@treasuredata/tdx 2026.8.6 → 2026.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/codex-command.d.ts +2 -1
  19. package/dist/commands/codex-command.d.ts.map +1 -1
  20. package/dist/commands/codex-command.js +1 -1
  21. package/dist/commands/codex-command.js.map +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-campaign-pull-command.js +1 -1
  31. package/dist/commands/engage-campaign-push-command.js +1 -1
  32. package/dist/commands/engage-campaign-validate-command.js +1 -1
  33. package/dist/commands/engage-command.d.ts.map +1 -1
  34. package/dist/commands/engage-command.js +1 -1
  35. package/dist/commands/engage-command.js.map +1 -1
  36. package/dist/commands/engage-template-pull-command.js +1 -1
  37. package/dist/commands/engage-template-push-command.js +1 -1
  38. package/dist/commands/engage-template-validate-command.js +1 -1
  39. package/dist/commands/job-command.js +1 -1
  40. package/dist/commands/journey-command.js +1 -1
  41. package/dist/commands/journey-validate-command.js +1 -1
  42. package/dist/commands/llm-command.js +1 -1
  43. package/dist/commands/mcp-command.js +1 -1
  44. package/dist/commands/p13n-command.d.ts +16 -1
  45. package/dist/commands/p13n-command.d.ts.map +1 -1
  46. package/dist/commands/p13n-command.js +1 -1
  47. package/dist/commands/p13n-command.js.map +1 -1
  48. package/dist/commands/parent-segment-command.js +1 -1
  49. package/dist/commands/policy-command.js +1 -1
  50. package/dist/commands/profile-command.js +1 -1
  51. package/dist/commands/profiles-command.js +1 -1
  52. package/dist/commands/query-command.js +1 -1
  53. package/dist/commands/schedule-command.js +1 -1
  54. package/dist/commands/segment-command.js +1 -1
  55. package/dist/commands/segment-create-command.js +1 -1
  56. package/dist/commands/segment-fields-command.js +1 -1
  57. package/dist/commands/segment-move-command.js +1 -1
  58. package/dist/commands/segment-pull-command.js +1 -1
  59. package/dist/commands/segment-push-command.js +1 -1
  60. package/dist/commands/segment-update-command.js +1 -1
  61. package/dist/commands/segment-use-command.js +1 -1
  62. package/dist/commands/segment-validate-command.js +1 -1
  63. package/dist/commands/segments.js +1 -1
  64. package/dist/commands/show.js +1 -1
  65. package/dist/commands/status-command.js +1 -1
  66. package/dist/commands/table-deleted.js +1 -1
  67. package/dist/commands/tables.js +1 -1
  68. package/dist/commands/unset-command.d.ts +1 -0
  69. package/dist/commands/unset-command.d.ts.map +1 -1
  70. package/dist/commands/unset-command.js +1 -1
  71. package/dist/commands/unset-command.js.map +1 -1
  72. package/dist/commands/upgrade-command.js +1 -1
  73. package/dist/commands/use-command.d.ts +1 -0
  74. package/dist/commands/use-command.d.ts.map +1 -1
  75. package/dist/commands/use-command.js +1 -1
  76. package/dist/commands/use-command.js.map +1 -1
  77. package/dist/commands/user-command.js +1 -1
  78. package/dist/commands/work-command.js +1 -1
  79. package/dist/commands/workflow-command.js +1 -1
  80. package/dist/core/auth.js +1 -1
  81. package/dist/core/command-output.js +1 -1
  82. package/dist/core/config.js +1 -1
  83. package/dist/core/connection-cache.js +1 -1
  84. package/dist/core/constants.js +1 -1
  85. package/dist/core/credential-cache.js +1 -1
  86. package/dist/core/global-context.d.ts +1 -0
  87. package/dist/core/global-context.d.ts.map +1 -1
  88. package/dist/core/global-context.js +1 -1
  89. package/dist/core/global-context.js.map +1 -1
  90. package/dist/core/keychain.js +1 -1
  91. package/dist/core/oauth-keychain.js +1 -1
  92. package/dist/core/oauth.js +1 -1
  93. package/dist/core/profile.js +1 -1
  94. package/dist/core/project-config.js +1 -1
  95. package/dist/core/session.d.ts +2 -1
  96. package/dist/core/session.d.ts.map +1 -1
  97. package/dist/core/session.js +1 -1
  98. package/dist/core/session.js.map +1 -1
  99. package/dist/core/site-mismatch.js +1 -1
  100. package/dist/core/user-cache.js +1 -1
  101. package/dist/core/version.js +1 -1
  102. package/dist/index.js +1 -1
  103. package/dist/mcp/server.js +1 -1
  104. package/dist/mcp/tools/index.js +1 -1
  105. package/dist/mcp/tools/tdx-run.js +1 -1
  106. package/dist/mcp/tools/tdx-search.js +1 -1
  107. package/dist/mcp/tools/work-create-item.js +1 -1
  108. package/dist/mcp/utils.js +1 -1
  109. package/dist/proxy/claude-usage-tracker.js +1 -1
  110. package/dist/proxy/passthrough-server.js +1 -1
  111. package/dist/proxy/sse-usage-parser.js +1 -1
  112. package/dist/sdk/agent/agent-config.js +1 -1
  113. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  114. package/dist/sdk/agent/agent-yaml.js +1 -1
  115. package/dist/sdk/agent/test/evaluator.js +1 -1
  116. package/dist/sdk/agent/test/executor.js +1 -1
  117. package/dist/sdk/agent/test/index.js +1 -1
  118. package/dist/sdk/agent/test/output.js +1 -1
  119. package/dist/sdk/agent/test/parser.js +1 -1
  120. package/dist/sdk/agent/tool-target-registry.js +1 -1
  121. package/dist/sdk/api.js +1 -1
  122. package/dist/sdk/auth-token.js +1 -1
  123. package/dist/sdk/cas/cas-api-client.js +1 -1
  124. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  125. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  126. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  127. package/dist/sdk/cas/cas-segment-schema.js +1 -1
  128. package/dist/sdk/cas/cas-segment-validator.js +1 -1
  129. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  130. package/dist/sdk/cas/index.js +1 -1
  131. package/dist/sdk/cas/pull-workflow.js +1 -1
  132. package/dist/sdk/cas/push-workflow.js +1 -1
  133. package/dist/sdk/cas/validate-files.js +1 -1
  134. package/dist/sdk/client/cdp-api-client.js +1 -1
  135. package/dist/sdk/client/delivery-api-client.js +1 -1
  136. package/dist/sdk/client/endpoints.js +1 -1
  137. package/dist/sdk/client/engage-api-client.d.ts +10 -2
  138. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  139. package/dist/sdk/client/engage-api-client.js +1 -1
  140. package/dist/sdk/client/engage-api-client.js.map +1 -1
  141. package/dist/sdk/client/http-client.js +1 -1
  142. package/dist/sdk/client/llm-api-client.js +1 -1
  143. package/dist/sdk/client/oauth-refresh.js +1 -1
  144. package/dist/sdk/client/p13n-studio-api-client.d.ts +65 -1
  145. package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
  146. package/dist/sdk/client/p13n-studio-api-client.js +1 -1
  147. package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
  148. package/dist/sdk/client/rate-limiter.js +1 -1
  149. package/dist/sdk/client/td-api-client.js +1 -1
  150. package/dist/sdk/client/trino-api-client.js +1 -1
  151. package/dist/sdk/client/workflow-client.js +1 -1
  152. package/dist/sdk/connection-validator.js +1 -1
  153. package/dist/sdk/connection.js +1 -1
  154. package/dist/sdk/delivery.js +1 -1
  155. package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
  156. package/dist/sdk/engage/always-on-campaign-push.js +1 -1
  157. package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
  158. package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
  159. package/dist/sdk/engage/campaign-pull.js +1 -1
  160. package/dist/sdk/engage/campaign-push.js +1 -1
  161. package/dist/sdk/engage/campaign-validator.js +1 -1
  162. package/dist/sdk/engage/campaign-yaml.js +1 -1
  163. package/dist/sdk/engage/template-pull.js +1 -1
  164. package/dist/sdk/engage/template-push.js +1 -1
  165. package/dist/sdk/engage/template-validator.js +1 -1
  166. package/dist/sdk/engage/template-yaml.js +1 -1
  167. package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
  168. package/dist/sdk/engage/types/campaign-def.js +1 -1
  169. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  170. package/dist/sdk/engage/types/template-schema.js +1 -1
  171. package/dist/sdk/engage.d.ts +7 -2
  172. package/dist/sdk/engage.d.ts.map +1 -1
  173. package/dist/sdk/engage.js +1 -1
  174. package/dist/sdk/engage.js.map +1 -1
  175. package/dist/sdk/errors.js +1 -1
  176. package/dist/sdk/index.d.ts +5 -1
  177. package/dist/sdk/index.d.ts.map +1 -1
  178. package/dist/sdk/index.js +1 -1
  179. package/dist/sdk/index.js.map +1 -1
  180. package/dist/sdk/io/index.js +1 -1
  181. package/dist/sdk/io/node-filesystem.js +1 -1
  182. package/dist/sdk/job.js +1 -1
  183. package/dist/sdk/journey.js +1 -1
  184. package/dist/sdk/llm/chat-cache.js +1 -1
  185. package/dist/sdk/llm/index.js +1 -1
  186. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  187. package/dist/sdk/llm/model-factors.js +1 -1
  188. package/dist/sdk/llm/user-settings.js +1 -1
  189. package/dist/sdk/p13n-studio.d.ts +148 -1
  190. package/dist/sdk/p13n-studio.d.ts.map +1 -1
  191. package/dist/sdk/p13n-studio.js +1 -1
  192. package/dist/sdk/p13n-studio.js.map +1 -1
  193. package/dist/sdk/personalization.js +1 -1
  194. package/dist/sdk/policy.js +1 -1
  195. package/dist/sdk/query/deleted-table-validation.js +1 -1
  196. package/dist/sdk/query/index.js +1 -1
  197. package/dist/sdk/query/sql-parser.js +1 -1
  198. package/dist/sdk/realtime.js +1 -1
  199. package/dist/sdk/schedule.js +1 -1
  200. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  201. package/dist/sdk/segment/fields-display.js +1 -1
  202. package/dist/sdk/segment/file-discovery.js +1 -1
  203. package/dist/sdk/segment/journey-utils.js +1 -1
  204. package/dist/sdk/segment/journey-validator.js +1 -1
  205. package/dist/sdk/segment/journey-yaml.js +1 -1
  206. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  207. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  208. package/dist/sdk/segment/pull-workflow.js +1 -1
  209. package/dist/sdk/segment/push-recovery.js +1 -1
  210. package/dist/sdk/segment/push-workflow.js +1 -1
  211. package/dist/sdk/segment/resolution-context.js +1 -1
  212. package/dist/sdk/segment/segment-path-parser.js +1 -1
  213. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  214. package/dist/sdk/segment/segment-validator.js +1 -1
  215. package/dist/sdk/segment/target-resolution.js +1 -1
  216. package/dist/sdk/segment/tdx-config.js +1 -1
  217. package/dist/sdk/segment/types/activation-schema.js +1 -1
  218. package/dist/sdk/segment/types/journey-def.js +1 -1
  219. package/dist/sdk/segment/types/journey-schema.js +1 -1
  220. package/dist/sdk/segment/types/segment-def.js +1 -1
  221. package/dist/sdk/segment/types/segment-schema.js +1 -1
  222. package/dist/sdk/segment/validate-files.js +1 -1
  223. package/dist/sdk/segment/yaml-validator.js +1 -1
  224. package/dist/sdk/segment.js +1 -1
  225. package/dist/sdk/types/engage.d.ts +41 -0
  226. package/dist/sdk/types/engage.d.ts.map +1 -1
  227. package/dist/sdk/types/index.d.ts +3 -2
  228. package/dist/sdk/types/index.d.ts.map +1 -1
  229. package/dist/sdk/types/index.js +1 -1
  230. package/dist/sdk/types/index.js.map +1 -1
  231. package/dist/sdk/types/p13n-studio.d.ts +73 -0
  232. package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
  233. package/dist/sdk/types/progress.js +1 -1
  234. package/dist/sdk/types/workspace.js +1 -1
  235. package/dist/sdk/user.js +1 -1
  236. package/dist/sdk/util/format-detector.js +1 -1
  237. package/dist/sdk/util/formatters.js +1 -1
  238. package/dist/sdk/util/index.js +1 -1
  239. package/dist/sdk/util/paginate.js +1 -1
  240. package/dist/sdk/util/tree-formatter.js +1 -1
  241. package/dist/sdk/util/tree-search.js +1 -1
  242. package/dist/sdk/workflow/archive-validation.js +1 -1
  243. package/dist/sdk/workflow/clone-workflow.js +1 -1
  244. package/dist/sdk/workflow/index.js +1 -1
  245. package/dist/sdk/workflow/pull-workflow.js +1 -1
  246. package/dist/sdk/workflow/push-workflow.js +1 -1
  247. package/dist/sdk/workflow/task-graph.js +1 -1
  248. package/dist/sdk/workflow/tdx-config.js +1 -1
  249. package/dist/sdk/workflow/workflow-utils.js +1 -1
  250. package/dist/sdk/workspace/access-tracker.js +1 -1
  251. package/dist/sdk/workspace/frontmatter.js +1 -1
  252. package/dist/sdk/workspace/git.js +1 -1
  253. package/dist/sdk/workspace/index.js +1 -1
  254. package/dist/sdk/workspace/templates.js +1 -1
  255. package/dist/sdk/workspace/weekly.js +1 -1
  256. package/dist/sdk/workspace/wikilinks.js +1 -1
  257. package/dist/test-utils/command-runner.js +1 -1
  258. package/dist/test-utils/factories.js +1 -1
  259. package/dist/test-utils/fixtures.js +1 -1
  260. package/dist/test-utils/http-mock.js +1 -1
  261. package/dist/test-utils/index.js +1 -1
  262. package/dist/utils/async.js +1 -1
  263. package/dist/utils/claude-code-state.js +1 -1
  264. package/dist/utils/colors.js +1 -1
  265. package/dist/utils/diff.js +1 -1
  266. package/dist/utils/file-permissions.js +1 -1
  267. package/dist/utils/file-reader.js +1 -1
  268. package/dist/utils/github-releases.js +1 -1
  269. package/dist/utils/global-cache.js +1 -1
  270. package/dist/utils/json-loader.js +1 -1
  271. package/dist/utils/local-cache.js +1 -1
  272. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  273. package/dist/utils/logger/formatters/index.js +1 -1
  274. package/dist/utils/logger/handlers/console-handler.js +1 -1
  275. package/dist/utils/logger/handlers/file-handler.js +1 -1
  276. package/dist/utils/logger/handlers/index.js +1 -1
  277. package/dist/utils/logger/handlers/null-handler.js +1 -1
  278. package/dist/utils/logger/index.js +1 -1
  279. package/dist/utils/logger/logger.js +1 -1
  280. package/dist/utils/logger/types.js +1 -1
  281. package/dist/utils/option-validation.js +1 -1
  282. package/dist/utils/process.js +1 -1
  283. package/dist/utils/prompt.js +1 -1
  284. package/dist/utils/proxy-fetch.js +1 -1
  285. package/dist/utils/spinner.js +1 -1
  286. package/dist/utils/sse-parser.js +1 -1
  287. package/dist/utils/string-utils.js +1 -1
  288. package/dist/utils/table-ref-parser.js +1 -1
  289. package/dist/utils/tdx-logger.js +1 -1
  290. package/dist/utils/version-check.js +1 -1
  291. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x3d059c,_0x2e9cdb){const _0x1f2712=a169_0xc934,_0x57d4e5=_0x3d059c();while(!![]){try{const _0x306880=-parseInt(_0x1f2712(0x219))/0x1+-parseInt(_0x1f2712(0x19d))/0x2+parseInt(_0x1f2712(0x242))/0x3+-parseInt(_0x1f2712(0x1ea))/0x4*(parseInt(_0x1f2712(0x22e))/0x5)+parseInt(_0x1f2712(0x207))/0x6*(-parseInt(_0x1f2712(0x1e6))/0x7)+-parseInt(_0x1f2712(0x1b7))/0x8+parseInt(_0x1f2712(0x1fb))/0x9;if(_0x306880===_0x2e9cdb)break;else _0x57d4e5['push'](_0x57d4e5['shift']());}catch(_0x1dcff8){_0x57d4e5['push'](_0x57d4e5['shift']());}}}(a169_0x1581,0x30fa2));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0xef4f5c,_0x4f6ce2,_0x3248b7,_0x4c18e0,_0xe4eba1,_0x2c5583){const _0x5b7c92=a169_0xc934;return{'level':_0xef4f5c,'path':_0x4f6ce2,'code':_0x3248b7,'message':_0x4c18e0,'location':getLocationFromPath(_0xe4eba1['document'],_0xe4eba1[_0x5b7c92(0x221)],pathToArray(_0x2c5583??_0x4f6ce2))};}function validateVersionStructure(_0x4c20e7,_0x473089){const _0x1dc670=a169_0xc934,_0x253fd8=[];return _0x4c20e7['length']>MAX_STAGES&&_0x253fd8[_0x1dc670(0x1d4)](createIssue(_0x1dc670(0x1ff),_0x1dc670(0x1d7),_0x1dc670(0x21c),'Journey\x20has\x20'+_0x4c20e7[_0x1dc670(0x247)]+_0x1dc670(0x24b)+MAX_STAGES,_0x473089)),_0x253fd8;}function validateStageStructure(_0x1c9e1e,_0x2e0aae,_0x59d8e9,_0x57aecf){const _0x19cb1b=a169_0xc934,_0x7303ac=[],_0x172641=_0x19cb1b(0x1a4)+_0x2e0aae+']';_0x2e0aae===0x0&&!_0x1c9e1e[_0x19cb1b(0x1a3)]&&_0x7303ac['push'](createIssue(_0x19cb1b(0x1ff),_0x172641+_0x19cb1b(0x214),_0x19cb1b(0x1b1),_0x19cb1b(0x223)+_0x1c9e1e[_0x19cb1b(0x1be)]+_0x19cb1b(0x1ab),_0x57aecf,_0x172641));const _0x3aed23=_0x2e0aae===_0x59d8e9-0x1;!_0x3aed23&&!_0x1c9e1e[_0x19cb1b(0x1b2)]&&_0x7303ac[_0x19cb1b(0x1d4)](createIssue(_0x19cb1b(0x1ff),_0x172641+_0x19cb1b(0x23f),_0x19cb1b(0x240),_0x19cb1b(0x223)+_0x1c9e1e[_0x19cb1b(0x1be)]+_0x19cb1b(0x22b),_0x57aecf,_0x172641));(!_0x1c9e1e[_0x19cb1b(0x1f4)]||_0x1c9e1e[_0x19cb1b(0x1f4)]['length']===0x0)&&_0x7303ac[_0x19cb1b(0x1d4)](createIssue('warning',_0x172641+_0x19cb1b(0x1ee),'MISSING_EXIT_CRITERIA',_0x19cb1b(0x223)+_0x1c9e1e[_0x19cb1b(0x1be)]+_0x19cb1b(0x1ce),_0x57aecf,_0x172641));const _0x554fa7=_0x1c9e1e[_0x19cb1b(0x24c)]?.[_0x19cb1b(0x247)]??0x0;if(_0x554fa7===0x0)_0x7303ac['push'](createIssue('error',_0x172641+_0x19cb1b(0x19a),_0x19cb1b(0x1ed),_0x19cb1b(0x223)+_0x1c9e1e[_0x19cb1b(0x1be)]+_0x19cb1b(0x213),_0x57aecf,_0x172641+_0x19cb1b(0x19a)));else{if(_0x554fa7===0x1)_0x7303ac[_0x19cb1b(0x1d4)](createIssue('warning',_0x172641+_0x19cb1b(0x19a),_0x19cb1b(0x1ed),'Stage\x20\x27'+_0x1c9e1e['name']+_0x19cb1b(0x241),_0x57aecf,_0x172641+_0x19cb1b(0x19a)));else _0x554fa7<=0x3&&_0x7303ac[_0x19cb1b(0x1d4)](createIssue(_0x19cb1b(0x1c6),_0x172641+_0x19cb1b(0x19a),_0x19cb1b(0x1f9),_0x19cb1b(0x223)+_0x1c9e1e[_0x19cb1b(0x1be)]+_0x19cb1b(0x1f1)+_0x554fa7+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x57aecf,_0x172641+'.steps'));}return _0x7303ac;}function validateStep(_0x3c6c4d,_0x35dc91,_0x1bd8a4,_0x37fcd3){const _0x4268a6=a169_0xc934,_0x5a81dd=[];if(_0x3c6c4d[_0x4268a6(0x1cd)]==='end')return _0x3c6c4d[_0x4268a6(0x209)]&&_0x5a81dd[_0x4268a6(0x1d4)](createIssue('error',_0x35dc91+_0x4268a6(0x1a0),_0x4268a6(0x20e),_0x4268a6(0x244)+_0x3c6c4d[_0x4268a6(0x1be)]+_0x4268a6(0x1ef),_0x1bd8a4)),_0x4268a6(0x1fe)in _0x3c6c4d&&_0x3c6c4d[_0x4268a6(0x1fe)]!==undefined&&_0x5a81dd[_0x4268a6(0x1d4)](createIssue(_0x4268a6(0x1ff),_0x35dc91+'.with','END_STEP_HAS_NEXT_OR_WITH',_0x4268a6(0x244)+_0x3c6c4d['name']+_0x4268a6(0x1aa),_0x1bd8a4)),_0x5a81dd;_0x3c6c4d[_0x4268a6(0x209)]&&(_0x1bd8a4[_0x4268a6(0x1c1)]&&!_0x1bd8a4[_0x4268a6(0x1c1)][_0x4268a6(0x1e2)](_0x3c6c4d[_0x4268a6(0x209)])&&_0x5a81dd[_0x4268a6(0x1d4)](createIssue(_0x4268a6(0x1ff),_0x35dc91+'.next',_0x4268a6(0x1fc),'Step\x20references\x20non-existent\x20step\x20\x27'+_0x3c6c4d[_0x4268a6(0x209)]+'\x27',_0x1bd8a4)));switch(_0x3c6c4d[_0x4268a6(0x1cd)]){case _0x4268a6(0x232):_0x5a81dd[_0x4268a6(0x1d4)](...validateWaitStep(_0x3c6c4d,_0x35dc91,_0x1bd8a4,_0x37fcd3));break;case _0x4268a6(0x248):_0x5a81dd['push'](...validateActivationStep(_0x3c6c4d,_0x35dc91,_0x1bd8a4));break;case _0x4268a6(0x1fa):_0x5a81dd[_0x4268a6(0x1d4)](...validateDecisionPointStep(_0x3c6c4d,_0x35dc91,_0x1bd8a4,_0x37fcd3));break;case _0x4268a6(0x1f6):_0x5a81dd[_0x4268a6(0x1d4)](...validateAbTestStep(_0x3c6c4d,_0x35dc91,_0x1bd8a4,_0x37fcd3));break;case _0x4268a6(0x1c7):_0x5a81dd[_0x4268a6(0x1d4)](...validateJumpStep(_0x3c6c4d,_0x35dc91,_0x1bd8a4));break;}return _0x5a81dd;}function validateWaitStep(_0x1c82a1,_0x55694d,_0x1830d3,_0x2af386){const _0xecc898=a169_0xc934,_0xbd0456=[];if(!_0x1c82a1[_0xecc898(0x1fe)])return _0xbd0456[_0xecc898(0x1d4)](createIssue(_0xecc898(0x1ff),_0x55694d+_0xecc898(0x1b5),_0xecc898(0x1eb),_0xecc898(0x23b),_0x1830d3,_0x55694d)),_0xbd0456;if(_0x1c82a1[_0xecc898(0x1fe)][_0xecc898(0x1ec)]){const _0x155483=_0x1c82a1[_0xecc898(0x1fe)][_0xecc898(0x1ec)];if(_0x155483[_0xecc898(0x1bf)]){_0x1830d3['referencedSegments']?.[_0xecc898(0x1a2)](_0x155483[_0xecc898(0x1bf)]);!_0x155483[_0xecc898(0x1bf)]['startsWith']('ref:')&&(_0x1830d3[_0xecc898(0x218)]&&!_0x1830d3[_0xecc898(0x218)][_0xecc898(0x1e2)](_0x155483[_0xecc898(0x1bf)])&&_0xbd0456[_0xecc898(0x1d4)](createIssue(_0xecc898(0x1ff),_0x55694d+_0xecc898(0x204),'MISSING_SEGMENT_REFERENCE','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x155483['segment']+_0xecc898(0x21e),_0x1830d3)));_0x155483[_0xecc898(0x209)]&&_0x1830d3[_0xecc898(0x1c1)]&&!_0x1830d3[_0xecc898(0x1c1)][_0xecc898(0x1e2)](_0x155483['next'])&&_0xbd0456[_0xecc898(0x1d4)](createIssue(_0xecc898(0x1ff),_0x55694d+_0xecc898(0x1a9),_0xecc898(0x1fc),_0xecc898(0x216)+_0x155483[_0xecc898(0x209)]+'\x27',_0x1830d3));_0x155483['timeout']?.['next']&&_0x1830d3[_0xecc898(0x1c1)]&&!_0x1830d3[_0xecc898(0x1c1)][_0xecc898(0x1e2)](_0x155483[_0xecc898(0x20d)][_0xecc898(0x209)])&&_0xbd0456['push'](createIssue(_0xecc898(0x1ff),_0x55694d+_0xecc898(0x202),_0xecc898(0x1fc),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x155483[_0xecc898(0x20d)][_0xecc898(0x209)]+'\x27',_0x1830d3));const _0x41e9ef=_0x155483[_0xecc898(0x209)]||_0x1c82a1[_0xecc898(0x209)],_0x2990ea=_0x155483[_0xecc898(0x20d)]?.[_0xecc898(0x209)]||_0x1c82a1[_0xecc898(0x209)];if(_0x41e9ef){const _0x3f2c48=_0x2af386[_0xecc898(0x1db)](_0x41e9ef);_0x3f2c48?.[_0xecc898(0x1cd)]===_0xecc898(0x1a7)&&_0xbd0456[_0xecc898(0x1d4)](createIssue(_0xecc898(0x1c6),_0x55694d+'.with.condition.next','BRANCH_DIRECTLY_TO_MERGE',_0xecc898(0x20a)+_0x41e9ef+_0xecc898(0x1f8),_0x1830d3,_0x55694d+_0xecc898(0x225)));}if(_0x2990ea){const _0x14fece=_0x2af386[_0xecc898(0x1db)](_0x2990ea);_0x14fece?.['type']===_0xecc898(0x1a7)&&_0xbd0456[_0xecc898(0x1d4)](createIssue(_0xecc898(0x1c6),_0x55694d+'.with.condition.timeout.next',_0xecc898(0x1b4),_0xecc898(0x1e3)+_0x2990ea+_0xecc898(0x1f8),_0x1830d3,_0x55694d+_0xecc898(0x1ae)));}}}return _0xbd0456;}function validateActivationStep(_0x5841e1,_0x3ca9a7,_0x479464){const _0x20279a=a169_0xc934,_0x2d4d4c=[];if(!_0x5841e1['with']?.[_0x20279a(0x248)])return _0x2d4d4c[_0x20279a(0x1d4)](createIssue(_0x20279a(0x1ff),_0x3ca9a7+_0x20279a(0x24a),_0x20279a(0x1f7),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x479464,_0x3ca9a7)),_0x2d4d4c;const _0xbe5bdf=_0x5841e1[_0x20279a(0x1fe)][_0x20279a(0x248)];return _0x479464['activationKeys']&&!_0xbe5bdf[_0x20279a(0x1bb)](_0x20279a(0x217))&&(!_0x479464[_0x20279a(0x227)][_0x20279a(0x1e2)](_0xbe5bdf)&&_0x2d4d4c['push'](createIssue('error',_0x3ca9a7+_0x20279a(0x24a),'MISSING_ACTIVATION_DEFINITION','Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0xbe5bdf+_0x20279a(0x21b),_0x479464))),_0x2d4d4c;}function validateDecisionPointStep(_0x49d938,_0x371008,_0x21b96b,_0x1cbeb5){const _0x3bf561=a169_0xc934,_0x4239b5=[];if(!_0x49d938[_0x3bf561(0x1fe)]?.[_0x3bf561(0x23e)]||_0x49d938[_0x3bf561(0x1fe)]['branches'][_0x3bf561(0x247)]===0x0)return _0x4239b5[_0x3bf561(0x1d4)](createIssue(_0x3bf561(0x1ff),_0x371008+_0x3bf561(0x1d0),_0x3bf561(0x249),_0x3bf561(0x1cf),_0x21b96b,_0x371008)),_0x4239b5;for(let _0x232df4=0x0;_0x232df4<_0x49d938[_0x3bf561(0x1fe)]['branches']['length'];_0x232df4++){const _0x5e2357=_0x49d938[_0x3bf561(0x1fe)][_0x3bf561(0x23e)][_0x232df4],_0x4b684b=_0x371008+_0x3bf561(0x19f)+_0x232df4+']';_0x5e2357[_0x3bf561(0x1bf)]&&!_0x5e2357[_0x3bf561(0x1a6)]&&(_0x21b96b['referencedSegments']?.[_0x3bf561(0x1a2)](_0x5e2357[_0x3bf561(0x1bf)]),!_0x5e2357[_0x3bf561(0x1bf)][_0x3bf561(0x1bb)](_0x3bf561(0x217))&&(_0x21b96b[_0x3bf561(0x218)]&&!_0x21b96b[_0x3bf561(0x218)][_0x3bf561(0x1e2)](_0x5e2357[_0x3bf561(0x1bf)])&&_0x4239b5[_0x3bf561(0x1d4)](createIssue('error',_0x4b684b+_0x3bf561(0x206),'MISSING_SEGMENT_REFERENCE','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x5e2357[_0x3bf561(0x1bf)]+'\x27',_0x21b96b))));_0x5e2357[_0x3bf561(0x209)]&&_0x21b96b[_0x3bf561(0x1c1)]&&!_0x21b96b[_0x3bf561(0x1c1)][_0x3bf561(0x1e2)](_0x5e2357[_0x3bf561(0x209)])&&_0x4239b5[_0x3bf561(0x1d4)](createIssue('error',_0x4b684b+_0x3bf561(0x1a0),'INVALID_NEXT_REFERENCE','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x5e2357[_0x3bf561(0x209)]+'\x27',_0x21b96b));if(_0x5e2357['next']){const _0x2d74b2=_0x1cbeb5[_0x3bf561(0x1db)](_0x5e2357[_0x3bf561(0x209)]);_0x2d74b2?.[_0x3bf561(0x1cd)]===_0x3bf561(0x1a7)&&_0x4239b5['push'](createIssue(_0x3bf561(0x1c6),_0x4b684b+_0x3bf561(0x1a0),_0x3bf561(0x1b4),_0x3bf561(0x230)+_0x5e2357['name']+_0x3bf561(0x1de)+_0x5e2357['next']+_0x3bf561(0x201),_0x21b96b));}}return _0x4239b5;}function validateAbTestStep(_0x5c3cdc,_0x9cda35,_0x27ca83,_0x3563a6){const _0x4f8eb2=a169_0xc934,_0x43c50f=[];if(!_0x5c3cdc[_0x4f8eb2(0x1fe)]?.['variants']||_0x5c3cdc['with'][_0x4f8eb2(0x208)][_0x4f8eb2(0x247)]===0x0)return _0x43c50f[_0x4f8eb2(0x1d4)](createIssue(_0x4f8eb2(0x1ff),_0x9cda35+_0x4f8eb2(0x22c),_0x4f8eb2(0x249),_0x4f8eb2(0x222),_0x27ca83,_0x9cda35)),_0x43c50f;const _0x8b0956=_0x5c3cdc[_0x4f8eb2(0x1fe)]['variants'][_0x4f8eb2(0x1af)]((_0x59f6a9,_0x14cb3f)=>_0x59f6a9+(_0x14cb3f[_0x4f8eb2(0x1d9)]||0x0),0x0);Math[_0x4f8eb2(0x24e)](_0x8b0956-0x64)>0.01&&_0x43c50f[_0x4f8eb2(0x1d4)](createIssue(_0x4f8eb2(0x1ff),_0x9cda35+_0x4f8eb2(0x22c),'INVALID_AB_TEST_PERCENTAGES',_0x4f8eb2(0x1c5)+_0x8b0956+'%)',_0x27ca83));for(let _0x619fc1=0x0;_0x619fc1<_0x5c3cdc[_0x4f8eb2(0x1fe)][_0x4f8eb2(0x208)]['length'];_0x619fc1++){const _0x2cab57=_0x5c3cdc[_0x4f8eb2(0x1fe)][_0x4f8eb2(0x208)][_0x619fc1],_0x2dbdae=_0x9cda35+_0x4f8eb2(0x224)+_0x619fc1+']';_0x2cab57[_0x4f8eb2(0x209)]&&_0x27ca83[_0x4f8eb2(0x1c1)]&&!_0x27ca83[_0x4f8eb2(0x1c1)]['has'](_0x2cab57[_0x4f8eb2(0x209)])&&_0x43c50f['push'](createIssue(_0x4f8eb2(0x1ff),_0x2dbdae+_0x4f8eb2(0x1a0),_0x4f8eb2(0x1fc),_0x4f8eb2(0x1dd)+_0x2cab57[_0x4f8eb2(0x209)]+'\x27',_0x27ca83));if(_0x2cab57[_0x4f8eb2(0x209)]){const _0x2fc431=_0x3563a6[_0x4f8eb2(0x1db)](_0x2cab57[_0x4f8eb2(0x209)]);_0x2fc431?.['type']===_0x4f8eb2(0x1a7)&&_0x43c50f['push'](createIssue(_0x4f8eb2(0x1c6),_0x2dbdae+_0x4f8eb2(0x1a0),_0x4f8eb2(0x1b4),_0x4f8eb2(0x220)+_0x2cab57['name']+_0x4f8eb2(0x1de)+_0x2cab57['next']+_0x4f8eb2(0x201),_0x27ca83));}}return _0x43c50f;}function validateJumpStep(_0x407850,_0x2e0bca,_0x3071c6){const _0x302659=a169_0xc934,_0x130cbc=[];if(!_0x407850['with']?.[_0x302659(0x1d5)])return _0x130cbc[_0x302659(0x1d4)](createIssue('error',_0x2e0bca+_0x302659(0x1d1),_0x302659(0x243),_0x302659(0x231),_0x3071c6,_0x2e0bca)),_0x130cbc;return(!_0x407850[_0x302659(0x1fe)][_0x302659(0x1d5)][_0x302659(0x1f2)]||!_0x407850['with'][_0x302659(0x1d5)][_0x302659(0x212)])&&_0x130cbc[_0x302659(0x1d4)](createIssue(_0x302659(0x1ff),_0x2e0bca+_0x302659(0x1d1),'INVALID_JUMP_TARGET',_0x302659(0x210),_0x3071c6)),_0x130cbc;}function buildConvergenceMap(_0x293c79){const _0x204d5c=a169_0xc934,_0x27c87b=new Map();function _0x3dae89(_0x14c253,_0x2ac623){const _0x45bb35=a169_0xc934,_0x2cc1b1=_0x27c87b[_0x45bb35(0x1db)](_0x14c253)||[];_0x2cc1b1['push'](_0x2ac623),_0x27c87b[_0x45bb35(0x1a1)](_0x14c253,_0x2cc1b1);}for(const _0xe72c35 of _0x293c79){_0xe72c35[_0x204d5c(0x209)]&&_0x3dae89(_0xe72c35['next'],{'stepName':_0xe72c35[_0x204d5c(0x1be)],'description':'step\x20\x27'+_0xe72c35[_0x204d5c(0x1be)]+'\x27'});if(_0xe72c35['type']===_0x204d5c(0x1fa)&&_0xe72c35[_0x204d5c(0x1fe)]?.[_0x204d5c(0x23e)])for(const _0x503943 of _0xe72c35[_0x204d5c(0x1fe)]['branches']){_0x503943[_0x204d5c(0x209)]&&_0x3dae89(_0x503943[_0x204d5c(0x209)],{'stepName':_0xe72c35[_0x204d5c(0x1be)],'description':_0x204d5c(0x1d6)+_0x503943['name']+_0x204d5c(0x24d)+_0xe72c35['name']+'\x27'});}if(_0xe72c35[_0x204d5c(0x1cd)]==='ab_test'&&_0xe72c35['with']?.[_0x204d5c(0x208)])for(const _0x43563c of _0xe72c35[_0x204d5c(0x1fe)][_0x204d5c(0x208)]){_0x43563c[_0x204d5c(0x209)]&&_0x3dae89(_0x43563c[_0x204d5c(0x209)],{'stepName':_0xe72c35['name'],'description':_0x204d5c(0x236)+_0x43563c[_0x204d5c(0x1be)]+_0x204d5c(0x24d)+_0xe72c35[_0x204d5c(0x1be)]+'\x27'});}_0xe72c35[_0x204d5c(0x1cd)]===_0x204d5c(0x232)&&_0xe72c35[_0x204d5c(0x1fe)]?.[_0x204d5c(0x1ec)]&&(_0xe72c35[_0x204d5c(0x1fe)]['condition'][_0x204d5c(0x209)]&&_0x3dae89(_0xe72c35[_0x204d5c(0x1fe)][_0x204d5c(0x1ec)][_0x204d5c(0x209)],{'stepName':_0xe72c35['name'],'description':_0x204d5c(0x229)+_0xe72c35[_0x204d5c(0x1be)]+'\x27'}),_0xe72c35[_0x204d5c(0x1fe)][_0x204d5c(0x1ec)][_0x204d5c(0x20d)]?.[_0x204d5c(0x209)]&&_0x3dae89(_0xe72c35[_0x204d5c(0x1fe)][_0x204d5c(0x1ec)][_0x204d5c(0x20d)][_0x204d5c(0x209)],{'stepName':_0xe72c35['name'],'description':_0x204d5c(0x1ac)+_0xe72c35['name']+'\x27'}));}return _0x27c87b;}function validateFlowControl(_0x5e8cdc,_0x175b5d,_0x329331){const _0x11d1b9=a169_0xc934,_0xd9d579=[],_0x155893=_0x11d1b9(0x1a4)+_0x175b5d+']',_0x46caee=_0x5e8cdc[_0x11d1b9(0x24c)]||[];if(_0x46caee[_0x11d1b9(0x247)]===0x0)return _0xd9d579;const _0x475b07=new Map();for(const _0x2ec8b4 of _0x46caee){_0x2ec8b4[_0x11d1b9(0x1be)]&&_0x475b07[_0x11d1b9(0x1a1)](_0x2ec8b4[_0x11d1b9(0x1be)],_0x2ec8b4);}const _0x34727d=buildConvergenceMap(_0x46caee),_0x37aea1=_0x46caee[_0x11d1b9(0x20f)](_0x5fdcd1=>_0x5fdcd1[_0x11d1b9(0x1cd)]==='end');!_0x37aea1&&_0xd9d579[_0x11d1b9(0x1d4)](createIssue(_0x11d1b9(0x1ff),_0x155893+_0x11d1b9(0x19a),_0x11d1b9(0x1b0),_0x11d1b9(0x223)+_0x5e8cdc[_0x11d1b9(0x1be)]+'\x27\x20has\x20no\x20end\x20step',_0x329331));for(const [_0x5c63b8,_0x4a4043]of _0x34727d){const _0x5bea37=_0x475b07[_0x11d1b9(0x1db)](_0x5c63b8);if(!_0x5bea37)continue;if(_0x4a4043[_0x11d1b9(0x247)]>0x1&&_0x5bea37['type']!==_0x11d1b9(0x1a7)){const _0x55c20a=_0x4a4043[_0x11d1b9(0x1b9)](_0x74549a=>_0x74549a[_0x11d1b9(0x21d)])['join'](',\x20');_0xd9d579[_0x11d1b9(0x1d4)](createIssue('error',_0x155893+_0x11d1b9(0x19a),'CONVERGENCE_WITHOUT_MERGE','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x5c63b8+_0x11d1b9(0x1e0)+_0x55c20a+_0x11d1b9(0x1d2),_0x329331));}_0x4a4043[_0x11d1b9(0x247)]===0x1&&_0x5bea37[_0x11d1b9(0x1cd)]==='merge'&&_0xd9d579[_0x11d1b9(0x1d4)](createIssue(_0x11d1b9(0x1c6),_0x155893+'.steps',_0x11d1b9(0x246),_0x11d1b9(0x1c4)+_0x5c63b8+_0x11d1b9(0x1da)+_0x4a4043[0x0]['description']+_0x11d1b9(0x21a),_0x329331));}for(const _0x1efa13 of _0x46caee){if(_0x1efa13[_0x11d1b9(0x1cd)]===_0x11d1b9(0x1a7)&&_0x1efa13[_0x11d1b9(0x209)]){const _0x3b994e=_0x475b07[_0x11d1b9(0x1db)](_0x1efa13[_0x11d1b9(0x209)]);_0x3b994e?.[_0x11d1b9(0x1cd)]===_0x11d1b9(0x1a7)&&_0xd9d579[_0x11d1b9(0x1d4)](createIssue('error',_0x155893+_0x11d1b9(0x19a),_0x11d1b9(0x24f),_0x11d1b9(0x1c4)+_0x1efa13['name']+_0x11d1b9(0x23d)+_0x1efa13[_0x11d1b9(0x209)]+_0x11d1b9(0x1f5),_0x329331));}}return _0xd9d579;}function validateCriteria(_0x33080b,_0x1148f4,_0x29a380){const _0x5ed5ac=a169_0xc934,_0x722d2d=[];return _0x33080b[_0x5ed5ac(0x1bf)]&&(_0x29a380[_0x5ed5ac(0x1e9)]?.[_0x5ed5ac(0x1a2)](_0x33080b['segment']),!_0x33080b[_0x5ed5ac(0x1bf)][_0x5ed5ac(0x1bb)]('ref:')&&(_0x29a380[_0x5ed5ac(0x218)]&&!_0x29a380[_0x5ed5ac(0x218)]['has'](_0x33080b['segment'])&&_0x722d2d['push'](createIssue(_0x5ed5ac(0x1ff),_0x1148f4+_0x5ed5ac(0x206),_0x5ed5ac(0x22f),_0x5ed5ac(0x1b8)+_0x33080b[_0x5ed5ac(0x1bf)]+'\x27',_0x29a380)))),_0x722d2d;}function validateEmbeddedSegment(_0x418262,_0x1edce8,_0x4b0590){const _0x193d46=a169_0xc934,_0x557fe2=[];return _0x418262[_0x193d46(0x1ad)]&&_0x557fe2[_0x193d46(0x1d4)](...validateRuleDef(_0x418262[_0x193d46(0x1ad)],_0x1edce8+_0x193d46(0x22d),_0x4b0590)),_0x557fe2;}function validateStage(_0x10ebba,_0x1caf16,_0x5cad32,_0x4f57fe){const _0x7b4537=a169_0xc934,_0x30c9b3=[],_0x31cc1f=_0x7b4537(0x1a4)+_0x1caf16+']',_0xfb6c12=new Map(),_0x14a84a=new Map();if(_0x10ebba['steps']){for(let _0x51ce90=0x0;_0x51ce90<_0x10ebba[_0x7b4537(0x24c)][_0x7b4537(0x247)];_0x51ce90++){const _0x4d25a0=_0x10ebba[_0x7b4537(0x24c)][_0x51ce90];_0x4d25a0[_0x7b4537(0x1be)]&&_0xfb6c12['set'](_0x4d25a0[_0x7b4537(0x1be)],_0x4d25a0);}for(let _0x5e8691=0x0;_0x5e8691<_0x10ebba[_0x7b4537(0x24c)][_0x7b4537(0x247)];_0x5e8691++){const _0x2e9321=_0x10ebba['steps'][_0x5e8691],_0xcb3691=_0x31cc1f+_0x7b4537(0x20b)+_0x5e8691+']';if(_0x2e9321[_0x7b4537(0x1be)]){if(_0x14a84a[_0x7b4537(0x1e2)](_0x2e9321[_0x7b4537(0x1be)])){const _0x17ba1c=_0x14a84a[_0x7b4537(0x1db)](_0x2e9321[_0x7b4537(0x1be)]);_0x30c9b3[_0x7b4537(0x1d4)](createIssue(_0x7b4537(0x1ff),_0xcb3691+'.name',_0x7b4537(0x1bc),'Duplicate\x20step\x20name\x20\x27'+_0x2e9321[_0x7b4537(0x1be)]+_0x7b4537(0x1c8)+_0x17ba1c+'])',_0x4f57fe));}else _0x14a84a['set'](_0x2e9321[_0x7b4537(0x1be)],_0x5e8691);}_0x30c9b3['push'](...validateStep(_0x2e9321,_0xcb3691,_0x4f57fe,_0xfb6c12));}}_0x10ebba[_0x7b4537(0x1a3)]&&_0x30c9b3[_0x7b4537(0x1d4)](...validateCriteria(_0x10ebba[_0x7b4537(0x1a3)],_0x31cc1f+_0x7b4537(0x214),_0x4f57fe));if(_0x10ebba[_0x7b4537(0x1f4)])for(let _0x670c7=0x0;_0x670c7<_0x10ebba['exit_criteria'][_0x7b4537(0x247)];_0x670c7++){_0x30c9b3[_0x7b4537(0x1d4)](...validateCriteria(_0x10ebba[_0x7b4537(0x1f4)][_0x670c7],_0x31cc1f+_0x7b4537(0x1b3)+_0x670c7+']',_0x4f57fe));}return _0x10ebba[_0x7b4537(0x1b2)]&&_0x30c9b3[_0x7b4537(0x1d4)](...validateCriteria(_0x10ebba[_0x7b4537(0x1b2)],_0x31cc1f+_0x7b4537(0x23f),_0x4f57fe)),_0x30c9b3[_0x7b4537(0x1d4)](...validateStageStructure(_0x10ebba,_0x1caf16,_0x5cad32,_0x4f57fe)),_0x30c9b3[_0x7b4537(0x1d4)](...validateFlowControl(_0x10ebba,_0x1caf16,_0x4f57fe)),_0x30c9b3;}function validateStagesForVersion(_0x1083cf,_0x6c0dec,_0x324314,_0x418f78,_0x1c4d52,_0x23a01a,_0x1664cf){const _0x31d044=a169_0xc934;if(_0x1083cf[_0x31d044(0x247)]===0x0){_0x1c4d52['push']({'level':'error','path':_0x418f78+_0x31d044(0x1d7),'code':_0x31d044(0x226),'message':_0x31d044(0x1bd),'location':getLocationFromPath(_0x324314['document'],_0x324314[_0x31d044(0x221)],[_0x31d044(0x1d7)])});return;}const _0x4087b4=new Set();for(const _0x5c57b1 of _0x1083cf){if(_0x5c57b1[_0x31d044(0x24c)])for(const _0x3162fd of _0x5c57b1[_0x31d044(0x24c)]){_0x3162fd['name']&&_0x4087b4[_0x31d044(0x1a2)](_0x3162fd[_0x31d044(0x1be)]);}}const _0x11aaa2={..._0x324314,'stepNames':_0x4087b4},_0xa353e0=validateVersionStructure(_0x1083cf,_0x11aaa2);for(const _0x3ead52 of _0xa353e0){const _0x7c26a8=_0x418f78?{..._0x3ead52,'path':''+_0x418f78+_0x3ead52['path']}:_0x3ead52;if(_0x7c26a8[_0x31d044(0x1d8)]===_0x31d044(0x1ff))_0x1c4d52[_0x31d044(0x1d4)](_0x7c26a8);else _0x23a01a[_0x31d044(0x1d4)](_0x7c26a8);}for(let _0x34f672=0x0;_0x34f672<_0x1083cf['length'];_0x34f672++){const _0x29d37e=validateStage(_0x1083cf[_0x34f672],_0x34f672,_0x1083cf[_0x31d044(0x247)],_0x11aaa2);for(const _0x3d662c of _0x29d37e){const _0x2cdd53=_0x418f78?{..._0x3d662c,'path':''+_0x418f78+_0x3d662c[_0x31d044(0x235)]}:_0x3d662c;if(_0x2cdd53['level']===_0x31d044(0x1ff))_0x1c4d52[_0x31d044(0x1d4)](_0x2cdd53);else _0x23a01a['push'](_0x2cdd53);}}if(_0x6c0dec[_0x31d044(0x1f0)]){const _0x14caf1=_0x1664cf?.['goalIsInherited']?_0x31d044(0x1f0):_0x418f78+'goal',_0x599598=validateCriteria(_0x6c0dec[_0x31d044(0x1f0)],_0x14caf1,_0x11aaa2);for(const _0x105dff of _0x599598){if(_0x105dff[_0x31d044(0x1d8)]==='error')_0x1c4d52[_0x31d044(0x1d4)](_0x105dff);else _0x23a01a[_0x31d044(0x1d4)](_0x105dff);}}}function extractVersionIndex(_0x1fde43){const _0xdcee17=a169_0xc934,_0x22aad4=_0x1fde43[_0xdcee17(0x1f3)](/^journeys\[(\d+)\]\./);return _0x22aad4?_0x22aad4[0x1]:undefined;}function deduplicateAcrossVersions(_0x38f9e1){const _0x34694f=a169_0xc934,_0x5639e9=new Map();for(let _0xf05f1f=0x0;_0xf05f1f<_0x38f9e1[_0x34694f(0x247)];_0xf05f1f++){const _0x1d4b18=_0x38f9e1[_0xf05f1f]['code']+':'+_0x38f9e1[_0xf05f1f][_0x34694f(0x1fd)],_0xd7d8bd=extractVersionIndex(_0x38f9e1[_0xf05f1f]['path']),_0x51461e=_0x5639e9[_0x34694f(0x1db)](_0x1d4b18);if(_0x51461e){_0x51461e[_0x34694f(0x22a)]['push'](_0xf05f1f);if(_0xd7d8bd)_0x51461e['versions'][_0x34694f(0x1a2)](_0xd7d8bd);}else _0x5639e9[_0x34694f(0x1a1)](_0x1d4b18,{'indices':[_0xf05f1f],'versions':new Set(_0xd7d8bd?[_0xd7d8bd]:[])});}const _0x14936d=new Set();for(const {indices:_0x2e34bc,versions:_0x3b9f40}of _0x5639e9[_0x34694f(0x1e7)]()){if(_0x3b9f40[_0x34694f(0x239)]<=0x1)continue;const _0x27c598=_0x38f9e1[_0x2e34bc[0x0]];_0x27c598['path']=_0x27c598['path']['replace'](/^journeys\[\d+\]\./,''),_0x27c598[_0x34694f(0x1fd)]=_0x27c598[_0x34694f(0x1fd)]+_0x34694f(0x20c)+_0x3b9f40[_0x34694f(0x239)]+'\x20versions)';for(let _0x45f079=0x1;_0x45f079<_0x2e34bc[_0x34694f(0x247)];_0x45f079++){_0x14936d[_0x34694f(0x1a2)](_0x2e34bc[_0x45f079]);}}const _0x2681a0=[..._0x14936d][_0x34694f(0x1e8)]((_0x2868a2,_0x4b5aff)=>_0x4b5aff-_0x2868a2);for(const _0x3caaf9 of _0x2681a0){_0x38f9e1['splice'](_0x3caaf9,0x1);}}function a169_0x1581(){const _0x23033e=['entry_criteria','stages[','launched','excluded','merge','safeParse','.with.condition.next','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','timeout\x20of\x20\x27','rule','.with.condition.timeout','reduce','MISSING_END_STEP','MISSING_ENTRY_CRITERIA','milestone','.exit_criteria[','BRANCH_DIRECTLY_TO_MERGE','.with','segments','3183008ytZkQg','Criteria\x20references\x20undefined\x20segment\x20\x27','map','every','startsWith','DUPLICATE_STEP_NAME','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','name','segment','DUPLICATE_LATEST','stepNames','filter','journeys[','Merge\x20step\x20\x27','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','warning','jump','\x27\x20(first\x20defined\x20at\x20steps[','latest','\x20with\x20latest:\x20true','version','includes','type','\x27\x20has\x20no\x20exit_criteria\x20defined','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','.with.branches','.with.target',').\x20Use\x20a\x20merge\x20step.','MISSING_NAME','push','target','branch\x20\x27','stages','level','percentage','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','get','.stages','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','segments.','\x27\x20(from:\x20','success','has','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','MISSING_GOAL','journeys,\x20stages,\x20or\x20versions','112DBNXMA','values','sort','referencedSegments','195324dQJYCl','MISSING_WAIT_PARAMS','condition','INSUFFICIENT_STEPS','.exit_criteria','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','goal','\x27\x20has\x20only\x20','journey','match','exit_criteria','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','ab_test','MISSING_ACTIVATION_REF','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','FEW_STEPS','decision_point','12228480TsVkdB','INVALID_NEXT_REFERENCE','message','with','error','activations','\x27\x20with\x20no\x20action\x20in\x20between','.with.condition.timeout.next','Journey\x20can\x20have\x20at\x20most\x20one\x20','.with.condition.segment','entries','.segment','121152LhJtSO','variants','next','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.steps[','\x20(across\x20','timeout','END_STEP_HAS_NEXT_OR_WITH','some','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','document','stage','\x27\x20has\x20no\x20steps','.entry_criteria','.type','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','ref:','embeddedSegments','391125bwSbzC',').\x20Merge\x20is\x20unnecessary.','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','TOO_MANY_STAGES','description','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','JOURNEY_SCHEMA_ERROR','A/B\x20test\x20variant\x20\x27','source','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','Stage\x20\x27','.with.variants[','.with.condition','MISSING_STAGES','activationKeys','state','condition\x20of\x20\x27','indices','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','.with.variants','.rule','5JAvgJs','MISSING_SEGMENT_REFERENCE','Decision\x20branch\x20\x27','Jump\x20step\x20requires\x20a\x20target','wait','keys','issues','path','variant\x20\x27','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','Journey\x20name\x20is\x20required','size','endsWith','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','versions','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','branches','.milestone','MISSING_MILESTONE','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','261825nogoMU','INVALID_JUMP_TARGET','End\x20step\x20\x27','journeys','SINGLE_INPUT_MERGE','length','activation','MISSING_CONDITIONS','.with.activation','\x20stages\x20but\x20maximum\x20is\x20','steps','\x27\x20of\x20\x27','abs','MERGE_TO_MERGE_CHAIN','.steps','excluded_','data','168962XOZhJm','UNUSED_EMBEDDED_SEGMENT','.with.branches[','.next','set','add'];a169_0x1581=function(){return _0x23033e;};return a169_0x1581();}export function validateJourneyDef(_0x15c1d0,_0x4b949e={},_0x26312a={}){const _0xdb8a2f=a169_0xc934;if(_0x26312a['skipSchema'])return runJourneySemanticChecks(_0x15c1d0,_0x4b949e);const _0x22b63b=JourneyDefSchema[_0xdb8a2f(0x1a8)](_0x15c1d0);if(_0x22b63b[_0xdb8a2f(0x1e1)])return runJourneySemanticChecks(_0x22b63b[_0xdb8a2f(0x19c)],_0x4b949e);return zodErrorsToJourneyValidationResult(_0x22b63b[_0xdb8a2f(0x1ff)],_0x4b949e);}function zodErrorsToJourneyValidationResult(_0x4a07ea,_0x1dbcd3){const _0x1a5e45=a169_0xc934,_0xe98d71=flattenZodIssues(_0x4a07ea[_0x1a5e45(0x234)]),_0x2a2584=_0xe98d71[_0x1a5e45(0x1b9)](_0x56ac42=>{const _0x286e7c=_0x1a5e45,_0x3c58ae=formatZodPath(_0x56ac42['path']),_0x12d476=mapJourneyZodIssueToCode(_0x56ac42,_0x3c58ae),_0x4d95bb=getLocationFromPath(_0x1dbcd3[_0x286e7c(0x211)],_0x1dbcd3[_0x286e7c(0x221)],_0x56ac42[_0x286e7c(0x235)]['map'](_0x193ffd=>typeof _0x193ffd==='symbol'?String(_0x193ffd):_0x193ffd));return{'level':_0x286e7c(0x1ff),'path':_0x3c58ae,'code':_0x12d476,'message':_0x56ac42['message'],..._0x4d95bb&&{'location':_0x4d95bb}};});return{'valid':![],'errors':_0x2a2584,'warnings':[]};}function a169_0xc934(_0x5e59f7,_0x1ca876){_0x5e59f7=_0x5e59f7-0x19a;const _0x15812e=a169_0x1581();let _0xc93474=_0x15812e[_0x5e59f7];return _0xc93474;}function mapJourneyZodIssueToCode(_0x3c8193,_0xaa9ae7){const _0x129eee=a169_0xc934;if(_0xaa9ae7===_0x129eee(0x1be))return _0x129eee(0x1d3);if(_0xaa9ae7[_0x129eee(0x23a)](_0x129eee(0x215))&&_0xaa9ae7[_0x129eee(0x1cc)]('steps'))return _0x129eee(0x21f);if(_0xaa9ae7===_0x129eee(0x1d7)||_0xaa9ae7[_0x129eee(0x23a)](_0x129eee(0x1dc)))return _0x129eee(0x226);if(_0xaa9ae7===''&&_0x3c8193[_0x129eee(0x1fd)][_0x129eee(0x1cc)](_0x129eee(0x1e5)))return _0x129eee(0x226);if(_0xaa9ae7[_0x129eee(0x1cc)](_0x129eee(0x248)))return'ACTIVATION_SCHEMA_ERROR';return _0x129eee(0x21f);}function runJourneySemanticChecks(_0x3e34da,_0x3263f5){const _0x31ab23=a169_0xc934,_0x110452=[],_0x1f1c0d=[];(!_0x3e34da[_0x31ab23(0x1be)]||_0x3e34da[_0x31ab23(0x1be)]['trim']()==='')&&_0x110452[_0x31ab23(0x1d4)]({'level':'error','path':_0x31ab23(0x1be),'code':'MISSING_NAME','message':_0x31ab23(0x238),'location':getLocationFromPath(_0x3263f5['document'],_0x3263f5[_0x31ab23(0x221)],[_0x31ab23(0x1be)])});const _0xc52ab6=new Set();if(_0x3e34da[_0x31ab23(0x1b6)])for(const _0x2cdc71 of Object[_0x31ab23(0x233)](_0x3e34da['segments'])){_0xc52ab6[_0x31ab23(0x1a2)](_0x2cdc71);}const _0x5e3da0=new Set();if(_0x3e34da[_0x31ab23(0x200)])for(const _0x3ddbcb of Object[_0x31ab23(0x233)](_0x3e34da[_0x31ab23(0x200)])){_0x5e3da0[_0x31ab23(0x1a2)](_0x3ddbcb);}const _0x38275c=new Set(),_0x5b8e07={..._0x3263f5,'embeddedSegments':_0xc52ab6,'referencedSegments':_0x38275c,'activationKeys':_0x5e3da0[_0x31ab23(0x239)]>0x0?_0x5e3da0:undefined};if(_0x3e34da[_0x31ab23(0x1b6)])for(const [_0x128119,_0x2df4ce]of Object[_0x31ab23(0x205)](_0x3e34da[_0x31ab23(0x1b6)])){const _0x2acaeb=validateEmbeddedSegment(_0x2df4ce,_0x31ab23(0x1df)+_0x128119,_0x5b8e07);for(const _0x1191d4 of _0x2acaeb){if(_0x1191d4[_0x31ab23(0x1d8)]===_0x31ab23(0x1ff))_0x110452[_0x31ab23(0x1d4)](_0x1191d4);else _0x1f1c0d[_0x31ab23(0x1d4)](_0x1191d4);}}const _0x52857e=!!_0x3e34da['goal'],_0x6743e1=_0x3e34da['journeys']?.[_0x31ab23(0x1ba)](_0x2e3bc9=>!!_0x2e3bc9[_0x31ab23(0x1f0)])??![];!_0x52857e&&!_0x6743e1&&_0x1f1c0d['push']({'level':_0x31ab23(0x1c6),'path':_0x31ab23(0x1f0),'code':_0x31ab23(0x1e4),'message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x3263f5[_0x31ab23(0x211)],_0x3263f5[_0x31ab23(0x221)],[_0x31ab23(0x1f0)])});const _0x1de128=_0x3e34da[_0x31ab23(0x245)]??_0x3e34da[_0x31ab23(0x23c)];if(_0x1de128&&_0x1de128[_0x31ab23(0x1c2)](_0x500a29=>_0x500a29[_0x31ab23(0x1c9)]===!![])['length']>0x1){const _0x588469=_0x3e34da[_0x31ab23(0x245)]?_0x31ab23(0x245):_0x31ab23(0x23c);_0x110452['push']({'level':_0x31ab23(0x1ff),'path':_0x588469,'code':_0x31ab23(0x1c0),'message':_0x31ab23(0x203)+(_0x588469===_0x31ab23(0x245)?'journey\x20entry':_0x31ab23(0x1cb))+_0x31ab23(0x1ca),'location':getLocationFromPath(_0x3263f5['document'],_0x3263f5[_0x31ab23(0x221)],[_0x588469])});}if(_0x3e34da[_0x31ab23(0x245)]&&_0x3e34da[_0x31ab23(0x245)][_0x31ab23(0x247)]>0x0)for(let _0x19bbf6=0x0;_0x19bbf6<_0x3e34da[_0x31ab23(0x245)][_0x31ab23(0x247)];_0x19bbf6++){const _0x434757=_0x3e34da[_0x31ab23(0x245)][_0x19bbf6];if(_0x3e34da[_0x31ab23(0x245)]['length']>0x1&&_0x434757[_0x31ab23(0x228)]===_0x31ab23(0x1a5))continue;const _0x43a908=_0x434757[_0x31ab23(0x1d7)]||[],_0x133b6c=_0x31ab23(0x1c3)+_0x19bbf6+'].',_0x36904f=!!_0x434757[_0x31ab23(0x1f0)],_0x148933=_0x36904f?{..._0x3e34da,'goal':_0x434757[_0x31ab23(0x1f0)]}:_0x3e34da;validateStagesForVersion(_0x43a908,_0x148933,_0x5b8e07,_0x133b6c,_0x110452,_0x1f1c0d,{'goalIsInherited':!_0x36904f});}else{if(_0x3e34da[_0x31ab23(0x23c)]&&_0x3e34da['versions'][_0x31ab23(0x247)]>0x0)for(let _0x46ca4e=0x0;_0x46ca4e<_0x3e34da['versions'][_0x31ab23(0x247)];_0x46ca4e++){const _0x8708d4=_0x3e34da['versions'][_0x46ca4e];if(_0x3e34da[_0x31ab23(0x23c)]['length']>0x1&&_0x8708d4[_0x31ab23(0x228)]===_0x31ab23(0x1a5))continue;const _0x5aa1f9=_0x8708d4[_0x31ab23(0x1d7)]||[],_0x4610c8='versions['+_0x46ca4e+'].';validateStagesForVersion(_0x5aa1f9,_0x3e34da,_0x5b8e07,_0x4610c8,_0x110452,_0x1f1c0d);}else{const _0x39a6e0=_0x3e34da[_0x31ab23(0x1d7)]||[];validateStagesForVersion(_0x39a6e0,_0x3e34da,_0x5b8e07,'',_0x110452,_0x1f1c0d);}}_0x3e34da[_0x31ab23(0x245)]&&_0x3e34da[_0x31ab23(0x245)][_0x31ab23(0x247)]>0x1&&(deduplicateAcrossVersions(_0x110452),deduplicateAcrossVersions(_0x1f1c0d));for(const _0x2cd4ce of _0xc52ab6){!_0x38275c['has'](_0x2cd4ce)&&!_0x2cd4ce['startsWith'](_0x31ab23(0x19b))&&_0x1f1c0d[_0x31ab23(0x1d4)]({'level':_0x31ab23(0x1c6),'path':_0x31ab23(0x1df)+_0x2cd4ce,'code':_0x31ab23(0x19e),'message':'Embedded\x20segment\x20\x27'+_0x2cd4ce+_0x31ab23(0x237),'location':getLocationFromPath(_0x3263f5[_0x31ab23(0x211)],_0x3263f5[_0x31ab23(0x221)],[_0x31ab23(0x1b6),_0x2cd4ce])});}return{'valid':_0x110452[_0x31ab23(0x247)]===0x0,'errors':_0x110452,'warnings':_0x1f1c0d};}
1
+ (function(_0x57f039,_0x24950e){const _0x4e8e4a=a169_0x4939,_0x5a277e=_0x57f039();while(!![]){try{const _0x51dcf=-parseInt(_0x4e8e4a(0x140))/0x1+parseInt(_0x4e8e4a(0x1c4))/0x2+parseInt(_0x4e8e4a(0x135))/0x3*(parseInt(_0x4e8e4a(0x17a))/0x4)+parseInt(_0x4e8e4a(0x1ab))/0x5*(parseInt(_0x4e8e4a(0x1a9))/0x6)+parseInt(_0x4e8e4a(0x19d))/0x7*(-parseInt(_0x4e8e4a(0x1b0))/0x8)+-parseInt(_0x4e8e4a(0x131))/0x9*(parseInt(_0x4e8e4a(0x1c6))/0xa)+parseInt(_0x4e8e4a(0x192))/0xb;if(_0x51dcf===_0x24950e)break;else _0x5a277e['push'](_0x5a277e['shift']());}catch(_0x1d2643){_0x5a277e['push'](_0x5a277e['shift']());}}}(a169_0x43d7,0xe261b));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x16e0ed,_0x5dbc40,_0x3c2c35,_0x52ee3c,_0x181cb4,_0x50d658){const _0x5e0b32=a169_0x4939;return{'level':_0x16e0ed,'path':_0x5dbc40,'code':_0x3c2c35,'message':_0x52ee3c,'location':getLocationFromPath(_0x181cb4[_0x5e0b32(0x161)],_0x181cb4[_0x5e0b32(0x17b)],pathToArray(_0x50d658??_0x5dbc40))};}function validateVersionStructure(_0x578e0f,_0x4118ae){const _0x57691f=a169_0x4939,_0x873ce0=[];return _0x578e0f['length']>MAX_STAGES&&_0x873ce0['push'](createIssue(_0x57691f(0x19f),_0x57691f(0x159),_0x57691f(0x19b),_0x57691f(0x139)+_0x578e0f[_0x57691f(0x163)]+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x4118ae)),_0x873ce0;}function validateStageStructure(_0x38ad33,_0x354e37,_0x368b37,_0x4f1a87){const _0x7c432c=a169_0x4939,_0x51a851=[],_0x106c68=_0x7c432c(0x1ad)+_0x354e37+']';_0x354e37===0x0&&!_0x38ad33[_0x7c432c(0x134)]&&_0x51a851['push'](createIssue(_0x7c432c(0x19f),_0x106c68+'.entry_criteria',_0x7c432c(0x196),_0x7c432c(0x16a)+_0x38ad33[_0x7c432c(0x191)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x4f1a87,_0x106c68));const _0x52b2f7=_0x354e37===_0x368b37-0x1;!_0x52b2f7&&!_0x38ad33['milestone']&&_0x51a851[_0x7c432c(0x18d)](createIssue(_0x7c432c(0x19f),_0x106c68+_0x7c432c(0x120),'MISSING_MILESTONE','Stage\x20\x27'+_0x38ad33[_0x7c432c(0x191)]+_0x7c432c(0x12f),_0x4f1a87,_0x106c68));(!_0x38ad33['exit_criteria']||_0x38ad33[_0x7c432c(0x123)][_0x7c432c(0x163)]===0x0)&&_0x51a851['push'](createIssue('warning',_0x106c68+_0x7c432c(0x12d),_0x7c432c(0x1a7),_0x7c432c(0x16a)+_0x38ad33[_0x7c432c(0x191)]+_0x7c432c(0x13e),_0x4f1a87,_0x106c68));const _0x1542d8=_0x38ad33[_0x7c432c(0x16b)]?.[_0x7c432c(0x163)]??0x0;if(_0x1542d8===0x0)_0x51a851['push'](createIssue('error',_0x106c68+_0x7c432c(0x11c),'INSUFFICIENT_STEPS','Stage\x20\x27'+_0x38ad33[_0x7c432c(0x191)]+_0x7c432c(0x178),_0x4f1a87,_0x106c68+_0x7c432c(0x11c)));else{if(_0x1542d8===0x1)_0x51a851['push'](createIssue(_0x7c432c(0x155),_0x106c68+'.steps',_0x7c432c(0x113),_0x7c432c(0x16a)+_0x38ad33['name']+_0x7c432c(0x130),_0x4f1a87,_0x106c68+'.steps'));else _0x1542d8<=0x3&&_0x51a851[_0x7c432c(0x18d)](createIssue(_0x7c432c(0x155),_0x106c68+'.steps',_0x7c432c(0x158),_0x7c432c(0x16a)+_0x38ad33[_0x7c432c(0x191)]+_0x7c432c(0x1b6)+_0x1542d8+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x4f1a87,_0x106c68+_0x7c432c(0x11c)));}return _0x51a851;}function validateStep(_0x1564d5,_0x57e918,_0x517d79,_0xd97149){const _0xb9fc18=a169_0x4939,_0x58d9d2=[];if(_0x1564d5[_0xb9fc18(0x1be)]===_0xb9fc18(0x122))return _0x1564d5[_0xb9fc18(0x1aa)]&&_0x58d9d2[_0xb9fc18(0x18d)](createIssue(_0xb9fc18(0x19f),_0x57e918+_0xb9fc18(0x1a8),_0xb9fc18(0x10f),_0xb9fc18(0x141)+_0x1564d5[_0xb9fc18(0x191)]+_0xb9fc18(0x13c),_0x517d79)),_0xb9fc18(0x12b)in _0x1564d5&&_0x1564d5['with']!==undefined&&_0x58d9d2[_0xb9fc18(0x18d)](createIssue('error',_0x57e918+_0xb9fc18(0x127),_0xb9fc18(0x10f),_0xb9fc18(0x141)+_0x1564d5[_0xb9fc18(0x191)]+'\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',_0x517d79)),_0x58d9d2;_0x1564d5['next']&&(_0x517d79[_0xb9fc18(0x162)]&&!_0x517d79[_0xb9fc18(0x162)][_0xb9fc18(0x152)](_0x1564d5[_0xb9fc18(0x1aa)])&&_0x58d9d2['push'](createIssue(_0xb9fc18(0x19f),_0x57e918+_0xb9fc18(0x1a8),_0xb9fc18(0x166),_0xb9fc18(0x175)+_0x1564d5['next']+'\x27',_0x517d79)));switch(_0x1564d5[_0xb9fc18(0x1be)]){case _0xb9fc18(0x142):_0x58d9d2[_0xb9fc18(0x18d)](...validateWaitStep(_0x1564d5,_0x57e918,_0x517d79,_0xd97149));break;case _0xb9fc18(0x185):_0x58d9d2[_0xb9fc18(0x18d)](...validateActivationStep(_0x1564d5,_0x57e918,_0x517d79));break;case _0xb9fc18(0x165):_0x58d9d2[_0xb9fc18(0x18d)](...validateDecisionPointStep(_0x1564d5,_0x57e918,_0x517d79,_0xd97149));break;case _0xb9fc18(0x16c):_0x58d9d2[_0xb9fc18(0x18d)](...validateAbTestStep(_0x1564d5,_0x57e918,_0x517d79,_0xd97149));break;case _0xb9fc18(0x15b):_0x58d9d2[_0xb9fc18(0x18d)](...validateJumpStep(_0x1564d5,_0x57e918,_0x517d79));break;}return _0x58d9d2;}function validateWaitStep(_0x1b645a,_0x4ac1e5,_0x76eafb,_0xd6b55a){const _0x355956=a169_0x4939,_0x404b2e=[];if(!_0x1b645a[_0x355956(0x12b)])return _0x404b2e[_0x355956(0x18d)](createIssue('error',_0x4ac1e5+'.with',_0x355956(0x1ae),_0x355956(0x136),_0x76eafb,_0x4ac1e5)),_0x404b2e;if(_0x1b645a[_0x355956(0x12b)]['condition']){const _0xd3be02=_0x1b645a[_0x355956(0x12b)][_0x355956(0x15d)];if(_0xd3be02[_0x355956(0x1a5)]){_0x76eafb[_0x355956(0x17e)]?.[_0x355956(0x182)](_0xd3be02['segment']);!_0xd3be02[_0x355956(0x1a5)][_0x355956(0x124)](_0x355956(0x181))&&(_0x76eafb[_0x355956(0x147)]&&!_0x76eafb['embeddedSegments'][_0x355956(0x152)](_0xd3be02[_0x355956(0x1a5)])&&_0x404b2e[_0x355956(0x18d)](createIssue(_0x355956(0x19f),_0x4ac1e5+'.with.condition.segment',_0x355956(0x1b3),_0x355956(0x18c)+_0xd3be02['segment']+_0x355956(0x16d),_0x76eafb)));_0xd3be02[_0x355956(0x1aa)]&&_0x76eafb[_0x355956(0x162)]&&!_0x76eafb[_0x355956(0x162)]['has'](_0xd3be02[_0x355956(0x1aa)])&&_0x404b2e[_0x355956(0x18d)](createIssue(_0x355956(0x19f),_0x4ac1e5+_0x355956(0x13f),_0x355956(0x166),'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0xd3be02[_0x355956(0x1aa)]+'\x27',_0x76eafb));_0xd3be02[_0x355956(0x17f)]?.[_0x355956(0x1aa)]&&_0x76eafb[_0x355956(0x162)]&&!_0x76eafb[_0x355956(0x162)][_0x355956(0x152)](_0xd3be02[_0x355956(0x17f)][_0x355956(0x1aa)])&&_0x404b2e[_0x355956(0x18d)](createIssue('error',_0x4ac1e5+_0x355956(0x14c),_0x355956(0x166),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0xd3be02[_0x355956(0x17f)][_0x355956(0x1aa)]+'\x27',_0x76eafb));const _0x348a60=_0xd3be02[_0x355956(0x1aa)]||_0x1b645a[_0x355956(0x1aa)],_0x31da36=_0xd3be02[_0x355956(0x17f)]?.[_0x355956(0x1aa)]||_0x1b645a[_0x355956(0x1aa)];if(_0x348a60){const _0x331572=_0xd6b55a[_0x355956(0x1b7)](_0x348a60);_0x331572?.[_0x355956(0x1be)]==='merge'&&_0x404b2e[_0x355956(0x18d)](createIssue(_0x355956(0x155),_0x4ac1e5+_0x355956(0x13f),_0x355956(0x190),_0x355956(0x150)+_0x348a60+_0x355956(0x17d),_0x76eafb,_0x4ac1e5+_0x355956(0x193)));}if(_0x31da36){const _0x34173d=_0xd6b55a[_0x355956(0x1b7)](_0x31da36);_0x34173d?.[_0x355956(0x1be)]===_0x355956(0x18f)&&_0x404b2e[_0x355956(0x18d)](createIssue(_0x355956(0x155),_0x4ac1e5+_0x355956(0x14c),_0x355956(0x190),_0x355956(0x112)+_0x31da36+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x76eafb,_0x4ac1e5+_0x355956(0x171)));}}}return _0x404b2e;}function validateActivationStep(_0x4a558d,_0x51374f,_0x1e3b7e){const _0x4ea2f0=a169_0x4939,_0x3e28f7=[];if(!_0x4a558d[_0x4ea2f0(0x12b)]?.[_0x4ea2f0(0x185)])return _0x3e28f7[_0x4ea2f0(0x18d)](createIssue(_0x4ea2f0(0x19f),_0x51374f+_0x4ea2f0(0x15c),_0x4ea2f0(0x12e),_0x4ea2f0(0x18e),_0x1e3b7e,_0x51374f)),_0x3e28f7;const _0x4192bb=_0x4a558d[_0x4ea2f0(0x12b)][_0x4ea2f0(0x185)];return _0x1e3b7e[_0x4ea2f0(0x1b4)]&&!_0x4192bb['startsWith']('ref:')&&(!_0x1e3b7e['activationKeys'][_0x4ea2f0(0x152)](_0x4192bb)&&_0x3e28f7[_0x4ea2f0(0x18d)](createIssue(_0x4ea2f0(0x19f),_0x51374f+_0x4ea2f0(0x15c),_0x4ea2f0(0x12a),_0x4ea2f0(0x115)+_0x4192bb+'\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',_0x1e3b7e))),_0x3e28f7;}function validateDecisionPointStep(_0x4e0e00,_0x4eedbb,_0x331e6a,_0x491d58){const _0x4b7610=a169_0x4939,_0x45762c=[];if(!_0x4e0e00[_0x4b7610(0x12b)]?.['branches']||_0x4e0e00[_0x4b7610(0x12b)][_0x4b7610(0x187)][_0x4b7610(0x163)]===0x0)return _0x45762c[_0x4b7610(0x18d)](createIssue('error',_0x4eedbb+'.with.branches',_0x4b7610(0x1a2),'Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x331e6a,_0x4eedbb)),_0x45762c;for(let _0x2c387f=0x0;_0x2c387f<_0x4e0e00['with']['branches'][_0x4b7610(0x163)];_0x2c387f++){const _0x2a7f40=_0x4e0e00[_0x4b7610(0x12b)][_0x4b7610(0x187)][_0x2c387f],_0xd772be=_0x4eedbb+_0x4b7610(0x19a)+_0x2c387f+']';_0x2a7f40['segment']&&!_0x2a7f40[_0x4b7610(0x18b)]&&(_0x331e6a[_0x4b7610(0x17e)]?.['add'](_0x2a7f40[_0x4b7610(0x1a5)]),!_0x2a7f40[_0x4b7610(0x1a5)][_0x4b7610(0x124)](_0x4b7610(0x181))&&(_0x331e6a[_0x4b7610(0x147)]&&!_0x331e6a[_0x4b7610(0x147)][_0x4b7610(0x152)](_0x2a7f40[_0x4b7610(0x1a5)])&&_0x45762c[_0x4b7610(0x18d)](createIssue('error',_0xd772be+'.segment',_0x4b7610(0x1b3),_0x4b7610(0x132)+_0x2a7f40[_0x4b7610(0x1a5)]+'\x27',_0x331e6a))));_0x2a7f40[_0x4b7610(0x1aa)]&&_0x331e6a[_0x4b7610(0x162)]&&!_0x331e6a[_0x4b7610(0x162)][_0x4b7610(0x152)](_0x2a7f40[_0x4b7610(0x1aa)])&&_0x45762c[_0x4b7610(0x18d)](createIssue('error',_0xd772be+'.next','INVALID_NEXT_REFERENCE',_0x4b7610(0x179)+_0x2a7f40[_0x4b7610(0x1aa)]+'\x27',_0x331e6a));if(_0x2a7f40['next']){const _0x1f77e2=_0x491d58[_0x4b7610(0x1b7)](_0x2a7f40[_0x4b7610(0x1aa)]);_0x1f77e2?.[_0x4b7610(0x1be)]==='merge'&&_0x45762c[_0x4b7610(0x18d)](createIssue(_0x4b7610(0x155),_0xd772be+_0x4b7610(0x1a8),_0x4b7610(0x190),_0x4b7610(0x11e)+_0x2a7f40[_0x4b7610(0x191)]+_0x4b7610(0x180)+_0x2a7f40[_0x4b7610(0x1aa)]+_0x4b7610(0x19c),_0x331e6a));}}return _0x45762c;}function validateAbTestStep(_0x32c9f7,_0x4cc806,_0x1e952b,_0x3c15bc){const _0x1f01d2=a169_0x4939,_0x5ee212=[];if(!_0x32c9f7[_0x1f01d2(0x12b)]?.['variants']||_0x32c9f7['with'][_0x1f01d2(0x198)][_0x1f01d2(0x163)]===0x0)return _0x5ee212[_0x1f01d2(0x18d)](createIssue(_0x1f01d2(0x19f),_0x4cc806+_0x1f01d2(0x15f),_0x1f01d2(0x1a2),_0x1f01d2(0x110),_0x1e952b,_0x4cc806)),_0x5ee212;const _0x1c089f=_0x32c9f7[_0x1f01d2(0x12b)][_0x1f01d2(0x198)][_0x1f01d2(0x118)]((_0x1a276d,_0x40c44b)=>_0x1a276d+(_0x40c44b[_0x1f01d2(0x186)]||0x0),0x0);Math[_0x1f01d2(0x138)](_0x1c089f-0x64)>0.01&&_0x5ee212[_0x1f01d2(0x18d)](createIssue(_0x1f01d2(0x19f),_0x4cc806+'.with.variants',_0x1f01d2(0x133),'A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20'+_0x1c089f+'%)',_0x1e952b));for(let _0x4de7b0=0x0;_0x4de7b0<_0x32c9f7[_0x1f01d2(0x12b)]['variants'][_0x1f01d2(0x163)];_0x4de7b0++){const _0x2cb940=_0x32c9f7[_0x1f01d2(0x12b)][_0x1f01d2(0x198)][_0x4de7b0],_0x325bc5=_0x4cc806+_0x1f01d2(0x129)+_0x4de7b0+']';_0x2cb940['next']&&_0x1e952b[_0x1f01d2(0x162)]&&!_0x1e952b[_0x1f01d2(0x162)][_0x1f01d2(0x152)](_0x2cb940[_0x1f01d2(0x1aa)])&&_0x5ee212[_0x1f01d2(0x18d)](createIssue(_0x1f01d2(0x19f),_0x325bc5+_0x1f01d2(0x1a8),_0x1f01d2(0x166),'A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x2cb940[_0x1f01d2(0x1aa)]+'\x27',_0x1e952b));if(_0x2cb940[_0x1f01d2(0x1aa)]){const _0x45ff2c=_0x3c15bc['get'](_0x2cb940[_0x1f01d2(0x1aa)]);_0x45ff2c?.[_0x1f01d2(0x1be)]===_0x1f01d2(0x18f)&&_0x5ee212[_0x1f01d2(0x18d)](createIssue(_0x1f01d2(0x155),_0x325bc5+_0x1f01d2(0x1a8),_0x1f01d2(0x190),_0x1f01d2(0x197)+_0x2cb940[_0x1f01d2(0x191)]+_0x1f01d2(0x180)+_0x2cb940[_0x1f01d2(0x1aa)]+_0x1f01d2(0x19c),_0x1e952b));}}return _0x5ee212;}function validateJumpStep(_0x3010fc,_0x355e8f,_0x16bda2){const _0x17c166=a169_0x4939,_0x1f7659=[];if(!_0x3010fc[_0x17c166(0x12b)]?.[_0x17c166(0x13b)])return _0x1f7659[_0x17c166(0x18d)](createIssue(_0x17c166(0x19f),_0x355e8f+_0x17c166(0x146),_0x17c166(0x1c0),_0x17c166(0x121),_0x16bda2,_0x355e8f)),_0x1f7659;return(!_0x3010fc[_0x17c166(0x12b)][_0x17c166(0x13b)][_0x17c166(0x1a0)]||!_0x3010fc[_0x17c166(0x12b)][_0x17c166(0x13b)][_0x17c166(0x154)])&&_0x1f7659[_0x17c166(0x18d)](createIssue(_0x17c166(0x19f),_0x355e8f+_0x17c166(0x146),_0x17c166(0x1c0),_0x17c166(0x1b2),_0x16bda2)),_0x1f7659;}function buildConvergenceMap(_0x1d921c){const _0x52b587=a169_0x4939,_0x7e078e=new Map();function _0x8df6b0(_0x2143c2,_0x1d7e58){const _0x32b626=a169_0x4939,_0x3689dc=_0x7e078e[_0x32b626(0x1b7)](_0x2143c2)||[];_0x3689dc[_0x32b626(0x18d)](_0x1d7e58),_0x7e078e[_0x32b626(0x11a)](_0x2143c2,_0x3689dc);}for(const _0x404754 of _0x1d921c){_0x404754[_0x52b587(0x1aa)]&&_0x8df6b0(_0x404754[_0x52b587(0x1aa)],{'stepName':_0x404754[_0x52b587(0x191)],'description':_0x52b587(0x128)+_0x404754[_0x52b587(0x191)]+'\x27'});if(_0x404754['type']===_0x52b587(0x165)&&_0x404754[_0x52b587(0x12b)]?.[_0x52b587(0x187)])for(const _0x3534e1 of _0x404754['with'][_0x52b587(0x187)]){_0x3534e1[_0x52b587(0x1aa)]&&_0x8df6b0(_0x3534e1[_0x52b587(0x1aa)],{'stepName':_0x404754[_0x52b587(0x191)],'description':_0x52b587(0x164)+_0x3534e1[_0x52b587(0x191)]+_0x52b587(0x18a)+_0x404754[_0x52b587(0x191)]+'\x27'});}if(_0x404754['type']==='ab_test'&&_0x404754['with']?.[_0x52b587(0x198)])for(const _0x284d14 of _0x404754['with'][_0x52b587(0x198)]){_0x284d14[_0x52b587(0x1aa)]&&_0x8df6b0(_0x284d14[_0x52b587(0x1aa)],{'stepName':_0x404754[_0x52b587(0x191)],'description':_0x52b587(0x199)+_0x284d14['name']+_0x52b587(0x18a)+_0x404754[_0x52b587(0x191)]+'\x27'});}_0x404754[_0x52b587(0x1be)]==='wait'&&_0x404754[_0x52b587(0x12b)]?.[_0x52b587(0x15d)]&&(_0x404754[_0x52b587(0x12b)][_0x52b587(0x15d)]['next']&&_0x8df6b0(_0x404754[_0x52b587(0x12b)][_0x52b587(0x15d)][_0x52b587(0x1aa)],{'stepName':_0x404754[_0x52b587(0x191)],'description':_0x52b587(0x143)+_0x404754['name']+'\x27'}),_0x404754[_0x52b587(0x12b)][_0x52b587(0x15d)][_0x52b587(0x17f)]?.['next']&&_0x8df6b0(_0x404754[_0x52b587(0x12b)][_0x52b587(0x15d)]['timeout'][_0x52b587(0x1aa)],{'stepName':_0x404754[_0x52b587(0x191)],'description':_0x52b587(0x1b5)+_0x404754[_0x52b587(0x191)]+'\x27'}));}return _0x7e078e;}function validateFlowControl(_0x1ce35d,_0x53c35a,_0x54b56a){const _0x5bd6c0=a169_0x4939,_0x3efbf4=[],_0x42e814=_0x5bd6c0(0x1ad)+_0x53c35a+']',_0x3653f0=_0x1ce35d[_0x5bd6c0(0x16b)]||[];if(_0x3653f0[_0x5bd6c0(0x163)]===0x0)return _0x3efbf4;const _0x5b37ee=new Map();for(const _0xc000ec of _0x3653f0){_0xc000ec[_0x5bd6c0(0x191)]&&_0x5b37ee['set'](_0xc000ec[_0x5bd6c0(0x191)],_0xc000ec);}const _0x2dd8fd=buildConvergenceMap(_0x3653f0),_0x520df1=_0x3653f0['some'](_0x2a1804=>_0x2a1804[_0x5bd6c0(0x1be)]===_0x5bd6c0(0x122));!_0x520df1&&_0x3efbf4['push'](createIssue('error',_0x42e814+_0x5bd6c0(0x11c),_0x5bd6c0(0x1ba),_0x5bd6c0(0x16a)+_0x1ce35d['name']+'\x27\x20has\x20no\x20end\x20step',_0x54b56a));for(const [_0x2a5a7f,_0x37d677]of _0x2dd8fd){const _0x2c80c1=_0x5b37ee[_0x5bd6c0(0x1b7)](_0x2a5a7f);if(!_0x2c80c1)continue;if(_0x37d677[_0x5bd6c0(0x163)]>0x1&&_0x2c80c1[_0x5bd6c0(0x1be)]!==_0x5bd6c0(0x18f)){const _0x59c82a=_0x37d677['map'](_0x141bab=>_0x141bab[_0x5bd6c0(0x184)])['join'](',\x20');_0x3efbf4['push'](createIssue('error',_0x42e814+_0x5bd6c0(0x11c),_0x5bd6c0(0x1af),'Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x2a5a7f+_0x5bd6c0(0x125)+_0x59c82a+_0x5bd6c0(0x1b9),_0x54b56a));}_0x37d677['length']===0x1&&_0x2c80c1[_0x5bd6c0(0x1be)]==='merge'&&_0x3efbf4['push'](createIssue(_0x5bd6c0(0x155),_0x42e814+_0x5bd6c0(0x11c),_0x5bd6c0(0x174),_0x5bd6c0(0x19e)+_0x2a5a7f+_0x5bd6c0(0x173)+_0x37d677[0x0][_0x5bd6c0(0x184)]+_0x5bd6c0(0x176),_0x54b56a));}for(const _0x2c771f of _0x3653f0){if(_0x2c771f[_0x5bd6c0(0x1be)]===_0x5bd6c0(0x18f)&&_0x2c771f['next']){const _0x156d6b=_0x5b37ee[_0x5bd6c0(0x1b7)](_0x2c771f['next']);_0x156d6b?.[_0x5bd6c0(0x1be)]==='merge'&&_0x3efbf4[_0x5bd6c0(0x18d)](createIssue(_0x5bd6c0(0x19f),_0x42e814+'.steps',_0x5bd6c0(0x1a3),_0x5bd6c0(0x19e)+_0x2c771f[_0x5bd6c0(0x191)]+_0x5bd6c0(0x14d)+_0x2c771f[_0x5bd6c0(0x1aa)]+_0x5bd6c0(0x160),_0x54b56a));}}return _0x3efbf4;}function validateCriteria(_0x32b7b9,_0x17bae6,_0x24ee0b){const _0x4c4ebf=a169_0x4939,_0x511362=[];return _0x32b7b9['segment']&&(_0x24ee0b[_0x4c4ebf(0x17e)]?.[_0x4c4ebf(0x182)](_0x32b7b9[_0x4c4ebf(0x1a5)]),!_0x32b7b9[_0x4c4ebf(0x1a5)][_0x4c4ebf(0x124)](_0x4c4ebf(0x181))&&(_0x24ee0b['embeddedSegments']&&!_0x24ee0b[_0x4c4ebf(0x147)][_0x4c4ebf(0x152)](_0x32b7b9[_0x4c4ebf(0x1a5)])&&_0x511362['push'](createIssue(_0x4c4ebf(0x19f),_0x17bae6+_0x4c4ebf(0x11b),_0x4c4ebf(0x1b3),_0x4c4ebf(0x157)+_0x32b7b9['segment']+'\x27',_0x24ee0b)))),_0x511362;}function validateEmbeddedSegment(_0x13b04f,_0x5aa1e3,_0x5b4382){const _0x1a5adc=a169_0x4939,_0x325fff=[];return _0x13b04f[_0x1a5adc(0x1bc)]&&_0x325fff['push'](...validateRuleDef(_0x13b04f[_0x1a5adc(0x1bc)],_0x5aa1e3+_0x1a5adc(0x177),_0x5b4382)),_0x325fff;}function validateStage(_0x47e12f,_0x3beee5,_0x1b0564,_0x10782){const _0x222298=a169_0x4939,_0x40eabe=[],_0x4cdd5b=_0x222298(0x1ad)+_0x3beee5+']',_0x54ac75=new Map(),_0x443adc=new Map();if(_0x47e12f[_0x222298(0x16b)]){for(let _0x8f7f1c=0x0;_0x8f7f1c<_0x47e12f[_0x222298(0x16b)][_0x222298(0x163)];_0x8f7f1c++){const _0x8b99fa=_0x47e12f[_0x222298(0x16b)][_0x8f7f1c];_0x8b99fa['name']&&_0x54ac75[_0x222298(0x11a)](_0x8b99fa[_0x222298(0x191)],_0x8b99fa);}for(let _0x175f3c=0x0;_0x175f3c<_0x47e12f[_0x222298(0x16b)][_0x222298(0x163)];_0x175f3c++){const _0x572de8=_0x47e12f[_0x222298(0x16b)][_0x175f3c],_0x546e04=_0x4cdd5b+_0x222298(0x151)+_0x175f3c+']';if(_0x572de8[_0x222298(0x191)]){if(_0x443adc[_0x222298(0x152)](_0x572de8[_0x222298(0x191)])){const _0x331f3b=_0x443adc[_0x222298(0x1b7)](_0x572de8[_0x222298(0x191)]);_0x40eabe['push'](createIssue('error',_0x546e04+_0x222298(0x14f),'DUPLICATE_STEP_NAME',_0x222298(0x14e)+_0x572de8[_0x222298(0x191)]+_0x222298(0x14a)+_0x331f3b+'])',_0x10782));}else _0x443adc[_0x222298(0x11a)](_0x572de8[_0x222298(0x191)],_0x175f3c);}_0x40eabe[_0x222298(0x18d)](...validateStep(_0x572de8,_0x546e04,_0x10782,_0x54ac75));}}_0x47e12f[_0x222298(0x134)]&&_0x40eabe[_0x222298(0x18d)](...validateCriteria(_0x47e12f[_0x222298(0x134)],_0x4cdd5b+_0x222298(0x17c),_0x10782));if(_0x47e12f[_0x222298(0x123)])for(let _0x2f9164=0x0;_0x2f9164<_0x47e12f['exit_criteria'][_0x222298(0x163)];_0x2f9164++){_0x40eabe[_0x222298(0x18d)](...validateCriteria(_0x47e12f[_0x222298(0x123)][_0x2f9164],_0x4cdd5b+'.exit_criteria['+_0x2f9164+']',_0x10782));}return _0x47e12f[_0x222298(0x116)]&&_0x40eabe[_0x222298(0x18d)](...validateCriteria(_0x47e12f['milestone'],_0x4cdd5b+'.milestone',_0x10782)),_0x40eabe[_0x222298(0x18d)](...validateStageStructure(_0x47e12f,_0x3beee5,_0x1b0564,_0x10782)),_0x40eabe['push'](...validateFlowControl(_0x47e12f,_0x3beee5,_0x10782)),_0x40eabe;}function validateStagesForVersion(_0x474550,_0x49f1d6,_0x2ba395,_0x503bf4,_0x25be61,_0x52506b,_0x12eff9){const _0x1a6823=a169_0x4939;if(_0x474550[_0x1a6823(0x163)]===0x0){_0x25be61[_0x1a6823(0x18d)]({'level':_0x1a6823(0x19f),'path':_0x503bf4+'stages','code':_0x1a6823(0x1c3),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x2ba395[_0x1a6823(0x161)],_0x2ba395['source'],['stages'])});return;}const _0x44551e=new Set();for(const _0x10041b of _0x474550){if(_0x10041b['steps'])for(const _0x4f75af of _0x10041b[_0x1a6823(0x16b)]){_0x4f75af[_0x1a6823(0x191)]&&_0x44551e[_0x1a6823(0x182)](_0x4f75af[_0x1a6823(0x191)]);}}const _0x2327f8={..._0x2ba395,'stepNames':_0x44551e},_0x4e8f0d=validateVersionStructure(_0x474550,_0x2327f8);for(const _0x37ebe3 of _0x4e8f0d){const _0x5707fc=_0x503bf4?{..._0x37ebe3,'path':''+_0x503bf4+_0x37ebe3[_0x1a6823(0x16f)]}:_0x37ebe3;if(_0x5707fc['level']==='error')_0x25be61[_0x1a6823(0x18d)](_0x5707fc);else _0x52506b[_0x1a6823(0x18d)](_0x5707fc);}for(let _0x307375=0x0;_0x307375<_0x474550[_0x1a6823(0x163)];_0x307375++){const _0x14cbe0=validateStage(_0x474550[_0x307375],_0x307375,_0x474550[_0x1a6823(0x163)],_0x2327f8);for(const _0x3c465e of _0x14cbe0){const _0x29f4fa=_0x503bf4?{..._0x3c465e,'path':''+_0x503bf4+_0x3c465e[_0x1a6823(0x16f)]}:_0x3c465e;if(_0x29f4fa[_0x1a6823(0x111)]==='error')_0x25be61[_0x1a6823(0x18d)](_0x29f4fa);else _0x52506b[_0x1a6823(0x18d)](_0x29f4fa);}}if(_0x49f1d6[_0x1a6823(0x144)]){const _0xe0312f=_0x12eff9?.['goalIsInherited']?_0x1a6823(0x144):_0x503bf4+_0x1a6823(0x144),_0x4c4720=validateCriteria(_0x49f1d6[_0x1a6823(0x144)],_0xe0312f,_0x2327f8);for(const _0x1d8470 of _0x4c4720){if(_0x1d8470[_0x1a6823(0x111)]===_0x1a6823(0x19f))_0x25be61[_0x1a6823(0x18d)](_0x1d8470);else _0x52506b[_0x1a6823(0x18d)](_0x1d8470);}}}function extractVersionIndex(_0x31cc41){const _0x3473ca=a169_0x4939,_0x151481=_0x31cc41[_0x3473ca(0x170)](/^journeys\[(\d+)\]\./);return _0x151481?_0x151481[0x1]:undefined;}function deduplicateAcrossVersions(_0x2aa147){const _0x3b90cd=a169_0x4939,_0x33ff9e=new Map();for(let _0x43fc6b=0x0;_0x43fc6b<_0x2aa147[_0x3b90cd(0x163)];_0x43fc6b++){const _0xdf9379=_0x2aa147[_0x43fc6b][_0x3b90cd(0x12c)]+':'+_0x2aa147[_0x43fc6b]['message'],_0x4f9fe9=extractVersionIndex(_0x2aa147[_0x43fc6b][_0x3b90cd(0x16f)]),_0x2bcb6c=_0x33ff9e[_0x3b90cd(0x1b7)](_0xdf9379);if(_0x2bcb6c){_0x2bcb6c[_0x3b90cd(0x1c5)][_0x3b90cd(0x18d)](_0x43fc6b);if(_0x4f9fe9)_0x2bcb6c[_0x3b90cd(0x1b8)][_0x3b90cd(0x182)](_0x4f9fe9);}else _0x33ff9e[_0x3b90cd(0x11a)](_0xdf9379,{'indices':[_0x43fc6b],'versions':new Set(_0x4f9fe9?[_0x4f9fe9]:[])});}const _0x58f744=new Set();for(const {indices:_0x2a8423,versions:_0x15228a}of _0x33ff9e[_0x3b90cd(0x172)]()){if(_0x15228a[_0x3b90cd(0x14b)]<=0x1)continue;const _0x589bae=_0x2aa147[_0x2a8423[0x0]];_0x589bae['path']=_0x589bae[_0x3b90cd(0x16f)][_0x3b90cd(0x119)](/^journeys\[\d+\]\./,''),_0x589bae['message']=_0x589bae[_0x3b90cd(0x156)]+'\x20(across\x20'+_0x15228a[_0x3b90cd(0x14b)]+_0x3b90cd(0x189);for(let _0x12a5c1=0x1;_0x12a5c1<_0x2a8423[_0x3b90cd(0x163)];_0x12a5c1++){_0x58f744['add'](_0x2a8423[_0x12a5c1]);}}const _0x2b98cd=[..._0x58f744][_0x3b90cd(0x1c1)]((_0x50ff22,_0x1a84da)=>_0x1a84da-_0x50ff22);for(const _0x187558 of _0x2b98cd){_0x2aa147[_0x3b90cd(0x195)](_0x187558,0x1);}}export function validateJourneyDef(_0x25cf80,_0x1b46d4={},_0x2d5769={}){const _0xafaf49=a169_0x4939;if(_0x2d5769[_0xafaf49(0x183)])return runJourneySemanticChecks(_0x25cf80,_0x1b46d4);const _0x262176=JourneyDefSchema[_0xafaf49(0x148)](_0x25cf80);if(_0x262176[_0xafaf49(0x1c2)])return runJourneySemanticChecks(_0x262176[_0xafaf49(0x153)],_0x1b46d4);return zodErrorsToJourneyValidationResult(_0x262176[_0xafaf49(0x19f)],_0x1b46d4);}function zodErrorsToJourneyValidationResult(_0x4658e6,_0x3b3b93){const _0x3d5c2d=a169_0x4939,_0x5a9992=flattenZodIssues(_0x4658e6[_0x3d5c2d(0x149)]),_0x23ee81=_0x5a9992[_0x3d5c2d(0x11d)](_0xdf8a5a=>{const _0x55814d=_0x3d5c2d,_0x4dca89=formatZodPath(_0xdf8a5a[_0x55814d(0x16f)]),_0x1d0068=mapJourneyZodIssueToCode(_0xdf8a5a,_0x4dca89),_0x57a8ea=getLocationFromPath(_0x3b3b93[_0x55814d(0x161)],_0x3b3b93[_0x55814d(0x17b)],_0xdf8a5a[_0x55814d(0x16f)][_0x55814d(0x11d)](_0x2a479e=>typeof _0x2a479e===_0x55814d(0x15a)?String(_0x2a479e):_0x2a479e));return{'level':_0x55814d(0x19f),'path':_0x4dca89,'code':_0x1d0068,'message':_0xdf8a5a[_0x55814d(0x156)],..._0x57a8ea&&{'location':_0x57a8ea}};});return{'valid':![],'errors':_0x23ee81,'warnings':[]};}function a169_0x43d7(){const _0x47c1e6=['1345130UDtXJR','END_STEP_HAS_NEXT_OR_WITH','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','level','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','INSUFFICIENT_STEPS','keys','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','milestone','.type','reduce','replace','set','.segment','.steps','map','Decision\x20branch\x20\x27','filter','.milestone','Jump\x20step\x20requires\x20a\x20target','end','exit_criteria','startsWith','\x27\x20(from:\x20','journeys','.with','step\x20\x27','.with.variants[','MISSING_ACTIVATION_DEFINITION','with','code','.exit_criteria','MISSING_ACTIVATION_REF','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','63RwhTRn','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','INVALID_AB_TEST_PERCENTAGES','entry_criteria','9LwqbBw','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','launched','abs','Journey\x20has\x20','segments','target','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','journeys,\x20stages,\x20or\x20versions','\x27\x20has\x20no\x20exit_criteria\x20defined','.with.condition.next','1260281rxCRIO','End\x20step\x20\x27','wait','condition\x20of\x20\x27','goal','includes','.with.target','embeddedSegments','safeParse','issues','\x27\x20(first\x20defined\x20at\x20steps[','size','.with.condition.timeout.next','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','Duplicate\x20step\x20name\x20\x27','.name','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.steps[','has','data','stage','warning','message','Criteria\x20references\x20undefined\x20segment\x20\x27','FEW_STEPS','stages','symbol','jump','.with.activation','condition','Journey\x20name\x20is\x20required','.with.variants','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','document','stepNames','length','branch\x20\x27','decision_point','INVALID_NEXT_REFERENCE','Journey\x20has\x20no\x20goal\x20defined','activations','DUPLICATE_LATEST','Stage\x20\x27','steps','ab_test','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','.stages','path','match','.with.condition.timeout','values','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','SINGLE_INPUT_MERGE','Step\x20references\x20non-existent\x20step\x20\x27',').\x20Merge\x20is\x20unnecessary.','.rule','\x27\x20has\x20no\x20steps','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','105832bgIkTM','source','.entry_criteria','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','referencedSegments','timeout','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','ref:','add','skipSchema','description','activation','percentage','branches','latest','\x20versions)','\x27\x20of\x20\x27','excluded','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','push','Activation\x20step\x20requires\x20an\x20activation\x20reference','merge','BRANCH_DIRECTLY_TO_MERGE','name','13217127YYIGzs','.with.condition','Journey\x20can\x20have\x20at\x20most\x20one\x20','splice','MISSING_ENTRY_CRITERIA','A/B\x20test\x20variant\x20\x27','variants','variant\x20\x27','.with.branches[','TOO_MANY_STAGES','\x27\x20with\x20no\x20action\x20in\x20between','2752176FAzGbq','Merge\x20step\x20\x27','error','journey','ACTIVATION_SCHEMA_ERROR','MISSING_CONDITIONS','MERGE_TO_MERGE_CHAIN','MISSING_NAME','segment','state','MISSING_EXIT_CRITERIA','.next','167016zNcLXa','next','185pkZuhH','excluded_','stages[','MISSING_WAIT_PARAMS','CONVERGENCE_WITHOUT_MERGE','8YZcxVN','version','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','MISSING_SEGMENT_REFERENCE','activationKeys','timeout\x20of\x20\x27','\x27\x20has\x20only\x20','get','versions',').\x20Use\x20a\x20merge\x20step.','MISSING_END_STEP','Embedded\x20segment\x20\x27','rule','UNUSED_EMBEDDED_SEGMENT','type','segments.','INVALID_JUMP_TARGET','sort','success','MISSING_STAGES','2422872ipqwWN','indices'];a169_0x43d7=function(){return _0x47c1e6;};return a169_0x43d7();}function mapJourneyZodIssueToCode(_0x1cbb64,_0x2a28ba){const _0x3bbaba=a169_0x4939;if(_0x2a28ba===_0x3bbaba(0x191))return _0x3bbaba(0x1a4);if(_0x2a28ba['endsWith'](_0x3bbaba(0x117))&&_0x2a28ba[_0x3bbaba(0x145)](_0x3bbaba(0x16b)))return'JOURNEY_SCHEMA_ERROR';if(_0x2a28ba===_0x3bbaba(0x159)||_0x2a28ba['endsWith'](_0x3bbaba(0x16e)))return _0x3bbaba(0x1c3);if(_0x2a28ba===''&&_0x1cbb64[_0x3bbaba(0x156)][_0x3bbaba(0x145)](_0x3bbaba(0x13d)))return _0x3bbaba(0x1c3);if(_0x2a28ba[_0x3bbaba(0x145)](_0x3bbaba(0x185)))return _0x3bbaba(0x1a1);return'JOURNEY_SCHEMA_ERROR';}function a169_0x4939(_0x3e54e0,_0x2bc181){_0x3e54e0=_0x3e54e0-0x10f;const _0x43d7e5=a169_0x43d7();let _0x49396e=_0x43d7e5[_0x3e54e0];return _0x49396e;}function runJourneySemanticChecks(_0x1b56ab,_0x467bb4){const _0x165490=a169_0x4939,_0x30c6ea=[],_0x3a7968=[];(!_0x1b56ab['name']||_0x1b56ab['name']['trim']()==='')&&_0x30c6ea[_0x165490(0x18d)]({'level':_0x165490(0x19f),'path':'name','code':_0x165490(0x1a4),'message':_0x165490(0x15e),'location':getLocationFromPath(_0x467bb4['document'],_0x467bb4[_0x165490(0x17b)],[_0x165490(0x191)])});const _0x28ac07=new Set();if(_0x1b56ab[_0x165490(0x13a)])for(const _0x7bdc6b of Object[_0x165490(0x114)](_0x1b56ab[_0x165490(0x13a)])){_0x28ac07[_0x165490(0x182)](_0x7bdc6b);}const _0x2738a1=new Set();if(_0x1b56ab[_0x165490(0x168)])for(const _0x1d604d of Object['keys'](_0x1b56ab[_0x165490(0x168)])){_0x2738a1[_0x165490(0x182)](_0x1d604d);}const _0x112d9b=new Set(),_0x5667e6={..._0x467bb4,'embeddedSegments':_0x28ac07,'referencedSegments':_0x112d9b,'activationKeys':_0x2738a1[_0x165490(0x14b)]>0x0?_0x2738a1:undefined};if(_0x1b56ab[_0x165490(0x13a)])for(const [_0x4a8fce,_0x2a3684]of Object['entries'](_0x1b56ab['segments'])){const _0x3c0aa9=validateEmbeddedSegment(_0x2a3684,_0x165490(0x1bf)+_0x4a8fce,_0x5667e6);for(const _0x463860 of _0x3c0aa9){if(_0x463860['level']===_0x165490(0x19f))_0x30c6ea['push'](_0x463860);else _0x3a7968[_0x165490(0x18d)](_0x463860);}}const _0x3cb64d=!!_0x1b56ab['goal'],_0x2e6a4d=_0x1b56ab[_0x165490(0x126)]?.['every'](_0x199068=>!!_0x199068[_0x165490(0x144)])??![];!_0x3cb64d&&!_0x2e6a4d&&_0x3a7968[_0x165490(0x18d)]({'level':_0x165490(0x155),'path':'goal','code':'MISSING_GOAL','message':_0x165490(0x167),'location':getLocationFromPath(_0x467bb4[_0x165490(0x161)],_0x467bb4[_0x165490(0x17b)],[_0x165490(0x144)])});const _0x40a226=_0x1b56ab[_0x165490(0x126)]??_0x1b56ab['versions'];if(_0x40a226&&_0x40a226[_0x165490(0x11f)](_0x26f10c=>_0x26f10c[_0x165490(0x188)]===!![])[_0x165490(0x163)]>0x1){const _0x4e46e6=_0x1b56ab[_0x165490(0x126)]?_0x165490(0x126):_0x165490(0x1b8);_0x30c6ea['push']({'level':'error','path':_0x4e46e6,'code':_0x165490(0x169),'message':_0x165490(0x194)+(_0x4e46e6===_0x165490(0x126)?'journey\x20entry':_0x165490(0x1b1))+'\x20with\x20latest:\x20true','location':getLocationFromPath(_0x467bb4[_0x165490(0x161)],_0x467bb4[_0x165490(0x17b)],[_0x4e46e6])});}if(_0x1b56ab[_0x165490(0x126)]&&_0x1b56ab[_0x165490(0x126)][_0x165490(0x163)]>0x0)for(let _0x5de06a=0x0;_0x5de06a<_0x1b56ab['journeys'][_0x165490(0x163)];_0x5de06a++){const _0x528e3d=_0x1b56ab[_0x165490(0x126)][_0x5de06a];if(_0x1b56ab[_0x165490(0x126)]['length']>0x1&&_0x528e3d[_0x165490(0x1a6)]===_0x165490(0x137))continue;const _0x5c7ae6=_0x528e3d['stages']||[],_0x335ec8='journeys['+_0x5de06a+'].',_0x4ac1c1=!!_0x528e3d['goal'],_0x18f0d6=_0x4ac1c1?{..._0x1b56ab,'goal':_0x528e3d['goal']}:_0x1b56ab;validateStagesForVersion(_0x5c7ae6,_0x18f0d6,_0x5667e6,_0x335ec8,_0x30c6ea,_0x3a7968,{'goalIsInherited':!_0x4ac1c1});}else{if(_0x1b56ab['versions']&&_0x1b56ab[_0x165490(0x1b8)]['length']>0x0)for(let _0x2cc689=0x0;_0x2cc689<_0x1b56ab[_0x165490(0x1b8)][_0x165490(0x163)];_0x2cc689++){const _0x4a74e0=_0x1b56ab[_0x165490(0x1b8)][_0x2cc689];if(_0x1b56ab['versions'][_0x165490(0x163)]>0x1&&_0x4a74e0['state']==='launched')continue;const _0xbe5981=_0x4a74e0[_0x165490(0x159)]||[],_0x2336f4='versions['+_0x2cc689+'].';validateStagesForVersion(_0xbe5981,_0x1b56ab,_0x5667e6,_0x2336f4,_0x30c6ea,_0x3a7968);}else{const _0x3f8ae4=_0x1b56ab['stages']||[];validateStagesForVersion(_0x3f8ae4,_0x1b56ab,_0x5667e6,'',_0x30c6ea,_0x3a7968);}}_0x1b56ab[_0x165490(0x126)]&&_0x1b56ab[_0x165490(0x126)]['length']>0x1&&(deduplicateAcrossVersions(_0x30c6ea),deduplicateAcrossVersions(_0x3a7968));for(const _0x39827a of _0x28ac07){!_0x112d9b[_0x165490(0x152)](_0x39827a)&&!_0x39827a[_0x165490(0x124)](_0x165490(0x1ac))&&_0x3a7968[_0x165490(0x18d)]({'level':_0x165490(0x155),'path':_0x165490(0x1bf)+_0x39827a,'code':_0x165490(0x1bd),'message':_0x165490(0x1bb)+_0x39827a+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x467bb4[_0x165490(0x161)],_0x467bb4[_0x165490(0x17b)],[_0x165490(0x13a),_0x39827a])});}return{'valid':_0x30c6ea[_0x165490(0x163)]===0x0,'errors':_0x30c6ea,'warnings':_0x3a7968};}
@@ -1 +1 @@
1
- const a170_0x38c1fc=a170_0x505d;(function(_0x52c737,_0x44a774){const _0x3d993c=a170_0x505d,_0x47b9df=_0x52c737();while(!![]){try{const _0x38b33b=-parseInt(_0x3d993c(0x1e0))/0x1*(-parseInt(_0x3d993c(0x229))/0x2)+-parseInt(_0x3d993c(0x21f))/0x3*(parseInt(_0x3d993c(0x1ce))/0x4)+-parseInt(_0x3d993c(0x199))/0x5*(parseInt(_0x3d993c(0x23d))/0x6)+-parseInt(_0x3d993c(0x22d))/0x7*(-parseInt(_0x3d993c(0x1df))/0x8)+-parseInt(_0x3d993c(0x1a6))/0x9+-parseInt(_0x3d993c(0x1de))/0xa*(-parseInt(_0x3d993c(0x1a7))/0xb)+parseInt(_0x3d993c(0x1a2))/0xc;if(_0x38b33b===_0x44a774)break;else _0x47b9df['push'](_0x47b9df['shift']());}catch(_0x357d08){_0x47b9df['push'](_0x47b9df['shift']());}}}(a170_0x517a,0xac07d));import*as a170_0x1634b1 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(_0x45f8bf){const _0x124fd0=a170_0x505d,_0x119347=_0x45f8bf[_0x124fd0(0x226)]();if(_0x119347==='days'||_0x119347==='day')return _0x124fd0(0x23a);if(_0x119347===_0x124fd0(0x183)||_0x119347===_0x124fd0(0x1a4))return _0x124fd0(0x1a4);return _0x45f8bf;}export function journeyResponseToDefSync(_0x424f8b){const _0x822b26=a170_0x505d,_0x4c5032=_0x424f8b['attributes'],_0xe28bc0=_0x4c5032['journeyBundleName']||_0x4c5032[_0x822b26(0x1d7)],_0x4ec63a={'stages':_0x4c5032[_0x822b26(0x1ae)]['map'](convertApiStageToYaml),'id':_0x424f8b['id']};_0x4c5032[_0x822b26(0x19f)]&&(_0x4ec63a[_0x822b26(0x19f)]=convertApiCriteriaToYaml(_0x4c5032[_0x822b26(0x19f)]));_0x4c5032[_0x822b26(0x1d7)]&&_0x4c5032['name']!==_0xe28bc0&&(_0x4ec63a['version']=_0x4c5032[_0x822b26(0x1d7)]);_0x4c5032[_0x822b26(0x236)]!==undefined&&(_0x4ec63a[_0x822b26(0x18e)]=_0x4c5032[_0x822b26(0x236)]);_0x4c5032['state']&&(_0x4ec63a[_0x822b26(0x215)]=_0x4c5032[_0x822b26(0x215)]===_0x822b26(0x209)?_0x822b26(0x209):'draft');const _0x1bf5e8={'type':'journey','name':_0xe28bc0,'journeys':[_0x4ec63a]};_0x4c5032['description']&&(_0x1bf5e8[_0x822b26(0x1b7)]=_0x4c5032['description']);_0x4c5032[_0x822b26(0x19f)]&&(_0x1bf5e8[_0x822b26(0x19f)]=convertApiCriteriaToYaml(_0x4c5032[_0x822b26(0x19f)]));if(_0x4c5032[_0x822b26(0x214)])_0x1bf5e8[_0x822b26(0x191)]=_0x4c5032['reentryMode'];else _0x4c5032[_0x822b26(0x1f0)]!==undefined&&(_0x1bf5e8[_0x822b26(0x191)]=_0x4c5032[_0x822b26(0x1f0)]?'reentry_always':_0x822b26(0x1b8));return _0x4c5032[_0x822b26(0x1fe)]&&(_0x1bf5e8[_0x822b26(0x1c4)]=_0x4c5032['journeyBundleId']),_0x4c5032[_0x822b26(0x20b)]&&(_0x1bf5e8['bundle_name']=_0x4c5032['journeyBundleName']),_0x424f8b[_0x822b26(0x202)]?.[_0x822b26(0x18f)]?.[_0x822b26(0x1bc)]?.['id']&&(_0x1bf5e8['folder_id']=_0x424f8b[_0x822b26(0x202)]['parentFolder'][_0x822b26(0x1bc)]['id']),_0x1bf5e8;}export async function journeyResponseToDef(_0x519220,_0x3c0f51){const _0x4397c1=a170_0x505d,_0x5083f1=journeyResponseToDefSync(_0x519220);if(!_0x3c0f51)return _0x5083f1;const _0x52f56f=new Set();collectSegmentIdsFromJourney(_0x5083f1,_0x52f56f);const _0x2ae00c=new Set();collectActivationIdsFromJourney(_0x5083f1,_0x2ae00c);const _0x5089a9={},_0x41b808=new Map();for(const _0x1a6126 of Array[_0x4397c1(0x1f4)](_0x52f56f)[_0x4397c1(0x181)]()){if(_0x3c0f51[_0x4397c1(0x21a)]){const _0x1bef2a=await _0x3c0f51[_0x4397c1(0x21a)](_0x1a6126);if(_0x1bef2a[_0x4397c1(0x1a9)]){_0x41b808['set'](_0x1a6126,_0x1bef2a[_0x4397c1(0x1d7)]);if(_0x1bef2a[_0x4397c1(0x244)]){const _0x2feddb={..._0x1bef2a[_0x4397c1(0x244)],'rule':deepSortObject(_0x1bef2a[_0x4397c1(0x244)]['rule'])};_0x5089a9[_0x1bef2a[_0x4397c1(0x1d7)]]=_0x2feddb;}}else _0x41b808[_0x4397c1(0x1d6)](_0x1a6126,makeSegmentRef(_0x1bef2a[_0x4397c1(0x1d7)]));}else{if(_0x3c0f51[_0x4397c1(0x1b3)]){const _0x3bd3e9=await _0x3c0f51[_0x4397c1(0x1b3)](_0x1a6126);_0x41b808[_0x4397c1(0x1d6)](_0x1a6126,_0x3bd3e9);}}}const _0x114e65={},_0x1d010a=new Map();for(const _0x449f9d of Array[_0x4397c1(0x1f4)](_0x2ae00c)[_0x4397c1(0x181)]()){if(_0x3c0f51[_0x4397c1(0x230)]){const _0x52e048=await _0x3c0f51[_0x4397c1(0x230)](_0x449f9d);_0x52e048[_0x4397c1(0x1a9)]?(_0x1d010a[_0x4397c1(0x1d6)](_0x449f9d,_0x52e048[_0x4397c1(0x1d7)]),_0x52e048[_0x4397c1(0x244)]&&(_0x114e65[_0x52e048[_0x4397c1(0x1d7)]]=_0x52e048['definition'])):_0x1d010a[_0x4397c1(0x1d6)](_0x449f9d,makeSegmentRef(_0x52e048['name']));}else{if(_0x3c0f51[_0x4397c1(0x188)]){const _0x44f012=await _0x3c0f51[_0x4397c1(0x188)](_0x449f9d);_0x1d010a['set'](_0x449f9d,_0x44f012);}}}_0x41b808[_0x4397c1(0x19a)]>0x0&&replaceSegmentIdsInJourney(_0x5083f1,_0x41b808);_0x1d010a[_0x4397c1(0x19a)]>0x0&&replaceActivationIdsInJourney(_0x5083f1,_0x1d010a);if(_0x3c0f51[_0x4397c1(0x1b5)]){const _0x55f202=[];collectJumpTargetsFromJourney(_0x5083f1,_0x55f202);if(_0x55f202[_0x4397c1(0x1f8)]>0x0){const _0x8b10d4=new Map();for(const _0x540d87 of _0x55f202){try{const _0x71141b=await _0x3c0f51['resolveJumpTarget'](_0x540d87[_0x4397c1(0x1c1)],_0x540d87['stageId']);_0x8b10d4[_0x4397c1(0x1d6)](_0x540d87[_0x4397c1(0x1c1)]+':'+_0x540d87['stageId'],_0x71141b);}catch{}}_0x8b10d4[_0x4397c1(0x19a)]>0x0&&replaceJumpTargetsInJourney(_0x5083f1,_0x8b10d4);}}return Object['keys'](_0x5089a9)[_0x4397c1(0x1f8)]>0x0&&(_0x5083f1[_0x4397c1(0x22b)]=_0x5089a9),Object[_0x4397c1(0x1e9)](_0x114e65)[_0x4397c1(0x1f8)]>0x0&&(_0x5083f1[_0x4397c1(0x196)]=_0x114e65),_0x5083f1;}function collectSegmentIdsFromJourney(_0x4a2af7,_0x563c5c){const _0x279ada=a170_0x505d;_0x4a2af7[_0x279ada(0x19f)]?.['segment']&&_0x563c5c[_0x279ada(0x1ec)](_0x4a2af7[_0x279ada(0x19f)]['segment']);const _0x5bf077=_0x56562c=>{const _0x1bf65a=_0x279ada;for(const _0xa7970 of _0x56562c){_0xa7970[_0x1bf65a(0x186)]?.['segment']&&_0x563c5c[_0x1bf65a(0x1ec)](_0xa7970['entry_criteria'][_0x1bf65a(0x224)]);if(_0xa7970[_0x1bf65a(0x206)])for(const _0x12b755 of _0xa7970[_0x1bf65a(0x206)]){_0x12b755[_0x1bf65a(0x224)]&&_0x563c5c[_0x1bf65a(0x1ec)](_0x12b755[_0x1bf65a(0x224)]);}_0xa7970[_0x1bf65a(0x217)]?.[_0x1bf65a(0x224)]&&_0x563c5c[_0x1bf65a(0x1ec)](_0xa7970[_0x1bf65a(0x217)]['segment']);if(_0xa7970[_0x1bf65a(0x1fc)])for(const _0x114161 of _0xa7970[_0x1bf65a(0x1fc)]){if(_0x114161[_0x1bf65a(0x222)]===_0x1bf65a(0x220)){const _0x5eab80=_0x114161;for(const _0x436559 of _0x5eab80['with']['branches']){_0x436559[_0x1bf65a(0x224)]&&_0x563c5c['add'](_0x436559['segment']);}}else{if(_0x114161[_0x1bf65a(0x222)]==='wait'){const _0x44c82d=_0x114161;_0x44c82d[_0x1bf65a(0x1a1)][_0x1bf65a(0x192)]?.[_0x1bf65a(0x224)]&&_0x563c5c['add'](_0x44c82d[_0x1bf65a(0x1a1)][_0x1bf65a(0x192)]['segment']);}}}}};if(_0x4a2af7[_0x279ada(0x216)])for(const _0x3bbbed of _0x4a2af7['journeys']){_0x3bbbed[_0x279ada(0x19f)]?.[_0x279ada(0x224)]&&_0x563c5c[_0x279ada(0x1ec)](_0x3bbbed[_0x279ada(0x19f)][_0x279ada(0x224)]),_0x5bf077(_0x3bbbed[_0x279ada(0x241)]);}_0x4a2af7[_0x279ada(0x241)]&&_0x5bf077(_0x4a2af7[_0x279ada(0x241)]);if(_0x4a2af7[_0x279ada(0x1ef)])for(const _0x348a11 of _0x4a2af7[_0x279ada(0x1ef)]){_0x5bf077(_0x348a11[_0x279ada(0x241)]);}}function replaceSegmentIdsInJourney(_0x4444af,_0x47390a){const _0x108da6=a170_0x505d,_0xf69b56=_0x3931e8=>_0x47390a[_0x108da6(0x233)](_0x3931e8)||_0x3931e8;_0x4444af[_0x108da6(0x19f)]?.[_0x108da6(0x224)]&&(_0x4444af['goal'][_0x108da6(0x224)]=_0xf69b56(_0x4444af[_0x108da6(0x19f)]['segment']));const _0x1a1b8f=_0x31203d=>{const _0x34f8a5=_0x108da6;for(const _0x1077b9 of _0x31203d){_0x1077b9[_0x34f8a5(0x186)]?.[_0x34f8a5(0x224)]&&(_0x1077b9[_0x34f8a5(0x186)][_0x34f8a5(0x224)]=_0xf69b56(_0x1077b9[_0x34f8a5(0x186)]['segment']));if(_0x1077b9[_0x34f8a5(0x206)])for(const _0x3d30c0 of _0x1077b9[_0x34f8a5(0x206)]){_0x3d30c0[_0x34f8a5(0x224)]&&(_0x3d30c0[_0x34f8a5(0x224)]=_0xf69b56(_0x3d30c0[_0x34f8a5(0x224)]));}_0x1077b9['milestone']?.[_0x34f8a5(0x224)]&&(_0x1077b9['milestone'][_0x34f8a5(0x224)]=_0xf69b56(_0x1077b9[_0x34f8a5(0x217)][_0x34f8a5(0x224)]));if(_0x1077b9[_0x34f8a5(0x1fc)])for(const _0x253d01 of _0x1077b9[_0x34f8a5(0x1fc)]){if(_0x253d01[_0x34f8a5(0x222)]===_0x34f8a5(0x220)){const _0x5db12f=_0x253d01;for(const _0x3400fe of _0x5db12f[_0x34f8a5(0x1a1)][_0x34f8a5(0x1e6)]){_0x3400fe[_0x34f8a5(0x224)]&&(_0x3400fe[_0x34f8a5(0x224)]=_0xf69b56(_0x3400fe['segment']));}}else{if(_0x253d01[_0x34f8a5(0x222)]===_0x34f8a5(0x23c)){const _0x2c0f20=_0x253d01;_0x2c0f20[_0x34f8a5(0x1a1)][_0x34f8a5(0x192)]?.['segment']&&(_0x2c0f20[_0x34f8a5(0x1a1)][_0x34f8a5(0x192)][_0x34f8a5(0x224)]=_0xf69b56(_0x2c0f20[_0x34f8a5(0x1a1)][_0x34f8a5(0x192)][_0x34f8a5(0x224)]));}}}}};if(_0x4444af[_0x108da6(0x216)])for(const _0x1c4086 of _0x4444af[_0x108da6(0x216)]){_0x1c4086[_0x108da6(0x19f)]?.[_0x108da6(0x224)]&&(_0x1c4086[_0x108da6(0x19f)][_0x108da6(0x224)]=_0xf69b56(_0x1c4086[_0x108da6(0x19f)][_0x108da6(0x224)])),_0x1a1b8f(_0x1c4086[_0x108da6(0x241)]);}_0x4444af[_0x108da6(0x241)]&&_0x1a1b8f(_0x4444af['stages']);if(_0x4444af['versions'])for(const _0x2fb4d1 of _0x4444af[_0x108da6(0x1ef)]){_0x1a1b8f(_0x2fb4d1[_0x108da6(0x241)]);}}function a170_0x517a(){const _0x2b9907=['version','segments:','resolveSegmentName','randomUUID','resolveJumpTarget','Goal\x20Achieved','description','no_reentry','days_of_week','waitStepUnit','daysOfWeek','data','stages:','object','versions:','folder_id','journeyId','Unknown\x20segment\x20\x22','rule','bundle_id','Journey\x20description','conditionTimeoutDuration','Met\x20condition(s)','endsWith','trim','next','schedule','find','end','12tvhUyk','activation_template_id','resolveSegmentId','entries','\x27.\x0a','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','Duration','timeout','set','name','behavior','JOURNEY_SYNTAX_ERROR','ab_test','\x20\x20rule:\x0a','merge','filter','46570hPDkIh','10337696kTjldq','1cbVkGj','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','timedOutPath','activations:','latest','waitStep','branches','waitCondition','.journey.yaml','keys','Date','moveAfter','add','WaitStep','And','versions','allowReentry','segmentId','conditionSegmentId','rootStep','from','rule.type\x20must\x20be\x20\x27And\x27,\x20\x27Or\x27,\x20or\x20\x27Composite\x27,\x20got\x20\x27','replace','Merge','length','resolveActivationId','exitCriterias','isArray','steps','resolveEmbeddedSegmentId','journeyBundleId','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','unit','Composite','relationships','\x27:\x20','root_step','wait_until','exit_criteria','target','activation','launched','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','journeyBundleName','ABTest','resolveStageId','AbTest','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','slice','startsWith','Variant','Send\x20Notification','reentryMode','state','journeys','milestone','DaysOfTheWeek','jump','resolveSegment','match','stringify','push','has','1299444wgTcRl','decision_point','DecisionPoint','type','draft','segment','goal-segment','toLowerCase','customizedSplit','ref:','215942ORYhPb','goal:','segments','ref','7Tqesec','*Max\x20wait\x20','customized_split','resolveActivation','journeyName','Activation','get','embedded','waitStepType','versionNumber','duration','(missing)','Entry\x20Criteria','day','journeyStageId','wait','114tRGEfT','stage','columns','test','stages','segment_id','unique_id','definition','waitUntilDate','values','\x20\x20\x20\x20conditions:\x0a','sort','Condition','weeks','includes','notification','entry_criteria','all','resolveActivationName','conditionTimeoutUnit','attributes','variants','resolveJourneyId','all_columns','version_number','parentFolder','uuid','reentry','condition','connector_config','excluded','null','activations','resolveEmbeddedActivationId','conditions','102610GIuyJa','size','.journey.yml','\x20\x20\x20\x20type:\x20And\x0a','entryCriteria','Jump','goal','End','with','12318852BXCEPg','Expected\x20format:\x0a','week','stageName','7797222WKXqYl','1969HEiBnH','journey','isJourneyLocal','Stage\x201','map','journeys:','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','journeyStages','percentage','folder'];a170_0x517a=function(){return _0x2b9907;};return a170_0x517a();}function collectActivationIdsFromJourney(_0x566870,_0x25a5a1){const _0x49542e=a170_0x505d,_0x47f367=_0x5147f5=>{const _0x4e1fd5=a170_0x505d;for(const _0x4813d5 of _0x5147f5){if(_0x4813d5[_0x4e1fd5(0x1fc)])for(const _0x7739b6 of _0x4813d5['steps']){if(_0x7739b6['type']==='activation'){const _0x45345b=_0x7739b6;_0x45345b[_0x4e1fd5(0x1a1)][_0x4e1fd5(0x208)]&&/^\d+$/[_0x4e1fd5(0x240)](_0x45345b[_0x4e1fd5(0x1a1)]['activation'])&&_0x25a5a1[_0x4e1fd5(0x1ec)](_0x45345b[_0x4e1fd5(0x1a1)][_0x4e1fd5(0x208)]);}}}};if(_0x566870[_0x49542e(0x216)])for(const _0x2e120b of _0x566870[_0x49542e(0x216)]){_0x47f367(_0x2e120b[_0x49542e(0x241)]);}_0x566870[_0x49542e(0x241)]&&_0x47f367(_0x566870[_0x49542e(0x241)]);if(_0x566870[_0x49542e(0x1ef)])for(const _0x1d54d9 of _0x566870[_0x49542e(0x1ef)]){_0x47f367(_0x1d54d9[_0x49542e(0x241)]);}}function replaceActivationIdsInJourney(_0x28576b,_0x5af5e4){const _0x21ba5e=a170_0x505d,_0x102715=_0x3c49d2=>_0x5af5e4['get'](_0x3c49d2)||_0x3c49d2,_0x52f5d3=_0x2cb9dc=>{const _0x551a98=a170_0x505d;for(const _0x2c9468 of _0x2cb9dc){if(_0x2c9468[_0x551a98(0x1fc)])for(const _0x20ddb5 of _0x2c9468[_0x551a98(0x1fc)]){if(_0x20ddb5[_0x551a98(0x222)]===_0x551a98(0x208)){const _0x5e8b7d=_0x20ddb5;_0x5e8b7d[_0x551a98(0x1a1)][_0x551a98(0x208)]&&(_0x5e8b7d[_0x551a98(0x1a1)]['activation']=_0x102715(_0x5e8b7d['with'][_0x551a98(0x208)]));}}}};if(_0x28576b['journeys'])for(const _0x533bcc of _0x28576b[_0x21ba5e(0x216)]){_0x52f5d3(_0x533bcc[_0x21ba5e(0x241)]);}_0x28576b[_0x21ba5e(0x241)]&&_0x52f5d3(_0x28576b[_0x21ba5e(0x241)]);if(_0x28576b[_0x21ba5e(0x1ef)])for(const _0x26c9c0 of _0x28576b[_0x21ba5e(0x1ef)]){_0x52f5d3(_0x26c9c0['stages']);}}function collectJumpTargetsFromJourney(_0x1bc4de,_0x59c9d5){const _0x669204=a170_0x505d,_0x58ee42=new Set(),_0x4628af=_0x16b174=>{const _0x211619=a170_0x505d;for(const _0x42fcba of _0x16b174){if(_0x42fcba[_0x211619(0x1fc)])for(const _0xe347c6 of _0x42fcba[_0x211619(0x1fc)]){if(_0xe347c6[_0x211619(0x222)]===_0x211619(0x219)){const _0x311cfc=_0xe347c6,_0x47a89e=_0x311cfc[_0x211619(0x1a1)][_0x211619(0x207)];if(_0x47a89e['journey']&&_0x47a89e[_0x211619(0x23e)]&&/^\d+$/[_0x211619(0x240)](_0x47a89e['journey'])&&/^\d+$/[_0x211619(0x240)](_0x47a89e[_0x211619(0x23e)])){const _0x529252=_0x47a89e[_0x211619(0x1a8)]+':'+_0x47a89e[_0x211619(0x23e)];!_0x58ee42[_0x211619(0x21e)](_0x529252)&&(_0x58ee42[_0x211619(0x1ec)](_0x529252),_0x59c9d5[_0x211619(0x21d)]({'journeyId':_0x47a89e[_0x211619(0x1a8)],'stageId':_0x47a89e[_0x211619(0x23e)]}));}}}}};if(_0x1bc4de['journeys'])for(const _0x482187 of _0x1bc4de[_0x669204(0x216)]){_0x4628af(_0x482187['stages']);}_0x1bc4de['stages']&&_0x4628af(_0x1bc4de[_0x669204(0x241)]);if(_0x1bc4de['versions'])for(const _0x36eb09 of _0x1bc4de[_0x669204(0x1ef)]){_0x4628af(_0x36eb09[_0x669204(0x241)]);}}function replaceJumpTargetsInJourney(_0x32f939,_0x2ff5f0){const _0x38eecf=a170_0x505d,_0x1a0ed0=_0x24c166=>{const _0x3a1462=a170_0x505d;for(const _0x10c091 of _0x24c166){if(_0x10c091['steps'])for(const _0x2d34e3 of _0x10c091[_0x3a1462(0x1fc)]){if(_0x2d34e3[_0x3a1462(0x222)]===_0x3a1462(0x219)){const _0x4e544f=_0x2d34e3,_0x22d50f=_0x4e544f[_0x3a1462(0x1a1)][_0x3a1462(0x207)],_0x1e56b7=_0x22d50f[_0x3a1462(0x1a8)]+':'+_0x22d50f[_0x3a1462(0x23e)],_0xb21d27=_0x2ff5f0[_0x3a1462(0x233)](_0x1e56b7);_0xb21d27&&(_0x22d50f[_0x3a1462(0x1a8)]=_0xb21d27[_0x3a1462(0x231)],_0x22d50f[_0x3a1462(0x23e)]=_0xb21d27[_0x3a1462(0x1a5)]);}}}};if(_0x32f939[_0x38eecf(0x216)])for(const _0x18727e of _0x32f939[_0x38eecf(0x216)]){_0x1a0ed0(_0x18727e['stages']);}_0x32f939[_0x38eecf(0x241)]&&_0x1a0ed0(_0x32f939[_0x38eecf(0x241)]);if(_0x32f939[_0x38eecf(0x1ef)])for(const _0xc4c5a5 of _0x32f939[_0x38eecf(0x1ef)]){_0x1a0ed0(_0xc4c5a5[_0x38eecf(0x241)]);}}function generateReadableStepName(_0x3db35e,_0x45f9aa){const _0x1adc0=a170_0x505d;if(_0x3db35e[_0x1adc0(0x1d7)]&&_0x3db35e[_0x1adc0(0x1d7)]!==_0x3db35e[_0x1adc0(0x222)]){const _0x1cc464=_0x3db35e[_0x1adc0(0x1d7)][_0x1adc0(0x1c9)]();if(_0x1cc464&&/[a-z0-9\p{L}]/iu['test'](_0x1cc464))return _0x1cc464;}const _0x4ba30c=_0x3db35e['type'][_0x1adc0(0x226)]()[_0x1adc0(0x1f6)](/step$/i,'');return _0x4ba30c+'_'+(_0x45f9aa+0x1);}function getStepNextRefs(_0x263011){const _0x5ab296=a170_0x505d,_0x4a7547=[];if(_0x263011['next'])_0x4a7547['push'](_0x263011[_0x5ab296(0x1ca)]);if(_0x263011[_0x5ab296(0x1e6)])for(const _0x284f7f of _0x263011[_0x5ab296(0x1e6)]){if(_0x284f7f[_0x5ab296(0x1ca)])_0x4a7547['push'](_0x284f7f[_0x5ab296(0x1ca)]);}if(_0x263011[_0x5ab296(0x18b)])for(const _0x3cd06f of _0x263011['variants']){if(_0x3cd06f[_0x5ab296(0x1ca)])_0x4a7547['push'](_0x3cd06f['next']);}if(_0x263011['conditions'])for(const _0x628c65 of _0x263011[_0x5ab296(0x198)]){if(_0x628c65[_0x5ab296(0x1ca)])_0x4a7547[_0x5ab296(0x21d)](_0x628c65[_0x5ab296(0x1ca)]);}return _0x4a7547;}function parseJumpTargetDisplayName(_0x14175a){const _0x39ed82=a170_0x505d,_0x4366f5=_0x14175a[_0x39ed82(0x21b)](/^(.+?)\s*\(([^/)]+)/);if(!_0x4366f5)return undefined;const _0x305ccc=_0x4366f5[0x1][_0x39ed82(0x1c9)](),_0x5d4c54=_0x4366f5[0x2][_0x39ed82(0x1c9)]();if(!_0x305ccc||!_0x5d4c54)return undefined;return{'stageName':_0x305ccc,'journeyName':_0x5d4c54};}function orderStepsFromRoot(_0x182b9c,_0x409982){const _0x1d9536=a170_0x505d,_0x37e4b0=Object[_0x1d9536(0x1d1)](_0x182b9c);if(_0x37e4b0['length']===0x0)return[];const _0xc5114e=new Set(_0x37e4b0['map'](([_0x1bd91b])=>_0x1bd91b)),_0x47387d=new Set();for(const [,_0x2abd55]of _0x37e4b0){for(const _0x4c67b7 of getStepNextRefs(_0x2abd55)){if(_0xc5114e[_0x1d9536(0x21e)](_0x4c67b7))_0x47387d['add'](_0x4c67b7);}}let _0x355188=_0x409982&&_0xc5114e[_0x1d9536(0x21e)](_0x409982)?_0x409982:undefined;if(!_0x355188){const _0x3ff848=_0x37e4b0[_0x1d9536(0x1dd)](([_0xa850bb])=>!_0x47387d[_0x1d9536(0x21e)](_0xa850bb));_0x3ff848[_0x1d9536(0x1f8)]>0x0?_0x355188=_0x3ff848[0x0][0x0]:_0x355188=_0x37e4b0[0x0][0x0];}const _0x448bda=[],_0x1a9258=new Set(),_0x3c5913=[_0x355188];while(_0x3c5913[_0x1d9536(0x1f8)]>0x0){const _0x137cae=_0x3c5913['shift']();if(_0x1a9258[_0x1d9536(0x21e)](_0x137cae))continue;_0x1a9258['add'](_0x137cae);const _0x444f7f=_0x182b9c[_0x137cae];if(!_0x444f7f)continue;_0x448bda[_0x1d9536(0x21d)]({'uuid':_0x137cae,'step':_0x444f7f});for(const _0xdf21e6 of getStepNextRefs(_0x444f7f)){_0xc5114e[_0x1d9536(0x21e)](_0xdf21e6)&&!_0x1a9258[_0x1d9536(0x21e)](_0xdf21e6)&&_0x3c5913[_0x1d9536(0x21d)](_0xdf21e6);}}for(const [_0x3330ef,_0x80963e]of _0x37e4b0){!_0x1a9258[_0x1d9536(0x21e)](_0x3330ef)&&_0x448bda[_0x1d9536(0x21d)]({'uuid':_0x3330ef,'step':_0x80963e});}return _0x448bda;}function resolveStepReferences(_0x2c2423,_0x549682,_0x5a454d,_0x649865){const _0x8e1d34=a170_0x505d;if(_0x2c2423[_0x8e1d34(0x222)]!==_0x8e1d34(0x1cd)){_0x2c2423['next']&&_0x649865[_0x8e1d34(0x21e)](_0x2c2423['next'])&&(_0x2c2423['next']=_0x649865[_0x8e1d34(0x233)](_0x2c2423[_0x8e1d34(0x1ca)]));const _0x19d642=_0x549682+0x1;if(_0x19d642<_0x5a454d[_0x8e1d34(0x1f8)]){const _0x3c9465=_0x649865[_0x8e1d34(0x233)](_0x5a454d[_0x19d642]['uuid']);_0x2c2423[_0x8e1d34(0x1ca)]===_0x3c9465&&delete _0x2c2423[_0x8e1d34(0x1ca)];}}if(_0x2c2423[_0x8e1d34(0x222)]==='decision_point')for(const _0xa78537 of _0x2c2423[_0x8e1d34(0x1a1)][_0x8e1d34(0x1e6)]){_0xa78537[_0x8e1d34(0x1ca)]&&_0x649865[_0x8e1d34(0x21e)](_0xa78537['next'])&&(_0xa78537[_0x8e1d34(0x1ca)]=_0x649865[_0x8e1d34(0x233)](_0xa78537[_0x8e1d34(0x1ca)]));}if(_0x2c2423[_0x8e1d34(0x222)]===_0x8e1d34(0x1da))for(const _0x210c43 of _0x2c2423[_0x8e1d34(0x1a1)]['variants']){_0x210c43[_0x8e1d34(0x1ca)]&&_0x649865[_0x8e1d34(0x21e)](_0x210c43[_0x8e1d34(0x1ca)])&&(_0x210c43[_0x8e1d34(0x1ca)]=_0x649865[_0x8e1d34(0x233)](_0x210c43[_0x8e1d34(0x1ca)]));}if(_0x2c2423[_0x8e1d34(0x222)]===_0x8e1d34(0x23c)&&_0x2c2423[_0x8e1d34(0x1a1)][_0x8e1d34(0x192)]){const _0x4985e5=_0x2c2423['with'][_0x8e1d34(0x192)];_0x4985e5[_0x8e1d34(0x1ca)]&&_0x649865['has'](_0x4985e5[_0x8e1d34(0x1ca)])&&(_0x4985e5[_0x8e1d34(0x1ca)]=_0x649865[_0x8e1d34(0x233)](_0x4985e5[_0x8e1d34(0x1ca)])),_0x4985e5['timeout']?.['next']&&_0x649865[_0x8e1d34(0x21e)](_0x4985e5[_0x8e1d34(0x1d5)][_0x8e1d34(0x1ca)])&&(_0x4985e5[_0x8e1d34(0x1d5)]['next']=_0x649865[_0x8e1d34(0x233)](_0x4985e5['timeout']['next']));}}function convertApiStageToYaml(_0x41e340){const _0x1b3c6a=a170_0x505d,_0x477655={'name':_0x41e340[_0x1b3c6a(0x1d7)]};_0x41e340['id']&&(_0x477655['id']=_0x41e340['id']);_0x41e340[_0x1b3c6a(0x1b7)]&&(_0x477655[_0x1b3c6a(0x1b7)]=_0x41e340[_0x1b3c6a(0x1b7)]);_0x41e340[_0x1b3c6a(0x19d)]&&(_0x477655['entry_criteria']=convertApiCriteriaToYaml(_0x41e340['entryCriteria']));_0x41e340[_0x1b3c6a(0x1fa)]&&_0x41e340[_0x1b3c6a(0x1fa)][_0x1b3c6a(0x1f8)]>0x0&&(_0x477655[_0x1b3c6a(0x206)]=_0x41e340[_0x1b3c6a(0x1fa)][_0x1b3c6a(0x1ab)](convertApiCriteriaToYaml));_0x41e340[_0x1b3c6a(0x217)]&&(_0x477655[_0x1b3c6a(0x217)]=convertApiCriteriaToYaml(_0x41e340['milestone']));if(_0x41e340['steps']&&Object[_0x1b3c6a(0x1e9)](_0x41e340[_0x1b3c6a(0x1fc)])[_0x1b3c6a(0x1f8)]>0x0){const _0x42a007=orderStepsFromRoot(_0x41e340[_0x1b3c6a(0x1fc)],_0x41e340[_0x1b3c6a(0x1f3)]),_0x182a4e=new Map(),_0x491d5c=new Set();for(let _0x166dd0=0x0;_0x166dd0<_0x42a007[_0x1b3c6a(0x1f8)];_0x166dd0++){const {uuid:_0x40b9e9,step:_0x4bb5f3}=_0x42a007[_0x166dd0];let _0x5c4b7e=generateReadableStepName(_0x4bb5f3,_0x166dd0),_0x3e7131=_0x5c4b7e,_0xbeb333=0x2;while(_0x491d5c['has'](_0x3e7131)){_0x3e7131=_0x5c4b7e+'_'+_0xbeb333,_0xbeb333++;}_0x491d5c['add'](_0x3e7131),_0x182a4e[_0x1b3c6a(0x1d6)](_0x40b9e9,_0x3e7131);}_0x477655[_0x1b3c6a(0x1fc)]=_0x42a007['map'](({uuid:_0x28b91b,step:_0x2f8f23},_0x45f17b)=>{const _0x209aad=_0x1b3c6a,_0x2580de=convertApiStepToYaml(_0x2f8f23,_0x182a4e[_0x209aad(0x233)](_0x28b91b));return resolveStepReferences(_0x2580de,_0x45f17b,_0x42a007,_0x182a4e),_0x2580de;});}return _0x477655;}function convertApiCriteriaToYaml(_0x26bea7){const _0x119b2e=a170_0x505d,_0x580f9c={'name':_0x26bea7[_0x119b2e(0x1d7)],'segment':_0x26bea7[_0x119b2e(0x1f1)]};_0x26bea7['description']&&(_0x580f9c[_0x119b2e(0x1b7)]=_0x26bea7[_0x119b2e(0x1b7)]);if(_0x26bea7['target']){let _0x32f00f=_0x26bea7['target'][_0x119b2e(0x1c1)],_0x2016b0=_0x26bea7['target'][_0x119b2e(0x23b)];if(_0x26bea7[_0x119b2e(0x207)][_0x119b2e(0x231)]){const _0x1a1811=parseJumpTargetDisplayName(_0x26bea7[_0x119b2e(0x207)][_0x119b2e(0x231)]);_0x1a1811&&(_0x2016b0=_0x1a1811[_0x119b2e(0x1a5)],_0x32f00f=_0x1a1811[_0x119b2e(0x231)]);}_0x580f9c['target']={'journey':_0x32f00f,'stage':_0x2016b0},_0x26bea7[_0x119b2e(0x207)][_0x119b2e(0x1fe)]&&(_0x580f9c[_0x119b2e(0x207)]['bundle_id']=_0x26bea7[_0x119b2e(0x207)]['journeyBundleId']);}return _0x580f9c;}function convertApiStepToYaml(_0x5b171c,_0x5b54de){const _0x514f5f=a170_0x505d;switch(_0x5b171c[_0x514f5f(0x222)]){case _0x514f5f(0x1ed):{const _0x2c3b0f={};if(_0x5b171c['waitStepType']===_0x514f5f(0x1d4)&&_0x5b171c[_0x514f5f(0x1e5)]!==undefined)_0x2c3b0f[_0x514f5f(0x237)]=_0x5b171c['waitStep'],_0x2c3b0f[_0x514f5f(0x200)]=_0x5b171c[_0x514f5f(0x1ba)];else{if(_0x5b171c[_0x514f5f(0x235)]===_0x514f5f(0x1ea)&&_0x5b171c[_0x514f5f(0x245)])_0x2c3b0f[_0x514f5f(0x205)]=_0x5b171c[_0x514f5f(0x245)];else{if(_0x5b171c[_0x514f5f(0x235)]===_0x514f5f(0x218)&&_0x5b171c['daysOfWeek'])_0x2c3b0f[_0x514f5f(0x1b9)]=_0x5b171c[_0x514f5f(0x1bb)];else{if(_0x5b171c[_0x514f5f(0x235)]===_0x514f5f(0x182)){if(_0x5b171c['conditions']&&_0x5b171c[_0x514f5f(0x198)]['length']>0x0){const _0x5d5f73=_0x5b171c['conditions']['find'](_0x23c0e9=>!_0x23c0e9[_0x514f5f(0x1e2)]),_0x2d075d=_0x5b171c[_0x514f5f(0x198)][_0x514f5f(0x1cc)](_0x3b871c=>_0x3b871c[_0x514f5f(0x1e2)]);_0x5d5f73?.[_0x514f5f(0x1f1)]&&(_0x2c3b0f[_0x514f5f(0x192)]={'segment':_0x5d5f73[_0x514f5f(0x1f1)],..._0x5d5f73[_0x514f5f(0x1ca)]?{'next':_0x5d5f73[_0x514f5f(0x1ca)]}:{}},_0x2d075d&&_0x2d075d[_0x514f5f(0x1eb)]!==undefined&&_0x2d075d[_0x514f5f(0x200)]&&(_0x2c3b0f[_0x514f5f(0x192)][_0x514f5f(0x1d5)]={'duration':_0x2d075d[_0x514f5f(0x1eb)],'unit':_0x2d075d[_0x514f5f(0x200)],..._0x2d075d[_0x514f5f(0x1ca)]?{'next':_0x2d075d[_0x514f5f(0x1ca)]}:{}}));}else _0x5b171c[_0x514f5f(0x1f2)]&&(_0x2c3b0f['condition']={'segment':_0x5b171c[_0x514f5f(0x1f2)]},_0x5b171c[_0x514f5f(0x1c6)]!==undefined&&_0x5b171c[_0x514f5f(0x189)]&&(_0x2c3b0f[_0x514f5f(0x192)][_0x514f5f(0x1d5)]={'duration':_0x5b171c[_0x514f5f(0x1c6)],'unit':_0x5b171c[_0x514f5f(0x189)]}));}}}}const _0x176945={'type':_0x514f5f(0x23c),'name':_0x5b54de,..._0x5b171c['next']?{'next':_0x5b171c[_0x514f5f(0x1ca)]}:{},'with':_0x2c3b0f};return _0x176945;}case'Activation':{const _0xe26b90={'type':_0x514f5f(0x208),'name':_0x5b54de,..._0x5b171c[_0x514f5f(0x1ca)]?{'next':_0x5b171c[_0x514f5f(0x1ca)]}:{},'with':{'activation':_0x5b171c['journeyActivationStepId']||''}};return _0xe26b90;}case _0x514f5f(0x221):{const _0x4f803e={'type':_0x514f5f(0x220),'name':_0x5b54de,..._0x5b171c[_0x514f5f(0x1ca)]?{'next':_0x5b171c[_0x514f5f(0x1ca)]}:{},'with':{'branches':(_0x5b171c[_0x514f5f(0x1e6)]||[])['map'](_0x5844ba=>({'name':_0x5844ba[_0x514f5f(0x1d7)],'segment':_0x5844ba[_0x514f5f(0x1f1)],'excluded':_0x5844ba['excludedPath'],..._0x5844ba['next']?{'next':_0x5844ba[_0x514f5f(0x1ca)]}:{}}))}};return _0x4f803e;}case _0x514f5f(0x20c):case _0x514f5f(0x20e):case _0x514f5f(0x212):{const _0x4a80fa=_0x5b171c[_0x514f5f(0x18b)]||(_0x5b171c[_0x514f5f(0x1e6)]||[])[_0x514f5f(0x1ab)](_0xdc3302=>({'name':_0xdc3302[_0x514f5f(0x1d7)],'percentage':0x0,'next':_0xdc3302[_0x514f5f(0x1ca)]})),_0x2f0eaf={'type':_0x514f5f(0x1da),'name':_0x5b54de,..._0x5b171c[_0x514f5f(0x1ca)]?{'next':_0x5b171c['next']}:{},'with':{'customized_split':_0x5b171c[_0x514f5f(0x227)],'unique_id':_0x5b171c['uniqueId'],'variants':_0x4a80fa[_0x514f5f(0x1ab)](_0x59535b=>({'name':_0x59535b[_0x514f5f(0x1d7)],'percentage':_0x59535b['percentage'],..._0x59535b[_0x514f5f(0x1ca)]?{'next':_0x59535b[_0x514f5f(0x1ca)]}:{}}))}};return _0x2f0eaf;}case _0x514f5f(0x1f7):{const _0x5b03d8={'type':_0x514f5f(0x1dc),'name':_0x5b54de,..._0x5b171c['next']?{'next':_0x5b171c['next']}:{}};return _0x5b03d8;}case _0x514f5f(0x19e):{let _0x202fb7='',_0x341c91='',_0x2f30de;if(_0x5b171c['target']){_0x202fb7=_0x5b171c['target'][_0x514f5f(0x1c1)],_0x341c91=_0x5b171c['target'][_0x514f5f(0x23b)],_0x2f30de=_0x5b171c[_0x514f5f(0x207)][_0x514f5f(0x1fe)];if(_0x5b171c[_0x514f5f(0x207)]['journeyName']){const _0x1e76a2=parseJumpTargetDisplayName(_0x5b171c[_0x514f5f(0x207)]['journeyName']);_0x1e76a2&&(_0x341c91=_0x1e76a2[_0x514f5f(0x1a5)],_0x202fb7=_0x1e76a2[_0x514f5f(0x231)]);}}const _0x160d09={'type':_0x514f5f(0x219),'name':_0x5b54de,..._0x5b171c[_0x514f5f(0x1ca)]?{'next':_0x5b171c[_0x514f5f(0x1ca)]}:{},'with':{'target':{'journey':_0x202fb7,'stage':_0x341c91,..._0x2f30de?{'bundle_id':_0x2f30de}:{}}}};return _0x160d09;}case'End':{const _0x4413ce={'type':_0x514f5f(0x1cd),'name':_0x5b54de};return _0x4413ce;}default:{const _0x4aa84d={'type':'end','name':_0x5b54de};return _0x4aa84d;}}}export async function journeyDefToRequest(_0x3badfb,_0x5adf9c,_0x3b5d53){const _0x24c9ce=a170_0x505d,_0x2552a4=_0x3badfb[_0x24c9ce(0x241)]||getActiveStages(_0x3badfb),_0x484e7c=isJourneysArrayMode(_0x3badfb)||isMultiVersionMode(_0x3badfb)?getLatestJourneyEntry(_0x3badfb):undefined,_0x32c984=_0x484e7c?.['version']??_0x3badfb[_0x24c9ce(0x1d7)],_0x27e8e1=_0x3badfb[_0x24c9ce(0x22b)]||{},_0x4e1a65=_0x3badfb[_0x24c9ce(0x196)]||{},_0x58d545={'type':_0x24c9ce(0x1a8),'attributes':{'name':_0x32c984,'audienceId':_0x5adf9c,'journeyStages':await Promise[_0x24c9ce(0x187)](_0x2552a4[_0x24c9ce(0x1ab)](_0x4e2963=>convertYamlStageToApi(_0x4e2963,_0x3b5d53,_0x27e8e1,_0x4e1a65)))}},_0x43443b=_0x484e7c?.['id']??_0x3badfb['id'];_0x43443b&&(_0x58d545['id']=_0x43443b);_0x3badfb[_0x24c9ce(0x1b7)]&&(_0x58d545[_0x24c9ce(0x18a)][_0x24c9ce(0x1b7)]=_0x3badfb['description']);const _0x7bdd41=getEffectiveGoal(_0x3badfb);_0x7bdd41&&(_0x58d545[_0x24c9ce(0x18a)][_0x24c9ce(0x19f)]=await convertYamlCriteriaToApi(_0x7bdd41,_0x3b5d53,_0x27e8e1));const _0x3685a5=getEffectiveReentry(_0x3badfb);return _0x3685a5&&(_0x58d545[_0x24c9ce(0x18a)][_0x24c9ce(0x214)]=_0x3685a5,_0x58d545[_0x24c9ce(0x18a)][_0x24c9ce(0x1f0)]=_0x3685a5!==_0x24c9ce(0x1b8)),_0x3badfb['folder_id']&&(_0x58d545['relationships']={'parentFolder':{'data':{'id':_0x3badfb[_0x24c9ce(0x1c0)],'type':_0x24c9ce(0x1b0)}}}),_0x58d545;}async function convertYamlStageToApi(_0x3dbe43,_0x3f93aa,_0x3f1590={},_0x7681f8={}){const _0x6aae52=a170_0x505d,_0x5e181d={'name':_0x3dbe43[_0x6aae52(0x1d7)]};_0x3dbe43['id']&&(_0x5e181d['id']=_0x3dbe43['id']);_0x3dbe43['description']&&(_0x5e181d['description']=_0x3dbe43['description']);_0x3dbe43['entry_criteria']&&(_0x5e181d['entryCriteria']=await convertYamlCriteriaToApi(_0x3dbe43[_0x6aae52(0x186)],_0x3f93aa,_0x3f1590));_0x3dbe43[_0x6aae52(0x206)]&&_0x3dbe43['exit_criteria']['length']>0x0&&(_0x5e181d['exitCriterias']=await Promise[_0x6aae52(0x187)](_0x3dbe43[_0x6aae52(0x206)][_0x6aae52(0x1ab)](_0x46c940=>convertYamlCriteriaToApi(_0x46c940,_0x3f93aa,_0x3f1590))));_0x3dbe43['milestone']&&(_0x5e181d[_0x6aae52(0x217)]=await convertYamlCriteriaToApi(_0x3dbe43[_0x6aae52(0x217)],_0x3f93aa,_0x3f1590));if(_0x3dbe43[_0x6aae52(0x1fc)]&&_0x3dbe43[_0x6aae52(0x1fc)][_0x6aae52(0x1f8)]>0x0){const _0x751368={},_0x48a050=_0x3dbe43[_0x6aae52(0x1fc)][_0x6aae52(0x1ab)]((_0x3551bb,_0x2131fe)=>{const _0x2866f5=_0x6aae52,_0x1686a4=_0x3551bb[_0x2866f5(0x190)]||generateUUID(),_0x586c07=_0x3551bb[_0x2866f5(0x1d7)]||_0x3551bb[_0x2866f5(0x222)]+'_'+_0x2131fe;return _0x751368[_0x586c07]=_0x1686a4,{..._0x3551bb,'name':_0x586c07};});_0x5e181d[_0x6aae52(0x1f3)]=_0x751368[_0x48a050[0x0]['name']],_0x5e181d[_0x6aae52(0x1fc)]={};for(let _0x24e4a6=0x0;_0x24e4a6<_0x48a050['length'];_0x24e4a6++){const _0x8bd9b2=_0x48a050[_0x24e4a6],_0x368711=_0x751368[_0x8bd9b2[_0x6aae52(0x1d7)]],_0x5a5390=!_0x8bd9b2['next']&&_0x24e4a6<_0x48a050[_0x6aae52(0x1f8)]-0x1&&_0x8bd9b2[_0x6aae52(0x222)]!==_0x6aae52(0x1cd)?_0x48a050[_0x24e4a6+0x1]['name']:_0x8bd9b2[_0x6aae52(0x1ca)],_0x21ff73=_0x5a5390!==_0x8bd9b2[_0x6aae52(0x1ca)]?{..._0x8bd9b2,'next':_0x5a5390}:_0x8bd9b2;_0x5e181d[_0x6aae52(0x1fc)][_0x368711]=await convertYamlStepToApi(_0x21ff73,_0x3f93aa,_0x3f1590,_0x751368,_0x7681f8);}}else _0x3dbe43[_0x6aae52(0x204)]&&(_0x5e181d[_0x6aae52(0x1f3)]=_0x3dbe43[_0x6aae52(0x204)]);return _0x5e181d;}async function convertYamlCriteriaToApi(_0x1da1b1,_0x430661,_0xd3bd2={}){const _0x2970d3=a170_0x505d;let _0xca47fe=_0x1da1b1['segment'];if(_0xca47fe&&!/^\d+$/[_0x2970d3(0x240)](_0xca47fe)){const _0x3ef6c1=parseSegmentRef(_0xca47fe);if(_0x3ef6c1[_0x2970d3(0x222)]===_0x2970d3(0x22c))_0x430661?.[_0x2970d3(0x1d0)]&&(_0xca47fe=await _0x430661[_0x2970d3(0x1d0)](_0x3ef6c1['name']));else{if(_0x3ef6c1[_0x2970d3(0x222)]===_0x2970d3(0x234)&&_0xd3bd2[_0x3ef6c1[_0x2970d3(0x1d7)]])_0x430661?.[_0x2970d3(0x1fd)]&&(_0xca47fe=await _0x430661[_0x2970d3(0x1fd)](_0x3ef6c1['name'],_0xd3bd2[_0x3ef6c1['name']]));else _0x430661?.[_0x2970d3(0x1d0)]&&(_0xca47fe=await _0x430661[_0x2970d3(0x1d0)](_0x3ef6c1[_0x2970d3(0x1d7)]));}}const _0x3caf08={'name':_0x1da1b1[_0x2970d3(0x1d7)],'segmentId':_0xca47fe};_0x1da1b1['description']&&(_0x3caf08['description']=_0x1da1b1[_0x2970d3(0x1b7)]);if(_0x1da1b1[_0x2970d3(0x207)]){const _0x1693c7=_0x1da1b1[_0x2970d3(0x207)][_0x2970d3(0x1a8)],_0x9b37b0=_0x1da1b1[_0x2970d3(0x207)][_0x2970d3(0x23e)];let _0x1b6e65=_0x1da1b1[_0x2970d3(0x207)][_0x2970d3(0x1a8)];_0x430661?.['resolveJourneyId']&&!/^\d+$/[_0x2970d3(0x240)](_0x1b6e65)&&(_0x1b6e65=await _0x430661[_0x2970d3(0x18c)](_0x1b6e65));let _0x58280f=_0x1da1b1['target'][_0x2970d3(0x23e)];_0x430661?.['resolveStageId']&&!/^\d+$/[_0x2970d3(0x240)](_0x58280f)&&(_0x58280f=await _0x430661[_0x2970d3(0x20d)](_0x1b6e65,_0x58280f));const _0x380594=!/^\d+$/[_0x2970d3(0x240)](_0x1693c7)&&!isLocalJourneyRef(_0x1693c7)?formatApiJourneyName(_0x1693c7,_0x9b37b0):undefined;_0x3caf08[_0x2970d3(0x207)]={'journeyId':_0x1b6e65,'journeyStageId':_0x58280f,'journeyName':_0x380594,'confirmed':!![]},_0x1da1b1[_0x2970d3(0x207)]['bundle_id']&&(_0x3caf08[_0x2970d3(0x207)]['journeyBundleId']=_0x1da1b1[_0x2970d3(0x207)][_0x2970d3(0x1c4)]);}return _0x3caf08;}async function convertYamlStepToApi(_0x1ef576,_0x239e84,_0x454081={},_0xcdcbbe={},_0x3b3e30={}){const _0xe95737=a170_0x505d,_0x4ecb7b=async _0x3ad330=>{const _0x731f16=a170_0x505d;if(/^\d+$/[_0x731f16(0x240)](_0x3ad330))return _0x3ad330;const _0x55364d=parseSegmentRef(_0x3ad330);if(_0x55364d[_0x731f16(0x222)]===_0x731f16(0x22c)){if(_0x239e84?.['resolveSegmentId'])return await _0x239e84[_0x731f16(0x1d0)](_0x55364d[_0x731f16(0x1d7)]);}else{if(_0x55364d['type']===_0x731f16(0x234)&&_0x454081[_0x55364d[_0x731f16(0x1d7)]]){if(_0x239e84?.[_0x731f16(0x1fd)])return await _0x239e84['resolveEmbeddedSegmentId'](_0x55364d[_0x731f16(0x1d7)],_0x454081[_0x55364d[_0x731f16(0x1d7)]]);}else{if(_0x239e84?.['resolveSegmentId'])return await _0x239e84[_0x731f16(0x1d0)](_0x55364d[_0x731f16(0x1d7)]);}}return _0x3ad330;},_0xbf009=async _0x1ee536=>{const _0x1abab6=a170_0x505d;if(/^\d+$/[_0x1abab6(0x240)](_0x1ee536))return _0x1ee536;const _0x249296=parseSegmentRef(_0x1ee536);if(_0x249296[_0x1abab6(0x222)]===_0x1abab6(0x22c)){if(_0x239e84?.['resolveActivationId'])return await _0x239e84[_0x1abab6(0x1f9)](_0x249296[_0x1abab6(0x1d7)]);return _0x249296[_0x1abab6(0x1d7)];}else{if(_0x249296['type']===_0x1abab6(0x234)&&_0x3b3e30[_0x249296[_0x1abab6(0x1d7)]]){if(_0x239e84?.[_0x1abab6(0x197)])return await _0x239e84['resolveEmbeddedActivationId'](_0x249296['name'],_0x3b3e30[_0x249296['name']]);if(_0x239e84?.[_0x1abab6(0x1f9)])return await _0x239e84[_0x1abab6(0x1f9)](_0x249296[_0x1abab6(0x1d7)]);}else{if(_0x239e84?.[_0x1abab6(0x1f9)])return await _0x239e84['resolveActivationId'](_0x249296[_0x1abab6(0x1d7)]);}}return _0x1ee536;},_0x54a8a6=_0x2472ca=>{const _0x599ef1=a170_0x505d;if(!_0x2472ca)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x599ef1(0x240)](_0x2472ca))return _0x2472ca;return _0xcdcbbe[_0x2472ca]||_0x2472ca;};switch(_0x1ef576[_0xe95737(0x222)]){case _0xe95737(0x23c):{const _0x20b0c7=_0x1ef576,_0x41547b=_0x20b0c7[_0xe95737(0x1a1)],_0x5ebc15={'type':_0xe95737(0x1ed),'name':_0x20b0c7['name'],'next':_0x54a8a6(_0x20b0c7[_0xe95737(0x1ca)])};if(_0x41547b[_0xe95737(0x237)]!==undefined&&_0x41547b[_0xe95737(0x200)])_0x5ebc15[_0xe95737(0x235)]=_0xe95737(0x1d4),_0x5ebc15[_0xe95737(0x1e5)]=_0x41547b['duration'],_0x5ebc15['waitStepUnit']=normalizeWaitUnit(_0x41547b[_0xe95737(0x200)]);else{if(_0x41547b['wait_until'])_0x5ebc15[_0xe95737(0x235)]=_0xe95737(0x1ea),_0x5ebc15[_0xe95737(0x245)]=_0x41547b[_0xe95737(0x205)];else{if(_0x41547b['days_of_week'])_0x5ebc15[_0xe95737(0x235)]=_0xe95737(0x218),_0x5ebc15[_0xe95737(0x1bb)]=_0x41547b['days_of_week'];else{if(_0x41547b[_0xe95737(0x192)]){_0x5ebc15[_0xe95737(0x235)]='Condition';const _0x53ab1b=await _0x4ecb7b(_0x41547b['condition'][_0xe95737(0x224)]),_0x2b8604=_0x41547b['condition']['timeout']?.[_0xe95737(0x1ca)]!==undefined;if(_0x2b8604){const _0x190b08=[];_0x190b08['push']({'id':generateUUID(),'segmentId':_0x53ab1b,'timedOutPath':![],'name':_0xe95737(0x1c7),'next':_0x54a8a6(_0x41547b[_0xe95737(0x192)][_0xe95737(0x1ca)]??_0x20b0c7[_0xe95737(0x1ca)])});if(_0x41547b[_0xe95737(0x192)][_0xe95737(0x1d5)]){const _0x338a88=_0x41547b[_0xe95737(0x192)][_0xe95737(0x1d5)][_0xe95737(0x237)],_0xa08fcd=normalizeWaitUnit(_0x41547b['condition'][_0xe95737(0x1d5)][_0xe95737(0x200)]);_0x190b08[_0xe95737(0x21d)]({'id':generateUUID(),'timedOutPath':!![],'name':_0xe95737(0x22e)+_0x338a88+'\x20'+_0xa08fcd,'moveAfter':_0x338a88,'unit':_0xa08fcd,'next':_0x54a8a6(_0x41547b[_0xe95737(0x192)][_0xe95737(0x1d5)]['next'])});}_0x5ebc15[_0xe95737(0x198)]=_0x190b08,delete _0x5ebc15['next'];}else _0x5ebc15['conditionSegmentId']=_0x53ab1b,_0x41547b['condition'][_0xe95737(0x1d5)]&&(_0x5ebc15[_0xe95737(0x1c6)]=_0x41547b[_0xe95737(0x192)][_0xe95737(0x1d5)][_0xe95737(0x237)],_0x41547b[_0xe95737(0x192)]['timeout'][_0xe95737(0x200)]&&(_0x5ebc15['conditionTimeoutUnit']=normalizeWaitUnit(_0x41547b[_0xe95737(0x192)][_0xe95737(0x1d5)][_0xe95737(0x200)])));}}}}return _0x5ebc15;}case'activation':{const _0x18e5ba=_0x1ef576,_0x2836b7=_0x18e5ba['with']['activation'],_0x4280ae=await _0xbf009(_0x2836b7);return{'type':_0xe95737(0x232),'name':_0x18e5ba[_0xe95737(0x1d7)],'journeyActivationStepId':_0x4280ae,'next':_0x54a8a6(_0x18e5ba['next'])};}case'decision_point':{const _0x1807cf=_0x1ef576,_0x35c25a=_0x1807cf[_0xe95737(0x1a1)][_0xe95737(0x1e6)];return{'type':_0xe95737(0x221),'name':_0x1807cf[_0xe95737(0x1d7)],'branches':await Promise[_0xe95737(0x187)](_0x35c25a['map'](async _0x37ede6=>{const _0x4e9b84=_0xe95737;let _0x540d1d='';if(!_0x37ede6[_0x4e9b84(0x194)]){const _0x6c6408=_0x37ede6[_0x4e9b84(0x224)]||_0x37ede6[_0x4e9b84(0x242)]||'';_0x540d1d=_0x6c6408?await _0x4ecb7b(_0x6c6408):'';}return{'id':crypto[_0x4e9b84(0x1b4)](),'name':_0x37ede6[_0x4e9b84(0x1d7)],'description':null,'segmentId':_0x540d1d,'excludedPath':_0x37ede6[_0x4e9b84(0x194)]??![],'next':_0x54a8a6(_0x37ede6[_0x4e9b84(0x1ca)])};})),'next':_0x54a8a6(_0x1807cf['next'])};}case _0xe95737(0x1da):{const _0x2eae31=_0x1ef576,_0x4c913=_0x2eae31[_0xe95737(0x1a1)];return{'type':_0xe95737(0x20c),'name':_0x2eae31['name'],'customizedSplit':_0x4c913[_0xe95737(0x22f)],'uniqueId':_0x4c913['unique_id'],'variants':_0x4c913['variants'][_0xe95737(0x1ab)](_0x49613a=>({'id':_0x49613a['id']||generateUUID(),'name':_0x49613a[_0xe95737(0x1d7)],'percentage':_0x49613a['percentage'],'next':_0x54a8a6(_0x49613a['next'])})),'next':_0x54a8a6(_0x2eae31[_0xe95737(0x1ca)])};}case _0xe95737(0x1dc):return{'type':'Merge','name':_0x1ef576[_0xe95737(0x1d7)],'next':_0x54a8a6(_0x1ef576[_0xe95737(0x1ca)])};case _0xe95737(0x219):{const _0xbadb9b=_0x1ef576,_0x42be9c=_0xbadb9b[_0xe95737(0x1a1)][_0xe95737(0x207)],_0x332ad6=_0x42be9c['journey'],_0x304118=_0x42be9c[_0xe95737(0x23e)];let _0xfcf5d9=_0x42be9c['journey'];_0x239e84?.[_0xe95737(0x18c)]&&!/^\d+$/['test'](_0xfcf5d9)&&(_0xfcf5d9=await _0x239e84[_0xe95737(0x18c)](_0xfcf5d9));let _0x238c2e=_0x42be9c['stage'];_0x239e84?.[_0xe95737(0x20d)]&&!/^\d+$/['test'](_0x238c2e)&&(_0x238c2e=await _0x239e84[_0xe95737(0x20d)](_0xfcf5d9,_0x238c2e));const _0x37d26a=!/^\d+$/[_0xe95737(0x240)](_0x332ad6)&&!isLocalJourneyRef(_0x332ad6)?formatApiJourneyName(_0x332ad6,_0x304118):undefined;return{'type':_0xe95737(0x19e),'name':_0xbadb9b[_0xe95737(0x1d7)],'target':{'journeyId':_0xfcf5d9,'journeyStageId':_0x238c2e,'journeyBundleId':_0x42be9c[_0xe95737(0x1c4)],'journeyName':_0x37d26a,'confirmed':!![]},'next':_0x54a8a6(_0xbadb9b[_0xe95737(0x1ca)])};}case _0xe95737(0x1cd):return{'type':_0xe95737(0x1a0),'name':_0x1ef576[_0xe95737(0x1d7)]};default:{const _0x2bc937=_0x1ef576;return{'type':_0xe95737(0x1a0),'name':_0x2bc937[_0xe95737(0x1d7)]};}}}export function toYamlString(_0xe5aac2){const _0x1bc678=a170_0x505d,_0x26ad2c=stripInternalFields(_0xe5aac2),_0x17a924=a170_0x1634b1[_0x1bc678(0x21c)](_0x26ad2c,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x1bc678(0x195)}),_0xd7bddf=[_0x1bc678(0x1b2),_0x1bc678(0x1e3),_0x1bc678(0x22a),'reentry:',_0x1bc678(0x1ac),_0x1bc678(0x1bd),_0x1bc678(0x1bf)];let _0x1e999e=_0x17a924;for(const _0x2d0ceb of _0xd7bddf){_0x1e999e=_0x1e999e['replace'](new RegExp('^('+_0x2d0ceb+')','m'),(_0xcf67a4,_0x3cb680,_0x16c3bb)=>{if(_0x16c3bb===0x0||_0x1e999e[_0x16c3bb-0x1]==='\x0a'&&_0x1e999e[_0x16c3bb-0x2]==='\x0a')return _0x3cb680;return'\x0a'+_0x3cb680;});}return _0x1e999e;}function stripInternalFields(_0x1d6bf8){const _0x27d5c1=a170_0x505d,{id:_0x21c3c1,folder_id:_0x8c7b4c,bundle_id:_0x5c78e8,bundle_name:_0x3384c2,version:_0x2259ae,allow_reentry:_0x319558,..._0x4f7f4e}=_0x1d6bf8;return _0x4f7f4e[_0x27d5c1(0x216)]&&(_0x4f7f4e[_0x27d5c1(0x216)]=_0x4f7f4e[_0x27d5c1(0x216)][_0x27d5c1(0x1ab)](_0x200c6f=>{const _0x1a849a=_0x27d5c1,{id:_0x550a64,..._0x50af2b}=_0x200c6f;return{..._0x50af2b,'stages':_0x50af2b[_0x1a849a(0x241)][_0x1a849a(0x1ab)](stripStageInternalFields),..._0x200c6f[_0x1a849a(0x1e4)]===!![]?{'latest':!![]}:{},..._0x4f7f4e['journeys']['length']===0x1&&_0x50af2b[_0x1a849a(0x1b1)]==='v1'?{'version':undefined}:{}};})),_0x4f7f4e[_0x27d5c1(0x241)]&&(_0x4f7f4e[_0x27d5c1(0x241)]=_0x4f7f4e[_0x27d5c1(0x241)][_0x27d5c1(0x1ab)](stripStageInternalFields)),_0x4f7f4e[_0x27d5c1(0x1ef)]&&(_0x4f7f4e[_0x27d5c1(0x1ef)]=_0x4f7f4e[_0x27d5c1(0x1ef)][_0x27d5c1(0x1ab)](_0x4c48f0=>{const _0x52631f=_0x27d5c1,{id:_0x1e88e2,..._0x212c4b}=_0x4c48f0;return{..._0x212c4b,'stages':_0x212c4b[_0x52631f(0x241)][_0x52631f(0x1ab)](stripStageInternalFields),..._0x4c48f0[_0x52631f(0x1e4)]===!![]?{'latest':!![]}:{}};})),_0x4f7f4e;}function stripStageInternalFields(_0x1bb146){const {id:_0x3073d7,..._0x2719e5}=_0x1bb146;return _0x2719e5;}export function parseYamlString(_0xf523c0){return safeParseYaml(_0xf523c0,JourneyDefSchema);}export function isJourneyDef(_0x31be8c,_0x410db6){const _0x2a2d70=a170_0x505d;if(_0x410db6&&(_0x410db6['endsWith'](_0x2a2d70(0x19b))||_0x410db6[_0x2a2d70(0x1c8)](_0x2a2d70(0x1e8))))return!![];return typeof _0x31be8c===_0x2a2d70(0x1be)&&_0x31be8c!==null&&_0x2a2d70(0x222)in _0x31be8c&&_0x31be8c[_0x2a2d70(0x222)]===_0x2a2d70(0x1a8);}export function generateTemplate(_0x195740,_0x5c59be){const _0x1359b9=a170_0x505d,_0x4d1879={'type':_0x1359b9(0x1a8),'name':_0x195740,'description':_0x1359b9(0x1c5),'reentry':_0x1359b9(0x1b8),'goal':{'name':_0x1359b9(0x1b6),'segment':_0x1359b9(0x225)},'stages':[{'name':_0x1359b9(0x1aa),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':_0x1359b9(0x239),'segment':_0x5c59be},'steps':[{'type':_0x1359b9(0x23c),'name':'Wait\x201\x20Day','with':{'duration':0x1,'unit':_0x1359b9(0x23a)}},{'type':'activation','name':_0x1359b9(0x213),'with':{'activation':'your-activation-name'}},{'type':_0x1359b9(0x1cd),'name':'Stage\x20Complete'}]}]};return toYamlString(_0x4d1879);}function generateUUID(){const _0x1e55d8=a170_0x505d;return crypto[_0x1e55d8(0x1b4)]();}export const SEGMENT_REF_PREFIX=a170_0x38c1fc(0x228);export function parseSegmentRef(_0x54b962){const _0x4d7ec2=a170_0x38c1fc;if(_0x54b962['startsWith'](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x54b962[_0x4d7ec2(0x210)](SEGMENT_REF_PREFIX[_0x4d7ec2(0x1f8)])};if(/^\d+$/['test'](_0x54b962))return{'type':'id','name':_0x54b962};return{'type':'embedded','name':_0x54b962};}export function makeSegmentRef(_0x3547c4){return''+SEGMENT_REF_PREFIX+_0x3547c4;}export function isExternalSegmentRef(_0x520200){const _0x4d0078=a170_0x38c1fc;return _0x520200[_0x4d0078(0x211)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x3c2d2f){const _0x28c6c9=a170_0x38c1fc;return!!(_0x3c2d2f[_0x28c6c9(0x216)]&&_0x3c2d2f[_0x28c6c9(0x216)][_0x28c6c9(0x1f8)]>0x0);}export function isMultiVersionMode(_0x20ca13){const _0x1a37df=a170_0x38c1fc;return!!(_0x20ca13[_0x1a37df(0x1ef)]&&_0x20ca13['versions'][_0x1a37df(0x1f8)]>0x0);}export function isSingleVersionMode(_0x4cdd67){const _0x16d6de=a170_0x38c1fc;return!!(_0x4cdd67[_0x16d6de(0x241)]&&_0x4cdd67[_0x16d6de(0x241)][_0x16d6de(0x1f8)]>0x0);}export function hasMultipleVersions(_0x2c0642){const _0x2c558c=a170_0x38c1fc;if(isJourneysArrayMode(_0x2c0642))return(_0x2c0642[_0x2c558c(0x216)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x2c0642))return(_0x2c0642[_0x2c558c(0x1ef)]?.[_0x2c558c(0x1f8)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x445d49){const _0x162123=a170_0x38c1fc;if(isJourneysArrayMode(_0x445d49))return _0x445d49;if(isSingleVersionMode(_0x445d49)){const {stages:_0x53d833,id:_0x3a9089,version:_0xd87e6f,version_number:_0x16ffdf,..._0x438b41}=_0x445d49;return{..._0x438b41,'journeys':[{'version':_0xd87e6f||'v1','stages':_0x53d833||[],'id':_0x3a9089,'version_number':_0x16ffdf}]};}if(isMultiVersionMode(_0x445d49)){const {versions:_0x3aed1c,..._0x5b2225}=_0x445d49;return{..._0x5b2225,'journeys':(_0x3aed1c||[])['map'](_0x4ee3dc=>({'version':_0x4ee3dc['name'],'state':_0x4ee3dc[_0x162123(0x215)],'latest':_0x4ee3dc[_0x162123(0x1e4)],'stages':_0x4ee3dc[_0x162123(0x241)],'id':_0x4ee3dc['id'],'version_number':_0x4ee3dc['version_number']}))};}return _0x445d49;}export function normalizeJourneyDef(_0x1471f9,_0x26f1ad){const _0x3cb142=a170_0x38c1fc,_0x26e0e7=normalizeToJourneysFormat(_0x1471f9),_0x4489f5=_0x26f1ad?.['segments']?Object['keys'](_0x26f1ad[_0x3cb142(0x22b)]):undefined,_0x5d5851=_0x26f1ad?.[_0x3cb142(0x196)]?Object[_0x3cb142(0x1e9)](_0x26f1ad[_0x3cb142(0x196)]):undefined;return{'type':_0x3cb142(0x1a8),'name':_0x26e0e7['name'],..._0x26e0e7['description']!==undefined&&{'description':_0x26e0e7[_0x3cb142(0x1b7)]},..._0x26e0e7[_0x3cb142(0x19f)]&&{'goal':normalizeJourneyCriteria(_0x26e0e7[_0x3cb142(0x19f)])},..._0x26e0e7[_0x3cb142(0x191)]!==undefined&&{'reentry':_0x26e0e7[_0x3cb142(0x191)]},..._0x26e0e7['segments']&&{'segments':normalizeEmbeddedSegments(_0x26e0e7[_0x3cb142(0x22b)],_0x4489f5)},..._0x26e0e7[_0x3cb142(0x196)]&&{'activations':normalizeEmbeddedActivations(_0x26e0e7[_0x3cb142(0x196)],_0x5d5851)},..._0x26e0e7[_0x3cb142(0x216)]&&{'journeys':_0x26e0e7['journeys'][_0x3cb142(0x1ab)](_0x534d49=>normalizeJourneyEntry(_0x534d49,_0x26e0e7['journeys'][_0x3cb142(0x1f8)]===0x1))}};}function normalizeJourneyEntry(_0x2e26b3,_0x30094d){const _0x388948=a170_0x38c1fc;return{...!_0x30094d&&_0x2e26b3[_0x388948(0x1b1)]!==undefined&&{'version':_0x2e26b3[_0x388948(0x1b1)]},..._0x2e26b3[_0x388948(0x215)]!==undefined&&{'state':_0x2e26b3[_0x388948(0x215)]},...!_0x30094d&&_0x2e26b3['latest']!==undefined&&{'latest':_0x2e26b3[_0x388948(0x1e4)]},..._0x2e26b3[_0x388948(0x18e)]!==undefined&&{'version_number':_0x2e26b3[_0x388948(0x18e)]},..._0x2e26b3['goal']&&{'goal':normalizeJourneyCriteria(_0x2e26b3[_0x388948(0x19f)])},..._0x2e26b3[_0x388948(0x191)]!==undefined&&{'reentry':_0x2e26b3[_0x388948(0x191)]},'stages':_0x2e26b3[_0x388948(0x241)][_0x388948(0x1ab)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x574959){const _0x2777fd=a170_0x38c1fc;return{'name':_0x574959[_0x2777fd(0x1d7)],..._0x574959['description']!==undefined&&{'description':_0x574959[_0x2777fd(0x1b7)]},..._0x574959[_0x2777fd(0x186)]&&{'entry_criteria':normalizeJourneyCriteria(_0x574959['entry_criteria'])},..._0x574959['exit_criteria']&&{'exit_criteria':_0x574959[_0x2777fd(0x206)][_0x2777fd(0x1ab)](normalizeJourneyCriteria)},..._0x574959['milestone']&&{'milestone':normalizeJourneyCriteria(_0x574959[_0x2777fd(0x217)])},..._0x574959[_0x2777fd(0x1fc)]&&{'steps':normalizeStepsWithImplicitNext(_0x574959[_0x2777fd(0x1fc)])}};}function normalizeStepsWithImplicitNext(_0x464a13){const _0x49d9f7=a170_0x38c1fc;return _0x464a13[_0x49d9f7(0x1ab)]((_0x1fad62,_0x503f69)=>{const _0x266621=_0x49d9f7,_0x3406e3=_0x503f69<_0x464a13[_0x266621(0x1f8)]-0x1?_0x464a13[_0x503f69+0x1][_0x266621(0x1d7)]:undefined;return normalizeJourneyStep(_0x1fad62,_0x3406e3);});}function normalizeJourneyCriteria(_0xfcd82){const _0x8800=a170_0x38c1fc;return{'name':_0xfcd82[_0x8800(0x1d7)],..._0xfcd82[_0x8800(0x1b7)]!==undefined&&{'description':_0xfcd82['description']},'segment':_0xfcd82[_0x8800(0x224)],..._0xfcd82['target']&&{'target':normalizeJumpTarget(_0xfcd82[_0x8800(0x207)])}};}function normalizeJourneyStep(_0xd6d18d,_0x2e54d8){const _0x232932=a170_0x38c1fc,_0x5d96e7=_0xd6d18d[_0x232932(0x1ca)]!==undefined&&_0xd6d18d[_0x232932(0x1ca)]!==_0x2e54d8,_0x268b4f={'type':_0xd6d18d[_0x232932(0x222)],'name':_0xd6d18d[_0x232932(0x1d7)],..._0x5d96e7&&{'next':_0xd6d18d[_0x232932(0x1ca)]}};if(_0x232932(0x1a1)in _0xd6d18d&&_0xd6d18d['with'])return{..._0x268b4f,'with':normalizeStepParams(_0xd6d18d['type'],_0xd6d18d[_0x232932(0x1a1)])};return _0x268b4f;}function normalizeStepParams(_0x31f24b,_0xe0080b){const _0x3e9a29=a170_0x38c1fc;switch(_0x31f24b){case'wait':{const _0x357762=_0xe0080b;let _0x13061d;return _0x357762['condition']&&(_0x13061d={'segment':_0x357762['condition'][_0x3e9a29(0x224)],..._0x357762['condition'][_0x3e9a29(0x1ca)]!==undefined&&{'next':_0x357762['condition'][_0x3e9a29(0x1ca)]},..._0x357762[_0x3e9a29(0x192)][_0x3e9a29(0x1d5)]&&{'timeout':{'duration':_0x357762['condition'][_0x3e9a29(0x1d5)][_0x3e9a29(0x237)],'unit':_0x357762[_0x3e9a29(0x192)][_0x3e9a29(0x1d5)]['unit'],..._0x357762[_0x3e9a29(0x192)][_0x3e9a29(0x1d5)]['next']!==undefined&&{'next':_0x357762[_0x3e9a29(0x192)][_0x3e9a29(0x1d5)][_0x3e9a29(0x1ca)]}}}}),{..._0x357762[_0x3e9a29(0x237)]!==undefined&&{'duration':_0x357762['duration']},..._0x357762['unit']!==undefined&&{'unit':_0x357762[_0x3e9a29(0x200)]},..._0x357762[_0x3e9a29(0x205)]!==undefined&&{'wait_until':_0x357762[_0x3e9a29(0x205)]},..._0x357762[_0x3e9a29(0x1b9)]!==undefined&&{'days_of_week':_0x357762['days_of_week']},..._0x13061d&&{'condition':_0x13061d}};}case _0x3e9a29(0x208):{const _0x4d8159=_0xe0080b;return{'activation':_0x4d8159[_0x3e9a29(0x208)]};}case _0x3e9a29(0x220):{const _0x368359=_0xe0080b;return{'branches':_0x368359[_0x3e9a29(0x1e6)]['map'](normalizeDecisionBranch)};}case'ab_test':{const _0x55c5c9=_0xe0080b;return{..._0x55c5c9['customized_split']!==undefined&&{'customized_split':_0x55c5c9[_0x3e9a29(0x22f)]},..._0x55c5c9[_0x3e9a29(0x243)]!==undefined&&{'unique_id':_0x55c5c9['unique_id']},'variants':_0x55c5c9[_0x3e9a29(0x18b)][_0x3e9a29(0x1ab)](normalizeAbTestVariant)};}case _0x3e9a29(0x219):{const _0x490a78=_0xe0080b;return{'target':normalizeJumpTarget(_0x490a78[_0x3e9a29(0x207)])};}default:return _0xe0080b;}}function normalizeDecisionBranch(_0x13f8e1){const _0xb8c5c4=a170_0x38c1fc;return{'name':_0x13f8e1['name'],..._0x13f8e1[_0xb8c5c4(0x224)]!==undefined&&{'segment':_0x13f8e1['segment']},..._0x13f8e1['excluded']!==undefined&&{'excluded':_0x13f8e1['excluded']},..._0x13f8e1[_0xb8c5c4(0x1ca)]!==undefined&&{'next':_0x13f8e1[_0xb8c5c4(0x1ca)]}};}function a170_0x505d(_0x223ed5,_0x20fa28){_0x223ed5=_0x223ed5-0x180;const _0x517a1e=a170_0x517a();let _0x505ddd=_0x517a1e[_0x223ed5];return _0x505ddd;}function normalizeAbTestVariant(_0x101bff){const _0x3c358e=a170_0x38c1fc;return{..._0x101bff['id']!==undefined&&{'id':_0x101bff['id']},'name':_0x101bff[_0x3c358e(0x1d7)],'percentage':_0x101bff[_0x3c358e(0x1af)],..._0x101bff['next']!==undefined&&{'next':_0x101bff['next']}};}function normalizeJumpTarget(_0x117b48){const _0x3504f2=a170_0x38c1fc;return{'journey':_0x117b48[_0x3504f2(0x1a8)],'stage':_0x117b48[_0x3504f2(0x23e)],..._0x117b48['bundle_id']!==undefined&&{'bundle_id':_0x117b48['bundle_id']}};}function normalizeEmbeddedSegments(_0x13c36e,_0x2bba04){const _0xc844a9=a170_0x38c1fc,_0x1cd107={},_0x52cb02=Object['keys'](_0x13c36e),_0x33c78a=_0x2bba04?[..._0x2bba04[_0xc844a9(0x1dd)](_0x1831d7=>_0x52cb02[_0xc844a9(0x184)](_0x1831d7)),..._0x52cb02[_0xc844a9(0x1dd)](_0x15e38f=>!_0x2bba04['includes'](_0x15e38f))[_0xc844a9(0x181)]()]:_0x52cb02[_0xc844a9(0x181)]();for(const _0x164969 of _0x33c78a){const _0x3d5ae7=_0x13c36e[_0x164969];if(_0x3d5ae7[_0xc844a9(0x1c3)]){const _0x115a96=_0x3d5ae7['rule'];if(_0x115a96['type']!==_0xc844a9(0x1ee)&&_0x115a96[_0xc844a9(0x222)]!=='Or'&&_0x115a96[_0xc844a9(0x222)]!==_0xc844a9(0x201)){const _0x18772f=_0x115a96['type']??_0xc844a9(0x238);throw new SDKError(ErrorCode[_0xc844a9(0x1d9)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x164969+_0xc844a9(0x203)+(_0xc844a9(0x1f5)+_0x18772f+_0xc844a9(0x1d2))+_0xc844a9(0x1a3)+_0xc844a9(0x1db)+_0xc844a9(0x19c)+_0xc844a9(0x180)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0xc844a9(0x1d3)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x115a96[_0xc844a9(0x198)]||!Array['isArray'](_0x115a96[_0xc844a9(0x198)]))throw new SDKError(ErrorCode[_0xc844a9(0x1d9)],_0xc844a9(0x1ad)+_0x164969+_0xc844a9(0x203)+_0xc844a9(0x20f)+_0xc844a9(0x1a3)+'\x20\x20rule:\x0a'+('\x20\x20\x20\x20type:\x20'+_0x115a96[_0xc844a9(0x222)]+'\x0a')+'\x20\x20\x20\x20conditions:\x0a'+_0xc844a9(0x1ff)+_0xc844a9(0x1d3)+_0xc844a9(0x1e1));}_0x1cd107[_0x164969]={..._0x3d5ae7[_0xc844a9(0x1b7)]&&_0x3d5ae7[_0xc844a9(0x1b7)][_0xc844a9(0x1c9)]()&&{'description':_0x3d5ae7[_0xc844a9(0x1b7)]},..._0x3d5ae7[_0xc844a9(0x1c3)]&&{'rule':deepSortObject(_0x3d5ae7['rule'])}};}return _0x1cd107;}function normalizeEmbeddedActivations(_0xd8d94,_0x2d3bce){const _0x67cc74=a170_0x38c1fc,_0x5e73f5={},_0x4441b0=Object[_0x67cc74(0x1e9)](_0xd8d94),_0x508cd3=_0x2d3bce?[..._0x2d3bce[_0x67cc74(0x1dd)](_0x4b3155=>_0x4441b0['includes'](_0x4b3155)),..._0x4441b0[_0x67cc74(0x1dd)](_0x3d14f2=>!_0x2d3bce[_0x67cc74(0x184)](_0x3d14f2))['sort']()]:_0x4441b0[_0x67cc74(0x181)]();for(const _0xa73297 of _0x508cd3){const _0x1e573e=_0xd8d94[_0xa73297];_0x5e73f5[_0xa73297]={'name':_0x1e573e[_0x67cc74(0x1d7)],'connection':_0x1e573e['connection'],..._0x1e573e[_0x67cc74(0x1b7)]!==undefined&&{'description':_0x1e573e[_0x67cc74(0x1b7)]},..._0x1e573e[_0x67cc74(0x18d)]!==undefined&&{'all_columns':_0x1e573e[_0x67cc74(0x18d)]},..._0x1e573e[_0x67cc74(0x23f)]!==undefined&&{'columns':_0x1e573e[_0x67cc74(0x23f)]},..._0x1e573e['behavior']!==undefined&&{'behavior':_0x1e573e[_0x67cc74(0x1d8)]},..._0x1e573e[_0x67cc74(0x1cb)]!==undefined&&{'schedule':_0x1e573e[_0x67cc74(0x1cb)]},..._0x1e573e[_0x67cc74(0x185)]!==undefined&&{'notification':_0x1e573e['notification']},..._0x1e573e['connector_config']!==undefined&&{'connector_config':_0x1e573e[_0x67cc74(0x193)]},..._0x1e573e['activation_template_id']!==undefined&&{'activation_template_id':_0x1e573e[_0x67cc74(0x1cf)]}};}return _0x5e73f5;}export function getActiveStages(_0x4493c8){const _0x32e4e7=a170_0x38c1fc;if(isJourneysArrayMode(_0x4493c8)){const _0x49c0f3=_0x4493c8['journeys']||[],_0x2e3e9d=_0x49c0f3[_0x32e4e7(0x1cc)](_0x19ff45=>_0x19ff45['latest']===!![])||_0x49c0f3[0x0];return _0x2e3e9d?.[_0x32e4e7(0x241)]||[];}if(isSingleVersionMode(_0x4493c8))return _0x4493c8['stages']||[];if(isMultiVersionMode(_0x4493c8)){const _0xbcb56=_0x4493c8['versions']||[],_0x54aec3=_0xbcb56[_0x32e4e7(0x1cc)](_0xcb84c2=>_0xcb84c2['latest']===!![])||_0xbcb56[0x0];return _0x54aec3?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x374ede){const _0x436d2d=a170_0x38c1fc;if(isJourneysArrayMode(_0x374ede)){const _0x37d708=_0x374ede[_0x436d2d(0x216)]||[];return _0x37d708[_0x436d2d(0x1cc)](_0x585806=>_0x585806['latest']===!![])||_0x37d708[0x0];}if(isMultiVersionMode(_0x374ede)){const _0xc6de3e=_0x374ede[_0x436d2d(0x1ef)]||[],_0xbb40e9=_0xc6de3e[_0x436d2d(0x1cc)](_0x30afdc=>_0x30afdc[_0x436d2d(0x1e4)]===!![])||_0xc6de3e[0x0];if(_0xbb40e9)return{'version':_0xbb40e9['name'],'state':_0xbb40e9[_0x436d2d(0x215)],'latest':_0xbb40e9[_0x436d2d(0x1e4)],'stages':_0xbb40e9[_0x436d2d(0x241)],'id':_0xbb40e9['id'],'version_number':_0xbb40e9[_0x436d2d(0x18e)]};}if(isSingleVersionMode(_0x374ede))return{'version':_0x374ede[_0x436d2d(0x1b1)]||'v1','state':_0x436d2d(0x223),'stages':_0x374ede['stages']||[],'id':_0x374ede['id'],'version_number':_0x374ede['version_number'],'goal':_0x374ede[_0x436d2d(0x19f)],'reentry':_0x374ede[_0x436d2d(0x191)]};return undefined;}export function getLatestVersion(_0x1d9a16){const _0x440bbf=a170_0x38c1fc;if(!isMultiVersionMode(_0x1d9a16))return undefined;const _0x56468e=_0x1d9a16['versions']||[];return _0x56468e['find'](_0x2c5f95=>_0x2c5f95[_0x440bbf(0x1e4)]===!![])||_0x56468e[0x0];}export function getEffectiveGoal(_0x1d3da8){const _0x515e77=a170_0x38c1fc,_0x10a181=getLatestJourneyEntry(_0x1d3da8);return _0x10a181?.['goal']||_0x1d3da8[_0x515e77(0x19f)];}export function getEffectiveReentry(_0x2d3e9d){const _0x5e9213=a170_0x38c1fc,_0x4939cb=getLatestJourneyEntry(_0x2d3e9d);return _0x4939cb?.[_0x5e9213(0x191)]||_0x2d3e9d['reentry'];}export function collectSegmentRefs(_0x46b7df){const _0x2cfa3a=a170_0x38c1fc,_0x42ff89=new Set();_0x46b7df[_0x2cfa3a(0x19f)]?.['segment']&&_0x42ff89[_0x2cfa3a(0x1ec)](_0x46b7df['goal'][_0x2cfa3a(0x224)]);const _0x5e60c9=_0x1fd11a=>{const _0x1e0403=_0x2cfa3a;for(const _0x2f6f6e of _0x1fd11a){_0x2f6f6e[_0x1e0403(0x186)]?.[_0x1e0403(0x224)]&&_0x42ff89[_0x1e0403(0x1ec)](_0x2f6f6e['entry_criteria'][_0x1e0403(0x224)]);if(_0x2f6f6e[_0x1e0403(0x206)])for(const _0x2c97ac of _0x2f6f6e[_0x1e0403(0x206)]){_0x2c97ac[_0x1e0403(0x224)]&&_0x42ff89[_0x1e0403(0x1ec)](_0x2c97ac[_0x1e0403(0x224)]);}_0x2f6f6e[_0x1e0403(0x217)]?.['segment']&&_0x42ff89[_0x1e0403(0x1ec)](_0x2f6f6e[_0x1e0403(0x217)][_0x1e0403(0x224)]);if(_0x2f6f6e[_0x1e0403(0x1fc)])for(const _0x143d0b of _0x2f6f6e[_0x1e0403(0x1fc)]){if(_0x143d0b[_0x1e0403(0x222)]===_0x1e0403(0x220)){const _0x1256fa=_0x143d0b;for(const _0x1cc23c of _0x1256fa[_0x1e0403(0x1a1)][_0x1e0403(0x1e6)]){_0x1cc23c[_0x1e0403(0x224)]&&_0x42ff89['add'](_0x1cc23c[_0x1e0403(0x224)]);}}else{if(_0x143d0b['type']===_0x1e0403(0x23c)){const _0x331d0d=_0x143d0b;_0x331d0d[_0x1e0403(0x1a1)][_0x1e0403(0x192)]?.[_0x1e0403(0x224)]&&_0x42ff89['add'](_0x331d0d[_0x1e0403(0x1a1)][_0x1e0403(0x192)][_0x1e0403(0x224)]);}}}}};_0x46b7df[_0x2cfa3a(0x241)]&&_0x5e60c9(_0x46b7df[_0x2cfa3a(0x241)]);if(_0x46b7df['versions'])for(const _0xf85c17 of _0x46b7df[_0x2cfa3a(0x1ef)]){_0x5e60c9(_0xf85c17['stages']);}return _0x42ff89;}export function validateSegmentRefs(_0x1593cb){const _0x19a2c2=a170_0x38c1fc,_0x300cbb=[],_0x39127f=collectSegmentRefs(_0x1593cb),_0x151fce=new Set(Object[_0x19a2c2(0x1e9)](_0x1593cb[_0x19a2c2(0x22b)]||{}));for(const _0x44d15c of _0x39127f){const _0x211b5=parseSegmentRef(_0x44d15c);_0x211b5[_0x19a2c2(0x222)]===_0x19a2c2(0x234)&&!_0x151fce[_0x19a2c2(0x21e)](_0x211b5['name'])&&_0x300cbb[_0x19a2c2(0x21d)](_0x19a2c2(0x1c2)+_0x211b5[_0x19a2c2(0x1d7)]+'\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:'+_0x211b5[_0x19a2c2(0x1d7)]+_0x19a2c2(0x20a));}return _0x300cbb;}export function collectSegmentIdsFromJourneyApi(_0x2cb652){const _0x4b08b9=a170_0x38c1fc,_0x1ab7a7=new Set();_0x2cb652[_0x4b08b9(0x18a)][_0x4b08b9(0x19f)]?.[_0x4b08b9(0x1f1)]&&_0x1ab7a7[_0x4b08b9(0x1ec)](_0x2cb652['attributes']['goal'][_0x4b08b9(0x1f1)]);const _0xd7381e=_0x2cb652[_0x4b08b9(0x18a)]['journeyStages'];if(Array[_0x4b08b9(0x1fb)](_0xd7381e))for(const _0x34b98f of _0xd7381e){_0x34b98f[_0x4b08b9(0x19d)]?.[_0x4b08b9(0x1f1)]&&_0x1ab7a7[_0x4b08b9(0x1ec)](_0x34b98f[_0x4b08b9(0x19d)][_0x4b08b9(0x1f1)]);const _0x5c30a3=_0x34b98f[_0x4b08b9(0x1fa)]??_0x34b98f['exitCriteria'];if(Array[_0x4b08b9(0x1fb)](_0x5c30a3))for(const _0x6c91b of _0x5c30a3){_0x6c91b[_0x4b08b9(0x1f1)]&&_0x1ab7a7[_0x4b08b9(0x1ec)](_0x6c91b[_0x4b08b9(0x1f1)]);}_0x34b98f[_0x4b08b9(0x217)]?.[_0x4b08b9(0x1f1)]&&_0x1ab7a7[_0x4b08b9(0x1ec)](_0x34b98f[_0x4b08b9(0x217)][_0x4b08b9(0x1f1)]);if(_0x34b98f['steps']&&typeof _0x34b98f['steps']===_0x4b08b9(0x1be)){const _0x559be7=Array['isArray'](_0x34b98f[_0x4b08b9(0x1fc)])?_0x34b98f[_0x4b08b9(0x1fc)]:Object[_0x4b08b9(0x246)](_0x34b98f[_0x4b08b9(0x1fc)]);for(const _0x5c65ff of _0x559be7){_0x5c65ff['waitCondition']?.['segmentId']&&_0x1ab7a7['add'](_0x5c65ff[_0x4b08b9(0x1e7)][_0x4b08b9(0x1f1)]);const _0x18bf09=_0x5c65ff;_0x18bf09[_0x4b08b9(0x1f2)]&&_0x1ab7a7[_0x4b08b9(0x1ec)](_0x18bf09[_0x4b08b9(0x1f2)]);if(Array[_0x4b08b9(0x1fb)](_0x18bf09['conditions']))for(const _0x53cf74 of _0x18bf09['conditions']){_0x53cf74[_0x4b08b9(0x1f1)]&&_0x1ab7a7[_0x4b08b9(0x1ec)](_0x53cf74[_0x4b08b9(0x1f1)]);}if(Array['isArray'](_0x5c65ff[_0x4b08b9(0x1e6)]))for(const _0x229667 of _0x5c65ff[_0x4b08b9(0x1e6)]){_0x229667['segmentId']&&_0x1ab7a7[_0x4b08b9(0x1ec)](_0x229667[_0x4b08b9(0x1f1)]);}}}}return _0x1ab7a7;}
1
+ const a170_0x53c011=a170_0x4c74;(function(_0x59fefc,_0x5e70a1){const _0x18e129=a170_0x4c74,_0x33be44=_0x59fefc();while(!![]){try{const _0x341657=parseInt(_0x18e129(0x241))/0x1*(-parseInt(_0x18e129(0x277))/0x2)+-parseInt(_0x18e129(0x289))/0x3*(parseInt(_0x18e129(0x1f9))/0x4)+-parseInt(_0x18e129(0x1e5))/0x5+parseInt(_0x18e129(0x263))/0x6*(parseInt(_0x18e129(0x211))/0x7)+parseInt(_0x18e129(0x27d))/0x8*(parseInt(_0x18e129(0x207))/0x9)+-parseInt(_0x18e129(0x229))/0xa+parseInt(_0x18e129(0x256))/0xb;if(_0x341657===_0x5e70a1)break;else _0x33be44['push'](_0x33be44['shift']());}catch(_0x1f2782){_0x33be44['push'](_0x33be44['shift']());}}}(a170_0xd575,0x617d1));import*as a170_0xe71565 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(_0x5e9ba8){const _0x5118fc=a170_0x4c74,_0x507e92=_0x5e9ba8[_0x5118fc(0x1f8)]();if(_0x507e92===_0x5118fc(0x25f)||_0x507e92===_0x5118fc(0x22a))return _0x5118fc(0x22a);if(_0x507e92===_0x5118fc(0x240)||_0x507e92==='week')return'week';return _0x5e9ba8;}export function journeyResponseToDefSync(_0x42a28d){const _0x640203=a170_0x4c74,_0x5ad4f4=_0x42a28d[_0x640203(0x244)],_0x23eaef=_0x5ad4f4[_0x640203(0x276)]||_0x5ad4f4['name'],_0x3a8f3f={'stages':_0x5ad4f4[_0x640203(0x206)][_0x640203(0x242)](convertApiStageToYaml),'id':_0x42a28d['id']};_0x5ad4f4[_0x640203(0x20c)]&&(_0x3a8f3f[_0x640203(0x20c)]=convertApiCriteriaToYaml(_0x5ad4f4['goal']));_0x5ad4f4[_0x640203(0x273)]&&_0x5ad4f4['name']!==_0x23eaef&&(_0x3a8f3f[_0x640203(0x2a7)]=_0x5ad4f4['name']);_0x5ad4f4[_0x640203(0x1fe)]!==undefined&&(_0x3a8f3f[_0x640203(0x261)]=_0x5ad4f4[_0x640203(0x1fe)]);_0x5ad4f4[_0x640203(0x259)]&&(_0x3a8f3f[_0x640203(0x259)]=_0x5ad4f4[_0x640203(0x259)]===_0x640203(0x212)?'launched':_0x640203(0x1fa));const _0x4c0326={'type':_0x640203(0x293),'name':_0x23eaef,'journeys':[_0x3a8f3f]};_0x5ad4f4['description']&&(_0x4c0326[_0x640203(0x20e)]=_0x5ad4f4[_0x640203(0x20e)]);_0x5ad4f4[_0x640203(0x20c)]&&(_0x4c0326['goal']=convertApiCriteriaToYaml(_0x5ad4f4[_0x640203(0x20c)]));if(_0x5ad4f4['reentryMode'])_0x4c0326[_0x640203(0x28d)]=_0x5ad4f4[_0x640203(0x202)];else _0x5ad4f4[_0x640203(0x25b)]!==undefined&&(_0x4c0326[_0x640203(0x28d)]=_0x5ad4f4[_0x640203(0x25b)]?_0x640203(0x21a):_0x640203(0x221));return _0x5ad4f4['journeyBundleId']&&(_0x4c0326['bundle_id']=_0x5ad4f4['journeyBundleId']),_0x5ad4f4['journeyBundleName']&&(_0x4c0326[_0x640203(0x20f)]=_0x5ad4f4[_0x640203(0x276)]),_0x42a28d['relationships']?.[_0x640203(0x1ea)]?.[_0x640203(0x26f)]?.['id']&&(_0x4c0326[_0x640203(0x1e1)]=_0x42a28d['relationships'][_0x640203(0x1ea)][_0x640203(0x26f)]['id']),_0x4c0326;}export async function journeyResponseToDef(_0x473a7a,_0x26ab42){const _0x38d7d6=a170_0x4c74,_0x578f21=journeyResponseToDefSync(_0x473a7a);if(!_0x26ab42)return _0x578f21;const _0x17e0ae=new Set();collectSegmentIdsFromJourney(_0x578f21,_0x17e0ae);const _0x3463bb=new Set();collectActivationIdsFromJourney(_0x578f21,_0x3463bb);const _0x568a45={},_0x1fcca7=new Map();for(const _0x27c89c of Array[_0x38d7d6(0x281)](_0x17e0ae)[_0x38d7d6(0x245)]()){if(_0x26ab42['resolveSegment']){const _0x4a7a5c=await _0x26ab42[_0x38d7d6(0x210)](_0x27c89c);if(_0x4a7a5c[_0x38d7d6(0x29c)]){_0x1fcca7['set'](_0x27c89c,_0x4a7a5c['name']);if(_0x4a7a5c[_0x38d7d6(0x290)]){const _0x136faa={..._0x4a7a5c[_0x38d7d6(0x290)],'rule':deepSortObject(_0x4a7a5c[_0x38d7d6(0x290)][_0x38d7d6(0x27a)])};_0x568a45[_0x4a7a5c['name']]=_0x136faa;}}else _0x1fcca7['set'](_0x27c89c,makeSegmentRef(_0x4a7a5c[_0x38d7d6(0x273)]));}else{if(_0x26ab42[_0x38d7d6(0x1e7)]){const _0x760b64=await _0x26ab42[_0x38d7d6(0x1e7)](_0x27c89c);_0x1fcca7[_0x38d7d6(0x255)](_0x27c89c,_0x760b64);}}}const _0x357d65={},_0xca5d29=new Map();for(const _0x22a222 of Array[_0x38d7d6(0x281)](_0x3463bb)['sort']()){if(_0x26ab42[_0x38d7d6(0x23c)]){const _0x2c8dbf=await _0x26ab42[_0x38d7d6(0x23c)](_0x22a222);_0x2c8dbf[_0x38d7d6(0x29c)]?(_0xca5d29[_0x38d7d6(0x255)](_0x22a222,_0x2c8dbf[_0x38d7d6(0x273)]),_0x2c8dbf[_0x38d7d6(0x290)]&&(_0x357d65[_0x2c8dbf[_0x38d7d6(0x273)]]=_0x2c8dbf[_0x38d7d6(0x290)])):_0xca5d29[_0x38d7d6(0x255)](_0x22a222,makeSegmentRef(_0x2c8dbf[_0x38d7d6(0x273)]));}else{if(_0x26ab42[_0x38d7d6(0x236)]){const _0x2f2434=await _0x26ab42[_0x38d7d6(0x236)](_0x22a222);_0xca5d29[_0x38d7d6(0x255)](_0x22a222,_0x2f2434);}}}_0x1fcca7[_0x38d7d6(0x21b)]>0x0&&replaceSegmentIdsInJourney(_0x578f21,_0x1fcca7);_0xca5d29[_0x38d7d6(0x21b)]>0x0&&replaceActivationIdsInJourney(_0x578f21,_0xca5d29);if(_0x26ab42['resolveJumpTarget']){const _0x5a3a35=[];collectJumpTargetsFromJourney(_0x578f21,_0x5a3a35);if(_0x5a3a35[_0x38d7d6(0x228)]>0x0){const _0x12f54e=new Map();for(const _0x51c7ea of _0x5a3a35){try{const _0x1fdc88=await _0x26ab42[_0x38d7d6(0x234)](_0x51c7ea[_0x38d7d6(0x200)],_0x51c7ea[_0x38d7d6(0x1f5)]);_0x12f54e['set'](_0x51c7ea['journeyId']+':'+_0x51c7ea[_0x38d7d6(0x1f5)],_0x1fdc88);}catch{}}_0x12f54e[_0x38d7d6(0x21b)]>0x0&&replaceJumpTargetsInJourney(_0x578f21,_0x12f54e);}}return Object[_0x38d7d6(0x20a)](_0x568a45)[_0x38d7d6(0x228)]>0x0&&(_0x578f21['segments']=_0x568a45),Object[_0x38d7d6(0x20a)](_0x357d65)[_0x38d7d6(0x228)]>0x0&&(_0x578f21[_0x38d7d6(0x264)]=_0x357d65),_0x578f21;}function collectSegmentIdsFromJourney(_0x5e5e92,_0x1939b6){const _0x4105f7=a170_0x4c74;_0x5e5e92[_0x4105f7(0x20c)]?.['segment']&&_0x1939b6['add'](_0x5e5e92['goal'][_0x4105f7(0x294)]);const _0x3eb88c=_0x4edb58=>{const _0x1134fc=_0x4105f7;for(const _0x3b789a of _0x4edb58){_0x3b789a['entry_criteria']?.[_0x1134fc(0x294)]&&_0x1939b6[_0x1134fc(0x284)](_0x3b789a[_0x1134fc(0x25e)][_0x1134fc(0x294)]);if(_0x3b789a[_0x1134fc(0x1e4)])for(const _0x308edd of _0x3b789a['exit_criteria']){_0x308edd[_0x1134fc(0x294)]&&_0x1939b6[_0x1134fc(0x284)](_0x308edd[_0x1134fc(0x294)]);}_0x3b789a[_0x1134fc(0x22d)]?.[_0x1134fc(0x294)]&&_0x1939b6[_0x1134fc(0x284)](_0x3b789a['milestone'][_0x1134fc(0x294)]);if(_0x3b789a[_0x1134fc(0x280)])for(const _0xa2a98c of _0x3b789a['steps']){if(_0xa2a98c[_0x1134fc(0x26c)]===_0x1134fc(0x2a8)){const _0x4b6faf=_0xa2a98c;for(const _0xc8d84b of _0x4b6faf[_0x1134fc(0x298)][_0x1134fc(0x295)]){_0xc8d84b['segment']&&_0x1939b6['add'](_0xc8d84b[_0x1134fc(0x294)]);}}else{if(_0xa2a98c[_0x1134fc(0x26c)]===_0x1134fc(0x260)){const _0x10133e=_0xa2a98c;_0x10133e['with'][_0x1134fc(0x22e)]?.[_0x1134fc(0x294)]&&_0x1939b6[_0x1134fc(0x284)](_0x10133e['with'][_0x1134fc(0x22e)][_0x1134fc(0x294)]);}}}}};if(_0x5e5e92['journeys'])for(const _0x2676b3 of _0x5e5e92[_0x4105f7(0x23b)]){_0x2676b3[_0x4105f7(0x20c)]?.['segment']&&_0x1939b6[_0x4105f7(0x284)](_0x2676b3['goal']['segment']),_0x3eb88c(_0x2676b3[_0x4105f7(0x216)]);}_0x5e5e92['stages']&&_0x3eb88c(_0x5e5e92[_0x4105f7(0x216)]);if(_0x5e5e92[_0x4105f7(0x201)])for(const _0xabc8e9 of _0x5e5e92[_0x4105f7(0x201)]){_0x3eb88c(_0xabc8e9[_0x4105f7(0x216)]);}}function replaceSegmentIdsInJourney(_0x43f5c6,_0x59504f){const _0x50149f=a170_0x4c74,_0x3d7cea=_0x46d0e7=>_0x59504f['get'](_0x46d0e7)||_0x46d0e7;_0x43f5c6[_0x50149f(0x20c)]?.['segment']&&(_0x43f5c6[_0x50149f(0x20c)][_0x50149f(0x294)]=_0x3d7cea(_0x43f5c6['goal'][_0x50149f(0x294)]));const _0x251ec4=_0x130066=>{const _0x39cb28=_0x50149f;for(const _0x6e34ca of _0x130066){_0x6e34ca[_0x39cb28(0x25e)]?.['segment']&&(_0x6e34ca[_0x39cb28(0x25e)]['segment']=_0x3d7cea(_0x6e34ca['entry_criteria'][_0x39cb28(0x294)]));if(_0x6e34ca[_0x39cb28(0x1e4)])for(const _0x4844be of _0x6e34ca[_0x39cb28(0x1e4)]){_0x4844be[_0x39cb28(0x294)]&&(_0x4844be['segment']=_0x3d7cea(_0x4844be['segment']));}_0x6e34ca[_0x39cb28(0x22d)]?.[_0x39cb28(0x294)]&&(_0x6e34ca[_0x39cb28(0x22d)][_0x39cb28(0x294)]=_0x3d7cea(_0x6e34ca[_0x39cb28(0x22d)][_0x39cb28(0x294)]));if(_0x6e34ca['steps'])for(const _0x93edac of _0x6e34ca['steps']){if(_0x93edac[_0x39cb28(0x26c)]==='decision_point'){const _0x5e3239=_0x93edac;for(const _0x44d29e of _0x5e3239[_0x39cb28(0x298)][_0x39cb28(0x295)]){_0x44d29e[_0x39cb28(0x294)]&&(_0x44d29e[_0x39cb28(0x294)]=_0x3d7cea(_0x44d29e[_0x39cb28(0x294)]));}}else{if(_0x93edac['type']===_0x39cb28(0x260)){const _0x181d24=_0x93edac;_0x181d24['with']['condition']?.[_0x39cb28(0x294)]&&(_0x181d24[_0x39cb28(0x298)]['condition'][_0x39cb28(0x294)]=_0x3d7cea(_0x181d24['with']['condition']['segment']));}}}}};if(_0x43f5c6[_0x50149f(0x23b)])for(const _0x153dec of _0x43f5c6['journeys']){_0x153dec[_0x50149f(0x20c)]?.[_0x50149f(0x294)]&&(_0x153dec['goal']['segment']=_0x3d7cea(_0x153dec[_0x50149f(0x20c)][_0x50149f(0x294)])),_0x251ec4(_0x153dec[_0x50149f(0x216)]);}_0x43f5c6[_0x50149f(0x216)]&&_0x251ec4(_0x43f5c6[_0x50149f(0x216)]);if(_0x43f5c6['versions'])for(const _0x90ac64 of _0x43f5c6[_0x50149f(0x201)]){_0x251ec4(_0x90ac64[_0x50149f(0x216)]);}}function collectActivationIdsFromJourney(_0x598aac,_0x5bdb8b){const _0x2d191e=a170_0x4c74,_0x440ef9=_0x38226d=>{const _0xd285a1=a170_0x4c74;for(const _0x497940 of _0x38226d){if(_0x497940[_0xd285a1(0x280)])for(const _0x1e6afe of _0x497940[_0xd285a1(0x280)]){if(_0x1e6afe[_0xd285a1(0x26c)]===_0xd285a1(0x283)){const _0x366ab1=_0x1e6afe;_0x366ab1[_0xd285a1(0x298)][_0xd285a1(0x283)]&&/^\d+$/[_0xd285a1(0x24b)](_0x366ab1[_0xd285a1(0x298)][_0xd285a1(0x283)])&&_0x5bdb8b[_0xd285a1(0x284)](_0x366ab1[_0xd285a1(0x298)][_0xd285a1(0x283)]);}}}};if(_0x598aac[_0x2d191e(0x23b)])for(const _0x104e28 of _0x598aac['journeys']){_0x440ef9(_0x104e28['stages']);}_0x598aac['stages']&&_0x440ef9(_0x598aac[_0x2d191e(0x216)]);if(_0x598aac[_0x2d191e(0x201)])for(const _0x16e740 of _0x598aac['versions']){_0x440ef9(_0x16e740[_0x2d191e(0x216)]);}}function replaceActivationIdsInJourney(_0x5e1990,_0x59f848){const _0x4924f5=a170_0x4c74,_0x5944e6=_0x5e7b79=>_0x59f848[_0x4924f5(0x248)](_0x5e7b79)||_0x5e7b79,_0x47ac04=_0x5c72bc=>{const _0x54ac6f=_0x4924f5;for(const _0x401725 of _0x5c72bc){if(_0x401725[_0x54ac6f(0x280)])for(const _0xf59afb of _0x401725[_0x54ac6f(0x280)]){if(_0xf59afb[_0x54ac6f(0x26c)]==='activation'){const _0x412a08=_0xf59afb;_0x412a08[_0x54ac6f(0x298)][_0x54ac6f(0x283)]&&(_0x412a08[_0x54ac6f(0x298)][_0x54ac6f(0x283)]=_0x5944e6(_0x412a08['with'][_0x54ac6f(0x283)]));}}}};if(_0x5e1990[_0x4924f5(0x23b)])for(const _0x5852b1 of _0x5e1990[_0x4924f5(0x23b)]){_0x47ac04(_0x5852b1[_0x4924f5(0x216)]);}_0x5e1990[_0x4924f5(0x216)]&&_0x47ac04(_0x5e1990[_0x4924f5(0x216)]);if(_0x5e1990['versions'])for(const _0x2ed42a of _0x5e1990[_0x4924f5(0x201)]){_0x47ac04(_0x2ed42a[_0x4924f5(0x216)]);}}function collectJumpTargetsFromJourney(_0x44ab4e,_0x558ea7){const _0x578111=a170_0x4c74,_0x55c4a8=new Set(),_0x5bab43=_0x482750=>{const _0xca455e=a170_0x4c74;for(const _0x4b9589 of _0x482750){if(_0x4b9589['steps'])for(const _0x4e10f4 of _0x4b9589[_0xca455e(0x280)]){if(_0x4e10f4['type']===_0xca455e(0x247)){const _0x248d02=_0x4e10f4,_0x3cdcf5=_0x248d02[_0xca455e(0x298)][_0xca455e(0x275)];if(_0x3cdcf5[_0xca455e(0x293)]&&_0x3cdcf5['stage']&&/^\d+$/[_0xca455e(0x24b)](_0x3cdcf5['journey'])&&/^\d+$/[_0xca455e(0x24b)](_0x3cdcf5[_0xca455e(0x26b)])){const _0x527dfe=_0x3cdcf5['journey']+':'+_0x3cdcf5[_0xca455e(0x26b)];!_0x55c4a8[_0xca455e(0x24c)](_0x527dfe)&&(_0x55c4a8[_0xca455e(0x284)](_0x527dfe),_0x558ea7[_0xca455e(0x1e9)]({'journeyId':_0x3cdcf5['journey'],'stageId':_0x3cdcf5['stage']}));}}}}};if(_0x44ab4e[_0x578111(0x23b)])for(const _0x52e2a0 of _0x44ab4e[_0x578111(0x23b)]){_0x5bab43(_0x52e2a0[_0x578111(0x216)]);}_0x44ab4e['stages']&&_0x5bab43(_0x44ab4e[_0x578111(0x216)]);if(_0x44ab4e[_0x578111(0x201)])for(const _0x2409f2 of _0x44ab4e[_0x578111(0x201)]){_0x5bab43(_0x2409f2[_0x578111(0x216)]);}}function replaceJumpTargetsInJourney(_0x17cd12,_0x9f9eec){const _0x5df135=a170_0x4c74,_0x163b6b=_0x1f358d=>{const _0x51bbe0=a170_0x4c74;for(const _0x7b5363 of _0x1f358d){if(_0x7b5363[_0x51bbe0(0x280)])for(const _0x27fb53 of _0x7b5363[_0x51bbe0(0x280)]){if(_0x27fb53[_0x51bbe0(0x26c)]===_0x51bbe0(0x247)){const _0x45374b=_0x27fb53,_0x7d095e=_0x45374b['with'][_0x51bbe0(0x275)],_0x4e89ec=_0x7d095e['journey']+':'+_0x7d095e[_0x51bbe0(0x26b)],_0x1b1d1a=_0x9f9eec[_0x51bbe0(0x248)](_0x4e89ec);_0x1b1d1a&&(_0x7d095e[_0x51bbe0(0x293)]=_0x1b1d1a[_0x51bbe0(0x222)],_0x7d095e[_0x51bbe0(0x26b)]=_0x1b1d1a[_0x51bbe0(0x213)]);}}}};if(_0x17cd12[_0x5df135(0x23b)])for(const _0x3dfbf2 of _0x17cd12['journeys']){_0x163b6b(_0x3dfbf2[_0x5df135(0x216)]);}_0x17cd12[_0x5df135(0x216)]&&_0x163b6b(_0x17cd12[_0x5df135(0x216)]);if(_0x17cd12[_0x5df135(0x201)])for(const _0x4d5ea8 of _0x17cd12['versions']){_0x163b6b(_0x4d5ea8[_0x5df135(0x216)]);}}function generateReadableStepName(_0x13c3f9,_0x346d79){const _0x514af7=a170_0x4c74;if(_0x13c3f9[_0x514af7(0x273)]&&_0x13c3f9['name']!==_0x13c3f9[_0x514af7(0x26c)]){const _0x4ed3e9=_0x13c3f9[_0x514af7(0x273)][_0x514af7(0x1e8)]();if(_0x4ed3e9&&/[a-z0-9\p{L}]/iu[_0x514af7(0x24b)](_0x4ed3e9))return _0x4ed3e9;}const _0x31c6d4=_0x13c3f9[_0x514af7(0x26c)]['toLowerCase']()[_0x514af7(0x292)](/step$/i,'');return _0x31c6d4+'_'+(_0x346d79+0x1);}function getStepNextRefs(_0xdfee4b){const _0x1d1fb0=a170_0x4c74,_0x561efd=[];if(_0xdfee4b[_0x1d1fb0(0x209)])_0x561efd[_0x1d1fb0(0x1e9)](_0xdfee4b[_0x1d1fb0(0x209)]);if(_0xdfee4b[_0x1d1fb0(0x295)])for(const _0x3e66f6 of _0xdfee4b[_0x1d1fb0(0x295)]){if(_0x3e66f6['next'])_0x561efd['push'](_0x3e66f6[_0x1d1fb0(0x209)]);}if(_0xdfee4b[_0x1d1fb0(0x2a1)])for(const _0x3b4929 of _0xdfee4b[_0x1d1fb0(0x2a1)]){if(_0x3b4929[_0x1d1fb0(0x209)])_0x561efd[_0x1d1fb0(0x1e9)](_0x3b4929[_0x1d1fb0(0x209)]);}if(_0xdfee4b[_0x1d1fb0(0x1ee)])for(const _0xa0d285 of _0xdfee4b[_0x1d1fb0(0x1ee)]){if(_0xa0d285[_0x1d1fb0(0x209)])_0x561efd['push'](_0xa0d285['next']);}return _0x561efd;}function parseJumpTargetDisplayName(_0x2ef140){const _0x26b5d2=a170_0x4c74,_0x255385=_0x2ef140[_0x26b5d2(0x249)](/^(.+?)\s*\(([^/)]+)/);if(!_0x255385)return undefined;const _0x4e823f=_0x255385[0x1][_0x26b5d2(0x1e8)](),_0x1a07a1=_0x255385[0x2][_0x26b5d2(0x1e8)]();if(!_0x4e823f||!_0x1a07a1)return undefined;return{'stageName':_0x4e823f,'journeyName':_0x1a07a1};}function orderStepsFromRoot(_0x3b518c,_0x1bb731){const _0x43a5a6=a170_0x4c74,_0x302d28=Object['entries'](_0x3b518c);if(_0x302d28['length']===0x0)return[];const _0x1aeda4=new Set(_0x302d28[_0x43a5a6(0x242)](([_0xc06b30])=>_0xc06b30)),_0x595553=new Set();for(const [,_0x480ef2]of _0x302d28){for(const _0x4e52ed of getStepNextRefs(_0x480ef2)){if(_0x1aeda4['has'](_0x4e52ed))_0x595553[_0x43a5a6(0x284)](_0x4e52ed);}}let _0x11a741=_0x1bb731&&_0x1aeda4[_0x43a5a6(0x24c)](_0x1bb731)?_0x1bb731:undefined;if(!_0x11a741){const _0x121ab0=_0x302d28['filter'](([_0x22c335])=>!_0x595553[_0x43a5a6(0x24c)](_0x22c335));_0x121ab0[_0x43a5a6(0x228)]>0x0?_0x11a741=_0x121ab0[0x0][0x0]:_0x11a741=_0x302d28[0x0][0x0];}const _0x301e57=[],_0x4a9970=new Set(),_0x5e83ef=[_0x11a741];while(_0x5e83ef['length']>0x0){const _0xef043e=_0x5e83ef[_0x43a5a6(0x1e3)]();if(_0x4a9970[_0x43a5a6(0x24c)](_0xef043e))continue;_0x4a9970['add'](_0xef043e);const _0x45d0f0=_0x3b518c[_0xef043e];if(!_0x45d0f0)continue;_0x301e57[_0x43a5a6(0x1e9)]({'uuid':_0xef043e,'step':_0x45d0f0});for(const _0x26fefb of getStepNextRefs(_0x45d0f0)){_0x1aeda4[_0x43a5a6(0x24c)](_0x26fefb)&&!_0x4a9970[_0x43a5a6(0x24c)](_0x26fefb)&&_0x5e83ef['push'](_0x26fefb);}}for(const [_0x49890c,_0x186b09]of _0x302d28){!_0x4a9970[_0x43a5a6(0x24c)](_0x49890c)&&_0x301e57['push']({'uuid':_0x49890c,'step':_0x186b09});}return _0x301e57;}function resolveStepReferences(_0x19244c,_0x4589b8,_0x53532b,_0xd36bc1){const _0x1757dc=a170_0x4c74;if(_0x19244c[_0x1757dc(0x26c)]!==_0x1757dc(0x23a)){_0x19244c[_0x1757dc(0x209)]&&_0xd36bc1['has'](_0x19244c[_0x1757dc(0x209)])&&(_0x19244c[_0x1757dc(0x209)]=_0xd36bc1[_0x1757dc(0x248)](_0x19244c['next']));const _0x84e423=_0x4589b8+0x1;if(_0x84e423<_0x53532b[_0x1757dc(0x228)]){const _0x147229=_0xd36bc1[_0x1757dc(0x248)](_0x53532b[_0x84e423][_0x1757dc(0x2a6)]);_0x19244c[_0x1757dc(0x209)]===_0x147229&&delete _0x19244c['next'];}}if(_0x19244c[_0x1757dc(0x26c)]===_0x1757dc(0x2a8))for(const _0x4fce30 of _0x19244c[_0x1757dc(0x298)][_0x1757dc(0x295)]){_0x4fce30[_0x1757dc(0x209)]&&_0xd36bc1[_0x1757dc(0x24c)](_0x4fce30[_0x1757dc(0x209)])&&(_0x4fce30[_0x1757dc(0x209)]=_0xd36bc1['get'](_0x4fce30[_0x1757dc(0x209)]));}if(_0x19244c[_0x1757dc(0x26c)]===_0x1757dc(0x208))for(const _0x555ce6 of _0x19244c[_0x1757dc(0x298)][_0x1757dc(0x2a1)]){_0x555ce6[_0x1757dc(0x209)]&&_0xd36bc1['has'](_0x555ce6[_0x1757dc(0x209)])&&(_0x555ce6[_0x1757dc(0x209)]=_0xd36bc1[_0x1757dc(0x248)](_0x555ce6['next']));}if(_0x19244c['type']===_0x1757dc(0x260)&&_0x19244c[_0x1757dc(0x298)]['condition']){const _0x399fb0=_0x19244c[_0x1757dc(0x298)][_0x1757dc(0x22e)];_0x399fb0[_0x1757dc(0x209)]&&_0xd36bc1[_0x1757dc(0x24c)](_0x399fb0[_0x1757dc(0x209)])&&(_0x399fb0[_0x1757dc(0x209)]=_0xd36bc1[_0x1757dc(0x248)](_0x399fb0['next'])),_0x399fb0['timeout']?.['next']&&_0xd36bc1[_0x1757dc(0x24c)](_0x399fb0[_0x1757dc(0x1fd)]['next'])&&(_0x399fb0[_0x1757dc(0x1fd)][_0x1757dc(0x209)]=_0xd36bc1[_0x1757dc(0x248)](_0x399fb0[_0x1757dc(0x1fd)]['next']));}}function convertApiStageToYaml(_0x13e6a1){const _0x43a034=a170_0x4c74,_0x36c3ba={'name':_0x13e6a1['name']};_0x13e6a1['id']&&(_0x36c3ba['id']=_0x13e6a1['id']);_0x13e6a1[_0x43a034(0x20e)]&&(_0x36c3ba[_0x43a034(0x20e)]=_0x13e6a1[_0x43a034(0x20e)]);_0x13e6a1[_0x43a034(0x243)]&&(_0x36c3ba[_0x43a034(0x25e)]=convertApiCriteriaToYaml(_0x13e6a1[_0x43a034(0x243)]));_0x13e6a1[_0x43a034(0x29b)]&&_0x13e6a1[_0x43a034(0x29b)][_0x43a034(0x228)]>0x0&&(_0x36c3ba['exit_criteria']=_0x13e6a1['exitCriterias'][_0x43a034(0x242)](convertApiCriteriaToYaml));_0x13e6a1[_0x43a034(0x22d)]&&(_0x36c3ba[_0x43a034(0x22d)]=convertApiCriteriaToYaml(_0x13e6a1[_0x43a034(0x22d)]));if(_0x13e6a1[_0x43a034(0x280)]&&Object[_0x43a034(0x20a)](_0x13e6a1[_0x43a034(0x280)])[_0x43a034(0x228)]>0x0){const _0x1f4cc0=orderStepsFromRoot(_0x13e6a1[_0x43a034(0x280)],_0x13e6a1[_0x43a034(0x271)]),_0xb34cea=new Map(),_0x4786ed=new Set();for(let _0x3c0847=0x0;_0x3c0847<_0x1f4cc0['length'];_0x3c0847++){const {uuid:_0x59e031,step:_0x50d2c4}=_0x1f4cc0[_0x3c0847];let _0x46667f=generateReadableStepName(_0x50d2c4,_0x3c0847),_0x582e0b=_0x46667f,_0x3d80bb=0x2;while(_0x4786ed[_0x43a034(0x24c)](_0x582e0b)){_0x582e0b=_0x46667f+'_'+_0x3d80bb,_0x3d80bb++;}_0x4786ed[_0x43a034(0x284)](_0x582e0b),_0xb34cea[_0x43a034(0x255)](_0x59e031,_0x582e0b);}_0x36c3ba[_0x43a034(0x280)]=_0x1f4cc0[_0x43a034(0x242)](({uuid:_0x1be45c,step:_0x52c85b},_0x32c658)=>{const _0x44ea4b=convertApiStepToYaml(_0x52c85b,_0xb34cea['get'](_0x1be45c));return resolveStepReferences(_0x44ea4b,_0x32c658,_0x1f4cc0,_0xb34cea),_0x44ea4b;});}return _0x36c3ba;}function convertApiCriteriaToYaml(_0x462171){const _0x3dc5e3=a170_0x4c74,_0x123697={'name':_0x462171[_0x3dc5e3(0x273)],'segment':_0x462171[_0x3dc5e3(0x219)]};_0x462171[_0x3dc5e3(0x20e)]&&(_0x123697[_0x3dc5e3(0x20e)]=_0x462171['description']);if(_0x462171['target']){let _0x50c54f=_0x462171['target'][_0x3dc5e3(0x200)],_0xd69519=_0x462171[_0x3dc5e3(0x275)][_0x3dc5e3(0x1fc)];if(_0x462171[_0x3dc5e3(0x275)]['journeyName']){const _0x100486=parseJumpTargetDisplayName(_0x462171[_0x3dc5e3(0x275)]['journeyName']);_0x100486&&(_0xd69519=_0x100486[_0x3dc5e3(0x213)],_0x50c54f=_0x100486['journeyName']);}_0x123697[_0x3dc5e3(0x275)]={'journey':_0x50c54f,'stage':_0xd69519},_0x462171['target'][_0x3dc5e3(0x28b)]&&(_0x123697[_0x3dc5e3(0x275)][_0x3dc5e3(0x254)]=_0x462171[_0x3dc5e3(0x275)][_0x3dc5e3(0x28b)]);}return _0x123697;}function convertApiStepToYaml(_0x268be5,_0xfc05e8){const _0x262bd7=a170_0x4c74;switch(_0x268be5[_0x262bd7(0x26c)]){case _0x262bd7(0x27c):{const _0x9831a5={};if(_0x268be5[_0x262bd7(0x1f2)]===_0x262bd7(0x262)&&_0x268be5['waitStep']!==undefined)_0x9831a5[_0x262bd7(0x21c)]=_0x268be5['waitStep'],_0x9831a5[_0x262bd7(0x205)]=_0x268be5[_0x262bd7(0x285)];else{if(_0x268be5[_0x262bd7(0x1f2)]===_0x262bd7(0x223)&&_0x268be5[_0x262bd7(0x1eb)])_0x9831a5[_0x262bd7(0x2a5)]=_0x268be5[_0x262bd7(0x1eb)];else{if(_0x268be5[_0x262bd7(0x1f2)]===_0x262bd7(0x23d)&&_0x268be5[_0x262bd7(0x22f)])_0x9831a5[_0x262bd7(0x25d)]=_0x268be5[_0x262bd7(0x22f)];else{if(_0x268be5[_0x262bd7(0x1f2)]===_0x262bd7(0x24f)){if(_0x268be5[_0x262bd7(0x1ee)]&&_0x268be5[_0x262bd7(0x1ee)]['length']>0x0){const _0x47db4c=_0x268be5[_0x262bd7(0x1ee)][_0x262bd7(0x1f0)](_0x427bdb=>!_0x427bdb[_0x262bd7(0x28a)]),_0x2631dd=_0x268be5[_0x262bd7(0x1ee)][_0x262bd7(0x1f0)](_0x54aaad=>_0x54aaad[_0x262bd7(0x28a)]);_0x47db4c?.[_0x262bd7(0x219)]&&(_0x9831a5[_0x262bd7(0x22e)]={'segment':_0x47db4c[_0x262bd7(0x219)],..._0x47db4c[_0x262bd7(0x209)]?{'next':_0x47db4c['next']}:{}},_0x2631dd&&_0x2631dd['moveAfter']!==undefined&&_0x2631dd[_0x262bd7(0x205)]&&(_0x9831a5['condition'][_0x262bd7(0x1fd)]={'duration':_0x2631dd[_0x262bd7(0x1ed)],'unit':_0x2631dd[_0x262bd7(0x205)],..._0x2631dd[_0x262bd7(0x209)]?{'next':_0x2631dd[_0x262bd7(0x209)]}:{}}));}else _0x268be5[_0x262bd7(0x267)]&&(_0x9831a5[_0x262bd7(0x22e)]={'segment':_0x268be5[_0x262bd7(0x267)]},_0x268be5['conditionTimeoutDuration']!==undefined&&_0x268be5[_0x262bd7(0x21f)]&&(_0x9831a5[_0x262bd7(0x22e)]['timeout']={'duration':_0x268be5[_0x262bd7(0x233)],'unit':_0x268be5[_0x262bd7(0x21f)]}));}}}}const _0x282859={'type':_0x262bd7(0x260),'name':_0xfc05e8,..._0x268be5['next']?{'next':_0x268be5[_0x262bd7(0x209)]}:{},'with':_0x9831a5};return _0x282859;}case _0x262bd7(0x23e):{const _0x585e1e={'type':_0x262bd7(0x283),'name':_0xfc05e8,..._0x268be5[_0x262bd7(0x209)]?{'next':_0x268be5['next']}:{},'with':{'activation':_0x268be5['journeyActivationStepId']||''}};return _0x585e1e;}case _0x262bd7(0x251):{const _0x2e882f={'type':_0x262bd7(0x2a8),'name':_0xfc05e8,..._0x268be5[_0x262bd7(0x209)]?{'next':_0x268be5['next']}:{},'with':{'branches':(_0x268be5['branches']||[])[_0x262bd7(0x242)](_0xdfb53d=>({'name':_0xdfb53d[_0x262bd7(0x273)],'segment':_0xdfb53d['segmentId'],'excluded':_0xdfb53d[_0x262bd7(0x26a)],..._0xdfb53d[_0x262bd7(0x209)]?{'next':_0xdfb53d[_0x262bd7(0x209)]}:{}}))}};return _0x2e882f;}case _0x262bd7(0x29d):case _0x262bd7(0x21e):case'Variant':{const _0x30123c=_0x268be5[_0x262bd7(0x2a1)]||(_0x268be5[_0x262bd7(0x295)]||[])[_0x262bd7(0x242)](_0x95564=>({'name':_0x95564[_0x262bd7(0x273)],'percentage':0x0,'next':_0x95564[_0x262bd7(0x209)]})),_0x347a19={'type':_0x262bd7(0x208),'name':_0xfc05e8,..._0x268be5[_0x262bd7(0x209)]?{'next':_0x268be5['next']}:{},'with':{'customized_split':_0x268be5[_0x262bd7(0x217)],'unique_id':_0x268be5[_0x262bd7(0x25c)],'variants':_0x30123c[_0x262bd7(0x242)](_0xe2fd2f=>({'name':_0xe2fd2f[_0x262bd7(0x273)],'percentage':_0xe2fd2f[_0x262bd7(0x28e)],..._0xe2fd2f[_0x262bd7(0x209)]?{'next':_0xe2fd2f[_0x262bd7(0x209)]}:{}}))}};return _0x347a19;}case _0x262bd7(0x215):{const _0x550100={'type':_0x262bd7(0x235),'name':_0xfc05e8,..._0x268be5['next']?{'next':_0x268be5[_0x262bd7(0x209)]}:{}};return _0x550100;}case'Jump':{let _0x2db636='',_0x391cf9='',_0x24ac3d;if(_0x268be5[_0x262bd7(0x275)]){_0x2db636=_0x268be5[_0x262bd7(0x275)][_0x262bd7(0x200)],_0x391cf9=_0x268be5[_0x262bd7(0x275)]['journeyStageId'],_0x24ac3d=_0x268be5[_0x262bd7(0x275)]['journeyBundleId'];if(_0x268be5['target'][_0x262bd7(0x222)]){const _0x47fa8f=parseJumpTargetDisplayName(_0x268be5[_0x262bd7(0x275)][_0x262bd7(0x222)]);_0x47fa8f&&(_0x391cf9=_0x47fa8f['stageName'],_0x2db636=_0x47fa8f['journeyName']);}}const _0x588d1a={'type':_0x262bd7(0x247),'name':_0xfc05e8,..._0x268be5[_0x262bd7(0x209)]?{'next':_0x268be5[_0x262bd7(0x209)]}:{},'with':{'target':{'journey':_0x2db636,'stage':_0x391cf9,..._0x24ac3d?{'bundle_id':_0x24ac3d}:{}}}};return _0x588d1a;}case _0x262bd7(0x1ef):{const _0x13a374={'type':'end','name':_0xfc05e8};return _0x13a374;}default:{const _0x588509={'type':_0x262bd7(0x23a),'name':_0xfc05e8};return _0x588509;}}}export async function journeyDefToRequest(_0x2dfe2c,_0x414ff7,_0x231a45){const _0x3706d2=a170_0x4c74,_0x541aba=_0x2dfe2c[_0x3706d2(0x216)]||getActiveStages(_0x2dfe2c),_0x246d46=isJourneysArrayMode(_0x2dfe2c)||isMultiVersionMode(_0x2dfe2c)?getLatestJourneyEntry(_0x2dfe2c):undefined,_0x3d1e49=_0x246d46?.[_0x3706d2(0x2a7)]??_0x2dfe2c[_0x3706d2(0x273)],_0x4e2402=_0x2dfe2c[_0x3706d2(0x1ff)]||{},_0x49dca9=_0x2dfe2c['activations']||{},_0x34be5d={'type':_0x3706d2(0x293),'attributes':{'name':_0x3d1e49,'audienceId':_0x414ff7,'journeyStages':await Promise[_0x3706d2(0x2a4)](_0x541aba[_0x3706d2(0x242)](_0xb65c8e=>convertYamlStageToApi(_0xb65c8e,_0x231a45,_0x4e2402,_0x49dca9)))}},_0x4f7547=_0x246d46?.['id']??_0x2dfe2c['id'];_0x4f7547&&(_0x34be5d['id']=_0x4f7547);_0x2dfe2c[_0x3706d2(0x20e)]&&(_0x34be5d[_0x3706d2(0x244)][_0x3706d2(0x20e)]=_0x2dfe2c[_0x3706d2(0x20e)]);const _0x380192=getEffectiveGoal(_0x2dfe2c);_0x380192&&(_0x34be5d[_0x3706d2(0x244)][_0x3706d2(0x20c)]=await convertYamlCriteriaToApi(_0x380192,_0x231a45,_0x4e2402));const _0x901e17=getEffectiveReentry(_0x2dfe2c);return _0x901e17&&(_0x34be5d['attributes']['reentryMode']=_0x901e17,_0x34be5d[_0x3706d2(0x244)]['allowReentry']=_0x901e17!==_0x3706d2(0x221)),_0x2dfe2c[_0x3706d2(0x1e1)]&&(_0x34be5d[_0x3706d2(0x23f)]={'parentFolder':{'data':{'id':_0x2dfe2c[_0x3706d2(0x1e1)],'type':_0x3706d2(0x296)}}}),_0x34be5d;}async function convertYamlStageToApi(_0x24772c,_0x4dc051,_0x48113f={},_0x3ed408={}){const _0x35d9a3=a170_0x4c74,_0x32ed26={'name':_0x24772c['name']};_0x24772c['id']&&(_0x32ed26['id']=_0x24772c['id']);_0x24772c[_0x35d9a3(0x20e)]&&(_0x32ed26[_0x35d9a3(0x20e)]=_0x24772c[_0x35d9a3(0x20e)]);_0x24772c['entry_criteria']&&(_0x32ed26[_0x35d9a3(0x243)]=await convertYamlCriteriaToApi(_0x24772c[_0x35d9a3(0x25e)],_0x4dc051,_0x48113f));_0x24772c[_0x35d9a3(0x1e4)]&&_0x24772c['exit_criteria'][_0x35d9a3(0x228)]>0x0&&(_0x32ed26[_0x35d9a3(0x29b)]=await Promise[_0x35d9a3(0x2a4)](_0x24772c[_0x35d9a3(0x1e4)][_0x35d9a3(0x242)](_0x51c5e0=>convertYamlCriteriaToApi(_0x51c5e0,_0x4dc051,_0x48113f))));_0x24772c[_0x35d9a3(0x22d)]&&(_0x32ed26[_0x35d9a3(0x22d)]=await convertYamlCriteriaToApi(_0x24772c[_0x35d9a3(0x22d)],_0x4dc051,_0x48113f));if(_0x24772c['steps']&&_0x24772c['steps'][_0x35d9a3(0x228)]>0x0){const _0x56ef1d={},_0xca5521=_0x24772c['steps']['map']((_0x51ba6d,_0x236081)=>{const _0x5890c2=_0x35d9a3,_0x1806fe=_0x51ba6d['uuid']||generateUUID(),_0x3e288c=_0x51ba6d[_0x5890c2(0x273)]||_0x51ba6d[_0x5890c2(0x26c)]+'_'+_0x236081;return _0x56ef1d[_0x3e288c]=_0x1806fe,{..._0x51ba6d,'name':_0x3e288c};});_0x32ed26['rootStep']=_0x56ef1d[_0xca5521[0x0]['name']],_0x32ed26[_0x35d9a3(0x280)]={};for(let _0x2b8789=0x0;_0x2b8789<_0xca5521[_0x35d9a3(0x228)];_0x2b8789++){const _0x2b7093=_0xca5521[_0x2b8789],_0x3776e5=_0x56ef1d[_0x2b7093['name']],_0x3cd576=!_0x2b7093[_0x35d9a3(0x209)]&&_0x2b8789<_0xca5521['length']-0x1&&_0x2b7093[_0x35d9a3(0x26c)]!==_0x35d9a3(0x23a)?_0xca5521[_0x2b8789+0x1][_0x35d9a3(0x273)]:_0x2b7093['next'],_0x105bbf=_0x3cd576!==_0x2b7093[_0x35d9a3(0x209)]?{..._0x2b7093,'next':_0x3cd576}:_0x2b7093;_0x32ed26[_0x35d9a3(0x280)][_0x3776e5]=await convertYamlStepToApi(_0x105bbf,_0x4dc051,_0x48113f,_0x56ef1d,_0x3ed408);}}else _0x24772c[_0x35d9a3(0x227)]&&(_0x32ed26['rootStep']=_0x24772c[_0x35d9a3(0x227)]);return _0x32ed26;}async function convertYamlCriteriaToApi(_0x100c10,_0x37f4fe,_0x2c05c0={}){const _0x18268e=a170_0x4c74;let _0xdbf1e3=_0x100c10[_0x18268e(0x294)];if(_0xdbf1e3&&!/^\d+$/[_0x18268e(0x24b)](_0xdbf1e3)){const _0x4e37a8=parseSegmentRef(_0xdbf1e3);if(_0x4e37a8[_0x18268e(0x26c)]===_0x18268e(0x29f))_0x37f4fe?.[_0x18268e(0x279)]&&(_0xdbf1e3=await _0x37f4fe[_0x18268e(0x279)](_0x4e37a8[_0x18268e(0x273)]));else{if(_0x4e37a8['type']===_0x18268e(0x238)&&_0x2c05c0[_0x4e37a8[_0x18268e(0x273)]])_0x37f4fe?.[_0x18268e(0x272)]&&(_0xdbf1e3=await _0x37f4fe[_0x18268e(0x272)](_0x4e37a8['name'],_0x2c05c0[_0x4e37a8[_0x18268e(0x273)]]));else _0x37f4fe?.[_0x18268e(0x279)]&&(_0xdbf1e3=await _0x37f4fe['resolveSegmentId'](_0x4e37a8[_0x18268e(0x273)]));}}const _0x4d7c29={'name':_0x100c10[_0x18268e(0x273)],'segmentId':_0xdbf1e3};_0x100c10[_0x18268e(0x20e)]&&(_0x4d7c29[_0x18268e(0x20e)]=_0x100c10['description']);if(_0x100c10[_0x18268e(0x275)]){const _0x31e4f5=_0x100c10[_0x18268e(0x275)]['journey'],_0x33e00c=_0x100c10[_0x18268e(0x275)][_0x18268e(0x26b)];let _0x37f184=_0x100c10['target'][_0x18268e(0x293)];_0x37f4fe?.[_0x18268e(0x237)]&&!/^\d+$/[_0x18268e(0x24b)](_0x37f184)&&(_0x37f184=await _0x37f4fe[_0x18268e(0x237)](_0x37f184));let _0x5c7b5a=_0x100c10[_0x18268e(0x275)]['stage'];_0x37f4fe?.[_0x18268e(0x1f6)]&&!/^\d+$/[_0x18268e(0x24b)](_0x5c7b5a)&&(_0x5c7b5a=await _0x37f4fe[_0x18268e(0x1f6)](_0x37f184,_0x5c7b5a));const _0x182f8=!/^\d+$/[_0x18268e(0x24b)](_0x31e4f5)&&!isLocalJourneyRef(_0x31e4f5)?formatApiJourneyName(_0x31e4f5,_0x33e00c):undefined;_0x4d7c29[_0x18268e(0x275)]={'journeyId':_0x37f184,'journeyStageId':_0x5c7b5a,'journeyName':_0x182f8,'confirmed':!![]},_0x100c10[_0x18268e(0x275)]['bundle_id']&&(_0x4d7c29[_0x18268e(0x275)][_0x18268e(0x28b)]=_0x100c10['target'][_0x18268e(0x254)]);}return _0x4d7c29;}function a170_0x4c74(_0x3c1be0,_0x271844){_0x3c1be0=_0x3c1be0-0x1e0;const _0xd5755e=a170_0xd575();let _0x4c7472=_0xd5755e[_0x3c1be0];return _0x4c7472;}async function convertYamlStepToApi(_0x49ba10,_0x111ce7,_0x4257ca={},_0x29d914={},_0x8025f8={}){const _0xcf9608=a170_0x4c74,_0x224960=async _0x3495c4=>{const _0x1e0d6c=a170_0x4c74;if(/^\d+$/['test'](_0x3495c4))return _0x3495c4;const _0x399fa2=parseSegmentRef(_0x3495c4);if(_0x399fa2['type']===_0x1e0d6c(0x29f)){if(_0x111ce7?.[_0x1e0d6c(0x279)])return await _0x111ce7[_0x1e0d6c(0x279)](_0x399fa2[_0x1e0d6c(0x273)]);}else{if(_0x399fa2['type']===_0x1e0d6c(0x238)&&_0x4257ca[_0x399fa2[_0x1e0d6c(0x273)]]){if(_0x111ce7?.[_0x1e0d6c(0x272)])return await _0x111ce7['resolveEmbeddedSegmentId'](_0x399fa2['name'],_0x4257ca[_0x399fa2[_0x1e0d6c(0x273)]]);}else{if(_0x111ce7?.[_0x1e0d6c(0x279)])return await _0x111ce7['resolveSegmentId'](_0x399fa2['name']);}}return _0x3495c4;},_0x2f14ca=async _0xa95389=>{const _0x3ff36d=a170_0x4c74;if(/^\d+$/[_0x3ff36d(0x24b)](_0xa95389))return _0xa95389;const _0x4473a9=parseSegmentRef(_0xa95389);if(_0x4473a9[_0x3ff36d(0x26c)]===_0x3ff36d(0x29f)){if(_0x111ce7?.[_0x3ff36d(0x1f7)])return await _0x111ce7['resolveActivationId'](_0x4473a9[_0x3ff36d(0x273)]);return _0x4473a9['name'];}else{if(_0x4473a9[_0x3ff36d(0x26c)]==='embedded'&&_0x8025f8[_0x4473a9[_0x3ff36d(0x273)]]){if(_0x111ce7?.['resolveEmbeddedActivationId'])return await _0x111ce7[_0x3ff36d(0x287)](_0x4473a9[_0x3ff36d(0x273)],_0x8025f8[_0x4473a9['name']]);if(_0x111ce7?.['resolveActivationId'])return await _0x111ce7['resolveActivationId'](_0x4473a9['name']);}else{if(_0x111ce7?.[_0x3ff36d(0x1f7)])return await _0x111ce7[_0x3ff36d(0x1f7)](_0x4473a9[_0x3ff36d(0x273)]);}}return _0xa95389;},_0x319171=_0x2f1543=>{const _0x37d86f=a170_0x4c74;if(!_0x2f1543)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x37d86f(0x24b)](_0x2f1543))return _0x2f1543;return _0x29d914[_0x2f1543]||_0x2f1543;};switch(_0x49ba10[_0xcf9608(0x26c)]){case _0xcf9608(0x260):{const _0x294b48=_0x49ba10,_0x18138f=_0x294b48[_0xcf9608(0x298)],_0x50bd5a={'type':_0xcf9608(0x27c),'name':_0x294b48[_0xcf9608(0x273)],'next':_0x319171(_0x294b48[_0xcf9608(0x209)])};if(_0x18138f[_0xcf9608(0x21c)]!==undefined&&_0x18138f['unit'])_0x50bd5a[_0xcf9608(0x1f2)]=_0xcf9608(0x262),_0x50bd5a['waitStep']=_0x18138f[_0xcf9608(0x21c)],_0x50bd5a[_0xcf9608(0x285)]=normalizeWaitUnit(_0x18138f[_0xcf9608(0x205)]);else{if(_0x18138f[_0xcf9608(0x2a5)])_0x50bd5a['waitStepType']=_0xcf9608(0x223),_0x50bd5a[_0xcf9608(0x1eb)]=_0x18138f[_0xcf9608(0x2a5)];else{if(_0x18138f['days_of_week'])_0x50bd5a[_0xcf9608(0x1f2)]='DaysOfTheWeek',_0x50bd5a[_0xcf9608(0x22f)]=_0x18138f['days_of_week'];else{if(_0x18138f['condition']){_0x50bd5a[_0xcf9608(0x1f2)]='Condition';const _0x102822=await _0x224960(_0x18138f[_0xcf9608(0x22e)][_0xcf9608(0x294)]),_0x41ca81=_0x18138f[_0xcf9608(0x22e)][_0xcf9608(0x1fd)]?.[_0xcf9608(0x209)]!==undefined;if(_0x41ca81){const _0x35d145=[];_0x35d145[_0xcf9608(0x1e9)]({'id':generateUUID(),'segmentId':_0x102822,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x319171(_0x18138f[_0xcf9608(0x22e)]['next']??_0x294b48[_0xcf9608(0x209)])});if(_0x18138f['condition'][_0xcf9608(0x1fd)]){const _0x57e22f=_0x18138f[_0xcf9608(0x22e)][_0xcf9608(0x1fd)][_0xcf9608(0x21c)],_0x3085dc=normalizeWaitUnit(_0x18138f[_0xcf9608(0x22e)]['timeout']['unit']);_0x35d145['push']({'id':generateUUID(),'timedOutPath':!![],'name':_0xcf9608(0x29e)+_0x57e22f+'\x20'+_0x3085dc,'moveAfter':_0x57e22f,'unit':_0x3085dc,'next':_0x319171(_0x18138f[_0xcf9608(0x22e)]['timeout'][_0xcf9608(0x209)])});}_0x50bd5a['conditions']=_0x35d145,delete _0x50bd5a[_0xcf9608(0x209)];}else _0x50bd5a[_0xcf9608(0x267)]=_0x102822,_0x18138f[_0xcf9608(0x22e)][_0xcf9608(0x1fd)]&&(_0x50bd5a['conditionTimeoutDuration']=_0x18138f[_0xcf9608(0x22e)][_0xcf9608(0x1fd)]['duration'],_0x18138f['condition'][_0xcf9608(0x1fd)][_0xcf9608(0x205)]&&(_0x50bd5a[_0xcf9608(0x21f)]=normalizeWaitUnit(_0x18138f[_0xcf9608(0x22e)][_0xcf9608(0x1fd)]['unit'])));}}}}return _0x50bd5a;}case'activation':{const _0x254e0e=_0x49ba10,_0x2dd516=_0x254e0e[_0xcf9608(0x298)][_0xcf9608(0x283)],_0x2bcc08=await _0x2f14ca(_0x2dd516);return{'type':_0xcf9608(0x23e),'name':_0x254e0e['name'],'journeyActivationStepId':_0x2bcc08,'next':_0x319171(_0x254e0e[_0xcf9608(0x209)])};}case _0xcf9608(0x2a8):{const _0x1f4108=_0x49ba10,_0x4f8287=_0x1f4108[_0xcf9608(0x298)][_0xcf9608(0x295)];return{'type':_0xcf9608(0x251),'name':_0x1f4108['name'],'branches':await Promise[_0xcf9608(0x2a4)](_0x4f8287[_0xcf9608(0x242)](async _0x1e8623=>{const _0x19b520=_0xcf9608;let _0x5610ec='';if(!_0x1e8623[_0x19b520(0x1e0)]){const _0x551c59=_0x1e8623[_0x19b520(0x294)]||_0x1e8623['segment_id']||'';_0x5610ec=_0x551c59?await _0x224960(_0x551c59):'';}return{'id':crypto[_0x19b520(0x225)](),'name':_0x1e8623[_0x19b520(0x273)],'description':null,'segmentId':_0x5610ec,'excludedPath':_0x1e8623['excluded']??![],'next':_0x319171(_0x1e8623[_0x19b520(0x209)])};})),'next':_0x319171(_0x1f4108[_0xcf9608(0x209)])};}case _0xcf9608(0x208):{const _0x4afdaa=_0x49ba10,_0xe6d55f=_0x4afdaa[_0xcf9608(0x298)];return{'type':_0xcf9608(0x29d),'name':_0x4afdaa['name'],'customizedSplit':_0xe6d55f['customized_split'],'uniqueId':_0xe6d55f[_0xcf9608(0x220)],'variants':_0xe6d55f[_0xcf9608(0x2a1)][_0xcf9608(0x242)](_0x5e21ea=>({'id':_0x5e21ea['id']||generateUUID(),'name':_0x5e21ea[_0xcf9608(0x273)],'percentage':_0x5e21ea['percentage'],'next':_0x319171(_0x5e21ea[_0xcf9608(0x209)])})),'next':_0x319171(_0x4afdaa[_0xcf9608(0x209)])};}case _0xcf9608(0x235):return{'type':'Merge','name':_0x49ba10[_0xcf9608(0x273)],'next':_0x319171(_0x49ba10['next'])};case _0xcf9608(0x247):{const _0x21320a=_0x49ba10,_0x4d0270=_0x21320a['with'][_0xcf9608(0x275)],_0x1d104c=_0x4d0270[_0xcf9608(0x293)],_0x155edc=_0x4d0270[_0xcf9608(0x26b)];let _0x20e599=_0x4d0270[_0xcf9608(0x293)];_0x111ce7?.[_0xcf9608(0x237)]&&!/^\d+$/[_0xcf9608(0x24b)](_0x20e599)&&(_0x20e599=await _0x111ce7[_0xcf9608(0x237)](_0x20e599));let _0x4c50be=_0x4d0270[_0xcf9608(0x26b)];_0x111ce7?.[_0xcf9608(0x1f6)]&&!/^\d+$/[_0xcf9608(0x24b)](_0x4c50be)&&(_0x4c50be=await _0x111ce7[_0xcf9608(0x1f6)](_0x20e599,_0x4c50be));const _0x46edca=!/^\d+$/[_0xcf9608(0x24b)](_0x1d104c)&&!isLocalJourneyRef(_0x1d104c)?formatApiJourneyName(_0x1d104c,_0x155edc):undefined;return{'type':_0xcf9608(0x26e),'name':_0x21320a[_0xcf9608(0x273)],'target':{'journeyId':_0x20e599,'journeyStageId':_0x4c50be,'journeyBundleId':_0x4d0270[_0xcf9608(0x254)],'journeyName':_0x46edca,'confirmed':!![]},'next':_0x319171(_0x21320a[_0xcf9608(0x209)])};}case _0xcf9608(0x23a):return{'type':'End','name':_0x49ba10[_0xcf9608(0x273)]};default:{const _0x93a564=_0x49ba10;return{'type':_0xcf9608(0x1ef),'name':_0x93a564[_0xcf9608(0x273)]};}}}export function toYamlString(_0xa3a076){const _0x106276=a170_0x4c74,_0x4fd5fc=stripInternalFields(_0xa3a076),_0x31d728=a170_0xe71565[_0x106276(0x25a)](_0x4fd5fc,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x106276(0x250)}),_0x5ae2fc=[_0x106276(0x204),'activations:','goal:',_0x106276(0x299),'journeys:',_0x106276(0x291),_0x106276(0x1f4)];let _0xae9d8a=_0x31d728;for(const _0x32cc28 of _0x5ae2fc){_0xae9d8a=_0xae9d8a[_0x106276(0x292)](new RegExp('^('+_0x32cc28+')','m'),(_0xc4e5f4,_0x1b320d,_0x274137)=>{if(_0x274137===0x0||_0xae9d8a[_0x274137-0x1]==='\x0a'&&_0xae9d8a[_0x274137-0x2]==='\x0a')return _0x1b320d;return'\x0a'+_0x1b320d;});}return _0xae9d8a;}function stripInternalFields(_0x20c851){const _0x59b78b=a170_0x4c74,{id:_0x2f748f,folder_id:_0x5880d7,bundle_id:_0x77a8b7,bundle_name:_0x1c2970,version:_0x225bd4,allow_reentry:_0x21b88c,..._0x2702c0}=_0x20c851;return _0x2702c0[_0x59b78b(0x23b)]&&(_0x2702c0['journeys']=_0x2702c0[_0x59b78b(0x23b)][_0x59b78b(0x242)](_0x1fa1dc=>{const _0x3efac1=_0x59b78b,{id:_0x4a6381,..._0x4f32fb}=_0x1fa1dc;return{..._0x4f32fb,'stages':_0x4f32fb[_0x3efac1(0x216)]['map'](stripStageInternalFields),..._0x1fa1dc['latest']===!![]?{'latest':!![]}:{},..._0x2702c0[_0x3efac1(0x23b)][_0x3efac1(0x228)]===0x1&&_0x4f32fb['version']==='v1'?{'version':undefined}:{}};})),_0x2702c0[_0x59b78b(0x216)]&&(_0x2702c0['stages']=_0x2702c0['stages'][_0x59b78b(0x242)](stripStageInternalFields)),_0x2702c0[_0x59b78b(0x201)]&&(_0x2702c0['versions']=_0x2702c0['versions']['map'](_0x53addc=>{const _0x3e5589=_0x59b78b,{id:_0x371134,..._0x48702d}=_0x53addc;return{..._0x48702d,'stages':_0x48702d[_0x3e5589(0x216)]['map'](stripStageInternalFields),..._0x53addc[_0x3e5589(0x239)]===!![]?{'latest':!![]}:{}};})),_0x2702c0;}function stripStageInternalFields(_0x3f8a86){const {id:_0x31d36b,..._0x6b12c5}=_0x3f8a86;return _0x6b12c5;}export function parseYamlString(_0xa91db8){return safeParseYaml(_0xa91db8,JourneyDefSchema);}export function isJourneyDef(_0x270702,_0x50e696){const _0xd0bd87=a170_0x4c74;if(_0x50e696&&(_0x50e696[_0xd0bd87(0x27b)](_0xd0bd87(0x1e6))||_0x50e696[_0xd0bd87(0x27b)](_0xd0bd87(0x218))))return!![];return typeof _0x270702===_0xd0bd87(0x266)&&_0x270702!==null&&_0xd0bd87(0x26c)in _0x270702&&_0x270702['type']===_0xd0bd87(0x293);}export function generateTemplate(_0xa74596,_0x3e8141){const _0x35b9bb=a170_0x4c74,_0x31f5a8={'type':_0x35b9bb(0x293),'name':_0xa74596,'description':_0x35b9bb(0x278),'reentry':_0x35b9bb(0x221),'goal':{'name':_0x35b9bb(0x288),'segment':_0x35b9bb(0x214)},'stages':[{'name':_0x35b9bb(0x28f),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':_0x35b9bb(0x29a),'segment':_0x3e8141},'steps':[{'type':_0x35b9bb(0x260),'name':_0x35b9bb(0x297),'with':{'duration':0x1,'unit':_0x35b9bb(0x22a)}},{'type':_0x35b9bb(0x283),'name':_0x35b9bb(0x286),'with':{'activation':_0x35b9bb(0x22b)}},{'type':_0x35b9bb(0x23a),'name':_0x35b9bb(0x1f1)}]}]};return toYamlString(_0x31f5a8);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX=a170_0x53c011(0x28c);export function parseSegmentRef(_0x508ad5){const _0x249712=a170_0x53c011;if(_0x508ad5[_0x249712(0x230)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x508ad5[_0x249712(0x21d)](SEGMENT_REF_PREFIX[_0x249712(0x228)])};if(/^\d+$/[_0x249712(0x24b)](_0x508ad5))return{'type':'id','name':_0x508ad5};return{'type':'embedded','name':_0x508ad5};}export function makeSegmentRef(_0x579b1e){return''+SEGMENT_REF_PREFIX+_0x579b1e;}export function isExternalSegmentRef(_0x2614c6){return _0x2614c6['startsWith'](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x1d1837){const _0x5567a7=a170_0x53c011;return!!(_0x1d1837[_0x5567a7(0x23b)]&&_0x1d1837[_0x5567a7(0x23b)][_0x5567a7(0x228)]>0x0);}export function isMultiVersionMode(_0xe01855){const _0x38c4e2=a170_0x53c011;return!!(_0xe01855[_0x38c4e2(0x201)]&&_0xe01855[_0x38c4e2(0x201)][_0x38c4e2(0x228)]>0x0);}export function isSingleVersionMode(_0x173839){const _0x3b676d=a170_0x53c011;return!!(_0x173839['stages']&&_0x173839[_0x3b676d(0x216)][_0x3b676d(0x228)]>0x0);}export function hasMultipleVersions(_0xca8abe){const _0x3d3ac3=a170_0x53c011;if(isJourneysArrayMode(_0xca8abe))return(_0xca8abe[_0x3d3ac3(0x23b)]?.[_0x3d3ac3(0x228)]||0x0)>0x1;if(isMultiVersionMode(_0xca8abe))return(_0xca8abe[_0x3d3ac3(0x201)]?.[_0x3d3ac3(0x228)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x1e0231){const _0x33c9=a170_0x53c011;if(isJourneysArrayMode(_0x1e0231))return _0x1e0231;if(isSingleVersionMode(_0x1e0231)){const {stages:_0x573afa,id:_0x27f9ba,version:_0x231c9b,version_number:_0x385f68,..._0x5de089}=_0x1e0231;return{..._0x5de089,'journeys':[{'version':_0x231c9b||'v1','stages':_0x573afa||[],'id':_0x27f9ba,'version_number':_0x385f68}]};}if(isMultiVersionMode(_0x1e0231)){const {versions:_0xb28d61,..._0x19e062}=_0x1e0231;return{..._0x19e062,'journeys':(_0xb28d61||[])[_0x33c9(0x242)](_0x4382fc=>({'version':_0x4382fc[_0x33c9(0x273)],'state':_0x4382fc['state'],'latest':_0x4382fc[_0x33c9(0x239)],'stages':_0x4382fc[_0x33c9(0x216)],'id':_0x4382fc['id'],'version_number':_0x4382fc[_0x33c9(0x261)]}))};}return _0x1e0231;}export function normalizeJourneyDef(_0x569009,_0x2895e4){const _0x680f9e=a170_0x53c011,_0xcb655a=normalizeToJourneysFormat(_0x569009),_0x23fce5=_0x2895e4?.[_0x680f9e(0x1ff)]?Object['keys'](_0x2895e4[_0x680f9e(0x1ff)]):undefined,_0x2a0d45=_0x2895e4?.[_0x680f9e(0x264)]?Object['keys'](_0x2895e4[_0x680f9e(0x264)]):undefined;return{'type':'journey','name':_0xcb655a[_0x680f9e(0x273)],..._0xcb655a['description']!==undefined&&{'description':_0xcb655a['description']},..._0xcb655a['goal']&&{'goal':normalizeJourneyCriteria(_0xcb655a[_0x680f9e(0x20c)])},..._0xcb655a['reentry']!==undefined&&{'reentry':_0xcb655a[_0x680f9e(0x28d)]},..._0xcb655a['segments']&&{'segments':normalizeEmbeddedSegments(_0xcb655a[_0x680f9e(0x1ff)],_0x23fce5)},..._0xcb655a[_0x680f9e(0x264)]&&{'activations':normalizeEmbeddedActivations(_0xcb655a[_0x680f9e(0x264)],_0x2a0d45)},..._0xcb655a[_0x680f9e(0x23b)]&&{'journeys':_0xcb655a[_0x680f9e(0x23b)][_0x680f9e(0x242)](_0x35f5ff=>normalizeJourneyEntry(_0x35f5ff,_0xcb655a[_0x680f9e(0x23b)][_0x680f9e(0x228)]===0x1))}};}function normalizeJourneyEntry(_0x137080,_0xb755de){const _0x7224d0=a170_0x53c011;return{...!_0xb755de&&_0x137080[_0x7224d0(0x2a7)]!==undefined&&{'version':_0x137080[_0x7224d0(0x2a7)]},..._0x137080['state']!==undefined&&{'state':_0x137080[_0x7224d0(0x259)]},...!_0xb755de&&_0x137080[_0x7224d0(0x239)]!==undefined&&{'latest':_0x137080[_0x7224d0(0x239)]},..._0x137080[_0x7224d0(0x261)]!==undefined&&{'version_number':_0x137080[_0x7224d0(0x261)]},..._0x137080[_0x7224d0(0x20c)]&&{'goal':normalizeJourneyCriteria(_0x137080['goal'])},..._0x137080[_0x7224d0(0x28d)]!==undefined&&{'reentry':_0x137080[_0x7224d0(0x28d)]},'stages':_0x137080['stages']['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x223b34){const _0x2abfc9=a170_0x53c011;return{'name':_0x223b34[_0x2abfc9(0x273)],..._0x223b34[_0x2abfc9(0x20e)]!==undefined&&{'description':_0x223b34['description']},..._0x223b34[_0x2abfc9(0x25e)]&&{'entry_criteria':normalizeJourneyCriteria(_0x223b34[_0x2abfc9(0x25e)])},..._0x223b34[_0x2abfc9(0x1e4)]&&{'exit_criteria':_0x223b34[_0x2abfc9(0x1e4)][_0x2abfc9(0x242)](normalizeJourneyCriteria)},..._0x223b34[_0x2abfc9(0x22d)]&&{'milestone':normalizeJourneyCriteria(_0x223b34['milestone'])},..._0x223b34['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x223b34[_0x2abfc9(0x280)])}};}function normalizeStepsWithImplicitNext(_0x49de4a){return _0x49de4a['map']((_0x5f18f1,_0x25ecc1)=>{const _0x3e3c50=a170_0x4c74,_0xfda6a5=_0x25ecc1<_0x49de4a[_0x3e3c50(0x228)]-0x1?_0x49de4a[_0x25ecc1+0x1][_0x3e3c50(0x273)]:undefined;return normalizeJourneyStep(_0x5f18f1,_0xfda6a5);});}function normalizeJourneyCriteria(_0x795871){const _0x2946c7=a170_0x53c011;return{'name':_0x795871['name'],..._0x795871[_0x2946c7(0x20e)]!==undefined&&{'description':_0x795871[_0x2946c7(0x20e)]},'segment':_0x795871[_0x2946c7(0x294)],..._0x795871[_0x2946c7(0x275)]&&{'target':normalizeJumpTarget(_0x795871[_0x2946c7(0x275)])}};}function normalizeJourneyStep(_0x535248,_0x4b614c){const _0x5af4b6=a170_0x53c011,_0x202ca5=_0x535248['next']!==undefined&&_0x535248[_0x5af4b6(0x209)]!==_0x4b614c,_0x2de272={'type':_0x535248['type'],'name':_0x535248['name'],..._0x202ca5&&{'next':_0x535248[_0x5af4b6(0x209)]}};if(_0x5af4b6(0x298)in _0x535248&&_0x535248['with'])return{..._0x2de272,'with':normalizeStepParams(_0x535248['type'],_0x535248[_0x5af4b6(0x298)])};return _0x2de272;}function normalizeStepParams(_0x4e9f04,_0x5036d1){const _0xecc02a=a170_0x53c011;switch(_0x4e9f04){case'wait':{const _0x4f4678=_0x5036d1;let _0x1d9e9e;return _0x4f4678[_0xecc02a(0x22e)]&&(_0x1d9e9e={'segment':_0x4f4678[_0xecc02a(0x22e)][_0xecc02a(0x294)],..._0x4f4678[_0xecc02a(0x22e)]['next']!==undefined&&{'next':_0x4f4678['condition']['next']},..._0x4f4678[_0xecc02a(0x22e)][_0xecc02a(0x1fd)]&&{'timeout':{'duration':_0x4f4678[_0xecc02a(0x22e)][_0xecc02a(0x1fd)]['duration'],'unit':_0x4f4678[_0xecc02a(0x22e)]['timeout'][_0xecc02a(0x205)],..._0x4f4678[_0xecc02a(0x22e)][_0xecc02a(0x1fd)][_0xecc02a(0x209)]!==undefined&&{'next':_0x4f4678[_0xecc02a(0x22e)][_0xecc02a(0x1fd)][_0xecc02a(0x209)]}}}}),{..._0x4f4678['duration']!==undefined&&{'duration':_0x4f4678[_0xecc02a(0x21c)]},..._0x4f4678[_0xecc02a(0x205)]!==undefined&&{'unit':_0x4f4678['unit']},..._0x4f4678[_0xecc02a(0x2a5)]!==undefined&&{'wait_until':_0x4f4678[_0xecc02a(0x2a5)]},..._0x4f4678['days_of_week']!==undefined&&{'days_of_week':_0x4f4678[_0xecc02a(0x25d)]},..._0x1d9e9e&&{'condition':_0x1d9e9e}};}case _0xecc02a(0x283):{const _0x285572=_0x5036d1;return{'activation':_0x285572[_0xecc02a(0x283)]};}case _0xecc02a(0x2a8):{const _0x16a706=_0x5036d1;return{'branches':_0x16a706[_0xecc02a(0x295)][_0xecc02a(0x242)](normalizeDecisionBranch)};}case _0xecc02a(0x208):{const _0x6ef3c2=_0x5036d1;return{..._0x6ef3c2[_0xecc02a(0x226)]!==undefined&&{'customized_split':_0x6ef3c2[_0xecc02a(0x226)]},..._0x6ef3c2[_0xecc02a(0x220)]!==undefined&&{'unique_id':_0x6ef3c2['unique_id']},'variants':_0x6ef3c2[_0xecc02a(0x2a1)][_0xecc02a(0x242)](normalizeAbTestVariant)};}case _0xecc02a(0x247):{const _0x49fa9f=_0x5036d1;return{'target':normalizeJumpTarget(_0x49fa9f['target'])};}default:return _0x5036d1;}}function normalizeDecisionBranch(_0x41e370){const _0x42c3bb=a170_0x53c011;return{'name':_0x41e370[_0x42c3bb(0x273)],..._0x41e370[_0x42c3bb(0x294)]!==undefined&&{'segment':_0x41e370[_0x42c3bb(0x294)]},..._0x41e370['excluded']!==undefined&&{'excluded':_0x41e370[_0x42c3bb(0x1e0)]},..._0x41e370[_0x42c3bb(0x209)]!==undefined&&{'next':_0x41e370[_0x42c3bb(0x209)]}};}function normalizeAbTestVariant(_0x267a34){const _0x53e3a8=a170_0x53c011;return{..._0x267a34['id']!==undefined&&{'id':_0x267a34['id']},'name':_0x267a34[_0x53e3a8(0x273)],'percentage':_0x267a34['percentage'],..._0x267a34[_0x53e3a8(0x209)]!==undefined&&{'next':_0x267a34[_0x53e3a8(0x209)]}};}function normalizeJumpTarget(_0x2a42d0){const _0x17fb5e=a170_0x53c011;return{'journey':_0x2a42d0[_0x17fb5e(0x293)],'stage':_0x2a42d0['stage'],..._0x2a42d0[_0x17fb5e(0x254)]!==undefined&&{'bundle_id':_0x2a42d0['bundle_id']}};}function normalizeEmbeddedSegments(_0x34a8ce,_0x567c86){const _0x3ade0d=a170_0x53c011,_0x4fbfb1={},_0x4c7e04=Object[_0x3ade0d(0x20a)](_0x34a8ce),_0x5af3c7=_0x567c86?[..._0x567c86[_0x3ade0d(0x24a)](_0x5bba3c=>_0x4c7e04[_0x3ade0d(0x24d)](_0x5bba3c)),..._0x4c7e04[_0x3ade0d(0x24a)](_0x368e32=>!_0x567c86[_0x3ade0d(0x24d)](_0x368e32))[_0x3ade0d(0x245)]()]:_0x4c7e04[_0x3ade0d(0x245)]();for(const _0x1ad9d4 of _0x5af3c7){const _0x251fdc=_0x34a8ce[_0x1ad9d4];if(_0x251fdc[_0x3ade0d(0x27a)]){const _0x54590a=_0x251fdc[_0x3ade0d(0x27a)];if(_0x54590a[_0x3ade0d(0x26c)]!==_0x3ade0d(0x203)&&_0x54590a['type']!=='Or'&&_0x54590a[_0x3ade0d(0x26c)]!=='Composite'){const _0x31b4f7=_0x54590a[_0x3ade0d(0x26c)]??_0x3ade0d(0x27e);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x3ade0d(0x26d)+_0x1ad9d4+_0x3ade0d(0x268)+(_0x3ade0d(0x257)+_0x31b4f7+'\x27.\x0a')+_0x3ade0d(0x270)+_0x3ade0d(0x252)+_0x3ade0d(0x1f3)+_0x3ade0d(0x224)+_0x3ade0d(0x269)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x3ade0d(0x2a0));}if(!_0x54590a[_0x3ade0d(0x1ee)]||!Array[_0x3ade0d(0x22c)](_0x54590a[_0x3ade0d(0x1ee)]))throw new SDKError(ErrorCode[_0x3ade0d(0x2a2)],_0x3ade0d(0x26d)+_0x1ad9d4+_0x3ade0d(0x268)+_0x3ade0d(0x1fb)+_0x3ade0d(0x270)+_0x3ade0d(0x252)+(_0x3ade0d(0x1e2)+_0x54590a[_0x3ade0d(0x26c)]+'\x0a')+_0x3ade0d(0x224)+_0x3ade0d(0x269)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x3ade0d(0x2a0));}_0x4fbfb1[_0x1ad9d4]={..._0x251fdc[_0x3ade0d(0x20e)]&&_0x251fdc[_0x3ade0d(0x20e)][_0x3ade0d(0x1e8)]()&&{'description':_0x251fdc['description']},..._0x251fdc[_0x3ade0d(0x27a)]&&{'rule':deepSortObject(_0x251fdc[_0x3ade0d(0x27a)])}};}return _0x4fbfb1;}function normalizeEmbeddedActivations(_0x569550,_0x138b13){const _0x14c0a3=a170_0x53c011,_0x5e9fd2={},_0x25294f=Object['keys'](_0x569550),_0x167c48=_0x138b13?[..._0x138b13['filter'](_0x103790=>_0x25294f['includes'](_0x103790)),..._0x25294f[_0x14c0a3(0x24a)](_0x5506c0=>!_0x138b13[_0x14c0a3(0x24d)](_0x5506c0))[_0x14c0a3(0x245)]()]:_0x25294f[_0x14c0a3(0x245)]();for(const _0x309d92 of _0x167c48){const _0x5c2e9a=_0x569550[_0x309d92];_0x5e9fd2[_0x309d92]={'name':_0x5c2e9a['name'],'connection':_0x5c2e9a[_0x14c0a3(0x274)],..._0x5c2e9a[_0x14c0a3(0x20e)]!==undefined&&{'description':_0x5c2e9a['description']},..._0x5c2e9a[_0x14c0a3(0x282)]!==undefined&&{'all_columns':_0x5c2e9a['all_columns']},..._0x5c2e9a[_0x14c0a3(0x232)]!==undefined&&{'columns':_0x5c2e9a[_0x14c0a3(0x232)]},..._0x5c2e9a[_0x14c0a3(0x24e)]!==undefined&&{'behavior':_0x5c2e9a[_0x14c0a3(0x24e)]},..._0x5c2e9a[_0x14c0a3(0x246)]!==undefined&&{'schedule':_0x5c2e9a[_0x14c0a3(0x246)]},..._0x5c2e9a[_0x14c0a3(0x2a3)]!==undefined&&{'notification':_0x5c2e9a[_0x14c0a3(0x2a3)]},..._0x5c2e9a[_0x14c0a3(0x231)]!==undefined&&{'connector_config':_0x5c2e9a[_0x14c0a3(0x231)]},..._0x5c2e9a[_0x14c0a3(0x265)]!==undefined&&{'activation_template_id':_0x5c2e9a[_0x14c0a3(0x265)]}};}return _0x5e9fd2;}export function getActiveStages(_0x7bc586){const _0x3633c0=a170_0x53c011;if(isJourneysArrayMode(_0x7bc586)){const _0xe3a59f=_0x7bc586[_0x3633c0(0x23b)]||[],_0x11c5d9=_0xe3a59f[_0x3633c0(0x1f0)](_0x206a19=>_0x206a19[_0x3633c0(0x239)]===!![])||_0xe3a59f[0x0];return _0x11c5d9?.['stages']||[];}if(isSingleVersionMode(_0x7bc586))return _0x7bc586[_0x3633c0(0x216)]||[];if(isMultiVersionMode(_0x7bc586)){const _0x3a0dcb=_0x7bc586[_0x3633c0(0x201)]||[],_0x2a207e=_0x3a0dcb[_0x3633c0(0x1f0)](_0x3ae125=>_0x3ae125[_0x3633c0(0x239)]===!![])||_0x3a0dcb[0x0];return _0x2a207e?.['stages']||[];}return[];}function a170_0xd575(){const _0x2a7501=['reentry_always','size','duration','slice','AbTest','conditionTimeoutUnit','unique_id','no_reentry','journeyName','Date','\x20\x20\x20\x20conditions:\x0a','randomUUID','customized_split','root_step','length','2305000lRWvVP','day','your-activation-name','isArray','milestone','condition','daysOfWeek','startsWith','connector_config','columns','conditionTimeoutDuration','resolveJumpTarget','merge','resolveActivationName','resolveJourneyId','embedded','latest','end','journeys','resolveActivation','DaysOfTheWeek','Activation','relationships','weeks','20231Inmimu','map','entryCriteria','attributes','sort','schedule','jump','get','match','filter','test','has','includes','behavior','Condition','null','DecisionPoint','\x20\x20rule:\x0a','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','bundle_id','set','13227346uhdygF','rule.type\x20must\x20be\x20\x27And\x27,\x20\x27Or\x27,\x20or\x20\x27Composite\x27,\x20got\x20\x27','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','state','stringify','allowReentry','uniqueId','days_of_week','entry_criteria','days','wait','version_number','Duration','169704KLOYUm','activations','activation_template_id','object','conditionSegmentId','\x27:\x20','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','excludedPath','stage','type','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','Jump','data','Expected\x20format:\x0a','rootStep','resolveEmbeddedSegmentId','name','connection','target','journeyBundleName','34jpKeTF','Journey\x20description','resolveSegmentId','rule','endsWith','WaitStep','60328IPQBRW','(missing)','exitCriteria','steps','from','all_columns','activation','add','waitStepUnit','Send\x20Notification','resolveEmbeddedActivationId','Goal\x20Achieved','1904031UPwcFe','timedOutPath','journeyBundleId','ref:','reentry','percentage','Stage\x201','definition','stages:','replace','journey','segment','branches','folder','Wait\x201\x20Day','with','reentry:','Entry\x20Criteria','exitCriterias','isJourneyLocal','ABTest','*Max\x20wait\x20','ref','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','variants','JOURNEY_SYNTAX_ERROR','notification','all','wait_until','uuid','version','decision_point','excluded','folder_id','\x20\x20\x20\x20type:\x20','shift','exit_criteria','629020tswCFZ','.journey.yml','resolveSegmentName','trim','push','parentFolder','waitUntilDate','values','moveAfter','conditions','End','find','Stage\x20Complete','waitStepType','\x20\x20\x20\x20type:\x20And\x0a','versions:','stageId','resolveStageId','resolveActivationId','toLowerCase','4FUCdCc','draft','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','journeyStageId','timeout','versionNumber','segments','journeyId','versions','reentryMode','And','segments:','unit','journeyStages','27IbXvDK','ab_test','next','keys','waitCondition','goal','Unknown\x20segment\x20\x22','description','bundle_name','resolveSegment','126pdwZAv','launched','stageName','goal-segment','Merge','stages','customizedSplit','.journey.yaml','segmentId'];a170_0xd575=function(){return _0x2a7501;};return a170_0xd575();}export function getLatestJourneyEntry(_0x32b977){const _0x45cd74=a170_0x53c011;if(isJourneysArrayMode(_0x32b977)){const _0x4f40e3=_0x32b977['journeys']||[];return _0x4f40e3[_0x45cd74(0x1f0)](_0x175c48=>_0x175c48['latest']===!![])||_0x4f40e3[0x0];}if(isMultiVersionMode(_0x32b977)){const _0x905e09=_0x32b977[_0x45cd74(0x201)]||[],_0x5b1293=_0x905e09['find'](_0x3fd70b=>_0x3fd70b['latest']===!![])||_0x905e09[0x0];if(_0x5b1293)return{'version':_0x5b1293[_0x45cd74(0x273)],'state':_0x5b1293[_0x45cd74(0x259)],'latest':_0x5b1293[_0x45cd74(0x239)],'stages':_0x5b1293[_0x45cd74(0x216)],'id':_0x5b1293['id'],'version_number':_0x5b1293[_0x45cd74(0x261)]};}if(isSingleVersionMode(_0x32b977))return{'version':_0x32b977[_0x45cd74(0x2a7)]||'v1','state':'draft','stages':_0x32b977['stages']||[],'id':_0x32b977['id'],'version_number':_0x32b977['version_number'],'goal':_0x32b977[_0x45cd74(0x20c)],'reentry':_0x32b977[_0x45cd74(0x28d)]};return undefined;}export function getLatestVersion(_0x31238c){const _0x4e1b95=a170_0x53c011;if(!isMultiVersionMode(_0x31238c))return undefined;const _0x559c3e=_0x31238c[_0x4e1b95(0x201)]||[];return _0x559c3e[_0x4e1b95(0x1f0)](_0x3a1c6a=>_0x3a1c6a[_0x4e1b95(0x239)]===!![])||_0x559c3e[0x0];}export function getEffectiveGoal(_0x257368){const _0x13775a=a170_0x53c011,_0x11fccc=getLatestJourneyEntry(_0x257368);return _0x11fccc?.[_0x13775a(0x20c)]||_0x257368[_0x13775a(0x20c)];}export function getEffectiveReentry(_0x12a2e4){const _0x231936=a170_0x53c011,_0x12a660=getLatestJourneyEntry(_0x12a2e4);return _0x12a660?.[_0x231936(0x28d)]||_0x12a2e4[_0x231936(0x28d)];}export function collectSegmentRefs(_0x13f454){const _0x37565b=a170_0x53c011,_0xa4885c=new Set();_0x13f454[_0x37565b(0x20c)]?.[_0x37565b(0x294)]&&_0xa4885c[_0x37565b(0x284)](_0x13f454['goal']['segment']);const _0x34b1ac=_0x21f9cb=>{const _0x32499e=_0x37565b;for(const _0x4c5fae of _0x21f9cb){_0x4c5fae[_0x32499e(0x25e)]?.[_0x32499e(0x294)]&&_0xa4885c[_0x32499e(0x284)](_0x4c5fae[_0x32499e(0x25e)]['segment']);if(_0x4c5fae['exit_criteria'])for(const _0x5a9c93 of _0x4c5fae['exit_criteria']){_0x5a9c93[_0x32499e(0x294)]&&_0xa4885c[_0x32499e(0x284)](_0x5a9c93[_0x32499e(0x294)]);}_0x4c5fae[_0x32499e(0x22d)]?.[_0x32499e(0x294)]&&_0xa4885c[_0x32499e(0x284)](_0x4c5fae[_0x32499e(0x22d)][_0x32499e(0x294)]);if(_0x4c5fae[_0x32499e(0x280)])for(const _0x45a29d of _0x4c5fae[_0x32499e(0x280)]){if(_0x45a29d['type']===_0x32499e(0x2a8)){const _0x3a25c8=_0x45a29d;for(const _0x50e45a of _0x3a25c8[_0x32499e(0x298)]['branches']){_0x50e45a['segment']&&_0xa4885c[_0x32499e(0x284)](_0x50e45a[_0x32499e(0x294)]);}}else{if(_0x45a29d[_0x32499e(0x26c)]===_0x32499e(0x260)){const _0x33cd32=_0x45a29d;_0x33cd32[_0x32499e(0x298)]['condition']?.['segment']&&_0xa4885c[_0x32499e(0x284)](_0x33cd32[_0x32499e(0x298)][_0x32499e(0x22e)][_0x32499e(0x294)]);}}}}};_0x13f454[_0x37565b(0x216)]&&_0x34b1ac(_0x13f454['stages']);if(_0x13f454[_0x37565b(0x201)])for(const _0xc45f6f of _0x13f454[_0x37565b(0x201)]){_0x34b1ac(_0xc45f6f[_0x37565b(0x216)]);}return _0xa4885c;}export function validateSegmentRefs(_0x459761){const _0x29976f=a170_0x53c011,_0x55eedb=[],_0x2852e2=collectSegmentRefs(_0x459761),_0x26cd24=new Set(Object['keys'](_0x459761[_0x29976f(0x1ff)]||{}));for(const _0x1ff3d2 of _0x2852e2){const _0x3fd87c=parseSegmentRef(_0x1ff3d2);_0x3fd87c[_0x29976f(0x26c)]===_0x29976f(0x238)&&!_0x26cd24[_0x29976f(0x24c)](_0x3fd87c[_0x29976f(0x273)])&&_0x55eedb['push'](_0x29976f(0x20d)+_0x3fd87c[_0x29976f(0x273)]+_0x29976f(0x253)+_0x3fd87c['name']+_0x29976f(0x258));}return _0x55eedb;}export function collectSegmentIdsFromJourneyApi(_0x8be89b){const _0x4a0d45=a170_0x53c011,_0x5dcce5=new Set();_0x8be89b[_0x4a0d45(0x244)][_0x4a0d45(0x20c)]?.[_0x4a0d45(0x219)]&&_0x5dcce5[_0x4a0d45(0x284)](_0x8be89b[_0x4a0d45(0x244)][_0x4a0d45(0x20c)][_0x4a0d45(0x219)]);const _0x28338a=_0x8be89b[_0x4a0d45(0x244)][_0x4a0d45(0x206)];if(Array['isArray'](_0x28338a))for(const _0x1f739c of _0x28338a){_0x1f739c['entryCriteria']?.[_0x4a0d45(0x219)]&&_0x5dcce5[_0x4a0d45(0x284)](_0x1f739c[_0x4a0d45(0x243)][_0x4a0d45(0x219)]);const _0x4b7dfe=_0x1f739c['exitCriterias']??_0x1f739c[_0x4a0d45(0x27f)];if(Array[_0x4a0d45(0x22c)](_0x4b7dfe))for(const _0x5be693 of _0x4b7dfe){_0x5be693[_0x4a0d45(0x219)]&&_0x5dcce5[_0x4a0d45(0x284)](_0x5be693[_0x4a0d45(0x219)]);}_0x1f739c[_0x4a0d45(0x22d)]?.[_0x4a0d45(0x219)]&&_0x5dcce5[_0x4a0d45(0x284)](_0x1f739c['milestone'][_0x4a0d45(0x219)]);if(_0x1f739c[_0x4a0d45(0x280)]&&typeof _0x1f739c[_0x4a0d45(0x280)]===_0x4a0d45(0x266)){const _0x56b675=Array[_0x4a0d45(0x22c)](_0x1f739c[_0x4a0d45(0x280)])?_0x1f739c[_0x4a0d45(0x280)]:Object[_0x4a0d45(0x1ec)](_0x1f739c[_0x4a0d45(0x280)]);for(const _0x4b1130 of _0x56b675){_0x4b1130[_0x4a0d45(0x20b)]?.[_0x4a0d45(0x219)]&&_0x5dcce5[_0x4a0d45(0x284)](_0x4b1130[_0x4a0d45(0x20b)][_0x4a0d45(0x219)]);const _0x474636=_0x4b1130;_0x474636[_0x4a0d45(0x267)]&&_0x5dcce5['add'](_0x474636[_0x4a0d45(0x267)]);if(Array[_0x4a0d45(0x22c)](_0x474636[_0x4a0d45(0x1ee)]))for(const _0x546282 of _0x474636[_0x4a0d45(0x1ee)]){_0x546282[_0x4a0d45(0x219)]&&_0x5dcce5[_0x4a0d45(0x284)](_0x546282['segmentId']);}if(Array[_0x4a0d45(0x22c)](_0x4b1130[_0x4a0d45(0x295)]))for(const _0x474d1c of _0x4b1130[_0x4a0d45(0x295)]){_0x474d1c[_0x4a0d45(0x219)]&&_0x5dcce5['add'](_0x474d1c[_0x4a0d45(0x219)]);}}}}return _0x5dcce5;}
@@ -1 +1 @@
1
- const a171_0x8ec79=a171_0x1e3f;(function(_0x25fbf3,_0x36a8cc){const _0x3f58c6=a171_0x1e3f,_0x58d298=_0x25fbf3();while(!![]){try{const _0x45af70=-parseInt(_0x3f58c6(0x161))/0x1*(-parseInt(_0x3f58c6(0x138))/0x2)+parseInt(_0x3f58c6(0x159))/0x3+-parseInt(_0x3f58c6(0x132))/0x4+parseInt(_0x3f58c6(0x130))/0x5*(-parseInt(_0x3f58c6(0x126))/0x6)+parseInt(_0x3f58c6(0x12c))/0x7+-parseInt(_0x3f58c6(0x163))/0x8*(-parseInt(_0x3f58c6(0x162))/0x9)+-parseInt(_0x3f58c6(0x13b))/0xa*(parseInt(_0x3f58c6(0x152))/0xb);if(_0x45af70===_0x36a8cc)break;else _0x58d298['push'](_0x58d298['shift']());}catch(_0x1a5ede){_0x58d298['push'](_0x58d298['shift']());}}}(a171_0x1f3a,0xbab4d));function a171_0x1f3a(){const _0x564b43=['\x20a\x0a\x20\x20ON\x20m.','2mZLYIq','\x0aSELECT\x20m.','\x0a\x20\x20ON\x20m.','810mhJqeJ','join','\x20=\x20a.','\x0aFROM\x20','\x0aLIMIT\x20','\x20LIMIT\x20','find','parent_key','SELECT\x20*\x20FROM\x20','toLowerCase','replace','\x20b\x0a\x20\x20ON\x20m.','\x0aLIMIT\x200\x0a','name','LEFT\x20JOIN\x20','columns','\x27)\x0a','\x20FROM\x20','map','table','-1d','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x20LIMIT\x200','190751GFFXKm','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','attributes','source','(all\x20columns)','\x0aWHERE\x20a.','\x20AS\x20','906324UOomWd','forEach','push','\x20m\x0a','\x20=\x20b.','label','\x27)\x0aLIMIT\x20','column','1256777BTljsV','9xmORxY','7208888ndifWa','SELECT\x20','\x20m\x0aJOIN\x20','master','33006AODDnD','\x20IS\x20NOT\x20NULL\x0a','behaviors','child_key','test','trim','8440985asXuTo','\x0aSELECT\x20','m.*','all_columns','80EHnFjd','\x20m\x0aLEFT\x20JOIN\x20','5633860mtqYwu','database','\x20=\x20','length','b.*'];a171_0x1f3a=function(){return _0x564b43;};return a171_0x1f3a();}export const DEFAULT_TIME_RANGE=a171_0x8ec79(0x14f);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x350726,_0x1e42f0,_0x437804){const _0x44a930=a171_0x8ec79,_0x2108c3=_0x437804&&_0x437804[_0x44a930(0x135)]>0x0?_0x437804[_0x44a930(0x13c)](',\x20'):'*';return _0x44a930(0x164)+_0x2108c3+_0x44a930(0x14c)+_0x350726+'.'+_0x1e42f0+_0x44a930(0x151);}export function generateMasterCountSQL(_0x4bd00a){const _0x316784=a171_0x8ec79,{database:_0x1d1877,table:_0x20adc0}=_0x4bd00a[_0x316784(0x125)];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0x1d1877+'.'+_0x20adc0;}export function generateMasterSampleSQL(_0x1aef27,_0x585bee=0x5){const _0x2cfd50=a171_0x8ec79,{database:_0x271aef,table:_0x2b7e8f}=_0x1aef27[_0x2cfd50(0x125)];return _0x2cfd50(0x143)+_0x271aef+'.'+_0x2b7e8f+_0x2cfd50(0x140)+_0x585bee;}export function generateAttributeCoverageSQL(_0x39c5bc,_0x52c811){const _0x4cb8d8=a171_0x8ec79,_0x5a775f=_0x39c5bc[_0x4cb8d8(0x125)];return(_0x4cb8d8(0x150)+_0x5a775f[_0x4cb8d8(0x133)]+'.'+_0x5a775f['table']+_0x4cb8d8(0x131)+_0x52c811['source']['database']+'.'+_0x52c811[_0x4cb8d8(0x155)]['table']+'\x20a\x0a\x20\x20ON\x20m.'+_0x52c811[_0x4cb8d8(0x13c)]['parent_key']+_0x4cb8d8(0x13d)+_0x52c811[_0x4cb8d8(0x13c)][_0x4cb8d8(0x129)]+_0x4cb8d8(0x157)+_0x52c811[_0x4cb8d8(0x13c)][_0x4cb8d8(0x129)]+_0x4cb8d8(0x127))['trim']();}function a171_0x1e3f(_0x47bc7a,_0x5adc7c){_0x47bc7a=_0x47bc7a-0x125;const _0x1f3a57=a171_0x1f3a();let _0x1e3f5e=_0x1f3a57[_0x47bc7a];return _0x1e3f5e;}export function generateBehaviorStatsSQL(_0x3de60b,_0x1d31d3,_0x4df7f5=DEFAULT_TIME_RANGE){const _0x2b9919=a171_0x8ec79,_0x3f55e0=_0x3de60b[_0x2b9919(0x125)];return('\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.'+_0x1d31d3[_0x2b9919(0x13c)][_0x2b9919(0x142)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x3f55e0[_0x2b9919(0x133)]+'.'+_0x3f55e0[_0x2b9919(0x14e)]+_0x2b9919(0x165)+_0x1d31d3[_0x2b9919(0x155)][_0x2b9919(0x133)]+'.'+_0x1d31d3['source']['table']+_0x2b9919(0x146)+_0x1d31d3['join'][_0x2b9919(0x142)]+_0x2b9919(0x15d)+_0x1d31d3[_0x2b9919(0x13c)]['child_key']+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x4df7f5+_0x2b9919(0x14b))['trim']();}export function generateAttributeSampleSQL(_0x2d5409,_0x296cb0,_0x33e217=0x5){const _0x4eb687=a171_0x8ec79,_0x41823e=_0x2d5409[_0x4eb687(0x125)],_0x1f0b95=_0x296cb0[_0x4eb687(0x13c)][_0x4eb687(0x142)],_0x177d76=_0x296cb0['columns'][_0x4eb687(0x14d)](_0x15c31f=>'a.'+_0x15c31f[_0x4eb687(0x160)])[_0x4eb687(0x13c)](',\x20');return(_0x4eb687(0x139)+_0x1f0b95+',\x20'+_0x177d76+_0x4eb687(0x13e)+_0x41823e[_0x4eb687(0x133)]+'.'+_0x41823e[_0x4eb687(0x14e)]+_0x4eb687(0x165)+_0x296cb0[_0x4eb687(0x155)]['database']+'.'+_0x296cb0['source'][_0x4eb687(0x14e)]+_0x4eb687(0x137)+_0x296cb0[_0x4eb687(0x13c)]['parent_key']+_0x4eb687(0x13d)+_0x296cb0['join'][_0x4eb687(0x129)]+_0x4eb687(0x13f)+_0x33e217+'\x0a')[_0x4eb687(0x12b)]();}export function generateBehaviorSampleSQL(_0x419ec1,_0x573be4,_0x832aaf=0x5,_0x4d3cce=DEFAULT_TIME_RANGE){const _0x3a66d8=a171_0x8ec79,_0x2df711=_0x419ec1[_0x3a66d8(0x125)],_0x21ae5f=_0x573be4[_0x3a66d8(0x13c)][_0x3a66d8(0x142)];let _0x218158;if(_0x573be4[_0x3a66d8(0x12f)])_0x218158=_0x3a66d8(0x136);else _0x573be4[_0x3a66d8(0x14a)]&&_0x573be4[_0x3a66d8(0x14a)][_0x3a66d8(0x135)]>0x0?_0x218158=_0x573be4[_0x3a66d8(0x14a)][_0x3a66d8(0x14d)](_0x396609=>'b.'+_0x396609['column'])[_0x3a66d8(0x13c)](',\x20'):_0x218158='b.*';return(_0x3a66d8(0x139)+_0x21ae5f+',\x20'+_0x218158+_0x3a66d8(0x13e)+_0x2df711[_0x3a66d8(0x133)]+'.'+_0x2df711[_0x3a66d8(0x14e)]+_0x3a66d8(0x165)+_0x573be4['source'][_0x3a66d8(0x133)]+'.'+_0x573be4['source'][_0x3a66d8(0x14e)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x573be4[_0x3a66d8(0x13c)][_0x3a66d8(0x142)]+'\x20=\x20b.'+_0x573be4[_0x3a66d8(0x13c)][_0x3a66d8(0x129)]+_0x3a66d8(0x153)+_0x4d3cce+_0x3a66d8(0x15f)+_0x832aaf+'\x0a')['trim']();}function quoteIdentifier(_0x23b903){const _0x2deec3=a171_0x8ec79;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x2deec3(0x12a)](_0x23b903))return'\x22'+_0x23b903[_0x2deec3(0x145)](/"/g,'\x22\x22')+'\x22';return _0x23b903;}export function generateEnrichedSQL(_0x54e255,_0x2ad42c=0x5){const _0x138bab=a171_0x8ec79,_0x4608e7=_0x54e255[_0x138bab(0x125)],_0x372cd4=_0x54e255[_0x138bab(0x154)]||[];if(_0x372cd4['length']===0x0)return _0x138bab(0x143)+_0x4608e7[_0x138bab(0x133)]+'.'+_0x4608e7['table']+_0x138bab(0x140)+_0x2ad42c;const _0x232f74=[_0x138bab(0x12e)],_0x19a833=[];return _0x372cd4[_0x138bab(0x15a)]((_0x2327fa,_0x23f69e)=>{const _0x3481ca=_0x138bab,_0x17d13f='a'+_0x23f69e;_0x2327fa[_0x3481ca(0x14a)][_0x3481ca(0x15a)](_0x240f97=>{const _0x22fcd1=_0x3481ca,_0x101d07=quoteIdentifier(_0x240f97['label']||_0x240f97[_0x22fcd1(0x160)]);_0x232f74[_0x22fcd1(0x15b)](_0x17d13f+'.'+_0x240f97['column']+_0x22fcd1(0x158)+_0x101d07);}),_0x19a833[_0x3481ca(0x15b)](_0x3481ca(0x149)+_0x2327fa[_0x3481ca(0x155)][_0x3481ca(0x133)]+'.'+_0x2327fa[_0x3481ca(0x155)][_0x3481ca(0x14e)]+'\x20'+_0x17d13f+_0x3481ca(0x13a)+_0x2327fa[_0x3481ca(0x13c)][_0x3481ca(0x142)]+_0x3481ca(0x134)+_0x17d13f+'.'+_0x2327fa[_0x3481ca(0x13c)][_0x3481ca(0x129)]);}),(_0x138bab(0x12d)+_0x232f74[_0x138bab(0x13c)](',\x20')+_0x138bab(0x13e)+_0x4608e7[_0x138bab(0x133)]+'.'+_0x4608e7[_0x138bab(0x14e)]+_0x138bab(0x15c)+_0x19a833[_0x138bab(0x13c)]('\x0a')+'\x0aLIMIT\x20'+_0x2ad42c+'\x0a')[_0x138bab(0x12b)]();}export function generateAttributeSchemaSQL(_0x28904e,_0xa40b75){const _0xba41d6=a171_0x8ec79,_0x457c3a=_0x28904e[_0xba41d6(0x125)],_0xaaa0ff=_0xa40b75[_0xba41d6(0x13c)][_0xba41d6(0x142)],_0x17be22=_0xa40b75[_0xba41d6(0x14a)][_0xba41d6(0x14d)](_0x9e87f0=>'a.'+_0x9e87f0['column'])['join'](',\x20');return('\x0aSELECT\x20m.'+_0xaaa0ff+',\x20'+_0x17be22+_0xba41d6(0x13e)+_0x457c3a[_0xba41d6(0x133)]+'.'+_0x457c3a['table']+_0xba41d6(0x165)+_0xa40b75[_0xba41d6(0x155)][_0xba41d6(0x133)]+'.'+_0xa40b75[_0xba41d6(0x155)][_0xba41d6(0x14e)]+'\x20a\x0a\x20\x20ON\x20m.'+_0xa40b75[_0xba41d6(0x13c)][_0xba41d6(0x142)]+_0xba41d6(0x13d)+_0xa40b75[_0xba41d6(0x13c)][_0xba41d6(0x129)]+_0xba41d6(0x147))[_0xba41d6(0x12b)]();}export function generateBehaviorSchemaSQL(_0x214054,_0x4c1dd7){const _0x38d3db=a171_0x8ec79,_0xe8a5ba=_0x214054[_0x38d3db(0x125)],_0x5ce273=_0x4c1dd7['join'][_0x38d3db(0x142)];let _0x482bf8;if(_0x4c1dd7[_0x38d3db(0x12f)])_0x482bf8=_0x38d3db(0x136);else _0x4c1dd7[_0x38d3db(0x14a)]&&_0x4c1dd7['columns'][_0x38d3db(0x135)]>0x0?_0x482bf8=_0x4c1dd7[_0x38d3db(0x14a)][_0x38d3db(0x14d)](_0x2854fd=>'b.'+_0x2854fd[_0x38d3db(0x160)])[_0x38d3db(0x13c)](',\x20'):_0x482bf8=_0x38d3db(0x136);return(_0x38d3db(0x139)+_0x5ce273+',\x20'+_0x482bf8+_0x38d3db(0x13e)+_0xe8a5ba[_0x38d3db(0x133)]+'.'+_0xe8a5ba[_0x38d3db(0x14e)]+_0x38d3db(0x165)+_0x4c1dd7[_0x38d3db(0x155)]['database']+'.'+_0x4c1dd7[_0x38d3db(0x155)][_0x38d3db(0x14e)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x4c1dd7['join'][_0x38d3db(0x142)]+_0x38d3db(0x15d)+_0x4c1dd7[_0x38d3db(0x13c)][_0x38d3db(0x129)]+'\x0aLIMIT\x200\x0a')[_0x38d3db(0x12b)]();}export function getAttributeColumns(_0xa9dbec){const _0x59c61c=a171_0x8ec79;return _0xa9dbec['columns'][_0x59c61c(0x14d)](_0x42aa3d=>({'label':_0x42aa3d[_0x59c61c(0x15e)]||_0x42aa3d['column'],'column':_0x42aa3d[_0x59c61c(0x160)]}));}export function getBehaviorColumns(_0x45f7f1){const _0x5de311=a171_0x8ec79;if(_0x45f7f1[_0x5de311(0x12f)])return[{'label':'(all\x20columns)','column':'*'}];if(_0x45f7f1[_0x5de311(0x14a)]&&_0x45f7f1[_0x5de311(0x14a)]['length']>0x0)return _0x45f7f1['columns'][_0x5de311(0x14d)](_0x4319c1=>({'label':_0x4319c1[_0x5de311(0x15e)]||_0x4319c1[_0x5de311(0x160)],'column':_0x4319c1[_0x5de311(0x160)]}));return[{'label':_0x5de311(0x156),'column':'*'}];}export function findAttributeByName(_0x3c25a6,_0x130e4d){const _0x24112b=a171_0x8ec79;return _0x3c25a6[_0x24112b(0x154)]?.[_0x24112b(0x141)](_0x526877=>_0x526877[_0x24112b(0x148)][_0x24112b(0x144)]()===_0x130e4d[_0x24112b(0x144)]());}export function findBehaviorByName(_0x3a7d50,_0x5f3b6d){const _0x3767b0=a171_0x8ec79;return _0x3a7d50[_0x3767b0(0x128)]?.[_0x3767b0(0x141)](_0x287d09=>_0x287d09[_0x3767b0(0x148)][_0x3767b0(0x144)]()===_0x5f3b6d[_0x3767b0(0x144)]());}
1
+ (function(_0x3cbb37,_0x2f1139){const _0x5be5b3=a171_0x3c67,_0x1bdba5=_0x3cbb37();while(!![]){try{const _0x327c1c=parseInt(_0x5be5b3(0x1a7))/0x1*(parseInt(_0x5be5b3(0x1c6))/0x2)+-parseInt(_0x5be5b3(0x1c9))/0x3+parseInt(_0x5be5b3(0x1bf))/0x4*(-parseInt(_0x5be5b3(0x1b7))/0x5)+parseInt(_0x5be5b3(0x1bb))/0x6+-parseInt(_0x5be5b3(0x1cb))/0x7*(parseInt(_0x5be5b3(0x1a9))/0x8)+parseInt(_0x5be5b3(0x1cf))/0x9+-parseInt(_0x5be5b3(0x1ca))/0xa;if(_0x327c1c===_0x2f1139)break;else _0x1bdba5['push'](_0x1bdba5['shift']());}catch(_0x34d8ce){_0x1bdba5['push'](_0x1bdba5['shift']());}}}(a171_0x3cd9,0x78521));export const DEFAULT_TIME_RANGE='-1d';export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x1715e4,_0x4c0e95,_0x26e3d9){const _0x455938=a171_0x3c67,_0x498530=_0x26e3d9&&_0x26e3d9['length']>0x0?_0x26e3d9[_0x455938(0x1c8)](',\x20'):'*';return _0x455938(0x1c2)+_0x498530+_0x455938(0x1d0)+_0x1715e4+'.'+_0x4c0e95+'\x20LIMIT\x200';}export function generateMasterCountSQL(_0x4b996c){const _0x27a02a=a171_0x3c67,{database:_0x4d0411,table:_0x468d75}=_0x4b996c[_0x27a02a(0x19b)];return _0x27a02a(0x19f)+_0x4d0411+'.'+_0x468d75;}export function generateMasterSampleSQL(_0x2185fa,_0x1a12a6=0x5){const _0x1b65b2=a171_0x3c67,{database:_0x4f178b,table:_0x2b2bf0}=_0x2185fa[_0x1b65b2(0x19b)];return _0x1b65b2(0x1ba)+_0x4f178b+'.'+_0x2b2bf0+'\x20LIMIT\x20'+_0x1a12a6;}export function generateAttributeCoverageSQL(_0x4160bc,_0x5add8b){const _0x26ab5a=a171_0x3c67,_0x9cfa50=_0x4160bc[_0x26ab5a(0x19b)];return(_0x26ab5a(0x1ab)+_0x9cfa50['database']+'.'+_0x9cfa50[_0x26ab5a(0x19e)]+_0x26ab5a(0x1d3)+_0x5add8b[_0x26ab5a(0x1a4)][_0x26ab5a(0x1bc)]+'.'+_0x5add8b[_0x26ab5a(0x1a4)][_0x26ab5a(0x19e)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x5add8b[_0x26ab5a(0x1c8)][_0x26ab5a(0x19c)]+_0x26ab5a(0x1aa)+_0x5add8b[_0x26ab5a(0x1c8)][_0x26ab5a(0x1c1)]+_0x26ab5a(0x1a2)+_0x5add8b['join']['child_key']+_0x26ab5a(0x1cd))[_0x26ab5a(0x1d1)]();}export function generateBehaviorStatsSQL(_0x11691d,_0x2a4950,_0x2165ed=DEFAULT_TIME_RANGE){const _0x318b77=a171_0x3c67,_0x5050b1=_0x11691d['master'];return('\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.'+_0x2a4950[_0x318b77(0x1c8)][_0x318b77(0x19c)]+_0x318b77(0x1a5)+_0x5050b1[_0x318b77(0x1bc)]+'.'+_0x5050b1[_0x318b77(0x19e)]+_0x318b77(0x1cc)+_0x2a4950[_0x318b77(0x1a4)][_0x318b77(0x1bc)]+'.'+_0x2a4950['source'][_0x318b77(0x19e)]+_0x318b77(0x1c4)+_0x2a4950[_0x318b77(0x1c8)][_0x318b77(0x19c)]+_0x318b77(0x1af)+_0x2a4950[_0x318b77(0x1c8)]['child_key']+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x2165ed+'\x27)\x0a')[_0x318b77(0x1d1)]();}export function generateAttributeSampleSQL(_0x5ce1b9,_0x56384f,_0x55d3dd=0x5){const _0x2dd4fb=a171_0x3c67,_0x18421e=_0x5ce1b9[_0x2dd4fb(0x19b)],_0x47a488=_0x56384f[_0x2dd4fb(0x1c8)][_0x2dd4fb(0x19c)],_0x4a27b9=_0x56384f[_0x2dd4fb(0x1be)][_0x2dd4fb(0x1b4)](_0x2dc823=>'a.'+_0x2dc823['column'])[_0x2dd4fb(0x1c8)](',\x20');return('\x0aSELECT\x20m.'+_0x47a488+',\x20'+_0x4a27b9+_0x2dd4fb(0x1b1)+_0x18421e[_0x2dd4fb(0x1bc)]+'.'+_0x18421e['table']+_0x2dd4fb(0x1cc)+_0x56384f[_0x2dd4fb(0x1a4)]['database']+'.'+_0x56384f[_0x2dd4fb(0x1a4)][_0x2dd4fb(0x19e)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x56384f['join'][_0x2dd4fb(0x19c)]+_0x2dd4fb(0x1aa)+_0x56384f['join']['child_key']+'\x0aLIMIT\x20'+_0x55d3dd+'\x0a')['trim']();}function a171_0x3cd9(){const _0x26e68f=['\x0aFROM\x20','label','\x0a\x20\x20ON\x20m.','map','all_columns','toLowerCase','178175dGoAEI','(all\x20columns)','length','SELECT\x20*\x20FROM\x20','5794836YOnewq','database','column','columns','100gdGPIe','\x20a\x0a\x20\x20ON\x20m.','child_key','SELECT\x20','forEach','\x20b\x0a\x20\x20ON\x20m.','name','2hcmJGx','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','join','410268vHEDOa','4291410lhZrJw','2705486SSFcqC','\x20m\x0aJOIN\x20','\x20IS\x20NOT\x20NULL\x0a','\x0aSELECT\x20m.','8330886aBmglR','\x20FROM\x20','trim','b.*','\x20m\x0aLEFT\x20JOIN\x20','LEFT\x20JOIN\x20','master','parent_key','test','table','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','m.*','\x20LIMIT\x20','\x0aWHERE\x20a.','behaviors','source',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','\x0aLIMIT\x200\x0a','444643ZBslAw','\x20m\x0a','8OUXhHR','\x20=\x20a.','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','attributes','\x0aLIMIT\x20','find','\x20=\x20b.','\x20AS\x20'];a171_0x3cd9=function(){return _0x26e68f;};return a171_0x3cd9();}export function generateBehaviorSampleSQL(_0x25fb7d,_0xdc6a00,_0x4064af=0x5,_0x402739=DEFAULT_TIME_RANGE){const _0x4ad5bd=a171_0x3c67,_0x397531=_0x25fb7d['master'],_0xe2ed64=_0xdc6a00['join'][_0x4ad5bd(0x19c)];let _0x112d88;if(_0xdc6a00[_0x4ad5bd(0x1b5)])_0x112d88=_0x4ad5bd(0x1d2);else _0xdc6a00[_0x4ad5bd(0x1be)]&&_0xdc6a00[_0x4ad5bd(0x1be)][_0x4ad5bd(0x1b9)]>0x0?_0x112d88=_0xdc6a00['columns']['map'](_0x850e48=>'b.'+_0x850e48[_0x4ad5bd(0x1bd)])[_0x4ad5bd(0x1c8)](',\x20'):_0x112d88=_0x4ad5bd(0x1d2);return('\x0aSELECT\x20m.'+_0xe2ed64+',\x20'+_0x112d88+_0x4ad5bd(0x1b1)+_0x397531[_0x4ad5bd(0x1bc)]+'.'+_0x397531[_0x4ad5bd(0x19e)]+'\x20m\x0aJOIN\x20'+_0xdc6a00['source'][_0x4ad5bd(0x1bc)]+'.'+_0xdc6a00[_0x4ad5bd(0x1a4)]['table']+'\x20b\x0a\x20\x20ON\x20m.'+_0xdc6a00['join'][_0x4ad5bd(0x19c)]+'\x20=\x20b.'+_0xdc6a00[_0x4ad5bd(0x1c8)][_0x4ad5bd(0x1c1)]+_0x4ad5bd(0x1c7)+_0x402739+'\x27)\x0aLIMIT\x20'+_0x4064af+'\x0a')['trim']();}function quoteIdentifier(_0x4cd14c){const _0xdf339=a171_0x3c67;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0xdf339(0x19d)](_0x4cd14c))return'\x22'+_0x4cd14c['replace'](/"/g,'\x22\x22')+'\x22';return _0x4cd14c;}function a171_0x3c67(_0x389723,_0x440ada){_0x389723=_0x389723-0x19a;const _0x3cd9cd=a171_0x3cd9();let _0x3c673e=_0x3cd9cd[_0x389723];return _0x3c673e;}export function generateEnrichedSQL(_0x24fe63,_0x31b31b=0x5){const _0x53b69e=a171_0x3c67,_0x166fc7=_0x24fe63[_0x53b69e(0x19b)],_0x3e4902=_0x24fe63[_0x53b69e(0x1ac)]||[];if(_0x3e4902[_0x53b69e(0x1b9)]===0x0)return'SELECT\x20*\x20FROM\x20'+_0x166fc7[_0x53b69e(0x1bc)]+'.'+_0x166fc7['table']+_0x53b69e(0x1a1)+_0x31b31b;const _0xf0c350=[_0x53b69e(0x1a0)],_0x3e4244=[];return _0x3e4902['forEach']((_0x3d7487,_0x2164fb)=>{const _0x4a6519=_0x53b69e,_0x4a9205='a'+_0x2164fb;_0x3d7487['columns'][_0x4a6519(0x1c3)](_0x19aff0=>{const _0x1e725a=_0x4a6519,_0x3e8c6f=quoteIdentifier(_0x19aff0[_0x1e725a(0x1b2)]||_0x19aff0[_0x1e725a(0x1bd)]);_0xf0c350['push'](_0x4a9205+'.'+_0x19aff0[_0x1e725a(0x1bd)]+_0x1e725a(0x1b0)+_0x3e8c6f);}),_0x3e4244['push'](_0x4a6519(0x19a)+_0x3d7487[_0x4a6519(0x1a4)][_0x4a6519(0x1bc)]+'.'+_0x3d7487['source'][_0x4a6519(0x19e)]+'\x20'+_0x4a9205+_0x4a6519(0x1b3)+_0x3d7487[_0x4a6519(0x1c8)][_0x4a6519(0x19c)]+'\x20=\x20'+_0x4a9205+'.'+_0x3d7487[_0x4a6519(0x1c8)][_0x4a6519(0x1c1)]);}),('\x0aSELECT\x20'+_0xf0c350[_0x53b69e(0x1c8)](',\x20')+_0x53b69e(0x1b1)+_0x166fc7[_0x53b69e(0x1bc)]+'.'+_0x166fc7[_0x53b69e(0x19e)]+_0x53b69e(0x1a8)+_0x3e4244[_0x53b69e(0x1c8)]('\x0a')+_0x53b69e(0x1ad)+_0x31b31b+'\x0a')[_0x53b69e(0x1d1)]();}export function generateAttributeSchemaSQL(_0xb1fd7e,_0x2e6e80){const _0x5ea068=a171_0x3c67,_0x3ef0e9=_0xb1fd7e[_0x5ea068(0x19b)],_0x1b562d=_0x2e6e80[_0x5ea068(0x1c8)][_0x5ea068(0x19c)],_0x1929ec=_0x2e6e80[_0x5ea068(0x1be)][_0x5ea068(0x1b4)](_0x456b14=>'a.'+_0x456b14[_0x5ea068(0x1bd)])[_0x5ea068(0x1c8)](',\x20');return(_0x5ea068(0x1ce)+_0x1b562d+',\x20'+_0x1929ec+_0x5ea068(0x1b1)+_0x3ef0e9[_0x5ea068(0x1bc)]+'.'+_0x3ef0e9[_0x5ea068(0x19e)]+'\x20m\x0aJOIN\x20'+_0x2e6e80[_0x5ea068(0x1a4)][_0x5ea068(0x1bc)]+'.'+_0x2e6e80['source'][_0x5ea068(0x19e)]+_0x5ea068(0x1c0)+_0x2e6e80[_0x5ea068(0x1c8)][_0x5ea068(0x19c)]+'\x20=\x20a.'+_0x2e6e80[_0x5ea068(0x1c8)][_0x5ea068(0x1c1)]+_0x5ea068(0x1a6))[_0x5ea068(0x1d1)]();}export function generateBehaviorSchemaSQL(_0x39a18f,_0x51f1f0){const _0x2712de=a171_0x3c67,_0x54ce3d=_0x39a18f[_0x2712de(0x19b)],_0x3c50ff=_0x51f1f0['join']['parent_key'];let _0xc255c;if(_0x51f1f0[_0x2712de(0x1b5)])_0xc255c='b.*';else _0x51f1f0['columns']&&_0x51f1f0[_0x2712de(0x1be)]['length']>0x0?_0xc255c=_0x51f1f0[_0x2712de(0x1be)][_0x2712de(0x1b4)](_0x5a6c20=>'b.'+_0x5a6c20[_0x2712de(0x1bd)])[_0x2712de(0x1c8)](',\x20'):_0xc255c=_0x2712de(0x1d2);return(_0x2712de(0x1ce)+_0x3c50ff+',\x20'+_0xc255c+_0x2712de(0x1b1)+_0x54ce3d[_0x2712de(0x1bc)]+'.'+_0x54ce3d[_0x2712de(0x19e)]+_0x2712de(0x1cc)+_0x51f1f0[_0x2712de(0x1a4)][_0x2712de(0x1bc)]+'.'+_0x51f1f0[_0x2712de(0x1a4)][_0x2712de(0x19e)]+_0x2712de(0x1c4)+_0x51f1f0[_0x2712de(0x1c8)]['parent_key']+_0x2712de(0x1af)+_0x51f1f0['join']['child_key']+'\x0aLIMIT\x200\x0a')[_0x2712de(0x1d1)]();}export function getAttributeColumns(_0x25e8bb){const _0x1157f2=a171_0x3c67;return _0x25e8bb[_0x1157f2(0x1be)]['map'](_0x2fe0ca=>({'label':_0x2fe0ca[_0x1157f2(0x1b2)]||_0x2fe0ca['column'],'column':_0x2fe0ca[_0x1157f2(0x1bd)]}));}export function getBehaviorColumns(_0x184a76){const _0x370f5b=a171_0x3c67;if(_0x184a76[_0x370f5b(0x1b5)])return[{'label':_0x370f5b(0x1b8),'column':'*'}];if(_0x184a76[_0x370f5b(0x1be)]&&_0x184a76['columns'][_0x370f5b(0x1b9)]>0x0)return _0x184a76[_0x370f5b(0x1be)][_0x370f5b(0x1b4)](_0x121295=>({'label':_0x121295['label']||_0x121295[_0x370f5b(0x1bd)],'column':_0x121295[_0x370f5b(0x1bd)]}));return[{'label':'(all\x20columns)','column':'*'}];}export function findAttributeByName(_0x5a3d7d,_0x5b3edc){const _0x5bc5cf=a171_0x3c67;return _0x5a3d7d['attributes']?.[_0x5bc5cf(0x1ae)](_0x297b64=>_0x297b64[_0x5bc5cf(0x1c5)][_0x5bc5cf(0x1b6)]()===_0x5b3edc['toLowerCase']());}export function findBehaviorByName(_0x1eb5c0,_0x426136){const _0x3cb4b7=a171_0x3c67;return _0x1eb5c0[_0x3cb4b7(0x1a3)]?.[_0x3cb4b7(0x1ae)](_0x31d5bc=>_0x31d5bc[_0x3cb4b7(0x1c5)]['toLowerCase']()===_0x426136[_0x3cb4b7(0x1b6)]());}