@treasuredata/tdx 2026.5.1 → 2026.6.1

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 (236) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-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/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/table-deleted.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/tools/work-create-item.js +1 -1
  79. package/dist/mcp/utils.js +1 -1
  80. package/dist/proxy/claude-usage-tracker.js +1 -1
  81. package/dist/proxy/passthrough-server.js +1 -1
  82. package/dist/proxy/sse-usage-parser.js +1 -1
  83. package/dist/sdk/agent/agent-config.js +1 -1
  84. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  85. package/dist/sdk/agent/agent-yaml.js +1 -1
  86. package/dist/sdk/agent/test/evaluator.js +1 -1
  87. package/dist/sdk/agent/test/executor.js +1 -1
  88. package/dist/sdk/agent/test/index.js +1 -1
  89. package/dist/sdk/agent/test/output.js +1 -1
  90. package/dist/sdk/agent/test/parser.js +1 -1
  91. package/dist/sdk/agent/tool-target-registry.js +1 -1
  92. package/dist/sdk/api.js +1 -1
  93. package/dist/sdk/cas/cas-api-client.js +1 -1
  94. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  95. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  96. package/dist/sdk/cas/index.js +1 -1
  97. package/dist/sdk/cas/pull-workflow.js +1 -1
  98. package/dist/sdk/cas/push-workflow.js +1 -1
  99. package/dist/sdk/client/cdp-api-client.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.js +1 -1
  105. package/dist/sdk/client/llm-api-client.js +1 -1
  106. package/dist/sdk/client/oauth-refresh.js +1 -1
  107. package/dist/sdk/client/rate-limiter.js +1 -1
  108. package/dist/sdk/client/td-api-client.js +1 -1
  109. package/dist/sdk/client/trino-api-client.js +1 -1
  110. package/dist/sdk/client/workflow-client.js +1 -1
  111. package/dist/sdk/connection-validator.js +1 -1
  112. package/dist/sdk/connection.js +1 -1
  113. package/dist/sdk/delivery.js +1 -1
  114. package/dist/sdk/engage/campaign-pull.js +1 -1
  115. package/dist/sdk/engage/campaign-push.js +1 -1
  116. package/dist/sdk/engage/campaign-validator.js +1 -1
  117. package/dist/sdk/engage/campaign-yaml.js +1 -1
  118. package/dist/sdk/engage/template-pull.js +1 -1
  119. package/dist/sdk/engage/template-push.js +1 -1
  120. package/dist/sdk/engage/template-validator.js +1 -1
  121. package/dist/sdk/engage/template-yaml.js +1 -1
  122. package/dist/sdk/engage/types/campaign-def.js +1 -1
  123. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  124. package/dist/sdk/engage/types/template-schema.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.js +1 -1
  127. package/dist/sdk/index.js +1 -1
  128. package/dist/sdk/io/index.js +1 -1
  129. package/dist/sdk/io/node-filesystem.js +1 -1
  130. package/dist/sdk/job.js +1 -1
  131. package/dist/sdk/journey.js +1 -1
  132. package/dist/sdk/llm/chat-cache.js +1 -1
  133. package/dist/sdk/llm/index.js +1 -1
  134. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  135. package/dist/sdk/llm/model-factors.d.ts +8 -4
  136. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  137. package/dist/sdk/llm/model-factors.js +1 -1
  138. package/dist/sdk/llm/model-factors.js.map +1 -1
  139. package/dist/sdk/llm/user-settings.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/deleted-table-validation.js +1 -1
  143. package/dist/sdk/query/index.js +1 -1
  144. package/dist/sdk/query/sql-parser.js +1 -1
  145. package/dist/sdk/realtime.js +1 -1
  146. package/dist/sdk/schedule.js +1 -1
  147. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  148. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  150. package/dist/sdk/segment/fields-display.js +1 -1
  151. package/dist/sdk/segment/file-discovery.js +1 -1
  152. package/dist/sdk/segment/journey-utils.js +1 -1
  153. package/dist/sdk/segment/journey-validator.js +1 -1
  154. package/dist/sdk/segment/journey-yaml.js +1 -1
  155. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  156. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/pull-workflow.js +1 -1
  158. package/dist/sdk/segment/push-recovery.js +1 -1
  159. package/dist/sdk/segment/push-workflow.js +1 -1
  160. package/dist/sdk/segment/resolution-context.js +1 -1
  161. package/dist/sdk/segment/segment-path-parser.js +1 -1
  162. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  163. package/dist/sdk/segment/segment-validator.js +1 -1
  164. package/dist/sdk/segment/segment-validator.js.map +1 -1
  165. package/dist/sdk/segment/target-resolution.js +1 -1
  166. package/dist/sdk/segment/tdx-config.js +1 -1
  167. package/dist/sdk/segment/types/activation-schema.js +1 -1
  168. package/dist/sdk/segment/types/journey-def.js +1 -1
  169. package/dist/sdk/segment/types/journey-schema.js +1 -1
  170. package/dist/sdk/segment/types/segment-def.js +1 -1
  171. package/dist/sdk/segment/types/segment-schema.js +1 -1
  172. package/dist/sdk/segment/validate-files.js +1 -1
  173. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  174. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  175. package/dist/sdk/segment/yaml-validator.js +1 -1
  176. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  177. package/dist/sdk/segment.js +1 -1
  178. package/dist/sdk/types/cdp.d.ts +4 -3
  179. package/dist/sdk/types/cdp.d.ts.map +1 -1
  180. package/dist/sdk/types/index.js +1 -1
  181. package/dist/sdk/types/progress.js +1 -1
  182. package/dist/sdk/types/workspace.js +1 -1
  183. package/dist/sdk/user.js +1 -1
  184. package/dist/sdk/util/format-detector.js +1 -1
  185. package/dist/sdk/util/formatters.js +1 -1
  186. package/dist/sdk/util/index.js +1 -1
  187. package/dist/sdk/util/paginate.js +1 -1
  188. package/dist/sdk/util/tree-formatter.js +1 -1
  189. package/dist/sdk/workflow/archive-validation.js +1 -1
  190. package/dist/sdk/workflow/clone-workflow.js +1 -1
  191. package/dist/sdk/workflow/index.js +1 -1
  192. package/dist/sdk/workflow/pull-workflow.js +1 -1
  193. package/dist/sdk/workflow/push-workflow.js +1 -1
  194. package/dist/sdk/workflow/task-graph.js +1 -1
  195. package/dist/sdk/workflow/tdx-config.js +1 -1
  196. package/dist/sdk/workflow/workflow-utils.js +1 -1
  197. package/dist/sdk/workspace/access-tracker.js +1 -1
  198. package/dist/sdk/workspace/frontmatter.js +1 -1
  199. package/dist/sdk/workspace/git.js +1 -1
  200. package/dist/sdk/workspace/index.js +1 -1
  201. package/dist/sdk/workspace/templates.js +1 -1
  202. package/dist/sdk/workspace/weekly.js +1 -1
  203. package/dist/sdk/workspace/wikilinks.js +1 -1
  204. package/dist/test-utils/command-runner.js +1 -1
  205. package/dist/test-utils/factories.js +1 -1
  206. package/dist/test-utils/fixtures.js +1 -1
  207. package/dist/test-utils/http-mock.js +1 -1
  208. package/dist/test-utils/index.js +1 -1
  209. package/dist/utils/async.js +1 -1
  210. package/dist/utils/colors.js +1 -1
  211. package/dist/utils/diff.js +1 -1
  212. package/dist/utils/file-permissions.js +1 -1
  213. package/dist/utils/file-reader.js +1 -1
  214. package/dist/utils/github-releases.js +1 -1
  215. package/dist/utils/global-cache.js +1 -1
  216. package/dist/utils/json-loader.js +1 -1
  217. package/dist/utils/local-cache.js +1 -1
  218. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  219. package/dist/utils/logger/formatters/index.js +1 -1
  220. package/dist/utils/logger/handlers/console-handler.js +1 -1
  221. package/dist/utils/logger/handlers/file-handler.js +1 -1
  222. package/dist/utils/logger/handlers/index.js +1 -1
  223. package/dist/utils/logger/handlers/null-handler.js +1 -1
  224. package/dist/utils/logger/index.js +1 -1
  225. package/dist/utils/logger/logger.js +1 -1
  226. package/dist/utils/logger/types.js +1 -1
  227. package/dist/utils/option-validation.js +1 -1
  228. package/dist/utils/process.js +1 -1
  229. package/dist/utils/prompt.js +1 -1
  230. package/dist/utils/spinner.js +1 -1
  231. package/dist/utils/sse-parser.js +1 -1
  232. package/dist/utils/string-utils.js +1 -1
  233. package/dist/utils/table-ref-parser.js +1 -1
  234. package/dist/utils/tdx-logger.js +1 -1
  235. package/dist/utils/version-check.js +1 -1
  236. package/package.json +1 -1
@@ -1 +1 @@
1
- const a154_0x9fd4da=a154_0x1344;(function(_0xd623de,_0x1ef9c1){const _0x574b71=a154_0x1344,_0x375741=_0xd623de();while(!![]){try{const _0x22e5a3=parseInt(_0x574b71(0x1b5))/0x1*(-parseInt(_0x574b71(0x1b4))/0x2)+parseInt(_0x574b71(0x1bd))/0x3+-parseInt(_0x574b71(0x1ba))/0x4+parseInt(_0x574b71(0x1b0))/0x5*(parseInt(_0x574b71(0x1c1))/0x6)+-parseInt(_0x574b71(0x1c7))/0x7*(parseInt(_0x574b71(0x1c2))/0x8)+-parseInt(_0x574b71(0x1ae))/0x9+parseInt(_0x574b71(0x1b9))/0xa*(parseInt(_0x574b71(0x1ac))/0xb);if(_0x22e5a3===_0x1ef9c1)break;else _0x375741['push'](_0x375741['shift']());}catch(_0x279bfa){_0x375741['push'](_0x375741['shift']());}}}(a154_0x204d,0x38523));function a154_0x204d(){const _0x3a5255=['5dvZnSS','toISOString','join','code','2aTnJJf','415187qtStei','stringify','journeyName','warn','30tPzHXZ','777576hBLZhg','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','.tmp','1356708LYQqJp','segments','string','utf-8','1885854tEOjMd','483656FpzQqm','tdx.sdk.push-recovery','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','.push-recovery.json','dirname','7bQeRXY','version','debug','ENOENT','1094412cDhPnd','basename','1478628FacCbG','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'];a154_0x204d=function(){return _0x3a5255;};return a154_0x204d();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a154_0x24372b from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a154_0x9fd4da(0x1c3));export function getPushRecoveryPath(_0x550c27){const _0x597ce9=a154_0x9fd4da,_0x5de003=a154_0x24372b[_0x597ce9(0x1c6)](_0x550c27),_0x337f54=a154_0x24372b[_0x597ce9(0x1ad)](_0x550c27);return a154_0x24372b[_0x597ce9(0x1b2)](_0x5de003,'.'+_0x337f54+_0x597ce9(0x1c5));}export function readPushRecovery(_0x1a7331){const _0x1a04ac=a154_0x9fd4da,_0x28a867=getPushRecoveryPath(_0x1a7331);if(!existsSync(_0x28a867))return undefined;try{const _0x1c22b3=readFileSync(_0x28a867,_0x1a04ac(0x1c0)),_0x26d7f9=JSON['parse'](_0x1c22b3);if(_0x26d7f9?.[_0x1a04ac(0x1c8)]!==0x1||typeof _0x26d7f9['journeyName']!==_0x1a04ac(0x1bf))return undefined;return _0x26d7f9;}catch(_0x4f852a){return _0x4f852a instanceof SyntaxError?logger[_0x1a04ac(0x1c9)](_0x1a04ac(0x1af)+_0x4f852a):logger[_0x1a04ac(0x1b8)](_0x1a04ac(0x1c4)+_0x4f852a),undefined;}}export function writePushRecovery(_0x5a301d,_0x35d0f2){const _0x2d6821=a154_0x9fd4da,_0x29be9e=getPushRecoveryPath(_0x5a301d),_0x27072a=_0x29be9e+_0x2d6821(0x1bc);writeFileSync(_0x27072a,JSON[_0x2d6821(0x1b6)](_0x35d0f2,null,0x2)+'\x0a','utf-8'),renameSync(_0x27072a,_0x29be9e);}export function deletePushRecovery(_0x791029){const _0x1dec5f=a154_0x9fd4da,_0x2ff40c=getPushRecoveryPath(_0x791029);try{unlinkSync(_0x2ff40c);}catch(_0x5ea265){_0x5ea265[_0x1dec5f(0x1b3)]!==_0x1dec5f(0x1ab)&&logger[_0x1dec5f(0x1c9)](_0x1dec5f(0x1bb)+_0x5ea265);}}function a154_0x1344(_0x40ab70,_0x53a886){_0x40ab70=_0x40ab70-0x1ab;const _0x204d8d=a154_0x204d();let _0x1344a3=_0x204d8d[_0x40ab70];return _0x1344a3;}export function saveSegmentToPushRecovery(_0x321db4,_0x46972e,_0x2ef679,_0x1aa2b4){const _0x116a39=a154_0x9fd4da,_0x1b5e4d=readPushRecovery(_0x321db4),_0x3972c8=_0x1b5e4d?.[_0x116a39(0x1b7)]===_0x46972e?{..._0x1b5e4d,'updatedAt':new Date()[_0x116a39(0x1b1)]()}:{'version':0x1,'journeyName':_0x46972e,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x3972c8[_0x116a39(0x1be)][_0x2ef679]=_0x1aa2b4,writePushRecovery(_0x321db4,_0x3972c8);}
1
+ const a154_0x221ad0=a154_0x3378;(function(_0x5b25d6,_0x4d22e0){const _0x4ee4bc=a154_0x3378,_0x259bfd=_0x5b25d6();while(!![]){try{const _0x38a275=parseInt(_0x4ee4bc(0x154))/0x1*(parseInt(_0x4ee4bc(0x155))/0x2)+parseInt(_0x4ee4bc(0x144))/0x3+parseInt(_0x4ee4bc(0x140))/0x4*(parseInt(_0x4ee4bc(0x13f))/0x5)+-parseInt(_0x4ee4bc(0x14d))/0x6+-parseInt(_0x4ee4bc(0x143))/0x7+-parseInt(_0x4ee4bc(0x142))/0x8*(parseInt(_0x4ee4bc(0x159))/0x9)+parseInt(_0x4ee4bc(0x158))/0xa*(parseInt(_0x4ee4bc(0x151))/0xb);if(_0x38a275===_0x4d22e0)break;else _0x259bfd['push'](_0x259bfd['shift']());}catch(_0x1f4ec5){_0x259bfd['push'](_0x259bfd['shift']());}}}(a154_0x1bbe,0x353ed));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a154_0x51cd62 from'path';function a154_0x1bbe(){const _0x27e6d7=['70JYsUPS','ENOENT','parse','20FOBvRN','5661VZhPes','275vsmPEn','22676xWgkqH','string','1304JAcLhz','1497202xYHzZt','966138CcrnIY','.push-recovery.json','toISOString','code','.tmp','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','stringify','basename','journeyName','2324808bEVZHI','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','tdx.sdk.push-recovery','join','1292324FDrcYJ','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','version','1519apwdCN'];a154_0x1bbe=function(){return _0x27e6d7;};return a154_0x1bbe();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a154_0x221ad0(0x14f));function a154_0x3378(_0x1362f3,_0x4672b6){_0x1362f3=_0x1362f3-0x13f;const _0x1bbe52=a154_0x1bbe();let _0x3378dc=_0x1bbe52[_0x1362f3];return _0x3378dc;}export function getPushRecoveryPath(_0x6a190c){const _0x150efc=a154_0x221ad0,_0x543fd9=a154_0x51cd62['dirname'](_0x6a190c),_0x39be55=a154_0x51cd62[_0x150efc(0x14b)](_0x6a190c);return a154_0x51cd62[_0x150efc(0x150)](_0x543fd9,'.'+_0x39be55+_0x150efc(0x145));}export function readPushRecovery(_0x4efc80){const _0x1a46b1=a154_0x221ad0,_0x19d3c3=getPushRecoveryPath(_0x4efc80);if(!existsSync(_0x19d3c3))return undefined;try{const _0x89c309=readFileSync(_0x19d3c3,'utf-8'),_0x1ffd5f=JSON[_0x1a46b1(0x157)](_0x89c309);if(_0x1ffd5f?.[_0x1a46b1(0x153)]!==0x1||typeof _0x1ffd5f[_0x1a46b1(0x14c)]!==_0x1a46b1(0x141))return undefined;return _0x1ffd5f;}catch(_0x524d97){return _0x524d97 instanceof SyntaxError?logger['debug'](_0x1a46b1(0x149)+_0x524d97):logger['warn'](_0x1a46b1(0x152)+_0x524d97),undefined;}}export function writePushRecovery(_0x2a75d5,_0x4bba74){const _0x1a4230=a154_0x221ad0,_0x5b6f6f=getPushRecoveryPath(_0x2a75d5),_0x586ffb=_0x5b6f6f+_0x1a4230(0x148);writeFileSync(_0x586ffb,JSON[_0x1a4230(0x14a)](_0x4bba74,null,0x2)+'\x0a','utf-8'),renameSync(_0x586ffb,_0x5b6f6f);}export function deletePushRecovery(_0x40f894){const _0x195fad=a154_0x221ad0,_0x40cca7=getPushRecoveryPath(_0x40f894);try{unlinkSync(_0x40cca7);}catch(_0x1c3603){_0x1c3603[_0x195fad(0x147)]!==_0x195fad(0x156)&&logger['debug'](_0x195fad(0x14e)+_0x1c3603);}}export function saveSegmentToPushRecovery(_0x49d649,_0x2c966c,_0x1d0a3e,_0x1da33b){const _0xd61c17=a154_0x221ad0,_0x562a55=readPushRecovery(_0x49d649),_0x258526=_0x562a55?.[_0xd61c17(0x14c)]===_0x2c966c?{..._0x562a55,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x2c966c,'updatedAt':new Date()[_0xd61c17(0x146)](),'segments':{}};_0x258526['segments'][_0x1d0a3e]=_0x1da33b,writePushRecovery(_0x49d649,_0x258526);}
@@ -1 +1 @@
1
- const a155_0x30a951=a155_0x5a27;(function(_0x4fde03,_0x5836bc){const _0x5db042=a155_0x5a27,_0x2582f8=_0x4fde03();while(!![]){try{const _0x3b9d70=parseInt(_0x5db042(0x28f))/0x1+parseInt(_0x5db042(0x206))/0x2*(parseInt(_0x5db042(0x1cc))/0x3)+parseInt(_0x5db042(0x210))/0x4+parseInt(_0x5db042(0x20f))/0x5+-parseInt(_0x5db042(0x1bb))/0x6*(-parseInt(_0x5db042(0x1dc))/0x7)+parseInt(_0x5db042(0x281))/0x8+-parseInt(_0x5db042(0x1a9))/0x9;if(_0x3b9d70===_0x5836bc)break;else _0x2582f8['push'](_0x2582f8['shift']());}catch(_0x40303f){_0x2582f8['push'](_0x2582f8['shift']());}}}(a155_0x3980,0x29673));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x30a951(0x1ec));export const PENDING_SEGMENT_PREFIX=a155_0x30a951(0x29f);function a155_0x3980(){const _0x1b191a=['journey_created','skipSegments','resolveJourneyId','folderId','delete','milestone','withProgress','2370976TvtZQi','stages','createActivation','verbose','getSegment','Failed\x20to\x20fetch\x20referenced\x20segment\x20','folderPath','existingSegments','journey_updating','values','updated','activationContext','Creating\x20segment\x20\x27','reduce','229747YUuUVv','flatMap','split','Stage\x20\x27','stage\x20\x27','folder_created','connectionIdToNameMap','toISOString','journeyBundleName','Created\x20journey\x20\x27','activationStepsById','Entry\x20criteria:\x20','__pending_act_','toString','debug','match','__pending_','activation_template_id','run_after_journey_refresh','activation_','\x27\x20exit\x20criteria','behavior','columns','journeyById','11453130MVaGZq','Condition','Delete\x20the\x20push\x20recovery\x20file\x20(','getSegmentEntity\x20also\x20failed\x20for\x20','segment','connector_config','replace','Matched\x20server\x20segment\x20\x27','getSegmentEntity','uniqueSegmentName','entryCriteria','and\x20the\x20server\x20segment,\x20then\x20retry.','activation_updating','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','updateActivation','journeyBundlesByFolderAndName','from','\x20error(s)','915546rRRMsL','getJourney','embeddedSegmentNameToId','embedded_activation_creating','activationsBySegmentId','data','updateSegmentById','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','digest','JOURNEY_SYNTAX_ERROR','logDeleted','set','nameToType','embedded_segment_creating','resolvedRule','isArray','diff','3iPBsml','Segment\x20not\x20found','createdSegmentId','Updating\x20activation\x20\x27','logInfo','waitStep','idToEmailMap','parse','createFolder','getSegment\x20failed\x20for\x20','trim','journeyActivationNameToId','join','progress','unchanged','fetchJourney','7jUHedI','\x20(referenced\x20in\x20journey\x20','attributes','description','parentSegmentFolder','idToName','versionNumber','folder','ACTIVATION_SYNTAX_ERROR','keys','max','index','../../utils/async.js','\x20activation\x20\x27','localName','resolveSegment','tdx.sdk.push-workflow','exitCriterias','Name\x20has\x20already\x20been\x20taken','draft','push','toLowerCase','activationActions','length','get','sort','entries','startsWith','add','action','goal','Updated\x20journey\x20\x27','schedule','\x0a\x20\x20','\x27\x20for\x20','./journey-yaml.js','connection','filter','journeyId','all','segmentId','null','631586wjxCjC','conditionSegmentId','\x27\x20entry\x20criteria','name','effectiveFolderId','isNew','journey','\x27\x20decision\x20point\x20branch\x20\x27','type','1171710eMfGum','853248dMUndJ','deleted','user','ACTIVATION_UPDATE_ERROR','hasChanges','Failed\x20to\x20resolve\x20segment\x20','Updated\x20activation\x20\x27','Fetching\x20','hex','./child-segment-yaml.js','Created\x20segment\x20\x27','deps',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','some','branches','activation_created','rule','journeyStages','parentId','Failed\x20to\x20','yamlConfig','\x27...','journey_updated','find','folder_creating','buildUserMaps','waitStepUnit','createJourneySegment','\x27\x20wait\x20condition','segments','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Failed\x20to\x20resolve\x20activation\x20','embedded_segment_created','Duration','absolutePath','journeyActivationStepId','Activation\x20not\x20found:\x20','segmentByFolderAndName','journeyName','listActivations','activation_updated','has','onProgress','parseDocument','segmentFolderId','SEGMENT_UPDATE_ERROR','Creating\x20activation\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','segment_creating','utf-8','steps','slice','existingJourney','segmentNameToId','create','Deleting\x20activation\x20\x27','valid','segment_created','all_columns','uniqueServerName','stringify','Deleted\x20segment\x20\x27','results','logWarning','created','logSuccess','WaitStep','NOT_FOUND','Updated\x20segment\x20\x27','\x27\x20milestone','size','map','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','item','getActivation','activations','rootFolderId','conditionTimeoutUnit','SEGMENT_NOT_FOUND','entry','Updating\x20segment\x20\x27','conditions','journeys','\x27\x20from\x20file:\x20','kind','sha1','yamlActivation','relative','journey_entry_criteria_','Segment\x20not\x20found:\x20','update','DecisionPoint','state','deleteActivation','existingSegment','waitStepType','validatedRequest','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','entry_criteria','segment_deleted','Activation','INTERNAL','dirname','conditionTimeoutDuration','existingActivation'];a155_0x3980=function(){return _0x1b191a;};return a155_0x3980();}export const PENDING_ACTIVATION_PREFIX=a155_0x30a951(0x29b);export function createPendingSegmentId(_0x314e0a){return''+PENDING_SEGMENT_PREFIX+_0x314e0a+'__';}export function isPendingSegmentId(_0x3d18cc){const _0x178001=a155_0x30a951;return _0x3d18cc['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x3d18cc[_0x178001(0x1f7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1c35c8){const _0x43b0bc=a155_0x30a951;return _0x1c35c8[_0x43b0bc(0x1af)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4d6680){return''+PENDING_ACTIVATION_PREFIX+_0x4d6680+'__';}export function isPendingActivationId(_0x4037f4){const _0x4db08c=a155_0x30a951;return _0x4037f4[_0x4db08c(0x1f7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x21ace2){const _0x27068d=a155_0x30a951;return _0x21ace2[_0x27068d(0x1af)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x86a2e6,_0xf08637){const _0x56e036=a155_0x30a951,_0x4f5827=_0x86a2e6+'::'+(_0xf08637[_0x56e036(0x1d6)]()||_0x56e036(0x1ad)),_0x134def=createHash(_0x56e036(0x266))[_0x56e036(0x26b)](_0x4f5827)[_0x56e036(0x1c3)](_0x56e036(0x218))[_0x56e036(0x244)](0x0,0xc);return _0x56e036(0x269)+_0x134def;}export function ensureJourneyDefaults(_0x2f22ea){const _0x2286ed=a155_0x30a951;!_0x2f22ea[_0x2286ed(0x1df)]&&(_0x2f22ea[_0x2286ed(0x1df)]=''),!_0x2f22ea[_0x2286ed(0x26d)]&&(_0x2f22ea[_0x2286ed(0x26d)]=_0x2286ed(0x1ef));}export function injectExistingStageIds(_0x1e4dc4,_0x125b34){const _0x2372c4=a155_0x30a951,_0x20cb4b=new Map(_0x125b34[_0x2372c4(0x258)](_0x3082d4=>[_0x3082d4[_0x2372c4(0x209)],_0x3082d4['id']]));for(const _0x2bca89 of _0x1e4dc4){if(!_0x2bca89['id']){const _0x3087ab=_0x20cb4b[_0x2372c4(0x1f4)](_0x2bca89['name']);_0x3087ab&&(_0x2bca89['id']=_0x3087ab);}}}export function resolveTDFolderPath(_0x3d22c2,_0x4619c7,_0x45e2fb){const _0x1e5c2a=a155_0x30a951;if(!_0x4619c7)return _0x3d22c2;if(_0x3d22c2===_0x45e2fb||_0x3d22c2[_0x1e5c2a(0x1f7)](_0x45e2fb+'/'))return _0x3d22c2;return _0x3d22c2?_0x45e2fb+'/'+_0x3d22c2:_0x45e2fb;}export function addFoldersToCreate(_0x5679e2,_0x1009e4,_0x123d09){const _0x2245fa=a155_0x30a951;if(!_0x5679e2)return;if(_0x1009e4[_0x2245fa(0x239)](_0x5679e2))return;const _0x686b71=_0x5679e2[_0x2245fa(0x291)]('/');let _0x3249ee='';for(const _0x32ec82 of _0x686b71){_0x3249ee=_0x3249ee?_0x3249ee+'/'+_0x32ec82:_0x32ec82,!_0x1009e4[_0x2245fa(0x239)](_0x3249ee)&&_0x123d09['add'](_0x3249ee);}}export function sortFoldersByDepth(_0x532bb3){const _0x3bf5fd=a155_0x30a951;return[..._0x532bb3][_0x3bf5fd(0x1f5)]((_0x2129db,_0x3d7b5f)=>{const _0xe53c89=_0x3bf5fd,_0x1a6549=(_0x2129db[_0xe53c89(0x29e)](/\//g)||[])[_0xe53c89(0x1f3)],_0x458445=(_0x3d7b5f[_0xe53c89(0x29e)](/\//g)||[])[_0xe53c89(0x1f3)];return _0x1a6549-_0x458445;});}import*as a155_0x26d673 from'yaml';import{readFileSync}from'fs';import a155_0x5c2d81 from'path';import{isJourneyDef,parseYamlString as a155_0x14fa23,toYamlString as a155_0x199b9e,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x494c4c){const _0x356020=a155_0x30a951;if(Array[_0x356020(0x1ca)](_0x494c4c))return'['+_0x494c4c[_0x356020(0x258)](_0x38f83c=>stableStringify(_0x38f83c))[_0x356020(0x1d8)](',')+']';if(_0x494c4c&&typeof _0x494c4c==='object'){const _0x45266c=_0x494c4c,_0x347ee5=Object['keys'](_0x45266c)[_0x356020(0x1f5)](),_0x4e1030=_0x347ee5[_0x356020(0x258)](_0x4e8a24=>'\x22'+_0x4e8a24+'\x22:'+stableStringify(_0x45266c[_0x4e8a24]));return'{'+_0x4e1030['join'](',')+'}';}const _0x1dc8fe=JSON[_0x356020(0x24d)](_0x494c4c);return _0x1dc8fe===undefined?_0x356020(0x205):_0x1dc8fe;}function activationSignature(_0x3bffed){const _0x10fe79=a155_0x30a951,_0x292c94={'connection':_0x3bffed[_0x10fe79(0x200)],..._0x3bffed[_0x10fe79(0x24b)]!==undefined&&{'all_columns':_0x3bffed[_0x10fe79(0x24b)]},..._0x3bffed[_0x10fe79(0x1a7)]!==undefined&&{'columns':_0x3bffed['columns']},..._0x3bffed[_0x10fe79(0x2a4)]!==undefined&&{'behavior':_0x3bffed[_0x10fe79(0x2a4)]},..._0x3bffed[_0x10fe79(0x1fc)]!==undefined&&{'schedule':_0x3bffed['schedule']},..._0x3bffed['notification']!==undefined&&{'notification':_0x3bffed['notification']},..._0x3bffed[_0x10fe79(0x1ae)]!==undefined&&{'connector_config':_0x3bffed[_0x10fe79(0x1ae)]},..._0x3bffed['activation_template_id']!==undefined&&{'activation_template_id':_0x3bffed[_0x10fe79(0x2a0)]}};return stableStringify(_0x292c94);}async function fetchSegment(_0x4c3ff8,_0x1332fc,_0x55b62e,_0x2b1363){const _0x2c1aa1=a155_0x30a951,_0x1205be=_0x2b1363?.[_0x2c1aa1(0x227)](_0x1a6b93=>_0x1a6b93['id']===_0x55b62e);if(_0x1205be)return _0x1205be;try{return await _0x4c3ff8['segment'][_0x2c1aa1(0x285)](_0x1332fc,_0x55b62e);}catch(_0x4c7e7c){logger[_0x2c1aa1(0x29d)](_0x2c1aa1(0x1d5)+_0x55b62e+_0x2c1aa1(0x21c)+_0x4c7e7c);try{return await _0x4c3ff8[_0x2c1aa1(0x1ad)][_0x2c1aa1(0x1b1)](_0x55b62e);}catch(_0x572c3f){return logger[_0x2c1aa1(0x29d)](_0x2c1aa1(0x1ac)+_0x55b62e+':\x20'+_0x572c3f),null;}}}function recoverSegmentIdsFromPushRecovery(_0x13ade3,_0x3d88c7,_0x514641){const _0x1555a8=a155_0x30a951,_0x4da611=readPushRecovery(_0x13ade3['absolutePath']);if(_0x4da611?.[_0x1555a8(0x236)]===_0x13ade3[_0x1555a8(0x224)][_0x1555a8(0x209)])for(const [_0x289088,_0x2bc384]of Object['entries'](_0x4da611[_0x1555a8(0x22d)])){const _0x4cdc89=generateDeterministicJourneySegmentName(_0x13ade3[_0x1555a8(0x224)][_0x1555a8(0x209)],_0x289088);_0x2bc384[_0x1555a8(0x24c)]===_0x4cdc89&&(_0x3d88c7[_0x1555a8(0x1c6)](_0x289088,_0x2bc384[_0x1555a8(0x204)]),_0x514641[_0x1555a8(0x1c6)](_0x289088,_0x2bc384['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x504ecf,_0x5b37a7,_0x32571e,_0x3443e7){const _0x9df7de=a155_0x30a951;let _0x5319ec;try{_0x5319ec=await _0x504ecf[_0x9df7de(0x1ad)][_0x9df7de(0x22b)]({'name':_0x32571e[_0x9df7de(0x1b2)],'description':_0x32571e[_0x9df7de(0x1df)],'journeyId':_0x32571e[_0x9df7de(0x202)],'rule':_0x3443e7(_0x32571e[_0x9df7de(0x1c9)],!![]),'countPopulation':!![],'parentFolderId':_0x32571e[_0x9df7de(0x27d)],'audienceId':_0x32571e[_0x9df7de(0x222)]});}catch(_0x16a1b2){const _0x1dd958=_0x16a1b2 instanceof Error&&_0x16a1b2['message']['includes'](_0x9df7de(0x1ee));if(_0x1dd958){const _0x2e0b50=readPushRecovery(_0x5b37a7[_0x9df7de(0x232)]),_0x154df6=_0x2e0b50?.[_0x9df7de(0x236)]===_0x5b37a7['yamlConfig'][_0x9df7de(0x209)]?_0x2e0b50[_0x9df7de(0x22d)][_0x32571e[_0x9df7de(0x1ea)]]:undefined;if(_0x154df6?.[_0x9df7de(0x24c)]===_0x32571e[_0x9df7de(0x1b2)])await _0x504ecf['segment'][_0x9df7de(0x1c1)](_0x32571e[_0x9df7de(0x222)],_0x154df6['segmentId'],{'description':_0x32571e[_0x9df7de(0x1df)],'rule':_0x3443e7(_0x32571e[_0x9df7de(0x1c9)],!![]),'countPopulation':!![]}),_0x5319ec=_0x154df6[_0x9df7de(0x204)];else throw new SDKError(ErrorCode[_0x9df7de(0x23d)],'Embedded\x20segment\x20\x27'+_0x32571e['localName']+_0x9df7de(0x272)+(_0x9df7de(0x1ab)+_0x5b37a7[_0x9df7de(0x232)][_0x9df7de(0x1af)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x9df7de(0x1b4),_0x16a1b2);}else throw _0x16a1b2;}return saveSegmentToPushRecovery(_0x5b37a7[_0x9df7de(0x232)],_0x5b37a7['yamlConfig'][_0x9df7de(0x209)],_0x32571e['localName'],{'segmentId':_0x5319ec,'uniqueServerName':_0x32571e[_0x9df7de(0x1b2)],'createdAt':new Date()[_0x9df7de(0x296)]()}),_0x5319ec;}export async function prepareSegmentFiles(_0x3a52dd,_0xe5541f,_0x1a17e7,_0x455a47,_0xe9479d){const _0x505477=a155_0x30a951,{activationDefToCreateRequest:_0x5ffc62}=await import(_0x505477(0x219)),_0xefd141=[],_0x2ea80b=new Set();for(const {yamlConfig:_0x462832,folderPath:_0x350ef6,sourcePath:_0x33dbbc}of _0x3a52dd){const _0x10606b=resolveTDFolderPath(_0x350ef6,_0x455a47,_0xe9479d),_0x1f5bc1=_0x10606b+':'+_0x462832[_0x505477(0x209)],_0x5c89a0=_0xe5541f[_0x505477(0x235)][_0x505477(0x1f4)](_0x1f5bc1),_0x28936c=_0x5c89a0?_0xe5541f[_0x505477(0x1bf)][_0x505477(0x1f4)](_0x5c89a0['id'])||[]:[];addFoldersToCreate(_0x10606b,_0xe5541f['folderPathToId'],_0x2ea80b);const _0x5e1f55=calculateActivationActions(_0x462832['activations']||[],_0x28936c,_0xe5541f[_0x505477(0x1d2)],_0xe5541f[_0x505477(0x295)]);for(const _0x1312b8 of _0x5e1f55){(_0x1312b8['type']==='create'||_0x1312b8[_0x505477(0x20e)]===_0x505477(0x26b))&&_0x1312b8[_0x505477(0x267)]&&(_0x1312b8[_0x505477(0x271)]=await _0x5ffc62(_0x1312b8[_0x505477(0x267)],_0x1a17e7));}const _0xe0ab0d=calculateSegmentDiff(_0x462832,_0x5c89a0,_0x28936c,_0xe5541f[_0x505477(0x1d2)],_0xe5541f[_0x505477(0x295)]);_0xefd141[_0x505477(0x1f0)]({'relativePath':_0x462832['name'],'absolutePath':_0x33dbbc,'yamlConfig':_0x462832,'folderPath':_0x10606b,'existingSegment':_0x5c89a0,'existingActivations':_0x28936c,'isNew':_0xe0ab0d[_0x505477(0x20b)],'hasChanges':_0xe0ab0d[_0x505477(0x214)],'diff':_0xe0ab0d['diff'],'activationActions':_0x5e1f55});}return{'segmentFiles':_0xefd141,'foldersToCreate':_0x2ea80b};}export async function prepareJourneyFiles(_0x5905a7,_0x346cec,_0x2a4c51,_0x30aa0b){const _0x2f1115=a155_0x30a951,_0x5a5b38=[],_0x5dd846=new Set();for(const {yamlConfig:_0xe0a2df,folderPath:_0x9fad6f,sourcePath:_0x30d97c}of _0x5905a7){const _0x4850c9=resolveTDFolderPath(_0x9fad6f,_0x2a4c51,_0x30aa0b),_0x226241=_0x4850c9+':'+_0xe0a2df[_0x2f1115(0x209)],_0x2a6719=_0x346cec[_0x2f1115(0x1b8)][_0x2f1115(0x1f4)](_0x226241);let _0x3ec71a,_0x3ac0de;if(_0x2a6719&&_0x2a6719[_0x2f1115(0x1f3)]>0x0){const _0x451269=buildLocalExpandedRuleMappings(_0xe0a2df),{createYamlContext:_0x1e3786,prefetchJourneySegments:_0x4bfaef}=createPushYamlContextForBundle(_0x346cec[_0x2f1115(0x21b)],_0x346cec[_0x2f1115(0x222)],_0x346cec[_0x2f1115(0x288)],_0x451269,_0x346cec[_0x2f1115(0x1d2)],_0x346cec[_0x2f1115(0x295)],_0x346cec[_0x2f1115(0x299)],_0x346cec[_0x2f1115(0x1a8)]);await _0x4bfaef(_0x2a6719[_0x2f1115(0x258)](_0x53b051=>_0x53b051['id']));const _0x589858=await _0x346cec[_0x2f1115(0x21b)][_0x2f1115(0x20c)]['getLatestJourneyId'](_0x2a6719[0x0]['journeyBundleId']),_0x3e29bb=hasMultipleVersions(_0xe0a2df),_0x3ffe7d=async _0x42a18e=>{const _0x551eb0=_0x2f1115,_0x28f69a=_0x346cec[_0x551eb0(0x1a8)]?.[_0x551eb0(0x1f4)](_0x42a18e);if(_0x28f69a)return _0x28f69a;return _0x346cec[_0x551eb0(0x1db)]({'journeyId':_0x42a18e,'journeyName':_0xe0a2df[_0x551eb0(0x209)],'isMultiVersion':_0x2a6719[_0x551eb0(0x1f3)]>0x1});};if(_0x3e29bb&&_0x2a6719['length']>0x1){const _0x2ed059=[];for(const _0x303e2b of _0x2a6719){const _0x321b76=_0x303e2b[_0x2f1115(0x1e2)]||0x1;_0x346cec[_0x2f1115(0x1d9)]?.['update'](_0x2f1115(0x217)+_0xe0a2df[_0x2f1115(0x209)]+'\x20v'+_0x321b76);const _0x1de52c=await _0x3ffe7d(_0x303e2b['id']),_0x3b69a5=_0x1e3786(_0x303e2b['id']),_0xf2ff3b=await journeyResponseToDef(_0x1de52c,_0x3b69a5);_0x2ed059['push']({'item':_0x303e2b,'yaml':_0xf2ff3b});}const _0x1f2953=buildLocalRuleToNameMappingFromJourney(_0xe0a2df);_0x3ac0de=buildMergedJourneyDef(_0x2ed059,_0x1f2953,_0x589858);const _0x5ce3b5=Math[_0x2f1115(0x1e6)](..._0x2ed059[_0x2f1115(0x258)](_0x178d88=>_0x178d88[_0x2f1115(0x25a)][_0x2f1115(0x1e2)]||0x0)),_0x54210f=_0x2a6719[_0x2f1115(0x227)](_0x15da65=>(_0x15da65[_0x2f1115(0x1e2)]||0x0)===_0x5ce3b5);_0x54210f&&(_0x346cec[_0x2f1115(0x1d9)]?.[_0x2f1115(0x26b)]('Fetching\x20'+_0xe0a2df[_0x2f1115(0x209)]+'\x20v'+_0x5ce3b5),_0x3ec71a=await _0x3ffe7d(_0x54210f['id']));}else{const _0x28c914=_0x2a6719[_0x2a6719[_0x2f1115(0x1f3)]-0x1];_0x346cec[_0x2f1115(0x1d9)]?.[_0x2f1115(0x26b)](_0x2f1115(0x217)+_0xe0a2df[_0x2f1115(0x209)]),_0x3ec71a=await _0x3ffe7d(_0x28c914['id']);const _0x2a44be=_0x1e3786(_0x28c914['id']),_0x574644=await journeyResponseToDef(_0x3ec71a,_0x2a44be),_0x18c5a5=buildLocalRuleToNameMappingFromJourney(_0xe0a2df);_0x3ac0de=buildMergedJourneyDef([{'item':_0x28c914,'yaml':_0x574644}],_0x18c5a5,_0x589858);}}addFoldersToCreate(_0x4850c9,_0x346cec['folderPathToId'],_0x5dd846);const _0x57aed4=calculateJourneyDiff(_0xe0a2df,_0x3ac0de);_0x5a5b38[_0x2f1115(0x1f0)]({'relativePath':_0xe0a2df['name'],'absolutePath':_0x30d97c,'yamlConfig':_0xe0a2df,'folderPath':_0x4850c9,'existingJourney':_0x3ec71a,'isNew':_0x57aed4[_0x2f1115(0x20b)],'hasChanges':_0x57aed4[_0x2f1115(0x214)],'diff':_0x57aed4[_0x2f1115(0x1cb)]});}return{'journeyFiles':_0x5a5b38,'foldersToCreate':_0x5dd846};}export function calculateActivationActions(_0x296a78,_0x5c5a68,_0x1a604f,_0x12b47f){const _0x1488b7=a155_0x30a951,_0x2e7373=[],_0x2ee0f7=new Map();for(const _0xcaf8a0 of _0x5c5a68){_0x2ee0f7['set'](_0xcaf8a0[_0x1488b7(0x209)],_0xcaf8a0);}const _0x1939cf=new Map();for(const _0x561084 of _0x296a78){_0x1939cf['set'](_0x561084['name'],_0x561084);}for(const _0x4245b2 of _0x296a78){const _0x1366e4=_0x2ee0f7[_0x1488b7(0x1f4)](_0x4245b2[_0x1488b7(0x209)]);if(!_0x1366e4)_0x2e7373[_0x1488b7(0x1f0)]({'type':_0x1488b7(0x247),'name':_0x4245b2[_0x1488b7(0x209)],'yamlActivation':_0x4245b2});else{const _0x12d676=activationResponseToDef(_0x1366e4,_0x1a604f,_0x12b47f),_0xfae057=a155_0x26d673['stringify'](_0x12d676),_0x1fb6d1=a155_0x26d673[_0x1488b7(0x24d)](_0x4245b2);_0xfae057!==_0x1fb6d1&&_0x2e7373[_0x1488b7(0x1f0)]({'type':_0x1488b7(0x26b),'name':_0x4245b2[_0x1488b7(0x209)],'yamlActivation':_0x4245b2,'existingActivation':_0x1366e4});}}for(const _0x344318 of _0x5c5a68){!_0x1939cf[_0x1488b7(0x239)](_0x344318[_0x1488b7(0x209)])&&_0x2e7373[_0x1488b7(0x1f0)]({'type':_0x1488b7(0x27e),'name':_0x344318['name'],'existingActivation':_0x344318});}return _0x2e7373;}function calculateYamlDiff(_0x35326f,_0x7f27eb){if(_0x7f27eb){const _0x4e6fd5=generateDiff(_0x7f27eb,_0x35326f),_0x22d593=hasChanges(_0x4e6fd5);return{'isNew':![],'hasChanges':_0x22d593,'diff':_0x22d593?formatDiffWithColors(_0x4e6fd5):undefined};}const _0x32cc53=generateDiff('',_0x35326f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x32cc53)};}export function calculateSegmentDiff(_0x5cee25,_0x43f445,_0x1f180f,_0x14d468,_0x261723){const _0xa5c577=segmentToYamlString(_0x5cee25),_0x3b716d=_0x43f445?segmentToYamlString(segmentWithActivationsToYaml(_0x43f445,_0x1f180f,undefined,_0x14d468,_0x261723)):undefined;return calculateYamlDiff(_0xa5c577,_0x3b716d);}export function calculateJourneyDiff(_0x42bb7b,_0xc3e7ef){const _0x453f29=normalizeJourneyDef(_0x42bb7b,_0x42bb7b),_0x366313=a155_0x199b9e(_0x453f29),_0x19ab07=_0xc3e7ef?a155_0x199b9e(normalizeJourneyDef(_0xc3e7ef,_0x42bb7b)):undefined;return calculateYamlDiff(_0x366313,_0x19ab07);}export function findSegmentsToDelete(_0x5c712b,_0x8eb1ce,_0x50d95b,_0x27498c,_0xe40d91){const _0x14eb4c=a155_0x30a951,_0x385ef2=new Set();for(const {yamlConfig:_0x70532f,folderPath:_0x317389}of _0x8eb1ce){_0x385ef2[_0x14eb4c(0x1f8)](_0x317389+':'+_0x70532f[_0x14eb4c(0x209)]);}return _0x5c712b[_0x14eb4c(0x201)](_0x5845c0=>{const _0x2fc024=_0x14eb4c,_0x420d61=_0x5845c0[_0x2fc024(0x23c)]?_0x50d95b['get'](_0x5845c0[_0x2fc024(0x23c)][_0x2fc024(0x29c)]())||'':'',_0x35797f=_0x420d61+':'+_0x5845c0[_0x2fc024(0x209)];if(_0x385ef2['has'](_0x35797f))return![];if(_0xe40d91)return _0x420d61===_0x27498c||_0x420d61[_0x2fc024(0x1f7)](_0x27498c+'/');return!![];});}export function findJourneysToDelete(_0x2a0c88,_0x54134b,_0x34c627,_0x3b0b1b,_0x5dcfd6){const _0x41e763=a155_0x30a951,_0x5a35c1=new Set();for(const {yamlConfig:_0x47d8e5,folderPath:_0x1765a}of _0x54134b){_0x5a35c1[_0x41e763(0x1f8)](_0x1765a+':'+_0x47d8e5[_0x41e763(0x209)]);}return _0x2a0c88[_0x41e763(0x201)](_0x5c0c52=>{const _0x3a9737=_0x41e763,_0x5c62a6=_0x5c0c52[_0x3a9737(0x27d)]?_0x34c627[_0x3a9737(0x1f4)](_0x5c0c52[_0x3a9737(0x27d)])||'':'',_0xa243a1=_0x5c62a6+':'+_0x5c0c52[_0x3a9737(0x297)];if(_0x5a35c1[_0x3a9737(0x239)](_0xa243a1))return![];if(_0x5dcfd6)return _0x5c62a6===_0x3b0b1b||_0x5c62a6['startsWith'](_0x3b0b1b+'/');return!![];});}export function buildSegmentLookupMap(_0x1aabfc,_0x57781a){const _0x16304f=a155_0x30a951,_0x3f1a1a=new Map();for(const _0x567ba9 of _0x1aabfc){const _0x205b50=_0x567ba9[_0x16304f(0x23c)]?_0x57781a[_0x16304f(0x1f4)](_0x567ba9['segmentFolderId']['toString']())||'':'',_0x2fe43d=_0x205b50+':'+_0x567ba9[_0x16304f(0x209)];_0x3f1a1a[_0x16304f(0x1c6)](_0x2fe43d,_0x567ba9);}return _0x3f1a1a;}export function buildSegmentNameToIdMap(_0xd3ed8b){const _0x245562=new Map();for(const _0x5e167e of _0xd3ed8b){_0x245562['set'](_0x5e167e['name'],_0x5e167e['id']);}return _0x245562;}export function buildJourneyBundleLookupMap(_0x2b378f,_0x3effc4){const _0x38ecc3=a155_0x30a951,_0x4254ff=new Map();for(const _0x557959 of _0x2b378f){const _0x4a8f2f=_0x557959['folderId']?_0x3effc4['get'](_0x557959['folderId'])||'':'',_0x2e4509=_0x4a8f2f+':'+_0x557959[_0x38ecc3(0x297)];!_0x4254ff['has'](_0x2e4509)&&_0x4254ff[_0x38ecc3(0x1c6)](_0x2e4509,[]),_0x4254ff[_0x38ecc3(0x1f4)](_0x2e4509)[_0x38ecc3(0x1f0)](_0x557959);}for(const _0x43138b of _0x4254ff[_0x38ecc3(0x28a)]()){_0x43138b[_0x38ecc3(0x1f5)]((_0x93d793,_0xbe97bd)=>(_0x93d793[_0x38ecc3(0x1e2)]||0x0)-(_0xbe97bd[_0x38ecc3(0x1e2)]||0x0));}return _0x4254ff;}export function collectFoldersToCreate(_0x271ea7,_0x38d553){const _0x3a8754=a155_0x30a951,_0x57afbb=new Set();for(const _0x742766 of _0x271ea7){if(!_0x742766)continue;if(_0x38d553['has'](_0x742766))continue;const _0x24f471=_0x742766[_0x3a8754(0x291)]('/');let _0x21d326='';for(const _0x5e742a of _0x24f471){_0x21d326=_0x21d326?_0x21d326+'/'+_0x5e742a:_0x5e742a,!_0x38d553['has'](_0x21d326)&&_0x57afbb[_0x3a8754(0x1f8)](_0x21d326);}}return _0x57afbb;}export function parseAndClassifyYamlFiles(_0x61982e,_0x23ccd4,_0x1c1e06){const _0x5d2371=a155_0x30a951,_0x55a1d0=[],_0x2053d4=[];for(const _0xa2e2c1 of _0x61982e){const _0x26dd2d=a155_0x5c2d81[_0x5d2371(0x268)](_0x23ccd4,a155_0x5c2d81[_0x5d2371(0x277)](_0xa2e2c1)),_0x2a5257=_0x26dd2d==='.'?'':_0x26dd2d['replace'](/\\/g,'/'),_0x46d4a4=readFileSync(_0xa2e2c1,_0x5d2371(0x242)),_0x14be99=a155_0x26d673['parse'](_0x46d4a4);if(isJourneyDef(_0x14be99)){const _0x1e10f9=a155_0x14fa23(_0x46d4a4);_0x2053d4['push']({'yamlConfig':_0x1e10f9,'folderPath':_0x2a5257,'sourcePath':_0xa2e2c1});}else{if(!_0x1c1e06?.[_0x5d2371(0x27b)]){const _0x13e29e=parseSegmentYamlFile(_0x46d4a4),_0x5a3f80=normalizeChildSegmentYaml(_0x13e29e);_0x55a1d0[_0x5d2371(0x1f0)]({'yamlConfig':_0x5a3f80,'folderPath':_0x2a5257,'sourcePath':_0xa2e2c1});}}}return{'segments':_0x55a1d0,'journeys':_0x2053d4};}export function validateParsedFiles(_0x28d123,_0x44f5a5){const _0x5776cc=a155_0x30a951,_0x10869f=[];for(const {yamlConfig:_0x73105e,sourcePath:_0x2338ce}of _0x28d123[_0x5776cc(0x22d)]){const _0x3dbd9d=readFileSync(_0x2338ce,_0x5776cc(0x242)),_0x594fc0=a155_0x26d673['parseDocument'](_0x3dbd9d),_0x14c895=validateSegmentDef(_0x73105e,{'source':_0x3dbd9d,'document':_0x594fc0},{'skipSchema':!![]});if(!_0x14c895[_0x5776cc(0x249)]){const _0x422e80=a155_0x5c2d81[_0x5776cc(0x268)](_0x44f5a5,_0x2338ce);_0x10869f[_0x5776cc(0x1f0)]({'filePath':_0x422e80,'source':_0x3dbd9d,'result':_0x14c895,'isJourney':![]});}}for(const {yamlConfig:_0x3a7dc4,sourcePath:_0x53f6c8}of _0x28d123[_0x5776cc(0x263)]){const _0x405784=readFileSync(_0x53f6c8,'utf-8'),_0x41d9b0=a155_0x26d673[_0x5776cc(0x23b)](_0x405784),_0x5de613=validateJourneyDef(_0x3a7dc4,{'source':_0x405784,'document':_0x41d9b0},{'skipSchema':!![]});if(!_0x5de613[_0x5776cc(0x249)]){const _0x535fd5=a155_0x5c2d81[_0x5776cc(0x268)](_0x44f5a5,_0x53f6c8);_0x10869f['push']({'filePath':_0x535fd5,'source':_0x405784,'result':_0x5de613,'isJourney':!![]});}}return _0x10869f;}export function formatValidationErrors(_0x32d7d1){const _0x16493d=a155_0x30a951,_0x41b6af=[];for(const {filePath:_0x4206a0,source:_0x2b3457,result:_0x55be1b,isJourney:_0x256e03}of _0x32d7d1){const _0x23d309=_0x256e03?_0x16493d(0x20c):_0x16493d(0x1ad);_0x41b6af['push']('\x0a'+_0x4206a0+'\x20('+_0x23d309+'):\x20'+_0x55be1b['errors'][_0x16493d(0x1f3)]+_0x16493d(0x1ba)),_0x41b6af[_0x16493d(0x1f0)](formatValidationResult(_0x55be1b,_0x2b3457,_0x4206a0));}return _0x41b6af[_0x16493d(0x1d8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x480fda){const _0xce09ab=a155_0x30a951,_0x2fc49d=new Set(),_0xee31e1=new Map(),_0x168523=collectSegmentUsageCounts(_0x480fda);if(_0x480fda['segments'])for(const [_0x3c0d50,_0x1dadd6]of Object[_0xce09ab(0x1f6)](_0x480fda['segments'])){_0x2fc49d['add'](_0x3c0d50);if(_0x1dadd6[_0xce09ab(0x220)]){const _0x598a48=yamlRuleToApi(_0x1dadd6[_0xce09ab(0x220)]),_0x363d2c=apiRuleToYaml(_0x598a48);_0xee31e1[_0xce09ab(0x1c6)](_0x3c0d50,_0x363d2c);}}const _0x263a97=new Map();let _0x551675=0x0;for(const [_0x59ba40,_0x15b9e4]of _0xee31e1){const _0x5e3888=serializeExpandedRule(_0x15b9e4,_0xee31e1),_0x140385=_0x263a97[_0xce09ab(0x1f4)](_0x5e3888)||[];_0x140385[_0xce09ab(0x1f0)]({'name':_0x59ba40,'index':_0x551675}),_0x263a97['set'](_0x5e3888,_0x140385),_0x551675++;}const _0x122ca7=new Map();for(const [_0x15cf24,_0x5ded23]of _0x263a97){const _0x43bd98=_0x5ded23['slice']()['sort']((_0x206335,_0x35256a)=>{const _0x5d4267=_0xce09ab,_0x548191=_0x168523[_0x5d4267(0x1f4)](_0x206335[_0x5d4267(0x209)])||0x0,_0x500e98=_0x168523[_0x5d4267(0x1f4)](_0x35256a[_0x5d4267(0x209)])||0x0;if(_0x548191!==_0x500e98)return _0x500e98-_0x548191;return _0x206335[_0x5d4267(0x1e7)]-_0x35256a[_0x5d4267(0x1e7)];})[_0xce09ab(0x258)](_0x55dcd3=>_0x55dcd3['name']),_0x3e6f67=[];for(const _0x5e639d of _0x43bd98){const _0x362eaf=_0x168523[_0xce09ab(0x1f4)](_0x5e639d)||0x0,_0x226065=Math[_0xce09ab(0x1e6)](_0x362eaf,0x1);for(let _0x37d093=0x0;_0x37d093<_0x226065;_0x37d093++){_0x3e6f67[_0xce09ab(0x1f0)](_0x5e639d);}}_0x122ca7[_0xce09ab(0x1c6)](_0x15cf24,_0x3e6f67);}return{'existingLocalSegmentNames':_0x2fc49d,'localSegmentRules':_0xee31e1,'localExpandedRuleToNames':_0x122ca7};}export function createSegmentIdResolver(_0x1424fc,_0x328da8){return async _0x1d5515=>{const _0x1f57bf=a155_0x5a27,_0x29c039=_0x1424fc[_0x1f57bf(0x1f4)](_0x1d5515);if(!_0x29c039)throw new SDKError(ErrorCode[_0x1f57bf(0x25f)],_0x1f57bf(0x26a)+_0x1d5515+_0x1f57bf(0x259)+_0x328da8+'\x27)');return _0x29c039;};}export function extractRootFolderId(_0x2cdd54){const _0x512709=a155_0x30a951;return _0x2cdd54['relationships']?.[_0x512709(0x1e0)]?.[_0x512709(0x1c0)]?.['id']||_0x2cdd54['relationships']?.['parentFolder']?.[_0x512709(0x1c0)]?.['id'];}export function buildConnectionMaps(_0x2ea047){const _0x1a4b7c=a155_0x30a951,_0x2a4c29=new Map(),_0x25b62a=new Map(),_0x144f6d=new Map();for(const _0x185443 of _0x2ea047){_0x2a4c29[_0x1a4b7c(0x1c6)](_0x185443[_0x1a4b7c(0x209)],parseInt(_0x185443['id'],0xa)),_0x25b62a[_0x1a4b7c(0x1c6)](_0x185443['id'],_0x185443['name']),_0x144f6d[_0x1a4b7c(0x1c6)](_0x185443[_0x1a4b7c(0x209)],_0x185443[_0x1a4b7c(0x20e)]);}return{'nameToId':_0x2a4c29,'idToName':_0x25b62a,'nameToType':_0x144f6d};}export function calculatePushStats(_0x4163b1,_0x3483c1,_0x17d9d0,_0x249eb0,_0x3a83c3,_0x507d75,_0x19cdce){const _0x18a67d=a155_0x30a951,_0x55f89b=_0x4163b1[_0x18a67d(0x201)](_0x55cc9e=>_0x55cc9e[_0x18a67d(0x20b)]),_0xb4fa16=_0x4163b1[_0x18a67d(0x201)](_0x22e1c0=>!_0x22e1c0[_0x18a67d(0x20b)]&&_0x22e1c0[_0x18a67d(0x214)]),_0x44b4ec=_0x4163b1[_0x18a67d(0x201)](_0x438b11=>!_0x438b11[_0x18a67d(0x20b)]&&!_0x438b11[_0x18a67d(0x214)]),_0x326eec=_0x507d75?_0x249eb0:[],_0x265adb=_0x3483c1[_0x18a67d(0x201)](_0x402f33=>_0x402f33['isNew']),_0x2b1cb6=_0x3483c1[_0x18a67d(0x201)](_0xb47688=>!_0xb47688[_0x18a67d(0x20b)]&&_0xb47688[_0x18a67d(0x214)]),_0x3f150b=_0x3483c1[_0x18a67d(0x201)](_0x2b8340=>!_0x2b8340['isNew']&&!_0x2b8340[_0x18a67d(0x214)]),_0x53fc17=_0x507d75?_0x3a83c3:[],_0x17dd4c=_0x4163b1[_0x18a67d(0x290)](_0x5a94d8=>_0x5a94d8['activationActions']),_0x5b74e4=_0x17dd4c[_0x18a67d(0x201)](_0x3a7ce1=>_0x3a7ce1[_0x18a67d(0x20e)]==='create'),_0x12c56c=_0x17dd4c[_0x18a67d(0x201)](_0x514ec1=>_0x514ec1['type']==='update'),_0x178dd7=_0x17dd4c['filter'](_0x2b73c0=>_0x2b73c0[_0x18a67d(0x20e)]===_0x18a67d(0x27e)),_0x94fd69=Array[_0x18a67d(0x1b9)](_0x17d9d0)[_0x18a67d(0x1f5)](),_0x594db3=_0x19cdce?![]:_0x55f89b[_0x18a67d(0x1f3)]>0x0||_0xb4fa16[_0x18a67d(0x1f3)]>0x0||_0x326eec[_0x18a67d(0x1f3)]>0x0,_0x1c59c2=_0x265adb[_0x18a67d(0x1f3)]>0x0||_0x2b1cb6[_0x18a67d(0x1f3)]>0x0||_0x53fc17[_0x18a67d(0x1f3)]>0x0,_0x338627=_0x19cdce?![]:_0x17dd4c[_0x18a67d(0x1f3)]>0x0,_0x2f5365=_0x94fd69['length']>0x0;return{'segments':{'new':_0x55f89b,'changed':_0xb4fa16,'unchanged':_0x44b4ec,'toDelete':_0x326eec},'journeys':{'new':_0x265adb,'changed':_0x2b1cb6,'unchanged':_0x3f150b,'toDelete':_0x53fc17},'activations':{'all':_0x17dd4c,'toCreate':_0x5b74e4,'toUpdate':_0x12c56c,'toDelete':_0x178dd7},'folders':{'toCreate':_0x94fd69},'counts':{'segments':{'new':_0x55f89b[_0x18a67d(0x1f3)],'changed':_0xb4fa16[_0x18a67d(0x1f3)],'unchanged':_0x44b4ec[_0x18a67d(0x1f3)],'toDelete':_0x326eec[_0x18a67d(0x1f3)]},'journeys':{'new':_0x265adb[_0x18a67d(0x1f3)],'changed':_0x2b1cb6[_0x18a67d(0x1f3)],'unchanged':_0x3f150b[_0x18a67d(0x1f3)],'toDelete':_0x53fc17[_0x18a67d(0x1f3)]},'activations':{'create':_0x5b74e4['length'],'update':_0x12c56c[_0x18a67d(0x1f3)],'delete':_0x178dd7[_0x18a67d(0x1f3)]},'folders':_0x94fd69[_0x18a67d(0x1f3)]},'hasChanges':_0x594db3||_0x1c59c2||_0x338627||_0x2f5365};}export async function buildPushExecutionContext(_0x1912d2,_0x3ec2ae,_0x5f4cc7,_0x1406c9,_0x2a55c7,_0x15fb24){const _0x1992ac=a155_0x30a951,_0x57d5d7=extractRootFolderId(_0x5f4cc7),{pathToId:_0x50d80,idToPath:_0x4ad1ab}=buildFolderMaps(_0x2a55c7),_0x2c705f=buildSegmentNameToIdMap(_0x1406c9),_0x2226c1=new Map(),{batchAsync:_0x47dc6a}=await import('../../utils/async.js'),[_0x288fc9,_0x376b20]=await Promise[_0x1992ac(0x203)]([_0x1912d2[_0x1992ac(0x212)][_0x1992ac(0x229)](),_0x1912d2[_0x1992ac(0x200)]['list'](),((async()=>{const _0xdd2e54=_0x1992ac;!_0x15fb24&&_0x1406c9[_0xdd2e54(0x1f3)]>0x0&&await _0x47dc6a(_0x1406c9,async _0x3c491a=>{const _0x14382f=_0xdd2e54,_0x40b266=await _0x1912d2[_0x14382f(0x1ad)][_0x14382f(0x237)](_0x3ec2ae,_0x3c491a['id']);_0x2226c1['set'](_0x3c491a['id'],_0x40b266);});})())]),{emailToId:_0x505f27,idToEmail:_0x28253b}=_0x288fc9,_0x2806b7=buildConnectionMaps(_0x376b20);return{'rootFolderId':_0x57d5d7,'folderPathToId':_0x50d80,'folderIdToPath':_0x4ad1ab,'segmentNameToId':_0x2c705f,'activationsBySegmentId':_0x2226c1,'emailToIdMap':_0x505f27,'idToEmailMap':_0x28253b,'connectionNameToIdMap':_0x2806b7['nameToId'],'connectionIdToNameMap':_0x2806b7[_0x1992ac(0x1e1)],'connectionNameToTypeMap':_0x2806b7[_0x1992ac(0x1c7)]};}export function createPushYamlContextForBundle(_0x58c851,_0x101285,_0x4b5ede,_0x447b74,_0x4f56b4,_0x135b79,_0x1dee95,_0x7d8acc){const {existingLocalSegmentNames:_0x34634d,localExpandedRuleToNames:_0x379bf4}=_0x447b74,_0x40328d=new Set(),_0x1fac3c=new Map(),_0x30383b=new Map(),_0x310ef1=new Map(),_0x234bee=createJumpTargetCache(),_0x5f25f4=new Map(),_0x46e953=new Map(),_0x1c3eec=new Set();let _0xb49b60;const _0x584f5a=_0x8198cf=>{const _0x1eef90={'resolveSegment':async _0x3ad0fa=>{const _0x378f26=a155_0x5a27,_0x1ec674=_0x310ef1[_0x378f26(0x1f4)](_0x3ad0fa);if(_0x1ec674!==undefined)return{'name':_0x1ec674,'isJourneyLocal':!![]};try{const _0x2ac564=await fetchSegment(_0x58c851,_0x101285,_0x3ad0fa,_0x4b5ede);if(!_0x2ac564)throw new Error(_0x378f26(0x1cd));const _0x38fc3a=generateJourneyLocalName(_0x2ac564[_0x378f26(0x209)]),_0x2ec9bc=_0x2ac564[_0x378f26(0x265)]===SEGMENT_KIND_JOURNEY&&_0x38fc3a!==undefined;let _0x323653=_0x2ac564['name'],_0x1c7fe3;if(_0x2ec9bc&&_0x2ac564[_0x378f26(0x220)]){const _0x97b95b=apiRuleToYaml(_0x2ac564[_0x378f26(0x220)]);_0x46e953[_0x378f26(0x1c6)](_0x3ad0fa,_0x97b95b);const _0xcfd213=async _0x2de0f2=>{const _0x673db0=_0x378f26,_0x4d01f5=collectSegmentRefsFromRule(_0x2de0f2);for(const _0x231b23 of _0x4d01f5){if(!_0x46e953['has'](_0x231b23))try{const _0x12c66a=await fetchSegment(_0x58c851,_0x101285,_0x231b23,_0x4b5ede);if(_0x12c66a?.[_0x673db0(0x220)]){const _0x49f7a1=apiRuleToYaml(_0x12c66a[_0x673db0(0x220)]);_0x46e953[_0x673db0(0x1c6)](_0x231b23,_0x49f7a1),await _0xcfd213(_0x49f7a1);}}catch(_0x54a6f8){logger['debug'](_0x673db0(0x286)+_0x231b23+':\x20'+_0x54a6f8);}}};await _0xcfd213(_0x97b95b);const _0x4cb20f=serializeExpandedRule(_0x97b95b,_0x46e953),_0x53fef8=_0x379bf4[_0x378f26(0x1f4)](_0x4cb20f);if(_0x53fef8&&_0x53fef8['length']>0x0){const _0x54480e=_0x1fac3c[_0x378f26(0x1f4)](_0x4cb20f)||0x0,_0x1325e3=_0x53fef8[_0x54480e]||_0x53fef8[_0x53fef8[_0x378f26(0x1f3)]-0x1];_0x1fac3c[_0x378f26(0x1c6)](_0x4cb20f,_0x54480e+0x1),_0x323653=_0x1325e3,_0x40328d['add'](_0x323653),_0x310ef1['set'](_0x3ad0fa,_0x323653);const _0x334e68=await resolveRuleSegmentRefs(_0x97b95b,async _0xa2dfd7=>{const _0x1b6998=_0x378f26,_0x21fe08=_0x310ef1[_0x1b6998(0x1f4)](_0xa2dfd7);if(_0x21fe08)return _0x21fe08;const _0x3b25c0=await _0xb49b60[_0x1b6998(0x1eb)](_0xa2dfd7);return _0x3b25c0[_0x1b6998(0x209)];});_0x1c7fe3={'description':_0x2ac564[_0x378f26(0x1df)],'rule':_0x334e68};}else{const _0x2d6c6e=_0x5f25f4['get'](_0x4cb20f);if(_0x2d6c6e)_0x323653=_0x2d6c6e,_0x310ef1[_0x378f26(0x1c6)](_0x3ad0fa,_0x323653);else{if(_0x38fc3a){let _0x465a3b=_0x38fc3a,_0x5bff49=0x2;while(_0x40328d[_0x378f26(0x239)](_0x465a3b)||_0x34634d[_0x378f26(0x239)](_0x465a3b)){_0x465a3b=_0x38fc3a+'_'+_0x5bff49,_0x5bff49++;}_0x40328d[_0x378f26(0x1f8)](_0x465a3b),_0x323653=_0x465a3b;}_0x310ef1[_0x378f26(0x1c6)](_0x3ad0fa,_0x323653),_0x5f25f4[_0x378f26(0x1c6)](_0x4cb20f,_0x323653);const _0x1d02f8=await resolveRuleSegmentRefs(_0x97b95b,async _0x337b99=>{const _0x5b31bd=_0x378f26,_0x5715c8=_0x310ef1[_0x5b31bd(0x1f4)](_0x337b99);if(_0x5715c8)return _0x5715c8;const _0x3cbc8d=await _0xb49b60[_0x5b31bd(0x1eb)](_0x337b99);return _0x3cbc8d[_0x5b31bd(0x209)];});_0x1c7fe3={'description':_0x2ac564[_0x378f26(0x1df)],'rule':_0x1d02f8};}}}return{'name':_0x323653,'isJourneyLocal':_0x2ec9bc,'definition':_0x1c7fe3};}catch(_0x4e7e03){return logger[_0x378f26(0x29d)](_0x378f26(0x215)+_0x3ad0fa+':\x20'+_0x4e7e03),{'name':_0x3ad0fa,'isJourneyLocal':![]};}},'resolveActivation':async _0x1b0f15=>{const _0x116ffe=a155_0x5a27,_0x3e281d=_0x30383b[_0x116ffe(0x1f4)](_0x1b0f15);if(_0x3e281d!==undefined)return{'name':_0x3e281d,'isJourneyLocal':!![]};try{let _0x2e1e99=_0x1dee95?.[_0x116ffe(0x1f4)](_0x1b0f15);!_0x2e1e99&&(_0x2e1e99=await _0x58c851[_0x116ffe(0x20c)][_0x116ffe(0x25b)](_0x8198cf,_0x1b0f15));const _0x411438=_0x2e1e99[_0x116ffe(0x1de)]['activationParams'][_0x116ffe(0x209)]||_0x1b0f15,_0x25787b=sanitizeYamlKey(_0x411438)||_0x116ffe(0x2a2)+_0x1b0f15,_0x29ca0e=_0x25787b;_0x30383b[_0x116ffe(0x1c6)](_0x1b0f15,_0x29ca0e);const _0x1421f2=journeyActivationStepToYaml(_0x2e1e99,_0x4f56b4,_0x135b79);return{'name':_0x29ca0e,'isJourneyLocal':!![],'definition':_0x1421f2};}catch(_0x1ad89f){return logger['debug'](_0x116ffe(0x22f)+_0x1b0f15+':\x20'+_0x1ad89f),{'name':_0x1b0f15,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x17bd48,_0x5ccd78)=>resolveJumpTarget(_0x17bd48,_0x5ccd78,_0x234bee,async _0x142a10=>{const _0x2b0aa0=a155_0x5a27,_0x26a15f=_0x7d8acc?.[_0x2b0aa0(0x1f4)](_0x142a10);if(_0x26a15f)return _0x26a15f;return _0x58c851['journey'][_0x2b0aa0(0x1bc)](_0x142a10);})};return _0xb49b60=_0x1eef90,_0x1eef90;},_0x27d3b7=async _0x3a859b=>{const _0x2a3e38=a155_0x5a27,{collectSegmentIdsFromJourneyApi:_0x3b3c7d}=await import('./journey-yaml.js'),{batchAsync:_0x249fd1}=await import('../../utils/async.js'),_0x104dfb=new Set();for(const _0x43ce48 of _0x3a859b){let _0x609c86=_0x7d8acc?.[_0x2a3e38(0x1f4)](_0x43ce48);!_0x609c86&&(_0x609c86=await _0x58c851[_0x2a3e38(0x20c)][_0x2a3e38(0x1bc)](_0x43ce48));const _0x37e1c5=_0x3b3c7d(_0x609c86);for(const _0x479343 of _0x37e1c5){_0x104dfb[_0x2a3e38(0x1f8)](_0x479343);}}let _0xe470ec=Array[_0x2a3e38(0x1b9)](_0x104dfb);while(_0xe470ec[_0x2a3e38(0x1f3)]>0x0){const _0x378a84=_0xe470ec[_0x2a3e38(0x201)](_0x5c65f3=>!_0x1c3eec[_0x2a3e38(0x239)](_0x5c65f3));if(_0x378a84['length']===0x0)break;const _0xe68200=await _0x249fd1(_0x378a84,async _0x211a4c=>{const _0x2a6006=_0x2a3e38;_0x1c3eec[_0x2a6006(0x1f8)](_0x211a4c);const _0x14f78e=await fetchSegment(_0x58c851,_0x101285,_0x211a4c,_0x4b5ede);if(!_0x14f78e)return null;return{'segmentId':_0x211a4c,'segment':_0x14f78e};},0xa),_0x2cf4c3=new Set();for(const _0x1cbb23 of _0xe68200){if(!_0x1cbb23?.[_0x2a3e38(0x1ad)]?.[_0x2a3e38(0x220)])continue;const _0xa56bae=apiRuleToYaml(_0x1cbb23[_0x2a3e38(0x1ad)]['rule']);_0x46e953[_0x2a3e38(0x1c6)](_0x1cbb23['segmentId'],_0xa56bae);const _0x59033f=collectSegmentRefsFromRule(_0xa56bae);for(const _0x49fa89 of _0x59033f){!_0x1c3eec[_0x2a3e38(0x239)](_0x49fa89)&&_0x2cf4c3['add'](_0x49fa89);}}_0xe470ec=Array['from'](_0x2cf4c3);}};return{'createYamlContext':_0x584f5a,'prefetchJourneySegments':_0x27d3b7};}export async function executePushSegments(_0x392f19,_0x2fa742,_0x3d4a4b,_0x140cd3,_0x36dcc7){const _0x298424=a155_0x30a951,{segmentDefToCreateRequest:_0x341219,segmentDefToUpdateRequest:_0xb2113f}=await import('./child-segment-yaml.js'),_0x49fea9=_0x3d4a4b['folderPathToId'],_0x486266=0x5,_0x2a3af3=async _0x42571a=>{const _0xe20a3b=a155_0x5a27,_0x4790c4=_0x42571a[_0xe20a3b(0x287)]?_0x49fea9[_0xe20a3b(0x1f4)](_0x42571a[_0xe20a3b(0x287)]):undefined;let _0x25efbd;const _0x496c5a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x26ebd5=_0x42571a[_0xe20a3b(0x224)];if(_0x42571a['yamlConfig']['rule']){const _0x327e38=createSegmentIdResolver(_0x3d4a4b[_0xe20a3b(0x246)],_0x42571a['yamlConfig']['name']),_0x33184a=await resolveRuleSegmentIds(_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x220)],_0x327e38);_0x26ebd5={..._0x42571a[_0xe20a3b(0x224)],'rule':_0x33184a};}try{if(_0x42571a[_0xe20a3b(0x20b)]){_0x36dcc7[_0xe20a3b(0x23a)]?.({'type':_0xe20a3b(0x241),'name':_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]});const _0x5db0e1=_0x341219(_0x26ebd5,_0x4790c4),_0x56ff9c=await _0x36dcc7[_0xe20a3b(0x280)](_0xe20a3b(0x28d)+_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]+'\x27...',()=>_0x392f19[_0xe20a3b(0x1ad)]['createSegment'](_0x140cd3[_0xe20a3b(0x222)],_0x5db0e1));_0x25efbd=_0x56ff9c[_0xe20a3b(0x1c0)]['id'],_0x3d4a4b['segmentNameToId']['set'](_0x42571a[_0xe20a3b(0x224)]['name'],_0x25efbd),_0x496c5a[_0xe20a3b(0x1ce)]={'name':_0x42571a['yamlConfig']['name'],'id':_0x25efbd},_0x36dcc7[_0xe20a3b(0x23a)]?.({'type':_0xe20a3b(0x24a),'name':_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)],'segmentId':_0x25efbd}),_0x36dcc7[_0xe20a3b(0x252)]?.(_0xe20a3b(0x21a)+_0x42571a[_0xe20a3b(0x224)]['name']+'\x27'),_0x496c5a['created']=0x1;}else{if(_0x42571a[_0xe20a3b(0x214)]){_0x36dcc7['onProgress']?.({'type':'segment_updating','name':_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]});const _0x5c41cf=_0xb2113f(_0x26ebd5);_0x4790c4!==_0x42571a['existingSegment']?.[_0xe20a3b(0x23c)]&&(_0x5c41cf[_0xe20a3b(0x23c)]=_0x4790c4?parseInt(_0x4790c4,0xa):undefined),await _0x36dcc7[_0xe20a3b(0x280)](_0xe20a3b(0x261)+_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]+_0xe20a3b(0x225),()=>_0x392f19[_0xe20a3b(0x1ad)]['updateSegmentById'](_0x140cd3[_0xe20a3b(0x222)],_0x42571a['existingSegment']['id'],_0x5c41cf)),_0x25efbd=_0x42571a[_0xe20a3b(0x26f)]['id'],_0x36dcc7[_0xe20a3b(0x23a)]?.({'type':'segment_updated','name':_0x42571a['yamlConfig']['name']}),_0x36dcc7[_0xe20a3b(0x252)]?.(_0xe20a3b(0x255)+_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)]+'\x27'),_0x496c5a[_0xe20a3b(0x28b)]=0x1;}else _0x25efbd=_0x42571a['existingSegment']['id'];}}catch(_0x9a8db7){const _0x5ef2a9=isHttp400Error(_0x9a8db7),_0x25ba25=_0x5ef2a9?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0xe20a3b(0x23d)],_0x558942=getErrorMessage(_0x9a8db7);throw new SDKError(_0x25ba25,'Failed\x20to\x20'+(_0x42571a['isNew']?_0xe20a3b(0x247):_0xe20a3b(0x26b))+'\x20segment\x20from\x20file:\x20'+_0x42571a[_0xe20a3b(0x232)]+_0xe20a3b(0x1fd)+_0x558942,_0x9a8db7);}try{const _0x4f245b=await syncActivationsForSegment(_0x392f19,_0x140cd3[_0xe20a3b(0x222)],_0x25efbd,_0x42571a[_0xe20a3b(0x224)][_0xe20a3b(0x209)],_0x42571a[_0xe20a3b(0x1f2)],_0x36dcc7,_0x42571a[_0xe20a3b(0x232)]);_0x496c5a[_0xe20a3b(0x25c)]=_0x4f245b;}catch(_0x5cbdc9){if(_0x5cbdc9 instanceof SDKError)throw _0x5cbdc9;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xe20a3b(0x240)+_0x42571a['yamlConfig']['name']+_0xe20a3b(0x264)+_0x42571a[_0xe20a3b(0x232)]+'\x0a\x20\x20'+getErrorMessage(_0x5cbdc9),_0x5cbdc9);}return _0x496c5a;},_0x4a3bd6=await batchAsync(_0x2fa742,_0x2a3af3,_0x486266),_0x30f68c={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x55851e of _0x4a3bd6){_0x30f68c[_0x298424(0x251)]+=_0x55851e[_0x298424(0x251)],_0x30f68c[_0x298424(0x28b)]+=_0x55851e[_0x298424(0x28b)],_0x55851e['createdSegmentId']&&_0x30f68c['createdSegmentIds'][_0x298424(0x1c6)](_0x55851e[_0x298424(0x1ce)][_0x298424(0x209)],_0x55851e[_0x298424(0x1ce)]['id']),_0x30f68c[_0x298424(0x25c)][_0x298424(0x251)]+=_0x55851e['activations'][_0x298424(0x251)],_0x30f68c[_0x298424(0x25c)][_0x298424(0x28b)]+=_0x55851e[_0x298424(0x25c)][_0x298424(0x28b)],_0x30f68c[_0x298424(0x25c)]['deleted']+=_0x55851e[_0x298424(0x25c)][_0x298424(0x211)];}return _0x30f68c;}function a155_0x5a27(_0x39a59a,_0x2add34){_0x39a59a=_0x39a59a-0x1a7;const _0x3980d1=a155_0x3980();let _0x5a2743=_0x3980d1[_0x39a59a];return _0x5a2743;}async function syncActivationsForSegment(_0x5cb661,_0x371d5e,_0x4c51ea,_0x44cbc3,_0x10018c,_0x410917,_0x10dfd6){const _0x402f17=a155_0x30a951,_0x22a2ab={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x381e97 of _0x10018c){try{if(_0x381e97['type']===_0x402f17(0x247)&&_0x381e97[_0x402f17(0x271)])_0x410917[_0x402f17(0x23a)]?.({'type':'activation_creating','segmentName':_0x44cbc3,'activationName':_0x381e97['name']}),await _0x410917['withProgress'](_0x402f17(0x23e)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x225),()=>_0x5cb661[_0x402f17(0x1ad)]['createActivation'](_0x371d5e,_0x4c51ea,_0x381e97[_0x402f17(0x271)])),_0x410917[_0x402f17(0x23a)]?.({'type':_0x402f17(0x21f),'segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),_0x410917['logSuccess']?.('Created\x20activation\x20\x27'+_0x381e97[_0x402f17(0x209)]+'\x27'),_0x22a2ab[_0x402f17(0x251)]++;else{if(_0x381e97[_0x402f17(0x20e)]===_0x402f17(0x26b)&&_0x381e97[_0x402f17(0x271)]&&_0x381e97[_0x402f17(0x279)])_0x410917[_0x402f17(0x23a)]?.({'type':_0x402f17(0x1b5),'segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),await _0x410917[_0x402f17(0x280)](_0x402f17(0x1cf)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x225),()=>_0x5cb661[_0x402f17(0x1ad)][_0x402f17(0x1b7)](_0x371d5e,_0x4c51ea,_0x381e97[_0x402f17(0x279)]['id'],_0x381e97['validatedRequest'])),_0x410917[_0x402f17(0x23a)]?.({'type':_0x402f17(0x238),'segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),_0x410917[_0x402f17(0x252)]?.(_0x402f17(0x216)+_0x381e97[_0x402f17(0x209)]+'\x27'),_0x22a2ab['updated']++;else _0x381e97[_0x402f17(0x20e)]==='delete'&&_0x381e97[_0x402f17(0x279)]&&(_0x410917[_0x402f17(0x23a)]?.({'type':'activation_deleting','segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),await _0x410917[_0x402f17(0x280)](_0x402f17(0x248)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x225),()=>_0x5cb661[_0x402f17(0x1ad)][_0x402f17(0x26e)](_0x371d5e,_0x4c51ea,_0x381e97[_0x402f17(0x279)]['id'])),_0x410917[_0x402f17(0x23a)]?.({'type':'activation_deleted','segmentName':_0x44cbc3,'activationName':_0x381e97[_0x402f17(0x209)]}),_0x410917[_0x402f17(0x1c5)]?.('Deleted\x20activation\x20\x27'+_0x381e97[_0x402f17(0x209)]+'\x27'),_0x22a2ab['deleted']++);}}catch(_0x397d1f){const _0x475ca0=isHttp400Error(_0x397d1f),_0x1cdfeb=_0x475ca0?ErrorCode[_0x402f17(0x1e4)]:ErrorCode[_0x402f17(0x213)],_0x5ae28c=getErrorMessage(_0x397d1f);throw new SDKError(_0x1cdfeb,_0x402f17(0x223)+_0x381e97[_0x402f17(0x20e)]+_0x402f17(0x1e9)+_0x381e97[_0x402f17(0x209)]+_0x402f17(0x264)+_0x10dfd6+_0x402f17(0x1fd)+_0x5ae28c,_0x397d1f);}}return _0x22a2ab;}export async function executePushFolders(_0x4496be,_0x3880ff,_0x4d25ee,_0x429eb9,_0x43fe72){const _0x4f9d5f=a155_0x30a951,_0x20e16b=new Map(_0x4d25ee),_0x4c63f2=sortFoldersByDepth(_0x3880ff);for(const _0x2e9ce6 of _0x4c63f2){const _0x42ea2a=_0x2e9ce6['split']('/'),_0x4bb413=_0x42ea2a[_0x42ea2a[_0x4f9d5f(0x1f3)]-0x1],_0x5d0640=_0x42ea2a[_0x4f9d5f(0x244)](0x0,-0x1)[_0x4f9d5f(0x1d8)]('/'),_0x5522cf=_0x20e16b['get'](_0x5d0640);_0x43fe72[_0x4f9d5f(0x23a)]?.({'type':_0x4f9d5f(0x228),'folder':_0x2e9ce6});const _0x4dc66f={'name':_0x4bb413,'parentFolderId':_0x5522cf},_0x2370c5=await _0x43fe72[_0x4f9d5f(0x280)]('Creating\x20folder\x20\x27'+_0x2e9ce6+'\x27...',()=>_0x4496be['segment'][_0x4f9d5f(0x1d4)](_0x429eb9[_0x4f9d5f(0x222)],_0x4dc66f));_0x20e16b[_0x4f9d5f(0x1c6)](_0x2e9ce6,_0x2370c5['data']['id']),_0x43fe72[_0x4f9d5f(0x23a)]?.({'type':_0x4f9d5f(0x294),'folder':_0x2e9ce6,'folderId':_0x2370c5[_0x4f9d5f(0x1c0)]['id']}),_0x43fe72[_0x4f9d5f(0x1d0)]?.('Created\x20folder\x20\x27'+_0x2e9ce6+'\x27');}return _0x20e16b;}export async function executePushSegmentDeletions(_0x1c8c06,_0x2d1b2a,_0x336b63){const _0x85cfdf=a155_0x30a951;if(_0x2d1b2a[_0x85cfdf(0x1f3)]===0x0)return 0x0;const {batchAsync:_0x229dee}=await import(_0x85cfdf(0x1e8)),_0x55dd9e=0x5,_0x4af6e7=await _0x229dee(_0x2d1b2a,async _0x4b0a29=>{const _0x2c8d0c=_0x85cfdf;return _0x336b63['onProgress']?.({'type':'segment_deleting','name':_0x4b0a29[_0x2c8d0c(0x209)]}),await _0x1c8c06['segment']['deleteSegment'](_0x4b0a29['id']),_0x336b63['onProgress']?.({'type':_0x2c8d0c(0x274),'name':_0x4b0a29['name']}),_0x336b63[_0x2c8d0c(0x1c5)]?.(_0x2c8d0c(0x24e)+_0x4b0a29[_0x2c8d0c(0x209)]+'\x27'),0x1;},_0x55dd9e);return _0x4af6e7[_0x85cfdf(0x28e)]((_0x31b865,_0x1e2738)=>_0x31b865+_0x1e2738,0x0);}export async function executePushJourneys(_0x24ece2,_0x55c2f4,_0x47cee6,_0x5800fa,_0x53eaa6){const _0x4d1dbb=a155_0x30a951,{journeyDefToRequest:_0x48c34f}=await import(_0x4d1dbb(0x1ff)),{activationDefToCreateRequest:_0xec6691,yamlRuleToApi:_0x32e45f,validateSegmentRule:_0x282158}=await import(_0x4d1dbb(0x219)),_0xcf905a={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5709de=new Map(_0x47cee6['segmentNameToId']),_0x26e218=0x5;for(let _0x4c1268=0x0;_0x4c1268<_0x55c2f4[_0x4d1dbb(0x1f3)];_0x4c1268+=_0x26e218){const _0x435cdf=_0x55c2f4[_0x4d1dbb(0x244)](_0x4c1268,_0x4c1268+_0x26e218),_0x41ff75=await Promise[_0x4d1dbb(0x203)](_0x435cdf[_0x4d1dbb(0x258)](async _0x4084ee=>{const _0x48d778=_0x4d1dbb;if(!_0x4084ee[_0x48d778(0x20b)]&&!_0x4084ee['hasChanges'])return{'action':_0x48d778(0x1da),'name':_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)],'journeyId':_0x4084ee[_0x48d778(0x245)]?.['id']};const _0x2b22f9=_0x4084ee[_0x48d778(0x287)]?_0x47cee6['folderPathToId'][_0x48d778(0x1f4)](_0x4084ee[_0x48d778(0x287)]):undefined;_0x53eaa6[_0x48d778(0x23a)]?.({'type':_0x4084ee[_0x48d778(0x20b)]?'journey_creating':_0x48d778(0x289),'name':_0x4084ee['yamlConfig'][_0x48d778(0x209)]});try{const _0x7efbf0=await executeSingleJourneyPush(_0x24ece2,_0x4084ee,{..._0x47cee6,'segmentNameToId':_0x5709de},{'parentId':_0x5800fa['parentId'],'rootFolderId':_0x5800fa[_0x48d778(0x25d)],'folderId':_0x2b22f9,'verbose':_0x5800fa[_0x48d778(0x284)]},_0x53eaa6,{'journeyDefToRequest':_0x48c34f,'activationDefToCreateRequest':_0xec6691,'yamlRuleToApi':_0x32e45f,'validateSegmentRule':_0x282158});for(const [_0x5c5149,_0x3ca315]of _0x7efbf0[_0x48d778(0x1bd)]){_0x5709de['set'](_0x5c5149,_0x3ca315),_0xcf905a['embeddedSegmentNameToId']['set'](_0x5c5149,_0x3ca315);}if(_0x7efbf0['action']===_0x48d778(0x251))_0x53eaa6['onProgress']?.({'type':_0x48d778(0x27a),'name':_0x4084ee['yamlConfig'][_0x48d778(0x209)],'journeyId':_0x7efbf0[_0x48d778(0x202)]}),_0x53eaa6['logSuccess']?.(_0x48d778(0x298)+_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)]+'\x27'),_0xcf905a[_0x48d778(0x251)]++;else _0x7efbf0[_0x48d778(0x1f9)]==='updated'&&(_0x53eaa6[_0x48d778(0x23a)]?.({'type':_0x48d778(0x226),'name':_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)]}),_0x53eaa6['logSuccess']?.(_0x48d778(0x1fb)+_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)]+'\x27'),_0xcf905a[_0x48d778(0x28b)]++);return{'action':_0x7efbf0[_0x48d778(0x1f9)],'name':_0x4084ee[_0x48d778(0x224)][_0x48d778(0x209)],'journeyId':_0x7efbf0[_0x48d778(0x202)]};}catch(_0x35af52){const _0x3a3a0e=isHttp400Error(_0x35af52),_0x14dad8=_0x3a3a0e?ErrorCode[_0x48d778(0x1c4)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x477375=getErrorMessage(_0x35af52);throw new SDKError(_0x14dad8,_0x48d778(0x223)+(_0x4084ee['isNew']?_0x48d778(0x247):_0x48d778(0x26b))+'\x20journey\x20from\x20file:\x20'+_0x4084ee[_0x48d778(0x232)]+_0x48d778(0x1fd)+_0x477375,_0x35af52);}}));_0xcf905a[_0x4d1dbb(0x24f)][_0x4d1dbb(0x1f0)](..._0x41ff75);}return _0xcf905a;}async function matchExistingJourneySegments(_0x5b0dc9,_0x480294,_0x5a6bbe,_0xf40760,_0x3fa737){const _0x44ce30=a155_0x30a951;if(!_0x480294[_0x44ce30(0x245)]||!_0x480294[_0x44ce30(0x224)][_0x44ce30(0x22d)])return;const _0xcbb380=new Map(),_0x564295=new Set();for(const _0x5a0566 of Object[_0x44ce30(0x1e5)](_0x480294[_0x44ce30(0x224)]['segments'])){const _0xd5e7b3=generateDeterministicJourneySegmentName(_0x480294[_0x44ce30(0x224)][_0x44ce30(0x209)],_0x5a0566);_0xcbb380[_0x44ce30(0x1c6)](_0xd5e7b3,_0x5a0566),_0x564295[_0x44ce30(0x1f8)](_0x5a0566);}const _0x20dc84=[],_0x3100b9=collectSegmentIdsFromJourneyApi(_0x480294['existingJourney']);for(const _0x5709a0 of _0x3100b9){const _0x1cee9f=await fetchSegment(_0x5b0dc9,_0x5a6bbe,_0x5709a0,_0xf40760);if(!_0x1cee9f?.[_0x44ce30(0x209)])continue;const _0x4e8355=_0xcbb380[_0x44ce30(0x1f4)](_0x1cee9f[_0x44ce30(0x209)]);_0x4e8355?(_0x3fa737[_0x44ce30(0x1c6)](_0x4e8355,_0x5709a0),_0x564295[_0x44ce30(0x27e)](_0x4e8355)):_0x20dc84[_0x44ce30(0x1f0)]({'id':_0x5709a0,'seg':_0x1cee9f});}if(_0x564295[_0x44ce30(0x257)]>0x0&&_0x20dc84[_0x44ce30(0x1f3)]>0x0){const {localExpandedRuleToNames:_0xcd6be5}=buildLocalExpandedRuleMappings(_0x480294['yamlConfig']),_0x930b27=new Map();for(const {id:_0x4f48ca,seg:_0x4e51be}of _0x20dc84){if(_0x4e51be[_0x44ce30(0x220)]){const _0x4228da=apiRuleToYaml(_0x4e51be['rule']);_0x930b27[_0x44ce30(0x1c6)](_0x4f48ca,_0x4228da);}}for(const {id:_0x4f8a53,seg:_0x2e3eea}of _0x20dc84){if(!_0x2e3eea[_0x44ce30(0x220)])continue;const _0x1fb185=_0x930b27[_0x44ce30(0x1f4)](_0x4f8a53);if(!_0x1fb185)continue;const _0x4fc448=serializeExpandedRule(_0x1fb185,_0x930b27),_0x34c970=_0xcd6be5['get'](_0x4fc448);if(_0x34c970){const _0x39758c=_0x34c970['find'](_0x42ca7f=>_0x564295['has'](_0x42ca7f));_0x39758c&&(_0x3fa737['set'](_0x39758c,_0x4f8a53),_0x564295[_0x44ce30(0x27e)](_0x39758c),logger[_0x44ce30(0x29d)](_0x44ce30(0x1b0)+_0x2e3eea[_0x44ce30(0x209)]+'\x27\x20to\x20local\x20\x27'+_0x39758c+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x17b66a,_0x2a7ced,_0x6e9b4a,_0x359150,_0x1ee12c,_0x73f23c){const _0x5a3e35=a155_0x30a951,{journeyDefToRequest:_0x21fbc4,activationDefToCreateRequest:_0x208ac8,yamlRuleToApi:_0x666664,validateSegmentRule:_0x4c78aa}=_0x73f23c,_0x39ac5d=new Map(),_0x45220a=new Map();recoverSegmentIdsFromPushRecovery(_0x2a7ced,_0x39ac5d,_0x6e9b4a['segmentNameToId']);const _0x42153f=new Map(),_0x319777=new Map(),_0x4feb9e=new Map();let _0x4334a0;const _0xa3ff2c=async()=>{const _0x222637=a155_0x5a27;if(_0x4334a0)return;_0x4334a0=new Map();if(!_0x2a7ced[_0x222637(0x245)])return;const _0x2a9129=await _0x17b66a[_0x222637(0x20c)]['listActivations'](_0x2a7ced[_0x222637(0x245)]['id']);for(const _0x48f22d of _0x2a9129){const _0x4ab7b0=journeyActivationStepToYaml(_0x48f22d,_0x6e9b4a[_0x222637(0x1d2)],_0x6e9b4a[_0x222637(0x295)]),_0x3108b1=activationSignature(_0x4ab7b0);!_0x4334a0[_0x222637(0x239)](_0x3108b1)&&_0x4334a0['set'](_0x3108b1,_0x48f22d['id']),_0x4ab7b0[_0x222637(0x209)]&&_0x45220a[_0x222637(0x1c6)](_0x4ab7b0[_0x222637(0x209)],_0x48f22d['id']);}};await matchExistingJourneySegments(_0x17b66a,_0x2a7ced,_0x359150[_0x5a3e35(0x222)],_0x6e9b4a[_0x5a3e35(0x288)],_0x6e9b4a[_0x5a3e35(0x246)]);const _0x7d1484={'resolveSegmentId':async _0x5cbcf8=>{const _0x58cf31=_0x5a3e35,_0x1aa16c=_0x6e9b4a[_0x58cf31(0x246)][_0x58cf31(0x1f4)](_0x5cbcf8);if(!_0x1aa16c)throw new SDKError(ErrorCode[_0x58cf31(0x25f)],_0x58cf31(0x26a)+_0x5cbcf8+'\x20(referenced\x20in\x20journey\x20'+_0x2a7ced[_0x58cf31(0x224)]['name']+')');return _0x1aa16c;},'resolveEmbeddedSegmentId':async(_0x2cb54e,_0x18aeaa)=>{const _0x4b11d2=_0x5a3e35,_0x273f30=_0x6e9b4a[_0x4b11d2(0x246)]['get'](_0x2cb54e);if(_0x273f30)return _0x273f30;const _0x19da16=_0x6e9b4a[_0x4b11d2(0x288)][_0x4b11d2(0x227)](_0x5bad5d=>_0x5bad5d['name']===_0x2cb54e);if(_0x19da16)return _0x6e9b4a[_0x4b11d2(0x246)]['set'](_0x2cb54e,_0x19da16['id']),_0x19da16['id'];if(_0x2a7ced['isNew']){const {stageName:_0x3e06e4,criteriaName:_0x472ab3}=findSegmentCriteriaLocation(_0x2a7ced[_0x4b11d2(0x224)],_0x2cb54e);return _0x4c78aa(_0x2cb54e,_0x18aeaa[_0x4b11d2(0x220)]),_0x319777['set'](_0x2cb54e,{'definition':_0x18aeaa,'stageName':_0x3e06e4,'criteriaName':_0x472ab3}),createPendingSegmentId(_0x2cb54e);}const _0x290e79=_0x2a7ced['existingJourney']?.['id'];if(!_0x290e79)throw new SDKError(ErrorCode[_0x4b11d2(0x276)],_0x4b11d2(0x23f));const _0x3c0cf8=_0x42153f[_0x4b11d2(0x1f4)](_0x2cb54e);if(_0x3c0cf8)return _0x3c0cf8;const _0x1872a4=((async()=>{const _0x29f1d6=_0x4b11d2;_0x4c78aa(_0x2cb54e,_0x18aeaa[_0x29f1d6(0x220)]);const _0x4334dd=generateDeterministicJourneySegmentName(_0x2a7ced['yamlConfig']['name'],_0x2cb54e),_0x18d4fe=_0x6e9b4a['existingSegments'][_0x29f1d6(0x227)](_0x4e51ac=>_0x4e51ac[_0x29f1d6(0x209)]===_0x4334dd),_0x53e841=createSegmentIdResolver(_0x6e9b4a['segmentNameToId'],_0x2cb54e),_0x1a523d=await resolveRuleSegmentIds(_0x18aeaa[_0x29f1d6(0x220)],_0x53e841);let _0x4f0f30;return _0x18d4fe?(await _0x17b66a[_0x29f1d6(0x1ad)][_0x29f1d6(0x1c1)](_0x359150[_0x29f1d6(0x222)],_0x18d4fe['id'],{'description':_0x18aeaa[_0x29f1d6(0x1df)]||_0x29f1d6(0x29a)+_0x2cb54e,'rule':_0x666664(_0x1a523d),'countPopulation':!![]}),_0x4f0f30=_0x18d4fe['id'],saveSegmentToPushRecovery(_0x2a7ced['absolutePath'],_0x2a7ced['yamlConfig'][_0x29f1d6(0x209)],_0x2cb54e,{'segmentId':_0x4f0f30,'uniqueServerName':_0x4334dd,'createdAt':new Date()[_0x29f1d6(0x296)]()})):_0x4f0f30=await createOrRecoverEmbeddedSegment(_0x17b66a,_0x2a7ced,{'localName':_0x2cb54e,'uniqueSegmentName':_0x4334dd,'description':_0x18aeaa[_0x29f1d6(0x1df)]||_0x29f1d6(0x29a)+_0x2cb54e,'journeyId':_0x290e79,'resolvedRule':_0x1a523d,'parentId':_0x359150['parentId'],'folderId':_0x359150['rootFolderId']||''},_0x666664),_0x6e9b4a[_0x29f1d6(0x246)][_0x29f1d6(0x1c6)](_0x2cb54e,_0x4f0f30),_0x39ac5d[_0x29f1d6(0x1c6)](_0x2cb54e,_0x4f0f30),_0x4f0f30;})());_0x42153f[_0x4b11d2(0x1c6)](_0x2cb54e,_0x1872a4);try{return await _0x1872a4;}finally{_0x42153f['delete'](_0x2cb54e);}},'resolveActivationId':async _0x4c7e5d=>{const _0x4bf478=_0x5a3e35,_0x3e7b7a=_0x45220a[_0x4bf478(0x1f4)](_0x4c7e5d);if(_0x3e7b7a)return _0x3e7b7a;if(_0x2a7ced[_0x4bf478(0x245)]){await _0xa3ff2c();const _0x56ba68=_0x45220a[_0x4bf478(0x1f4)](_0x4c7e5d);if(_0x56ba68)return _0x56ba68;}throw new SDKError(ErrorCode[_0x4bf478(0x254)],_0x4bf478(0x234)+_0x4c7e5d+_0x4bf478(0x1dd)+_0x2a7ced['yamlConfig']['name']+').\x20'+_0x4bf478(0x1c2));},'resolveEmbeddedActivationId':async(_0x39f3e6,_0x529a0f)=>{const _0x29cecb=_0x5a3e35,_0xae7dd0=_0x45220a[_0x29cecb(0x1f4)](_0x39f3e6);if(_0xae7dd0)return _0xae7dd0;if(_0x2a7ced[_0x29cecb(0x20b)])return _0x4feb9e[_0x29cecb(0x1c6)](_0x39f3e6,_0x529a0f),createPendingActivationId(_0x39f3e6);if(_0x2a7ced['existingJourney']){await _0xa3ff2c();const _0x3b8164=_0x45220a[_0x29cecb(0x1f4)](_0x529a0f[_0x29cecb(0x209)]);if(_0x3b8164)return _0x45220a[_0x29cecb(0x1c6)](_0x39f3e6,_0x3b8164),_0x3b8164;const _0x381083=activationSignature(_0x529a0f),_0x11b54a=_0x4334a0?.[_0x29cecb(0x1f4)](_0x381083);if(_0x11b54a)return _0x45220a[_0x29cecb(0x1c6)](_0x39f3e6,_0x11b54a),_0x11b54a;const _0x1cc938=await _0x208ac8(_0x529a0f,_0x6e9b4a[_0x29cecb(0x28c)]),_0x56af74={..._0x1cc938,..._0x529a0f[_0x29cecb(0x2a1)]!==undefined&&{'runAfterJourneyRefresh':_0x529a0f[_0x29cecb(0x2a1)]}},_0x58695b=await _0x17b66a[_0x29cecb(0x20c)][_0x29cecb(0x283)](_0x2a7ced[_0x29cecb(0x245)]['id'],_0x56af74);return _0x45220a[_0x29cecb(0x1c6)](_0x39f3e6,_0x58695b['id']),_0x58695b['id'];}throw new SDKError(ErrorCode[_0x29cecb(0x276)],_0x29cecb(0x1b6));},'resolveJourneyId':async _0x408cd8=>{const _0xfb45=_0x5a3e35;try{return await _0x17b66a[_0xfb45(0x20c)][_0xfb45(0x27c)](_0x359150[_0xfb45(0x222)],_0x408cd8);}catch(_0x43fe4f){throw new SDKError(ErrorCode[_0xfb45(0x254)],'Journey\x20\x27'+_0x408cd8+_0xfb45(0x22e)+_0x2a7ced[_0xfb45(0x224)][_0xfb45(0x209)]+'\x27)',_0x43fe4f);}},'resolveStageId':async(_0x4bf76b,_0x519b26)=>{const _0x2217e4=_0x5a3e35,_0x3420fc=await _0x17b66a['journey'][_0x2217e4(0x1bc)](_0x4bf76b),_0x549143=_0x3420fc['attributes']['journeyStages'][_0x2217e4(0x227)](_0x332adb=>_0x332adb['name'][_0x2217e4(0x1f1)]()===_0x519b26[_0x2217e4(0x1f1)]());if(!_0x549143?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x2217e4(0x292)+_0x519b26+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3420fc[_0x2217e4(0x1de)][_0x2217e4(0x297)]||_0x3420fc[_0x2217e4(0x1de)][_0x2217e4(0x209)])+'\x27');return _0x549143['id'];}},_0x5de21a=await _0x21fbc4(_0x2a7ced[_0x5a3e35(0x224)],_0x359150[_0x5a3e35(0x222)],_0x7d1484),_0x4065ba=_0x359150['folderId']||_0x359150['rootFolderId'];_0x4065ba&&(_0x5de21a['relationships']={'parentFolder':{'data':{'id':_0x4065ba,'type':_0x5a3e35(0x1e3)}}});if(_0x2a7ced[_0x5a3e35(0x20b)]){if(_0x319777[_0x5a3e35(0x257)]>0x0||_0x4feb9e[_0x5a3e35(0x257)]>0x0)return await executeThreeStepJourneyCreate(_0x17b66a,_0x2a7ced,_0x5de21a,{'pendingEmbeddedSegments':_0x319777,'pendingEmbeddedActivations':_0x4feb9e,'embeddedSegmentNameToId':_0x39ac5d,'journeyActivationNameToId':_0x45220a},{..._0x359150,'effectiveFolderId':_0x4065ba},_0x6e9b4a,_0x1ee12c,_0x73f23c);else{ensureJourneyDefaults(_0x5de21a['attributes']);const _0x49b7f7=await _0x17b66a['journey'][_0x5a3e35(0x247)](_0x5de21a);return deletePushRecovery(_0x2a7ced['absolutePath']),{'action':_0x5a3e35(0x251),'journeyId':_0x49b7f7['id'],'embeddedSegmentNameToId':_0x39ac5d};}}else{if(_0x2a7ced[_0x5a3e35(0x214)]&&_0x2a7ced['existingJourney']){_0x5de21a['id']=_0x2a7ced[_0x5a3e35(0x245)]['id'];const _0x4c767b=_0x5de21a[_0x5a3e35(0x1de)];_0x2a7ced['existingJourney'][_0x5a3e35(0x1de)]?.[_0x5a3e35(0x297)]&&(_0x4c767b[_0x5a3e35(0x297)]=_0x2a7ced['existingJourney'][_0x5a3e35(0x1de)]['journeyBundleName']);const _0xe378f1=_0x2a7ced['existingJourney'][_0x5a3e35(0x1de)]?.[_0x5a3e35(0x221)];return _0xe378f1&&_0x5de21a['attributes']['journeyStages']&&injectExistingStageIds(_0x5de21a[_0x5a3e35(0x1de)]['journeyStages'],_0xe378f1),ensureJourneyDefaults(_0x4c767b),await _0x17b66a[_0x5a3e35(0x20c)][_0x5a3e35(0x26b)](_0x2a7ced[_0x5a3e35(0x245)]['id'],_0x5de21a),deletePushRecovery(_0x2a7ced[_0x5a3e35(0x232)]),{'action':_0x5a3e35(0x28b),'journeyId':_0x2a7ced[_0x5a3e35(0x245)]['id'],'embeddedSegmentNameToId':_0x39ac5d};}}return deletePushRecovery(_0x2a7ced[_0x5a3e35(0x232)]),{'action':_0x5a3e35(0x1da),'journeyId':_0x2a7ced[_0x5a3e35(0x245)]?.['id'],'embeddedSegmentNameToId':_0x39ac5d};}function findSegmentCriteriaLocation(_0xefa6e4,_0x15e620){const _0x142859=a155_0x30a951,_0x11340d=_0xefa6e4[_0x142859(0x282)]||_0xefa6e4[_0x142859(0x263)]?.[0x0]?.[_0x142859(0x282)]||[];let _0x442a16=_0x142859(0x260),_0x4f9c35=_0x15e620;const _0x23bf00=_0xefa6e4[_0x142859(0x1fa)]||_0xefa6e4[_0x142859(0x263)]?.[0x0]?.[_0x142859(0x1fa)];if(_0x23bf00?.[_0x142859(0x1ad)]===_0x15e620)return{'stageName':'goal','criteriaName':_0x23bf00[_0x142859(0x209)]||_0x15e620};_0x233bf4:for(const _0x2563ad of _0x11340d){if(_0x2563ad[_0x142859(0x273)]?.[_0x142859(0x1ad)]===_0x15e620){_0x442a16=_0x2563ad['name'],_0x4f9c35=_0x2563ad[_0x142859(0x273)][_0x142859(0x209)]||_0x15e620;break;}if(_0x2563ad[_0x142859(0x243)])for(const _0x574ecf of _0x2563ad[_0x142859(0x243)]){if(_0x574ecf[_0x142859(0x20e)]==='decision_point'&&_0x574ecf['with']?.['branches'])for(const _0xe265e7 of _0x574ecf['with'][_0x142859(0x21e)]){if(_0xe265e7[_0x142859(0x1ad)]===_0x15e620){_0x442a16=_0x2563ad[_0x142859(0x209)],_0x4f9c35=_0xe265e7[_0x142859(0x209)]||_0x15e620;break _0x233bf4;}}}}return{'stageName':_0x442a16,'criteriaName':_0x4f9c35};}async function executeThreeStepJourneyCreate(_0x345a19,_0x2ec764,_0x3b785f,_0x1e3c10,_0x2c46fc,_0x364bf0,_0x381f8a,_0x5daca4){const _0x1235f9=a155_0x30a951,{activationDefToCreateRequest:_0x4233ab,yamlRuleToApi:_0x569f8a}=_0x5daca4,{pendingEmbeddedSegments:_0x237244,pendingEmbeddedActivations:_0x3c11ac,embeddedSegmentNameToId:_0x122c42}=_0x1e3c10,_0xe6f08a=JSON[_0x1235f9(0x1d3)](JSON[_0x1235f9(0x24d)](_0x3b785f));ensureJourneyDefaults(_0xe6f08a['attributes']),stripPendingIds(_0xe6f08a);const _0x21e024=await _0x345a19[_0x1235f9(0x20c)][_0x1235f9(0x247)](_0xe6f08a),_0x972f10=_0x21e024['id'],_0x4dda0d=new Map();for(const _0x460421 of _0x21e024['attributes'][_0x1235f9(0x221)]){_0x4dda0d[_0x1235f9(0x1c6)](_0x460421[_0x1235f9(0x209)][_0x1235f9(0x1f1)](),_0x460421['id']);}recoverSegmentIdsFromPushRecovery(_0x2ec764,_0x122c42,_0x364bf0[_0x1235f9(0x246)]);for(const [_0x1d83d7,{definition:_0x2a09f0}]of _0x237244){if(_0x122c42[_0x1235f9(0x239)](_0x1d83d7)){_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x230),'journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'segmentName':_0x1d83d7});continue;}const _0x8c250e=generateDeterministicJourneySegmentName(_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],_0x1d83d7);_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x1c8),'journeyName':_0x2ec764[_0x1235f9(0x224)]['name'],'segmentName':_0x1d83d7});const _0x51df5e=createSegmentIdResolver(_0x364bf0['segmentNameToId'],_0x1d83d7),_0x536d5c=await resolveRuleSegmentIds(_0x2a09f0['rule'],_0x51df5e),_0x496a5b=await createOrRecoverEmbeddedSegment(_0x345a19,_0x2ec764,{'localName':_0x1d83d7,'uniqueSegmentName':_0x8c250e,'description':_0x2a09f0[_0x1235f9(0x1df)]||_0x1235f9(0x29a)+_0x1d83d7,'journeyId':_0x972f10,'resolvedRule':_0x536d5c,'parentId':_0x2c46fc[_0x1235f9(0x222)],'folderId':_0x2c46fc[_0x1235f9(0x20a)]||''},_0x569f8a);_0x122c42[_0x1235f9(0x1c6)](_0x1d83d7,_0x496a5b),_0x364bf0[_0x1235f9(0x246)][_0x1235f9(0x1c6)](_0x1d83d7,_0x496a5b),_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x230),'journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'segmentName':_0x1d83d7});}const _0x34f06d=new Map();for(const [_0x5ddf7b,_0x379fd2]of _0x3c11ac){_0x381f8a[_0x1235f9(0x23a)]?.({'type':_0x1235f9(0x1be),'journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'activationName':_0x5ddf7b});const _0x1b8a14=await _0x4233ab(_0x379fd2,_0x364bf0[_0x1235f9(0x28c)]),_0x572e2f={..._0x1b8a14,..._0x379fd2[_0x1235f9(0x2a1)]!==undefined&&{'runAfterJourneyRefresh':_0x379fd2['run_after_journey_refresh']}},_0x2929cd=await _0x345a19[_0x1235f9(0x20c)][_0x1235f9(0x283)](_0x972f10,_0x572e2f);_0x34f06d[_0x1235f9(0x1c6)](_0x5ddf7b,_0x2929cd['id']),_0x1e3c10[_0x1235f9(0x1d7)][_0x1235f9(0x1c6)](_0x5ddf7b,_0x2929cd['id']),_0x381f8a[_0x1235f9(0x23a)]?.({'type':'embedded_activation_created','journeyName':_0x2ec764[_0x1235f9(0x224)][_0x1235f9(0x209)],'activationName':_0x5ddf7b});}const _0x25a22d=JSON[_0x1235f9(0x1d3)](JSON[_0x1235f9(0x24d)](_0x3b785f));return _0x25a22d['id']=_0x972f10,ensureJourneyDefaults(_0x25a22d[_0x1235f9(0x1de)]),resolvePendingIdsInRequest(_0x25a22d,_0x3b785f,_0x4dda0d,_0x122c42,_0x34f06d,_0x381f8a),await _0x345a19[_0x1235f9(0x20c)][_0x1235f9(0x26b)](_0x972f10,_0x25a22d),deletePushRecovery(_0x2ec764[_0x1235f9(0x232)]),{'action':'created','journeyId':_0x972f10,'embeddedSegmentNameToId':_0x122c42};}export function stripWaitStepPendingIds(_0x48e2bb){const _0x1a206e=a155_0x30a951,_0x229283=_0x48e2bb[_0x1a206e(0x207)]&&isPendingSegmentId(_0x48e2bb['conditionSegmentId']),_0x113109=_0x48e2bb[_0x1a206e(0x262)]?.[_0x1a206e(0x21d)](_0x3ce1bc=>_0x3ce1bc[_0x1a206e(0x204)]&&isPendingSegmentId(_0x3ce1bc[_0x1a206e(0x204)]));(_0x229283||_0x113109)&&(_0x48e2bb[_0x1a206e(0x270)]=_0x1a206e(0x231),_0x48e2bb[_0x1a206e(0x1d1)]=0x1,_0x48e2bb[_0x1a206e(0x22a)]='day',delete _0x48e2bb['conditionSegmentId'],delete _0x48e2bb[_0x1a206e(0x278)],delete _0x48e2bb[_0x1a206e(0x25e)],delete _0x48e2bb[_0x1a206e(0x262)]);}export function resolveWaitStepPendingIds(_0x472e06,_0x250947,_0x7ae222,_0x139923){const _0x46e695=a155_0x30a951;if(_0x250947[_0x46e695(0x207)]&&isPendingSegmentId(_0x250947[_0x46e695(0x207)])){const _0x1b1d00=_0x7ae222(_0x250947[_0x46e695(0x207)],_0x46e695(0x293)+_0x139923+_0x46e695(0x22c));_0x1b1d00&&(_0x472e06[_0x46e695(0x270)]=_0x46e695(0x1aa),_0x472e06[_0x46e695(0x207)]=_0x1b1d00,delete _0x472e06[_0x46e695(0x1d1)],delete _0x472e06[_0x46e695(0x22a)],_0x250947[_0x46e695(0x278)]!==undefined&&(_0x472e06[_0x46e695(0x278)]=_0x250947[_0x46e695(0x278)]),_0x250947['conditionTimeoutUnit']&&(_0x472e06['conditionTimeoutUnit']=_0x250947[_0x46e695(0x25e)]));}if(_0x250947[_0x46e695(0x262)]){const _0x506c36=_0x250947[_0x46e695(0x262)]['some'](_0x3b01c7=>_0x3b01c7[_0x46e695(0x204)]&&isPendingSegmentId(_0x3b01c7[_0x46e695(0x204)]));if(_0x506c36){const _0x48c3ae=_0x250947['conditions'][_0x46e695(0x258)](_0x5498ca=>{const _0x252c88=_0x46e695;if(_0x5498ca[_0x252c88(0x204)]&&isPendingSegmentId(_0x5498ca[_0x252c88(0x204)])){const _0x4da096=_0x7ae222(_0x5498ca[_0x252c88(0x204)],_0x252c88(0x293)+_0x139923+_0x252c88(0x22c));return{..._0x5498ca,'segmentId':_0x4da096||_0x5498ca[_0x252c88(0x204)]};}return{..._0x5498ca};});_0x472e06[_0x46e695(0x270)]=_0x46e695(0x1aa),_0x472e06[_0x46e695(0x262)]=_0x48c3ae,delete _0x472e06['waitStep'],delete _0x472e06['waitStepUnit'],delete _0x472e06[_0x46e695(0x207)],delete _0x472e06['conditionTimeoutDuration'],delete _0x472e06['conditionTimeoutUnit'];}}}function stripPendingIds(_0x4aeb18){const _0x3324a5=a155_0x30a951;_0x4aeb18[_0x3324a5(0x1de)][_0x3324a5(0x1fa)]?.[_0x3324a5(0x204)]&&isPendingSegmentId(_0x4aeb18[_0x3324a5(0x1de)]['goal'][_0x3324a5(0x204)])&&delete _0x4aeb18[_0x3324a5(0x1de)][_0x3324a5(0x1fa)];for(const _0x2fd2d4 of _0x4aeb18['attributes'][_0x3324a5(0x221)]||[]){_0x2fd2d4[_0x3324a5(0x1b3)]?.[_0x3324a5(0x204)]&&isPendingSegmentId(_0x2fd2d4[_0x3324a5(0x1b3)][_0x3324a5(0x204)])&&delete _0x2fd2d4[_0x3324a5(0x1b3)];_0x2fd2d4[_0x3324a5(0x27f)]?.[_0x3324a5(0x204)]&&isPendingSegmentId(_0x2fd2d4[_0x3324a5(0x27f)][_0x3324a5(0x204)])&&delete _0x2fd2d4['milestone'];_0x2fd2d4[_0x3324a5(0x1ed)]&&(_0x2fd2d4[_0x3324a5(0x1ed)]=_0x2fd2d4[_0x3324a5(0x1ed)][_0x3324a5(0x201)](_0x1ee9e4=>!_0x1ee9e4[_0x3324a5(0x204)]||!isPendingSegmentId(_0x1ee9e4[_0x3324a5(0x204)])));if(_0x2fd2d4[_0x3324a5(0x243)])for(const _0x597901 of Object[_0x3324a5(0x1e5)](_0x2fd2d4['steps'])){const _0x463bbb=_0x2fd2d4[_0x3324a5(0x243)][_0x597901];_0x463bbb[_0x3324a5(0x20e)]===_0x3324a5(0x275)&&_0x463bbb[_0x3324a5(0x233)]&&isPendingActivationId(_0x463bbb[_0x3324a5(0x233)])&&(_0x463bbb[_0x3324a5(0x233)]='');if(_0x463bbb[_0x3324a5(0x20e)]===_0x3324a5(0x26c)&&_0x463bbb[_0x3324a5(0x21e)])for(const _0x5ce0f9 of _0x463bbb[_0x3324a5(0x21e)]){_0x5ce0f9[_0x3324a5(0x204)]&&isPendingSegmentId(_0x5ce0f9[_0x3324a5(0x204)])&&(_0x5ce0f9[_0x3324a5(0x204)]='');}_0x463bbb[_0x3324a5(0x20e)]===_0x3324a5(0x253)&&stripWaitStepPendingIds(_0x463bbb);}}}function resolvePendingIdsInRequest(_0x3fe06a,_0x1fdda0,_0xeeee79,_0x3bb306,_0x552c10,_0x3b668b){const _0x53586c=a155_0x30a951,_0x2f9344=(_0x21b2b0,_0x2848e5)=>{const _0x528ca6=a155_0x5a27;if(!isPendingSegmentId(_0x21b2b0))return _0x21b2b0;const _0x1b4e9e=extractPendingSegmentName(_0x21b2b0),_0x43bdd8=_0x3bb306[_0x528ca6(0x1f4)](_0x1b4e9e);return!_0x43bdd8&&_0x3b668b[_0x528ca6(0x250)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x1b4e9e+_0x528ca6(0x1fe)+_0x2848e5),_0x43bdd8;};if(_0x3fe06a[_0x53586c(0x1de)][_0x53586c(0x1fa)]?.[_0x53586c(0x204)]&&isPendingSegmentId(_0x3fe06a[_0x53586c(0x1de)]['goal']['segmentId'])){const _0x2dc5ec=_0x2f9344(_0x3fe06a[_0x53586c(0x1de)][_0x53586c(0x1fa)][_0x53586c(0x204)],'goal\x20criteria');_0x2dc5ec&&(_0x3fe06a['attributes'][_0x53586c(0x1fa)]['segmentId']=_0x2dc5ec);}for(const _0xee679c of _0x3fe06a[_0x53586c(0x1de)]['journeyStages']||[]){const _0x8505ce=_0xeeee79['get'](_0xee679c[_0x53586c(0x209)][_0x53586c(0x1f1)]());_0x8505ce&&(_0xee679c['id']=_0x8505ce);if(_0xee679c[_0x53586c(0x1b3)]?.[_0x53586c(0x204)]&&isPendingSegmentId(_0xee679c[_0x53586c(0x1b3)][_0x53586c(0x204)])){const _0x29c436=_0x2f9344(_0xee679c[_0x53586c(0x1b3)]['segmentId'],'stage\x20\x27'+_0xee679c[_0x53586c(0x209)]+_0x53586c(0x208));_0x29c436&&(_0xee679c[_0x53586c(0x1b3)][_0x53586c(0x204)]=_0x29c436);}if(_0xee679c[_0x53586c(0x1ed)])for(const _0x2e8946 of _0xee679c['exitCriterias']){if(_0x2e8946['segmentId']&&isPendingSegmentId(_0x2e8946['segmentId'])){const _0x56a73f=_0x2f9344(_0x2e8946[_0x53586c(0x204)],_0x53586c(0x293)+_0xee679c[_0x53586c(0x209)]+_0x53586c(0x2a3));_0x56a73f&&(_0x2e8946[_0x53586c(0x204)]=_0x56a73f);}}if(_0xee679c[_0x53586c(0x27f)]?.[_0x53586c(0x204)]&&isPendingSegmentId(_0xee679c[_0x53586c(0x27f)][_0x53586c(0x204)])){const _0x4c2fa2=_0x2f9344(_0xee679c[_0x53586c(0x27f)][_0x53586c(0x204)],'stage\x20\x27'+_0xee679c['name']+_0x53586c(0x256));_0x4c2fa2&&(_0xee679c[_0x53586c(0x27f)]['segmentId']=_0x4c2fa2);}if(_0xee679c[_0x53586c(0x243)]){const _0x867f41=_0x3b4edf=>_0x1fdda0[_0x53586c(0x1de)]['journeyStages']?.[_0x53586c(0x227)](_0x4fecf4=>_0x4fecf4[_0x53586c(0x209)][_0x53586c(0x1f1)]()===_0xee679c['name'][_0x53586c(0x1f1)]())?.[_0x53586c(0x243)]?.[_0x3b4edf];for(const _0x284b3e of Object['keys'](_0xee679c[_0x53586c(0x243)])){const _0x59cc03=_0xee679c[_0x53586c(0x243)][_0x284b3e],_0xca6a1e=_0x867f41(_0x284b3e);if(_0x59cc03[_0x53586c(0x20e)]===_0x53586c(0x275)&&_0x59cc03['journeyActivationStepId']&&(isPendingActivationId(_0x59cc03[_0x53586c(0x233)])||_0x59cc03[_0x53586c(0x233)]==='')){if(_0xca6a1e?.['journeyActivationStepId']&&isPendingActivationId(_0xca6a1e[_0x53586c(0x233)])){const _0x25ef0b=extractPendingActivationName(_0xca6a1e[_0x53586c(0x233)]),_0x222291=_0x552c10[_0x53586c(0x1f4)](_0x25ef0b);_0x222291&&(_0x59cc03['journeyActivationStepId']=_0x222291);}}if(_0x59cc03[_0x53586c(0x20e)]===_0x53586c(0x26c)&&_0x59cc03['branches']&&_0xca6a1e?.[_0x53586c(0x21e)])for(let _0x90e67f=0x0;_0x90e67f<_0x59cc03[_0x53586c(0x21e)][_0x53586c(0x1f3)];_0x90e67f++){const _0x2226b2=_0x59cc03[_0x53586c(0x21e)][_0x90e67f],_0x29bbf6=_0xca6a1e[_0x53586c(0x21e)][_0x90e67f];if(_0x29bbf6?.[_0x53586c(0x204)]&&isPendingSegmentId(_0x29bbf6[_0x53586c(0x204)])){const _0xdfe421=_0x2f9344(_0x29bbf6[_0x53586c(0x204)],_0x53586c(0x293)+_0xee679c['name']+_0x53586c(0x20d)+(_0x2226b2['name']||_0x90e67f)+'\x27');_0xdfe421&&(_0x2226b2[_0x53586c(0x204)]=_0xdfe421);}}_0x59cc03[_0x53586c(0x20e)]===_0x53586c(0x253)&&_0xca6a1e?.[_0x53586c(0x20e)]===_0x53586c(0x253)&&resolveWaitStepPendingIds(_0x59cc03,_0xca6a1e,_0x2f9344,_0xee679c['name']);}}}}
1
+ const a155_0x3e8afc=a155_0x4ade;(function(_0x45304d,_0x1874d4){const _0x3b7323=a155_0x4ade,_0x58f268=_0x45304d();while(!![]){try{const _0x4438e6=parseInt(_0x3b7323(0x158))/0x1*(parseInt(_0x3b7323(0x143))/0x2)+-parseInt(_0x3b7323(0x18d))/0x3+parseInt(_0x3b7323(0x197))/0x4*(-parseInt(_0x3b7323(0x1e5))/0x5)+parseInt(_0x3b7323(0x149))/0x6*(parseInt(_0x3b7323(0x14f))/0x7)+parseInt(_0x3b7323(0x1cb))/0x8*(-parseInt(_0x3b7323(0x1a3))/0x9)+-parseInt(_0x3b7323(0x228))/0xa*(-parseInt(_0x3b7323(0x161))/0xb)+parseInt(_0x3b7323(0x1c3))/0xc*(-parseInt(_0x3b7323(0x178))/0xd);if(_0x4438e6===_0x1874d4)break;else _0x58f268['push'](_0x58f268['shift']());}catch(_0x4680a8){_0x58f268['push'](_0x58f268['shift']());}}}(a155_0x3ac6,0x3a503));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x3e8afc(0x211));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a155_0x3e8afc(0x1ad);export function createPendingSegmentId(_0x5d9d86){return''+PENDING_SEGMENT_PREFIX+_0x5d9d86+'__';}export function isPendingSegmentId(_0x379c86){const _0x1c598a=a155_0x3e8afc;return _0x379c86['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x379c86[_0x1c598a(0x238)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x114a00){const _0x493668=a155_0x3e8afc;return _0x114a00[_0x493668(0x199)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x57709f){return''+PENDING_ACTIVATION_PREFIX+_0x57709f+'__';}export function isPendingActivationId(_0x37e375){return _0x37e375['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x111bfb){return _0x111bfb['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x575a81,_0x1e8c63){const _0x323385=a155_0x3e8afc,_0x2b45a2=_0x575a81+'::'+(_0x1e8c63[_0x323385(0x23d)]()||_0x323385(0x1cf)),_0x708fde=createHash(_0x323385(0x200))[_0x323385(0x206)](_0x2b45a2)['digest'](_0x323385(0x1a1))[_0x323385(0x195)](0x0,0xc);return _0x323385(0x14d)+_0x708fde;}export function ensureJourneyDefaults(_0x316b01){const _0x1764bd=a155_0x3e8afc;!_0x316b01[_0x1764bd(0x214)]&&(_0x316b01['description']=''),!_0x316b01['state']&&(_0x316b01['state']=_0x1764bd(0x18b));}export function injectExistingStageIds(_0x19ae9e,_0x51cdf6){const _0x28e2b1=a155_0x3e8afc,_0x81d7c7=new Map(_0x51cdf6[_0x28e2b1(0x1ef)](_0x50458f=>[_0x50458f[_0x28e2b1(0x1ea)],_0x50458f['id']]));for(const _0x45a01c of _0x19ae9e){if(!_0x45a01c['id']){const _0x3af461=_0x81d7c7[_0x28e2b1(0x1bd)](_0x45a01c[_0x28e2b1(0x1ea)]);_0x3af461&&(_0x45a01c['id']=_0x3af461);}}}export function resolveTDFolderPath(_0x5d861c,_0x148959,_0x45b650){const _0xa8e920=a155_0x3e8afc;if(!_0x148959)return _0x5d861c;if(_0x5d861c===_0x45b650||_0x5d861c[_0xa8e920(0x238)](_0x45b650+'/'))return _0x5d861c;return _0x5d861c?_0x45b650+'/'+_0x5d861c:_0x45b650;}export function addFoldersToCreate(_0x3f6ef8,_0x4ec148,_0x3e95e2){const _0x4fa041=a155_0x3e8afc;if(!_0x3f6ef8)return;if(_0x4ec148[_0x4fa041(0x1c9)](_0x3f6ef8))return;const _0x26d32e=_0x3f6ef8['split']('/');let _0x2fe9a2='';for(const _0x45dff4 of _0x26d32e){_0x2fe9a2=_0x2fe9a2?_0x2fe9a2+'/'+_0x45dff4:_0x45dff4,!_0x4ec148['has'](_0x2fe9a2)&&_0x3e95e2['add'](_0x2fe9a2);}}export function sortFoldersByDepth(_0xf8e381){return[..._0xf8e381]['sort']((_0x3a6657,_0x568c9e)=>{const _0x2778f9=a155_0x4ade,_0x5867fd=(_0x3a6657[_0x2778f9(0x236)](/\//g)||[])['length'],_0x37ec8e=(_0x568c9e['match'](/\//g)||[])[_0x2778f9(0x140)];return _0x5867fd-_0x37ec8e;});}import*as a155_0x3e9382 from'yaml';import{readFileSync}from'fs';import a155_0x405b9f from'path';import{isJourneyDef,parseYamlString as a155_0x273a5a,toYamlString as a155_0xf7453a,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';function a155_0x4ade(_0x389954,_0x476ccf){_0x389954=_0x389954-0x13d;const _0x3ac689=a155_0x3ac6();let _0x4ade46=_0x3ac689[_0x389954];return _0x4ade46;}import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x398e05){const _0x53a42b=a155_0x3e8afc;if(Array[_0x53a42b(0x21e)](_0x398e05))return'['+_0x398e05[_0x53a42b(0x1ef)](_0x4f5a26=>stableStringify(_0x4f5a26))[_0x53a42b(0x23a)](',')+']';if(_0x398e05&&typeof _0x398e05===_0x53a42b(0x1e0)){const _0x89d658=_0x398e05,_0x225469=Object[_0x53a42b(0x1f0)](_0x89d658)[_0x53a42b(0x180)](),_0x62cbed=_0x225469[_0x53a42b(0x1ef)](_0x555616=>'\x22'+_0x555616+'\x22:'+stableStringify(_0x89d658[_0x555616]));return'{'+_0x62cbed[_0x53a42b(0x23a)](',')+'}';}const _0x5719c8=JSON[_0x53a42b(0x22e)](_0x398e05);return _0x5719c8===undefined?_0x53a42b(0x153):_0x5719c8;}function activationSignature(_0x2a2c9f){const _0x262714=a155_0x3e8afc,_0x577d11={'connection':_0x2a2c9f[_0x262714(0x1d1)],..._0x2a2c9f[_0x262714(0x1b9)]!==undefined&&{'all_columns':_0x2a2c9f[_0x262714(0x1b9)]},..._0x2a2c9f[_0x262714(0x203)]!==undefined&&{'columns':_0x2a2c9f[_0x262714(0x203)]},..._0x2a2c9f[_0x262714(0x1da)]!==undefined&&{'behavior':_0x2a2c9f[_0x262714(0x1da)]},..._0x2a2c9f[_0x262714(0x1e6)]!==undefined&&{'schedule':_0x2a2c9f[_0x262714(0x1e6)]},..._0x2a2c9f['notification']!==undefined&&{'notification':_0x2a2c9f[_0x262714(0x1bc)]},..._0x2a2c9f[_0x262714(0x1f6)]!==undefined&&{'connector_config':_0x2a2c9f[_0x262714(0x1f6)]},..._0x2a2c9f['activation_template_id']!==undefined&&{'activation_template_id':_0x2a2c9f[_0x262714(0x172)]}};return stableStringify(_0x577d11);}async function fetchSegment(_0x20c2fa,_0x8fcdb4,_0x3aeebd,_0x17f31d){const _0x4f5ec1=a155_0x3e8afc,_0x4f0520=_0x17f31d?.[_0x4f5ec1(0x1d4)](_0x2483c6=>_0x2483c6['id']===_0x3aeebd);if(_0x4f0520)return _0x4f0520;try{return await _0x20c2fa[_0x4f5ec1(0x1cf)][_0x4f5ec1(0x188)](_0x8fcdb4,_0x3aeebd);}catch(_0x5d6f00){logger[_0x4f5ec1(0x22b)](_0x4f5ec1(0x1a7)+_0x3aeebd+_0x4f5ec1(0x1f2)+_0x5d6f00);try{return await _0x20c2fa[_0x4f5ec1(0x1cf)][_0x4f5ec1(0x18a)](_0x3aeebd);}catch(_0x4bad8e){return logger[_0x4f5ec1(0x22b)](_0x4f5ec1(0x1b0)+_0x3aeebd+':\x20'+_0x4bad8e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5cbf6d,_0x59c17a,_0x983c03){const _0x5c6cca=a155_0x3e8afc,_0x3237d0=readPushRecovery(_0x5cbf6d[_0x5c6cca(0x1fd)]);if(_0x3237d0?.[_0x5c6cca(0x16b)]===_0x5cbf6d[_0x5c6cca(0x1d8)][_0x5c6cca(0x1ea)])for(const [_0xf6979b,_0xf19dea]of Object[_0x5c6cca(0x1a6)](_0x3237d0[_0x5c6cca(0x156)])){const _0x4573d0=generateDeterministicJourneySegmentName(_0x5cbf6d[_0x5c6cca(0x1d8)][_0x5c6cca(0x1ea)],_0xf6979b);_0xf19dea['uniqueServerName']===_0x4573d0&&(_0x59c17a[_0x5c6cca(0x226)](_0xf6979b,_0xf19dea[_0x5c6cca(0x1a0)]),_0x983c03[_0x5c6cca(0x226)](_0xf6979b,_0xf19dea[_0x5c6cca(0x1a0)]));}}async function createOrRecoverEmbeddedSegment(_0x58ebed,_0x50e9c4,_0x62049b,_0x9d9cd7){const _0x109522=a155_0x3e8afc;let _0x53bee8;try{_0x53bee8=await _0x58ebed[_0x109522(0x1cf)][_0x109522(0x230)]({'name':_0x62049b['uniqueSegmentName'],'description':_0x62049b['description'],'journeyId':_0x62049b[_0x109522(0x181)],'rule':_0x9d9cd7(_0x62049b[_0x109522(0x224)],!![]),'countPopulation':!![],'parentFolderId':_0x62049b[_0x109522(0x1cd)],'audienceId':_0x62049b[_0x109522(0x212)]});}catch(_0x1d4c93){const _0xd01470=_0x1d4c93 instanceof Error&&_0x1d4c93['message'][_0x109522(0x15a)](_0x109522(0x233));if(_0xd01470){const _0x700b03=readPushRecovery(_0x50e9c4[_0x109522(0x1fd)]),_0x4f1939=_0x700b03?.[_0x109522(0x16b)]===_0x50e9c4[_0x109522(0x1d8)][_0x109522(0x1ea)]?_0x700b03[_0x109522(0x156)][_0x62049b[_0x109522(0x1f8)]]:undefined;if(_0x4f1939?.[_0x109522(0x194)]===_0x62049b[_0x109522(0x240)])await _0x58ebed[_0x109522(0x1cf)]['updateSegmentById'](_0x62049b[_0x109522(0x212)],_0x4f1939['segmentId'],{'description':_0x62049b[_0x109522(0x214)],'rule':_0x9d9cd7(_0x62049b[_0x109522(0x224)],!![]),'countPopulation':!![]}),_0x53bee8=_0x4f1939[_0x109522(0x1a0)];else throw new SDKError(ErrorCode[_0x109522(0x14b)],'Embedded\x20segment\x20\x27'+_0x62049b[_0x109522(0x1f8)]+_0x109522(0x1fe)+(_0x109522(0x229)+_0x50e9c4[_0x109522(0x1fd)][_0x109522(0x199)](/([^/]+)$/,_0x109522(0x227))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x1d4c93);}else throw _0x1d4c93;}return saveSegmentToPushRecovery(_0x50e9c4[_0x109522(0x1fd)],_0x50e9c4[_0x109522(0x1d8)][_0x109522(0x1ea)],_0x62049b[_0x109522(0x1f8)],{'segmentId':_0x53bee8,'uniqueServerName':_0x62049b[_0x109522(0x240)],'createdAt':new Date()['toISOString']()}),_0x53bee8;}export async function prepareSegmentFiles(_0x4f3a9e,_0x122d40,_0x2b9b6d,_0xc1fea,_0x472c8e){const _0x58afb9=a155_0x3e8afc,{activationDefToCreateRequest:_0x52deba}=await import('./child-segment-yaml.js'),_0x3b9b62=[],_0x21b15e=new Set();for(const {yamlConfig:_0x4a8c4c,folderPath:_0xe939c4,sourcePath:_0x2436d9}of _0x4f3a9e){const _0x51cf27=resolveTDFolderPath(_0xe939c4,_0xc1fea,_0x472c8e),_0x5ac887=_0x51cf27+':'+_0x4a8c4c[_0x58afb9(0x1ea)],_0x38fd67=_0x122d40[_0x58afb9(0x14c)]['get'](_0x5ac887),_0x353236=_0x38fd67?_0x122d40['activationsBySegmentId'][_0x58afb9(0x1bd)](_0x38fd67['id'])||[]:[];addFoldersToCreate(_0x51cf27,_0x122d40['folderPathToId'],_0x21b15e);const _0x16a588=calculateActivationActions(_0x4a8c4c['activations']||[],_0x353236,_0x122d40[_0x58afb9(0x1f7)],_0x122d40['connectionIdToNameMap']);for(const _0x33dcfc of _0x16a588){(_0x33dcfc[_0x58afb9(0x20c)]===_0x58afb9(0x148)||_0x33dcfc['type']===_0x58afb9(0x206))&&_0x33dcfc['yamlActivation']&&(_0x33dcfc[_0x58afb9(0x1b5)]=await _0x52deba(_0x33dcfc[_0x58afb9(0x213)],_0x2b9b6d));}const _0x2b61f8=calculateSegmentDiff(_0x4a8c4c,_0x38fd67,_0x353236,_0x122d40[_0x58afb9(0x1f7)],_0x122d40['connectionIdToNameMap']);_0x3b9b62[_0x58afb9(0x209)]({'relativePath':_0x4a8c4c[_0x58afb9(0x1ea)],'absolutePath':_0x2436d9,'yamlConfig':_0x4a8c4c,'folderPath':_0x51cf27,'existingSegment':_0x38fd67,'existingActivations':_0x353236,'isNew':_0x2b61f8['isNew'],'hasChanges':_0x2b61f8[_0x58afb9(0x21c)],'diff':_0x2b61f8[_0x58afb9(0x231)],'activationActions':_0x16a588});}return{'segmentFiles':_0x3b9b62,'foldersToCreate':_0x21b15e};}export async function prepareJourneyFiles(_0x434e48,_0x247edf,_0x38c17a,_0x6d233c){const _0x6be047=a155_0x3e8afc,_0x1d9d23=[],_0x31c1d1=new Set();for(const {yamlConfig:_0x5045d7,folderPath:_0x46d3be,sourcePath:_0x1dc750}of _0x434e48){const _0x2191fa=resolveTDFolderPath(_0x46d3be,_0x38c17a,_0x6d233c),_0x1fb0f1=_0x2191fa+':'+_0x5045d7[_0x6be047(0x1ea)],_0x35efeb=_0x247edf[_0x6be047(0x147)][_0x6be047(0x1bd)](_0x1fb0f1);let _0x5d8863,_0x4f2311;if(_0x35efeb&&_0x35efeb[_0x6be047(0x140)]>0x0){const _0x17954e=buildLocalExpandedRuleMappings(_0x5045d7),{createYamlContext:_0x566564,prefetchJourneySegments:_0x5607c8}=createPushYamlContextForBundle(_0x247edf['deps'],_0x247edf[_0x6be047(0x212)],_0x247edf[_0x6be047(0x15b)],_0x17954e,_0x247edf[_0x6be047(0x1f7)],_0x247edf[_0x6be047(0x19d)],_0x247edf[_0x6be047(0x157)],_0x247edf[_0x6be047(0x1aa)]);await _0x5607c8(_0x35efeb[_0x6be047(0x1ef)](_0x1c962e=>_0x1c962e['id']));const _0x4bbb02=await _0x247edf[_0x6be047(0x1a2)][_0x6be047(0x1e4)][_0x6be047(0x239)](_0x35efeb[0x0][_0x6be047(0x22c)]),_0x5a5642=hasMultipleVersions(_0x5045d7),_0x49745d=async _0x2c3846=>{const _0x119b9f=_0x6be047,_0x8ba404=_0x247edf[_0x119b9f(0x1aa)]?.[_0x119b9f(0x1bd)](_0x2c3846);if(_0x8ba404)return _0x8ba404;return _0x247edf['fetchJourney']({'journeyId':_0x2c3846,'journeyName':_0x5045d7['name'],'isMultiVersion':_0x35efeb[_0x119b9f(0x140)]>0x1});};if(_0x5a5642&&_0x35efeb[_0x6be047(0x140)]>0x1){const _0x3a65e5=[];for(const _0xa1bcb4 of _0x35efeb){const _0x14f2a5=_0xa1bcb4[_0x6be047(0x1d0)]||0x1;_0x247edf['progress']?.[_0x6be047(0x206)](_0x6be047(0x1ba)+_0x5045d7[_0x6be047(0x1ea)]+'\x20v'+_0x14f2a5);const _0x9ef8ec=await _0x49745d(_0xa1bcb4['id']),_0x58931b=_0x566564(_0xa1bcb4['id']),_0x33921a=await journeyResponseToDef(_0x9ef8ec,_0x58931b);_0x3a65e5[_0x6be047(0x209)]({'item':_0xa1bcb4,'yaml':_0x33921a});}const _0x95c0a0=buildLocalRuleToNameMappingFromJourney(_0x5045d7);_0x4f2311=buildMergedJourneyDef(_0x3a65e5,_0x95c0a0,_0x4bbb02);const _0x2f1c3b=Math[_0x6be047(0x198)](..._0x3a65e5[_0x6be047(0x1ef)](_0x5b3c8b=>_0x5b3c8b[_0x6be047(0x23f)]['versionNumber']||0x0)),_0x50b8e6=_0x35efeb[_0x6be047(0x1d4)](_0x1ad251=>(_0x1ad251[_0x6be047(0x1d0)]||0x0)===_0x2f1c3b);_0x50b8e6&&(_0x247edf[_0x6be047(0x187)]?.[_0x6be047(0x206)]('Fetching\x20'+_0x5045d7[_0x6be047(0x1ea)]+'\x20v'+_0x2f1c3b),_0x5d8863=await _0x49745d(_0x50b8e6['id']));}else{const _0x38825f=_0x35efeb[_0x35efeb['length']-0x1];_0x247edf[_0x6be047(0x187)]?.[_0x6be047(0x206)](_0x6be047(0x1ba)+_0x5045d7[_0x6be047(0x1ea)]),_0x5d8863=await _0x49745d(_0x38825f['id']);const _0xd916da=_0x566564(_0x38825f['id']),_0x50e5ab=await journeyResponseToDef(_0x5d8863,_0xd916da),_0x1b44ad=buildLocalRuleToNameMappingFromJourney(_0x5045d7);_0x4f2311=buildMergedJourneyDef([{'item':_0x38825f,'yaml':_0x50e5ab}],_0x1b44ad,_0x4bbb02);}}addFoldersToCreate(_0x2191fa,_0x247edf['folderPathToId'],_0x31c1d1);const _0x50786a=calculateJourneyDiff(_0x5045d7,_0x4f2311);_0x1d9d23[_0x6be047(0x209)]({'relativePath':_0x5045d7[_0x6be047(0x1ea)],'absolutePath':_0x1dc750,'yamlConfig':_0x5045d7,'folderPath':_0x2191fa,'existingJourney':_0x5d8863,'isNew':_0x50786a[_0x6be047(0x1f1)],'hasChanges':_0x50786a[_0x6be047(0x21c)],'diff':_0x50786a[_0x6be047(0x231)]});}return{'journeyFiles':_0x1d9d23,'foldersToCreate':_0x31c1d1};}export function calculateActivationActions(_0x50a2a1,_0x355166,_0x1a99fc,_0x2c8a33){const _0x3297a7=a155_0x3e8afc,_0x5a9355=[],_0x229522=new Map();for(const _0x1e46df of _0x355166){_0x229522[_0x3297a7(0x226)](_0x1e46df[_0x3297a7(0x1ea)],_0x1e46df);}const _0x14a142=new Map();for(const _0x5e23c3 of _0x50a2a1){_0x14a142['set'](_0x5e23c3[_0x3297a7(0x1ea)],_0x5e23c3);}for(const _0x21eb14 of _0x50a2a1){const _0x3d0f88=_0x229522[_0x3297a7(0x1bd)](_0x21eb14[_0x3297a7(0x1ea)]);if(!_0x3d0f88)_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x148),'name':_0x21eb14[_0x3297a7(0x1ea)],'yamlActivation':_0x21eb14});else{const _0x3add0b=activationResponseToDef(_0x3d0f88,_0x1a99fc,_0x2c8a33),_0x3b3404=a155_0x3e9382[_0x3297a7(0x22e)](_0x3add0b),_0x4bb94d=a155_0x3e9382[_0x3297a7(0x22e)](_0x21eb14);_0x3b3404!==_0x4bb94d&&_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x206),'name':_0x21eb14[_0x3297a7(0x1ea)],'yamlActivation':_0x21eb14,'existingActivation':_0x3d0f88});}}for(const _0x270c20 of _0x355166){!_0x14a142[_0x3297a7(0x1c9)](_0x270c20[_0x3297a7(0x1ea)])&&_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x235),'name':_0x270c20[_0x3297a7(0x1ea)],'existingActivation':_0x270c20});}return _0x5a9355;}function calculateYamlDiff(_0xcc43af,_0x462d6b){if(_0x462d6b){const _0x161878=generateDiff(_0x462d6b,_0xcc43af),_0x50d4d5=hasChanges(_0x161878);return{'isNew':![],'hasChanges':_0x50d4d5,'diff':_0x50d4d5?formatDiffWithColors(_0x161878):undefined};}const _0x4dfb80=generateDiff('',_0xcc43af);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4dfb80)};}function a155_0x3ac6(){const _0x57a3f2=['\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','\x27\x20to\x20local\x20\x27','resolveSegment','Updating\x20activation\x20\x27','utf-8','object','embedded_segment_created','activations','\x20activation\x20\x27','journey','25pkSZzP','schedule','user','segmentFolderId','segmentNameToId','name','journeyActivationStepId','Created\x20journey\x20\x27','getActivation','WaitStep','map','keys','isNew',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_created','deleteSegment','steps','connector_config','idToEmailMap','localName','activation_deleted','reduce','\x27...','SEGMENT_SYNTAX_ERROR','absolutePath','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','created','sha1','add','Creating\x20segment\x20\x27','columns','ACTIVATION_SYNTAX_ERROR','deleted','update','createdSegmentIds','toString','push','JOURNEY_SYNTAX_ERROR','Failed\x20to\x20resolve\x20activation\x20','type',').\x20','some','waitStep','Segment\x20not\x20found','tdx.sdk.push-workflow','parentId','yamlActivation','description','ACTIVATION_UPDATE_ERROR','list','size','entry_criteria','folderPath','waitStepUnit','segment_deleting','hasChanges','unchanged','isArray','conditions','filter','goal','resolveJourneyId','Activation','resolvedRule','action','set','.$1.push-recovery.json','4320950inhJNH','Delete\x20the\x20push\x20recovery\x20file\x20(','journeyActivationNameToId','debug','journeyBundleId','\x27\x20not\x20found\x20in\x20journey\x20\x27','stringify','relationships','createJourneySegment','diff','valid','Name\x20has\x20already\x20been\x20taken','Deleting\x20activation\x20\x27','delete','match','rule','startsWith','getLatestJourneyId','join','segment_updating','updated','trim','Condition','item','uniqueSegmentName','goal\x20criteria','onProgress','Activation\x20not\x20found:\x20','\x27\x20from\x20file:\x20','data','length','\x27\x20exit\x20criteria','flatMap','218MGgmIj','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Failed\x20to\x20','buildUserMaps','journeyBundlesByFolderAndName','create','128094YVcFBs','embedded_activation_created','SEGMENT_UPDATE_ERROR','segmentByFolderAndName','journey_entry_criteria_','activation_deleting','154ulRevl','existingSegment','createActivation','nameToId','null','\x27\x20by\x20rule\x20content','rootFolderId','segments','activationStepsById','1912JRDgFv','\x27\x20entry\x20criteria','includes','existingSegments','Journey\x20\x27','run_after_journey_refresh','kind','parse','relative','11dLWVxB','index','activation_','parentFolder','embeddedSegmentNameToId','activation_creating','activationActions','conditionTimeoutUnit','attributes','journeyStages','journeyName','with','createSegment','branches','conditionTimeoutDuration','segment_deleted','./child-segment-yaml.js','activation_template_id','Created\x20activation\x20\x27','journeyBundleName','logDeleted','from','\x27\x20wait\x20condition','169GdjHpP','):\x20','parseDocument','exitCriterias','embedded_activation_creating','Segment\x20not\x20found:\x20','parentSegmentFolder','listActivations','sort','journeyId','conditionSegmentId','journey_updating','Failed\x20to\x20resolve\x20segment\x20','segment_creating','Stage\x20\x27','progress','getSegment','waitStepType','getSegmentEntity','draft','dirname','560424JTbCiZ','segment_updated','nameToType','DecisionPoint','split','existingActivation','folderPathToId','uniqueServerName','slice','entryCriteria','172992LJldAS','max','replace','journey_creating','\x20segment\x20from\x20file:\x20','\x20journey\x20from\x20file:\x20','connectionIdToNameMap','activationContext','createdSegmentId','segmentId','hex','deps','176859mNYRZY','Updated\x20activation\x20\x27','SEGMENT_NOT_FOUND','entries','getSegment\x20failed\x20for\x20','../../utils/async.js','Deleted\x20segment\x20\x27','journeyById','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20(referenced\x20in\x20journey\x20','__pending_act_','day','milestone','getSegmentEntity\x20also\x20failed\x20for\x20','stage\x20\x27','logInfo','\x27\x20milestone','activation_updated','validatedRequest','journeys','NOT_FOUND','Entry\x20criteria:\x20','all_columns','Fetching\x20','existingJourney','notification','get','logSuccess','toLowerCase','updateSegmentById','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','skipSegments','87612RDreFH','withProgress','Duration','journey_created','./journey-yaml.js','values','has','\x0a\x20\x20','152uRhLOt','results','folderId','JOURNEY_UPDATE_ERROR','segment','versionNumber','connection','folder_creating','Updated\x20journey\x20\x27','find','updateActivation','Updated\x20segment\x20\x27','getJourney','yamlConfig','INTERNAL','behavior'];a155_0x3ac6=function(){return _0x57a3f2;};return a155_0x3ac6();}export function calculateSegmentDiff(_0x46a00e,_0x3a5a95,_0x2eb6a1,_0x3f1211,_0x29d5d7){const _0xf0d31e=segmentToYamlString(_0x46a00e),_0x2d9a85=_0x3a5a95?segmentToYamlString(segmentWithActivationsToYaml(_0x3a5a95,_0x2eb6a1,undefined,_0x3f1211,_0x29d5d7)):undefined;return calculateYamlDiff(_0xf0d31e,_0x2d9a85);}export function calculateJourneyDiff(_0x44b661,_0x472fc2){const _0x5af34b=normalizeJourneyDef(_0x44b661,_0x44b661),_0x34a97b=a155_0xf7453a(_0x5af34b),_0x335882=_0x472fc2?a155_0xf7453a(normalizeJourneyDef(_0x472fc2,_0x44b661)):undefined;return calculateYamlDiff(_0x34a97b,_0x335882);}export function findSegmentsToDelete(_0x5bdb26,_0x399bd9,_0xa43a3,_0x18b27e,_0x2b1646){const _0x20b798=a155_0x3e8afc,_0x35be86=new Set();for(const {yamlConfig:_0x5ad60c,folderPath:_0xaf0c9d}of _0x399bd9){_0x35be86['add'](_0xaf0c9d+':'+_0x5ad60c[_0x20b798(0x1ea)]);}return _0x5bdb26[_0x20b798(0x220)](_0xbf7a1=>{const _0x25b5b4=_0x20b798,_0x5ca8c2=_0xbf7a1[_0x25b5b4(0x1e8)]?_0xa43a3[_0x25b5b4(0x1bd)](_0xbf7a1[_0x25b5b4(0x1e8)][_0x25b5b4(0x208)]())||'':'',_0x11a761=_0x5ca8c2+':'+_0xbf7a1[_0x25b5b4(0x1ea)];if(_0x35be86[_0x25b5b4(0x1c9)](_0x11a761))return![];if(_0x2b1646)return _0x5ca8c2===_0x18b27e||_0x5ca8c2[_0x25b5b4(0x238)](_0x18b27e+'/');return!![];});}export function findJourneysToDelete(_0x2c854e,_0xe00316,_0x49085f,_0x42d506,_0x1c6f81){const _0x4d0221=a155_0x3e8afc,_0x59ece5=new Set();for(const {yamlConfig:_0x1eb8e8,folderPath:_0x1ad7e0}of _0xe00316){_0x59ece5[_0x4d0221(0x201)](_0x1ad7e0+':'+_0x1eb8e8['name']);}return _0x2c854e[_0x4d0221(0x220)](_0x967121=>{const _0x28ebb3=_0x4d0221,_0x10fa67=_0x967121['folderId']?_0x49085f[_0x28ebb3(0x1bd)](_0x967121['folderId'])||'':'',_0x26ecc7=_0x10fa67+':'+_0x967121[_0x28ebb3(0x174)];if(_0x59ece5[_0x28ebb3(0x1c9)](_0x26ecc7))return![];if(_0x1c6f81)return _0x10fa67===_0x42d506||_0x10fa67['startsWith'](_0x42d506+'/');return!![];});}export function buildSegmentLookupMap(_0x2bba65,_0x304f2a){const _0x334399=a155_0x3e8afc,_0x46a236=new Map();for(const _0x25af9e of _0x2bba65){const _0x41f9d8=_0x25af9e[_0x334399(0x1e8)]?_0x304f2a[_0x334399(0x1bd)](_0x25af9e[_0x334399(0x1e8)][_0x334399(0x208)]())||'':'',_0xc38b4b=_0x41f9d8+':'+_0x25af9e[_0x334399(0x1ea)];_0x46a236[_0x334399(0x226)](_0xc38b4b,_0x25af9e);}return _0x46a236;}export function buildSegmentNameToIdMap(_0x1c2b79){const _0x57cf6d=a155_0x3e8afc,_0x5a88e0=new Map();for(const _0x2b8710 of _0x1c2b79){_0x5a88e0[_0x57cf6d(0x226)](_0x2b8710[_0x57cf6d(0x1ea)],_0x2b8710['id']);}return _0x5a88e0;}export function buildJourneyBundleLookupMap(_0x15c5ef,_0x54265d){const _0x5625c0=a155_0x3e8afc,_0x28bfc8=new Map();for(const _0x37afad of _0x15c5ef){const _0x1232f8=_0x37afad['folderId']?_0x54265d[_0x5625c0(0x1bd)](_0x37afad[_0x5625c0(0x1cd)])||'':'',_0x175aeb=_0x1232f8+':'+_0x37afad['journeyBundleName'];!_0x28bfc8['has'](_0x175aeb)&&_0x28bfc8[_0x5625c0(0x226)](_0x175aeb,[]),_0x28bfc8[_0x5625c0(0x1bd)](_0x175aeb)[_0x5625c0(0x209)](_0x37afad);}for(const _0x2aebf9 of _0x28bfc8[_0x5625c0(0x1c8)]()){_0x2aebf9[_0x5625c0(0x180)]((_0x4d8534,_0x3281b2)=>(_0x4d8534[_0x5625c0(0x1d0)]||0x0)-(_0x3281b2[_0x5625c0(0x1d0)]||0x0));}return _0x28bfc8;}export function collectFoldersToCreate(_0x1dbdb5,_0x1e2ad7){const _0x448312=a155_0x3e8afc,_0x1451c8=new Set();for(const _0x4ec888 of _0x1dbdb5){if(!_0x4ec888)continue;if(_0x1e2ad7[_0x448312(0x1c9)](_0x4ec888))continue;const _0x3b801e=_0x4ec888[_0x448312(0x191)]('/');let _0x702f7e='';for(const _0x2edbd1 of _0x3b801e){_0x702f7e=_0x702f7e?_0x702f7e+'/'+_0x2edbd1:_0x2edbd1,!_0x1e2ad7[_0x448312(0x1c9)](_0x702f7e)&&_0x1451c8['add'](_0x702f7e);}}return _0x1451c8;}export function parseAndClassifyYamlFiles(_0x4c2f70,_0x27ca64,_0x410b1c){const _0x2b9305=a155_0x3e8afc,_0x13f962=[],_0x4f215c=[];for(const _0x1d6f66 of _0x4c2f70){const _0x16e2b3=a155_0x405b9f['relative'](_0x27ca64,a155_0x405b9f[_0x2b9305(0x18c)](_0x1d6f66)),_0x4c7cf1=_0x16e2b3==='.'?'':_0x16e2b3[_0x2b9305(0x199)](/\\/g,'/'),_0xd1aecc=readFileSync(_0x1d6f66,'utf-8'),_0x28743d=a155_0x3e9382[_0x2b9305(0x15f)](_0xd1aecc);if(isJourneyDef(_0x28743d)){const _0x735f9=a155_0x273a5a(_0xd1aecc);_0x4f215c[_0x2b9305(0x209)]({'yamlConfig':_0x735f9,'folderPath':_0x4c7cf1,'sourcePath':_0x1d6f66});}else{if(!_0x410b1c?.[_0x2b9305(0x1c2)]){const _0x382929=parseSegmentYamlFile(_0xd1aecc),_0x212975=normalizeChildSegmentYaml(_0x382929);_0x13f962[_0x2b9305(0x209)]({'yamlConfig':_0x212975,'folderPath':_0x4c7cf1,'sourcePath':_0x1d6f66});}}}return{'segments':_0x13f962,'journeys':_0x4f215c};}export function validateParsedFiles(_0x24dd3e,_0x4b1366){const _0x530acd=a155_0x3e8afc,_0x5b3d22=[];for(const {yamlConfig:_0x291212,sourcePath:_0x1270cf}of _0x24dd3e[_0x530acd(0x156)]){const _0x173579=readFileSync(_0x1270cf,_0x530acd(0x1df)),_0x97b394=a155_0x3e9382['parseDocument'](_0x173579),_0x67347=validateSegmentDef(_0x291212,{'source':_0x173579,'document':_0x97b394},{'skipSchema':!![]});if(!_0x67347[_0x530acd(0x232)]){const _0x3379f9=a155_0x405b9f['relative'](_0x4b1366,_0x1270cf);_0x5b3d22[_0x530acd(0x209)]({'filePath':_0x3379f9,'source':_0x173579,'result':_0x67347,'isJourney':![]});}}for(const {yamlConfig:_0x36490c,sourcePath:_0x123b8e}of _0x24dd3e[_0x530acd(0x1b6)]){const _0x21b193=readFileSync(_0x123b8e,_0x530acd(0x1df)),_0x13fe88=a155_0x3e9382[_0x530acd(0x17a)](_0x21b193),_0x4d4678=validateJourneyDef(_0x36490c,{'source':_0x21b193,'document':_0x13fe88},{'skipSchema':!![]});if(!_0x4d4678[_0x530acd(0x232)]){const _0x2406af=a155_0x405b9f[_0x530acd(0x160)](_0x4b1366,_0x123b8e);_0x5b3d22[_0x530acd(0x209)]({'filePath':_0x2406af,'source':_0x21b193,'result':_0x4d4678,'isJourney':!![]});}}return _0x5b3d22;}export function formatValidationErrors(_0x2338f7){const _0xf2dcb8=a155_0x3e8afc,_0x3f2670=[];for(const {filePath:_0x4b5ab0,source:_0x69feb4,result:_0x1b207e,isJourney:_0x20858a}of _0x2338f7){const _0x25c71c=_0x20858a?'journey':_0xf2dcb8(0x1cf);_0x3f2670['push']('\x0a'+_0x4b5ab0+'\x20('+_0x25c71c+_0xf2dcb8(0x179)+_0x1b207e['errors'][_0xf2dcb8(0x140)]+'\x20error(s)'),_0x3f2670[_0xf2dcb8(0x209)](formatValidationResult(_0x1b207e,_0x69feb4,_0x4b5ab0));}return _0x3f2670[_0xf2dcb8(0x23a)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x1368ac){const _0x113d63=a155_0x3e8afc,_0x19dff9=new Set(),_0x46ed8c=new Map(),_0x407891=collectSegmentUsageCounts(_0x1368ac);if(_0x1368ac[_0x113d63(0x156)])for(const [_0x1ebf0f,_0x3272f6]of Object['entries'](_0x1368ac[_0x113d63(0x156)])){_0x19dff9['add'](_0x1ebf0f);if(_0x3272f6['rule']){const _0x371d1b=yamlRuleToApi(_0x3272f6[_0x113d63(0x237)]),_0x1a1cc9=apiRuleToYaml(_0x371d1b);_0x46ed8c[_0x113d63(0x226)](_0x1ebf0f,_0x1a1cc9);}}const _0x44ba13=new Map();let _0x4706e3=0x0;for(const [_0x413c86,_0xd924bd]of _0x46ed8c){const _0x3ee884=serializeExpandedRule(_0xd924bd,_0x46ed8c),_0x507fc4=_0x44ba13['get'](_0x3ee884)||[];_0x507fc4['push']({'name':_0x413c86,'index':_0x4706e3}),_0x44ba13[_0x113d63(0x226)](_0x3ee884,_0x507fc4),_0x4706e3++;}const _0x3dabaa=new Map();for(const [_0x322049,_0x835e20]of _0x44ba13){const _0x348084=_0x835e20[_0x113d63(0x195)]()[_0x113d63(0x180)]((_0x123f15,_0x49929b)=>{const _0x2511bc=_0x113d63,_0x3f0e56=_0x407891['get'](_0x123f15[_0x2511bc(0x1ea)])||0x0,_0x4c257a=_0x407891[_0x2511bc(0x1bd)](_0x49929b[_0x2511bc(0x1ea)])||0x0;if(_0x3f0e56!==_0x4c257a)return _0x4c257a-_0x3f0e56;return _0x123f15[_0x2511bc(0x162)]-_0x49929b['index'];})[_0x113d63(0x1ef)](_0x82f2b=>_0x82f2b[_0x113d63(0x1ea)]),_0x2abf29=[];for(const _0x5bf556 of _0x348084){const _0x3281c2=_0x407891['get'](_0x5bf556)||0x0,_0x14b95e=Math[_0x113d63(0x198)](_0x3281c2,0x1);for(let _0x78a62b=0x0;_0x78a62b<_0x14b95e;_0x78a62b++){_0x2abf29[_0x113d63(0x209)](_0x5bf556);}}_0x3dabaa[_0x113d63(0x226)](_0x322049,_0x2abf29);}return{'existingLocalSegmentNames':_0x19dff9,'localSegmentRules':_0x46ed8c,'localExpandedRuleToNames':_0x3dabaa};}export function createSegmentIdResolver(_0x2bf81c,_0x3c55d6){return async _0x11f007=>{const _0x4cccac=a155_0x4ade,_0x50471b=_0x2bf81c['get'](_0x11f007);if(!_0x50471b)throw new SDKError(ErrorCode[_0x4cccac(0x1a5)],_0x4cccac(0x17d)+_0x11f007+_0x4cccac(0x144)+_0x3c55d6+'\x27)');return _0x50471b;};}export function extractRootFolderId(_0xcd9459){const _0x180dc5=a155_0x3e8afc;return _0xcd9459[_0x180dc5(0x22f)]?.[_0x180dc5(0x17e)]?.[_0x180dc5(0x13f)]?.['id']||_0xcd9459[_0x180dc5(0x22f)]?.[_0x180dc5(0x164)]?.[_0x180dc5(0x13f)]?.['id'];}export function buildConnectionMaps(_0x447c5b){const _0x4199e2=a155_0x3e8afc,_0x17a2e0=new Map(),_0x486814=new Map(),_0x33d386=new Map();for(const _0x26b8bc of _0x447c5b){_0x17a2e0[_0x4199e2(0x226)](_0x26b8bc[_0x4199e2(0x1ea)],parseInt(_0x26b8bc['id'],0xa)),_0x486814[_0x4199e2(0x226)](_0x26b8bc['id'],_0x26b8bc['name']),_0x33d386[_0x4199e2(0x226)](_0x26b8bc[_0x4199e2(0x1ea)],_0x26b8bc[_0x4199e2(0x20c)]);}return{'nameToId':_0x17a2e0,'idToName':_0x486814,'nameToType':_0x33d386};}export function calculatePushStats(_0x575502,_0xf32ab7,_0x2e2778,_0x50f577,_0x4119dd,_0x909440,_0x449f42){const _0x1cec2d=a155_0x3e8afc,_0x2a3aa1=_0x575502[_0x1cec2d(0x220)](_0x550c26=>_0x550c26['isNew']),_0x4f58c7=_0x575502[_0x1cec2d(0x220)](_0x5e4c36=>!_0x5e4c36[_0x1cec2d(0x1f1)]&&_0x5e4c36[_0x1cec2d(0x21c)]),_0x406e74=_0x575502[_0x1cec2d(0x220)](_0x17f899=>!_0x17f899[_0x1cec2d(0x1f1)]&&!_0x17f899[_0x1cec2d(0x21c)]),_0x211bc1=_0x909440?_0x50f577:[],_0x663c9=_0xf32ab7[_0x1cec2d(0x220)](_0x65f974=>_0x65f974[_0x1cec2d(0x1f1)]),_0x595c49=_0xf32ab7[_0x1cec2d(0x220)](_0x427662=>!_0x427662['isNew']&&_0x427662[_0x1cec2d(0x21c)]),_0x13f75a=_0xf32ab7[_0x1cec2d(0x220)](_0xc6651f=>!_0xc6651f[_0x1cec2d(0x1f1)]&&!_0xc6651f[_0x1cec2d(0x21c)]),_0x12a91f=_0x909440?_0x4119dd:[],_0x4ce7a9=_0x575502[_0x1cec2d(0x142)](_0x2aba01=>_0x2aba01[_0x1cec2d(0x167)]),_0x52256c=_0x4ce7a9[_0x1cec2d(0x220)](_0x488807=>_0x488807[_0x1cec2d(0x20c)]===_0x1cec2d(0x148)),_0x58dd51=_0x4ce7a9['filter'](_0xa376ed=>_0xa376ed[_0x1cec2d(0x20c)]===_0x1cec2d(0x206)),_0x491ec0=_0x4ce7a9[_0x1cec2d(0x220)](_0x2d7d9c=>_0x2d7d9c[_0x1cec2d(0x20c)]===_0x1cec2d(0x235)),_0x5ac204=Array[_0x1cec2d(0x176)](_0x2e2778)[_0x1cec2d(0x180)](),_0x120dba=_0x449f42?![]:_0x2a3aa1['length']>0x0||_0x4f58c7[_0x1cec2d(0x140)]>0x0||_0x211bc1[_0x1cec2d(0x140)]>0x0,_0x4ba015=_0x663c9[_0x1cec2d(0x140)]>0x0||_0x595c49[_0x1cec2d(0x140)]>0x0||_0x12a91f[_0x1cec2d(0x140)]>0x0,_0x12d8b5=_0x449f42?![]:_0x4ce7a9[_0x1cec2d(0x140)]>0x0,_0x1634fb=_0x5ac204['length']>0x0;return{'segments':{'new':_0x2a3aa1,'changed':_0x4f58c7,'unchanged':_0x406e74,'toDelete':_0x211bc1},'journeys':{'new':_0x663c9,'changed':_0x595c49,'unchanged':_0x13f75a,'toDelete':_0x12a91f},'activations':{'all':_0x4ce7a9,'toCreate':_0x52256c,'toUpdate':_0x58dd51,'toDelete':_0x491ec0},'folders':{'toCreate':_0x5ac204},'counts':{'segments':{'new':_0x2a3aa1[_0x1cec2d(0x140)],'changed':_0x4f58c7[_0x1cec2d(0x140)],'unchanged':_0x406e74['length'],'toDelete':_0x211bc1[_0x1cec2d(0x140)]},'journeys':{'new':_0x663c9[_0x1cec2d(0x140)],'changed':_0x595c49['length'],'unchanged':_0x13f75a['length'],'toDelete':_0x12a91f['length']},'activations':{'create':_0x52256c[_0x1cec2d(0x140)],'update':_0x58dd51[_0x1cec2d(0x140)],'delete':_0x491ec0[_0x1cec2d(0x140)]},'folders':_0x5ac204[_0x1cec2d(0x140)]},'hasChanges':_0x120dba||_0x4ba015||_0x12d8b5||_0x1634fb};}export async function buildPushExecutionContext(_0x293d93,_0x386119,_0x9b087f,_0x37b283,_0x5774a5,_0x58337c){const _0x393242=a155_0x3e8afc,_0x3002e9=extractRootFolderId(_0x9b087f),{pathToId:_0x307bd9,idToPath:_0x1eee56}=buildFolderMaps(_0x5774a5),_0x57b79f=buildSegmentNameToIdMap(_0x37b283),_0x5ce808=new Map(),{batchAsync:_0x31f6cf}=await import(_0x393242(0x1a8)),[_0x2560fd,_0x27432f]=await Promise['all']([_0x293d93[_0x393242(0x1e7)][_0x393242(0x146)](),_0x293d93[_0x393242(0x1d1)][_0x393242(0x216)](),((async()=>{const _0x3108e9=_0x393242;!_0x58337c&&_0x37b283[_0x3108e9(0x140)]>0x0&&await _0x31f6cf(_0x37b283,async _0x307f3e=>{const _0x262530=_0x3108e9,_0x53c655=await _0x293d93[_0x262530(0x1cf)][_0x262530(0x17f)](_0x386119,_0x307f3e['id']);_0x5ce808[_0x262530(0x226)](_0x307f3e['id'],_0x53c655);});})())]),{emailToId:_0x5e92e3,idToEmail:_0x4a6208}=_0x2560fd,_0x3b6ab0=buildConnectionMaps(_0x27432f);return{'rootFolderId':_0x3002e9,'folderPathToId':_0x307bd9,'folderIdToPath':_0x1eee56,'segmentNameToId':_0x57b79f,'activationsBySegmentId':_0x5ce808,'emailToIdMap':_0x5e92e3,'idToEmailMap':_0x4a6208,'connectionNameToIdMap':_0x3b6ab0[_0x393242(0x152)],'connectionIdToNameMap':_0x3b6ab0['idToName'],'connectionNameToTypeMap':_0x3b6ab0[_0x393242(0x18f)]};}export function createPushYamlContextForBundle(_0x2801f5,_0x174031,_0x1adb85,_0x593d12,_0x1d8202,_0x4930fa,_0x29b469,_0x403b28){const {existingLocalSegmentNames:_0x21c146,localExpandedRuleToNames:_0x109722}=_0x593d12,_0x5ca435=new Set(),_0x44cbd=new Map(),_0x31b0a9=new Map(),_0x50b31a=new Map(),_0x18ec09=createJumpTargetCache(),_0x3aeabb=new Map(),_0x19e7a2=new Map(),_0x4db2b4=new Set();let _0x5c19ea;const _0x26acd7=_0x3c3151=>{const _0x20f263={'resolveSegment':async _0x360071=>{const _0x5d9fb2=a155_0x4ade,_0x5e9e60=_0x50b31a[_0x5d9fb2(0x1bd)](_0x360071);if(_0x5e9e60!==undefined)return{'name':_0x5e9e60,'isJourneyLocal':!![]};try{const _0x2965eb=await fetchSegment(_0x2801f5,_0x174031,_0x360071,_0x1adb85);if(!_0x2965eb)throw new Error(_0x5d9fb2(0x210));const _0x39904b=generateJourneyLocalName(_0x2965eb[_0x5d9fb2(0x1ea)]),_0x5857e9=_0x2965eb[_0x5d9fb2(0x15e)]===SEGMENT_KIND_JOURNEY&&_0x39904b!==undefined;let _0x57c5b0=_0x2965eb[_0x5d9fb2(0x1ea)],_0x12255f;if(_0x5857e9&&_0x2965eb[_0x5d9fb2(0x237)]){const _0x5cf297=apiRuleToYaml(_0x2965eb[_0x5d9fb2(0x237)]);_0x19e7a2[_0x5d9fb2(0x226)](_0x360071,_0x5cf297);const _0x163521=async _0x5a265e=>{const _0x9b0f40=_0x5d9fb2,_0x1e3378=collectSegmentRefsFromRule(_0x5a265e);for(const _0x349704 of _0x1e3378){if(!_0x19e7a2[_0x9b0f40(0x1c9)](_0x349704))try{const _0x46ea62=await fetchSegment(_0x2801f5,_0x174031,_0x349704,_0x1adb85);if(_0x46ea62?.[_0x9b0f40(0x237)]){const _0x3007cb=apiRuleToYaml(_0x46ea62[_0x9b0f40(0x237)]);_0x19e7a2[_0x9b0f40(0x226)](_0x349704,_0x3007cb),await _0x163521(_0x3007cb);}}catch(_0x5eda44){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x349704+':\x20'+_0x5eda44);}}};await _0x163521(_0x5cf297);const _0x2b2bf2=serializeExpandedRule(_0x5cf297,_0x19e7a2),_0x31f0d4=_0x109722[_0x5d9fb2(0x1bd)](_0x2b2bf2);if(_0x31f0d4&&_0x31f0d4[_0x5d9fb2(0x140)]>0x0){const _0x3d3661=_0x44cbd[_0x5d9fb2(0x1bd)](_0x2b2bf2)||0x0,_0x2f1adb=_0x31f0d4[_0x3d3661]||_0x31f0d4[_0x31f0d4[_0x5d9fb2(0x140)]-0x1];_0x44cbd['set'](_0x2b2bf2,_0x3d3661+0x1),_0x57c5b0=_0x2f1adb,_0x5ca435[_0x5d9fb2(0x201)](_0x57c5b0),_0x50b31a[_0x5d9fb2(0x226)](_0x360071,_0x57c5b0);const _0x13f7e5=await resolveRuleSegmentRefs(_0x5cf297,async _0x2c40b7=>{const _0x218d0b=_0x5d9fb2,_0x2b87eb=_0x50b31a[_0x218d0b(0x1bd)](_0x2c40b7);if(_0x2b87eb)return _0x2b87eb;const _0x322c53=await _0x5c19ea[_0x218d0b(0x1dd)](_0x2c40b7);return _0x322c53[_0x218d0b(0x1ea)];});_0x12255f={'description':_0x2965eb[_0x5d9fb2(0x214)],'rule':_0x13f7e5};}else{const _0x4ea653=_0x3aeabb[_0x5d9fb2(0x1bd)](_0x2b2bf2);if(_0x4ea653)_0x57c5b0=_0x4ea653,_0x50b31a['set'](_0x360071,_0x57c5b0);else{if(_0x39904b){let _0x2109d5=_0x39904b,_0x3545a6=0x2;while(_0x5ca435[_0x5d9fb2(0x1c9)](_0x2109d5)||_0x21c146[_0x5d9fb2(0x1c9)](_0x2109d5)){_0x2109d5=_0x39904b+'_'+_0x3545a6,_0x3545a6++;}_0x5ca435[_0x5d9fb2(0x201)](_0x2109d5),_0x57c5b0=_0x2109d5;}_0x50b31a['set'](_0x360071,_0x57c5b0),_0x3aeabb['set'](_0x2b2bf2,_0x57c5b0);const _0x39a1bf=await resolveRuleSegmentRefs(_0x5cf297,async _0x19b470=>{const _0x1a822d=_0x5d9fb2,_0x163b33=_0x50b31a[_0x1a822d(0x1bd)](_0x19b470);if(_0x163b33)return _0x163b33;const _0x1230b2=await _0x5c19ea[_0x1a822d(0x1dd)](_0x19b470);return _0x1230b2[_0x1a822d(0x1ea)];});_0x12255f={'description':_0x2965eb[_0x5d9fb2(0x214)],'rule':_0x39a1bf};}}}return{'name':_0x57c5b0,'isJourneyLocal':_0x5857e9,'definition':_0x12255f};}catch(_0x1d7c42){return logger[_0x5d9fb2(0x22b)](_0x5d9fb2(0x184)+_0x360071+':\x20'+_0x1d7c42),{'name':_0x360071,'isJourneyLocal':![]};}},'resolveActivation':async _0x227aec=>{const _0x134cff=a155_0x4ade,_0x36a2b6=_0x31b0a9['get'](_0x227aec);if(_0x36a2b6!==undefined)return{'name':_0x36a2b6,'isJourneyLocal':!![]};try{let _0x32b6d2=_0x29b469?.[_0x134cff(0x1bd)](_0x227aec);!_0x32b6d2&&(_0x32b6d2=await _0x2801f5[_0x134cff(0x1e4)][_0x134cff(0x1ed)](_0x3c3151,_0x227aec));const _0x4366e4=_0x32b6d2[_0x134cff(0x169)]['activationParams'][_0x134cff(0x1ea)]||_0x227aec,_0x49c328=sanitizeYamlKey(_0x4366e4)||_0x134cff(0x163)+_0x227aec,_0x4f610c=_0x49c328;_0x31b0a9[_0x134cff(0x226)](_0x227aec,_0x4f610c);const _0x4e9642=journeyActivationStepToYaml(_0x32b6d2,_0x1d8202,_0x4930fa);return{'name':_0x4f610c,'isJourneyLocal':!![],'definition':_0x4e9642};}catch(_0x575540){return logger['debug'](_0x134cff(0x20b)+_0x227aec+':\x20'+_0x575540),{'name':_0x227aec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x50e640,_0x24fd28)=>resolveJumpTarget(_0x50e640,_0x24fd28,_0x18ec09,async _0x46074c=>{const _0x2321cf=a155_0x4ade,_0xb86ba6=_0x403b28?.[_0x2321cf(0x1bd)](_0x46074c);if(_0xb86ba6)return _0xb86ba6;return _0x2801f5[_0x2321cf(0x1e4)][_0x2321cf(0x1d7)](_0x46074c);})};return _0x5c19ea=_0x20f263,_0x20f263;},_0x2749ba=async _0x189d50=>{const _0x2d4777=a155_0x4ade,{collectSegmentIdsFromJourneyApi:_0x153122}=await import(_0x2d4777(0x1c7)),{batchAsync:_0x2fd0d3}=await import('../../utils/async.js'),_0x48f8f7=new Set();for(const _0x1e6991 of _0x189d50){let _0xd116b0=_0x403b28?.[_0x2d4777(0x1bd)](_0x1e6991);!_0xd116b0&&(_0xd116b0=await _0x2801f5[_0x2d4777(0x1e4)][_0x2d4777(0x1d7)](_0x1e6991));const _0x2da71b=_0x153122(_0xd116b0);for(const _0x14feff of _0x2da71b){_0x48f8f7['add'](_0x14feff);}}let _0x3d53da=Array[_0x2d4777(0x176)](_0x48f8f7);while(_0x3d53da[_0x2d4777(0x140)]>0x0){const _0x4dccd6=_0x3d53da['filter'](_0x4805ed=>!_0x4db2b4['has'](_0x4805ed));if(_0x4dccd6[_0x2d4777(0x140)]===0x0)break;const _0x390df5=await _0x2fd0d3(_0x4dccd6,async _0x2b26d2=>{_0x4db2b4['add'](_0x2b26d2);const _0x274da6=await fetchSegment(_0x2801f5,_0x174031,_0x2b26d2,_0x1adb85);if(!_0x274da6)return null;return{'segmentId':_0x2b26d2,'segment':_0x274da6};},0xa),_0x5f2e50=new Set();for(const _0xd1858e of _0x390df5){if(!_0xd1858e?.[_0x2d4777(0x1cf)]?.[_0x2d4777(0x237)])continue;const _0x393e47=apiRuleToYaml(_0xd1858e['segment'][_0x2d4777(0x237)]);_0x19e7a2['set'](_0xd1858e['segmentId'],_0x393e47);const _0x964bd6=collectSegmentRefsFromRule(_0x393e47);for(const _0x16c502 of _0x964bd6){!_0x4db2b4[_0x2d4777(0x1c9)](_0x16c502)&&_0x5f2e50[_0x2d4777(0x201)](_0x16c502);}}_0x3d53da=Array['from'](_0x5f2e50);}};return{'createYamlContext':_0x26acd7,'prefetchJourneySegments':_0x2749ba};}export async function executePushSegments(_0xe51685,_0x1f3583,_0x549dfe,_0x15daf3,_0x1cee54){const _0x4d2367=a155_0x3e8afc,{segmentDefToCreateRequest:_0x4bb4c4,segmentDefToUpdateRequest:_0x1d7c0b}=await import(_0x4d2367(0x171)),_0x23f801=_0x549dfe[_0x4d2367(0x193)],_0x2112a6=0x5,_0x5ae251=async _0x3fb02a=>{const _0x307264=_0x4d2367,_0x43de5f=_0x3fb02a['folderPath']?_0x23f801[_0x307264(0x1bd)](_0x3fb02a[_0x307264(0x219)]):undefined;let _0x137b4b;const _0x255bc1={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x4ecdeb=_0x3fb02a[_0x307264(0x1d8)];if(_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x237)]){const _0x4b55ee=createSegmentIdResolver(_0x549dfe['segmentNameToId'],_0x3fb02a['yamlConfig'][_0x307264(0x1ea)]),_0x31b538=await resolveRuleSegmentIds(_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x237)],_0x4b55ee);_0x4ecdeb={..._0x3fb02a[_0x307264(0x1d8)],'rule':_0x31b538};}try{if(_0x3fb02a[_0x307264(0x1f1)]){_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x185),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]});const _0x41be83=_0x4bb4c4(_0x4ecdeb,_0x43de5f),_0x29e23c=await _0x1cee54[_0x307264(0x1c4)](_0x307264(0x202)+_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]+_0x307264(0x1fb),()=>_0xe51685[_0x307264(0x1cf)][_0x307264(0x16d)](_0x15daf3['parentId'],_0x41be83));_0x137b4b=_0x29e23c['data']['id'],_0x549dfe[_0x307264(0x1e9)][_0x307264(0x226)](_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)],_0x137b4b),_0x255bc1[_0x307264(0x19f)]={'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)],'id':_0x137b4b},_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x1f3),'name':_0x3fb02a['yamlConfig'][_0x307264(0x1ea)],'segmentId':_0x137b4b}),_0x1cee54[_0x307264(0x1be)]?.('Created\x20segment\x20\x27'+_0x3fb02a[_0x307264(0x1d8)]['name']+'\x27'),_0x255bc1[_0x307264(0x1ff)]=0x1;}else{if(_0x3fb02a[_0x307264(0x21c)]){_0x1cee54['onProgress']?.({'type':_0x307264(0x23b),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]});const _0x349308=_0x1d7c0b(_0x4ecdeb);_0x43de5f!==_0x3fb02a[_0x307264(0x150)]?.[_0x307264(0x1e8)]&&(_0x349308[_0x307264(0x1e8)]=_0x43de5f?parseInt(_0x43de5f,0xa):undefined),await _0x1cee54[_0x307264(0x1c4)]('Updating\x20segment\x20\x27'+_0x3fb02a['yamlConfig'][_0x307264(0x1ea)]+_0x307264(0x1fb),()=>_0xe51685[_0x307264(0x1cf)][_0x307264(0x1c0)](_0x15daf3[_0x307264(0x212)],_0x3fb02a['existingSegment']['id'],_0x349308)),_0x137b4b=_0x3fb02a[_0x307264(0x150)]['id'],_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x18e),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]}),_0x1cee54[_0x307264(0x1be)]?.(_0x307264(0x1d6)+_0x3fb02a[_0x307264(0x1d8)]['name']+'\x27'),_0x255bc1[_0x307264(0x23c)]=0x1;}else _0x137b4b=_0x3fb02a[_0x307264(0x150)]['id'];}}catch(_0x249aed){const _0x5aed34=isHttp400Error(_0x249aed),_0x59e4cd=_0x5aed34?ErrorCode[_0x307264(0x1fc)]:ErrorCode[_0x307264(0x14b)],_0x3ad62a=getErrorMessage(_0x249aed);throw new SDKError(_0x59e4cd,_0x307264(0x145)+(_0x3fb02a[_0x307264(0x1f1)]?_0x307264(0x148):'update')+_0x307264(0x19b)+_0x3fb02a[_0x307264(0x1fd)]+_0x307264(0x1ca)+_0x3ad62a,_0x249aed);}try{const _0x2ccb13=await syncActivationsForSegment(_0xe51685,_0x15daf3['parentId'],_0x137b4b,_0x3fb02a['yamlConfig'][_0x307264(0x1ea)],_0x3fb02a['activationActions'],_0x1cee54,_0x3fb02a[_0x307264(0x1fd)]);_0x255bc1[_0x307264(0x1e2)]=_0x2ccb13;}catch(_0x19fbfd){if(_0x19fbfd instanceof SDKError)throw _0x19fbfd;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]+'\x27\x20from\x20file:\x20'+_0x3fb02a[_0x307264(0x1fd)]+_0x307264(0x1ca)+getErrorMessage(_0x19fbfd),_0x19fbfd);}return _0x255bc1;},_0x241bdb=await batchAsync(_0x1f3583,_0x5ae251,_0x2112a6),_0xaa31e9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3c94c0 of _0x241bdb){_0xaa31e9[_0x4d2367(0x1ff)]+=_0x3c94c0['created'],_0xaa31e9[_0x4d2367(0x23c)]+=_0x3c94c0[_0x4d2367(0x23c)],_0x3c94c0[_0x4d2367(0x19f)]&&_0xaa31e9[_0x4d2367(0x207)]['set'](_0x3c94c0[_0x4d2367(0x19f)][_0x4d2367(0x1ea)],_0x3c94c0['createdSegmentId']['id']),_0xaa31e9['activations'][_0x4d2367(0x1ff)]+=_0x3c94c0[_0x4d2367(0x1e2)][_0x4d2367(0x1ff)],_0xaa31e9[_0x4d2367(0x1e2)][_0x4d2367(0x23c)]+=_0x3c94c0[_0x4d2367(0x1e2)][_0x4d2367(0x23c)],_0xaa31e9[_0x4d2367(0x1e2)][_0x4d2367(0x205)]+=_0x3c94c0[_0x4d2367(0x1e2)]['deleted'];}return _0xaa31e9;}async function syncActivationsForSegment(_0x46297,_0x14fcf0,_0x1e9d6c,_0x1e116d,_0x4399f6,_0x4a3b02,_0x1b7d28){const _0x1e343a=a155_0x3e8afc,_0x15ade6={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5406bf of _0x4399f6){try{if(_0x5406bf[_0x1e343a(0x20c)]===_0x1e343a(0x148)&&_0x5406bf[_0x1e343a(0x1b5)])_0x4a3b02['onProgress']?.({'type':_0x1e343a(0x166),'segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),await _0x4a3b02[_0x1e343a(0x1c4)]('Creating\x20activation\x20\x27'+_0x5406bf['name']+_0x1e343a(0x1fb),()=>_0x46297[_0x1e343a(0x1cf)][_0x1e343a(0x151)](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x1b5)])),_0x4a3b02['onProgress']?.({'type':'activation_created','segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),_0x4a3b02[_0x1e343a(0x1be)]?.(_0x1e343a(0x173)+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x1ff)]++;else{if(_0x5406bf['type']==='update'&&_0x5406bf[_0x1e343a(0x1b5)]&&_0x5406bf[_0x1e343a(0x192)])_0x4a3b02[_0x1e343a(0x242)]?.({'type':'activation_updating','segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),await _0x4a3b02[_0x1e343a(0x1c4)](_0x1e343a(0x1de)+_0x5406bf[_0x1e343a(0x1ea)]+_0x1e343a(0x1fb),()=>_0x46297['segment'][_0x1e343a(0x1d5)](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x192)]['id'],_0x5406bf[_0x1e343a(0x1b5)])),_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x1b4),'segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),_0x4a3b02['logSuccess']?.(_0x1e343a(0x1a4)+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x23c)]++;else _0x5406bf[_0x1e343a(0x20c)]==='delete'&&_0x5406bf[_0x1e343a(0x192)]&&(_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x14e),'segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),await _0x4a3b02[_0x1e343a(0x1c4)](_0x1e343a(0x234)+_0x5406bf['name']+_0x1e343a(0x1fb),()=>_0x46297[_0x1e343a(0x1cf)]['deleteActivation'](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x192)]['id'])),_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x1f9),'segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),_0x4a3b02[_0x1e343a(0x175)]?.('Deleted\x20activation\x20\x27'+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x205)]++);}}catch(_0x4acdc9){const _0x3eb22c=isHttp400Error(_0x4acdc9),_0x2bd182=_0x3eb22c?ErrorCode[_0x1e343a(0x204)]:ErrorCode[_0x1e343a(0x215)],_0x54cf7d=getErrorMessage(_0x4acdc9);throw new SDKError(_0x2bd182,_0x1e343a(0x145)+_0x5406bf[_0x1e343a(0x20c)]+_0x1e343a(0x1e3)+_0x5406bf[_0x1e343a(0x1ea)]+_0x1e343a(0x13e)+_0x1b7d28+_0x1e343a(0x1ca)+_0x54cf7d,_0x4acdc9);}}return _0x15ade6;}export async function executePushFolders(_0x1c37ee,_0x33f160,_0x1b5a5d,_0x5446c8,_0xec07b3){const _0x1f70b7=a155_0x3e8afc,_0x577718=new Map(_0x1b5a5d),_0x4c3b14=sortFoldersByDepth(_0x33f160);for(const _0x1f582d of _0x4c3b14){const _0x184390=_0x1f582d[_0x1f70b7(0x191)]('/'),_0xa1bd14=_0x184390[_0x184390['length']-0x1],_0x2a7e4a=_0x184390[_0x1f70b7(0x195)](0x0,-0x1)[_0x1f70b7(0x23a)]('/'),_0x20dd15=_0x577718[_0x1f70b7(0x1bd)](_0x2a7e4a);_0xec07b3['onProgress']?.({'type':_0x1f70b7(0x1d2),'folder':_0x1f582d});const _0x183128={'name':_0xa1bd14,'parentFolderId':_0x20dd15},_0x780d1=await _0xec07b3[_0x1f70b7(0x1c4)]('Creating\x20folder\x20\x27'+_0x1f582d+_0x1f70b7(0x1fb),()=>_0x1c37ee[_0x1f70b7(0x1cf)]['createFolder'](_0x5446c8[_0x1f70b7(0x212)],_0x183128));_0x577718[_0x1f70b7(0x226)](_0x1f582d,_0x780d1[_0x1f70b7(0x13f)]['id']),_0xec07b3[_0x1f70b7(0x242)]?.({'type':'folder_created','folder':_0x1f582d,'folderId':_0x780d1[_0x1f70b7(0x13f)]['id']}),_0xec07b3[_0x1f70b7(0x1b2)]?.('Created\x20folder\x20\x27'+_0x1f582d+'\x27');}return _0x577718;}export async function executePushSegmentDeletions(_0x4155e6,_0x110263,_0x37e2cd){const _0x4f6e5e=a155_0x3e8afc;if(_0x110263[_0x4f6e5e(0x140)]===0x0)return 0x0;const {batchAsync:_0x1c7001}=await import(_0x4f6e5e(0x1a8)),_0x1dbc81=0x5,_0x100638=await _0x1c7001(_0x110263,async _0x1a45d4=>{const _0x131bd4=_0x4f6e5e;return _0x37e2cd[_0x131bd4(0x242)]?.({'type':_0x131bd4(0x21b),'name':_0x1a45d4[_0x131bd4(0x1ea)]}),await _0x4155e6['segment'][_0x131bd4(0x1f4)](_0x1a45d4['id']),_0x37e2cd[_0x131bd4(0x242)]?.({'type':_0x131bd4(0x170),'name':_0x1a45d4[_0x131bd4(0x1ea)]}),_0x37e2cd[_0x131bd4(0x175)]?.(_0x131bd4(0x1a9)+_0x1a45d4[_0x131bd4(0x1ea)]+'\x27'),0x1;},_0x1dbc81);return _0x100638[_0x4f6e5e(0x1fa)]((_0x5bbc05,_0x1d4751)=>_0x5bbc05+_0x1d4751,0x0);}export async function executePushJourneys(_0x237080,_0x516ebd,_0x1ca9ea,_0x5077f0,_0x389c64){const _0x2fe200=a155_0x3e8afc,{journeyDefToRequest:_0x55df89}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x336048,yamlRuleToApi:_0x498f8e,validateSegmentRule:_0x4d139f}=await import(_0x2fe200(0x171)),_0x2f49e0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x29e6b9=new Map(_0x1ca9ea['segmentNameToId']),_0x5b2b17=0x5;for(let _0x38b414=0x0;_0x38b414<_0x516ebd[_0x2fe200(0x140)];_0x38b414+=_0x5b2b17){const _0x4dbaba=_0x516ebd[_0x2fe200(0x195)](_0x38b414,_0x38b414+_0x5b2b17),_0x5449e8=await Promise['all'](_0x4dbaba[_0x2fe200(0x1ef)](async _0x70f1e2=>{const _0x36b2a7=_0x2fe200;if(!_0x70f1e2[_0x36b2a7(0x1f1)]&&!_0x70f1e2[_0x36b2a7(0x21c)])return{'action':'unchanged','name':_0x70f1e2['yamlConfig'][_0x36b2a7(0x1ea)],'journeyId':_0x70f1e2[_0x36b2a7(0x1bb)]?.['id']};const _0x500fc7=_0x70f1e2[_0x36b2a7(0x219)]?_0x1ca9ea['folderPathToId']['get'](_0x70f1e2['folderPath']):undefined;_0x389c64[_0x36b2a7(0x242)]?.({'type':_0x70f1e2['isNew']?_0x36b2a7(0x19a):_0x36b2a7(0x183),'name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)]});try{const _0x2aab2f=await executeSingleJourneyPush(_0x237080,_0x70f1e2,{..._0x1ca9ea,'segmentNameToId':_0x29e6b9},{'parentId':_0x5077f0[_0x36b2a7(0x212)],'rootFolderId':_0x5077f0['rootFolderId'],'folderId':_0x500fc7,'verbose':_0x5077f0['verbose']},_0x389c64,{'journeyDefToRequest':_0x55df89,'activationDefToCreateRequest':_0x336048,'yamlRuleToApi':_0x498f8e,'validateSegmentRule':_0x4d139f});for(const [_0x3138fc,_0x215ccb]of _0x2aab2f[_0x36b2a7(0x165)]){_0x29e6b9[_0x36b2a7(0x226)](_0x3138fc,_0x215ccb),_0x2f49e0['embeddedSegmentNameToId']['set'](_0x3138fc,_0x215ccb);}if(_0x2aab2f['action']===_0x36b2a7(0x1ff))_0x389c64['onProgress']?.({'type':_0x36b2a7(0x1c6),'name':_0x70f1e2[_0x36b2a7(0x1d8)]['name'],'journeyId':_0x2aab2f['journeyId']}),_0x389c64['logSuccess']?.(_0x36b2a7(0x1ec)+_0x70f1e2[_0x36b2a7(0x1d8)]['name']+'\x27'),_0x2f49e0['created']++;else _0x2aab2f[_0x36b2a7(0x225)]===_0x36b2a7(0x23c)&&(_0x389c64[_0x36b2a7(0x242)]?.({'type':'journey_updated','name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)]}),_0x389c64[_0x36b2a7(0x1be)]?.(_0x36b2a7(0x1d3)+_0x70f1e2[_0x36b2a7(0x1d8)]['name']+'\x27'),_0x2f49e0[_0x36b2a7(0x23c)]++);return{'action':_0x2aab2f[_0x36b2a7(0x225)],'name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)],'journeyId':_0x2aab2f[_0x36b2a7(0x181)]};}catch(_0x5dec90){const _0x280bc2=isHttp400Error(_0x5dec90),_0x1eb85e=_0x280bc2?ErrorCode[_0x36b2a7(0x20a)]:ErrorCode[_0x36b2a7(0x1ce)],_0x43a851=getErrorMessage(_0x5dec90);throw new SDKError(_0x1eb85e,_0x36b2a7(0x145)+(_0x70f1e2[_0x36b2a7(0x1f1)]?_0x36b2a7(0x148):_0x36b2a7(0x206))+_0x36b2a7(0x19c)+_0x70f1e2['absolutePath']+_0x36b2a7(0x1ca)+_0x43a851,_0x5dec90);}}));_0x2f49e0[_0x2fe200(0x1cc)][_0x2fe200(0x209)](..._0x5449e8);}return _0x2f49e0;}async function matchExistingJourneySegments(_0x2c016e,_0x2a2d33,_0x8add1a,_0x3ddd9d,_0xc424ee){const _0x28e1cd=a155_0x3e8afc;if(!_0x2a2d33[_0x28e1cd(0x1bb)]||!_0x2a2d33['yamlConfig'][_0x28e1cd(0x156)])return;const _0x213096=new Map(),_0x181add=new Set();for(const _0x474dce of Object[_0x28e1cd(0x1f0)](_0x2a2d33[_0x28e1cd(0x1d8)][_0x28e1cd(0x156)])){const _0x3ede26=generateDeterministicJourneySegmentName(_0x2a2d33[_0x28e1cd(0x1d8)][_0x28e1cd(0x1ea)],_0x474dce);_0x213096[_0x28e1cd(0x226)](_0x3ede26,_0x474dce),_0x181add[_0x28e1cd(0x201)](_0x474dce);}const _0x3dce37=[],_0x897542=collectSegmentIdsFromJourneyApi(_0x2a2d33[_0x28e1cd(0x1bb)]);for(const _0x435b09 of _0x897542){const _0x3c5094=await fetchSegment(_0x2c016e,_0x8add1a,_0x435b09,_0x3ddd9d);if(!_0x3c5094?.[_0x28e1cd(0x1ea)])continue;const _0x4850a5=_0x213096[_0x28e1cd(0x1bd)](_0x3c5094[_0x28e1cd(0x1ea)]);_0x4850a5?(_0xc424ee[_0x28e1cd(0x226)](_0x4850a5,_0x435b09),_0x181add[_0x28e1cd(0x235)](_0x4850a5)):_0x3dce37[_0x28e1cd(0x209)]({'id':_0x435b09,'seg':_0x3c5094});}if(_0x181add[_0x28e1cd(0x217)]>0x0&&_0x3dce37['length']>0x0){const {localExpandedRuleToNames:_0x4d63c3}=buildLocalExpandedRuleMappings(_0x2a2d33['yamlConfig']),_0xd9cc21=new Map();for(const {id:_0x2e6e61,seg:_0x2230d3}of _0x3dce37){if(_0x2230d3[_0x28e1cd(0x237)]){const _0x100f05=apiRuleToYaml(_0x2230d3[_0x28e1cd(0x237)]);_0xd9cc21[_0x28e1cd(0x226)](_0x2e6e61,_0x100f05);}}for(const {id:_0x2cfc76,seg:_0x44b1e5}of _0x3dce37){if(!_0x44b1e5[_0x28e1cd(0x237)])continue;const _0x725b95=_0xd9cc21[_0x28e1cd(0x1bd)](_0x2cfc76);if(!_0x725b95)continue;const _0x2b930a=serializeExpandedRule(_0x725b95,_0xd9cc21),_0xcce6e=_0x4d63c3[_0x28e1cd(0x1bd)](_0x2b930a);if(_0xcce6e){const _0x560e56=_0xcce6e[_0x28e1cd(0x1d4)](_0x2a158a=>_0x181add[_0x28e1cd(0x1c9)](_0x2a158a));_0x560e56&&(_0xc424ee[_0x28e1cd(0x226)](_0x560e56,_0x2cfc76),_0x181add[_0x28e1cd(0x235)](_0x560e56),logger[_0x28e1cd(0x22b)]('Matched\x20server\x20segment\x20\x27'+_0x44b1e5['name']+_0x28e1cd(0x1dc)+_0x560e56+_0x28e1cd(0x154)));}}}}async function executeSingleJourneyPush(_0x203680,_0x5086c1,_0x2e1f5a,_0x175d9c,_0x32c89d,_0x3dcbcb){const _0x109663=a155_0x3e8afc,{journeyDefToRequest:_0x592f0e,activationDefToCreateRequest:_0x1ec983,yamlRuleToApi:_0x230876,validateSegmentRule:_0x385163}=_0x3dcbcb,_0x42d3b2=new Map(),_0x5ae881=new Map();recoverSegmentIdsFromPushRecovery(_0x5086c1,_0x42d3b2,_0x2e1f5a[_0x109663(0x1e9)]);const _0x25ac48=new Map(),_0x29e407=new Map(),_0x45ecdf=new Map();let _0x535d3c;const _0x481186=async()=>{const _0x29a872=_0x109663;if(_0x535d3c)return;_0x535d3c=new Map();if(!_0x5086c1[_0x29a872(0x1bb)])return;const _0x176a33=await _0x203680[_0x29a872(0x1e4)][_0x29a872(0x17f)](_0x5086c1[_0x29a872(0x1bb)]['id']);for(const _0x116b5e of _0x176a33){const _0x551aa6=journeyActivationStepToYaml(_0x116b5e,_0x2e1f5a[_0x29a872(0x1f7)],_0x2e1f5a[_0x29a872(0x19d)]),_0x58a2bf=activationSignature(_0x551aa6);!_0x535d3c[_0x29a872(0x1c9)](_0x58a2bf)&&_0x535d3c[_0x29a872(0x226)](_0x58a2bf,_0x116b5e['id']),_0x551aa6[_0x29a872(0x1ea)]&&_0x5ae881['set'](_0x551aa6[_0x29a872(0x1ea)],_0x116b5e['id']);}};await matchExistingJourneySegments(_0x203680,_0x5086c1,_0x175d9c['parentId'],_0x2e1f5a[_0x109663(0x15b)],_0x2e1f5a[_0x109663(0x1e9)]);const _0x1bb984={'resolveSegmentId':async _0x502558=>{const _0x3bd9af=_0x109663,_0x3c31e4=_0x2e1f5a[_0x3bd9af(0x1e9)][_0x3bd9af(0x1bd)](_0x502558);if(!_0x3c31e4)throw new SDKError(ErrorCode[_0x3bd9af(0x1a5)],_0x3bd9af(0x17d)+_0x502558+_0x3bd9af(0x1ac)+_0x5086c1['yamlConfig']['name']+')');return _0x3c31e4;},'resolveEmbeddedSegmentId':async(_0x3f756f,_0x286df1)=>{const _0x3d779c=_0x109663,_0x1bbb56=_0x2e1f5a[_0x3d779c(0x1e9)][_0x3d779c(0x1bd)](_0x3f756f);if(_0x1bbb56)return _0x1bbb56;const _0x8ddc50=_0x2e1f5a['existingSegments']['find'](_0x509c32=>_0x509c32['name']===_0x3f756f);if(_0x8ddc50)return _0x2e1f5a[_0x3d779c(0x1e9)][_0x3d779c(0x226)](_0x3f756f,_0x8ddc50['id']),_0x8ddc50['id'];if(_0x5086c1['isNew']){const {stageName:_0x56416b,criteriaName:_0x180ffa}=findSegmentCriteriaLocation(_0x5086c1['yamlConfig'],_0x3f756f);return _0x385163(_0x3f756f,_0x286df1[_0x3d779c(0x237)]),_0x29e407[_0x3d779c(0x226)](_0x3f756f,{'definition':_0x286df1,'stageName':_0x56416b,'criteriaName':_0x180ffa}),createPendingSegmentId(_0x3f756f);}const _0x5a590d=_0x5086c1[_0x3d779c(0x1bb)]?.['id'];if(!_0x5a590d)throw new SDKError(ErrorCode[_0x3d779c(0x1d9)],_0x3d779c(0x1ab));const _0x4bd12a=_0x25ac48[_0x3d779c(0x1bd)](_0x3f756f);if(_0x4bd12a)return _0x4bd12a;const _0x14c88f=((async()=>{const _0x1e3160=_0x3d779c;_0x385163(_0x3f756f,_0x286df1[_0x1e3160(0x237)]);const _0x11231e=generateDeterministicJourneySegmentName(_0x5086c1[_0x1e3160(0x1d8)][_0x1e3160(0x1ea)],_0x3f756f),_0x2c4c1c=_0x2e1f5a[_0x1e3160(0x15b)]['find'](_0x2e3e57=>_0x2e3e57[_0x1e3160(0x1ea)]===_0x11231e),_0x596f70=createSegmentIdResolver(_0x2e1f5a[_0x1e3160(0x1e9)],_0x3f756f),_0x297dda=await resolveRuleSegmentIds(_0x286df1['rule'],_0x596f70);let _0x34c28a;return _0x2c4c1c?(await _0x203680['segment'][_0x1e3160(0x1c0)](_0x175d9c[_0x1e3160(0x212)],_0x2c4c1c['id'],{'description':_0x286df1['description']||_0x1e3160(0x1b8)+_0x3f756f,'rule':_0x230876(_0x297dda),'countPopulation':!![]}),_0x34c28a=_0x2c4c1c['id'],saveSegmentToPushRecovery(_0x5086c1[_0x1e3160(0x1fd)],_0x5086c1['yamlConfig'][_0x1e3160(0x1ea)],_0x3f756f,{'segmentId':_0x34c28a,'uniqueServerName':_0x11231e,'createdAt':new Date()['toISOString']()})):_0x34c28a=await createOrRecoverEmbeddedSegment(_0x203680,_0x5086c1,{'localName':_0x3f756f,'uniqueSegmentName':_0x11231e,'description':_0x286df1['description']||'Entry\x20criteria:\x20'+_0x3f756f,'journeyId':_0x5a590d,'resolvedRule':_0x297dda,'parentId':_0x175d9c['parentId'],'folderId':_0x175d9c[_0x1e3160(0x155)]||''},_0x230876),_0x2e1f5a[_0x1e3160(0x1e9)][_0x1e3160(0x226)](_0x3f756f,_0x34c28a),_0x42d3b2[_0x1e3160(0x226)](_0x3f756f,_0x34c28a),_0x34c28a;})());_0x25ac48[_0x3d779c(0x226)](_0x3f756f,_0x14c88f);try{return await _0x14c88f;}finally{_0x25ac48[_0x3d779c(0x235)](_0x3f756f);}},'resolveActivationId':async _0x4c7102=>{const _0x56647c=_0x109663,_0x46bd0d=_0x5ae881[_0x56647c(0x1bd)](_0x4c7102);if(_0x46bd0d)return _0x46bd0d;if(_0x5086c1['existingJourney']){await _0x481186();const _0x107331=_0x5ae881[_0x56647c(0x1bd)](_0x4c7102);if(_0x107331)return _0x107331;}throw new SDKError(ErrorCode[_0x56647c(0x1b7)],_0x56647c(0x13d)+_0x4c7102+_0x56647c(0x1ac)+_0x5086c1[_0x56647c(0x1d8)][_0x56647c(0x1ea)]+_0x56647c(0x20d)+_0x56647c(0x1c1));},'resolveEmbeddedActivationId':async(_0x1fb9a0,_0x34645a)=>{const _0xa09e3e=_0x109663,_0x34ae1e=_0x5ae881['get'](_0x1fb9a0);if(_0x34ae1e)return _0x34ae1e;if(_0x5086c1['isNew'])return _0x45ecdf[_0xa09e3e(0x226)](_0x1fb9a0,_0x34645a),createPendingActivationId(_0x1fb9a0);if(_0x5086c1[_0xa09e3e(0x1bb)]){await _0x481186();const _0x588748=_0x5ae881[_0xa09e3e(0x1bd)](_0x34645a[_0xa09e3e(0x1ea)]);if(_0x588748)return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x588748),_0x588748;const _0x571241=activationSignature(_0x34645a),_0x459181=_0x535d3c?.[_0xa09e3e(0x1bd)](_0x571241);if(_0x459181)return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x459181),_0x459181;const _0x1352bc=await _0x1ec983(_0x34645a,_0x2e1f5a[_0xa09e3e(0x19e)]),_0x2af3c4={..._0x1352bc,..._0x34645a[_0xa09e3e(0x15d)]!==undefined&&{'runAfterJourneyRefresh':_0x34645a['run_after_journey_refresh']}},_0x446aeb=await _0x203680[_0xa09e3e(0x1e4)][_0xa09e3e(0x151)](_0x5086c1['existingJourney']['id'],_0x2af3c4);return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x446aeb['id']),_0x446aeb['id'];}throw new SDKError(ErrorCode[_0xa09e3e(0x1d9)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x3877fb=>{const _0x201a13=_0x109663;try{return await _0x203680[_0x201a13(0x1e4)][_0x201a13(0x222)](_0x175d9c[_0x201a13(0x212)],_0x3877fb);}catch(_0x4315df){throw new SDKError(ErrorCode[_0x201a13(0x1b7)],_0x201a13(0x15c)+_0x3877fb+_0x201a13(0x1db)+_0x5086c1[_0x201a13(0x1d8)]['name']+'\x27)',_0x4315df);}},'resolveStageId':async(_0x4eb4cd,_0x20b60c)=>{const _0xb13f05=_0x109663,_0x2c83a9=await _0x203680[_0xb13f05(0x1e4)][_0xb13f05(0x1d7)](_0x4eb4cd),_0x291466=_0x2c83a9['attributes'][_0xb13f05(0x16a)]['find'](_0x15daf8=>_0x15daf8[_0xb13f05(0x1ea)][_0xb13f05(0x1bf)]()===_0x20b60c[_0xb13f05(0x1bf)]());if(!_0x291466?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0xb13f05(0x186)+_0x20b60c+_0xb13f05(0x22d)+(_0x2c83a9[_0xb13f05(0x169)][_0xb13f05(0x174)]||_0x2c83a9[_0xb13f05(0x169)][_0xb13f05(0x1ea)])+'\x27');return _0x291466['id'];}},_0xe77327=await _0x592f0e(_0x5086c1['yamlConfig'],_0x175d9c['parentId'],_0x1bb984),_0x3bc7d1=_0x175d9c[_0x109663(0x1cd)]||_0x175d9c[_0x109663(0x155)];_0x3bc7d1&&(_0xe77327[_0x109663(0x22f)]={'parentFolder':{'data':{'id':_0x3bc7d1,'type':'folder'}}});if(_0x5086c1[_0x109663(0x1f1)]){if(_0x29e407['size']>0x0||_0x45ecdf[_0x109663(0x217)]>0x0)return await executeThreeStepJourneyCreate(_0x203680,_0x5086c1,_0xe77327,{'pendingEmbeddedSegments':_0x29e407,'pendingEmbeddedActivations':_0x45ecdf,'embeddedSegmentNameToId':_0x42d3b2,'journeyActivationNameToId':_0x5ae881},{..._0x175d9c,'effectiveFolderId':_0x3bc7d1},_0x2e1f5a,_0x32c89d,_0x3dcbcb);else{ensureJourneyDefaults(_0xe77327['attributes']);const _0x20e9ae=await _0x203680['journey'][_0x109663(0x148)](_0xe77327);return deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':'created','journeyId':_0x20e9ae['id'],'embeddedSegmentNameToId':_0x42d3b2};}}else{if(_0x5086c1[_0x109663(0x21c)]&&_0x5086c1['existingJourney']){_0xe77327['id']=_0x5086c1['existingJourney']['id'];const _0x12f904=_0xe77327['attributes'];_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]?.['journeyBundleName']&&(_0x12f904['journeyBundleName']=_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]['journeyBundleName']);const _0x133c50=_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]?.[_0x109663(0x16a)];return _0x133c50&&_0xe77327[_0x109663(0x169)][_0x109663(0x16a)]&&injectExistingStageIds(_0xe77327[_0x109663(0x169)]['journeyStages'],_0x133c50),ensureJourneyDefaults(_0x12f904),await _0x203680[_0x109663(0x1e4)]['update'](_0x5086c1[_0x109663(0x1bb)]['id'],_0xe77327),deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':'updated','journeyId':_0x5086c1[_0x109663(0x1bb)]['id'],'embeddedSegmentNameToId':_0x42d3b2};}}return deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':_0x109663(0x21d),'journeyId':_0x5086c1['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x42d3b2};}function findSegmentCriteriaLocation(_0x11e085,_0x2f7a3e){const _0x14b7fa=a155_0x3e8afc,_0x170b22=_0x11e085['stages']||_0x11e085[_0x14b7fa(0x1b6)]?.[0x0]?.['stages']||[];let _0x33c795='entry',_0x4a8abe=_0x2f7a3e;const _0x39fe5e=_0x11e085[_0x14b7fa(0x221)]||_0x11e085['journeys']?.[0x0]?.['goal'];if(_0x39fe5e?.[_0x14b7fa(0x1cf)]===_0x2f7a3e)return{'stageName':'goal','criteriaName':_0x39fe5e['name']||_0x2f7a3e};_0x19f7f5:for(const _0x154352 of _0x170b22){if(_0x154352[_0x14b7fa(0x218)]?.[_0x14b7fa(0x1cf)]===_0x2f7a3e){_0x33c795=_0x154352[_0x14b7fa(0x1ea)],_0x4a8abe=_0x154352['entry_criteria'][_0x14b7fa(0x1ea)]||_0x2f7a3e;break;}if(_0x154352[_0x14b7fa(0x1f5)])for(const _0x3ebf84 of _0x154352[_0x14b7fa(0x1f5)]){if(_0x3ebf84['type']==='decision_point'&&_0x3ebf84['with']?.[_0x14b7fa(0x16e)])for(const _0x21ae37 of _0x3ebf84[_0x14b7fa(0x16c)][_0x14b7fa(0x16e)]){if(_0x21ae37[_0x14b7fa(0x1cf)]===_0x2f7a3e){_0x33c795=_0x154352[_0x14b7fa(0x1ea)],_0x4a8abe=_0x21ae37['name']||_0x2f7a3e;break _0x19f7f5;}}}}return{'stageName':_0x33c795,'criteriaName':_0x4a8abe};}async function executeThreeStepJourneyCreate(_0x3f04b7,_0x5ce3a0,_0xcc729f,_0xcb8a56,_0x3287d4,_0x4e0937,_0x4fd9b4,_0x5c3076){const _0x8f6373=a155_0x3e8afc,{activationDefToCreateRequest:_0x14b87f,yamlRuleToApi:_0x19739e}=_0x5c3076,{pendingEmbeddedSegments:_0x445344,pendingEmbeddedActivations:_0x3f78fa,embeddedSegmentNameToId:_0x101e07}=_0xcb8a56,_0x1319c1=JSON[_0x8f6373(0x15f)](JSON[_0x8f6373(0x22e)](_0xcc729f));ensureJourneyDefaults(_0x1319c1[_0x8f6373(0x169)]),stripPendingIds(_0x1319c1);const _0x1f8f95=await _0x3f04b7[_0x8f6373(0x1e4)]['create'](_0x1319c1),_0x5bef8c=_0x1f8f95['id'],_0x470bde=new Map();for(const _0x55e199 of _0x1f8f95['attributes'][_0x8f6373(0x16a)]){_0x470bde[_0x8f6373(0x226)](_0x55e199[_0x8f6373(0x1ea)][_0x8f6373(0x1bf)](),_0x55e199['id']);}recoverSegmentIdsFromPushRecovery(_0x5ce3a0,_0x101e07,_0x4e0937[_0x8f6373(0x1e9)]);for(const [_0x3886df,{definition:_0x247b9c}]of _0x445344){if(_0x101e07[_0x8f6373(0x1c9)](_0x3886df)){_0x4fd9b4[_0x8f6373(0x242)]?.({'type':_0x8f6373(0x1e1),'journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'segmentName':_0x3886df});continue;}const _0x39c492=generateDeterministicJourneySegmentName(_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],_0x3886df);_0x4fd9b4[_0x8f6373(0x242)]?.({'type':'embedded_segment_creating','journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'segmentName':_0x3886df});const _0x254174=createSegmentIdResolver(_0x4e0937[_0x8f6373(0x1e9)],_0x3886df),_0x8e2c1f=await resolveRuleSegmentIds(_0x247b9c[_0x8f6373(0x237)],_0x254174),_0x40bf3d=await createOrRecoverEmbeddedSegment(_0x3f04b7,_0x5ce3a0,{'localName':_0x3886df,'uniqueSegmentName':_0x39c492,'description':_0x247b9c[_0x8f6373(0x214)]||'Entry\x20criteria:\x20'+_0x3886df,'journeyId':_0x5bef8c,'resolvedRule':_0x8e2c1f,'parentId':_0x3287d4['parentId'],'folderId':_0x3287d4['effectiveFolderId']||''},_0x19739e);_0x101e07[_0x8f6373(0x226)](_0x3886df,_0x40bf3d),_0x4e0937['segmentNameToId'][_0x8f6373(0x226)](_0x3886df,_0x40bf3d),_0x4fd9b4['onProgress']?.({'type':_0x8f6373(0x1e1),'journeyName':_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],'segmentName':_0x3886df});}const _0x2f42ea=new Map();for(const [_0x4a38e9,_0x5cc95c]of _0x3f78fa){_0x4fd9b4[_0x8f6373(0x242)]?.({'type':_0x8f6373(0x17c),'journeyName':_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],'activationName':_0x4a38e9});const _0x202b0b=await _0x14b87f(_0x5cc95c,_0x4e0937[_0x8f6373(0x19e)]),_0x412c41={..._0x202b0b,..._0x5cc95c[_0x8f6373(0x15d)]!==undefined&&{'runAfterJourneyRefresh':_0x5cc95c[_0x8f6373(0x15d)]}},_0x828842=await _0x3f04b7[_0x8f6373(0x1e4)]['createActivation'](_0x5bef8c,_0x412c41);_0x2f42ea['set'](_0x4a38e9,_0x828842['id']),_0xcb8a56[_0x8f6373(0x22a)]['set'](_0x4a38e9,_0x828842['id']),_0x4fd9b4['onProgress']?.({'type':_0x8f6373(0x14a),'journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'activationName':_0x4a38e9});}const _0x488fec=JSON[_0x8f6373(0x15f)](JSON[_0x8f6373(0x22e)](_0xcc729f));return _0x488fec['id']=_0x5bef8c,ensureJourneyDefaults(_0x488fec[_0x8f6373(0x169)]),resolvePendingIdsInRequest(_0x488fec,_0xcc729f,_0x470bde,_0x101e07,_0x2f42ea,_0x4fd9b4),await _0x3f04b7['journey'][_0x8f6373(0x206)](_0x5bef8c,_0x488fec),deletePushRecovery(_0x5ce3a0[_0x8f6373(0x1fd)]),{'action':_0x8f6373(0x1ff),'journeyId':_0x5bef8c,'embeddedSegmentNameToId':_0x101e07};}export function stripWaitStepPendingIds(_0x40bf2f){const _0x4e9a1b=a155_0x3e8afc,_0x4459b4=_0x40bf2f[_0x4e9a1b(0x182)]&&isPendingSegmentId(_0x40bf2f[_0x4e9a1b(0x182)]),_0x3d616b=_0x40bf2f['conditions']?.[_0x4e9a1b(0x20e)](_0x2aab19=>_0x2aab19[_0x4e9a1b(0x1a0)]&&isPendingSegmentId(_0x2aab19[_0x4e9a1b(0x1a0)]));(_0x4459b4||_0x3d616b)&&(_0x40bf2f[_0x4e9a1b(0x189)]=_0x4e9a1b(0x1c5),_0x40bf2f[_0x4e9a1b(0x20f)]=0x1,_0x40bf2f[_0x4e9a1b(0x21a)]=_0x4e9a1b(0x1ae),delete _0x40bf2f['conditionSegmentId'],delete _0x40bf2f[_0x4e9a1b(0x16f)],delete _0x40bf2f['conditionTimeoutUnit'],delete _0x40bf2f[_0x4e9a1b(0x21f)]);}export function resolveWaitStepPendingIds(_0x78d326,_0x1999b7,_0xef8343,_0x5aef09){const _0x21b826=a155_0x3e8afc;if(_0x1999b7[_0x21b826(0x182)]&&isPendingSegmentId(_0x1999b7[_0x21b826(0x182)])){const _0xeb05d3=_0xef8343(_0x1999b7['conditionSegmentId'],_0x21b826(0x1b1)+_0x5aef09+_0x21b826(0x177));_0xeb05d3&&(_0x78d326['waitStepType']=_0x21b826(0x23e),_0x78d326['conditionSegmentId']=_0xeb05d3,delete _0x78d326['waitStep'],delete _0x78d326[_0x21b826(0x21a)],_0x1999b7[_0x21b826(0x16f)]!==undefined&&(_0x78d326[_0x21b826(0x16f)]=_0x1999b7['conditionTimeoutDuration']),_0x1999b7[_0x21b826(0x168)]&&(_0x78d326[_0x21b826(0x168)]=_0x1999b7[_0x21b826(0x168)]));}if(_0x1999b7[_0x21b826(0x21f)]){const _0x15f8d2=_0x1999b7[_0x21b826(0x21f)][_0x21b826(0x20e)](_0x3bb161=>_0x3bb161[_0x21b826(0x1a0)]&&isPendingSegmentId(_0x3bb161[_0x21b826(0x1a0)]));if(_0x15f8d2){const _0x31c080=_0x1999b7[_0x21b826(0x21f)][_0x21b826(0x1ef)](_0x986975=>{const _0x3c53d7=_0x21b826;if(_0x986975[_0x3c53d7(0x1a0)]&&isPendingSegmentId(_0x986975[_0x3c53d7(0x1a0)])){const _0x447654=_0xef8343(_0x986975[_0x3c53d7(0x1a0)],_0x3c53d7(0x1b1)+_0x5aef09+'\x27\x20wait\x20condition');return{..._0x986975,'segmentId':_0x447654||_0x986975[_0x3c53d7(0x1a0)]};}return{..._0x986975};});_0x78d326[_0x21b826(0x189)]=_0x21b826(0x23e),_0x78d326[_0x21b826(0x21f)]=_0x31c080,delete _0x78d326[_0x21b826(0x20f)],delete _0x78d326[_0x21b826(0x21a)],delete _0x78d326[_0x21b826(0x182)],delete _0x78d326[_0x21b826(0x16f)],delete _0x78d326['conditionTimeoutUnit'];}}}function stripPendingIds(_0x557a6a){const _0x1562d3=a155_0x3e8afc;_0x557a6a['attributes'][_0x1562d3(0x221)]?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x557a6a['attributes'][_0x1562d3(0x221)][_0x1562d3(0x1a0)])&&delete _0x557a6a[_0x1562d3(0x169)][_0x1562d3(0x221)];for(const _0x1f3574 of _0x557a6a[_0x1562d3(0x169)][_0x1562d3(0x16a)]||[]){_0x1f3574[_0x1562d3(0x196)]?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1f3574['entryCriteria'][_0x1562d3(0x1a0)])&&delete _0x1f3574[_0x1562d3(0x196)];_0x1f3574['milestone']?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1f3574[_0x1562d3(0x1af)][_0x1562d3(0x1a0)])&&delete _0x1f3574[_0x1562d3(0x1af)];_0x1f3574['exitCriterias']&&(_0x1f3574['exitCriterias']=_0x1f3574[_0x1562d3(0x17b)][_0x1562d3(0x220)](_0x204638=>!_0x204638[_0x1562d3(0x1a0)]||!isPendingSegmentId(_0x204638[_0x1562d3(0x1a0)])));if(_0x1f3574[_0x1562d3(0x1f5)])for(const _0x126b73 of Object[_0x1562d3(0x1f0)](_0x1f3574[_0x1562d3(0x1f5)])){const _0x5e0396=_0x1f3574[_0x1562d3(0x1f5)][_0x126b73];_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x223)&&_0x5e0396[_0x1562d3(0x1eb)]&&isPendingActivationId(_0x5e0396[_0x1562d3(0x1eb)])&&(_0x5e0396[_0x1562d3(0x1eb)]='');if(_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x190)&&_0x5e0396[_0x1562d3(0x16e)])for(const _0x1d8898 of _0x5e0396[_0x1562d3(0x16e)]){_0x1d8898[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1d8898[_0x1562d3(0x1a0)])&&(_0x1d8898[_0x1562d3(0x1a0)]='');}_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x1ee)&&stripWaitStepPendingIds(_0x5e0396);}}}function resolvePendingIdsInRequest(_0x4852c8,_0x456269,_0x548a1e,_0x8443d6,_0x37a340,_0x147cf3){const _0x2e45a1=a155_0x3e8afc,_0x5f1d28=(_0x418794,_0x4d464a)=>{const _0x31154d=a155_0x4ade;if(!isPendingSegmentId(_0x418794))return _0x418794;const _0x4e6807=extractPendingSegmentName(_0x418794),_0x11745e=_0x8443d6[_0x31154d(0x1bd)](_0x4e6807);return!_0x11745e&&_0x147cf3['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x4e6807+'\x27\x20for\x20'+_0x4d464a),_0x11745e;};if(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)])){const _0x10574d=_0x5f1d28(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)],_0x2e45a1(0x241));_0x10574d&&(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)]=_0x10574d);}for(const _0x48fcc9 of _0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x16a)]||[]){const _0x1be0ba=_0x548a1e[_0x2e45a1(0x1bd)](_0x48fcc9[_0x2e45a1(0x1ea)][_0x2e45a1(0x1bf)]());_0x1be0ba&&(_0x48fcc9['id']=_0x1be0ba);if(_0x48fcc9[_0x2e45a1(0x196)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x48fcc9['entryCriteria']['segmentId'])){const _0x33259d=_0x5f1d28(_0x48fcc9['entryCriteria'][_0x2e45a1(0x1a0)],'stage\x20\x27'+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x159));_0x33259d&&(_0x48fcc9[_0x2e45a1(0x196)][_0x2e45a1(0x1a0)]=_0x33259d);}if(_0x48fcc9['exitCriterias'])for(const _0x150968 of _0x48fcc9[_0x2e45a1(0x17b)]){if(_0x150968[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x150968[_0x2e45a1(0x1a0)])){const _0x9f7d30=_0x5f1d28(_0x150968[_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x141));_0x9f7d30&&(_0x150968[_0x2e45a1(0x1a0)]=_0x9f7d30);}}if(_0x48fcc9[_0x2e45a1(0x1af)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x48fcc9[_0x2e45a1(0x1af)]['segmentId'])){const _0x5cfc16=_0x5f1d28(_0x48fcc9[_0x2e45a1(0x1af)][_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x1b3));_0x5cfc16&&(_0x48fcc9[_0x2e45a1(0x1af)][_0x2e45a1(0x1a0)]=_0x5cfc16);}if(_0x48fcc9[_0x2e45a1(0x1f5)]){const _0x58deca=_0x407b8d=>_0x456269[_0x2e45a1(0x169)][_0x2e45a1(0x16a)]?.['find'](_0x31f15c=>_0x31f15c['name']['toLowerCase']()===_0x48fcc9['name']['toLowerCase']())?.['steps']?.[_0x407b8d];for(const _0x57da17 of Object[_0x2e45a1(0x1f0)](_0x48fcc9[_0x2e45a1(0x1f5)])){const _0x5576ff=_0x48fcc9[_0x2e45a1(0x1f5)][_0x57da17],_0x1e90b8=_0x58deca(_0x57da17);if(_0x5576ff['type']===_0x2e45a1(0x223)&&_0x5576ff[_0x2e45a1(0x1eb)]&&(isPendingActivationId(_0x5576ff['journeyActivationStepId'])||_0x5576ff['journeyActivationStepId']==='')){if(_0x1e90b8?.[_0x2e45a1(0x1eb)]&&isPendingActivationId(_0x1e90b8[_0x2e45a1(0x1eb)])){const _0x3874c5=extractPendingActivationName(_0x1e90b8['journeyActivationStepId']),_0x5cfac3=_0x37a340[_0x2e45a1(0x1bd)](_0x3874c5);_0x5cfac3&&(_0x5576ff['journeyActivationStepId']=_0x5cfac3);}}if(_0x5576ff['type']===_0x2e45a1(0x190)&&_0x5576ff[_0x2e45a1(0x16e)]&&_0x1e90b8?.[_0x2e45a1(0x16e)])for(let _0x1ed25d=0x0;_0x1ed25d<_0x5576ff['branches'][_0x2e45a1(0x140)];_0x1ed25d++){const _0x2a2974=_0x5576ff[_0x2e45a1(0x16e)][_0x1ed25d],_0x8c2fb4=_0x1e90b8[_0x2e45a1(0x16e)][_0x1ed25d];if(_0x8c2fb4?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x8c2fb4['segmentId'])){const _0x4712e4=_0x5f1d28(_0x8c2fb4[_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2a2974[_0x2e45a1(0x1ea)]||_0x1ed25d)+'\x27');_0x4712e4&&(_0x2a2974[_0x2e45a1(0x1a0)]=_0x4712e4);}}_0x5576ff[_0x2e45a1(0x20c)]===_0x2e45a1(0x1ee)&&_0x1e90b8?.[_0x2e45a1(0x20c)]===_0x2e45a1(0x1ee)&&resolveWaitStepPendingIds(_0x5576ff,_0x1e90b8,_0x5f1d28,_0x48fcc9[_0x2e45a1(0x1ea)]);}}}}
@@ -1 +1 @@
1
- (function(_0x53cc68,_0x129b56){const _0x32ec62=a156_0x4ace,_0x31424=_0x53cc68();while(!![]){try{const _0x1193f2=-parseInt(_0x32ec62(0x159))/0x1+parseInt(_0x32ec62(0x151))/0x2*(-parseInt(_0x32ec62(0x15d))/0x3)+-parseInt(_0x32ec62(0x153))/0x4+parseInt(_0x32ec62(0x15b))/0x5*(-parseInt(_0x32ec62(0x14f))/0x6)+-parseInt(_0x32ec62(0x154))/0x7+parseInt(_0x32ec62(0x15e))/0x8+-parseInt(_0x32ec62(0x158))/0x9*(-parseInt(_0x32ec62(0x152))/0xa);if(_0x1193f2===_0x129b56)break;else _0x31424['push'](_0x31424['shift']());}catch(_0x4c71c6){_0x31424['push'](_0x31424['shift']());}}}(a156_0x5957,0x6e5fe));function a156_0x4ace(_0x43c0ad,_0x31363d){_0x43c0ad=_0x43c0ad-0x14f;const _0x595759=a156_0x5957();let _0x4ace4b=_0x595759[_0x43c0ad];return _0x4ace4b;}export function buildFolderIdToPathMap(_0x50d0b8){const _0x40e859=a156_0x4ace,_0x1e54b2=new Map(),_0x639252=new Map();for(const _0x10ae90 of _0x50d0b8){_0x639252[_0x40e859(0x157)](_0x10ae90['id'],_0x10ae90);}const _0x30e088=new Set();for(const _0x305bd8 of _0x50d0b8){!_0x305bd8[_0x40e859(0x155)]&&_0x30e088[_0x40e859(0x15a)](_0x305bd8['id']);}function _0x4f56f8(_0x2175c2){const _0x1d4d92=_0x40e859;if(_0x1e54b2['has'](_0x2175c2['id']))return _0x1e54b2[_0x1d4d92(0x156)](_0x2175c2['id']);if(_0x30e088['has'](_0x2175c2['id']))return _0x1e54b2['set'](_0x2175c2['id'],''),'';if(_0x2175c2[_0x1d4d92(0x155)]){const _0x1dd2ca=_0x639252[_0x1d4d92(0x156)](_0x2175c2[_0x1d4d92(0x155)]);if(_0x1dd2ca){const _0x56b858=_0x4f56f8(_0x1dd2ca),_0x33ca8c=_0x56b858?_0x56b858+'/'+_0x2175c2[_0x1d4d92(0x15c)]:_0x2175c2[_0x1d4d92(0x15c)];return _0x1e54b2[_0x1d4d92(0x157)](_0x2175c2['id'],_0x33ca8c),_0x33ca8c;}}const _0x5a2732=_0x2175c2[_0x1d4d92(0x15c)];return _0x1e54b2['set'](_0x2175c2['id'],_0x5a2732),_0x5a2732;}for(const _0x3b5f45 of _0x50d0b8){_0x4f56f8(_0x3b5f45);}return _0x1e54b2;}function a156_0x5957(){const _0x1b9dc7=['371100WAXseh','4315710goGbUR','parentFolderId','get','set','14215923OXfzEv','861855NRwYTj','add','108665fXzVRK','name','1306119taqsCJ','1176960dBlDUf','234tcpEnA','has','2BIbOxU','20lmlqhM'];a156_0x5957=function(){return _0x1b9dc7;};return a156_0x5957();}export function buildFolderPathToIdMap(_0x5adf02){const _0x440dba=a156_0x4ace,_0x445e15=new Map(),_0x43ebeb=new Map();for(const _0x4b9d3c of _0x5adf02){_0x43ebeb[_0x440dba(0x157)](_0x4b9d3c['id'],_0x4b9d3c);}const _0x26fbeb=new Set();for(const _0x188c76 of _0x5adf02){!_0x188c76[_0x440dba(0x155)]&&_0x26fbeb['add'](_0x188c76['id']);}function _0x3c2849(_0x3cb6e9){const _0x65602f=_0x440dba;if(_0x26fbeb[_0x65602f(0x150)](_0x3cb6e9['id']))return'';if(_0x3cb6e9[_0x65602f(0x155)]){const _0x5a3d8a=_0x43ebeb[_0x65602f(0x156)](_0x3cb6e9[_0x65602f(0x155)]);if(_0x5a3d8a){const _0xc67159=_0x3c2849(_0x5a3d8a);return _0xc67159?_0xc67159+'/'+_0x3cb6e9[_0x65602f(0x15c)]:_0x3cb6e9['name'];}}return _0x3cb6e9[_0x65602f(0x15c)];}for(const _0x35307e of _0x5adf02){const _0x25967e=_0x3c2849(_0x35307e);_0x445e15[_0x440dba(0x157)](_0x25967e,_0x35307e['id']);}return _0x445e15;}export function buildFolderMaps(_0x322764){const _0x3261b5=a156_0x4ace,_0x5ed5f6=buildFolderIdToPathMap(_0x322764),_0x53fcc5=new Map();for(const [_0x32acb1,_0xb9e9fb]of _0x5ed5f6){_0x53fcc5[_0x3261b5(0x157)](_0xb9e9fb,_0x32acb1);}return{'idToPath':_0x5ed5f6,'pathToId':_0x53fcc5};}export function getFolderPath(_0xcd913f,_0x36b530){const _0x415c66=a156_0x4ace;if(!_0xcd913f)return'';return _0x36b530[_0x415c66(0x156)](_0xcd913f)??'';}
1
+ function a156_0x3974(){const _0x5af274=['get','has','12BKpHeH','346754mrggOL','set','335630hicJKw','105InlImj','495htpUaM','name','1026171fTRwLx','add','parentFolderId','1422456kGAIfu','79844wKywES','3137337VJUHTg','3FhtfAo','6895024pXMDjI'];a156_0x3974=function(){return _0x5af274;};return a156_0x3974();}(function(_0x3c3a5f,_0x2dae5a){const _0x3ae55c=a156_0x4ee4,_0x54a412=_0x3c3a5f();while(!![]){try{const _0x221a09=parseInt(_0x3ae55c(0x1f6))/0x1*(parseInt(_0x3ae55c(0x1ea))/0x2)+parseInt(_0x3ae55c(0x1f0))/0x3+parseInt(_0x3ae55c(0x1f4))/0x4*(parseInt(_0x3ae55c(0x1ed))/0x5)+-parseInt(_0x3ae55c(0x1e9))/0x6*(-parseInt(_0x3ae55c(0x1f3))/0x7)+parseInt(_0x3ae55c(0x1f7))/0x8+-parseInt(_0x3ae55c(0x1f5))/0x9+parseInt(_0x3ae55c(0x1ec))/0xa*(-parseInt(_0x3ae55c(0x1ee))/0xb);if(_0x221a09===_0x2dae5a)break;else _0x54a412['push'](_0x54a412['shift']());}catch(_0x33b98c){_0x54a412['push'](_0x54a412['shift']());}}}(a156_0x3974,0xa8a2f));export function buildFolderIdToPathMap(_0x360d78){const _0x5ea414=a156_0x4ee4,_0x2b9410=new Map(),_0xf21de1=new Map();for(const _0x53d247 of _0x360d78){_0xf21de1[_0x5ea414(0x1eb)](_0x53d247['id'],_0x53d247);}const _0xb815dc=new Set();for(const _0x2e3652 of _0x360d78){!_0x2e3652['parentFolderId']&&_0xb815dc[_0x5ea414(0x1f1)](_0x2e3652['id']);}function _0x3192c1(_0x348bbd){const _0x2509e0=_0x5ea414;if(_0x2b9410[_0x2509e0(0x1e8)](_0x348bbd['id']))return _0x2b9410[_0x2509e0(0x1e7)](_0x348bbd['id']);if(_0xb815dc[_0x2509e0(0x1e8)](_0x348bbd['id']))return _0x2b9410[_0x2509e0(0x1eb)](_0x348bbd['id'],''),'';if(_0x348bbd[_0x2509e0(0x1f2)]){const _0x294d5b=_0xf21de1[_0x2509e0(0x1e7)](_0x348bbd[_0x2509e0(0x1f2)]);if(_0x294d5b){const _0x245feb=_0x3192c1(_0x294d5b),_0x4a2874=_0x245feb?_0x245feb+'/'+_0x348bbd[_0x2509e0(0x1ef)]:_0x348bbd[_0x2509e0(0x1ef)];return _0x2b9410[_0x2509e0(0x1eb)](_0x348bbd['id'],_0x4a2874),_0x4a2874;}}const _0x3f6f9a=_0x348bbd[_0x2509e0(0x1ef)];return _0x2b9410['set'](_0x348bbd['id'],_0x3f6f9a),_0x3f6f9a;}for(const _0x255f7a of _0x360d78){_0x3192c1(_0x255f7a);}return _0x2b9410;}function a156_0x4ee4(_0x28d0e8,_0x39f147){_0x28d0e8=_0x28d0e8-0x1e7;const _0x39745a=a156_0x3974();let _0x4ee4c0=_0x39745a[_0x28d0e8];return _0x4ee4c0;}export function buildFolderPathToIdMap(_0x5a04e5){const _0x2c505b=a156_0x4ee4,_0x5a428f=new Map(),_0x4a182b=new Map();for(const _0x580301 of _0x5a04e5){_0x4a182b[_0x2c505b(0x1eb)](_0x580301['id'],_0x580301);}const _0x2ee5c3=new Set();for(const _0x3acde4 of _0x5a04e5){!_0x3acde4['parentFolderId']&&_0x2ee5c3[_0x2c505b(0x1f1)](_0x3acde4['id']);}function _0x25548e(_0x12da4e){const _0xa9c578=_0x2c505b;if(_0x2ee5c3['has'](_0x12da4e['id']))return'';if(_0x12da4e['parentFolderId']){const _0x5ef24e=_0x4a182b['get'](_0x12da4e[_0xa9c578(0x1f2)]);if(_0x5ef24e){const _0x1e8b94=_0x25548e(_0x5ef24e);return _0x1e8b94?_0x1e8b94+'/'+_0x12da4e[_0xa9c578(0x1ef)]:_0x12da4e[_0xa9c578(0x1ef)];}}return _0x12da4e[_0xa9c578(0x1ef)];}for(const _0x5df317 of _0x5a04e5){const _0x15d0dd=_0x25548e(_0x5df317);_0x5a428f[_0x2c505b(0x1eb)](_0x15d0dd,_0x5df317['id']);}return _0x5a428f;}export function buildFolderMaps(_0x24bf43){const _0x44d10e=a156_0x4ee4,_0x55afea=buildFolderIdToPathMap(_0x24bf43),_0x583369=new Map();for(const [_0x59090a,_0x51ecd9]of _0x55afea){_0x583369[_0x44d10e(0x1eb)](_0x51ecd9,_0x59090a);}return{'idToPath':_0x55afea,'pathToId':_0x583369};}export function getFolderPath(_0x133cfd,_0x1f9aa4){const _0x5cc031=a156_0x4ee4;if(!_0x133cfd)return'';return _0x1f9aa4[_0x5cc031(0x1e7)](_0x133cfd)??'';}
@@ -1 +1 @@
1
- (function(_0x450de2,_0x7ae52d){const _0x1540b9=a157_0x30bb,_0x1c1b8b=_0x450de2();while(!![]){try{const _0x5e26bd=-parseInt(_0x1540b9(0xa5))/0x1*(parseInt(_0x1540b9(0x81))/0x2)+parseInt(_0x1540b9(0x8b))/0x3+-parseInt(_0x1540b9(0x8e))/0x4+parseInt(_0x1540b9(0xa6))/0x5+parseInt(_0x1540b9(0x8d))/0x6*(-parseInt(_0x1540b9(0x80))/0x7)+parseInt(_0x1540b9(0xa0))/0x8*(-parseInt(_0x1540b9(0x90))/0x9)+parseInt(_0x1540b9(0x83))/0xa;if(_0x5e26bd===_0x7ae52d)break;else _0x1c1b8b['push'](_0x1c1b8b['shift']());}catch(_0x192da8){_0x1c1b8b['push'](_0x1c1b8b['shift']());}}}(a157_0x1c77,0x6595e));import a157_0x5a34de from'path';import{parse as a157_0x46dc91}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x56e29a){const _0x1937c5=a157_0x30bb;if(!_0x56e29a||_0x56e29a[_0x1937c5(0x9d)]()==='')throw new Error(_0x1937c5(0x84));const _0x16af86=_0x56e29a[_0x1937c5(0x9d)]();if(_0x16af86==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x56e29a};const _0x2906ae=_0x16af86[_0x1937c5(0xa2)]('/')?_0x16af86['substring'](0x1):_0x16af86,_0x30ddd7=_0x2906ae[_0x1937c5(0x7c)]('/')[_0x1937c5(0x96)](_0x3d73dc=>_0x3d73dc!=='');if(_0x30ddd7[_0x1937c5(0x95)]===0x0)throw new Error(_0x1937c5(0xa3));const _0x2d8643=_0x16af86[_0x1937c5(0xa2)]('/')||!isRelativePathSegment(_0x30ddd7[0x0]);for(const _0x569f17 of _0x30ddd7){validatePathSegment(_0x569f17);}return{'segments':_0x30ddd7,'isAbsolute':_0x2d8643,'raw':_0x56e29a};}function isRelativePathSegment(_0x5dd6b6){return _0x5dd6b6==='.'||_0x5dd6b6==='..';}function validatePathSegment(_0x5baae6){const _0x3098c0=a157_0x30bb;if(_0x5baae6==='')throw new Error(_0x3098c0(0x8c));if(_0x5baae6==='.'||_0x5baae6==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x5baae6))throw new Error(_0x3098c0(0x7d)+_0x5baae6);if(_0x5baae6!==_0x5baae6[_0x3098c0(0x9d)]()){}}export function validatePath(_0x2540a2){const _0x24e983=a157_0x30bb;if(_0x2540a2[_0x24e983(0x97)]['length']===0x0&&!_0x2540a2[_0x24e983(0x87)])throw new Error(_0x24e983(0xa1));if(_0x2540a2[_0x24e983(0x87)]){if(_0x2540a2[_0x24e983(0x97)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x4351ac=0x0;for(const _0x2599b7 of _0x2540a2[_0x24e983(0x97)]){if(_0x2599b7==='..'){if(_0x4351ac===0x0)throw new Error(_0x24e983(0x9e));_0x4351ac--;}else _0x2599b7!=='.'&&_0x4351ac++;}}}export function joinPaths(_0x95a221,_0x3b5e9f){const _0x367202=a157_0x30bb;if(!_0x95a221||_0x95a221==='/')return _0x3b5e9f;if(!_0x3b5e9f||_0x3b5e9f==='.')return _0x95a221;if(_0x3b5e9f[_0x367202(0xa2)]('/'))return _0x3b5e9f;const _0x4d49e5=parsePath(_0x95a221),_0x4763e2=parsePath(_0x3b5e9f),_0x24504e=[..._0x4d49e5[_0x367202(0x97)]];for(const _0x253e7f of _0x4763e2[_0x367202(0x97)]){if(_0x253e7f==='.')continue;else{if(_0x253e7f==='..'){if(_0x24504e[_0x367202(0x95)]===0x0)throw new Error(_0x367202(0x89));_0x24504e['pop']();}else _0x24504e['push'](_0x253e7f);}}const _0x2c63eb=_0x24504e['join']('/');return _0x4d49e5[_0x367202(0x93)]['startsWith']('/')?'/'+_0x2c63eb:_0x2c63eb;}export function normalizePath(_0x312fd1){const _0x384d3b=a157_0x30bb,_0x21f2bd=parsePath(_0x312fd1),_0x56009f=[];for(const _0x35fe38 of _0x21f2bd[_0x384d3b(0x97)]){if(_0x35fe38==='.')continue;else{if(_0x35fe38==='..'){if(_0x56009f[_0x384d3b(0x95)]===0x0){if(_0x21f2bd[_0x384d3b(0x87)])throw new Error(_0x384d3b(0x89));_0x56009f[_0x384d3b(0xa4)]('..');}else _0x56009f[_0x56009f[_0x384d3b(0x95)]-0x1]==='..'?_0x56009f[_0x384d3b(0xa4)]('..'):_0x56009f[_0x384d3b(0x9c)]();}else _0x56009f[_0x384d3b(0xa4)](_0x35fe38);}}if(_0x56009f[_0x384d3b(0x95)]===0x0)return _0x21f2bd['isAbsolute']?'/':'.';const _0x39f467=_0x56009f[_0x384d3b(0x86)]('/');return _0x21f2bd['raw']['startsWith']('/')?'/'+_0x39f467:_0x39f467;}export function getParentPath(_0x1e0147){const _0x20388b=a157_0x30bb,_0x846718=parsePath(_0x1e0147);if(_0x846718[_0x20388b(0x97)][_0x20388b(0x95)]<=0x1)return'/';const _0x284783=_0x846718[_0x20388b(0x97)]['slice'](0x0,-0x1)[_0x20388b(0x86)]('/');return _0x846718[_0x20388b(0x93)]['startsWith']('/')?'/'+_0x284783:_0x284783;}function a157_0x1c77(){const _0x57c1ed=['journey','No\x20tdx.json\x20found\x20for\x20file:\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','split','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','readFile','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','217UHxgps','298FRimEx','type','17810430GYPKWI','Path\x20cannot\x20be\x20empty','parent_segment','join','isAbsolute','root','Cannot\x20navigate\x20above\x20root','exists','1274040HYCaiz','Path\x20segment\x20cannot\x20be\x20empty','100014JLsUfJ','2858476IrRrDu','.yaml','18clPRXK','.yml','slice','raw','dirname','length','filter','segments','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','resolve','parse','name','pop','trim','Path\x20attempts\x20to\x20navigate\x20above\x20root','endsWith','970544iZuqNb','Relative\x20path\x20cannot\x20be\x20empty','startsWith','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','push','2885vQImLs','571150MkqfgN','relative'];a157_0x1c77=function(){return _0x57c1ed;};return a157_0x1c77();}function a157_0x30bb(_0x290595,_0x4ab967){_0x290595=_0x290595-0x79;const _0x1c77b4=a157_0x1c77();let _0x30bba9=_0x1c77b4[_0x290595];return _0x30bba9;}export function getBaseName(_0x27b313){const _0x403176=a157_0x30bb,_0x345917=parsePath(_0x27b313);return _0x345917[_0x403176(0x97)][_0x345917[_0x403176(0x97)][_0x403176(0x95)]-0x1]||'';}export function isChildPath(_0x224f90,_0x2de1bd){const _0x343f5f=a157_0x30bb,_0x576922=parsePath(_0x224f90),_0x1a26dc=parsePath(_0x2de1bd);if(_0x576922[_0x343f5f(0x97)][_0x343f5f(0x95)]<=_0x1a26dc[_0x343f5f(0x97)]['length'])return![];for(let _0x57c6d1=0x0;_0x57c6d1<_0x1a26dc[_0x343f5f(0x97)][_0x343f5f(0x95)];_0x57c6d1++){if(_0x576922[_0x343f5f(0x97)][_0x57c6d1]!==_0x1a26dc[_0x343f5f(0x97)][_0x57c6d1])return![];}return!![];}export function splitPath(_0x34d174){const _0x3a1c50=a157_0x30bb,_0x548ebc=parsePath(_0x34d174);if(_0x548ebc[_0x3a1c50(0x97)][_0x3a1c50(0x95)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x548ebc[_0x3a1c50(0x97)][_0x3a1c50(0x95)]===0x1)return{'parent':_0x548ebc[_0x3a1c50(0x97)][0x0]};return{'parent':_0x548ebc['segments'][0x0],'child':_0x548ebc['segments'][_0x3a1c50(0x92)](0x1)[_0x3a1c50(0x86)]('/')};}export function isYamlFilePath(_0x3f118a){const _0x56145c=a157_0x30bb;return _0x3f118a[_0x56145c(0x9f)](_0x56145c(0x91))||_0x3f118a['endsWith'](_0x56145c(0x8f));}export async function resolveYamlFilePath(_0x17b624,_0x2d0a58=nodeFileSystem){const _0x41fff6=a157_0x30bb,_0x4ec227=a157_0x5a34de[_0x41fff6(0x99)](_0x17b624);if(!await _0x2d0a58[_0x41fff6(0x8a)](_0x4ec227))throw new Error('File\x20not\x20found:\x20'+_0x17b624);let _0x3d59be=a157_0x5a34de[_0x41fff6(0x94)](_0x4ec227),_0x978643=null,_0x4cd704=null;const _0x1e9756=a157_0x5a34de[_0x41fff6(0x9a)](_0x3d59be)[_0x41fff6(0x88)];while(_0x3d59be!==_0x1e9756){const _0x30eb73=a157_0x5a34de[_0x41fff6(0x86)](_0x3d59be,'tdx.json');if(await _0x2d0a58[_0x41fff6(0x8a)](_0x30eb73)){_0x978643=_0x30eb73,_0x4cd704=_0x3d59be;break;}_0x3d59be=a157_0x5a34de[_0x41fff6(0x94)](_0x3d59be);}if(!_0x978643||!_0x4cd704)throw new Error(_0x41fff6(0x7a)+_0x17b624+'\x0a'+_0x41fff6(0x7f));const _0x5c0341=await _0x2d0a58[_0x41fff6(0x7e)](_0x978643),_0x316250=JSON[_0x41fff6(0x9a)](_0x5c0341),_0x21d243=_0x316250[_0x41fff6(0x85)];if(!_0x21d243)throw new Error(_0x41fff6(0x7b));const _0x4c5cd3=await _0x2d0a58[_0x41fff6(0x7e)](_0x4ec227),_0x3deaa7=a157_0x46dc91(_0x4c5cd3),_0x2e573b=_0x3deaa7[_0x41fff6(0x9b)];if(!_0x2e573b)throw new Error(_0x41fff6(0x98)+_0x17b624);const _0xb95af9=_0x3deaa7[_0x41fff6(0x82)]===_0x41fff6(0x79)?'journey':'segment',_0x2d91f3=a157_0x5a34de[_0x41fff6(0xa7)](_0x4cd704,_0x4ec227),_0x128257=a157_0x5a34de['dirname'](_0x2d91f3),_0x3a6b84=_0x128257==='.'?'':_0x128257['replace'](/\\/g,'/'),_0x4fdd9b=_0x3a6b84?_0x21d243+'/'+_0x3a6b84+'/'+_0x2e573b:_0x21d243+'/'+_0x2e573b;return{'parentSegment':_0x21d243,'segmentName':_0x2e573b,'folderPath':_0x3a6b84,'fullPath':_0x4fdd9b,'resourceType':_0xb95af9,'content':_0x4c5cd3};}
1
+ (function(_0x469e84,_0x297e57){const _0x291116=a157_0x523d,_0x46fcf2=_0x469e84();while(!![]){try{const _0xd2db9f=parseInt(_0x291116(0x150))/0x1+parseInt(_0x291116(0x161))/0x2+parseInt(_0x291116(0x158))/0x3*(-parseInt(_0x291116(0x154))/0x4)+parseInt(_0x291116(0x16a))/0x5*(parseInt(_0x291116(0x166))/0x6)+parseInt(_0x291116(0x15d))/0x7+parseInt(_0x291116(0x14d))/0x8*(parseInt(_0x291116(0x152))/0x9)+parseInt(_0x291116(0x159))/0xa*(-parseInt(_0x291116(0x14c))/0xb);if(_0xd2db9f===_0x297e57)break;else _0x46fcf2['push'](_0x46fcf2['shift']());}catch(_0x233ff8){_0x46fcf2['push'](_0x46fcf2['shift']());}}}(a157_0x58c7,0xa3a03));import a157_0x396baa from'path';import{parse as a157_0x9d79cb}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x58896e){const _0x33a8fd=a157_0x523d;if(!_0x58896e||_0x58896e[_0x33a8fd(0x165)]()==='')throw new Error(_0x33a8fd(0x16d));const _0xfad6ad=_0x58896e['trim']();if(_0xfad6ad==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x58896e};const _0x31ce1d=_0xfad6ad[_0x33a8fd(0x13e)]('/')?_0xfad6ad[_0x33a8fd(0x153)](0x1):_0xfad6ad,_0xcfe981=_0x31ce1d[_0x33a8fd(0x155)]('/')[_0x33a8fd(0x15b)](_0x474e9b=>_0x474e9b!=='');if(_0xcfe981[_0x33a8fd(0x14b)]===0x0)throw new Error(_0x33a8fd(0x151));const _0x178293=_0xfad6ad[_0x33a8fd(0x13e)]('/')||!isRelativePathSegment(_0xcfe981[0x0]);for(const _0x416a7f of _0xcfe981){validatePathSegment(_0x416a7f);}return{'segments':_0xcfe981,'isAbsolute':_0x178293,'raw':_0x58896e};}function isRelativePathSegment(_0x2fc6e2){return _0x2fc6e2==='.'||_0x2fc6e2==='..';}function a157_0x523d(_0x3cf689,_0x3ee02d){_0x3cf689=_0x3cf689-0x13e;const _0x58c7a5=a157_0x58c7();let _0x523dbc=_0x58c7a5[_0x3cf689];return _0x523dbc;}function validatePathSegment(_0x943e17){const _0x103b19=a157_0x523d;if(_0x943e17==='')throw new Error(_0x103b19(0x14e));if(_0x943e17==='.'||_0x943e17==='..')return;if(/[\x00-\x1F\x7F]/[_0x103b19(0x16c)](_0x943e17))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x943e17);if(_0x943e17!==_0x943e17[_0x103b19(0x165)]()){}}export function validatePath(_0x3cbd00){const _0x23cd1d=a157_0x523d;if(_0x3cbd00[_0x23cd1d(0x167)]['length']===0x0&&!_0x3cbd00[_0x23cd1d(0x157)])throw new Error(_0x23cd1d(0x145));if(_0x3cbd00[_0x23cd1d(0x157)]){if(_0x3cbd00[_0x23cd1d(0x167)][0x0]==='..')throw new Error(_0x23cd1d(0x14f));let _0x476531=0x0;for(const _0x595f7a of _0x3cbd00['segments']){if(_0x595f7a==='..'){if(_0x476531===0x0)throw new Error(_0x23cd1d(0x16f));_0x476531--;}else _0x595f7a!=='.'&&_0x476531++;}}}export function joinPaths(_0x2d237d,_0x5de854){const _0x5df608=a157_0x523d;if(!_0x2d237d||_0x2d237d==='/')return _0x5de854;if(!_0x5de854||_0x5de854==='.')return _0x2d237d;if(_0x5de854[_0x5df608(0x13e)]('/'))return _0x5de854;const _0x1e5204=parsePath(_0x2d237d),_0x10ed53=parsePath(_0x5de854),_0x44938f=[..._0x1e5204[_0x5df608(0x167)]];for(const _0x22140b of _0x10ed53[_0x5df608(0x167)]){if(_0x22140b==='.')continue;else{if(_0x22140b==='..'){if(_0x44938f[_0x5df608(0x14b)]===0x0)throw new Error(_0x5df608(0x168));_0x44938f[_0x5df608(0x140)]();}else _0x44938f[_0x5df608(0x141)](_0x22140b);}}const _0x19a5ea=_0x44938f[_0x5df608(0x16e)]('/');return _0x1e5204[_0x5df608(0x148)][_0x5df608(0x13e)]('/')?'/'+_0x19a5ea:_0x19a5ea;}export function normalizePath(_0x5c050c){const _0x356fc8=a157_0x523d,_0x31736d=parsePath(_0x5c050c),_0x4dd1cd=[];for(const _0x470a87 of _0x31736d[_0x356fc8(0x167)]){if(_0x470a87==='.')continue;else{if(_0x470a87==='..'){if(_0x4dd1cd[_0x356fc8(0x14b)]===0x0){if(_0x31736d[_0x356fc8(0x157)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x4dd1cd[_0x356fc8(0x141)]('..');}else _0x4dd1cd[_0x4dd1cd[_0x356fc8(0x14b)]-0x1]==='..'?_0x4dd1cd[_0x356fc8(0x141)]('..'):_0x4dd1cd[_0x356fc8(0x140)]();}else _0x4dd1cd['push'](_0x470a87);}}if(_0x4dd1cd[_0x356fc8(0x14b)]===0x0)return _0x31736d[_0x356fc8(0x157)]?'/':'.';const _0x5c3986=_0x4dd1cd[_0x356fc8(0x16e)]('/');return _0x31736d[_0x356fc8(0x148)][_0x356fc8(0x13e)]('/')?'/'+_0x5c3986:_0x5c3986;}export function getParentPath(_0x3a3fa0){const _0x606497=a157_0x523d,_0x408fd9=parsePath(_0x3a3fa0);if(_0x408fd9[_0x606497(0x167)]['length']<=0x1)return'/';const _0x155aa5=_0x408fd9[_0x606497(0x167)]['slice'](0x0,-0x1)[_0x606497(0x16e)]('/');return _0x408fd9[_0x606497(0x148)]['startsWith']('/')?'/'+_0x155aa5:_0x155aa5;}export function getBaseName(_0x271cda){const _0x5e020b=a157_0x523d,_0x3ef6f1=parsePath(_0x271cda);return _0x3ef6f1[_0x5e020b(0x167)][_0x3ef6f1[_0x5e020b(0x167)][_0x5e020b(0x14b)]-0x1]||'';}export function isChildPath(_0x16a047,_0x58f03f){const _0xadcf7c=a157_0x523d,_0x3361fd=parsePath(_0x16a047),_0x1a3313=parsePath(_0x58f03f);if(_0x3361fd[_0xadcf7c(0x167)]['length']<=_0x1a3313[_0xadcf7c(0x167)][_0xadcf7c(0x14b)])return![];for(let _0x55422d=0x0;_0x55422d<_0x1a3313[_0xadcf7c(0x167)][_0xadcf7c(0x14b)];_0x55422d++){if(_0x3361fd[_0xadcf7c(0x167)][_0x55422d]!==_0x1a3313[_0xadcf7c(0x167)][_0x55422d])return![];}return!![];}function a157_0x58c7(){const _0x1e62b8=['11aFSyCM','48632keUdMv','Path\x20segment\x20cannot\x20be\x20empty','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','743692xGeDBm','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','333sFGriB','substring','100652haGGBI','split','parse','isAbsolute','51wMMZuR','19823070VoezRE','.yaml','filter','root','6769952hqTYQo','No\x20tdx.json\x20found\x20for\x20file:\x20','journey','Cannot\x20split\x20empty\x20path','2245586ZdXyZL','dirname','tdx.json','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','trim','26094AnEfsJ','segments','Cannot\x20navigate\x20above\x20root','.yml','25ZqpMcz','endsWith','test','Path\x20cannot\x20be\x20empty','join','Path\x20attempts\x20to\x20navigate\x20above\x20root','startsWith','exists','pop','push','readFile','name','replace','Relative\x20path\x20cannot\x20be\x20empty','segment','relative','raw','type','File\x20not\x20found:\x20','length'];a157_0x58c7=function(){return _0x1e62b8;};return a157_0x58c7();}export function splitPath(_0x103f4e){const _0x14edba=a157_0x523d,_0x4863c1=parsePath(_0x103f4e);if(_0x4863c1[_0x14edba(0x167)][_0x14edba(0x14b)]===0x0)throw new Error(_0x14edba(0x160));if(_0x4863c1[_0x14edba(0x167)][_0x14edba(0x14b)]===0x1)return{'parent':_0x4863c1[_0x14edba(0x167)][0x0]};return{'parent':_0x4863c1['segments'][0x0],'child':_0x4863c1[_0x14edba(0x167)]['slice'](0x1)[_0x14edba(0x16e)]('/')};}export function isYamlFilePath(_0x31e8d4){const _0x12f625=a157_0x523d;return _0x31e8d4[_0x12f625(0x16b)](_0x12f625(0x169))||_0x31e8d4[_0x12f625(0x16b)](_0x12f625(0x15a));}export async function resolveYamlFilePath(_0x4f4f13,_0x4ddb98=nodeFileSystem){const _0x2ca25d=a157_0x523d,_0x1af14e=a157_0x396baa['resolve'](_0x4f4f13);if(!await _0x4ddb98[_0x2ca25d(0x13f)](_0x1af14e))throw new Error(_0x2ca25d(0x14a)+_0x4f4f13);let _0x5bac67=a157_0x396baa[_0x2ca25d(0x162)](_0x1af14e),_0x3ddb9e=null,_0x25152c=null;const _0x3df286=a157_0x396baa[_0x2ca25d(0x156)](_0x5bac67)[_0x2ca25d(0x15c)];while(_0x5bac67!==_0x3df286){const _0x1aba83=a157_0x396baa[_0x2ca25d(0x16e)](_0x5bac67,_0x2ca25d(0x163));if(await _0x4ddb98[_0x2ca25d(0x13f)](_0x1aba83)){_0x3ddb9e=_0x1aba83,_0x25152c=_0x5bac67;break;}_0x5bac67=a157_0x396baa[_0x2ca25d(0x162)](_0x5bac67);}if(!_0x3ddb9e||!_0x25152c)throw new Error(_0x2ca25d(0x15e)+_0x4f4f13+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0xb5f15f=await _0x4ddb98[_0x2ca25d(0x142)](_0x3ddb9e),_0x3b08f4=JSON[_0x2ca25d(0x156)](_0xb5f15f),_0x2c2cbf=_0x3b08f4['parent_segment'];if(!_0x2c2cbf)throw new Error(_0x2ca25d(0x164));const _0xb107ad=await _0x4ddb98['readFile'](_0x1af14e),_0x1f8f90=a157_0x9d79cb(_0xb107ad),_0x77fa81=_0x1f8f90[_0x2ca25d(0x143)];if(!_0x77fa81)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x4f4f13);const _0x4997a6=_0x1f8f90[_0x2ca25d(0x149)]===_0x2ca25d(0x15f)?_0x2ca25d(0x15f):_0x2ca25d(0x146),_0x1452e0=a157_0x396baa[_0x2ca25d(0x147)](_0x25152c,_0x1af14e),_0x5ade1a=a157_0x396baa['dirname'](_0x1452e0),_0x22fffb=_0x5ade1a==='.'?'':_0x5ade1a[_0x2ca25d(0x144)](/\\/g,'/'),_0x48fdb4=_0x22fffb?_0x2c2cbf+'/'+_0x22fffb+'/'+_0x77fa81:_0x2c2cbf+'/'+_0x77fa81;return{'parentSegment':_0x2c2cbf,'segmentName':_0x77fa81,'folderPath':_0x22fffb,'fullPath':_0x48fdb4,'resourceType':_0x4997a6,'content':_0xb107ad};}
@@ -1 +1 @@
1
- function a158_0x2975(_0xd07025,_0x25ea84){_0xd07025=_0xd07025-0x169;const _0x48099b=a158_0x4809();let _0x29752f=_0x48099b[_0xd07025];return _0x29752f;}(function(_0x20a3bd,_0x55a740){const _0x536332=a158_0x2975,_0x3a8bfa=_0x20a3bd();while(!![]){try{const _0x1810d2=parseInt(_0x536332(0x16c))/0x1+parseInt(_0x536332(0x16b))/0x2+parseInt(_0x536332(0x170))/0x3*(-parseInt(_0x536332(0x176))/0x4)+parseInt(_0x536332(0x171))/0x5+-parseInt(_0x536332(0x16a))/0x6*(-parseInt(_0x536332(0x16e))/0x7)+-parseInt(_0x536332(0x16f))/0x8+-parseInt(_0x536332(0x16d))/0x9;if(_0x1810d2===_0x55a740)break;else _0x3a8bfa['push'](_0x3a8bfa['shift']());}catch(_0x1036be){_0x3a8bfa['push'](_0x3a8bfa['shift']());}}}(a158_0x4809,0xe58b2));export function parseSegmentRef(_0x2f7817){const _0x45a5e7=a158_0x2975,_0x467777=_0x2f7817[_0x45a5e7(0x169)]('/');if(_0x467777===-0x1)return{'parentId':_0x2f7817};if(_0x467777===0x0)throw new Error(_0x45a5e7(0x173)+_0x2f7817+_0x45a5e7(0x175));const _0x59b449=_0x2f7817[_0x45a5e7(0x174)](0x0,_0x467777),_0x46bb54=_0x2f7817[_0x45a5e7(0x174)](_0x467777+0x1);if(_0x46bb54==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2f7817+_0x45a5e7(0x172));return{'parentId':_0x59b449,'childId':_0x46bb54};}function a158_0x4809(){const _0x167241=['1217658KYMbAj','1571498GeVmVm','1272841VQmNIK','4681719fTCKqD','14hGaERI','3265896sYbLWz','2361QckvpR','2529810wuUBGS','.\x20Child\x20name\x20cannot\x20be\x20empty','Invalid\x20segment\x20reference\x20format:\x20','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','5600UjSfOu','indexOf'];a158_0x4809=function(){return _0x167241;};return a158_0x4809();}
1
+ (function(_0x42a617,_0x23fe76){const _0x444e7b=a158_0x56b2,_0x4f2798=_0x42a617();while(!![]){try{const _0x1c6714=-parseInt(_0x444e7b(0x16f))/0x1*(parseInt(_0x444e7b(0x16c))/0x2)+-parseInt(_0x444e7b(0x167))/0x3*(-parseInt(_0x444e7b(0x16e))/0x4)+parseInt(_0x444e7b(0x177))/0x5*(parseInt(_0x444e7b(0x16a))/0x6)+-parseInt(_0x444e7b(0x175))/0x7+parseInt(_0x444e7b(0x170))/0x8*(-parseInt(_0x444e7b(0x176))/0x9)+-parseInt(_0x444e7b(0x16b))/0xa+parseInt(_0x444e7b(0x173))/0xb*(parseInt(_0x444e7b(0x174))/0xc);if(_0x1c6714===_0x23fe76)break;else _0x4f2798['push'](_0x4f2798['shift']());}catch(_0x1e3754){_0x4f2798['push'](_0x4f2798['shift']());}}}(a158_0x1c8c,0xe912b));function a158_0x56b2(_0x325799,_0x2d4a28){_0x325799=_0x325799-0x167;const _0x1c8c37=a158_0x1c8c();let _0x56b262=_0x1c8c37[_0x325799];return _0x56b262;}export function parseSegmentRef(_0x26bedb){const _0x6b993a=a158_0x56b2,_0x19ef65=_0x26bedb[_0x6b993a(0x171)]('/');if(_0x19ef65===-0x1)return{'parentId':_0x26bedb};if(_0x19ef65===0x0)throw new Error(_0x6b993a(0x172)+_0x26bedb+_0x6b993a(0x169));const _0x4b77a8=_0x26bedb[_0x6b993a(0x16d)](0x0,_0x19ef65),_0xad25d2=_0x26bedb['substring'](_0x19ef65+0x1);if(_0xad25d2==='')throw new Error(_0x6b993a(0x172)+_0x26bedb+_0x6b993a(0x168));return{'parentId':_0x4b77a8,'childId':_0xad25d2};}function a158_0x1c8c(){const _0x17456b=['indexOf','Invalid\x20segment\x20reference\x20format:\x20','572NXhhvT','498156SQEgXE','7003297gViaAr','1161UMNGwE','5lvVmqt','148704XcHifz','.\x20Child\x20name\x20cannot\x20be\x20empty','.\x20Parent\x20name\x20cannot\x20be\x20empty','9750648PwQPZF','3240790fvjZNe','2768vaTiev','substring','152QMYQDJ','1103HZogQu','115448JbEGst'];a158_0x1c8c=function(){return _0x17456b;};return a158_0x1c8c();}