@treasuredata/tdx 2026.3.46 → 2026.3.47

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 (242) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/TASK.md +62 -0
  182. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/schedule.yaml +20 -0
  183. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/TASK.md +106 -0
  184. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/schedule.yaml +18 -0
  185. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
  186. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
  187. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
  188. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
  189. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/TASK.md +21 -0
  190. package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/schedule.yaml +14 -0
  191. package/dist/sdk/workspace/builtin-schedules/execute-items/TASK.md +62 -0
  192. package/dist/sdk/workspace/builtin-schedules/execute-items/schedule.yaml +20 -0
  193. package/dist/sdk/workspace/builtin-schedules/item-triage/TASK.md +106 -0
  194. package/dist/sdk/workspace/builtin-schedules/item-triage/schedule.yaml +18 -0
  195. package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
  196. package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
  197. package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
  198. package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
  199. package/dist/sdk/workspace/builtin-schedules/weekly-review/TASK.md +21 -0
  200. package/dist/sdk/workspace/builtin-schedules/weekly-review/schedule.yaml +14 -0
  201. package/dist/sdk/workspace/frontmatter.js +1 -1
  202. package/dist/sdk/workspace/git.js +1 -1
  203. package/dist/sdk/workspace/index.d.ts +5 -1
  204. package/dist/sdk/workspace/index.d.ts.map +1 -1
  205. package/dist/sdk/workspace/index.js +1 -1
  206. package/dist/sdk/workspace/index.js.map +1 -1
  207. package/dist/sdk/workspace/templates.js +1 -1
  208. package/dist/sdk/workspace/weekly.js +1 -1
  209. package/dist/sdk/workspace/wikilinks.js +1 -1
  210. package/dist/test-utils/command-runner.js +1 -1
  211. package/dist/test-utils/factories.js +1 -1
  212. package/dist/test-utils/fixtures.js +1 -1
  213. package/dist/test-utils/http-mock.js +1 -1
  214. package/dist/test-utils/index.js +1 -1
  215. package/dist/utils/async.js +1 -1
  216. package/dist/utils/colors.js +1 -1
  217. package/dist/utils/diff.js +1 -1
  218. package/dist/utils/file-permissions.js +1 -1
  219. package/dist/utils/file-reader.js +1 -1
  220. package/dist/utils/github-releases.js +1 -1
  221. package/dist/utils/global-cache.js +1 -1
  222. package/dist/utils/json-loader.js +1 -1
  223. package/dist/utils/local-cache.js +1 -1
  224. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  225. package/dist/utils/logger/formatters/index.js +1 -1
  226. package/dist/utils/logger/handlers/console-handler.js +1 -1
  227. package/dist/utils/logger/handlers/file-handler.js +1 -1
  228. package/dist/utils/logger/handlers/index.js +1 -1
  229. package/dist/utils/logger/handlers/null-handler.js +1 -1
  230. package/dist/utils/logger/index.js +1 -1
  231. package/dist/utils/logger/logger.js +1 -1
  232. package/dist/utils/logger/types.js +1 -1
  233. package/dist/utils/option-validation.js +1 -1
  234. package/dist/utils/process.js +1 -1
  235. package/dist/utils/prompt.js +1 -1
  236. package/dist/utils/spinner.js +1 -1
  237. package/dist/utils/sse-parser.js +1 -1
  238. package/dist/utils/string-utils.js +1 -1
  239. package/dist/utils/table-ref-parser.js +1 -1
  240. package/dist/utils/tdx-logger.js +1 -1
  241. package/dist/utils/version-check.js +1 -1
  242. package/package.json +2 -2
@@ -1 +1 @@
1
- (function(_0xbd93c,_0x4067eb){const _0x358d23=a146_0xe940,_0x2d9374=_0xbd93c();while(!![]){try{const _0x2adeb7=-parseInt(_0x358d23(0xa7))/0x1*(parseInt(_0x358d23(0xa1))/0x2)+parseInt(_0x358d23(0x124))/0x3+-parseInt(_0x358d23(0xb3))/0x4*(parseInt(_0x358d23(0xc5))/0x5)+-parseInt(_0x358d23(0xe9))/0x6*(parseInt(_0x358d23(0xbc))/0x7)+-parseInt(_0x358d23(0xb7))/0x8*(-parseInt(_0x358d23(0xae))/0x9)+parseInt(_0x358d23(0x139))/0xa+parseInt(_0x358d23(0xab))/0xb;if(_0x2adeb7===_0x4067eb)break;else _0x2d9374['push'](_0x2d9374['shift']());}catch(_0x48e80a){_0x2d9374['push'](_0x2d9374['shift']());}}}(a146_0x5591,0x5cf8e));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x577e1d,_0x314463,_0x7868f6,_0x58f5d9,_0x258d00,_0x2dfd30){return{'level':_0x577e1d,'path':_0x314463,'code':_0x7868f6,'message':_0x58f5d9,'location':getLocationFromPath(_0x258d00['document'],_0x258d00['source'],pathToArray(_0x2dfd30??_0x314463))};}function validateVersionStructure(_0x190370,_0x44b695){const _0x9c890e=a146_0xe940,_0x3c59a8=[];return _0x190370[_0x9c890e(0x111)]>MAX_STAGES&&_0x3c59a8[_0x9c890e(0x115)](createIssue(_0x9c890e(0xee),_0x9c890e(0x102),_0x9c890e(0xd0),'Journey\x20has\x20'+_0x190370['length']+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x44b695)),_0x3c59a8;}function validateStageStructure(_0x4ae9de,_0x1fc209,_0xb37415,_0x459d89){const _0x10cdba=a146_0xe940,_0x486b00=[],_0x390625=_0x10cdba(0x10a)+_0x1fc209+']';_0x1fc209===0x0&&!_0x4ae9de[_0x10cdba(0xcc)]&&_0x486b00[_0x10cdba(0x115)](createIssue(_0x10cdba(0xee),_0x390625+_0x10cdba(0x12e),_0x10cdba(0x113),_0x10cdba(0x117)+_0x4ae9de[_0x10cdba(0xec)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x459d89,_0x390625));const _0x4a39c0=_0x1fc209===_0xb37415-0x1;!_0x4a39c0&&!_0x4ae9de[_0x10cdba(0xed)]&&_0x486b00[_0x10cdba(0x115)](createIssue(_0x10cdba(0xee),_0x390625+_0x10cdba(0x96),'MISSING_MILESTONE','Stage\x20\x27'+_0x4ae9de[_0x10cdba(0xec)]+_0x10cdba(0xef),_0x459d89,_0x390625));(!_0x4ae9de['exit_criteria']||_0x4ae9de[_0x10cdba(0xb4)][_0x10cdba(0x111)]===0x0)&&_0x486b00[_0x10cdba(0x115)](createIssue(_0x10cdba(0xe8),_0x390625+_0x10cdba(0x118),_0x10cdba(0xbe),'Stage\x20\x27'+_0x4ae9de[_0x10cdba(0xec)]+_0x10cdba(0x120),_0x459d89,_0x390625));const _0x2cb673=_0x4ae9de['steps']?.[_0x10cdba(0x111)]??0x0;if(_0x2cb673===0x0)_0x486b00[_0x10cdba(0x115)](createIssue(_0x10cdba(0xee),_0x390625+'.steps',_0x10cdba(0xa6),_0x10cdba(0x117)+_0x4ae9de['name']+_0x10cdba(0x12a),_0x459d89,_0x390625+_0x10cdba(0xd7)));else{if(_0x2cb673===0x1)_0x486b00[_0x10cdba(0x115)](createIssue(_0x10cdba(0xe8),_0x390625+_0x10cdba(0xd7),_0x10cdba(0xa6),_0x10cdba(0x117)+_0x4ae9de[_0x10cdba(0xec)]+_0x10cdba(0x9e),_0x459d89,_0x390625+'.steps'));else _0x2cb673<=0x3&&_0x486b00['push'](createIssue(_0x10cdba(0xe8),_0x390625+_0x10cdba(0xd7),'FEW_STEPS',_0x10cdba(0x117)+_0x4ae9de[_0x10cdba(0xec)]+_0x10cdba(0xdd)+_0x2cb673+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x459d89,_0x390625+'.steps'));}return _0x486b00;}function a146_0xe940(_0x8cf482,_0x38d1ca){_0x8cf482=_0x8cf482-0x8f;const _0x559184=a146_0x5591();let _0xe94001=_0x559184[_0x8cf482];return _0xe94001;}function validateStep(_0xa7dbf0,_0x102c98,_0x19457b,_0xbd1c88){const _0x13e98e=a146_0xe940,_0xac8f81=[];if(_0xa7dbf0[_0x13e98e(0xaa)]===_0x13e98e(0xbf))return _0xa7dbf0[_0x13e98e(0x110)]&&_0xac8f81[_0x13e98e(0x115)](createIssue(_0x13e98e(0xee),_0x102c98+'.next','END_STEP_HAS_NEXT_OR_WITH',_0x13e98e(0xf1)+_0xa7dbf0['name']+_0x13e98e(0x10d),_0x19457b)),'with'in _0xa7dbf0&&_0xa7dbf0[_0x13e98e(0x12c)]!==undefined&&_0xac8f81[_0x13e98e(0x115)](createIssue(_0x13e98e(0xee),_0x102c98+_0x13e98e(0x91),_0x13e98e(0x101),_0x13e98e(0xf1)+_0xa7dbf0[_0x13e98e(0xec)]+'\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',_0x19457b)),_0xac8f81;_0xa7dbf0[_0x13e98e(0x110)]&&(_0x19457b['stepNames']&&!_0x19457b[_0x13e98e(0xad)]['has'](_0xa7dbf0[_0x13e98e(0x110)])&&_0xac8f81[_0x13e98e(0x115)](createIssue('error',_0x102c98+_0x13e98e(0x9d),_0x13e98e(0x11b),_0x13e98e(0xa9)+_0xa7dbf0[_0x13e98e(0x110)]+'\x27',_0x19457b)));switch(_0xa7dbf0[_0x13e98e(0xaa)]){case'wait':_0xac8f81[_0x13e98e(0x115)](...validateWaitStep(_0xa7dbf0,_0x102c98,_0x19457b,_0xbd1c88));break;case _0x13e98e(0x125):_0xac8f81[_0x13e98e(0x115)](...validateActivationStep(_0xa7dbf0,_0x102c98,_0x19457b));break;case _0x13e98e(0xf5):_0xac8f81[_0x13e98e(0x115)](...validateDecisionPointStep(_0xa7dbf0,_0x102c98,_0x19457b,_0xbd1c88));break;case _0x13e98e(0xbd):_0xac8f81['push'](...validateAbTestStep(_0xa7dbf0,_0x102c98,_0x19457b,_0xbd1c88));break;case _0x13e98e(0xb5):_0xac8f81['push'](...validateJumpStep(_0xa7dbf0,_0x102c98,_0x19457b));break;}return _0xac8f81;}function validateWaitStep(_0x1bb235,_0x13bc62,_0x2a2ab8,_0x1c66fd){const _0x32e07c=a146_0xe940,_0x2aaaa5=[];if(!_0x1bb235['with'])return _0x2aaaa5['push'](createIssue(_0x32e07c(0xee),_0x13bc62+_0x32e07c(0x91),_0x32e07c(0x11e),_0x32e07c(0x12d),_0x2a2ab8,_0x13bc62)),_0x2aaaa5;if(_0x1bb235[_0x32e07c(0x12c)]['condition']){const _0x25cd07=_0x1bb235[_0x32e07c(0x12c)]['condition'];if(_0x25cd07[_0x32e07c(0xfb)]){_0x2a2ab8[_0x32e07c(0xfd)]?.['add'](_0x25cd07[_0x32e07c(0xfb)]);!_0x25cd07['segment'][_0x32e07c(0x122)](_0x32e07c(0x138))&&(_0x2a2ab8[_0x32e07c(0xba)]&&!_0x2a2ab8['embeddedSegments'][_0x32e07c(0xf7)](_0x25cd07[_0x32e07c(0xfb)])&&_0x2aaaa5[_0x32e07c(0x115)](createIssue('error',_0x13bc62+_0x32e07c(0xc9),_0x32e07c(0x94),_0x32e07c(0x107)+_0x25cd07['segment']+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.',_0x2a2ab8)));_0x25cd07[_0x32e07c(0x110)]&&_0x2a2ab8[_0x32e07c(0xad)]&&!_0x2a2ab8['stepNames']['has'](_0x25cd07[_0x32e07c(0x110)])&&_0x2aaaa5['push'](createIssue(_0x32e07c(0xee),_0x13bc62+_0x32e07c(0xac),_0x32e07c(0x11b),_0x32e07c(0xf8)+_0x25cd07['next']+'\x27',_0x2a2ab8));_0x25cd07[_0x32e07c(0xcb)]?.[_0x32e07c(0x110)]&&_0x2a2ab8[_0x32e07c(0xad)]&&!_0x2a2ab8[_0x32e07c(0xad)][_0x32e07c(0xf7)](_0x25cd07[_0x32e07c(0xcb)][_0x32e07c(0x110)])&&_0x2aaaa5['push'](createIssue('error',_0x13bc62+_0x32e07c(0x135),_0x32e07c(0x11b),_0x32e07c(0x90)+_0x25cd07[_0x32e07c(0xcb)][_0x32e07c(0x110)]+'\x27',_0x2a2ab8));const _0x363ee0=_0x25cd07[_0x32e07c(0x110)]||_0x1bb235[_0x32e07c(0x110)],_0x3a716b=_0x25cd07['timeout']?.[_0x32e07c(0x110)]||_0x1bb235['next'];if(_0x363ee0){const _0xceb594=_0x1c66fd['get'](_0x363ee0);_0xceb594?.['type']==='merge'&&_0x2aaaa5[_0x32e07c(0x115)](createIssue(_0x32e07c(0xe8),_0x13bc62+_0x32e07c(0xac),_0x32e07c(0x114),_0x32e07c(0xdb)+_0x363ee0+_0x32e07c(0xe2),_0x2a2ab8,_0x13bc62+_0x32e07c(0x95)));}if(_0x3a716b){const _0x2e4358=_0x1c66fd['get'](_0x3a716b);_0x2e4358?.[_0x32e07c(0xaa)]===_0x32e07c(0x116)&&_0x2aaaa5[_0x32e07c(0x115)](createIssue(_0x32e07c(0xe8),_0x13bc62+_0x32e07c(0x135),'BRANCH_DIRECTLY_TO_MERGE','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x3a716b+_0x32e07c(0xe2),_0x2a2ab8,_0x13bc62+'.with.condition.timeout'));}}}return _0x2aaaa5;}function validateActivationStep(_0x26e5d3,_0x3d3817,_0x1dc498){const _0x412809=a146_0xe940,_0x7882b=[];if(!_0x26e5d3[_0x412809(0x12c)]?.[_0x412809(0x125)])return _0x7882b[_0x412809(0x115)](createIssue(_0x412809(0xee),_0x3d3817+_0x412809(0x104),'MISSING_ACTIVATION_REF',_0x412809(0x132),_0x1dc498,_0x3d3817)),_0x7882b;const _0x28ea5c=_0x26e5d3[_0x412809(0x12c)][_0x412809(0x125)];return _0x1dc498[_0x412809(0x10e)]&&!_0x28ea5c[_0x412809(0x122)](_0x412809(0x138))&&(!_0x1dc498['activationKeys'][_0x412809(0xf7)](_0x28ea5c)&&_0x7882b[_0x412809(0x115)](createIssue(_0x412809(0xee),_0x3d3817+_0x412809(0x104),'MISSING_ACTIVATION_DEFINITION',_0x412809(0xd9)+_0x28ea5c+_0x412809(0x106),_0x1dc498))),_0x7882b;}function validateDecisionPointStep(_0x279692,_0x2b3d3d,_0x5755fe,_0x4f740a){const _0x188784=a146_0xe940,_0x365fca=[];if(!_0x279692[_0x188784(0x12c)]?.[_0x188784(0xe6)]||_0x279692[_0x188784(0x12c)][_0x188784(0xe6)][_0x188784(0x111)]===0x0)return _0x365fca['push'](createIssue(_0x188784(0xee),_0x2b3d3d+_0x188784(0x92),_0x188784(0x119),_0x188784(0xa2),_0x5755fe,_0x2b3d3d)),_0x365fca;for(let _0x2f4916=0x0;_0x2f4916<_0x279692[_0x188784(0x12c)][_0x188784(0xe6)][_0x188784(0x111)];_0x2f4916++){const _0x73f4b4=_0x279692[_0x188784(0x12c)][_0x188784(0xe6)][_0x2f4916],_0x4815f4=_0x2b3d3d+_0x188784(0xdc)+_0x2f4916+']';_0x73f4b4['segment']&&!_0x73f4b4[_0x188784(0x112)]&&(_0x5755fe['referencedSegments']?.['add'](_0x73f4b4[_0x188784(0xfb)]),!_0x73f4b4[_0x188784(0xfb)][_0x188784(0x122)]('ref:')&&(_0x5755fe['embeddedSegments']&&!_0x5755fe[_0x188784(0xba)][_0x188784(0xf7)](_0x73f4b4[_0x188784(0xfb)])&&_0x365fca[_0x188784(0x115)](createIssue(_0x188784(0xee),_0x4815f4+_0x188784(0xeb),_0x188784(0x94),_0x188784(0x8f)+_0x73f4b4[_0x188784(0xfb)]+'\x27',_0x5755fe))));_0x73f4b4[_0x188784(0x110)]&&_0x5755fe[_0x188784(0xad)]&&!_0x5755fe[_0x188784(0xad)][_0x188784(0xf7)](_0x73f4b4[_0x188784(0x110)])&&_0x365fca[_0x188784(0x115)](createIssue(_0x188784(0xee),_0x4815f4+_0x188784(0x9d),_0x188784(0x11b),_0x188784(0xa4)+_0x73f4b4[_0x188784(0x110)]+'\x27',_0x5755fe));if(_0x73f4b4['next']){const _0x265857=_0x4f740a[_0x188784(0xb0)](_0x73f4b4['next']);_0x265857?.[_0x188784(0xaa)]===_0x188784(0x116)&&_0x365fca[_0x188784(0x115)](createIssue(_0x188784(0xe8),_0x4815f4+_0x188784(0x9d),_0x188784(0x114),_0x188784(0xde)+_0x73f4b4[_0x188784(0xec)]+_0x188784(0xd6)+_0x73f4b4[_0x188784(0x110)]+_0x188784(0x127),_0x5755fe));}}return _0x365fca;}function validateAbTestStep(_0x42eeda,_0x54c293,_0x4dcafa,_0xa55709){const _0xb93f01=a146_0xe940,_0x1b2f2b=[];if(!_0x42eeda['with']?.[_0xb93f01(0x129)]||_0x42eeda[_0xb93f01(0x12c)][_0xb93f01(0x129)][_0xb93f01(0x111)]===0x0)return _0x1b2f2b[_0xb93f01(0x115)](createIssue(_0xb93f01(0xee),_0x54c293+_0xb93f01(0xc6),_0xb93f01(0x119),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x4dcafa,_0x54c293)),_0x1b2f2b;const _0x577ec2=_0x42eeda[_0xb93f01(0x12c)][_0xb93f01(0x129)][_0xb93f01(0x103)]((_0x426c32,_0x494367)=>_0x426c32+(_0x494367['percentage']||0x0),0x0);Math[_0xb93f01(0xd4)](_0x577ec2-0x64)>0.01&&_0x1b2f2b[_0xb93f01(0x115)](createIssue(_0xb93f01(0xee),_0x54c293+_0xb93f01(0xc6),'INVALID_AB_TEST_PERCENTAGES',_0xb93f01(0xb2)+_0x577ec2+'%)',_0x4dcafa));for(let _0x513311=0x0;_0x513311<_0x42eeda[_0xb93f01(0x12c)][_0xb93f01(0x129)]['length'];_0x513311++){const _0xb78006=_0x42eeda[_0xb93f01(0x12c)][_0xb93f01(0x129)][_0x513311],_0x4ee44a=_0x54c293+_0xb93f01(0xd3)+_0x513311+']';_0xb78006[_0xb93f01(0x110)]&&_0x4dcafa['stepNames']&&!_0x4dcafa[_0xb93f01(0xad)]['has'](_0xb78006[_0xb93f01(0x110)])&&_0x1b2f2b[_0xb93f01(0x115)](createIssue(_0xb93f01(0xee),_0x4ee44a+_0xb93f01(0x9d),_0xb93f01(0x11b),_0xb93f01(0xf2)+_0xb78006[_0xb93f01(0x110)]+'\x27',_0x4dcafa));if(_0xb78006[_0xb93f01(0x110)]){const _0x56515c=_0xa55709['get'](_0xb78006[_0xb93f01(0x110)]);_0x56515c?.[_0xb93f01(0xaa)]===_0xb93f01(0x116)&&_0x1b2f2b[_0xb93f01(0x115)](createIssue(_0xb93f01(0xe8),_0x4ee44a+_0xb93f01(0x9d),_0xb93f01(0x114),'A/B\x20test\x20variant\x20\x27'+_0xb78006[_0xb93f01(0xec)]+_0xb93f01(0xd6)+_0xb78006[_0xb93f01(0x110)]+_0xb93f01(0x127),_0x4dcafa));}}return _0x1b2f2b;}function validateJumpStep(_0x1ac96d,_0x2c1b4b,_0x4d3954){const _0x17a4a9=a146_0xe940,_0x317658=[];if(!_0x1ac96d[_0x17a4a9(0x12c)]?.[_0x17a4a9(0x109)])return _0x317658[_0x17a4a9(0x115)](createIssue(_0x17a4a9(0xee),_0x2c1b4b+_0x17a4a9(0xb6),_0x17a4a9(0xcf),'Jump\x20step\x20requires\x20a\x20target',_0x4d3954,_0x2c1b4b)),_0x317658;return(!_0x1ac96d[_0x17a4a9(0x12c)]['target'][_0x17a4a9(0x9f)]||!_0x1ac96d['with'][_0x17a4a9(0x109)][_0x17a4a9(0xda)])&&_0x317658[_0x17a4a9(0x115)](createIssue(_0x17a4a9(0xee),_0x2c1b4b+_0x17a4a9(0xb6),_0x17a4a9(0xcf),_0x17a4a9(0x9c),_0x4d3954)),_0x317658;}function buildConvergenceMap(_0x4f348b){const _0x1e8b63=a146_0xe940,_0x2e6fcc=new Map();function _0x59be69(_0x4deced,_0xbcb674){const _0x2985aa=a146_0xe940,_0x29ae72=_0x2e6fcc['get'](_0x4deced)||[];_0x29ae72[_0x2985aa(0x115)](_0xbcb674),_0x2e6fcc[_0x2985aa(0xfe)](_0x4deced,_0x29ae72);}for(const _0x1b0224 of _0x4f348b){_0x1b0224[_0x1e8b63(0x110)]&&_0x59be69(_0x1b0224[_0x1e8b63(0x110)],{'stepName':_0x1b0224['name'],'description':'step\x20\x27'+_0x1b0224[_0x1e8b63(0xec)]+'\x27'});if(_0x1b0224[_0x1e8b63(0xaa)]===_0x1e8b63(0xf5)&&_0x1b0224[_0x1e8b63(0x12c)]?.['branches'])for(const _0x2e722f of _0x1b0224['with'][_0x1e8b63(0xe6)]){_0x2e722f['next']&&_0x59be69(_0x2e722f[_0x1e8b63(0x110)],{'stepName':_0x1b0224[_0x1e8b63(0xec)],'description':_0x1e8b63(0xc4)+_0x2e722f['name']+_0x1e8b63(0xf4)+_0x1b0224[_0x1e8b63(0xec)]+'\x27'});}if(_0x1b0224['type']===_0x1e8b63(0xbd)&&_0x1b0224['with']?.[_0x1e8b63(0x129)])for(const _0x4128eb of _0x1b0224['with'][_0x1e8b63(0x129)]){_0x4128eb[_0x1e8b63(0x110)]&&_0x59be69(_0x4128eb['next'],{'stepName':_0x1b0224[_0x1e8b63(0xec)],'description':_0x1e8b63(0xb9)+_0x4128eb[_0x1e8b63(0xec)]+_0x1e8b63(0xf4)+_0x1b0224['name']+'\x27'});}_0x1b0224['type']==='wait'&&_0x1b0224[_0x1e8b63(0x12c)]?.[_0x1e8b63(0xe5)]&&(_0x1b0224[_0x1e8b63(0x12c)][_0x1e8b63(0xe5)][_0x1e8b63(0x110)]&&_0x59be69(_0x1b0224['with'][_0x1e8b63(0xe5)][_0x1e8b63(0x110)],{'stepName':_0x1b0224[_0x1e8b63(0xec)],'description':_0x1e8b63(0xf9)+_0x1b0224[_0x1e8b63(0xec)]+'\x27'}),_0x1b0224[_0x1e8b63(0x12c)][_0x1e8b63(0xe5)]['timeout']?.[_0x1e8b63(0x110)]&&_0x59be69(_0x1b0224['with'][_0x1e8b63(0xe5)][_0x1e8b63(0xcb)][_0x1e8b63(0x110)],{'stepName':_0x1b0224['name'],'description':'timeout\x20of\x20\x27'+_0x1b0224[_0x1e8b63(0xec)]+'\x27'}));}return _0x2e6fcc;}function validateFlowControl(_0x46a4de,_0x2302a4,_0x29c1b5){const _0x2ec261=a146_0xe940,_0x289eb3=[],_0x24c261=_0x2ec261(0x10a)+_0x2302a4+']',_0x3853ea=_0x46a4de[_0x2ec261(0xe3)]||[];if(_0x3853ea[_0x2ec261(0x111)]===0x0)return _0x289eb3;const _0x241c59=new Map();for(const _0x4cecf0 of _0x3853ea){_0x4cecf0[_0x2ec261(0xec)]&&_0x241c59[_0x2ec261(0xfe)](_0x4cecf0[_0x2ec261(0xec)],_0x4cecf0);}const _0x298f15=buildConvergenceMap(_0x3853ea),_0x2d8b79=_0x3853ea['some'](_0x1c0e28=>_0x1c0e28[_0x2ec261(0xaa)]===_0x2ec261(0xbf));!_0x2d8b79&&_0x289eb3[_0x2ec261(0x115)](createIssue(_0x2ec261(0xee),_0x24c261+_0x2ec261(0xd7),'MISSING_END_STEP','Stage\x20\x27'+_0x46a4de['name']+_0x2ec261(0xf3),_0x29c1b5));for(const [_0x50fb88,_0x5845a5]of _0x298f15){const _0x148e10=_0x241c59[_0x2ec261(0xb0)](_0x50fb88);if(!_0x148e10)continue;if(_0x5845a5['length']>0x1&&_0x148e10[_0x2ec261(0xaa)]!==_0x2ec261(0x116)){const _0x62eb1c=_0x5845a5[_0x2ec261(0x11d)](_0x15d723=>_0x15d723[_0x2ec261(0xfa)])['join'](',\x20');_0x289eb3['push'](createIssue(_0x2ec261(0xee),_0x24c261+_0x2ec261(0xd7),_0x2ec261(0xfc),_0x2ec261(0x11c)+_0x50fb88+'\x27\x20(from:\x20'+_0x62eb1c+').\x20Use\x20a\x20merge\x20step.',_0x29c1b5));}_0x5845a5[_0x2ec261(0x111)]===0x1&&_0x148e10['type']==='merge'&&_0x289eb3[_0x2ec261(0x115)](createIssue(_0x2ec261(0xe8),_0x24c261+'.steps','SINGLE_INPUT_MERGE',_0x2ec261(0x105)+_0x50fb88+_0x2ec261(0x10b)+_0x5845a5[0x0][_0x2ec261(0xfa)]+_0x2ec261(0x10f),_0x29c1b5));}for(const _0x34c131 of _0x3853ea){if(_0x34c131[_0x2ec261(0xaa)]===_0x2ec261(0x116)&&_0x34c131[_0x2ec261(0x110)]){const _0x354635=_0x241c59[_0x2ec261(0xb0)](_0x34c131[_0x2ec261(0x110)]);_0x354635?.[_0x2ec261(0xaa)]===_0x2ec261(0x116)&&_0x289eb3[_0x2ec261(0x115)](createIssue('error',_0x24c261+_0x2ec261(0xd7),_0x2ec261(0x93),_0x2ec261(0x105)+_0x34c131['name']+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x34c131[_0x2ec261(0x110)]+_0x2ec261(0xb1),_0x29c1b5));}}return _0x289eb3;}function validateCriteria(_0x1d865a,_0x2237ce,_0x313014){const _0x578592=a146_0xe940,_0x4dab7c=[];return _0x1d865a[_0x578592(0xfb)]&&(_0x313014[_0x578592(0xfd)]?.[_0x578592(0x11a)](_0x1d865a['segment']),!_0x1d865a[_0x578592(0xfb)][_0x578592(0x122)]('ref:')&&(_0x313014['embeddedSegments']&&!_0x313014['embeddedSegments']['has'](_0x1d865a[_0x578592(0xfb)])&&_0x4dab7c[_0x578592(0x115)](createIssue(_0x578592(0xee),_0x2237ce+'.segment',_0x578592(0x94),'Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x1d865a[_0x578592(0xfb)]+'\x27',_0x313014)))),_0x4dab7c;}function validateEmbeddedSegment(_0x11a557,_0x1429cf,_0x21a1bd){const _0xa4db25=a146_0xe940,_0x1f9059=[];return _0x11a557[_0xa4db25(0x123)]&&_0x1f9059['push'](...validateRuleDef(_0x11a557[_0xa4db25(0x123)],_0x1429cf+_0xa4db25(0xa0),_0x21a1bd)),_0x1f9059;}function validateStage(_0x470920,_0x3831ac,_0x3cb973,_0x5dc4ac){const _0x541f9a=a146_0xe940,_0x2cf4ee=[],_0x56f2b9=_0x541f9a(0x10a)+_0x3831ac+']',_0x10c48e=new Map(),_0x2e9a98=new Map();if(_0x470920[_0x541f9a(0xe3)]){for(let _0x344baf=0x0;_0x344baf<_0x470920[_0x541f9a(0xe3)][_0x541f9a(0x111)];_0x344baf++){const _0x4ac459=_0x470920[_0x541f9a(0xe3)][_0x344baf];_0x4ac459['name']&&_0x10c48e[_0x541f9a(0xfe)](_0x4ac459[_0x541f9a(0xec)],_0x4ac459);}for(let _0x275fa0=0x0;_0x275fa0<_0x470920[_0x541f9a(0xe3)][_0x541f9a(0x111)];_0x275fa0++){const _0x5e02df=_0x470920['steps'][_0x275fa0],_0x131124=_0x56f2b9+_0x541f9a(0x133)+_0x275fa0+']';if(_0x5e02df[_0x541f9a(0xec)]){if(_0x2e9a98[_0x541f9a(0xf7)](_0x5e02df['name'])){const _0xe53694=_0x2e9a98[_0x541f9a(0xb0)](_0x5e02df['name']);_0x2cf4ee[_0x541f9a(0x115)](createIssue(_0x541f9a(0xee),_0x131124+'.name','DUPLICATE_STEP_NAME',_0x541f9a(0x131)+_0x5e02df['name']+_0x541f9a(0xc8)+_0xe53694+'])',_0x5dc4ac));}else _0x2e9a98[_0x541f9a(0xfe)](_0x5e02df[_0x541f9a(0xec)],_0x275fa0);}_0x2cf4ee[_0x541f9a(0x115)](...validateStep(_0x5e02df,_0x131124,_0x5dc4ac,_0x10c48e));}}_0x470920[_0x541f9a(0xcc)]&&_0x2cf4ee[_0x541f9a(0x115)](...validateCriteria(_0x470920[_0x541f9a(0xcc)],_0x56f2b9+_0x541f9a(0x12e),_0x5dc4ac));if(_0x470920[_0x541f9a(0xb4)])for(let _0x4e33b8=0x0;_0x4e33b8<_0x470920[_0x541f9a(0xb4)][_0x541f9a(0x111)];_0x4e33b8++){_0x2cf4ee['push'](...validateCriteria(_0x470920[_0x541f9a(0xb4)][_0x4e33b8],_0x56f2b9+_0x541f9a(0xf0)+_0x4e33b8+']',_0x5dc4ac));}return _0x470920[_0x541f9a(0xed)]&&_0x2cf4ee[_0x541f9a(0x115)](...validateCriteria(_0x470920[_0x541f9a(0xed)],_0x56f2b9+_0x541f9a(0x96),_0x5dc4ac)),_0x2cf4ee[_0x541f9a(0x115)](...validateStageStructure(_0x470920,_0x3831ac,_0x3cb973,_0x5dc4ac)),_0x2cf4ee[_0x541f9a(0x115)](...validateFlowControl(_0x470920,_0x3831ac,_0x5dc4ac)),_0x2cf4ee;}function validateStagesForVersion(_0x3463c4,_0x1178d0,_0x3a1774,_0x37fdb3,_0x3f9a44,_0x217c32,_0x3d9da9){const _0x23d8ba=a146_0xe940;if(_0x3463c4[_0x23d8ba(0x111)]===0x0){_0x3f9a44[_0x23d8ba(0x115)]({'level':_0x23d8ba(0xee),'path':_0x37fdb3+_0x23d8ba(0x102),'code':_0x23d8ba(0x12f),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x3a1774['document'],_0x3a1774['source'],[_0x23d8ba(0x102)])});return;}const _0xfc9458=new Set();for(const _0x34ae33 of _0x3463c4){if(_0x34ae33[_0x23d8ba(0xe3)])for(const _0x3b6007 of _0x34ae33[_0x23d8ba(0xe3)]){_0x3b6007[_0x23d8ba(0xec)]&&_0xfc9458[_0x23d8ba(0x11a)](_0x3b6007[_0x23d8ba(0xec)]);}}const _0x56c3f4={..._0x3a1774,'stepNames':_0xfc9458},_0x35cf8a=validateVersionStructure(_0x3463c4,_0x56c3f4);for(const _0xcaf99a of _0x35cf8a){const _0x4fea0b=_0x37fdb3?{..._0xcaf99a,'path':''+_0x37fdb3+_0xcaf99a[_0x23d8ba(0xc7)]}:_0xcaf99a;if(_0x4fea0b[_0x23d8ba(0xea)]==='error')_0x3f9a44[_0x23d8ba(0x115)](_0x4fea0b);else _0x217c32['push'](_0x4fea0b);}for(let _0x1bff0a=0x0;_0x1bff0a<_0x3463c4['length'];_0x1bff0a++){const _0x33a42=validateStage(_0x3463c4[_0x1bff0a],_0x1bff0a,_0x3463c4['length'],_0x56c3f4);for(const _0x2600d3 of _0x33a42){const _0x199f43=_0x37fdb3?{..._0x2600d3,'path':''+_0x37fdb3+_0x2600d3[_0x23d8ba(0xc7)]}:_0x2600d3;if(_0x199f43[_0x23d8ba(0xea)]===_0x23d8ba(0xee))_0x3f9a44[_0x23d8ba(0x115)](_0x199f43);else _0x217c32[_0x23d8ba(0x115)](_0x199f43);}}if(_0x1178d0[_0x23d8ba(0x126)]){const _0x1ae949=_0x3d9da9?.[_0x23d8ba(0xce)]?'goal':_0x37fdb3+_0x23d8ba(0x126),_0x4ad475=validateCriteria(_0x1178d0[_0x23d8ba(0x126)],_0x1ae949,_0x56c3f4);for(const _0x16e8b6 of _0x4ad475){if(_0x16e8b6['level']===_0x23d8ba(0xee))_0x3f9a44[_0x23d8ba(0x115)](_0x16e8b6);else _0x217c32[_0x23d8ba(0x115)](_0x16e8b6);}}}function extractVersionIndex(_0x1d0353){const _0x4bbd59=a146_0xe940,_0x8c2339=_0x1d0353[_0x4bbd59(0x98)](/^journeys\[(\d+)\]\./);return _0x8c2339?_0x8c2339[0x1]:undefined;}function deduplicateAcrossVersions(_0x3b29ea){const _0x2d54b2=a146_0xe940,_0x27990a=new Map();for(let _0x280af7=0x0;_0x280af7<_0x3b29ea['length'];_0x280af7++){const _0x399a38=_0x3b29ea[_0x280af7][_0x2d54b2(0xb8)]+':'+_0x3b29ea[_0x280af7]['message'],_0x274eea=extractVersionIndex(_0x3b29ea[_0x280af7][_0x2d54b2(0xc7)]),_0x2f8f9b=_0x27990a[_0x2d54b2(0xb0)](_0x399a38);if(_0x2f8f9b){_0x2f8f9b[_0x2d54b2(0xd8)][_0x2d54b2(0x115)](_0x280af7);if(_0x274eea)_0x2f8f9b[_0x2d54b2(0x136)][_0x2d54b2(0x11a)](_0x274eea);}else _0x27990a[_0x2d54b2(0xfe)](_0x399a38,{'indices':[_0x280af7],'versions':new Set(_0x274eea?[_0x274eea]:[])});}const _0x2b6941=new Set();for(const {indices:_0x26677f,versions:_0x5573e1}of _0x27990a[_0x2d54b2(0xa5)]()){if(_0x5573e1[_0x2d54b2(0xc1)]<=0x1)continue;const _0x46c9bf=_0x3b29ea[_0x26677f[0x0]];_0x46c9bf['path']=_0x46c9bf[_0x2d54b2(0xc7)][_0x2d54b2(0x108)](/^journeys\[\d+\]\./,''),_0x46c9bf[_0x2d54b2(0xdf)]=_0x46c9bf[_0x2d54b2(0xdf)]+_0x2d54b2(0xc0)+_0x5573e1[_0x2d54b2(0xc1)]+_0x2d54b2(0xff);for(let _0x10bf93=0x1;_0x10bf93<_0x26677f['length'];_0x10bf93++){_0x2b6941['add'](_0x26677f[_0x10bf93]);}}const _0x441b77=[..._0x2b6941][_0x2d54b2(0xca)]((_0x2064e9,_0x3c541d)=>_0x3c541d-_0x2064e9);for(const _0x1b98e0 of _0x441b77){_0x3b29ea[_0x2d54b2(0xc2)](_0x1b98e0,0x1);}}export function validateJourneyDef(_0x568982,_0x5b2d43={},_0x46acbe={}){const _0x1aeb63=a146_0xe940;if(_0x46acbe['skipSchema'])return runJourneySemanticChecks(_0x568982,_0x5b2d43);const _0x4920f1=JourneyDefSchema['safeParse'](_0x568982);if(_0x4920f1[_0x1aeb63(0xcd)])return runJourneySemanticChecks(_0x4920f1['data'],_0x5b2d43);return zodErrorsToJourneyValidationResult(_0x4920f1[_0x1aeb63(0xee)],_0x5b2d43);}function zodErrorsToJourneyValidationResult(_0x5025c8,_0x58a987){const _0x105e53=a146_0xe940,_0x1f9638=flattenZodIssues(_0x5025c8['issues']),_0x4537d5=_0x1f9638[_0x105e53(0x11d)](_0x3e254d=>{const _0x72530d=_0x105e53,_0x273f02=formatZodPath(_0x3e254d[_0x72530d(0xc7)]),_0x49029d=mapJourneyZodIssueToCode(_0x3e254d,_0x273f02),_0x5b4951=getLocationFromPath(_0x58a987[_0x72530d(0xbb)],_0x58a987[_0x72530d(0xd5)],_0x3e254d['path'][_0x72530d(0x11d)](_0x56cde2=>typeof _0x56cde2===_0x72530d(0xd1)?String(_0x56cde2):_0x56cde2));return{'level':_0x72530d(0xee),'path':_0x273f02,'code':_0x49029d,'message':_0x3e254d[_0x72530d(0xdf)],..._0x5b4951&&{'location':_0x5b4951}};});return{'valid':![],'errors':_0x4537d5,'warnings':[]};}function mapJourneyZodIssueToCode(_0x5c1fee,_0xd3d11b){const _0x175aae=a146_0xe940;if(_0xd3d11b===_0x175aae(0xec))return _0x175aae(0x128);if(_0xd3d11b[_0x175aae(0x12b)](_0x175aae(0x10c))&&_0xd3d11b['includes'](_0x175aae(0xe3)))return _0x175aae(0xa3);if(_0xd3d11b===_0x175aae(0x102)||_0xd3d11b[_0x175aae(0x12b)]('.stages'))return'MISSING_STAGES';if(_0xd3d11b===''&&_0x5c1fee[_0x175aae(0xdf)]['includes'](_0x175aae(0xe7)))return _0x175aae(0x12f);if(_0xd3d11b['includes'](_0x175aae(0x125)))return'ACTIVATION_SCHEMA_ERROR';return _0x175aae(0xa3);}function a146_0x5591(){const _0x11499a=['Journey\x20has\x20no\x20goal\x20defined','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','steps','trim','condition','branches','journeys,\x20stages,\x20or\x20versions','warning','534NyOapq','level','.segment','name','milestone','error','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','.exit_criteria[','End\x20step\x20\x27','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','\x27\x20has\x20no\x20end\x20step','\x27\x20of\x20\x27','decision_point','launched','has','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','condition\x20of\x20\x27','description','segment','CONVERGENCE_WITHOUT_MERGE','referencedSegments','set','\x20versions)','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','END_STEP_HAS_NEXT_OR_WITH','stages','reduce','.with.activation','Merge\x20step\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','replace','target','stages[','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','.type','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','activationKeys',').\x20Merge\x20is\x20unnecessary.','next','length','excluded','MISSING_ENTRY_CRITERIA','BRANCH_DIRECTLY_TO_MERGE','push','merge','Stage\x20\x27','.exit_criteria','MISSING_CONDITIONS','add','INVALID_NEXT_REFERENCE','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','map','MISSING_WAIT_PARAMS','segments.','\x27\x20has\x20no\x20exit_criteria\x20defined','DUPLICATE_LATEST','startsWith','rule','522417dFFOjp','activation','goal','\x27\x20with\x20no\x20action\x20in\x20between','MISSING_NAME','variants','\x27\x20has\x20no\x20steps','endsWith','with','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','.entry_criteria','MISSING_STAGES','keys','Duplicate\x20step\x20name\x20\x27','Activation\x20step\x20requires\x20an\x20activation\x20reference','.steps[','filter','.with.condition.timeout.next','versions','journeys','ref:','5381910wnlQvN','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','.with','.with.branches','MERGE_TO_MERGE_CHAIN','MISSING_SEGMENT_REFERENCE','.with.condition','.milestone','\x20with\x20latest:\x20true','match','Embedded\x20segment\x20\x27','every','MISSING_GOAL','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','.next','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','journey','.rule','1293572MxYKtQ','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','JOURNEY_SCHEMA_ERROR','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','values','INSUFFICIENT_STEPS','1uJvESy','state','Step\x20references\x20non-existent\x20step\x20\x27','type','4300846Yxfwgg','.with.condition.next','stepNames','2115675IDPHtd','UNUSED_EMBEDDED_SEGMENT','get','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','4vjclCD','exit_criteria','jump','.with.target','16wwEJQH','code','variant\x20\x27','embeddedSegments','document','18298vOONBM','ab_test','MISSING_EXIT_CRITERIA','end','\x20(across\x20','size','splice','segments','branch\x20\x27','1566100Vanofm','.with.variants','path','\x27\x20(first\x20defined\x20at\x20steps[','.with.condition.segment','sort','timeout','entry_criteria','success','goalIsInherited','INVALID_JUMP_TARGET','TOO_MANY_STAGES','symbol','version','.with.variants[','abs','source','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.steps','indices','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','stage','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.with.branches[','\x27\x20has\x20only\x20','Decision\x20branch\x20\x27','message','journey\x20entry'];a146_0x5591=function(){return _0x11499a;};return a146_0x5591();}function runJourneySemanticChecks(_0x490d2a,_0x1727dd){const _0x3bb888=a146_0xe940,_0x18a3fa=[],_0x2df9d8=[];(!_0x490d2a[_0x3bb888(0xec)]||_0x490d2a[_0x3bb888(0xec)][_0x3bb888(0xe4)]()==='')&&_0x18a3fa['push']({'level':_0x3bb888(0xee),'path':_0x3bb888(0xec),'code':'MISSING_NAME','message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x1727dd[_0x3bb888(0xbb)],_0x1727dd[_0x3bb888(0xd5)],[_0x3bb888(0xec)])});const _0x53882b=new Set();if(_0x490d2a[_0x3bb888(0xc3)])for(const _0x139f7e of Object[_0x3bb888(0x130)](_0x490d2a[_0x3bb888(0xc3)])){_0x53882b[_0x3bb888(0x11a)](_0x139f7e);}const _0x2802b6=new Set();if(_0x490d2a['activations'])for(const _0x239aa7 of Object[_0x3bb888(0x130)](_0x490d2a['activations'])){_0x2802b6[_0x3bb888(0x11a)](_0x239aa7);}const _0x54e983=new Set(),_0x427fd8={..._0x1727dd,'embeddedSegments':_0x53882b,'referencedSegments':_0x54e983,'activationKeys':_0x2802b6[_0x3bb888(0xc1)]>0x0?_0x2802b6:undefined};if(_0x490d2a[_0x3bb888(0xc3)])for(const [_0x27eb62,_0xc156c1]of Object['entries'](_0x490d2a['segments'])){const _0x2781e2=validateEmbeddedSegment(_0xc156c1,'segments.'+_0x27eb62,_0x427fd8);for(const _0x5d4e76 of _0x2781e2){if(_0x5d4e76[_0x3bb888(0xea)]===_0x3bb888(0xee))_0x18a3fa['push'](_0x5d4e76);else _0x2df9d8[_0x3bb888(0x115)](_0x5d4e76);}}const _0x682ccf=!!_0x490d2a[_0x3bb888(0x126)],_0xd1ef54=_0x490d2a[_0x3bb888(0x137)]?.[_0x3bb888(0x9a)](_0x4c0fa5=>!!_0x4c0fa5[_0x3bb888(0x126)])??![];!_0x682ccf&&!_0xd1ef54&&_0x2df9d8[_0x3bb888(0x115)]({'level':_0x3bb888(0xe8),'path':_0x3bb888(0x126),'code':_0x3bb888(0x9b),'message':_0x3bb888(0xe1),'location':getLocationFromPath(_0x1727dd[_0x3bb888(0xbb)],_0x1727dd['source'],[_0x3bb888(0x126)])});const _0x44086e=_0x490d2a[_0x3bb888(0x137)]??_0x490d2a[_0x3bb888(0x136)];if(_0x44086e&&_0x44086e[_0x3bb888(0x134)](_0x47d706=>_0x47d706['latest']===!![])[_0x3bb888(0x111)]>0x1){const _0x22f179=_0x490d2a[_0x3bb888(0x137)]?_0x3bb888(0x137):'versions';_0x18a3fa[_0x3bb888(0x115)]({'level':'error','path':_0x22f179,'code':_0x3bb888(0x121),'message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x22f179===_0x3bb888(0x137)?_0x3bb888(0xe0):_0x3bb888(0xd2))+_0x3bb888(0x97),'location':getLocationFromPath(_0x1727dd[_0x3bb888(0xbb)],_0x1727dd[_0x3bb888(0xd5)],[_0x22f179])});}if(_0x490d2a[_0x3bb888(0x137)]&&_0x490d2a[_0x3bb888(0x137)]['length']>0x0)for(let _0x3e9573=0x0;_0x3e9573<_0x490d2a[_0x3bb888(0x137)]['length'];_0x3e9573++){const _0x229635=_0x490d2a[_0x3bb888(0x137)][_0x3e9573];if(_0x490d2a[_0x3bb888(0x137)][_0x3bb888(0x111)]>0x1&&_0x229635['state']===_0x3bb888(0xf6))continue;const _0x38bd8e=_0x229635[_0x3bb888(0x102)]||[],_0x4385b3='journeys['+_0x3e9573+'].',_0x503bb8=!!_0x229635[_0x3bb888(0x126)],_0x57ea2a=_0x503bb8?{..._0x490d2a,'goal':_0x229635[_0x3bb888(0x126)]}:_0x490d2a;validateStagesForVersion(_0x38bd8e,_0x57ea2a,_0x427fd8,_0x4385b3,_0x18a3fa,_0x2df9d8,{'goalIsInherited':!_0x503bb8});}else{if(_0x490d2a[_0x3bb888(0x136)]&&_0x490d2a['versions'][_0x3bb888(0x111)]>0x0)for(let _0x5d26c8=0x0;_0x5d26c8<_0x490d2a[_0x3bb888(0x136)][_0x3bb888(0x111)];_0x5d26c8++){const _0x539668=_0x490d2a[_0x3bb888(0x136)][_0x5d26c8];if(_0x490d2a[_0x3bb888(0x136)][_0x3bb888(0x111)]>0x1&&_0x539668[_0x3bb888(0xa8)]===_0x3bb888(0xf6))continue;const _0x3ef58b=_0x539668['stages']||[],_0x441be5='versions['+_0x5d26c8+'].';validateStagesForVersion(_0x3ef58b,_0x490d2a,_0x427fd8,_0x441be5,_0x18a3fa,_0x2df9d8);}else{const _0x279488=_0x490d2a['stages']||[];validateStagesForVersion(_0x279488,_0x490d2a,_0x427fd8,'',_0x18a3fa,_0x2df9d8);}}_0x490d2a[_0x3bb888(0x137)]&&_0x490d2a[_0x3bb888(0x137)]['length']>0x1&&(deduplicateAcrossVersions(_0x18a3fa),deduplicateAcrossVersions(_0x2df9d8));for(const _0x881c10 of _0x53882b){!_0x54e983[_0x3bb888(0xf7)](_0x881c10)&&!_0x881c10[_0x3bb888(0x122)]('excluded_')&&_0x2df9d8[_0x3bb888(0x115)]({'level':_0x3bb888(0xe8),'path':_0x3bb888(0x11f)+_0x881c10,'code':_0x3bb888(0xaf),'message':_0x3bb888(0x99)+_0x881c10+_0x3bb888(0x100),'location':getLocationFromPath(_0x1727dd[_0x3bb888(0xbb)],_0x1727dd['source'],[_0x3bb888(0xc3),_0x881c10])});}return{'valid':_0x18a3fa[_0x3bb888(0x111)]===0x0,'errors':_0x18a3fa,'warnings':_0x2df9d8};}
1
+ (function(_0x58f320,_0x151242){const _0x4245dc=a146_0x5865,_0x28ed38=_0x58f320();while(!![]){try{const _0xc5fac4=-parseInt(_0x4245dc(0x10f))/0x1*(parseInt(_0x4245dc(0x106))/0x2)+parseInt(_0x4245dc(0x127))/0x3*(-parseInt(_0x4245dc(0x157))/0x4)+parseInt(_0x4245dc(0x16f))/0x5*(-parseInt(_0x4245dc(0x10d))/0x6)+-parseInt(_0x4245dc(0x121))/0x7*(parseInt(_0x4245dc(0x199))/0x8)+parseInt(_0x4245dc(0x147))/0x9*(-parseInt(_0x4245dc(0x15c))/0xa)+parseInt(_0x4245dc(0x166))/0xb*(-parseInt(_0x4245dc(0x128))/0xc)+parseInt(_0x4245dc(0x153))/0xd;if(_0xc5fac4===_0x151242)break;else _0x28ed38['push'](_0x28ed38['shift']());}catch(_0x48067f){_0x28ed38['push'](_0x28ed38['shift']());}}}(a146_0x1fc8,0x6c2d2));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x2c8143,_0x456164,_0x494c1b,_0x14f0ba,_0x18a9c0,_0x38f604){const _0x1219a5=a146_0x5865;return{'level':_0x2c8143,'path':_0x456164,'code':_0x494c1b,'message':_0x14f0ba,'location':getLocationFromPath(_0x18a9c0[_0x1219a5(0x13c)],_0x18a9c0[_0x1219a5(0x160)],pathToArray(_0x38f604??_0x456164))};}function validateVersionStructure(_0x5655a8,_0x1aec37){const _0x10c7f8=a146_0x5865,_0x47245d=[];return _0x5655a8['length']>MAX_STAGES&&_0x47245d[_0x10c7f8(0x152)](createIssue('error',_0x10c7f8(0x1a3),_0x10c7f8(0x16c),'Journey\x20has\x20'+_0x5655a8[_0x10c7f8(0x11c)]+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x1aec37)),_0x47245d;}function validateStageStructure(_0x4623e8,_0x2f4a59,_0x4f54ba,_0x227dad){const _0x3bb0cb=a146_0x5865,_0x5450fb=[],_0x10ad88=_0x3bb0cb(0x18f)+_0x2f4a59+']';_0x2f4a59===0x0&&!_0x4623e8[_0x3bb0cb(0x191)]&&_0x5450fb[_0x3bb0cb(0x152)](createIssue(_0x3bb0cb(0x149),_0x10ad88+_0x3bb0cb(0x10e),_0x3bb0cb(0x126),_0x3bb0cb(0x101)+_0x4623e8[_0x3bb0cb(0x19c)]+_0x3bb0cb(0x194),_0x227dad,_0x10ad88));const _0x16b6b7=_0x2f4a59===_0x4f54ba-0x1;!_0x16b6b7&&!_0x4623e8[_0x3bb0cb(0x1a5)]&&_0x5450fb[_0x3bb0cb(0x152)](createIssue(_0x3bb0cb(0x149),_0x10ad88+_0x3bb0cb(0x116),_0x3bb0cb(0x1a0),'Stage\x20\x27'+_0x4623e8[_0x3bb0cb(0x19c)]+_0x3bb0cb(0x107),_0x227dad,_0x10ad88));(!_0x4623e8[_0x3bb0cb(0x1aa)]||_0x4623e8[_0x3bb0cb(0x1aa)][_0x3bb0cb(0x11c)]===0x0)&&_0x5450fb[_0x3bb0cb(0x152)](createIssue(_0x3bb0cb(0x135),_0x10ad88+_0x3bb0cb(0x112),'MISSING_EXIT_CRITERIA',_0x3bb0cb(0x101)+_0x4623e8[_0x3bb0cb(0x19c)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x227dad,_0x10ad88));const _0x111519=_0x4623e8[_0x3bb0cb(0x141)]?.['length']??0x0;if(_0x111519===0x0)_0x5450fb['push'](createIssue(_0x3bb0cb(0x149),_0x10ad88+_0x3bb0cb(0x134),_0x3bb0cb(0x109),'Stage\x20\x27'+_0x4623e8[_0x3bb0cb(0x19c)]+'\x27\x20has\x20no\x20steps',_0x227dad,_0x10ad88+'.steps'));else{if(_0x111519===0x1)_0x5450fb[_0x3bb0cb(0x152)](createIssue(_0x3bb0cb(0x135),_0x10ad88+_0x3bb0cb(0x134),_0x3bb0cb(0x109),_0x3bb0cb(0x101)+_0x4623e8[_0x3bb0cb(0x19c)]+_0x3bb0cb(0x19d),_0x227dad,_0x10ad88+_0x3bb0cb(0x134)));else _0x111519<=0x3&&_0x5450fb[_0x3bb0cb(0x152)](createIssue(_0x3bb0cb(0x135),_0x10ad88+_0x3bb0cb(0x134),_0x3bb0cb(0x196),_0x3bb0cb(0x101)+_0x4623e8['name']+_0x3bb0cb(0x1b6)+_0x111519+_0x3bb0cb(0x181),_0x227dad,_0x10ad88+_0x3bb0cb(0x134)));}return _0x5450fb;}function validateStep(_0xaa0bd2,_0x48e74f,_0x12a9d4,_0x116de4){const _0x4d7fc5=a146_0x5865,_0x289fbb=[];if(_0xaa0bd2[_0x4d7fc5(0x15d)]===_0x4d7fc5(0x189))return _0xaa0bd2[_0x4d7fc5(0x138)]&&_0x289fbb[_0x4d7fc5(0x152)](createIssue(_0x4d7fc5(0x149),_0x48e74f+'.next',_0x4d7fc5(0x170),_0x4d7fc5(0x1ad)+_0xaa0bd2['name']+_0x4d7fc5(0x1af),_0x12a9d4)),'with'in _0xaa0bd2&&_0xaa0bd2[_0x4d7fc5(0x14f)]!==undefined&&_0x289fbb['push'](createIssue(_0x4d7fc5(0x149),_0x48e74f+_0x4d7fc5(0x17c),_0x4d7fc5(0x170),_0x4d7fc5(0x1ad)+_0xaa0bd2[_0x4d7fc5(0x19c)]+_0x4d7fc5(0x1ab),_0x12a9d4)),_0x289fbb;_0xaa0bd2[_0x4d7fc5(0x138)]&&(_0x12a9d4[_0x4d7fc5(0x159)]&&!_0x12a9d4['stepNames'][_0x4d7fc5(0x13d)](_0xaa0bd2['next'])&&_0x289fbb['push'](createIssue(_0x4d7fc5(0x149),_0x48e74f+'.next','INVALID_NEXT_REFERENCE',_0x4d7fc5(0x17b)+_0xaa0bd2[_0x4d7fc5(0x138)]+'\x27',_0x12a9d4)));switch(_0xaa0bd2[_0x4d7fc5(0x15d)]){case'wait':_0x289fbb[_0x4d7fc5(0x152)](...validateWaitStep(_0xaa0bd2,_0x48e74f,_0x12a9d4,_0x116de4));break;case _0x4d7fc5(0x1b0):_0x289fbb[_0x4d7fc5(0x152)](...validateActivationStep(_0xaa0bd2,_0x48e74f,_0x12a9d4));break;case'decision_point':_0x289fbb[_0x4d7fc5(0x152)](...validateDecisionPointStep(_0xaa0bd2,_0x48e74f,_0x12a9d4,_0x116de4));break;case _0x4d7fc5(0x165):_0x289fbb['push'](...validateAbTestStep(_0xaa0bd2,_0x48e74f,_0x12a9d4,_0x116de4));break;case _0x4d7fc5(0x130):_0x289fbb[_0x4d7fc5(0x152)](...validateJumpStep(_0xaa0bd2,_0x48e74f,_0x12a9d4));break;}return _0x289fbb;}function validateWaitStep(_0x5a2e42,_0x400b37,_0x487c41,_0x187813){const _0x943d7c=a146_0x5865,_0x158f3e=[];if(!_0x5a2e42['with'])return _0x158f3e[_0x943d7c(0x152)](createIssue(_0x943d7c(0x149),_0x400b37+_0x943d7c(0x17c),_0x943d7c(0x198),'Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field',_0x487c41,_0x400b37)),_0x158f3e;if(_0x5a2e42[_0x943d7c(0x14f)][_0x943d7c(0x114)]){const _0x60fe75=_0x5a2e42[_0x943d7c(0x14f)][_0x943d7c(0x114)];if(_0x60fe75[_0x943d7c(0x173)]){_0x487c41[_0x943d7c(0x133)]?.[_0x943d7c(0x151)](_0x60fe75[_0x943d7c(0x173)]);!_0x60fe75[_0x943d7c(0x173)][_0x943d7c(0x14e)](_0x943d7c(0x174))&&(_0x487c41['embeddedSegments']&&!_0x487c41[_0x943d7c(0x103)][_0x943d7c(0x13d)](_0x60fe75[_0x943d7c(0x173)])&&_0x158f3e[_0x943d7c(0x152)](createIssue(_0x943d7c(0x149),_0x400b37+_0x943d7c(0x17a),'MISSING_SEGMENT_REFERENCE',_0x943d7c(0x144)+_0x60fe75[_0x943d7c(0x173)]+_0x943d7c(0x186),_0x487c41)));_0x60fe75['next']&&_0x487c41['stepNames']&&!_0x487c41[_0x943d7c(0x159)][_0x943d7c(0x13d)](_0x60fe75['next'])&&_0x158f3e[_0x943d7c(0x152)](createIssue(_0x943d7c(0x149),_0x400b37+_0x943d7c(0x162),_0x943d7c(0x18d),_0x943d7c(0x118)+_0x60fe75[_0x943d7c(0x138)]+'\x27',_0x487c41));_0x60fe75[_0x943d7c(0x150)]?.[_0x943d7c(0x138)]&&_0x487c41[_0x943d7c(0x159)]&&!_0x487c41['stepNames'][_0x943d7c(0x13d)](_0x60fe75['timeout'][_0x943d7c(0x138)])&&_0x158f3e[_0x943d7c(0x152)](createIssue(_0x943d7c(0x149),_0x400b37+'.with.condition.timeout.next',_0x943d7c(0x18d),_0x943d7c(0x154)+_0x60fe75[_0x943d7c(0x150)]['next']+'\x27',_0x487c41));const _0x5422e7=_0x60fe75['next']||_0x5a2e42[_0x943d7c(0x138)],_0x53d443=_0x60fe75[_0x943d7c(0x150)]?.[_0x943d7c(0x138)]||_0x5a2e42[_0x943d7c(0x138)];if(_0x5422e7){const _0x36021d=_0x187813[_0x943d7c(0x137)](_0x5422e7);_0x36021d?.[_0x943d7c(0x15d)]===_0x943d7c(0x146)&&_0x158f3e['push'](createIssue(_0x943d7c(0x135),_0x400b37+_0x943d7c(0x162),_0x943d7c(0x12a),'Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x5422e7+_0x943d7c(0x143),_0x487c41,_0x400b37+_0x943d7c(0x12e)));}if(_0x53d443){const _0x318b45=_0x187813[_0x943d7c(0x137)](_0x53d443);_0x318b45?.[_0x943d7c(0x15d)]===_0x943d7c(0x146)&&_0x158f3e['push'](createIssue(_0x943d7c(0x135),_0x400b37+_0x943d7c(0x15a),_0x943d7c(0x12a),'Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x53d443+_0x943d7c(0x143),_0x487c41,_0x400b37+'.with.condition.timeout'));}}}return _0x158f3e;}function validateActivationStep(_0x1dbff4,_0x14fa28,_0x37e5d8){const _0x20ae94=a146_0x5865,_0x13d511=[];if(!_0x1dbff4[_0x20ae94(0x14f)]?.[_0x20ae94(0x1b0)])return _0x13d511['push'](createIssue(_0x20ae94(0x149),_0x14fa28+'.with.activation',_0x20ae94(0x10c),_0x20ae94(0x124),_0x37e5d8,_0x14fa28)),_0x13d511;const _0x429494=_0x1dbff4['with'][_0x20ae94(0x1b0)];return _0x37e5d8[_0x20ae94(0x12c)]&&!_0x429494[_0x20ae94(0x14e)](_0x20ae94(0x174))&&(!_0x37e5d8[_0x20ae94(0x12c)]['has'](_0x429494)&&_0x13d511[_0x20ae94(0x152)](createIssue(_0x20ae94(0x149),_0x14fa28+_0x20ae94(0x11f),'MISSING_ACTIVATION_DEFINITION','Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x429494+_0x20ae94(0x113),_0x37e5d8))),_0x13d511;}function validateDecisionPointStep(_0x3c14a4,_0x36cfff,_0x577377,_0x22a629){const _0x4ae0ff=a146_0x5865,_0x24b262=[];if(!_0x3c14a4[_0x4ae0ff(0x14f)]?.[_0x4ae0ff(0x13f)]||_0x3c14a4[_0x4ae0ff(0x14f)][_0x4ae0ff(0x13f)][_0x4ae0ff(0x11c)]===0x0)return _0x24b262[_0x4ae0ff(0x152)](createIssue(_0x4ae0ff(0x149),_0x36cfff+_0x4ae0ff(0x179),_0x4ae0ff(0x129),'Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x577377,_0x36cfff)),_0x24b262;for(let _0x37ae7d=0x0;_0x37ae7d<_0x3c14a4['with'][_0x4ae0ff(0x13f)]['length'];_0x37ae7d++){const _0xabf0b1=_0x3c14a4['with']['branches'][_0x37ae7d],_0x4201d8=_0x36cfff+'.with.branches['+_0x37ae7d+']';_0xabf0b1['segment']&&!_0xabf0b1[_0x4ae0ff(0xfc)]&&(_0x577377[_0x4ae0ff(0x133)]?.[_0x4ae0ff(0x151)](_0xabf0b1['segment']),!_0xabf0b1[_0x4ae0ff(0x173)][_0x4ae0ff(0x14e)](_0x4ae0ff(0x174))&&(_0x577377[_0x4ae0ff(0x103)]&&!_0x577377[_0x4ae0ff(0x103)][_0x4ae0ff(0x13d)](_0xabf0b1['segment'])&&_0x24b262['push'](createIssue(_0x4ae0ff(0x149),_0x4201d8+_0x4ae0ff(0x19b),_0x4ae0ff(0x12b),_0x4ae0ff(0x104)+_0xabf0b1[_0x4ae0ff(0x173)]+'\x27',_0x577377))));_0xabf0b1[_0x4ae0ff(0x138)]&&_0x577377[_0x4ae0ff(0x159)]&&!_0x577377['stepNames']['has'](_0xabf0b1['next'])&&_0x24b262['push'](createIssue(_0x4ae0ff(0x149),_0x4201d8+'.next','INVALID_NEXT_REFERENCE',_0x4ae0ff(0x108)+_0xabf0b1[_0x4ae0ff(0x138)]+'\x27',_0x577377));if(_0xabf0b1['next']){const _0x1e4062=_0x22a629[_0x4ae0ff(0x137)](_0xabf0b1['next']);_0x1e4062?.[_0x4ae0ff(0x15d)]==='merge'&&_0x24b262['push'](createIssue(_0x4ae0ff(0x135),_0x4201d8+'.next',_0x4ae0ff(0x12a),_0x4ae0ff(0x187)+_0xabf0b1['name']+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0xabf0b1['next']+_0x4ae0ff(0x163),_0x577377));}}return _0x24b262;}function validateAbTestStep(_0x1c45bc,_0x3441a0,_0xd980df,_0x1177d2){const _0x2cf14f=a146_0x5865,_0x87167b=[];if(!_0x1c45bc[_0x2cf14f(0x14f)]?.['variants']||_0x1c45bc[_0x2cf14f(0x14f)][_0x2cf14f(0x185)][_0x2cf14f(0x11c)]===0x0)return _0x87167b['push'](createIssue(_0x2cf14f(0x149),_0x3441a0+_0x2cf14f(0x14b),_0x2cf14f(0x129),_0x2cf14f(0x18b),_0xd980df,_0x3441a0)),_0x87167b;const _0x29e24f=_0x1c45bc[_0x2cf14f(0x14f)]['variants'][_0x2cf14f(0x111)]((_0x5c4212,_0x46c122)=>_0x5c4212+(_0x46c122[_0x2cf14f(0x176)]||0x0),0x0);Math[_0x2cf14f(0x178)](_0x29e24f-0x64)>0.01&&_0x87167b[_0x2cf14f(0x152)](createIssue('error',_0x3441a0+_0x2cf14f(0x14b),_0x2cf14f(0x193),_0x2cf14f(0xfb)+_0x29e24f+'%)',_0xd980df));for(let _0x30c3c0=0x0;_0x30c3c0<_0x1c45bc[_0x2cf14f(0x14f)][_0x2cf14f(0x185)][_0x2cf14f(0x11c)];_0x30c3c0++){const _0x5af459=_0x1c45bc[_0x2cf14f(0x14f)]['variants'][_0x30c3c0],_0x4ee0de=_0x3441a0+'.with.variants['+_0x30c3c0+']';_0x5af459[_0x2cf14f(0x138)]&&_0xd980df[_0x2cf14f(0x159)]&&!_0xd980df[_0x2cf14f(0x159)][_0x2cf14f(0x13d)](_0x5af459['next'])&&_0x87167b[_0x2cf14f(0x152)](createIssue('error',_0x4ee0de+_0x2cf14f(0x139),'INVALID_NEXT_REFERENCE',_0x2cf14f(0x131)+_0x5af459['next']+'\x27',_0xd980df));if(_0x5af459['next']){const _0x5796ae=_0x1177d2['get'](_0x5af459[_0x2cf14f(0x138)]);_0x5796ae?.[_0x2cf14f(0x15d)]===_0x2cf14f(0x146)&&_0x87167b[_0x2cf14f(0x152)](createIssue(_0x2cf14f(0x135),_0x4ee0de+'.next',_0x2cf14f(0x12a),_0x2cf14f(0x169)+_0x5af459[_0x2cf14f(0x19c)]+_0x2cf14f(0x14d)+_0x5af459[_0x2cf14f(0x138)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0xd980df));}}return _0x87167b;}function validateJumpStep(_0x14d917,_0x247bdf,_0x571301){const _0x39360f=a146_0x5865,_0x293a13=[];if(!_0x14d917[_0x39360f(0x14f)]?.[_0x39360f(0x11e)])return _0x293a13['push'](createIssue(_0x39360f(0x149),_0x247bdf+_0x39360f(0x1b3),_0x39360f(0x145),_0x39360f(0x168),_0x571301,_0x247bdf)),_0x293a13;return(!_0x14d917[_0x39360f(0x14f)][_0x39360f(0x11e)]['journey']||!_0x14d917[_0x39360f(0x14f)][_0x39360f(0x11e)][_0x39360f(0x18e)])&&_0x293a13[_0x39360f(0x152)](createIssue(_0x39360f(0x149),_0x247bdf+_0x39360f(0x1b3),'INVALID_JUMP_TARGET',_0x39360f(0x142),_0x571301)),_0x293a13;}function buildConvergenceMap(_0xb1629){const _0x2f1253=a146_0x5865,_0x1c9070=new Map();function _0x1360db(_0x3f20e5,_0x3920cd){const _0x13cc5c=a146_0x5865,_0x2b5a71=_0x1c9070['get'](_0x3f20e5)||[];_0x2b5a71[_0x13cc5c(0x152)](_0x3920cd),_0x1c9070['set'](_0x3f20e5,_0x2b5a71);}for(const _0x2e353b of _0xb1629){_0x2e353b[_0x2f1253(0x138)]&&_0x1360db(_0x2e353b[_0x2f1253(0x138)],{'stepName':_0x2e353b[_0x2f1253(0x19c)],'description':_0x2f1253(0x19e)+_0x2e353b[_0x2f1253(0x19c)]+'\x27'});if(_0x2e353b[_0x2f1253(0x15d)]===_0x2f1253(0x10a)&&_0x2e353b[_0x2f1253(0x14f)]?.['branches'])for(const _0x37c4e5 of _0x2e353b['with'][_0x2f1253(0x13f)]){_0x37c4e5['next']&&_0x1360db(_0x37c4e5[_0x2f1253(0x138)],{'stepName':_0x2e353b[_0x2f1253(0x19c)],'description':_0x2f1253(0x192)+_0x37c4e5[_0x2f1253(0x19c)]+'\x27\x20of\x20\x27'+_0x2e353b[_0x2f1253(0x19c)]+'\x27'});}if(_0x2e353b[_0x2f1253(0x15d)]===_0x2f1253(0x165)&&_0x2e353b['with']?.[_0x2f1253(0x185)])for(const _0x36544d of _0x2e353b[_0x2f1253(0x14f)][_0x2f1253(0x185)]){_0x36544d[_0x2f1253(0x138)]&&_0x1360db(_0x36544d[_0x2f1253(0x138)],{'stepName':_0x2e353b[_0x2f1253(0x19c)],'description':_0x2f1253(0x172)+_0x36544d[_0x2f1253(0x19c)]+_0x2f1253(0x1a9)+_0x2e353b[_0x2f1253(0x19c)]+'\x27'});}_0x2e353b[_0x2f1253(0x15d)]==='wait'&&_0x2e353b['with']?.['condition']&&(_0x2e353b[_0x2f1253(0x14f)][_0x2f1253(0x114)][_0x2f1253(0x138)]&&_0x1360db(_0x2e353b[_0x2f1253(0x14f)]['condition'][_0x2f1253(0x138)],{'stepName':_0x2e353b[_0x2f1253(0x19c)],'description':_0x2f1253(0x1a1)+_0x2e353b[_0x2f1253(0x19c)]+'\x27'}),_0x2e353b[_0x2f1253(0x14f)][_0x2f1253(0x114)][_0x2f1253(0x150)]?.[_0x2f1253(0x138)]&&_0x1360db(_0x2e353b['with'][_0x2f1253(0x114)][_0x2f1253(0x150)][_0x2f1253(0x138)],{'stepName':_0x2e353b[_0x2f1253(0x19c)],'description':_0x2f1253(0x17f)+_0x2e353b['name']+'\x27'}));}return _0x1c9070;}function validateFlowControl(_0x5eef83,_0xe5aa2d,_0x57865e){const _0x2dda9a=a146_0x5865,_0x598e26=[],_0x2a6a09=_0x2dda9a(0x18f)+_0xe5aa2d+']',_0x531aa9=_0x5eef83['steps']||[];if(_0x531aa9[_0x2dda9a(0x11c)]===0x0)return _0x598e26;const _0x2d43b0=new Map();for(const _0x51484c of _0x531aa9){_0x51484c['name']&&_0x2d43b0[_0x2dda9a(0x17d)](_0x51484c[_0x2dda9a(0x19c)],_0x51484c);}const _0x596973=buildConvergenceMap(_0x531aa9),_0x1e9f22=_0x531aa9[_0x2dda9a(0x120)](_0x36efee=>_0x36efee['type']===_0x2dda9a(0x189));!_0x1e9f22&&_0x598e26[_0x2dda9a(0x152)](createIssue(_0x2dda9a(0x149),_0x2a6a09+_0x2dda9a(0x134),'MISSING_END_STEP','Stage\x20\x27'+_0x5eef83[_0x2dda9a(0x19c)]+_0x2dda9a(0x182),_0x57865e));for(const [_0x38fe63,_0x413559]of _0x596973){const _0x2a9d1f=_0x2d43b0[_0x2dda9a(0x137)](_0x38fe63);if(!_0x2a9d1f)continue;if(_0x413559[_0x2dda9a(0x11c)]>0x1&&_0x2a9d1f[_0x2dda9a(0x15d)]!==_0x2dda9a(0x146)){const _0x4b0fd6=_0x413559[_0x2dda9a(0x125)](_0x15c9a6=>_0x15c9a6[_0x2dda9a(0x1b4)])[_0x2dda9a(0x1a8)](',\x20');_0x598e26[_0x2dda9a(0x152)](createIssue(_0x2dda9a(0x149),_0x2a6a09+_0x2dda9a(0x134),_0x2dda9a(0x177),_0x2dda9a(0x1a6)+_0x38fe63+'\x27\x20(from:\x20'+_0x4b0fd6+_0x2dda9a(0x1b5),_0x57865e));}_0x413559[_0x2dda9a(0x11c)]===0x1&&_0x2a9d1f[_0x2dda9a(0x15d)]===_0x2dda9a(0x146)&&_0x598e26[_0x2dda9a(0x152)](createIssue(_0x2dda9a(0x135),_0x2a6a09+_0x2dda9a(0x134),_0x2dda9a(0x132),_0x2dda9a(0x105)+_0x38fe63+'\x27\x20has\x20only\x20one\x20input\x20(from:\x20'+_0x413559[0x0][_0x2dda9a(0x1b4)]+_0x2dda9a(0x161),_0x57865e));}for(const _0x534c68 of _0x531aa9){if(_0x534c68[_0x2dda9a(0x15d)]==='merge'&&_0x534c68[_0x2dda9a(0x138)]){const _0x3cc423=_0x2d43b0[_0x2dda9a(0x137)](_0x534c68['next']);_0x3cc423?.[_0x2dda9a(0x15d)]==='merge'&&_0x598e26[_0x2dda9a(0x152)](createIssue(_0x2dda9a(0x149),_0x2a6a09+_0x2dda9a(0x134),_0x2dda9a(0x171),_0x2dda9a(0x105)+_0x534c68[_0x2dda9a(0x19c)]+_0x2dda9a(0x195)+_0x534c68[_0x2dda9a(0x138)]+'\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.',_0x57865e));}}return _0x598e26;}function validateCriteria(_0x14f087,_0x4daad8,_0xc37ffa){const _0x2fad8f=a146_0x5865,_0x376cfc=[];return _0x14f087[_0x2fad8f(0x173)]&&(_0xc37ffa['referencedSegments']?.[_0x2fad8f(0x151)](_0x14f087['segment']),!_0x14f087[_0x2fad8f(0x173)][_0x2fad8f(0x14e)](_0x2fad8f(0x174))&&(_0xc37ffa[_0x2fad8f(0x103)]&&!_0xc37ffa[_0x2fad8f(0x103)][_0x2fad8f(0x13d)](_0x14f087[_0x2fad8f(0x173)])&&_0x376cfc[_0x2fad8f(0x152)](createIssue(_0x2fad8f(0x149),_0x4daad8+'.segment',_0x2fad8f(0x12b),'Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x14f087[_0x2fad8f(0x173)]+'\x27',_0xc37ffa)))),_0x376cfc;}function validateEmbeddedSegment(_0x1ad565,_0x416bfc,_0x4082bc){const _0x694193=a146_0x5865,_0x2f128d=[];return _0x1ad565[_0x694193(0x13a)]&&_0x2f128d[_0x694193(0x152)](...validateRuleDef(_0x1ad565[_0x694193(0x13a)],_0x416bfc+_0x694193(0x16d),_0x4082bc)),_0x2f128d;}function validateStage(_0x39d8bb,_0x107bdc,_0x139ade,_0x599864){const _0x389315=a146_0x5865,_0xcb0555=[],_0x23a324=_0x389315(0x18f)+_0x107bdc+']',_0x7e0bc5=new Map(),_0x217844=new Map();if(_0x39d8bb[_0x389315(0x141)]){for(let _0xedeaa9=0x0;_0xedeaa9<_0x39d8bb[_0x389315(0x141)]['length'];_0xedeaa9++){const _0x27d304=_0x39d8bb[_0x389315(0x141)][_0xedeaa9];_0x27d304['name']&&_0x7e0bc5[_0x389315(0x17d)](_0x27d304[_0x389315(0x19c)],_0x27d304);}for(let _0x483f37=0x0;_0x483f37<_0x39d8bb['steps'][_0x389315(0x11c)];_0x483f37++){const _0x4fc408=_0x39d8bb[_0x389315(0x141)][_0x483f37],_0x33db8b=_0x23a324+_0x389315(0x119)+_0x483f37+']';if(_0x4fc408['name']){if(_0x217844[_0x389315(0x13d)](_0x4fc408[_0x389315(0x19c)])){const _0x2b485f=_0x217844[_0x389315(0x137)](_0x4fc408[_0x389315(0x19c)]);_0xcb0555['push'](createIssue('error',_0x33db8b+_0x389315(0x19f),_0x389315(0x14c),_0x389315(0x18a)+_0x4fc408['name']+_0x389315(0x115)+_0x2b485f+'])',_0x599864));}else _0x217844[_0x389315(0x17d)](_0x4fc408[_0x389315(0x19c)],_0x483f37);}_0xcb0555[_0x389315(0x152)](...validateStep(_0x4fc408,_0x33db8b,_0x599864,_0x7e0bc5));}}_0x39d8bb[_0x389315(0x191)]&&_0xcb0555[_0x389315(0x152)](...validateCriteria(_0x39d8bb[_0x389315(0x191)],_0x23a324+_0x389315(0x10e),_0x599864));if(_0x39d8bb[_0x389315(0x1aa)])for(let _0x275baf=0x0;_0x275baf<_0x39d8bb[_0x389315(0x1aa)][_0x389315(0x11c)];_0x275baf++){_0xcb0555[_0x389315(0x152)](...validateCriteria(_0x39d8bb[_0x389315(0x1aa)][_0x275baf],_0x23a324+_0x389315(0x11a)+_0x275baf+']',_0x599864));}return _0x39d8bb[_0x389315(0x1a5)]&&_0xcb0555[_0x389315(0x152)](...validateCriteria(_0x39d8bb[_0x389315(0x1a5)],_0x23a324+'.milestone',_0x599864)),_0xcb0555[_0x389315(0x152)](...validateStageStructure(_0x39d8bb,_0x107bdc,_0x139ade,_0x599864)),_0xcb0555[_0x389315(0x152)](...validateFlowControl(_0x39d8bb,_0x107bdc,_0x599864)),_0xcb0555;}function validateStagesForVersion(_0x39421b,_0x476e8a,_0x398ff9,_0x29d4b9,_0x533e54,_0x282266,_0x4c7b6c){const _0x3d2e76=a146_0x5865;if(_0x39421b[_0x3d2e76(0x11c)]===0x0){_0x533e54[_0x3d2e76(0x152)]({'level':_0x3d2e76(0x149),'path':_0x29d4b9+'stages','code':_0x3d2e76(0x110),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x398ff9['document'],_0x398ff9[_0x3d2e76(0x160)],[_0x3d2e76(0x1a3)])});return;}const _0x351d26=new Set();for(const _0x3fcce3 of _0x39421b){if(_0x3fcce3[_0x3d2e76(0x141)])for(const _0x1ee283 of _0x3fcce3[_0x3d2e76(0x141)]){_0x1ee283[_0x3d2e76(0x19c)]&&_0x351d26[_0x3d2e76(0x151)](_0x1ee283[_0x3d2e76(0x19c)]);}}const _0x187f4e={..._0x398ff9,'stepNames':_0x351d26},_0x5c6461=validateVersionStructure(_0x39421b,_0x187f4e);for(const _0xbdba0f of _0x5c6461){const _0x5071b4=_0x29d4b9?{..._0xbdba0f,'path':''+_0x29d4b9+_0xbdba0f[_0x3d2e76(0x18c)]}:_0xbdba0f;if(_0x5071b4[_0x3d2e76(0x10b)]===_0x3d2e76(0x149))_0x533e54[_0x3d2e76(0x152)](_0x5071b4);else _0x282266[_0x3d2e76(0x152)](_0x5071b4);}for(let _0x4e26fe=0x0;_0x4e26fe<_0x39421b['length'];_0x4e26fe++){const _0x2da93a=validateStage(_0x39421b[_0x4e26fe],_0x4e26fe,_0x39421b['length'],_0x187f4e);for(const _0x35ddbb of _0x2da93a){const _0x48ca57=_0x29d4b9?{..._0x35ddbb,'path':''+_0x29d4b9+_0x35ddbb[_0x3d2e76(0x18c)]}:_0x35ddbb;if(_0x48ca57[_0x3d2e76(0x10b)]===_0x3d2e76(0x149))_0x533e54[_0x3d2e76(0x152)](_0x48ca57);else _0x282266['push'](_0x48ca57);}}if(_0x476e8a['goal']){const _0x35b88c=_0x4c7b6c?.['goalIsInherited']?_0x3d2e76(0x16a):_0x29d4b9+'goal',_0x1bfca0=validateCriteria(_0x476e8a[_0x3d2e76(0x16a)],_0x35b88c,_0x187f4e);for(const _0x573206 of _0x1bfca0){if(_0x573206[_0x3d2e76(0x10b)]===_0x3d2e76(0x149))_0x533e54[_0x3d2e76(0x152)](_0x573206);else _0x282266[_0x3d2e76(0x152)](_0x573206);}}}function extractVersionIndex(_0x3e0b71){const _0x31bfd7=a146_0x5865,_0x4d613d=_0x3e0b71[_0x31bfd7(0x197)](/^journeys\[(\d+)\]\./);return _0x4d613d?_0x4d613d[0x1]:undefined;}function a146_0x1fc8(){const _0x17106d=['versions','steps','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','INVALID_JUMP_TARGET','merge','252ioxBQa','journeys,\x20stages,\x20or\x20versions','error','entries','.with.variants','DUPLICATE_STEP_NAME','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','startsWith','with','timeout','add','push','43549532DpSVOH','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','skipSchema','journeys[','4BStaFb','latest','stepNames','.with.condition.timeout.next','MISSING_NAME','43790gJuGzK','type','symbol','segments','source',').\x20Merge\x20is\x20unnecessary.','.with.condition.next','\x27\x20with\x20no\x20action\x20in\x20between','indices','ab_test','8883171XebJLb','.type','Jump\x20step\x20requires\x20a\x20target','A/B\x20test\x20variant\x20\x27','goal','excluded_','TOO_MANY_STAGES','.rule','safeParse','5QemzlK','END_STEP_HAS_NEXT_OR_WITH','MERGE_TO_MERGE_CHAIN','variant\x20\x27','segment','ref:','message','percentage','CONVERGENCE_WITHOUT_MERGE','abs','.with.branches','.with.condition.segment','Step\x20references\x20non-existent\x20step\x20\x27','.with','set','version','timeout\x20of\x20\x27','splice','\x20steps\x20(may\x20be\x20too\x20simple)','\x27\x20has\x20no\x20end\x20step','segments.','\x20(across\x20','variants','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','Decision\x20branch\x20\x27','JOURNEY_SCHEMA_ERROR','end','Duplicate\x20step\x20name\x20\x27','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','path','INVALID_NEXT_REFERENCE','stage','stages[','data','entry_criteria','branch\x20\x27','INVALID_AB_TEST_PERCENTAGES','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','FEW_STEPS','match','MISSING_WAIT_PARAMS','8RzXgXX','success','.segment','name','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','step\x20\x27','.name','MISSING_MILESTONE','condition\x20of\x20\x27','MISSING_GOAL','stages','code','milestone','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','versions[','join','\x27\x20of\x20\x27','exit_criteria','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','every','End\x20step\x20\x27','replace','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','activation','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','endsWith','.with.target','description',').\x20Use\x20a\x20merge\x20step.','\x27\x20has\x20only\x20','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','excluded','size','Embedded\x20segment\x20\x27','values','launched','Stage\x20\x27','Journey\x20has\x20no\x20goal\x20defined','embeddedSegments','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','Merge\x20step\x20\x27','2PcHfpC','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','INSUFFICIENT_STEPS','decision_point','level','MISSING_ACTIVATION_REF','4325898lFKXVB','.entry_criteria','334213whgYqz','MISSING_STAGES','reduce','.exit_criteria','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','condition','\x27\x20(first\x20defined\x20at\x20steps[','.milestone','keys','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','.steps[','.exit_criteria[','state','length','\x20versions)','target','.with.activation','some','443198JpASXF','ACTIVATION_SCHEMA_ERROR','activations','Activation\x20step\x20requires\x20an\x20activation\x20reference','map','MISSING_ENTRY_CRITERIA','2574573cvYPqm','12FQYIif','MISSING_CONDITIONS','BRANCH_DIRECTLY_TO_MERGE','MISSING_SEGMENT_REFERENCE','activationKeys','journey\x20entry','.with.condition','issues','jump','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','SINGLE_INPUT_MERGE','referencedSegments','.steps','warning','includes','get','next','.next','rule','journeys','document','has','Journey\x20name\x20is\x20required','branches'];a146_0x1fc8=function(){return _0x17106d;};return a146_0x1fc8();}function deduplicateAcrossVersions(_0x17738b){const _0x371212=a146_0x5865,_0x234b84=new Map();for(let _0x1f2f0c=0x0;_0x1f2f0c<_0x17738b[_0x371212(0x11c)];_0x1f2f0c++){const _0x27ad76=_0x17738b[_0x1f2f0c][_0x371212(0x1a4)]+':'+_0x17738b[_0x1f2f0c][_0x371212(0x175)],_0x39ab48=extractVersionIndex(_0x17738b[_0x1f2f0c]['path']),_0x536b77=_0x234b84[_0x371212(0x137)](_0x27ad76);if(_0x536b77){_0x536b77[_0x371212(0x164)][_0x371212(0x152)](_0x1f2f0c);if(_0x39ab48)_0x536b77[_0x371212(0x140)][_0x371212(0x151)](_0x39ab48);}else _0x234b84[_0x371212(0x17d)](_0x27ad76,{'indices':[_0x1f2f0c],'versions':new Set(_0x39ab48?[_0x39ab48]:[])});}const _0x51a2b6=new Set();for(const {indices:_0x371eb7,versions:_0x2852a6}of _0x234b84[_0x371212(0xff)]()){if(_0x2852a6[_0x371212(0xfd)]<=0x1)continue;const _0x2cff9c=_0x17738b[_0x371eb7[0x0]];_0x2cff9c['path']=_0x2cff9c[_0x371212(0x18c)][_0x371212(0x1ae)](/^journeys\[\d+\]\./,''),_0x2cff9c[_0x371212(0x175)]=_0x2cff9c[_0x371212(0x175)]+_0x371212(0x184)+_0x2852a6['size']+_0x371212(0x11d);for(let _0x57144=0x1;_0x57144<_0x371eb7[_0x371212(0x11c)];_0x57144++){_0x51a2b6['add'](_0x371eb7[_0x57144]);}}const _0x1c84f0=[..._0x51a2b6]['sort']((_0x583605,_0x114a99)=>_0x114a99-_0x583605);for(const _0x29ffbe of _0x1c84f0){_0x17738b[_0x371212(0x180)](_0x29ffbe,0x1);}}function a146_0x5865(_0x3edae9,_0x5410b3){_0x3edae9=_0x3edae9-0xfb;const _0x1fc848=a146_0x1fc8();let _0x58659b=_0x1fc848[_0x3edae9];return _0x58659b;}export function validateJourneyDef(_0x50db02,_0x272cd9={},_0x32f47b={}){const _0x366ac5=a146_0x5865;if(_0x32f47b[_0x366ac5(0x155)])return runJourneySemanticChecks(_0x50db02,_0x272cd9);const _0x2795d7=JourneyDefSchema[_0x366ac5(0x16e)](_0x50db02);if(_0x2795d7[_0x366ac5(0x19a)])return runJourneySemanticChecks(_0x2795d7[_0x366ac5(0x190)],_0x272cd9);return zodErrorsToJourneyValidationResult(_0x2795d7[_0x366ac5(0x149)],_0x272cd9);}function zodErrorsToJourneyValidationResult(_0x1c3932,_0x4532b1){const _0x9bb87d=a146_0x5865,_0x8e6de2=flattenZodIssues(_0x1c3932[_0x9bb87d(0x12f)]),_0x522fb0=_0x8e6de2[_0x9bb87d(0x125)](_0x3a63e5=>{const _0x5274ec=_0x9bb87d,_0x163ce6=formatZodPath(_0x3a63e5[_0x5274ec(0x18c)]),_0x573d37=mapJourneyZodIssueToCode(_0x3a63e5,_0x163ce6),_0x269d47=getLocationFromPath(_0x4532b1[_0x5274ec(0x13c)],_0x4532b1[_0x5274ec(0x160)],_0x3a63e5['path'][_0x5274ec(0x125)](_0x51a723=>typeof _0x51a723===_0x5274ec(0x15e)?String(_0x51a723):_0x51a723));return{'level':'error','path':_0x163ce6,'code':_0x573d37,'message':_0x3a63e5['message'],..._0x269d47&&{'location':_0x269d47}};});return{'valid':![],'errors':_0x522fb0,'warnings':[]};}function mapJourneyZodIssueToCode(_0x599b6c,_0x414adb){const _0x3c3a11=a146_0x5865;if(_0x414adb===_0x3c3a11(0x19c))return _0x3c3a11(0x15b);if(_0x414adb[_0x3c3a11(0x1b2)](_0x3c3a11(0x167))&&_0x414adb[_0x3c3a11(0x136)](_0x3c3a11(0x141)))return _0x3c3a11(0x188);if(_0x414adb==='stages'||_0x414adb[_0x3c3a11(0x1b2)]('.stages'))return _0x3c3a11(0x110);if(_0x414adb===''&&_0x599b6c[_0x3c3a11(0x175)][_0x3c3a11(0x136)](_0x3c3a11(0x148)))return _0x3c3a11(0x110);if(_0x414adb[_0x3c3a11(0x136)](_0x3c3a11(0x1b0)))return _0x3c3a11(0x122);return'JOURNEY_SCHEMA_ERROR';}function runJourneySemanticChecks(_0x13fc2c,_0x2b053b){const _0x11707f=a146_0x5865,_0x115cd8=[],_0x4a86fa=[];(!_0x13fc2c[_0x11707f(0x19c)]||_0x13fc2c[_0x11707f(0x19c)]['trim']()==='')&&_0x115cd8[_0x11707f(0x152)]({'level':_0x11707f(0x149),'path':'name','code':_0x11707f(0x15b),'message':_0x11707f(0x13e),'location':getLocationFromPath(_0x2b053b[_0x11707f(0x13c)],_0x2b053b[_0x11707f(0x160)],[_0x11707f(0x19c)])});const _0x791b56=new Set();if(_0x13fc2c[_0x11707f(0x15f)])for(const _0x22d1b9 of Object[_0x11707f(0x117)](_0x13fc2c[_0x11707f(0x15f)])){_0x791b56['add'](_0x22d1b9);}const _0x35a65f=new Set();if(_0x13fc2c[_0x11707f(0x123)])for(const _0x2f5bbe of Object[_0x11707f(0x117)](_0x13fc2c[_0x11707f(0x123)])){_0x35a65f['add'](_0x2f5bbe);}const _0x47d0d6=new Set(),_0x5804d0={..._0x2b053b,'embeddedSegments':_0x791b56,'referencedSegments':_0x47d0d6,'activationKeys':_0x35a65f[_0x11707f(0xfd)]>0x0?_0x35a65f:undefined};if(_0x13fc2c[_0x11707f(0x15f)])for(const [_0x11122f,_0x9c951f]of Object[_0x11707f(0x14a)](_0x13fc2c[_0x11707f(0x15f)])){const _0x23222a=validateEmbeddedSegment(_0x9c951f,_0x11707f(0x183)+_0x11122f,_0x5804d0);for(const _0x7aaef3 of _0x23222a){if(_0x7aaef3[_0x11707f(0x10b)]===_0x11707f(0x149))_0x115cd8[_0x11707f(0x152)](_0x7aaef3);else _0x4a86fa[_0x11707f(0x152)](_0x7aaef3);}}const _0x430392=!!_0x13fc2c[_0x11707f(0x16a)],_0x20f3e8=_0x13fc2c[_0x11707f(0x13b)]?.[_0x11707f(0x1ac)](_0x595f9d=>!!_0x595f9d['goal'])??![];!_0x430392&&!_0x20f3e8&&_0x4a86fa['push']({'level':_0x11707f(0x135),'path':'goal','code':_0x11707f(0x1a2),'message':_0x11707f(0x102),'location':getLocationFromPath(_0x2b053b[_0x11707f(0x13c)],_0x2b053b[_0x11707f(0x160)],[_0x11707f(0x16a)])});const _0xea3414=_0x13fc2c['journeys']??_0x13fc2c[_0x11707f(0x140)];if(_0xea3414&&_0xea3414['filter'](_0x5f4df2=>_0x5f4df2[_0x11707f(0x158)]===!![])[_0x11707f(0x11c)]>0x1){const _0x673451=_0x13fc2c['journeys']?_0x11707f(0x13b):_0x11707f(0x140);_0x115cd8[_0x11707f(0x152)]({'level':_0x11707f(0x149),'path':_0x673451,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x673451===_0x11707f(0x13b)?_0x11707f(0x12d):_0x11707f(0x17e))+'\x20with\x20latest:\x20true','location':getLocationFromPath(_0x2b053b['document'],_0x2b053b[_0x11707f(0x160)],[_0x673451])});}if(_0x13fc2c[_0x11707f(0x13b)]&&_0x13fc2c[_0x11707f(0x13b)][_0x11707f(0x11c)]>0x0)for(let _0x93b4c4=0x0;_0x93b4c4<_0x13fc2c['journeys'][_0x11707f(0x11c)];_0x93b4c4++){const _0x2ad7b3=_0x13fc2c[_0x11707f(0x13b)][_0x93b4c4];if(_0x13fc2c['journeys'][_0x11707f(0x11c)]>0x1&&_0x2ad7b3['state']===_0x11707f(0x100))continue;const _0xde065f=_0x2ad7b3[_0x11707f(0x1a3)]||[],_0x3c8a4a=_0x11707f(0x156)+_0x93b4c4+'].',_0x499561=!!_0x2ad7b3[_0x11707f(0x16a)],_0x22e5e6=_0x499561?{..._0x13fc2c,'goal':_0x2ad7b3[_0x11707f(0x16a)]}:_0x13fc2c;validateStagesForVersion(_0xde065f,_0x22e5e6,_0x5804d0,_0x3c8a4a,_0x115cd8,_0x4a86fa,{'goalIsInherited':!_0x499561});}else{if(_0x13fc2c['versions']&&_0x13fc2c['versions']['length']>0x0)for(let _0x549100=0x0;_0x549100<_0x13fc2c[_0x11707f(0x140)]['length'];_0x549100++){const _0xa16c7d=_0x13fc2c[_0x11707f(0x140)][_0x549100];if(_0x13fc2c[_0x11707f(0x140)]['length']>0x1&&_0xa16c7d[_0x11707f(0x11b)]===_0x11707f(0x100))continue;const _0x1aca9f=_0xa16c7d['stages']||[],_0xbc61a6=_0x11707f(0x1a7)+_0x549100+'].';validateStagesForVersion(_0x1aca9f,_0x13fc2c,_0x5804d0,_0xbc61a6,_0x115cd8,_0x4a86fa);}else{const _0x1f7259=_0x13fc2c[_0x11707f(0x1a3)]||[];validateStagesForVersion(_0x1f7259,_0x13fc2c,_0x5804d0,'',_0x115cd8,_0x4a86fa);}}_0x13fc2c['journeys']&&_0x13fc2c[_0x11707f(0x13b)]['length']>0x1&&(deduplicateAcrossVersions(_0x115cd8),deduplicateAcrossVersions(_0x4a86fa));for(const _0x5079a3 of _0x791b56){!_0x47d0d6[_0x11707f(0x13d)](_0x5079a3)&&!_0x5079a3[_0x11707f(0x14e)](_0x11707f(0x16b))&&_0x4a86fa['push']({'level':'warning','path':'segments.'+_0x5079a3,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x11707f(0xfe)+_0x5079a3+_0x11707f(0x1b1),'location':getLocationFromPath(_0x2b053b[_0x11707f(0x13c)],_0x2b053b[_0x11707f(0x160)],[_0x11707f(0x15f),_0x5079a3])});}return{'valid':_0x115cd8[_0x11707f(0x11c)]===0x0,'errors':_0x115cd8,'warnings':_0x4a86fa};}
@@ -1 +1 @@
1
- const a147_0x2ac4aa=a147_0x29bb;(function(_0x406fe1,_0x3d435f){const _0x48aef6=a147_0x29bb,_0x595768=_0x406fe1();while(!![]){try{const _0x165dc3=-parseInt(_0x48aef6(0x1d2))/0x1*(parseInt(_0x48aef6(0x1b0))/0x2)+-parseInt(_0x48aef6(0x188))/0x3*(-parseInt(_0x48aef6(0x1ca))/0x4)+parseInt(_0x48aef6(0x1b4))/0x5*(parseInt(_0x48aef6(0x1b7))/0x6)+parseInt(_0x48aef6(0x14a))/0x7*(-parseInt(_0x48aef6(0x1d0))/0x8)+-parseInt(_0x48aef6(0x129))/0x9*(parseInt(_0x48aef6(0x175))/0xa)+-parseInt(_0x48aef6(0x1a3))/0xb*(-parseInt(_0x48aef6(0x171))/0xc)+parseInt(_0x48aef6(0x14f))/0xd;if(_0x165dc3===_0x3d435f)break;else _0x595768['push'](_0x595768['shift']());}catch(_0x3914ad){_0x595768['push'](_0x595768['shift']());}}}(a147_0x312d,0x3ecaf));import*as a147_0x10fcee from'yaml';import{SDKError,ErrorCode}from'../errors.js';function a147_0x29bb(_0x4227c1,_0x5efa47){_0x4227c1=_0x4227c1-0x11a;const _0x312dab=a147_0x312d();let _0x29bbeb=_0x312dab[_0x4227c1];return _0x29bbeb;}import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x25d15b){const _0x58855c=a147_0x29bb,_0x2d63ae=_0x25d15b[_0x58855c(0x1ac)]();if(_0x2d63ae===_0x58855c(0x17c)||_0x2d63ae===_0x58855c(0x18c))return _0x58855c(0x18c);if(_0x2d63ae===_0x58855c(0x1b5)||_0x2d63ae===_0x58855c(0x127))return _0x58855c(0x127);return _0x25d15b;}export function journeyResponseToDefSync(_0x4e5ded){const _0x4a1288=a147_0x29bb,_0x22021b=_0x4e5ded[_0x4a1288(0x19f)],_0x3a25f7=_0x22021b['journeyBundleName']||_0x22021b[_0x4a1288(0x181)],_0x2d8c41={'stages':_0x22021b['journeyStages']['map'](convertApiStageToYaml),'id':_0x4e5ded['id']};_0x22021b[_0x4a1288(0x15a)]&&(_0x2d8c41[_0x4a1288(0x15a)]=convertApiCriteriaToYaml(_0x22021b[_0x4a1288(0x15a)]));_0x22021b[_0x4a1288(0x181)]&&_0x22021b['name']!==_0x3a25f7&&(_0x2d8c41['version']=_0x22021b['name']);_0x22021b[_0x4a1288(0x159)]!==undefined&&(_0x2d8c41['version_number']=_0x22021b[_0x4a1288(0x159)]);_0x22021b['state']&&(_0x2d8c41['state']=_0x22021b[_0x4a1288(0x1be)]==='launched'?_0x4a1288(0x17d):_0x4a1288(0x182));const _0x100396={'type':_0x4a1288(0x13a),'name':_0x3a25f7,'journeys':[_0x2d8c41]};_0x22021b[_0x4a1288(0x164)]&&(_0x100396[_0x4a1288(0x164)]=_0x22021b[_0x4a1288(0x164)]);_0x22021b[_0x4a1288(0x15a)]&&(_0x100396['goal']=convertApiCriteriaToYaml(_0x22021b[_0x4a1288(0x15a)]));if(_0x22021b[_0x4a1288(0x154)])_0x100396[_0x4a1288(0x18e)]=_0x22021b[_0x4a1288(0x154)];else _0x22021b[_0x4a1288(0x138)]!==undefined&&(_0x100396[_0x4a1288(0x18e)]=_0x22021b[_0x4a1288(0x138)]?'reentry_always':_0x4a1288(0x150));return _0x22021b[_0x4a1288(0x139)]&&(_0x100396[_0x4a1288(0x186)]=_0x22021b[_0x4a1288(0x139)]),_0x22021b[_0x4a1288(0x1c0)]&&(_0x100396['bundle_name']=_0x22021b[_0x4a1288(0x1c0)]),_0x4e5ded['relationships']?.[_0x4a1288(0x13b)]?.[_0x4a1288(0x1a0)]?.['id']&&(_0x100396[_0x4a1288(0x13e)]=_0x4e5ded[_0x4a1288(0x1b1)]['parentFolder']['data']['id']),_0x100396;}export async function journeyResponseToDef(_0x344fd0,_0x3c1366){const _0x491283=a147_0x29bb,_0x4f8363=journeyResponseToDefSync(_0x344fd0);if(!_0x3c1366)return _0x4f8363;const _0x249f1d=new Set();collectSegmentIdsFromJourney(_0x4f8363,_0x249f1d);const _0x34effb=new Set();collectActivationIdsFromJourney(_0x4f8363,_0x34effb);const _0x48b33f={},_0x1d07f0=new Map();for(const _0x555248 of Array[_0x491283(0x1a2)](_0x249f1d)['sort']()){if(_0x3c1366[_0x491283(0x1cc)]){const _0x36288f=await _0x3c1366[_0x491283(0x1cc)](_0x555248);if(_0x36288f['isJourneyLocal']){_0x1d07f0[_0x491283(0x146)](_0x555248,_0x36288f[_0x491283(0x181)]);if(_0x36288f[_0x491283(0x1aa)]){const _0x354e88={..._0x36288f[_0x491283(0x1aa)],'rule':deepSortObject(_0x36288f[_0x491283(0x1aa)][_0x491283(0x16e)])};_0x48b33f[_0x36288f[_0x491283(0x181)]]=_0x354e88;}}else _0x1d07f0[_0x491283(0x146)](_0x555248,makeSegmentRef(_0x36288f[_0x491283(0x181)]));}else{if(_0x3c1366[_0x491283(0x1ab)]){const _0x3dbf98=await _0x3c1366[_0x491283(0x1ab)](_0x555248);_0x1d07f0[_0x491283(0x146)](_0x555248,_0x3dbf98);}}}const _0x5a5dc2={},_0x1bff6a=new Map();for(const _0x3023a5 of Array[_0x491283(0x1a2)](_0x34effb)[_0x491283(0x16c)]()){if(_0x3c1366[_0x491283(0x14c)]){const _0x509010=await _0x3c1366[_0x491283(0x14c)](_0x3023a5);_0x509010[_0x491283(0x1a9)]?(_0x1bff6a[_0x491283(0x146)](_0x3023a5,_0x509010[_0x491283(0x181)]),_0x509010[_0x491283(0x1aa)]&&(_0x5a5dc2[_0x509010[_0x491283(0x181)]]=_0x509010[_0x491283(0x1aa)])):_0x1bff6a[_0x491283(0x146)](_0x3023a5,makeSegmentRef(_0x509010[_0x491283(0x181)]));}else{if(_0x3c1366['resolveActivationName']){const _0x1b488a=await _0x3c1366[_0x491283(0x1c9)](_0x3023a5);_0x1bff6a[_0x491283(0x146)](_0x3023a5,_0x1b488a);}}}_0x1d07f0[_0x491283(0x16b)]>0x0&&replaceSegmentIdsInJourney(_0x4f8363,_0x1d07f0);_0x1bff6a[_0x491283(0x16b)]>0x0&&replaceActivationIdsInJourney(_0x4f8363,_0x1bff6a);if(_0x3c1366[_0x491283(0x1d5)]){const _0x75c441=[];collectJumpTargetsFromJourney(_0x4f8363,_0x75c441);if(_0x75c441[_0x491283(0x11d)]>0x0){const _0x101c41=new Map();for(const _0x972f64 of _0x75c441){try{const _0x413bd2=await _0x3c1366['resolveJumpTarget'](_0x972f64[_0x491283(0x121)],_0x972f64[_0x491283(0x173)]);_0x101c41[_0x491283(0x146)](_0x972f64['journeyId']+':'+_0x972f64['stageId'],_0x413bd2);}catch{}}_0x101c41[_0x491283(0x16b)]>0x0&&replaceJumpTargetsInJourney(_0x4f8363,_0x101c41);}}return Object[_0x491283(0x1b3)](_0x48b33f)[_0x491283(0x11d)]>0x0&&(_0x4f8363[_0x491283(0x15d)]=_0x48b33f),Object['keys'](_0x5a5dc2)[_0x491283(0x11d)]>0x0&&(_0x4f8363[_0x491283(0x1ba)]=_0x5a5dc2),_0x4f8363;}function collectSegmentIdsFromJourney(_0x114534,_0x483ee6){const _0x20a519=a147_0x29bb;_0x114534['goal']?.[_0x20a519(0x1ae)]&&_0x483ee6[_0x20a519(0x192)](_0x114534['goal'][_0x20a519(0x1ae)]);const _0xf7fa9b=_0x276753=>{const _0xcc5c33=_0x20a519;for(const _0x56ef1b of _0x276753){_0x56ef1b['entry_criteria']?.[_0xcc5c33(0x1ae)]&&_0x483ee6[_0xcc5c33(0x192)](_0x56ef1b['entry_criteria'][_0xcc5c33(0x1ae)]);if(_0x56ef1b[_0xcc5c33(0x135)])for(const _0x4777c1 of _0x56ef1b[_0xcc5c33(0x135)]){_0x4777c1['segment']&&_0x483ee6['add'](_0x4777c1[_0xcc5c33(0x1ae)]);}_0x56ef1b[_0xcc5c33(0x18d)]?.[_0xcc5c33(0x1ae)]&&_0x483ee6[_0xcc5c33(0x192)](_0x56ef1b['milestone'][_0xcc5c33(0x1ae)]);if(_0x56ef1b[_0xcc5c33(0x194)])for(const _0xcb0086 of _0x56ef1b[_0xcc5c33(0x194)]){if(_0xcb0086['type']==='decision_point'){const _0xe0f6f2=_0xcb0086;for(const _0x3840cc of _0xe0f6f2['with'][_0xcc5c33(0x190)]){_0x3840cc[_0xcc5c33(0x1ae)]&&_0x483ee6['add'](_0x3840cc[_0xcc5c33(0x1ae)]);}}else{if(_0xcb0086[_0xcc5c33(0x163)]===_0xcc5c33(0x196)){const _0x3e9126=_0xcb0086;_0x3e9126[_0xcc5c33(0x177)][_0xcc5c33(0x168)]?.['segment']&&_0x483ee6[_0xcc5c33(0x192)](_0x3e9126[_0xcc5c33(0x177)][_0xcc5c33(0x168)]['segment']);}}}}};if(_0x114534[_0x20a519(0x174)])for(const _0x333ce6 of _0x114534[_0x20a519(0x174)]){_0x333ce6[_0x20a519(0x15a)]?.[_0x20a519(0x1ae)]&&_0x483ee6[_0x20a519(0x192)](_0x333ce6[_0x20a519(0x15a)][_0x20a519(0x1ae)]),_0xf7fa9b(_0x333ce6['stages']);}_0x114534[_0x20a519(0x1e0)]&&_0xf7fa9b(_0x114534[_0x20a519(0x1e0)]);if(_0x114534[_0x20a519(0x1d9)])for(const _0x3bcb46 of _0x114534[_0x20a519(0x1d9)]){_0xf7fa9b(_0x3bcb46[_0x20a519(0x1e0)]);}}function replaceSegmentIdsInJourney(_0x363aba,_0x28d173){const _0x29fa8c=a147_0x29bb,_0x1287c5=_0x34243b=>_0x28d173['get'](_0x34243b)||_0x34243b;_0x363aba[_0x29fa8c(0x15a)]?.[_0x29fa8c(0x1ae)]&&(_0x363aba[_0x29fa8c(0x15a)][_0x29fa8c(0x1ae)]=_0x1287c5(_0x363aba[_0x29fa8c(0x15a)]['segment']));const _0x586950=_0x289a0d=>{const _0x3c4a25=_0x29fa8c;for(const _0x5bfc24 of _0x289a0d){_0x5bfc24[_0x3c4a25(0x155)]?.[_0x3c4a25(0x1ae)]&&(_0x5bfc24[_0x3c4a25(0x155)][_0x3c4a25(0x1ae)]=_0x1287c5(_0x5bfc24[_0x3c4a25(0x155)][_0x3c4a25(0x1ae)]));if(_0x5bfc24[_0x3c4a25(0x135)])for(const _0x5f5924 of _0x5bfc24['exit_criteria']){_0x5f5924[_0x3c4a25(0x1ae)]&&(_0x5f5924[_0x3c4a25(0x1ae)]=_0x1287c5(_0x5f5924[_0x3c4a25(0x1ae)]));}_0x5bfc24[_0x3c4a25(0x18d)]?.[_0x3c4a25(0x1ae)]&&(_0x5bfc24[_0x3c4a25(0x18d)][_0x3c4a25(0x1ae)]=_0x1287c5(_0x5bfc24['milestone'][_0x3c4a25(0x1ae)]));if(_0x5bfc24[_0x3c4a25(0x194)])for(const _0x3155e3 of _0x5bfc24[_0x3c4a25(0x194)]){if(_0x3155e3['type']==='decision_point'){const _0x2a63a2=_0x3155e3;for(const _0x30ff0b of _0x2a63a2[_0x3c4a25(0x177)][_0x3c4a25(0x190)]){_0x30ff0b[_0x3c4a25(0x1ae)]&&(_0x30ff0b[_0x3c4a25(0x1ae)]=_0x1287c5(_0x30ff0b['segment']));}}else{if(_0x3155e3[_0x3c4a25(0x163)]===_0x3c4a25(0x196)){const _0x569b9f=_0x3155e3;_0x569b9f['with'][_0x3c4a25(0x168)]?.[_0x3c4a25(0x1ae)]&&(_0x569b9f[_0x3c4a25(0x177)][_0x3c4a25(0x168)][_0x3c4a25(0x1ae)]=_0x1287c5(_0x569b9f[_0x3c4a25(0x177)][_0x3c4a25(0x168)][_0x3c4a25(0x1ae)]));}}}}};if(_0x363aba[_0x29fa8c(0x174)])for(const _0x37f324 of _0x363aba[_0x29fa8c(0x174)]){_0x37f324['goal']?.[_0x29fa8c(0x1ae)]&&(_0x37f324[_0x29fa8c(0x15a)][_0x29fa8c(0x1ae)]=_0x1287c5(_0x37f324[_0x29fa8c(0x15a)][_0x29fa8c(0x1ae)])),_0x586950(_0x37f324[_0x29fa8c(0x1e0)]);}_0x363aba[_0x29fa8c(0x1e0)]&&_0x586950(_0x363aba[_0x29fa8c(0x1e0)]);if(_0x363aba[_0x29fa8c(0x1d9)])for(const _0x5eaf64 of _0x363aba[_0x29fa8c(0x1d9)]){_0x586950(_0x5eaf64[_0x29fa8c(0x1e0)]);}}function collectActivationIdsFromJourney(_0x26a1fe,_0xa86d38){const _0x28143e=a147_0x29bb,_0xbd3e20=_0x48889c=>{const _0x50697f=a147_0x29bb;for(const _0xb705f1 of _0x48889c){if(_0xb705f1[_0x50697f(0x194)])for(const _0x55f9e5 of _0xb705f1['steps']){if(_0x55f9e5[_0x50697f(0x163)]==='activation'){const _0x51cd7e=_0x55f9e5;_0x51cd7e['with']['activation']&&/^\d+$/[_0x50697f(0x1c1)](_0x51cd7e[_0x50697f(0x177)][_0x50697f(0x140)])&&_0xa86d38[_0x50697f(0x192)](_0x51cd7e[_0x50697f(0x177)]['activation']);}}}};if(_0x26a1fe['journeys'])for(const _0x21c34f of _0x26a1fe['journeys']){_0xbd3e20(_0x21c34f[_0x28143e(0x1e0)]);}_0x26a1fe[_0x28143e(0x1e0)]&&_0xbd3e20(_0x26a1fe[_0x28143e(0x1e0)]);if(_0x26a1fe['versions'])for(const _0x29a1d6 of _0x26a1fe[_0x28143e(0x1d9)]){_0xbd3e20(_0x29a1d6[_0x28143e(0x1e0)]);}}function replaceActivationIdsInJourney(_0x480575,_0x5cd5fd){const _0x274e17=a147_0x29bb,_0x5ce0b6=_0x3eeacc=>_0x5cd5fd[_0x274e17(0x17a)](_0x3eeacc)||_0x3eeacc,_0x5e74d1=_0x55a8aa=>{const _0x16640b=_0x274e17;for(const _0x37af80 of _0x55a8aa){if(_0x37af80[_0x16640b(0x194)])for(const _0x2e71cf of _0x37af80[_0x16640b(0x194)]){if(_0x2e71cf['type']==='activation'){const _0x50d446=_0x2e71cf;_0x50d446['with']['activation']&&(_0x50d446[_0x16640b(0x177)]['activation']=_0x5ce0b6(_0x50d446[_0x16640b(0x177)][_0x16640b(0x140)]));}}}};if(_0x480575[_0x274e17(0x174)])for(const _0x10508d of _0x480575[_0x274e17(0x174)]){_0x5e74d1(_0x10508d[_0x274e17(0x1e0)]);}_0x480575[_0x274e17(0x1e0)]&&_0x5e74d1(_0x480575[_0x274e17(0x1e0)]);if(_0x480575[_0x274e17(0x1d9)])for(const _0x4acc37 of _0x480575[_0x274e17(0x1d9)]){_0x5e74d1(_0x4acc37['stages']);}}function collectJumpTargetsFromJourney(_0xbca0e1,_0x1088f7){const _0x48fb0f=a147_0x29bb,_0x197870=new Set(),_0x3c3b41=_0x18777a=>{const _0x24a8c8=a147_0x29bb;for(const _0x5c4a54 of _0x18777a){if(_0x5c4a54['steps'])for(const _0x461416 of _0x5c4a54[_0x24a8c8(0x194)]){if(_0x461416[_0x24a8c8(0x163)]==='jump'){const _0x1f72be=_0x461416,_0x42f3b6=_0x1f72be[_0x24a8c8(0x177)]['target'];if(_0x42f3b6[_0x24a8c8(0x13a)]&&_0x42f3b6[_0x24a8c8(0x19a)]&&/^\d+$/['test'](_0x42f3b6['journey'])&&/^\d+$/[_0x24a8c8(0x1c1)](_0x42f3b6[_0x24a8c8(0x19a)])){const _0x51d2af=_0x42f3b6[_0x24a8c8(0x13a)]+':'+_0x42f3b6['stage'];!_0x197870[_0x24a8c8(0x1bf)](_0x51d2af)&&(_0x197870['add'](_0x51d2af),_0x1088f7['push']({'journeyId':_0x42f3b6[_0x24a8c8(0x13a)],'stageId':_0x42f3b6[_0x24a8c8(0x19a)]}));}}}}};if(_0xbca0e1['journeys'])for(const _0x2f683d of _0xbca0e1['journeys']){_0x3c3b41(_0x2f683d['stages']);}_0xbca0e1['stages']&&_0x3c3b41(_0xbca0e1['stages']);if(_0xbca0e1[_0x48fb0f(0x1d9)])for(const _0x18ffe6 of _0xbca0e1['versions']){_0x3c3b41(_0x18ffe6[_0x48fb0f(0x1e0)]);}}function replaceJumpTargetsInJourney(_0x5d13f0,_0x1709ee){const _0x4d6457=a147_0x29bb,_0x4bbca4=_0x15751c=>{const _0x58a2fc=a147_0x29bb;for(const _0xd09d8f of _0x15751c){if(_0xd09d8f[_0x58a2fc(0x194)])for(const _0x18450b of _0xd09d8f['steps']){if(_0x18450b['type']===_0x58a2fc(0x193)){const _0x1ee141=_0x18450b,_0x7b5d07=_0x1ee141[_0x58a2fc(0x177)][_0x58a2fc(0x147)],_0x23143b=_0x7b5d07['journey']+':'+_0x7b5d07[_0x58a2fc(0x19a)],_0x5ec77c=_0x1709ee[_0x58a2fc(0x17a)](_0x23143b);_0x5ec77c&&(_0x7b5d07['journey']=_0x5ec77c[_0x58a2fc(0x179)],_0x7b5d07[_0x58a2fc(0x19a)]=_0x5ec77c['stageName']);}}}};if(_0x5d13f0[_0x4d6457(0x174)])for(const _0x507d09 of _0x5d13f0[_0x4d6457(0x174)]){_0x4bbca4(_0x507d09[_0x4d6457(0x1e0)]);}_0x5d13f0[_0x4d6457(0x1e0)]&&_0x4bbca4(_0x5d13f0[_0x4d6457(0x1e0)]);if(_0x5d13f0[_0x4d6457(0x1d9)])for(const _0x1e694a of _0x5d13f0[_0x4d6457(0x1d9)]){_0x4bbca4(_0x1e694a[_0x4d6457(0x1e0)]);}}function generateReadableStepName(_0x3571f4,_0x4fe11e){const _0x382216=a147_0x29bb;if(_0x3571f4[_0x382216(0x181)]&&_0x3571f4[_0x382216(0x181)]!==_0x3571f4[_0x382216(0x163)]){const _0x4998ca=_0x3571f4['name'][_0x382216(0x145)]();if(_0x4998ca&&/[a-z0-9\p{L}]/iu[_0x382216(0x1c1)](_0x4998ca))return _0x4998ca;}const _0x2f165a=_0x3571f4['type'][_0x382216(0x1ac)]()['replace'](/step$/i,'');return _0x2f165a+'_'+(_0x4fe11e+0x1);}function getStepNextRefs(_0xa1d65c){const _0x29b4d0=a147_0x29bb,_0x36ebab=[];if(_0xa1d65c['next'])_0x36ebab[_0x29b4d0(0x1da)](_0xa1d65c[_0x29b4d0(0x152)]);if(_0xa1d65c['branches'])for(const _0x41bf19 of _0xa1d65c['branches']){if(_0x41bf19[_0x29b4d0(0x152)])_0x36ebab[_0x29b4d0(0x1da)](_0x41bf19[_0x29b4d0(0x152)]);}if(_0xa1d65c[_0x29b4d0(0x176)])for(const _0x4ee951 of _0xa1d65c[_0x29b4d0(0x176)]){if(_0x4ee951[_0x29b4d0(0x152)])_0x36ebab[_0x29b4d0(0x1da)](_0x4ee951['next']);}if(_0xa1d65c[_0x29b4d0(0x19d)])for(const _0x462f47 of _0xa1d65c[_0x29b4d0(0x19d)]){if(_0x462f47[_0x29b4d0(0x152)])_0x36ebab[_0x29b4d0(0x1da)](_0x462f47['next']);}return _0x36ebab;}function parseJumpTargetDisplayName(_0x11962f){const _0x51c493=a147_0x29bb,_0x47d09b=_0x11962f[_0x51c493(0x1c8)](/^(.+?)\s*\(([^/)]+)/);if(!_0x47d09b)return undefined;const _0x54fc00=_0x47d09b[0x1][_0x51c493(0x145)](),_0x10533c=_0x47d09b[0x2]['trim']();if(!_0x54fc00||!_0x10533c)return undefined;return{'stageName':_0x54fc00,'journeyName':_0x10533c};}function orderStepsFromRoot(_0x242dd7,_0x3c045c){const _0x21ddb2=a147_0x29bb,_0x589d2a=Object['entries'](_0x242dd7);if(_0x589d2a[_0x21ddb2(0x11d)]===0x0)return[];const _0xe2d77b=new Set(_0x589d2a['map'](([_0x1a4676])=>_0x1a4676)),_0x387c8a=new Set();for(const [,_0x1b0faf]of _0x589d2a){for(const _0x1d60ee of getStepNextRefs(_0x1b0faf)){if(_0xe2d77b[_0x21ddb2(0x1bf)](_0x1d60ee))_0x387c8a[_0x21ddb2(0x192)](_0x1d60ee);}}let _0x433c23=_0x3c045c&&_0xe2d77b[_0x21ddb2(0x1bf)](_0x3c045c)?_0x3c045c:undefined;if(!_0x433c23){const _0x70ed8f=_0x589d2a[_0x21ddb2(0x17b)](([_0x463111])=>!_0x387c8a['has'](_0x463111));_0x70ed8f[_0x21ddb2(0x11d)]>0x0?_0x433c23=_0x70ed8f[0x0][0x0]:_0x433c23=_0x589d2a[0x0][0x0];}const _0x3bdbd7=[],_0x151f70=new Set(),_0x103aab=[_0x433c23];while(_0x103aab[_0x21ddb2(0x11d)]>0x0){const _0x5d5db5=_0x103aab['shift']();if(_0x151f70['has'](_0x5d5db5))continue;_0x151f70[_0x21ddb2(0x192)](_0x5d5db5);const _0x5c599a=_0x242dd7[_0x5d5db5];if(!_0x5c599a)continue;_0x3bdbd7[_0x21ddb2(0x1da)]({'uuid':_0x5d5db5,'step':_0x5c599a});for(const _0x45c045 of getStepNextRefs(_0x5c599a)){_0xe2d77b[_0x21ddb2(0x1bf)](_0x45c045)&&!_0x151f70[_0x21ddb2(0x1bf)](_0x45c045)&&_0x103aab[_0x21ddb2(0x1da)](_0x45c045);}}for(const [_0x5e6c9e,_0x393d90]of _0x589d2a){!_0x151f70['has'](_0x5e6c9e)&&_0x3bdbd7[_0x21ddb2(0x1da)]({'uuid':_0x5e6c9e,'step':_0x393d90});}return _0x3bdbd7;}function resolveStepReferences(_0x4515f5,_0x1423cb,_0x3511b3,_0xeb3705){const _0x5d70ed=a147_0x29bb;if(_0x4515f5[_0x5d70ed(0x163)]!==_0x5d70ed(0x126)){_0x4515f5[_0x5d70ed(0x152)]&&_0xeb3705['has'](_0x4515f5[_0x5d70ed(0x152)])&&(_0x4515f5[_0x5d70ed(0x152)]=_0xeb3705[_0x5d70ed(0x17a)](_0x4515f5[_0x5d70ed(0x152)]));const _0x29519b=_0x1423cb+0x1;if(_0x29519b<_0x3511b3[_0x5d70ed(0x11d)]){const _0xa2d202=_0xeb3705['get'](_0x3511b3[_0x29519b][_0x5d70ed(0x1df)]);_0x4515f5[_0x5d70ed(0x152)]===_0xa2d202&&delete _0x4515f5[_0x5d70ed(0x152)];}}if(_0x4515f5['type']===_0x5d70ed(0x1e1))for(const _0x3e22a5 of _0x4515f5['with'][_0x5d70ed(0x190)]){_0x3e22a5[_0x5d70ed(0x152)]&&_0xeb3705[_0x5d70ed(0x1bf)](_0x3e22a5[_0x5d70ed(0x152)])&&(_0x3e22a5[_0x5d70ed(0x152)]=_0xeb3705['get'](_0x3e22a5[_0x5d70ed(0x152)]));}if(_0x4515f5['type']===_0x5d70ed(0x184))for(const _0x4dc4fa of _0x4515f5[_0x5d70ed(0x177)][_0x5d70ed(0x176)]){_0x4dc4fa[_0x5d70ed(0x152)]&&_0xeb3705['has'](_0x4dc4fa[_0x5d70ed(0x152)])&&(_0x4dc4fa[_0x5d70ed(0x152)]=_0xeb3705[_0x5d70ed(0x17a)](_0x4dc4fa['next']));}if(_0x4515f5[_0x5d70ed(0x163)]===_0x5d70ed(0x196)&&_0x4515f5[_0x5d70ed(0x177)][_0x5d70ed(0x168)]){const _0x4398c9=_0x4515f5['with'][_0x5d70ed(0x168)];_0x4398c9['next']&&_0xeb3705[_0x5d70ed(0x1bf)](_0x4398c9[_0x5d70ed(0x152)])&&(_0x4398c9[_0x5d70ed(0x152)]=_0xeb3705[_0x5d70ed(0x17a)](_0x4398c9['next'])),_0x4398c9['timeout']?.['next']&&_0xeb3705[_0x5d70ed(0x1bf)](_0x4398c9['timeout']['next'])&&(_0x4398c9[_0x5d70ed(0x130)][_0x5d70ed(0x152)]=_0xeb3705[_0x5d70ed(0x17a)](_0x4398c9[_0x5d70ed(0x130)]['next']));}}function convertApiStageToYaml(_0x31d6ed){const _0x45f682=a147_0x29bb,_0x4cc4cd={'name':_0x31d6ed['name']};_0x31d6ed['id']&&(_0x4cc4cd['id']=_0x31d6ed['id']);_0x31d6ed[_0x45f682(0x164)]&&(_0x4cc4cd[_0x45f682(0x164)]=_0x31d6ed[_0x45f682(0x164)]);_0x31d6ed[_0x45f682(0x11f)]&&(_0x4cc4cd[_0x45f682(0x155)]=convertApiCriteriaToYaml(_0x31d6ed[_0x45f682(0x11f)]));_0x31d6ed[_0x45f682(0x148)]&&_0x31d6ed[_0x45f682(0x148)][_0x45f682(0x11d)]>0x0&&(_0x4cc4cd['exit_criteria']=_0x31d6ed[_0x45f682(0x148)][_0x45f682(0x134)](convertApiCriteriaToYaml));_0x31d6ed[_0x45f682(0x18d)]&&(_0x4cc4cd[_0x45f682(0x18d)]=convertApiCriteriaToYaml(_0x31d6ed[_0x45f682(0x18d)]));if(_0x31d6ed[_0x45f682(0x194)]&&Object[_0x45f682(0x1b3)](_0x31d6ed[_0x45f682(0x194)])[_0x45f682(0x11d)]>0x0){const _0xb3d32a=orderStepsFromRoot(_0x31d6ed['steps'],_0x31d6ed['rootStep']),_0x583784=new Map(),_0x2d97e4=new Set();for(let _0x396656=0x0;_0x396656<_0xb3d32a[_0x45f682(0x11d)];_0x396656++){const {uuid:_0x5d6d79,step:_0x14071f}=_0xb3d32a[_0x396656];let _0x3b09b8=generateReadableStepName(_0x14071f,_0x396656),_0x311f55=_0x3b09b8,_0x194461=0x2;while(_0x2d97e4[_0x45f682(0x1bf)](_0x311f55)){_0x311f55=_0x3b09b8+'_'+_0x194461,_0x194461++;}_0x2d97e4[_0x45f682(0x192)](_0x311f55),_0x583784[_0x45f682(0x146)](_0x5d6d79,_0x311f55);}_0x4cc4cd[_0x45f682(0x194)]=_0xb3d32a[_0x45f682(0x134)](({uuid:_0x5a6d99,step:_0x335321},_0x5563f0)=>{const _0x24fb45=_0x45f682,_0x3de25a=convertApiStepToYaml(_0x335321,_0x583784[_0x24fb45(0x17a)](_0x5a6d99));return resolveStepReferences(_0x3de25a,_0x5563f0,_0xb3d32a,_0x583784),_0x3de25a;});}return _0x4cc4cd;}function convertApiCriteriaToYaml(_0x2712aa){const _0x379d19=a147_0x29bb,_0x246cd0={'name':_0x2712aa[_0x379d19(0x181)],'segment':_0x2712aa['segmentId']};_0x2712aa[_0x379d19(0x164)]&&(_0x246cd0[_0x379d19(0x164)]=_0x2712aa[_0x379d19(0x164)]);if(_0x2712aa[_0x379d19(0x147)]){let _0x236171=_0x2712aa[_0x379d19(0x147)][_0x379d19(0x121)],_0x57b277=_0x2712aa[_0x379d19(0x147)][_0x379d19(0x143)];if(_0x2712aa[_0x379d19(0x147)]['journeyName']){const _0x21f72a=parseJumpTargetDisplayName(_0x2712aa[_0x379d19(0x147)][_0x379d19(0x179)]);_0x21f72a&&(_0x57b277=_0x21f72a[_0x379d19(0x187)],_0x236171=_0x21f72a['journeyName']);}_0x246cd0[_0x379d19(0x147)]={'journey':_0x236171,'stage':_0x57b277},_0x2712aa[_0x379d19(0x147)][_0x379d19(0x139)]&&(_0x246cd0[_0x379d19(0x147)][_0x379d19(0x186)]=_0x2712aa[_0x379d19(0x147)][_0x379d19(0x139)]);}return _0x246cd0;}function convertApiStepToYaml(_0x30b644,_0x567a90){const _0x3549d1=a147_0x29bb;switch(_0x30b644[_0x3549d1(0x163)]){case'WaitStep':{const _0x4942d5={};if(_0x30b644['waitStepType']===_0x3549d1(0x11b)&&_0x30b644['waitStep']!==undefined)_0x4942d5[_0x3549d1(0x189)]=_0x30b644[_0x3549d1(0x142)],_0x4942d5['unit']=_0x30b644['waitStepUnit'];else{if(_0x30b644['waitStepType']===_0x3549d1(0x1bc)&&_0x30b644[_0x3549d1(0x1d4)])_0x4942d5[_0x3549d1(0x165)]=_0x30b644[_0x3549d1(0x1d4)];else{if(_0x30b644['waitStepType']==='DaysOfTheWeek'&&_0x30b644[_0x3549d1(0x16a)])_0x4942d5[_0x3549d1(0x14d)]=_0x30b644[_0x3549d1(0x16a)];else{if(_0x30b644[_0x3549d1(0x1cd)]===_0x3549d1(0x14e)){if(_0x30b644[_0x3549d1(0x19d)]&&_0x30b644[_0x3549d1(0x19d)][_0x3549d1(0x11d)]>0x0){const _0x1a8f1a=_0x30b644['conditions'][_0x3549d1(0x172)](_0x53c59a=>!_0x53c59a[_0x3549d1(0x1b8)]),_0x22c392=_0x30b644[_0x3549d1(0x19d)]['find'](_0x25e65c=>_0x25e65c[_0x3549d1(0x1b8)]);_0x1a8f1a?.[_0x3549d1(0x1d3)]&&(_0x4942d5[_0x3549d1(0x168)]={'segment':_0x1a8f1a[_0x3549d1(0x1d3)],..._0x1a8f1a['next']?{'next':_0x1a8f1a[_0x3549d1(0x152)]}:{}},_0x22c392&&_0x22c392[_0x3549d1(0x1c6)]!==undefined&&_0x22c392[_0x3549d1(0x1c3)]&&(_0x4942d5['condition'][_0x3549d1(0x130)]={'duration':_0x22c392[_0x3549d1(0x1c6)],'unit':_0x22c392['unit'],..._0x22c392['next']?{'next':_0x22c392[_0x3549d1(0x152)]}:{}}));}else _0x30b644[_0x3549d1(0x136)]&&(_0x4942d5['condition']={'segment':_0x30b644[_0x3549d1(0x136)]},_0x30b644[_0x3549d1(0x195)]!==undefined&&_0x30b644[_0x3549d1(0x12d)]&&(_0x4942d5[_0x3549d1(0x168)][_0x3549d1(0x130)]={'duration':_0x30b644[_0x3549d1(0x195)],'unit':_0x30b644[_0x3549d1(0x12d)]}));}}}}const _0x11bca4={'type':_0x3549d1(0x196),'name':_0x567a90,..._0x30b644[_0x3549d1(0x152)]?{'next':_0x30b644[_0x3549d1(0x152)]}:{},'with':_0x4942d5};return _0x11bca4;}case _0x3549d1(0x1d1):{const _0x4d5afc={'type':'activation','name':_0x567a90,..._0x30b644[_0x3549d1(0x152)]?{'next':_0x30b644[_0x3549d1(0x152)]}:{},'with':{'activation':_0x30b644[_0x3549d1(0x11e)]||''}};return _0x4d5afc;}case _0x3549d1(0x1a6):{const _0x390a1f={'type':_0x3549d1(0x1e1),'name':_0x567a90,..._0x30b644[_0x3549d1(0x152)]?{'next':_0x30b644[_0x3549d1(0x152)]}:{},'with':{'branches':(_0x30b644['branches']||[])['map'](_0x502113=>({'name':_0x502113[_0x3549d1(0x181)],'segment':_0x502113[_0x3549d1(0x1d3)],'excluded':_0x502113['excludedPath'],..._0x502113['next']?{'next':_0x502113[_0x3549d1(0x152)]}:{}}))}};return _0x390a1f;}case _0x3549d1(0x17e):case _0x3549d1(0x198):case _0x3549d1(0x137):{const _0x104e41=_0x30b644[_0x3549d1(0x176)]||(_0x30b644[_0x3549d1(0x190)]||[])[_0x3549d1(0x134)](_0x4198e1=>({'name':_0x4198e1[_0x3549d1(0x181)],'percentage':0x0,'next':_0x4198e1[_0x3549d1(0x152)]})),_0x5561f0={'type':_0x3549d1(0x184),'name':_0x567a90,..._0x30b644[_0x3549d1(0x152)]?{'next':_0x30b644[_0x3549d1(0x152)]}:{},'with':{'customized_split':_0x30b644[_0x3549d1(0x1bb)],'unique_id':_0x30b644[_0x3549d1(0x197)],'variants':_0x104e41[_0x3549d1(0x134)](_0x2e91c4=>({'name':_0x2e91c4[_0x3549d1(0x181)],'percentage':_0x2e91c4[_0x3549d1(0x13f)],..._0x2e91c4[_0x3549d1(0x152)]?{'next':_0x2e91c4[_0x3549d1(0x152)]}:{}}))}};return _0x5561f0;}case _0x3549d1(0x124):{const _0x5174a0={'type':'merge','name':_0x567a90,..._0x30b644[_0x3549d1(0x152)]?{'next':_0x30b644[_0x3549d1(0x152)]}:{}};return _0x5174a0;}case _0x3549d1(0x18a):{let _0xf1696='',_0x26da1d='',_0x10ddcc;if(_0x30b644[_0x3549d1(0x147)]){_0xf1696=_0x30b644[_0x3549d1(0x147)][_0x3549d1(0x121)],_0x26da1d=_0x30b644['target']['journeyStageId'],_0x10ddcc=_0x30b644[_0x3549d1(0x147)][_0x3549d1(0x139)];if(_0x30b644['target'][_0x3549d1(0x179)]){const _0x38827f=parseJumpTargetDisplayName(_0x30b644[_0x3549d1(0x147)][_0x3549d1(0x179)]);_0x38827f&&(_0x26da1d=_0x38827f[_0x3549d1(0x187)],_0xf1696=_0x38827f[_0x3549d1(0x179)]);}}const _0x2857f4={'type':_0x3549d1(0x193),'name':_0x567a90,..._0x30b644[_0x3549d1(0x152)]?{'next':_0x30b644['next']}:{},'with':{'target':{'journey':_0xf1696,'stage':_0x26da1d,..._0x10ddcc?{'bundle_id':_0x10ddcc}:{}}}};return _0x2857f4;}case'End':{const _0x1b174f={'type':_0x3549d1(0x126),'name':_0x567a90};return _0x1b174f;}default:{const _0x32613e={'type':_0x3549d1(0x126),'name':_0x567a90};return _0x32613e;}}}export async function journeyDefToRequest(_0x58cd1a,_0x3a1130,_0x1cd86a){const _0x3ed48b=a147_0x29bb,_0x3c01c1=_0x58cd1a[_0x3ed48b(0x1e0)]||getActiveStages(_0x58cd1a),_0x134bee=isJourneysArrayMode(_0x58cd1a)||isMultiVersionMode(_0x58cd1a)?getLatestJourneyEntry(_0x58cd1a):undefined,_0x28c609=_0x134bee?.[_0x3ed48b(0x12e)]??_0x58cd1a[_0x3ed48b(0x181)],_0xf44f1f=_0x58cd1a[_0x3ed48b(0x15d)]||{},_0x224ba9=_0x58cd1a[_0x3ed48b(0x1ba)]||{},_0x3cfa8c={'type':_0x3ed48b(0x13a),'attributes':{'name':_0x28c609,'audienceId':_0x3a1130,'journeyStages':await Promise[_0x3ed48b(0x158)](_0x3c01c1[_0x3ed48b(0x134)](_0x23062d=>convertYamlStageToApi(_0x23062d,_0x1cd86a,_0xf44f1f,_0x224ba9)))}},_0x14c974=_0x134bee?.['id']??_0x58cd1a['id'];_0x14c974&&(_0x3cfa8c['id']=_0x14c974);_0x58cd1a[_0x3ed48b(0x164)]&&(_0x3cfa8c['attributes']['description']=_0x58cd1a[_0x3ed48b(0x164)]);const _0x37a734=getEffectiveGoal(_0x58cd1a);_0x37a734&&(_0x3cfa8c[_0x3ed48b(0x19f)][_0x3ed48b(0x15a)]=await convertYamlCriteriaToApi(_0x37a734,_0x1cd86a,_0xf44f1f));const _0xa0130a=getEffectiveReentry(_0x58cd1a);return _0xa0130a&&(_0x3cfa8c[_0x3ed48b(0x19f)][_0x3ed48b(0x154)]=_0xa0130a,_0x3cfa8c[_0x3ed48b(0x19f)][_0x3ed48b(0x138)]=_0xa0130a!==_0x3ed48b(0x150)),_0x58cd1a[_0x3ed48b(0x13e)]&&(_0x3cfa8c[_0x3ed48b(0x1b1)]={'parentFolder':{'data':{'id':_0x58cd1a[_0x3ed48b(0x13e)],'type':_0x3ed48b(0x19e)}}}),_0x3cfa8c;}async function convertYamlStageToApi(_0x20bdee,_0xe03c58,_0x199233={},_0x1fbc8f={}){const _0x1e2593=a147_0x29bb,_0x622b8f={'name':_0x20bdee['name']};_0x20bdee['id']&&(_0x622b8f['id']=_0x20bdee['id']);_0x20bdee['description']&&(_0x622b8f[_0x1e2593(0x164)]=_0x20bdee[_0x1e2593(0x164)]);_0x20bdee[_0x1e2593(0x155)]&&(_0x622b8f[_0x1e2593(0x11f)]=await convertYamlCriteriaToApi(_0x20bdee[_0x1e2593(0x155)],_0xe03c58,_0x199233));_0x20bdee[_0x1e2593(0x135)]&&_0x20bdee[_0x1e2593(0x135)][_0x1e2593(0x11d)]>0x0&&(_0x622b8f[_0x1e2593(0x148)]=await Promise[_0x1e2593(0x158)](_0x20bdee[_0x1e2593(0x135)][_0x1e2593(0x134)](_0x2daad0=>convertYamlCriteriaToApi(_0x2daad0,_0xe03c58,_0x199233))));_0x20bdee[_0x1e2593(0x18d)]&&(_0x622b8f[_0x1e2593(0x18d)]=await convertYamlCriteriaToApi(_0x20bdee[_0x1e2593(0x18d)],_0xe03c58,_0x199233));if(_0x20bdee[_0x1e2593(0x194)]&&_0x20bdee[_0x1e2593(0x194)]['length']>0x0){const _0x2352bd={},_0x211e95=_0x20bdee[_0x1e2593(0x194)][_0x1e2593(0x134)]((_0x526c6e,_0x151d21)=>{const _0x9fb9b2=_0x1e2593,_0x3e974e=_0x526c6e['uuid']||generateUUID(),_0x7b882d=_0x526c6e[_0x9fb9b2(0x181)]||_0x526c6e[_0x9fb9b2(0x163)]+'_'+_0x151d21;return _0x2352bd[_0x7b882d]=_0x3e974e,{..._0x526c6e,'name':_0x7b882d};});_0x622b8f[_0x1e2593(0x151)]=_0x2352bd[_0x211e95[0x0]['name']],_0x622b8f[_0x1e2593(0x194)]={};for(let _0x342499=0x0;_0x342499<_0x211e95[_0x1e2593(0x11d)];_0x342499++){const _0x31247b=_0x211e95[_0x342499],_0x1afd67=_0x2352bd[_0x31247b[_0x1e2593(0x181)]],_0x8f6518=!_0x31247b[_0x1e2593(0x152)]&&_0x342499<_0x211e95[_0x1e2593(0x11d)]-0x1&&_0x31247b['type']!==_0x1e2593(0x126)?_0x211e95[_0x342499+0x1][_0x1e2593(0x181)]:_0x31247b[_0x1e2593(0x152)],_0x18d91d=_0x8f6518!==_0x31247b['next']?{..._0x31247b,'next':_0x8f6518}:_0x31247b;_0x622b8f[_0x1e2593(0x194)][_0x1afd67]=await convertYamlStepToApi(_0x18d91d,_0xe03c58,_0x199233,_0x2352bd,_0x1fbc8f);}}else _0x20bdee[_0x1e2593(0x157)]&&(_0x622b8f[_0x1e2593(0x151)]=_0x20bdee[_0x1e2593(0x157)]);return _0x622b8f;}async function convertYamlCriteriaToApi(_0xaa26ad,_0x346957,_0x3d126a={}){const _0x2ed91a=a147_0x29bb;let _0x5030d8=_0xaa26ad[_0x2ed91a(0x1ae)];if(_0x5030d8&&!/^\d+$/['test'](_0x5030d8)){const _0x1c1778=parseSegmentRef(_0x5030d8);if(_0x1c1778[_0x2ed91a(0x163)]==='ref')_0x346957?.[_0x2ed91a(0x162)]&&(_0x5030d8=await _0x346957[_0x2ed91a(0x162)](_0x1c1778[_0x2ed91a(0x181)]));else{if(_0x1c1778['type']==='embedded'&&_0x3d126a[_0x1c1778[_0x2ed91a(0x181)]])_0x346957?.[_0x2ed91a(0x1ce)]&&(_0x5030d8=await _0x346957['resolveEmbeddedSegmentId'](_0x1c1778[_0x2ed91a(0x181)],_0x3d126a[_0x1c1778[_0x2ed91a(0x181)]]));else _0x346957?.[_0x2ed91a(0x162)]&&(_0x5030d8=await _0x346957[_0x2ed91a(0x162)](_0x1c1778[_0x2ed91a(0x181)]));}}const _0x4f0a0a={'name':_0xaa26ad['name'],'segmentId':_0x5030d8};_0xaa26ad[_0x2ed91a(0x164)]&&(_0x4f0a0a[_0x2ed91a(0x164)]=_0xaa26ad[_0x2ed91a(0x164)]);if(_0xaa26ad[_0x2ed91a(0x147)]){const _0x5814ad=_0xaa26ad[_0x2ed91a(0x147)][_0x2ed91a(0x13a)],_0x4a1522=_0xaa26ad[_0x2ed91a(0x147)][_0x2ed91a(0x19a)];let _0x4a39c6=_0xaa26ad[_0x2ed91a(0x147)]['journey'];_0x346957?.['resolveJourneyId']&&!/^\d+$/['test'](_0x4a39c6)&&(_0x4a39c6=await _0x346957[_0x2ed91a(0x12f)](_0x4a39c6));let _0x58d89b=_0xaa26ad[_0x2ed91a(0x147)][_0x2ed91a(0x19a)];_0x346957?.[_0x2ed91a(0x19c)]&&!/^\d+$/[_0x2ed91a(0x1c1)](_0x58d89b)&&(_0x58d89b=await _0x346957[_0x2ed91a(0x19c)](_0x4a39c6,_0x58d89b));const _0xe43b6c=!/^\d+$/['test'](_0x5814ad)&&!isLocalJourneyRef(_0x5814ad)?formatApiJourneyName(_0x5814ad,_0x4a1522):undefined;_0x4f0a0a['target']={'journeyId':_0x4a39c6,'journeyStageId':_0x58d89b,'journeyName':_0xe43b6c,'confirmed':!![]},_0xaa26ad[_0x2ed91a(0x147)][_0x2ed91a(0x186)]&&(_0x4f0a0a[_0x2ed91a(0x147)]['journeyBundleId']=_0xaa26ad[_0x2ed91a(0x147)][_0x2ed91a(0x186)]);}return _0x4f0a0a;}async function convertYamlStepToApi(_0x47eecd,_0x64bddf,_0x369b24={},_0x292ffc={},_0x1a3cb0={}){const _0x135310=a147_0x29bb,_0x19443f=async _0x1a6602=>{const _0x2c09f6=a147_0x29bb;if(/^\d+$/[_0x2c09f6(0x1c1)](_0x1a6602))return _0x1a6602;const _0x3e9732=parseSegmentRef(_0x1a6602);if(_0x3e9732[_0x2c09f6(0x163)]===_0x2c09f6(0x14b)){if(_0x64bddf?.[_0x2c09f6(0x162)])return await _0x64bddf[_0x2c09f6(0x162)](_0x3e9732[_0x2c09f6(0x181)]);}else{if(_0x3e9732[_0x2c09f6(0x163)]==='embedded'&&_0x369b24[_0x3e9732[_0x2c09f6(0x181)]]){if(_0x64bddf?.[_0x2c09f6(0x1ce)])return await _0x64bddf['resolveEmbeddedSegmentId'](_0x3e9732[_0x2c09f6(0x181)],_0x369b24[_0x3e9732[_0x2c09f6(0x181)]]);}else{if(_0x64bddf?.[_0x2c09f6(0x162)])return await _0x64bddf[_0x2c09f6(0x162)](_0x3e9732[_0x2c09f6(0x181)]);}}return _0x1a6602;},_0x32b991=async _0x1d2a98=>{const _0x50922e=a147_0x29bb;if(/^\d+$/[_0x50922e(0x1c1)](_0x1d2a98))return _0x1d2a98;const _0x519a28=parseSegmentRef(_0x1d2a98);if(_0x519a28[_0x50922e(0x163)]==='ref'){if(_0x64bddf?.[_0x50922e(0x1dc)])return await _0x64bddf[_0x50922e(0x1dc)](_0x519a28[_0x50922e(0x181)]);return _0x519a28['name'];}else{if(_0x519a28['type']===_0x50922e(0x149)&&_0x1a3cb0[_0x519a28[_0x50922e(0x181)]]){if(_0x64bddf?.['resolveEmbeddedActivationId'])return await _0x64bddf[_0x50922e(0x199)](_0x519a28[_0x50922e(0x181)],_0x1a3cb0[_0x519a28[_0x50922e(0x181)]]);if(_0x64bddf?.[_0x50922e(0x1dc)])return await _0x64bddf[_0x50922e(0x1dc)](_0x519a28[_0x50922e(0x181)]);}else{if(_0x64bddf?.['resolveActivationId'])return await _0x64bddf[_0x50922e(0x1dc)](_0x519a28['name']);}}return _0x1d2a98;},_0x597cf0=_0xc0e6ae=>{const _0x2bd140=a147_0x29bb;if(!_0xc0e6ae)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x2bd140(0x1c1)](_0xc0e6ae))return _0xc0e6ae;return _0x292ffc[_0xc0e6ae]||_0xc0e6ae;};switch(_0x47eecd[_0x135310(0x163)]){case'wait':{const _0x274893=_0x47eecd,_0x4cd414=_0x274893[_0x135310(0x177)],_0x427072={'type':'WaitStep','name':_0x274893['name'],'next':_0x597cf0(_0x274893[_0x135310(0x152)])};if(_0x4cd414[_0x135310(0x189)]!==undefined&&_0x4cd414[_0x135310(0x1c3)])_0x427072['waitStepType']=_0x135310(0x11b),_0x427072[_0x135310(0x142)]=_0x4cd414[_0x135310(0x189)],_0x427072[_0x135310(0x1af)]=normalizeWaitUnit(_0x4cd414[_0x135310(0x1c3)]);else{if(_0x4cd414[_0x135310(0x165)])_0x427072[_0x135310(0x1cd)]=_0x135310(0x1bc),_0x427072['waitUntilDate']=_0x4cd414[_0x135310(0x165)];else{if(_0x4cd414[_0x135310(0x14d)])_0x427072[_0x135310(0x1cd)]=_0x135310(0x169),_0x427072[_0x135310(0x16a)]=_0x4cd414['days_of_week'];else{if(_0x4cd414[_0x135310(0x168)]){_0x427072[_0x135310(0x1cd)]='Condition';const _0x111ce9=await _0x19443f(_0x4cd414[_0x135310(0x168)]['segment']),_0x26b9cd=_0x4cd414[_0x135310(0x168)]['timeout']?.[_0x135310(0x152)]!==undefined;if(_0x26b9cd){const _0x4e44ce=[];_0x4e44ce[_0x135310(0x1da)]({'id':generateUUID(),'segmentId':_0x111ce9,'timedOutPath':![],'name':_0x135310(0x1cb),'next':_0x597cf0(_0x4cd414[_0x135310(0x168)]['next']??_0x274893[_0x135310(0x152)])});if(_0x4cd414['condition'][_0x135310(0x130)]){const _0x53142e=_0x4cd414['condition'][_0x135310(0x130)][_0x135310(0x189)],_0x545d42=normalizeWaitUnit(_0x4cd414[_0x135310(0x168)]['timeout']['unit']);_0x4e44ce[_0x135310(0x1da)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x135310(0x1b6)+_0x53142e+'\x20'+_0x545d42,'moveAfter':_0x53142e,'unit':_0x545d42,'next':_0x597cf0(_0x4cd414[_0x135310(0x168)][_0x135310(0x130)]['next'])});}_0x427072['conditions']=_0x4e44ce,delete _0x427072['next'];}else _0x427072[_0x135310(0x136)]=_0x111ce9,_0x4cd414[_0x135310(0x168)][_0x135310(0x130)]&&(_0x427072['conditionTimeoutDuration']=_0x4cd414[_0x135310(0x168)][_0x135310(0x130)][_0x135310(0x189)],_0x4cd414[_0x135310(0x168)][_0x135310(0x130)][_0x135310(0x1c3)]&&(_0x427072[_0x135310(0x12d)]=normalizeWaitUnit(_0x4cd414[_0x135310(0x168)][_0x135310(0x130)][_0x135310(0x1c3)])));}}}}return _0x427072;}case _0x135310(0x140):{const _0x3a0bbe=_0x47eecd,_0x5dd8c6=_0x3a0bbe['with'][_0x135310(0x140)],_0x325740=await _0x32b991(_0x5dd8c6);return{'type':_0x135310(0x1d1),'name':_0x3a0bbe[_0x135310(0x181)],'journeyActivationStepId':_0x325740,'next':_0x597cf0(_0x3a0bbe['next'])};}case'decision_point':{const _0x45e179=_0x47eecd,_0x411dbe=_0x45e179[_0x135310(0x177)][_0x135310(0x190)];return{'type':_0x135310(0x1a6),'name':_0x45e179[_0x135310(0x181)],'branches':await Promise[_0x135310(0x158)](_0x411dbe[_0x135310(0x134)](async _0x204ef7=>{const _0x3e8040=_0x135310;let _0x1cc6d3='';if(!_0x204ef7[_0x3e8040(0x1cf)]){const _0xe50b9e=_0x204ef7['segment']||_0x204ef7[_0x3e8040(0x12a)]||'';_0x1cc6d3=_0xe50b9e?await _0x19443f(_0xe50b9e):'';}return{'id':crypto[_0x3e8040(0x144)](),'name':_0x204ef7[_0x3e8040(0x181)],'description':null,'segmentId':_0x1cc6d3,'excludedPath':_0x204ef7[_0x3e8040(0x1cf)]??![],'next':_0x597cf0(_0x204ef7[_0x3e8040(0x152)])};})),'next':_0x597cf0(_0x45e179[_0x135310(0x152)])};}case'ab_test':{const _0x13fd19=_0x47eecd,_0x419533=_0x13fd19[_0x135310(0x177)];return{'type':_0x135310(0x17e),'name':_0x13fd19[_0x135310(0x181)],'customizedSplit':_0x419533[_0x135310(0x183)],'uniqueId':_0x419533['unique_id'],'variants':_0x419533[_0x135310(0x176)]['map'](_0x47900d=>({'id':_0x47900d['id']||generateUUID(),'name':_0x47900d['name'],'percentage':_0x47900d[_0x135310(0x13f)],'next':_0x597cf0(_0x47900d[_0x135310(0x152)])})),'next':_0x597cf0(_0x13fd19[_0x135310(0x152)])};}case _0x135310(0x160):return{'type':'Merge','name':_0x47eecd['name'],'next':_0x597cf0(_0x47eecd['next'])};case _0x135310(0x193):{const _0x468574=_0x47eecd,_0x3fe08a=_0x468574['with'][_0x135310(0x147)],_0x4f4f4f=_0x3fe08a[_0x135310(0x13a)],_0x23034d=_0x3fe08a[_0x135310(0x19a)];let _0x1474a4=_0x3fe08a[_0x135310(0x13a)];_0x64bddf?.[_0x135310(0x12f)]&&!/^\d+$/[_0x135310(0x1c1)](_0x1474a4)&&(_0x1474a4=await _0x64bddf[_0x135310(0x12f)](_0x1474a4));let _0x91af7b=_0x3fe08a[_0x135310(0x19a)];_0x64bddf?.[_0x135310(0x19c)]&&!/^\d+$/[_0x135310(0x1c1)](_0x91af7b)&&(_0x91af7b=await _0x64bddf[_0x135310(0x19c)](_0x1474a4,_0x91af7b));const _0x434930=!/^\d+$/[_0x135310(0x1c1)](_0x4f4f4f)&&!isLocalJourneyRef(_0x4f4f4f)?formatApiJourneyName(_0x4f4f4f,_0x23034d):undefined;return{'type':_0x135310(0x18a),'name':_0x468574[_0x135310(0x181)],'target':{'journeyId':_0x1474a4,'journeyStageId':_0x91af7b,'journeyBundleId':_0x3fe08a['bundle_id'],'journeyName':_0x434930,'confirmed':!![]},'next':_0x597cf0(_0x468574[_0x135310(0x152)])};}case'end':return{'type':_0x135310(0x1d8),'name':_0x47eecd[_0x135310(0x181)]};default:{const _0x5b8402=_0x47eecd;return{'type':_0x135310(0x1d8),'name':_0x5b8402[_0x135310(0x181)]};}}}export function toYamlString(_0x5f242b){const _0x5c34d8=a147_0x29bb,_0x17e497=stripInternalFields(_0x5f242b),_0x485d45=a147_0x10fcee[_0x5c34d8(0x180)](_0x17e497,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5c34d8(0x1de)}),_0x423e98=[_0x5c34d8(0x1a5),_0x5c34d8(0x1c4),_0x5c34d8(0x153),_0x5c34d8(0x16f),_0x5c34d8(0x178),_0x5c34d8(0x1a7),_0x5c34d8(0x170)];let _0x3e77ff=_0x485d45;for(const _0x47f370 of _0x423e98){_0x3e77ff=_0x3e77ff[_0x5c34d8(0x19b)](new RegExp('^('+_0x47f370+')','m'),(_0x4f48e9,_0x4ef1b3,_0x3fc253)=>{if(_0x3fc253===0x0||_0x3e77ff[_0x3fc253-0x1]==='\x0a'&&_0x3e77ff[_0x3fc253-0x2]==='\x0a')return _0x4ef1b3;return'\x0a'+_0x4ef1b3;});}return _0x3e77ff;}function stripInternalFields(_0xe087cd){const _0x29f11b=a147_0x29bb,{id:_0x5bfa48,folder_id:_0x21ecaf,bundle_id:_0x4a00bb,bundle_name:_0x31702b,version:_0x5844d7,allow_reentry:_0x2b09b5,..._0x356d84}=_0xe087cd;return _0x356d84[_0x29f11b(0x174)]&&(_0x356d84[_0x29f11b(0x174)]=_0x356d84[_0x29f11b(0x174)][_0x29f11b(0x134)](_0x2270eb=>{const _0x238f2f=_0x29f11b,{id:_0x303fd4,..._0x2432c6}=_0x2270eb;return{..._0x2432c6,'stages':_0x2432c6[_0x238f2f(0x1e0)][_0x238f2f(0x134)](stripStageInternalFields),..._0x2270eb[_0x238f2f(0x11c)]===!![]?{'latest':!![]}:{},..._0x356d84[_0x238f2f(0x174)][_0x238f2f(0x11d)]===0x1&&_0x2432c6[_0x238f2f(0x12e)]==='v1'?{'version':undefined}:{}};})),_0x356d84[_0x29f11b(0x1e0)]&&(_0x356d84[_0x29f11b(0x1e0)]=_0x356d84[_0x29f11b(0x1e0)][_0x29f11b(0x134)](stripStageInternalFields)),_0x356d84[_0x29f11b(0x1d9)]&&(_0x356d84[_0x29f11b(0x1d9)]=_0x356d84[_0x29f11b(0x1d9)]['map'](_0xda87b2=>{const _0x303354=_0x29f11b,{id:_0x4c1ad8,..._0x22b27d}=_0xda87b2;return{..._0x22b27d,'stages':_0x22b27d[_0x303354(0x1e0)][_0x303354(0x134)](stripStageInternalFields),..._0xda87b2['latest']===!![]?{'latest':!![]}:{}};})),_0x356d84;}function stripStageInternalFields(_0x21af1c){const {id:_0xcd149d,..._0x1c772e}=_0x21af1c;return _0x1c772e;}export function parseYamlString(_0xee7b37){return safeParseYaml(_0xee7b37,JourneyDefSchema);}export function isJourneyDef(_0x15ed06){const _0x4ef1ac=a147_0x29bb;return typeof _0x15ed06===_0x4ef1ac(0x166)&&_0x15ed06!==null&&_0x4ef1ac(0x163)in _0x15ed06&&_0x15ed06[_0x4ef1ac(0x163)]===_0x4ef1ac(0x13a);}export function generateTemplate(_0x14b011,_0x1a8abc){const _0x1db0b7=a147_0x29bb,_0x3f5eb7={'type':_0x1db0b7(0x13a),'name':_0x14b011,'description':_0x1db0b7(0x1b2),'reentry':_0x1db0b7(0x150),'goal':{'name':_0x1db0b7(0x123),'segment':'goal-segment'},'stages':[{'name':'Stage\x201','description':_0x1db0b7(0x15c),'entry_criteria':{'name':'Entry\x20Criteria','segment':_0x1a8abc},'steps':[{'type':_0x1db0b7(0x196),'name':'Wait\x201\x20Day','with':{'duration':0x1,'unit':'day'}},{'type':'activation','name':_0x1db0b7(0x15b),'with':{'activation':_0x1db0b7(0x1bd)}},{'type':_0x1db0b7(0x126),'name':_0x1db0b7(0x156)}]}]};return toYamlString(_0x3f5eb7);}function generateUUID(){const _0x5c35b9=a147_0x29bb;return crypto[_0x5c35b9(0x144)]();}export const SEGMENT_REF_PREFIX=a147_0x2ac4aa(0x1d6);export function parseSegmentRef(_0x29cd66){const _0x4d0e1d=a147_0x2ac4aa;if(_0x29cd66[_0x4d0e1d(0x132)](SEGMENT_REF_PREFIX))return{'type':_0x4d0e1d(0x14b),'name':_0x29cd66[_0x4d0e1d(0x1b9)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x4d0e1d(0x1c1)](_0x29cd66))return{'type':'id','name':_0x29cd66};return{'type':_0x4d0e1d(0x149),'name':_0x29cd66};}export function makeSegmentRef(_0xa5155c){return''+SEGMENT_REF_PREFIX+_0xa5155c;}export function isExternalSegmentRef(_0x543770){const _0x1772b0=a147_0x2ac4aa;return _0x543770[_0x1772b0(0x132)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x200daa){const _0x145458=a147_0x2ac4aa;return!!(_0x200daa['journeys']&&_0x200daa[_0x145458(0x174)][_0x145458(0x11d)]>0x0);}export function isMultiVersionMode(_0x313fff){const _0x2b4531=a147_0x2ac4aa;return!!(_0x313fff[_0x2b4531(0x1d9)]&&_0x313fff[_0x2b4531(0x1d9)][_0x2b4531(0x11d)]>0x0);}export function isSingleVersionMode(_0x5b348d){const _0x3065f6=a147_0x2ac4aa;return!!(_0x5b348d[_0x3065f6(0x1e0)]&&_0x5b348d[_0x3065f6(0x1e0)][_0x3065f6(0x11d)]>0x0);}export function hasMultipleVersions(_0x1b8552){const _0x565775=a147_0x2ac4aa;if(isJourneysArrayMode(_0x1b8552))return(_0x1b8552[_0x565775(0x174)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x1b8552))return(_0x1b8552[_0x565775(0x1d9)]?.[_0x565775(0x11d)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x5450a9){const _0xb3076d=a147_0x2ac4aa;if(isJourneysArrayMode(_0x5450a9))return _0x5450a9;if(isSingleVersionMode(_0x5450a9)){const {stages:_0x32f75a,id:_0x3ad6c4,version:_0x111287,version_number:_0x4d2477,..._0x2bf76d}=_0x5450a9;return{..._0x2bf76d,'journeys':[{'version':_0x111287||'v1','stages':_0x32f75a||[],'id':_0x3ad6c4,'version_number':_0x4d2477}]};}if(isMultiVersionMode(_0x5450a9)){const {versions:_0x1f6469,..._0xca7215}=_0x5450a9;return{..._0xca7215,'journeys':(_0x1f6469||[])[_0xb3076d(0x134)](_0x1737b8=>({'version':_0x1737b8[_0xb3076d(0x181)],'state':_0x1737b8[_0xb3076d(0x1be)],'latest':_0x1737b8[_0xb3076d(0x11c)],'stages':_0x1737b8[_0xb3076d(0x1e0)],'id':_0x1737b8['id'],'version_number':_0x1737b8['version_number']}))};}return _0x5450a9;}export function normalizeJourneyDef(_0x3c38ac,_0x577f3e){const _0x601fa0=a147_0x2ac4aa,_0x2f8eb1=normalizeToJourneysFormat(_0x3c38ac),_0x2924e4=_0x577f3e?.[_0x601fa0(0x15d)]?Object[_0x601fa0(0x1b3)](_0x577f3e['segments']):undefined,_0x2fda2a=_0x577f3e?.[_0x601fa0(0x1ba)]?Object[_0x601fa0(0x1b3)](_0x577f3e[_0x601fa0(0x1ba)]):undefined;return{'type':'journey','name':_0x2f8eb1[_0x601fa0(0x181)],..._0x2f8eb1['description']!==undefined&&{'description':_0x2f8eb1[_0x601fa0(0x164)]},..._0x2f8eb1['goal']&&{'goal':normalizeJourneyCriteria(_0x2f8eb1[_0x601fa0(0x15a)])},..._0x2f8eb1[_0x601fa0(0x18e)]!==undefined&&{'reentry':_0x2f8eb1[_0x601fa0(0x18e)]},..._0x2f8eb1['segments']&&{'segments':normalizeEmbeddedSegments(_0x2f8eb1['segments'],_0x2924e4)},..._0x2f8eb1[_0x601fa0(0x1ba)]&&{'activations':normalizeEmbeddedActivations(_0x2f8eb1[_0x601fa0(0x1ba)],_0x2fda2a)},..._0x2f8eb1['journeys']&&{'journeys':_0x2f8eb1['journeys']['map'](_0x178d20=>normalizeJourneyEntry(_0x178d20,_0x2f8eb1['journeys'][_0x601fa0(0x11d)]===0x1))}};}function normalizeJourneyEntry(_0x575ed2,_0x515237){const _0x719fa8=a147_0x2ac4aa;return{...!_0x515237&&_0x575ed2[_0x719fa8(0x12e)]!==undefined&&{'version':_0x575ed2[_0x719fa8(0x12e)]},..._0x575ed2[_0x719fa8(0x1be)]!==undefined&&{'state':_0x575ed2['state']},...!_0x515237&&_0x575ed2[_0x719fa8(0x11c)]!==undefined&&{'latest':_0x575ed2[_0x719fa8(0x11c)]},..._0x575ed2[_0x719fa8(0x1c2)]!==undefined&&{'version_number':_0x575ed2[_0x719fa8(0x1c2)]},..._0x575ed2['goal']&&{'goal':normalizeJourneyCriteria(_0x575ed2[_0x719fa8(0x15a)])},..._0x575ed2[_0x719fa8(0x18e)]!==undefined&&{'reentry':_0x575ed2[_0x719fa8(0x18e)]},'stages':_0x575ed2[_0x719fa8(0x1e0)][_0x719fa8(0x134)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x4b2f98){const _0x56127e=a147_0x2ac4aa;return{'name':_0x4b2f98[_0x56127e(0x181)],..._0x4b2f98[_0x56127e(0x164)]!==undefined&&{'description':_0x4b2f98['description']},..._0x4b2f98['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0x4b2f98[_0x56127e(0x155)])},..._0x4b2f98[_0x56127e(0x135)]&&{'exit_criteria':_0x4b2f98[_0x56127e(0x135)][_0x56127e(0x134)](normalizeJourneyCriteria)},..._0x4b2f98['milestone']&&{'milestone':normalizeJourneyCriteria(_0x4b2f98[_0x56127e(0x18d)])},..._0x4b2f98[_0x56127e(0x194)]&&{'steps':normalizeStepsWithImplicitNext(_0x4b2f98[_0x56127e(0x194)])}};}function normalizeStepsWithImplicitNext(_0x430a68){const _0x1b7ddf=a147_0x2ac4aa;return _0x430a68[_0x1b7ddf(0x134)]((_0x34ed11,_0xe877f4)=>{const _0x3562ed=_0x1b7ddf,_0x5cbc6b=_0xe877f4<_0x430a68[_0x3562ed(0x11d)]-0x1?_0x430a68[_0xe877f4+0x1][_0x3562ed(0x181)]:undefined;return normalizeJourneyStep(_0x34ed11,_0x5cbc6b);});}function a147_0x312d(){const _0x5a8ab5=['Expected\x20format:\x0a','condition','DaysOfTheWeek','daysOfWeek','size','sort','Unknown\x20segment\x20\x22','rule','reentry:','versions:','24XuhYiN','find','stageId','journeys','1090BwhcJL','variants','with','journeys:','journeyName','get','filter','days','launched','ABTest','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','stringify','name','draft','customized_split','ab_test','values','bundle_id','stageName','33465HLcvnd','duration','Jump','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','day','milestone','reentry','includes','branches','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','add','jump','steps','conditionTimeoutDuration','wait','uniqueId','AbTest','resolveEmbeddedActivationId','stage','replace','resolveStageId','conditions','folder','attributes','data','\x20\x20\x20\x20type:\x20And\x0a','from','1805287QGgPDl','behavior','segments:','DecisionPoint','stages:','\x20\x20rule:\x0a','isJourneyLocal','definition','resolveSegmentName','toLowerCase','all_columns','segment','waitStepUnit','1396XzkvEC','relationships','Journey\x20description','keys','5OGEpMl','weeks','*Max\x20wait\x20','1524720wJhEJv','timedOutPath','slice','activations','customizedSplit','Date','your-activation-name','state','has','journeyBundleName','test','version_number','unit','activations:','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','moveAfter','\x20\x20\x20\x20type:\x20','match','resolveActivationName','184zPmtHQ','Met\x20condition(s)','resolveSegment','waitStepType','resolveEmbeddedSegmentId','excluded','16kaKdil','Activation','634UPGkfr','segmentId','waitUntilDate','resolveJumpTarget','ref:','isArray','End','versions','push','activation_template_id','resolveActivationId','journeyStages','null','uuid','stages','decision_point','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','Duration','latest','length','journeyActivationStepId','entryCriteria','unique_id','journeyId','notification','Goal\x20Achieved','Merge','exitCriteria','end','week','JOURNEY_SYNTAX_ERROR','36873mxeWmh','segment_id','And','\x27.\x0a','conditionTimeoutUnit','version','resolveJourneyId','timeout','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','startsWith','columns','map','exit_criteria','conditionSegmentId','Variant','allowReentry','journeyBundleId','journey','parentFolder','\x27:\x20','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','folder_id','percentage','activation','schedule','waitStep','journeyStageId','randomUUID','trim','set','target','exitCriterias','embedded','914767aWciMA','ref','resolveActivation','days_of_week','Condition','4058366LYRUxQ','no_reentry','rootStep','next','goal:','reentryMode','entry_criteria','Stage\x20Complete','root_step','all','versionNumber','goal','Send\x20Notification','First\x20stage\x20of\x20the\x20journey','segments','\x20\x20\x20\x20conditions:\x0a','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','merge','connector_config','resolveSegmentId','type','description','wait_until','object'];a147_0x312d=function(){return _0x5a8ab5;};return a147_0x312d();}function normalizeJourneyCriteria(_0x418606){const _0xa5038a=a147_0x2ac4aa;return{'name':_0x418606['name'],..._0x418606['description']!==undefined&&{'description':_0x418606[_0xa5038a(0x164)]},'segment':_0x418606['segment'],..._0x418606[_0xa5038a(0x147)]&&{'target':normalizeJumpTarget(_0x418606[_0xa5038a(0x147)])}};}function normalizeJourneyStep(_0x2a88db,_0x5c0275){const _0x1e407a=a147_0x2ac4aa,_0x4df367=_0x2a88db[_0x1e407a(0x152)]!==undefined&&_0x2a88db[_0x1e407a(0x152)]!==_0x5c0275,_0x526f15={'type':_0x2a88db[_0x1e407a(0x163)],'name':_0x2a88db['name'],..._0x4df367&&{'next':_0x2a88db[_0x1e407a(0x152)]}};if(_0x1e407a(0x177)in _0x2a88db&&_0x2a88db[_0x1e407a(0x177)])return{..._0x526f15,'with':normalizeStepParams(_0x2a88db[_0x1e407a(0x163)],_0x2a88db[_0x1e407a(0x177)])};return _0x526f15;}function normalizeStepParams(_0x3bf21a,_0x3b47cb){const _0x17ec97=a147_0x2ac4aa;switch(_0x3bf21a){case _0x17ec97(0x196):{const _0x5dee3c=_0x3b47cb;let _0x8dcf46;return _0x5dee3c[_0x17ec97(0x168)]&&(_0x8dcf46={'segment':_0x5dee3c['condition'][_0x17ec97(0x1ae)],..._0x5dee3c[_0x17ec97(0x168)]['next']!==undefined&&{'next':_0x5dee3c[_0x17ec97(0x168)][_0x17ec97(0x152)]},..._0x5dee3c[_0x17ec97(0x168)][_0x17ec97(0x130)]&&{'timeout':{'duration':_0x5dee3c['condition'][_0x17ec97(0x130)][_0x17ec97(0x189)],'unit':_0x5dee3c[_0x17ec97(0x168)][_0x17ec97(0x130)]['unit'],..._0x5dee3c[_0x17ec97(0x168)][_0x17ec97(0x130)][_0x17ec97(0x152)]!==undefined&&{'next':_0x5dee3c[_0x17ec97(0x168)][_0x17ec97(0x130)][_0x17ec97(0x152)]}}}}),{..._0x5dee3c[_0x17ec97(0x189)]!==undefined&&{'duration':_0x5dee3c[_0x17ec97(0x189)]},..._0x5dee3c[_0x17ec97(0x1c3)]!==undefined&&{'unit':_0x5dee3c[_0x17ec97(0x1c3)]},..._0x5dee3c['wait_until']!==undefined&&{'wait_until':_0x5dee3c[_0x17ec97(0x165)]},..._0x5dee3c['days_of_week']!==undefined&&{'days_of_week':_0x5dee3c[_0x17ec97(0x14d)]},..._0x8dcf46&&{'condition':_0x8dcf46}};}case'activation':{const _0x2d071d=_0x3b47cb;return{'activation':_0x2d071d[_0x17ec97(0x140)]};}case _0x17ec97(0x1e1):{const _0x5e04fc=_0x3b47cb;return{'branches':_0x5e04fc[_0x17ec97(0x190)][_0x17ec97(0x134)](normalizeDecisionBranch)};}case _0x17ec97(0x184):{const _0x41ee60=_0x3b47cb;return{..._0x41ee60[_0x17ec97(0x183)]!==undefined&&{'customized_split':_0x41ee60['customized_split']},..._0x41ee60[_0x17ec97(0x120)]!==undefined&&{'unique_id':_0x41ee60['unique_id']},'variants':_0x41ee60['variants'][_0x17ec97(0x134)](normalizeAbTestVariant)};}case _0x17ec97(0x193):{const _0x510ce0=_0x3b47cb;return{'target':normalizeJumpTarget(_0x510ce0[_0x17ec97(0x147)])};}default:return _0x3b47cb;}}function normalizeDecisionBranch(_0x580255){const _0x34f8e7=a147_0x2ac4aa;return{'name':_0x580255['name'],..._0x580255[_0x34f8e7(0x1ae)]!==undefined&&{'segment':_0x580255[_0x34f8e7(0x1ae)]},..._0x580255['excluded']!==undefined&&{'excluded':_0x580255['excluded']},..._0x580255[_0x34f8e7(0x152)]!==undefined&&{'next':_0x580255[_0x34f8e7(0x152)]}};}function normalizeAbTestVariant(_0x209b68){const _0x2011ec=a147_0x2ac4aa;return{..._0x209b68['id']!==undefined&&{'id':_0x209b68['id']},'name':_0x209b68[_0x2011ec(0x181)],'percentage':_0x209b68[_0x2011ec(0x13f)],..._0x209b68[_0x2011ec(0x152)]!==undefined&&{'next':_0x209b68[_0x2011ec(0x152)]}};}function normalizeJumpTarget(_0x302808){const _0x6d1689=a147_0x2ac4aa;return{'journey':_0x302808[_0x6d1689(0x13a)],'stage':_0x302808[_0x6d1689(0x19a)],..._0x302808['bundle_id']!==undefined&&{'bundle_id':_0x302808[_0x6d1689(0x186)]}};}function normalizeEmbeddedSegments(_0xeffb98,_0x1d83d5){const _0x4c40df=a147_0x2ac4aa,_0x4a6645={},_0x56cc36=Object[_0x4c40df(0x1b3)](_0xeffb98),_0x3256b0=_0x1d83d5?[..._0x1d83d5[_0x4c40df(0x17b)](_0xffe2c7=>_0x56cc36[_0x4c40df(0x18f)](_0xffe2c7)),..._0x56cc36[_0x4c40df(0x17b)](_0x4e35d8=>!_0x1d83d5[_0x4c40df(0x18f)](_0x4e35d8))[_0x4c40df(0x16c)]()]:_0x56cc36['sort']();for(const _0x8d18aa of _0x3256b0){const _0x5076fb=_0xeffb98[_0x8d18aa];if(_0x5076fb['rule']){const _0x5af927=_0x5076fb['rule'];if(_0x5af927['type']!==_0x4c40df(0x12b)&&_0x5af927[_0x4c40df(0x163)]!=='Or'){const _0x2ad87c=_0x5af927['type']??'(missing)';throw new SDKError(ErrorCode[_0x4c40df(0x128)],_0x4c40df(0x131)+_0x8d18aa+_0x4c40df(0x13c)+(_0x4c40df(0x13d)+_0x2ad87c+_0x4c40df(0x12c))+_0x4c40df(0x167)+'\x20\x20rule:\x0a'+_0x4c40df(0x1a1)+_0x4c40df(0x15e)+_0x4c40df(0x17f)+_0x4c40df(0x1c5)+_0x4c40df(0x15f));}if(!_0x5af927[_0x4c40df(0x19d)]||!Array[_0x4c40df(0x1d7)](_0x5af927[_0x4c40df(0x19d)]))throw new SDKError(ErrorCode[_0x4c40df(0x128)],_0x4c40df(0x131)+_0x8d18aa+_0x4c40df(0x13c)+_0x4c40df(0x18b)+_0x4c40df(0x167)+_0x4c40df(0x1a8)+(_0x4c40df(0x1c7)+_0x5af927['type']+'\x0a')+'\x20\x20\x20\x20conditions:\x0a'+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x4c40df(0x1c5)+_0x4c40df(0x15f));}_0x4a6645[_0x8d18aa]={..._0x5076fb[_0x4c40df(0x164)]&&_0x5076fb[_0x4c40df(0x164)][_0x4c40df(0x145)]()&&{'description':_0x5076fb['description']},..._0x5076fb[_0x4c40df(0x16e)]&&{'rule':deepSortObject(_0x5076fb[_0x4c40df(0x16e)])}};}return _0x4a6645;}function normalizeEmbeddedActivations(_0x53ae77,_0x448c2e){const _0x5c15aa=a147_0x2ac4aa,_0x17ed91={},_0x2c3945=Object[_0x5c15aa(0x1b3)](_0x53ae77),_0x27d903=_0x448c2e?[..._0x448c2e['filter'](_0x54d6ba=>_0x2c3945[_0x5c15aa(0x18f)](_0x54d6ba)),..._0x2c3945[_0x5c15aa(0x17b)](_0x13d806=>!_0x448c2e[_0x5c15aa(0x18f)](_0x13d806))[_0x5c15aa(0x16c)]()]:_0x2c3945[_0x5c15aa(0x16c)]();for(const _0x573226 of _0x27d903){const _0x2df246=_0x53ae77[_0x573226];_0x17ed91[_0x573226]={'name':_0x2df246[_0x5c15aa(0x181)],'connection':_0x2df246['connection'],..._0x2df246[_0x5c15aa(0x164)]!==undefined&&{'description':_0x2df246[_0x5c15aa(0x164)]},..._0x2df246['all_columns']!==undefined&&{'all_columns':_0x2df246[_0x5c15aa(0x1ad)]},..._0x2df246[_0x5c15aa(0x133)]!==undefined&&{'columns':_0x2df246['columns']},..._0x2df246[_0x5c15aa(0x1a4)]!==undefined&&{'behavior':_0x2df246['behavior']},..._0x2df246['schedule']!==undefined&&{'schedule':_0x2df246[_0x5c15aa(0x141)]},..._0x2df246[_0x5c15aa(0x122)]!==undefined&&{'notification':_0x2df246[_0x5c15aa(0x122)]},..._0x2df246[_0x5c15aa(0x161)]!==undefined&&{'connector_config':_0x2df246[_0x5c15aa(0x161)]},..._0x2df246['activation_template_id']!==undefined&&{'activation_template_id':_0x2df246[_0x5c15aa(0x1db)]}};}return _0x17ed91;}export function getActiveStages(_0x357469){const _0xd953a9=a147_0x2ac4aa;if(isJourneysArrayMode(_0x357469)){const _0x42672d=_0x357469['journeys']||[],_0x5c3465=_0x42672d[_0xd953a9(0x172)](_0x5d0751=>_0x5d0751[_0xd953a9(0x11c)]===!![])||_0x42672d[0x0];return _0x5c3465?.[_0xd953a9(0x1e0)]||[];}if(isSingleVersionMode(_0x357469))return _0x357469[_0xd953a9(0x1e0)]||[];if(isMultiVersionMode(_0x357469)){const _0x16cbd7=_0x357469[_0xd953a9(0x1d9)]||[],_0x2ae3fc=_0x16cbd7[_0xd953a9(0x172)](_0x2b094c=>_0x2b094c[_0xd953a9(0x11c)]===!![])||_0x16cbd7[0x0];return _0x2ae3fc?.[_0xd953a9(0x1e0)]||[];}return[];}export function getLatestJourneyEntry(_0x25b73c){const _0x3f4109=a147_0x2ac4aa;if(isJourneysArrayMode(_0x25b73c)){const _0x2f8d0c=_0x25b73c['journeys']||[];return _0x2f8d0c[_0x3f4109(0x172)](_0x49d428=>_0x49d428['latest']===!![])||_0x2f8d0c[0x0];}if(isMultiVersionMode(_0x25b73c)){const _0x5da0ae=_0x25b73c[_0x3f4109(0x1d9)]||[],_0x5670f4=_0x5da0ae['find'](_0x35c119=>_0x35c119[_0x3f4109(0x11c)]===!![])||_0x5da0ae[0x0];if(_0x5670f4)return{'version':_0x5670f4[_0x3f4109(0x181)],'state':_0x5670f4['state'],'latest':_0x5670f4[_0x3f4109(0x11c)],'stages':_0x5670f4[_0x3f4109(0x1e0)],'id':_0x5670f4['id'],'version_number':_0x5670f4[_0x3f4109(0x1c2)]};}if(isSingleVersionMode(_0x25b73c))return{'version':_0x25b73c[_0x3f4109(0x12e)]||'v1','state':'draft','stages':_0x25b73c[_0x3f4109(0x1e0)]||[],'id':_0x25b73c['id'],'version_number':_0x25b73c['version_number'],'goal':_0x25b73c[_0x3f4109(0x15a)],'reentry':_0x25b73c[_0x3f4109(0x18e)]};return undefined;}export function getLatestVersion(_0x3d7768){const _0x4c087c=a147_0x2ac4aa;if(!isMultiVersionMode(_0x3d7768))return undefined;const _0x36b0ce=_0x3d7768['versions']||[];return _0x36b0ce['find'](_0x40980e=>_0x40980e[_0x4c087c(0x11c)]===!![])||_0x36b0ce[0x0];}export function getEffectiveGoal(_0x54b851){const _0x463ccf=a147_0x2ac4aa,_0x1bb7d0=getLatestJourneyEntry(_0x54b851);return _0x1bb7d0?.[_0x463ccf(0x15a)]||_0x54b851[_0x463ccf(0x15a)];}export function getEffectiveReentry(_0x42a63e){const _0x4b8f9c=a147_0x2ac4aa,_0x19ac92=getLatestJourneyEntry(_0x42a63e);return _0x19ac92?.[_0x4b8f9c(0x18e)]||_0x42a63e[_0x4b8f9c(0x18e)];}export function collectSegmentRefs(_0x9cd8fd){const _0x179a50=a147_0x2ac4aa,_0x1af31a=new Set();_0x9cd8fd[_0x179a50(0x15a)]?.[_0x179a50(0x1ae)]&&_0x1af31a['add'](_0x9cd8fd['goal'][_0x179a50(0x1ae)]);const _0x40bf49=_0x246bfa=>{const _0x5b4cc6=_0x179a50;for(const _0x330299 of _0x246bfa){_0x330299[_0x5b4cc6(0x155)]?.[_0x5b4cc6(0x1ae)]&&_0x1af31a[_0x5b4cc6(0x192)](_0x330299[_0x5b4cc6(0x155)][_0x5b4cc6(0x1ae)]);if(_0x330299[_0x5b4cc6(0x135)])for(const _0x26af44 of _0x330299['exit_criteria']){_0x26af44[_0x5b4cc6(0x1ae)]&&_0x1af31a[_0x5b4cc6(0x192)](_0x26af44['segment']);}_0x330299[_0x5b4cc6(0x18d)]?.[_0x5b4cc6(0x1ae)]&&_0x1af31a[_0x5b4cc6(0x192)](_0x330299[_0x5b4cc6(0x18d)]['segment']);if(_0x330299['steps'])for(const _0x39ab88 of _0x330299[_0x5b4cc6(0x194)]){if(_0x39ab88['type']===_0x5b4cc6(0x1e1)){const _0x716515=_0x39ab88;for(const _0x538119 of _0x716515[_0x5b4cc6(0x177)]['branches']){_0x538119[_0x5b4cc6(0x1ae)]&&_0x1af31a[_0x5b4cc6(0x192)](_0x538119['segment']);}}else{if(_0x39ab88[_0x5b4cc6(0x163)]===_0x5b4cc6(0x196)){const _0x4420bf=_0x39ab88;_0x4420bf[_0x5b4cc6(0x177)][_0x5b4cc6(0x168)]?.[_0x5b4cc6(0x1ae)]&&_0x1af31a[_0x5b4cc6(0x192)](_0x4420bf[_0x5b4cc6(0x177)][_0x5b4cc6(0x168)]['segment']);}}}}};_0x9cd8fd[_0x179a50(0x1e0)]&&_0x40bf49(_0x9cd8fd[_0x179a50(0x1e0)]);if(_0x9cd8fd[_0x179a50(0x1d9)])for(const _0x4ffbd9 of _0x9cd8fd['versions']){_0x40bf49(_0x4ffbd9[_0x179a50(0x1e0)]);}return _0x1af31a;}export function validateSegmentRefs(_0x305684){const _0x44c238=a147_0x2ac4aa,_0x4f6e4a=[],_0x53a00d=collectSegmentRefs(_0x305684),_0x5f2a28=new Set(Object[_0x44c238(0x1b3)](_0x305684[_0x44c238(0x15d)]||{}));for(const _0x4ba71c of _0x53a00d){const _0x4a5414=parseSegmentRef(_0x4ba71c);_0x4a5414[_0x44c238(0x163)]===_0x44c238(0x149)&&!_0x5f2a28['has'](_0x4a5414['name'])&&_0x4f6e4a[_0x44c238(0x1da)](_0x44c238(0x16d)+_0x4a5414[_0x44c238(0x181)]+_0x44c238(0x191)+_0x4a5414[_0x44c238(0x181)]+_0x44c238(0x11a));}return _0x4f6e4a;}export function collectSegmentIdsFromJourneyApi(_0x3557d2){const _0x5bab39=a147_0x2ac4aa,_0x6fabf0=new Set();_0x3557d2['attributes']['goal']?.[_0x5bab39(0x1d3)]&&_0x6fabf0['add'](_0x3557d2['attributes'][_0x5bab39(0x15a)][_0x5bab39(0x1d3)]);const _0x52fe6e=_0x3557d2[_0x5bab39(0x19f)][_0x5bab39(0x1dd)];if(Array[_0x5bab39(0x1d7)](_0x52fe6e))for(const _0x51298b of _0x52fe6e){_0x51298b[_0x5bab39(0x11f)]?.[_0x5bab39(0x1d3)]&&_0x6fabf0[_0x5bab39(0x192)](_0x51298b[_0x5bab39(0x11f)][_0x5bab39(0x1d3)]);const _0x25b7bf=_0x51298b[_0x5bab39(0x148)]??_0x51298b[_0x5bab39(0x125)];if(Array[_0x5bab39(0x1d7)](_0x25b7bf))for(const _0x58f1e8 of _0x25b7bf){_0x58f1e8[_0x5bab39(0x1d3)]&&_0x6fabf0[_0x5bab39(0x192)](_0x58f1e8[_0x5bab39(0x1d3)]);}_0x51298b[_0x5bab39(0x18d)]?.['segmentId']&&_0x6fabf0[_0x5bab39(0x192)](_0x51298b[_0x5bab39(0x18d)][_0x5bab39(0x1d3)]);if(_0x51298b[_0x5bab39(0x194)]&&typeof _0x51298b[_0x5bab39(0x194)]===_0x5bab39(0x166)){const _0x4cf68a=Array[_0x5bab39(0x1d7)](_0x51298b[_0x5bab39(0x194)])?_0x51298b[_0x5bab39(0x194)]:Object[_0x5bab39(0x185)](_0x51298b[_0x5bab39(0x194)]);for(const _0x5dcc5a of _0x4cf68a){_0x5dcc5a['waitCondition']?.[_0x5bab39(0x1d3)]&&_0x6fabf0[_0x5bab39(0x192)](_0x5dcc5a['waitCondition'][_0x5bab39(0x1d3)]);const _0x265b36=_0x5dcc5a;_0x265b36[_0x5bab39(0x136)]&&_0x6fabf0[_0x5bab39(0x192)](_0x265b36['conditionSegmentId']);if(Array[_0x5bab39(0x1d7)](_0x265b36[_0x5bab39(0x19d)]))for(const _0x1f10d4 of _0x265b36['conditions']){_0x1f10d4['segmentId']&&_0x6fabf0[_0x5bab39(0x192)](_0x1f10d4[_0x5bab39(0x1d3)]);}if(Array[_0x5bab39(0x1d7)](_0x5dcc5a['branches']))for(const _0x19a8c6 of _0x5dcc5a[_0x5bab39(0x190)]){_0x19a8c6['segmentId']&&_0x6fabf0[_0x5bab39(0x192)](_0x19a8c6[_0x5bab39(0x1d3)]);}}}}return _0x6fabf0;}
1
+ (function(_0x23109e,_0x348926){const _0x2ac350=a147_0x2081,_0x1180f4=_0x23109e();while(!![]){try{const _0x649d7a=parseInt(_0x2ac350(0x1b4))/0x1*(parseInt(_0x2ac350(0x20e))/0x2)+-parseInt(_0x2ac350(0x228))/0x3+parseInt(_0x2ac350(0x18f))/0x4*(-parseInt(_0x2ac350(0x1d9))/0x5)+-parseInt(_0x2ac350(0x18a))/0x6*(-parseInt(_0x2ac350(0x202))/0x7)+parseInt(_0x2ac350(0x1ab))/0x8*(parseInt(_0x2ac350(0x220))/0x9)+parseInt(_0x2ac350(0x1a4))/0xa+parseInt(_0x2ac350(0x197))/0xb*(parseInt(_0x2ac350(0x195))/0xc);if(_0x649d7a===_0x348926)break;else _0x1180f4['push'](_0x1180f4['shift']());}catch(_0x3becea){_0x1180f4['push'](_0x1180f4['shift']());}}}(a147_0x2a1c,0xd5273));import*as a147_0x3683c9 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x2eabe1){const _0x57c946=a147_0x2081,_0x3c7465=_0x2eabe1[_0x57c946(0x213)]();if(_0x3c7465===_0x57c946(0x23c)||_0x3c7465===_0x57c946(0x23a))return'day';if(_0x3c7465==='weeks'||_0x3c7465==='week')return _0x57c946(0x22d);return _0x2eabe1;}function a147_0x2081(_0x28000c,_0x387cd7){_0x28000c=_0x28000c-0x187;const _0x2a1c62=a147_0x2a1c();let _0x208176=_0x2a1c62[_0x28000c];return _0x208176;}export function journeyResponseToDefSync(_0x238f35){const _0x203c40=a147_0x2081,_0x39e75c=_0x238f35['attributes'],_0x2de4d8=_0x39e75c[_0x203c40(0x226)]||_0x39e75c[_0x203c40(0x200)],_0x4fec7b={'stages':_0x39e75c['journeyStages'][_0x203c40(0x218)](convertApiStageToYaml),'id':_0x238f35['id']};_0x39e75c[_0x203c40(0x1b0)]&&(_0x4fec7b[_0x203c40(0x1b0)]=convertApiCriteriaToYaml(_0x39e75c[_0x203c40(0x1b0)]));_0x39e75c['name']&&_0x39e75c[_0x203c40(0x200)]!==_0x2de4d8&&(_0x4fec7b[_0x203c40(0x1e9)]=_0x39e75c[_0x203c40(0x200)]);_0x39e75c[_0x203c40(0x1ae)]!==undefined&&(_0x4fec7b[_0x203c40(0x1d6)]=_0x39e75c[_0x203c40(0x1ae)]);_0x39e75c[_0x203c40(0x1db)]&&(_0x4fec7b[_0x203c40(0x1db)]=_0x39e75c[_0x203c40(0x1db)]===_0x203c40(0x217)?_0x203c40(0x217):'draft');const _0x405e2d={'type':_0x203c40(0x225),'name':_0x2de4d8,'journeys':[_0x4fec7b]};_0x39e75c[_0x203c40(0x1cc)]&&(_0x405e2d[_0x203c40(0x1cc)]=_0x39e75c[_0x203c40(0x1cc)]);_0x39e75c[_0x203c40(0x1b0)]&&(_0x405e2d['goal']=convertApiCriteriaToYaml(_0x39e75c[_0x203c40(0x1b0)]));if(_0x39e75c['reentryMode'])_0x405e2d[_0x203c40(0x18d)]=_0x39e75c[_0x203c40(0x203)];else _0x39e75c[_0x203c40(0x1c7)]!==undefined&&(_0x405e2d[_0x203c40(0x18d)]=_0x39e75c[_0x203c40(0x1c7)]?_0x203c40(0x1a3):_0x203c40(0x1bb));return _0x39e75c[_0x203c40(0x1df)]&&(_0x405e2d[_0x203c40(0x1dc)]=_0x39e75c[_0x203c40(0x1df)]),_0x39e75c[_0x203c40(0x226)]&&(_0x405e2d[_0x203c40(0x223)]=_0x39e75c[_0x203c40(0x226)]),_0x238f35[_0x203c40(0x1b9)]?.[_0x203c40(0x1fd)]?.[_0x203c40(0x1d2)]?.['id']&&(_0x405e2d[_0x203c40(0x1c6)]=_0x238f35['relationships'][_0x203c40(0x1fd)][_0x203c40(0x1d2)]['id']),_0x405e2d;}export async function journeyResponseToDef(_0x3468e6,_0x223513){const _0x4c35c0=a147_0x2081,_0x15ad6c=journeyResponseToDefSync(_0x3468e6);if(!_0x223513)return _0x15ad6c;const _0x41ba94=new Set();collectSegmentIdsFromJourney(_0x15ad6c,_0x41ba94);const _0x3814e1=new Set();collectActivationIdsFromJourney(_0x15ad6c,_0x3814e1);const _0x2fa998={},_0x4e968c=new Map();for(const _0x39e5a9 of Array[_0x4c35c0(0x1d3)](_0x41ba94)[_0x4c35c0(0x1ad)]()){if(_0x223513[_0x4c35c0(0x1d7)]){const _0x464d26=await _0x223513[_0x4c35c0(0x1d7)](_0x39e5a9);if(_0x464d26['isJourneyLocal']){_0x4e968c[_0x4c35c0(0x190)](_0x39e5a9,_0x464d26['name']);if(_0x464d26['definition']){const _0x52ece6={..._0x464d26['definition'],'rule':deepSortObject(_0x464d26[_0x4c35c0(0x1f6)]['rule'])};_0x2fa998[_0x464d26[_0x4c35c0(0x200)]]=_0x52ece6;}}else _0x4e968c[_0x4c35c0(0x190)](_0x39e5a9,makeSegmentRef(_0x464d26['name']));}else{if(_0x223513[_0x4c35c0(0x229)]){const _0x553acf=await _0x223513[_0x4c35c0(0x229)](_0x39e5a9);_0x4e968c[_0x4c35c0(0x190)](_0x39e5a9,_0x553acf);}}}const _0x541267={},_0x2d7a25=new Map();for(const _0x349713 of Array['from'](_0x3814e1)[_0x4c35c0(0x1ad)]()){if(_0x223513['resolveActivation']){const _0x57062d=await _0x223513['resolveActivation'](_0x349713);_0x57062d[_0x4c35c0(0x243)]?(_0x2d7a25['set'](_0x349713,_0x57062d[_0x4c35c0(0x200)]),_0x57062d[_0x4c35c0(0x1f6)]&&(_0x541267[_0x57062d[_0x4c35c0(0x200)]]=_0x57062d[_0x4c35c0(0x1f6)])):_0x2d7a25[_0x4c35c0(0x190)](_0x349713,makeSegmentRef(_0x57062d[_0x4c35c0(0x200)]));}else{if(_0x223513['resolveActivationName']){const _0x537d80=await _0x223513['resolveActivationName'](_0x349713);_0x2d7a25['set'](_0x349713,_0x537d80);}}}_0x4e968c[_0x4c35c0(0x1b1)]>0x0&&replaceSegmentIdsInJourney(_0x15ad6c,_0x4e968c);_0x2d7a25[_0x4c35c0(0x1b1)]>0x0&&replaceActivationIdsInJourney(_0x15ad6c,_0x2d7a25);if(_0x223513['resolveJumpTarget']){const _0x42edbd=[];collectJumpTargetsFromJourney(_0x15ad6c,_0x42edbd);if(_0x42edbd['length']>0x0){const _0x2701a6=new Map();for(const _0x285e40 of _0x42edbd){try{const _0x5f4d1d=await _0x223513['resolveJumpTarget'](_0x285e40[_0x4c35c0(0x1eb)],_0x285e40[_0x4c35c0(0x1af)]);_0x2701a6[_0x4c35c0(0x190)](_0x285e40[_0x4c35c0(0x1eb)]+':'+_0x285e40[_0x4c35c0(0x1af)],_0x5f4d1d);}catch{}}_0x2701a6[_0x4c35c0(0x1b1)]>0x0&&replaceJumpTargetsInJourney(_0x15ad6c,_0x2701a6);}}return Object[_0x4c35c0(0x1ff)](_0x2fa998)['length']>0x0&&(_0x15ad6c[_0x4c35c0(0x23b)]=_0x2fa998),Object[_0x4c35c0(0x1ff)](_0x541267)['length']>0x0&&(_0x15ad6c['activations']=_0x541267),_0x15ad6c;}function collectSegmentIdsFromJourney(_0x137eeb,_0x429842){const _0x40c4a8=a147_0x2081;_0x137eeb[_0x40c4a8(0x1b0)]?.[_0x40c4a8(0x1c3)]&&_0x429842[_0x40c4a8(0x233)](_0x137eeb['goal'][_0x40c4a8(0x1c3)]);const _0x159e4a=_0x7d9a0d=>{const _0x27b666=_0x40c4a8;for(const _0x2181dc of _0x7d9a0d){_0x2181dc['entry_criteria']?.[_0x27b666(0x1c3)]&&_0x429842[_0x27b666(0x233)](_0x2181dc['entry_criteria']['segment']);if(_0x2181dc['exit_criteria'])for(const _0x13a88e of _0x2181dc[_0x27b666(0x22e)]){_0x13a88e[_0x27b666(0x1c3)]&&_0x429842[_0x27b666(0x233)](_0x13a88e['segment']);}_0x2181dc[_0x27b666(0x1c4)]?.[_0x27b666(0x1c3)]&&_0x429842[_0x27b666(0x233)](_0x2181dc[_0x27b666(0x1c4)][_0x27b666(0x1c3)]);if(_0x2181dc[_0x27b666(0x1c8)])for(const _0x25f03f of _0x2181dc[_0x27b666(0x1c8)]){if(_0x25f03f[_0x27b666(0x1ce)]===_0x27b666(0x1ee)){const _0x547854=_0x25f03f;for(const _0x544d51 of _0x547854['with']['branches']){_0x544d51[_0x27b666(0x1c3)]&&_0x429842[_0x27b666(0x233)](_0x544d51['segment']);}}else{if(_0x25f03f[_0x27b666(0x1ce)]===_0x27b666(0x22b)){const _0x4b4efd=_0x25f03f;_0x4b4efd['with'][_0x27b666(0x1fc)]?.[_0x27b666(0x1c3)]&&_0x429842[_0x27b666(0x233)](_0x4b4efd[_0x27b666(0x240)]['condition'][_0x27b666(0x1c3)]);}}}}};if(_0x137eeb['journeys'])for(const _0x19dc57 of _0x137eeb[_0x40c4a8(0x234)]){_0x19dc57[_0x40c4a8(0x1b0)]?.[_0x40c4a8(0x1c3)]&&_0x429842[_0x40c4a8(0x233)](_0x19dc57['goal']['segment']),_0x159e4a(_0x19dc57[_0x40c4a8(0x214)]);}_0x137eeb[_0x40c4a8(0x214)]&&_0x159e4a(_0x137eeb[_0x40c4a8(0x214)]);if(_0x137eeb[_0x40c4a8(0x1f8)])for(const _0x1185be of _0x137eeb[_0x40c4a8(0x1f8)]){_0x159e4a(_0x1185be['stages']);}}function replaceSegmentIdsInJourney(_0x5efdc1,_0x16ae5f){const _0x49e197=a147_0x2081,_0x753e67=_0x107fb9=>_0x16ae5f[_0x49e197(0x224)](_0x107fb9)||_0x107fb9;_0x5efdc1['goal']?.['segment']&&(_0x5efdc1[_0x49e197(0x1b0)][_0x49e197(0x1c3)]=_0x753e67(_0x5efdc1[_0x49e197(0x1b0)][_0x49e197(0x1c3)]));const _0x14702a=_0x26dab8=>{const _0x3dbb4b=_0x49e197;for(const _0x2820c9 of _0x26dab8){_0x2820c9['entry_criteria']?.['segment']&&(_0x2820c9[_0x3dbb4b(0x1f5)][_0x3dbb4b(0x1c3)]=_0x753e67(_0x2820c9[_0x3dbb4b(0x1f5)][_0x3dbb4b(0x1c3)]));if(_0x2820c9[_0x3dbb4b(0x22e)])for(const _0x3adc26 of _0x2820c9[_0x3dbb4b(0x22e)]){_0x3adc26['segment']&&(_0x3adc26['segment']=_0x753e67(_0x3adc26[_0x3dbb4b(0x1c3)]));}_0x2820c9[_0x3dbb4b(0x1c4)]?.[_0x3dbb4b(0x1c3)]&&(_0x2820c9['milestone'][_0x3dbb4b(0x1c3)]=_0x753e67(_0x2820c9[_0x3dbb4b(0x1c4)]['segment']));if(_0x2820c9[_0x3dbb4b(0x1c8)])for(const _0x3f2afa of _0x2820c9['steps']){if(_0x3f2afa[_0x3dbb4b(0x1ce)]===_0x3dbb4b(0x1ee)){const _0x3c06a1=_0x3f2afa;for(const _0x519d88 of _0x3c06a1[_0x3dbb4b(0x240)][_0x3dbb4b(0x1f7)]){_0x519d88['segment']&&(_0x519d88[_0x3dbb4b(0x1c3)]=_0x753e67(_0x519d88[_0x3dbb4b(0x1c3)]));}}else{if(_0x3f2afa[_0x3dbb4b(0x1ce)]===_0x3dbb4b(0x22b)){const _0x53b4ca=_0x3f2afa;_0x53b4ca[_0x3dbb4b(0x240)][_0x3dbb4b(0x1fc)]?.[_0x3dbb4b(0x1c3)]&&(_0x53b4ca['with'][_0x3dbb4b(0x1fc)][_0x3dbb4b(0x1c3)]=_0x753e67(_0x53b4ca['with'][_0x3dbb4b(0x1fc)][_0x3dbb4b(0x1c3)]));}}}}};if(_0x5efdc1[_0x49e197(0x234)])for(const _0x461e3f of _0x5efdc1[_0x49e197(0x234)]){_0x461e3f[_0x49e197(0x1b0)]?.[_0x49e197(0x1c3)]&&(_0x461e3f[_0x49e197(0x1b0)][_0x49e197(0x1c3)]=_0x753e67(_0x461e3f['goal'][_0x49e197(0x1c3)])),_0x14702a(_0x461e3f[_0x49e197(0x214)]);}_0x5efdc1[_0x49e197(0x214)]&&_0x14702a(_0x5efdc1['stages']);if(_0x5efdc1[_0x49e197(0x1f8)])for(const _0x17cf04 of _0x5efdc1[_0x49e197(0x1f8)]){_0x14702a(_0x17cf04[_0x49e197(0x214)]);}}function collectActivationIdsFromJourney(_0x22f5e6,_0x4055a2){const _0x816baa=a147_0x2081,_0x1fa7cb=_0x2ff3be=>{const _0x14e9a0=a147_0x2081;for(const _0x21aea5 of _0x2ff3be){if(_0x21aea5[_0x14e9a0(0x1c8)])for(const _0x2c5dff of _0x21aea5[_0x14e9a0(0x1c8)]){if(_0x2c5dff[_0x14e9a0(0x1ce)]===_0x14e9a0(0x1d1)){const _0x178605=_0x2c5dff;_0x178605[_0x14e9a0(0x240)][_0x14e9a0(0x1d1)]&&/^\d+$/[_0x14e9a0(0x1fe)](_0x178605[_0x14e9a0(0x240)]['activation'])&&_0x4055a2[_0x14e9a0(0x233)](_0x178605[_0x14e9a0(0x240)][_0x14e9a0(0x1d1)]);}}}};if(_0x22f5e6[_0x816baa(0x234)])for(const _0x350648 of _0x22f5e6['journeys']){_0x1fa7cb(_0x350648['stages']);}_0x22f5e6[_0x816baa(0x214)]&&_0x1fa7cb(_0x22f5e6['stages']);if(_0x22f5e6[_0x816baa(0x1f8)])for(const _0x5c3c99 of _0x22f5e6[_0x816baa(0x1f8)]){_0x1fa7cb(_0x5c3c99['stages']);}}function replaceActivationIdsInJourney(_0x3f22c3,_0x3cda61){const _0x41deea=a147_0x2081,_0x2a6985=_0x3d4744=>_0x3cda61[_0x41deea(0x224)](_0x3d4744)||_0x3d4744,_0x233d6b=_0x38f989=>{const _0x14ffec=_0x41deea;for(const _0x3fdbfc of _0x38f989){if(_0x3fdbfc[_0x14ffec(0x1c8)])for(const _0x22918c of _0x3fdbfc['steps']){if(_0x22918c[_0x14ffec(0x1ce)]===_0x14ffec(0x1d1)){const _0x5d6264=_0x22918c;_0x5d6264[_0x14ffec(0x240)]['activation']&&(_0x5d6264[_0x14ffec(0x240)][_0x14ffec(0x1d1)]=_0x2a6985(_0x5d6264[_0x14ffec(0x240)][_0x14ffec(0x1d1)]));}}}};if(_0x3f22c3[_0x41deea(0x234)])for(const _0x121a3d of _0x3f22c3[_0x41deea(0x234)]){_0x233d6b(_0x121a3d[_0x41deea(0x214)]);}_0x3f22c3[_0x41deea(0x214)]&&_0x233d6b(_0x3f22c3['stages']);if(_0x3f22c3[_0x41deea(0x1f8)])for(const _0x547576 of _0x3f22c3[_0x41deea(0x1f8)]){_0x233d6b(_0x547576[_0x41deea(0x214)]);}}function collectJumpTargetsFromJourney(_0x23b7cc,_0x2aca9f){const _0x33fc7c=a147_0x2081,_0x143909=new Set(),_0x4add98=_0xa510bf=>{const _0x201d2e=a147_0x2081;for(const _0x5dcea8 of _0xa510bf){if(_0x5dcea8[_0x201d2e(0x1c8)])for(const _0x4b4918 of _0x5dcea8['steps']){if(_0x4b4918['type']===_0x201d2e(0x1da)){const _0x1abc57=_0x4b4918,_0x2e6b34=_0x1abc57[_0x201d2e(0x240)][_0x201d2e(0x1b8)];if(_0x2e6b34[_0x201d2e(0x225)]&&_0x2e6b34[_0x201d2e(0x19b)]&&/^\d+$/['test'](_0x2e6b34[_0x201d2e(0x225)])&&/^\d+$/['test'](_0x2e6b34[_0x201d2e(0x19b)])){const _0x295ee5=_0x2e6b34['journey']+':'+_0x2e6b34[_0x201d2e(0x19b)];!_0x143909[_0x201d2e(0x1e0)](_0x295ee5)&&(_0x143909[_0x201d2e(0x233)](_0x295ee5),_0x2aca9f[_0x201d2e(0x1cd)]({'journeyId':_0x2e6b34[_0x201d2e(0x225)],'stageId':_0x2e6b34[_0x201d2e(0x19b)]}));}}}}};if(_0x23b7cc[_0x33fc7c(0x234)])for(const _0x3f3b0d of _0x23b7cc['journeys']){_0x4add98(_0x3f3b0d[_0x33fc7c(0x214)]);}_0x23b7cc[_0x33fc7c(0x214)]&&_0x4add98(_0x23b7cc[_0x33fc7c(0x214)]);if(_0x23b7cc[_0x33fc7c(0x1f8)])for(const _0x2aa423 of _0x23b7cc[_0x33fc7c(0x1f8)]){_0x4add98(_0x2aa423[_0x33fc7c(0x214)]);}}function replaceJumpTargetsInJourney(_0x4155d7,_0x49fd0a){const _0x36c0e0=a147_0x2081,_0xff5560=_0x3b5a3e=>{const _0x33f796=a147_0x2081;for(const _0x5284ad of _0x3b5a3e){if(_0x5284ad[_0x33f796(0x1c8)])for(const _0x2a90f6 of _0x5284ad[_0x33f796(0x1c8)]){if(_0x2a90f6[_0x33f796(0x1ce)]===_0x33f796(0x1da)){const _0x545b98=_0x2a90f6,_0x3feae1=_0x545b98[_0x33f796(0x240)][_0x33f796(0x1b8)],_0x5e7d56=_0x3feae1['journey']+':'+_0x3feae1[_0x33f796(0x19b)],_0x2eadd4=_0x49fd0a[_0x33f796(0x224)](_0x5e7d56);_0x2eadd4&&(_0x3feae1['journey']=_0x2eadd4['journeyName'],_0x3feae1[_0x33f796(0x19b)]=_0x2eadd4[_0x33f796(0x1ed)]);}}}};if(_0x4155d7[_0x36c0e0(0x234)])for(const _0x52c8a7 of _0x4155d7[_0x36c0e0(0x234)]){_0xff5560(_0x52c8a7['stages']);}_0x4155d7[_0x36c0e0(0x214)]&&_0xff5560(_0x4155d7[_0x36c0e0(0x214)]);if(_0x4155d7[_0x36c0e0(0x1f8)])for(const _0x221452 of _0x4155d7['versions']){_0xff5560(_0x221452[_0x36c0e0(0x214)]);}}function generateReadableStepName(_0xbd28e0,_0xdae247){const _0x4ac08a=a147_0x2081;if(_0xbd28e0[_0x4ac08a(0x200)]&&_0xbd28e0[_0x4ac08a(0x200)]!==_0xbd28e0[_0x4ac08a(0x1ce)]){const _0x295108=_0xbd28e0[_0x4ac08a(0x200)][_0x4ac08a(0x1f0)]();if(_0x295108&&/[a-z0-9\p{L}]/iu['test'](_0x295108))return _0x295108;}const _0x358099=_0xbd28e0['type'][_0x4ac08a(0x213)]()[_0x4ac08a(0x1e4)](/step$/i,'');return _0x358099+'_'+(_0xdae247+0x1);}function getStepNextRefs(_0x4208b9){const _0x4add05=a147_0x2081,_0x14c364=[];if(_0x4208b9[_0x4add05(0x237)])_0x14c364[_0x4add05(0x1cd)](_0x4208b9[_0x4add05(0x237)]);if(_0x4208b9[_0x4add05(0x1f7)])for(const _0x2ea14b of _0x4208b9[_0x4add05(0x1f7)]){if(_0x2ea14b['next'])_0x14c364[_0x4add05(0x1cd)](_0x2ea14b[_0x4add05(0x237)]);}if(_0x4208b9['variants'])for(const _0x21a3b4 of _0x4208b9[_0x4add05(0x1f1)]){if(_0x21a3b4[_0x4add05(0x237)])_0x14c364[_0x4add05(0x1cd)](_0x21a3b4['next']);}if(_0x4208b9[_0x4add05(0x22a)])for(const _0x108e65 of _0x4208b9[_0x4add05(0x22a)]){if(_0x108e65[_0x4add05(0x237)])_0x14c364[_0x4add05(0x1cd)](_0x108e65['next']);}return _0x14c364;}function parseJumpTargetDisplayName(_0x4f4255){const _0x4028da=a147_0x2081,_0x388f54=_0x4f4255[_0x4028da(0x1aa)](/^(.+?)\s*\(([^/)]+)/);if(!_0x388f54)return undefined;const _0x492d9b=_0x388f54[0x1][_0x4028da(0x1f0)](),_0x3d48d6=_0x388f54[0x2][_0x4028da(0x1f0)]();if(!_0x492d9b||!_0x3d48d6)return undefined;return{'stageName':_0x492d9b,'journeyName':_0x3d48d6};}function orderStepsFromRoot(_0x42b02a,_0x3c0980){const _0x993ae=a147_0x2081,_0x468842=Object[_0x993ae(0x191)](_0x42b02a);if(_0x468842[_0x993ae(0x23d)]===0x0)return[];const _0x12adf7=new Set(_0x468842[_0x993ae(0x218)](([_0x404f3c])=>_0x404f3c)),_0x2f75e7=new Set();for(const [,_0x1c06e4]of _0x468842){for(const _0x3b0996 of getStepNextRefs(_0x1c06e4)){if(_0x12adf7[_0x993ae(0x1e0)](_0x3b0996))_0x2f75e7[_0x993ae(0x233)](_0x3b0996);}}let _0x27e4d6=_0x3c0980&&_0x12adf7['has'](_0x3c0980)?_0x3c0980:undefined;if(!_0x27e4d6){const _0x2c1e91=_0x468842[_0x993ae(0x1c9)](([_0x10cacf])=>!_0x2f75e7[_0x993ae(0x1e0)](_0x10cacf));_0x2c1e91[_0x993ae(0x23d)]>0x0?_0x27e4d6=_0x2c1e91[0x0][0x0]:_0x27e4d6=_0x468842[0x0][0x0];}const _0x36ce7d=[],_0x4ed8f7=new Set(),_0x27bf8e=[_0x27e4d6];while(_0x27bf8e[_0x993ae(0x23d)]>0x0){const _0x3d9036=_0x27bf8e[_0x993ae(0x1cf)]();if(_0x4ed8f7[_0x993ae(0x1e0)](_0x3d9036))continue;_0x4ed8f7[_0x993ae(0x233)](_0x3d9036);const _0x2d7198=_0x42b02a[_0x3d9036];if(!_0x2d7198)continue;_0x36ce7d['push']({'uuid':_0x3d9036,'step':_0x2d7198});for(const _0x1d2dff of getStepNextRefs(_0x2d7198)){_0x12adf7[_0x993ae(0x1e0)](_0x1d2dff)&&!_0x4ed8f7[_0x993ae(0x1e0)](_0x1d2dff)&&_0x27bf8e[_0x993ae(0x1cd)](_0x1d2dff);}}for(const [_0x17970c,_0x3b5f11]of _0x468842){!_0x4ed8f7[_0x993ae(0x1e0)](_0x17970c)&&_0x36ce7d[_0x993ae(0x1cd)]({'uuid':_0x17970c,'step':_0x3b5f11});}return _0x36ce7d;}function resolveStepReferences(_0x3d83a2,_0x112787,_0x2a51ba,_0xc4d4e){const _0x57f8d7=a147_0x2081;if(_0x3d83a2[_0x57f8d7(0x1ce)]!==_0x57f8d7(0x1a0)){_0x3d83a2[_0x57f8d7(0x237)]&&_0xc4d4e[_0x57f8d7(0x1e0)](_0x3d83a2[_0x57f8d7(0x237)])&&(_0x3d83a2['next']=_0xc4d4e[_0x57f8d7(0x224)](_0x3d83a2[_0x57f8d7(0x237)]));const _0x186b66=_0x112787+0x1;if(_0x186b66<_0x2a51ba['length']){const _0x4e4ffe=_0xc4d4e['get'](_0x2a51ba[_0x186b66][_0x57f8d7(0x1e7)]);_0x3d83a2[_0x57f8d7(0x237)]===_0x4e4ffe&&delete _0x3d83a2[_0x57f8d7(0x237)];}}if(_0x3d83a2[_0x57f8d7(0x1ce)]===_0x57f8d7(0x1ee))for(const _0x5bd376 of _0x3d83a2[_0x57f8d7(0x240)][_0x57f8d7(0x1f7)]){_0x5bd376[_0x57f8d7(0x237)]&&_0xc4d4e[_0x57f8d7(0x1e0)](_0x5bd376['next'])&&(_0x5bd376[_0x57f8d7(0x237)]=_0xc4d4e['get'](_0x5bd376[_0x57f8d7(0x237)]));}if(_0x3d83a2[_0x57f8d7(0x1ce)]===_0x57f8d7(0x21e))for(const _0x27ae10 of _0x3d83a2[_0x57f8d7(0x240)][_0x57f8d7(0x1f1)]){_0x27ae10[_0x57f8d7(0x237)]&&_0xc4d4e[_0x57f8d7(0x1e0)](_0x27ae10['next'])&&(_0x27ae10[_0x57f8d7(0x237)]=_0xc4d4e[_0x57f8d7(0x224)](_0x27ae10[_0x57f8d7(0x237)]));}if(_0x3d83a2['type']===_0x57f8d7(0x22b)&&_0x3d83a2['with'][_0x57f8d7(0x1fc)]){const _0x2b245c=_0x3d83a2['with'][_0x57f8d7(0x1fc)];_0x2b245c[_0x57f8d7(0x237)]&&_0xc4d4e['has'](_0x2b245c[_0x57f8d7(0x237)])&&(_0x2b245c[_0x57f8d7(0x237)]=_0xc4d4e[_0x57f8d7(0x224)](_0x2b245c['next'])),_0x2b245c[_0x57f8d7(0x1e6)]?.[_0x57f8d7(0x237)]&&_0xc4d4e['has'](_0x2b245c[_0x57f8d7(0x1e6)]['next'])&&(_0x2b245c[_0x57f8d7(0x1e6)]['next']=_0xc4d4e[_0x57f8d7(0x224)](_0x2b245c[_0x57f8d7(0x1e6)]['next']));}}function convertApiStageToYaml(_0x3a5e3e){const _0x48f1d7=a147_0x2081,_0x4a570d={'name':_0x3a5e3e[_0x48f1d7(0x200)]};_0x3a5e3e['id']&&(_0x4a570d['id']=_0x3a5e3e['id']);_0x3a5e3e[_0x48f1d7(0x1cc)]&&(_0x4a570d[_0x48f1d7(0x1cc)]=_0x3a5e3e[_0x48f1d7(0x1cc)]);_0x3a5e3e[_0x48f1d7(0x207)]&&(_0x4a570d['entry_criteria']=convertApiCriteriaToYaml(_0x3a5e3e[_0x48f1d7(0x207)]));_0x3a5e3e[_0x48f1d7(0x1cb)]&&_0x3a5e3e[_0x48f1d7(0x1cb)][_0x48f1d7(0x23d)]>0x0&&(_0x4a570d[_0x48f1d7(0x22e)]=_0x3a5e3e[_0x48f1d7(0x1cb)][_0x48f1d7(0x218)](convertApiCriteriaToYaml));_0x3a5e3e[_0x48f1d7(0x1c4)]&&(_0x4a570d[_0x48f1d7(0x1c4)]=convertApiCriteriaToYaml(_0x3a5e3e[_0x48f1d7(0x1c4)]));if(_0x3a5e3e[_0x48f1d7(0x1c8)]&&Object[_0x48f1d7(0x1ff)](_0x3a5e3e[_0x48f1d7(0x1c8)])[_0x48f1d7(0x23d)]>0x0){const _0xd9adf0=orderStepsFromRoot(_0x3a5e3e['steps'],_0x3a5e3e[_0x48f1d7(0x210)]),_0x567a30=new Map(),_0xef8dc2=new Set();for(let _0x47ca31=0x0;_0x47ca31<_0xd9adf0[_0x48f1d7(0x23d)];_0x47ca31++){const {uuid:_0x2475dd,step:_0x5b561f}=_0xd9adf0[_0x47ca31];let _0x17745a=generateReadableStepName(_0x5b561f,_0x47ca31),_0x5992e1=_0x17745a,_0xd660b=0x2;while(_0xef8dc2[_0x48f1d7(0x1e0)](_0x5992e1)){_0x5992e1=_0x17745a+'_'+_0xd660b,_0xd660b++;}_0xef8dc2[_0x48f1d7(0x233)](_0x5992e1),_0x567a30[_0x48f1d7(0x190)](_0x2475dd,_0x5992e1);}_0x4a570d[_0x48f1d7(0x1c8)]=_0xd9adf0[_0x48f1d7(0x218)](({uuid:_0x42b643,step:_0x10727f},_0x1d08e)=>{const _0x370562=_0x48f1d7,_0x4e8cb9=convertApiStepToYaml(_0x10727f,_0x567a30[_0x370562(0x224)](_0x42b643));return resolveStepReferences(_0x4e8cb9,_0x1d08e,_0xd9adf0,_0x567a30),_0x4e8cb9;});}return _0x4a570d;}function convertApiCriteriaToYaml(_0xc00423){const _0x1087ec=a147_0x2081,_0x35b735={'name':_0xc00423[_0x1087ec(0x200)],'segment':_0xc00423[_0x1087ec(0x18c)]};_0xc00423['description']&&(_0x35b735[_0x1087ec(0x1cc)]=_0xc00423[_0x1087ec(0x1cc)]);if(_0xc00423['target']){let _0x529079=_0xc00423['target'][_0x1087ec(0x1eb)],_0x2ea7e7=_0xc00423[_0x1087ec(0x1b8)][_0x1087ec(0x1a2)];if(_0xc00423['target'][_0x1087ec(0x1b2)]){const _0x218662=parseJumpTargetDisplayName(_0xc00423[_0x1087ec(0x1b8)]['journeyName']);_0x218662&&(_0x2ea7e7=_0x218662[_0x1087ec(0x1ed)],_0x529079=_0x218662[_0x1087ec(0x1b2)]);}_0x35b735[_0x1087ec(0x1b8)]={'journey':_0x529079,'stage':_0x2ea7e7},_0xc00423['target'][_0x1087ec(0x1df)]&&(_0x35b735[_0x1087ec(0x1b8)][_0x1087ec(0x1dc)]=_0xc00423['target'][_0x1087ec(0x1df)]);}return _0x35b735;}function convertApiStepToYaml(_0x565c7a,_0x847130){const _0x481ba4=a147_0x2081;switch(_0x565c7a[_0x481ba4(0x1ce)]){case _0x481ba4(0x239):{const _0x4c9d81={};if(_0x565c7a[_0x481ba4(0x187)]==='Duration'&&_0x565c7a[_0x481ba4(0x1a9)]!==undefined)_0x4c9d81[_0x481ba4(0x216)]=_0x565c7a['waitStep'],_0x4c9d81[_0x481ba4(0x212)]=_0x565c7a[_0x481ba4(0x1bd)];else{if(_0x565c7a[_0x481ba4(0x187)]===_0x481ba4(0x1c2)&&_0x565c7a[_0x481ba4(0x196)])_0x4c9d81[_0x481ba4(0x231)]=_0x565c7a[_0x481ba4(0x196)];else{if(_0x565c7a[_0x481ba4(0x187)]==='DaysOfTheWeek'&&_0x565c7a[_0x481ba4(0x219)])_0x4c9d81[_0x481ba4(0x1ba)]=_0x565c7a['daysOfWeek'];else{if(_0x565c7a[_0x481ba4(0x187)]==='Condition'){if(_0x565c7a[_0x481ba4(0x22a)]&&_0x565c7a['conditions'][_0x481ba4(0x23d)]>0x0){const _0xd405cd=_0x565c7a[_0x481ba4(0x22a)][_0x481ba4(0x209)](_0x2da353=>!_0x2da353['timedOutPath']),_0x387ba8=_0x565c7a[_0x481ba4(0x22a)][_0x481ba4(0x209)](_0x6f4fc1=>_0x6f4fc1[_0x481ba4(0x18e)]);_0xd405cd?.[_0x481ba4(0x18c)]&&(_0x4c9d81['condition']={'segment':_0xd405cd[_0x481ba4(0x18c)],..._0xd405cd[_0x481ba4(0x237)]?{'next':_0xd405cd[_0x481ba4(0x237)]}:{}},_0x387ba8&&_0x387ba8['moveAfter']!==undefined&&_0x387ba8['unit']&&(_0x4c9d81[_0x481ba4(0x1fc)][_0x481ba4(0x1e6)]={'duration':_0x387ba8['moveAfter'],'unit':_0x387ba8[_0x481ba4(0x212)],..._0x387ba8['next']?{'next':_0x387ba8[_0x481ba4(0x237)]}:{}}));}else _0x565c7a[_0x481ba4(0x230)]&&(_0x4c9d81[_0x481ba4(0x1fc)]={'segment':_0x565c7a['conditionSegmentId']},_0x565c7a[_0x481ba4(0x1e1)]!==undefined&&_0x565c7a[_0x481ba4(0x20f)]&&(_0x4c9d81[_0x481ba4(0x1fc)]['timeout']={'duration':_0x565c7a[_0x481ba4(0x1e1)],'unit':_0x565c7a['conditionTimeoutUnit']}));}}}}const _0x2ea8cb={'type':'wait','name':_0x847130,..._0x565c7a[_0x481ba4(0x237)]?{'next':_0x565c7a[_0x481ba4(0x237)]}:{},'with':_0x4c9d81};return _0x2ea8cb;}case _0x481ba4(0x1dd):{const _0x202520={'type':_0x481ba4(0x1d1),'name':_0x847130,..._0x565c7a[_0x481ba4(0x237)]?{'next':_0x565c7a[_0x481ba4(0x237)]}:{},'with':{'activation':_0x565c7a['journeyActivationStepId']||''}};return _0x202520;}case _0x481ba4(0x1a5):{const _0x5a3e4e={'type':_0x481ba4(0x1ee),'name':_0x847130,..._0x565c7a[_0x481ba4(0x237)]?{'next':_0x565c7a[_0x481ba4(0x237)]}:{},'with':{'branches':(_0x565c7a[_0x481ba4(0x1f7)]||[])[_0x481ba4(0x218)](_0x163568=>({'name':_0x163568[_0x481ba4(0x200)],'segment':_0x163568[_0x481ba4(0x18c)],'excluded':_0x163568[_0x481ba4(0x1f9)],..._0x163568[_0x481ba4(0x237)]?{'next':_0x163568[_0x481ba4(0x237)]}:{}}))}};return _0x5a3e4e;}case _0x481ba4(0x194):case'AbTest':case _0x481ba4(0x204):{const _0x500ced=_0x565c7a[_0x481ba4(0x1f1)]||(_0x565c7a['branches']||[])['map'](_0x525e86=>({'name':_0x525e86[_0x481ba4(0x200)],'percentage':0x0,'next':_0x525e86[_0x481ba4(0x237)]})),_0x3a1c05={'type':_0x481ba4(0x21e),'name':_0x847130,..._0x565c7a['next']?{'next':_0x565c7a[_0x481ba4(0x237)]}:{},'with':{'customized_split':_0x565c7a['customizedSplit'],'unique_id':_0x565c7a[_0x481ba4(0x23e)],'variants':_0x500ced[_0x481ba4(0x218)](_0x3e2734=>({'name':_0x3e2734[_0x481ba4(0x200)],'percentage':_0x3e2734[_0x481ba4(0x21f)],..._0x3e2734['next']?{'next':_0x3e2734['next']}:{}}))}};return _0x3a1c05;}case _0x481ba4(0x193):{const _0x4c0893={'type':_0x481ba4(0x22f),'name':_0x847130,..._0x565c7a[_0x481ba4(0x237)]?{'next':_0x565c7a[_0x481ba4(0x237)]}:{}};return _0x4c0893;}case _0x481ba4(0x19c):{let _0x4e23ea='',_0x3e0387='',_0x6db78f;if(_0x565c7a['target']){_0x4e23ea=_0x565c7a[_0x481ba4(0x1b8)][_0x481ba4(0x1eb)],_0x3e0387=_0x565c7a[_0x481ba4(0x1b8)]['journeyStageId'],_0x6db78f=_0x565c7a[_0x481ba4(0x1b8)][_0x481ba4(0x1df)];if(_0x565c7a[_0x481ba4(0x1b8)][_0x481ba4(0x1b2)]){const _0x2e8027=parseJumpTargetDisplayName(_0x565c7a[_0x481ba4(0x1b8)]['journeyName']);_0x2e8027&&(_0x3e0387=_0x2e8027[_0x481ba4(0x1ed)],_0x4e23ea=_0x2e8027[_0x481ba4(0x1b2)]);}}const _0x4743c8={'type':_0x481ba4(0x1da),'name':_0x847130,..._0x565c7a[_0x481ba4(0x237)]?{'next':_0x565c7a[_0x481ba4(0x237)]}:{},'with':{'target':{'journey':_0x4e23ea,'stage':_0x3e0387,..._0x6db78f?{'bundle_id':_0x6db78f}:{}}}};return _0x4743c8;}case'End':{const _0x5a2994={'type':_0x481ba4(0x1a0),'name':_0x847130};return _0x5a2994;}default:{const _0x21264c={'type':'end','name':_0x847130};return _0x21264c;}}}export async function journeyDefToRequest(_0x294b3f,_0x299ff6,_0x3484d2){const _0x54012e=a147_0x2081,_0x484e66=_0x294b3f['stages']||getActiveStages(_0x294b3f),_0x2a5fd4=isJourneysArrayMode(_0x294b3f)||isMultiVersionMode(_0x294b3f)?getLatestJourneyEntry(_0x294b3f):undefined,_0x1987bd=_0x2a5fd4?.[_0x54012e(0x1e9)]??_0x294b3f[_0x54012e(0x200)],_0x43b464=_0x294b3f[_0x54012e(0x23b)]||{},_0x46fa44=_0x294b3f['activations']||{},_0x168b73={'type':_0x54012e(0x225),'attributes':{'name':_0x1987bd,'audienceId':_0x299ff6,'journeyStages':await Promise[_0x54012e(0x198)](_0x484e66[_0x54012e(0x218)](_0x4f8c58=>convertYamlStageToApi(_0x4f8c58,_0x3484d2,_0x43b464,_0x46fa44)))}},_0x566d20=_0x2a5fd4?.['id']??_0x294b3f['id'];_0x566d20&&(_0x168b73['id']=_0x566d20);_0x294b3f[_0x54012e(0x1cc)]&&(_0x168b73[_0x54012e(0x21b)][_0x54012e(0x1cc)]=_0x294b3f['description']);const _0x1e752f=getEffectiveGoal(_0x294b3f);_0x1e752f&&(_0x168b73[_0x54012e(0x21b)][_0x54012e(0x1b0)]=await convertYamlCriteriaToApi(_0x1e752f,_0x3484d2,_0x43b464));const _0x507051=getEffectiveReentry(_0x294b3f);return _0x507051&&(_0x168b73[_0x54012e(0x21b)][_0x54012e(0x203)]=_0x507051,_0x168b73[_0x54012e(0x21b)][_0x54012e(0x1c7)]=_0x507051!==_0x54012e(0x1bb)),_0x294b3f[_0x54012e(0x1c6)]&&(_0x168b73['relationships']={'parentFolder':{'data':{'id':_0x294b3f[_0x54012e(0x1c6)],'type':_0x54012e(0x20c)}}}),_0x168b73;}async function convertYamlStageToApi(_0x2a0374,_0x380b45,_0x2f6c60={},_0x2dcece={}){const _0xbdb60a=a147_0x2081,_0x125b5c={'name':_0x2a0374[_0xbdb60a(0x200)]};_0x2a0374['id']&&(_0x125b5c['id']=_0x2a0374['id']);_0x2a0374[_0xbdb60a(0x1cc)]&&(_0x125b5c[_0xbdb60a(0x1cc)]=_0x2a0374[_0xbdb60a(0x1cc)]);_0x2a0374['entry_criteria']&&(_0x125b5c[_0xbdb60a(0x207)]=await convertYamlCriteriaToApi(_0x2a0374['entry_criteria'],_0x380b45,_0x2f6c60));_0x2a0374['exit_criteria']&&_0x2a0374[_0xbdb60a(0x22e)][_0xbdb60a(0x23d)]>0x0&&(_0x125b5c[_0xbdb60a(0x1cb)]=await Promise['all'](_0x2a0374[_0xbdb60a(0x22e)][_0xbdb60a(0x218)](_0x57c950=>convertYamlCriteriaToApi(_0x57c950,_0x380b45,_0x2f6c60))));_0x2a0374[_0xbdb60a(0x1c4)]&&(_0x125b5c[_0xbdb60a(0x1c4)]=await convertYamlCriteriaToApi(_0x2a0374['milestone'],_0x380b45,_0x2f6c60));if(_0x2a0374[_0xbdb60a(0x1c8)]&&_0x2a0374[_0xbdb60a(0x1c8)]['length']>0x0){const _0x4a5663={},_0x1ac40f=_0x2a0374['steps'][_0xbdb60a(0x218)]((_0xce6b50,_0x230268)=>{const _0x92cef9=_0xbdb60a,_0x551f6d=_0xce6b50[_0x92cef9(0x1e7)]||generateUUID(),_0x15360e=_0xce6b50[_0x92cef9(0x200)]||_0xce6b50['type']+'_'+_0x230268;return _0x4a5663[_0x15360e]=_0x551f6d,{..._0xce6b50,'name':_0x15360e};});_0x125b5c[_0xbdb60a(0x210)]=_0x4a5663[_0x1ac40f[0x0][_0xbdb60a(0x200)]],_0x125b5c[_0xbdb60a(0x1c8)]={};for(let _0x1c801a=0x0;_0x1c801a<_0x1ac40f['length'];_0x1c801a++){const _0x2b3441=_0x1ac40f[_0x1c801a],_0x2fd068=_0x4a5663[_0x2b3441['name']],_0x1bae07=!_0x2b3441[_0xbdb60a(0x237)]&&_0x1c801a<_0x1ac40f[_0xbdb60a(0x23d)]-0x1&&_0x2b3441[_0xbdb60a(0x1ce)]!=='end'?_0x1ac40f[_0x1c801a+0x1][_0xbdb60a(0x200)]:_0x2b3441['next'],_0x53fec3=_0x1bae07!==_0x2b3441[_0xbdb60a(0x237)]?{..._0x2b3441,'next':_0x1bae07}:_0x2b3441;_0x125b5c[_0xbdb60a(0x1c8)][_0x2fd068]=await convertYamlStepToApi(_0x53fec3,_0x380b45,_0x2f6c60,_0x4a5663,_0x2dcece);}}else _0x2a0374[_0xbdb60a(0x199)]&&(_0x125b5c[_0xbdb60a(0x210)]=_0x2a0374[_0xbdb60a(0x199)]);return _0x125b5c;}async function convertYamlCriteriaToApi(_0x5cce78,_0x23d8bc,_0x275f3b={}){const _0x44ab32=a147_0x2081;let _0x544dfd=_0x5cce78['segment'];if(_0x544dfd&&!/^\d+$/[_0x44ab32(0x1fe)](_0x544dfd)){const _0x3d0d99=parseSegmentRef(_0x544dfd);if(_0x3d0d99[_0x44ab32(0x1ce)]===_0x44ab32(0x238))_0x23d8bc?.[_0x44ab32(0x189)]&&(_0x544dfd=await _0x23d8bc[_0x44ab32(0x189)](_0x3d0d99['name']));else{if(_0x3d0d99[_0x44ab32(0x1ce)]===_0x44ab32(0x1b7)&&_0x275f3b[_0x3d0d99['name']])_0x23d8bc?.[_0x44ab32(0x1d0)]&&(_0x544dfd=await _0x23d8bc[_0x44ab32(0x1d0)](_0x3d0d99['name'],_0x275f3b[_0x3d0d99[_0x44ab32(0x200)]]));else _0x23d8bc?.[_0x44ab32(0x189)]&&(_0x544dfd=await _0x23d8bc[_0x44ab32(0x189)](_0x3d0d99[_0x44ab32(0x200)]));}}const _0x382e9d={'name':_0x5cce78[_0x44ab32(0x200)],'segmentId':_0x544dfd};_0x5cce78['description']&&(_0x382e9d[_0x44ab32(0x1cc)]=_0x5cce78[_0x44ab32(0x1cc)]);if(_0x5cce78[_0x44ab32(0x1b8)]){const _0x51db2e=_0x5cce78[_0x44ab32(0x1b8)]['journey'],_0x3ccb77=_0x5cce78[_0x44ab32(0x1b8)][_0x44ab32(0x19b)];let _0x527485=_0x5cce78[_0x44ab32(0x1b8)][_0x44ab32(0x225)];_0x23d8bc?.['resolveJourneyId']&&!/^\d+$/[_0x44ab32(0x1fe)](_0x527485)&&(_0x527485=await _0x23d8bc[_0x44ab32(0x1d4)](_0x527485));let _0xa6c124=_0x5cce78[_0x44ab32(0x1b8)]['stage'];_0x23d8bc?.['resolveStageId']&&!/^\d+$/[_0x44ab32(0x1fe)](_0xa6c124)&&(_0xa6c124=await _0x23d8bc[_0x44ab32(0x235)](_0x527485,_0xa6c124));const _0x4bfd7d=!/^\d+$/[_0x44ab32(0x1fe)](_0x51db2e)&&!isLocalJourneyRef(_0x51db2e)?formatApiJourneyName(_0x51db2e,_0x3ccb77):undefined;_0x382e9d[_0x44ab32(0x1b8)]={'journeyId':_0x527485,'journeyStageId':_0xa6c124,'journeyName':_0x4bfd7d,'confirmed':!![]},_0x5cce78['target']['bundle_id']&&(_0x382e9d[_0x44ab32(0x1b8)][_0x44ab32(0x1df)]=_0x5cce78[_0x44ab32(0x1b8)]['bundle_id']);}return _0x382e9d;}async function convertYamlStepToApi(_0x266c68,_0x37a49f,_0x3a8d31={},_0x1724fa={},_0x455b6c={}){const _0x2a29bd=a147_0x2081,_0x49188b=async _0x5c15b9=>{const _0x719d93=a147_0x2081;if(/^\d+$/[_0x719d93(0x1fe)](_0x5c15b9))return _0x5c15b9;const _0x4090bd=parseSegmentRef(_0x5c15b9);if(_0x4090bd[_0x719d93(0x1ce)]===_0x719d93(0x238)){if(_0x37a49f?.['resolveSegmentId'])return await _0x37a49f[_0x719d93(0x189)](_0x4090bd[_0x719d93(0x200)]);}else{if(_0x4090bd['type']==='embedded'&&_0x3a8d31[_0x4090bd[_0x719d93(0x200)]]){if(_0x37a49f?.[_0x719d93(0x1d0)])return await _0x37a49f['resolveEmbeddedSegmentId'](_0x4090bd[_0x719d93(0x200)],_0x3a8d31[_0x4090bd[_0x719d93(0x200)]]);}else{if(_0x37a49f?.[_0x719d93(0x189)])return await _0x37a49f[_0x719d93(0x189)](_0x4090bd['name']);}}return _0x5c15b9;},_0x578ebb=async _0x4cc121=>{const _0x1ec9c4=a147_0x2081;if(/^\d+$/[_0x1ec9c4(0x1fe)](_0x4cc121))return _0x4cc121;const _0x34ea6d=parseSegmentRef(_0x4cc121);if(_0x34ea6d[_0x1ec9c4(0x1ce)]===_0x1ec9c4(0x238)){if(_0x37a49f?.[_0x1ec9c4(0x1de)])return await _0x37a49f['resolveActivationId'](_0x34ea6d[_0x1ec9c4(0x200)]);return _0x34ea6d[_0x1ec9c4(0x200)];}else{if(_0x34ea6d[_0x1ec9c4(0x1ce)]===_0x1ec9c4(0x1b7)&&_0x455b6c[_0x34ea6d[_0x1ec9c4(0x200)]]){if(_0x37a49f?.['resolveEmbeddedActivationId'])return await _0x37a49f[_0x1ec9c4(0x1ec)](_0x34ea6d[_0x1ec9c4(0x200)],_0x455b6c[_0x34ea6d['name']]);if(_0x37a49f?.['resolveActivationId'])return await _0x37a49f[_0x1ec9c4(0x1de)](_0x34ea6d['name']);}else{if(_0x37a49f?.[_0x1ec9c4(0x1de)])return await _0x37a49f['resolveActivationId'](_0x34ea6d[_0x1ec9c4(0x200)]);}}return _0x4cc121;},_0x812627=_0xf87871=>{if(!_0xf87871)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0xf87871))return _0xf87871;return _0x1724fa[_0xf87871]||_0xf87871;};switch(_0x266c68[_0x2a29bd(0x1ce)]){case _0x2a29bd(0x22b):{const _0x26dab4=_0x266c68,_0x15f3fe=_0x26dab4['with'],_0x37d484={'type':_0x2a29bd(0x239),'name':_0x26dab4[_0x2a29bd(0x200)],'next':_0x812627(_0x26dab4[_0x2a29bd(0x237)])};if(_0x15f3fe[_0x2a29bd(0x216)]!==undefined&&_0x15f3fe[_0x2a29bd(0x212)])_0x37d484[_0x2a29bd(0x187)]=_0x2a29bd(0x18b),_0x37d484[_0x2a29bd(0x1a9)]=_0x15f3fe[_0x2a29bd(0x216)],_0x37d484[_0x2a29bd(0x1bd)]=normalizeWaitUnit(_0x15f3fe['unit']);else{if(_0x15f3fe[_0x2a29bd(0x231)])_0x37d484[_0x2a29bd(0x187)]=_0x2a29bd(0x1c2),_0x37d484['waitUntilDate']=_0x15f3fe[_0x2a29bd(0x231)];else{if(_0x15f3fe[_0x2a29bd(0x1ba)])_0x37d484[_0x2a29bd(0x187)]=_0x2a29bd(0x1f3),_0x37d484[_0x2a29bd(0x219)]=_0x15f3fe['days_of_week'];else{if(_0x15f3fe[_0x2a29bd(0x1fc)]){_0x37d484['waitStepType']=_0x2a29bd(0x22c);const _0x275fa8=await _0x49188b(_0x15f3fe[_0x2a29bd(0x1fc)][_0x2a29bd(0x1c3)]),_0x1bb4d4=_0x15f3fe[_0x2a29bd(0x1fc)][_0x2a29bd(0x1e6)]?.[_0x2a29bd(0x237)]!==undefined;if(_0x1bb4d4){const _0x2c6f39=[];_0x2c6f39[_0x2a29bd(0x1cd)]({'id':generateUUID(),'segmentId':_0x275fa8,'timedOutPath':![],'name':_0x2a29bd(0x1d5),'next':_0x812627(_0x15f3fe[_0x2a29bd(0x1fc)]['next']??_0x26dab4[_0x2a29bd(0x237)])});if(_0x15f3fe['condition'][_0x2a29bd(0x1e6)]){const _0x8b8037=_0x15f3fe[_0x2a29bd(0x1fc)][_0x2a29bd(0x1e6)][_0x2a29bd(0x216)],_0x1c2206=normalizeWaitUnit(_0x15f3fe[_0x2a29bd(0x1fc)][_0x2a29bd(0x1e6)]['unit']);_0x2c6f39['push']({'id':generateUUID(),'timedOutPath':!![],'name':'*Max\x20wait\x20'+_0x8b8037+'\x20'+_0x1c2206,'moveAfter':_0x8b8037,'unit':_0x1c2206,'next':_0x812627(_0x15f3fe[_0x2a29bd(0x1fc)][_0x2a29bd(0x1e6)]['next'])});}_0x37d484[_0x2a29bd(0x22a)]=_0x2c6f39,delete _0x37d484[_0x2a29bd(0x237)];}else _0x37d484[_0x2a29bd(0x230)]=_0x275fa8,_0x15f3fe[_0x2a29bd(0x1fc)]['timeout']&&(_0x37d484[_0x2a29bd(0x1e1)]=_0x15f3fe[_0x2a29bd(0x1fc)]['timeout'][_0x2a29bd(0x216)],_0x15f3fe[_0x2a29bd(0x1fc)][_0x2a29bd(0x1e6)]['unit']&&(_0x37d484[_0x2a29bd(0x20f)]=normalizeWaitUnit(_0x15f3fe['condition'][_0x2a29bd(0x1e6)]['unit'])));}}}}return _0x37d484;}case _0x2a29bd(0x1d1):{const _0x16054a=_0x266c68,_0x11d951=_0x16054a['with'][_0x2a29bd(0x1d1)],_0x442282=await _0x578ebb(_0x11d951);return{'type':'Activation','name':_0x16054a[_0x2a29bd(0x200)],'journeyActivationStepId':_0x442282,'next':_0x812627(_0x16054a[_0x2a29bd(0x237)])};}case _0x2a29bd(0x1ee):{const _0x4e75e2=_0x266c68,_0xf4110a=_0x4e75e2[_0x2a29bd(0x240)][_0x2a29bd(0x1f7)];return{'type':_0x2a29bd(0x1a5),'name':_0x4e75e2[_0x2a29bd(0x200)],'branches':await Promise[_0x2a29bd(0x198)](_0xf4110a[_0x2a29bd(0x218)](async _0x5a7080=>{const _0x4a6a57=_0x2a29bd;let _0x54d216='';if(!_0x5a7080[_0x4a6a57(0x1ef)]){const _0x1e9ba4=_0x5a7080[_0x4a6a57(0x1c3)]||_0x5a7080['segment_id']||'';_0x54d216=_0x1e9ba4?await _0x49188b(_0x1e9ba4):'';}return{'id':crypto['randomUUID'](),'name':_0x5a7080[_0x4a6a57(0x200)],'description':null,'segmentId':_0x54d216,'excludedPath':_0x5a7080[_0x4a6a57(0x1ef)]??![],'next':_0x812627(_0x5a7080[_0x4a6a57(0x237)])};})),'next':_0x812627(_0x4e75e2[_0x2a29bd(0x237)])};}case _0x2a29bd(0x21e):{const _0x450150=_0x266c68,_0x250cdc=_0x450150[_0x2a29bd(0x240)];return{'type':_0x2a29bd(0x194),'name':_0x450150[_0x2a29bd(0x200)],'customizedSplit':_0x250cdc['customized_split'],'uniqueId':_0x250cdc['unique_id'],'variants':_0x250cdc[_0x2a29bd(0x1f1)]['map'](_0x19c83e=>({'id':_0x19c83e['id']||generateUUID(),'name':_0x19c83e['name'],'percentage':_0x19c83e['percentage'],'next':_0x812627(_0x19c83e['next'])})),'next':_0x812627(_0x450150['next'])};}case _0x2a29bd(0x22f):return{'type':_0x2a29bd(0x193),'name':_0x266c68[_0x2a29bd(0x200)],'next':_0x812627(_0x266c68[_0x2a29bd(0x237)])};case'jump':{const _0x5eefe3=_0x266c68,_0x22a5ff=_0x5eefe3['with']['target'],_0x333d55=_0x22a5ff[_0x2a29bd(0x225)],_0x4d8643=_0x22a5ff[_0x2a29bd(0x19b)];let _0x551154=_0x22a5ff[_0x2a29bd(0x225)];_0x37a49f?.[_0x2a29bd(0x1d4)]&&!/^\d+$/['test'](_0x551154)&&(_0x551154=await _0x37a49f['resolveJourneyId'](_0x551154));let _0x581a71=_0x22a5ff[_0x2a29bd(0x19b)];_0x37a49f?.[_0x2a29bd(0x235)]&&!/^\d+$/['test'](_0x581a71)&&(_0x581a71=await _0x37a49f[_0x2a29bd(0x235)](_0x551154,_0x581a71));const _0x1b5e30=!/^\d+$/['test'](_0x333d55)&&!isLocalJourneyRef(_0x333d55)?formatApiJourneyName(_0x333d55,_0x4d8643):undefined;return{'type':_0x2a29bd(0x19c),'name':_0x5eefe3[_0x2a29bd(0x200)],'target':{'journeyId':_0x551154,'journeyStageId':_0x581a71,'journeyBundleId':_0x22a5ff[_0x2a29bd(0x1dc)],'journeyName':_0x1b5e30,'confirmed':!![]},'next':_0x812627(_0x5eefe3[_0x2a29bd(0x237)])};}case _0x2a29bd(0x1a0):return{'type':_0x2a29bd(0x1b3),'name':_0x266c68[_0x2a29bd(0x200)]};default:{const _0x51ec8c=_0x266c68;return{'type':'End','name':_0x51ec8c[_0x2a29bd(0x200)]};}}}export function toYamlString(_0x229b11){const _0x40bab0=a147_0x2081,_0x478c27=stripInternalFields(_0x229b11),_0x42d039=a147_0x3683c9['stringify'](_0x478c27,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x40bab0(0x1e8)}),_0x4bc46b=[_0x40bab0(0x21d),_0x40bab0(0x20b),_0x40bab0(0x221),_0x40bab0(0x21a),'journeys:',_0x40bab0(0x208),_0x40bab0(0x241)];let _0x464abe=_0x42d039;for(const _0x26ab53 of _0x4bc46b){_0x464abe=_0x464abe[_0x40bab0(0x1e4)](new RegExp('^('+_0x26ab53+')','m'),(_0x4531be,_0x433f35,_0x95df0a)=>{if(_0x95df0a===0x0||_0x464abe[_0x95df0a-0x1]==='\x0a'&&_0x464abe[_0x95df0a-0x2]==='\x0a')return _0x433f35;return'\x0a'+_0x433f35;});}return _0x464abe;}function stripInternalFields(_0x350955){const _0x828f5b=a147_0x2081,{id:_0x22aa0a,folder_id:_0x580fbb,bundle_id:_0x4d0adb,bundle_name:_0x9e0a40,version:_0x5053de,allow_reentry:_0x790916,..._0x2b411a}=_0x350955;return _0x2b411a[_0x828f5b(0x234)]&&(_0x2b411a['journeys']=_0x2b411a[_0x828f5b(0x234)][_0x828f5b(0x218)](_0x1ee1df=>{const _0x2dc65b=_0x828f5b,{id:_0x37faef,..._0x3fc075}=_0x1ee1df;return{..._0x3fc075,'stages':_0x3fc075['stages'][_0x2dc65b(0x218)](stripStageInternalFields),..._0x1ee1df[_0x2dc65b(0x1f4)]===!![]?{'latest':!![]}:{},..._0x2b411a[_0x2dc65b(0x234)][_0x2dc65b(0x23d)]===0x1&&_0x3fc075[_0x2dc65b(0x1e9)]==='v1'?{'version':undefined}:{}};})),_0x2b411a[_0x828f5b(0x214)]&&(_0x2b411a[_0x828f5b(0x214)]=_0x2b411a[_0x828f5b(0x214)][_0x828f5b(0x218)](stripStageInternalFields)),_0x2b411a['versions']&&(_0x2b411a[_0x828f5b(0x1f8)]=_0x2b411a[_0x828f5b(0x1f8)][_0x828f5b(0x218)](_0x10cb7a=>{const _0x58222b=_0x828f5b,{id:_0x32386b,..._0x2d8867}=_0x10cb7a;return{..._0x2d8867,'stages':_0x2d8867['stages'][_0x58222b(0x218)](stripStageInternalFields),..._0x10cb7a['latest']===!![]?{'latest':!![]}:{}};})),_0x2b411a;}function stripStageInternalFields(_0x5e4286){const {id:_0x12b599,..._0x7f19bf}=_0x5e4286;return _0x7f19bf;}export function parseYamlString(_0x32e570){return safeParseYaml(_0x32e570,JourneyDefSchema);}export function isJourneyDef(_0x4ace58){const _0x4e5e5e=a147_0x2081;return typeof _0x4ace58===_0x4e5e5e(0x1c1)&&_0x4ace58!==null&&_0x4e5e5e(0x1ce)in _0x4ace58&&_0x4ace58[_0x4e5e5e(0x1ce)]==='journey';}export function generateTemplate(_0x46c756,_0x149f2c){const _0x4c944c=a147_0x2081,_0x315f0e={'type':'journey','name':_0x46c756,'description':_0x4c944c(0x232),'reentry':_0x4c944c(0x1bb),'goal':{'name':_0x4c944c(0x211),'segment':'goal-segment'},'stages':[{'name':'Stage\x201','description':_0x4c944c(0x188),'entry_criteria':{'name':'Entry\x20Criteria','segment':_0x149f2c},'steps':[{'type':_0x4c944c(0x22b),'name':_0x4c944c(0x1a6),'with':{'duration':0x1,'unit':_0x4c944c(0x23a)}},{'type':'activation','name':_0x4c944c(0x1b5),'with':{'activation':_0x4c944c(0x1ea)}},{'type':_0x4c944c(0x1a0),'name':_0x4c944c(0x23f)}]}]};return toYamlString(_0x315f0e);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x145b2b){const _0x2eb6e4=a147_0x2081;if(_0x145b2b['startsWith'](SEGMENT_REF_PREFIX))return{'type':_0x2eb6e4(0x238),'name':_0x145b2b[_0x2eb6e4(0x1fa)](SEGMENT_REF_PREFIX[_0x2eb6e4(0x23d)])};if(/^\d+$/[_0x2eb6e4(0x1fe)](_0x145b2b))return{'type':'id','name':_0x145b2b};return{'type':_0x2eb6e4(0x1b7),'name':_0x145b2b};}export function makeSegmentRef(_0x5e6ff1){return''+SEGMENT_REF_PREFIX+_0x5e6ff1;}export function isExternalSegmentRef(_0x11603d){const _0xbdbefb=a147_0x2081;return _0x11603d[_0xbdbefb(0x215)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x1c4b11){const _0x516580=a147_0x2081;return!!(_0x1c4b11[_0x516580(0x234)]&&_0x1c4b11[_0x516580(0x234)][_0x516580(0x23d)]>0x0);}export function isMultiVersionMode(_0x13a45c){const _0x3d6351=a147_0x2081;return!!(_0x13a45c[_0x3d6351(0x1f8)]&&_0x13a45c['versions'][_0x3d6351(0x23d)]>0x0);}export function isSingleVersionMode(_0x537688){const _0x2f6979=a147_0x2081;return!!(_0x537688[_0x2f6979(0x214)]&&_0x537688[_0x2f6979(0x214)][_0x2f6979(0x23d)]>0x0);}export function hasMultipleVersions(_0x3dff12){const _0x5402f1=a147_0x2081;if(isJourneysArrayMode(_0x3dff12))return(_0x3dff12['journeys']?.[_0x5402f1(0x23d)]||0x0)>0x1;if(isMultiVersionMode(_0x3dff12))return(_0x3dff12[_0x5402f1(0x1f8)]?.[_0x5402f1(0x23d)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x5c77a){const _0x503760=a147_0x2081;if(isJourneysArrayMode(_0x5c77a))return _0x5c77a;if(isSingleVersionMode(_0x5c77a)){const {stages:_0x2900b1,id:_0x9a2d34,version:_0x51c689,version_number:_0x56f88a,..._0x13f923}=_0x5c77a;return{..._0x13f923,'journeys':[{'version':_0x51c689||'v1','stages':_0x2900b1||[],'id':_0x9a2d34,'version_number':_0x56f88a}]};}if(isMultiVersionMode(_0x5c77a)){const {versions:_0x1050db,..._0x2c2158}=_0x5c77a;return{..._0x2c2158,'journeys':(_0x1050db||[])['map'](_0x180790=>({'version':_0x180790[_0x503760(0x200)],'state':_0x180790[_0x503760(0x1db)],'latest':_0x180790[_0x503760(0x1f4)],'stages':_0x180790[_0x503760(0x214)],'id':_0x180790['id'],'version_number':_0x180790['version_number']}))};}return _0x5c77a;}export function normalizeJourneyDef(_0x2b5be0,_0x2f2487){const _0x29e452=a147_0x2081,_0xaabe96=normalizeToJourneysFormat(_0x2b5be0),_0x1be20a=_0x2f2487?.[_0x29e452(0x23b)]?Object[_0x29e452(0x1ff)](_0x2f2487[_0x29e452(0x23b)]):undefined,_0x42cb80=_0x2f2487?.[_0x29e452(0x242)]?Object[_0x29e452(0x1ff)](_0x2f2487[_0x29e452(0x242)]):undefined;return{'type':_0x29e452(0x225),'name':_0xaabe96['name'],..._0xaabe96['description']!==undefined&&{'description':_0xaabe96[_0x29e452(0x1cc)]},..._0xaabe96[_0x29e452(0x1b0)]&&{'goal':normalizeJourneyCriteria(_0xaabe96[_0x29e452(0x1b0)])},..._0xaabe96[_0x29e452(0x18d)]!==undefined&&{'reentry':_0xaabe96['reentry']},..._0xaabe96[_0x29e452(0x23b)]&&{'segments':normalizeEmbeddedSegments(_0xaabe96[_0x29e452(0x23b)],_0x1be20a)},..._0xaabe96['activations']&&{'activations':normalizeEmbeddedActivations(_0xaabe96[_0x29e452(0x242)],_0x42cb80)},..._0xaabe96['journeys']&&{'journeys':_0xaabe96['journeys']['map'](_0x4f700b=>normalizeJourneyEntry(_0x4f700b,_0xaabe96[_0x29e452(0x234)][_0x29e452(0x23d)]===0x1))}};}function normalizeJourneyEntry(_0x25d01c,_0x5d16b9){const _0x4ae71c=a147_0x2081;return{...!_0x5d16b9&&_0x25d01c[_0x4ae71c(0x1e9)]!==undefined&&{'version':_0x25d01c[_0x4ae71c(0x1e9)]},..._0x25d01c[_0x4ae71c(0x1db)]!==undefined&&{'state':_0x25d01c['state']},...!_0x5d16b9&&_0x25d01c['latest']!==undefined&&{'latest':_0x25d01c['latest']},..._0x25d01c[_0x4ae71c(0x1d6)]!==undefined&&{'version_number':_0x25d01c[_0x4ae71c(0x1d6)]},..._0x25d01c[_0x4ae71c(0x1b0)]&&{'goal':normalizeJourneyCriteria(_0x25d01c[_0x4ae71c(0x1b0)])},..._0x25d01c['reentry']!==undefined&&{'reentry':_0x25d01c[_0x4ae71c(0x18d)]},'stages':_0x25d01c[_0x4ae71c(0x214)][_0x4ae71c(0x218)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x221bc4){const _0x381fc6=a147_0x2081;return{'name':_0x221bc4[_0x381fc6(0x200)],..._0x221bc4[_0x381fc6(0x1cc)]!==undefined&&{'description':_0x221bc4[_0x381fc6(0x1cc)]},..._0x221bc4[_0x381fc6(0x1f5)]&&{'entry_criteria':normalizeJourneyCriteria(_0x221bc4['entry_criteria'])},..._0x221bc4[_0x381fc6(0x22e)]&&{'exit_criteria':_0x221bc4[_0x381fc6(0x22e)][_0x381fc6(0x218)](normalizeJourneyCriteria)},..._0x221bc4[_0x381fc6(0x1c4)]&&{'milestone':normalizeJourneyCriteria(_0x221bc4[_0x381fc6(0x1c4)])},..._0x221bc4['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x221bc4[_0x381fc6(0x1c8)])}};}function normalizeStepsWithImplicitNext(_0x24d3c6){const _0x18c0fd=a147_0x2081;return _0x24d3c6[_0x18c0fd(0x218)]((_0x2a7afb,_0x302d92)=>{const _0x304cf6=_0x18c0fd,_0x5e2bd0=_0x302d92<_0x24d3c6['length']-0x1?_0x24d3c6[_0x302d92+0x1][_0x304cf6(0x200)]:undefined;return normalizeJourneyStep(_0x2a7afb,_0x5e2bd0);});}function normalizeJourneyCriteria(_0x5e764a){const _0x406122=a147_0x2081;return{'name':_0x5e764a[_0x406122(0x200)],..._0x5e764a[_0x406122(0x1cc)]!==undefined&&{'description':_0x5e764a[_0x406122(0x1cc)]},'segment':_0x5e764a[_0x406122(0x1c3)],..._0x5e764a[_0x406122(0x1b8)]&&{'target':normalizeJumpTarget(_0x5e764a[_0x406122(0x1b8)])}};}function normalizeJourneyStep(_0x43a281,_0x240cc2){const _0x5ca2ec=a147_0x2081,_0x5f2f2d=_0x43a281[_0x5ca2ec(0x237)]!==undefined&&_0x43a281[_0x5ca2ec(0x237)]!==_0x240cc2,_0x533448={'type':_0x43a281['type'],'name':_0x43a281[_0x5ca2ec(0x200)],..._0x5f2f2d&&{'next':_0x43a281[_0x5ca2ec(0x237)]}};if(_0x5ca2ec(0x240)in _0x43a281&&_0x43a281[_0x5ca2ec(0x240)])return{..._0x533448,'with':normalizeStepParams(_0x43a281['type'],_0x43a281[_0x5ca2ec(0x240)])};return _0x533448;}function normalizeStepParams(_0x3c8f33,_0x19adc2){const _0x55b9b2=a147_0x2081;switch(_0x3c8f33){case _0x55b9b2(0x22b):{const _0x3aec1c=_0x19adc2;let _0x572a4c;return _0x3aec1c[_0x55b9b2(0x1fc)]&&(_0x572a4c={'segment':_0x3aec1c[_0x55b9b2(0x1fc)][_0x55b9b2(0x1c3)],..._0x3aec1c[_0x55b9b2(0x1fc)][_0x55b9b2(0x237)]!==undefined&&{'next':_0x3aec1c[_0x55b9b2(0x1fc)][_0x55b9b2(0x237)]},..._0x3aec1c[_0x55b9b2(0x1fc)][_0x55b9b2(0x1e6)]&&{'timeout':{'duration':_0x3aec1c[_0x55b9b2(0x1fc)][_0x55b9b2(0x1e6)][_0x55b9b2(0x216)],'unit':_0x3aec1c[_0x55b9b2(0x1fc)][_0x55b9b2(0x1e6)][_0x55b9b2(0x212)],..._0x3aec1c[_0x55b9b2(0x1fc)][_0x55b9b2(0x1e6)][_0x55b9b2(0x237)]!==undefined&&{'next':_0x3aec1c['condition'][_0x55b9b2(0x1e6)]['next']}}}}),{..._0x3aec1c[_0x55b9b2(0x216)]!==undefined&&{'duration':_0x3aec1c[_0x55b9b2(0x216)]},..._0x3aec1c['unit']!==undefined&&{'unit':_0x3aec1c[_0x55b9b2(0x212)]},..._0x3aec1c[_0x55b9b2(0x231)]!==undefined&&{'wait_until':_0x3aec1c[_0x55b9b2(0x231)]},..._0x3aec1c['days_of_week']!==undefined&&{'days_of_week':_0x3aec1c[_0x55b9b2(0x1ba)]},..._0x572a4c&&{'condition':_0x572a4c}};}case _0x55b9b2(0x1d1):{const _0x380a3c=_0x19adc2;return{'activation':_0x380a3c[_0x55b9b2(0x1d1)]};}case _0x55b9b2(0x1ee):{const _0x112319=_0x19adc2;return{'branches':_0x112319[_0x55b9b2(0x1f7)][_0x55b9b2(0x218)](normalizeDecisionBranch)};}case _0x55b9b2(0x21e):{const _0x55fd29=_0x19adc2;return{..._0x55fd29[_0x55b9b2(0x20a)]!==undefined&&{'customized_split':_0x55fd29[_0x55b9b2(0x20a)]},..._0x55fd29[_0x55b9b2(0x236)]!==undefined&&{'unique_id':_0x55fd29[_0x55b9b2(0x236)]},'variants':_0x55fd29[_0x55b9b2(0x1f1)][_0x55b9b2(0x218)](normalizeAbTestVariant)};}case _0x55b9b2(0x1da):{const _0x2a7245=_0x19adc2;return{'target':normalizeJumpTarget(_0x2a7245['target'])};}default:return _0x19adc2;}}function normalizeDecisionBranch(_0x5b5889){const _0xc0102f=a147_0x2081;return{'name':_0x5b5889[_0xc0102f(0x200)],..._0x5b5889['segment']!==undefined&&{'segment':_0x5b5889[_0xc0102f(0x1c3)]},..._0x5b5889['excluded']!==undefined&&{'excluded':_0x5b5889['excluded']},..._0x5b5889[_0xc0102f(0x237)]!==undefined&&{'next':_0x5b5889['next']}};}function normalizeAbTestVariant(_0x3ad1e7){const _0x2e7d86=a147_0x2081;return{..._0x3ad1e7['id']!==undefined&&{'id':_0x3ad1e7['id']},'name':_0x3ad1e7[_0x2e7d86(0x200)],'percentage':_0x3ad1e7[_0x2e7d86(0x21f)],..._0x3ad1e7[_0x2e7d86(0x237)]!==undefined&&{'next':_0x3ad1e7['next']}};}function normalizeJumpTarget(_0x516a50){const _0x1f6e98=a147_0x2081;return{'journey':_0x516a50[_0x1f6e98(0x225)],'stage':_0x516a50[_0x1f6e98(0x19b)],..._0x516a50[_0x1f6e98(0x1dc)]!==undefined&&{'bundle_id':_0x516a50['bundle_id']}};}function normalizeEmbeddedSegments(_0x10f501,_0x5d4654){const _0x2cf25b=a147_0x2081,_0xed51d5={},_0x5d7c24=Object[_0x2cf25b(0x1ff)](_0x10f501),_0x4d297d=_0x5d4654?[..._0x5d4654[_0x2cf25b(0x1c9)](_0x440c3f=>_0x5d7c24['includes'](_0x440c3f)),..._0x5d7c24[_0x2cf25b(0x1c9)](_0x3b3d1a=>!_0x5d4654[_0x2cf25b(0x19f)](_0x3b3d1a))[_0x2cf25b(0x1ad)]()]:_0x5d7c24[_0x2cf25b(0x1ad)]();for(const _0x3b0a62 of _0x4d297d){const _0x11d253=_0x10f501[_0x3b0a62];if(_0x11d253[_0x2cf25b(0x222)]){const _0x305f38=_0x11d253[_0x2cf25b(0x222)];if(_0x305f38[_0x2cf25b(0x1ce)]!==_0x2cf25b(0x1e3)&&_0x305f38[_0x2cf25b(0x1ce)]!=='Or'){const _0x4f8ed3=_0x305f38[_0x2cf25b(0x1ce)]??_0x2cf25b(0x1c5);throw new SDKError(ErrorCode[_0x2cf25b(0x19a)],_0x2cf25b(0x205)+_0x3b0a62+_0x2cf25b(0x1e2)+(_0x2cf25b(0x1a7)+_0x4f8ed3+'\x27.\x0a')+_0x2cf25b(0x1a1)+_0x2cf25b(0x1ac)+_0x2cf25b(0x1a8)+_0x2cf25b(0x19d)+_0x2cf25b(0x1bc)+_0x2cf25b(0x1f2)+_0x2cf25b(0x21c));}if(!_0x305f38['conditions']||!Array['isArray'](_0x305f38['conditions']))throw new SDKError(ErrorCode[_0x2cf25b(0x19a)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x3b0a62+'\x27:\x20'+_0x2cf25b(0x244)+'Expected\x20format:\x0a'+'\x20\x20rule:\x0a'+('\x20\x20\x20\x20type:\x20'+_0x305f38[_0x2cf25b(0x1ce)]+'\x0a')+_0x2cf25b(0x19d)+_0x2cf25b(0x1bc)+_0x2cf25b(0x1f2)+_0x2cf25b(0x21c));}_0xed51d5[_0x3b0a62]={..._0x11d253[_0x2cf25b(0x1cc)]&&_0x11d253['description']['trim']()&&{'description':_0x11d253[_0x2cf25b(0x1cc)]},..._0x11d253[_0x2cf25b(0x222)]&&{'rule':deepSortObject(_0x11d253[_0x2cf25b(0x222)])}};}return _0xed51d5;}function normalizeEmbeddedActivations(_0x45669c,_0x1da621){const _0x520194=a147_0x2081,_0x35dd86={},_0x49df36=Object[_0x520194(0x1ff)](_0x45669c),_0x2796d9=_0x1da621?[..._0x1da621[_0x520194(0x1c9)](_0x356f8e=>_0x49df36[_0x520194(0x19f)](_0x356f8e)),..._0x49df36[_0x520194(0x1c9)](_0x5a9e66=>!_0x1da621[_0x520194(0x19f)](_0x5a9e66))[_0x520194(0x1ad)]()]:_0x49df36[_0x520194(0x1ad)]();for(const _0x7eed53 of _0x2796d9){const _0x1a9fb6=_0x45669c[_0x7eed53];_0x35dd86[_0x7eed53]={'name':_0x1a9fb6[_0x520194(0x200)],'connection':_0x1a9fb6[_0x520194(0x1bf)],..._0x1a9fb6['description']!==undefined&&{'description':_0x1a9fb6[_0x520194(0x1cc)]},..._0x1a9fb6[_0x520194(0x1ca)]!==undefined&&{'all_columns':_0x1a9fb6[_0x520194(0x1ca)]},..._0x1a9fb6[_0x520194(0x20d)]!==undefined&&{'columns':_0x1a9fb6['columns']},..._0x1a9fb6[_0x520194(0x201)]!==undefined&&{'behavior':_0x1a9fb6[_0x520194(0x201)]},..._0x1a9fb6['schedule']!==undefined&&{'schedule':_0x1a9fb6[_0x520194(0x206)]},..._0x1a9fb6[_0x520194(0x1fb)]!==undefined&&{'notification':_0x1a9fb6[_0x520194(0x1fb)]},..._0x1a9fb6['connector_config']!==undefined&&{'connector_config':_0x1a9fb6[_0x520194(0x1b6)]},..._0x1a9fb6[_0x520194(0x1c0)]!==undefined&&{'activation_template_id':_0x1a9fb6[_0x520194(0x1c0)]}};}return _0x35dd86;}export function getActiveStages(_0x5bc88e){const _0x138bac=a147_0x2081;if(isJourneysArrayMode(_0x5bc88e)){const _0x143d22=_0x5bc88e['journeys']||[],_0x5061cc=_0x143d22[_0x138bac(0x209)](_0x3b7887=>_0x3b7887[_0x138bac(0x1f4)]===!![])||_0x143d22[0x0];return _0x5061cc?.[_0x138bac(0x214)]||[];}if(isSingleVersionMode(_0x5bc88e))return _0x5bc88e[_0x138bac(0x214)]||[];if(isMultiVersionMode(_0x5bc88e)){const _0x59c8b0=_0x5bc88e[_0x138bac(0x1f8)]||[],_0x1674d8=_0x59c8b0[_0x138bac(0x209)](_0x5d2fe0=>_0x5d2fe0[_0x138bac(0x1f4)]===!![])||_0x59c8b0[0x0];return _0x1674d8?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x340578){const _0x3b5baa=a147_0x2081;if(isJourneysArrayMode(_0x340578)){const _0x13a4f0=_0x340578[_0x3b5baa(0x234)]||[];return _0x13a4f0[_0x3b5baa(0x209)](_0x85bed9=>_0x85bed9[_0x3b5baa(0x1f4)]===!![])||_0x13a4f0[0x0];}if(isMultiVersionMode(_0x340578)){const _0x2cfcbc=_0x340578['versions']||[],_0x3f3b3f=_0x2cfcbc[_0x3b5baa(0x209)](_0xbc3e78=>_0xbc3e78['latest']===!![])||_0x2cfcbc[0x0];if(_0x3f3b3f)return{'version':_0x3f3b3f['name'],'state':_0x3f3b3f[_0x3b5baa(0x1db)],'latest':_0x3f3b3f[_0x3b5baa(0x1f4)],'stages':_0x3f3b3f[_0x3b5baa(0x214)],'id':_0x3f3b3f['id'],'version_number':_0x3f3b3f[_0x3b5baa(0x1d6)]};}if(isSingleVersionMode(_0x340578))return{'version':_0x340578['version']||'v1','state':'draft','stages':_0x340578[_0x3b5baa(0x214)]||[],'id':_0x340578['id'],'version_number':_0x340578[_0x3b5baa(0x1d6)],'goal':_0x340578[_0x3b5baa(0x1b0)],'reentry':_0x340578[_0x3b5baa(0x18d)]};return undefined;}export function getLatestVersion(_0x570f74){const _0x386a6a=a147_0x2081;if(!isMultiVersionMode(_0x570f74))return undefined;const _0x2806ef=_0x570f74[_0x386a6a(0x1f8)]||[];return _0x2806ef['find'](_0x1c82bf=>_0x1c82bf['latest']===!![])||_0x2806ef[0x0];}export function getEffectiveGoal(_0x484241){const _0x4231d5=a147_0x2081,_0x527bde=getLatestJourneyEntry(_0x484241);return _0x527bde?.[_0x4231d5(0x1b0)]||_0x484241[_0x4231d5(0x1b0)];}export function getEffectiveReentry(_0x29e78b){const _0x56637a=a147_0x2081,_0x1e6304=getLatestJourneyEntry(_0x29e78b);return _0x1e6304?.[_0x56637a(0x18d)]||_0x29e78b[_0x56637a(0x18d)];}function a147_0x2a1c(){const _0x3d89bb=['Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','schedule','entryCriteria','stages:','find','customized_split','activations:','folder','columns','290074gGhuJk','conditionTimeoutUnit','rootStep','Goal\x20Achieved','unit','toLowerCase','stages','startsWith','duration','launched','map','daysOfWeek','reentry:','attributes','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','segments:','ab_test','percentage','7278561OqvVRA','goal:','rule','bundle_name','get','journey','journeyBundleName','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','4490859qWCSph','resolveSegmentName','conditions','wait','Condition','week','exit_criteria','merge','conditionSegmentId','wait_until','Journey\x20description','add','journeys','resolveStageId','unique_id','next','ref','WaitStep','day','segments','days','length','uniqueId','Stage\x20Complete','with','versions:','activations','isJourneyLocal','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','waitStepType','First\x20stage\x20of\x20the\x20journey','resolveSegmentId','1086uvONQo','Duration','segmentId','reentry','timedOutPath','40476RFUnTQ','set','entries','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','Merge','ABTest','12684htJTpv','waitUntilDate','3157yckBXy','all','root_step','JOURNEY_SYNTAX_ERROR','stage','Jump','\x20\x20\x20\x20conditions:\x0a','isArray','includes','end','Expected\x20format:\x0a','journeyStageId','reentry_always','9197890PQrTwL','DecisionPoint','Wait\x201\x20Day','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','\x20\x20\x20\x20type:\x20And\x0a','waitStep','match','8hOerNb','\x20\x20rule:\x0a','sort','versionNumber','stageId','goal','size','journeyName','End','1Fjxpyh','Send\x20Notification','connector_config','embedded','target','relationships','days_of_week','no_reentry','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','waitStepUnit','journeyStages','connection','activation_template_id','object','Date','segment','milestone','(missing)','folder_id','allowReentry','steps','filter','all_columns','exitCriterias','description','push','type','shift','resolveEmbeddedSegmentId','activation','data','from','resolveJourneyId','Met\x20condition(s)','version_number','resolveSegment','exitCriteria','635affmaM','jump','state','bundle_id','Activation','resolveActivationId','journeyBundleId','has','conditionTimeoutDuration','\x27:\x20','And','replace','values','timeout','uuid','null','version','your-activation-name','journeyId','resolveEmbeddedActivationId','stageName','decision_point','excluded','trim','variants','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','DaysOfTheWeek','latest','entry_criteria','definition','branches','versions','excludedPath','slice','notification','condition','parentFolder','test','keys','name','behavior','57169psivUq','reentryMode','Variant'];a147_0x2a1c=function(){return _0x3d89bb;};return a147_0x2a1c();}export function collectSegmentRefs(_0x130199){const _0x10caa1=a147_0x2081,_0x358674=new Set();_0x130199[_0x10caa1(0x1b0)]?.[_0x10caa1(0x1c3)]&&_0x358674[_0x10caa1(0x233)](_0x130199['goal'][_0x10caa1(0x1c3)]);const _0x133d6c=_0x2a5b98=>{const _0x236e9c=_0x10caa1;for(const _0x32b004 of _0x2a5b98){_0x32b004[_0x236e9c(0x1f5)]?.['segment']&&_0x358674[_0x236e9c(0x233)](_0x32b004[_0x236e9c(0x1f5)][_0x236e9c(0x1c3)]);if(_0x32b004[_0x236e9c(0x22e)])for(const _0x33ca03 of _0x32b004[_0x236e9c(0x22e)]){_0x33ca03[_0x236e9c(0x1c3)]&&_0x358674[_0x236e9c(0x233)](_0x33ca03['segment']);}_0x32b004[_0x236e9c(0x1c4)]?.[_0x236e9c(0x1c3)]&&_0x358674[_0x236e9c(0x233)](_0x32b004[_0x236e9c(0x1c4)]['segment']);if(_0x32b004[_0x236e9c(0x1c8)])for(const _0x2c7012 of _0x32b004[_0x236e9c(0x1c8)]){if(_0x2c7012[_0x236e9c(0x1ce)]==='decision_point'){const _0x2ec566=_0x2c7012;for(const _0x4ac304 of _0x2ec566[_0x236e9c(0x240)][_0x236e9c(0x1f7)]){_0x4ac304['segment']&&_0x358674[_0x236e9c(0x233)](_0x4ac304[_0x236e9c(0x1c3)]);}}else{if(_0x2c7012[_0x236e9c(0x1ce)]===_0x236e9c(0x22b)){const _0x2d928c=_0x2c7012;_0x2d928c['with'][_0x236e9c(0x1fc)]?.[_0x236e9c(0x1c3)]&&_0x358674[_0x236e9c(0x233)](_0x2d928c[_0x236e9c(0x240)][_0x236e9c(0x1fc)][_0x236e9c(0x1c3)]);}}}}};_0x130199[_0x10caa1(0x214)]&&_0x133d6c(_0x130199[_0x10caa1(0x214)]);if(_0x130199[_0x10caa1(0x1f8)])for(const _0x37a9bb of _0x130199['versions']){_0x133d6c(_0x37a9bb[_0x10caa1(0x214)]);}return _0x358674;}export function validateSegmentRefs(_0x41a578){const _0x488431=a147_0x2081,_0x5b7223=[],_0x20d749=collectSegmentRefs(_0x41a578),_0x1ca7b1=new Set(Object[_0x488431(0x1ff)](_0x41a578[_0x488431(0x23b)]||{}));for(const _0x241be2 of _0x20d749){const _0x996c95=parseSegmentRef(_0x241be2);_0x996c95['type']===_0x488431(0x1b7)&&!_0x1ca7b1[_0x488431(0x1e0)](_0x996c95['name'])&&_0x5b7223[_0x488431(0x1cd)]('Unknown\x20segment\x20\x22'+_0x996c95[_0x488431(0x200)]+_0x488431(0x192)+_0x996c95[_0x488431(0x200)]+_0x488431(0x227));}return _0x5b7223;}export function collectSegmentIdsFromJourneyApi(_0x1f8b76){const _0x143955=a147_0x2081,_0x57871c=new Set();_0x1f8b76[_0x143955(0x21b)]['goal']?.[_0x143955(0x18c)]&&_0x57871c[_0x143955(0x233)](_0x1f8b76[_0x143955(0x21b)][_0x143955(0x1b0)]['segmentId']);const _0x36ab51=_0x1f8b76[_0x143955(0x21b)][_0x143955(0x1be)];if(Array[_0x143955(0x19e)](_0x36ab51))for(const _0x1d5737 of _0x36ab51){_0x1d5737['entryCriteria']?.[_0x143955(0x18c)]&&_0x57871c[_0x143955(0x233)](_0x1d5737[_0x143955(0x207)][_0x143955(0x18c)]);const _0x26c9d5=_0x1d5737['exitCriterias']??_0x1d5737[_0x143955(0x1d8)];if(Array['isArray'](_0x26c9d5))for(const _0x294f55 of _0x26c9d5){_0x294f55[_0x143955(0x18c)]&&_0x57871c[_0x143955(0x233)](_0x294f55[_0x143955(0x18c)]);}_0x1d5737['milestone']?.[_0x143955(0x18c)]&&_0x57871c['add'](_0x1d5737[_0x143955(0x1c4)][_0x143955(0x18c)]);if(_0x1d5737[_0x143955(0x1c8)]&&typeof _0x1d5737['steps']===_0x143955(0x1c1)){const _0x2eb9ec=Array[_0x143955(0x19e)](_0x1d5737[_0x143955(0x1c8)])?_0x1d5737[_0x143955(0x1c8)]:Object[_0x143955(0x1e5)](_0x1d5737[_0x143955(0x1c8)]);for(const _0x2ba60a of _0x2eb9ec){_0x2ba60a['waitCondition']?.[_0x143955(0x18c)]&&_0x57871c[_0x143955(0x233)](_0x2ba60a['waitCondition']['segmentId']);const _0x224782=_0x2ba60a;_0x224782['conditionSegmentId']&&_0x57871c[_0x143955(0x233)](_0x224782[_0x143955(0x230)]);if(Array[_0x143955(0x19e)](_0x224782[_0x143955(0x22a)]))for(const _0xc2674c of _0x224782['conditions']){_0xc2674c['segmentId']&&_0x57871c[_0x143955(0x233)](_0xc2674c[_0x143955(0x18c)]);}if(Array[_0x143955(0x19e)](_0x2ba60a['branches']))for(const _0x4317f7 of _0x2ba60a[_0x143955(0x1f7)]){_0x4317f7[_0x143955(0x18c)]&&_0x57871c[_0x143955(0x233)](_0x4317f7[_0x143955(0x18c)]);}}}}return _0x57871c;}
@@ -1 +1 @@
1
- const a148_0x23f8e1=a148_0x2f2d;(function(_0x13cc03,_0x5c9ccb){const _0x433bdd=a148_0x2f2d,_0x135171=_0x13cc03();while(!![]){try{const _0x596e22=-parseInt(_0x433bdd(0x175))/0x1+parseInt(_0x433bdd(0x169))/0x2*(parseInt(_0x433bdd(0x14a))/0x3)+parseInt(_0x433bdd(0x159))/0x4*(-parseInt(_0x433bdd(0x162))/0x5)+parseInt(_0x433bdd(0x149))/0x6+parseInt(_0x433bdd(0x181))/0x7*(parseInt(_0x433bdd(0x151))/0x8)+parseInt(_0x433bdd(0x15c))/0x9+parseInt(_0x433bdd(0x14d))/0xa;if(_0x596e22===_0x5c9ccb)break;else _0x135171['push'](_0x135171['shift']());}catch(_0x1b7ff4){_0x135171['push'](_0x135171['shift']());}}}(a148_0x569b,0xc88fe));export const DEFAULT_TIME_RANGE=a148_0x23f8e1(0x16e);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x5917ab,_0x31ac03,_0x2fcabd){const _0x364c1e=a148_0x23f8e1,_0x5a83df=_0x2fcabd&&_0x2fcabd[_0x364c1e(0x154)]>0x0?_0x2fcabd[_0x364c1e(0x17b)](',\x20'):'*';return _0x364c1e(0x161)+_0x5a83df+'\x20FROM\x20'+_0x5917ab+'.'+_0x31ac03+_0x364c1e(0x14f);}export function generateMasterCountSQL(_0x4486e0){const _0x1ea1a6=a148_0x23f8e1,{database:_0xc1c007,table:_0x1de4ef}=_0x4486e0[_0x1ea1a6(0x155)];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0xc1c007+'.'+_0x1de4ef;}function a148_0x2f2d(_0x416d37,_0x4270ab){_0x416d37=_0x416d37-0x148;const _0x569bb5=a148_0x569b();let _0x2f2dec=_0x569bb5[_0x416d37];return _0x2f2dec;}export function generateMasterSampleSQL(_0x1d53f6,_0x436ba0=0x5){const _0x484255=a148_0x23f8e1,{database:_0x14f21c,table:_0x3fa627}=_0x1d53f6['master'];return _0x484255(0x15f)+_0x14f21c+'.'+_0x3fa627+_0x484255(0x172)+_0x436ba0;}export function generateAttributeCoverageSQL(_0xf810d7,_0x47fca3){const _0x3dae83=a148_0x23f8e1,_0x4da7e6=_0xf810d7[_0x3dae83(0x155)];return(_0x3dae83(0x173)+_0x4da7e6[_0x3dae83(0x14e)]+'.'+_0x4da7e6['table']+'\x20m\x0aLEFT\x20JOIN\x20'+_0x47fca3['source']['database']+'.'+_0x47fca3['source']['table']+_0x3dae83(0x16b)+_0x47fca3['join'][_0x3dae83(0x166)]+_0x3dae83(0x179)+_0x47fca3[_0x3dae83(0x17b)][_0x3dae83(0x14b)]+'\x0aWHERE\x20a.'+_0x47fca3['join']['child_key']+_0x3dae83(0x176))[_0x3dae83(0x150)]();}export function generateBehaviorStatsSQL(_0x510d7e,_0x559fe5,_0x3fbf4a=DEFAULT_TIME_RANGE){const _0x5a3037=a148_0x23f8e1,_0x2ca58f=_0x510d7e['master'];return(_0x5a3037(0x163)+_0x559fe5['join'][_0x5a3037(0x166)]+_0x5a3037(0x180)+_0x2ca58f[_0x5a3037(0x14e)]+'.'+_0x2ca58f[_0x5a3037(0x17f)]+'\x20m\x0aJOIN\x20'+_0x559fe5['source'][_0x5a3037(0x14e)]+'.'+_0x559fe5[_0x5a3037(0x148)][_0x5a3037(0x17f)]+_0x5a3037(0x174)+_0x559fe5[_0x5a3037(0x17b)][_0x5a3037(0x166)]+_0x5a3037(0x17a)+_0x559fe5[_0x5a3037(0x17b)][_0x5a3037(0x14b)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x3fbf4a+_0x5a3037(0x170))[_0x5a3037(0x150)]();}export function generateAttributeSampleSQL(_0x8eb255,_0x500b96,_0x493b4e=0x5){const _0x465d81=a148_0x23f8e1,_0x248f53=_0x8eb255[_0x465d81(0x155)],_0x419838=_0x500b96['join']['parent_key'],_0x26f812=_0x500b96[_0x465d81(0x171)][_0x465d81(0x167)](_0x1ce4b3=>'a.'+_0x1ce4b3['column'])['join'](',\x20');return(_0x465d81(0x177)+_0x419838+',\x20'+_0x26f812+_0x465d81(0x15b)+_0x248f53[_0x465d81(0x14e)]+'.'+_0x248f53[_0x465d81(0x17f)]+_0x465d81(0x16f)+_0x500b96[_0x465d81(0x148)][_0x465d81(0x14e)]+'.'+_0x500b96['source'][_0x465d81(0x17f)]+_0x465d81(0x16b)+_0x500b96[_0x465d81(0x17b)][_0x465d81(0x166)]+_0x465d81(0x179)+_0x500b96['join'][_0x465d81(0x14b)]+_0x465d81(0x158)+_0x493b4e+'\x0a')[_0x465d81(0x150)]();}export function generateBehaviorSampleSQL(_0x3c9416,_0x1b5651,_0x4d7f33=0x5,_0x4cb156=DEFAULT_TIME_RANGE){const _0xc57124=a148_0x23f8e1,_0x598769=_0x3c9416[_0xc57124(0x155)],_0x5660d5=_0x1b5651[_0xc57124(0x17b)][_0xc57124(0x166)];let _0x42a5f2;if(_0x1b5651[_0xc57124(0x156)])_0x42a5f2=_0xc57124(0x17d);else _0x1b5651[_0xc57124(0x171)]&&_0x1b5651[_0xc57124(0x171)]['length']>0x0?_0x42a5f2=_0x1b5651[_0xc57124(0x171)][_0xc57124(0x167)](_0x1d39d8=>'b.'+_0x1d39d8[_0xc57124(0x16d)])[_0xc57124(0x17b)](',\x20'):_0x42a5f2=_0xc57124(0x17d);return(_0xc57124(0x177)+_0x5660d5+',\x20'+_0x42a5f2+_0xc57124(0x15b)+_0x598769[_0xc57124(0x14e)]+'.'+_0x598769[_0xc57124(0x17f)]+_0xc57124(0x16f)+_0x1b5651[_0xc57124(0x148)][_0xc57124(0x14e)]+'.'+_0x1b5651[_0xc57124(0x148)][_0xc57124(0x17f)]+_0xc57124(0x174)+_0x1b5651[_0xc57124(0x17b)][_0xc57124(0x166)]+'\x20=\x20b.'+_0x1b5651[_0xc57124(0x17b)][_0xc57124(0x14b)]+_0xc57124(0x152)+_0x4cb156+'\x27)\x0aLIMIT\x20'+_0x4d7f33+'\x0a')[_0xc57124(0x150)]();}function quoteIdentifier(_0x142aa3){const _0x41d725=a148_0x23f8e1;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/['test'](_0x142aa3))return'\x22'+_0x142aa3[_0x41d725(0x17c)](/"/g,'\x22\x22')+'\x22';return _0x142aa3;}export function generateEnrichedSQL(_0x59efe4,_0xdbe4c4=0x5){const _0x519511=a148_0x23f8e1,_0x1fad56=_0x59efe4[_0x519511(0x155)],_0x110993=_0x59efe4[_0x519511(0x16c)]||[];if(_0x110993['length']===0x0)return _0x519511(0x15f)+_0x1fad56[_0x519511(0x14e)]+'.'+_0x1fad56['table']+_0x519511(0x172)+_0xdbe4c4;const _0x53bb1d=[_0x519511(0x16a)],_0x1021af=[];return _0x110993[_0x519511(0x164)]((_0x55aa6d,_0x350d00)=>{const _0x46bfd1=_0x519511,_0x33cc66='a'+_0x350d00;_0x55aa6d['columns'][_0x46bfd1(0x164)](_0x281fc4=>{const _0x40a95f=_0x46bfd1,_0x2ad2d2=quoteIdentifier(_0x281fc4['label']||_0x281fc4[_0x40a95f(0x16d)]);_0x53bb1d[_0x40a95f(0x160)](_0x33cc66+'.'+_0x281fc4['column']+'\x20AS\x20'+_0x2ad2d2);}),_0x1021af[_0x46bfd1(0x160)]('LEFT\x20JOIN\x20'+_0x55aa6d[_0x46bfd1(0x148)][_0x46bfd1(0x14e)]+'.'+_0x55aa6d[_0x46bfd1(0x148)][_0x46bfd1(0x17f)]+'\x20'+_0x33cc66+_0x46bfd1(0x15a)+_0x55aa6d[_0x46bfd1(0x17b)][_0x46bfd1(0x166)]+'\x20=\x20'+_0x33cc66+'.'+_0x55aa6d['join'][_0x46bfd1(0x14b)]);}),(_0x519511(0x14c)+_0x53bb1d[_0x519511(0x17b)](',\x20')+_0x519511(0x15b)+_0x1fad56[_0x519511(0x14e)]+'.'+_0x1fad56[_0x519511(0x17f)]+_0x519511(0x15d)+_0x1021af[_0x519511(0x17b)]('\x0a')+_0x519511(0x158)+_0xdbe4c4+'\x0a')[_0x519511(0x150)]();}export function generateAttributeSchemaSQL(_0x41556a,_0x27bbaf){const _0x215a34=a148_0x23f8e1,_0x52f523=_0x41556a[_0x215a34(0x155)],_0x499923=_0x27bbaf[_0x215a34(0x17b)][_0x215a34(0x166)],_0x45dbe6=_0x27bbaf[_0x215a34(0x171)][_0x215a34(0x167)](_0x369de9=>'a.'+_0x369de9[_0x215a34(0x16d)])[_0x215a34(0x17b)](',\x20');return('\x0aSELECT\x20m.'+_0x499923+',\x20'+_0x45dbe6+_0x215a34(0x15b)+_0x52f523[_0x215a34(0x14e)]+'.'+_0x52f523[_0x215a34(0x17f)]+_0x215a34(0x16f)+_0x27bbaf['source']['database']+'.'+_0x27bbaf[_0x215a34(0x148)][_0x215a34(0x17f)]+_0x215a34(0x16b)+_0x27bbaf[_0x215a34(0x17b)]['parent_key']+_0x215a34(0x179)+_0x27bbaf[_0x215a34(0x17b)][_0x215a34(0x14b)]+_0x215a34(0x178))[_0x215a34(0x150)]();}export function generateBehaviorSchemaSQL(_0x509723,_0x1a5b13){const _0xceec14=a148_0x23f8e1,_0x5e27d9=_0x509723[_0xceec14(0x155)],_0x1db0a4=_0x1a5b13[_0xceec14(0x17b)][_0xceec14(0x166)];let _0x477c31;if(_0x1a5b13[_0xceec14(0x156)])_0x477c31=_0xceec14(0x17d);else _0x1a5b13[_0xceec14(0x171)]&&_0x1a5b13[_0xceec14(0x171)][_0xceec14(0x154)]>0x0?_0x477c31=_0x1a5b13[_0xceec14(0x171)]['map'](_0x1ab966=>'b.'+_0x1ab966[_0xceec14(0x16d)])[_0xceec14(0x17b)](',\x20'):_0x477c31='b.*';return(_0xceec14(0x177)+_0x1db0a4+',\x20'+_0x477c31+_0xceec14(0x15b)+_0x5e27d9[_0xceec14(0x14e)]+'.'+_0x5e27d9[_0xceec14(0x17f)]+_0xceec14(0x16f)+_0x1a5b13[_0xceec14(0x148)]['database']+'.'+_0x1a5b13['source']['table']+_0xceec14(0x174)+_0x1a5b13['join'][_0xceec14(0x166)]+'\x20=\x20b.'+_0x1a5b13[_0xceec14(0x17b)]['child_key']+_0xceec14(0x178))[_0xceec14(0x150)]();}export function getAttributeColumns(_0x1f2165){const _0x4276d8=a148_0x23f8e1;return _0x1f2165[_0x4276d8(0x171)][_0x4276d8(0x167)](_0x4d5a36=>({'label':_0x4d5a36['label']||_0x4d5a36[_0x4276d8(0x16d)],'column':_0x4d5a36['column']}));}export function getBehaviorColumns(_0x1852bc){const _0x3ffb08=a148_0x23f8e1;if(_0x1852bc[_0x3ffb08(0x156)])return[{'label':_0x3ffb08(0x15e),'column':'*'}];if(_0x1852bc['columns']&&_0x1852bc['columns']['length']>0x0)return _0x1852bc['columns']['map'](_0x37b9ec=>({'label':_0x37b9ec[_0x3ffb08(0x165)]||_0x37b9ec[_0x3ffb08(0x16d)],'column':_0x37b9ec[_0x3ffb08(0x16d)]}));return[{'label':'(all\x20columns)','column':'*'}];}export function findAttributeByName(_0x3c67ba,_0x4f4491){const _0x1f4ecc=a148_0x23f8e1;return _0x3c67ba[_0x1f4ecc(0x16c)]?.[_0x1f4ecc(0x17e)](_0x23620b=>_0x23620b[_0x1f4ecc(0x153)][_0x1f4ecc(0x168)]()===_0x4f4491[_0x1f4ecc(0x168)]());}function a148_0x569b(){const _0x9e8027=['(all\x20columns)','SELECT\x20*\x20FROM\x20','push','SELECT\x20','30pqFzPb','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','forEach','label','parent_key','map','toLowerCase','2jXSKaO','m.*','\x20a\x0a\x20\x20ON\x20m.','attributes','column','-1d','\x20m\x0aJOIN\x20','\x27)\x0a','columns','\x20LIMIT\x20','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x20b\x0a\x20\x20ON\x20m.','740455XbUDnk','\x20IS\x20NOT\x20NULL\x0a','\x0aSELECT\x20m.','\x0aLIMIT\x200\x0a','\x20=\x20a.','\x20=\x20b.','join','replace','b.*','find','table',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','1774843POCDXW','source','8361696tnuMjI','2204190njPfZo','child_key','\x0aSELECT\x20','6752200tvnwXU','database','\x20LIMIT\x200','trim','8LugUuE','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','name','length','master','all_columns','behaviors','\x0aLIMIT\x20','1011268zdCygn','\x0a\x20\x20ON\x20m.','\x0aFROM\x20','195696FyoGEg','\x20m\x0a'];a148_0x569b=function(){return _0x9e8027;};return a148_0x569b();}export function findBehaviorByName(_0x56138e,_0x1808a0){const _0x31801a=a148_0x23f8e1;return _0x56138e[_0x31801a(0x157)]?.[_0x31801a(0x17e)](_0x1dfd07=>_0x1dfd07[_0x31801a(0x153)][_0x31801a(0x168)]()===_0x1808a0[_0x31801a(0x168)]());}
1
+ const a148_0x5686bc=a148_0x241a;(function(_0x299f51,_0x317eca){const _0x559be5=a148_0x241a,_0x2a9435=_0x299f51();while(!![]){try{const _0x1bb81c=-parseInt(_0x559be5(0x136))/0x1*(-parseInt(_0x559be5(0x14f))/0x2)+parseInt(_0x559be5(0x13b))/0x3*(parseInt(_0x559be5(0x140))/0x4)+-parseInt(_0x559be5(0x14e))/0x5*(parseInt(_0x559be5(0x16c))/0x6)+parseInt(_0x559be5(0x149))/0x7*(parseInt(_0x559be5(0x138))/0x8)+-parseInt(_0x559be5(0x151))/0x9+parseInt(_0x559be5(0x16d))/0xa+-parseInt(_0x559be5(0x146))/0xb;if(_0x1bb81c===_0x317eca)break;else _0x2a9435['push'](_0x2a9435['shift']());}catch(_0x2adb97){_0x2a9435['push'](_0x2a9435['shift']());}}}(a148_0x55c0,0x94624));export const DEFAULT_TIME_RANGE=a148_0x5686bc(0x16a);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x1c063a,_0x5240c7,_0x61e4cc){const _0x24da52=a148_0x5686bc,_0x133c32=_0x61e4cc&&_0x61e4cc[_0x24da52(0x165)]>0x0?_0x61e4cc[_0x24da52(0x15d)](',\x20'):'*';return'SELECT\x20'+_0x133c32+'\x20FROM\x20'+_0x1c063a+'.'+_0x5240c7+'\x20LIMIT\x200';}export function generateMasterCountSQL(_0xe5cfd3){const _0x54130f=a148_0x5686bc,{database:_0x4333aa,table:_0x50513b}=_0xe5cfd3[_0x54130f(0x145)];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0x4333aa+'.'+_0x50513b;}export function generateMasterSampleSQL(_0x195ea1,_0x48f13f=0x5){const _0x5c212c=a148_0x5686bc,{database:_0x5dd794,table:_0x54188b}=_0x195ea1[_0x5c212c(0x145)];return _0x5c212c(0x155)+_0x5dd794+'.'+_0x54188b+_0x5c212c(0x153)+_0x48f13f;}export function generateAttributeCoverageSQL(_0x3d40a7,_0x28cd87){const _0x3a110f=a148_0x5686bc,_0x4ec7d5=_0x3d40a7[_0x3a110f(0x145)];return(_0x3a110f(0x167)+_0x4ec7d5[_0x3a110f(0x135)]+'.'+_0x4ec7d5[_0x3a110f(0x15f)]+_0x3a110f(0x14a)+_0x28cd87[_0x3a110f(0x15e)][_0x3a110f(0x135)]+'.'+_0x28cd87[_0x3a110f(0x15e)][_0x3a110f(0x15f)]+_0x3a110f(0x163)+_0x28cd87['join'][_0x3a110f(0x156)]+_0x3a110f(0x154)+_0x28cd87['join'][_0x3a110f(0x166)]+_0x3a110f(0x16b)+_0x28cd87[_0x3a110f(0x15d)][_0x3a110f(0x166)]+'\x20IS\x20NOT\x20NULL\x0a')['trim']();}export function generateBehaviorStatsSQL(_0x3fe307,_0x32d1c3,_0x56014b=DEFAULT_TIME_RANGE){const _0x33c838=a148_0x5686bc,_0x892c6d=_0x3fe307[_0x33c838(0x145)];return(_0x33c838(0x14d)+_0x32d1c3['join']['parent_key']+_0x33c838(0x15a)+_0x892c6d[_0x33c838(0x135)]+'.'+_0x892c6d[_0x33c838(0x15f)]+_0x33c838(0x142)+_0x32d1c3['source'][_0x33c838(0x135)]+'.'+_0x32d1c3[_0x33c838(0x15e)][_0x33c838(0x15f)]+_0x33c838(0x164)+_0x32d1c3[_0x33c838(0x15d)][_0x33c838(0x156)]+_0x33c838(0x144)+_0x32d1c3[_0x33c838(0x15d)][_0x33c838(0x166)]+_0x33c838(0x13f)+_0x56014b+_0x33c838(0x160))['trim']();}export function generateAttributeSampleSQL(_0x571cd4,_0x3195cd,_0x188385=0x5){const _0x5c6c41=a148_0x5686bc,_0x17bded=_0x571cd4[_0x5c6c41(0x145)],_0x301069=_0x3195cd[_0x5c6c41(0x15d)][_0x5c6c41(0x156)],_0x172076=_0x3195cd['columns']['map'](_0x34247a=>'a.'+_0x34247a[_0x5c6c41(0x14c)])[_0x5c6c41(0x15d)](',\x20');return(_0x5c6c41(0x170)+_0x301069+',\x20'+_0x172076+'\x0aFROM\x20'+_0x17bded[_0x5c6c41(0x135)]+'.'+_0x17bded['table']+_0x5c6c41(0x142)+_0x3195cd[_0x5c6c41(0x15e)][_0x5c6c41(0x135)]+'.'+_0x3195cd[_0x5c6c41(0x15e)][_0x5c6c41(0x15f)]+_0x5c6c41(0x163)+_0x3195cd['join'][_0x5c6c41(0x156)]+_0x5c6c41(0x154)+_0x3195cd[_0x5c6c41(0x15d)][_0x5c6c41(0x166)]+'\x0aLIMIT\x20'+_0x188385+'\x0a')['trim']();}function a148_0x55c0(){const _0x37c40d=['\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x0aFROM\x20','forEach','-1d','\x0aWHERE\x20a.','30150ISfCrd','10950510xAYVdp','push','\x20m\x0a','\x0aSELECT\x20m.','replace','database','1528AjGfqB','behaviors','40nZGcTl','b.*','label','3GJTnIJ','find','name','m.*','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','878068VtqNqk','all_columns','\x20m\x0aJOIN\x20','\x20=\x20','\x20=\x20b.','master','16056887ZkaPvA','columns','(all\x20columns)','993881mycRGB','\x20m\x0aLEFT\x20JOIN\x20','\x27)\x0aLIMIT\x20','column','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','380xITUfw','604NEeXFR','\x20AS\x20','328878JbobBj','map','\x20LIMIT\x20','\x20=\x20a.','SELECT\x20*\x20FROM\x20','parent_key','\x0aSELECT\x20','\x0aLIMIT\x20','attributes',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','toLowerCase','\x0aLIMIT\x200\x0a','join','source','table','\x27)\x0a','trim','test','\x20a\x0a\x20\x20ON\x20m.','\x20b\x0a\x20\x20ON\x20m.','length','child_key'];a148_0x55c0=function(){return _0x37c40d;};return a148_0x55c0();}export function generateBehaviorSampleSQL(_0x176b5d,_0x35961f,_0x243b58=0x5,_0x58ab12=DEFAULT_TIME_RANGE){const _0x353bc5=a148_0x5686bc,_0x1d6900=_0x176b5d[_0x353bc5(0x145)],_0x3ac5bc=_0x35961f[_0x353bc5(0x15d)]['parent_key'];let _0x3404ff;if(_0x35961f[_0x353bc5(0x141)])_0x3404ff=_0x353bc5(0x139);else _0x35961f[_0x353bc5(0x147)]&&_0x35961f[_0x353bc5(0x147)][_0x353bc5(0x165)]>0x0?_0x3404ff=_0x35961f[_0x353bc5(0x147)]['map'](_0x1b28ed=>'b.'+_0x1b28ed[_0x353bc5(0x14c)])[_0x353bc5(0x15d)](',\x20'):_0x3404ff=_0x353bc5(0x139);return('\x0aSELECT\x20m.'+_0x3ac5bc+',\x20'+_0x3404ff+_0x353bc5(0x168)+_0x1d6900[_0x353bc5(0x135)]+'.'+_0x1d6900[_0x353bc5(0x15f)]+_0x353bc5(0x142)+_0x35961f[_0x353bc5(0x15e)]['database']+'.'+_0x35961f[_0x353bc5(0x15e)][_0x353bc5(0x15f)]+_0x353bc5(0x164)+_0x35961f[_0x353bc5(0x15d)][_0x353bc5(0x156)]+_0x353bc5(0x144)+_0x35961f['join'][_0x353bc5(0x166)]+_0x353bc5(0x13f)+_0x58ab12+_0x353bc5(0x14b)+_0x243b58+'\x0a')[_0x353bc5(0x161)]();}function quoteIdentifier(_0x13f8c3){const _0x4e1f47=a148_0x5686bc;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x4e1f47(0x162)](_0x13f8c3))return'\x22'+_0x13f8c3[_0x4e1f47(0x171)](/"/g,'\x22\x22')+'\x22';return _0x13f8c3;}export function generateEnrichedSQL(_0x38fe17,_0x581e89=0x5){const _0x3fa515=a148_0x5686bc,_0x55dfc5=_0x38fe17['master'],_0x10883e=_0x38fe17[_0x3fa515(0x159)]||[];if(_0x10883e[_0x3fa515(0x165)]===0x0)return _0x3fa515(0x155)+_0x55dfc5['database']+'.'+_0x55dfc5['table']+_0x3fa515(0x153)+_0x581e89;const _0x197259=[_0x3fa515(0x13e)],_0x3f7d60=[];return _0x10883e[_0x3fa515(0x169)]((_0xe331fb,_0x30c566)=>{const _0x42740d=_0x3fa515,_0x4e9a7e='a'+_0x30c566;_0xe331fb[_0x42740d(0x147)][_0x42740d(0x169)](_0x1af3c0=>{const _0x49f887=_0x42740d,_0x49f51f=quoteIdentifier(_0x1af3c0[_0x49f887(0x13a)]||_0x1af3c0[_0x49f887(0x14c)]);_0x197259[_0x49f887(0x16e)](_0x4e9a7e+'.'+_0x1af3c0['column']+_0x49f887(0x150)+_0x49f51f);}),_0x3f7d60[_0x42740d(0x16e)]('LEFT\x20JOIN\x20'+_0xe331fb['source'][_0x42740d(0x135)]+'.'+_0xe331fb[_0x42740d(0x15e)][_0x42740d(0x15f)]+'\x20'+_0x4e9a7e+'\x0a\x20\x20ON\x20m.'+_0xe331fb[_0x42740d(0x15d)]['parent_key']+_0x42740d(0x143)+_0x4e9a7e+'.'+_0xe331fb[_0x42740d(0x15d)][_0x42740d(0x166)]);}),(_0x3fa515(0x157)+_0x197259['join'](',\x20')+'\x0aFROM\x20'+_0x55dfc5['database']+'.'+_0x55dfc5['table']+_0x3fa515(0x16f)+_0x3f7d60[_0x3fa515(0x15d)]('\x0a')+_0x3fa515(0x158)+_0x581e89+'\x0a')[_0x3fa515(0x161)]();}export function generateAttributeSchemaSQL(_0x13e8da,_0x3a10a6){const _0x268b55=a148_0x5686bc,_0x27de74=_0x13e8da[_0x268b55(0x145)],_0x57b962=_0x3a10a6[_0x268b55(0x15d)][_0x268b55(0x156)],_0x1aba4b=_0x3a10a6[_0x268b55(0x147)]['map'](_0x370b54=>'a.'+_0x370b54[_0x268b55(0x14c)])['join'](',\x20');return('\x0aSELECT\x20m.'+_0x57b962+',\x20'+_0x1aba4b+_0x268b55(0x168)+_0x27de74[_0x268b55(0x135)]+'.'+_0x27de74[_0x268b55(0x15f)]+_0x268b55(0x142)+_0x3a10a6['source']['database']+'.'+_0x3a10a6[_0x268b55(0x15e)][_0x268b55(0x15f)]+_0x268b55(0x163)+_0x3a10a6[_0x268b55(0x15d)]['parent_key']+_0x268b55(0x154)+_0x3a10a6[_0x268b55(0x15d)][_0x268b55(0x166)]+_0x268b55(0x15c))[_0x268b55(0x161)]();}function a148_0x241a(_0x4d4d84,_0x13cd0c){_0x4d4d84=_0x4d4d84-0x135;const _0x55c09e=a148_0x55c0();let _0x241a18=_0x55c09e[_0x4d4d84];return _0x241a18;}export function generateBehaviorSchemaSQL(_0x5d4ad9,_0x3d17b2){const _0x914eb5=a148_0x5686bc,_0x48333d=_0x5d4ad9[_0x914eb5(0x145)],_0x3e9f0f=_0x3d17b2[_0x914eb5(0x15d)][_0x914eb5(0x156)];let _0x5bbf68;if(_0x3d17b2[_0x914eb5(0x141)])_0x5bbf68=_0x914eb5(0x139);else _0x3d17b2['columns']&&_0x3d17b2[_0x914eb5(0x147)][_0x914eb5(0x165)]>0x0?_0x5bbf68=_0x3d17b2[_0x914eb5(0x147)][_0x914eb5(0x152)](_0x544313=>'b.'+_0x544313['column'])[_0x914eb5(0x15d)](',\x20'):_0x5bbf68='b.*';return(_0x914eb5(0x170)+_0x3e9f0f+',\x20'+_0x5bbf68+'\x0aFROM\x20'+_0x48333d[_0x914eb5(0x135)]+'.'+_0x48333d[_0x914eb5(0x15f)]+_0x914eb5(0x142)+_0x3d17b2['source'][_0x914eb5(0x135)]+'.'+_0x3d17b2['source'][_0x914eb5(0x15f)]+_0x914eb5(0x164)+_0x3d17b2[_0x914eb5(0x15d)][_0x914eb5(0x156)]+'\x20=\x20b.'+_0x3d17b2[_0x914eb5(0x15d)][_0x914eb5(0x166)]+_0x914eb5(0x15c))[_0x914eb5(0x161)]();}export function getAttributeColumns(_0x118378){const _0x323bd7=a148_0x5686bc;return _0x118378[_0x323bd7(0x147)][_0x323bd7(0x152)](_0x104f3d=>({'label':_0x104f3d[_0x323bd7(0x13a)]||_0x104f3d['column'],'column':_0x104f3d['column']}));}export function getBehaviorColumns(_0x394aa5){const _0x132999=a148_0x5686bc;if(_0x394aa5[_0x132999(0x141)])return[{'label':_0x132999(0x148),'column':'*'}];if(_0x394aa5[_0x132999(0x147)]&&_0x394aa5[_0x132999(0x147)]['length']>0x0)return _0x394aa5[_0x132999(0x147)][_0x132999(0x152)](_0x2d19bb=>({'label':_0x2d19bb[_0x132999(0x13a)]||_0x2d19bb['column'],'column':_0x2d19bb['column']}));return[{'label':'(all\x20columns)','column':'*'}];}export function findAttributeByName(_0xb9890c,_0x1b3b9c){const _0x2be264=a148_0x5686bc;return _0xb9890c[_0x2be264(0x159)]?.[_0x2be264(0x13c)](_0xb7a06c=>_0xb7a06c[_0x2be264(0x13d)][_0x2be264(0x15b)]()===_0x1b3b9c[_0x2be264(0x15b)]());}export function findBehaviorByName(_0x51f07e,_0x1dcadc){const _0x2a4df0=a148_0x5686bc;return _0x51f07e[_0x2a4df0(0x137)]?.['find'](_0x264348=>_0x264348[_0x2a4df0(0x13d)][_0x2a4df0(0x15b)]()===_0x1dcadc[_0x2a4df0(0x15b)]());}