@treasuredata/tdx 2026.8.2 → 2026.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/p13n-command.d.ts +11 -0
  39. package/dist/commands/p13n-command.d.ts.map +1 -0
  40. package/dist/commands/p13n-command.js +1 -0
  41. package/dist/commands/p13n-command.js.map +1 -0
  42. package/dist/commands/parent-segment-command.js +1 -1
  43. package/dist/commands/policy-command.js +1 -1
  44. package/dist/commands/profile-command.js +1 -1
  45. package/dist/commands/profiles-command.js +1 -1
  46. package/dist/commands/query-command.js +1 -1
  47. package/dist/commands/schedule-command.js +1 -1
  48. package/dist/commands/segment-command.js +1 -1
  49. package/dist/commands/segment-create-command.js +1 -1
  50. package/dist/commands/segment-fields-command.js +1 -1
  51. package/dist/commands/segment-move-command.js +1 -1
  52. package/dist/commands/segment-pull-command.js +1 -1
  53. package/dist/commands/segment-push-command.js +1 -1
  54. package/dist/commands/segment-update-command.js +1 -1
  55. package/dist/commands/segment-use-command.js +1 -1
  56. package/dist/commands/segment-validate-command.js +1 -1
  57. package/dist/commands/segments.js +1 -1
  58. package/dist/commands/show.js +1 -1
  59. package/dist/commands/status-command.js +1 -1
  60. package/dist/commands/table-deleted.js +1 -1
  61. package/dist/commands/tables.js +1 -1
  62. package/dist/commands/unset-command.js +1 -1
  63. package/dist/commands/upgrade-command.js +1 -1
  64. package/dist/commands/use-command.js +1 -1
  65. package/dist/commands/user-command.js +1 -1
  66. package/dist/commands/work-command.js +1 -1
  67. package/dist/commands/workflow-command.js +1 -1
  68. package/dist/core/auth.js +1 -1
  69. package/dist/core/command-output.js +1 -1
  70. package/dist/core/config.js +1 -1
  71. package/dist/core/connection-cache.js +1 -1
  72. package/dist/core/constants.js +1 -1
  73. package/dist/core/credential-cache.js +1 -1
  74. package/dist/core/global-context.d.ts.map +1 -1
  75. package/dist/core/global-context.js +1 -1
  76. package/dist/core/global-context.js.map +1 -1
  77. package/dist/core/keychain.js +1 -1
  78. package/dist/core/oauth-keychain.js +1 -1
  79. package/dist/core/oauth.d.ts +9 -1
  80. package/dist/core/oauth.d.ts.map +1 -1
  81. package/dist/core/oauth.js +1 -1
  82. package/dist/core/oauth.js.map +1 -1
  83. package/dist/core/profile.js +1 -1
  84. package/dist/core/project-config.js +1 -1
  85. package/dist/core/session.js +1 -1
  86. package/dist/core/site-mismatch.js +1 -1
  87. package/dist/core/user-cache.js +1 -1
  88. package/dist/core/version.js +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/mcp/server.js +1 -1
  91. package/dist/mcp/tools/index.js +1 -1
  92. package/dist/mcp/tools/tdx-run.js +1 -1
  93. package/dist/mcp/tools/tdx-search.js +1 -1
  94. package/dist/mcp/tools/work-create-item.js +1 -1
  95. package/dist/mcp/utils.js +1 -1
  96. package/dist/proxy/claude-usage-tracker.js +1 -1
  97. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  98. package/dist/proxy/passthrough-server.js +1 -1
  99. package/dist/proxy/passthrough-server.js.map +1 -1
  100. package/dist/proxy/sse-usage-parser.js +1 -1
  101. package/dist/sdk/agent/agent-config.js +1 -1
  102. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  103. package/dist/sdk/agent/agent-yaml.js +1 -1
  104. package/dist/sdk/agent/test/evaluator.js +1 -1
  105. package/dist/sdk/agent/test/executor.js +1 -1
  106. package/dist/sdk/agent/test/index.js +1 -1
  107. package/dist/sdk/agent/test/output.js +1 -1
  108. package/dist/sdk/agent/test/parser.js +1 -1
  109. package/dist/sdk/agent/tool-target-registry.js +1 -1
  110. package/dist/sdk/api.js +1 -1
  111. package/dist/sdk/auth-token.d.ts +42 -6
  112. package/dist/sdk/auth-token.d.ts.map +1 -1
  113. package/dist/sdk/auth-token.js +1 -1
  114. package/dist/sdk/auth-token.js.map +1 -1
  115. package/dist/sdk/cas/cas-api-client.d.ts +9 -3
  116. package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
  117. package/dist/sdk/cas/cas-api-client.js +1 -1
  118. package/dist/sdk/cas/cas-api-client.js.map +1 -1
  119. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  120. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  121. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  122. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  123. package/dist/sdk/cas/index.d.ts +10 -0
  124. package/dist/sdk/cas/index.d.ts.map +1 -1
  125. package/dist/sdk/cas/index.js +1 -1
  126. package/dist/sdk/cas/index.js.map +1 -1
  127. package/dist/sdk/cas/pull-workflow.js +1 -1
  128. package/dist/sdk/cas/push-workflow.js +1 -1
  129. package/dist/sdk/cas/validate-files.js +1 -1
  130. package/dist/sdk/client/cdp-api-client.js +1 -1
  131. package/dist/sdk/client/delivery-api-client.js +1 -1
  132. package/dist/sdk/client/endpoints.d.ts +6 -0
  133. package/dist/sdk/client/endpoints.d.ts.map +1 -1
  134. package/dist/sdk/client/endpoints.js +1 -1
  135. package/dist/sdk/client/endpoints.js.map +1 -1
  136. package/dist/sdk/client/engage-api-client.js +1 -1
  137. package/dist/sdk/client/http-client.js +1 -1
  138. package/dist/sdk/client/llm-api-client.js +1 -1
  139. package/dist/sdk/client/oauth-refresh.d.ts +11 -2
  140. package/dist/sdk/client/oauth-refresh.d.ts.map +1 -1
  141. package/dist/sdk/client/oauth-refresh.js +1 -1
  142. package/dist/sdk/client/oauth-refresh.js.map +1 -1
  143. package/dist/sdk/client/p13n-studio-api-client.d.ts +19 -0
  144. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -0
  145. package/dist/sdk/client/p13n-studio-api-client.js +1 -0
  146. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -0
  147. package/dist/sdk/client/rate-limiter.js +1 -1
  148. package/dist/sdk/client/td-api-client.js +1 -1
  149. package/dist/sdk/client/trino-api-client.js +1 -1
  150. package/dist/sdk/client/workflow-client.js +1 -1
  151. package/dist/sdk/connection-validator.js +1 -1
  152. package/dist/sdk/connection.js +1 -1
  153. package/dist/sdk/delivery.js +1 -1
  154. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  155. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  156. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  157. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  158. package/dist/sdk/engage/campaign-pull.js +1 -1
  159. package/dist/sdk/engage/campaign-push.js +1 -1
  160. package/dist/sdk/engage/campaign-validator.js +1 -1
  161. package/dist/sdk/engage/campaign-yaml.js +1 -1
  162. package/dist/sdk/engage/template-pull.js +1 -1
  163. package/dist/sdk/engage/template-push.js +1 -1
  164. package/dist/sdk/engage/template-validator.js +1 -1
  165. package/dist/sdk/engage/template-yaml.js +1 -1
  166. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  167. package/dist/sdk/engage/types/campaign-def.js +1 -1
  168. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  169. package/dist/sdk/engage/types/template-schema.js +1 -1
  170. package/dist/sdk/engage.js +1 -1
  171. package/dist/sdk/errors.js +1 -1
  172. package/dist/sdk/index.d.ts +6 -0
  173. package/dist/sdk/index.d.ts.map +1 -1
  174. package/dist/sdk/index.js +1 -1
  175. package/dist/sdk/index.js.map +1 -1
  176. package/dist/sdk/io/index.js +1 -1
  177. package/dist/sdk/io/node-filesystem.js +1 -1
  178. package/dist/sdk/job.js +1 -1
  179. package/dist/sdk/journey.js +1 -1
  180. package/dist/sdk/llm/chat-cache.js +1 -1
  181. package/dist/sdk/llm/index.js +1 -1
  182. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  183. package/dist/sdk/llm/model-factors.js +1 -1
  184. package/dist/sdk/llm/user-settings.js +1 -1
  185. package/dist/sdk/p13n-studio.d.ts +13 -0
  186. package/dist/sdk/p13n-studio.d.ts.map +1 -0
  187. package/dist/sdk/p13n-studio.js +1 -0
  188. package/dist/sdk/p13n-studio.js.map +1 -0
  189. package/dist/sdk/personalization.js +1 -1
  190. package/dist/sdk/policy.js +1 -1
  191. package/dist/sdk/query/deleted-table-validation.js +1 -1
  192. package/dist/sdk/query/index.js +1 -1
  193. package/dist/sdk/query/sql-parser.js +1 -1
  194. package/dist/sdk/realtime.js +1 -1
  195. package/dist/sdk/schedule.js +1 -1
  196. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  197. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  198. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  199. package/dist/sdk/segment/fields-display.js +1 -1
  200. package/dist/sdk/segment/file-discovery.js +1 -1
  201. package/dist/sdk/segment/journey-utils.js +1 -1
  202. package/dist/sdk/segment/journey-validator.js +1 -1
  203. package/dist/sdk/segment/journey-yaml.js +1 -1
  204. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  205. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  206. package/dist/sdk/segment/pull-workflow.js +1 -1
  207. package/dist/sdk/segment/push-recovery.js +1 -1
  208. package/dist/sdk/segment/push-workflow.js +1 -1
  209. package/dist/sdk/segment/resolution-context.js +1 -1
  210. package/dist/sdk/segment/segment-path-parser.js +1 -1
  211. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  212. package/dist/sdk/segment/segment-validator.js +1 -1
  213. package/dist/sdk/segment/target-resolution.js +1 -1
  214. package/dist/sdk/segment/tdx-config.js +1 -1
  215. package/dist/sdk/segment/types/activation-schema.js +1 -1
  216. package/dist/sdk/segment/types/journey-def.js +1 -1
  217. package/dist/sdk/segment/types/journey-schema.js +1 -1
  218. package/dist/sdk/segment/types/segment-def.js +1 -1
  219. package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -1
  220. package/dist/sdk/segment/types/segment-schema.js +1 -1
  221. package/dist/sdk/segment/types/segment-schema.js.map +1 -1
  222. package/dist/sdk/segment/validate-files.js +1 -1
  223. package/dist/sdk/segment/yaml-validator.js +1 -1
  224. package/dist/sdk/segment.js +1 -1
  225. package/dist/sdk/types/index.d.ts +2 -1
  226. package/dist/sdk/types/index.d.ts.map +1 -1
  227. package/dist/sdk/types/index.js +1 -1
  228. package/dist/sdk/types/index.js.map +1 -1
  229. package/dist/sdk/types/p13n-studio.d.ts +18 -0
  230. package/dist/sdk/types/p13n-studio.d.ts.map +1 -0
  231. package/dist/sdk/types/p13n-studio.js +1 -0
  232. package/dist/sdk/types/p13n-studio.js.map +1 -0
  233. package/dist/sdk/types/progress.js +1 -1
  234. package/dist/sdk/types/workspace.js +1 -1
  235. package/dist/sdk/user.js +1 -1
  236. package/dist/sdk/util/format-detector.js +1 -1
  237. package/dist/sdk/util/formatters.js +1 -1
  238. package/dist/sdk/util/index.js +1 -1
  239. package/dist/sdk/util/paginate.js +1 -1
  240. package/dist/sdk/util/tree-formatter.js +1 -1
  241. package/dist/sdk/util/tree-search.js +1 -1
  242. package/dist/sdk/workflow/archive-validation.js +1 -1
  243. package/dist/sdk/workflow/clone-workflow.js +1 -1
  244. package/dist/sdk/workflow/index.js +1 -1
  245. package/dist/sdk/workflow/pull-workflow.js +1 -1
  246. package/dist/sdk/workflow/push-workflow.js +1 -1
  247. package/dist/sdk/workflow/task-graph.js +1 -1
  248. package/dist/sdk/workflow/tdx-config.js +1 -1
  249. package/dist/sdk/workflow/workflow-utils.js +1 -1
  250. package/dist/sdk/workspace/access-tracker.js +1 -1
  251. package/dist/sdk/workspace/frontmatter.js +1 -1
  252. package/dist/sdk/workspace/git.js +1 -1
  253. package/dist/sdk/workspace/index.js +1 -1
  254. package/dist/sdk/workspace/templates.js +1 -1
  255. package/dist/sdk/workspace/weekly.js +1 -1
  256. package/dist/sdk/workspace/wikilinks.js +1 -1
  257. package/dist/test-utils/command-runner.js +1 -1
  258. package/dist/test-utils/factories.js +1 -1
  259. package/dist/test-utils/fixtures.js +1 -1
  260. package/dist/test-utils/http-mock.js +1 -1
  261. package/dist/test-utils/index.js +1 -1
  262. package/dist/utils/async.js +1 -1
  263. package/dist/utils/claude-code-state.js +1 -1
  264. package/dist/utils/colors.js +1 -1
  265. package/dist/utils/diff.js +1 -1
  266. package/dist/utils/file-permissions.js +1 -1
  267. package/dist/utils/file-reader.js +1 -1
  268. package/dist/utils/github-releases.js +1 -1
  269. package/dist/utils/global-cache.js +1 -1
  270. package/dist/utils/json-loader.js +1 -1
  271. package/dist/utils/local-cache.js +1 -1
  272. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  273. package/dist/utils/logger/formatters/index.js +1 -1
  274. package/dist/utils/logger/handlers/console-handler.js +1 -1
  275. package/dist/utils/logger/handlers/file-handler.js +1 -1
  276. package/dist/utils/logger/handlers/index.js +1 -1
  277. package/dist/utils/logger/handlers/null-handler.js +1 -1
  278. package/dist/utils/logger/index.js +1 -1
  279. package/dist/utils/logger/logger.js +1 -1
  280. package/dist/utils/logger/types.js +1 -1
  281. package/dist/utils/option-validation.js +1 -1
  282. package/dist/utils/process.js +1 -1
  283. package/dist/utils/prompt.js +1 -1
  284. package/dist/utils/proxy-fetch.js +1 -1
  285. package/dist/utils/spinner.js +1 -1
  286. package/dist/utils/sse-parser.js +1 -1
  287. package/dist/utils/string-utils.js +1 -1
  288. package/dist/utils/table-ref-parser.js +1 -1
  289. package/dist/utils/tdx-logger.js +1 -1
  290. package/dist/utils/version-check.js +1 -1
  291. package/package.json +1 -1
@@ -1 +1 @@
1
- const a168_0x14bcdc=a168_0x3edc;(function(_0x47b312,_0x56cb07){const _0x3a1b79=a168_0x3edc,_0x10f3e8=_0x47b312();while(!![]){try{const _0x171acb=parseInt(_0x3a1b79(0xad))/0x1*(-parseInt(_0x3a1b79(0x9a))/0x2)+-parseInt(_0x3a1b79(0x9e))/0x3*(parseInt(_0x3a1b79(0xaf))/0x4)+parseInt(_0x3a1b79(0xb0))/0x5+-parseInt(_0x3a1b79(0xa8))/0x6+-parseInt(_0x3a1b79(0xa4))/0x7*(-parseInt(_0x3a1b79(0xa6))/0x8)+parseInt(_0x3a1b79(0xa7))/0x9*(-parseInt(_0x3a1b79(0x98))/0xa)+-parseInt(_0x3a1b79(0x97))/0xb*(-parseInt(_0x3a1b79(0xae))/0xc);if(_0x171acb===_0x56cb07)break;else _0x10f3e8['push'](_0x10f3e8['shift']());}catch(_0xb11e3b){_0x10f3e8['push'](_0x10f3e8['shift']());}}}(a168_0x2039,0xd6cda));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a168_0x2f648c from'path';function a168_0x2039(){const _0x3c4cc1=['4829703ihZvpV','segments','ENOENT','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','journeyName','tdx.sdk.push-recovery','2877WxWmvg','toISOString','32552kkBqNj','20268xhOqaB','8326056medAWu','stringify','warn','debug','code','9gWWJCB','12LDkqMB','4xxTYRs','5943110XElxLw','join','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','utf-8','dirname','34268267AZTxmF','7130sWBgAv','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','109598MIlWlY','.tmp','basename','.push-recovery.json'];a168_0x2039=function(){return _0x3c4cc1;};return a168_0x2039();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a168_0x14bcdc(0xa3));export function getPushRecoveryPath(_0x133ef5){const _0x4a0cad=a168_0x14bcdc,_0x58cf5c=a168_0x2f648c[_0x4a0cad(0xb4)](_0x133ef5),_0x2d20bc=a168_0x2f648c[_0x4a0cad(0x9c)](_0x133ef5);return a168_0x2f648c[_0x4a0cad(0xb1)](_0x58cf5c,'.'+_0x2d20bc+_0x4a0cad(0x9d));}function a168_0x3edc(_0x1b7954,_0x573783){_0x1b7954=_0x1b7954-0x97;const _0x20396a=a168_0x2039();let _0x3edc26=_0x20396a[_0x1b7954];return _0x3edc26;}export function readPushRecovery(_0x44b568){const _0x5c0826=a168_0x14bcdc,_0x40387d=getPushRecoveryPath(_0x44b568);if(!existsSync(_0x40387d))return undefined;try{const _0x19d335=readFileSync(_0x40387d,_0x5c0826(0xb3)),_0x1ace37=JSON['parse'](_0x19d335);if(_0x1ace37?.['version']!==0x1||typeof _0x1ace37[_0x5c0826(0xa2)]!=='string')return undefined;return _0x1ace37;}catch(_0x1bec09){return _0x1bec09 instanceof SyntaxError?logger[_0x5c0826(0xab)](_0x5c0826(0xa1)+_0x1bec09):logger[_0x5c0826(0xaa)](_0x5c0826(0x99)+_0x1bec09),undefined;}}export function writePushRecovery(_0x5408e8,_0x1616c0){const _0x3f975f=a168_0x14bcdc,_0x5767f4=getPushRecoveryPath(_0x5408e8),_0x5b5e50=_0x5767f4+_0x3f975f(0x9b);writeFileSync(_0x5b5e50,JSON[_0x3f975f(0xa9)](_0x1616c0,null,0x2)+'\x0a',_0x3f975f(0xb3)),renameSync(_0x5b5e50,_0x5767f4);}export function deletePushRecovery(_0x39ac8a){const _0x588f50=a168_0x14bcdc,_0x39e160=getPushRecoveryPath(_0x39ac8a);try{unlinkSync(_0x39e160);}catch(_0xe3e493){_0xe3e493[_0x588f50(0xac)]!==_0x588f50(0xa0)&&logger[_0x588f50(0xab)](_0x588f50(0xb2)+_0xe3e493);}}export function saveSegmentToPushRecovery(_0x501703,_0x1e8a14,_0x3b7f72,_0x35835a){const _0x29d965=a168_0x14bcdc,_0x56495f=readPushRecovery(_0x501703),_0x1bd75e=_0x56495f?.[_0x29d965(0xa2)]===_0x1e8a14?{..._0x56495f,'updatedAt':new Date()[_0x29d965(0xa5)]()}:{'version':0x1,'journeyName':_0x1e8a14,'updatedAt':new Date()[_0x29d965(0xa5)](),'segments':{}};_0x1bd75e[_0x29d965(0x9f)][_0x3b7f72]=_0x35835a,writePushRecovery(_0x501703,_0x1bd75e);}
1
+ (function(_0x185039,_0x33ad58){const _0x552cca=a171_0x5c5b,_0x51ab19=_0x185039();while(!![]){try{const _0x399c0f=-parseInt(_0x552cca(0x1ec))/0x1*(-parseInt(_0x552cca(0x1dc))/0x2)+-parseInt(_0x552cca(0x1e8))/0x3*(parseInt(_0x552cca(0x1db))/0x4)+-parseInt(_0x552cca(0x1de))/0x5+parseInt(_0x552cca(0x1ef))/0x6+parseInt(_0x552cca(0x1e2))/0x7*(-parseInt(_0x552cca(0x1e5))/0x8)+parseInt(_0x552cca(0x1e7))/0x9+-parseInt(_0x552cca(0x1da))/0xa;if(_0x399c0f===_0x33ad58)break;else _0x51ab19['push'](_0x51ab19['shift']());}catch(_0x32876f){_0x51ab19['push'](_0x51ab19['shift']());}}}(a171_0x161b,0x78485));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a171_0x5c5b(_0x25063f,_0x52e8a2){_0x25063f=_0x25063f-0x1d8;const _0x161bc5=a171_0x161b();let _0x5c5b34=_0x161bc5[_0x25063f];return _0x5c5b34;}import a171_0x3ce995 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');function a171_0x161b(){const _0x4f6728=['dirname','parse','76696vSUcOL','version','6215958haecJc','9DAMzIR','code','segments','basename','827toCmFh','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','stringify','1670664kBuCiU','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','utf-8','debug','4926230OHhHVf','289012dWyXim','2174SOCXBZ','join','1268775BHAQEl','ENOENT','journeyName','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','301sPvWjy'];a171_0x161b=function(){return _0x4f6728;};return a171_0x161b();}export function getPushRecoveryPath(_0x3c6a30){const _0x51a900=a171_0x5c5b,_0x4c6cde=a171_0x3ce995[_0x51a900(0x1e3)](_0x3c6a30),_0xa0b374=a171_0x3ce995[_0x51a900(0x1eb)](_0x3c6a30);return a171_0x3ce995[_0x51a900(0x1dd)](_0x4c6cde,'.'+_0xa0b374+'.push-recovery.json');}export function readPushRecovery(_0x5f1024){const _0x51cff0=a171_0x5c5b,_0x2a3ff8=getPushRecoveryPath(_0x5f1024);if(!existsSync(_0x2a3ff8))return undefined;try{const _0x524c51=readFileSync(_0x2a3ff8,'utf-8'),_0x222adb=JSON[_0x51cff0(0x1e4)](_0x524c51);if(_0x222adb?.[_0x51cff0(0x1e6)]!==0x1||typeof _0x222adb[_0x51cff0(0x1e0)]!=='string')return undefined;return _0x222adb;}catch(_0x383a4c){return _0x383a4c instanceof SyntaxError?logger[_0x51cff0(0x1d9)](_0x51cff0(0x1e1)+_0x383a4c):logger['warn'](_0x51cff0(0x1f0)+_0x383a4c),undefined;}}export function writePushRecovery(_0x10bf5d,_0x460ee0){const _0x21af6e=a171_0x5c5b,_0x160759=getPushRecoveryPath(_0x10bf5d),_0x35329c=_0x160759+'.tmp';writeFileSync(_0x35329c,JSON[_0x21af6e(0x1ee)](_0x460ee0,null,0x2)+'\x0a',_0x21af6e(0x1d8)),renameSync(_0x35329c,_0x160759);}export function deletePushRecovery(_0x5bdf74){const _0x3aa406=a171_0x5c5b,_0x206431=getPushRecoveryPath(_0x5bdf74);try{unlinkSync(_0x206431);}catch(_0x366e15){_0x366e15[_0x3aa406(0x1e9)]!==_0x3aa406(0x1df)&&logger[_0x3aa406(0x1d9)](_0x3aa406(0x1ed)+_0x366e15);}}export function saveSegmentToPushRecovery(_0x198591,_0x41213d,_0x56ab5c,_0x607d65){const _0x4bba8f=a171_0x5c5b,_0x2e6e64=readPushRecovery(_0x198591),_0x58500d=_0x2e6e64?.['journeyName']===_0x41213d?{..._0x2e6e64,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x41213d,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x58500d[_0x4bba8f(0x1ea)][_0x56ab5c]=_0x607d65,writePushRecovery(_0x198591,_0x58500d);}
@@ -1 +1 @@
1
- const a169_0x12f8f2=a169_0x880c;(function(_0x425f53,_0x25a6c5){const _0x5c2ea6=a169_0x880c,_0x2a3d34=_0x425f53();while(!![]){try{const _0x524e85=-parseInt(_0x5c2ea6(0x229))/0x1*(parseInt(_0x5c2ea6(0x24b))/0x2)+parseInt(_0x5c2ea6(0x244))/0x3*(parseInt(_0x5c2ea6(0x1ce))/0x4)+-parseInt(_0x5c2ea6(0x1e8))/0x5+-parseInt(_0x5c2ea6(0x251))/0x6*(parseInt(_0x5c2ea6(0x273))/0x7)+-parseInt(_0x5c2ea6(0x279))/0x8*(-parseInt(_0x5c2ea6(0x23e))/0x9)+parseInt(_0x5c2ea6(0x2bd))/0xa+parseInt(_0x5c2ea6(0x1e0))/0xb;if(_0x524e85===_0x25a6c5)break;else _0x2a3d34['push'](_0x2a3d34['shift']());}catch(_0x13d03e){_0x2a3d34['push'](_0x2a3d34['shift']());}}}(a169_0xf99f,0xd87b0));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a169_0x12f8f2(0x2be));export const PENDING_SEGMENT_PREFIX=a169_0x12f8f2(0x2b2);export const PENDING_ACTIVATION_PREFIX=a169_0x12f8f2(0x20e);export function createPendingSegmentId(_0x541c24){return''+PENDING_SEGMENT_PREFIX+_0x541c24+'__';}export function isPendingSegmentId(_0x4563e2){const _0x42f4f2=a169_0x12f8f2;return _0x4563e2[_0x42f4f2(0x28d)](PENDING_SEGMENT_PREFIX)&&!_0x4563e2[_0x42f4f2(0x28d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4a71ad){const _0x12dfaa=a169_0x12f8f2;return _0x4a71ad[_0x12dfaa(0x228)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3da04b){return''+PENDING_ACTIVATION_PREFIX+_0x3da04b+'__';}export function isPendingActivationId(_0x50a055){const _0x2c9c1d=a169_0x12f8f2;return _0x50a055[_0x2c9c1d(0x28d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1db518){const _0x4c185d=a169_0x12f8f2;return _0x1db518[_0x4c185d(0x228)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2ad93e,_0x406d58){const _0x39bf74=a169_0x12f8f2,_0x108181=_0x2ad93e+'::'+(_0x406d58[_0x39bf74(0x271)]()||_0x39bf74(0x28e)),_0x1133a5=createHash(_0x39bf74(0x23c))['update'](_0x108181)[_0x39bf74(0x280)]('hex')[_0x39bf74(0x209)](0x0,0xc);return _0x39bf74(0x231)+_0x1133a5;}export function ensureJourneyDefaults(_0xd1d229){const _0xc22543=a169_0x12f8f2;!_0xd1d229[_0xc22543(0x261)]&&(_0xd1d229[_0xc22543(0x261)]=''),!_0xd1d229['state']&&(_0xd1d229[_0xc22543(0x1f1)]='draft');}export function injectExistingStageIds(_0x24a44b,_0x3f5d85){const _0x4ed02b=a169_0x12f8f2,_0x4c256d=new Map(_0x3f5d85['map'](_0x14bc99=>[_0x14bc99['name'],_0x14bc99['id']]));for(const _0x3c7a56 of _0x24a44b){if(!_0x3c7a56['id']){const _0x380f07=_0x4c256d[_0x4ed02b(0x1d3)](_0x3c7a56['name']);_0x380f07&&(_0x3c7a56['id']=_0x380f07);}}}export function resolveTDFolderPath(_0x2edc8c,_0x487631,_0x2449bc){const _0x3bc9b9=a169_0x12f8f2;if(!_0x487631)return _0x2edc8c;if(_0x2edc8c===_0x2449bc||_0x2edc8c[_0x3bc9b9(0x28d)](_0x2449bc+'/'))return _0x2edc8c;return _0x2edc8c?_0x2449bc+'/'+_0x2edc8c:_0x2449bc;}export function addFoldersToCreate(_0x497632,_0x46b1d2,_0x2648f2){const _0x289aba=a169_0x12f8f2;if(!_0x497632)return;if(_0x46b1d2[_0x289aba(0x249)](_0x497632))return;const _0x350fce=_0x497632[_0x289aba(0x2bb)]('/');let _0xb842c9='';for(const _0xeaf482 of _0x350fce){_0xb842c9=_0xb842c9?_0xb842c9+'/'+_0xeaf482:_0xeaf482,!_0x46b1d2[_0x289aba(0x249)](_0xb842c9)&&_0x2648f2[_0x289aba(0x1f7)](_0xb842c9);}}export function sortFoldersByDepth(_0x3a6cdd){const _0x33b09b=a169_0x12f8f2;return[..._0x3a6cdd][_0x33b09b(0x2a7)]((_0xfe7ded,_0x3e4b72)=>{const _0x1af6ec=_0x33b09b,_0x51e82d=(_0xfe7ded['match'](/\//g)||[])[_0x1af6ec(0x295)],_0x58e2e3=(_0x3e4b72[_0x1af6ec(0x29f)](/\//g)||[])[_0x1af6ec(0x295)];return _0x51e82d-_0x58e2e3;});}import*as a169_0x56a015 from'yaml';import{readFileSync}from'fs';import a169_0x240131 from'path';import{isJourneyDef,parseYamlString as a169_0x235896,toYamlString as a169_0x271d0b,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(_0xb24438){const _0x51038a=a169_0x12f8f2;if(Array[_0x51038a(0x200)](_0xb24438))return'['+_0xb24438['map'](_0x1236ba=>stableStringify(_0x1236ba))[_0x51038a(0x2b9)](',')+']';if(_0xb24438&&typeof _0xb24438===_0x51038a(0x1fc)){const _0x183879=_0xb24438,_0x4dddae=Object[_0x51038a(0x1d2)](_0x183879)[_0x51038a(0x2a7)](),_0x5961c1=_0x4dddae[_0x51038a(0x201)](_0x3085dd=>'\x22'+_0x3085dd+'\x22:'+stableStringify(_0x183879[_0x3085dd]));return'{'+_0x5961c1['join'](',')+'}';}const _0x37373c=JSON[_0x51038a(0x298)](_0xb24438);return _0x37373c===undefined?_0x51038a(0x299):_0x37373c;}function activationSignature(_0x23ac55){const _0x311f30=a169_0x12f8f2,_0x20494a={'connection':_0x23ac55[_0x311f30(0x1f5)],..._0x23ac55[_0x311f30(0x27c)]!==undefined&&{'all_columns':_0x23ac55[_0x311f30(0x27c)]},..._0x23ac55[_0x311f30(0x2cb)]!==undefined&&{'columns':_0x23ac55[_0x311f30(0x2cb)]},..._0x23ac55['behavior']!==undefined&&{'behavior':_0x23ac55[_0x311f30(0x1e5)]},..._0x23ac55[_0x311f30(0x2b1)]!==undefined&&{'behaviors':_0x23ac55[_0x311f30(0x2b1)]},..._0x23ac55['schedule']!==undefined&&{'schedule':_0x23ac55[_0x311f30(0x2a0)]},..._0x23ac55[_0x311f30(0x26b)]!==undefined&&{'notification':_0x23ac55[_0x311f30(0x26b)]},..._0x23ac55[_0x311f30(0x27a)]!==undefined&&{'connector_config':_0x23ac55[_0x311f30(0x27a)]},..._0x23ac55[_0x311f30(0x234)]!==undefined&&{'activation_template_id':_0x23ac55['activation_template_id']}};return stableStringify(_0x20494a);}async function fetchSegment(_0x51d257,_0x3b372f,_0x41bfd7,_0x1ed2b6){const _0x4b8376=a169_0x12f8f2,_0x31b39c=_0x1ed2b6?.[_0x4b8376(0x1f8)](_0x5fb2f6=>_0x5fb2f6['id']===_0x41bfd7);if(_0x31b39c)return _0x31b39c;try{return await _0x51d257[_0x4b8376(0x28e)]['getSegment'](_0x3b372f,_0x41bfd7);}catch(_0x159ab9){logger['debug']('getSegment\x20failed\x20for\x20'+_0x41bfd7+_0x4b8376(0x22c)+_0x159ab9);try{return await _0x51d257[_0x4b8376(0x28e)][_0x4b8376(0x211)](_0x41bfd7);}catch(_0x4ea2a7){return logger[_0x4b8376(0x1eb)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x41bfd7+':\x20'+_0x4ea2a7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x9dd050,_0x2de427,_0x397630){const _0x3bf5ac=a169_0x12f8f2,_0xe8675b=readPushRecovery(_0x9dd050[_0x3bf5ac(0x253)]);if(_0xe8675b?.['journeyName']===_0x9dd050[_0x3bf5ac(0x256)][_0x3bf5ac(0x2a4)])for(const [_0x160a6a,_0x1fdcb1]of Object['entries'](_0xe8675b[_0x3bf5ac(0x1ed)])){const _0x2f22c8=generateDeterministicJourneySegmentName(_0x9dd050['yamlConfig'][_0x3bf5ac(0x2a4)],_0x160a6a);_0x1fdcb1[_0x3bf5ac(0x274)]===_0x2f22c8&&(_0x2de427[_0x3bf5ac(0x1ea)](_0x160a6a,_0x1fdcb1[_0x3bf5ac(0x26d)]),_0x397630['set'](_0x160a6a,_0x1fdcb1[_0x3bf5ac(0x26d)]));}}async function createOrRecoverEmbeddedSegment(_0x1b3147,_0x29c86a,_0x191fba,_0x82650f){const _0x2b19ed=a169_0x12f8f2;let _0x12d100;try{_0x12d100=await _0x1b3147[_0x2b19ed(0x28e)][_0x2b19ed(0x210)]({'name':_0x191fba[_0x2b19ed(0x205)],'description':_0x191fba[_0x2b19ed(0x261)],'journeyId':_0x191fba['journeyId'],'rule':_0x82650f(_0x191fba[_0x2b19ed(0x214)],!![]),'countPopulation':!![],'parentFolderId':_0x191fba[_0x2b19ed(0x27d)],'audienceId':_0x191fba[_0x2b19ed(0x1e4)]});}catch(_0x2d9b2a){const _0x5280fd=_0x2d9b2a instanceof Error&&_0x2d9b2a['message'][_0x2b19ed(0x26f)](_0x2b19ed(0x268));if(_0x5280fd){const _0x28cb20=readPushRecovery(_0x29c86a[_0x2b19ed(0x253)]),_0x5d0c77=_0x28cb20?.[_0x2b19ed(0x1e3)]===_0x29c86a[_0x2b19ed(0x256)][_0x2b19ed(0x2a4)]?_0x28cb20[_0x2b19ed(0x1ed)][_0x191fba[_0x2b19ed(0x297)]]:undefined;if(_0x5d0c77?.[_0x2b19ed(0x274)]===_0x191fba[_0x2b19ed(0x205)])await _0x1b3147[_0x2b19ed(0x28e)][_0x2b19ed(0x22d)](_0x191fba[_0x2b19ed(0x1e4)],_0x5d0c77[_0x2b19ed(0x26d)],{'description':_0x191fba[_0x2b19ed(0x261)],'rule':_0x82650f(_0x191fba['resolvedRule'],!![]),'countPopulation':!![]}),_0x12d100=_0x5d0c77['segmentId'];else throw new SDKError(ErrorCode[_0x2b19ed(0x239)],_0x2b19ed(0x232)+_0x191fba[_0x2b19ed(0x297)]+_0x2b19ed(0x1f0)+(_0x2b19ed(0x20a)+_0x29c86a['absolutePath'][_0x2b19ed(0x228)](/([^/]+)$/,_0x2b19ed(0x245))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x2d9b2a);}else throw _0x2d9b2a;}return saveSegmentToPushRecovery(_0x29c86a[_0x2b19ed(0x253)],_0x29c86a[_0x2b19ed(0x256)]['name'],_0x191fba[_0x2b19ed(0x297)],{'segmentId':_0x12d100,'uniqueServerName':_0x191fba[_0x2b19ed(0x205)],'createdAt':new Date()[_0x2b19ed(0x2ad)]()}),_0x12d100;}export async function prepareSegmentFiles(_0x22ac10,_0x3968a5,_0x18a2cc,_0x4d8a42,_0x372abd){const _0x38bdf5=a169_0x12f8f2,{activationDefToCreateRequest:_0x177430}=await import(_0x38bdf5(0x202)),_0x2c47fd=[],_0x354f36=new Set();for(const {yamlConfig:_0x5ab5c2,folderPath:_0x234108,sourcePath:_0x2afe37}of _0x22ac10){const _0x1da61d=resolveTDFolderPath(_0x234108,_0x4d8a42,_0x372abd),_0x2d41d7=_0x1da61d+':'+_0x5ab5c2[_0x38bdf5(0x2a4)],_0x4e1b59=_0x3968a5[_0x38bdf5(0x29b)][_0x38bdf5(0x1d3)](_0x2d41d7),_0x4072d2=_0x4e1b59?_0x3968a5[_0x38bdf5(0x23a)]['get'](_0x4e1b59['id'])||[]:[];addFoldersToCreate(_0x1da61d,_0x3968a5[_0x38bdf5(0x241)],_0x354f36);const _0x1acc79=calculateActivationActions(_0x5ab5c2[_0x38bdf5(0x20c)]||[],_0x4072d2,_0x3968a5[_0x38bdf5(0x1ef)],_0x3968a5[_0x38bdf5(0x212)]);for(const _0x324511 of _0x1acc79){(_0x324511[_0x38bdf5(0x1d7)]===_0x38bdf5(0x29d)||_0x324511['type']==='update')&&_0x324511['yamlActivation']&&(_0x324511[_0x38bdf5(0x2c3)]=await _0x177430(_0x324511[_0x38bdf5(0x288)],_0x18a2cc));}const _0xd5c6ef=calculateSegmentDiff(_0x5ab5c2,_0x4e1b59,_0x4072d2,_0x3968a5[_0x38bdf5(0x1ef)],_0x3968a5[_0x38bdf5(0x212)]);_0x2c47fd[_0x38bdf5(0x2a9)]({'relativePath':_0x5ab5c2[_0x38bdf5(0x2a4)],'absolutePath':_0x2afe37,'yamlConfig':_0x5ab5c2,'folderPath':_0x1da61d,'existingSegment':_0x4e1b59,'existingActivations':_0x4072d2,'isNew':_0xd5c6ef[_0x38bdf5(0x267)],'hasChanges':_0xd5c6ef[_0x38bdf5(0x247)],'diff':_0xd5c6ef[_0x38bdf5(0x206)],'activationActions':_0x1acc79});}return{'segmentFiles':_0x2c47fd,'foldersToCreate':_0x354f36};}function a169_0x880c(_0x4e4c34,_0x1536f7){_0x4e4c34=_0x4e4c34-0x1ce;const _0xf99fa4=a169_0xf99f();let _0x880c74=_0xf99fa4[_0x4e4c34];return _0x880c74;}export async function prepareJourneyFiles(_0x21f1ba,_0x3edbf0,_0xd77b41,_0x52732b){const _0x4b2fd8=a169_0x12f8f2,_0x57b2ed=[],_0x2471aa=new Set();for(const {yamlConfig:_0x322df0,folderPath:_0x41c093,sourcePath:_0x3fa7cb}of _0x21f1ba){const _0x2722e9=resolveTDFolderPath(_0x41c093,_0xd77b41,_0x52732b),_0x763ac3=_0x2722e9+':'+_0x322df0[_0x4b2fd8(0x2a4)],_0x26db51=_0x3edbf0[_0x4b2fd8(0x1ec)][_0x4b2fd8(0x1d3)](_0x763ac3);let _0x28fc7c,_0x4892cf;if(_0x26db51&&_0x26db51[_0x4b2fd8(0x295)]>0x0){const _0x330a57=buildLocalExpandedRuleMappings(_0x322df0),{createYamlContext:_0x173f3b,prefetchJourneySegments:_0x486911}=createPushYamlContextForBundle(_0x3edbf0[_0x4b2fd8(0x2ba)],_0x3edbf0[_0x4b2fd8(0x1e4)],_0x3edbf0[_0x4b2fd8(0x21a)],_0x330a57,_0x3edbf0[_0x4b2fd8(0x1ef)],_0x3edbf0[_0x4b2fd8(0x212)],_0x3edbf0['activationStepsById'],_0x3edbf0[_0x4b2fd8(0x2b3)]);await _0x486911(_0x26db51['map'](_0x341950=>_0x341950['id']));const _0x5f4ccc=await _0x3edbf0[_0x4b2fd8(0x2ba)][_0x4b2fd8(0x2bc)][_0x4b2fd8(0x2c7)](_0x26db51[0x0]['journeyBundleId']),_0x17dd19=hasMultipleVersions(_0x322df0),_0x31d75b=async _0x5be338=>{const _0x33ea49=_0x4b2fd8,_0x38722d=_0x3edbf0['journeyById']?.['get'](_0x5be338);if(_0x38722d)return _0x38722d;return _0x3edbf0['fetchJourney']({'journeyId':_0x5be338,'journeyName':_0x322df0['name'],'isMultiVersion':_0x26db51[_0x33ea49(0x295)]>0x1});};if(_0x17dd19&&_0x26db51[_0x4b2fd8(0x295)]>0x1){const _0x17c15a=[];for(const _0x5c1594 of _0x26db51){const _0x1c8f3d=_0x5c1594[_0x4b2fd8(0x2a1)]||0x1;_0x3edbf0['progress']?.[_0x4b2fd8(0x23f)](_0x4b2fd8(0x260)+_0x322df0['name']+'\x20v'+_0x1c8f3d);const _0x53aeb2=await _0x31d75b(_0x5c1594['id']),_0x397500=_0x173f3b(_0x5c1594['id']),_0x5c4c1f=await journeyResponseToDef(_0x53aeb2,_0x397500);_0x17c15a[_0x4b2fd8(0x2a9)]({'item':_0x5c1594,'yaml':_0x5c4c1f});}const _0xe03e14=buildLocalRuleToNameMappingFromJourney(_0x322df0);_0x4892cf=buildMergedJourneyDef(_0x17c15a,_0xe03e14,_0x5f4ccc);const _0x5b7989=Math[_0x4b2fd8(0x26e)](..._0x17c15a['map'](_0x43b917=>_0x43b917[_0x4b2fd8(0x270)][_0x4b2fd8(0x2a1)]||0x0)),_0xced487=_0x26db51[_0x4b2fd8(0x1f8)](_0x208720=>(_0x208720['versionNumber']||0x0)===_0x5b7989);_0xced487&&(_0x3edbf0['progress']?.[_0x4b2fd8(0x23f)]('Fetching\x20'+_0x322df0['name']+'\x20v'+_0x5b7989),_0x28fc7c=await _0x31d75b(_0xced487['id']));}else{const _0x2998a3=_0x26db51[_0x26db51[_0x4b2fd8(0x295)]-0x1];_0x3edbf0[_0x4b2fd8(0x1de)]?.[_0x4b2fd8(0x23f)](_0x4b2fd8(0x260)+_0x322df0[_0x4b2fd8(0x2a4)]),_0x28fc7c=await _0x31d75b(_0x2998a3['id']);const _0x4c3679=_0x173f3b(_0x2998a3['id']),_0x2d2516=await journeyResponseToDef(_0x28fc7c,_0x4c3679),_0x371104=buildLocalRuleToNameMappingFromJourney(_0x322df0);_0x4892cf=buildMergedJourneyDef([{'item':_0x2998a3,'yaml':_0x2d2516}],_0x371104,_0x5f4ccc);}}addFoldersToCreate(_0x2722e9,_0x3edbf0[_0x4b2fd8(0x241)],_0x2471aa);const _0x5268db=calculateJourneyDiff(_0x322df0,_0x4892cf);_0x57b2ed[_0x4b2fd8(0x2a9)]({'relativePath':_0x322df0[_0x4b2fd8(0x2a4)],'absolutePath':_0x3fa7cb,'yamlConfig':_0x322df0,'folderPath':_0x2722e9,'existingJourney':_0x28fc7c,'isNew':_0x5268db['isNew'],'hasChanges':_0x5268db[_0x4b2fd8(0x247)],'diff':_0x5268db[_0x4b2fd8(0x206)]});}return{'journeyFiles':_0x57b2ed,'foldersToCreate':_0x2471aa};}export function calculateActivationActions(_0x568a6b,_0x4e7cb6,_0x299131,_0x45be10){const _0xe552be=a169_0x12f8f2,_0x1324d3=[],_0x5b70ea=new Map();for(const _0x44221b of _0x4e7cb6){_0x5b70ea[_0xe552be(0x1ea)](_0x44221b[_0xe552be(0x2a4)],_0x44221b);}const _0x472b50=new Map();for(const _0x590503 of _0x568a6b){_0x472b50[_0xe552be(0x1ea)](_0x590503[_0xe552be(0x2a4)],_0x590503);}for(const _0x5bfded of _0x568a6b){const _0x2935fe=_0x5b70ea[_0xe552be(0x1d3)](_0x5bfded[_0xe552be(0x2a4)]);if(!_0x2935fe)_0x1324d3['push']({'type':_0xe552be(0x29d),'name':_0x5bfded[_0xe552be(0x2a4)],'yamlActivation':_0x5bfded});else{const _0x28f01b=activationResponseToDef(_0x2935fe,_0x299131,_0x45be10),_0x5dd227=a169_0x56a015[_0xe552be(0x298)](_0x28f01b),_0x11bce4=a169_0x56a015[_0xe552be(0x298)](_0x5bfded);_0x5dd227!==_0x11bce4&&_0x1324d3[_0xe552be(0x2a9)]({'type':_0xe552be(0x23f),'name':_0x5bfded[_0xe552be(0x2a4)],'yamlActivation':_0x5bfded,'existingActivation':_0x2935fe});}}for(const _0x35d1a2 of _0x4e7cb6){!_0x472b50[_0xe552be(0x249)](_0x35d1a2[_0xe552be(0x2a4)])&&_0x1324d3['push']({'type':_0xe552be(0x275),'name':_0x35d1a2[_0xe552be(0x2a4)],'existingActivation':_0x35d1a2});}return _0x1324d3;}function calculateYamlDiff(_0x5258fd,_0x585ad4){if(_0x585ad4){const _0x2a8db3=generateDiff(_0x585ad4,_0x5258fd),_0x47d459=hasChanges(_0x2a8db3);return{'isNew':![],'hasChanges':_0x47d459,'diff':_0x47d459?formatDiffWithColors(_0x2a8db3):undefined};}const _0x5aef0e=generateDiff('',_0x5258fd);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5aef0e)};}export function calculateSegmentDiff(_0x5d29e3,_0x22c05a,_0x56675c,_0x194ab1,_0x598186){const _0x1984d4=segmentToYamlString(_0x5d29e3),_0x5ed46b=_0x22c05a?segmentToYamlString(segmentWithActivationsToYaml(_0x22c05a,_0x56675c,undefined,_0x194ab1,_0x598186)):undefined;return calculateYamlDiff(_0x1984d4,_0x5ed46b);}export function calculateJourneyDiff(_0x250ab4,_0x1ada0e){const _0x2ef306=normalizeJourneyDef(_0x250ab4,_0x250ab4),_0x192b38=a169_0x271d0b(_0x2ef306),_0x1b217e=_0x1ada0e?a169_0x271d0b(normalizeJourneyDef(_0x1ada0e,_0x250ab4)):undefined;return calculateYamlDiff(_0x192b38,_0x1b217e);}export function findSegmentsToDelete(_0x31c610,_0x5eed92,_0x397a82,_0x17e9f4,_0x1caeea){const _0x373c48=a169_0x12f8f2,_0xc6ce97=new Set();for(const {yamlConfig:_0x182c58,folderPath:_0x4180f1}of _0x5eed92){_0xc6ce97[_0x373c48(0x1f7)](_0x4180f1+':'+_0x182c58[_0x373c48(0x2a4)]);}return _0x31c610['filter'](_0x21f372=>{const _0x4c3b6f=_0x373c48,_0x5d4b81=_0x21f372[_0x4c3b6f(0x22e)]?_0x397a82['get'](_0x21f372[_0x4c3b6f(0x22e)][_0x4c3b6f(0x21c)]())||'':'',_0x5412ca=_0x5d4b81+':'+_0x21f372[_0x4c3b6f(0x2a4)];if(_0xc6ce97[_0x4c3b6f(0x249)](_0x5412ca))return![];if(_0x1caeea)return _0x5d4b81===_0x17e9f4||_0x5d4b81[_0x4c3b6f(0x28d)](_0x17e9f4+'/');return!![];});}export function findJourneysToDelete(_0x12482a,_0x52ba1c,_0x3daa95,_0x54fbea,_0x11ff23){const _0x271c89=a169_0x12f8f2,_0x4b295e=new Set();for(const {yamlConfig:_0x393f18,folderPath:_0x20949d}of _0x52ba1c){_0x4b295e[_0x271c89(0x1f7)](_0x20949d+':'+_0x393f18[_0x271c89(0x2a4)]);}return _0x12482a['filter'](_0x2c9bb9=>{const _0x1abdf8=_0x271c89,_0x8e829b=_0x2c9bb9['folderId']?_0x3daa95['get'](_0x2c9bb9[_0x1abdf8(0x27d)])||'':'',_0x129dcf=_0x8e829b+':'+_0x2c9bb9[_0x1abdf8(0x203)];if(_0x4b295e[_0x1abdf8(0x249)](_0x129dcf))return![];if(_0x11ff23)return _0x8e829b===_0x54fbea||_0x8e829b[_0x1abdf8(0x28d)](_0x54fbea+'/');return!![];});}export function buildSegmentLookupMap(_0x7f9fa4,_0x3bc784){const _0x2dd59d=a169_0x12f8f2,_0x2ad1d1=new Map();for(const _0x3a4651 of _0x7f9fa4){const _0xad5234=_0x3a4651[_0x2dd59d(0x22e)]?_0x3bc784[_0x2dd59d(0x1d3)](_0x3a4651[_0x2dd59d(0x22e)]['toString']())||'':'',_0x33c008=_0xad5234+':'+_0x3a4651[_0x2dd59d(0x2a4)];_0x2ad1d1[_0x2dd59d(0x1ea)](_0x33c008,_0x3a4651);}return _0x2ad1d1;}export function buildSegmentNameToIdMap(_0x3db959){const _0x453372=a169_0x12f8f2,_0x39c105=new Map();for(const _0x2682da of _0x3db959){_0x39c105[_0x453372(0x1ea)](_0x2682da['name'],_0x2682da['id']);}return _0x39c105;}export function buildJourneyBundleLookupMap(_0x4be2a4,_0x44d9d5){const _0x5e000d=a169_0x12f8f2,_0x409aff=new Map();for(const _0xe3752e of _0x4be2a4){const _0x52abf7=_0xe3752e[_0x5e000d(0x27d)]?_0x44d9d5[_0x5e000d(0x1d3)](_0xe3752e[_0x5e000d(0x27d)])||'':'',_0x2bd378=_0x52abf7+':'+_0xe3752e[_0x5e000d(0x203)];!_0x409aff[_0x5e000d(0x249)](_0x2bd378)&&_0x409aff['set'](_0x2bd378,[]),_0x409aff[_0x5e000d(0x1d3)](_0x2bd378)[_0x5e000d(0x2a9)](_0xe3752e);}for(const _0x1ae348 of _0x409aff[_0x5e000d(0x254)]()){_0x1ae348['sort']((_0xc8458c,_0x4fb55e)=>(_0xc8458c[_0x5e000d(0x2a1)]||0x0)-(_0x4fb55e[_0x5e000d(0x2a1)]||0x0));}return _0x409aff;}export function collectFoldersToCreate(_0x4caf4b,_0x453fa0){const _0x40eeb4=a169_0x12f8f2,_0xafbe02=new Set();for(const _0x591064 of _0x4caf4b){if(!_0x591064)continue;if(_0x453fa0['has'](_0x591064))continue;const _0x5a1eeb=_0x591064[_0x40eeb4(0x2bb)]('/');let _0x48f321='';for(const _0x49e48a of _0x5a1eeb){_0x48f321=_0x48f321?_0x48f321+'/'+_0x49e48a:_0x49e48a,!_0x453fa0['has'](_0x48f321)&&_0xafbe02[_0x40eeb4(0x1f7)](_0x48f321);}}return _0xafbe02;}export function parseAndClassifyYamlFiles(_0x54aa0a,_0xd70e7f,_0x5f22ee){const _0x9a835f=a169_0x12f8f2,_0x1d88ca=[],_0x3705fc=[];for(const _0x4a4592 of _0x54aa0a){const _0x5768e7=a169_0x240131[_0x9a835f(0x223)](_0xd70e7f,a169_0x240131['dirname'](_0x4a4592)),_0x400b2d=_0x5768e7==='.'?'':_0x5768e7[_0x9a835f(0x228)](/\\/g,'/'),_0x3df099=readFileSync(_0x4a4592,_0x9a835f(0x2cf)),_0x18409a=a169_0x56a015[_0x9a835f(0x2a2)](_0x3df099);if(isJourneyDef(_0x18409a,_0x4a4592)){const _0x2c1632=a169_0x235896(_0x3df099);_0x3705fc[_0x9a835f(0x2a9)]({'yamlConfig':_0x2c1632,'folderPath':_0x400b2d,'sourcePath':_0x4a4592});}else{if(!_0x5f22ee?.['skipSegments']){const _0x1b453b=parseSegmentYamlFile(_0x3df099),_0x5b4e80=normalizeChildSegmentYaml(_0x1b453b);_0x1d88ca[_0x9a835f(0x2a9)]({'yamlConfig':_0x5b4e80,'folderPath':_0x400b2d,'sourcePath':_0x4a4592});}}}return{'segments':_0x1d88ca,'journeys':_0x3705fc};}export function validateParsedFiles(_0xce089f,_0x3ad269){const _0x3feb03=a169_0x12f8f2,_0x3bd037=[];for(const {yamlConfig:_0x226fe2,sourcePath:_0x289b4e}of _0xce089f['segments']){const _0x2aa6c4=readFileSync(_0x289b4e,_0x3feb03(0x2cf)),_0xc2f020=a169_0x56a015[_0x3feb03(0x221)](_0x2aa6c4),_0x3991af=validateSegmentDef(_0x226fe2,{'source':_0x2aa6c4,'document':_0xc2f020},{'skipSchema':!![]});if(!_0x3991af[_0x3feb03(0x286)]){const _0xb1a2af=a169_0x240131[_0x3feb03(0x223)](_0x3ad269,_0x289b4e);_0x3bd037[_0x3feb03(0x2a9)]({'filePath':_0xb1a2af,'source':_0x2aa6c4,'result':_0x3991af,'isJourney':![]});}}for(const {yamlConfig:_0x5ddb29,sourcePath:_0x3f9f89}of _0xce089f['journeys']){const _0x2024cd=readFileSync(_0x3f9f89,_0x3feb03(0x2cf)),_0x3c9a49=a169_0x56a015[_0x3feb03(0x221)](_0x2024cd),_0x41c14a=validateJourneyDef(_0x5ddb29,{'source':_0x2024cd,'document':_0x3c9a49},{'skipSchema':!![]});if(!_0x41c14a[_0x3feb03(0x286)]){const _0x2087de=a169_0x240131[_0x3feb03(0x223)](_0x3ad269,_0x3f9f89);_0x3bd037['push']({'filePath':_0x2087de,'source':_0x2024cd,'result':_0x41c14a,'isJourney':!![]});}}return _0x3bd037;}export function formatValidationErrors(_0x427179){const _0x453e57=a169_0x12f8f2,_0x36e473=[];for(const {filePath:_0x45d47f,source:_0xbfacc2,result:_0x4b125b,isJourney:_0x27bdff}of _0x427179){const _0x1cb1c4=_0x27bdff?_0x453e57(0x2bc):_0x453e57(0x28e);_0x36e473['push']('\x0a'+_0x45d47f+'\x20('+_0x1cb1c4+_0x453e57(0x22a)+_0x4b125b[_0x453e57(0x27b)][_0x453e57(0x295)]+_0x453e57(0x2cd)),_0x36e473[_0x453e57(0x2a9)](formatValidationResult(_0x4b125b,_0xbfacc2,_0x45d47f));}return _0x36e473[_0x453e57(0x2b9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2ba5e8){const _0x150509=a169_0x12f8f2,_0x1751cf=new Set(),_0x1037c2=new Map(),_0x1cdcad=collectSegmentUsageCounts(_0x2ba5e8);if(_0x2ba5e8[_0x150509(0x1ed)])for(const [_0x59853e,_0x58c02a]of Object[_0x150509(0x1f6)](_0x2ba5e8['segments'])){_0x1751cf[_0x150509(0x1f7)](_0x59853e);if(_0x58c02a[_0x150509(0x284)]){const _0x45ec55=yamlRuleToApi(_0x58c02a[_0x150509(0x284)]),_0x2230bb=apiRuleToYaml(_0x45ec55);_0x1037c2[_0x150509(0x1ea)](_0x59853e,_0x2230bb);}}const _0x53cc17=new Map();let _0x3d81b9=0x0;for(const [_0x331857,_0x21a6bd]of _0x1037c2){const _0x875114=serializeExpandedRule(_0x21a6bd,_0x1037c2),_0x160467=_0x53cc17[_0x150509(0x1d3)](_0x875114)||[];_0x160467[_0x150509(0x2a9)]({'name':_0x331857,'index':_0x3d81b9}),_0x53cc17['set'](_0x875114,_0x160467),_0x3d81b9++;}const _0x44b631=new Map();for(const [_0x17ac0f,_0x2860f1]of _0x53cc17){const _0x37314e=_0x2860f1[_0x150509(0x209)]()[_0x150509(0x2a7)]((_0x3d0bf4,_0x55a9e5)=>{const _0x75ce32=_0x150509,_0x21d02b=_0x1cdcad['get'](_0x3d0bf4[_0x75ce32(0x2a4)])||0x0,_0x3553a8=_0x1cdcad['get'](_0x55a9e5['name'])||0x0;if(_0x21d02b!==_0x3553a8)return _0x3553a8-_0x21d02b;return _0x3d0bf4[_0x75ce32(0x243)]-_0x55a9e5[_0x75ce32(0x243)];})[_0x150509(0x201)](_0x22a1b9=>_0x22a1b9[_0x150509(0x2a4)]),_0x2b72b5=[];for(const _0xc668ce of _0x37314e){const _0x545cfb=_0x1cdcad[_0x150509(0x1d3)](_0xc668ce)||0x0,_0x62b473=Math['max'](_0x545cfb,0x1);for(let _0x2061db=0x0;_0x2061db<_0x62b473;_0x2061db++){_0x2b72b5[_0x150509(0x2a9)](_0xc668ce);}}_0x44b631[_0x150509(0x1ea)](_0x17ac0f,_0x2b72b5);}return{'existingLocalSegmentNames':_0x1751cf,'localSegmentRules':_0x1037c2,'localExpandedRuleToNames':_0x44b631};}export function createSegmentIdResolver(_0x4e6fc5,_0x6b5b1c){return async _0x15265e=>{const _0x216d05=a169_0x880c,_0x44ea06=_0x4e6fc5[_0x216d05(0x1d3)](_0x15265e);if(!_0x44ea06)throw new SDKError(ErrorCode[_0x216d05(0x218)],_0x216d05(0x1d6)+_0x15265e+_0x216d05(0x246)+_0x6b5b1c+'\x27)');return _0x44ea06;};}export function extractRootFolderId(_0x46c674){const _0x1e6545=a169_0x12f8f2;return _0x46c674['relationships']?.['parentSegmentFolder']?.['data']?.['id']||_0x46c674[_0x1e6545(0x28f)]?.[_0x1e6545(0x1e7)]?.[_0x1e6545(0x204)]?.['id'];}export function buildConnectionMaps(_0x5db828){const _0x3ab45c=a169_0x12f8f2,_0x1f9d91=new Map(),_0x340745=new Map(),_0x30ba02=new Map();for(const _0x2ba8f3 of _0x5db828){_0x1f9d91[_0x3ab45c(0x1ea)](_0x2ba8f3[_0x3ab45c(0x2a4)],parseInt(_0x2ba8f3['id'],0xa)),_0x340745[_0x3ab45c(0x1ea)](_0x2ba8f3['id'],_0x2ba8f3[_0x3ab45c(0x2a4)]),_0x30ba02[_0x3ab45c(0x1ea)](_0x2ba8f3[_0x3ab45c(0x2a4)],_0x2ba8f3['type']);}return{'nameToId':_0x1f9d91,'idToName':_0x340745,'nameToType':_0x30ba02};}export function calculatePushStats(_0x5835a7,_0x484916,_0x33a3dc,_0x4a612b,_0x5ae9b0,_0x34e49d,_0x213682){const _0x34cc30=a169_0x12f8f2,_0x46c51a=_0x5835a7['filter'](_0x23145b=>_0x23145b[_0x34cc30(0x267)]),_0x3cc4d0=_0x5835a7['filter'](_0x5d7497=>!_0x5d7497[_0x34cc30(0x267)]&&_0x5d7497[_0x34cc30(0x247)]),_0x40208b=_0x5835a7[_0x34cc30(0x2af)](_0x3e247d=>!_0x3e247d[_0x34cc30(0x267)]&&!_0x3e247d[_0x34cc30(0x247)]),_0x37cd4e=_0x34e49d?_0x4a612b:[],_0x481922=_0x484916[_0x34cc30(0x2af)](_0x5b734b=>_0x5b734b[_0x34cc30(0x267)]),_0x309d41=_0x484916['filter'](_0x36475b=>!_0x36475b[_0x34cc30(0x267)]&&_0x36475b['hasChanges']),_0x55b487=_0x484916[_0x34cc30(0x2af)](_0x307651=>!_0x307651['isNew']&&!_0x307651[_0x34cc30(0x247)]),_0x6b9f0b=_0x34e49d?_0x5ae9b0:[],_0x34614a=_0x5835a7[_0x34cc30(0x2c2)](_0x3d5544=>_0x3d5544[_0x34cc30(0x2ab)]),_0x30d70e=_0x34614a['filter'](_0x57d98a=>_0x57d98a['type']===_0x34cc30(0x29d)),_0x52a684=_0x34614a[_0x34cc30(0x2af)](_0x292085=>_0x292085[_0x34cc30(0x1d7)]===_0x34cc30(0x23f)),_0x3dc352=_0x34614a[_0x34cc30(0x2af)](_0x360e49=>_0x360e49['type']===_0x34cc30(0x275)),_0x3bbfd1=Array[_0x34cc30(0x276)](_0x33a3dc)['sort'](),_0x64e82a=_0x213682?![]:_0x46c51a[_0x34cc30(0x295)]>0x0||_0x3cc4d0[_0x34cc30(0x295)]>0x0||_0x37cd4e[_0x34cc30(0x295)]>0x0,_0x21d515=_0x481922['length']>0x0||_0x309d41[_0x34cc30(0x295)]>0x0||_0x6b9f0b[_0x34cc30(0x295)]>0x0,_0xb1c06a=_0x213682?![]:_0x34614a[_0x34cc30(0x295)]>0x0,_0x59c28e=_0x3bbfd1['length']>0x0;return{'segments':{'new':_0x46c51a,'changed':_0x3cc4d0,'unchanged':_0x40208b,'toDelete':_0x37cd4e},'journeys':{'new':_0x481922,'changed':_0x309d41,'unchanged':_0x55b487,'toDelete':_0x6b9f0b},'activations':{'all':_0x34614a,'toCreate':_0x30d70e,'toUpdate':_0x52a684,'toDelete':_0x3dc352},'folders':{'toCreate':_0x3bbfd1},'counts':{'segments':{'new':_0x46c51a['length'],'changed':_0x3cc4d0[_0x34cc30(0x295)],'unchanged':_0x40208b[_0x34cc30(0x295)],'toDelete':_0x37cd4e[_0x34cc30(0x295)]},'journeys':{'new':_0x481922[_0x34cc30(0x295)],'changed':_0x309d41['length'],'unchanged':_0x55b487['length'],'toDelete':_0x6b9f0b[_0x34cc30(0x295)]},'activations':{'create':_0x30d70e[_0x34cc30(0x295)],'update':_0x52a684[_0x34cc30(0x295)],'delete':_0x3dc352[_0x34cc30(0x295)]},'folders':_0x3bbfd1[_0x34cc30(0x295)]},'hasChanges':_0x64e82a||_0x21d515||_0xb1c06a||_0x59c28e};}function a169_0xf99f(){const _0x58b184=['12549582TGGQCL','update','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','folderPathToId','createActivation','index','1685589tSFlQN','.$1.push-recovery.json','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','hasChanges','segment_created','has','Journey\x20\x27','3197086wVSyws','Updating\x20segment\x20\x27','ACTIVATION_UPDATE_ERROR','INTERNAL','activation_created','journeyActivationNameToId','5370uLDckm','nameToType','absolutePath','values','\x20segment\x20from\x20file:\x20','yamlConfig','effectiveFolderId','getActivation','deleteActivation','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','DecisionPoint','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Segment\x20not\x20found','unchanged','day','Fetching\x20','description','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folder_creating','folder_created','updateActivation','\x20(referenced\x20in\x20journey\x20','isNew','Name\x20has\x20already\x20been\x20taken','../../utils/async.js','JOURNEY_SYNTAX_ERROR','notification','\x20journey\x20from\x20file:\x20','segmentId','max','includes','item','trim','logInfo','1428QAboMX','uniqueServerName','delete','from','exitCriterias','NOT_FOUND','8IbYbMJ','connector_config','errors','all_columns','folderId','activation_updated','Creating\x20activation\x20\x27','digest','embeddedSegmentNameToId','JOURNEY_UPDATE_ERROR','Failed\x20to\x20fetch\x20referenced\x20segment\x20','rule','segment_updating','valid','\x27\x20by\x20rule\x20content','yamlActivation','waitStep','logSuccess','list','Creating\x20segment\x20\x27','startsWith','segment','relationships','journeyActivationStepId','folder','conditionSegmentId','segment_updated','segmentNameToId','length','SEGMENT_SYNTAX_ERROR','localName','stringify','null','journeyId','segmentByFolderAndName','entryCriteria','create','created','match','schedule','versionNumber','parse','journey_updated','name','Created\x20folder\x20\x27','Created\x20journey\x20\x27','sort','folderPath','push','Failed\x20to\x20','activationActions','Condition','toISOString','createdSegmentId','filter','steps','behaviors','__pending_','journeyById','logDeleted','stages','results','\x27\x20from\x20file:\x20','\x27\x20decision\x20point\x20branch\x20\x27','join','deps','split','journey','7342470GqFmEk','tdx.sdk.push-workflow','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','goal','flatMap','validatedRequest','Created\x20segment\x20\x27','attributes','journey_updating','getLatestJourneyId','existingSegment','conditions','goal\x20criteria','columns','./journey-yaml.js','\x20error(s)','\x27\x20wait\x20condition','utf-8','with','activationParams','4CEuhYG','Stage\x20\x27','WaitStep','rootFolderId','keys','get','Updated\x20segment\x20\x27','createSegment','Segment\x20not\x20found:\x20','type','journey_created','Matched\x20server\x20segment\x20\x27','embedded_segment_created','Failed\x20to\x20resolve\x20activation\x20','deleted','Entry\x20criteria:\x20','progress','\x27...','836363gCrGbU','waitStepType','milestone','journeyName','parentId','behavior','\x0a\x20\x20','parentFolder','493570eYXQxC','activation_deleted','set','debug','journeyBundlesByFolderAndName','segments','branches','idToEmailMap','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','state','Updated\x20activation\x20\x27','stage\x20\x27','all','connection','entries','add','find','embedded_activation_created','activation_creating','updated','object','idToName','\x27\x20entry\x20criteria','conditionTimeoutDuration','isArray','map','./child-segment-yaml.js','journeyBundleName','data','uniqueSegmentName','diff','reduce','segment_deleted','slice','Delete\x20the\x20push\x20recovery\x20file\x20(','Activation','activations','resolveSegment','__pending_act_','Created\x20activation\x20\x27','createJourneySegment','getSegmentEntity','connectionIdToNameMap','deleteSegment','resolvedRule',').\x20','onProgress','listActivations','SEGMENT_NOT_FOUND','\x27\x20not\x20found\x20in\x20journey\x20\x27','existingSegments','existingActivation','toString','toLowerCase','conditionTimeoutUnit','journeys','withProgress','parseDocument','embedded_activation_creating','relative','ACTIVATION_SYNTAX_ERROR','action','resolveJourneyId','getJourney','replace','1GxXwAP','):\x20','activationContext',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','updateSegmentById','segmentFolderId','entry_criteria','\x20activation\x20\x27','journey_entry_criteria_','Embedded\x20segment\x20\x27','run_after_journey_refresh','activation_template_id','buildUserMaps','waitStepUnit','some','journeyStages','SEGMENT_UPDATE_ERROR','activationsBySegmentId','existingJourney','sha1','verbose'];a169_0xf99f=function(){return _0x58b184;};return a169_0xf99f();}export async function buildPushExecutionContext(_0x3cff81,_0x144f12,_0x490a4f,_0x3bbfda,_0x5bad27,_0x2ac091){const _0x4621f5=a169_0x12f8f2,_0x558572=extractRootFolderId(_0x490a4f),{pathToId:_0x2d3e5a,idToPath:_0x446649}=buildFolderMaps(_0x5bad27),_0x3bdbfa=buildSegmentNameToIdMap(_0x3bbfda),_0x5899d3=new Map(),{batchAsync:_0x53eb12}=await import('../../utils/async.js'),[_0x45836e,_0x15ed3b]=await Promise[_0x4621f5(0x1f4)]([_0x3cff81['user'][_0x4621f5(0x235)](),_0x3cff81['connection'][_0x4621f5(0x28b)](),((async()=>{const _0x46b50a=_0x4621f5;!_0x2ac091&&_0x3bbfda[_0x46b50a(0x295)]>0x0&&await _0x53eb12(_0x3bbfda,async _0x2f23df=>{const _0x262d39=_0x46b50a,_0x3ec4d2=await _0x3cff81[_0x262d39(0x28e)][_0x262d39(0x217)](_0x144f12,_0x2f23df['id']);_0x5899d3['set'](_0x2f23df['id'],_0x3ec4d2);});})())]),{emailToId:_0x9ad3a6,idToEmail:_0x598283}=_0x45836e,_0x524b8b=buildConnectionMaps(_0x15ed3b);return{'rootFolderId':_0x558572,'folderPathToId':_0x2d3e5a,'folderIdToPath':_0x446649,'segmentNameToId':_0x3bdbfa,'activationsBySegmentId':_0x5899d3,'emailToIdMap':_0x9ad3a6,'idToEmailMap':_0x598283,'connectionNameToIdMap':_0x524b8b['nameToId'],'connectionIdToNameMap':_0x524b8b[_0x4621f5(0x1fd)],'connectionNameToTypeMap':_0x524b8b[_0x4621f5(0x252)]};}export function createPushYamlContextForBundle(_0x2f770d,_0x1f506c,_0x76a654,_0x2d6450,_0x2fccf7,_0x1574bf,_0x4a6e9a,_0x52bd43){const {existingLocalSegmentNames:_0x18af2c,localExpandedRuleToNames:_0x349dc7}=_0x2d6450,_0x36edd4=new Set(),_0x58d9cc=new Map(),_0x17f0b6=new Map(),_0x5e4f37=new Map(),_0x3e479e=createJumpTargetCache(),_0x48389b=new Map(),_0x50a809=new Map(),_0x36d1e0=new Set();let _0x45ed88;const _0x332410=_0x20b54e=>{const _0x423667={'resolveSegment':async _0x5e24cc=>{const _0x9fe798=a169_0x880c,_0xab0243=_0x5e4f37['get'](_0x5e24cc);if(_0xab0243!==undefined)return{'name':_0xab0243,'isJourneyLocal':!![]};try{const _0x52ff02=await fetchSegment(_0x2f770d,_0x1f506c,_0x5e24cc,_0x76a654);if(!_0x52ff02)throw new Error(_0x9fe798(0x25d));const _0x5e0a38=generateJourneyLocalName(_0x52ff02[_0x9fe798(0x2a4)]),_0x16baf9=_0x52ff02[_0x9fe798(0x2c0)]===SEGMENT_KIND_JOURNEY&&_0x5e0a38!==undefined;let _0x3b4b24=_0x52ff02[_0x9fe798(0x2a4)],_0x5f9015;if(_0x16baf9&&_0x52ff02[_0x9fe798(0x284)]){const _0x21e2ee=apiRuleToYaml(_0x52ff02[_0x9fe798(0x284)]);_0x50a809['set'](_0x5e24cc,_0x21e2ee);const _0x29e69a=async _0x47fd63=>{const _0x447950=_0x9fe798,_0x417af2=collectSegmentRefsFromRule(_0x47fd63);for(const _0x3cd671 of _0x417af2){if(!_0x50a809[_0x447950(0x249)](_0x3cd671))try{const _0x3e2fe1=await fetchSegment(_0x2f770d,_0x1f506c,_0x3cd671,_0x76a654);if(_0x3e2fe1?.[_0x447950(0x284)]){const _0x57f266=apiRuleToYaml(_0x3e2fe1['rule']);_0x50a809['set'](_0x3cd671,_0x57f266),await _0x29e69a(_0x57f266);}}catch(_0x2b3ea5){logger[_0x447950(0x1eb)](_0x447950(0x283)+_0x3cd671+':\x20'+_0x2b3ea5);}}};await _0x29e69a(_0x21e2ee);const _0x49833e=serializeExpandedRule(_0x21e2ee,_0x50a809),_0x224a85=_0x349dc7[_0x9fe798(0x1d3)](_0x49833e);if(_0x224a85&&_0x224a85[_0x9fe798(0x295)]>0x0){const _0x2b3c28=_0x58d9cc[_0x9fe798(0x1d3)](_0x49833e)||0x0,_0x524780=_0x224a85[_0x2b3c28]||_0x224a85[_0x224a85['length']-0x1];_0x58d9cc[_0x9fe798(0x1ea)](_0x49833e,_0x2b3c28+0x1),_0x3b4b24=_0x524780,_0x36edd4[_0x9fe798(0x1f7)](_0x3b4b24),_0x5e4f37[_0x9fe798(0x1ea)](_0x5e24cc,_0x3b4b24);const _0x1be744=await resolveRuleSegmentRefs(_0x21e2ee,async _0x10cf9a=>{const _0x255cd3=_0x9fe798,_0x23930c=_0x5e4f37[_0x255cd3(0x1d3)](_0x10cf9a);if(_0x23930c)return _0x23930c;const _0x85737e=await _0x45ed88[_0x255cd3(0x20d)](_0x10cf9a);return _0x85737e[_0x255cd3(0x2a4)];});_0x5f9015={'description':_0x52ff02[_0x9fe798(0x261)],'rule':_0x1be744};}else{const _0x492e77=_0x48389b[_0x9fe798(0x1d3)](_0x49833e);if(_0x492e77)_0x3b4b24=_0x492e77,_0x5e4f37[_0x9fe798(0x1ea)](_0x5e24cc,_0x3b4b24);else{if(_0x5e0a38){let _0x1c4bc5=_0x5e0a38,_0x3e1f63=0x2;while(_0x36edd4[_0x9fe798(0x249)](_0x1c4bc5)||_0x18af2c[_0x9fe798(0x249)](_0x1c4bc5)){_0x1c4bc5=_0x5e0a38+'_'+_0x3e1f63,_0x3e1f63++;}_0x36edd4[_0x9fe798(0x1f7)](_0x1c4bc5),_0x3b4b24=_0x1c4bc5;}_0x5e4f37['set'](_0x5e24cc,_0x3b4b24),_0x48389b[_0x9fe798(0x1ea)](_0x49833e,_0x3b4b24);const _0xbe027d=await resolveRuleSegmentRefs(_0x21e2ee,async _0x28c1e9=>{const _0xf3e1b7=_0x9fe798,_0x3d9a2e=_0x5e4f37['get'](_0x28c1e9);if(_0x3d9a2e)return _0x3d9a2e;const _0x10c28d=await _0x45ed88[_0xf3e1b7(0x20d)](_0x28c1e9);return _0x10c28d[_0xf3e1b7(0x2a4)];});_0x5f9015={'description':_0x52ff02['description'],'rule':_0xbe027d};}}}return{'name':_0x3b4b24,'isJourneyLocal':_0x16baf9,'definition':_0x5f9015};}catch(_0x565df6){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x5e24cc+':\x20'+_0x565df6),{'name':_0x5e24cc,'isJourneyLocal':![]};}},'resolveActivation':async _0x28412c=>{const _0x9b5d42=a169_0x880c,_0xd218c1=_0x17f0b6[_0x9b5d42(0x1d3)](_0x28412c);if(_0xd218c1!==undefined)return{'name':_0xd218c1,'isJourneyLocal':!![]};try{let _0x649542=_0x4a6e9a?.[_0x9b5d42(0x1d3)](_0x28412c);!_0x649542&&(_0x649542=await _0x2f770d[_0x9b5d42(0x2bc)][_0x9b5d42(0x258)](_0x20b54e,_0x28412c));const _0x54308d=_0x649542[_0x9b5d42(0x2c5)][_0x9b5d42(0x2d1)][_0x9b5d42(0x2a4)]||_0x28412c,_0x5394cd=sanitizeYamlKey(_0x54308d)||'activation_'+_0x28412c,_0x5af7b1=_0x5394cd;_0x17f0b6[_0x9b5d42(0x1ea)](_0x28412c,_0x5af7b1);const _0x4c5efa=journeyActivationStepToYaml(_0x649542,_0x2fccf7,_0x1574bf);return{'name':_0x5af7b1,'isJourneyLocal':!![],'definition':_0x4c5efa};}catch(_0x17d526){return logger[_0x9b5d42(0x1eb)](_0x9b5d42(0x1db)+_0x28412c+':\x20'+_0x17d526),{'name':_0x28412c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1028f7,_0x2eb62f)=>resolveJumpTarget(_0x1028f7,_0x2eb62f,_0x3e479e,async _0x325187=>{const _0x15070b=a169_0x880c,_0x5dbe49=_0x52bd43?.[_0x15070b(0x1d3)](_0x325187);if(_0x5dbe49)return _0x5dbe49;return _0x2f770d['journey'][_0x15070b(0x227)](_0x325187);})};return _0x45ed88=_0x423667,_0x423667;},_0x1c2e85=async _0x2bafea=>{const _0x59c9f6=a169_0x880c,{collectSegmentIdsFromJourneyApi:_0x4edbc0}=await import(_0x59c9f6(0x2cc)),{batchAsync:_0x2776cc}=await import(_0x59c9f6(0x269)),_0x442406=new Set();for(const _0x552c39 of _0x2bafea){let _0x946a8b=_0x52bd43?.[_0x59c9f6(0x1d3)](_0x552c39);!_0x946a8b&&(_0x946a8b=await _0x2f770d[_0x59c9f6(0x2bc)][_0x59c9f6(0x227)](_0x552c39));const _0x420af4=_0x4edbc0(_0x946a8b);for(const _0x4b6e71 of _0x420af4){_0x442406[_0x59c9f6(0x1f7)](_0x4b6e71);}}let _0x1c20a0=Array[_0x59c9f6(0x276)](_0x442406);while(_0x1c20a0[_0x59c9f6(0x295)]>0x0){const _0x1616a8=_0x1c20a0[_0x59c9f6(0x2af)](_0x8348be=>!_0x36d1e0[_0x59c9f6(0x249)](_0x8348be));if(_0x1616a8[_0x59c9f6(0x295)]===0x0)break;const _0x3120a3=await _0x2776cc(_0x1616a8,async _0x28d5d8=>{const _0x19e7a7=_0x59c9f6;_0x36d1e0[_0x19e7a7(0x1f7)](_0x28d5d8);const _0x5b109c=await fetchSegment(_0x2f770d,_0x1f506c,_0x28d5d8,_0x76a654);if(!_0x5b109c)return null;return{'segmentId':_0x28d5d8,'segment':_0x5b109c};},0xa),_0x213373=new Set();for(const _0x41ad48 of _0x3120a3){if(!_0x41ad48?.[_0x59c9f6(0x28e)]?.['rule'])continue;const _0x2490d2=apiRuleToYaml(_0x41ad48['segment'][_0x59c9f6(0x284)]);_0x50a809[_0x59c9f6(0x1ea)](_0x41ad48[_0x59c9f6(0x26d)],_0x2490d2);const _0x32f240=collectSegmentRefsFromRule(_0x2490d2);for(const _0x1327df of _0x32f240){!_0x36d1e0[_0x59c9f6(0x249)](_0x1327df)&&_0x213373[_0x59c9f6(0x1f7)](_0x1327df);}}_0x1c20a0=Array['from'](_0x213373);}};return{'createYamlContext':_0x332410,'prefetchJourneySegments':_0x1c2e85};}export async function executePushSegments(_0x30f1d8,_0x16c483,_0x4491c1,_0x26c86f,_0x5c1c56){const _0xfe1d18=a169_0x12f8f2,{segmentDefToCreateRequest:_0xbd0431,segmentDefToUpdateRequest:_0xf572fa}=await import(_0xfe1d18(0x202)),_0x36d221=_0x4491c1['folderPathToId'],_0x3921f7=0x5,_0x4592a7=async _0x5a7f8d=>{const _0x19370b=_0xfe1d18,_0xfa71a1=_0x5a7f8d['folderPath']?_0x36d221['get'](_0x5a7f8d['folderPath']):undefined;let _0x22dea4;const _0x25662a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xc1ac47=_0x5a7f8d[_0x19370b(0x256)];if(_0x5a7f8d['yamlConfig'][_0x19370b(0x284)]){const _0x3203d8=createSegmentIdResolver(_0x4491c1[_0x19370b(0x294)],_0x5a7f8d['yamlConfig']['name']),_0x9b0e11=await resolveRuleSegmentIds(_0x5a7f8d[_0x19370b(0x256)]['rule'],_0x3203d8);_0xc1ac47={..._0x5a7f8d[_0x19370b(0x256)],'rule':_0x9b0e11};}try{if(_0x5a7f8d[_0x19370b(0x267)]){_0x5c1c56[_0x19370b(0x216)]?.({'type':'segment_creating','name':_0x5a7f8d[_0x19370b(0x256)]['name']});const _0x1ce40b=_0xbd0431(_0xc1ac47,_0xfa71a1),_0x16f304=await _0x5c1c56[_0x19370b(0x220)](_0x19370b(0x28c)+_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]+_0x19370b(0x1df),()=>_0x30f1d8[_0x19370b(0x28e)][_0x19370b(0x1d5)](_0x26c86f['parentId'],_0x1ce40b));_0x22dea4=_0x16f304[_0x19370b(0x204)]['id'],_0x4491c1[_0x19370b(0x294)][_0x19370b(0x1ea)](_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)],_0x22dea4),_0x25662a['createdSegmentId']={'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)],'id':_0x22dea4},_0x5c1c56[_0x19370b(0x216)]?.({'type':_0x19370b(0x248),'name':_0x5a7f8d[_0x19370b(0x256)]['name'],'segmentId':_0x22dea4}),_0x5c1c56[_0x19370b(0x28a)]?.(_0x19370b(0x2c4)+_0x5a7f8d[_0x19370b(0x256)]['name']+'\x27'),_0x25662a[_0x19370b(0x29e)]=0x1;}else{if(_0x5a7f8d[_0x19370b(0x247)]){_0x5c1c56['onProgress']?.({'type':_0x19370b(0x285),'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]});const _0x46e629=_0xf572fa(_0xc1ac47);_0xfa71a1!==_0x5a7f8d['existingSegment']?.[_0x19370b(0x22e)]&&(_0x46e629['segmentFolderId']=_0xfa71a1?parseInt(_0xfa71a1,0xa):undefined),await _0x5c1c56['withProgress'](_0x19370b(0x24c)+_0x5a7f8d[_0x19370b(0x256)]['name']+_0x19370b(0x1df),()=>_0x30f1d8['segment'][_0x19370b(0x22d)](_0x26c86f[_0x19370b(0x1e4)],_0x5a7f8d[_0x19370b(0x2c8)]['id'],_0x46e629)),_0x22dea4=_0x5a7f8d[_0x19370b(0x2c8)]['id'],_0x5c1c56[_0x19370b(0x216)]?.({'type':_0x19370b(0x293),'name':_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]}),_0x5c1c56[_0x19370b(0x28a)]?.(_0x19370b(0x1d4)+_0x5a7f8d[_0x19370b(0x256)][_0x19370b(0x2a4)]+'\x27'),_0x25662a[_0x19370b(0x1fb)]=0x1;}else _0x22dea4=_0x5a7f8d['existingSegment']['id'];}}catch(_0x4ff1e7){const _0x5efd68=isHttp400Error(_0x4ff1e7),_0x21bb0b=_0x5efd68?ErrorCode[_0x19370b(0x296)]:ErrorCode[_0x19370b(0x239)],_0x2aefc3=getErrorMessage(_0x4ff1e7);throw new SDKError(_0x21bb0b,'Failed\x20to\x20'+(_0x5a7f8d[_0x19370b(0x267)]?_0x19370b(0x29d):_0x19370b(0x23f))+_0x19370b(0x255)+_0x5a7f8d[_0x19370b(0x253)]+_0x19370b(0x1e6)+_0x2aefc3,_0x4ff1e7);}try{const _0x18673a=await syncActivationsForSegment(_0x30f1d8,_0x26c86f[_0x19370b(0x1e4)],_0x22dea4,_0x5a7f8d['yamlConfig'][_0x19370b(0x2a4)],_0x5a7f8d[_0x19370b(0x2ab)],_0x5c1c56,_0x5a7f8d[_0x19370b(0x253)]);_0x25662a['activations']=_0x18673a;}catch(_0x1f606f){if(_0x1f606f instanceof SDKError)throw _0x1f606f;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x19370b(0x25c)+_0x5a7f8d['yamlConfig'][_0x19370b(0x2a4)]+_0x19370b(0x2b7)+_0x5a7f8d[_0x19370b(0x253)]+_0x19370b(0x1e6)+getErrorMessage(_0x1f606f),_0x1f606f);}return _0x25662a;},_0x3edecd=await batchAsync(_0x16c483,_0x4592a7,_0x3921f7),_0x1456a8={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x12d4b9 of _0x3edecd){_0x1456a8['created']+=_0x12d4b9['created'],_0x1456a8[_0xfe1d18(0x1fb)]+=_0x12d4b9[_0xfe1d18(0x1fb)],_0x12d4b9['createdSegmentId']&&_0x1456a8['createdSegmentIds'][_0xfe1d18(0x1ea)](_0x12d4b9[_0xfe1d18(0x2ae)][_0xfe1d18(0x2a4)],_0x12d4b9['createdSegmentId']['id']),_0x1456a8[_0xfe1d18(0x20c)][_0xfe1d18(0x29e)]+=_0x12d4b9[_0xfe1d18(0x20c)][_0xfe1d18(0x29e)],_0x1456a8[_0xfe1d18(0x20c)]['updated']+=_0x12d4b9[_0xfe1d18(0x20c)][_0xfe1d18(0x1fb)],_0x1456a8[_0xfe1d18(0x20c)][_0xfe1d18(0x1dc)]+=_0x12d4b9['activations']['deleted'];}return _0x1456a8;}async function syncActivationsForSegment(_0x5a42b2,_0x5126dd,_0x13d04b,_0xc28f72,_0x83bf3,_0xa654b5,_0x160e81){const _0x5826ed=a169_0x12f8f2,_0x363826={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x19d6f3 of _0x83bf3){try{if(_0x19d6f3[_0x5826ed(0x1d7)]===_0x5826ed(0x29d)&&_0x19d6f3[_0x5826ed(0x2c3)])_0xa654b5[_0x5826ed(0x216)]?.({'type':_0x5826ed(0x1fa),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5['withProgress'](_0x5826ed(0x27f)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27...',()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x242)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x2c3)])),_0xa654b5[_0x5826ed(0x216)]?.({'type':_0x5826ed(0x24f),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x28a)]?.(_0x5826ed(0x20f)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x29e)]++;else{if(_0x19d6f3['type']===_0x5826ed(0x23f)&&_0x19d6f3[_0x5826ed(0x2c3)]&&_0x19d6f3['existingActivation'])_0xa654b5['onProgress']?.({'type':'activation_updating','segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5[_0x5826ed(0x220)]('Updating\x20activation\x20\x27'+_0x19d6f3['name']+_0x5826ed(0x1df),()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x265)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x21b)]['id'],_0x19d6f3[_0x5826ed(0x2c3)])),_0xa654b5['onProgress']?.({'type':_0x5826ed(0x27e),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x28a)]?.(_0x5826ed(0x1f2)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x1fb)]++;else _0x19d6f3[_0x5826ed(0x1d7)]===_0x5826ed(0x275)&&_0x19d6f3[_0x5826ed(0x21b)]&&(_0xa654b5['onProgress']?.({'type':'activation_deleting','segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),await _0xa654b5['withProgress']('Deleting\x20activation\x20\x27'+_0x19d6f3[_0x5826ed(0x2a4)]+_0x5826ed(0x1df),()=>_0x5a42b2[_0x5826ed(0x28e)][_0x5826ed(0x259)](_0x5126dd,_0x13d04b,_0x19d6f3[_0x5826ed(0x21b)]['id'])),_0xa654b5['onProgress']?.({'type':_0x5826ed(0x1e9),'segmentName':_0xc28f72,'activationName':_0x19d6f3[_0x5826ed(0x2a4)]}),_0xa654b5[_0x5826ed(0x2b4)]?.('Deleted\x20activation\x20\x27'+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27'),_0x363826[_0x5826ed(0x1dc)]++);}}catch(_0x261fd9){const _0x11e3fd=isHttp400Error(_0x261fd9),_0x5c5df3=_0x11e3fd?ErrorCode[_0x5826ed(0x224)]:ErrorCode[_0x5826ed(0x24d)],_0x432cb7=getErrorMessage(_0x261fd9);throw new SDKError(_0x5c5df3,_0x5826ed(0x2aa)+_0x19d6f3[_0x5826ed(0x1d7)]+_0x5826ed(0x230)+_0x19d6f3[_0x5826ed(0x2a4)]+'\x27\x20from\x20file:\x20'+_0x160e81+_0x5826ed(0x1e6)+_0x432cb7,_0x261fd9);}}return _0x363826;}export async function executePushFolders(_0x2bec26,_0x2ebb77,_0xe9b408,_0x2095be,_0x4831b4){const _0xcc790a=a169_0x12f8f2,_0x2993fb=new Map(_0xe9b408),_0x4d351b=sortFoldersByDepth(_0x2ebb77);for(const _0xa43de2 of _0x4d351b){const _0x1ac8c3=_0xa43de2[_0xcc790a(0x2bb)]('/'),_0x5535ac=_0x1ac8c3[_0x1ac8c3[_0xcc790a(0x295)]-0x1],_0x4474fe=_0x1ac8c3[_0xcc790a(0x209)](0x0,-0x1)[_0xcc790a(0x2b9)]('/'),_0x1e9f56=_0x2993fb[_0xcc790a(0x1d3)](_0x4474fe);_0x4831b4[_0xcc790a(0x216)]?.({'type':_0xcc790a(0x263),'folder':_0xa43de2});const _0x3698a1={'name':_0x5535ac,'parentFolderId':_0x1e9f56},_0xd63371=await _0x4831b4[_0xcc790a(0x220)]('Creating\x20folder\x20\x27'+_0xa43de2+'\x27...',()=>_0x2bec26[_0xcc790a(0x28e)]['createFolder'](_0x2095be[_0xcc790a(0x1e4)],_0x3698a1));_0x2993fb[_0xcc790a(0x1ea)](_0xa43de2,_0xd63371[_0xcc790a(0x204)]['id']),_0x4831b4['onProgress']?.({'type':_0xcc790a(0x264),'folder':_0xa43de2,'folderId':_0xd63371[_0xcc790a(0x204)]['id']}),_0x4831b4[_0xcc790a(0x272)]?.(_0xcc790a(0x2a5)+_0xa43de2+'\x27');}return _0x2993fb;}export async function executePushSegmentDeletions(_0x3b46f2,_0x143c16,_0xa2c447){const _0x4c479d=a169_0x12f8f2;if(_0x143c16[_0x4c479d(0x295)]===0x0)return 0x0;const {batchAsync:_0x366b79}=await import(_0x4c479d(0x269)),_0x4e62e3=0x5,_0x51d468=await _0x366b79(_0x143c16,async _0x20be75=>{const _0x5e6529=_0x4c479d;return _0xa2c447[_0x5e6529(0x216)]?.({'type':'segment_deleting','name':_0x20be75[_0x5e6529(0x2a4)]}),await _0x3b46f2[_0x5e6529(0x28e)][_0x5e6529(0x213)](_0x20be75['id']),_0xa2c447[_0x5e6529(0x216)]?.({'type':_0x5e6529(0x208),'name':_0x20be75[_0x5e6529(0x2a4)]}),_0xa2c447[_0x5e6529(0x2b4)]?.('Deleted\x20segment\x20\x27'+_0x20be75['name']+'\x27'),0x1;},_0x4e62e3);return _0x51d468[_0x4c479d(0x207)]((_0x2230bc,_0x53a0be)=>_0x2230bc+_0x53a0be,0x0);}export async function executePushJourneys(_0x59d74c,_0x2f26af,_0x42b3f4,_0x3d7a97,_0x3d271b){const _0x253138=a169_0x12f8f2,{journeyDefToRequest:_0x3430c3}=await import(_0x253138(0x2cc)),{activationDefToCreateRequest:_0x3c3301,yamlRuleToApi:_0x444e69,validateSegmentRule:_0x4d7d98}=await import(_0x253138(0x202)),_0x3b0450={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3262cb=new Map(_0x42b3f4[_0x253138(0x294)]),_0x453f6d=0x5;for(let _0x583299=0x0;_0x583299<_0x2f26af[_0x253138(0x295)];_0x583299+=_0x453f6d){const _0x3095ba=_0x2f26af['slice'](_0x583299,_0x583299+_0x453f6d),_0x5bb7b2=await Promise['all'](_0x3095ba[_0x253138(0x201)](async _0x3d124f=>{const _0x55dedb=_0x253138;if(!_0x3d124f['isNew']&&!_0x3d124f[_0x55dedb(0x247)])return{'action':'unchanged','name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)],'journeyId':_0x3d124f[_0x55dedb(0x23b)]?.['id']};const _0x191a3a=_0x3d124f[_0x55dedb(0x2a8)]?_0x42b3f4[_0x55dedb(0x241)][_0x55dedb(0x1d3)](_0x3d124f[_0x55dedb(0x2a8)]):undefined;_0x3d271b[_0x55dedb(0x216)]?.({'type':_0x3d124f[_0x55dedb(0x267)]?'journey_creating':_0x55dedb(0x2c6),'name':_0x3d124f['yamlConfig'][_0x55dedb(0x2a4)]});try{const _0x540257=await executeSingleJourneyPush(_0x59d74c,_0x3d124f,{..._0x42b3f4,'segmentNameToId':_0x3262cb},{'parentId':_0x3d7a97[_0x55dedb(0x1e4)],'rootFolderId':_0x3d7a97[_0x55dedb(0x1d1)],'folderId':_0x191a3a,'verbose':_0x3d7a97[_0x55dedb(0x23d)]},_0x3d271b,{'journeyDefToRequest':_0x3430c3,'activationDefToCreateRequest':_0x3c3301,'yamlRuleToApi':_0x444e69,'validateSegmentRule':_0x4d7d98});for(const [_0x4ce91f,_0x361d0e]of _0x540257[_0x55dedb(0x281)]){_0x3262cb['set'](_0x4ce91f,_0x361d0e),_0x3b0450['embeddedSegmentNameToId'][_0x55dedb(0x1ea)](_0x4ce91f,_0x361d0e);}if(_0x540257[_0x55dedb(0x225)]===_0x55dedb(0x29e))_0x3d271b[_0x55dedb(0x216)]?.({'type':_0x55dedb(0x1d8),'name':_0x3d124f[_0x55dedb(0x256)]['name'],'journeyId':_0x540257[_0x55dedb(0x29a)]}),_0x3d271b[_0x55dedb(0x28a)]?.(_0x55dedb(0x2a6)+_0x3d124f[_0x55dedb(0x256)]['name']+'\x27'),_0x3b0450[_0x55dedb(0x29e)]++;else _0x540257[_0x55dedb(0x225)]===_0x55dedb(0x1fb)&&(_0x3d271b['onProgress']?.({'type':_0x55dedb(0x2a3),'name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)]}),_0x3d271b[_0x55dedb(0x28a)]?.('Updated\x20journey\x20\x27'+_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)]+'\x27'),_0x3b0450[_0x55dedb(0x1fb)]++);return{'action':_0x540257['action'],'name':_0x3d124f[_0x55dedb(0x256)][_0x55dedb(0x2a4)],'journeyId':_0x540257[_0x55dedb(0x29a)]};}catch(_0x2c7a30){const _0x4833fa=isHttp400Error(_0x2c7a30),_0x599610=_0x4833fa?ErrorCode[_0x55dedb(0x26a)]:ErrorCode[_0x55dedb(0x282)],_0x5696fa=getErrorMessage(_0x2c7a30);throw new SDKError(_0x599610,_0x55dedb(0x2aa)+(_0x3d124f[_0x55dedb(0x267)]?_0x55dedb(0x29d):'update')+_0x55dedb(0x26c)+_0x3d124f[_0x55dedb(0x253)]+_0x55dedb(0x1e6)+_0x5696fa,_0x2c7a30);}}));_0x3b0450[_0x253138(0x2b6)][_0x253138(0x2a9)](..._0x5bb7b2);}return _0x3b0450;}async function matchExistingJourneySegments(_0x5dc956,_0x2f6989,_0xb55bbe,_0x350d42,_0x5d3409){const _0x4364c7=a169_0x12f8f2;if(!_0x2f6989[_0x4364c7(0x23b)]||!_0x2f6989[_0x4364c7(0x256)]['segments'])return;const _0x2d4735=new Map(),_0x452d41=new Set();for(const _0x480340 of Object[_0x4364c7(0x1d2)](_0x2f6989[_0x4364c7(0x256)][_0x4364c7(0x1ed)])){const _0x29e73a=generateDeterministicJourneySegmentName(_0x2f6989[_0x4364c7(0x256)][_0x4364c7(0x2a4)],_0x480340);_0x2d4735[_0x4364c7(0x1ea)](_0x29e73a,_0x480340),_0x452d41[_0x4364c7(0x1f7)](_0x480340);}const _0x2de35d=[],_0x14ca10=collectSegmentIdsFromJourneyApi(_0x2f6989[_0x4364c7(0x23b)]);for(const _0x132d88 of _0x14ca10){const _0x25c5b4=await fetchSegment(_0x5dc956,_0xb55bbe,_0x132d88,_0x350d42);if(!_0x25c5b4?.[_0x4364c7(0x2a4)])continue;const _0x3a94cb=_0x2d4735['get'](_0x25c5b4[_0x4364c7(0x2a4)]);_0x3a94cb?(_0x5d3409[_0x4364c7(0x1ea)](_0x3a94cb,_0x132d88),_0x452d41[_0x4364c7(0x275)](_0x3a94cb)):_0x2de35d[_0x4364c7(0x2a9)]({'id':_0x132d88,'seg':_0x25c5b4});}if(_0x452d41['size']>0x0&&_0x2de35d[_0x4364c7(0x295)]>0x0){const {localExpandedRuleToNames:_0x12f957}=buildLocalExpandedRuleMappings(_0x2f6989[_0x4364c7(0x256)]),_0x5266f8=new Map();for(const {id:_0x367a9a,seg:_0x454d98}of _0x2de35d){if(_0x454d98[_0x4364c7(0x284)]){const _0x31bd03=apiRuleToYaml(_0x454d98['rule']);_0x5266f8[_0x4364c7(0x1ea)](_0x367a9a,_0x31bd03);}}for(const {id:_0x3487c5,seg:_0x21a62a}of _0x2de35d){if(!_0x21a62a[_0x4364c7(0x284)])continue;const _0x300315=_0x5266f8[_0x4364c7(0x1d3)](_0x3487c5);if(!_0x300315)continue;const _0x328601=serializeExpandedRule(_0x300315,_0x5266f8),_0x500d60=_0x12f957[_0x4364c7(0x1d3)](_0x328601);if(_0x500d60){const _0x2e01ea=_0x500d60[_0x4364c7(0x1f8)](_0x17e9fd=>_0x452d41[_0x4364c7(0x249)](_0x17e9fd));_0x2e01ea&&(_0x5d3409[_0x4364c7(0x1ea)](_0x2e01ea,_0x3487c5),_0x452d41[_0x4364c7(0x275)](_0x2e01ea),logger[_0x4364c7(0x1eb)](_0x4364c7(0x1d9)+_0x21a62a[_0x4364c7(0x2a4)]+'\x27\x20to\x20local\x20\x27'+_0x2e01ea+_0x4364c7(0x287)));}}}}async function executeSingleJourneyPush(_0x3b481c,_0x354b51,_0x58674f,_0x3e2030,_0x5e3db5,_0xca719a){const _0x5dfb9a=a169_0x12f8f2,{journeyDefToRequest:_0x5093fa,activationDefToCreateRequest:_0x592e47,yamlRuleToApi:_0x41a634,validateSegmentRule:_0x4bea41}=_0xca719a,_0x8f0ba4=new Map(),_0xc348de=new Map();recoverSegmentIdsFromPushRecovery(_0x354b51,_0x8f0ba4,_0x58674f['segmentNameToId']);const _0x3bbdf7=new Map(),_0x35f53f=new Map(),_0x261d77=new Map();let _0x335523;const _0x1153a2=async()=>{const _0x79e86b=a169_0x880c;if(_0x335523)return;_0x335523=new Map();if(!_0x354b51[_0x79e86b(0x23b)])return;const _0x47bb18=await _0x3b481c['journey'][_0x79e86b(0x217)](_0x354b51[_0x79e86b(0x23b)]['id']);for(const _0xceac57 of _0x47bb18){const _0x11aad9=journeyActivationStepToYaml(_0xceac57,_0x58674f[_0x79e86b(0x1ef)],_0x58674f[_0x79e86b(0x212)]),_0x571652=activationSignature(_0x11aad9);!_0x335523[_0x79e86b(0x249)](_0x571652)&&_0x335523[_0x79e86b(0x1ea)](_0x571652,_0xceac57['id']),_0x11aad9['name']&&_0xc348de[_0x79e86b(0x1ea)](_0x11aad9[_0x79e86b(0x2a4)],_0xceac57['id']);}};await matchExistingJourneySegments(_0x3b481c,_0x354b51,_0x3e2030[_0x5dfb9a(0x1e4)],_0x58674f[_0x5dfb9a(0x21a)],_0x58674f[_0x5dfb9a(0x294)]);const _0x1f8486={'resolveSegmentId':async _0x2007cb=>{const _0x11661e=_0x5dfb9a,_0x5b602a=_0x58674f[_0x11661e(0x294)][_0x11661e(0x1d3)](_0x2007cb);if(!_0x5b602a)throw new SDKError(ErrorCode[_0x11661e(0x218)],_0x11661e(0x1d6)+_0x2007cb+_0x11661e(0x266)+_0x354b51[_0x11661e(0x256)][_0x11661e(0x2a4)]+')');return _0x5b602a;},'resolveEmbeddedSegmentId':async(_0x143fd5,_0x465ea2)=>{const _0x53324b=_0x5dfb9a,_0x4ace68=_0x58674f[_0x53324b(0x294)][_0x53324b(0x1d3)](_0x143fd5);if(_0x4ace68)return _0x4ace68;const _0x44a18f=_0x58674f[_0x53324b(0x21a)][_0x53324b(0x1f8)](_0x54df9b=>_0x54df9b[_0x53324b(0x2a4)]===_0x143fd5);if(_0x44a18f)return _0x58674f['segmentNameToId'][_0x53324b(0x1ea)](_0x143fd5,_0x44a18f['id']),_0x44a18f['id'];if(_0x354b51[_0x53324b(0x267)]){const {stageName:_0x5c7b78,criteriaName:_0x5513a4}=findSegmentCriteriaLocation(_0x354b51['yamlConfig'],_0x143fd5);return _0x4bea41(_0x143fd5,_0x465ea2[_0x53324b(0x284)]),_0x35f53f[_0x53324b(0x1ea)](_0x143fd5,{'definition':_0x465ea2,'stageName':_0x5c7b78,'criteriaName':_0x5513a4}),createPendingSegmentId(_0x143fd5);}const _0x4a4d6e=_0x354b51[_0x53324b(0x23b)]?.['id'];if(!_0x4a4d6e)throw new SDKError(ErrorCode[_0x53324b(0x24e)],_0x53324b(0x240));const _0x14c959=_0x3bbdf7[_0x53324b(0x1d3)](_0x143fd5);if(_0x14c959)return _0x14c959;const _0x4159cb=((async()=>{const _0x2d5e37=_0x53324b;_0x4bea41(_0x143fd5,_0x465ea2[_0x2d5e37(0x284)]);const _0x937a42=generateDeterministicJourneySegmentName(_0x354b51[_0x2d5e37(0x256)][_0x2d5e37(0x2a4)],_0x143fd5),_0x2833f8=_0x58674f[_0x2d5e37(0x21a)][_0x2d5e37(0x1f8)](_0x3377e4=>_0x3377e4[_0x2d5e37(0x2a4)]===_0x937a42),_0x42878f=createSegmentIdResolver(_0x58674f[_0x2d5e37(0x294)],_0x143fd5),_0x347ff8=await resolveRuleSegmentIds(_0x465ea2[_0x2d5e37(0x284)],_0x42878f);let _0x2be5b3;return _0x2833f8?(await _0x3b481c[_0x2d5e37(0x28e)][_0x2d5e37(0x22d)](_0x3e2030[_0x2d5e37(0x1e4)],_0x2833f8['id'],{'description':_0x465ea2[_0x2d5e37(0x261)]||_0x2d5e37(0x1dd)+_0x143fd5,'rule':_0x41a634(_0x347ff8),'countPopulation':!![]}),_0x2be5b3=_0x2833f8['id'],saveSegmentToPushRecovery(_0x354b51[_0x2d5e37(0x253)],_0x354b51[_0x2d5e37(0x256)][_0x2d5e37(0x2a4)],_0x143fd5,{'segmentId':_0x2be5b3,'uniqueServerName':_0x937a42,'createdAt':new Date()[_0x2d5e37(0x2ad)]()})):_0x2be5b3=await createOrRecoverEmbeddedSegment(_0x3b481c,_0x354b51,{'localName':_0x143fd5,'uniqueSegmentName':_0x937a42,'description':_0x465ea2[_0x2d5e37(0x261)]||_0x2d5e37(0x1dd)+_0x143fd5,'journeyId':_0x4a4d6e,'resolvedRule':_0x347ff8,'parentId':_0x3e2030[_0x2d5e37(0x1e4)],'folderId':_0x3e2030[_0x2d5e37(0x1d1)]||''},_0x41a634),_0x58674f[_0x2d5e37(0x294)][_0x2d5e37(0x1ea)](_0x143fd5,_0x2be5b3),_0x8f0ba4[_0x2d5e37(0x1ea)](_0x143fd5,_0x2be5b3),_0x2be5b3;})());_0x3bbdf7['set'](_0x143fd5,_0x4159cb);try{return await _0x4159cb;}finally{_0x3bbdf7[_0x53324b(0x275)](_0x143fd5);}},'resolveActivationId':async _0x1c10b7=>{const _0x349422=_0x5dfb9a,_0x1fc3d1=_0xc348de['get'](_0x1c10b7);if(_0x1fc3d1)return _0x1fc3d1;if(_0x354b51[_0x349422(0x23b)]){await _0x1153a2();const _0x5b1d02=_0xc348de[_0x349422(0x1d3)](_0x1c10b7);if(_0x5b1d02)return _0x5b1d02;}throw new SDKError(ErrorCode[_0x349422(0x278)],'Activation\x20not\x20found:\x20'+_0x1c10b7+_0x349422(0x266)+_0x354b51[_0x349422(0x256)][_0x349422(0x2a4)]+_0x349422(0x215)+_0x349422(0x2bf));},'resolveEmbeddedActivationId':async(_0x45832e,_0x2732e9)=>{const _0x4cee17=_0x5dfb9a,_0x47a9ba=_0xc348de[_0x4cee17(0x1d3)](_0x45832e);if(_0x47a9ba)return _0x47a9ba;if(_0x354b51['isNew'])return _0x261d77[_0x4cee17(0x1ea)](_0x45832e,_0x2732e9),createPendingActivationId(_0x45832e);if(_0x354b51[_0x4cee17(0x23b)]){await _0x1153a2();const _0xfbbbe2=_0xc348de[_0x4cee17(0x1d3)](_0x2732e9[_0x4cee17(0x2a4)]);if(_0xfbbbe2)return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0xfbbbe2),_0xfbbbe2;const _0x3613d1=activationSignature(_0x2732e9),_0x4df490=_0x335523?.['get'](_0x3613d1);if(_0x4df490)return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0x4df490),_0x4df490;const _0x22cbf6=await _0x592e47(_0x2732e9,_0x58674f[_0x4cee17(0x22b)]),_0x3f8715={..._0x22cbf6,..._0x2732e9[_0x4cee17(0x233)]!==undefined&&{'runAfterJourneyRefresh':_0x2732e9[_0x4cee17(0x233)]}},_0x394b80=await _0x3b481c[_0x4cee17(0x2bc)][_0x4cee17(0x242)](_0x354b51['existingJourney']['id'],_0x3f8715);return _0xc348de[_0x4cee17(0x1ea)](_0x45832e,_0x394b80['id']),_0x394b80['id'];}throw new SDKError(ErrorCode[_0x4cee17(0x24e)],_0x4cee17(0x262));},'resolveJourneyId':async _0x2e3b1f=>{const _0x5edef4=_0x5dfb9a;try{return await _0x3b481c['journey'][_0x5edef4(0x226)](_0x3e2030[_0x5edef4(0x1e4)],_0x2e3b1f);}catch(_0x27e6a7){throw new SDKError(ErrorCode[_0x5edef4(0x278)],_0x5edef4(0x24a)+_0x2e3b1f+_0x5edef4(0x25a)+_0x354b51[_0x5edef4(0x256)][_0x5edef4(0x2a4)]+'\x27)',_0x27e6a7);}},'resolveStageId':async(_0x2622f4,_0x3c5fdc)=>{const _0x41d7c8=_0x5dfb9a,_0x39e6b4=await _0x3b481c[_0x41d7c8(0x2bc)][_0x41d7c8(0x227)](_0x2622f4),_0x366869=_0x39e6b4[_0x41d7c8(0x2c5)][_0x41d7c8(0x238)][_0x41d7c8(0x1f8)](_0x5b4697=>_0x5b4697['name']['toLowerCase']()===_0x3c5fdc[_0x41d7c8(0x21d)]());if(!_0x366869?.['id'])throw new SDKError(ErrorCode[_0x41d7c8(0x278)],_0x41d7c8(0x1cf)+_0x3c5fdc+_0x41d7c8(0x219)+(_0x39e6b4[_0x41d7c8(0x2c5)][_0x41d7c8(0x203)]||_0x39e6b4[_0x41d7c8(0x2c5)]['name'])+'\x27');return _0x366869['id'];}},_0x3d4f4f=await _0x5093fa(_0x354b51[_0x5dfb9a(0x256)],_0x3e2030[_0x5dfb9a(0x1e4)],_0x1f8486),_0x269c8d=_0x3e2030[_0x5dfb9a(0x27d)]||_0x3e2030['rootFolderId'];_0x269c8d&&(_0x3d4f4f['relationships']={'parentFolder':{'data':{'id':_0x269c8d,'type':_0x5dfb9a(0x291)}}});if(_0x354b51[_0x5dfb9a(0x267)]){if(_0x35f53f['size']>0x0||_0x261d77['size']>0x0)return await executeThreeStepJourneyCreate(_0x3b481c,_0x354b51,_0x3d4f4f,{'pendingEmbeddedSegments':_0x35f53f,'pendingEmbeddedActivations':_0x261d77,'embeddedSegmentNameToId':_0x8f0ba4,'journeyActivationNameToId':_0xc348de},{..._0x3e2030,'effectiveFolderId':_0x269c8d},_0x58674f,_0x5e3db5,_0xca719a);else{ensureJourneyDefaults(_0x3d4f4f[_0x5dfb9a(0x2c5)]);const _0x1b72f6=await _0x3b481c[_0x5dfb9a(0x2bc)][_0x5dfb9a(0x29d)](_0x3d4f4f);return deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':'created','journeyId':_0x1b72f6['id'],'embeddedSegmentNameToId':_0x8f0ba4};}}else{if(_0x354b51[_0x5dfb9a(0x247)]&&_0x354b51[_0x5dfb9a(0x23b)]){_0x3d4f4f['id']=_0x354b51[_0x5dfb9a(0x23b)]['id'];const _0x4f5717=_0x3d4f4f[_0x5dfb9a(0x2c5)];_0x354b51[_0x5dfb9a(0x23b)][_0x5dfb9a(0x2c5)]?.[_0x5dfb9a(0x203)]&&(_0x4f5717[_0x5dfb9a(0x203)]=_0x354b51[_0x5dfb9a(0x23b)]['attributes'][_0x5dfb9a(0x203)]);const _0x509ae8=_0x354b51[_0x5dfb9a(0x23b)][_0x5dfb9a(0x2c5)]?.[_0x5dfb9a(0x238)];return _0x509ae8&&_0x3d4f4f['attributes'][_0x5dfb9a(0x238)]&&injectExistingStageIds(_0x3d4f4f['attributes']['journeyStages'],_0x509ae8),ensureJourneyDefaults(_0x4f5717),await _0x3b481c[_0x5dfb9a(0x2bc)]['update'](_0x354b51[_0x5dfb9a(0x23b)]['id'],_0x3d4f4f),deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':'updated','journeyId':_0x354b51[_0x5dfb9a(0x23b)]['id'],'embeddedSegmentNameToId':_0x8f0ba4};}}return deletePushRecovery(_0x354b51[_0x5dfb9a(0x253)]),{'action':_0x5dfb9a(0x25e),'journeyId':_0x354b51['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x8f0ba4};}function findSegmentCriteriaLocation(_0x3b1e72,_0xe91eae){const _0x2afe5a=a169_0x12f8f2,_0x47ac27=_0x3b1e72[_0x2afe5a(0x2b5)]||_0x3b1e72[_0x2afe5a(0x21f)]?.[0x0]?.[_0x2afe5a(0x2b5)]||[];let _0x66529e='entry',_0x60e359=_0xe91eae;const _0x13987e=_0x3b1e72['goal']||_0x3b1e72[_0x2afe5a(0x21f)]?.[0x0]?.['goal'];if(_0x13987e?.['segment']===_0xe91eae)return{'stageName':_0x2afe5a(0x2c1),'criteriaName':_0x13987e['name']||_0xe91eae};_0x3a7ece:for(const _0x32eaf2 of _0x47ac27){if(_0x32eaf2[_0x2afe5a(0x22f)]?.['segment']===_0xe91eae){_0x66529e=_0x32eaf2[_0x2afe5a(0x2a4)],_0x60e359=_0x32eaf2[_0x2afe5a(0x22f)][_0x2afe5a(0x2a4)]||_0xe91eae;break;}if(_0x32eaf2[_0x2afe5a(0x2b0)])for(const _0x3bc5c5 of _0x32eaf2['steps']){if(_0x3bc5c5[_0x2afe5a(0x1d7)]==='decision_point'&&_0x3bc5c5[_0x2afe5a(0x2d0)]?.[_0x2afe5a(0x1ee)])for(const _0x2a6666 of _0x3bc5c5[_0x2afe5a(0x2d0)][_0x2afe5a(0x1ee)]){if(_0x2a6666['segment']===_0xe91eae){_0x66529e=_0x32eaf2[_0x2afe5a(0x2a4)],_0x60e359=_0x2a6666[_0x2afe5a(0x2a4)]||_0xe91eae;break _0x3a7ece;}}}}return{'stageName':_0x66529e,'criteriaName':_0x60e359};}async function executeThreeStepJourneyCreate(_0x81ef42,_0xb6bdbf,_0x388cb1,_0x332740,_0x4e9402,_0x336fb3,_0x4d85da,_0x53b2c9){const _0x6847e7=a169_0x12f8f2,{activationDefToCreateRequest:_0x37ff0f,yamlRuleToApi:_0x1209fa}=_0x53b2c9,{pendingEmbeddedSegments:_0x25879f,pendingEmbeddedActivations:_0x266e46,embeddedSegmentNameToId:_0x60306d}=_0x332740,_0x23230c=JSON[_0x6847e7(0x2a2)](JSON[_0x6847e7(0x298)](_0x388cb1));ensureJourneyDefaults(_0x23230c[_0x6847e7(0x2c5)]),stripPendingIds(_0x23230c);const _0x5b6d68=await _0x81ef42['journey'][_0x6847e7(0x29d)](_0x23230c),_0x1dedfa=_0x5b6d68['id'],_0x4c725e=new Map();for(const _0xfd0f21 of _0x5b6d68['attributes']['journeyStages']){_0x4c725e['set'](_0xfd0f21[_0x6847e7(0x2a4)][_0x6847e7(0x21d)](),_0xfd0f21['id']);}recoverSegmentIdsFromPushRecovery(_0xb6bdbf,_0x60306d,_0x336fb3['segmentNameToId']);for(const [_0x416111,{definition:_0x2f4511}]of _0x25879f){if(_0x60306d[_0x6847e7(0x249)](_0x416111)){_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x1da),'journeyName':_0xb6bdbf[_0x6847e7(0x256)][_0x6847e7(0x2a4)],'segmentName':_0x416111});continue;}const _0x481ed2=generateDeterministicJourneySegmentName(_0xb6bdbf[_0x6847e7(0x256)]['name'],_0x416111);_0x4d85da[_0x6847e7(0x216)]?.({'type':'embedded_segment_creating','journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'segmentName':_0x416111});const _0x4e760b=createSegmentIdResolver(_0x336fb3[_0x6847e7(0x294)],_0x416111),_0x5a75d4=await resolveRuleSegmentIds(_0x2f4511[_0x6847e7(0x284)],_0x4e760b),_0x3df1dc=await createOrRecoverEmbeddedSegment(_0x81ef42,_0xb6bdbf,{'localName':_0x416111,'uniqueSegmentName':_0x481ed2,'description':_0x2f4511[_0x6847e7(0x261)]||_0x6847e7(0x1dd)+_0x416111,'journeyId':_0x1dedfa,'resolvedRule':_0x5a75d4,'parentId':_0x4e9402[_0x6847e7(0x1e4)],'folderId':_0x4e9402[_0x6847e7(0x257)]||''},_0x1209fa);_0x60306d[_0x6847e7(0x1ea)](_0x416111,_0x3df1dc),_0x336fb3[_0x6847e7(0x294)][_0x6847e7(0x1ea)](_0x416111,_0x3df1dc),_0x4d85da[_0x6847e7(0x216)]?.({'type':'embedded_segment_created','journeyName':_0xb6bdbf[_0x6847e7(0x256)]['name'],'segmentName':_0x416111});}const _0x12b815=new Map();for(const [_0x5ab345,_0x34b5d9]of _0x266e46){_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x222),'journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'activationName':_0x5ab345});const _0x5b2538=await _0x37ff0f(_0x34b5d9,_0x336fb3[_0x6847e7(0x22b)]),_0x13e705={..._0x5b2538,..._0x34b5d9[_0x6847e7(0x233)]!==undefined&&{'runAfterJourneyRefresh':_0x34b5d9[_0x6847e7(0x233)]}},_0x16712b=await _0x81ef42[_0x6847e7(0x2bc)][_0x6847e7(0x242)](_0x1dedfa,_0x13e705);_0x12b815[_0x6847e7(0x1ea)](_0x5ab345,_0x16712b['id']),_0x332740[_0x6847e7(0x250)][_0x6847e7(0x1ea)](_0x5ab345,_0x16712b['id']),_0x4d85da[_0x6847e7(0x216)]?.({'type':_0x6847e7(0x1f9),'journeyName':_0xb6bdbf['yamlConfig'][_0x6847e7(0x2a4)],'activationName':_0x5ab345});}const _0x19e3c4=JSON[_0x6847e7(0x2a2)](JSON[_0x6847e7(0x298)](_0x388cb1));return _0x19e3c4['id']=_0x1dedfa,ensureJourneyDefaults(_0x19e3c4[_0x6847e7(0x2c5)]),resolvePendingIdsInRequest(_0x19e3c4,_0x388cb1,_0x4c725e,_0x60306d,_0x12b815,_0x4d85da),await _0x81ef42[_0x6847e7(0x2bc)][_0x6847e7(0x23f)](_0x1dedfa,_0x19e3c4),deletePushRecovery(_0xb6bdbf[_0x6847e7(0x253)]),{'action':_0x6847e7(0x29e),'journeyId':_0x1dedfa,'embeddedSegmentNameToId':_0x60306d};}export function stripWaitStepPendingIds(_0x1a9de8){const _0x58b866=a169_0x12f8f2,_0x22a2d7=_0x1a9de8[_0x58b866(0x292)]&&isPendingSegmentId(_0x1a9de8['conditionSegmentId']),_0x1a35c4=_0x1a9de8[_0x58b866(0x2c9)]?.[_0x58b866(0x237)](_0x59e6a8=>_0x59e6a8[_0x58b866(0x26d)]&&isPendingSegmentId(_0x59e6a8[_0x58b866(0x26d)]));(_0x22a2d7||_0x1a35c4)&&(_0x1a9de8[_0x58b866(0x1e1)]='Duration',_0x1a9de8[_0x58b866(0x289)]=0x1,_0x1a9de8[_0x58b866(0x236)]=_0x58b866(0x25f),delete _0x1a9de8[_0x58b866(0x292)],delete _0x1a9de8['conditionTimeoutDuration'],delete _0x1a9de8['conditionTimeoutUnit'],delete _0x1a9de8[_0x58b866(0x2c9)]);}export function resolveWaitStepPendingIds(_0x37853c,_0x231f24,_0x5192dd,_0x3dcd01){const _0x3629e1=a169_0x12f8f2;if(_0x231f24[_0x3629e1(0x292)]&&isPendingSegmentId(_0x231f24[_0x3629e1(0x292)])){const _0x28987d=_0x5192dd(_0x231f24[_0x3629e1(0x292)],_0x3629e1(0x1f3)+_0x3dcd01+_0x3629e1(0x2ce));_0x28987d&&(_0x37853c[_0x3629e1(0x1e1)]=_0x3629e1(0x2ac),_0x37853c[_0x3629e1(0x292)]=_0x28987d,delete _0x37853c[_0x3629e1(0x289)],delete _0x37853c[_0x3629e1(0x236)],_0x231f24[_0x3629e1(0x1ff)]!==undefined&&(_0x37853c['conditionTimeoutDuration']=_0x231f24['conditionTimeoutDuration']),_0x231f24['conditionTimeoutUnit']&&(_0x37853c[_0x3629e1(0x21e)]=_0x231f24[_0x3629e1(0x21e)]));}if(_0x231f24[_0x3629e1(0x2c9)]){const _0x3fac33=_0x231f24[_0x3629e1(0x2c9)]['some'](_0x2818cc=>_0x2818cc['segmentId']&&isPendingSegmentId(_0x2818cc['segmentId']));if(_0x3fac33){const _0xd1b3f=_0x231f24[_0x3629e1(0x2c9)][_0x3629e1(0x201)](_0x1a23b2=>{const _0x5631b1=_0x3629e1;if(_0x1a23b2[_0x5631b1(0x26d)]&&isPendingSegmentId(_0x1a23b2[_0x5631b1(0x26d)])){const _0x845f72=_0x5192dd(_0x1a23b2[_0x5631b1(0x26d)],_0x5631b1(0x1f3)+_0x3dcd01+_0x5631b1(0x2ce));return{..._0x1a23b2,'segmentId':_0x845f72||_0x1a23b2[_0x5631b1(0x26d)]};}return{..._0x1a23b2};});_0x37853c[_0x3629e1(0x1e1)]=_0x3629e1(0x2ac),_0x37853c[_0x3629e1(0x2c9)]=_0xd1b3f,delete _0x37853c[_0x3629e1(0x289)],delete _0x37853c[_0x3629e1(0x236)],delete _0x37853c[_0x3629e1(0x292)],delete _0x37853c[_0x3629e1(0x1ff)],delete _0x37853c[_0x3629e1(0x21e)];}}}function stripPendingIds(_0x17d507){const _0x4242d8=a169_0x12f8f2;_0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x2c1)]?.[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x2c1)]['segmentId'])&&delete _0x17d507[_0x4242d8(0x2c5)]['goal'];for(const _0x52c4b4 of _0x17d507[_0x4242d8(0x2c5)][_0x4242d8(0x238)]||[]){_0x52c4b4['entryCriteria']?.[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x52c4b4[_0x4242d8(0x29c)]['segmentId'])&&delete _0x52c4b4[_0x4242d8(0x29c)];_0x52c4b4['milestone']?.['segmentId']&&isPendingSegmentId(_0x52c4b4[_0x4242d8(0x1e2)]['segmentId'])&&delete _0x52c4b4['milestone'];_0x52c4b4[_0x4242d8(0x277)]&&(_0x52c4b4[_0x4242d8(0x277)]=_0x52c4b4['exitCriterias'][_0x4242d8(0x2af)](_0x1b85a3=>!_0x1b85a3[_0x4242d8(0x26d)]||!isPendingSegmentId(_0x1b85a3['segmentId'])));if(_0x52c4b4[_0x4242d8(0x2b0)])for(const _0x13efaa of Object[_0x4242d8(0x1d2)](_0x52c4b4[_0x4242d8(0x2b0)])){const _0x43f8dd=_0x52c4b4[_0x4242d8(0x2b0)][_0x13efaa];_0x43f8dd[_0x4242d8(0x1d7)]===_0x4242d8(0x20b)&&_0x43f8dd['journeyActivationStepId']&&isPendingActivationId(_0x43f8dd[_0x4242d8(0x290)])&&(_0x43f8dd[_0x4242d8(0x290)]='');if(_0x43f8dd['type']===_0x4242d8(0x25b)&&_0x43f8dd[_0x4242d8(0x1ee)])for(const _0x18a271 of _0x43f8dd['branches']){_0x18a271[_0x4242d8(0x26d)]&&isPendingSegmentId(_0x18a271[_0x4242d8(0x26d)])&&(_0x18a271[_0x4242d8(0x26d)]='');}_0x43f8dd['type']===_0x4242d8(0x1d0)&&stripWaitStepPendingIds(_0x43f8dd);}}}function resolvePendingIdsInRequest(_0x37f5cb,_0x47302a,_0xc618da,_0x4951c4,_0x2e6ccd,_0x1b2672){const _0x48e770=a169_0x12f8f2,_0x4c9611=(_0x4124b0,_0x3831ef)=>{if(!isPendingSegmentId(_0x4124b0))return _0x4124b0;const _0x52939f=extractPendingSegmentName(_0x4124b0),_0x4d66fb=_0x4951c4['get'](_0x52939f);return!_0x4d66fb&&_0x1b2672['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x52939f+'\x27\x20for\x20'+_0x3831ef),_0x4d66fb;};if(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)]?.[_0x48e770(0x26d)]&&isPendingSegmentId(_0x37f5cb['attributes']['goal'][_0x48e770(0x26d)])){const _0xfa468d=_0x4c9611(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)][_0x48e770(0x26d)],_0x48e770(0x2ca));_0xfa468d&&(_0x37f5cb[_0x48e770(0x2c5)][_0x48e770(0x2c1)]['segmentId']=_0xfa468d);}for(const _0x397199 of _0x37f5cb['attributes'][_0x48e770(0x238)]||[]){const _0x22c2b0=_0xc618da[_0x48e770(0x1d3)](_0x397199['name'][_0x48e770(0x21d)]());_0x22c2b0&&(_0x397199['id']=_0x22c2b0);if(_0x397199[_0x48e770(0x29c)]?.['segmentId']&&isPendingSegmentId(_0x397199[_0x48e770(0x29c)][_0x48e770(0x26d)])){const _0x45787b=_0x4c9611(_0x397199[_0x48e770(0x29c)][_0x48e770(0x26d)],_0x48e770(0x1f3)+_0x397199[_0x48e770(0x2a4)]+_0x48e770(0x1fe));_0x45787b&&(_0x397199['entryCriteria']['segmentId']=_0x45787b);}if(_0x397199[_0x48e770(0x277)])for(const _0x2fd0f0 of _0x397199['exitCriterias']){if(_0x2fd0f0[_0x48e770(0x26d)]&&isPendingSegmentId(_0x2fd0f0[_0x48e770(0x26d)])){const _0x135320=_0x4c9611(_0x2fd0f0['segmentId'],'stage\x20\x27'+_0x397199[_0x48e770(0x2a4)]+'\x27\x20exit\x20criteria');_0x135320&&(_0x2fd0f0[_0x48e770(0x26d)]=_0x135320);}}if(_0x397199[_0x48e770(0x1e2)]?.['segmentId']&&isPendingSegmentId(_0x397199[_0x48e770(0x1e2)]['segmentId'])){const _0x827564=_0x4c9611(_0x397199['milestone'][_0x48e770(0x26d)],_0x48e770(0x1f3)+_0x397199[_0x48e770(0x2a4)]+'\x27\x20milestone');_0x827564&&(_0x397199[_0x48e770(0x1e2)][_0x48e770(0x26d)]=_0x827564);}if(_0x397199[_0x48e770(0x2b0)]){const _0x66765b=_0x4f6175=>_0x47302a[_0x48e770(0x2c5)][_0x48e770(0x238)]?.[_0x48e770(0x1f8)](_0x1b5811=>_0x1b5811['name'][_0x48e770(0x21d)]()===_0x397199[_0x48e770(0x2a4)][_0x48e770(0x21d)]())?.[_0x48e770(0x2b0)]?.[_0x4f6175];for(const _0x5d9109 of Object[_0x48e770(0x1d2)](_0x397199[_0x48e770(0x2b0)])){const _0x19decf=_0x397199[_0x48e770(0x2b0)][_0x5d9109],_0x13176b=_0x66765b(_0x5d9109);if(_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x20b)&&_0x19decf[_0x48e770(0x290)]&&(isPendingActivationId(_0x19decf['journeyActivationStepId'])||_0x19decf[_0x48e770(0x290)]==='')){if(_0x13176b?.['journeyActivationStepId']&&isPendingActivationId(_0x13176b[_0x48e770(0x290)])){const _0x229c72=extractPendingActivationName(_0x13176b[_0x48e770(0x290)]),_0x46f786=_0x2e6ccd[_0x48e770(0x1d3)](_0x229c72);_0x46f786&&(_0x19decf[_0x48e770(0x290)]=_0x46f786);}}if(_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x25b)&&_0x19decf[_0x48e770(0x1ee)]&&_0x13176b?.[_0x48e770(0x1ee)])for(let _0x174822=0x0;_0x174822<_0x19decf[_0x48e770(0x1ee)][_0x48e770(0x295)];_0x174822++){const _0x5cee04=_0x19decf[_0x48e770(0x1ee)][_0x174822],_0x4d8671=_0x13176b[_0x48e770(0x1ee)][_0x174822];if(_0x4d8671?.[_0x48e770(0x26d)]&&isPendingSegmentId(_0x4d8671['segmentId'])){const _0x4d4d10=_0x4c9611(_0x4d8671[_0x48e770(0x26d)],'stage\x20\x27'+_0x397199[_0x48e770(0x2a4)]+_0x48e770(0x2b8)+(_0x5cee04['name']||_0x174822)+'\x27');_0x4d4d10&&(_0x5cee04[_0x48e770(0x26d)]=_0x4d4d10);}}_0x19decf[_0x48e770(0x1d7)]===_0x48e770(0x1d0)&&_0x13176b?.['type']===_0x48e770(0x1d0)&&resolveWaitStepPendingIds(_0x19decf,_0x13176b,_0x4c9611,_0x397199['name']);}}}}
1
+ const a172_0x504867=a172_0xbe52;(function(_0x41af4c,_0x3cb1e2){const _0xdb2a56=a172_0xbe52,_0x48fcf0=_0x41af4c();while(!![]){try{const _0x46cbb4=-parseInt(_0xdb2a56(0x109))/0x1*(-parseInt(_0xdb2a56(0xc0))/0x2)+-parseInt(_0xdb2a56(0x102))/0x3*(parseInt(_0xdb2a56(0xf1))/0x4)+parseInt(_0xdb2a56(0x125))/0x5+-parseInt(_0xdb2a56(0x9d))/0x6+parseInt(_0xdb2a56(0x162))/0x7+parseInt(_0xdb2a56(0x6f))/0x8+-parseInt(_0xdb2a56(0xe9))/0x9*(parseInt(_0xdb2a56(0xe7))/0xa);if(_0x46cbb4===_0x3cb1e2)break;else _0x48fcf0['push'](_0x48fcf0['shift']());}catch(_0x23a750){_0x48fcf0['push'](_0x48fcf0['shift']());}}}(a172_0x113d,0x4e304));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a172_0x504867(0xcb);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x5d1a6c){return''+PENDING_SEGMENT_PREFIX+_0x5d1a6c+'__';}export function isPendingSegmentId(_0x120d24){const _0x35de34=a172_0x504867;return _0x120d24[_0x35de34(0x155)](PENDING_SEGMENT_PREFIX)&&!_0x120d24[_0x35de34(0x155)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x45791b){const _0x301968=a172_0x504867;return _0x45791b[_0x301968(0x15b)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xf75d7b){return''+PENDING_ACTIVATION_PREFIX+_0xf75d7b+'__';}export function isPendingActivationId(_0x2ab0e2){return _0x2ab0e2['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x49bc8d){return _0x49bc8d['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x37a906,_0xe29388){const _0x53e9cf=a172_0x504867,_0x1fa31e=_0x37a906+'::'+(_0xe29388[_0x53e9cf(0xbb)]()||_0x53e9cf(0x165)),_0xe022d5=createHash(_0x53e9cf(0xbc))[_0x53e9cf(0xc3)](_0x1fa31e)['digest']('hex')[_0x53e9cf(0x91)](0x0,0xc);return _0x53e9cf(0xb2)+_0xe022d5;}export function ensureJourneyDefaults(_0x423a92){const _0x2e2fa6=a172_0x504867;!_0x423a92[_0x2e2fa6(0xfa)]&&(_0x423a92[_0x2e2fa6(0xfa)]=''),!_0x423a92[_0x2e2fa6(0x154)]&&(_0x423a92[_0x2e2fa6(0x154)]=_0x2e2fa6(0x163));}export function injectExistingStageIds(_0x40cff1,_0x191734){const _0x5ce3eb=a172_0x504867,_0x1d0396=new Map(_0x191734['map'](_0x391dad=>[_0x391dad[_0x5ce3eb(0xa2)],_0x391dad['id']]));for(const _0xa2f4c3 of _0x40cff1){if(!_0xa2f4c3['id']){const _0x217890=_0x1d0396[_0x5ce3eb(0x153)](_0xa2f4c3[_0x5ce3eb(0xa2)]);_0x217890&&(_0xa2f4c3['id']=_0x217890);}}}export function resolveTDFolderPath(_0x2da9d9,_0x54f2ed,_0x4a622a){const _0x32bd4c=a172_0x504867;if(!_0x54f2ed)return _0x2da9d9;if(_0x2da9d9===_0x4a622a||_0x2da9d9[_0x32bd4c(0x155)](_0x4a622a+'/'))return _0x2da9d9;return _0x2da9d9?_0x4a622a+'/'+_0x2da9d9:_0x4a622a;}export function addFoldersToCreate(_0x134ae0,_0x506bfe,_0x3028ba){const _0xf126f9=a172_0x504867;if(!_0x134ae0)return;if(_0x506bfe[_0xf126f9(0xff)](_0x134ae0))return;const _0x3fcf18=_0x134ae0[_0xf126f9(0x145)]('/');let _0x5315e1='';for(const _0x261f32 of _0x3fcf18){_0x5315e1=_0x5315e1?_0x5315e1+'/'+_0x261f32:_0x261f32,!_0x506bfe[_0xf126f9(0xff)](_0x5315e1)&&_0x3028ba['add'](_0x5315e1);}}export function sortFoldersByDepth(_0x16e424){const _0x5bce84=a172_0x504867;return[..._0x16e424][_0x5bce84(0xb5)]((_0x29398a,_0x38f770)=>{const _0x59f3a7=_0x5bce84,_0x3edfa7=(_0x29398a[_0x59f3a7(0x9e)](/\//g)||[])[_0x59f3a7(0xdc)],_0x5b93f7=(_0x38f770[_0x59f3a7(0x9e)](/\//g)||[])[_0x59f3a7(0xdc)];return _0x3edfa7-_0x5b93f7;});}import*as a172_0x42c49c from'yaml';import{readFileSync}from'fs';import a172_0x5b835a from'path';import{isJourneyDef,parseYamlString as a172_0x58880,toYamlString as a172_0x37f0cf,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';function a172_0x113d(){const _0x455c13=['getSegmentEntity','embedded_segment_creating','toISOString','DecisionPoint','entry_criteria','trim','sha1','activationParams','journeyById','isNew','60TiDHNr','notification','createActivation','update','./journey-yaml.js','ACTIVATION_UPDATE_ERROR','resolveSegment','Updating\x20segment\x20\x27','delete','keys','\x20(referenced\x20in\x20journey\x20','__pending_','null','activation_updating','embeddedSegmentNameToId','segmentId','reduce','data','activations','conditionTimeoutUnit','debug','add','day','Failed\x20to\x20resolve\x20segment\x20','utf-8','schedule','nameToId','fetchJourney','length','type','Created\x20activation\x20\x27','journeyActivationStepId','all_columns','Duration','folderPath','Created\x20journey\x20\x27','size','SEGMENT_UPDATE_ERROR','waitStepUnit','10lAtUJS','with','6769017QmJqHJ','activationStepsById','dirname','connectionIdToNameMap','onProgress','withProgress',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','stage\x20\x27','4qJHwQM','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journey_creating','segment_updating','Entry\x20criteria:\x20','validatedRequest','segmentNameToId','entries','folderId','description','rule','Deleted\x20segment\x20\x27','map','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','has','existingJourney','join','1059546zsriwB','NOT_FOUND','idToName','Name\x20has\x20already\x20been\x20taken','list','parentId','create','9443uxTwzL','Updated\x20activation\x20\x27','connector_config','segment_creating','folder_created','idToEmailMap','Failed\x20to\x20resolve\x20activation\x20','SEGMENT_NOT_FOUND','results','segment_created','logDeleted','activation_template_id','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','behavior','nameToType','branches','find','connection','exitCriterias','journey_updated','conditionTimeoutDuration','goal','Created\x20folder\x20\x27','getJourney','\x0a\x20\x20','parentSegmentFolder','ACTIVATION_SYNTAX_ERROR',').\x20','2556315UtOauA','\x27...','logWarning','journeyId','set','folderPathToId','activation_deleted','\x20segment\x20from\x20file:\x20','existingSegments','Creating\x20activation\x20\x27','Journey\x20\x27','journeyActivationNameToId','journeyBundlesByFolderAndName','rootFolderId','isArray','run_after_journey_refresh','Segment\x20not\x20found:\x20','buildUserMaps','activation_created','logSuccess','activation_updated','some','stringify','Activation\x20not\x20found:\x20','activation_creating','):\x20','\x27\x20for\x20','../../utils/async.js','.$1.push-recovery.json','push','segmentFolderId','flatMap','split','journeyBundleId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','toString','getSegment','uniqueServerName','progress','Delete\x20the\x20push\x20recovery\x20file\x20(','\x27\x20wait\x20condition','journeyStages','created','segments','yamlActivation','entry','get','state','startsWith','journeys','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','behaviors','entryCriteria','and\x20the\x20server\x20segment,\x20then\x20retry.','replace','from','journeyBundleName','Created\x20segment\x20\x27','versionNumber','steps','getActivation','2966054nJxbZc','draft','waitStep','segment','max','getSegment\x20failed\x20for\x20','activationsBySegmentId','parseDocument','conditions','Activation','WaitStep','embedded_segment_created','localName','4026440yamdAU','Fetching\x20','absolutePath','updated','updateSegmentById','existingSegment','all','createdSegmentId','Segment\x20not\x20found','getSegmentEntity\x20also\x20failed\x20for\x20','Creating\x20folder\x20\x27','Updated\x20segment\x20\x27','\x27\x20to\x20local\x20\x27','embedded_activation_creating','uniqueSegmentName','\x27\x20decision\x20point\x20branch\x20\x27','createdSegmentIds','Stage\x20\x27','relationships','journey','kind','embedded_activation_created','Creating\x20segment\x20\x27','resolveJourneyId','valid','existingActivation','columns','waitStepType','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','diff','toLowerCase','journey_created','\x27\x20milestone','INTERNAL','slice','parse','conditionSegmentId','action','segmentByFolderAndName','Matched\x20server\x20segment\x20\x27','relative','Condition','deps','logInfo','folder','Failed\x20to\x20fetch\x20referenced\x20segment\x20','1776150Ujvqba','match','attributes','\x27\x20not\x20found\x20in\x20journey\x20\x27','Deleting\x20activation\x20\x27','name','createSegment','hasChanges','filter','Failed\x20to\x20','Updated\x20journey\x20\x27','yamlConfig','createJourneySegment','item','journeyName','resolvedRule','deleted','effectiveFolderId','activationActions','Deleted\x20activation\x20\x27','milestone','journey_entry_criteria_','index','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','sort'];a172_0x113d=function(){return _0x455c13;};return a172_0x113d();}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(_0x26c037){const _0x24f34c=a172_0x504867;if(Array[_0x24f34c(0x133)](_0x26c037))return'['+_0x26c037['map'](_0x5eb86c=>stableStringify(_0x5eb86c))['join'](',')+']';if(_0x26c037&&typeof _0x26c037==='object'){const _0x442d17=_0x26c037,_0x493868=Object['keys'](_0x442d17)[_0x24f34c(0xb5)](),_0x4b391a=_0x493868[_0x24f34c(0xfd)](_0x1e52de=>'\x22'+_0x1e52de+'\x22:'+stableStringify(_0x442d17[_0x1e52de]));return'{'+_0x4b391a[_0x24f34c(0x101)](',')+'}';}const _0x45cf27=JSON[_0x24f34c(0x13b)](_0x26c037);return _0x45cf27===undefined?_0x24f34c(0xcc):_0x45cf27;}function activationSignature(_0x282047){const _0x309502=a172_0x504867,_0x2a8832={'connection':_0x282047[_0x309502(0x11a)],..._0x282047['all_columns']!==undefined&&{'all_columns':_0x282047[_0x309502(0xe0)]},..._0x282047[_0x309502(0x89)]!==undefined&&{'columns':_0x282047[_0x309502(0x89)]},..._0x282047[_0x309502(0x116)]!==undefined&&{'behavior':_0x282047['behavior']},..._0x282047[_0x309502(0x158)]!==undefined&&{'behaviors':_0x282047[_0x309502(0x158)]},..._0x282047[_0x309502(0xd9)]!==undefined&&{'schedule':_0x282047[_0x309502(0xd9)]},..._0x282047['notification']!==undefined&&{'notification':_0x282047[_0x309502(0xc1)]},..._0x282047[_0x309502(0x10b)]!==undefined&&{'connector_config':_0x282047[_0x309502(0x10b)]},..._0x282047[_0x309502(0x114)]!==undefined&&{'activation_template_id':_0x282047[_0x309502(0x114)]}};return stableStringify(_0x2a8832);}async function fetchSegment(_0x39f158,_0x3b231e,_0x5c3cbd,_0xb048ab){const _0x1b2212=a172_0x504867,_0x30b148=_0xb048ab?.[_0x1b2212(0x119)](_0x3c299f=>_0x3c299f['id']===_0x5c3cbd);if(_0x30b148)return _0x30b148;try{return await _0x39f158['segment'][_0x1b2212(0x149)](_0x3b231e,_0x5c3cbd);}catch(_0x39e205){logger[_0x1b2212(0xd4)](_0x1b2212(0x67)+_0x5c3cbd+_0x1b2212(0xef)+_0x39e205);try{return await _0x39f158[_0x1b2212(0x165)][_0x1b2212(0xb6)](_0x5c3cbd);}catch(_0x525c7b){return logger[_0x1b2212(0xd4)](_0x1b2212(0x78)+_0x5c3cbd+':\x20'+_0x525c7b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x634e30,_0x44f232,_0x13123f){const _0xdbcd9e=a172_0x504867,_0x3a5311=readPushRecovery(_0x634e30['absolutePath']);if(_0x3a5311?.[_0xdbcd9e(0xab)]===_0x634e30['yamlConfig']['name'])for(const [_0x3a553b,_0x1f14f9]of Object['entries'](_0x3a5311[_0xdbcd9e(0x150)])){const _0x170be1=generateDeterministicJourneySegmentName(_0x634e30[_0xdbcd9e(0xa8)][_0xdbcd9e(0xa2)],_0x3a553b);_0x1f14f9[_0xdbcd9e(0x14a)]===_0x170be1&&(_0x44f232[_0xdbcd9e(0x129)](_0x3a553b,_0x1f14f9['segmentId']),_0x13123f[_0xdbcd9e(0x129)](_0x3a553b,_0x1f14f9[_0xdbcd9e(0xcf)]));}}async function createOrRecoverEmbeddedSegment(_0x2c67ac,_0x2091a0,_0x4e1343,_0x4aab81){const _0x2e8f10=a172_0x504867;let _0x63abd2;try{_0x63abd2=await _0x2c67ac[_0x2e8f10(0x165)][_0x2e8f10(0xa9)]({'name':_0x4e1343['uniqueSegmentName'],'description':_0x4e1343['description'],'journeyId':_0x4e1343[_0x2e8f10(0x128)],'rule':_0x4aab81(_0x4e1343[_0x2e8f10(0xac)],!![]),'countPopulation':!![],'parentFolderId':_0x4e1343[_0x2e8f10(0xf9)],'audienceId':_0x4e1343[_0x2e8f10(0x107)]});}catch(_0x3e80ac){const _0x49f3e5=_0x3e80ac instanceof Error&&_0x3e80ac['message']['includes'](_0x2e8f10(0x105));if(_0x49f3e5){const _0x1a1159=readPushRecovery(_0x2091a0['absolutePath']),_0x37c34c=_0x1a1159?.[_0x2e8f10(0xab)]===_0x2091a0['yamlConfig'][_0x2e8f10(0xa2)]?_0x1a1159[_0x2e8f10(0x150)][_0x4e1343['localName']]:undefined;if(_0x37c34c?.[_0x2e8f10(0x14a)]===_0x4e1343[_0x2e8f10(0x7d)])await _0x2c67ac[_0x2e8f10(0x165)][_0x2e8f10(0x73)](_0x4e1343[_0x2e8f10(0x107)],_0x37c34c[_0x2e8f10(0xcf)],{'description':_0x4e1343[_0x2e8f10(0xfa)],'rule':_0x4aab81(_0x4e1343[_0x2e8f10(0xac)],!![]),'countPopulation':!![]}),_0x63abd2=_0x37c34c[_0x2e8f10(0xcf)];else throw new SDKError(ErrorCode[_0x2e8f10(0xe5)],'Embedded\x20segment\x20\x27'+_0x4e1343[_0x2e8f10(0x6e)]+_0x2e8f10(0xfe)+(_0x2e8f10(0x14c)+_0x2091a0[_0x2e8f10(0x71)][_0x2e8f10(0x15b)](/([^/]+)$/,_0x2e8f10(0x141))+')\x20')+_0x2e8f10(0x15a),_0x3e80ac);}else throw _0x3e80ac;}return saveSegmentToPushRecovery(_0x2091a0[_0x2e8f10(0x71)],_0x2091a0['yamlConfig']['name'],_0x4e1343[_0x2e8f10(0x6e)],{'segmentId':_0x63abd2,'uniqueServerName':_0x4e1343[_0x2e8f10(0x7d)],'createdAt':new Date()[_0x2e8f10(0xb8)]()}),_0x63abd2;}export async function prepareSegmentFiles(_0x22e0ae,_0x3edd67,_0x1a3317,_0x2ee24c,_0x20288e){const _0x318153=a172_0x504867,{activationDefToCreateRequest:_0x2ace95}=await import('./child-segment-yaml.js'),_0xb1a1f=[],_0x1e9e63=new Set();for(const {yamlConfig:_0x115dd3,folderPath:_0x19855e,sourcePath:_0x2af658}of _0x22e0ae){const _0x4ae518=resolveTDFolderPath(_0x19855e,_0x2ee24c,_0x20288e),_0x81e0ef=_0x4ae518+':'+_0x115dd3[_0x318153(0xa2)],_0x22fcf8=_0x3edd67[_0x318153(0x95)][_0x318153(0x153)](_0x81e0ef),_0x53699c=_0x22fcf8?_0x3edd67[_0x318153(0x68)][_0x318153(0x153)](_0x22fcf8['id'])||[]:[];addFoldersToCreate(_0x4ae518,_0x3edd67[_0x318153(0x12a)],_0x1e9e63);const _0x2aebad=calculateActivationActions(_0x115dd3[_0x318153(0xd2)]||[],_0x53699c,_0x3edd67['idToEmailMap'],_0x3edd67[_0x318153(0xec)]);for(const _0x53d247 of _0x2aebad){(_0x53d247[_0x318153(0xdd)]==='create'||_0x53d247['type']===_0x318153(0xc3))&&_0x53d247['yamlActivation']&&(_0x53d247[_0x318153(0xf6)]=await _0x2ace95(_0x53d247[_0x318153(0x151)],_0x1a3317));}const _0x13bfdb=calculateSegmentDiff(_0x115dd3,_0x22fcf8,_0x53699c,_0x3edd67[_0x318153(0x10e)],_0x3edd67['connectionIdToNameMap']);_0xb1a1f[_0x318153(0x142)]({'relativePath':_0x115dd3[_0x318153(0xa2)],'absolutePath':_0x2af658,'yamlConfig':_0x115dd3,'folderPath':_0x4ae518,'existingSegment':_0x22fcf8,'existingActivations':_0x53699c,'isNew':_0x13bfdb[_0x318153(0xbf)],'hasChanges':_0x13bfdb[_0x318153(0xa4)],'diff':_0x13bfdb[_0x318153(0x8c)],'activationActions':_0x2aebad});}return{'segmentFiles':_0xb1a1f,'foldersToCreate':_0x1e9e63};}export async function prepareJourneyFiles(_0x3ea4ab,_0x2e9e29,_0x41e4c3,_0x3434de){const _0x456b2c=a172_0x504867,_0x276b6a=[],_0x1a6708=new Set();for(const {yamlConfig:_0x195bc2,folderPath:_0x47c91d,sourcePath:_0x1b47cf}of _0x3ea4ab){const _0x43b0fe=resolveTDFolderPath(_0x47c91d,_0x41e4c3,_0x3434de),_0x5070bf=_0x43b0fe+':'+_0x195bc2[_0x456b2c(0xa2)],_0x4b2d5d=_0x2e9e29[_0x456b2c(0x131)][_0x456b2c(0x153)](_0x5070bf);let _0x1984e7,_0x4950b7;if(_0x4b2d5d&&_0x4b2d5d[_0x456b2c(0xdc)]>0x0){const _0x222718=buildLocalExpandedRuleMappings(_0x195bc2),{createYamlContext:_0x2a73b5,prefetchJourneySegments:_0x2d8c09}=createPushYamlContextForBundle(_0x2e9e29[_0x456b2c(0x99)],_0x2e9e29[_0x456b2c(0x107)],_0x2e9e29[_0x456b2c(0x12d)],_0x222718,_0x2e9e29[_0x456b2c(0x10e)],_0x2e9e29['connectionIdToNameMap'],_0x2e9e29[_0x456b2c(0xea)],_0x2e9e29[_0x456b2c(0xbe)]);await _0x2d8c09(_0x4b2d5d[_0x456b2c(0xfd)](_0x16b5d9=>_0x16b5d9['id']));const _0x30bf67=await _0x2e9e29['deps'][_0x456b2c(0x82)]['getLatestJourneyId'](_0x4b2d5d[0x0][_0x456b2c(0x146)]),_0x56f99f=hasMultipleVersions(_0x195bc2),_0x4618d2=async _0x3883de=>{const _0x3aff03=_0x456b2c,_0x2f5a32=_0x2e9e29[_0x3aff03(0xbe)]?.[_0x3aff03(0x153)](_0x3883de);if(_0x2f5a32)return _0x2f5a32;return _0x2e9e29[_0x3aff03(0xdb)]({'journeyId':_0x3883de,'journeyName':_0x195bc2[_0x3aff03(0xa2)],'isMultiVersion':_0x4b2d5d[_0x3aff03(0xdc)]>0x1});};if(_0x56f99f&&_0x4b2d5d['length']>0x1){const _0x5a5558=[];for(const _0x5a5195 of _0x4b2d5d){const _0x4c8b1c=_0x5a5195[_0x456b2c(0x15f)]||0x1;_0x2e9e29[_0x456b2c(0x14b)]?.[_0x456b2c(0xc3)]('Fetching\x20'+_0x195bc2[_0x456b2c(0xa2)]+'\x20v'+_0x4c8b1c);const _0x325a16=await _0x4618d2(_0x5a5195['id']),_0xcfc8a0=_0x2a73b5(_0x5a5195['id']),_0x519cd6=await journeyResponseToDef(_0x325a16,_0xcfc8a0);_0x5a5558[_0x456b2c(0x142)]({'item':_0x5a5195,'yaml':_0x519cd6});}const _0x151124=buildLocalRuleToNameMappingFromJourney(_0x195bc2);_0x4950b7=buildMergedJourneyDef(_0x5a5558,_0x151124,_0x30bf67);const _0x5e267c=Math[_0x456b2c(0x66)](..._0x5a5558[_0x456b2c(0xfd)](_0x524a0d=>_0x524a0d[_0x456b2c(0xaa)][_0x456b2c(0x15f)]||0x0)),_0x23c624=_0x4b2d5d[_0x456b2c(0x119)](_0xa35d3d=>(_0xa35d3d['versionNumber']||0x0)===_0x5e267c);_0x23c624&&(_0x2e9e29['progress']?.[_0x456b2c(0xc3)](_0x456b2c(0x70)+_0x195bc2[_0x456b2c(0xa2)]+'\x20v'+_0x5e267c),_0x1984e7=await _0x4618d2(_0x23c624['id']));}else{const _0x411b32=_0x4b2d5d[_0x4b2d5d[_0x456b2c(0xdc)]-0x1];_0x2e9e29[_0x456b2c(0x14b)]?.[_0x456b2c(0xc3)](_0x456b2c(0x70)+_0x195bc2[_0x456b2c(0xa2)]),_0x1984e7=await _0x4618d2(_0x411b32['id']);const _0x294045=_0x2a73b5(_0x411b32['id']),_0x1102d9=await journeyResponseToDef(_0x1984e7,_0x294045),_0x36b7d0=buildLocalRuleToNameMappingFromJourney(_0x195bc2);_0x4950b7=buildMergedJourneyDef([{'item':_0x411b32,'yaml':_0x1102d9}],_0x36b7d0,_0x30bf67);}}addFoldersToCreate(_0x43b0fe,_0x2e9e29['folderPathToId'],_0x1a6708);const _0x49e868=calculateJourneyDiff(_0x195bc2,_0x4950b7);_0x276b6a[_0x456b2c(0x142)]({'relativePath':_0x195bc2[_0x456b2c(0xa2)],'absolutePath':_0x1b47cf,'yamlConfig':_0x195bc2,'folderPath':_0x43b0fe,'existingJourney':_0x1984e7,'isNew':_0x49e868[_0x456b2c(0xbf)],'hasChanges':_0x49e868[_0x456b2c(0xa4)],'diff':_0x49e868[_0x456b2c(0x8c)]});}return{'journeyFiles':_0x276b6a,'foldersToCreate':_0x1a6708};}export function calculateActivationActions(_0x89fbb8,_0x10a12a,_0x2fd489,_0x24d8c8){const _0x391692=a172_0x504867,_0x4c2031=[],_0x817e36=new Map();for(const _0x586ad7 of _0x10a12a){_0x817e36['set'](_0x586ad7[_0x391692(0xa2)],_0x586ad7);}const _0x32800c=new Map();for(const _0x134801 of _0x89fbb8){_0x32800c[_0x391692(0x129)](_0x134801['name'],_0x134801);}for(const _0x1887cf of _0x89fbb8){const _0x13270c=_0x817e36[_0x391692(0x153)](_0x1887cf[_0x391692(0xa2)]);if(!_0x13270c)_0x4c2031[_0x391692(0x142)]({'type':_0x391692(0x108),'name':_0x1887cf[_0x391692(0xa2)],'yamlActivation':_0x1887cf});else{const _0x29bd63=activationResponseToDef(_0x13270c,_0x2fd489,_0x24d8c8),_0x246c52=a172_0x42c49c[_0x391692(0x13b)](_0x29bd63),_0x3aa1ac=a172_0x42c49c[_0x391692(0x13b)](_0x1887cf);_0x246c52!==_0x3aa1ac&&_0x4c2031[_0x391692(0x142)]({'type':_0x391692(0xc3),'name':_0x1887cf[_0x391692(0xa2)],'yamlActivation':_0x1887cf,'existingActivation':_0x13270c});}}for(const _0x1deb17 of _0x10a12a){!_0x32800c[_0x391692(0xff)](_0x1deb17[_0x391692(0xa2)])&&_0x4c2031[_0x391692(0x142)]({'type':'delete','name':_0x1deb17['name'],'existingActivation':_0x1deb17});}return _0x4c2031;}function calculateYamlDiff(_0x463632,_0x10e9be){if(_0x10e9be){const _0xa46908=generateDiff(_0x10e9be,_0x463632),_0x52c97e=hasChanges(_0xa46908);return{'isNew':![],'hasChanges':_0x52c97e,'diff':_0x52c97e?formatDiffWithColors(_0xa46908):undefined};}const _0x51f296=generateDiff('',_0x463632);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x51f296)};}export function calculateSegmentDiff(_0x278ba9,_0x281e0b,_0x5372ad,_0x55b9b7,_0x21b5dd){const _0x76e7b0=segmentToYamlString(_0x278ba9),_0x1babe7=_0x281e0b?segmentToYamlString(segmentWithActivationsToYaml(_0x281e0b,_0x5372ad,undefined,_0x55b9b7,_0x21b5dd)):undefined;return calculateYamlDiff(_0x76e7b0,_0x1babe7);}export function calculateJourneyDiff(_0x392e84,_0x3f08f3){const _0x3f25c6=normalizeJourneyDef(_0x392e84,_0x392e84),_0x38a65e=a172_0x37f0cf(_0x3f25c6),_0x2f0156=_0x3f08f3?a172_0x37f0cf(normalizeJourneyDef(_0x3f08f3,_0x392e84)):undefined;return calculateYamlDiff(_0x38a65e,_0x2f0156);}export function findSegmentsToDelete(_0x5bdcb4,_0x1f2f72,_0x4cba65,_0x59a745,_0x56bcdc){const _0x5714e3=a172_0x504867,_0x4ab338=new Set();for(const {yamlConfig:_0x5133ae,folderPath:_0x1a8f44}of _0x1f2f72){_0x4ab338[_0x5714e3(0xd5)](_0x1a8f44+':'+_0x5133ae['name']);}return _0x5bdcb4[_0x5714e3(0xa5)](_0x33f3cc=>{const _0xfbade6=_0x5714e3,_0x353037=_0x33f3cc[_0xfbade6(0x143)]?_0x4cba65[_0xfbade6(0x153)](_0x33f3cc['segmentFolderId'][_0xfbade6(0x148)]())||'':'',_0x354e13=_0x353037+':'+_0x33f3cc[_0xfbade6(0xa2)];if(_0x4ab338[_0xfbade6(0xff)](_0x354e13))return![];if(_0x56bcdc)return _0x353037===_0x59a745||_0x353037['startsWith'](_0x59a745+'/');return!![];});}export function findJourneysToDelete(_0x30552c,_0x13e4ec,_0x392820,_0x30460c,_0x4a5213){const _0xb4d1d1=a172_0x504867,_0x5e0aca=new Set();for(const {yamlConfig:_0x6a47be,folderPath:_0x4a8a6f}of _0x13e4ec){_0x5e0aca[_0xb4d1d1(0xd5)](_0x4a8a6f+':'+_0x6a47be[_0xb4d1d1(0xa2)]);}return _0x30552c['filter'](_0x352645=>{const _0x1b8c8a=_0xb4d1d1,_0x55e741=_0x352645['folderId']?_0x392820['get'](_0x352645[_0x1b8c8a(0xf9)])||'':'',_0xef178f=_0x55e741+':'+_0x352645[_0x1b8c8a(0x15d)];if(_0x5e0aca[_0x1b8c8a(0xff)](_0xef178f))return![];if(_0x4a5213)return _0x55e741===_0x30460c||_0x55e741[_0x1b8c8a(0x155)](_0x30460c+'/');return!![];});}export function buildSegmentLookupMap(_0xa7c10f,_0xbc5d08){const _0x5c9455=a172_0x504867,_0x1cd6f4=new Map();for(const _0x5bf347 of _0xa7c10f){const _0x3b781d=_0x5bf347[_0x5c9455(0x143)]?_0xbc5d08[_0x5c9455(0x153)](_0x5bf347[_0x5c9455(0x143)][_0x5c9455(0x148)]())||'':'',_0x345070=_0x3b781d+':'+_0x5bf347[_0x5c9455(0xa2)];_0x1cd6f4['set'](_0x345070,_0x5bf347);}return _0x1cd6f4;}export function buildSegmentNameToIdMap(_0xdfb1ef){const _0x536fad=a172_0x504867,_0x50b84c=new Map();for(const _0x349969 of _0xdfb1ef){_0x50b84c[_0x536fad(0x129)](_0x349969[_0x536fad(0xa2)],_0x349969['id']);}return _0x50b84c;}export function buildJourneyBundleLookupMap(_0x4b0bf4,_0x2bd03e){const _0x17f1b5=a172_0x504867,_0x4a8479=new Map();for(const _0x5526c8 of _0x4b0bf4){const _0xa8e91b=_0x5526c8[_0x17f1b5(0xf9)]?_0x2bd03e['get'](_0x5526c8[_0x17f1b5(0xf9)])||'':'',_0x1593bc=_0xa8e91b+':'+_0x5526c8[_0x17f1b5(0x15d)];!_0x4a8479[_0x17f1b5(0xff)](_0x1593bc)&&_0x4a8479['set'](_0x1593bc,[]),_0x4a8479[_0x17f1b5(0x153)](_0x1593bc)['push'](_0x5526c8);}for(const _0x1d72f3 of _0x4a8479['values']()){_0x1d72f3[_0x17f1b5(0xb5)]((_0xef221b,_0x50499b)=>(_0xef221b[_0x17f1b5(0x15f)]||0x0)-(_0x50499b[_0x17f1b5(0x15f)]||0x0));}return _0x4a8479;}export function collectFoldersToCreate(_0x2254a1,_0x67fc69){const _0x1642ad=a172_0x504867,_0x467238=new Set();for(const _0x159ca2 of _0x2254a1){if(!_0x159ca2)continue;if(_0x67fc69[_0x1642ad(0xff)](_0x159ca2))continue;const _0xeed612=_0x159ca2[_0x1642ad(0x145)]('/');let _0xf54432='';for(const _0xafaa7b of _0xeed612){_0xf54432=_0xf54432?_0xf54432+'/'+_0xafaa7b:_0xafaa7b,!_0x67fc69[_0x1642ad(0xff)](_0xf54432)&&_0x467238[_0x1642ad(0xd5)](_0xf54432);}}return _0x467238;}export function parseAndClassifyYamlFiles(_0x170ce1,_0x322bfd,_0x1aa2fb){const _0x421384=a172_0x504867,_0x7d236=[],_0x53732b=[];for(const _0x57e6c8 of _0x170ce1){const _0x3893d3=a172_0x5b835a[_0x421384(0x97)](_0x322bfd,a172_0x5b835a[_0x421384(0xeb)](_0x57e6c8)),_0x191449=_0x3893d3==='.'?'':_0x3893d3[_0x421384(0x15b)](/\\/g,'/'),_0x13884c=readFileSync(_0x57e6c8,'utf-8'),_0x3b70e6=a172_0x42c49c['parse'](_0x13884c);if(isJourneyDef(_0x3b70e6,_0x57e6c8)){const _0x39aabe=a172_0x58880(_0x13884c);_0x53732b[_0x421384(0x142)]({'yamlConfig':_0x39aabe,'folderPath':_0x191449,'sourcePath':_0x57e6c8});}else{if(!_0x1aa2fb?.['skipSegments']){const _0x2ddb08=parseSegmentYamlFile(_0x13884c),_0x42f66d=normalizeChildSegmentYaml(_0x2ddb08);_0x7d236[_0x421384(0x142)]({'yamlConfig':_0x42f66d,'folderPath':_0x191449,'sourcePath':_0x57e6c8});}}}return{'segments':_0x7d236,'journeys':_0x53732b};}function a172_0xbe52(_0x2157b0,_0x356b7f){_0x2157b0=_0x2157b0-0x66;const _0x113da9=a172_0x113d();let _0xbe525a=_0x113da9[_0x2157b0];return _0xbe525a;}export function validateParsedFiles(_0x2bce05,_0x294865){const _0x97fb40=a172_0x504867,_0x5c8810=[];for(const {yamlConfig:_0x1fabcb,sourcePath:_0x5c7fa5}of _0x2bce05[_0x97fb40(0x150)]){const _0x120e42=readFileSync(_0x5c7fa5,_0x97fb40(0xd8)),_0xb3b64f=a172_0x42c49c[_0x97fb40(0x69)](_0x120e42),_0x3ec4e8=validateSegmentDef(_0x1fabcb,{'source':_0x120e42,'document':_0xb3b64f},{'skipSchema':!![]});if(!_0x3ec4e8['valid']){const _0x5e6bc7=a172_0x5b835a[_0x97fb40(0x97)](_0x294865,_0x5c7fa5);_0x5c8810['push']({'filePath':_0x5e6bc7,'source':_0x120e42,'result':_0x3ec4e8,'isJourney':![]});}}for(const {yamlConfig:_0x28f072,sourcePath:_0x555ef3}of _0x2bce05[_0x97fb40(0x156)]){const _0x2f106d=readFileSync(_0x555ef3,_0x97fb40(0xd8)),_0x21bd4e=a172_0x42c49c[_0x97fb40(0x69)](_0x2f106d),_0x3b5ca3=validateJourneyDef(_0x28f072,{'source':_0x2f106d,'document':_0x21bd4e},{'skipSchema':!![]});if(!_0x3b5ca3[_0x97fb40(0x87)]){const _0x359a80=a172_0x5b835a[_0x97fb40(0x97)](_0x294865,_0x555ef3);_0x5c8810['push']({'filePath':_0x359a80,'source':_0x2f106d,'result':_0x3b5ca3,'isJourney':!![]});}}return _0x5c8810;}export function formatValidationErrors(_0x4213ab){const _0x18e50f=a172_0x504867,_0x402c8e=[];for(const {filePath:_0x8cf4a3,source:_0x2eb3ca,result:_0x377c4c,isJourney:_0x4b3df9}of _0x4213ab){const _0x58cc2b=_0x4b3df9?'journey':_0x18e50f(0x165);_0x402c8e[_0x18e50f(0x142)]('\x0a'+_0x8cf4a3+'\x20('+_0x58cc2b+_0x18e50f(0x13e)+_0x377c4c['errors'][_0x18e50f(0xdc)]+'\x20error(s)'),_0x402c8e[_0x18e50f(0x142)](formatValidationResult(_0x377c4c,_0x2eb3ca,_0x8cf4a3));}return _0x402c8e[_0x18e50f(0x101)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x190df7){const _0x5a8f7a=a172_0x504867,_0x331d78=new Set(),_0x47681a=new Map(),_0x2dfa5d=collectSegmentUsageCounts(_0x190df7);if(_0x190df7['segments'])for(const [_0x3b18e2,_0x924842]of Object[_0x5a8f7a(0xf8)](_0x190df7[_0x5a8f7a(0x150)])){_0x331d78[_0x5a8f7a(0xd5)](_0x3b18e2);if(_0x924842[_0x5a8f7a(0xfb)]){const _0x5a26fa=yamlRuleToApi(_0x924842[_0x5a8f7a(0xfb)]),_0x488d11=apiRuleToYaml(_0x5a26fa);_0x47681a[_0x5a8f7a(0x129)](_0x3b18e2,_0x488d11);}}const _0x3d2549=new Map();let _0x36e0cc=0x0;for(const [_0x1cc1aa,_0x248c9b]of _0x47681a){const _0x5e7b2f=serializeExpandedRule(_0x248c9b,_0x47681a),_0x3366ea=_0x3d2549[_0x5a8f7a(0x153)](_0x5e7b2f)||[];_0x3366ea['push']({'name':_0x1cc1aa,'index':_0x36e0cc}),_0x3d2549[_0x5a8f7a(0x129)](_0x5e7b2f,_0x3366ea),_0x36e0cc++;}const _0x195fdf=new Map();for(const [_0x36a285,_0x45e415]of _0x3d2549){const _0x47f858=_0x45e415['slice']()[_0x5a8f7a(0xb5)]((_0x34333d,_0x27e68f)=>{const _0x94140a=_0x5a8f7a,_0x1df334=_0x2dfa5d[_0x94140a(0x153)](_0x34333d[_0x94140a(0xa2)])||0x0,_0x2b6064=_0x2dfa5d['get'](_0x27e68f[_0x94140a(0xa2)])||0x0;if(_0x1df334!==_0x2b6064)return _0x2b6064-_0x1df334;return _0x34333d[_0x94140a(0xb3)]-_0x27e68f[_0x94140a(0xb3)];})[_0x5a8f7a(0xfd)](_0x1acdf5=>_0x1acdf5['name']),_0x23c3ad=[];for(const _0x50260c of _0x47f858){const _0x524627=_0x2dfa5d[_0x5a8f7a(0x153)](_0x50260c)||0x0,_0x389eaa=Math['max'](_0x524627,0x1);for(let _0x2eae16=0x0;_0x2eae16<_0x389eaa;_0x2eae16++){_0x23c3ad[_0x5a8f7a(0x142)](_0x50260c);}}_0x195fdf[_0x5a8f7a(0x129)](_0x36a285,_0x23c3ad);}return{'existingLocalSegmentNames':_0x331d78,'localSegmentRules':_0x47681a,'localExpandedRuleToNames':_0x195fdf};}export function createSegmentIdResolver(_0x2d3d79,_0x4878bb){return async _0x561ff3=>{const _0x44f214=a172_0xbe52,_0x5d9423=_0x2d3d79['get'](_0x561ff3);if(!_0x5d9423)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x44f214(0x135)+_0x561ff3+_0x44f214(0x147)+_0x4878bb+'\x27)');return _0x5d9423;};}export function extractRootFolderId(_0x26b129){const _0x5780b6=a172_0x504867;return _0x26b129[_0x5780b6(0x81)]?.[_0x5780b6(0x122)]?.[_0x5780b6(0xd1)]?.['id']||_0x26b129['relationships']?.['parentFolder']?.[_0x5780b6(0xd1)]?.['id'];}export function buildConnectionMaps(_0x4baa40){const _0x4fac9f=a172_0x504867,_0x2ec231=new Map(),_0x6a1d2e=new Map(),_0x1282a5=new Map();for(const _0x4e4acd of _0x4baa40){_0x2ec231[_0x4fac9f(0x129)](_0x4e4acd[_0x4fac9f(0xa2)],parseInt(_0x4e4acd['id'],0xa)),_0x6a1d2e[_0x4fac9f(0x129)](_0x4e4acd['id'],_0x4e4acd[_0x4fac9f(0xa2)]),_0x1282a5[_0x4fac9f(0x129)](_0x4e4acd[_0x4fac9f(0xa2)],_0x4e4acd[_0x4fac9f(0xdd)]);}return{'nameToId':_0x2ec231,'idToName':_0x6a1d2e,'nameToType':_0x1282a5};}export function calculatePushStats(_0x27f2d0,_0x4115a5,_0x1fe71a,_0x4d95d2,_0x385399,_0x56fdb9,_0x132169){const _0x27e11d=a172_0x504867,_0x5b004b=_0x27f2d0[_0x27e11d(0xa5)](_0x32b57f=>_0x32b57f['isNew']),_0x3010fb=_0x27f2d0[_0x27e11d(0xa5)](_0xea9e02=>!_0xea9e02[_0x27e11d(0xbf)]&&_0xea9e02[_0x27e11d(0xa4)]),_0x59ade4=_0x27f2d0[_0x27e11d(0xa5)](_0x5da1f0=>!_0x5da1f0[_0x27e11d(0xbf)]&&!_0x5da1f0[_0x27e11d(0xa4)]),_0x5c0386=_0x56fdb9?_0x4d95d2:[],_0x176921=_0x4115a5[_0x27e11d(0xa5)](_0x740fa9=>_0x740fa9[_0x27e11d(0xbf)]),_0xc08dab=_0x4115a5[_0x27e11d(0xa5)](_0x5814a7=>!_0x5814a7[_0x27e11d(0xbf)]&&_0x5814a7['hasChanges']),_0x3d283a=_0x4115a5[_0x27e11d(0xa5)](_0x436bdc=>!_0x436bdc[_0x27e11d(0xbf)]&&!_0x436bdc[_0x27e11d(0xa4)]),_0x2f69fa=_0x56fdb9?_0x385399:[],_0x353af0=_0x27f2d0[_0x27e11d(0x144)](_0x2bbd80=>_0x2bbd80[_0x27e11d(0xaf)]),_0x1b6ccb=_0x353af0[_0x27e11d(0xa5)](_0x244788=>_0x244788[_0x27e11d(0xdd)]===_0x27e11d(0x108)),_0x8118c1=_0x353af0[_0x27e11d(0xa5)](_0x5e3085=>_0x5e3085[_0x27e11d(0xdd)]===_0x27e11d(0xc3)),_0x46e1af=_0x353af0[_0x27e11d(0xa5)](_0x4f2a16=>_0x4f2a16['type']===_0x27e11d(0xc8)),_0xc68ed6=Array[_0x27e11d(0x15c)](_0x1fe71a)[_0x27e11d(0xb5)](),_0x2df5b9=_0x132169?![]:_0x5b004b[_0x27e11d(0xdc)]>0x0||_0x3010fb[_0x27e11d(0xdc)]>0x0||_0x5c0386[_0x27e11d(0xdc)]>0x0,_0x29771b=_0x176921[_0x27e11d(0xdc)]>0x0||_0xc08dab[_0x27e11d(0xdc)]>0x0||_0x2f69fa[_0x27e11d(0xdc)]>0x0,_0x42c6cc=_0x132169?![]:_0x353af0[_0x27e11d(0xdc)]>0x0,_0x2200ec=_0xc68ed6[_0x27e11d(0xdc)]>0x0;return{'segments':{'new':_0x5b004b,'changed':_0x3010fb,'unchanged':_0x59ade4,'toDelete':_0x5c0386},'journeys':{'new':_0x176921,'changed':_0xc08dab,'unchanged':_0x3d283a,'toDelete':_0x2f69fa},'activations':{'all':_0x353af0,'toCreate':_0x1b6ccb,'toUpdate':_0x8118c1,'toDelete':_0x46e1af},'folders':{'toCreate':_0xc68ed6},'counts':{'segments':{'new':_0x5b004b[_0x27e11d(0xdc)],'changed':_0x3010fb[_0x27e11d(0xdc)],'unchanged':_0x59ade4[_0x27e11d(0xdc)],'toDelete':_0x5c0386[_0x27e11d(0xdc)]},'journeys':{'new':_0x176921['length'],'changed':_0xc08dab[_0x27e11d(0xdc)],'unchanged':_0x3d283a[_0x27e11d(0xdc)],'toDelete':_0x2f69fa['length']},'activations':{'create':_0x1b6ccb['length'],'update':_0x8118c1['length'],'delete':_0x46e1af[_0x27e11d(0xdc)]},'folders':_0xc68ed6['length']},'hasChanges':_0x2df5b9||_0x29771b||_0x42c6cc||_0x2200ec};}export async function buildPushExecutionContext(_0x1fcc4c,_0x379b70,_0x4cca8a,_0x580c2f,_0x31001a,_0x20fcc8){const _0x27e51e=a172_0x504867,_0x1cfc85=extractRootFolderId(_0x4cca8a),{pathToId:_0x4bf93d,idToPath:_0x3eb752}=buildFolderMaps(_0x31001a),_0xdffe73=buildSegmentNameToIdMap(_0x580c2f),_0x1202b5=new Map(),{batchAsync:_0x288049}=await import(_0x27e51e(0x140)),[_0x2a2f42,_0x2f8383]=await Promise[_0x27e51e(0x75)]([_0x1fcc4c['user'][_0x27e51e(0x136)](),_0x1fcc4c[_0x27e51e(0x11a)][_0x27e51e(0x106)](),((async()=>{const _0x5f0dcb=_0x27e51e;!_0x20fcc8&&_0x580c2f[_0x5f0dcb(0xdc)]>0x0&&await _0x288049(_0x580c2f,async _0x524a5e=>{const _0x5cea7c=_0x5f0dcb,_0x36b1ce=await _0x1fcc4c[_0x5cea7c(0x165)]['listActivations'](_0x379b70,_0x524a5e['id']);_0x1202b5[_0x5cea7c(0x129)](_0x524a5e['id'],_0x36b1ce);});})())]),{emailToId:_0x511624,idToEmail:_0x50763d}=_0x2a2f42,_0x3161c3=buildConnectionMaps(_0x2f8383);return{'rootFolderId':_0x1cfc85,'folderPathToId':_0x4bf93d,'folderIdToPath':_0x3eb752,'segmentNameToId':_0xdffe73,'activationsBySegmentId':_0x1202b5,'emailToIdMap':_0x511624,'idToEmailMap':_0x50763d,'connectionNameToIdMap':_0x3161c3[_0x27e51e(0xda)],'connectionIdToNameMap':_0x3161c3[_0x27e51e(0x104)],'connectionNameToTypeMap':_0x3161c3[_0x27e51e(0x117)]};}export function createPushYamlContextForBundle(_0x4967b2,_0x398856,_0x27fea6,_0x2ad7f4,_0x11154b,_0x45dc2f,_0x542288,_0x1c69de){const {existingLocalSegmentNames:_0x1dc1cb,localExpandedRuleToNames:_0x17a10d}=_0x2ad7f4,_0xdc7918=new Set(),_0x56e77b=new Map(),_0x26df7b=new Map(),_0x580169=new Map(),_0x4417e4=createJumpTargetCache(),_0x143fa5=new Map(),_0x587c2e=new Map(),_0x3bccdd=new Set();let _0x31e16f;const _0x4af5c6=_0x25edd2=>{const _0xd35c5d={'resolveSegment':async _0x4425da=>{const _0x29bd86=a172_0xbe52,_0x320090=_0x580169[_0x29bd86(0x153)](_0x4425da);if(_0x320090!==undefined)return{'name':_0x320090,'isJourneyLocal':!![]};try{const _0xa77d5e=await fetchSegment(_0x4967b2,_0x398856,_0x4425da,_0x27fea6);if(!_0xa77d5e)throw new Error(_0x29bd86(0x77));const _0x5e56c6=generateJourneyLocalName(_0xa77d5e['name']),_0x21aac0=_0xa77d5e[_0x29bd86(0x83)]===SEGMENT_KIND_JOURNEY&&_0x5e56c6!==undefined;let _0x403ed7=_0xa77d5e[_0x29bd86(0xa2)],_0x333ecf;if(_0x21aac0&&_0xa77d5e[_0x29bd86(0xfb)]){const _0x4c10ed=apiRuleToYaml(_0xa77d5e[_0x29bd86(0xfb)]);_0x587c2e[_0x29bd86(0x129)](_0x4425da,_0x4c10ed);const _0x5b6ce9=async _0x332a4c=>{const _0xb71eac=_0x29bd86,_0x215224=collectSegmentRefsFromRule(_0x332a4c);for(const _0x46c18e of _0x215224){if(!_0x587c2e['has'](_0x46c18e))try{const _0x8e54d6=await fetchSegment(_0x4967b2,_0x398856,_0x46c18e,_0x27fea6);if(_0x8e54d6?.[_0xb71eac(0xfb)]){const _0x2977eb=apiRuleToYaml(_0x8e54d6['rule']);_0x587c2e['set'](_0x46c18e,_0x2977eb),await _0x5b6ce9(_0x2977eb);}}catch(_0x1aa93f){logger[_0xb71eac(0xd4)](_0xb71eac(0x9c)+_0x46c18e+':\x20'+_0x1aa93f);}}};await _0x5b6ce9(_0x4c10ed);const _0xd1314a=serializeExpandedRule(_0x4c10ed,_0x587c2e),_0x4d17a4=_0x17a10d['get'](_0xd1314a);if(_0x4d17a4&&_0x4d17a4[_0x29bd86(0xdc)]>0x0){const _0x400fa5=_0x56e77b[_0x29bd86(0x153)](_0xd1314a)||0x0,_0x5c8978=_0x4d17a4[_0x400fa5]||_0x4d17a4[_0x4d17a4['length']-0x1];_0x56e77b[_0x29bd86(0x129)](_0xd1314a,_0x400fa5+0x1),_0x403ed7=_0x5c8978,_0xdc7918['add'](_0x403ed7),_0x580169['set'](_0x4425da,_0x403ed7);const _0x5e4a20=await resolveRuleSegmentRefs(_0x4c10ed,async _0x10fb2e=>{const _0x17af4c=_0x29bd86,_0x170059=_0x580169[_0x17af4c(0x153)](_0x10fb2e);if(_0x170059)return _0x170059;const _0x47d5c1=await _0x31e16f[_0x17af4c(0xc6)](_0x10fb2e);return _0x47d5c1[_0x17af4c(0xa2)];});_0x333ecf={'description':_0xa77d5e[_0x29bd86(0xfa)],'rule':_0x5e4a20};}else{const _0x527361=_0x143fa5[_0x29bd86(0x153)](_0xd1314a);if(_0x527361)_0x403ed7=_0x527361,_0x580169[_0x29bd86(0x129)](_0x4425da,_0x403ed7);else{if(_0x5e56c6){let _0x25b963=_0x5e56c6,_0x416c6f=0x2;while(_0xdc7918['has'](_0x25b963)||_0x1dc1cb['has'](_0x25b963)){_0x25b963=_0x5e56c6+'_'+_0x416c6f,_0x416c6f++;}_0xdc7918[_0x29bd86(0xd5)](_0x25b963),_0x403ed7=_0x25b963;}_0x580169[_0x29bd86(0x129)](_0x4425da,_0x403ed7),_0x143fa5[_0x29bd86(0x129)](_0xd1314a,_0x403ed7);const _0xafd126=await resolveRuleSegmentRefs(_0x4c10ed,async _0x5a5cdd=>{const _0x1f0fe8=_0x29bd86,_0x2201b1=_0x580169['get'](_0x5a5cdd);if(_0x2201b1)return _0x2201b1;const _0x551da9=await _0x31e16f[_0x1f0fe8(0xc6)](_0x5a5cdd);return _0x551da9[_0x1f0fe8(0xa2)];});_0x333ecf={'description':_0xa77d5e[_0x29bd86(0xfa)],'rule':_0xafd126};}}}return{'name':_0x403ed7,'isJourneyLocal':_0x21aac0,'definition':_0x333ecf};}catch(_0x408673){return logger[_0x29bd86(0xd4)](_0x29bd86(0xd7)+_0x4425da+':\x20'+_0x408673),{'name':_0x4425da,'isJourneyLocal':![]};}},'resolveActivation':async _0x1fa021=>{const _0x8a8e54=a172_0xbe52,_0x33c6d2=_0x26df7b['get'](_0x1fa021);if(_0x33c6d2!==undefined)return{'name':_0x33c6d2,'isJourneyLocal':!![]};try{let _0x20435a=_0x542288?.[_0x8a8e54(0x153)](_0x1fa021);!_0x20435a&&(_0x20435a=await _0x4967b2[_0x8a8e54(0x82)][_0x8a8e54(0x161)](_0x25edd2,_0x1fa021));const _0x3e392e=_0x20435a[_0x8a8e54(0x9f)][_0x8a8e54(0xbd)][_0x8a8e54(0xa2)]||_0x1fa021,_0x284dd9=sanitizeYamlKey(_0x3e392e)||'activation_'+_0x1fa021,_0x202f6e=_0x284dd9;_0x26df7b[_0x8a8e54(0x129)](_0x1fa021,_0x202f6e);const _0x170614=journeyActivationStepToYaml(_0x20435a,_0x11154b,_0x45dc2f);return{'name':_0x202f6e,'isJourneyLocal':!![],'definition':_0x170614};}catch(_0x1a8fda){return logger[_0x8a8e54(0xd4)](_0x8a8e54(0x10f)+_0x1fa021+':\x20'+_0x1a8fda),{'name':_0x1fa021,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2448cf,_0x17d76a)=>resolveJumpTarget(_0x2448cf,_0x17d76a,_0x4417e4,async _0x434ad5=>{const _0x5a7897=a172_0xbe52,_0x3df51f=_0x1c69de?.['get'](_0x434ad5);if(_0x3df51f)return _0x3df51f;return _0x4967b2['journey'][_0x5a7897(0x120)](_0x434ad5);})};return _0x31e16f=_0xd35c5d,_0xd35c5d;},_0x19618c=async _0x53f600=>{const _0x3ed6cb=a172_0xbe52,{collectSegmentIdsFromJourneyApi:_0x10d496}=await import(_0x3ed6cb(0xc4)),{batchAsync:_0x4816eb}=await import('../../utils/async.js'),_0x200e2a=new Set();for(const _0x5450ec of _0x53f600){let _0x4e5cc2=_0x1c69de?.[_0x3ed6cb(0x153)](_0x5450ec);!_0x4e5cc2&&(_0x4e5cc2=await _0x4967b2[_0x3ed6cb(0x82)][_0x3ed6cb(0x120)](_0x5450ec));const _0x4625b6=_0x10d496(_0x4e5cc2);for(const _0x1aa5a9 of _0x4625b6){_0x200e2a[_0x3ed6cb(0xd5)](_0x1aa5a9);}}let _0x572d00=Array['from'](_0x200e2a);while(_0x572d00[_0x3ed6cb(0xdc)]>0x0){const _0x55e4bc=_0x572d00[_0x3ed6cb(0xa5)](_0x5b5dea=>!_0x3bccdd[_0x3ed6cb(0xff)](_0x5b5dea));if(_0x55e4bc[_0x3ed6cb(0xdc)]===0x0)break;const _0x451c67=await _0x4816eb(_0x55e4bc,async _0x218e33=>{const _0x111f57=_0x3ed6cb;_0x3bccdd[_0x111f57(0xd5)](_0x218e33);const _0x214b22=await fetchSegment(_0x4967b2,_0x398856,_0x218e33,_0x27fea6);if(!_0x214b22)return null;return{'segmentId':_0x218e33,'segment':_0x214b22};},0xa),_0x5de573=new Set();for(const _0x2da804 of _0x451c67){if(!_0x2da804?.[_0x3ed6cb(0x165)]?.[_0x3ed6cb(0xfb)])continue;const _0x1ddb75=apiRuleToYaml(_0x2da804['segment'][_0x3ed6cb(0xfb)]);_0x587c2e['set'](_0x2da804[_0x3ed6cb(0xcf)],_0x1ddb75);const _0x3f5f7a=collectSegmentRefsFromRule(_0x1ddb75);for(const _0x3a36ce of _0x3f5f7a){!_0x3bccdd['has'](_0x3a36ce)&&_0x5de573[_0x3ed6cb(0xd5)](_0x3a36ce);}}_0x572d00=Array[_0x3ed6cb(0x15c)](_0x5de573);}};return{'createYamlContext':_0x4af5c6,'prefetchJourneySegments':_0x19618c};}export async function executePushSegments(_0x44007d,_0x7ce3ec,_0x314994,_0x38705a,_0x23c2d4){const _0x969212=a172_0x504867,{segmentDefToCreateRequest:_0xa9512a,segmentDefToUpdateRequest:_0x28a95e}=await import('./child-segment-yaml.js'),_0xefbc35=_0x314994[_0x969212(0x12a)],_0x434e43=0x5,_0x255a63=async _0x53ff1b=>{const _0x397971=_0x969212,_0x14c292=_0x53ff1b[_0x397971(0xe2)]?_0xefbc35[_0x397971(0x153)](_0x53ff1b['folderPath']):undefined;let _0x5b627c;const _0xe5b64e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x14047b=_0x53ff1b[_0x397971(0xa8)];if(_0x53ff1b['yamlConfig'][_0x397971(0xfb)]){const _0x51f21e=createSegmentIdResolver(_0x314994['segmentNameToId'],_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]),_0x5635fc=await resolveRuleSegmentIds(_0x53ff1b[_0x397971(0xa8)][_0x397971(0xfb)],_0x51f21e);_0x14047b={..._0x53ff1b[_0x397971(0xa8)],'rule':_0x5635fc};}try{if(_0x53ff1b[_0x397971(0xbf)]){_0x23c2d4[_0x397971(0xed)]?.({'type':_0x397971(0x10c),'name':_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]});const _0x561722=_0xa9512a(_0x14047b,_0x14c292),_0x5ea569=await _0x23c2d4[_0x397971(0xee)](_0x397971(0x85)+_0x53ff1b[_0x397971(0xa8)]['name']+'\x27...',()=>_0x44007d['segment'][_0x397971(0xa3)](_0x38705a[_0x397971(0x107)],_0x561722));_0x5b627c=_0x5ea569[_0x397971(0xd1)]['id'],_0x314994[_0x397971(0xf7)][_0x397971(0x129)](_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)],_0x5b627c),_0xe5b64e[_0x397971(0x76)]={'name':_0x53ff1b[_0x397971(0xa8)]['name'],'id':_0x5b627c},_0x23c2d4[_0x397971(0xed)]?.({'type':_0x397971(0x112),'name':_0x53ff1b['yamlConfig'][_0x397971(0xa2)],'segmentId':_0x5b627c}),_0x23c2d4[_0x397971(0x138)]?.(_0x397971(0x15e)+_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]+'\x27'),_0xe5b64e['created']=0x1;}else{if(_0x53ff1b[_0x397971(0xa4)]){_0x23c2d4['onProgress']?.({'type':_0x397971(0xf4),'name':_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]});const _0x528b17=_0x28a95e(_0x14047b);_0x14c292!==_0x53ff1b[_0x397971(0x74)]?.[_0x397971(0x143)]&&(_0x528b17[_0x397971(0x143)]=_0x14c292?parseInt(_0x14c292,0xa):undefined),await _0x23c2d4[_0x397971(0xee)](_0x397971(0xc7)+_0x53ff1b[_0x397971(0xa8)]['name']+_0x397971(0x126),()=>_0x44007d[_0x397971(0x165)][_0x397971(0x73)](_0x38705a[_0x397971(0x107)],_0x53ff1b[_0x397971(0x74)]['id'],_0x528b17)),_0x5b627c=_0x53ff1b[_0x397971(0x74)]['id'],_0x23c2d4[_0x397971(0xed)]?.({'type':'segment_updated','name':_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]}),_0x23c2d4['logSuccess']?.(_0x397971(0x7a)+_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)]+'\x27'),_0xe5b64e['updated']=0x1;}else _0x5b627c=_0x53ff1b['existingSegment']['id'];}}catch(_0x5b88c0){const _0x42808f=isHttp400Error(_0x5b88c0),_0x14a491=_0x42808f?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5a7877=getErrorMessage(_0x5b88c0);throw new SDKError(_0x14a491,_0x397971(0xa6)+(_0x53ff1b[_0x397971(0xbf)]?_0x397971(0x108):_0x397971(0xc3))+_0x397971(0x12c)+_0x53ff1b['absolutePath']+_0x397971(0x121)+_0x5a7877,_0x5b88c0);}try{const _0x4166f2=await syncActivationsForSegment(_0x44007d,_0x38705a[_0x397971(0x107)],_0x5b627c,_0x53ff1b[_0x397971(0xa8)][_0x397971(0xa2)],_0x53ff1b['activationActions'],_0x23c2d4,_0x53ff1b['absolutePath']);_0xe5b64e[_0x397971(0xd2)]=_0x4166f2;}catch(_0x55a41a){if(_0x55a41a instanceof SDKError)throw _0x55a41a;throw new SDKError(ErrorCode[_0x397971(0xc5)],_0x397971(0x157)+_0x53ff1b[_0x397971(0xa8)]['name']+'\x27\x20from\x20file:\x20'+_0x53ff1b[_0x397971(0x71)]+_0x397971(0x121)+getErrorMessage(_0x55a41a),_0x55a41a);}return _0xe5b64e;},_0x562f1f=await batchAsync(_0x7ce3ec,_0x255a63,_0x434e43),_0xfb7c3c={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4ab08c of _0x562f1f){_0xfb7c3c[_0x969212(0x14f)]+=_0x4ab08c[_0x969212(0x14f)],_0xfb7c3c[_0x969212(0x72)]+=_0x4ab08c[_0x969212(0x72)],_0x4ab08c[_0x969212(0x76)]&&_0xfb7c3c[_0x969212(0x7f)][_0x969212(0x129)](_0x4ab08c[_0x969212(0x76)]['name'],_0x4ab08c[_0x969212(0x76)]['id']),_0xfb7c3c['activations']['created']+=_0x4ab08c[_0x969212(0xd2)][_0x969212(0x14f)],_0xfb7c3c[_0x969212(0xd2)]['updated']+=_0x4ab08c['activations'][_0x969212(0x72)],_0xfb7c3c[_0x969212(0xd2)][_0x969212(0xad)]+=_0x4ab08c['activations'][_0x969212(0xad)];}return _0xfb7c3c;}async function syncActivationsForSegment(_0x5a286c,_0x512859,_0x117c94,_0x5f0bdb,_0x2da01e,_0xcced39,_0x2ec826){const _0x50ee64=a172_0x504867,_0x380ab8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3b30dd of _0x2da01e){try{if(_0x3b30dd[_0x50ee64(0xdd)]===_0x50ee64(0x108)&&_0x3b30dd[_0x50ee64(0xf6)])_0xcced39['onProgress']?.({'type':_0x50ee64(0x13d),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),await _0xcced39[_0x50ee64(0xee)](_0x50ee64(0x12e)+_0x3b30dd['name']+_0x50ee64(0x126),()=>_0x5a286c[_0x50ee64(0x165)][_0x50ee64(0xc2)](_0x512859,_0x117c94,_0x3b30dd[_0x50ee64(0xf6)])),_0xcced39[_0x50ee64(0xed)]?.({'type':_0x50ee64(0x137),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),_0xcced39[_0x50ee64(0x138)]?.(_0x50ee64(0xde)+_0x3b30dd['name']+'\x27'),_0x380ab8['created']++;else{if(_0x3b30dd[_0x50ee64(0xdd)]===_0x50ee64(0xc3)&&_0x3b30dd[_0x50ee64(0xf6)]&&_0x3b30dd[_0x50ee64(0x88)])_0xcced39['onProgress']?.({'type':_0x50ee64(0xcd),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),await _0xcced39[_0x50ee64(0xee)]('Updating\x20activation\x20\x27'+_0x3b30dd[_0x50ee64(0xa2)]+_0x50ee64(0x126),()=>_0x5a286c[_0x50ee64(0x165)]['updateActivation'](_0x512859,_0x117c94,_0x3b30dd[_0x50ee64(0x88)]['id'],_0x3b30dd[_0x50ee64(0xf6)])),_0xcced39['onProgress']?.({'type':_0x50ee64(0x139),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd['name']}),_0xcced39[_0x50ee64(0x138)]?.(_0x50ee64(0x10a)+_0x3b30dd['name']+'\x27'),_0x380ab8[_0x50ee64(0x72)]++;else _0x3b30dd[_0x50ee64(0xdd)]===_0x50ee64(0xc8)&&_0x3b30dd[_0x50ee64(0x88)]&&(_0xcced39['onProgress']?.({'type':'activation_deleting','segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),await _0xcced39[_0x50ee64(0xee)](_0x50ee64(0xa1)+_0x3b30dd[_0x50ee64(0xa2)]+'\x27...',()=>_0x5a286c[_0x50ee64(0x165)]['deleteActivation'](_0x512859,_0x117c94,_0x3b30dd['existingActivation']['id'])),_0xcced39[_0x50ee64(0xed)]?.({'type':_0x50ee64(0x12b),'segmentName':_0x5f0bdb,'activationName':_0x3b30dd[_0x50ee64(0xa2)]}),_0xcced39['logDeleted']?.(_0x50ee64(0xb0)+_0x3b30dd[_0x50ee64(0xa2)]+'\x27'),_0x380ab8[_0x50ee64(0xad)]++);}}catch(_0x588047){const _0x5c4ff6=isHttp400Error(_0x588047),_0x16873e=_0x5c4ff6?ErrorCode[_0x50ee64(0x123)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3ddbd3=getErrorMessage(_0x588047);throw new SDKError(_0x16873e,_0x50ee64(0xa6)+_0x3b30dd[_0x50ee64(0xdd)]+'\x20activation\x20\x27'+_0x3b30dd['name']+'\x27\x20from\x20file:\x20'+_0x2ec826+_0x50ee64(0x121)+_0x3ddbd3,_0x588047);}}return _0x380ab8;}export async function executePushFolders(_0x3763a1,_0xa3779d,_0x2818db,_0x2e916d,_0x5e35b8){const _0x490bef=a172_0x504867,_0x564fb4=new Map(_0x2818db),_0x457812=sortFoldersByDepth(_0xa3779d);for(const _0x4e8b07 of _0x457812){const _0x5d4514=_0x4e8b07['split']('/'),_0x209f39=_0x5d4514[_0x5d4514['length']-0x1],_0x2a09ad=_0x5d4514[_0x490bef(0x91)](0x0,-0x1)[_0x490bef(0x101)]('/'),_0x426037=_0x564fb4[_0x490bef(0x153)](_0x2a09ad);_0x5e35b8[_0x490bef(0xed)]?.({'type':'folder_creating','folder':_0x4e8b07});const _0x19fa7e={'name':_0x209f39,'parentFolderId':_0x426037},_0x1a6371=await _0x5e35b8[_0x490bef(0xee)](_0x490bef(0x79)+_0x4e8b07+'\x27...',()=>_0x3763a1[_0x490bef(0x165)]['createFolder'](_0x2e916d[_0x490bef(0x107)],_0x19fa7e));_0x564fb4[_0x490bef(0x129)](_0x4e8b07,_0x1a6371[_0x490bef(0xd1)]['id']),_0x5e35b8['onProgress']?.({'type':_0x490bef(0x10d),'folder':_0x4e8b07,'folderId':_0x1a6371[_0x490bef(0xd1)]['id']}),_0x5e35b8[_0x490bef(0x9a)]?.(_0x490bef(0x11f)+_0x4e8b07+'\x27');}return _0x564fb4;}export async function executePushSegmentDeletions(_0x5b40ac,_0x1d1104,_0x5a69b7){const _0x2f9f26=a172_0x504867;if(_0x1d1104[_0x2f9f26(0xdc)]===0x0)return 0x0;const {batchAsync:_0x599a9e}=await import(_0x2f9f26(0x140)),_0x3f14b2=0x5,_0xd1f1de=await _0x599a9e(_0x1d1104,async _0x287af7=>{const _0x234542=_0x2f9f26;return _0x5a69b7[_0x234542(0xed)]?.({'type':'segment_deleting','name':_0x287af7[_0x234542(0xa2)]}),await _0x5b40ac[_0x234542(0x165)]['deleteSegment'](_0x287af7['id']),_0x5a69b7['onProgress']?.({'type':'segment_deleted','name':_0x287af7['name']}),_0x5a69b7[_0x234542(0x113)]?.(_0x234542(0xfc)+_0x287af7['name']+'\x27'),0x1;},_0x3f14b2);return _0xd1f1de[_0x2f9f26(0xd0)]((_0x27a80f,_0x2d86e1)=>_0x27a80f+_0x2d86e1,0x0);}export async function executePushJourneys(_0x269988,_0x38cc69,_0x18b95b,_0x372651,_0x384da7){const _0x3d5404=a172_0x504867,{journeyDefToRequest:_0x1846b9}=await import(_0x3d5404(0xc4)),{activationDefToCreateRequest:_0x2678e1,yamlRuleToApi:_0x4962b2,validateSegmentRule:_0x3a021b}=await import('./child-segment-yaml.js'),_0x46f4e3={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x597da1=new Map(_0x18b95b[_0x3d5404(0xf7)]),_0x32de44=0x5;for(let _0x4a934a=0x0;_0x4a934a<_0x38cc69['length'];_0x4a934a+=_0x32de44){const _0x4b186e=_0x38cc69[_0x3d5404(0x91)](_0x4a934a,_0x4a934a+_0x32de44),_0x237e59=await Promise[_0x3d5404(0x75)](_0x4b186e[_0x3d5404(0xfd)](async _0x14d914=>{const _0x902f9=_0x3d5404;if(!_0x14d914[_0x902f9(0xbf)]&&!_0x14d914[_0x902f9(0xa4)])return{'action':'unchanged','name':_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)],'journeyId':_0x14d914['existingJourney']?.['id']};const _0x2ced70=_0x14d914['folderPath']?_0x18b95b[_0x902f9(0x12a)][_0x902f9(0x153)](_0x14d914[_0x902f9(0xe2)]):undefined;_0x384da7['onProgress']?.({'type':_0x14d914['isNew']?_0x902f9(0xf3):'journey_updating','name':_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)]});try{const _0x35a13d=await executeSingleJourneyPush(_0x269988,_0x14d914,{..._0x18b95b,'segmentNameToId':_0x597da1},{'parentId':_0x372651['parentId'],'rootFolderId':_0x372651[_0x902f9(0x132)],'folderId':_0x2ced70,'verbose':_0x372651['verbose']},_0x384da7,{'journeyDefToRequest':_0x1846b9,'activationDefToCreateRequest':_0x2678e1,'yamlRuleToApi':_0x4962b2,'validateSegmentRule':_0x3a021b});for(const [_0x569361,_0x1b355b]of _0x35a13d[_0x902f9(0xce)]){_0x597da1[_0x902f9(0x129)](_0x569361,_0x1b355b),_0x46f4e3['embeddedSegmentNameToId']['set'](_0x569361,_0x1b355b);}if(_0x35a13d[_0x902f9(0x94)]===_0x902f9(0x14f))_0x384da7[_0x902f9(0xed)]?.({'type':_0x902f9(0x8e),'name':_0x14d914['yamlConfig'][_0x902f9(0xa2)],'journeyId':_0x35a13d[_0x902f9(0x128)]}),_0x384da7[_0x902f9(0x138)]?.(_0x902f9(0xe3)+_0x14d914[_0x902f9(0xa8)]['name']+'\x27'),_0x46f4e3[_0x902f9(0x14f)]++;else _0x35a13d[_0x902f9(0x94)]===_0x902f9(0x72)&&(_0x384da7['onProgress']?.({'type':_0x902f9(0x11c),'name':_0x14d914[_0x902f9(0xa8)]['name']}),_0x384da7['logSuccess']?.(_0x902f9(0xa7)+_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)]+'\x27'),_0x46f4e3[_0x902f9(0x72)]++);return{'action':_0x35a13d[_0x902f9(0x94)],'name':_0x14d914[_0x902f9(0xa8)][_0x902f9(0xa2)],'journeyId':_0x35a13d['journeyId']};}catch(_0x2d3864){const _0x40c9b5=isHttp400Error(_0x2d3864),_0x50b233=_0x40c9b5?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2c3d92=getErrorMessage(_0x2d3864);throw new SDKError(_0x50b233,_0x902f9(0xa6)+(_0x14d914[_0x902f9(0xbf)]?_0x902f9(0x108):_0x902f9(0xc3))+'\x20journey\x20from\x20file:\x20'+_0x14d914[_0x902f9(0x71)]+_0x902f9(0x121)+_0x2c3d92,_0x2d3864);}}));_0x46f4e3[_0x3d5404(0x111)][_0x3d5404(0x142)](..._0x237e59);}return _0x46f4e3;}async function matchExistingJourneySegments(_0x487d39,_0x878f90,_0x3e4a95,_0x4d4874,_0x139bcd){const _0x4c1e1d=a172_0x504867;if(!_0x878f90['existingJourney']||!_0x878f90[_0x4c1e1d(0xa8)]['segments'])return;const _0x12d610=new Map(),_0x278957=new Set();for(const _0x57fcc5 of Object['keys'](_0x878f90[_0x4c1e1d(0xa8)][_0x4c1e1d(0x150)])){const _0x542adb=generateDeterministicJourneySegmentName(_0x878f90[_0x4c1e1d(0xa8)][_0x4c1e1d(0xa2)],_0x57fcc5);_0x12d610[_0x4c1e1d(0x129)](_0x542adb,_0x57fcc5),_0x278957['add'](_0x57fcc5);}const _0x23235b=[],_0x96210e=collectSegmentIdsFromJourneyApi(_0x878f90[_0x4c1e1d(0x100)]);for(const _0x354d8b of _0x96210e){const _0x5e85ee=await fetchSegment(_0x487d39,_0x3e4a95,_0x354d8b,_0x4d4874);if(!_0x5e85ee?.[_0x4c1e1d(0xa2)])continue;const _0x521a5e=_0x12d610['get'](_0x5e85ee[_0x4c1e1d(0xa2)]);_0x521a5e?(_0x139bcd[_0x4c1e1d(0x129)](_0x521a5e,_0x354d8b),_0x278957[_0x4c1e1d(0xc8)](_0x521a5e)):_0x23235b[_0x4c1e1d(0x142)]({'id':_0x354d8b,'seg':_0x5e85ee});}if(_0x278957['size']>0x0&&_0x23235b[_0x4c1e1d(0xdc)]>0x0){const {localExpandedRuleToNames:_0x1f520f}=buildLocalExpandedRuleMappings(_0x878f90[_0x4c1e1d(0xa8)]),_0x3dc3e4=new Map();for(const {id:_0x170857,seg:_0x14535a}of _0x23235b){if(_0x14535a[_0x4c1e1d(0xfb)]){const _0x354e89=apiRuleToYaml(_0x14535a[_0x4c1e1d(0xfb)]);_0x3dc3e4[_0x4c1e1d(0x129)](_0x170857,_0x354e89);}}for(const {id:_0x2ea5aa,seg:_0x33a09d}of _0x23235b){if(!_0x33a09d[_0x4c1e1d(0xfb)])continue;const _0x2c0aae=_0x3dc3e4['get'](_0x2ea5aa);if(!_0x2c0aae)continue;const _0x51e218=serializeExpandedRule(_0x2c0aae,_0x3dc3e4),_0x4d3f89=_0x1f520f[_0x4c1e1d(0x153)](_0x51e218);if(_0x4d3f89){const _0x438482=_0x4d3f89[_0x4c1e1d(0x119)](_0x519e00=>_0x278957[_0x4c1e1d(0xff)](_0x519e00));_0x438482&&(_0x139bcd['set'](_0x438482,_0x2ea5aa),_0x278957[_0x4c1e1d(0xc8)](_0x438482),logger[_0x4c1e1d(0xd4)](_0x4c1e1d(0x96)+_0x33a09d[_0x4c1e1d(0xa2)]+_0x4c1e1d(0x7b)+_0x438482+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0xd6ee78,_0xc4bc65,_0x2ebb62,_0x59c191,_0x263e22,_0x23f29e){const _0x597bf1=a172_0x504867,{journeyDefToRequest:_0x76ba8b,activationDefToCreateRequest:_0x35e680,yamlRuleToApi:_0x13712b,validateSegmentRule:_0x5ca1d3}=_0x23f29e,_0x571d00=new Map(),_0x459f41=new Map();recoverSegmentIdsFromPushRecovery(_0xc4bc65,_0x571d00,_0x2ebb62[_0x597bf1(0xf7)]);const _0x2ffd6c=new Map(),_0x20195b=new Map(),_0x27c947=new Map();let _0x24c250;const _0x4c62f3=async()=>{const _0xbcd57=_0x597bf1;if(_0x24c250)return;_0x24c250=new Map();if(!_0xc4bc65['existingJourney'])return;const _0x38461e=await _0xd6ee78[_0xbcd57(0x82)]['listActivations'](_0xc4bc65[_0xbcd57(0x100)]['id']);for(const _0x3e46f3 of _0x38461e){const _0x55748e=journeyActivationStepToYaml(_0x3e46f3,_0x2ebb62['idToEmailMap'],_0x2ebb62['connectionIdToNameMap']),_0x897ad0=activationSignature(_0x55748e);!_0x24c250[_0xbcd57(0xff)](_0x897ad0)&&_0x24c250['set'](_0x897ad0,_0x3e46f3['id']),_0x55748e[_0xbcd57(0xa2)]&&_0x459f41[_0xbcd57(0x129)](_0x55748e[_0xbcd57(0xa2)],_0x3e46f3['id']);}};await matchExistingJourneySegments(_0xd6ee78,_0xc4bc65,_0x59c191[_0x597bf1(0x107)],_0x2ebb62['existingSegments'],_0x2ebb62[_0x597bf1(0xf7)]);const _0x303fad={'resolveSegmentId':async _0x3e22f1=>{const _0x43dd0c=_0x597bf1,_0x102ae8=_0x2ebb62['segmentNameToId'][_0x43dd0c(0x153)](_0x3e22f1);if(!_0x102ae8)throw new SDKError(ErrorCode[_0x43dd0c(0x110)],_0x43dd0c(0x135)+_0x3e22f1+_0x43dd0c(0xca)+_0xc4bc65[_0x43dd0c(0xa8)][_0x43dd0c(0xa2)]+')');return _0x102ae8;},'resolveEmbeddedSegmentId':async(_0x191f4d,_0x30193a)=>{const _0x11dc41=_0x597bf1,_0x1cd5f8=_0x2ebb62['segmentNameToId'][_0x11dc41(0x153)](_0x191f4d);if(_0x1cd5f8)return _0x1cd5f8;const _0x329903=_0x2ebb62[_0x11dc41(0x12d)][_0x11dc41(0x119)](_0x1135ea=>_0x1135ea['name']===_0x191f4d);if(_0x329903)return _0x2ebb62[_0x11dc41(0xf7)]['set'](_0x191f4d,_0x329903['id']),_0x329903['id'];if(_0xc4bc65['isNew']){const {stageName:_0x393a78,criteriaName:_0xd3ce5d}=findSegmentCriteriaLocation(_0xc4bc65[_0x11dc41(0xa8)],_0x191f4d);return _0x5ca1d3(_0x191f4d,_0x30193a[_0x11dc41(0xfb)]),_0x20195b['set'](_0x191f4d,{'definition':_0x30193a,'stageName':_0x393a78,'criteriaName':_0xd3ce5d}),createPendingSegmentId(_0x191f4d);}const _0x505a23=_0xc4bc65[_0x11dc41(0x100)]?.['id'];if(!_0x505a23)throw new SDKError(ErrorCode[_0x11dc41(0x90)],_0x11dc41(0xf2));const _0x3fe738=_0x2ffd6c[_0x11dc41(0x153)](_0x191f4d);if(_0x3fe738)return _0x3fe738;const _0x2f4cba=((async()=>{const _0x47ac4c=_0x11dc41;_0x5ca1d3(_0x191f4d,_0x30193a['rule']);const _0xf82742=generateDeterministicJourneySegmentName(_0xc4bc65[_0x47ac4c(0xa8)][_0x47ac4c(0xa2)],_0x191f4d),_0x120edd=_0x2ebb62['existingSegments'][_0x47ac4c(0x119)](_0x27a240=>_0x27a240[_0x47ac4c(0xa2)]===_0xf82742),_0x3c1678=createSegmentIdResolver(_0x2ebb62[_0x47ac4c(0xf7)],_0x191f4d),_0x38f09c=await resolveRuleSegmentIds(_0x30193a[_0x47ac4c(0xfb)],_0x3c1678);let _0x24607f;return _0x120edd?(await _0xd6ee78[_0x47ac4c(0x165)][_0x47ac4c(0x73)](_0x59c191[_0x47ac4c(0x107)],_0x120edd['id'],{'description':_0x30193a['description']||_0x47ac4c(0xf5)+_0x191f4d,'rule':_0x13712b(_0x38f09c),'countPopulation':!![]}),_0x24607f=_0x120edd['id'],saveSegmentToPushRecovery(_0xc4bc65[_0x47ac4c(0x71)],_0xc4bc65[_0x47ac4c(0xa8)][_0x47ac4c(0xa2)],_0x191f4d,{'segmentId':_0x24607f,'uniqueServerName':_0xf82742,'createdAt':new Date()['toISOString']()})):_0x24607f=await createOrRecoverEmbeddedSegment(_0xd6ee78,_0xc4bc65,{'localName':_0x191f4d,'uniqueSegmentName':_0xf82742,'description':_0x30193a[_0x47ac4c(0xfa)]||_0x47ac4c(0xf5)+_0x191f4d,'journeyId':_0x505a23,'resolvedRule':_0x38f09c,'parentId':_0x59c191['parentId'],'folderId':_0x59c191['rootFolderId']||''},_0x13712b),_0x2ebb62['segmentNameToId'][_0x47ac4c(0x129)](_0x191f4d,_0x24607f),_0x571d00[_0x47ac4c(0x129)](_0x191f4d,_0x24607f),_0x24607f;})());_0x2ffd6c['set'](_0x191f4d,_0x2f4cba);try{return await _0x2f4cba;}finally{_0x2ffd6c[_0x11dc41(0xc8)](_0x191f4d);}},'resolveActivationId':async _0x548306=>{const _0x2ba5a5=_0x597bf1,_0x29a20d=_0x459f41[_0x2ba5a5(0x153)](_0x548306);if(_0x29a20d)return _0x29a20d;if(_0xc4bc65[_0x2ba5a5(0x100)]){await _0x4c62f3();const _0x7b303d=_0x459f41[_0x2ba5a5(0x153)](_0x548306);if(_0x7b303d)return _0x7b303d;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x2ba5a5(0x13c)+_0x548306+_0x2ba5a5(0xca)+_0xc4bc65[_0x2ba5a5(0xa8)][_0x2ba5a5(0xa2)]+_0x2ba5a5(0x124)+_0x2ba5a5(0xb4));},'resolveEmbeddedActivationId':async(_0x24acb2,_0x5d911b)=>{const _0x442d54=_0x597bf1,_0x5f36e7=_0x459f41[_0x442d54(0x153)](_0x24acb2);if(_0x5f36e7)return _0x5f36e7;if(_0xc4bc65[_0x442d54(0xbf)])return _0x27c947[_0x442d54(0x129)](_0x24acb2,_0x5d911b),createPendingActivationId(_0x24acb2);if(_0xc4bc65[_0x442d54(0x100)]){await _0x4c62f3();const _0x5a8666=_0x459f41[_0x442d54(0x153)](_0x5d911b[_0x442d54(0xa2)]);if(_0x5a8666)return _0x459f41['set'](_0x24acb2,_0x5a8666),_0x5a8666;const _0x4f2ca0=activationSignature(_0x5d911b),_0x37fa38=_0x24c250?.['get'](_0x4f2ca0);if(_0x37fa38)return _0x459f41[_0x442d54(0x129)](_0x24acb2,_0x37fa38),_0x37fa38;const _0x3177f1=await _0x35e680(_0x5d911b,_0x2ebb62['activationContext']),_0x54f782={..._0x3177f1,..._0x5d911b['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x5d911b[_0x442d54(0x134)]}},_0x27369=await _0xd6ee78[_0x442d54(0x82)][_0x442d54(0xc2)](_0xc4bc65[_0x442d54(0x100)]['id'],_0x54f782);return _0x459f41[_0x442d54(0x129)](_0x24acb2,_0x27369['id']),_0x27369['id'];}throw new SDKError(ErrorCode[_0x442d54(0x90)],_0x442d54(0x115));},'resolveJourneyId':async _0x56527d=>{const _0xf00cd4=_0x597bf1;try{return await _0xd6ee78[_0xf00cd4(0x82)][_0xf00cd4(0x86)](_0x59c191[_0xf00cd4(0x107)],_0x56527d);}catch(_0x1b6a14){throw new SDKError(ErrorCode[_0xf00cd4(0x103)],_0xf00cd4(0x12f)+_0x56527d+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xc4bc65[_0xf00cd4(0xa8)][_0xf00cd4(0xa2)]+'\x27)',_0x1b6a14);}},'resolveStageId':async(_0xf30d4f,_0x535de6)=>{const _0x342159=_0x597bf1,_0x2bd85a=await _0xd6ee78[_0x342159(0x82)][_0x342159(0x120)](_0xf30d4f),_0x5e4bd4=_0x2bd85a[_0x342159(0x9f)][_0x342159(0x14e)][_0x342159(0x119)](_0x40ea8d=>_0x40ea8d[_0x342159(0xa2)][_0x342159(0x8d)]()===_0x535de6[_0x342159(0x8d)]());if(!_0x5e4bd4?.['id'])throw new SDKError(ErrorCode[_0x342159(0x103)],_0x342159(0x80)+_0x535de6+_0x342159(0xa0)+(_0x2bd85a[_0x342159(0x9f)][_0x342159(0x15d)]||_0x2bd85a[_0x342159(0x9f)]['name'])+'\x27');return _0x5e4bd4['id'];}},_0xf7a7c1=await _0x76ba8b(_0xc4bc65[_0x597bf1(0xa8)],_0x59c191[_0x597bf1(0x107)],_0x303fad),_0x1fd85f=_0x59c191['folderId']||_0x59c191[_0x597bf1(0x132)];_0x1fd85f&&(_0xf7a7c1[_0x597bf1(0x81)]={'parentFolder':{'data':{'id':_0x1fd85f,'type':_0x597bf1(0x9b)}}});if(_0xc4bc65[_0x597bf1(0xbf)]){if(_0x20195b[_0x597bf1(0xe4)]>0x0||_0x27c947['size']>0x0)return await executeThreeStepJourneyCreate(_0xd6ee78,_0xc4bc65,_0xf7a7c1,{'pendingEmbeddedSegments':_0x20195b,'pendingEmbeddedActivations':_0x27c947,'embeddedSegmentNameToId':_0x571d00,'journeyActivationNameToId':_0x459f41},{..._0x59c191,'effectiveFolderId':_0x1fd85f},_0x2ebb62,_0x263e22,_0x23f29e);else{ensureJourneyDefaults(_0xf7a7c1[_0x597bf1(0x9f)]);const _0x2ff468=await _0xd6ee78[_0x597bf1(0x82)][_0x597bf1(0x108)](_0xf7a7c1);return deletePushRecovery(_0xc4bc65['absolutePath']),{'action':_0x597bf1(0x14f),'journeyId':_0x2ff468['id'],'embeddedSegmentNameToId':_0x571d00};}}else{if(_0xc4bc65[_0x597bf1(0xa4)]&&_0xc4bc65[_0x597bf1(0x100)]){_0xf7a7c1['id']=_0xc4bc65[_0x597bf1(0x100)]['id'];const _0x97b3ee=_0xf7a7c1[_0x597bf1(0x9f)];_0xc4bc65[_0x597bf1(0x100)][_0x597bf1(0x9f)]?.[_0x597bf1(0x15d)]&&(_0x97b3ee[_0x597bf1(0x15d)]=_0xc4bc65['existingJourney']['attributes'][_0x597bf1(0x15d)]);const _0x27b823=_0xc4bc65[_0x597bf1(0x100)][_0x597bf1(0x9f)]?.[_0x597bf1(0x14e)];return _0x27b823&&_0xf7a7c1[_0x597bf1(0x9f)]['journeyStages']&&injectExistingStageIds(_0xf7a7c1[_0x597bf1(0x9f)][_0x597bf1(0x14e)],_0x27b823),ensureJourneyDefaults(_0x97b3ee),await _0xd6ee78[_0x597bf1(0x82)][_0x597bf1(0xc3)](_0xc4bc65[_0x597bf1(0x100)]['id'],_0xf7a7c1),deletePushRecovery(_0xc4bc65[_0x597bf1(0x71)]),{'action':_0x597bf1(0x72),'journeyId':_0xc4bc65[_0x597bf1(0x100)]['id'],'embeddedSegmentNameToId':_0x571d00};}}return deletePushRecovery(_0xc4bc65[_0x597bf1(0x71)]),{'action':'unchanged','journeyId':_0xc4bc65[_0x597bf1(0x100)]?.['id'],'embeddedSegmentNameToId':_0x571d00};}function findSegmentCriteriaLocation(_0x480f13,_0x59d338){const _0x40a5f0=a172_0x504867,_0x4f8d82=_0x480f13['stages']||_0x480f13['journeys']?.[0x0]?.['stages']||[];let _0xdbf25f=_0x40a5f0(0x152),_0x5b2eef=_0x59d338;const _0x1b8ad7=_0x480f13[_0x40a5f0(0x11e)]||_0x480f13[_0x40a5f0(0x156)]?.[0x0]?.[_0x40a5f0(0x11e)];if(_0x1b8ad7?.[_0x40a5f0(0x165)]===_0x59d338)return{'stageName':'goal','criteriaName':_0x1b8ad7[_0x40a5f0(0xa2)]||_0x59d338};_0x46d080:for(const _0x36d58c of _0x4f8d82){if(_0x36d58c[_0x40a5f0(0xba)]?.['segment']===_0x59d338){_0xdbf25f=_0x36d58c[_0x40a5f0(0xa2)],_0x5b2eef=_0x36d58c['entry_criteria']['name']||_0x59d338;break;}if(_0x36d58c[_0x40a5f0(0x160)])for(const _0x276d15 of _0x36d58c[_0x40a5f0(0x160)]){if(_0x276d15['type']==='decision_point'&&_0x276d15[_0x40a5f0(0xe8)]?.['branches'])for(const _0x42a973 of _0x276d15[_0x40a5f0(0xe8)][_0x40a5f0(0x118)]){if(_0x42a973[_0x40a5f0(0x165)]===_0x59d338){_0xdbf25f=_0x36d58c['name'],_0x5b2eef=_0x42a973['name']||_0x59d338;break _0x46d080;}}}}return{'stageName':_0xdbf25f,'criteriaName':_0x5b2eef};}async function executeThreeStepJourneyCreate(_0x46ada0,_0x312d2f,_0x59455c,_0x2cec98,_0x101039,_0x2a50d4,_0x5567e3,_0x2df378){const _0x13dfcc=a172_0x504867,{activationDefToCreateRequest:_0x36cf40,yamlRuleToApi:_0x92800f}=_0x2df378,{pendingEmbeddedSegments:_0xeaafd0,pendingEmbeddedActivations:_0x45cbd8,embeddedSegmentNameToId:_0x544100}=_0x2cec98,_0x3fec90=JSON[_0x13dfcc(0x92)](JSON[_0x13dfcc(0x13b)](_0x59455c));ensureJourneyDefaults(_0x3fec90[_0x13dfcc(0x9f)]),stripPendingIds(_0x3fec90);const _0xff7a25=await _0x46ada0[_0x13dfcc(0x82)]['create'](_0x3fec90),_0x61edb0=_0xff7a25['id'],_0x3a705b=new Map();for(const _0x1f63a4 of _0xff7a25[_0x13dfcc(0x9f)]['journeyStages']){_0x3a705b[_0x13dfcc(0x129)](_0x1f63a4[_0x13dfcc(0xa2)]['toLowerCase'](),_0x1f63a4['id']);}recoverSegmentIdsFromPushRecovery(_0x312d2f,_0x544100,_0x2a50d4[_0x13dfcc(0xf7)]);for(const [_0x365493,{definition:_0x2a8740}]of _0xeaafd0){if(_0x544100[_0x13dfcc(0xff)](_0x365493)){_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x6d),'journeyName':_0x312d2f[_0x13dfcc(0xa8)]['name'],'segmentName':_0x365493});continue;}const _0x1ecc88=generateDeterministicJourneySegmentName(_0x312d2f['yamlConfig']['name'],_0x365493);_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0xb7),'journeyName':_0x312d2f['yamlConfig'][_0x13dfcc(0xa2)],'segmentName':_0x365493});const _0x415ded=createSegmentIdResolver(_0x2a50d4[_0x13dfcc(0xf7)],_0x365493),_0x4f76ab=await resolveRuleSegmentIds(_0x2a8740[_0x13dfcc(0xfb)],_0x415ded),_0x18004b=await createOrRecoverEmbeddedSegment(_0x46ada0,_0x312d2f,{'localName':_0x365493,'uniqueSegmentName':_0x1ecc88,'description':_0x2a8740['description']||_0x13dfcc(0xf5)+_0x365493,'journeyId':_0x61edb0,'resolvedRule':_0x4f76ab,'parentId':_0x101039[_0x13dfcc(0x107)],'folderId':_0x101039[_0x13dfcc(0xae)]||''},_0x92800f);_0x544100[_0x13dfcc(0x129)](_0x365493,_0x18004b),_0x2a50d4['segmentNameToId'][_0x13dfcc(0x129)](_0x365493,_0x18004b),_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x6d),'journeyName':_0x312d2f[_0x13dfcc(0xa8)][_0x13dfcc(0xa2)],'segmentName':_0x365493});}const _0x3acb78=new Map();for(const [_0x25cce3,_0x1d448e]of _0x45cbd8){_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x7c),'journeyName':_0x312d2f['yamlConfig'][_0x13dfcc(0xa2)],'activationName':_0x25cce3});const _0x39d85d=await _0x36cf40(_0x1d448e,_0x2a50d4['activationContext']),_0x53d2de={..._0x39d85d,..._0x1d448e[_0x13dfcc(0x134)]!==undefined&&{'runAfterJourneyRefresh':_0x1d448e[_0x13dfcc(0x134)]}},_0x6d469d=await _0x46ada0[_0x13dfcc(0x82)][_0x13dfcc(0xc2)](_0x61edb0,_0x53d2de);_0x3acb78[_0x13dfcc(0x129)](_0x25cce3,_0x6d469d['id']),_0x2cec98[_0x13dfcc(0x130)]['set'](_0x25cce3,_0x6d469d['id']),_0x5567e3[_0x13dfcc(0xed)]?.({'type':_0x13dfcc(0x84),'journeyName':_0x312d2f[_0x13dfcc(0xa8)][_0x13dfcc(0xa2)],'activationName':_0x25cce3});}const _0x127a0c=JSON[_0x13dfcc(0x92)](JSON[_0x13dfcc(0x13b)](_0x59455c));return _0x127a0c['id']=_0x61edb0,ensureJourneyDefaults(_0x127a0c[_0x13dfcc(0x9f)]),resolvePendingIdsInRequest(_0x127a0c,_0x59455c,_0x3a705b,_0x544100,_0x3acb78,_0x5567e3),await _0x46ada0[_0x13dfcc(0x82)][_0x13dfcc(0xc3)](_0x61edb0,_0x127a0c),deletePushRecovery(_0x312d2f[_0x13dfcc(0x71)]),{'action':'created','journeyId':_0x61edb0,'embeddedSegmentNameToId':_0x544100};}export function stripWaitStepPendingIds(_0x5e0086){const _0x4d2b13=a172_0x504867,_0x29705c=_0x5e0086[_0x4d2b13(0x93)]&&isPendingSegmentId(_0x5e0086[_0x4d2b13(0x93)]),_0x4d9bd6=_0x5e0086['conditions']?.[_0x4d2b13(0x13a)](_0x2aeb73=>_0x2aeb73[_0x4d2b13(0xcf)]&&isPendingSegmentId(_0x2aeb73[_0x4d2b13(0xcf)]));(_0x29705c||_0x4d9bd6)&&(_0x5e0086[_0x4d2b13(0x8a)]=_0x4d2b13(0xe1),_0x5e0086['waitStep']=0x1,_0x5e0086['waitStepUnit']=_0x4d2b13(0xd6),delete _0x5e0086[_0x4d2b13(0x93)],delete _0x5e0086[_0x4d2b13(0x11d)],delete _0x5e0086[_0x4d2b13(0xd3)],delete _0x5e0086[_0x4d2b13(0x6a)]);}export function resolveWaitStepPendingIds(_0x948418,_0x5e2d91,_0x428a2a,_0x43d8d4){const _0x171891=a172_0x504867;if(_0x5e2d91[_0x171891(0x93)]&&isPendingSegmentId(_0x5e2d91[_0x171891(0x93)])){const _0x3abb60=_0x428a2a(_0x5e2d91[_0x171891(0x93)],_0x171891(0xf0)+_0x43d8d4+_0x171891(0x14d));_0x3abb60&&(_0x948418[_0x171891(0x8a)]=_0x171891(0x98),_0x948418[_0x171891(0x93)]=_0x3abb60,delete _0x948418[_0x171891(0x164)],delete _0x948418['waitStepUnit'],_0x5e2d91['conditionTimeoutDuration']!==undefined&&(_0x948418[_0x171891(0x11d)]=_0x5e2d91[_0x171891(0x11d)]),_0x5e2d91[_0x171891(0xd3)]&&(_0x948418['conditionTimeoutUnit']=_0x5e2d91[_0x171891(0xd3)]));}if(_0x5e2d91[_0x171891(0x6a)]){const _0x37f9e7=_0x5e2d91[_0x171891(0x6a)][_0x171891(0x13a)](_0x5c3c8=>_0x5c3c8[_0x171891(0xcf)]&&isPendingSegmentId(_0x5c3c8['segmentId']));if(_0x37f9e7){const _0x57e892=_0x5e2d91['conditions']['map'](_0xf62320=>{const _0x5deec1=_0x171891;if(_0xf62320[_0x5deec1(0xcf)]&&isPendingSegmentId(_0xf62320['segmentId'])){const _0x5edcdd=_0x428a2a(_0xf62320[_0x5deec1(0xcf)],_0x5deec1(0xf0)+_0x43d8d4+'\x27\x20wait\x20condition');return{..._0xf62320,'segmentId':_0x5edcdd||_0xf62320[_0x5deec1(0xcf)]};}return{..._0xf62320};});_0x948418[_0x171891(0x8a)]=_0x171891(0x98),_0x948418[_0x171891(0x6a)]=_0x57e892,delete _0x948418[_0x171891(0x164)],delete _0x948418[_0x171891(0xe6)],delete _0x948418[_0x171891(0x93)],delete _0x948418[_0x171891(0x11d)],delete _0x948418[_0x171891(0xd3)];}}}function stripPendingIds(_0x5acaef){const _0x452fd5=a172_0x504867;_0x5acaef['attributes'][_0x452fd5(0x11e)]?.[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x5acaef[_0x452fd5(0x9f)][_0x452fd5(0x11e)][_0x452fd5(0xcf)])&&delete _0x5acaef['attributes'][_0x452fd5(0x11e)];for(const _0x322c42 of _0x5acaef[_0x452fd5(0x9f)][_0x452fd5(0x14e)]||[]){_0x322c42[_0x452fd5(0x159)]?.[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x322c42[_0x452fd5(0x159)][_0x452fd5(0xcf)])&&delete _0x322c42[_0x452fd5(0x159)];_0x322c42[_0x452fd5(0xb1)]?.[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x322c42[_0x452fd5(0xb1)]['segmentId'])&&delete _0x322c42[_0x452fd5(0xb1)];_0x322c42['exitCriterias']&&(_0x322c42[_0x452fd5(0x11b)]=_0x322c42[_0x452fd5(0x11b)][_0x452fd5(0xa5)](_0x59ecf6=>!_0x59ecf6[_0x452fd5(0xcf)]||!isPendingSegmentId(_0x59ecf6[_0x452fd5(0xcf)])));if(_0x322c42['steps'])for(const _0x20ddd8 of Object[_0x452fd5(0xc9)](_0x322c42[_0x452fd5(0x160)])){const _0xe3d2f1=_0x322c42[_0x452fd5(0x160)][_0x20ddd8];_0xe3d2f1['type']===_0x452fd5(0x6b)&&_0xe3d2f1[_0x452fd5(0xdf)]&&isPendingActivationId(_0xe3d2f1[_0x452fd5(0xdf)])&&(_0xe3d2f1[_0x452fd5(0xdf)]='');if(_0xe3d2f1[_0x452fd5(0xdd)]===_0x452fd5(0xb9)&&_0xe3d2f1[_0x452fd5(0x118)])for(const _0x273973 of _0xe3d2f1['branches']){_0x273973[_0x452fd5(0xcf)]&&isPendingSegmentId(_0x273973[_0x452fd5(0xcf)])&&(_0x273973[_0x452fd5(0xcf)]='');}_0xe3d2f1[_0x452fd5(0xdd)]===_0x452fd5(0x6c)&&stripWaitStepPendingIds(_0xe3d2f1);}}}function resolvePendingIdsInRequest(_0x387eb6,_0x19fd14,_0x584bad,_0x57507a,_0x4dbdc0,_0x3b5253){const _0xe489dd=a172_0x504867,_0x55569c=(_0x4be93c,_0xadbe82)=>{const _0x327ddc=a172_0xbe52;if(!isPendingSegmentId(_0x4be93c))return _0x4be93c;const _0x49d852=extractPendingSegmentName(_0x4be93c),_0x4438de=_0x57507a[_0x327ddc(0x153)](_0x49d852);return!_0x4438de&&_0x3b5253[_0x327ddc(0x127)]?.(_0x327ddc(0x8b)+_0x49d852+_0x327ddc(0x13f)+_0xadbe82),_0x4438de;};if(_0x387eb6['attributes'][_0xe489dd(0x11e)]?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x11e)][_0xe489dd(0xcf)])){const _0x3814a3=_0x55569c(_0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x11e)][_0xe489dd(0xcf)],'goal\x20criteria');_0x3814a3&&(_0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x11e)][_0xe489dd(0xcf)]=_0x3814a3);}for(const _0x1f8b78 of _0x387eb6[_0xe489dd(0x9f)][_0xe489dd(0x14e)]||[]){const _0x142625=_0x584bad[_0xe489dd(0x153)](_0x1f8b78[_0xe489dd(0xa2)][_0xe489dd(0x8d)]());_0x142625&&(_0x1f8b78['id']=_0x142625);if(_0x1f8b78[_0xe489dd(0x159)]?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x1f8b78['entryCriteria'][_0xe489dd(0xcf)])){const _0xc2664c=_0x55569c(_0x1f8b78[_0xe489dd(0x159)]['segmentId'],_0xe489dd(0xf0)+_0x1f8b78['name']+'\x27\x20entry\x20criteria');_0xc2664c&&(_0x1f8b78[_0xe489dd(0x159)][_0xe489dd(0xcf)]=_0xc2664c);}if(_0x1f8b78[_0xe489dd(0x11b)])for(const _0x19ae34 of _0x1f8b78[_0xe489dd(0x11b)]){if(_0x19ae34[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x19ae34[_0xe489dd(0xcf)])){const _0x53e0d5=_0x55569c(_0x19ae34[_0xe489dd(0xcf)],_0xe489dd(0xf0)+_0x1f8b78[_0xe489dd(0xa2)]+'\x27\x20exit\x20criteria');_0x53e0d5&&(_0x19ae34['segmentId']=_0x53e0d5);}}if(_0x1f8b78['milestone']?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x1f8b78[_0xe489dd(0xb1)][_0xe489dd(0xcf)])){const _0x1bc370=_0x55569c(_0x1f8b78['milestone'][_0xe489dd(0xcf)],_0xe489dd(0xf0)+_0x1f8b78[_0xe489dd(0xa2)]+_0xe489dd(0x8f));_0x1bc370&&(_0x1f8b78[_0xe489dd(0xb1)][_0xe489dd(0xcf)]=_0x1bc370);}if(_0x1f8b78[_0xe489dd(0x160)]){const _0x1e639c=_0x2caee1=>_0x19fd14[_0xe489dd(0x9f)][_0xe489dd(0x14e)]?.['find'](_0x429e17=>_0x429e17[_0xe489dd(0xa2)][_0xe489dd(0x8d)]()===_0x1f8b78['name'][_0xe489dd(0x8d)]())?.[_0xe489dd(0x160)]?.[_0x2caee1];for(const _0x4c27dd of Object[_0xe489dd(0xc9)](_0x1f8b78['steps'])){const _0x40a66b=_0x1f8b78[_0xe489dd(0x160)][_0x4c27dd],_0x95e223=_0x1e639c(_0x4c27dd);if(_0x40a66b[_0xe489dd(0xdd)]==='Activation'&&_0x40a66b['journeyActivationStepId']&&(isPendingActivationId(_0x40a66b[_0xe489dd(0xdf)])||_0x40a66b[_0xe489dd(0xdf)]==='')){if(_0x95e223?.['journeyActivationStepId']&&isPendingActivationId(_0x95e223[_0xe489dd(0xdf)])){const _0x29ae26=extractPendingActivationName(_0x95e223['journeyActivationStepId']),_0x4b92d7=_0x4dbdc0[_0xe489dd(0x153)](_0x29ae26);_0x4b92d7&&(_0x40a66b[_0xe489dd(0xdf)]=_0x4b92d7);}}if(_0x40a66b[_0xe489dd(0xdd)]===_0xe489dd(0xb9)&&_0x40a66b[_0xe489dd(0x118)]&&_0x95e223?.['branches'])for(let _0xa32952=0x0;_0xa32952<_0x40a66b[_0xe489dd(0x118)]['length'];_0xa32952++){const _0x37817d=_0x40a66b['branches'][_0xa32952],_0x5dad84=_0x95e223[_0xe489dd(0x118)][_0xa32952];if(_0x5dad84?.[_0xe489dd(0xcf)]&&isPendingSegmentId(_0x5dad84[_0xe489dd(0xcf)])){const _0x44d3ae=_0x55569c(_0x5dad84[_0xe489dd(0xcf)],_0xe489dd(0xf0)+_0x1f8b78[_0xe489dd(0xa2)]+_0xe489dd(0x7e)+(_0x37817d[_0xe489dd(0xa2)]||_0xa32952)+'\x27');_0x44d3ae&&(_0x37817d[_0xe489dd(0xcf)]=_0x44d3ae);}}_0x40a66b[_0xe489dd(0xdd)]===_0xe489dd(0x6c)&&_0x95e223?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x40a66b,_0x95e223,_0x55569c,_0x1f8b78[_0xe489dd(0xa2)]);}}}}
@@ -1 +1 @@
1
- function a170_0x5db3(){const _0x27e618=['2362086vBnpno','name','4876Qarbkv','554596lQtaFZ','get','set','624DYPlcU','128733opreiI','573XbfSrU','has','6RsnIEM','15252TahKxn','88590mlkFkV','70620LiMFks','4xoWTjI','24GhhHrV','150SoySkJ','add','parentFolderId'];a170_0x5db3=function(){return _0x27e618;};return a170_0x5db3();}(function(_0x43129d,_0x1914e6){const _0x28fdc6=a170_0x1a3a,_0x341e56=_0x43129d();while(!![]){try{const _0x425c00=-parseInt(_0x28fdc6(0x1a3))/0x1*(parseInt(_0x28fdc6(0x1a1))/0x2)+-parseInt(_0x28fdc6(0x19d))/0x3*(-parseInt(_0x28fdc6(0x1aa))/0x4)+parseInt(_0x28fdc6(0x1a2))/0x5*(parseInt(_0x28fdc6(0x19f))/0x6)+parseInt(_0x28fdc6(0x1ab))/0x7*(parseInt(_0x28fdc6(0x1a4))/0x8)+-parseInt(_0x28fdc6(0x1a8))/0x9+parseInt(_0x28fdc6(0x1a5))/0xa*(parseInt(_0x28fdc6(0x19c))/0xb)+-parseInt(_0x28fdc6(0x1a0))/0xc*(parseInt(_0x28fdc6(0x1ae))/0xd);if(_0x425c00===_0x1914e6)break;else _0x341e56['push'](_0x341e56['shift']());}catch(_0x45bc9c){_0x341e56['push'](_0x341e56['shift']());}}}(a170_0x5db3,0x26f34));export function buildFolderIdToPathMap(_0x26a7a2){const _0x387eab=a170_0x1a3a,_0x436f99=new Map(),_0x5dd81e=new Map();for(const _0x16f8a6 of _0x26a7a2){_0x5dd81e[_0x387eab(0x1ad)](_0x16f8a6['id'],_0x16f8a6);}const _0x36c588=new Set();for(const _0x17fbb4 of _0x26a7a2){!_0x17fbb4[_0x387eab(0x1a7)]&&_0x36c588['add'](_0x17fbb4['id']);}function _0xe1c30a(_0x47c05f){const _0x45df67=_0x387eab;if(_0x436f99[_0x45df67(0x19e)](_0x47c05f['id']))return _0x436f99[_0x45df67(0x1ac)](_0x47c05f['id']);if(_0x36c588['has'](_0x47c05f['id']))return _0x436f99[_0x45df67(0x1ad)](_0x47c05f['id'],''),'';if(_0x47c05f['parentFolderId']){const _0x3e4d06=_0x5dd81e[_0x45df67(0x1ac)](_0x47c05f[_0x45df67(0x1a7)]);if(_0x3e4d06){const _0xd8e5cf=_0xe1c30a(_0x3e4d06),_0x14f83c=_0xd8e5cf?_0xd8e5cf+'/'+_0x47c05f[_0x45df67(0x1a9)]:_0x47c05f[_0x45df67(0x1a9)];return _0x436f99['set'](_0x47c05f['id'],_0x14f83c),_0x14f83c;}}const _0x1879d0=_0x47c05f[_0x45df67(0x1a9)];return _0x436f99['set'](_0x47c05f['id'],_0x1879d0),_0x1879d0;}for(const _0x11fdfd of _0x26a7a2){_0xe1c30a(_0x11fdfd);}return _0x436f99;}export function buildFolderPathToIdMap(_0x57dece){const _0x576ba7=a170_0x1a3a,_0x41a6a9=new Map(),_0x44a425=new Map();for(const _0x5d3208 of _0x57dece){_0x44a425[_0x576ba7(0x1ad)](_0x5d3208['id'],_0x5d3208);}const _0x325f69=new Set();for(const _0x2d2b9c of _0x57dece){!_0x2d2b9c[_0x576ba7(0x1a7)]&&_0x325f69[_0x576ba7(0x1a6)](_0x2d2b9c['id']);}function _0x5c271a(_0x3a2dc3){const _0x18c8eb=_0x576ba7;if(_0x325f69[_0x18c8eb(0x19e)](_0x3a2dc3['id']))return'';if(_0x3a2dc3[_0x18c8eb(0x1a7)]){const _0x9d83ae=_0x44a425[_0x18c8eb(0x1ac)](_0x3a2dc3['parentFolderId']);if(_0x9d83ae){const _0x4a7c80=_0x5c271a(_0x9d83ae);return _0x4a7c80?_0x4a7c80+'/'+_0x3a2dc3[_0x18c8eb(0x1a9)]:_0x3a2dc3[_0x18c8eb(0x1a9)];}}return _0x3a2dc3[_0x18c8eb(0x1a9)];}for(const _0x2384d8 of _0x57dece){const _0x3bc68b=_0x5c271a(_0x2384d8);_0x41a6a9[_0x576ba7(0x1ad)](_0x3bc68b,_0x2384d8['id']);}return _0x41a6a9;}function a170_0x1a3a(_0x115536,_0x5161dd){_0x115536=_0x115536-0x19c;const _0x5db382=a170_0x5db3();let _0x1a3a30=_0x5db382[_0x115536];return _0x1a3a30;}export function buildFolderMaps(_0x1df256){const _0x35e803=a170_0x1a3a,_0x823460=buildFolderIdToPathMap(_0x1df256),_0x497cc=new Map();for(const [_0x162d8e,_0x32de30]of _0x823460){_0x497cc[_0x35e803(0x1ad)](_0x32de30,_0x162d8e);}return{'idToPath':_0x823460,'pathToId':_0x497cc};}export function getFolderPath(_0x4c6eb5,_0x3535cb){const _0x2dc14a=a170_0x1a3a;if(!_0x4c6eb5)return'';return _0x3535cb[_0x2dc14a(0x1ac)](_0x4c6eb5)??'';}
1
+ (function(_0x4f74f1,_0x452451){const _0x274403=a173_0x4abc,_0x46d658=_0x4f74f1();while(!![]){try{const _0x17d4fd=parseInt(_0x274403(0x19a))/0x1+-parseInt(_0x274403(0x197))/0x2+-parseInt(_0x274403(0x19b))/0x3+parseInt(_0x274403(0x195))/0x4*(parseInt(_0x274403(0x191))/0x5)+parseInt(_0x274403(0x192))/0x6+-parseInt(_0x274403(0x193))/0x7*(-parseInt(_0x274403(0x199))/0x8)+parseInt(_0x274403(0x18f))/0x9*(parseInt(_0x274403(0x190))/0xa);if(_0x17d4fd===_0x452451)break;else _0x46d658['push'](_0x46d658['shift']());}catch(_0x4a51ac){_0x46d658['push'](_0x46d658['shift']());}}}(a173_0x1d99,0xe6654));function a173_0x4abc(_0x5c2d2f,_0x28398f){_0x5c2d2f=_0x5c2d2f-0x18d;const _0x1d9907=a173_0x1d99();let _0x4abce3=_0x1d9907[_0x5c2d2f];return _0x4abce3;}export function buildFolderIdToPathMap(_0x2e821f){const _0x1cac1e=a173_0x4abc,_0x284285=new Map(),_0x2485bc=new Map();for(const _0x5c910d of _0x2e821f){_0x2485bc['set'](_0x5c910d['id'],_0x5c910d);}const _0x1023b0=new Set();for(const _0x243755 of _0x2e821f){!_0x243755[_0x1cac1e(0x196)]&&_0x1023b0['add'](_0x243755['id']);}function _0x8e5a32(_0x4a378c){const _0x1d8981=_0x1cac1e;if(_0x284285[_0x1d8981(0x198)](_0x4a378c['id']))return _0x284285[_0x1d8981(0x19c)](_0x4a378c['id']);if(_0x1023b0[_0x1d8981(0x198)](_0x4a378c['id']))return _0x284285['set'](_0x4a378c['id'],''),'';if(_0x4a378c[_0x1d8981(0x196)]){const _0x283fbd=_0x2485bc['get'](_0x4a378c['parentFolderId']);if(_0x283fbd){const _0x11dddf=_0x8e5a32(_0x283fbd),_0x59988b=_0x11dddf?_0x11dddf+'/'+_0x4a378c['name']:_0x4a378c['name'];return _0x284285['set'](_0x4a378c['id'],_0x59988b),_0x59988b;}}const _0x38fce4=_0x4a378c['name'];return _0x284285[_0x1d8981(0x194)](_0x4a378c['id'],_0x38fce4),_0x38fce4;}for(const _0x3bbc67 of _0x2e821f){_0x8e5a32(_0x3bbc67);}return _0x284285;}function a173_0x1d99(){const _0x509ed9=['2292805MGjqcY','2000676OpOhzo','82054dWruDJ','set','4QWIQHN','parentFolderId','680474VfEnBE','has','392seJfuv','283810Aqnsis','4470150VhwRAM','get','name','add','18YPTcpZ','5618960ZRZOXO'];a173_0x1d99=function(){return _0x509ed9;};return a173_0x1d99();}export function buildFolderPathToIdMap(_0x9aa6){const _0x3e06c9=a173_0x4abc,_0x254b35=new Map(),_0x43edf8=new Map();for(const _0x475d20 of _0x9aa6){_0x43edf8[_0x3e06c9(0x194)](_0x475d20['id'],_0x475d20);}const _0xc32d57=new Set();for(const _0x471263 of _0x9aa6){!_0x471263['parentFolderId']&&_0xc32d57[_0x3e06c9(0x18e)](_0x471263['id']);}function _0x206c7b(_0xbbfd9c){const _0x417e6a=_0x3e06c9;if(_0xc32d57[_0x417e6a(0x198)](_0xbbfd9c['id']))return'';if(_0xbbfd9c['parentFolderId']){const _0x5de34c=_0x43edf8['get'](_0xbbfd9c[_0x417e6a(0x196)]);if(_0x5de34c){const _0x470428=_0x206c7b(_0x5de34c);return _0x470428?_0x470428+'/'+_0xbbfd9c[_0x417e6a(0x18d)]:_0xbbfd9c[_0x417e6a(0x18d)];}}return _0xbbfd9c['name'];}for(const _0xe6ca21 of _0x9aa6){const _0xdc3252=_0x206c7b(_0xe6ca21);_0x254b35['set'](_0xdc3252,_0xe6ca21['id']);}return _0x254b35;}export function buildFolderMaps(_0x848d7b){const _0x499883=a173_0x4abc,_0x4e9a1b=buildFolderIdToPathMap(_0x848d7b),_0x20e2f6=new Map();for(const [_0x1364f4,_0x1bc06a]of _0x4e9a1b){_0x20e2f6[_0x499883(0x194)](_0x1bc06a,_0x1364f4);}return{'idToPath':_0x4e9a1b,'pathToId':_0x20e2f6};}export function getFolderPath(_0x401c52,_0x1235a5){const _0x24ebbd=a173_0x4abc;if(!_0x401c52)return'';return _0x1235a5[_0x24ebbd(0x19c)](_0x401c52)??'';}
@@ -1 +1 @@
1
- (function(_0x573b51,_0x1880f5){const _0x239748=a171_0x2be2,_0x56fb56=_0x573b51();while(!![]){try{const _0x4c535e=parseInt(_0x239748(0x1db))/0x1*(parseInt(_0x239748(0x1f4))/0x2)+-parseInt(_0x239748(0x1e5))/0x3+-parseInt(_0x239748(0x1ea))/0x4+-parseInt(_0x239748(0x1d3))/0x5+parseInt(_0x239748(0x1dc))/0x6+-parseInt(_0x239748(0x1e1))/0x7+parseInt(_0x239748(0x1f7))/0x8*(parseInt(_0x239748(0x1fb))/0x9);if(_0x4c535e===_0x1880f5)break;else _0x56fb56['push'](_0x56fb56['shift']());}catch(_0x265039){_0x56fb56['push'](_0x56fb56['shift']());}}}(a171_0x30ab,0x7a48e));import a171_0x2ec83f from'path';import{parse as a171_0x3663e5}from'yaml';function a171_0x2be2(_0x1c66c9,_0x2b8f54){_0x1c66c9=_0x1c66c9-0x1cd;const _0x30ab01=a171_0x30ab();let _0x2be2ac=_0x30ab01[_0x1c66c9];return _0x2be2ac;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x103a12){const _0x332b2a=a171_0x2be2;if(!_0x103a12||_0x103a12[_0x332b2a(0x1f8)]()==='')throw new Error(_0x332b2a(0x1fa));const _0xfab9a1=_0x103a12[_0x332b2a(0x1f8)]();if(_0xfab9a1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x103a12};const _0x3cc320=_0xfab9a1['startsWith']('/')?_0xfab9a1[_0x332b2a(0x1e2)](0x1):_0xfab9a1,_0x278c49=_0x3cc320[_0x332b2a(0x1e9)]('/')[_0x332b2a(0x1da)](_0x3c9dee=>_0x3c9dee!=='');if(_0x278c49['length']===0x0)throw new Error(_0x332b2a(0x1ee));const _0x154e56=_0xfab9a1['startsWith']('/')||!isRelativePathSegment(_0x278c49[0x0]);for(const _0x5cc95a of _0x278c49){validatePathSegment(_0x5cc95a);}return{'segments':_0x278c49,'isAbsolute':_0x154e56,'raw':_0x103a12};}function isRelativePathSegment(_0x58dcaa){return _0x58dcaa==='.'||_0x58dcaa==='..';}function a171_0x30ab(){const _0x4f1a2c=['length','segments','relative','readFile','2614975lUBcqX','test','parse','parent_segment','Relative\x20path\x20cannot\x20be\x20empty','slice','Path\x20attempts\x20to\x20navigate\x20above\x20root','filter','436969QAlCnb','3522972lgYDUI','dirname','replace','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','startsWith','4607197FNYUrN','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','segment','1630023DWzQwj','Cannot\x20navigate\x20above\x20root','File\x20not\x20found:\x20','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','split','2476704ejajMp','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','Cannot\x20split\x20empty\x20path','exists','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20segment\x20cannot\x20be\x20empty','isAbsolute','push','No\x20tdx.json\x20found\x20for\x20file:\x20','raw','2FYJewB','join','resolve','40680UhhjWu','trim','pop','Path\x20cannot\x20be\x20empty','3222jiwUnX','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','name'];a171_0x30ab=function(){return _0x4f1a2c;};return a171_0x30ab();}function validatePathSegment(_0x58f417){const _0x5acb80=a171_0x2be2;if(_0x58f417==='')throw new Error(_0x5acb80(0x1ef));if(_0x58f417==='.'||_0x58f417==='..')return;if(/[\x00-\x1F\x7F]/[_0x5acb80(0x1d4)](_0x58f417))throw new Error(_0x5acb80(0x1df)+_0x58f417);if(_0x58f417!==_0x58f417['trim']()){}}export function validatePath(_0x31f468){const _0x26ce69=a171_0x2be2;if(_0x31f468[_0x26ce69(0x1d0)][_0x26ce69(0x1cf)]===0x0&&!_0x31f468[_0x26ce69(0x1f0)])throw new Error(_0x26ce69(0x1d7));if(_0x31f468[_0x26ce69(0x1f0)]){if(_0x31f468[_0x26ce69(0x1d0)][0x0]==='..')throw new Error(_0x26ce69(0x1e3));let _0x515ca4=0x0;for(const _0x409db4 of _0x31f468['segments']){if(_0x409db4==='..'){if(_0x515ca4===0x0)throw new Error(_0x26ce69(0x1d9));_0x515ca4--;}else _0x409db4!=='.'&&_0x515ca4++;}}}export function joinPaths(_0x4706a2,_0x57d891){const _0x52987a=a171_0x2be2;if(!_0x4706a2||_0x4706a2==='/')return _0x57d891;if(!_0x57d891||_0x57d891==='.')return _0x4706a2;if(_0x57d891[_0x52987a(0x1e0)]('/'))return _0x57d891;const _0x3ca2ce=parsePath(_0x4706a2),_0x11641b=parsePath(_0x57d891),_0x3e79af=[..._0x3ca2ce[_0x52987a(0x1d0)]];for(const _0x401420 of _0x11641b[_0x52987a(0x1d0)]){if(_0x401420==='.')continue;else{if(_0x401420==='..'){if(_0x3e79af['length']===0x0)throw new Error(_0x52987a(0x1e6));_0x3e79af[_0x52987a(0x1f9)]();}else _0x3e79af[_0x52987a(0x1f1)](_0x401420);}}const _0x36e554=_0x3e79af['join']('/');return _0x3ca2ce[_0x52987a(0x1f3)][_0x52987a(0x1e0)]('/')?'/'+_0x36e554:_0x36e554;}export function normalizePath(_0xe05ffa){const _0x28e0b8=a171_0x2be2,_0x3e69ba=parsePath(_0xe05ffa),_0x5c2bfb=[];for(const _0x5c6cc9 of _0x3e69ba[_0x28e0b8(0x1d0)]){if(_0x5c6cc9==='.')continue;else{if(_0x5c6cc9==='..'){if(_0x5c2bfb[_0x28e0b8(0x1cf)]===0x0){if(_0x3e69ba[_0x28e0b8(0x1f0)])throw new Error(_0x28e0b8(0x1e6));_0x5c2bfb[_0x28e0b8(0x1f1)]('..');}else _0x5c2bfb[_0x5c2bfb[_0x28e0b8(0x1cf)]-0x1]==='..'?_0x5c2bfb['push']('..'):_0x5c2bfb[_0x28e0b8(0x1f9)]();}else _0x5c2bfb[_0x28e0b8(0x1f1)](_0x5c6cc9);}}if(_0x5c2bfb['length']===0x0)return _0x3e69ba[_0x28e0b8(0x1f0)]?'/':'.';const _0x29dd0d=_0x5c2bfb['join']('/');return _0x3e69ba[_0x28e0b8(0x1f3)][_0x28e0b8(0x1e0)]('/')?'/'+_0x29dd0d:_0x29dd0d;}export function getParentPath(_0x249f7d){const _0x7925f2=a171_0x2be2,_0x1493dc=parsePath(_0x249f7d);if(_0x1493dc[_0x7925f2(0x1d0)][_0x7925f2(0x1cf)]<=0x1)return'/';const _0x5e7f12=_0x1493dc[_0x7925f2(0x1d0)]['slice'](0x0,-0x1)[_0x7925f2(0x1f5)]('/');return _0x1493dc[_0x7925f2(0x1f3)][_0x7925f2(0x1e0)]('/')?'/'+_0x5e7f12:_0x5e7f12;}export function getBaseName(_0x238f58){const _0x2f7f1e=a171_0x2be2,_0x1d4e59=parsePath(_0x238f58);return _0x1d4e59[_0x2f7f1e(0x1d0)][_0x1d4e59[_0x2f7f1e(0x1d0)]['length']-0x1]||'';}export function isChildPath(_0x8e6ef4,_0x1dd0d6){const _0x4d9956=a171_0x2be2,_0x4e8e8b=parsePath(_0x8e6ef4),_0x2aa69e=parsePath(_0x1dd0d6);if(_0x4e8e8b[_0x4d9956(0x1d0)]['length']<=_0x2aa69e[_0x4d9956(0x1d0)][_0x4d9956(0x1cf)])return![];for(let _0x4ace51=0x0;_0x4ace51<_0x2aa69e[_0x4d9956(0x1d0)]['length'];_0x4ace51++){if(_0x4e8e8b[_0x4d9956(0x1d0)][_0x4ace51]!==_0x2aa69e[_0x4d9956(0x1d0)][_0x4ace51])return![];}return!![];}export function splitPath(_0x5548c0){const _0x3899aa=a171_0x2be2,_0x237852=parsePath(_0x5548c0);if(_0x237852[_0x3899aa(0x1d0)][_0x3899aa(0x1cf)]===0x0)throw new Error(_0x3899aa(0x1ec));if(_0x237852[_0x3899aa(0x1d0)]['length']===0x1)return{'parent':_0x237852['segments'][0x0]};return{'parent':_0x237852['segments'][0x0],'child':_0x237852['segments'][_0x3899aa(0x1d8)](0x1)[_0x3899aa(0x1f5)]('/')};}export function isYamlFilePath(_0x1e7585){return _0x1e7585['endsWith']('.yml')||_0x1e7585['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x473979,_0x53fef1=nodeFileSystem){const _0x33b4b3=a171_0x2be2,_0x29c04f=a171_0x2ec83f[_0x33b4b3(0x1f6)](_0x473979);if(!await _0x53fef1['exists'](_0x29c04f))throw new Error(_0x33b4b3(0x1e7)+_0x473979);let _0x199637=a171_0x2ec83f['dirname'](_0x29c04f),_0x31f65d=null,_0xedcf66=null;const _0x29dd4e=a171_0x2ec83f[_0x33b4b3(0x1d5)](_0x199637)['root'];while(_0x199637!==_0x29dd4e){const _0x2f0f0d=a171_0x2ec83f[_0x33b4b3(0x1f5)](_0x199637,'tdx.json');if(await _0x53fef1[_0x33b4b3(0x1ed)](_0x2f0f0d)){_0x31f65d=_0x2f0f0d,_0xedcf66=_0x199637;break;}_0x199637=a171_0x2ec83f[_0x33b4b3(0x1dd)](_0x199637);}if(!_0x31f65d||!_0xedcf66)throw new Error(_0x33b4b3(0x1f2)+_0x473979+'\x0a'+_0x33b4b3(0x1e8));const _0x36a7ac=await _0x53fef1['readFile'](_0x31f65d),_0x6d0572=JSON[_0x33b4b3(0x1d5)](_0x36a7ac),_0x308ed3=_0x6d0572[_0x33b4b3(0x1d6)];if(!_0x308ed3)throw new Error(_0x33b4b3(0x1cd));const _0x2dec8=await _0x53fef1[_0x33b4b3(0x1d2)](_0x29c04f),_0x143f05=a171_0x3663e5(_0x2dec8),_0x5f0e91=_0x143f05[_0x33b4b3(0x1ce)];if(!_0x5f0e91)throw new Error(_0x33b4b3(0x1eb)+_0x473979);const _0x543ce8=isJourneyDef(_0x143f05,_0x29c04f)?'journey':_0x33b4b3(0x1e4),_0x4c2253=a171_0x2ec83f[_0x33b4b3(0x1d1)](_0xedcf66,_0x29c04f),_0x516138=a171_0x2ec83f[_0x33b4b3(0x1dd)](_0x4c2253),_0x430789=_0x516138==='.'?'':_0x516138[_0x33b4b3(0x1de)](/\\/g,'/'),_0x1e8cb3=_0x430789?_0x308ed3+'/'+_0x430789+'/'+_0x5f0e91:_0x308ed3+'/'+_0x5f0e91;return{'parentSegment':_0x308ed3,'segmentName':_0x5f0e91,'folderPath':_0x430789,'fullPath':_0x1e8cb3,'resourceType':_0x543ce8,'content':_0x2dec8};}
1
+ (function(_0x4a9923,_0x2a2674){const _0x4ccf55=a174_0x570e,_0x4bb4b0=_0x4a9923();while(!![]){try{const _0x1db7f0=-parseInt(_0x4ccf55(0x16d))/0x1+-parseInt(_0x4ccf55(0x180))/0x2+parseInt(_0x4ccf55(0x196))/0x3+parseInt(_0x4ccf55(0x18e))/0x4+parseInt(_0x4ccf55(0x18d))/0x5*(parseInt(_0x4ccf55(0x189))/0x6)+-parseInt(_0x4ccf55(0x188))/0x7+parseInt(_0x4ccf55(0x171))/0x8;if(_0x1db7f0===_0x2a2674)break;else _0x4bb4b0['push'](_0x4bb4b0['shift']());}catch(_0x243b7e){_0x4bb4b0['push'](_0x4bb4b0['shift']());}}}(a174_0xcf38,0x20ed9));import a174_0x2da46f from'path';import{parse as a174_0x14264a}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x914b){const _0x1af31c=a174_0x570e;if(!_0x914b||_0x914b[_0x1af31c(0x193)]()==='')throw new Error(_0x1af31c(0x197));const _0x3177cf=_0x914b[_0x1af31c(0x193)]();if(_0x3177cf==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x914b};const _0x54dfc9=_0x3177cf[_0x1af31c(0x192)]('/')?_0x3177cf[_0x1af31c(0x16c)](0x1):_0x3177cf,_0x17764f=_0x54dfc9[_0x1af31c(0x17f)]('/')[_0x1af31c(0x174)](_0x5e32bb=>_0x5e32bb!=='');if(_0x17764f[_0x1af31c(0x18c)]===0x0)throw new Error(_0x1af31c(0x16a));const _0x56c754=_0x3177cf[_0x1af31c(0x192)]('/')||!isRelativePathSegment(_0x17764f[0x0]);for(const _0x39b6eb of _0x17764f){validatePathSegment(_0x39b6eb);}return{'segments':_0x17764f,'isAbsolute':_0x56c754,'raw':_0x914b};}function isRelativePathSegment(_0x2e56b8){return _0x2e56b8==='.'||_0x2e56b8==='..';}function validatePathSegment(_0x34211f){const _0x2b22a2=a174_0x570e;if(_0x34211f==='')throw new Error(_0x2b22a2(0x16b));if(_0x34211f==='.'||_0x34211f==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x34211f))throw new Error(_0x2b22a2(0x186)+_0x34211f);if(_0x34211f!==_0x34211f[_0x2b22a2(0x193)]()){}}export function validatePath(_0x328577){const _0xfad0fb=a174_0x570e;if(_0x328577[_0xfad0fb(0x17e)]['length']===0x0&&!_0x328577['isAbsolute'])throw new Error(_0xfad0fb(0x184));if(_0x328577['isAbsolute']){if(_0x328577[_0xfad0fb(0x17e)][0x0]==='..')throw new Error(_0xfad0fb(0x187));let _0xfd4c2b=0x0;for(const _0x21632e of _0x328577[_0xfad0fb(0x17e)]){if(_0x21632e==='..'){if(_0xfd4c2b===0x0)throw new Error(_0xfad0fb(0x185));_0xfd4c2b--;}else _0x21632e!=='.'&&_0xfd4c2b++;}}}function a174_0xcf38(){const _0x3a0a8f=['exists','segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20segment\x20cannot\x20be\x20empty','substring','836hLsklL','relative','slice','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','1737496hCmUdl','No\x20tdx.json\x20found\x20for\x20file:\x20','journey','filter','dirname','push','pop','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','parse','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','isAbsolute','replace','root','segments','split','397352ycBzOr','readFile','resolve','join','Relative\x20path\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','1886031AoWBST','109608PfJuAc','.yaml','endsWith','length','15ElYhUb','1054956FiqJnV','tdx.json','parent_segment','raw','startsWith','trim','Cannot\x20navigate\x20above\x20root','File\x20not\x20found:\x20','204264UQXnzM','Path\x20cannot\x20be\x20empty'];a174_0xcf38=function(){return _0x3a0a8f;};return a174_0xcf38();}export function joinPaths(_0x33ff12,_0x57ff3a){const _0x2e3ae2=a174_0x570e;if(!_0x33ff12||_0x33ff12==='/')return _0x57ff3a;if(!_0x57ff3a||_0x57ff3a==='.')return _0x33ff12;if(_0x57ff3a[_0x2e3ae2(0x192)]('/'))return _0x57ff3a;const _0x3cb4fe=parsePath(_0x33ff12),_0x14f7df=parsePath(_0x57ff3a),_0x505a4a=[..._0x3cb4fe['segments']];for(const _0x2e3d54 of _0x14f7df['segments']){if(_0x2e3d54==='.')continue;else{if(_0x2e3d54==='..'){if(_0x505a4a[_0x2e3ae2(0x18c)]===0x0)throw new Error(_0x2e3ae2(0x194));_0x505a4a[_0x2e3ae2(0x177)]();}else _0x505a4a[_0x2e3ae2(0x176)](_0x2e3d54);}}const _0x3abe76=_0x505a4a[_0x2e3ae2(0x183)]('/');return _0x3cb4fe[_0x2e3ae2(0x191)][_0x2e3ae2(0x192)]('/')?'/'+_0x3abe76:_0x3abe76;}function a174_0x570e(_0xbfb09d,_0x1edbf4){_0xbfb09d=_0xbfb09d-0x169;const _0xcf38bf=a174_0xcf38();let _0x570eaf=_0xcf38bf[_0xbfb09d];return _0x570eaf;}export function normalizePath(_0x152af2){const _0x25694e=a174_0x570e,_0x5cec7b=parsePath(_0x152af2),_0x96c787=[];for(const _0x45363e of _0x5cec7b[_0x25694e(0x17e)]){if(_0x45363e==='.')continue;else{if(_0x45363e==='..'){if(_0x96c787[_0x25694e(0x18c)]===0x0){if(_0x5cec7b[_0x25694e(0x17b)])throw new Error(_0x25694e(0x194));_0x96c787[_0x25694e(0x176)]('..');}else _0x96c787[_0x96c787[_0x25694e(0x18c)]-0x1]==='..'?_0x96c787[_0x25694e(0x176)]('..'):_0x96c787[_0x25694e(0x177)]();}else _0x96c787[_0x25694e(0x176)](_0x45363e);}}if(_0x96c787[_0x25694e(0x18c)]===0x0)return _0x5cec7b[_0x25694e(0x17b)]?'/':'.';const _0x29d806=_0x96c787[_0x25694e(0x183)]('/');return _0x5cec7b['raw'][_0x25694e(0x192)]('/')?'/'+_0x29d806:_0x29d806;}export function getParentPath(_0x51b3c8){const _0x59bc27=a174_0x570e,_0x21e153=parsePath(_0x51b3c8);if(_0x21e153[_0x59bc27(0x17e)][_0x59bc27(0x18c)]<=0x1)return'/';const _0x2b56e0=_0x21e153[_0x59bc27(0x17e)][_0x59bc27(0x16f)](0x0,-0x1)['join']('/');return _0x21e153['raw'][_0x59bc27(0x192)]('/')?'/'+_0x2b56e0:_0x2b56e0;}export function getBaseName(_0x2955e0){const _0x5afaa2=a174_0x570e,_0x1a49da=parsePath(_0x2955e0);return _0x1a49da['segments'][_0x1a49da[_0x5afaa2(0x17e)][_0x5afaa2(0x18c)]-0x1]||'';}export function isChildPath(_0x340080,_0x5cc34f){const _0x24b548=a174_0x570e,_0x44edbb=parsePath(_0x340080),_0x3bbf43=parsePath(_0x5cc34f);if(_0x44edbb['segments'][_0x24b548(0x18c)]<=_0x3bbf43['segments'][_0x24b548(0x18c)])return![];for(let _0x32e635=0x0;_0x32e635<_0x3bbf43[_0x24b548(0x17e)][_0x24b548(0x18c)];_0x32e635++){if(_0x44edbb[_0x24b548(0x17e)][_0x32e635]!==_0x3bbf43['segments'][_0x32e635])return![];}return!![];}export function splitPath(_0x442ef1){const _0x2330d1=a174_0x570e,_0x5cb477=parsePath(_0x442ef1);if(_0x5cb477[_0x2330d1(0x17e)][_0x2330d1(0x18c)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x5cb477[_0x2330d1(0x17e)][_0x2330d1(0x18c)]===0x1)return{'parent':_0x5cb477[_0x2330d1(0x17e)][0x0]};return{'parent':_0x5cb477[_0x2330d1(0x17e)][0x0],'child':_0x5cb477[_0x2330d1(0x17e)][_0x2330d1(0x16f)](0x1)['join']('/')};}export function isYamlFilePath(_0x144b86){const _0x1d2bbd=a174_0x570e;return _0x144b86[_0x1d2bbd(0x18b)]('.yml')||_0x144b86['endsWith'](_0x1d2bbd(0x18a));}export async function resolveYamlFilePath(_0x28cf8a,_0x655b82=nodeFileSystem){const _0x4ddb50=a174_0x570e,_0x1b0111=a174_0x2da46f[_0x4ddb50(0x182)](_0x28cf8a);if(!await _0x655b82[_0x4ddb50(0x198)](_0x1b0111))throw new Error(_0x4ddb50(0x195)+_0x28cf8a);let _0xc9beef=a174_0x2da46f[_0x4ddb50(0x175)](_0x1b0111),_0x2337ba=null,_0x4f3ae5=null;const _0x58d613=a174_0x2da46f[_0x4ddb50(0x179)](_0xc9beef)[_0x4ddb50(0x17d)];while(_0xc9beef!==_0x58d613){const _0x53f0f6=a174_0x2da46f[_0x4ddb50(0x183)](_0xc9beef,_0x4ddb50(0x18f));if(await _0x655b82[_0x4ddb50(0x198)](_0x53f0f6)){_0x2337ba=_0x53f0f6,_0x4f3ae5=_0xc9beef;break;}_0xc9beef=a174_0x2da46f[_0x4ddb50(0x175)](_0xc9beef);}if(!_0x2337ba||!_0x4f3ae5)throw new Error(_0x4ddb50(0x172)+_0x28cf8a+'\x0a'+_0x4ddb50(0x178));const _0x296fe1=await _0x655b82[_0x4ddb50(0x181)](_0x2337ba),_0xc2f6a5=JSON[_0x4ddb50(0x179)](_0x296fe1),_0x3e8b27=_0xc2f6a5[_0x4ddb50(0x190)];if(!_0x3e8b27)throw new Error(_0x4ddb50(0x17a));const _0x89bdf8=await _0x655b82['readFile'](_0x1b0111),_0x13f9fa=a174_0x14264a(_0x89bdf8),_0x20e9c6=_0x13f9fa['name'];if(!_0x20e9c6)throw new Error(_0x4ddb50(0x170)+_0x28cf8a);const _0x5d34b1=isJourneyDef(_0x13f9fa,_0x1b0111)?_0x4ddb50(0x173):_0x4ddb50(0x169),_0x29e0c6=a174_0x2da46f[_0x4ddb50(0x16e)](_0x4f3ae5,_0x1b0111),_0x2ebcfc=a174_0x2da46f['dirname'](_0x29e0c6),_0x217f47=_0x2ebcfc==='.'?'':_0x2ebcfc[_0x4ddb50(0x17c)](/\\/g,'/'),_0x1aab1f=_0x217f47?_0x3e8b27+'/'+_0x217f47+'/'+_0x20e9c6:_0x3e8b27+'/'+_0x20e9c6;return{'parentSegment':_0x3e8b27,'segmentName':_0x20e9c6,'folderPath':_0x217f47,'fullPath':_0x1aab1f,'resourceType':_0x5d34b1,'content':_0x89bdf8};}
@@ -1 +1 @@
1
- (function(_0x2648b8,_0x22556e){const _0x43e8d3=a172_0x1a11,_0x375cf3=_0x2648b8();while(!![]){try{const _0x25352b=parseInt(_0x43e8d3(0xb7))/0x1+-parseInt(_0x43e8d3(0xb0))/0x2*(parseInt(_0x43e8d3(0xb9))/0x3)+parseInt(_0x43e8d3(0xb1))/0x4+parseInt(_0x43e8d3(0xb4))/0x5*(parseInt(_0x43e8d3(0xbb))/0x6)+parseInt(_0x43e8d3(0xb2))/0x7*(-parseInt(_0x43e8d3(0xaf))/0x8)+parseInt(_0x43e8d3(0xbc))/0x9*(-parseInt(_0x43e8d3(0xbe))/0xa)+-parseInt(_0x43e8d3(0xb3))/0xb*(parseInt(_0x43e8d3(0xb8))/0xc);if(_0x25352b===_0x22556e)break;else _0x375cf3['push'](_0x375cf3['shift']());}catch(_0x53b192){_0x375cf3['push'](_0x375cf3['shift']());}}}(a172_0x2277,0xc61ef));function a172_0x2277(){const _0x54beb9=['substring','Invalid\x20segment\x20reference\x20format:\x20','1602188WByuIg','12VoEjuW','3579RUvBeO','.\x20Parent\x20name\x20cannot\x20be\x20empty','18nVmzGt','6057UwmkmR','indexOf','5330wGhnuB','3736awrniH','106qgFbZo','3652760xtMAcj','23191SMLFow','763807oqIHjt','557785dLJnNw'];a172_0x2277=function(){return _0x54beb9;};return a172_0x2277();}function a172_0x1a11(_0x4ee5fb,_0x149eb0){_0x4ee5fb=_0x4ee5fb-0xaf;const _0x22772b=a172_0x2277();let _0x1a1148=_0x22772b[_0x4ee5fb];return _0x1a1148;}export function parseSegmentRef(_0x53dd74){const _0xf840ed=a172_0x1a11,_0x4e2562=_0x53dd74[_0xf840ed(0xbd)]('/');if(_0x4e2562===-0x1)return{'parentId':_0x53dd74};if(_0x4e2562===0x0)throw new Error(_0xf840ed(0xb6)+_0x53dd74+_0xf840ed(0xba));const _0x27d479=_0x53dd74[_0xf840ed(0xb5)](0x0,_0x4e2562),_0x123a09=_0x53dd74[_0xf840ed(0xb5)](_0x4e2562+0x1);if(_0x123a09==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x53dd74+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x27d479,'childId':_0x123a09};}
1
+ (function(_0x10f9ac,_0x226ebc){const _0x559ac7=a175_0x1410,_0x5c830d=_0x10f9ac();while(!![]){try{const _0x46ed03=parseInt(_0x559ac7(0xd1))/0x1+parseInt(_0x559ac7(0xcc))/0x2*(-parseInt(_0x559ac7(0xce))/0x3)+-parseInt(_0x559ac7(0xcd))/0x4+-parseInt(_0x559ac7(0xd2))/0x5*(parseInt(_0x559ac7(0xcf))/0x6)+-parseInt(_0x559ac7(0xc5))/0x7+parseInt(_0x559ac7(0xc6))/0x8*(-parseInt(_0x559ac7(0xc7))/0x9)+parseInt(_0x559ac7(0xc8))/0xa;if(_0x46ed03===_0x226ebc)break;else _0x5c830d['push'](_0x5c830d['shift']());}catch(_0x3b5bd8){_0x5c830d['push'](_0x5c830d['shift']());}}}(a175_0x2776,0x85d8c));export function parseSegmentRef(_0x26195f){const _0x41cf15=a175_0x1410,_0x1b54ba=_0x26195f[_0x41cf15(0xca)]('/');if(_0x1b54ba===-0x1)return{'parentId':_0x26195f};if(_0x1b54ba===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x26195f+_0x41cf15(0xc9));const _0x18b301=_0x26195f['substring'](0x0,_0x1b54ba),_0xff77=_0x26195f[_0x41cf15(0xcb)](_0x1b54ba+0x1);if(_0xff77==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x26195f+_0x41cf15(0xd0));return{'parentId':_0x18b301,'childId':_0xff77};}function a175_0x1410(_0x58fbb7,_0x417f81){_0x58fbb7=_0x58fbb7-0xc5;const _0x277686=a175_0x2776();let _0x1410d=_0x277686[_0x58fbb7];return _0x1410d;}function a175_0x2776(){const _0x159548=['20720370hxrkUj','.\x20Parent\x20name\x20cannot\x20be\x20empty','indexOf','substring','1108738XTQuZK','1545700LyNYZN','3sGGxXf','38268orrntz','.\x20Child\x20name\x20cannot\x20be\x20empty','936771lEpmXv','15bWUHww','7468314GbVJzd','12664VIYohg','2466tQSqdg'];a175_0x2776=function(){return _0x159548;};return a175_0x2776();}