@treasuredata/tdx 2026.4.20 → 2026.4.22

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 (247) 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.d.ts.map +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-command.js.map +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/delivery-command.js +1 -1
  24. package/dist/commands/describe.js +1 -1
  25. package/dist/commands/engage-campaign-pull-command.js +1 -1
  26. package/dist/commands/engage-campaign-push-command.js +1 -1
  27. package/dist/commands/engage-campaign-validate-command.js +1 -1
  28. package/dist/commands/engage-command.d.ts +47 -0
  29. package/dist/commands/engage-command.d.ts.map +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-command.js.map +1 -1
  32. package/dist/commands/engage-template-pull-command.js +1 -1
  33. package/dist/commands/engage-template-push-command.js +1 -1
  34. package/dist/commands/engage-template-validate-command.js +1 -1
  35. package/dist/commands/job-command.js +1 -1
  36. package/dist/commands/journey-command.js +1 -1
  37. package/dist/commands/journey-validate-command.js +1 -1
  38. package/dist/commands/llm-command.js +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/parent-segment-command.js +1 -1
  41. package/dist/commands/policy-command.js +1 -1
  42. package/dist/commands/profile-command.js +1 -1
  43. package/dist/commands/profiles-command.js +1 -1
  44. package/dist/commands/query-command.js +1 -1
  45. package/dist/commands/schedule-command.js +1 -1
  46. package/dist/commands/segment-command.js +1 -1
  47. package/dist/commands/segment-create-command.js +1 -1
  48. package/dist/commands/segment-fields-command.js +1 -1
  49. package/dist/commands/segment-pull-command.js +1 -1
  50. package/dist/commands/segment-push-command.js +1 -1
  51. package/dist/commands/segment-update-command.js +1 -1
  52. package/dist/commands/segment-use-command.js +1 -1
  53. package/dist/commands/segment-validate-command.js +1 -1
  54. package/dist/commands/segments.js +1 -1
  55. package/dist/commands/show.js +1 -1
  56. package/dist/commands/status-command.js +1 -1
  57. package/dist/commands/tables.js +1 -1
  58. package/dist/commands/unset-command.js +1 -1
  59. package/dist/commands/upgrade-command.js +1 -1
  60. package/dist/commands/use-command.js +1 -1
  61. package/dist/commands/user-command.js +1 -1
  62. package/dist/commands/work-command.js +1 -1
  63. package/dist/commands/workflow-command.js +1 -1
  64. package/dist/core/auth.js +1 -1
  65. package/dist/core/command-output.js +1 -1
  66. package/dist/core/config.js +1 -1
  67. package/dist/core/connection-cache.js +1 -1
  68. package/dist/core/constants.js +1 -1
  69. package/dist/core/credential-cache.js +1 -1
  70. package/dist/core/global-context.js +1 -1
  71. package/dist/core/keychain.js +1 -1
  72. package/dist/core/oauth-keychain.js +1 -1
  73. package/dist/core/oauth.js +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/tools/work-create-item.js +1 -1
  85. package/dist/mcp/utils.js +1 -1
  86. package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
  87. package/dist/proxy/claude-usage-tracker.js +1 -1
  88. package/dist/proxy/claude-usage-tracker.js.map +1 -1
  89. package/dist/proxy/passthrough-server.d.ts +10 -0
  90. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  91. package/dist/proxy/passthrough-server.js +1 -1
  92. package/dist/proxy/passthrough-server.js.map +1 -1
  93. package/dist/proxy/sse-usage-parser.js +1 -1
  94. package/dist/sdk/agent/agent-config.js +1 -1
  95. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/test/evaluator.js +1 -1
  98. package/dist/sdk/agent/test/executor.js +1 -1
  99. package/dist/sdk/agent/test/index.js +1 -1
  100. package/dist/sdk/agent/test/output.js +1 -1
  101. package/dist/sdk/agent/test/parser.js +1 -1
  102. package/dist/sdk/agent/tool-target-registry.js +1 -1
  103. package/dist/sdk/api.js +1 -1
  104. package/dist/sdk/cas/cas-api-client.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.js +1 -1
  108. package/dist/sdk/cas/pull-workflow.js +1 -1
  109. package/dist/sdk/cas/push-workflow.js +1 -1
  110. package/dist/sdk/client/cdp-api-client.js +1 -1
  111. package/dist/sdk/client/delivery-api-client.js +1 -1
  112. package/dist/sdk/client/endpoints.js +1 -1
  113. package/dist/sdk/client/engage-api-client.d.ts +50 -1
  114. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  115. package/dist/sdk/client/engage-api-client.js +1 -1
  116. package/dist/sdk/client/engage-api-client.js.map +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.js +1 -1
  120. package/dist/sdk/client/rate-limiter.js +1 -1
  121. package/dist/sdk/client/td-api-client.js +1 -1
  122. package/dist/sdk/client/trino-api-client.js +1 -1
  123. package/dist/sdk/client/workflow-client.js +1 -1
  124. package/dist/sdk/connection-validator.js +1 -1
  125. package/dist/sdk/connection.js +1 -1
  126. package/dist/sdk/delivery.js +1 -1
  127. package/dist/sdk/engage/campaign-pull.js +1 -1
  128. package/dist/sdk/engage/campaign-push.js +1 -1
  129. package/dist/sdk/engage/campaign-validator.js +1 -1
  130. package/dist/sdk/engage/campaign-yaml.js +1 -1
  131. package/dist/sdk/engage/template-pull.js +1 -1
  132. package/dist/sdk/engage/template-push.js +1 -1
  133. package/dist/sdk/engage/template-validator.js +1 -1
  134. package/dist/sdk/engage/template-yaml.js +1 -1
  135. package/dist/sdk/engage/types/campaign-def.js +1 -1
  136. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  137. package/dist/sdk/engage/types/template-schema.js +1 -1
  138. package/dist/sdk/engage.d.ts +35 -1
  139. package/dist/sdk/engage.d.ts.map +1 -1
  140. package/dist/sdk/engage.js +1 -1
  141. package/dist/sdk/engage.js.map +1 -1
  142. package/dist/sdk/errors.js +1 -1
  143. package/dist/sdk/index.js +1 -1
  144. package/dist/sdk/io/index.js +1 -1
  145. package/dist/sdk/io/node-filesystem.js +1 -1
  146. package/dist/sdk/job.js +1 -1
  147. package/dist/sdk/journey.js +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/index.js +1 -1
  150. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  151. package/dist/sdk/llm/model-factors.d.ts +33 -9
  152. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  153. package/dist/sdk/llm/model-factors.js +1 -1
  154. package/dist/sdk/llm/model-factors.js.map +1 -1
  155. package/dist/sdk/personalization.js +1 -1
  156. package/dist/sdk/policy.js +1 -1
  157. package/dist/sdk/query/index.js +1 -1
  158. package/dist/sdk/query/sql-parser.js +1 -1
  159. package/dist/sdk/realtime.js +1 -1
  160. package/dist/sdk/schedule.js +1 -1
  161. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  162. package/dist/sdk/segment/fields-display.js +1 -1
  163. package/dist/sdk/segment/file-discovery.js +1 -1
  164. package/dist/sdk/segment/journey-utils.js +1 -1
  165. package/dist/sdk/segment/journey-validator.js +1 -1
  166. package/dist/sdk/segment/journey-yaml.js +1 -1
  167. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  168. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  169. package/dist/sdk/segment/pull-workflow.js +1 -1
  170. package/dist/sdk/segment/push-recovery.js +1 -1
  171. package/dist/sdk/segment/push-workflow.js +1 -1
  172. package/dist/sdk/segment/resolution-context.js +1 -1
  173. package/dist/sdk/segment/segment-path-parser.js +1 -1
  174. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  175. package/dist/sdk/segment/segment-validator.js +1 -1
  176. package/dist/sdk/segment/target-resolution.js +1 -1
  177. package/dist/sdk/segment/tdx-config.js +1 -1
  178. package/dist/sdk/segment/types/activation-schema.js +1 -1
  179. package/dist/sdk/segment/types/journey-def.js +1 -1
  180. package/dist/sdk/segment/types/journey-schema.js +1 -1
  181. package/dist/sdk/segment/types/segment-def.js +1 -1
  182. package/dist/sdk/segment/types/segment-schema.js +1 -1
  183. package/dist/sdk/segment/validate-files.js +1 -1
  184. package/dist/sdk/segment/yaml-validator.js +1 -1
  185. package/dist/sdk/segment.js +1 -1
  186. package/dist/sdk/types/engage.d.ts +53 -0
  187. package/dist/sdk/types/engage.d.ts.map +1 -1
  188. package/dist/sdk/types/index.d.ts +1 -1
  189. package/dist/sdk/types/index.d.ts.map +1 -1
  190. package/dist/sdk/types/index.js +1 -1
  191. package/dist/sdk/types/index.js.map +1 -1
  192. package/dist/sdk/types/progress.js +1 -1
  193. package/dist/sdk/types/workspace.js +1 -1
  194. package/dist/sdk/user.js +1 -1
  195. package/dist/sdk/util/format-detector.js +1 -1
  196. package/dist/sdk/util/formatters.js +1 -1
  197. package/dist/sdk/util/index.js +1 -1
  198. package/dist/sdk/util/paginate.js +1 -1
  199. package/dist/sdk/util/tree-formatter.js +1 -1
  200. package/dist/sdk/workflow/archive-validation.js +1 -1
  201. package/dist/sdk/workflow/clone-workflow.js +1 -1
  202. package/dist/sdk/workflow/index.js +1 -1
  203. package/dist/sdk/workflow/pull-workflow.js +1 -1
  204. package/dist/sdk/workflow/push-workflow.js +1 -1
  205. package/dist/sdk/workflow/task-graph.js +1 -1
  206. package/dist/sdk/workflow/tdx-config.js +1 -1
  207. package/dist/sdk/workflow/workflow-utils.js +1 -1
  208. package/dist/sdk/workspace/access-tracker.js +1 -1
  209. package/dist/sdk/workspace/frontmatter.js +1 -1
  210. package/dist/sdk/workspace/git.js +1 -1
  211. package/dist/sdk/workspace/index.js +1 -1
  212. package/dist/sdk/workspace/templates.js +1 -1
  213. package/dist/sdk/workspace/weekly.js +1 -1
  214. package/dist/sdk/workspace/wikilinks.js +1 -1
  215. package/dist/test-utils/command-runner.js +1 -1
  216. package/dist/test-utils/factories.js +1 -1
  217. package/dist/test-utils/fixtures.js +1 -1
  218. package/dist/test-utils/http-mock.js +1 -1
  219. package/dist/test-utils/index.js +1 -1
  220. package/dist/utils/async.js +1 -1
  221. package/dist/utils/colors.js +1 -1
  222. package/dist/utils/diff.js +1 -1
  223. package/dist/utils/file-permissions.js +1 -1
  224. package/dist/utils/file-reader.js +1 -1
  225. package/dist/utils/github-releases.js +1 -1
  226. package/dist/utils/global-cache.js +1 -1
  227. package/dist/utils/json-loader.js +1 -1
  228. package/dist/utils/local-cache.js +1 -1
  229. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  230. package/dist/utils/logger/formatters/index.js +1 -1
  231. package/dist/utils/logger/handlers/console-handler.js +1 -1
  232. package/dist/utils/logger/handlers/file-handler.js +1 -1
  233. package/dist/utils/logger/handlers/index.js +1 -1
  234. package/dist/utils/logger/handlers/null-handler.js +1 -1
  235. package/dist/utils/logger/index.js +1 -1
  236. package/dist/utils/logger/logger.js +1 -1
  237. package/dist/utils/logger/types.js +1 -1
  238. package/dist/utils/option-validation.js +1 -1
  239. package/dist/utils/process.js +1 -1
  240. package/dist/utils/prompt.js +1 -1
  241. package/dist/utils/spinner.js +1 -1
  242. package/dist/utils/sse-parser.js +1 -1
  243. package/dist/utils/string-utils.js +1 -1
  244. package/dist/utils/table-ref-parser.js +1 -1
  245. package/dist/utils/tdx-logger.js +1 -1
  246. package/dist/utils/version-check.js +1 -1
  247. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x3a8e1d,_0x2585d2){const _0x1a005e=a146_0x13e4,_0x3b6d50=_0x3a8e1d();while(!![]){try{const _0x15a9fb=parseInt(_0x1a005e(0x1e4))/0x1*(parseInt(_0x1a005e(0x191))/0x2)+parseInt(_0x1a005e(0x1d5))/0x3+parseInt(_0x1a005e(0x1ed))/0x4+-parseInt(_0x1a005e(0x20c))/0x5*(-parseInt(_0x1a005e(0x20b))/0x6)+-parseInt(_0x1a005e(0x1ca))/0x7*(-parseInt(_0x1a005e(0x21e))/0x8)+-parseInt(_0x1a005e(0x23b))/0x9+parseInt(_0x1a005e(0x1c4))/0xa*(-parseInt(_0x1a005e(0x1f3))/0xb);if(_0x15a9fb===_0x2585d2)break;else _0x3b6d50['push'](_0x3b6d50['shift']());}catch(_0x10dfea){_0x3b6d50['push'](_0x3b6d50['shift']());}}}(a146_0x1513,0xbda82));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function a146_0x1513(){const _0x2530f9=['launched','branch\x20\x27','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','variants','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','INVALID_AB_TEST_PERCENTAGES','Stage\x20\x27','Duplicate\x20step\x20name\x20\x27','INVALID_JUMP_TARGET','MISSING_SEGMENT_REFERENCE','length','MISSING_ACTIVATION_DEFINITION','version','startsWith','embeddedSegments','keys','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','condition','abs','\x27\x20of\x20\x27','MISSING_ACTIVATION_REF','.with.condition.segment','ref:','.with.branches','Embedded\x20segment\x20\x27','goalIsInherited','MISSING_WAIT_PARAMS','\x27\x20with\x20no\x20action\x20in\x20between','values','set','rule','Decision\x20branch\x20\x27','.steps[','Criteria\x20references\x20undefined\x20segment\x20\x27','exit_criteria','\x20(across\x20','name','19223540cQanFk','steps','ACTIVATION_SCHEMA_ERROR','path','segments','\x27\x20(from:\x20','9315733AljqAn','has','splice','journey','.with.activation','endsWith','some','Step\x20references\x20non-existent\x20step\x20\x27','\x20with\x20latest:\x20true','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','2365287DGMXKs','FEW_STEPS','MISSING_STAGES','timeout','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','replace','.with','INVALID_NEXT_REFERENCE','MISSING_NAME','reduce','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','entry_criteria','state','error','2182Ylbbnf','Jump\x20step\x20requires\x20a\x20target','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','level','Journey\x20name\x20is\x20required','.segment','UNUSED_EMBEDDED_SEGMENT','\x27\x20has\x20no\x20steps','activation','4812008cYNSjo','\x27\x20(first\x20defined\x20at\x20steps[','add','stage','push','.with.branches[','22Bchdsn','timeout\x20of\x20\x27','merge','MISSING_MILESTONE','decision_point','End\x20step\x20\x27','message','SINGLE_INPUT_MERGE','sort','INSUFFICIENT_STEPS','activationKeys','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','\x27\x20has\x20only\x20','JOURNEY_SCHEMA_ERROR','source','DUPLICATE_STEP_NAME','step\x20\x27','.entry_criteria','.milestone','.exit_criteria','versions','journeys','Merge\x20step\x20\x27','symbol','2301336cWadRi','15bBGIcD','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','skipSchema','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.next','referencedSegments','warning','CONVERGENCE_WITHOUT_MERGE','MISSING_END_STEP','goal','excluded','journeys[','get','segment','MISSING_EXIT_CRITERIA','latest','segments.','issues','8BxdLYH','Activation\x20step\x20requires\x20an\x20activation\x20reference','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','MISSING_GOAL','.stages','milestone','document','activations','.with.target','journeys,\x20stages,\x20or\x20versions','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','wait','includes','.steps','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','END_STEP_HAS_NEXT_OR_WITH','.with.condition.timeout.next','stepNames','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','safeParse','MISSING_CONDITIONS','size','\x27\x20has\x20no\x20end\x20step','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',').\x20Merge\x20is\x20unnecessary.','join','end','.type','data','3041658NXVoyu','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','type','entries','.with.condition','stages','branches','jump','filter','next','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','446BiFhpy','.with.condition.next','target','BRANCH_DIRECTLY_TO_MERGE','\x20stages\x20but\x20maximum\x20is\x20','TOO_MANY_STAGES','with','.rule','ab_test','variant\x20\x27','stages[','condition\x20of\x20\x27','map'];a146_0x1513=function(){return _0x2530f9;};return a146_0x1513();}function createIssue(_0x5f2e9d,_0x2e66de,_0x282c1d,_0x3b2a7a,_0x495e19,_0x7c0421){const _0x1b46ed=a146_0x13e4;return{'level':_0x5f2e9d,'path':_0x2e66de,'code':_0x282c1d,'message':_0x3b2a7a,'location':getLocationFromPath(_0x495e19[_0x1b46ed(0x224)],_0x495e19['source'],pathToArray(_0x7c0421??_0x2e66de))};}function validateVersionStructure(_0x2df7d7,_0x5b56a9){const _0x5e2c93=a146_0x13e4,_0x5d4107=[];return _0x2df7d7[_0x5e2c93(0x1a8)]>MAX_STAGES&&_0x5d4107[_0x5e2c93(0x1f1)](createIssue(_0x5e2c93(0x1e3),_0x5e2c93(0x18b),_0x5e2c93(0x196),'Journey\x20has\x20'+_0x2df7d7[_0x5e2c93(0x1a8)]+_0x5e2c93(0x195)+MAX_STAGES,_0x5b56a9)),_0x5d4107;}function validateStageStructure(_0x156df4,_0x4d3867,_0x3a1cd4,_0x1d7172){const _0x4961f4=a146_0x13e4,_0x3e181f=[],_0x25e0fc=_0x4961f4(0x19b)+_0x4d3867+']';_0x4d3867===0x0&&!_0x156df4[_0x4961f4(0x1e1)]&&_0x3e181f[_0x4961f4(0x1f1)](createIssue('error',_0x25e0fc+'.entry_criteria','MISSING_ENTRY_CRITERIA',_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x1d7172,_0x25e0fc));const _0xb98e6c=_0x4d3867===_0x3a1cd4-0x1;!_0xb98e6c&&!_0x156df4[_0x4961f4(0x223)]&&_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x1e3),_0x25e0fc+_0x4961f4(0x205),_0x4961f4(0x1f6),_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1a0),_0x1d7172,_0x25e0fc));(!_0x156df4['exit_criteria']||_0x156df4[_0x4961f4(0x1c1)][_0x4961f4(0x1a8)]===0x0)&&_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x206),_0x4961f4(0x21a),_0x4961f4(0x1a4)+_0x156df4['name']+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x1d7172,_0x25e0fc));const _0xf3eb9c=_0x156df4[_0x4961f4(0x1c5)]?.[_0x4961f4(0x1a8)]??0x0;if(_0xf3eb9c===0x0)_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x1e3),_0x25e0fc+_0x4961f4(0x22b),_0x4961f4(0x1fc),'Stage\x20\x27'+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1eb),_0x1d7172,_0x25e0fc+_0x4961f4(0x22b)));else{if(_0xf3eb9c===0x1)_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x22b),'INSUFFICIENT_STEPS',_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x23d),_0x1d7172,_0x25e0fc+'.steps'));else _0xf3eb9c<=0x3&&_0x3e181f['push'](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x22b),_0x4961f4(0x1d6),_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1ff)+_0xf3eb9c+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x1d7172,_0x25e0fc+'.steps'));}return _0x3e181f;}function validateStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a){const _0x4cf71b=a146_0x13e4,_0x565ddd=[];if(_0x356637[_0x4cf71b(0x188)]===_0x4cf71b(0x238))return _0x356637[_0x4cf71b(0x18f)]&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue('error',_0x225fde+_0x4cf71b(0x210),_0x4cf71b(0x22d),_0x4cf71b(0x1f8)+_0x356637[_0x4cf71b(0x1c3)]+_0x4cf71b(0x20f),_0x42b51e)),_0x4cf71b(0x197)in _0x356637&&_0x356637[_0x4cf71b(0x197)]!==undefined&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue(_0x4cf71b(0x1e3),_0x225fde+_0x4cf71b(0x1dc),_0x4cf71b(0x22d),'End\x20step\x20\x27'+_0x356637['name']+_0x4cf71b(0x228),_0x42b51e)),_0x565ddd;_0x356637[_0x4cf71b(0x18f)]&&(_0x42b51e[_0x4cf71b(0x22f)]&&!_0x42b51e['stepNames'][_0x4cf71b(0x1cb)](_0x356637[_0x4cf71b(0x18f)])&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue('error',_0x225fde+_0x4cf71b(0x210),'INVALID_NEXT_REFERENCE',_0x4cf71b(0x1d1)+_0x356637[_0x4cf71b(0x18f)]+'\x27',_0x42b51e)));switch(_0x356637[_0x4cf71b(0x188)]){case _0x4cf71b(0x229):_0x565ddd[_0x4cf71b(0x1f1)](...validateWaitStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x1ec):_0x565ddd[_0x4cf71b(0x1f1)](...validateActivationStep(_0x356637,_0x225fde,_0x42b51e));break;case _0x4cf71b(0x1f7):_0x565ddd['push'](...validateDecisionPointStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x199):_0x565ddd[_0x4cf71b(0x1f1)](...validateAbTestStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x18d):_0x565ddd['push'](...validateJumpStep(_0x356637,_0x225fde,_0x42b51e));break;}return _0x565ddd;}function validateWaitStep(_0x167cbd,_0x31f3ce,_0x449895,_0x2a9e36){const _0x539f68=a146_0x13e4,_0x4987d8=[];if(!_0x167cbd[_0x539f68(0x197)])return _0x4987d8['push'](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x1dc),_0x539f68(0x1b9),_0x539f68(0x187),_0x449895,_0x31f3ce)),_0x4987d8;if(_0x167cbd[_0x539f68(0x197)]['condition']){const _0x75a963=_0x167cbd[_0x539f68(0x197)][_0x539f68(0x1b0)];if(_0x75a963[_0x539f68(0x219)]){_0x449895['referencedSegments']?.[_0x539f68(0x1ef)](_0x75a963[_0x539f68(0x219)]);!_0x75a963[_0x539f68(0x219)]['startsWith'](_0x539f68(0x1b5))&&(_0x449895[_0x539f68(0x1ac)]&&!_0x449895[_0x539f68(0x1ac)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x219)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x1b4),_0x539f68(0x1a7),'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x75a963[_0x539f68(0x219)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.',_0x449895)));_0x75a963[_0x539f68(0x18f)]&&_0x449895[_0x539f68(0x22f)]&&!_0x449895[_0x539f68(0x22f)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x18f)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x192),'INVALID_NEXT_REFERENCE','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x75a963[_0x539f68(0x18f)]+'\x27',_0x449895));_0x75a963[_0x539f68(0x1d8)]?.['next']&&_0x449895[_0x539f68(0x22f)]&&!_0x449895[_0x539f68(0x22f)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x1d8)][_0x539f68(0x18f)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue('error',_0x31f3ce+'.with.condition.timeout.next',_0x539f68(0x1dd),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x75a963[_0x539f68(0x1d8)][_0x539f68(0x18f)]+'\x27',_0x449895));const _0xe552e4=_0x75a963[_0x539f68(0x18f)]||_0x167cbd['next'],_0x40b5d1=_0x75a963[_0x539f68(0x1d8)]?.['next']||_0x167cbd[_0x539f68(0x18f)];if(_0xe552e4){const _0xd2eb62=_0x2a9e36[_0x539f68(0x218)](_0xe552e4);_0xd2eb62?.[_0x539f68(0x188)]==='merge'&&_0x4987d8['push'](createIssue(_0x539f68(0x212),_0x31f3ce+'.with.condition.next',_0x539f68(0x194),_0x539f68(0x1af)+_0xe552e4+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x449895,_0x31f3ce+_0x539f68(0x18a)));}if(_0x40b5d1){const _0x315968=_0x2a9e36[_0x539f68(0x218)](_0x40b5d1);_0x315968?.[_0x539f68(0x188)]===_0x539f68(0x1f5)&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x212),_0x31f3ce+_0x539f68(0x22e),'BRANCH_DIRECTLY_TO_MERGE',_0x539f68(0x1d9)+_0x40b5d1+_0x539f68(0x22c),_0x449895,_0x31f3ce+'.with.condition.timeout'));}}}return _0x4987d8;}function validateActivationStep(_0x892c39,_0x5bc3d8,_0x4c714f){const _0x20ac3c=a146_0x13e4,_0x46d3cc=[];if(!_0x892c39[_0x20ac3c(0x197)]?.[_0x20ac3c(0x1ec)])return _0x46d3cc[_0x20ac3c(0x1f1)](createIssue('error',_0x5bc3d8+'.with.activation',_0x20ac3c(0x1b3),_0x20ac3c(0x21f),_0x4c714f,_0x5bc3d8)),_0x46d3cc;const _0x5dfeec=_0x892c39[_0x20ac3c(0x197)]['activation'];return _0x4c714f['activationKeys']&&!_0x5dfeec[_0x20ac3c(0x1ab)](_0x20ac3c(0x1b5))&&(!_0x4c714f[_0x20ac3c(0x1fd)][_0x20ac3c(0x1cb)](_0x5dfeec)&&_0x46d3cc[_0x20ac3c(0x1f1)](createIssue(_0x20ac3c(0x1e3),_0x5bc3d8+_0x20ac3c(0x1ce),_0x20ac3c(0x1a9),_0x20ac3c(0x1d4)+_0x5dfeec+_0x20ac3c(0x1a2),_0x4c714f))),_0x46d3cc;}function validateDecisionPointStep(_0x158770,_0x456aa4,_0x37682f,_0x5a568e){const _0x59e4b6=a146_0x13e4,_0x4e108b=[];if(!_0x158770[_0x59e4b6(0x197)]?.[_0x59e4b6(0x18c)]||_0x158770[_0x59e4b6(0x197)]['branches'][_0x59e4b6(0x1a8)]===0x0)return _0x4e108b[_0x59e4b6(0x1f1)](createIssue(_0x59e4b6(0x1e3),_0x456aa4+_0x59e4b6(0x1b6),_0x59e4b6(0x232),_0x59e4b6(0x1ae),_0x37682f,_0x456aa4)),_0x4e108b;for(let _0x265d89=0x0;_0x265d89<_0x158770[_0x59e4b6(0x197)]['branches'][_0x59e4b6(0x1a8)];_0x265d89++){const _0x1b5d2b=_0x158770['with'][_0x59e4b6(0x18c)][_0x265d89],_0x4351f8=_0x456aa4+_0x59e4b6(0x1f2)+_0x265d89+']';_0x1b5d2b[_0x59e4b6(0x219)]&&!_0x1b5d2b[_0x59e4b6(0x216)]&&(_0x37682f[_0x59e4b6(0x211)]?.[_0x59e4b6(0x1ef)](_0x1b5d2b[_0x59e4b6(0x219)]),!_0x1b5d2b[_0x59e4b6(0x219)][_0x59e4b6(0x1ab)](_0x59e4b6(0x1b5))&&(_0x37682f['embeddedSegments']&&!_0x37682f['embeddedSegments'][_0x59e4b6(0x1cb)](_0x1b5d2b[_0x59e4b6(0x219)])&&_0x4e108b['push'](createIssue(_0x59e4b6(0x1e3),_0x4351f8+_0x59e4b6(0x1e9),'MISSING_SEGMENT_REFERENCE',_0x59e4b6(0x230)+_0x1b5d2b[_0x59e4b6(0x219)]+'\x27',_0x37682f))));_0x1b5d2b[_0x59e4b6(0x18f)]&&_0x37682f[_0x59e4b6(0x22f)]&&!_0x37682f['stepNames']['has'](_0x1b5d2b[_0x59e4b6(0x18f)])&&_0x4e108b['push'](createIssue(_0x59e4b6(0x1e3),_0x4351f8+_0x59e4b6(0x210),'INVALID_NEXT_REFERENCE','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x1b5d2b[_0x59e4b6(0x18f)]+'\x27',_0x37682f));if(_0x1b5d2b[_0x59e4b6(0x18f)]){const _0xc9de6b=_0x5a568e['get'](_0x1b5d2b[_0x59e4b6(0x18f)]);_0xc9de6b?.['type']===_0x59e4b6(0x1f5)&&_0x4e108b[_0x59e4b6(0x1f1)](createIssue(_0x59e4b6(0x212),_0x4351f8+_0x59e4b6(0x210),_0x59e4b6(0x194),_0x59e4b6(0x1be)+_0x1b5d2b[_0x59e4b6(0x1c3)]+_0x59e4b6(0x1d3)+_0x1b5d2b[_0x59e4b6(0x18f)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x37682f));}}return _0x4e108b;}function validateAbTestStep(_0x25eba2,_0x5d2449,_0x3cafcf,_0xe9fb6a){const _0x14d217=a146_0x13e4,_0x12e24e=[];if(!_0x25eba2['with']?.[_0x14d217(0x1a1)]||_0x25eba2[_0x14d217(0x197)]['variants'][_0x14d217(0x1a8)]===0x0)return _0x12e24e['push'](createIssue('error',_0x5d2449+'.with.variants',_0x14d217(0x232),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x3cafcf,_0x5d2449)),_0x12e24e;const _0x249553=_0x25eba2[_0x14d217(0x197)][_0x14d217(0x1a1)][_0x14d217(0x1df)]((_0x58d0c5,_0xb77f87)=>_0x58d0c5+(_0xb77f87['percentage']||0x0),0x0);Math[_0x14d217(0x1b1)](_0x249553-0x64)>0.01&&_0x12e24e[_0x14d217(0x1f1)](createIssue('error',_0x5d2449+'.with.variants',_0x14d217(0x1a3),_0x14d217(0x190)+_0x249553+'%)',_0x3cafcf));for(let _0x267dd4=0x0;_0x267dd4<_0x25eba2['with'][_0x14d217(0x1a1)]['length'];_0x267dd4++){const _0xd7fb51=_0x25eba2[_0x14d217(0x197)]['variants'][_0x267dd4],_0x5aba97=_0x5d2449+'.with.variants['+_0x267dd4+']';_0xd7fb51[_0x14d217(0x18f)]&&_0x3cafcf[_0x14d217(0x22f)]&&!_0x3cafcf[_0x14d217(0x22f)][_0x14d217(0x1cb)](_0xd7fb51['next'])&&_0x12e24e['push'](createIssue(_0x14d217(0x1e3),_0x5aba97+_0x14d217(0x210),_0x14d217(0x1dd),_0x14d217(0x1da)+_0xd7fb51['next']+'\x27',_0x3cafcf));if(_0xd7fb51[_0x14d217(0x18f)]){const _0x322152=_0xe9fb6a[_0x14d217(0x218)](_0xd7fb51[_0x14d217(0x18f)]);_0x322152?.[_0x14d217(0x188)]==='merge'&&_0x12e24e[_0x14d217(0x1f1)](createIssue(_0x14d217(0x212),_0x5aba97+_0x14d217(0x210),_0x14d217(0x194),'A/B\x20test\x20variant\x20\x27'+_0xd7fb51['name']+_0x14d217(0x1d3)+_0xd7fb51['next']+_0x14d217(0x1ba),_0x3cafcf));}}return _0x12e24e;}function validateJumpStep(_0x5cbfe6,_0x4f7fcf,_0x55cea4){const _0x216322=a146_0x13e4,_0x1779f0=[];if(!_0x5cbfe6[_0x216322(0x197)]?.[_0x216322(0x193)])return _0x1779f0[_0x216322(0x1f1)](createIssue(_0x216322(0x1e3),_0x4f7fcf+'.with.target',_0x216322(0x1a6),_0x216322(0x1e5),_0x55cea4,_0x4f7fcf)),_0x1779f0;return(!_0x5cbfe6[_0x216322(0x197)][_0x216322(0x193)][_0x216322(0x1cd)]||!_0x5cbfe6[_0x216322(0x197)][_0x216322(0x193)][_0x216322(0x1f0)])&&_0x1779f0[_0x216322(0x1f1)](createIssue(_0x216322(0x1e3),_0x4f7fcf+_0x216322(0x226),'INVALID_JUMP_TARGET',_0x216322(0x235),_0x55cea4)),_0x1779f0;}function buildConvergenceMap(_0x16ce01){const _0x5402bf=a146_0x13e4,_0x2d0f0f=new Map();function _0x492627(_0x52a920,_0x16453e){const _0x36d891=a146_0x13e4,_0x57e5e0=_0x2d0f0f[_0x36d891(0x218)](_0x52a920)||[];_0x57e5e0[_0x36d891(0x1f1)](_0x16453e),_0x2d0f0f[_0x36d891(0x1bc)](_0x52a920,_0x57e5e0);}for(const _0x43db20 of _0x16ce01){_0x43db20[_0x5402bf(0x18f)]&&_0x492627(_0x43db20[_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x203)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});if(_0x43db20['type']===_0x5402bf(0x1f7)&&_0x43db20[_0x5402bf(0x197)]?.['branches'])for(const _0x54842f of _0x43db20[_0x5402bf(0x197)]['branches']){_0x54842f[_0x5402bf(0x18f)]&&_0x492627(_0x54842f[_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19f)+_0x54842f[_0x5402bf(0x1c3)]+_0x5402bf(0x1b2)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});}if(_0x43db20[_0x5402bf(0x188)]===_0x5402bf(0x199)&&_0x43db20[_0x5402bf(0x197)]?.[_0x5402bf(0x1a1)])for(const _0x10f547 of _0x43db20[_0x5402bf(0x197)]['variants']){_0x10f547[_0x5402bf(0x18f)]&&_0x492627(_0x10f547['next'],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19a)+_0x10f547[_0x5402bf(0x1c3)]+'\x27\x20of\x20\x27'+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});}_0x43db20[_0x5402bf(0x188)]===_0x5402bf(0x229)&&_0x43db20['with']?.[_0x5402bf(0x1b0)]&&(_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)][_0x5402bf(0x18f)]&&_0x492627(_0x43db20['with']['condition'][_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19c)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'}),_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)]['timeout']?.[_0x5402bf(0x18f)]&&_0x492627(_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)][_0x5402bf(0x1d8)]['next'],{'stepName':_0x43db20['name'],'description':_0x5402bf(0x1f4)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'}));}return _0x2d0f0f;}function a146_0x13e4(_0x16eac6,_0x53221e){_0x16eac6=_0x16eac6-0x187;const _0x151379=a146_0x1513();let _0x13e49e=_0x151379[_0x16eac6];return _0x13e49e;}function validateFlowControl(_0xde982b,_0x1ac113,_0x26d74b){const _0x3b30bb=a146_0x13e4,_0x55b828=[],_0x5eb467='stages['+_0x1ac113+']',_0x1fa47b=_0xde982b['steps']||[];if(_0x1fa47b[_0x3b30bb(0x1a8)]===0x0)return _0x55b828;const _0x574e21=new Map();for(const _0x384606 of _0x1fa47b){_0x384606[_0x3b30bb(0x1c3)]&&_0x574e21[_0x3b30bb(0x1bc)](_0x384606[_0x3b30bb(0x1c3)],_0x384606);}const _0x176565=buildConvergenceMap(_0x1fa47b),_0x195a5e=_0x1fa47b[_0x3b30bb(0x1d0)](_0x1b3855=>_0x1b3855[_0x3b30bb(0x188)]==='end');!_0x195a5e&&_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+_0x3b30bb(0x22b),_0x3b30bb(0x214),'Stage\x20\x27'+_0xde982b[_0x3b30bb(0x1c3)]+_0x3b30bb(0x234),_0x26d74b));for(const [_0x17add3,_0x332986]of _0x176565){const _0x721eb=_0x574e21['get'](_0x17add3);if(!_0x721eb)continue;if(_0x332986[_0x3b30bb(0x1a8)]>0x1&&_0x721eb[_0x3b30bb(0x188)]!=='merge'){const _0x57330a=_0x332986['map'](_0x12111f=>_0x12111f['description'])[_0x3b30bb(0x237)](',\x20');_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+_0x3b30bb(0x22b),_0x3b30bb(0x213),_0x3b30bb(0x23c)+_0x17add3+_0x3b30bb(0x1c9)+_0x57330a+').\x20Use\x20a\x20merge\x20step.',_0x26d74b));}_0x332986[_0x3b30bb(0x1a8)]===0x1&&_0x721eb['type']===_0x3b30bb(0x1f5)&&_0x55b828['push'](createIssue(_0x3b30bb(0x212),_0x5eb467+'.steps',_0x3b30bb(0x1fa),_0x3b30bb(0x209)+_0x17add3+_0x3b30bb(0x1e0)+_0x332986[0x0]['description']+_0x3b30bb(0x236),_0x26d74b));}for(const _0x17141a of _0x1fa47b){if(_0x17141a[_0x3b30bb(0x188)]===_0x3b30bb(0x1f5)&&_0x17141a[_0x3b30bb(0x18f)]){const _0x4695b9=_0x574e21[_0x3b30bb(0x218)](_0x17141a[_0x3b30bb(0x18f)]);_0x4695b9?.[_0x3b30bb(0x188)]==='merge'&&_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+'.steps','MERGE_TO_MERGE_CHAIN',_0x3b30bb(0x209)+_0x17141a[_0x3b30bb(0x1c3)]+_0x3b30bb(0x20d)+_0x17141a[_0x3b30bb(0x18f)]+_0x3b30bb(0x1fe),_0x26d74b));}}return _0x55b828;}function validateCriteria(_0x10756b,_0x4d55dc,_0x5913e5){const _0x4809ff=a146_0x13e4,_0x22982f=[];return _0x10756b[_0x4809ff(0x219)]&&(_0x5913e5[_0x4809ff(0x211)]?.[_0x4809ff(0x1ef)](_0x10756b[_0x4809ff(0x219)]),!_0x10756b[_0x4809ff(0x219)][_0x4809ff(0x1ab)](_0x4809ff(0x1b5))&&(_0x5913e5[_0x4809ff(0x1ac)]&&!_0x5913e5[_0x4809ff(0x1ac)][_0x4809ff(0x1cb)](_0x10756b[_0x4809ff(0x219)])&&_0x22982f[_0x4809ff(0x1f1)](createIssue(_0x4809ff(0x1e3),_0x4d55dc+_0x4809ff(0x1e9),_0x4809ff(0x1a7),_0x4809ff(0x1c0)+_0x10756b[_0x4809ff(0x219)]+'\x27',_0x5913e5)))),_0x22982f;}function validateEmbeddedSegment(_0x28440f,_0x1c9816,_0x5651af){const _0x401780=a146_0x13e4,_0x4367d5=[];return _0x28440f[_0x401780(0x1bd)]&&_0x4367d5['push'](...validateRuleDef(_0x28440f[_0x401780(0x1bd)],_0x1c9816+_0x401780(0x198),_0x5651af)),_0x4367d5;}function validateStage(_0x132f3e,_0x5de3f9,_0x35fa4a,_0x75bbab){const _0x3e5dde=a146_0x13e4,_0x596e0f=[],_0x28a385=_0x3e5dde(0x19b)+_0x5de3f9+']',_0x6f28a4=new Map(),_0x5cb50e=new Map();if(_0x132f3e[_0x3e5dde(0x1c5)]){for(let _0x2b561a=0x0;_0x2b561a<_0x132f3e[_0x3e5dde(0x1c5)][_0x3e5dde(0x1a8)];_0x2b561a++){const _0x392a77=_0x132f3e[_0x3e5dde(0x1c5)][_0x2b561a];_0x392a77['name']&&_0x6f28a4[_0x3e5dde(0x1bc)](_0x392a77[_0x3e5dde(0x1c3)],_0x392a77);}for(let _0x1a1b92=0x0;_0x1a1b92<_0x132f3e[_0x3e5dde(0x1c5)][_0x3e5dde(0x1a8)];_0x1a1b92++){const _0x1413a3=_0x132f3e[_0x3e5dde(0x1c5)][_0x1a1b92],_0x2acf6c=_0x28a385+_0x3e5dde(0x1bf)+_0x1a1b92+']';if(_0x1413a3['name']){if(_0x5cb50e[_0x3e5dde(0x1cb)](_0x1413a3['name'])){const _0x4bf0c3=_0x5cb50e['get'](_0x1413a3['name']);_0x596e0f['push'](createIssue('error',_0x2acf6c+'.name',_0x3e5dde(0x202),_0x3e5dde(0x1a5)+_0x1413a3[_0x3e5dde(0x1c3)]+_0x3e5dde(0x1ee)+_0x4bf0c3+'])',_0x75bbab));}else _0x5cb50e[_0x3e5dde(0x1bc)](_0x1413a3[_0x3e5dde(0x1c3)],_0x1a1b92);}_0x596e0f[_0x3e5dde(0x1f1)](...validateStep(_0x1413a3,_0x2acf6c,_0x75bbab,_0x6f28a4));}}_0x132f3e[_0x3e5dde(0x1e1)]&&_0x596e0f[_0x3e5dde(0x1f1)](...validateCriteria(_0x132f3e['entry_criteria'],_0x28a385+_0x3e5dde(0x204),_0x75bbab));if(_0x132f3e[_0x3e5dde(0x1c1)])for(let _0x1ffe49=0x0;_0x1ffe49<_0x132f3e[_0x3e5dde(0x1c1)][_0x3e5dde(0x1a8)];_0x1ffe49++){_0x596e0f['push'](...validateCriteria(_0x132f3e['exit_criteria'][_0x1ffe49],_0x28a385+'.exit_criteria['+_0x1ffe49+']',_0x75bbab));}return _0x132f3e[_0x3e5dde(0x223)]&&_0x596e0f['push'](...validateCriteria(_0x132f3e[_0x3e5dde(0x223)],_0x28a385+'.milestone',_0x75bbab)),_0x596e0f[_0x3e5dde(0x1f1)](...validateStageStructure(_0x132f3e,_0x5de3f9,_0x35fa4a,_0x75bbab)),_0x596e0f[_0x3e5dde(0x1f1)](...validateFlowControl(_0x132f3e,_0x5de3f9,_0x75bbab)),_0x596e0f;}function validateStagesForVersion(_0x1a4c81,_0xefe251,_0x3abe5e,_0x48cf11,_0x114add,_0x4dabe6,_0x2e71b0){const _0x306a44=a146_0x13e4;if(_0x1a4c81[_0x306a44(0x1a8)]===0x0){_0x114add[_0x306a44(0x1f1)]({'level':_0x306a44(0x1e3),'path':_0x48cf11+_0x306a44(0x18b),'code':_0x306a44(0x1d7),'message':_0x306a44(0x1e6),'location':getLocationFromPath(_0x3abe5e['document'],_0x3abe5e[_0x306a44(0x201)],[_0x306a44(0x18b)])});return;}const _0x2c5f7a=new Set();for(const _0x19ef31 of _0x1a4c81){if(_0x19ef31['steps'])for(const _0x5f3b23 of _0x19ef31[_0x306a44(0x1c5)]){_0x5f3b23[_0x306a44(0x1c3)]&&_0x2c5f7a[_0x306a44(0x1ef)](_0x5f3b23['name']);}}const _0x5849af={..._0x3abe5e,'stepNames':_0x2c5f7a},_0x16d835=validateVersionStructure(_0x1a4c81,_0x5849af);for(const _0x4125ce of _0x16d835){const _0xfa51a=_0x48cf11?{..._0x4125ce,'path':''+_0x48cf11+_0x4125ce[_0x306a44(0x1c7)]}:_0x4125ce;if(_0xfa51a[_0x306a44(0x1e7)]==='error')_0x114add[_0x306a44(0x1f1)](_0xfa51a);else _0x4dabe6[_0x306a44(0x1f1)](_0xfa51a);}for(let _0x9d3135=0x0;_0x9d3135<_0x1a4c81[_0x306a44(0x1a8)];_0x9d3135++){const _0x523e5c=validateStage(_0x1a4c81[_0x9d3135],_0x9d3135,_0x1a4c81[_0x306a44(0x1a8)],_0x5849af);for(const _0x570d01 of _0x523e5c){const _0x3500fb=_0x48cf11?{..._0x570d01,'path':''+_0x48cf11+_0x570d01[_0x306a44(0x1c7)]}:_0x570d01;if(_0x3500fb[_0x306a44(0x1e7)]==='error')_0x114add['push'](_0x3500fb);else _0x4dabe6['push'](_0x3500fb);}}if(_0xefe251[_0x306a44(0x215)]){const _0x52346d=_0x2e71b0?.[_0x306a44(0x1b8)]?'goal':_0x48cf11+'goal',_0x4e0bf8=validateCriteria(_0xefe251[_0x306a44(0x215)],_0x52346d,_0x5849af);for(const _0x27d82e of _0x4e0bf8){if(_0x27d82e['level']===_0x306a44(0x1e3))_0x114add[_0x306a44(0x1f1)](_0x27d82e);else _0x4dabe6[_0x306a44(0x1f1)](_0x27d82e);}}}function extractVersionIndex(_0x4ef1d6){const _0x20d4c6=_0x4ef1d6['match'](/^journeys\[(\d+)\]\./);return _0x20d4c6?_0x20d4c6[0x1]:undefined;}function deduplicateAcrossVersions(_0x1c45bd){const _0xef5f39=a146_0x13e4,_0x262f9e=new Map();for(let _0x39bd16=0x0;_0x39bd16<_0x1c45bd[_0xef5f39(0x1a8)];_0x39bd16++){const _0x5bb11e=_0x1c45bd[_0x39bd16]['code']+':'+_0x1c45bd[_0x39bd16][_0xef5f39(0x1f9)],_0x50eb9a=extractVersionIndex(_0x1c45bd[_0x39bd16][_0xef5f39(0x1c7)]),_0x361b60=_0x262f9e['get'](_0x5bb11e);if(_0x361b60){_0x361b60['indices'][_0xef5f39(0x1f1)](_0x39bd16);if(_0x50eb9a)_0x361b60['versions'][_0xef5f39(0x1ef)](_0x50eb9a);}else _0x262f9e[_0xef5f39(0x1bc)](_0x5bb11e,{'indices':[_0x39bd16],'versions':new Set(_0x50eb9a?[_0x50eb9a]:[])});}const _0x17ca41=new Set();for(const {indices:_0x4e461d,versions:_0x47a45e}of _0x262f9e[_0xef5f39(0x1bb)]()){if(_0x47a45e[_0xef5f39(0x233)]<=0x1)continue;const _0x1d9fa6=_0x1c45bd[_0x4e461d[0x0]];_0x1d9fa6[_0xef5f39(0x1c7)]=_0x1d9fa6['path'][_0xef5f39(0x1db)](/^journeys\[\d+\]\./,''),_0x1d9fa6[_0xef5f39(0x1f9)]=_0x1d9fa6['message']+_0xef5f39(0x1c2)+_0x47a45e[_0xef5f39(0x233)]+'\x20versions)';for(let _0x2cccd8=0x1;_0x2cccd8<_0x4e461d['length'];_0x2cccd8++){_0x17ca41[_0xef5f39(0x1ef)](_0x4e461d[_0x2cccd8]);}}const _0x399967=[..._0x17ca41][_0xef5f39(0x1fb)]((_0x520356,_0x3f6a90)=>_0x3f6a90-_0x520356);for(const _0x19dfc3 of _0x399967){_0x1c45bd[_0xef5f39(0x1cc)](_0x19dfc3,0x1);}}export function validateJourneyDef(_0x3c4053,_0x525174={},_0x370478={}){const _0x10caad=a146_0x13e4;if(_0x370478[_0x10caad(0x20e)])return runJourneySemanticChecks(_0x3c4053,_0x525174);const _0x4f71c7=JourneyDefSchema[_0x10caad(0x231)](_0x3c4053);if(_0x4f71c7['success'])return runJourneySemanticChecks(_0x4f71c7[_0x10caad(0x23a)],_0x525174);return zodErrorsToJourneyValidationResult(_0x4f71c7[_0x10caad(0x1e3)],_0x525174);}function zodErrorsToJourneyValidationResult(_0x49e553,_0x7d0f41){const _0x12e0f1=a146_0x13e4,_0x2b9664=flattenZodIssues(_0x49e553[_0x12e0f1(0x21d)]),_0x779c40=_0x2b9664[_0x12e0f1(0x19d)](_0x249527=>{const _0xb4f947=_0x12e0f1,_0x2f2028=formatZodPath(_0x249527[_0xb4f947(0x1c7)]),_0x51a8d5=mapJourneyZodIssueToCode(_0x249527,_0x2f2028),_0x40d7b7=getLocationFromPath(_0x7d0f41[_0xb4f947(0x224)],_0x7d0f41['source'],_0x249527[_0xb4f947(0x1c7)][_0xb4f947(0x19d)](_0x4461fd=>typeof _0x4461fd===_0xb4f947(0x20a)?String(_0x4461fd):_0x4461fd));return{'level':_0xb4f947(0x1e3),'path':_0x2f2028,'code':_0x51a8d5,'message':_0x249527[_0xb4f947(0x1f9)],..._0x40d7b7&&{'location':_0x40d7b7}};});return{'valid':![],'errors':_0x779c40,'warnings':[]};}function mapJourneyZodIssueToCode(_0x4cdb8b,_0x22c939){const _0x3dfe90=a146_0x13e4;if(_0x22c939===_0x3dfe90(0x1c3))return'MISSING_NAME';if(_0x22c939['endsWith'](_0x3dfe90(0x239))&&_0x22c939[_0x3dfe90(0x22a)](_0x3dfe90(0x1c5)))return _0x3dfe90(0x200);if(_0x22c939===_0x3dfe90(0x18b)||_0x22c939[_0x3dfe90(0x1cf)](_0x3dfe90(0x222)))return _0x3dfe90(0x1d7);if(_0x22c939===''&&_0x4cdb8b[_0x3dfe90(0x1f9)][_0x3dfe90(0x22a)](_0x3dfe90(0x227)))return _0x3dfe90(0x1d7);if(_0x22c939['includes'](_0x3dfe90(0x1ec)))return _0x3dfe90(0x1c6);return _0x3dfe90(0x200);}function runJourneySemanticChecks(_0x144293,_0x2f0981){const _0x2f1a30=a146_0x13e4,_0x2a40b5=[],_0x3b1c00=[];(!_0x144293['name']||_0x144293[_0x2f1a30(0x1c3)]['trim']()==='')&&_0x2a40b5['push']({'level':_0x2f1a30(0x1e3),'path':_0x2f1a30(0x1c3),'code':_0x2f1a30(0x1de),'message':_0x2f1a30(0x1e8),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x2f1a30(0x1c3)])});const _0x1b7813=new Set();if(_0x144293[_0x2f1a30(0x1c8)])for(const _0xeedde3 of Object[_0x2f1a30(0x1ad)](_0x144293[_0x2f1a30(0x1c8)])){_0x1b7813[_0x2f1a30(0x1ef)](_0xeedde3);}const _0x4d9734=new Set();if(_0x144293['activations'])for(const _0x18e3a1 of Object[_0x2f1a30(0x1ad)](_0x144293[_0x2f1a30(0x225)])){_0x4d9734[_0x2f1a30(0x1ef)](_0x18e3a1);}const _0x159409=new Set(),_0x256978={..._0x2f0981,'embeddedSegments':_0x1b7813,'referencedSegments':_0x159409,'activationKeys':_0x4d9734['size']>0x0?_0x4d9734:undefined};if(_0x144293['segments'])for(const [_0x7e2442,_0x243a1e]of Object[_0x2f1a30(0x189)](_0x144293[_0x2f1a30(0x1c8)])){const _0x1999c0=validateEmbeddedSegment(_0x243a1e,_0x2f1a30(0x21c)+_0x7e2442,_0x256978);for(const _0x53acc6 of _0x1999c0){if(_0x53acc6[_0x2f1a30(0x1e7)]===_0x2f1a30(0x1e3))_0x2a40b5[_0x2f1a30(0x1f1)](_0x53acc6);else _0x3b1c00[_0x2f1a30(0x1f1)](_0x53acc6);}}const _0x29121b=!!_0x144293[_0x2f1a30(0x215)],_0x2f9d10=_0x144293[_0x2f1a30(0x208)]?.['every'](_0x1cf337=>!!_0x1cf337[_0x2f1a30(0x215)])??![];!_0x29121b&&!_0x2f9d10&&_0x3b1c00[_0x2f1a30(0x1f1)]({'level':_0x2f1a30(0x212),'path':_0x2f1a30(0x215),'code':_0x2f1a30(0x221),'message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x2f1a30(0x215)])});const _0xb902da=_0x144293['journeys']??_0x144293[_0x2f1a30(0x207)];if(_0xb902da&&_0xb902da[_0x2f1a30(0x18e)](_0x16f166=>_0x16f166[_0x2f1a30(0x21b)]===!![])[_0x2f1a30(0x1a8)]>0x1){const _0x134dd2=_0x144293[_0x2f1a30(0x208)]?_0x2f1a30(0x208):_0x2f1a30(0x207);_0x2a40b5[_0x2f1a30(0x1f1)]({'level':_0x2f1a30(0x1e3),'path':_0x134dd2,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x134dd2==='journeys'?'journey\x20entry':_0x2f1a30(0x1aa))+_0x2f1a30(0x1d2),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x134dd2])});}if(_0x144293['journeys']&&_0x144293[_0x2f1a30(0x208)][_0x2f1a30(0x1a8)]>0x0)for(let _0x481677=0x0;_0x481677<_0x144293[_0x2f1a30(0x208)]['length'];_0x481677++){const _0x20890c=_0x144293['journeys'][_0x481677];if(_0x144293['journeys'][_0x2f1a30(0x1a8)]>0x1&&_0x20890c[_0x2f1a30(0x1e2)]==='launched')continue;const _0x287788=_0x20890c['stages']||[],_0x53f4bd=_0x2f1a30(0x217)+_0x481677+'].',_0x100381=!!_0x20890c[_0x2f1a30(0x215)],_0x4f55b3=_0x100381?{..._0x144293,'goal':_0x20890c[_0x2f1a30(0x215)]}:_0x144293;validateStagesForVersion(_0x287788,_0x4f55b3,_0x256978,_0x53f4bd,_0x2a40b5,_0x3b1c00,{'goalIsInherited':!_0x100381});}else{if(_0x144293['versions']&&_0x144293[_0x2f1a30(0x207)]['length']>0x0)for(let _0x5a57ad=0x0;_0x5a57ad<_0x144293[_0x2f1a30(0x207)][_0x2f1a30(0x1a8)];_0x5a57ad++){const _0x522de6=_0x144293['versions'][_0x5a57ad];if(_0x144293[_0x2f1a30(0x207)][_0x2f1a30(0x1a8)]>0x1&&_0x522de6['state']===_0x2f1a30(0x19e))continue;const _0x3523ae=_0x522de6[_0x2f1a30(0x18b)]||[],_0x1c21b6='versions['+_0x5a57ad+'].';validateStagesForVersion(_0x3523ae,_0x144293,_0x256978,_0x1c21b6,_0x2a40b5,_0x3b1c00);}else{const _0x3c9fba=_0x144293[_0x2f1a30(0x18b)]||[];validateStagesForVersion(_0x3c9fba,_0x144293,_0x256978,'',_0x2a40b5,_0x3b1c00);}}_0x144293[_0x2f1a30(0x208)]&&_0x144293[_0x2f1a30(0x208)][_0x2f1a30(0x1a8)]>0x1&&(deduplicateAcrossVersions(_0x2a40b5),deduplicateAcrossVersions(_0x3b1c00));for(const _0x13cfc1 of _0x1b7813){!_0x159409['has'](_0x13cfc1)&&!_0x13cfc1['startsWith']('excluded_')&&_0x3b1c00['push']({'level':_0x2f1a30(0x212),'path':_0x2f1a30(0x21c)+_0x13cfc1,'code':_0x2f1a30(0x1ea),'message':_0x2f1a30(0x1b7)+_0x13cfc1+_0x2f1a30(0x220),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981['source'],[_0x2f1a30(0x1c8),_0x13cfc1])});}return{'valid':_0x2a40b5[_0x2f1a30(0x1a8)]===0x0,'errors':_0x2a40b5,'warnings':_0x3b1c00};}
1
+ (function(_0x2e7613,_0xebf8aa){const _0x2ef7dc=a146_0x5900,_0x145659=_0x2e7613();while(!![]){try{const _0x4a435f=parseInt(_0x2ef7dc(0x15f))/0x1*(parseInt(_0x2ef7dc(0x17c))/0x2)+parseInt(_0x2ef7dc(0x15a))/0x3+parseInt(_0x2ef7dc(0x1ae))/0x4*(parseInt(_0x2ef7dc(0x104))/0x5)+-parseInt(_0x2ef7dc(0x132))/0x6*(parseInt(_0x2ef7dc(0x188))/0x7)+parseInt(_0x2ef7dc(0x10e))/0x8+-parseInt(_0x2ef7dc(0x110))/0x9+-parseInt(_0x2ef7dc(0x17e))/0xa;if(_0x4a435f===_0xebf8aa)break;else _0x145659['push'](_0x145659['shift']());}catch(_0x3823aa){_0x145659['push'](_0x145659['shift']());}}}(a146_0x56e2,0x923f7));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x49dbf5,_0x1ed018,_0x40bef4,_0xecbcf2,_0x3667f8,_0x556f9f){const _0x1f1c7c=a146_0x5900;return{'level':_0x49dbf5,'path':_0x1ed018,'code':_0x40bef4,'message':_0xecbcf2,'location':getLocationFromPath(_0x3667f8[_0x1f1c7c(0x163)],_0x3667f8[_0x1f1c7c(0x175)],pathToArray(_0x556f9f??_0x1ed018))};}function validateVersionStructure(_0x372fef,_0x47699b){const _0x4bbe09=a146_0x5900,_0x4c5219=[];return _0x372fef[_0x4bbe09(0x166)]>MAX_STAGES&&_0x4c5219['push'](createIssue('error','stages',_0x4bbe09(0x100),_0x4bbe09(0x186)+_0x372fef[_0x4bbe09(0x166)]+_0x4bbe09(0x157)+MAX_STAGES,_0x47699b)),_0x4c5219;}function validateStageStructure(_0x2f4a0b,_0x2f4633,_0x26888b,_0x3fc2f3){const _0x58a12c=a146_0x5900,_0x2db63b=[],_0x26e991=_0x58a12c(0x19c)+_0x2f4633+']';_0x2f4633===0x0&&!_0x2f4a0b[_0x58a12c(0x129)]&&_0x2db63b[_0x58a12c(0x18c)](createIssue(_0x58a12c(0x155),_0x26e991+'.entry_criteria',_0x58a12c(0x145),_0x58a12c(0x17d)+_0x2f4a0b['name']+_0x58a12c(0x10b),_0x3fc2f3,_0x26e991));const _0x453588=_0x2f4633===_0x26888b-0x1;!_0x453588&&!_0x2f4a0b['milestone']&&_0x2db63b[_0x58a12c(0x18c)](createIssue(_0x58a12c(0x155),_0x26e991+_0x58a12c(0x1a5),'MISSING_MILESTONE',_0x58a12c(0x17d)+_0x2f4a0b['name']+_0x58a12c(0x1af),_0x3fc2f3,_0x26e991));(!_0x2f4a0b['exit_criteria']||_0x2f4a0b['exit_criteria']['length']===0x0)&&_0x2db63b[_0x58a12c(0x18c)](createIssue('warning',_0x26e991+_0x58a12c(0x181),_0x58a12c(0x119),_0x58a12c(0x17d)+_0x2f4a0b[_0x58a12c(0x11b)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x3fc2f3,_0x26e991));const _0x162e7a=_0x2f4a0b['steps']?.['length']??0x0;if(_0x162e7a===0x0)_0x2db63b[_0x58a12c(0x18c)](createIssue('error',_0x26e991+_0x58a12c(0x12c),'INSUFFICIENT_STEPS',_0x58a12c(0x17d)+_0x2f4a0b['name']+_0x58a12c(0x127),_0x3fc2f3,_0x26e991+'.steps'));else{if(_0x162e7a===0x1)_0x2db63b[_0x58a12c(0x18c)](createIssue('warning',_0x26e991+_0x58a12c(0x12c),'INSUFFICIENT_STEPS',_0x58a12c(0x17d)+_0x2f4a0b[_0x58a12c(0x11b)]+_0x58a12c(0x1b3),_0x3fc2f3,_0x26e991+'.steps'));else _0x162e7a<=0x3&&_0x2db63b[_0x58a12c(0x18c)](createIssue(_0x58a12c(0x177),_0x26e991+_0x58a12c(0x12c),_0x58a12c(0xf9),'Stage\x20\x27'+_0x2f4a0b[_0x58a12c(0x11b)]+_0x58a12c(0x102)+_0x162e7a+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x3fc2f3,_0x26e991+_0x58a12c(0x12c)));}return _0x2db63b;}function validateStep(_0x1591d6,_0x75c119,_0x82df24,_0x112d60){const _0x501ce8=a146_0x5900,_0x1f9589=[];if(_0x1591d6[_0x501ce8(0x193)]===_0x501ce8(0x180))return _0x1591d6[_0x501ce8(0x19f)]&&_0x1f9589[_0x501ce8(0x18c)](createIssue(_0x501ce8(0x155),_0x75c119+'.next',_0x501ce8(0x14d),'End\x20step\x20\x27'+_0x1591d6[_0x501ce8(0x11b)]+_0x501ce8(0x107),_0x82df24)),_0x501ce8(0x116)in _0x1591d6&&_0x1591d6[_0x501ce8(0x116)]!==undefined&&_0x1f9589[_0x501ce8(0x18c)](createIssue(_0x501ce8(0x155),_0x75c119+_0x501ce8(0x124),'END_STEP_HAS_NEXT_OR_WITH',_0x501ce8(0x139)+_0x1591d6[_0x501ce8(0x11b)]+'\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',_0x82df24)),_0x1f9589;_0x1591d6[_0x501ce8(0x19f)]&&(_0x82df24[_0x501ce8(0x19d)]&&!_0x82df24[_0x501ce8(0x19d)]['has'](_0x1591d6[_0x501ce8(0x19f)])&&_0x1f9589[_0x501ce8(0x18c)](createIssue('error',_0x75c119+_0x501ce8(0x1a9),_0x501ce8(0x187),_0x501ce8(0x14a)+_0x1591d6[_0x501ce8(0x19f)]+'\x27',_0x82df24)));switch(_0x1591d6['type']){case'wait':_0x1f9589[_0x501ce8(0x18c)](...validateWaitStep(_0x1591d6,_0x75c119,_0x82df24,_0x112d60));break;case'activation':_0x1f9589['push'](...validateActivationStep(_0x1591d6,_0x75c119,_0x82df24));break;case'decision_point':_0x1f9589[_0x501ce8(0x18c)](...validateDecisionPointStep(_0x1591d6,_0x75c119,_0x82df24,_0x112d60));break;case _0x501ce8(0x158):_0x1f9589[_0x501ce8(0x18c)](...validateAbTestStep(_0x1591d6,_0x75c119,_0x82df24,_0x112d60));break;case _0x501ce8(0x16f):_0x1f9589[_0x501ce8(0x18c)](...validateJumpStep(_0x1591d6,_0x75c119,_0x82df24));break;}return _0x1f9589;}function validateWaitStep(_0x4ca968,_0x15cca0,_0x1919f4,_0x453dad){const _0x121c3a=a146_0x5900,_0x467253=[];if(!_0x4ca968[_0x121c3a(0x116)])return _0x467253[_0x121c3a(0x18c)](createIssue(_0x121c3a(0x155),_0x15cca0+_0x121c3a(0x124),_0x121c3a(0x179),_0x121c3a(0x14b),_0x1919f4,_0x15cca0)),_0x467253;if(_0x4ca968[_0x121c3a(0x116)][_0x121c3a(0x161)]){const _0x4575f4=_0x4ca968[_0x121c3a(0x116)][_0x121c3a(0x161)];if(_0x4575f4[_0x121c3a(0x1b0)]){_0x1919f4[_0x121c3a(0xfe)]?.[_0x121c3a(0x1a2)](_0x4575f4[_0x121c3a(0x1b0)]);!_0x4575f4['segment']['startsWith'](_0x121c3a(0x173))&&(_0x1919f4[_0x121c3a(0x18f)]&&!_0x1919f4[_0x121c3a(0x18f)][_0x121c3a(0x115)](_0x4575f4['segment'])&&_0x467253[_0x121c3a(0x18c)](createIssue(_0x121c3a(0x155),_0x15cca0+_0x121c3a(0x190),_0x121c3a(0x128),'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x4575f4[_0x121c3a(0x1b0)]+_0x121c3a(0x1b2),_0x1919f4)));_0x4575f4['next']&&_0x1919f4[_0x121c3a(0x19d)]&&!_0x1919f4[_0x121c3a(0x19d)][_0x121c3a(0x115)](_0x4575f4[_0x121c3a(0x19f)])&&_0x467253[_0x121c3a(0x18c)](createIssue(_0x121c3a(0x155),_0x15cca0+_0x121c3a(0x178),_0x121c3a(0x187),_0x121c3a(0x150)+_0x4575f4['next']+'\x27',_0x1919f4));_0x4575f4[_0x121c3a(0x1ac)]?.[_0x121c3a(0x19f)]&&_0x1919f4['stepNames']&&!_0x1919f4[_0x121c3a(0x19d)]['has'](_0x4575f4[_0x121c3a(0x1ac)][_0x121c3a(0x19f)])&&_0x467253[_0x121c3a(0x18c)](createIssue(_0x121c3a(0x155),_0x15cca0+_0x121c3a(0x198),_0x121c3a(0x187),_0x121c3a(0x1a0)+_0x4575f4[_0x121c3a(0x1ac)]['next']+'\x27',_0x1919f4));const _0x482fdd=_0x4575f4[_0x121c3a(0x19f)]||_0x4ca968[_0x121c3a(0x19f)],_0x557457=_0x4575f4[_0x121c3a(0x1ac)]?.[_0x121c3a(0x19f)]||_0x4ca968[_0x121c3a(0x19f)];if(_0x482fdd){const _0x5d8cea=_0x453dad['get'](_0x482fdd);_0x5d8cea?.[_0x121c3a(0x193)]===_0x121c3a(0x192)&&_0x467253[_0x121c3a(0x18c)](createIssue(_0x121c3a(0x177),_0x15cca0+_0x121c3a(0x178),_0x121c3a(0x120),_0x121c3a(0x133)+_0x482fdd+_0x121c3a(0x13b),_0x1919f4,_0x15cca0+'.with.condition'));}if(_0x557457){const _0x208cce=_0x453dad[_0x121c3a(0x11f)](_0x557457);_0x208cce?.[_0x121c3a(0x193)]===_0x121c3a(0x192)&&_0x467253[_0x121c3a(0x18c)](createIssue(_0x121c3a(0x177),_0x15cca0+_0x121c3a(0x198),_0x121c3a(0x120),_0x121c3a(0x121)+_0x557457+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x1919f4,_0x15cca0+'.with.condition.timeout'));}}}return _0x467253;}function validateActivationStep(_0x46dbc3,_0x130287,_0x5d6bd1){const _0x2771f4=a146_0x5900,_0x34b3da=[];if(!_0x46dbc3[_0x2771f4(0x116)]?.[_0x2771f4(0x17b)])return _0x34b3da['push'](createIssue(_0x2771f4(0x155),_0x130287+'.with.activation',_0x2771f4(0x11c),_0x2771f4(0xfb),_0x5d6bd1,_0x130287)),_0x34b3da;const _0x27f0e0=_0x46dbc3[_0x2771f4(0x116)][_0x2771f4(0x17b)];return _0x5d6bd1[_0x2771f4(0x12f)]&&!_0x27f0e0[_0x2771f4(0x13a)](_0x2771f4(0x173))&&(!_0x5d6bd1[_0x2771f4(0x12f)]['has'](_0x27f0e0)&&_0x34b3da[_0x2771f4(0x18c)](createIssue(_0x2771f4(0x155),_0x130287+_0x2771f4(0x136),'MISSING_ACTIVATION_DEFINITION',_0x2771f4(0x11a)+_0x27f0e0+_0x2771f4(0xfd),_0x5d6bd1))),_0x34b3da;}function validateDecisionPointStep(_0x235bbf,_0x57887a,_0x600488,_0x5e60a7){const _0xacc452=a146_0x5900,_0x1ec4ea=[];if(!_0x235bbf[_0xacc452(0x116)]?.['branches']||_0x235bbf[_0xacc452(0x116)][_0xacc452(0x17a)][_0xacc452(0x166)]===0x0)return _0x1ec4ea[_0xacc452(0x18c)](createIssue(_0xacc452(0x155),_0x57887a+_0xacc452(0x189),'MISSING_CONDITIONS','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x600488,_0x57887a)),_0x1ec4ea;for(let _0x393b48=0x0;_0x393b48<_0x235bbf[_0xacc452(0x116)]['branches'][_0xacc452(0x166)];_0x393b48++){const _0x25f083=_0x235bbf[_0xacc452(0x116)][_0xacc452(0x17a)][_0x393b48],_0x2f5b5c=_0x57887a+_0xacc452(0x10d)+_0x393b48+']';_0x25f083[_0xacc452(0x1b0)]&&!_0x25f083[_0xacc452(0x14c)]&&(_0x600488[_0xacc452(0xfe)]?.[_0xacc452(0x1a2)](_0x25f083[_0xacc452(0x1b0)]),!_0x25f083[_0xacc452(0x1b0)]['startsWith'](_0xacc452(0x173))&&(_0x600488['embeddedSegments']&&!_0x600488[_0xacc452(0x18f)][_0xacc452(0x115)](_0x25f083[_0xacc452(0x1b0)])&&_0x1ec4ea[_0xacc452(0x18c)](createIssue(_0xacc452(0x155),_0x2f5b5c+'.segment','MISSING_SEGMENT_REFERENCE',_0xacc452(0x10c)+_0x25f083[_0xacc452(0x1b0)]+'\x27',_0x600488))));_0x25f083[_0xacc452(0x19f)]&&_0x600488[_0xacc452(0x19d)]&&!_0x600488[_0xacc452(0x19d)][_0xacc452(0x115)](_0x25f083[_0xacc452(0x19f)])&&_0x1ec4ea[_0xacc452(0x18c)](createIssue(_0xacc452(0x155),_0x2f5b5c+_0xacc452(0x1a9),_0xacc452(0x187),_0xacc452(0x196)+_0x25f083['next']+'\x27',_0x600488));if(_0x25f083[_0xacc452(0x19f)]){const _0x5426b2=_0x5e60a7[_0xacc452(0x11f)](_0x25f083['next']);_0x5426b2?.[_0xacc452(0x193)]===_0xacc452(0x192)&&_0x1ec4ea['push'](createIssue(_0xacc452(0x177),_0x2f5b5c+_0xacc452(0x1a9),'BRANCH_DIRECTLY_TO_MERGE',_0xacc452(0x153)+_0x25f083[_0xacc452(0x11b)]+_0xacc452(0x169)+_0x25f083['next']+_0xacc452(0x191),_0x600488));}}return _0x1ec4ea;}function validateAbTestStep(_0x21406c,_0x12f86e,_0x1a24b9,_0x12731f){const _0x5cdc47=a146_0x5900,_0x19191=[];if(!_0x21406c[_0x5cdc47(0x116)]?.[_0x5cdc47(0x130)]||_0x21406c['with'][_0x5cdc47(0x130)][_0x5cdc47(0x166)]===0x0)return _0x19191[_0x5cdc47(0x18c)](createIssue('error',_0x12f86e+_0x5cdc47(0x15d),_0x5cdc47(0x168),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x1a24b9,_0x12f86e)),_0x19191;const _0x473433=_0x21406c[_0x5cdc47(0x116)][_0x5cdc47(0x130)][_0x5cdc47(0x174)]((_0x1ca178,_0x4b6678)=>_0x1ca178+(_0x4b6678[_0x5cdc47(0x141)]||0x0),0x0);Math['abs'](_0x473433-0x64)>0.01&&_0x19191[_0x5cdc47(0x18c)](createIssue(_0x5cdc47(0x155),_0x12f86e+_0x5cdc47(0x15d),_0x5cdc47(0x1b1),_0x5cdc47(0x194)+_0x473433+'%)',_0x1a24b9));for(let _0x2e134f=0x0;_0x2e134f<_0x21406c['with'][_0x5cdc47(0x130)][_0x5cdc47(0x166)];_0x2e134f++){const _0x4eb0b4=_0x21406c[_0x5cdc47(0x116)][_0x5cdc47(0x130)][_0x2e134f],_0x40bdbf=_0x12f86e+'.with.variants['+_0x2e134f+']';_0x4eb0b4[_0x5cdc47(0x19f)]&&_0x1a24b9['stepNames']&&!_0x1a24b9[_0x5cdc47(0x19d)][_0x5cdc47(0x115)](_0x4eb0b4[_0x5cdc47(0x19f)])&&_0x19191['push'](createIssue(_0x5cdc47(0x155),_0x40bdbf+_0x5cdc47(0x1a9),'INVALID_NEXT_REFERENCE',_0x5cdc47(0x14f)+_0x4eb0b4['next']+'\x27',_0x1a24b9));if(_0x4eb0b4[_0x5cdc47(0x19f)]){const _0x18e9ed=_0x12731f[_0x5cdc47(0x11f)](_0x4eb0b4[_0x5cdc47(0x19f)]);_0x18e9ed?.[_0x5cdc47(0x193)]===_0x5cdc47(0x192)&&_0x19191[_0x5cdc47(0x18c)](createIssue(_0x5cdc47(0x177),_0x40bdbf+_0x5cdc47(0x1a9),_0x5cdc47(0x120),_0x5cdc47(0x118)+_0x4eb0b4[_0x5cdc47(0x11b)]+_0x5cdc47(0x169)+_0x4eb0b4[_0x5cdc47(0x19f)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x1a24b9));}}return _0x19191;}function validateJumpStep(_0x46fc77,_0x357070,_0x592cfb){const _0x4a2f2d=a146_0x5900,_0x16354f=[];if(!_0x46fc77['with']?.['target'])return _0x16354f[_0x4a2f2d(0x18c)](createIssue(_0x4a2f2d(0x155),_0x357070+_0x4a2f2d(0x137),_0x4a2f2d(0x18b),_0x4a2f2d(0x184),_0x592cfb,_0x357070)),_0x16354f;return(!_0x46fc77[_0x4a2f2d(0x116)][_0x4a2f2d(0x1a3)][_0x4a2f2d(0x1a8)]||!_0x46fc77[_0x4a2f2d(0x116)][_0x4a2f2d(0x1a3)]['stage'])&&_0x16354f['push'](createIssue('error',_0x357070+'.with.target',_0x4a2f2d(0x18b),_0x4a2f2d(0xfa),_0x592cfb)),_0x16354f;}function buildConvergenceMap(_0x403016){const _0x44a95c=a146_0x5900,_0x582c72=new Map();function _0x123e95(_0x3203aa,_0x2acc1e){const _0x20565c=a146_0x5900,_0x1cdfea=_0x582c72[_0x20565c(0x11f)](_0x3203aa)||[];_0x1cdfea[_0x20565c(0x18c)](_0x2acc1e),_0x582c72['set'](_0x3203aa,_0x1cdfea);}for(const _0x1a3c4b of _0x403016){_0x1a3c4b[_0x44a95c(0x19f)]&&_0x123e95(_0x1a3c4b[_0x44a95c(0x19f)],{'stepName':_0x1a3c4b[_0x44a95c(0x11b)],'description':_0x44a95c(0x13f)+_0x1a3c4b['name']+'\x27'});if(_0x1a3c4b[_0x44a95c(0x193)]===_0x44a95c(0x109)&&_0x1a3c4b[_0x44a95c(0x116)]?.[_0x44a95c(0x17a)])for(const _0x5aaeeb of _0x1a3c4b['with'][_0x44a95c(0x17a)]){_0x5aaeeb[_0x44a95c(0x19f)]&&_0x123e95(_0x5aaeeb[_0x44a95c(0x19f)],{'stepName':_0x1a3c4b[_0x44a95c(0x11b)],'description':'branch\x20\x27'+_0x5aaeeb[_0x44a95c(0x11b)]+_0x44a95c(0x151)+_0x1a3c4b[_0x44a95c(0x11b)]+'\x27'});}if(_0x1a3c4b[_0x44a95c(0x193)]===_0x44a95c(0x158)&&_0x1a3c4b['with']?.['variants'])for(const _0x3129de of _0x1a3c4b[_0x44a95c(0x116)][_0x44a95c(0x130)]){_0x3129de[_0x44a95c(0x19f)]&&_0x123e95(_0x3129de[_0x44a95c(0x19f)],{'stepName':_0x1a3c4b[_0x44a95c(0x11b)],'description':'variant\x20\x27'+_0x3129de[_0x44a95c(0x11b)]+_0x44a95c(0x151)+_0x1a3c4b[_0x44a95c(0x11b)]+'\x27'});}_0x1a3c4b['type']===_0x44a95c(0x108)&&_0x1a3c4b[_0x44a95c(0x116)]?.['condition']&&(_0x1a3c4b[_0x44a95c(0x116)][_0x44a95c(0x161)]['next']&&_0x123e95(_0x1a3c4b[_0x44a95c(0x116)]['condition']['next'],{'stepName':_0x1a3c4b[_0x44a95c(0x11b)],'description':_0x44a95c(0x16d)+_0x1a3c4b[_0x44a95c(0x11b)]+'\x27'}),_0x1a3c4b['with'][_0x44a95c(0x161)][_0x44a95c(0x1ac)]?.[_0x44a95c(0x19f)]&&_0x123e95(_0x1a3c4b[_0x44a95c(0x116)][_0x44a95c(0x161)][_0x44a95c(0x1ac)]['next'],{'stepName':_0x1a3c4b[_0x44a95c(0x11b)],'description':_0x44a95c(0x165)+_0x1a3c4b[_0x44a95c(0x11b)]+'\x27'}));}return _0x582c72;}function validateFlowControl(_0xb00446,_0x37f7b0,_0x3c8016){const _0x516e8d=a146_0x5900,_0x48f6e4=[],_0x59806e='stages['+_0x37f7b0+']',_0x580eab=_0xb00446[_0x516e8d(0x144)]||[];if(_0x580eab[_0x516e8d(0x166)]===0x0)return _0x48f6e4;const _0xaec813=new Map();for(const _0x51e72e of _0x580eab){_0x51e72e[_0x516e8d(0x11b)]&&_0xaec813[_0x516e8d(0x15e)](_0x51e72e['name'],_0x51e72e);}const _0x419bcc=buildConvergenceMap(_0x580eab),_0x520993=_0x580eab[_0x516e8d(0x1aa)](_0xd55ec=>_0xd55ec[_0x516e8d(0x193)]===_0x516e8d(0x180));!_0x520993&&_0x48f6e4[_0x516e8d(0x18c)](createIssue(_0x516e8d(0x155),_0x59806e+_0x516e8d(0x12c),_0x516e8d(0x146),_0x516e8d(0x17d)+_0xb00446[_0x516e8d(0x11b)]+_0x516e8d(0x16a),_0x3c8016));for(const [_0x3bf208,_0x31b08f]of _0x419bcc){const _0x488aa0=_0xaec813[_0x516e8d(0x11f)](_0x3bf208);if(!_0x488aa0)continue;if(_0x31b08f[_0x516e8d(0x166)]>0x1&&_0x488aa0[_0x516e8d(0x193)]!==_0x516e8d(0x192)){const _0xccfb21=_0x31b08f['map'](_0x5381da=>_0x5381da['description'])[_0x516e8d(0x172)](',\x20');_0x48f6e4['push'](createIssue('error',_0x59806e+_0x516e8d(0x12c),_0x516e8d(0x159),_0x516e8d(0x10a)+_0x3bf208+_0x516e8d(0x185)+_0xccfb21+_0x516e8d(0x131),_0x3c8016));}_0x31b08f[_0x516e8d(0x166)]===0x1&&_0x488aa0[_0x516e8d(0x193)]==='merge'&&_0x48f6e4[_0x516e8d(0x18c)](createIssue(_0x516e8d(0x177),_0x59806e+_0x516e8d(0x12c),_0x516e8d(0x18a),_0x516e8d(0x176)+_0x3bf208+_0x516e8d(0xfc)+_0x31b08f[0x0]['description']+').\x20Merge\x20is\x20unnecessary.',_0x3c8016));}for(const _0x43f94e of _0x580eab){if(_0x43f94e[_0x516e8d(0x193)]===_0x516e8d(0x192)&&_0x43f94e[_0x516e8d(0x19f)]){const _0x3d9f8c=_0xaec813[_0x516e8d(0x11f)](_0x43f94e[_0x516e8d(0x19f)]);_0x3d9f8c?.['type']===_0x516e8d(0x192)&&_0x48f6e4[_0x516e8d(0x18c)](createIssue('error',_0x59806e+_0x516e8d(0x12c),_0x516e8d(0x197),_0x516e8d(0x176)+_0x43f94e[_0x516e8d(0x11b)]+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x43f94e[_0x516e8d(0x19f)]+_0x516e8d(0x148),_0x3c8016));}}return _0x48f6e4;}function validateCriteria(_0x551af3,_0x2c2c82,_0x2f492c){const _0x555ba0=a146_0x5900,_0x42ca01=[];return _0x551af3[_0x555ba0(0x1b0)]&&(_0x2f492c[_0x555ba0(0xfe)]?.[_0x555ba0(0x1a2)](_0x551af3[_0x555ba0(0x1b0)]),!_0x551af3[_0x555ba0(0x1b0)][_0x555ba0(0x13a)](_0x555ba0(0x173))&&(_0x2f492c[_0x555ba0(0x18f)]&&!_0x2f492c[_0x555ba0(0x18f)]['has'](_0x551af3['segment'])&&_0x42ca01[_0x555ba0(0x18c)](createIssue(_0x555ba0(0x155),_0x2c2c82+_0x555ba0(0x142),_0x555ba0(0x128),'Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x551af3[_0x555ba0(0x1b0)]+'\x27',_0x2f492c)))),_0x42ca01;}function validateEmbeddedSegment(_0x4180d9,_0x58d573,_0x2ab01f){const _0x3be8b5=a146_0x5900,_0x2fa493=[];return _0x4180d9[_0x3be8b5(0x11d)]&&_0x2fa493[_0x3be8b5(0x18c)](...validateRuleDef(_0x4180d9[_0x3be8b5(0x11d)],_0x58d573+_0x3be8b5(0x105),_0x2ab01f)),_0x2fa493;}function validateStage(_0x154d16,_0xcebccc,_0x755ae2,_0x43407e){const _0x111839=a146_0x5900,_0x10ccbe=[],_0x25ce8e=_0x111839(0x19c)+_0xcebccc+']',_0x3f73b7=new Map(),_0x1e4c06=new Map();if(_0x154d16[_0x111839(0x144)]){for(let _0x145260=0x0;_0x145260<_0x154d16[_0x111839(0x144)][_0x111839(0x166)];_0x145260++){const _0x2df79c=_0x154d16[_0x111839(0x144)][_0x145260];_0x2df79c[_0x111839(0x11b)]&&_0x3f73b7['set'](_0x2df79c[_0x111839(0x11b)],_0x2df79c);}for(let _0x4fafba=0x0;_0x4fafba<_0x154d16[_0x111839(0x144)]['length'];_0x4fafba++){const _0x2dc1b9=_0x154d16[_0x111839(0x144)][_0x4fafba],_0x249ab9=_0x25ce8e+_0x111839(0x112)+_0x4fafba+']';if(_0x2dc1b9[_0x111839(0x11b)]){if(_0x1e4c06[_0x111839(0x115)](_0x2dc1b9['name'])){const _0x18bf54=_0x1e4c06[_0x111839(0x11f)](_0x2dc1b9[_0x111839(0x11b)]);_0x10ccbe[_0x111839(0x18c)](createIssue('error',_0x249ab9+_0x111839(0x19e),_0x111839(0x13d),_0x111839(0x12e)+_0x2dc1b9['name']+_0x111839(0x134)+_0x18bf54+'])',_0x43407e));}else _0x1e4c06[_0x111839(0x15e)](_0x2dc1b9[_0x111839(0x11b)],_0x4fafba);}_0x10ccbe[_0x111839(0x18c)](...validateStep(_0x2dc1b9,_0x249ab9,_0x43407e,_0x3f73b7));}}_0x154d16['entry_criteria']&&_0x10ccbe[_0x111839(0x18c)](...validateCriteria(_0x154d16[_0x111839(0x129)],_0x25ce8e+'.entry_criteria',_0x43407e));if(_0x154d16[_0x111839(0x125)])for(let _0x2cb77d=0x0;_0x2cb77d<_0x154d16[_0x111839(0x125)][_0x111839(0x166)];_0x2cb77d++){_0x10ccbe['push'](...validateCriteria(_0x154d16[_0x111839(0x125)][_0x2cb77d],_0x25ce8e+'.exit_criteria['+_0x2cb77d+']',_0x43407e));}return _0x154d16[_0x111839(0x17f)]&&_0x10ccbe['push'](...validateCriteria(_0x154d16['milestone'],_0x25ce8e+_0x111839(0x1a5),_0x43407e)),_0x10ccbe['push'](...validateStageStructure(_0x154d16,_0xcebccc,_0x755ae2,_0x43407e)),_0x10ccbe[_0x111839(0x18c)](...validateFlowControl(_0x154d16,_0xcebccc,_0x43407e)),_0x10ccbe;}function validateStagesForVersion(_0x5d9b32,_0x9390c5,_0x4ebc97,_0x3be264,_0x282d1c,_0x4a3054,_0xf53aa5){const _0x1d4b06=a146_0x5900;if(_0x5d9b32[_0x1d4b06(0x166)]===0x0){_0x282d1c[_0x1d4b06(0x18c)]({'level':_0x1d4b06(0x155),'path':_0x3be264+_0x1d4b06(0x170),'code':_0x1d4b06(0x149),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x4ebc97[_0x1d4b06(0x163)],_0x4ebc97['source'],[_0x1d4b06(0x170)])});return;}const _0x2a3992=new Set();for(const _0x23ee8c of _0x5d9b32){if(_0x23ee8c[_0x1d4b06(0x144)])for(const _0x38d0e5 of _0x23ee8c[_0x1d4b06(0x144)]){_0x38d0e5['name']&&_0x2a3992[_0x1d4b06(0x1a2)](_0x38d0e5[_0x1d4b06(0x11b)]);}}const _0x226189={..._0x4ebc97,'stepNames':_0x2a3992},_0x834c37=validateVersionStructure(_0x5d9b32,_0x226189);for(const _0x3cf258 of _0x834c37){const _0x28ac68=_0x3be264?{..._0x3cf258,'path':''+_0x3be264+_0x3cf258['path']}:_0x3cf258;if(_0x28ac68[_0x1d4b06(0x14e)]==='error')_0x282d1c[_0x1d4b06(0x18c)](_0x28ac68);else _0x4a3054['push'](_0x28ac68);}for(let _0x23343c=0x0;_0x23343c<_0x5d9b32['length'];_0x23343c++){const _0x324c48=validateStage(_0x5d9b32[_0x23343c],_0x23343c,_0x5d9b32['length'],_0x226189);for(const _0x27d1ea of _0x324c48){const _0x5b7ab0=_0x3be264?{..._0x27d1ea,'path':''+_0x3be264+_0x27d1ea['path']}:_0x27d1ea;if(_0x5b7ab0[_0x1d4b06(0x14e)]===_0x1d4b06(0x155))_0x282d1c['push'](_0x5b7ab0);else _0x4a3054[_0x1d4b06(0x18c)](_0x5b7ab0);}}if(_0x9390c5['goal']){const _0x19ec9a=_0xf53aa5?.[_0x1d4b06(0x154)]?_0x1d4b06(0x12d):_0x3be264+_0x1d4b06(0x12d),_0x53096f=validateCriteria(_0x9390c5[_0x1d4b06(0x12d)],_0x19ec9a,_0x226189);for(const _0x32ce6c of _0x53096f){if(_0x32ce6c[_0x1d4b06(0x14e)]===_0x1d4b06(0x155))_0x282d1c[_0x1d4b06(0x18c)](_0x32ce6c);else _0x4a3054[_0x1d4b06(0x18c)](_0x32ce6c);}}}function a146_0x56e2(){const _0x6be5e0=['activation','601958PFlWWs','Stage\x20\x27','11779280ZFFUNw','milestone','end','.exit_criteria','excluded_','includes','Jump\x20step\x20requires\x20a\x20target','\x27\x20(from:\x20','Journey\x20has\x20','INVALID_NEXT_REFERENCE','706055kogQRz','.with.branches','SINGLE_INPUT_MERGE','INVALID_JUMP_TARGET','push','versions','sort','embeddedSegments','.with.condition.segment','\x27\x20with\x20no\x20action\x20in\x20between','merge','type','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','journey\x20entry','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','MERGE_TO_MERGE_CHAIN','.with.condition.timeout.next','path','\x20with\x20latest:\x20true','success','stages[','stepNames','.name','next','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','replace','add','target','code','.milestone','data','keys','journey','.next','some','symbol','timeout','ACTIVATION_SCHEMA_ERROR','16232eynWsv','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','segment','INVALID_AB_TEST_PERCENTAGES','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','FEW_STEPS','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','Activation\x20step\x20requires\x20an\x20activation\x20reference','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','referencedSegments','latest','TOO_MANY_STAGES','issues','\x27\x20has\x20only\x20','MISSING_GOAL','995nzFUWc','.rule','versions[','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','wait','decision_point','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','.with.branches[','8704872UilHzX','journeys[','4043286zBfxuk','\x20versions)','.steps[','journeys,\x20stages,\x20or\x20versions','filter','has','with','.stages','A/B\x20test\x20variant\x20\x27','MISSING_EXIT_CRITERIA','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','name','MISSING_ACTIVATION_REF','rule','values','get','BRANCH_DIRECTLY_TO_MERGE','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','endsWith','DUPLICATE_LATEST','.with','exit_criteria','MISSING_NAME','\x27\x20has\x20no\x20steps','MISSING_SEGMENT_REFERENCE','entry_criteria','version','launched','.steps','goal','Duplicate\x20step\x20name\x20\x27','activationKeys','variants',').\x20Use\x20a\x20merge\x20step.','42xYtzQS','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20(first\x20defined\x20at\x20steps[','map','.with.activation','.with.target','segments.','End\x20step\x20\x27','startsWith','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','Journey\x20has\x20no\x20goal\x20defined','DUPLICATE_STEP_NAME','Journey\x20can\x20have\x20at\x20most\x20one\x20','step\x20\x27','splice','percentage','.segment','safeParse','steps','MISSING_ENTRY_CRITERIA','MISSING_END_STEP','message','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','MISSING_STAGES','Step\x20references\x20non-existent\x20step\x20\x27','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','excluded','END_STEP_HAS_NEXT_OR_WITH','level','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','\x27\x20of\x20\x27','journeys','Decision\x20branch\x20\x27','goalIsInherited','error','Journey\x20name\x20is\x20required','\x20stages\x20but\x20maximum\x20is\x20','ab_test','CONVERGENCE_WITHOUT_MERGE','401040Ybdozo','segments','state','.with.variants','set','3TAjqlD','size','condition','match','document','.type','timeout\x20of\x20\x27','length','trim','MISSING_CONDITIONS','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20has\x20no\x20end\x20step','indices','Embedded\x20segment\x20\x27','condition\x20of\x20\x27','\x20(across\x20','jump','stages','JOURNEY_SCHEMA_ERROR','join','ref:','reduce','source','Merge\x20step\x20\x27','warning','.with.condition.next','MISSING_WAIT_PARAMS','branches'];a146_0x56e2=function(){return _0x6be5e0;};return a146_0x56e2();}function extractVersionIndex(_0x314adb){const _0xfa69ba=a146_0x5900,_0x34b7a9=_0x314adb[_0xfa69ba(0x162)](/^journeys\[(\d+)\]\./);return _0x34b7a9?_0x34b7a9[0x1]:undefined;}function deduplicateAcrossVersions(_0x1a8f4d){const _0x249e42=a146_0x5900,_0x1bbae=new Map();for(let _0x2e1a31=0x0;_0x2e1a31<_0x1a8f4d[_0x249e42(0x166)];_0x2e1a31++){const _0x31c462=_0x1a8f4d[_0x2e1a31][_0x249e42(0x1a4)]+':'+_0x1a8f4d[_0x2e1a31][_0x249e42(0x147)],_0x47659d=extractVersionIndex(_0x1a8f4d[_0x2e1a31][_0x249e42(0x199)]),_0x1dc73b=_0x1bbae[_0x249e42(0x11f)](_0x31c462);if(_0x1dc73b){_0x1dc73b[_0x249e42(0x16b)][_0x249e42(0x18c)](_0x2e1a31);if(_0x47659d)_0x1dc73b[_0x249e42(0x18d)][_0x249e42(0x1a2)](_0x47659d);}else _0x1bbae['set'](_0x31c462,{'indices':[_0x2e1a31],'versions':new Set(_0x47659d?[_0x47659d]:[])});}const _0x2e71ed=new Set();for(const {indices:_0x2a44c0,versions:_0x15d021}of _0x1bbae[_0x249e42(0x11e)]()){if(_0x15d021['size']<=0x1)continue;const _0x51a516=_0x1a8f4d[_0x2a44c0[0x0]];_0x51a516[_0x249e42(0x199)]=_0x51a516[_0x249e42(0x199)][_0x249e42(0x1a1)](/^journeys\[\d+\]\./,''),_0x51a516['message']=_0x51a516[_0x249e42(0x147)]+_0x249e42(0x16e)+_0x15d021['size']+_0x249e42(0x111);for(let _0xa7f18e=0x1;_0xa7f18e<_0x2a44c0[_0x249e42(0x166)];_0xa7f18e++){_0x2e71ed[_0x249e42(0x1a2)](_0x2a44c0[_0xa7f18e]);}}const _0x5860f8=[..._0x2e71ed][_0x249e42(0x18e)]((_0x1b480b,_0x1eac6a)=>_0x1eac6a-_0x1b480b);for(const _0x58f3e0 of _0x5860f8){_0x1a8f4d[_0x249e42(0x140)](_0x58f3e0,0x1);}}export function validateJourneyDef(_0x477024,_0x24220f={},_0x1c4f0b={}){const _0x894a69=a146_0x5900;if(_0x1c4f0b['skipSchema'])return runJourneySemanticChecks(_0x477024,_0x24220f);const _0x55d0ca=JourneyDefSchema[_0x894a69(0x143)](_0x477024);if(_0x55d0ca[_0x894a69(0x19b)])return runJourneySemanticChecks(_0x55d0ca[_0x894a69(0x1a6)],_0x24220f);return zodErrorsToJourneyValidationResult(_0x55d0ca[_0x894a69(0x155)],_0x24220f);}function a146_0x5900(_0x34e239,_0x56ba97){_0x34e239=_0x34e239-0xf9;const _0x56e28e=a146_0x56e2();let _0x590080=_0x56e28e[_0x34e239];return _0x590080;}function zodErrorsToJourneyValidationResult(_0x3004ef,_0x3b9983){const _0x1ab2c0=a146_0x5900,_0xd33d37=flattenZodIssues(_0x3004ef[_0x1ab2c0(0x101)]),_0x4bd384=_0xd33d37[_0x1ab2c0(0x135)](_0x4b2afc=>{const _0x2eb0ab=_0x1ab2c0,_0xded23d=formatZodPath(_0x4b2afc[_0x2eb0ab(0x199)]),_0x4e332b=mapJourneyZodIssueToCode(_0x4b2afc,_0xded23d),_0x4712b1=getLocationFromPath(_0x3b9983[_0x2eb0ab(0x163)],_0x3b9983[_0x2eb0ab(0x175)],_0x4b2afc[_0x2eb0ab(0x199)][_0x2eb0ab(0x135)](_0x4e454e=>typeof _0x4e454e===_0x2eb0ab(0x1ab)?String(_0x4e454e):_0x4e454e));return{'level':_0x2eb0ab(0x155),'path':_0xded23d,'code':_0x4e332b,'message':_0x4b2afc[_0x2eb0ab(0x147)],..._0x4712b1&&{'location':_0x4712b1}};});return{'valid':![],'errors':_0x4bd384,'warnings':[]};}function mapJourneyZodIssueToCode(_0x35c45d,_0x2cb326){const _0x5e49ae=a146_0x5900;if(_0x2cb326===_0x5e49ae(0x11b))return _0x5e49ae(0x126);if(_0x2cb326[_0x5e49ae(0x122)](_0x5e49ae(0x164))&&_0x2cb326[_0x5e49ae(0x183)](_0x5e49ae(0x144)))return _0x5e49ae(0x171);if(_0x2cb326===_0x5e49ae(0x170)||_0x2cb326[_0x5e49ae(0x122)](_0x5e49ae(0x117)))return'MISSING_STAGES';if(_0x2cb326===''&&_0x35c45d[_0x5e49ae(0x147)][_0x5e49ae(0x183)](_0x5e49ae(0x113)))return _0x5e49ae(0x149);if(_0x2cb326[_0x5e49ae(0x183)]('activation'))return _0x5e49ae(0x1ad);return _0x5e49ae(0x171);}function runJourneySemanticChecks(_0x283c22,_0x2d2f3d){const _0x3beeb4=a146_0x5900,_0x389d25=[],_0x428a54=[];(!_0x283c22['name']||_0x283c22[_0x3beeb4(0x11b)][_0x3beeb4(0x167)]()==='')&&_0x389d25[_0x3beeb4(0x18c)]({'level':_0x3beeb4(0x155),'path':'name','code':_0x3beeb4(0x126),'message':_0x3beeb4(0x156),'location':getLocationFromPath(_0x2d2f3d[_0x3beeb4(0x163)],_0x2d2f3d[_0x3beeb4(0x175)],[_0x3beeb4(0x11b)])});const _0x15b24d=new Set();if(_0x283c22[_0x3beeb4(0x15b)])for(const _0x1bde98 of Object[_0x3beeb4(0x1a7)](_0x283c22['segments'])){_0x15b24d[_0x3beeb4(0x1a2)](_0x1bde98);}const _0x37dd6c=new Set();if(_0x283c22['activations'])for(const _0x424594 of Object[_0x3beeb4(0x1a7)](_0x283c22['activations'])){_0x37dd6c[_0x3beeb4(0x1a2)](_0x424594);}const _0x4f75c5=new Set(),_0x2ea463={..._0x2d2f3d,'embeddedSegments':_0x15b24d,'referencedSegments':_0x4f75c5,'activationKeys':_0x37dd6c[_0x3beeb4(0x160)]>0x0?_0x37dd6c:undefined};if(_0x283c22[_0x3beeb4(0x15b)])for(const [_0xa0a0e7,_0x56beac]of Object['entries'](_0x283c22['segments'])){const _0x1daa73=validateEmbeddedSegment(_0x56beac,_0x3beeb4(0x138)+_0xa0a0e7,_0x2ea463);for(const _0x282a82 of _0x1daa73){if(_0x282a82[_0x3beeb4(0x14e)]==='error')_0x389d25['push'](_0x282a82);else _0x428a54[_0x3beeb4(0x18c)](_0x282a82);}}const _0x23028=!!_0x283c22['goal'],_0x51d319=_0x283c22[_0x3beeb4(0x152)]?.['every'](_0x936084=>!!_0x936084[_0x3beeb4(0x12d)])??![];!_0x23028&&!_0x51d319&&_0x428a54[_0x3beeb4(0x18c)]({'level':_0x3beeb4(0x177),'path':_0x3beeb4(0x12d),'code':_0x3beeb4(0x103),'message':_0x3beeb4(0x13c),'location':getLocationFromPath(_0x2d2f3d[_0x3beeb4(0x163)],_0x2d2f3d['source'],[_0x3beeb4(0x12d)])});const _0x466e58=_0x283c22[_0x3beeb4(0x152)]??_0x283c22['versions'];if(_0x466e58&&_0x466e58[_0x3beeb4(0x114)](_0x3b64d0=>_0x3b64d0[_0x3beeb4(0xff)]===!![])[_0x3beeb4(0x166)]>0x1){const _0x5c35fc=_0x283c22[_0x3beeb4(0x152)]?_0x3beeb4(0x152):_0x3beeb4(0x18d);_0x389d25[_0x3beeb4(0x18c)]({'level':_0x3beeb4(0x155),'path':_0x5c35fc,'code':_0x3beeb4(0x123),'message':_0x3beeb4(0x13e)+(_0x5c35fc===_0x3beeb4(0x152)?_0x3beeb4(0x195):_0x3beeb4(0x12a))+_0x3beeb4(0x19a),'location':getLocationFromPath(_0x2d2f3d[_0x3beeb4(0x163)],_0x2d2f3d[_0x3beeb4(0x175)],[_0x5c35fc])});}if(_0x283c22['journeys']&&_0x283c22[_0x3beeb4(0x152)][_0x3beeb4(0x166)]>0x0)for(let _0x4468a1=0x0;_0x4468a1<_0x283c22[_0x3beeb4(0x152)][_0x3beeb4(0x166)];_0x4468a1++){const _0x6e9b0b=_0x283c22[_0x3beeb4(0x152)][_0x4468a1];if(_0x283c22[_0x3beeb4(0x152)]['length']>0x1&&_0x6e9b0b[_0x3beeb4(0x15c)]===_0x3beeb4(0x12b))continue;const _0x4b33a7=_0x6e9b0b[_0x3beeb4(0x170)]||[],_0x47c83c=_0x3beeb4(0x10f)+_0x4468a1+'].',_0x4dc964=!!_0x6e9b0b[_0x3beeb4(0x12d)],_0x299023=_0x4dc964?{..._0x283c22,'goal':_0x6e9b0b[_0x3beeb4(0x12d)]}:_0x283c22;validateStagesForVersion(_0x4b33a7,_0x299023,_0x2ea463,_0x47c83c,_0x389d25,_0x428a54,{'goalIsInherited':!_0x4dc964});}else{if(_0x283c22[_0x3beeb4(0x18d)]&&_0x283c22[_0x3beeb4(0x18d)]['length']>0x0)for(let _0x435fc0=0x0;_0x435fc0<_0x283c22[_0x3beeb4(0x18d)][_0x3beeb4(0x166)];_0x435fc0++){const _0x5987f0=_0x283c22[_0x3beeb4(0x18d)][_0x435fc0];if(_0x283c22[_0x3beeb4(0x18d)][_0x3beeb4(0x166)]>0x1&&_0x5987f0[_0x3beeb4(0x15c)]===_0x3beeb4(0x12b))continue;const _0x2a583e=_0x5987f0[_0x3beeb4(0x170)]||[],_0x38f8b1=_0x3beeb4(0x106)+_0x435fc0+'].';validateStagesForVersion(_0x2a583e,_0x283c22,_0x2ea463,_0x38f8b1,_0x389d25,_0x428a54);}else{const _0x50dfc5=_0x283c22[_0x3beeb4(0x170)]||[];validateStagesForVersion(_0x50dfc5,_0x283c22,_0x2ea463,'',_0x389d25,_0x428a54);}}_0x283c22[_0x3beeb4(0x152)]&&_0x283c22[_0x3beeb4(0x152)][_0x3beeb4(0x166)]>0x1&&(deduplicateAcrossVersions(_0x389d25),deduplicateAcrossVersions(_0x428a54));for(const _0x5b8d74 of _0x15b24d){!_0x4f75c5[_0x3beeb4(0x115)](_0x5b8d74)&&!_0x5b8d74['startsWith'](_0x3beeb4(0x182))&&_0x428a54['push']({'level':_0x3beeb4(0x177),'path':_0x3beeb4(0x138)+_0x5b8d74,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x3beeb4(0x16c)+_0x5b8d74+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x2d2f3d['document'],_0x2d2f3d[_0x3beeb4(0x175)],[_0x3beeb4(0x15b),_0x5b8d74])});}return{'valid':_0x389d25['length']===0x0,'errors':_0x389d25,'warnings':_0x428a54};}
@@ -1 +1 @@
1
- function a147_0x3a14(_0x27eb77,_0x100db0){_0x27eb77=_0x27eb77-0x194;const _0x28af54=a147_0x28af();let _0x3a140a=_0x28af54[_0x27eb77];return _0x3a140a;}const a147_0x4d9c99=a147_0x3a14;(function(_0x39e0cc,_0x220508){const _0x49036d=a147_0x3a14,_0x9fea87=_0x39e0cc();while(!![]){try{const _0x57742a=parseInt(_0x49036d(0x246))/0x1*(parseInt(_0x49036d(0x1d2))/0x2)+parseInt(_0x49036d(0x20b))/0x3+parseInt(_0x49036d(0x1ca))/0x4*(-parseInt(_0x49036d(0x1d8))/0x5)+-parseInt(_0x49036d(0x1ab))/0x6+-parseInt(_0x49036d(0x224))/0x7+-parseInt(_0x49036d(0x1e0))/0x8*(-parseInt(_0x49036d(0x1cd))/0x9)+parseInt(_0x49036d(0x1d6))/0xa;if(_0x57742a===_0x220508)break;else _0x9fea87['push'](_0x9fea87['shift']());}catch(_0x5c71fc){_0x9fea87['push'](_0x9fea87['shift']());}}}(a147_0x28af,0x206db));import*as a147_0x327dd2 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(_0x43c424){const _0xadcb22=a147_0x3a14,_0x386446=_0x43c424[_0xadcb22(0x247)]();if(_0x386446===_0xadcb22(0x22d)||_0x386446===_0xadcb22(0x1ae))return _0xadcb22(0x1ae);if(_0x386446===_0xadcb22(0x1f0)||_0x386446===_0xadcb22(0x213))return _0xadcb22(0x213);return _0x43c424;}export function journeyResponseToDefSync(_0x2e3a2e){const _0x4f481c=a147_0x3a14,_0x35210e=_0x2e3a2e[_0x4f481c(0x202)],_0x7f1008=_0x35210e[_0x4f481c(0x19e)]||_0x35210e[_0x4f481c(0x1a5)],_0x2c714f={'stages':_0x35210e[_0x4f481c(0x228)][_0x4f481c(0x1ef)](convertApiStageToYaml),'id':_0x2e3a2e['id']};_0x35210e[_0x4f481c(0x22b)]&&(_0x2c714f[_0x4f481c(0x22b)]=convertApiCriteriaToYaml(_0x35210e[_0x4f481c(0x22b)]));_0x35210e[_0x4f481c(0x1a5)]&&_0x35210e[_0x4f481c(0x1a5)]!==_0x7f1008&&(_0x2c714f[_0x4f481c(0x226)]=_0x35210e[_0x4f481c(0x1a5)]);_0x35210e[_0x4f481c(0x1a7)]!==undefined&&(_0x2c714f['version_number']=_0x35210e[_0x4f481c(0x1a7)]);_0x35210e['state']&&(_0x2c714f[_0x4f481c(0x1cf)]=_0x35210e['state']==='launched'?_0x4f481c(0x1b1):_0x4f481c(0x1f1));const _0x5be2ec={'type':_0x4f481c(0x237),'name':_0x7f1008,'journeys':[_0x2c714f]};_0x35210e[_0x4f481c(0x225)]&&(_0x5be2ec[_0x4f481c(0x225)]=_0x35210e['description']);_0x35210e['goal']&&(_0x5be2ec[_0x4f481c(0x22b)]=convertApiCriteriaToYaml(_0x35210e[_0x4f481c(0x22b)]));if(_0x35210e[_0x4f481c(0x1f8)])_0x5be2ec['reentry']=_0x35210e[_0x4f481c(0x1f8)];else _0x35210e['allowReentry']!==undefined&&(_0x5be2ec[_0x4f481c(0x1e9)]=_0x35210e[_0x4f481c(0x23f)]?_0x4f481c(0x1d4):_0x4f481c(0x221));return _0x35210e[_0x4f481c(0x1bd)]&&(_0x5be2ec['bundle_id']=_0x35210e[_0x4f481c(0x1bd)]),_0x35210e[_0x4f481c(0x19e)]&&(_0x5be2ec[_0x4f481c(0x211)]=_0x35210e[_0x4f481c(0x19e)]),_0x2e3a2e[_0x4f481c(0x1d9)]?.['parentFolder']?.[_0x4f481c(0x1fe)]?.['id']&&(_0x5be2ec[_0x4f481c(0x19f)]=_0x2e3a2e[_0x4f481c(0x1d9)][_0x4f481c(0x1f4)][_0x4f481c(0x1fe)]['id']),_0x5be2ec;}export async function journeyResponseToDef(_0x2f340d,_0x26639d){const _0x1a4430=a147_0x3a14,_0x2ecf2a=journeyResponseToDefSync(_0x2f340d);if(!_0x26639d)return _0x2ecf2a;const _0xfdf875=new Set();collectSegmentIdsFromJourney(_0x2ecf2a,_0xfdf875);const _0x2d175e=new Set();collectActivationIdsFromJourney(_0x2ecf2a,_0x2d175e);const _0x143a99={},_0x5add38=new Map();for(const _0x37683e of Array['from'](_0xfdf875)[_0x1a4430(0x1bf)]()){if(_0x26639d[_0x1a4430(0x1cc)]){const _0x51498c=await _0x26639d[_0x1a4430(0x1cc)](_0x37683e);if(_0x51498c[_0x1a4430(0x1f7)]){_0x5add38[_0x1a4430(0x1b8)](_0x37683e,_0x51498c[_0x1a4430(0x1a5)]);if(_0x51498c[_0x1a4430(0x200)]){const _0x4722d3={..._0x51498c[_0x1a4430(0x200)],'rule':deepSortObject(_0x51498c[_0x1a4430(0x200)][_0x1a4430(0x1f3)])};_0x143a99[_0x51498c[_0x1a4430(0x1a5)]]=_0x4722d3;}}else _0x5add38[_0x1a4430(0x1b8)](_0x37683e,makeSegmentRef(_0x51498c['name']));}else{if(_0x26639d[_0x1a4430(0x212)]){const _0x1bf34f=await _0x26639d[_0x1a4430(0x212)](_0x37683e);_0x5add38[_0x1a4430(0x1b8)](_0x37683e,_0x1bf34f);}}}const _0x478f31={},_0x1b44b3=new Map();for(const _0x47613f of Array[_0x1a4430(0x19a)](_0x2d175e)[_0x1a4430(0x1bf)]()){if(_0x26639d['resolveActivation']){const _0x4e6cb3=await _0x26639d[_0x1a4430(0x1dc)](_0x47613f);_0x4e6cb3['isJourneyLocal']?(_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,_0x4e6cb3['name']),_0x4e6cb3[_0x1a4430(0x200)]&&(_0x478f31[_0x4e6cb3['name']]=_0x4e6cb3['definition'])):_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,makeSegmentRef(_0x4e6cb3[_0x1a4430(0x1a5)]));}else{if(_0x26639d[_0x1a4430(0x1e1)]){const _0x3bb4d0=await _0x26639d['resolveActivationName'](_0x47613f);_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,_0x3bb4d0);}}}_0x5add38['size']>0x0&&replaceSegmentIdsInJourney(_0x2ecf2a,_0x5add38);_0x1b44b3['size']>0x0&&replaceActivationIdsInJourney(_0x2ecf2a,_0x1b44b3);if(_0x26639d[_0x1a4430(0x1ea)]){const _0x5de1c3=[];collectJumpTargetsFromJourney(_0x2ecf2a,_0x5de1c3);if(_0x5de1c3[_0x1a4430(0x1e2)]>0x0){const _0x54d8a0=new Map();for(const _0x24633b of _0x5de1c3){try{const _0x3c54d1=await _0x26639d[_0x1a4430(0x1ea)](_0x24633b[_0x1a4430(0x22a)],_0x24633b[_0x1a4430(0x234)]);_0x54d8a0['set'](_0x24633b[_0x1a4430(0x22a)]+':'+_0x24633b[_0x1a4430(0x234)],_0x3c54d1);}catch{}}_0x54d8a0[_0x1a4430(0x1e8)]>0x0&&replaceJumpTargetsInJourney(_0x2ecf2a,_0x54d8a0);}}return Object['keys'](_0x143a99)[_0x1a4430(0x1e2)]>0x0&&(_0x2ecf2a['segments']=_0x143a99),Object[_0x1a4430(0x1c7)](_0x478f31)[_0x1a4430(0x1e2)]>0x0&&(_0x2ecf2a[_0x1a4430(0x1b6)]=_0x478f31),_0x2ecf2a;}function collectSegmentIdsFromJourney(_0x2d6418,_0x244525){const _0x43600b=a147_0x3a14;_0x2d6418[_0x43600b(0x22b)]?.['segment']&&_0x244525[_0x43600b(0x195)](_0x2d6418[_0x43600b(0x22b)][_0x43600b(0x208)]);const _0x52e211=_0x729efc=>{const _0x648ef0=_0x43600b;for(const _0x569897 of _0x729efc){_0x569897[_0x648ef0(0x21f)]?.[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x569897[_0x648ef0(0x21f)][_0x648ef0(0x208)]);if(_0x569897[_0x648ef0(0x1c6)])for(const _0x5bef17 of _0x569897[_0x648ef0(0x1c6)]){_0x5bef17[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x5bef17[_0x648ef0(0x208)]);}_0x569897[_0x648ef0(0x1ec)]?.['segment']&&_0x244525['add'](_0x569897[_0x648ef0(0x1ec)]['segment']);if(_0x569897['steps'])for(const _0x3939ac of _0x569897[_0x648ef0(0x206)]){if(_0x3939ac[_0x648ef0(0x1fb)]===_0x648ef0(0x255)){const _0x44836e=_0x3939ac;for(const _0x241e69 of _0x44836e[_0x648ef0(0x20f)][_0x648ef0(0x216)]){_0x241e69[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x241e69[_0x648ef0(0x208)]);}}else{if(_0x3939ac[_0x648ef0(0x1fb)]===_0x648ef0(0x1b7)){const _0x1c2479=_0x3939ac;_0x1c2479[_0x648ef0(0x20f)][_0x648ef0(0x24b)]?.[_0x648ef0(0x208)]&&_0x244525['add'](_0x1c2479[_0x648ef0(0x20f)][_0x648ef0(0x24b)]['segment']);}}}}};if(_0x2d6418['journeys'])for(const _0x454c6b of _0x2d6418[_0x43600b(0x1e5)]){_0x454c6b[_0x43600b(0x22b)]?.['segment']&&_0x244525['add'](_0x454c6b[_0x43600b(0x22b)][_0x43600b(0x208)]),_0x52e211(_0x454c6b[_0x43600b(0x1a9)]);}_0x2d6418[_0x43600b(0x1a9)]&&_0x52e211(_0x2d6418[_0x43600b(0x1a9)]);if(_0x2d6418[_0x43600b(0x1c0)])for(const _0x58c2a1 of _0x2d6418[_0x43600b(0x1c0)]){_0x52e211(_0x58c2a1[_0x43600b(0x1a9)]);}}function replaceSegmentIdsInJourney(_0x351ea2,_0x3d0003){const _0x49ca66=a147_0x3a14,_0x250633=_0x42faf1=>_0x3d0003[_0x49ca66(0x232)](_0x42faf1)||_0x42faf1;_0x351ea2['goal']?.[_0x49ca66(0x208)]&&(_0x351ea2[_0x49ca66(0x22b)][_0x49ca66(0x208)]=_0x250633(_0x351ea2['goal'][_0x49ca66(0x208)]));const _0x27d492=_0x19b86a=>{const _0x5b878c=_0x49ca66;for(const _0x15dc43 of _0x19b86a){_0x15dc43[_0x5b878c(0x21f)]?.[_0x5b878c(0x208)]&&(_0x15dc43[_0x5b878c(0x21f)][_0x5b878c(0x208)]=_0x250633(_0x15dc43[_0x5b878c(0x21f)][_0x5b878c(0x208)]));if(_0x15dc43[_0x5b878c(0x1c6)])for(const _0x2b67a8 of _0x15dc43[_0x5b878c(0x1c6)]){_0x2b67a8['segment']&&(_0x2b67a8['segment']=_0x250633(_0x2b67a8[_0x5b878c(0x208)]));}_0x15dc43[_0x5b878c(0x1ec)]?.[_0x5b878c(0x208)]&&(_0x15dc43[_0x5b878c(0x1ec)][_0x5b878c(0x208)]=_0x250633(_0x15dc43['milestone']['segment']));if(_0x15dc43[_0x5b878c(0x206)])for(const _0x20e726 of _0x15dc43['steps']){if(_0x20e726[_0x5b878c(0x1fb)]==='decision_point'){const _0x11174b=_0x20e726;for(const _0x139594 of _0x11174b[_0x5b878c(0x20f)][_0x5b878c(0x216)]){_0x139594[_0x5b878c(0x208)]&&(_0x139594['segment']=_0x250633(_0x139594[_0x5b878c(0x208)]));}}else{if(_0x20e726[_0x5b878c(0x1fb)]===_0x5b878c(0x1b7)){const _0x3e60cb=_0x20e726;_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)]?.[_0x5b878c(0x208)]&&(_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)][_0x5b878c(0x208)]=_0x250633(_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)][_0x5b878c(0x208)]));}}}}};if(_0x351ea2[_0x49ca66(0x1e5)])for(const _0x3222c3 of _0x351ea2[_0x49ca66(0x1e5)]){_0x3222c3[_0x49ca66(0x22b)]?.[_0x49ca66(0x208)]&&(_0x3222c3['goal'][_0x49ca66(0x208)]=_0x250633(_0x3222c3[_0x49ca66(0x22b)][_0x49ca66(0x208)])),_0x27d492(_0x3222c3['stages']);}_0x351ea2['stages']&&_0x27d492(_0x351ea2[_0x49ca66(0x1a9)]);if(_0x351ea2[_0x49ca66(0x1c0)])for(const _0x5d6eaf of _0x351ea2[_0x49ca66(0x1c0)]){_0x27d492(_0x5d6eaf[_0x49ca66(0x1a9)]);}}function collectActivationIdsFromJourney(_0x1200ff,_0x22d11e){const _0x4920f6=a147_0x3a14,_0x50e107=_0x332201=>{const _0x5c2533=a147_0x3a14;for(const _0x33cbef of _0x332201){if(_0x33cbef[_0x5c2533(0x206)])for(const _0x3d4e5d of _0x33cbef['steps']){if(_0x3d4e5d[_0x5c2533(0x1fb)]==='activation'){const _0x2ff2ef=_0x3d4e5d;_0x2ff2ef[_0x5c2533(0x20f)]['activation']&&/^\d+$/['test'](_0x2ff2ef[_0x5c2533(0x20f)][_0x5c2533(0x1a6)])&&_0x22d11e[_0x5c2533(0x195)](_0x2ff2ef[_0x5c2533(0x20f)][_0x5c2533(0x1a6)]);}}}};if(_0x1200ff[_0x4920f6(0x1e5)])for(const _0x4a04fa of _0x1200ff[_0x4920f6(0x1e5)]){_0x50e107(_0x4a04fa[_0x4920f6(0x1a9)]);}_0x1200ff[_0x4920f6(0x1a9)]&&_0x50e107(_0x1200ff[_0x4920f6(0x1a9)]);if(_0x1200ff[_0x4920f6(0x1c0)])for(const _0x571a40 of _0x1200ff[_0x4920f6(0x1c0)]){_0x50e107(_0x571a40[_0x4920f6(0x1a9)]);}}function replaceActivationIdsInJourney(_0x475001,_0x33dd1c){const _0x376325=a147_0x3a14,_0x568ce6=_0x59df81=>_0x33dd1c['get'](_0x59df81)||_0x59df81,_0x5af813=_0x4b28c1=>{const _0x48472e=a147_0x3a14;for(const _0x5dfceb of _0x4b28c1){if(_0x5dfceb['steps'])for(const _0x64b39f of _0x5dfceb['steps']){if(_0x64b39f['type']===_0x48472e(0x1a6)){const _0x1355a7=_0x64b39f;_0x1355a7[_0x48472e(0x20f)][_0x48472e(0x1a6)]&&(_0x1355a7[_0x48472e(0x20f)]['activation']=_0x568ce6(_0x1355a7[_0x48472e(0x20f)][_0x48472e(0x1a6)]));}}}};if(_0x475001[_0x376325(0x1e5)])for(const _0x4ec9b0 of _0x475001['journeys']){_0x5af813(_0x4ec9b0[_0x376325(0x1a9)]);}_0x475001['stages']&&_0x5af813(_0x475001[_0x376325(0x1a9)]);if(_0x475001[_0x376325(0x1c0)])for(const _0xd2e01a of _0x475001[_0x376325(0x1c0)]){_0x5af813(_0xd2e01a['stages']);}}function collectJumpTargetsFromJourney(_0x28aa44,_0x2c7160){const _0x3a9b10=a147_0x3a14,_0xf2ac45=new Set(),_0x43d162=_0x111481=>{const _0x20c713=a147_0x3a14;for(const _0x13313a of _0x111481){if(_0x13313a[_0x20c713(0x206)])for(const _0x2471de of _0x13313a[_0x20c713(0x206)]){if(_0x2471de['type']==='jump'){const _0x14370c=_0x2471de,_0xf3ffe3=_0x14370c['with']['target'];if(_0xf3ffe3[_0x20c713(0x237)]&&_0xf3ffe3[_0x20c713(0x1e3)]&&/^\d+$/['test'](_0xf3ffe3[_0x20c713(0x237)])&&/^\d+$/[_0x20c713(0x210)](_0xf3ffe3[_0x20c713(0x1e3)])){const _0xbe834b=_0xf3ffe3[_0x20c713(0x237)]+':'+_0xf3ffe3[_0x20c713(0x1e3)];!_0xf2ac45['has'](_0xbe834b)&&(_0xf2ac45[_0x20c713(0x195)](_0xbe834b),_0x2c7160['push']({'journeyId':_0xf3ffe3['journey'],'stageId':_0xf3ffe3[_0x20c713(0x1e3)]}));}}}}};if(_0x28aa44[_0x3a9b10(0x1e5)])for(const _0xcd88f9 of _0x28aa44['journeys']){_0x43d162(_0xcd88f9[_0x3a9b10(0x1a9)]);}_0x28aa44[_0x3a9b10(0x1a9)]&&_0x43d162(_0x28aa44[_0x3a9b10(0x1a9)]);if(_0x28aa44[_0x3a9b10(0x1c0)])for(const _0x186207 of _0x28aa44[_0x3a9b10(0x1c0)]){_0x43d162(_0x186207[_0x3a9b10(0x1a9)]);}}function replaceJumpTargetsInJourney(_0x616ca1,_0x4a0d8e){const _0x22fcdc=a147_0x3a14,_0x146b29=_0x1dcd92=>{const _0x3e7a91=a147_0x3a14;for(const _0x2075f3 of _0x1dcd92){if(_0x2075f3[_0x3e7a91(0x206)])for(const _0x5a6b28 of _0x2075f3[_0x3e7a91(0x206)]){if(_0x5a6b28[_0x3e7a91(0x1fb)]==='jump'){const _0xf4be15=_0x5a6b28,_0x2a22bc=_0xf4be15[_0x3e7a91(0x20f)]['target'],_0x3a5aed=_0x2a22bc[_0x3e7a91(0x237)]+':'+_0x2a22bc[_0x3e7a91(0x1e3)],_0x376d46=_0x4a0d8e[_0x3e7a91(0x232)](_0x3a5aed);_0x376d46&&(_0x2a22bc['journey']=_0x376d46[_0x3e7a91(0x242)],_0x2a22bc['stage']=_0x376d46[_0x3e7a91(0x1ba)]);}}}};if(_0x616ca1[_0x22fcdc(0x1e5)])for(const _0xf72cb6 of _0x616ca1[_0x22fcdc(0x1e5)]){_0x146b29(_0xf72cb6[_0x22fcdc(0x1a9)]);}_0x616ca1[_0x22fcdc(0x1a9)]&&_0x146b29(_0x616ca1[_0x22fcdc(0x1a9)]);if(_0x616ca1[_0x22fcdc(0x1c0)])for(const _0x323d10 of _0x616ca1['versions']){_0x146b29(_0x323d10['stages']);}}function generateReadableStepName(_0x9fe728,_0x4e1204){const _0x4e09dc=a147_0x3a14;if(_0x9fe728[_0x4e09dc(0x1a5)]&&_0x9fe728[_0x4e09dc(0x1a5)]!==_0x9fe728['type']){const _0x3ee81c=_0x9fe728[_0x4e09dc(0x1a5)]['trim']();if(_0x3ee81c&&/[a-z0-9\p{L}]/iu[_0x4e09dc(0x210)](_0x3ee81c))return _0x3ee81c;}const _0x3296ad=_0x9fe728[_0x4e09dc(0x1fb)][_0x4e09dc(0x247)]()[_0x4e09dc(0x1ad)](/step$/i,'');return _0x3296ad+'_'+(_0x4e1204+0x1);}function getStepNextRefs(_0x228eb9){const _0x4bb1a5=a147_0x3a14,_0xb4aac1=[];if(_0x228eb9[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x228eb9['next']);if(_0x228eb9[_0x4bb1a5(0x216)])for(const _0x13f66b of _0x228eb9['branches']){if(_0x13f66b[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x13f66b[_0x4bb1a5(0x253)]);}if(_0x228eb9[_0x4bb1a5(0x1ff)])for(const _0x210f57 of _0x228eb9[_0x4bb1a5(0x1ff)]){if(_0x210f57[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x210f57[_0x4bb1a5(0x253)]);}if(_0x228eb9[_0x4bb1a5(0x1af)])for(const _0x5f5261 of _0x228eb9['conditions']){if(_0x5f5261[_0x4bb1a5(0x253)])_0xb4aac1['push'](_0x5f5261['next']);}return _0xb4aac1;}function parseJumpTargetDisplayName(_0x4f4a6c){const _0x1b7e99=a147_0x3a14,_0x45a149=_0x4f4a6c[_0x1b7e99(0x256)](/^(.+?)\s*\(([^/)]+)/);if(!_0x45a149)return undefined;const _0xabc774=_0x45a149[0x1][_0x1b7e99(0x1fd)](),_0x7e6b62=_0x45a149[0x2]['trim']();if(!_0xabc774||!_0x7e6b62)return undefined;return{'stageName':_0xabc774,'journeyName':_0x7e6b62};}function orderStepsFromRoot(_0x28c014,_0x1d5813){const _0x5cdfb4=a147_0x3a14,_0x30e151=Object[_0x5cdfb4(0x251)](_0x28c014);if(_0x30e151[_0x5cdfb4(0x1e2)]===0x0)return[];const _0x233389=new Set(_0x30e151[_0x5cdfb4(0x1ef)](([_0x34c533])=>_0x34c533)),_0x27bd75=new Set();for(const [,_0x3ca697]of _0x30e151){for(const _0xe964fd of getStepNextRefs(_0x3ca697)){if(_0x233389[_0x5cdfb4(0x21d)](_0xe964fd))_0x27bd75['add'](_0xe964fd);}}let _0x4fdc8d=_0x1d5813&&_0x233389[_0x5cdfb4(0x21d)](_0x1d5813)?_0x1d5813:undefined;if(!_0x4fdc8d){const _0x201b30=_0x30e151['filter'](([_0x5b1046])=>!_0x27bd75[_0x5cdfb4(0x21d)](_0x5b1046));_0x201b30[_0x5cdfb4(0x1e2)]>0x0?_0x4fdc8d=_0x201b30[0x0][0x0]:_0x4fdc8d=_0x30e151[0x0][0x0];}const _0x4fa739=[],_0x35f15e=new Set(),_0x5cdd58=[_0x4fdc8d];while(_0x5cdd58['length']>0x0){const _0x3f1a73=_0x5cdd58[_0x5cdfb4(0x207)]();if(_0x35f15e[_0x5cdfb4(0x21d)](_0x3f1a73))continue;_0x35f15e[_0x5cdfb4(0x195)](_0x3f1a73);const _0x546188=_0x28c014[_0x3f1a73];if(!_0x546188)continue;_0x4fa739[_0x5cdfb4(0x20c)]({'uuid':_0x3f1a73,'step':_0x546188});for(const _0x13a79b of getStepNextRefs(_0x546188)){_0x233389['has'](_0x13a79b)&&!_0x35f15e[_0x5cdfb4(0x21d)](_0x13a79b)&&_0x5cdd58['push'](_0x13a79b);}}for(const [_0x24e766,_0x54e1bf]of _0x30e151){!_0x35f15e[_0x5cdfb4(0x21d)](_0x24e766)&&_0x4fa739[_0x5cdfb4(0x20c)]({'uuid':_0x24e766,'step':_0x54e1bf});}return _0x4fa739;}function resolveStepReferences(_0x4a9d1d,_0x1265a8,_0x50087c,_0x50501f){const _0x2a97f9=a147_0x3a14;if(_0x4a9d1d[_0x2a97f9(0x1fb)]!==_0x2a97f9(0x1f5)){_0x4a9d1d['next']&&_0x50501f[_0x2a97f9(0x21d)](_0x4a9d1d[_0x2a97f9(0x253)])&&(_0x4a9d1d['next']=_0x50501f['get'](_0x4a9d1d['next']));const _0x4058ef=_0x1265a8+0x1;if(_0x4058ef<_0x50087c[_0x2a97f9(0x1e2)]){const _0x578b81=_0x50501f[_0x2a97f9(0x232)](_0x50087c[_0x4058ef][_0x2a97f9(0x1cb)]);_0x4a9d1d['next']===_0x578b81&&delete _0x4a9d1d[_0x2a97f9(0x253)];}}if(_0x4a9d1d['type']==='decision_point')for(const _0xfe17cc of _0x4a9d1d[_0x2a97f9(0x20f)]['branches']){_0xfe17cc['next']&&_0x50501f[_0x2a97f9(0x21d)](_0xfe17cc[_0x2a97f9(0x253)])&&(_0xfe17cc[_0x2a97f9(0x253)]=_0x50501f[_0x2a97f9(0x232)](_0xfe17cc['next']));}if(_0x4a9d1d[_0x2a97f9(0x1fb)]==='ab_test')for(const _0x1107bf of _0x4a9d1d[_0x2a97f9(0x20f)]['variants']){_0x1107bf['next']&&_0x50501f['has'](_0x1107bf[_0x2a97f9(0x253)])&&(_0x1107bf[_0x2a97f9(0x253)]=_0x50501f[_0x2a97f9(0x232)](_0x1107bf[_0x2a97f9(0x253)]));}if(_0x4a9d1d['type']===_0x2a97f9(0x1b7)&&_0x4a9d1d[_0x2a97f9(0x20f)][_0x2a97f9(0x24b)]){const _0x115692=_0x4a9d1d[_0x2a97f9(0x20f)][_0x2a97f9(0x24b)];_0x115692[_0x2a97f9(0x253)]&&_0x50501f[_0x2a97f9(0x21d)](_0x115692[_0x2a97f9(0x253)])&&(_0x115692['next']=_0x50501f['get'](_0x115692[_0x2a97f9(0x253)])),_0x115692['timeout']?.[_0x2a97f9(0x253)]&&_0x50501f[_0x2a97f9(0x21d)](_0x115692[_0x2a97f9(0x201)]['next'])&&(_0x115692[_0x2a97f9(0x201)][_0x2a97f9(0x253)]=_0x50501f['get'](_0x115692[_0x2a97f9(0x201)][_0x2a97f9(0x253)]));}}function convertApiStageToYaml(_0x527c53){const _0x27cfbe=a147_0x3a14,_0x1bb06c={'name':_0x527c53[_0x27cfbe(0x1a5)]};_0x527c53['id']&&(_0x1bb06c['id']=_0x527c53['id']);_0x527c53[_0x27cfbe(0x225)]&&(_0x1bb06c['description']=_0x527c53[_0x27cfbe(0x225)]);_0x527c53[_0x27cfbe(0x227)]&&(_0x1bb06c[_0x27cfbe(0x21f)]=convertApiCriteriaToYaml(_0x527c53[_0x27cfbe(0x227)]));_0x527c53[_0x27cfbe(0x1b9)]&&_0x527c53[_0x27cfbe(0x1b9)][_0x27cfbe(0x1e2)]>0x0&&(_0x1bb06c[_0x27cfbe(0x1c6)]=_0x527c53[_0x27cfbe(0x1b9)]['map'](convertApiCriteriaToYaml));_0x527c53[_0x27cfbe(0x1ec)]&&(_0x1bb06c[_0x27cfbe(0x1ec)]=convertApiCriteriaToYaml(_0x527c53['milestone']));if(_0x527c53['steps']&&Object[_0x27cfbe(0x1c7)](_0x527c53[_0x27cfbe(0x206)])[_0x27cfbe(0x1e2)]>0x0){const _0x22f910=orderStepsFromRoot(_0x527c53[_0x27cfbe(0x206)],_0x527c53['rootStep']),_0x44657c=new Map(),_0x321a83=new Set();for(let _0x2e7261=0x0;_0x2e7261<_0x22f910['length'];_0x2e7261++){const {uuid:_0x2a5ad5,step:_0x31bd8b}=_0x22f910[_0x2e7261];let _0xb8059c=generateReadableStepName(_0x31bd8b,_0x2e7261),_0x150173=_0xb8059c,_0x429da9=0x2;while(_0x321a83[_0x27cfbe(0x21d)](_0x150173)){_0x150173=_0xb8059c+'_'+_0x429da9,_0x429da9++;}_0x321a83['add'](_0x150173),_0x44657c[_0x27cfbe(0x1b8)](_0x2a5ad5,_0x150173);}_0x1bb06c['steps']=_0x22f910[_0x27cfbe(0x1ef)](({uuid:_0x15a0db,step:_0x2f239c},_0x33e328)=>{const _0x7b1ead=_0x27cfbe,_0x1e512b=convertApiStepToYaml(_0x2f239c,_0x44657c[_0x7b1ead(0x232)](_0x15a0db));return resolveStepReferences(_0x1e512b,_0x33e328,_0x22f910,_0x44657c),_0x1e512b;});}return _0x1bb06c;}function convertApiCriteriaToYaml(_0x737a9e){const _0x457a59=a147_0x3a14,_0xb7df49={'name':_0x737a9e['name'],'segment':_0x737a9e[_0x457a59(0x22e)]};_0x737a9e[_0x457a59(0x225)]&&(_0xb7df49['description']=_0x737a9e[_0x457a59(0x225)]);if(_0x737a9e['target']){let _0x128eac=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x22a)],_0x3d2cda=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x219)];if(_0x737a9e['target']['journeyName']){const _0x25f1a2=parseJumpTargetDisplayName(_0x737a9e[_0x457a59(0x215)][_0x457a59(0x242)]);_0x25f1a2&&(_0x3d2cda=_0x25f1a2[_0x457a59(0x1ba)],_0x128eac=_0x25f1a2[_0x457a59(0x242)]);}_0xb7df49['target']={'journey':_0x128eac,'stage':_0x3d2cda},_0x737a9e[_0x457a59(0x215)][_0x457a59(0x1bd)]&&(_0xb7df49['target'][_0x457a59(0x223)]=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x1bd)]);}return _0xb7df49;}function convertApiStepToYaml(_0x48d1b7,_0x24d189){const _0x31ef26=a147_0x3a14;switch(_0x48d1b7[_0x31ef26(0x1fb)]){case _0x31ef26(0x1e4):{const _0x1c75ac={};if(_0x48d1b7['waitStepType']===_0x31ef26(0x214)&&_0x48d1b7[_0x31ef26(0x231)]!==undefined)_0x1c75ac[_0x31ef26(0x1eb)]=_0x48d1b7[_0x31ef26(0x231)],_0x1c75ac[_0x31ef26(0x222)]=_0x48d1b7[_0x31ef26(0x1d0)];else{if(_0x48d1b7['waitStepType']==='Date'&&_0x48d1b7[_0x31ef26(0x194)])_0x1c75ac[_0x31ef26(0x218)]=_0x48d1b7[_0x31ef26(0x194)];else{if(_0x48d1b7[_0x31ef26(0x22c)]===_0x31ef26(0x24d)&&_0x48d1b7['daysOfWeek'])_0x1c75ac['days_of_week']=_0x48d1b7[_0x31ef26(0x24f)];else{if(_0x48d1b7[_0x31ef26(0x22c)]===_0x31ef26(0x1e6)){if(_0x48d1b7['conditions']&&_0x48d1b7[_0x31ef26(0x1af)][_0x31ef26(0x1e2)]>0x0){const _0x21e6db=_0x48d1b7['conditions'][_0x31ef26(0x23a)](_0x1c9441=>!_0x1c9441[_0x31ef26(0x240)]),_0x49c646=_0x48d1b7['conditions']['find'](_0x20ac2c=>_0x20ac2c['timedOutPath']);_0x21e6db?.[_0x31ef26(0x22e)]&&(_0x1c75ac['condition']={'segment':_0x21e6db[_0x31ef26(0x22e)],..._0x21e6db[_0x31ef26(0x253)]?{'next':_0x21e6db['next']}:{}},_0x49c646&&_0x49c646[_0x31ef26(0x1ee)]!==undefined&&_0x49c646[_0x31ef26(0x222)]&&(_0x1c75ac[_0x31ef26(0x24b)][_0x31ef26(0x201)]={'duration':_0x49c646[_0x31ef26(0x1ee)],'unit':_0x49c646[_0x31ef26(0x222)],..._0x49c646[_0x31ef26(0x253)]?{'next':_0x49c646[_0x31ef26(0x253)]}:{}}));}else _0x48d1b7['conditionSegmentId']&&(_0x1c75ac[_0x31ef26(0x24b)]={'segment':_0x48d1b7['conditionSegmentId']},_0x48d1b7['conditionTimeoutDuration']!==undefined&&_0x48d1b7[_0x31ef26(0x1de)]&&(_0x1c75ac[_0x31ef26(0x24b)][_0x31ef26(0x201)]={'duration':_0x48d1b7[_0x31ef26(0x1db)],'unit':_0x48d1b7[_0x31ef26(0x1de)]}));}}}}const _0x5829bd={'type':_0x31ef26(0x1b7),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':_0x1c75ac};return _0x5829bd;}case _0x31ef26(0x21c):{const _0x4f7601={'type':'activation','name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7['next']}:{},'with':{'activation':_0x48d1b7[_0x31ef26(0x1bb)]||''}};return _0x4f7601;}case _0x31ef26(0x235):{const _0x451e82={'type':_0x31ef26(0x255),'name':_0x24d189,..._0x48d1b7['next']?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':{'branches':(_0x48d1b7[_0x31ef26(0x216)]||[])[_0x31ef26(0x1ef)](_0x162d25=>({'name':_0x162d25[_0x31ef26(0x1a5)],'segment':_0x162d25['segmentId'],'excluded':_0x162d25[_0x31ef26(0x204)],..._0x162d25[_0x31ef26(0x253)]?{'next':_0x162d25[_0x31ef26(0x253)]}:{}}))}};return _0x451e82;}case _0x31ef26(0x1bc):case _0x31ef26(0x1d7):case'Variant':{const _0x591756=_0x48d1b7[_0x31ef26(0x1ff)]||(_0x48d1b7[_0x31ef26(0x216)]||[])['map'](_0x4d1d82=>({'name':_0x4d1d82[_0x31ef26(0x1a5)],'percentage':0x0,'next':_0x4d1d82[_0x31ef26(0x253)]})),_0x428def={'type':_0x31ef26(0x1c3),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7['next']}:{},'with':{'customized_split':_0x48d1b7['customizedSplit'],'unique_id':_0x48d1b7[_0x31ef26(0x196)],'variants':_0x591756['map'](_0x4f0047=>({'name':_0x4f0047[_0x31ef26(0x1a5)],'percentage':_0x4f0047[_0x31ef26(0x1e7)],..._0x4f0047[_0x31ef26(0x253)]?{'next':_0x4f0047[_0x31ef26(0x253)]}:{}}))}};return _0x428def;}case'Merge':{const _0x1106eb={'type':_0x31ef26(0x24e),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{}};return _0x1106eb;}case _0x31ef26(0x1ac):{let _0x4fbc33='',_0x4da378='',_0x4e74d9;if(_0x48d1b7[_0x31ef26(0x215)]){_0x4fbc33=_0x48d1b7[_0x31ef26(0x215)][_0x31ef26(0x22a)],_0x4da378=_0x48d1b7[_0x31ef26(0x215)]['journeyStageId'],_0x4e74d9=_0x48d1b7[_0x31ef26(0x215)][_0x31ef26(0x1bd)];if(_0x48d1b7['target'][_0x31ef26(0x242)]){const _0x1c54f5=parseJumpTargetDisplayName(_0x48d1b7[_0x31ef26(0x215)]['journeyName']);_0x1c54f5&&(_0x4da378=_0x1c54f5['stageName'],_0x4fbc33=_0x1c54f5[_0x31ef26(0x242)]);}}const _0x4892e1={'type':'jump','name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':{'target':{'journey':_0x4fbc33,'stage':_0x4da378,..._0x4e74d9?{'bundle_id':_0x4e74d9}:{}}}};return _0x4892e1;}case'End':{const _0x4ad49f={'type':_0x31ef26(0x1f5),'name':_0x24d189};return _0x4ad49f;}default:{const _0x3f45ad={'type':_0x31ef26(0x1f5),'name':_0x24d189};return _0x3f45ad;}}}export async function journeyDefToRequest(_0x36e74a,_0x11024e,_0x3a9ea3){const _0x2b9442=a147_0x3a14,_0xf784ab=_0x36e74a[_0x2b9442(0x1a9)]||getActiveStages(_0x36e74a),_0x315a14=isJourneysArrayMode(_0x36e74a)||isMultiVersionMode(_0x36e74a)?getLatestJourneyEntry(_0x36e74a):undefined,_0x2fcd60=_0x315a14?.['version']??_0x36e74a[_0x2b9442(0x1a5)],_0x5b138a=_0x36e74a[_0x2b9442(0x20d)]||{},_0x30097e=_0x36e74a[_0x2b9442(0x1b6)]||{},_0x348aaa={'type':_0x2b9442(0x237),'attributes':{'name':_0x2fcd60,'audienceId':_0x11024e,'journeyStages':await Promise[_0x2b9442(0x1c1)](_0xf784ab['map'](_0x12f895=>convertYamlStageToApi(_0x12f895,_0x3a9ea3,_0x5b138a,_0x30097e)))}},_0x55b6ea=_0x315a14?.['id']??_0x36e74a['id'];_0x55b6ea&&(_0x348aaa['id']=_0x55b6ea);_0x36e74a['description']&&(_0x348aaa['attributes'][_0x2b9442(0x225)]=_0x36e74a[_0x2b9442(0x225)]);const _0x1b0ed2=getEffectiveGoal(_0x36e74a);_0x1b0ed2&&(_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x22b)]=await convertYamlCriteriaToApi(_0x1b0ed2,_0x3a9ea3,_0x5b138a));const _0x304192=getEffectiveReentry(_0x36e74a);return _0x304192&&(_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x1f8)]=_0x304192,_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x23f)]=_0x304192!==_0x2b9442(0x221)),_0x36e74a[_0x2b9442(0x19f)]&&(_0x348aaa[_0x2b9442(0x1d9)]={'parentFolder':{'data':{'id':_0x36e74a['folder_id'],'type':_0x2b9442(0x1f9)}}}),_0x348aaa;}async function convertYamlStageToApi(_0x5b9619,_0xe93332,_0x4a00dd={},_0x1acd12={}){const _0x3163b2=a147_0x3a14,_0x413658={'name':_0x5b9619[_0x3163b2(0x1a5)]};_0x5b9619['id']&&(_0x413658['id']=_0x5b9619['id']);_0x5b9619[_0x3163b2(0x225)]&&(_0x413658[_0x3163b2(0x225)]=_0x5b9619[_0x3163b2(0x225)]);_0x5b9619[_0x3163b2(0x21f)]&&(_0x413658[_0x3163b2(0x227)]=await convertYamlCriteriaToApi(_0x5b9619['entry_criteria'],_0xe93332,_0x4a00dd));_0x5b9619[_0x3163b2(0x1c6)]&&_0x5b9619[_0x3163b2(0x1c6)]['length']>0x0&&(_0x413658[_0x3163b2(0x1b9)]=await Promise[_0x3163b2(0x1c1)](_0x5b9619[_0x3163b2(0x1c6)]['map'](_0x421553=>convertYamlCriteriaToApi(_0x421553,_0xe93332,_0x4a00dd))));_0x5b9619['milestone']&&(_0x413658['milestone']=await convertYamlCriteriaToApi(_0x5b9619[_0x3163b2(0x1ec)],_0xe93332,_0x4a00dd));if(_0x5b9619[_0x3163b2(0x206)]&&_0x5b9619[_0x3163b2(0x206)]['length']>0x0){const _0x5d3e35={},_0x275a54=_0x5b9619['steps'][_0x3163b2(0x1ef)]((_0x440653,_0x42e842)=>{const _0x2cd20d=_0x3163b2,_0x26e410=_0x440653[_0x2cd20d(0x1cb)]||generateUUID(),_0x1a37c4=_0x440653[_0x2cd20d(0x1a5)]||_0x440653['type']+'_'+_0x42e842;return _0x5d3e35[_0x1a37c4]=_0x26e410,{..._0x440653,'name':_0x1a37c4};});_0x413658['rootStep']=_0x5d3e35[_0x275a54[0x0][_0x3163b2(0x1a5)]],_0x413658['steps']={};for(let _0x198f43=0x0;_0x198f43<_0x275a54[_0x3163b2(0x1e2)];_0x198f43++){const _0x1283ec=_0x275a54[_0x198f43],_0xf2cb3f=_0x5d3e35[_0x1283ec['name']],_0x26fb03=!_0x1283ec['next']&&_0x198f43<_0x275a54['length']-0x1&&_0x1283ec[_0x3163b2(0x1fb)]!==_0x3163b2(0x1f5)?_0x275a54[_0x198f43+0x1][_0x3163b2(0x1a5)]:_0x1283ec[_0x3163b2(0x253)],_0x4b904f=_0x26fb03!==_0x1283ec[_0x3163b2(0x253)]?{..._0x1283ec,'next':_0x26fb03}:_0x1283ec;_0x413658[_0x3163b2(0x206)][_0xf2cb3f]=await convertYamlStepToApi(_0x4b904f,_0xe93332,_0x4a00dd,_0x5d3e35,_0x1acd12);}}else _0x5b9619[_0x3163b2(0x1be)]&&(_0x413658['rootStep']=_0x5b9619['root_step']);return _0x413658;}async function convertYamlCriteriaToApi(_0x34c517,_0x15637f,_0x59b345={}){const _0x247652=a147_0x3a14;let _0x565010=_0x34c517[_0x247652(0x208)];if(_0x565010&&!/^\d+$/[_0x247652(0x210)](_0x565010)){const _0x171629=parseSegmentRef(_0x565010);if(_0x171629['type']===_0x247652(0x1c2))_0x15637f?.[_0x247652(0x198)]&&(_0x565010=await _0x15637f[_0x247652(0x198)](_0x171629['name']));else{if(_0x171629[_0x247652(0x1fb)]==='embedded'&&_0x59b345[_0x171629[_0x247652(0x1a5)]])_0x15637f?.['resolveEmbeddedSegmentId']&&(_0x565010=await _0x15637f[_0x247652(0x220)](_0x171629[_0x247652(0x1a5)],_0x59b345[_0x171629[_0x247652(0x1a5)]]));else _0x15637f?.[_0x247652(0x198)]&&(_0x565010=await _0x15637f[_0x247652(0x198)](_0x171629[_0x247652(0x1a5)]));}}const _0xe28c84={'name':_0x34c517['name'],'segmentId':_0x565010};_0x34c517[_0x247652(0x225)]&&(_0xe28c84[_0x247652(0x225)]=_0x34c517[_0x247652(0x225)]);if(_0x34c517['target']){const _0x288d90=_0x34c517['target']['journey'],_0x136d29=_0x34c517['target'][_0x247652(0x1e3)];let _0x545acf=_0x34c517[_0x247652(0x215)][_0x247652(0x237)];_0x15637f?.[_0x247652(0x19c)]&&!/^\d+$/[_0x247652(0x210)](_0x545acf)&&(_0x545acf=await _0x15637f[_0x247652(0x19c)](_0x545acf));let _0x37b9a7=_0x34c517[_0x247652(0x215)][_0x247652(0x1e3)];_0x15637f?.[_0x247652(0x197)]&&!/^\d+$/[_0x247652(0x210)](_0x37b9a7)&&(_0x37b9a7=await _0x15637f[_0x247652(0x197)](_0x545acf,_0x37b9a7));const _0xe2b486=!/^\d+$/['test'](_0x288d90)&&!isLocalJourneyRef(_0x288d90)?formatApiJourneyName(_0x288d90,_0x136d29):undefined;_0xe28c84[_0x247652(0x215)]={'journeyId':_0x545acf,'journeyStageId':_0x37b9a7,'journeyName':_0xe2b486,'confirmed':!![]},_0x34c517[_0x247652(0x215)][_0x247652(0x223)]&&(_0xe28c84[_0x247652(0x215)][_0x247652(0x1bd)]=_0x34c517[_0x247652(0x215)]['bundle_id']);}return _0xe28c84;}async function convertYamlStepToApi(_0x18609d,_0x3cdcb2,_0x32ec3c={},_0x1a70c4={},_0x4d6dad={}){const _0x3993c9=a147_0x3a14,_0x2979a8=async _0x76a450=>{const _0x1c5707=a147_0x3a14;if(/^\d+$/['test'](_0x76a450))return _0x76a450;const _0x1be3fb=parseSegmentRef(_0x76a450);if(_0x1be3fb['type']==='ref'){if(_0x3cdcb2?.[_0x1c5707(0x198)])return await _0x3cdcb2[_0x1c5707(0x198)](_0x1be3fb[_0x1c5707(0x1a5)]);}else{if(_0x1be3fb['type']===_0x1c5707(0x1a4)&&_0x32ec3c[_0x1be3fb[_0x1c5707(0x1a5)]]){if(_0x3cdcb2?.[_0x1c5707(0x220)])return await _0x3cdcb2['resolveEmbeddedSegmentId'](_0x1be3fb[_0x1c5707(0x1a5)],_0x32ec3c[_0x1be3fb[_0x1c5707(0x1a5)]]);}else{if(_0x3cdcb2?.[_0x1c5707(0x198)])return await _0x3cdcb2[_0x1c5707(0x198)](_0x1be3fb[_0x1c5707(0x1a5)]);}}return _0x76a450;},_0x254c21=async _0x382d37=>{const _0x5be8d9=a147_0x3a14;if(/^\d+$/[_0x5be8d9(0x210)](_0x382d37))return _0x382d37;const _0x8ce631=parseSegmentRef(_0x382d37);if(_0x8ce631[_0x5be8d9(0x1fb)]===_0x5be8d9(0x1c2)){if(_0x3cdcb2?.['resolveActivationId'])return await _0x3cdcb2['resolveActivationId'](_0x8ce631['name']);return _0x8ce631[_0x5be8d9(0x1a5)];}else{if(_0x8ce631['type']==='embedded'&&_0x4d6dad[_0x8ce631[_0x5be8d9(0x1a5)]]){if(_0x3cdcb2?.[_0x5be8d9(0x1a2)])return await _0x3cdcb2[_0x5be8d9(0x1a2)](_0x8ce631['name'],_0x4d6dad[_0x8ce631[_0x5be8d9(0x1a5)]]);if(_0x3cdcb2?.[_0x5be8d9(0x250)])return await _0x3cdcb2['resolveActivationId'](_0x8ce631[_0x5be8d9(0x1a5)]);}else{if(_0x3cdcb2?.[_0x5be8d9(0x250)])return await _0x3cdcb2[_0x5be8d9(0x250)](_0x8ce631[_0x5be8d9(0x1a5)]);}}return _0x382d37;},_0x4158ca=_0xa5604a=>{const _0x476c43=a147_0x3a14;if(!_0xa5604a)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x476c43(0x210)](_0xa5604a))return _0xa5604a;return _0x1a70c4[_0xa5604a]||_0xa5604a;};switch(_0x18609d['type']){case _0x3993c9(0x1b7):{const _0x400cf2=_0x18609d,_0x5056d9=_0x400cf2[_0x3993c9(0x20f)],_0x5cbf0f={'type':_0x3993c9(0x1e4),'name':_0x400cf2[_0x3993c9(0x1a5)],'next':_0x4158ca(_0x400cf2[_0x3993c9(0x253)])};if(_0x5056d9['duration']!==undefined&&_0x5056d9['unit'])_0x5cbf0f[_0x3993c9(0x22c)]='Duration',_0x5cbf0f['waitStep']=_0x5056d9[_0x3993c9(0x1eb)],_0x5cbf0f[_0x3993c9(0x1d0)]=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x222)]);else{if(_0x5056d9[_0x3993c9(0x218)])_0x5cbf0f['waitStepType']=_0x3993c9(0x24a),_0x5cbf0f[_0x3993c9(0x194)]=_0x5056d9['wait_until'];else{if(_0x5056d9[_0x3993c9(0x1f2)])_0x5cbf0f[_0x3993c9(0x22c)]='DaysOfTheWeek',_0x5cbf0f[_0x3993c9(0x24f)]=_0x5056d9[_0x3993c9(0x1f2)];else{if(_0x5056d9[_0x3993c9(0x24b)]){_0x5cbf0f[_0x3993c9(0x22c)]=_0x3993c9(0x1e6);const _0x17ea8b=await _0x2979a8(_0x5056d9['condition'][_0x3993c9(0x208)]),_0x3b02d9=_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]?.['next']!==undefined;if(_0x3b02d9){const _0x426091=[];_0x426091[_0x3993c9(0x20c)]({'id':generateUUID(),'segmentId':_0x17ea8b,'timedOutPath':![],'name':_0x3993c9(0x1a8),'next':_0x4158ca(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x253)]??_0x400cf2[_0x3993c9(0x253)])});if(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]){const _0x19dae0=_0x5056d9[_0x3993c9(0x24b)]['timeout'][_0x3993c9(0x1eb)],_0x1ac83e=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]['unit']);_0x426091[_0x3993c9(0x20c)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x3993c9(0x1d3)+_0x19dae0+'\x20'+_0x1ac83e,'moveAfter':_0x19dae0,'unit':_0x1ac83e,'next':_0x4158ca(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)][_0x3993c9(0x253)])});}_0x5cbf0f[_0x3993c9(0x1af)]=_0x426091,delete _0x5cbf0f[_0x3993c9(0x253)];}else _0x5cbf0f[_0x3993c9(0x243)]=_0x17ea8b,_0x5056d9['condition']['timeout']&&(_0x5cbf0f[_0x3993c9(0x1db)]=_0x5056d9['condition'][_0x3993c9(0x201)][_0x3993c9(0x1eb)],_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)][_0x3993c9(0x222)]&&(_0x5cbf0f[_0x3993c9(0x1de)]=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x24b)]['timeout'][_0x3993c9(0x222)])));}}}}return _0x5cbf0f;}case _0x3993c9(0x1a6):{const _0x177ab0=_0x18609d,_0x34551c=_0x177ab0[_0x3993c9(0x20f)][_0x3993c9(0x1a6)],_0x33cfbc=await _0x254c21(_0x34551c);return{'type':_0x3993c9(0x21c),'name':_0x177ab0[_0x3993c9(0x1a5)],'journeyActivationStepId':_0x33cfbc,'next':_0x4158ca(_0x177ab0[_0x3993c9(0x253)])};}case _0x3993c9(0x255):{const _0x17191b=_0x18609d,_0x5e2288=_0x17191b[_0x3993c9(0x20f)]['branches'];return{'type':'DecisionPoint','name':_0x17191b[_0x3993c9(0x1a5)],'branches':await Promise[_0x3993c9(0x1c1)](_0x5e2288[_0x3993c9(0x1ef)](async _0x4428b2=>{const _0x200b53=_0x3993c9;let _0x2d03c6='';if(!_0x4428b2[_0x200b53(0x19b)]){const _0x5931e6=_0x4428b2['segment']||_0x4428b2[_0x200b53(0x1a1)]||'';_0x2d03c6=_0x5931e6?await _0x2979a8(_0x5931e6):'';}return{'id':crypto[_0x200b53(0x1f6)](),'name':_0x4428b2['name'],'description':null,'segmentId':_0x2d03c6,'excludedPath':_0x4428b2[_0x200b53(0x19b)]??![],'next':_0x4158ca(_0x4428b2[_0x200b53(0x253)])};})),'next':_0x4158ca(_0x17191b[_0x3993c9(0x253)])};}case _0x3993c9(0x1c3):{const _0x44b6e3=_0x18609d,_0x25cf59=_0x44b6e3[_0x3993c9(0x20f)];return{'type':'ABTest','name':_0x44b6e3['name'],'customizedSplit':_0x25cf59[_0x3993c9(0x22f)],'uniqueId':_0x25cf59[_0x3993c9(0x199)],'variants':_0x25cf59[_0x3993c9(0x1ff)][_0x3993c9(0x1ef)](_0x51ba17=>({'id':_0x51ba17['id']||generateUUID(),'name':_0x51ba17[_0x3993c9(0x1a5)],'percentage':_0x51ba17['percentage'],'next':_0x4158ca(_0x51ba17[_0x3993c9(0x253)])})),'next':_0x4158ca(_0x44b6e3['next'])};}case _0x3993c9(0x24e):return{'type':'Merge','name':_0x18609d[_0x3993c9(0x1a5)],'next':_0x4158ca(_0x18609d[_0x3993c9(0x253)])};case _0x3993c9(0x20a):{const _0x389220=_0x18609d,_0x46db92=_0x389220[_0x3993c9(0x20f)]['target'],_0x918cc0=_0x46db92[_0x3993c9(0x237)],_0x10edaa=_0x46db92[_0x3993c9(0x1e3)];let _0x3b9cfa=_0x46db92[_0x3993c9(0x237)];_0x3cdcb2?.['resolveJourneyId']&&!/^\d+$/['test'](_0x3b9cfa)&&(_0x3b9cfa=await _0x3cdcb2[_0x3993c9(0x19c)](_0x3b9cfa));let _0x58b203=_0x46db92['stage'];_0x3cdcb2?.[_0x3993c9(0x197)]&&!/^\d+$/[_0x3993c9(0x210)](_0x58b203)&&(_0x58b203=await _0x3cdcb2['resolveStageId'](_0x3b9cfa,_0x58b203));const _0x4a1aad=!/^\d+$/[_0x3993c9(0x210)](_0x918cc0)&&!isLocalJourneyRef(_0x918cc0)?formatApiJourneyName(_0x918cc0,_0x10edaa):undefined;return{'type':_0x3993c9(0x1ac),'name':_0x389220[_0x3993c9(0x1a5)],'target':{'journeyId':_0x3b9cfa,'journeyStageId':_0x58b203,'journeyBundleId':_0x46db92[_0x3993c9(0x223)],'journeyName':_0x4a1aad,'confirmed':!![]},'next':_0x4158ca(_0x389220[_0x3993c9(0x253)])};}case _0x3993c9(0x1f5):return{'type':_0x3993c9(0x205),'name':_0x18609d[_0x3993c9(0x1a5)]};default:{const _0x2b39fc=_0x18609d;return{'type':'End','name':_0x2b39fc[_0x3993c9(0x1a5)]};}}}export function toYamlString(_0xa3190){const _0x2111af=a147_0x3a14,_0x3ed2b0=stripInternalFields(_0xa3190),_0x3be74e=a147_0x327dd2[_0x2111af(0x239)](_0x3ed2b0,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x2111af(0x1d1)}),_0x29a113=[_0x2111af(0x252),'activations:',_0x2111af(0x1ce),_0x2111af(0x248),_0x2111af(0x23d),'stages:','versions:'];let _0x1166ed=_0x3be74e;for(const _0x4471cb of _0x29a113){_0x1166ed=_0x1166ed[_0x2111af(0x1ad)](new RegExp('^('+_0x4471cb+')','m'),(_0x1c5fba,_0x27fba8,_0x5d4ff5)=>{if(_0x5d4ff5===0x0||_0x1166ed[_0x5d4ff5-0x1]==='\x0a'&&_0x1166ed[_0x5d4ff5-0x2]==='\x0a')return _0x27fba8;return'\x0a'+_0x27fba8;});}return _0x1166ed;}function stripInternalFields(_0x56d6f8){const _0x51ed1f=a147_0x3a14,{id:_0x39471c,folder_id:_0x2b15d1,bundle_id:_0x48c497,bundle_name:_0x22d7fe,version:_0x4f23b0,allow_reentry:_0x170995,..._0x517586}=_0x56d6f8;return _0x517586[_0x51ed1f(0x1e5)]&&(_0x517586['journeys']=_0x517586['journeys'][_0x51ed1f(0x1ef)](_0x3d8371=>{const _0x4c80cb=_0x51ed1f,{id:_0x580e55,..._0x10afc7}=_0x3d8371;return{..._0x10afc7,'stages':_0x10afc7['stages'][_0x4c80cb(0x1ef)](stripStageInternalFields),..._0x3d8371[_0x4c80cb(0x1dd)]===!![]?{'latest':!![]}:{},..._0x517586[_0x4c80cb(0x1e5)]['length']===0x1&&_0x10afc7[_0x4c80cb(0x226)]==='v1'?{'version':undefined}:{}};})),_0x517586[_0x51ed1f(0x1a9)]&&(_0x517586[_0x51ed1f(0x1a9)]=_0x517586[_0x51ed1f(0x1a9)][_0x51ed1f(0x1ef)](stripStageInternalFields)),_0x517586['versions']&&(_0x517586[_0x51ed1f(0x1c0)]=_0x517586[_0x51ed1f(0x1c0)]['map'](_0xcbc584=>{const _0x3ccf46=_0x51ed1f,{id:_0x237546,..._0x584504}=_0xcbc584;return{..._0x584504,'stages':_0x584504['stages'][_0x3ccf46(0x1ef)](stripStageInternalFields),..._0xcbc584[_0x3ccf46(0x1dd)]===!![]?{'latest':!![]}:{}};})),_0x517586;}function stripStageInternalFields(_0x50a488){const {id:_0x1be010,..._0x3434be}=_0x50a488;return _0x3434be;}export function parseYamlString(_0x49b1fd){return safeParseYaml(_0x49b1fd,JourneyDefSchema);}export function isJourneyDef(_0x2bc9bb){const _0x4f856a=a147_0x3a14;return typeof _0x2bc9bb==='object'&&_0x2bc9bb!==null&&_0x4f856a(0x1fb)in _0x2bc9bb&&_0x2bc9bb['type']===_0x4f856a(0x237);}export function generateTemplate(_0x1a65e8,_0x1d8967){const _0xda4d16=a147_0x3a14,_0x1f973f={'type':_0xda4d16(0x237),'name':_0x1a65e8,'description':'Journey\x20description','reentry':_0xda4d16(0x221),'goal':{'name':'Goal\x20Achieved','segment':'goal-segment'},'stages':[{'name':_0xda4d16(0x1c5),'description':_0xda4d16(0x1df),'entry_criteria':{'name':_0xda4d16(0x1d5),'segment':_0x1d8967},'steps':[{'type':_0xda4d16(0x1b7),'name':_0xda4d16(0x21b),'with':{'duration':0x1,'unit':_0xda4d16(0x1ae)}},{'type':_0xda4d16(0x1a6),'name':_0xda4d16(0x1da),'with':{'activation':_0xda4d16(0x23b)}},{'type':_0xda4d16(0x1f5),'name':_0xda4d16(0x1c4)}]}]};return toYamlString(_0x1f973f);}function generateUUID(){const _0x13e520=a147_0x3a14;return crypto[_0x13e520(0x1f6)]();}export const SEGMENT_REF_PREFIX=a147_0x4d9c99(0x24c);export function parseSegmentRef(_0x7cb59d){const _0x3c44bb=a147_0x4d9c99;if(_0x7cb59d[_0x3c44bb(0x217)](SEGMENT_REF_PREFIX))return{'type':_0x3c44bb(0x1c2),'name':_0x7cb59d['slice'](SEGMENT_REF_PREFIX[_0x3c44bb(0x1e2)])};if(/^\d+$/[_0x3c44bb(0x210)](_0x7cb59d))return{'type':'id','name':_0x7cb59d};return{'type':_0x3c44bb(0x1a4),'name':_0x7cb59d};}export function makeSegmentRef(_0x3c3e54){return''+SEGMENT_REF_PREFIX+_0x3c3e54;}export function isExternalSegmentRef(_0x2b9ddb){const _0x4b9286=a147_0x4d9c99;return _0x2b9ddb[_0x4b9286(0x217)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x2f2fc7){const _0x35d137=a147_0x4d9c99;return!!(_0x2f2fc7[_0x35d137(0x1e5)]&&_0x2f2fc7[_0x35d137(0x1e5)][_0x35d137(0x1e2)]>0x0);}export function isMultiVersionMode(_0x4e75d0){const _0x48459c=a147_0x4d9c99;return!!(_0x4e75d0['versions']&&_0x4e75d0[_0x48459c(0x1c0)][_0x48459c(0x1e2)]>0x0);}export function isSingleVersionMode(_0x3fb2f5){const _0xd52df6=a147_0x4d9c99;return!!(_0x3fb2f5['stages']&&_0x3fb2f5[_0xd52df6(0x1a9)]['length']>0x0);}export function hasMultipleVersions(_0x402313){const _0x2c4b19=a147_0x4d9c99;if(isJourneysArrayMode(_0x402313))return(_0x402313['journeys']?.[_0x2c4b19(0x1e2)]||0x0)>0x1;if(isMultiVersionMode(_0x402313))return(_0x402313['versions']?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x24a4e0){const _0x15865d=a147_0x4d9c99;if(isJourneysArrayMode(_0x24a4e0))return _0x24a4e0;if(isSingleVersionMode(_0x24a4e0)){const {stages:_0x572561,id:_0x2d0b25,version:_0x92c3b1,version_number:_0x44ec48,..._0x4c08af}=_0x24a4e0;return{..._0x4c08af,'journeys':[{'version':_0x92c3b1||'v1','stages':_0x572561||[],'id':_0x2d0b25,'version_number':_0x44ec48}]};}if(isMultiVersionMode(_0x24a4e0)){const {versions:_0x27b10,..._0xa26995}=_0x24a4e0;return{..._0xa26995,'journeys':(_0x27b10||[])['map'](_0x47be59=>({'version':_0x47be59['name'],'state':_0x47be59[_0x15865d(0x1cf)],'latest':_0x47be59['latest'],'stages':_0x47be59[_0x15865d(0x1a9)],'id':_0x47be59['id'],'version_number':_0x47be59['version_number']}))};}return _0x24a4e0;}export function normalizeJourneyDef(_0x49dc4c,_0x5a369f){const _0x38d313=a147_0x4d9c99,_0xb3b7c5=normalizeToJourneysFormat(_0x49dc4c),_0x1710ab=_0x5a369f?.[_0x38d313(0x20d)]?Object[_0x38d313(0x1c7)](_0x5a369f[_0x38d313(0x20d)]):undefined,_0x1bd692=_0x5a369f?.[_0x38d313(0x1b6)]?Object[_0x38d313(0x1c7)](_0x5a369f[_0x38d313(0x1b6)]):undefined;return{'type':_0x38d313(0x237),'name':_0xb3b7c5['name'],..._0xb3b7c5[_0x38d313(0x225)]!==undefined&&{'description':_0xb3b7c5['description']},..._0xb3b7c5[_0x38d313(0x22b)]&&{'goal':normalizeJourneyCriteria(_0xb3b7c5[_0x38d313(0x22b)])},..._0xb3b7c5['reentry']!==undefined&&{'reentry':_0xb3b7c5[_0x38d313(0x1e9)]},..._0xb3b7c5[_0x38d313(0x20d)]&&{'segments':normalizeEmbeddedSegments(_0xb3b7c5[_0x38d313(0x20d)],_0x1710ab)},..._0xb3b7c5[_0x38d313(0x1b6)]&&{'activations':normalizeEmbeddedActivations(_0xb3b7c5['activations'],_0x1bd692)},..._0xb3b7c5[_0x38d313(0x1e5)]&&{'journeys':_0xb3b7c5[_0x38d313(0x1e5)][_0x38d313(0x1ef)](_0x114b63=>normalizeJourneyEntry(_0x114b63,_0xb3b7c5[_0x38d313(0x1e5)][_0x38d313(0x1e2)]===0x1))}};}function normalizeJourneyEntry(_0xf012b6,_0x560c49){const _0xbaacc0=a147_0x4d9c99;return{...!_0x560c49&&_0xf012b6[_0xbaacc0(0x226)]!==undefined&&{'version':_0xf012b6['version']},..._0xf012b6[_0xbaacc0(0x1cf)]!==undefined&&{'state':_0xf012b6['state']},...!_0x560c49&&_0xf012b6['latest']!==undefined&&{'latest':_0xf012b6['latest']},..._0xf012b6[_0xbaacc0(0x1c9)]!==undefined&&{'version_number':_0xf012b6[_0xbaacc0(0x1c9)]},..._0xf012b6[_0xbaacc0(0x22b)]&&{'goal':normalizeJourneyCriteria(_0xf012b6['goal'])},..._0xf012b6[_0xbaacc0(0x1e9)]!==undefined&&{'reentry':_0xf012b6[_0xbaacc0(0x1e9)]},'stages':_0xf012b6[_0xbaacc0(0x1a9)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x1d341f){const _0x29c1b8=a147_0x4d9c99;return{'name':_0x1d341f[_0x29c1b8(0x1a5)],..._0x1d341f['description']!==undefined&&{'description':_0x1d341f[_0x29c1b8(0x225)]},..._0x1d341f[_0x29c1b8(0x21f)]&&{'entry_criteria':normalizeJourneyCriteria(_0x1d341f[_0x29c1b8(0x21f)])},..._0x1d341f[_0x29c1b8(0x1c6)]&&{'exit_criteria':_0x1d341f[_0x29c1b8(0x1c6)]['map'](normalizeJourneyCriteria)},..._0x1d341f[_0x29c1b8(0x1ec)]&&{'milestone':normalizeJourneyCriteria(_0x1d341f['milestone'])},..._0x1d341f['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x1d341f[_0x29c1b8(0x206)])}};}function normalizeStepsWithImplicitNext(_0x35a906){const _0x47c17f=a147_0x4d9c99;return _0x35a906[_0x47c17f(0x1ef)]((_0x57a6d1,_0x31018b)=>{const _0x5c160e=_0x47c17f,_0x58314c=_0x31018b<_0x35a906['length']-0x1?_0x35a906[_0x31018b+0x1][_0x5c160e(0x1a5)]:undefined;return normalizeJourneyStep(_0x57a6d1,_0x58314c);});}function normalizeJourneyCriteria(_0x1c74cd){const _0xe29a16=a147_0x4d9c99;return{'name':_0x1c74cd[_0xe29a16(0x1a5)],..._0x1c74cd[_0xe29a16(0x225)]!==undefined&&{'description':_0x1c74cd[_0xe29a16(0x225)]},'segment':_0x1c74cd[_0xe29a16(0x208)],..._0x1c74cd['target']&&{'target':normalizeJumpTarget(_0x1c74cd['target'])}};}function normalizeJourneyStep(_0xbb80af,_0xb3260a){const _0x5557f2=a147_0x4d9c99,_0x793ec=_0xbb80af[_0x5557f2(0x253)]!==undefined&&_0xbb80af[_0x5557f2(0x253)]!==_0xb3260a,_0x3500a9={'type':_0xbb80af[_0x5557f2(0x1fb)],'name':_0xbb80af[_0x5557f2(0x1a5)],..._0x793ec&&{'next':_0xbb80af[_0x5557f2(0x253)]}};if(_0x5557f2(0x20f)in _0xbb80af&&_0xbb80af[_0x5557f2(0x20f)])return{..._0x3500a9,'with':normalizeStepParams(_0xbb80af['type'],_0xbb80af[_0x5557f2(0x20f)])};return _0x3500a9;}function normalizeStepParams(_0x55a2ab,_0xad3320){const _0x51c4c1=a147_0x4d9c99;switch(_0x55a2ab){case _0x51c4c1(0x1b7):{const _0x27a2e2=_0xad3320;let _0x33f83f;return _0x27a2e2[_0x51c4c1(0x24b)]&&(_0x33f83f={'segment':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x208)],..._0x27a2e2['condition'][_0x51c4c1(0x253)]!==undefined&&{'next':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x253)]},..._0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)]&&{'timeout':{'duration':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x1eb)],'unit':_0x27a2e2['condition']['timeout'][_0x51c4c1(0x222)],..._0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x253)]!==undefined&&{'next':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x253)]}}}}),{..._0x27a2e2['duration']!==undefined&&{'duration':_0x27a2e2[_0x51c4c1(0x1eb)]},..._0x27a2e2[_0x51c4c1(0x222)]!==undefined&&{'unit':_0x27a2e2['unit']},..._0x27a2e2[_0x51c4c1(0x218)]!==undefined&&{'wait_until':_0x27a2e2[_0x51c4c1(0x218)]},..._0x27a2e2[_0x51c4c1(0x1f2)]!==undefined&&{'days_of_week':_0x27a2e2[_0x51c4c1(0x1f2)]},..._0x33f83f&&{'condition':_0x33f83f}};}case _0x51c4c1(0x1a6):{const _0x799d24=_0xad3320;return{'activation':_0x799d24[_0x51c4c1(0x1a6)]};}case _0x51c4c1(0x255):{const _0x57e474=_0xad3320;return{'branches':_0x57e474[_0x51c4c1(0x216)][_0x51c4c1(0x1ef)](normalizeDecisionBranch)};}case _0x51c4c1(0x1c3):{const _0xb621b=_0xad3320;return{..._0xb621b[_0x51c4c1(0x22f)]!==undefined&&{'customized_split':_0xb621b[_0x51c4c1(0x22f)]},..._0xb621b[_0x51c4c1(0x199)]!==undefined&&{'unique_id':_0xb621b[_0x51c4c1(0x199)]},'variants':_0xb621b['variants']['map'](normalizeAbTestVariant)};}case _0x51c4c1(0x20a):{const _0x433eb4=_0xad3320;return{'target':normalizeJumpTarget(_0x433eb4[_0x51c4c1(0x215)])};}default:return _0xad3320;}}function normalizeDecisionBranch(_0x31bd47){const _0x569631=a147_0x4d9c99;return{'name':_0x31bd47[_0x569631(0x1a5)],..._0x31bd47[_0x569631(0x208)]!==undefined&&{'segment':_0x31bd47[_0x569631(0x208)]},..._0x31bd47[_0x569631(0x19b)]!==undefined&&{'excluded':_0x31bd47[_0x569631(0x19b)]},..._0x31bd47[_0x569631(0x253)]!==undefined&&{'next':_0x31bd47[_0x569631(0x253)]}};}function normalizeAbTestVariant(_0x58fd3e){const _0x5cdbb0=a147_0x4d9c99;return{..._0x58fd3e['id']!==undefined&&{'id':_0x58fd3e['id']},'name':_0x58fd3e[_0x5cdbb0(0x1a5)],'percentage':_0x58fd3e[_0x5cdbb0(0x1e7)],..._0x58fd3e[_0x5cdbb0(0x253)]!==undefined&&{'next':_0x58fd3e[_0x5cdbb0(0x253)]}};}function normalizeJumpTarget(_0x557476){const _0x138ba4=a147_0x4d9c99;return{'journey':_0x557476[_0x138ba4(0x237)],'stage':_0x557476[_0x138ba4(0x1e3)],..._0x557476[_0x138ba4(0x223)]!==undefined&&{'bundle_id':_0x557476[_0x138ba4(0x223)]}};}function normalizeEmbeddedSegments(_0x24ac8e,_0x5d63a8){const _0x4cb77a=a147_0x4d9c99,_0x167eeb={},_0x409e14=Object[_0x4cb77a(0x1c7)](_0x24ac8e),_0xc6aa30=_0x5d63a8?[..._0x5d63a8['filter'](_0x28b262=>_0x409e14[_0x4cb77a(0x209)](_0x28b262)),..._0x409e14[_0x4cb77a(0x236)](_0x2611d8=>!_0x5d63a8[_0x4cb77a(0x209)](_0x2611d8))[_0x4cb77a(0x1bf)]()]:_0x409e14[_0x4cb77a(0x1bf)]();for(const _0x36a177 of _0xc6aa30){const _0x34728f=_0x24ac8e[_0x36a177];if(_0x34728f[_0x4cb77a(0x1f3)]){const _0x3892a5=_0x34728f[_0x4cb77a(0x1f3)];if(_0x3892a5[_0x4cb77a(0x1fb)]!==_0x4cb77a(0x254)&&_0x3892a5['type']!=='Or'){const _0x5ad812=_0x3892a5[_0x4cb77a(0x1fb)]??_0x4cb77a(0x20e);throw new SDKError(ErrorCode[_0x4cb77a(0x230)],_0x4cb77a(0x1a0)+_0x36a177+'\x27:\x20'+(_0x4cb77a(0x1b5)+_0x5ad812+_0x4cb77a(0x21a))+'Expected\x20format:\x0a'+_0x4cb77a(0x1fa)+_0x4cb77a(0x1a3)+'\x20\x20\x20\x20conditions:\x0a'+_0x4cb77a(0x19d)+_0x4cb77a(0x203)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x3892a5[_0x4cb77a(0x1af)]||!Array[_0x4cb77a(0x241)](_0x3892a5['conditions']))throw new SDKError(ErrorCode[_0x4cb77a(0x230)],_0x4cb77a(0x1a0)+_0x36a177+_0x4cb77a(0x21e)+_0x4cb77a(0x1aa)+_0x4cb77a(0x1b3)+_0x4cb77a(0x1fa)+(_0x4cb77a(0x1ed)+_0x3892a5[_0x4cb77a(0x1fb)]+'\x0a')+_0x4cb77a(0x233)+_0x4cb77a(0x19d)+_0x4cb77a(0x203)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x167eeb[_0x36a177]={..._0x34728f[_0x4cb77a(0x225)]&&_0x34728f[_0x4cb77a(0x225)]['trim']()&&{'description':_0x34728f['description']},..._0x34728f[_0x4cb77a(0x1f3)]&&{'rule':deepSortObject(_0x34728f[_0x4cb77a(0x1f3)])}};}return _0x167eeb;}function normalizeEmbeddedActivations(_0x5fd6a4,_0x4ea807){const _0x47f741=a147_0x4d9c99,_0x5040e1={},_0x536b58=Object[_0x47f741(0x1c7)](_0x5fd6a4),_0x360092=_0x4ea807?[..._0x4ea807[_0x47f741(0x236)](_0x41b4e1=>_0x536b58[_0x47f741(0x209)](_0x41b4e1)),..._0x536b58['filter'](_0x3e6fc4=>!_0x4ea807['includes'](_0x3e6fc4))[_0x47f741(0x1bf)]()]:_0x536b58['sort']();for(const _0x8bf5b7 of _0x360092){const _0x36c148=_0x5fd6a4[_0x8bf5b7];_0x5040e1[_0x8bf5b7]={'name':_0x36c148['name'],'connection':_0x36c148[_0x47f741(0x229)],..._0x36c148[_0x47f741(0x225)]!==undefined&&{'description':_0x36c148[_0x47f741(0x225)]},..._0x36c148['all_columns']!==undefined&&{'all_columns':_0x36c148['all_columns']},..._0x36c148['columns']!==undefined&&{'columns':_0x36c148[_0x47f741(0x1c8)]},..._0x36c148[_0x47f741(0x1b4)]!==undefined&&{'behavior':_0x36c148[_0x47f741(0x1b4)]},..._0x36c148[_0x47f741(0x1b2)]!==undefined&&{'schedule':_0x36c148['schedule']},..._0x36c148[_0x47f741(0x249)]!==undefined&&{'notification':_0x36c148[_0x47f741(0x249)]},..._0x36c148['connector_config']!==undefined&&{'connector_config':_0x36c148[_0x47f741(0x244)]},..._0x36c148[_0x47f741(0x23e)]!==undefined&&{'activation_template_id':_0x36c148[_0x47f741(0x23e)]}};}return _0x5040e1;}export function getActiveStages(_0x14282f){const _0x1134ac=a147_0x4d9c99;if(isJourneysArrayMode(_0x14282f)){const _0x1a5829=_0x14282f['journeys']||[],_0x3a1ab4=_0x1a5829[_0x1134ac(0x23a)](_0x7826ef=>_0x7826ef[_0x1134ac(0x1dd)]===!![])||_0x1a5829[0x0];return _0x3a1ab4?.['stages']||[];}if(isSingleVersionMode(_0x14282f))return _0x14282f[_0x1134ac(0x1a9)]||[];if(isMultiVersionMode(_0x14282f)){const _0x1fde7b=_0x14282f[_0x1134ac(0x1c0)]||[],_0x36ef07=_0x1fde7b['find'](_0x1288b6=>_0x1288b6['latest']===!![])||_0x1fde7b[0x0];return _0x36ef07?.[_0x1134ac(0x1a9)]||[];}return[];}export function getLatestJourneyEntry(_0x1d2edd){const _0x45f5a9=a147_0x4d9c99;if(isJourneysArrayMode(_0x1d2edd)){const _0x5945c1=_0x1d2edd[_0x45f5a9(0x1e5)]||[];return _0x5945c1['find'](_0x1c2738=>_0x1c2738['latest']===!![])||_0x5945c1[0x0];}if(isMultiVersionMode(_0x1d2edd)){const _0x1d5fd0=_0x1d2edd[_0x45f5a9(0x1c0)]||[],_0x1e4f3b=_0x1d5fd0['find'](_0x2f2a44=>_0x2f2a44[_0x45f5a9(0x1dd)]===!![])||_0x1d5fd0[0x0];if(_0x1e4f3b)return{'version':_0x1e4f3b[_0x45f5a9(0x1a5)],'state':_0x1e4f3b[_0x45f5a9(0x1cf)],'latest':_0x1e4f3b[_0x45f5a9(0x1dd)],'stages':_0x1e4f3b[_0x45f5a9(0x1a9)],'id':_0x1e4f3b['id'],'version_number':_0x1e4f3b[_0x45f5a9(0x1c9)]};}if(isSingleVersionMode(_0x1d2edd))return{'version':_0x1d2edd[_0x45f5a9(0x226)]||'v1','state':_0x45f5a9(0x1f1),'stages':_0x1d2edd[_0x45f5a9(0x1a9)]||[],'id':_0x1d2edd['id'],'version_number':_0x1d2edd['version_number'],'goal':_0x1d2edd[_0x45f5a9(0x22b)],'reentry':_0x1d2edd[_0x45f5a9(0x1e9)]};return undefined;}export function getLatestVersion(_0x48ac2d){const _0x40d348=a147_0x4d9c99;if(!isMultiVersionMode(_0x48ac2d))return undefined;const _0x47fdc6=_0x48ac2d[_0x40d348(0x1c0)]||[];return _0x47fdc6[_0x40d348(0x23a)](_0x3daf2a=>_0x3daf2a[_0x40d348(0x1dd)]===!![])||_0x47fdc6[0x0];}export function getEffectiveGoal(_0x3cc17f){const _0x15f102=a147_0x4d9c99,_0x26f14c=getLatestJourneyEntry(_0x3cc17f);return _0x26f14c?.[_0x15f102(0x22b)]||_0x3cc17f['goal'];}export function getEffectiveReentry(_0x195a6b){const _0x3726f2=a147_0x4d9c99,_0x34bafb=getLatestJourneyEntry(_0x195a6b);return _0x34bafb?.[_0x3726f2(0x1e9)]||_0x195a6b['reentry'];}export function collectSegmentRefs(_0x4b9264){const _0x2d4e29=a147_0x4d9c99,_0x1dc97b=new Set();_0x4b9264[_0x2d4e29(0x22b)]?.[_0x2d4e29(0x208)]&&_0x1dc97b[_0x2d4e29(0x195)](_0x4b9264['goal'][_0x2d4e29(0x208)]);const _0x294274=_0x10c8c4=>{const _0x164012=_0x2d4e29;for(const _0xf6b5cd of _0x10c8c4){_0xf6b5cd[_0x164012(0x21f)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0xf6b5cd[_0x164012(0x21f)]['segment']);if(_0xf6b5cd['exit_criteria'])for(const _0x560d88 of _0xf6b5cd[_0x164012(0x1c6)]){_0x560d88[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0x560d88['segment']);}_0xf6b5cd[_0x164012(0x1ec)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0xf6b5cd[_0x164012(0x1ec)]['segment']);if(_0xf6b5cd[_0x164012(0x206)])for(const _0x40db62 of _0xf6b5cd[_0x164012(0x206)]){if(_0x40db62['type']==='decision_point'){const _0x58ffe7=_0x40db62;for(const _0x40b447 of _0x58ffe7[_0x164012(0x20f)][_0x164012(0x216)]){_0x40b447[_0x164012(0x208)]&&_0x1dc97b['add'](_0x40b447[_0x164012(0x208)]);}}else{if(_0x40db62[_0x164012(0x1fb)]===_0x164012(0x1b7)){const _0x54f56d=_0x40db62;_0x54f56d['with'][_0x164012(0x24b)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0x54f56d[_0x164012(0x20f)]['condition'][_0x164012(0x208)]);}}}}};_0x4b9264[_0x2d4e29(0x1a9)]&&_0x294274(_0x4b9264[_0x2d4e29(0x1a9)]);if(_0x4b9264[_0x2d4e29(0x1c0)])for(const _0x1b41a5 of _0x4b9264[_0x2d4e29(0x1c0)]){_0x294274(_0x1b41a5[_0x2d4e29(0x1a9)]);}return _0x1dc97b;}export function validateSegmentRefs(_0x1739ba){const _0x2bff00=a147_0x4d9c99,_0xd7d76c=[],_0xb546a3=collectSegmentRefs(_0x1739ba),_0x16d0f7=new Set(Object[_0x2bff00(0x1c7)](_0x1739ba['segments']||{}));for(const _0x30e5bf of _0xb546a3){const _0xd0db04=parseSegmentRef(_0x30e5bf);_0xd0db04['type']===_0x2bff00(0x1a4)&&!_0x16d0f7[_0x2bff00(0x21d)](_0xd0db04[_0x2bff00(0x1a5)])&&_0xd7d76c[_0x2bff00(0x20c)](_0x2bff00(0x1b0)+_0xd0db04[_0x2bff00(0x1a5)]+_0x2bff00(0x1fc)+_0xd0db04[_0x2bff00(0x1a5)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0xd7d76c;}function a147_0x28af(){const _0x591466=['\x20\x20\x20\x20type:\x20And\x0a','embedded','name','activation','versionNumber','Met\x20condition(s)','stages','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','951246JLAsbb','Jump','replace','day','conditions','Unknown\x20segment\x20\x22','launched','schedule','Expected\x20format:\x0a','behavior','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','activations','wait','set','exitCriterias','stageName','journeyActivationStepId','ABTest','journeyBundleId','root_step','sort','versions','all','ref','ab_test','Stage\x20Complete','Stage\x201','exit_criteria','keys','columns','version_number','4iGqsts','uuid','resolveSegment','189693MpxHTa','goal:','state','waitStepUnit','null','26ibJSgI','*Max\x20wait\x20','reentry_always','Entry\x20Criteria','197920StoGAZ','AbTest','210970hixZsf','relationships','Send\x20Notification','conditionTimeoutDuration','resolveActivation','latest','conditionTimeoutUnit','First\x20stage\x20of\x20the\x20journey','8GUnBng','resolveActivationName','length','stage','WaitStep','journeys','Condition','percentage','size','reentry','resolveJumpTarget','duration','milestone','\x20\x20\x20\x20type:\x20','moveAfter','map','weeks','draft','days_of_week','rule','parentFolder','end','randomUUID','isJourneyLocal','reentryMode','folder','\x20\x20rule:\x0a','type','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','trim','data','variants','definition','timeout','attributes','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','excludedPath','End','steps','shift','segment','includes','jump','676920vLbLEd','push','segments','(missing)','with','test','bundle_name','resolveSegmentName','week','Duration','target','branches','startsWith','wait_until','journeyStageId','\x27.\x0a','Wait\x201\x20Day','Activation','has','\x27:\x20','entry_criteria','resolveEmbeddedSegmentId','no_reentry','unit','bundle_id','1297758nsgILC','description','version','entryCriteria','journeyStages','connection','journeyId','goal','waitStepType','days','segmentId','customized_split','JOURNEY_SYNTAX_ERROR','waitStep','get','\x20\x20\x20\x20conditions:\x0a','stageId','DecisionPoint','filter','journey','waitCondition','stringify','find','your-activation-name','object','journeys:','activation_template_id','allowReentry','timedOutPath','isArray','journeyName','conditionSegmentId','connector_config','exitCriteria','19419cQIbAP','toLowerCase','reentry:','notification','Date','condition','ref:','DaysOfTheWeek','merge','daysOfWeek','resolveActivationId','entries','segments:','next','And','decision_point','match','waitUntilDate','add','uniqueId','resolveStageId','resolveSegmentId','unique_id','from','excluded','resolveJourneyId','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','journeyBundleName','folder_id','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','segment_id','resolveEmbeddedActivationId'];a147_0x28af=function(){return _0x591466;};return a147_0x28af();}export function collectSegmentIdsFromJourneyApi(_0x40d09a){const _0x34af5b=a147_0x4d9c99,_0xf284e1=new Set();_0x40d09a['attributes'][_0x34af5b(0x22b)]?.[_0x34af5b(0x22e)]&&_0xf284e1['add'](_0x40d09a['attributes'][_0x34af5b(0x22b)][_0x34af5b(0x22e)]);const _0x2cbf1b=_0x40d09a['attributes'][_0x34af5b(0x228)];if(Array['isArray'](_0x2cbf1b))for(const _0x56f551 of _0x2cbf1b){_0x56f551['entryCriteria']?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x56f551['entryCriteria'][_0x34af5b(0x22e)]);const _0x249f8c=_0x56f551[_0x34af5b(0x1b9)]??_0x56f551[_0x34af5b(0x245)];if(Array[_0x34af5b(0x241)](_0x249f8c))for(const _0x5ec46f of _0x249f8c){_0x5ec46f['segmentId']&&_0xf284e1[_0x34af5b(0x195)](_0x5ec46f[_0x34af5b(0x22e)]);}_0x56f551[_0x34af5b(0x1ec)]?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x56f551[_0x34af5b(0x1ec)][_0x34af5b(0x22e)]);if(_0x56f551[_0x34af5b(0x206)]&&typeof _0x56f551[_0x34af5b(0x206)]===_0x34af5b(0x23c)){const _0x143afc=Array[_0x34af5b(0x241)](_0x56f551[_0x34af5b(0x206)])?_0x56f551[_0x34af5b(0x206)]:Object['values'](_0x56f551[_0x34af5b(0x206)]);for(const _0x4a6b19 of _0x143afc){_0x4a6b19[_0x34af5b(0x238)]?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x4a6b19[_0x34af5b(0x238)][_0x34af5b(0x22e)]);const _0x4cb0f7=_0x4a6b19;_0x4cb0f7[_0x34af5b(0x243)]&&_0xf284e1[_0x34af5b(0x195)](_0x4cb0f7['conditionSegmentId']);if(Array[_0x34af5b(0x241)](_0x4cb0f7[_0x34af5b(0x1af)]))for(const _0x4cad0e of _0x4cb0f7[_0x34af5b(0x1af)]){_0x4cad0e[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x4cad0e[_0x34af5b(0x22e)]);}if(Array[_0x34af5b(0x241)](_0x4a6b19[_0x34af5b(0x216)]))for(const _0x294e51 of _0x4a6b19['branches']){_0x294e51['segmentId']&&_0xf284e1[_0x34af5b(0x195)](_0x294e51[_0x34af5b(0x22e)]);}}}}return _0xf284e1;}
1
+ function a147_0x5076(_0x134c22,_0x1847f8){_0x134c22=_0x134c22-0x1e2;const _0x47e67a=a147_0x47e6();let _0x507672=_0x47e67a[_0x134c22];return _0x507672;}const a147_0x3557e0=a147_0x5076;(function(_0x593efc,_0x160f40){const _0xece2e=a147_0x5076,_0x30cf9b=_0x593efc();while(!![]){try{const _0xa55c56=parseInt(_0xece2e(0x251))/0x1+parseInt(_0xece2e(0x25a))/0x2*(-parseInt(_0xece2e(0x280))/0x3)+parseInt(_0xece2e(0x285))/0x4*(-parseInt(_0xece2e(0x241))/0x5)+parseInt(_0xece2e(0x218))/0x6+-parseInt(_0xece2e(0x22d))/0x7+-parseInt(_0xece2e(0x281))/0x8+parseInt(_0xece2e(0x26e))/0x9;if(_0xa55c56===_0x160f40)break;else _0x30cf9b['push'](_0x30cf9b['shift']());}catch(_0x320168){_0x30cf9b['push'](_0x30cf9b['shift']());}}}(a147_0x47e6,0x4e16d));import*as a147_0x2b5319 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';function a147_0x47e6(){const _0x1d749e=['WaitStep','\x20\x20rule:\x0a','Entry\x20Criteria','trim','versions:','goal','branches','\x27.\x0a','resolveEmbeddedSegmentId','resolveActivationId','activations','wait_until','attributes','test','parentFolder','bundle_name','add','Wait\x201\x20Day','schedule','resolveJourneyId','your-activation-name','waitStep','definition','conditions','steps','reentry_always','null','bundle_id','Met\x20condition(s)','jump','with','Jump','DecisionPoint','launched','resolveSegmentName','set','keys','customizedSplit','journeyStages','condition','Send\x20Notification','(missing)','Activation','stages:','columns','journeyName','push','exitCriteria','all','ref:','decision_point','ab_test','resolveStageId','moveAfter','end','resolveActivation','stageId','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','next','JOURNEY_SYNTAX_ERROR','filter','conditionSegmentId','journeys:','2866470eZOmKM','days','waitCondition','Date','excluded','randomUUID','customized_split','relationships','sort','waitUntilDate','shift','isArray','journeyId','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','resolveSegmentId','activation','End','variants','And','resolveSegment','journeys','2060772RiDnek','versionNumber','exit_criteria','version','Condition','journey','conditionTimeoutDuration','Goal\x20Achieved','exitCriterias','duration','folder_id','toLowerCase','Variant','Stage\x20Complete','resolveEmbeddedActivationId','unit','object','length','goal:','no_reentry','55Oekpgx','ABTest','name','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','data','*Max\x20wait\x20','reentry:','root_step','all_columns','journeyBundleName','Journey\x20description','percentage','version_number','First\x20stage\x20of\x20the\x20journey','embedded','journeyBundleId','73587CdumRu','timedOutPath','behavior','slice','map','\x20\x20\x20\x20conditions:\x0a','has','stages','activations:','2464tpJlGA','allowReentry','find','milestone','wait','merge','unique_id','Expected\x20format:\x0a','get','Merge','DaysOfTheWeek','isJourneyLocal','target','resolveActivationName','Stage\x201','state','type','replace','rootStep','values','10804266XParSN','waitStepType','rule','includes','segment_id','stringify','description','journeyActivationStepId','startsWith','daysOfWeek','\x27:\x20','\x20\x20\x20\x20type:\x20And\x0a','connection','reentry','ref','segment','day','waitStepUnit','705HkCrPZ','4048288pLOrFk','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','timeout','latest','124364GHgzgS','activation_template_id','segmentId','notification','days_of_week','size','week','entry_criteria','draft','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','Duration','segments','connector_config','stageName','versions','entryCriteria','stage','uuid','conditionTimeoutUnit','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','journeyStageId','from'];a147_0x47e6=function(){return _0x1d749e;};return a147_0x47e6();}import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x30a889){const _0x111b0e=a147_0x5076,_0x48cd66=_0x30a889[_0x111b0e(0x238)]();if(_0x48cd66===_0x111b0e(0x219)||_0x48cd66===_0x111b0e(0x27e))return _0x111b0e(0x27e);if(_0x48cd66==='weeks'||_0x48cd66===_0x111b0e(0x28b))return _0x111b0e(0x28b);return _0x30a889;}export function journeyResponseToDefSync(_0x54c7b4){const _0x243db8=a147_0x5076,_0x5a16bc=_0x54c7b4[_0x243db8(0x1e5)],_0x915b2a=_0x5a16bc[_0x243db8(0x24a)]||_0x5a16bc[_0x243db8(0x243)],_0x52907c={'stages':_0x5a16bc[_0x243db8(0x1ff)]['map'](convertApiStageToYaml),'id':_0x54c7b4['id']};_0x5a16bc[_0x243db8(0x2a0)]&&(_0x52907c[_0x243db8(0x2a0)]=convertApiCriteriaToYaml(_0x5a16bc[_0x243db8(0x2a0)]));_0x5a16bc['name']&&_0x5a16bc['name']!==_0x915b2a&&(_0x52907c[_0x243db8(0x230)]=_0x5a16bc[_0x243db8(0x243)]);_0x5a16bc[_0x243db8(0x22e)]!==undefined&&(_0x52907c[_0x243db8(0x24d)]=_0x5a16bc[_0x243db8(0x22e)]);_0x5a16bc[_0x243db8(0x269)]&&(_0x52907c[_0x243db8(0x269)]=_0x5a16bc['state']===_0x243db8(0x1fa)?'launched':'draft');const _0x2f1b12={'type':'journey','name':_0x915b2a,'journeys':[_0x52907c]};_0x5a16bc[_0x243db8(0x274)]&&(_0x2f1b12['description']=_0x5a16bc[_0x243db8(0x274)]);_0x5a16bc[_0x243db8(0x2a0)]&&(_0x2f1b12[_0x243db8(0x2a0)]=convertApiCriteriaToYaml(_0x5a16bc[_0x243db8(0x2a0)]));if(_0x5a16bc['reentryMode'])_0x2f1b12[_0x243db8(0x27b)]=_0x5a16bc['reentryMode'];else _0x5a16bc[_0x243db8(0x25b)]!==undefined&&(_0x2f1b12[_0x243db8(0x27b)]=_0x5a16bc[_0x243db8(0x25b)]?_0x243db8(0x1f2):_0x243db8(0x240));return _0x5a16bc['journeyBundleId']&&(_0x2f1b12[_0x243db8(0x1f4)]=_0x5a16bc[_0x243db8(0x250)]),_0x5a16bc[_0x243db8(0x24a)]&&(_0x2f1b12[_0x243db8(0x1e8)]=_0x5a16bc[_0x243db8(0x24a)]),_0x54c7b4['relationships']?.[_0x243db8(0x1e7)]?.[_0x243db8(0x245)]?.['id']&&(_0x2f1b12[_0x243db8(0x237)]=_0x54c7b4['relationships'][_0x243db8(0x1e7)][_0x243db8(0x245)]['id']),_0x2f1b12;}export async function journeyResponseToDef(_0x52a9a7,_0xfd9d20){const _0x2c3860=a147_0x5076,_0xe6c4a7=journeyResponseToDefSync(_0x52a9a7);if(!_0xfd9d20)return _0xe6c4a7;const _0x53251b=new Set();collectSegmentIdsFromJourney(_0xe6c4a7,_0x53251b);const _0x33b473=new Set();collectActivationIdsFromJourney(_0xe6c4a7,_0x33b473);const _0x13e9ba={},_0x6816af=new Map();for(const _0x369cbf of Array[_0x2c3860(0x29a)](_0x53251b)[_0x2c3860(0x220)]()){if(_0xfd9d20['resolveSegment']){const _0x22486c=await _0xfd9d20[_0x2c3860(0x22b)](_0x369cbf);if(_0x22486c[_0x2c3860(0x265)]){_0x6816af[_0x2c3860(0x1fc)](_0x369cbf,_0x22486c[_0x2c3860(0x243)]);if(_0x22486c[_0x2c3860(0x1ef)]){const _0x364606={..._0x22486c[_0x2c3860(0x1ef)],'rule':deepSortObject(_0x22486c['definition'][_0x2c3860(0x270)])};_0x13e9ba[_0x22486c[_0x2c3860(0x243)]]=_0x364606;}}else _0x6816af[_0x2c3860(0x1fc)](_0x369cbf,makeSegmentRef(_0x22486c[_0x2c3860(0x243)]));}else{if(_0xfd9d20[_0x2c3860(0x1fb)]){const _0x2649ea=await _0xfd9d20['resolveSegmentName'](_0x369cbf);_0x6816af[_0x2c3860(0x1fc)](_0x369cbf,_0x2649ea);}}}const _0x4fc464={},_0x2ed64e=new Map();for(const _0x2f1521 of Array[_0x2c3860(0x29a)](_0x33b473)[_0x2c3860(0x220)]()){if(_0xfd9d20[_0x2c3860(0x210)]){const _0xbac435=await _0xfd9d20[_0x2c3860(0x210)](_0x2f1521);_0xbac435[_0x2c3860(0x265)]?(_0x2ed64e[_0x2c3860(0x1fc)](_0x2f1521,_0xbac435['name']),_0xbac435[_0x2c3860(0x1ef)]&&(_0x4fc464[_0xbac435[_0x2c3860(0x243)]]=_0xbac435['definition'])):_0x2ed64e[_0x2c3860(0x1fc)](_0x2f1521,makeSegmentRef(_0xbac435[_0x2c3860(0x243)]));}else{if(_0xfd9d20[_0x2c3860(0x267)]){const _0x5d148b=await _0xfd9d20['resolveActivationName'](_0x2f1521);_0x2ed64e['set'](_0x2f1521,_0x5d148b);}}}_0x6816af[_0x2c3860(0x28a)]>0x0&&replaceSegmentIdsInJourney(_0xe6c4a7,_0x6816af);_0x2ed64e['size']>0x0&&replaceActivationIdsInJourney(_0xe6c4a7,_0x2ed64e);if(_0xfd9d20['resolveJumpTarget']){const _0x431aed=[];collectJumpTargetsFromJourney(_0xe6c4a7,_0x431aed);if(_0x431aed[_0x2c3860(0x23e)]>0x0){const _0x3c4a69=new Map();for(const _0x2b318d of _0x431aed){try{const _0x275a52=await _0xfd9d20['resolveJumpTarget'](_0x2b318d[_0x2c3860(0x224)],_0x2b318d[_0x2c3860(0x211)]);_0x3c4a69[_0x2c3860(0x1fc)](_0x2b318d[_0x2c3860(0x224)]+':'+_0x2b318d['stageId'],_0x275a52);}catch{}}_0x3c4a69[_0x2c3860(0x28a)]>0x0&&replaceJumpTargetsInJourney(_0xe6c4a7,_0x3c4a69);}}return Object[_0x2c3860(0x1fd)](_0x13e9ba)[_0x2c3860(0x23e)]>0x0&&(_0xe6c4a7['segments']=_0x13e9ba),Object[_0x2c3860(0x1fd)](_0x4fc464)[_0x2c3860(0x23e)]>0x0&&(_0xe6c4a7[_0x2c3860(0x1e3)]=_0x4fc464),_0xe6c4a7;}function collectSegmentIdsFromJourney(_0x4f1414,_0x10cd47){const _0x332ff1=a147_0x5076;_0x4f1414[_0x332ff1(0x2a0)]?.[_0x332ff1(0x27d)]&&_0x10cd47[_0x332ff1(0x1e9)](_0x4f1414[_0x332ff1(0x2a0)]['segment']);const _0xb83a16=_0x327348=>{const _0x514229=_0x332ff1;for(const _0x1bcc54 of _0x327348){_0x1bcc54[_0x514229(0x28c)]?.[_0x514229(0x27d)]&&_0x10cd47[_0x514229(0x1e9)](_0x1bcc54['entry_criteria']['segment']);if(_0x1bcc54[_0x514229(0x22f)])for(const _0x473f84 of _0x1bcc54['exit_criteria']){_0x473f84['segment']&&_0x10cd47[_0x514229(0x1e9)](_0x473f84[_0x514229(0x27d)]);}_0x1bcc54[_0x514229(0x25d)]?.['segment']&&_0x10cd47['add'](_0x1bcc54[_0x514229(0x25d)][_0x514229(0x27d)]);if(_0x1bcc54[_0x514229(0x1f1)])for(const _0x5d6f40 of _0x1bcc54[_0x514229(0x1f1)]){if(_0x5d6f40['type']===_0x514229(0x20b)){const _0x5d0e63=_0x5d6f40;for(const _0x34d5e2 of _0x5d0e63[_0x514229(0x1f7)][_0x514229(0x2a1)]){_0x34d5e2[_0x514229(0x27d)]&&_0x10cd47[_0x514229(0x1e9)](_0x34d5e2['segment']);}}else{if(_0x5d6f40[_0x514229(0x26a)]===_0x514229(0x25e)){const _0x12b2e7=_0x5d6f40;_0x12b2e7[_0x514229(0x1f7)][_0x514229(0x200)]?.['segment']&&_0x10cd47[_0x514229(0x1e9)](_0x12b2e7[_0x514229(0x1f7)]['condition']['segment']);}}}}};if(_0x4f1414['journeys'])for(const _0x1d47cd of _0x4f1414[_0x332ff1(0x22c)]){_0x1d47cd['goal']?.[_0x332ff1(0x27d)]&&_0x10cd47[_0x332ff1(0x1e9)](_0x1d47cd[_0x332ff1(0x2a0)][_0x332ff1(0x27d)]),_0xb83a16(_0x1d47cd[_0x332ff1(0x258)]);}_0x4f1414[_0x332ff1(0x258)]&&_0xb83a16(_0x4f1414[_0x332ff1(0x258)]);if(_0x4f1414['versions'])for(const _0x508869 of _0x4f1414[_0x332ff1(0x293)]){_0xb83a16(_0x508869[_0x332ff1(0x258)]);}}function replaceSegmentIdsInJourney(_0x578a21,_0x544822){const _0x1b925e=a147_0x5076,_0x52b02a=_0x213c38=>_0x544822['get'](_0x213c38)||_0x213c38;_0x578a21['goal']?.[_0x1b925e(0x27d)]&&(_0x578a21['goal'][_0x1b925e(0x27d)]=_0x52b02a(_0x578a21['goal']['segment']));const _0xf19665=_0x226e73=>{const _0xe35774=_0x1b925e;for(const _0x1e991c of _0x226e73){_0x1e991c[_0xe35774(0x28c)]?.[_0xe35774(0x27d)]&&(_0x1e991c[_0xe35774(0x28c)][_0xe35774(0x27d)]=_0x52b02a(_0x1e991c[_0xe35774(0x28c)][_0xe35774(0x27d)]));if(_0x1e991c[_0xe35774(0x22f)])for(const _0x385c92 of _0x1e991c[_0xe35774(0x22f)]){_0x385c92[_0xe35774(0x27d)]&&(_0x385c92['segment']=_0x52b02a(_0x385c92[_0xe35774(0x27d)]));}_0x1e991c['milestone']?.['segment']&&(_0x1e991c[_0xe35774(0x25d)][_0xe35774(0x27d)]=_0x52b02a(_0x1e991c['milestone'][_0xe35774(0x27d)]));if(_0x1e991c[_0xe35774(0x1f1)])for(const _0x2662b4 of _0x1e991c['steps']){if(_0x2662b4[_0xe35774(0x26a)]===_0xe35774(0x20b)){const _0x43b6a5=_0x2662b4;for(const _0x5bef41 of _0x43b6a5[_0xe35774(0x1f7)][_0xe35774(0x2a1)]){_0x5bef41[_0xe35774(0x27d)]&&(_0x5bef41['segment']=_0x52b02a(_0x5bef41[_0xe35774(0x27d)]));}}else{if(_0x2662b4['type']===_0xe35774(0x25e)){const _0x25476b=_0x2662b4;_0x25476b['with'][_0xe35774(0x200)]?.[_0xe35774(0x27d)]&&(_0x25476b[_0xe35774(0x1f7)]['condition'][_0xe35774(0x27d)]=_0x52b02a(_0x25476b[_0xe35774(0x1f7)][_0xe35774(0x200)][_0xe35774(0x27d)]));}}}}};if(_0x578a21['journeys'])for(const _0x25b2d0 of _0x578a21[_0x1b925e(0x22c)]){_0x25b2d0['goal']?.['segment']&&(_0x25b2d0['goal'][_0x1b925e(0x27d)]=_0x52b02a(_0x25b2d0[_0x1b925e(0x2a0)][_0x1b925e(0x27d)])),_0xf19665(_0x25b2d0[_0x1b925e(0x258)]);}_0x578a21[_0x1b925e(0x258)]&&_0xf19665(_0x578a21['stages']);if(_0x578a21[_0x1b925e(0x293)])for(const _0xae62c2 of _0x578a21[_0x1b925e(0x293)]){_0xf19665(_0xae62c2[_0x1b925e(0x258)]);}}function collectActivationIdsFromJourney(_0x242949,_0x4b0abd){const _0x4c590e=a147_0x5076,_0x5a6afb=_0x13daf8=>{const _0x770a27=a147_0x5076;for(const _0x1429fc of _0x13daf8){if(_0x1429fc['steps'])for(const _0x186a6d of _0x1429fc['steps']){if(_0x186a6d[_0x770a27(0x26a)]===_0x770a27(0x227)){const _0x1b1dbb=_0x186a6d;_0x1b1dbb[_0x770a27(0x1f7)][_0x770a27(0x227)]&&/^\d+$/['test'](_0x1b1dbb[_0x770a27(0x1f7)][_0x770a27(0x227)])&&_0x4b0abd[_0x770a27(0x1e9)](_0x1b1dbb[_0x770a27(0x1f7)]['activation']);}}}};if(_0x242949['journeys'])for(const _0x4f2188 of _0x242949[_0x4c590e(0x22c)]){_0x5a6afb(_0x4f2188[_0x4c590e(0x258)]);}_0x242949[_0x4c590e(0x258)]&&_0x5a6afb(_0x242949['stages']);if(_0x242949[_0x4c590e(0x293)])for(const _0x3e69c7 of _0x242949[_0x4c590e(0x293)]){_0x5a6afb(_0x3e69c7[_0x4c590e(0x258)]);}}function replaceActivationIdsInJourney(_0x2cc8b8,_0x1195f7){const _0x43aed8=a147_0x5076,_0x5b1ade=_0x34985c=>_0x1195f7['get'](_0x34985c)||_0x34985c,_0x3e6b7b=_0x22d0ba=>{const _0x4fa826=a147_0x5076;for(const _0x5cfa51 of _0x22d0ba){if(_0x5cfa51[_0x4fa826(0x1f1)])for(const _0x2bb75b of _0x5cfa51[_0x4fa826(0x1f1)]){if(_0x2bb75b[_0x4fa826(0x26a)]===_0x4fa826(0x227)){const _0x554954=_0x2bb75b;_0x554954[_0x4fa826(0x1f7)][_0x4fa826(0x227)]&&(_0x554954[_0x4fa826(0x1f7)][_0x4fa826(0x227)]=_0x5b1ade(_0x554954[_0x4fa826(0x1f7)][_0x4fa826(0x227)]));}}}};if(_0x2cc8b8['journeys'])for(const _0x43377d of _0x2cc8b8[_0x43aed8(0x22c)]){_0x3e6b7b(_0x43377d['stages']);}_0x2cc8b8[_0x43aed8(0x258)]&&_0x3e6b7b(_0x2cc8b8[_0x43aed8(0x258)]);if(_0x2cc8b8['versions'])for(const _0xf49045 of _0x2cc8b8[_0x43aed8(0x293)]){_0x3e6b7b(_0xf49045[_0x43aed8(0x258)]);}}function collectJumpTargetsFromJourney(_0x9a5bf2,_0x20d139){const _0x22d148=a147_0x5076,_0x3106a1=new Set(),_0x4c6f58=_0x28efce=>{const _0x1d82e8=a147_0x5076;for(const _0x11c4fc of _0x28efce){if(_0x11c4fc[_0x1d82e8(0x1f1)])for(const _0x52dfe0 of _0x11c4fc[_0x1d82e8(0x1f1)]){if(_0x52dfe0['type']===_0x1d82e8(0x1f6)){const _0x149180=_0x52dfe0,_0x5ee3a1=_0x149180[_0x1d82e8(0x1f7)][_0x1d82e8(0x266)];if(_0x5ee3a1[_0x1d82e8(0x232)]&&_0x5ee3a1[_0x1d82e8(0x295)]&&/^\d+$/[_0x1d82e8(0x1e6)](_0x5ee3a1[_0x1d82e8(0x232)])&&/^\d+$/[_0x1d82e8(0x1e6)](_0x5ee3a1['stage'])){const _0x4ec20b=_0x5ee3a1['journey']+':'+_0x5ee3a1[_0x1d82e8(0x295)];!_0x3106a1[_0x1d82e8(0x257)](_0x4ec20b)&&(_0x3106a1[_0x1d82e8(0x1e9)](_0x4ec20b),_0x20d139[_0x1d82e8(0x207)]({'journeyId':_0x5ee3a1[_0x1d82e8(0x232)],'stageId':_0x5ee3a1[_0x1d82e8(0x295)]}));}}}}};if(_0x9a5bf2[_0x22d148(0x22c)])for(const _0xcc615d of _0x9a5bf2['journeys']){_0x4c6f58(_0xcc615d['stages']);}_0x9a5bf2['stages']&&_0x4c6f58(_0x9a5bf2[_0x22d148(0x258)]);if(_0x9a5bf2['versions'])for(const _0x34e021 of _0x9a5bf2[_0x22d148(0x293)]){_0x4c6f58(_0x34e021[_0x22d148(0x258)]);}}function replaceJumpTargetsInJourney(_0x4450e8,_0x306242){const _0x195b4d=a147_0x5076,_0x5022bc=_0x71620f=>{const _0x4f1e8b=a147_0x5076;for(const _0x588b3e of _0x71620f){if(_0x588b3e[_0x4f1e8b(0x1f1)])for(const _0x34a66f of _0x588b3e['steps']){if(_0x34a66f[_0x4f1e8b(0x26a)]==='jump'){const _0x259f68=_0x34a66f,_0x56cb8f=_0x259f68['with'][_0x4f1e8b(0x266)],_0x5266fc=_0x56cb8f[_0x4f1e8b(0x232)]+':'+_0x56cb8f[_0x4f1e8b(0x295)],_0x18f8a1=_0x306242[_0x4f1e8b(0x262)](_0x5266fc);_0x18f8a1&&(_0x56cb8f[_0x4f1e8b(0x232)]=_0x18f8a1['journeyName'],_0x56cb8f[_0x4f1e8b(0x295)]=_0x18f8a1[_0x4f1e8b(0x292)]);}}}};if(_0x4450e8['journeys'])for(const _0x2c20f6 of _0x4450e8['journeys']){_0x5022bc(_0x2c20f6[_0x195b4d(0x258)]);}_0x4450e8[_0x195b4d(0x258)]&&_0x5022bc(_0x4450e8[_0x195b4d(0x258)]);if(_0x4450e8['versions'])for(const _0x3278d9 of _0x4450e8[_0x195b4d(0x293)]){_0x5022bc(_0x3278d9[_0x195b4d(0x258)]);}}function generateReadableStepName(_0x1dd1cb,_0x165a88){const _0x3a2f50=a147_0x5076;if(_0x1dd1cb[_0x3a2f50(0x243)]&&_0x1dd1cb[_0x3a2f50(0x243)]!==_0x1dd1cb[_0x3a2f50(0x26a)]){const _0x5e55d0=_0x1dd1cb['name'][_0x3a2f50(0x29e)]();if(_0x5e55d0&&/[a-z0-9\p{L}]/iu[_0x3a2f50(0x1e6)](_0x5e55d0))return _0x5e55d0;}const _0x2a877b=_0x1dd1cb[_0x3a2f50(0x26a)][_0x3a2f50(0x238)]()['replace'](/step$/i,'');return _0x2a877b+'_'+(_0x165a88+0x1);}function getStepNextRefs(_0x12c220){const _0x48cdba=a147_0x5076,_0x47ad53=[];if(_0x12c220[_0x48cdba(0x213)])_0x47ad53[_0x48cdba(0x207)](_0x12c220[_0x48cdba(0x213)]);if(_0x12c220[_0x48cdba(0x2a1)])for(const _0x15eb3f of _0x12c220[_0x48cdba(0x2a1)]){if(_0x15eb3f[_0x48cdba(0x213)])_0x47ad53[_0x48cdba(0x207)](_0x15eb3f['next']);}if(_0x12c220[_0x48cdba(0x229)])for(const _0x1580f5 of _0x12c220[_0x48cdba(0x229)]){if(_0x1580f5[_0x48cdba(0x213)])_0x47ad53[_0x48cdba(0x207)](_0x1580f5[_0x48cdba(0x213)]);}if(_0x12c220[_0x48cdba(0x1f0)])for(const _0x1251b7 of _0x12c220[_0x48cdba(0x1f0)]){if(_0x1251b7[_0x48cdba(0x213)])_0x47ad53[_0x48cdba(0x207)](_0x1251b7[_0x48cdba(0x213)]);}return _0x47ad53;}function parseJumpTargetDisplayName(_0x2fb854){const _0x2e3f5c=a147_0x5076,_0x7931e0=_0x2fb854['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x7931e0)return undefined;const _0x29e237=_0x7931e0[0x1][_0x2e3f5c(0x29e)](),_0x403a38=_0x7931e0[0x2][_0x2e3f5c(0x29e)]();if(!_0x29e237||!_0x403a38)return undefined;return{'stageName':_0x29e237,'journeyName':_0x403a38};}function orderStepsFromRoot(_0x3a5b11,_0x375bbb){const _0x3a5554=a147_0x5076,_0x431f42=Object['entries'](_0x3a5b11);if(_0x431f42['length']===0x0)return[];const _0x40b102=new Set(_0x431f42[_0x3a5554(0x255)](([_0x19b366])=>_0x19b366)),_0x540450=new Set();for(const [,_0x5a0a21]of _0x431f42){for(const _0x4f8e16 of getStepNextRefs(_0x5a0a21)){if(_0x40b102['has'](_0x4f8e16))_0x540450[_0x3a5554(0x1e9)](_0x4f8e16);}}let _0x3adf0f=_0x375bbb&&_0x40b102['has'](_0x375bbb)?_0x375bbb:undefined;if(!_0x3adf0f){const _0x327459=_0x431f42[_0x3a5554(0x215)](([_0x47ba15])=>!_0x540450[_0x3a5554(0x257)](_0x47ba15));_0x327459[_0x3a5554(0x23e)]>0x0?_0x3adf0f=_0x327459[0x0][0x0]:_0x3adf0f=_0x431f42[0x0][0x0];}const _0x2feddb=[],_0x10d7a0=new Set(),_0x8c2acd=[_0x3adf0f];while(_0x8c2acd['length']>0x0){const _0x1ec09b=_0x8c2acd[_0x3a5554(0x222)]();if(_0x10d7a0[_0x3a5554(0x257)](_0x1ec09b))continue;_0x10d7a0['add'](_0x1ec09b);const _0x2c12a0=_0x3a5b11[_0x1ec09b];if(!_0x2c12a0)continue;_0x2feddb[_0x3a5554(0x207)]({'uuid':_0x1ec09b,'step':_0x2c12a0});for(const _0x263090 of getStepNextRefs(_0x2c12a0)){_0x40b102[_0x3a5554(0x257)](_0x263090)&&!_0x10d7a0[_0x3a5554(0x257)](_0x263090)&&_0x8c2acd['push'](_0x263090);}}for(const [_0x53b6e0,_0x519f71]of _0x431f42){!_0x10d7a0[_0x3a5554(0x257)](_0x53b6e0)&&_0x2feddb[_0x3a5554(0x207)]({'uuid':_0x53b6e0,'step':_0x519f71});}return _0x2feddb;}function resolveStepReferences(_0x8cacca,_0x19c815,_0x2ba1bd,_0x15457b){const _0x11cdc9=a147_0x5076;if(_0x8cacca['type']!=='end'){_0x8cacca[_0x11cdc9(0x213)]&&_0x15457b[_0x11cdc9(0x257)](_0x8cacca[_0x11cdc9(0x213)])&&(_0x8cacca[_0x11cdc9(0x213)]=_0x15457b['get'](_0x8cacca['next']));const _0x26a932=_0x19c815+0x1;if(_0x26a932<_0x2ba1bd[_0x11cdc9(0x23e)]){const _0x36b5aa=_0x15457b[_0x11cdc9(0x262)](_0x2ba1bd[_0x26a932]['uuid']);_0x8cacca['next']===_0x36b5aa&&delete _0x8cacca[_0x11cdc9(0x213)];}}if(_0x8cacca['type']===_0x11cdc9(0x20b))for(const _0x449875 of _0x8cacca[_0x11cdc9(0x1f7)][_0x11cdc9(0x2a1)]){_0x449875[_0x11cdc9(0x213)]&&_0x15457b[_0x11cdc9(0x257)](_0x449875[_0x11cdc9(0x213)])&&(_0x449875[_0x11cdc9(0x213)]=_0x15457b['get'](_0x449875[_0x11cdc9(0x213)]));}if(_0x8cacca[_0x11cdc9(0x26a)]==='ab_test')for(const _0x711a88 of _0x8cacca[_0x11cdc9(0x1f7)][_0x11cdc9(0x229)]){_0x711a88[_0x11cdc9(0x213)]&&_0x15457b[_0x11cdc9(0x257)](_0x711a88[_0x11cdc9(0x213)])&&(_0x711a88['next']=_0x15457b[_0x11cdc9(0x262)](_0x711a88[_0x11cdc9(0x213)]));}if(_0x8cacca[_0x11cdc9(0x26a)]===_0x11cdc9(0x25e)&&_0x8cacca[_0x11cdc9(0x1f7)][_0x11cdc9(0x200)]){const _0x5c81d7=_0x8cacca[_0x11cdc9(0x1f7)][_0x11cdc9(0x200)];_0x5c81d7[_0x11cdc9(0x213)]&&_0x15457b[_0x11cdc9(0x257)](_0x5c81d7[_0x11cdc9(0x213)])&&(_0x5c81d7[_0x11cdc9(0x213)]=_0x15457b[_0x11cdc9(0x262)](_0x5c81d7[_0x11cdc9(0x213)])),_0x5c81d7[_0x11cdc9(0x283)]?.['next']&&_0x15457b[_0x11cdc9(0x257)](_0x5c81d7[_0x11cdc9(0x283)][_0x11cdc9(0x213)])&&(_0x5c81d7[_0x11cdc9(0x283)]['next']=_0x15457b[_0x11cdc9(0x262)](_0x5c81d7['timeout'][_0x11cdc9(0x213)]));}}function convertApiStageToYaml(_0x40a0c0){const _0x1aa127=a147_0x5076,_0x312cc6={'name':_0x40a0c0[_0x1aa127(0x243)]};_0x40a0c0['id']&&(_0x312cc6['id']=_0x40a0c0['id']);_0x40a0c0[_0x1aa127(0x274)]&&(_0x312cc6[_0x1aa127(0x274)]=_0x40a0c0[_0x1aa127(0x274)]);_0x40a0c0['entryCriteria']&&(_0x312cc6['entry_criteria']=convertApiCriteriaToYaml(_0x40a0c0[_0x1aa127(0x294)]));_0x40a0c0[_0x1aa127(0x235)]&&_0x40a0c0[_0x1aa127(0x235)][_0x1aa127(0x23e)]>0x0&&(_0x312cc6[_0x1aa127(0x22f)]=_0x40a0c0['exitCriterias'][_0x1aa127(0x255)](convertApiCriteriaToYaml));_0x40a0c0[_0x1aa127(0x25d)]&&(_0x312cc6[_0x1aa127(0x25d)]=convertApiCriteriaToYaml(_0x40a0c0[_0x1aa127(0x25d)]));if(_0x40a0c0[_0x1aa127(0x1f1)]&&Object[_0x1aa127(0x1fd)](_0x40a0c0['steps'])['length']>0x0){const _0x1e7994=orderStepsFromRoot(_0x40a0c0[_0x1aa127(0x1f1)],_0x40a0c0[_0x1aa127(0x26c)]),_0x505eb3=new Map(),_0x4b6be9=new Set();for(let _0x174683=0x0;_0x174683<_0x1e7994[_0x1aa127(0x23e)];_0x174683++){const {uuid:_0x18316f,step:_0x3d7fb2}=_0x1e7994[_0x174683];let _0x8f33c7=generateReadableStepName(_0x3d7fb2,_0x174683),_0x35aee9=_0x8f33c7,_0x5542e7=0x2;while(_0x4b6be9['has'](_0x35aee9)){_0x35aee9=_0x8f33c7+'_'+_0x5542e7,_0x5542e7++;}_0x4b6be9[_0x1aa127(0x1e9)](_0x35aee9),_0x505eb3[_0x1aa127(0x1fc)](_0x18316f,_0x35aee9);}_0x312cc6['steps']=_0x1e7994[_0x1aa127(0x255)](({uuid:_0x3037b3,step:_0x4e384f},_0x3b457c)=>{const _0x243165=_0x1aa127,_0x5e08fa=convertApiStepToYaml(_0x4e384f,_0x505eb3[_0x243165(0x262)](_0x3037b3));return resolveStepReferences(_0x5e08fa,_0x3b457c,_0x1e7994,_0x505eb3),_0x5e08fa;});}return _0x312cc6;}function convertApiCriteriaToYaml(_0x119a76){const _0x1fbd50=a147_0x5076,_0xb94c95={'name':_0x119a76['name'],'segment':_0x119a76[_0x1fbd50(0x287)]};_0x119a76[_0x1fbd50(0x274)]&&(_0xb94c95['description']=_0x119a76[_0x1fbd50(0x274)]);if(_0x119a76[_0x1fbd50(0x266)]){let _0x2327b3=_0x119a76[_0x1fbd50(0x266)][_0x1fbd50(0x224)],_0x4d8cf0=_0x119a76[_0x1fbd50(0x266)][_0x1fbd50(0x299)];if(_0x119a76['target'][_0x1fbd50(0x206)]){const _0x3b3f7a=parseJumpTargetDisplayName(_0x119a76[_0x1fbd50(0x266)][_0x1fbd50(0x206)]);_0x3b3f7a&&(_0x4d8cf0=_0x3b3f7a['stageName'],_0x2327b3=_0x3b3f7a[_0x1fbd50(0x206)]);}_0xb94c95[_0x1fbd50(0x266)]={'journey':_0x2327b3,'stage':_0x4d8cf0},_0x119a76[_0x1fbd50(0x266)]['journeyBundleId']&&(_0xb94c95[_0x1fbd50(0x266)][_0x1fbd50(0x1f4)]=_0x119a76[_0x1fbd50(0x266)][_0x1fbd50(0x250)]);}return _0xb94c95;}function convertApiStepToYaml(_0x28d052,_0x169b23){const _0x581d14=a147_0x5076;switch(_0x28d052[_0x581d14(0x26a)]){case _0x581d14(0x29b):{const _0x1e7eea={};if(_0x28d052[_0x581d14(0x26f)]===_0x581d14(0x28f)&&_0x28d052[_0x581d14(0x1ee)]!==undefined)_0x1e7eea[_0x581d14(0x236)]=_0x28d052[_0x581d14(0x1ee)],_0x1e7eea[_0x581d14(0x23c)]=_0x28d052[_0x581d14(0x27f)];else{if(_0x28d052[_0x581d14(0x26f)]==='Date'&&_0x28d052[_0x581d14(0x221)])_0x1e7eea[_0x581d14(0x1e4)]=_0x28d052[_0x581d14(0x221)];else{if(_0x28d052[_0x581d14(0x26f)]===_0x581d14(0x264)&&_0x28d052[_0x581d14(0x277)])_0x1e7eea[_0x581d14(0x289)]=_0x28d052[_0x581d14(0x277)];else{if(_0x28d052[_0x581d14(0x26f)]===_0x581d14(0x231)){if(_0x28d052[_0x581d14(0x1f0)]&&_0x28d052[_0x581d14(0x1f0)][_0x581d14(0x23e)]>0x0){const _0x76a5ed=_0x28d052[_0x581d14(0x1f0)][_0x581d14(0x25c)](_0x40b989=>!_0x40b989[_0x581d14(0x252)]),_0x3b1624=_0x28d052[_0x581d14(0x1f0)][_0x581d14(0x25c)](_0x5e2886=>_0x5e2886[_0x581d14(0x252)]);_0x76a5ed?.[_0x581d14(0x287)]&&(_0x1e7eea[_0x581d14(0x200)]={'segment':_0x76a5ed[_0x581d14(0x287)],..._0x76a5ed[_0x581d14(0x213)]?{'next':_0x76a5ed[_0x581d14(0x213)]}:{}},_0x3b1624&&_0x3b1624[_0x581d14(0x20e)]!==undefined&&_0x3b1624[_0x581d14(0x23c)]&&(_0x1e7eea[_0x581d14(0x200)][_0x581d14(0x283)]={'duration':_0x3b1624[_0x581d14(0x20e)],'unit':_0x3b1624[_0x581d14(0x23c)],..._0x3b1624['next']?{'next':_0x3b1624['next']}:{}}));}else _0x28d052[_0x581d14(0x216)]&&(_0x1e7eea[_0x581d14(0x200)]={'segment':_0x28d052[_0x581d14(0x216)]},_0x28d052[_0x581d14(0x233)]!==undefined&&_0x28d052[_0x581d14(0x297)]&&(_0x1e7eea[_0x581d14(0x200)][_0x581d14(0x283)]={'duration':_0x28d052[_0x581d14(0x233)],'unit':_0x28d052['conditionTimeoutUnit']}));}}}}const _0x337b24={'type':_0x581d14(0x25e),'name':_0x169b23,..._0x28d052[_0x581d14(0x213)]?{'next':_0x28d052['next']}:{},'with':_0x1e7eea};return _0x337b24;}case _0x581d14(0x203):{const _0x1f58c9={'type':'activation','name':_0x169b23,..._0x28d052[_0x581d14(0x213)]?{'next':_0x28d052['next']}:{},'with':{'activation':_0x28d052[_0x581d14(0x275)]||''}};return _0x1f58c9;}case _0x581d14(0x1f9):{const _0x122463={'type':'decision_point','name':_0x169b23,..._0x28d052[_0x581d14(0x213)]?{'next':_0x28d052[_0x581d14(0x213)]}:{},'with':{'branches':(_0x28d052['branches']||[])[_0x581d14(0x255)](_0x3c3c70=>({'name':_0x3c3c70[_0x581d14(0x243)],'segment':_0x3c3c70['segmentId'],'excluded':_0x3c3c70['excludedPath'],..._0x3c3c70[_0x581d14(0x213)]?{'next':_0x3c3c70[_0x581d14(0x213)]}:{}}))}};return _0x122463;}case _0x581d14(0x242):case'AbTest':case _0x581d14(0x239):{const _0x4172b3=_0x28d052[_0x581d14(0x229)]||(_0x28d052[_0x581d14(0x2a1)]||[])[_0x581d14(0x255)](_0x576064=>({'name':_0x576064['name'],'percentage':0x0,'next':_0x576064[_0x581d14(0x213)]})),_0x4a6556={'type':_0x581d14(0x20c),'name':_0x169b23,..._0x28d052[_0x581d14(0x213)]?{'next':_0x28d052[_0x581d14(0x213)]}:{},'with':{'customized_split':_0x28d052[_0x581d14(0x1fe)],'unique_id':_0x28d052['uniqueId'],'variants':_0x4172b3['map'](_0x294203=>({'name':_0x294203[_0x581d14(0x243)],'percentage':_0x294203[_0x581d14(0x24c)],..._0x294203[_0x581d14(0x213)]?{'next':_0x294203['next']}:{}}))}};return _0x4a6556;}case _0x581d14(0x263):{const _0x4a70a7={'type':_0x581d14(0x25f),'name':_0x169b23,..._0x28d052[_0x581d14(0x213)]?{'next':_0x28d052[_0x581d14(0x213)]}:{}};return _0x4a70a7;}case _0x581d14(0x1f8):{let _0x3ef459='',_0xbf5e43='',_0x1868e2;if(_0x28d052[_0x581d14(0x266)]){_0x3ef459=_0x28d052[_0x581d14(0x266)]['journeyId'],_0xbf5e43=_0x28d052[_0x581d14(0x266)]['journeyStageId'],_0x1868e2=_0x28d052[_0x581d14(0x266)][_0x581d14(0x250)];if(_0x28d052[_0x581d14(0x266)][_0x581d14(0x206)]){const _0x642d60=parseJumpTargetDisplayName(_0x28d052[_0x581d14(0x266)]['journeyName']);_0x642d60&&(_0xbf5e43=_0x642d60[_0x581d14(0x292)],_0x3ef459=_0x642d60[_0x581d14(0x206)]);}}const _0x2abcb={'type':_0x581d14(0x1f6),'name':_0x169b23,..._0x28d052[_0x581d14(0x213)]?{'next':_0x28d052[_0x581d14(0x213)]}:{},'with':{'target':{'journey':_0x3ef459,'stage':_0xbf5e43,..._0x1868e2?{'bundle_id':_0x1868e2}:{}}}};return _0x2abcb;}case _0x581d14(0x228):{const _0x301af6={'type':'end','name':_0x169b23};return _0x301af6;}default:{const _0x2ea309={'type':_0x581d14(0x20f),'name':_0x169b23};return _0x2ea309;}}}export async function journeyDefToRequest(_0x5da11a,_0x23bfef,_0x344d80){const _0x1a475e=a147_0x5076,_0x4677fb=_0x5da11a[_0x1a475e(0x258)]||getActiveStages(_0x5da11a),_0x796449=isJourneysArrayMode(_0x5da11a)||isMultiVersionMode(_0x5da11a)?getLatestJourneyEntry(_0x5da11a):undefined,_0x17a4ca=_0x796449?.['version']??_0x5da11a[_0x1a475e(0x243)],_0x13f96b=_0x5da11a[_0x1a475e(0x290)]||{},_0x5c1dfc=_0x5da11a[_0x1a475e(0x1e3)]||{},_0x21ab08={'type':'journey','attributes':{'name':_0x17a4ca,'audienceId':_0x23bfef,'journeyStages':await Promise[_0x1a475e(0x209)](_0x4677fb['map'](_0x19083c=>convertYamlStageToApi(_0x19083c,_0x344d80,_0x13f96b,_0x5c1dfc)))}},_0x2d7b7b=_0x796449?.['id']??_0x5da11a['id'];_0x2d7b7b&&(_0x21ab08['id']=_0x2d7b7b);_0x5da11a[_0x1a475e(0x274)]&&(_0x21ab08[_0x1a475e(0x1e5)]['description']=_0x5da11a['description']);const _0x265671=getEffectiveGoal(_0x5da11a);_0x265671&&(_0x21ab08[_0x1a475e(0x1e5)][_0x1a475e(0x2a0)]=await convertYamlCriteriaToApi(_0x265671,_0x344d80,_0x13f96b));const _0x2df3ef=getEffectiveReentry(_0x5da11a);return _0x2df3ef&&(_0x21ab08[_0x1a475e(0x1e5)]['reentryMode']=_0x2df3ef,_0x21ab08[_0x1a475e(0x1e5)][_0x1a475e(0x25b)]=_0x2df3ef!==_0x1a475e(0x240)),_0x5da11a[_0x1a475e(0x237)]&&(_0x21ab08[_0x1a475e(0x21f)]={'parentFolder':{'data':{'id':_0x5da11a[_0x1a475e(0x237)],'type':'folder'}}}),_0x21ab08;}async function convertYamlStageToApi(_0x1dca9b,_0x559ed8,_0x40442b={},_0x4aecc2={}){const _0x22dc43=a147_0x5076,_0x7451ce={'name':_0x1dca9b['name']};_0x1dca9b['id']&&(_0x7451ce['id']=_0x1dca9b['id']);_0x1dca9b['description']&&(_0x7451ce[_0x22dc43(0x274)]=_0x1dca9b[_0x22dc43(0x274)]);_0x1dca9b[_0x22dc43(0x28c)]&&(_0x7451ce[_0x22dc43(0x294)]=await convertYamlCriteriaToApi(_0x1dca9b[_0x22dc43(0x28c)],_0x559ed8,_0x40442b));_0x1dca9b[_0x22dc43(0x22f)]&&_0x1dca9b[_0x22dc43(0x22f)][_0x22dc43(0x23e)]>0x0&&(_0x7451ce[_0x22dc43(0x235)]=await Promise[_0x22dc43(0x209)](_0x1dca9b[_0x22dc43(0x22f)]['map'](_0x1487fd=>convertYamlCriteriaToApi(_0x1487fd,_0x559ed8,_0x40442b))));_0x1dca9b[_0x22dc43(0x25d)]&&(_0x7451ce[_0x22dc43(0x25d)]=await convertYamlCriteriaToApi(_0x1dca9b[_0x22dc43(0x25d)],_0x559ed8,_0x40442b));if(_0x1dca9b[_0x22dc43(0x1f1)]&&_0x1dca9b[_0x22dc43(0x1f1)][_0x22dc43(0x23e)]>0x0){const _0x131428={},_0x2a8fbc=_0x1dca9b[_0x22dc43(0x1f1)][_0x22dc43(0x255)]((_0x1b6f34,_0x3c5420)=>{const _0x3570c4=_0x22dc43,_0x52e329=_0x1b6f34[_0x3570c4(0x296)]||generateUUID(),_0x22cf98=_0x1b6f34[_0x3570c4(0x243)]||_0x1b6f34['type']+'_'+_0x3c5420;return _0x131428[_0x22cf98]=_0x52e329,{..._0x1b6f34,'name':_0x22cf98};});_0x7451ce[_0x22dc43(0x26c)]=_0x131428[_0x2a8fbc[0x0][_0x22dc43(0x243)]],_0x7451ce[_0x22dc43(0x1f1)]={};for(let _0x159389=0x0;_0x159389<_0x2a8fbc[_0x22dc43(0x23e)];_0x159389++){const _0x878c6=_0x2a8fbc[_0x159389],_0x4db08d=_0x131428[_0x878c6[_0x22dc43(0x243)]],_0x5ebd25=!_0x878c6[_0x22dc43(0x213)]&&_0x159389<_0x2a8fbc[_0x22dc43(0x23e)]-0x1&&_0x878c6[_0x22dc43(0x26a)]!==_0x22dc43(0x20f)?_0x2a8fbc[_0x159389+0x1][_0x22dc43(0x243)]:_0x878c6[_0x22dc43(0x213)],_0x5162ac=_0x5ebd25!==_0x878c6['next']?{..._0x878c6,'next':_0x5ebd25}:_0x878c6;_0x7451ce[_0x22dc43(0x1f1)][_0x4db08d]=await convertYamlStepToApi(_0x5162ac,_0x559ed8,_0x40442b,_0x131428,_0x4aecc2);}}else _0x1dca9b[_0x22dc43(0x248)]&&(_0x7451ce[_0x22dc43(0x26c)]=_0x1dca9b['root_step']);return _0x7451ce;}async function convertYamlCriteriaToApi(_0x400935,_0x47433f,_0x390f87={}){const _0x28640c=a147_0x5076;let _0x546e91=_0x400935[_0x28640c(0x27d)];if(_0x546e91&&!/^\d+$/[_0x28640c(0x1e6)](_0x546e91)){const _0x5a98ee=parseSegmentRef(_0x546e91);if(_0x5a98ee[_0x28640c(0x26a)]==='ref')_0x47433f?.[_0x28640c(0x226)]&&(_0x546e91=await _0x47433f['resolveSegmentId'](_0x5a98ee[_0x28640c(0x243)]));else{if(_0x5a98ee[_0x28640c(0x26a)]===_0x28640c(0x24f)&&_0x390f87[_0x5a98ee['name']])_0x47433f?.[_0x28640c(0x2a3)]&&(_0x546e91=await _0x47433f[_0x28640c(0x2a3)](_0x5a98ee[_0x28640c(0x243)],_0x390f87[_0x5a98ee[_0x28640c(0x243)]]));else _0x47433f?.[_0x28640c(0x226)]&&(_0x546e91=await _0x47433f[_0x28640c(0x226)](_0x5a98ee[_0x28640c(0x243)]));}}const _0x57c9d0={'name':_0x400935[_0x28640c(0x243)],'segmentId':_0x546e91};_0x400935['description']&&(_0x57c9d0[_0x28640c(0x274)]=_0x400935[_0x28640c(0x274)]);if(_0x400935[_0x28640c(0x266)]){const _0x52ddd5=_0x400935[_0x28640c(0x266)][_0x28640c(0x232)],_0x367f9f=_0x400935[_0x28640c(0x266)][_0x28640c(0x295)];let _0x3a84d1=_0x400935[_0x28640c(0x266)]['journey'];_0x47433f?.['resolveJourneyId']&&!/^\d+$/[_0x28640c(0x1e6)](_0x3a84d1)&&(_0x3a84d1=await _0x47433f[_0x28640c(0x1ec)](_0x3a84d1));let _0x17dd5f=_0x400935[_0x28640c(0x266)][_0x28640c(0x295)];_0x47433f?.[_0x28640c(0x20d)]&&!/^\d+$/[_0x28640c(0x1e6)](_0x17dd5f)&&(_0x17dd5f=await _0x47433f[_0x28640c(0x20d)](_0x3a84d1,_0x17dd5f));const _0x3c17f4=!/^\d+$/[_0x28640c(0x1e6)](_0x52ddd5)&&!isLocalJourneyRef(_0x52ddd5)?formatApiJourneyName(_0x52ddd5,_0x367f9f):undefined;_0x57c9d0[_0x28640c(0x266)]={'journeyId':_0x3a84d1,'journeyStageId':_0x17dd5f,'journeyName':_0x3c17f4,'confirmed':!![]},_0x400935[_0x28640c(0x266)][_0x28640c(0x1f4)]&&(_0x57c9d0[_0x28640c(0x266)]['journeyBundleId']=_0x400935[_0x28640c(0x266)]['bundle_id']);}return _0x57c9d0;}async function convertYamlStepToApi(_0x32c253,_0x505806,_0x20fe9c={},_0x5e0be0={},_0x471597={}){const _0x3659a0=a147_0x5076,_0x465bcb=async _0x1a88ef=>{const _0x107314=a147_0x5076;if(/^\d+$/['test'](_0x1a88ef))return _0x1a88ef;const _0x4fbe17=parseSegmentRef(_0x1a88ef);if(_0x4fbe17['type']===_0x107314(0x27c)){if(_0x505806?.[_0x107314(0x226)])return await _0x505806[_0x107314(0x226)](_0x4fbe17[_0x107314(0x243)]);}else{if(_0x4fbe17[_0x107314(0x26a)]==='embedded'&&_0x20fe9c[_0x4fbe17[_0x107314(0x243)]]){if(_0x505806?.[_0x107314(0x2a3)])return await _0x505806[_0x107314(0x2a3)](_0x4fbe17[_0x107314(0x243)],_0x20fe9c[_0x4fbe17['name']]);}else{if(_0x505806?.[_0x107314(0x226)])return await _0x505806[_0x107314(0x226)](_0x4fbe17[_0x107314(0x243)]);}}return _0x1a88ef;},_0x19070e=async _0x4fc672=>{const _0x2fed53=a147_0x5076;if(/^\d+$/[_0x2fed53(0x1e6)](_0x4fc672))return _0x4fc672;const _0x2f76c6=parseSegmentRef(_0x4fc672);if(_0x2f76c6[_0x2fed53(0x26a)]===_0x2fed53(0x27c)){if(_0x505806?.[_0x2fed53(0x1e2)])return await _0x505806[_0x2fed53(0x1e2)](_0x2f76c6[_0x2fed53(0x243)]);return _0x2f76c6['name'];}else{if(_0x2f76c6['type']==='embedded'&&_0x471597[_0x2f76c6[_0x2fed53(0x243)]]){if(_0x505806?.[_0x2fed53(0x23b)])return await _0x505806[_0x2fed53(0x23b)](_0x2f76c6['name'],_0x471597[_0x2f76c6[_0x2fed53(0x243)]]);if(_0x505806?.['resolveActivationId'])return await _0x505806['resolveActivationId'](_0x2f76c6['name']);}else{if(_0x505806?.[_0x2fed53(0x1e2)])return await _0x505806['resolveActivationId'](_0x2f76c6[_0x2fed53(0x243)]);}}return _0x4fc672;},_0x28f523=_0x5e9a7a=>{const _0x570f45=a147_0x5076;if(!_0x5e9a7a)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x570f45(0x1e6)](_0x5e9a7a))return _0x5e9a7a;return _0x5e0be0[_0x5e9a7a]||_0x5e9a7a;};switch(_0x32c253[_0x3659a0(0x26a)]){case'wait':{const _0x4ede7b=_0x32c253,_0x118a49=_0x4ede7b[_0x3659a0(0x1f7)],_0x1b0610={'type':_0x3659a0(0x29b),'name':_0x4ede7b['name'],'next':_0x28f523(_0x4ede7b[_0x3659a0(0x213)])};if(_0x118a49[_0x3659a0(0x236)]!==undefined&&_0x118a49[_0x3659a0(0x23c)])_0x1b0610[_0x3659a0(0x26f)]=_0x3659a0(0x28f),_0x1b0610[_0x3659a0(0x1ee)]=_0x118a49['duration'],_0x1b0610[_0x3659a0(0x27f)]=normalizeWaitUnit(_0x118a49[_0x3659a0(0x23c)]);else{if(_0x118a49[_0x3659a0(0x1e4)])_0x1b0610[_0x3659a0(0x26f)]=_0x3659a0(0x21b),_0x1b0610[_0x3659a0(0x221)]=_0x118a49[_0x3659a0(0x1e4)];else{if(_0x118a49['days_of_week'])_0x1b0610['waitStepType']=_0x3659a0(0x264),_0x1b0610[_0x3659a0(0x277)]=_0x118a49[_0x3659a0(0x289)];else{if(_0x118a49['condition']){_0x1b0610['waitStepType']=_0x3659a0(0x231);const _0x3306d3=await _0x465bcb(_0x118a49[_0x3659a0(0x200)][_0x3659a0(0x27d)]),_0x40aa33=_0x118a49[_0x3659a0(0x200)][_0x3659a0(0x283)]?.['next']!==undefined;if(_0x40aa33){const _0x58aaa4=[];_0x58aaa4[_0x3659a0(0x207)]({'id':generateUUID(),'segmentId':_0x3306d3,'timedOutPath':![],'name':_0x3659a0(0x1f5),'next':_0x28f523(_0x118a49['condition'][_0x3659a0(0x213)]??_0x4ede7b[_0x3659a0(0x213)])});if(_0x118a49[_0x3659a0(0x200)][_0x3659a0(0x283)]){const _0x131a88=_0x118a49[_0x3659a0(0x200)][_0x3659a0(0x283)][_0x3659a0(0x236)],_0x360318=normalizeWaitUnit(_0x118a49['condition'][_0x3659a0(0x283)]['unit']);_0x58aaa4[_0x3659a0(0x207)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x3659a0(0x246)+_0x131a88+'\x20'+_0x360318,'moveAfter':_0x131a88,'unit':_0x360318,'next':_0x28f523(_0x118a49['condition'][_0x3659a0(0x283)][_0x3659a0(0x213)])});}_0x1b0610[_0x3659a0(0x1f0)]=_0x58aaa4,delete _0x1b0610['next'];}else _0x1b0610[_0x3659a0(0x216)]=_0x3306d3,_0x118a49[_0x3659a0(0x200)][_0x3659a0(0x283)]&&(_0x1b0610[_0x3659a0(0x233)]=_0x118a49[_0x3659a0(0x200)][_0x3659a0(0x283)]['duration'],_0x118a49[_0x3659a0(0x200)][_0x3659a0(0x283)][_0x3659a0(0x23c)]&&(_0x1b0610[_0x3659a0(0x297)]=normalizeWaitUnit(_0x118a49['condition'][_0x3659a0(0x283)][_0x3659a0(0x23c)])));}}}}return _0x1b0610;}case _0x3659a0(0x227):{const _0x28502b=_0x32c253,_0x303b90=_0x28502b['with'][_0x3659a0(0x227)],_0x534f03=await _0x19070e(_0x303b90);return{'type':_0x3659a0(0x203),'name':_0x28502b[_0x3659a0(0x243)],'journeyActivationStepId':_0x534f03,'next':_0x28f523(_0x28502b[_0x3659a0(0x213)])};}case _0x3659a0(0x20b):{const _0x518386=_0x32c253,_0x743b20=_0x518386[_0x3659a0(0x1f7)][_0x3659a0(0x2a1)];return{'type':_0x3659a0(0x1f9),'name':_0x518386[_0x3659a0(0x243)],'branches':await Promise['all'](_0x743b20[_0x3659a0(0x255)](async _0x1f6088=>{const _0x3a47b5=_0x3659a0;let _0x11b080='';if(!_0x1f6088['excluded']){const _0x1b1585=_0x1f6088['segment']||_0x1f6088[_0x3a47b5(0x272)]||'';_0x11b080=_0x1b1585?await _0x465bcb(_0x1b1585):'';}return{'id':crypto[_0x3a47b5(0x21d)](),'name':_0x1f6088[_0x3a47b5(0x243)],'description':null,'segmentId':_0x11b080,'excludedPath':_0x1f6088[_0x3a47b5(0x21c)]??![],'next':_0x28f523(_0x1f6088[_0x3a47b5(0x213)])};})),'next':_0x28f523(_0x518386[_0x3659a0(0x213)])};}case _0x3659a0(0x20c):{const _0x3b1217=_0x32c253,_0x141fb3=_0x3b1217['with'];return{'type':_0x3659a0(0x242),'name':_0x3b1217['name'],'customizedSplit':_0x141fb3[_0x3659a0(0x21e)],'uniqueId':_0x141fb3[_0x3659a0(0x260)],'variants':_0x141fb3['variants']['map'](_0x23468b=>({'id':_0x23468b['id']||generateUUID(),'name':_0x23468b[_0x3659a0(0x243)],'percentage':_0x23468b[_0x3659a0(0x24c)],'next':_0x28f523(_0x23468b[_0x3659a0(0x213)])})),'next':_0x28f523(_0x3b1217['next'])};}case _0x3659a0(0x25f):return{'type':_0x3659a0(0x263),'name':_0x32c253[_0x3659a0(0x243)],'next':_0x28f523(_0x32c253['next'])};case'jump':{const _0xc34f83=_0x32c253,_0x14dbe2=_0xc34f83[_0x3659a0(0x1f7)]['target'],_0x45ef8b=_0x14dbe2[_0x3659a0(0x232)],_0x3a6750=_0x14dbe2['stage'];let _0x4e7232=_0x14dbe2[_0x3659a0(0x232)];_0x505806?.['resolveJourneyId']&&!/^\d+$/[_0x3659a0(0x1e6)](_0x4e7232)&&(_0x4e7232=await _0x505806['resolveJourneyId'](_0x4e7232));let _0x505c37=_0x14dbe2['stage'];_0x505806?.[_0x3659a0(0x20d)]&&!/^\d+$/['test'](_0x505c37)&&(_0x505c37=await _0x505806[_0x3659a0(0x20d)](_0x4e7232,_0x505c37));const _0x3fc5a7=!/^\d+$/['test'](_0x45ef8b)&&!isLocalJourneyRef(_0x45ef8b)?formatApiJourneyName(_0x45ef8b,_0x3a6750):undefined;return{'type':'Jump','name':_0xc34f83['name'],'target':{'journeyId':_0x4e7232,'journeyStageId':_0x505c37,'journeyBundleId':_0x14dbe2[_0x3659a0(0x1f4)],'journeyName':_0x3fc5a7,'confirmed':!![]},'next':_0x28f523(_0xc34f83[_0x3659a0(0x213)])};}case _0x3659a0(0x20f):return{'type':_0x3659a0(0x228),'name':_0x32c253[_0x3659a0(0x243)]};default:{const _0x5319cc=_0x32c253;return{'type':_0x3659a0(0x228),'name':_0x5319cc[_0x3659a0(0x243)]};}}}export function toYamlString(_0x4ff53e){const _0x4c91c6=a147_0x5076,_0x456394=stripInternalFields(_0x4ff53e),_0x292e09=a147_0x2b5319[_0x4c91c6(0x273)](_0x456394,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4c91c6(0x1f3)}),_0x390ff7=['segments:',_0x4c91c6(0x259),_0x4c91c6(0x23f),_0x4c91c6(0x247),_0x4c91c6(0x217),_0x4c91c6(0x204),_0x4c91c6(0x29f)];let _0x31bcf8=_0x292e09;for(const _0x2083f4 of _0x390ff7){_0x31bcf8=_0x31bcf8[_0x4c91c6(0x26b)](new RegExp('^('+_0x2083f4+')','m'),(_0x2e398c,_0x50d67f,_0x442512)=>{if(_0x442512===0x0||_0x31bcf8[_0x442512-0x1]==='\x0a'&&_0x31bcf8[_0x442512-0x2]==='\x0a')return _0x50d67f;return'\x0a'+_0x50d67f;});}return _0x31bcf8;}function stripInternalFields(_0x3e1b85){const _0x4b5c34=a147_0x5076,{id:_0x516eb4,folder_id:_0x35fe5d,bundle_id:_0x387d70,bundle_name:_0x2096ba,version:_0x3aa41e,allow_reentry:_0x39c806,..._0x31ed46}=_0x3e1b85;return _0x31ed46['journeys']&&(_0x31ed46['journeys']=_0x31ed46[_0x4b5c34(0x22c)]['map'](_0x1ede86=>{const _0x598187=_0x4b5c34,{id:_0x367e68,..._0x1804a7}=_0x1ede86;return{..._0x1804a7,'stages':_0x1804a7[_0x598187(0x258)][_0x598187(0x255)](stripStageInternalFields),..._0x1ede86[_0x598187(0x284)]===!![]?{'latest':!![]}:{},..._0x31ed46[_0x598187(0x22c)]['length']===0x1&&_0x1804a7[_0x598187(0x230)]==='v1'?{'version':undefined}:{}};})),_0x31ed46[_0x4b5c34(0x258)]&&(_0x31ed46[_0x4b5c34(0x258)]=_0x31ed46['stages'][_0x4b5c34(0x255)](stripStageInternalFields)),_0x31ed46[_0x4b5c34(0x293)]&&(_0x31ed46['versions']=_0x31ed46[_0x4b5c34(0x293)][_0x4b5c34(0x255)](_0x408e4b=>{const _0x495606=_0x4b5c34,{id:_0x316b4c,..._0x5a65cf}=_0x408e4b;return{..._0x5a65cf,'stages':_0x5a65cf[_0x495606(0x258)]['map'](stripStageInternalFields),..._0x408e4b['latest']===!![]?{'latest':!![]}:{}};})),_0x31ed46;}function stripStageInternalFields(_0x2542fb){const {id:_0x491e8f,..._0x529e68}=_0x2542fb;return _0x529e68;}export function parseYamlString(_0x1ff07d){return safeParseYaml(_0x1ff07d,JourneyDefSchema);}export function isJourneyDef(_0x12c634){const _0x5de0f4=a147_0x5076;return typeof _0x12c634===_0x5de0f4(0x23d)&&_0x12c634!==null&&_0x5de0f4(0x26a)in _0x12c634&&_0x12c634[_0x5de0f4(0x26a)]===_0x5de0f4(0x232);}export function generateTemplate(_0x27073f,_0x28c3de){const _0x3966e7=a147_0x5076,_0xf5e635={'type':_0x3966e7(0x232),'name':_0x27073f,'description':_0x3966e7(0x24b),'reentry':'no_reentry','goal':{'name':_0x3966e7(0x234),'segment':'goal-segment'},'stages':[{'name':_0x3966e7(0x268),'description':_0x3966e7(0x24e),'entry_criteria':{'name':_0x3966e7(0x29d),'segment':_0x28c3de},'steps':[{'type':'wait','name':_0x3966e7(0x1ea),'with':{'duration':0x1,'unit':_0x3966e7(0x27e)}},{'type':_0x3966e7(0x227),'name':_0x3966e7(0x201),'with':{'activation':_0x3966e7(0x1ed)}},{'type':_0x3966e7(0x20f),'name':_0x3966e7(0x23a)}]}]};return toYamlString(_0xf5e635);}function generateUUID(){const _0x18892c=a147_0x5076;return crypto[_0x18892c(0x21d)]();}export const SEGMENT_REF_PREFIX=a147_0x3557e0(0x20a);export function parseSegmentRef(_0x5aad22){const _0x480afb=a147_0x3557e0;if(_0x5aad22[_0x480afb(0x276)](SEGMENT_REF_PREFIX))return{'type':_0x480afb(0x27c),'name':_0x5aad22[_0x480afb(0x254)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x480afb(0x1e6)](_0x5aad22))return{'type':'id','name':_0x5aad22};return{'type':_0x480afb(0x24f),'name':_0x5aad22};}export function makeSegmentRef(_0x554b49){return''+SEGMENT_REF_PREFIX+_0x554b49;}export function isExternalSegmentRef(_0x2ec7e2){const _0x512ab5=a147_0x3557e0;return _0x2ec7e2[_0x512ab5(0x276)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x4dccd3){const _0x15b3b5=a147_0x3557e0;return!!(_0x4dccd3[_0x15b3b5(0x22c)]&&_0x4dccd3[_0x15b3b5(0x22c)][_0x15b3b5(0x23e)]>0x0);}export function isMultiVersionMode(_0x1f30cf){const _0x1ef950=a147_0x3557e0;return!!(_0x1f30cf['versions']&&_0x1f30cf[_0x1ef950(0x293)][_0x1ef950(0x23e)]>0x0);}export function isSingleVersionMode(_0x352924){const _0x4f6ff2=a147_0x3557e0;return!!(_0x352924[_0x4f6ff2(0x258)]&&_0x352924['stages'][_0x4f6ff2(0x23e)]>0x0);}export function hasMultipleVersions(_0x4ff98e){const _0x3dfe63=a147_0x3557e0;if(isJourneysArrayMode(_0x4ff98e))return(_0x4ff98e['journeys']?.[_0x3dfe63(0x23e)]||0x0)>0x1;if(isMultiVersionMode(_0x4ff98e))return(_0x4ff98e['versions']?.[_0x3dfe63(0x23e)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0xd90b2c){const _0x18c2af=a147_0x3557e0;if(isJourneysArrayMode(_0xd90b2c))return _0xd90b2c;if(isSingleVersionMode(_0xd90b2c)){const {stages:_0x2124ad,id:_0x40f7a4,version:_0x1e45be,version_number:_0x29e708,..._0x4ec46b}=_0xd90b2c;return{..._0x4ec46b,'journeys':[{'version':_0x1e45be||'v1','stages':_0x2124ad||[],'id':_0x40f7a4,'version_number':_0x29e708}]};}if(isMultiVersionMode(_0xd90b2c)){const {versions:_0x5cfe95,..._0x5093c8}=_0xd90b2c;return{..._0x5093c8,'journeys':(_0x5cfe95||[])[_0x18c2af(0x255)](_0x1efc75=>({'version':_0x1efc75[_0x18c2af(0x243)],'state':_0x1efc75['state'],'latest':_0x1efc75[_0x18c2af(0x284)],'stages':_0x1efc75[_0x18c2af(0x258)],'id':_0x1efc75['id'],'version_number':_0x1efc75[_0x18c2af(0x24d)]}))};}return _0xd90b2c;}export function normalizeJourneyDef(_0xe78acd,_0x55ec8f){const _0xbf9274=a147_0x3557e0,_0x104a34=normalizeToJourneysFormat(_0xe78acd),_0x3cc67e=_0x55ec8f?.[_0xbf9274(0x290)]?Object[_0xbf9274(0x1fd)](_0x55ec8f[_0xbf9274(0x290)]):undefined,_0x2514dd=_0x55ec8f?.[_0xbf9274(0x1e3)]?Object[_0xbf9274(0x1fd)](_0x55ec8f['activations']):undefined;return{'type':_0xbf9274(0x232),'name':_0x104a34[_0xbf9274(0x243)],..._0x104a34['description']!==undefined&&{'description':_0x104a34[_0xbf9274(0x274)]},..._0x104a34[_0xbf9274(0x2a0)]&&{'goal':normalizeJourneyCriteria(_0x104a34[_0xbf9274(0x2a0)])},..._0x104a34[_0xbf9274(0x27b)]!==undefined&&{'reentry':_0x104a34[_0xbf9274(0x27b)]},..._0x104a34[_0xbf9274(0x290)]&&{'segments':normalizeEmbeddedSegments(_0x104a34[_0xbf9274(0x290)],_0x3cc67e)},..._0x104a34['activations']&&{'activations':normalizeEmbeddedActivations(_0x104a34['activations'],_0x2514dd)},..._0x104a34[_0xbf9274(0x22c)]&&{'journeys':_0x104a34['journeys'][_0xbf9274(0x255)](_0x5a3a0a=>normalizeJourneyEntry(_0x5a3a0a,_0x104a34[_0xbf9274(0x22c)][_0xbf9274(0x23e)]===0x1))}};}function normalizeJourneyEntry(_0x279c83,_0x2af6e7){const _0x499798=a147_0x3557e0;return{...!_0x2af6e7&&_0x279c83['version']!==undefined&&{'version':_0x279c83['version']},..._0x279c83[_0x499798(0x269)]!==undefined&&{'state':_0x279c83[_0x499798(0x269)]},...!_0x2af6e7&&_0x279c83[_0x499798(0x284)]!==undefined&&{'latest':_0x279c83[_0x499798(0x284)]},..._0x279c83[_0x499798(0x24d)]!==undefined&&{'version_number':_0x279c83['version_number']},..._0x279c83['goal']&&{'goal':normalizeJourneyCriteria(_0x279c83[_0x499798(0x2a0)])},..._0x279c83[_0x499798(0x27b)]!==undefined&&{'reentry':_0x279c83[_0x499798(0x27b)]},'stages':_0x279c83[_0x499798(0x258)][_0x499798(0x255)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x2c3a2f){const _0x4c77d3=a147_0x3557e0;return{'name':_0x2c3a2f[_0x4c77d3(0x243)],..._0x2c3a2f['description']!==undefined&&{'description':_0x2c3a2f['description']},..._0x2c3a2f['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0x2c3a2f[_0x4c77d3(0x28c)])},..._0x2c3a2f[_0x4c77d3(0x22f)]&&{'exit_criteria':_0x2c3a2f[_0x4c77d3(0x22f)][_0x4c77d3(0x255)](normalizeJourneyCriteria)},..._0x2c3a2f['milestone']&&{'milestone':normalizeJourneyCriteria(_0x2c3a2f[_0x4c77d3(0x25d)])},..._0x2c3a2f[_0x4c77d3(0x1f1)]&&{'steps':normalizeStepsWithImplicitNext(_0x2c3a2f['steps'])}};}function normalizeStepsWithImplicitNext(_0x285b26){const _0x1f9dd3=a147_0x3557e0;return _0x285b26[_0x1f9dd3(0x255)]((_0x5df47f,_0x215ab7)=>{const _0x2382c9=_0x1f9dd3,_0x4e5a1c=_0x215ab7<_0x285b26[_0x2382c9(0x23e)]-0x1?_0x285b26[_0x215ab7+0x1]['name']:undefined;return normalizeJourneyStep(_0x5df47f,_0x4e5a1c);});}function normalizeJourneyCriteria(_0x23cdb6){const _0x35c22a=a147_0x3557e0;return{'name':_0x23cdb6[_0x35c22a(0x243)],..._0x23cdb6[_0x35c22a(0x274)]!==undefined&&{'description':_0x23cdb6[_0x35c22a(0x274)]},'segment':_0x23cdb6[_0x35c22a(0x27d)],..._0x23cdb6[_0x35c22a(0x266)]&&{'target':normalizeJumpTarget(_0x23cdb6[_0x35c22a(0x266)])}};}function normalizeJourneyStep(_0x5e3c83,_0x4ab0be){const _0x383b25=a147_0x3557e0,_0x921451=_0x5e3c83[_0x383b25(0x213)]!==undefined&&_0x5e3c83[_0x383b25(0x213)]!==_0x4ab0be,_0x185850={'type':_0x5e3c83[_0x383b25(0x26a)],'name':_0x5e3c83[_0x383b25(0x243)],..._0x921451&&{'next':_0x5e3c83[_0x383b25(0x213)]}};if(_0x383b25(0x1f7)in _0x5e3c83&&_0x5e3c83[_0x383b25(0x1f7)])return{..._0x185850,'with':normalizeStepParams(_0x5e3c83[_0x383b25(0x26a)],_0x5e3c83['with'])};return _0x185850;}function normalizeStepParams(_0x341ac8,_0x2a1614){const _0x184e8c=a147_0x3557e0;switch(_0x341ac8){case'wait':{const _0xdcc993=_0x2a1614;let _0x29786b;return _0xdcc993['condition']&&(_0x29786b={'segment':_0xdcc993[_0x184e8c(0x200)][_0x184e8c(0x27d)],..._0xdcc993[_0x184e8c(0x200)]['next']!==undefined&&{'next':_0xdcc993[_0x184e8c(0x200)]['next']},..._0xdcc993[_0x184e8c(0x200)][_0x184e8c(0x283)]&&{'timeout':{'duration':_0xdcc993['condition'][_0x184e8c(0x283)][_0x184e8c(0x236)],'unit':_0xdcc993[_0x184e8c(0x200)][_0x184e8c(0x283)][_0x184e8c(0x23c)],..._0xdcc993[_0x184e8c(0x200)][_0x184e8c(0x283)][_0x184e8c(0x213)]!==undefined&&{'next':_0xdcc993[_0x184e8c(0x200)]['timeout'][_0x184e8c(0x213)]}}}}),{..._0xdcc993[_0x184e8c(0x236)]!==undefined&&{'duration':_0xdcc993[_0x184e8c(0x236)]},..._0xdcc993[_0x184e8c(0x23c)]!==undefined&&{'unit':_0xdcc993[_0x184e8c(0x23c)]},..._0xdcc993[_0x184e8c(0x1e4)]!==undefined&&{'wait_until':_0xdcc993[_0x184e8c(0x1e4)]},..._0xdcc993[_0x184e8c(0x289)]!==undefined&&{'days_of_week':_0xdcc993['days_of_week']},..._0x29786b&&{'condition':_0x29786b}};}case _0x184e8c(0x227):{const _0x3cf789=_0x2a1614;return{'activation':_0x3cf789[_0x184e8c(0x227)]};}case'decision_point':{const _0x4565ef=_0x2a1614;return{'branches':_0x4565ef[_0x184e8c(0x2a1)][_0x184e8c(0x255)](normalizeDecisionBranch)};}case _0x184e8c(0x20c):{const _0x2389af=_0x2a1614;return{..._0x2389af[_0x184e8c(0x21e)]!==undefined&&{'customized_split':_0x2389af[_0x184e8c(0x21e)]},..._0x2389af[_0x184e8c(0x260)]!==undefined&&{'unique_id':_0x2389af[_0x184e8c(0x260)]},'variants':_0x2389af[_0x184e8c(0x229)][_0x184e8c(0x255)](normalizeAbTestVariant)};}case'jump':{const _0x211ba6=_0x2a1614;return{'target':normalizeJumpTarget(_0x211ba6[_0x184e8c(0x266)])};}default:return _0x2a1614;}}function normalizeDecisionBranch(_0x558f3b){const _0x5b3f13=a147_0x3557e0;return{'name':_0x558f3b[_0x5b3f13(0x243)],..._0x558f3b[_0x5b3f13(0x27d)]!==undefined&&{'segment':_0x558f3b['segment']},..._0x558f3b['excluded']!==undefined&&{'excluded':_0x558f3b[_0x5b3f13(0x21c)]},..._0x558f3b[_0x5b3f13(0x213)]!==undefined&&{'next':_0x558f3b[_0x5b3f13(0x213)]}};}function normalizeAbTestVariant(_0x598693){const _0x4be743=a147_0x3557e0;return{..._0x598693['id']!==undefined&&{'id':_0x598693['id']},'name':_0x598693[_0x4be743(0x243)],'percentage':_0x598693['percentage'],..._0x598693[_0x4be743(0x213)]!==undefined&&{'next':_0x598693['next']}};}function normalizeJumpTarget(_0x4c6d2e){const _0x45a1f4=a147_0x3557e0;return{'journey':_0x4c6d2e[_0x45a1f4(0x232)],'stage':_0x4c6d2e[_0x45a1f4(0x295)],..._0x4c6d2e[_0x45a1f4(0x1f4)]!==undefined&&{'bundle_id':_0x4c6d2e[_0x45a1f4(0x1f4)]}};}function normalizeEmbeddedSegments(_0x226ffe,_0x14e514){const _0x40cb4a=a147_0x3557e0,_0x3b1658={},_0x6cb1bf=Object[_0x40cb4a(0x1fd)](_0x226ffe),_0x5b41c4=_0x14e514?[..._0x14e514[_0x40cb4a(0x215)](_0x49a3d7=>_0x6cb1bf[_0x40cb4a(0x271)](_0x49a3d7)),..._0x6cb1bf[_0x40cb4a(0x215)](_0x12041c=>!_0x14e514[_0x40cb4a(0x271)](_0x12041c))['sort']()]:_0x6cb1bf[_0x40cb4a(0x220)]();for(const _0x341569 of _0x5b41c4){const _0x292c83=_0x226ffe[_0x341569];if(_0x292c83['rule']){const _0x1ff3d6=_0x292c83[_0x40cb4a(0x270)];if(_0x1ff3d6[_0x40cb4a(0x26a)]!==_0x40cb4a(0x22a)&&_0x1ff3d6[_0x40cb4a(0x26a)]!=='Or'){const _0x483bb2=_0x1ff3d6[_0x40cb4a(0x26a)]??_0x40cb4a(0x202);throw new SDKError(ErrorCode[_0x40cb4a(0x214)],_0x40cb4a(0x28e)+_0x341569+_0x40cb4a(0x278)+(_0x40cb4a(0x244)+_0x483bb2+_0x40cb4a(0x2a2))+_0x40cb4a(0x261)+_0x40cb4a(0x29c)+_0x40cb4a(0x279)+'\x20\x20\x20\x20conditions:\x0a'+_0x40cb4a(0x225)+_0x40cb4a(0x282)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x1ff3d6['conditions']||!Array[_0x40cb4a(0x223)](_0x1ff3d6[_0x40cb4a(0x1f0)]))throw new SDKError(ErrorCode[_0x40cb4a(0x214)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x341569+_0x40cb4a(0x278)+'rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a'+_0x40cb4a(0x261)+_0x40cb4a(0x29c)+('\x20\x20\x20\x20type:\x20'+_0x1ff3d6[_0x40cb4a(0x26a)]+'\x0a')+_0x40cb4a(0x256)+_0x40cb4a(0x225)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x3b1658[_0x341569]={..._0x292c83[_0x40cb4a(0x274)]&&_0x292c83['description']['trim']()&&{'description':_0x292c83['description']},..._0x292c83[_0x40cb4a(0x270)]&&{'rule':deepSortObject(_0x292c83[_0x40cb4a(0x270)])}};}return _0x3b1658;}function normalizeEmbeddedActivations(_0x1f685c,_0x4418cf){const _0xc5d091=a147_0x3557e0,_0x48a4c9={},_0x583ac3=Object[_0xc5d091(0x1fd)](_0x1f685c),_0x56cb42=_0x4418cf?[..._0x4418cf[_0xc5d091(0x215)](_0x3c413c=>_0x583ac3[_0xc5d091(0x271)](_0x3c413c)),..._0x583ac3[_0xc5d091(0x215)](_0x16d708=>!_0x4418cf[_0xc5d091(0x271)](_0x16d708))[_0xc5d091(0x220)]()]:_0x583ac3[_0xc5d091(0x220)]();for(const _0x14bb10 of _0x56cb42){const _0x4b5b26=_0x1f685c[_0x14bb10];_0x48a4c9[_0x14bb10]={'name':_0x4b5b26[_0xc5d091(0x243)],'connection':_0x4b5b26[_0xc5d091(0x27a)],..._0x4b5b26[_0xc5d091(0x274)]!==undefined&&{'description':_0x4b5b26[_0xc5d091(0x274)]},..._0x4b5b26[_0xc5d091(0x249)]!==undefined&&{'all_columns':_0x4b5b26[_0xc5d091(0x249)]},..._0x4b5b26[_0xc5d091(0x205)]!==undefined&&{'columns':_0x4b5b26[_0xc5d091(0x205)]},..._0x4b5b26[_0xc5d091(0x253)]!==undefined&&{'behavior':_0x4b5b26[_0xc5d091(0x253)]},..._0x4b5b26[_0xc5d091(0x1eb)]!==undefined&&{'schedule':_0x4b5b26['schedule']},..._0x4b5b26[_0xc5d091(0x288)]!==undefined&&{'notification':_0x4b5b26[_0xc5d091(0x288)]},..._0x4b5b26[_0xc5d091(0x291)]!==undefined&&{'connector_config':_0x4b5b26[_0xc5d091(0x291)]},..._0x4b5b26[_0xc5d091(0x286)]!==undefined&&{'activation_template_id':_0x4b5b26[_0xc5d091(0x286)]}};}return _0x48a4c9;}export function getActiveStages(_0x520e06){const _0x59a88c=a147_0x3557e0;if(isJourneysArrayMode(_0x520e06)){const _0x4606d3=_0x520e06[_0x59a88c(0x22c)]||[],_0x688e28=_0x4606d3[_0x59a88c(0x25c)](_0x26ecaa=>_0x26ecaa[_0x59a88c(0x284)]===!![])||_0x4606d3[0x0];return _0x688e28?.[_0x59a88c(0x258)]||[];}if(isSingleVersionMode(_0x520e06))return _0x520e06[_0x59a88c(0x258)]||[];if(isMultiVersionMode(_0x520e06)){const _0x53833e=_0x520e06[_0x59a88c(0x293)]||[],_0x1e5bf9=_0x53833e[_0x59a88c(0x25c)](_0x3d0d51=>_0x3d0d51[_0x59a88c(0x284)]===!![])||_0x53833e[0x0];return _0x1e5bf9?.[_0x59a88c(0x258)]||[];}return[];}export function getLatestJourneyEntry(_0x3555c2){const _0x28a33d=a147_0x3557e0;if(isJourneysArrayMode(_0x3555c2)){const _0x4190ae=_0x3555c2['journeys']||[];return _0x4190ae[_0x28a33d(0x25c)](_0x5dd129=>_0x5dd129['latest']===!![])||_0x4190ae[0x0];}if(isMultiVersionMode(_0x3555c2)){const _0x1dd7a9=_0x3555c2[_0x28a33d(0x293)]||[],_0x18f799=_0x1dd7a9[_0x28a33d(0x25c)](_0x34c827=>_0x34c827[_0x28a33d(0x284)]===!![])||_0x1dd7a9[0x0];if(_0x18f799)return{'version':_0x18f799['name'],'state':_0x18f799[_0x28a33d(0x269)],'latest':_0x18f799['latest'],'stages':_0x18f799['stages'],'id':_0x18f799['id'],'version_number':_0x18f799[_0x28a33d(0x24d)]};}if(isSingleVersionMode(_0x3555c2))return{'version':_0x3555c2[_0x28a33d(0x230)]||'v1','state':_0x28a33d(0x28d),'stages':_0x3555c2[_0x28a33d(0x258)]||[],'id':_0x3555c2['id'],'version_number':_0x3555c2[_0x28a33d(0x24d)],'goal':_0x3555c2[_0x28a33d(0x2a0)],'reentry':_0x3555c2[_0x28a33d(0x27b)]};return undefined;}export function getLatestVersion(_0x5d9e06){const _0x489322=a147_0x3557e0;if(!isMultiVersionMode(_0x5d9e06))return undefined;const _0xd63c43=_0x5d9e06['versions']||[];return _0xd63c43[_0x489322(0x25c)](_0x2578d1=>_0x2578d1[_0x489322(0x284)]===!![])||_0xd63c43[0x0];}export function getEffectiveGoal(_0x19fcc3){const _0x594289=a147_0x3557e0,_0x115beb=getLatestJourneyEntry(_0x19fcc3);return _0x115beb?.[_0x594289(0x2a0)]||_0x19fcc3[_0x594289(0x2a0)];}export function getEffectiveReentry(_0x33e317){const _0x42eb70=a147_0x3557e0,_0x412960=getLatestJourneyEntry(_0x33e317);return _0x412960?.[_0x42eb70(0x27b)]||_0x33e317[_0x42eb70(0x27b)];}export function collectSegmentRefs(_0x58975a){const _0x153d5a=a147_0x3557e0,_0x15dff4=new Set();_0x58975a['goal']?.[_0x153d5a(0x27d)]&&_0x15dff4[_0x153d5a(0x1e9)](_0x58975a['goal'][_0x153d5a(0x27d)]);const _0x917e60=_0x5de2c7=>{const _0x3bb2d3=_0x153d5a;for(const _0x56b170 of _0x5de2c7){_0x56b170['entry_criteria']?.[_0x3bb2d3(0x27d)]&&_0x15dff4[_0x3bb2d3(0x1e9)](_0x56b170[_0x3bb2d3(0x28c)][_0x3bb2d3(0x27d)]);if(_0x56b170[_0x3bb2d3(0x22f)])for(const _0x1733e1 of _0x56b170[_0x3bb2d3(0x22f)]){_0x1733e1['segment']&&_0x15dff4['add'](_0x1733e1[_0x3bb2d3(0x27d)]);}_0x56b170[_0x3bb2d3(0x25d)]?.['segment']&&_0x15dff4[_0x3bb2d3(0x1e9)](_0x56b170[_0x3bb2d3(0x25d)][_0x3bb2d3(0x27d)]);if(_0x56b170[_0x3bb2d3(0x1f1)])for(const _0x54592f of _0x56b170[_0x3bb2d3(0x1f1)]){if(_0x54592f[_0x3bb2d3(0x26a)]==='decision_point'){const _0x2441eb=_0x54592f;for(const _0x2a86c6 of _0x2441eb['with']['branches']){_0x2a86c6[_0x3bb2d3(0x27d)]&&_0x15dff4[_0x3bb2d3(0x1e9)](_0x2a86c6['segment']);}}else{if(_0x54592f['type']===_0x3bb2d3(0x25e)){const _0x131cf9=_0x54592f;_0x131cf9[_0x3bb2d3(0x1f7)]['condition']?.[_0x3bb2d3(0x27d)]&&_0x15dff4[_0x3bb2d3(0x1e9)](_0x131cf9[_0x3bb2d3(0x1f7)][_0x3bb2d3(0x200)][_0x3bb2d3(0x27d)]);}}}}};_0x58975a[_0x153d5a(0x258)]&&_0x917e60(_0x58975a[_0x153d5a(0x258)]);if(_0x58975a[_0x153d5a(0x293)])for(const _0x536e92 of _0x58975a['versions']){_0x917e60(_0x536e92[_0x153d5a(0x258)]);}return _0x15dff4;}export function validateSegmentRefs(_0x197c18){const _0x3c8b78=a147_0x3557e0,_0x3678c5=[],_0x20fac2=collectSegmentRefs(_0x197c18),_0x56dbd1=new Set(Object[_0x3c8b78(0x1fd)](_0x197c18[_0x3c8b78(0x290)]||{}));for(const _0x5d9515 of _0x20fac2){const _0x27dfe7=parseSegmentRef(_0x5d9515);_0x27dfe7[_0x3c8b78(0x26a)]===_0x3c8b78(0x24f)&&!_0x56dbd1['has'](_0x27dfe7['name'])&&_0x3678c5[_0x3c8b78(0x207)]('Unknown\x20segment\x20\x22'+_0x27dfe7[_0x3c8b78(0x243)]+_0x3c8b78(0x298)+_0x27dfe7[_0x3c8b78(0x243)]+_0x3c8b78(0x212));}return _0x3678c5;}export function collectSegmentIdsFromJourneyApi(_0xac68e8){const _0x1bcbad=a147_0x3557e0,_0x1152d0=new Set();_0xac68e8[_0x1bcbad(0x1e5)][_0x1bcbad(0x2a0)]?.[_0x1bcbad(0x287)]&&_0x1152d0[_0x1bcbad(0x1e9)](_0xac68e8[_0x1bcbad(0x1e5)]['goal'][_0x1bcbad(0x287)]);const _0x2df5fd=_0xac68e8[_0x1bcbad(0x1e5)][_0x1bcbad(0x1ff)];if(Array[_0x1bcbad(0x223)](_0x2df5fd))for(const _0x4ae284 of _0x2df5fd){_0x4ae284[_0x1bcbad(0x294)]?.[_0x1bcbad(0x287)]&&_0x1152d0[_0x1bcbad(0x1e9)](_0x4ae284[_0x1bcbad(0x294)][_0x1bcbad(0x287)]);const _0xff247b=_0x4ae284[_0x1bcbad(0x235)]??_0x4ae284[_0x1bcbad(0x208)];if(Array[_0x1bcbad(0x223)](_0xff247b))for(const _0x5eaae7 of _0xff247b){_0x5eaae7[_0x1bcbad(0x287)]&&_0x1152d0['add'](_0x5eaae7[_0x1bcbad(0x287)]);}_0x4ae284[_0x1bcbad(0x25d)]?.[_0x1bcbad(0x287)]&&_0x1152d0[_0x1bcbad(0x1e9)](_0x4ae284[_0x1bcbad(0x25d)][_0x1bcbad(0x287)]);if(_0x4ae284[_0x1bcbad(0x1f1)]&&typeof _0x4ae284['steps']===_0x1bcbad(0x23d)){const _0x4e1331=Array[_0x1bcbad(0x223)](_0x4ae284['steps'])?_0x4ae284['steps']:Object[_0x1bcbad(0x26d)](_0x4ae284[_0x1bcbad(0x1f1)]);for(const _0x4a4876 of _0x4e1331){_0x4a4876[_0x1bcbad(0x21a)]?.[_0x1bcbad(0x287)]&&_0x1152d0[_0x1bcbad(0x1e9)](_0x4a4876[_0x1bcbad(0x21a)][_0x1bcbad(0x287)]);const _0x558c00=_0x4a4876;_0x558c00[_0x1bcbad(0x216)]&&_0x1152d0[_0x1bcbad(0x1e9)](_0x558c00[_0x1bcbad(0x216)]);if(Array['isArray'](_0x558c00[_0x1bcbad(0x1f0)]))for(const _0xac46b4 of _0x558c00[_0x1bcbad(0x1f0)]){_0xac46b4[_0x1bcbad(0x287)]&&_0x1152d0[_0x1bcbad(0x1e9)](_0xac46b4[_0x1bcbad(0x287)]);}if(Array[_0x1bcbad(0x223)](_0x4a4876[_0x1bcbad(0x2a1)]))for(const _0x5b0e84 of _0x4a4876['branches']){_0x5b0e84[_0x1bcbad(0x287)]&&_0x1152d0[_0x1bcbad(0x1e9)](_0x5b0e84[_0x1bcbad(0x287)]);}}}}return _0x1152d0;}
@@ -1 +1 @@
1
- const a148_0xfa874e=a148_0x1d58;(function(_0x4a1123,_0x5ad0c2){const _0x27e079=a148_0x1d58,_0x4ec10f=_0x4a1123();while(!![]){try{const _0x2e9136=-parseInt(_0x27e079(0x9e))/0x1+parseInt(_0x27e079(0xa8))/0x2+-parseInt(_0x27e079(0xd4))/0x3+parseInt(_0x27e079(0xb4))/0x4*(-parseInt(_0x27e079(0xad))/0x5)+parseInt(_0x27e079(0x9b))/0x6*(parseInt(_0x27e079(0x9c))/0x7)+-parseInt(_0x27e079(0xc0))/0x8*(-parseInt(_0x27e079(0xa4))/0x9)+parseInt(_0x27e079(0xb5))/0xa;if(_0x2e9136===_0x5ad0c2)break;else _0x4ec10f['push'](_0x4ec10f['shift']());}catch(_0x6acfe1){_0x4ec10f['push'](_0x4ec10f['shift']());}}}(a148_0x288c,0x4b3df));export const DEFAULT_TIME_RANGE=a148_0xfa874e(0x9f);function a148_0x288c(){const _0x2daeeb=['\x20LIMIT\x200','master','890508qFdWsB','7ylcFHE','\x27)\x0aLIMIT\x20','339871fOmKWt','-1d','\x0aLIMIT\x20','\x20=\x20a.','\x0aSELECT\x20m.','forEach','12105ZITfix','length','SELECT\x20*\x20FROM\x20','b.*','737332hPaNDl','column',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','trim','\x27)\x0a','4105hqWbbv','\x20b\x0a\x20\x20ON\x20m.','\x20m\x0aLEFT\x20JOIN\x20','SELECT\x20','source','\x0aLIMIT\x200\x0a','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','2540PgKQsy','11665960NPjxKB','\x0a\x20\x20ON\x20m.','map','columns','attributes','name','behaviors','\x20a\x0a\x20\x20ON\x20m.','\x0aFROM\x20','push','\x20=\x20b.','88KMBMgZ','all_columns','join','child_key','\x20IS\x20NOT\x20NULL\x0a','\x20m\x0a','\x20=\x20','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','\x0aWHERE\x20a.','m.*','table','parent_key','find','label','\x0aSELECT\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','LEFT\x20JOIN\x20','\x20LIMIT\x20','(all\x20columns)','database','1587234bWFgPt','\x20m\x0aJOIN\x20','toLowerCase'];a148_0x288c=function(){return _0x2daeeb;};return a148_0x288c();}export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x557060,_0x5529ef,_0x1fb490){const _0x16eb5f=a148_0xfa874e,_0x28b516=_0x1fb490&&_0x1fb490[_0x16eb5f(0xa5)]>0x0?_0x1fb490[_0x16eb5f(0xc2)](',\x20'):'*';return _0x16eb5f(0xb0)+_0x28b516+'\x20FROM\x20'+_0x557060+'.'+_0x5529ef+_0x16eb5f(0xd7);}export function generateMasterCountSQL(_0x5df542){const _0x32606c=a148_0xfa874e,{database:_0x5df9ee,table:_0x5bc3fa}=_0x5df542['master'];return _0x32606c(0xb3)+_0x5df9ee+'.'+_0x5bc3fa;}function a148_0x1d58(_0x1986ed,_0x34f9fb){_0x1986ed=_0x1986ed-0x9b;const _0x288c46=a148_0x288c();let _0x1d58c5=_0x288c46[_0x1986ed];return _0x1d58c5;}export function generateMasterSampleSQL(_0x4faf32,_0x451e6d=0x5){const {database:_0x3be31e,table:_0x2fd58c}=_0x4faf32['master'];return'SELECT\x20*\x20FROM\x20'+_0x3be31e+'.'+_0x2fd58c+'\x20LIMIT\x20'+_0x451e6d;}export function generateAttributeCoverageSQL(_0xb1c02b,_0x45990d){const _0x25ca6a=a148_0xfa874e,_0x505c66=_0xb1c02b[_0x25ca6a(0xd8)];return('\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20'+_0x505c66['database']+'.'+_0x505c66[_0x25ca6a(0xca)]+_0x25ca6a(0xaf)+_0x45990d['source'][_0x25ca6a(0xd3)]+'.'+_0x45990d[_0x25ca6a(0xb1)][_0x25ca6a(0xca)]+_0x25ca6a(0xbc)+_0x45990d[_0x25ca6a(0xc2)]['parent_key']+_0x25ca6a(0xa1)+_0x45990d[_0x25ca6a(0xc2)]['child_key']+_0x25ca6a(0xc8)+_0x45990d['join']['child_key']+_0x25ca6a(0xc4))[_0x25ca6a(0xab)]();}export function generateBehaviorStatsSQL(_0x5bef8e,_0x3fb7e0,_0x1f1502=DEFAULT_TIME_RANGE){const _0x362748=a148_0xfa874e,_0x553820=_0x5bef8e[_0x362748(0xd8)];return(_0x362748(0xc7)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xcb)]+_0x362748(0xaa)+_0x553820['database']+'.'+_0x553820[_0x362748(0xca)]+_0x362748(0xd5)+_0x3fb7e0[_0x362748(0xb1)]['database']+'.'+_0x3fb7e0[_0x362748(0xb1)]['table']+_0x362748(0xae)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xcb)]+_0x362748(0xbf)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xc3)]+_0x362748(0xcf)+_0x1f1502+_0x362748(0xac))['trim']();}export function generateAttributeSampleSQL(_0x52acd4,_0x3313d3,_0x340681=0x5){const _0x503aed=a148_0xfa874e,_0x23190d=_0x52acd4[_0x503aed(0xd8)],_0x20ebf2=_0x3313d3[_0x503aed(0xc2)]['parent_key'],_0x53fb9b=_0x3313d3[_0x503aed(0xb8)][_0x503aed(0xb7)](_0x27aa65=>'a.'+_0x27aa65[_0x503aed(0xa9)])['join'](',\x20');return(_0x503aed(0xa2)+_0x20ebf2+',\x20'+_0x53fb9b+_0x503aed(0xbd)+_0x23190d[_0x503aed(0xd3)]+'.'+_0x23190d[_0x503aed(0xca)]+'\x20m\x0aJOIN\x20'+_0x3313d3[_0x503aed(0xb1)][_0x503aed(0xd3)]+'.'+_0x3313d3[_0x503aed(0xb1)][_0x503aed(0xca)]+_0x503aed(0xbc)+_0x3313d3['join'][_0x503aed(0xcb)]+_0x503aed(0xa1)+_0x3313d3['join'][_0x503aed(0xc3)]+'\x0aLIMIT\x20'+_0x340681+'\x0a')['trim']();}export function generateBehaviorSampleSQL(_0x36484e,_0x22ca94,_0x106b18=0x5,_0x41aafd=DEFAULT_TIME_RANGE){const _0x35db29=a148_0xfa874e,_0x540452=_0x36484e[_0x35db29(0xd8)],_0x2c6af0=_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xcb)];let _0x4f250c;if(_0x22ca94[_0x35db29(0xc1)])_0x4f250c=_0x35db29(0xa7);else _0x22ca94['columns']&&_0x22ca94[_0x35db29(0xb8)][_0x35db29(0xa5)]>0x0?_0x4f250c=_0x22ca94[_0x35db29(0xb8)]['map'](_0x18ee4c=>'b.'+_0x18ee4c[_0x35db29(0xa9)])[_0x35db29(0xc2)](',\x20'):_0x4f250c=_0x35db29(0xa7);return('\x0aSELECT\x20m.'+_0x2c6af0+',\x20'+_0x4f250c+_0x35db29(0xbd)+_0x540452[_0x35db29(0xd3)]+'.'+_0x540452[_0x35db29(0xca)]+_0x35db29(0xd5)+_0x22ca94[_0x35db29(0xb1)][_0x35db29(0xd3)]+'.'+_0x22ca94[_0x35db29(0xb1)]['table']+_0x35db29(0xae)+_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xcb)]+'\x20=\x20b.'+_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xc3)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x41aafd+_0x35db29(0x9d)+_0x106b18+'\x0a')[_0x35db29(0xab)]();}function quoteIdentifier(_0xabe715){if(/[\s\-\.\#\[\]\(\)]|^[0-9]/['test'](_0xabe715))return'\x22'+_0xabe715['replace'](/"/g,'\x22\x22')+'\x22';return _0xabe715;}export function generateEnrichedSQL(_0x592ff4,_0x2e5e2b=0x5){const _0x2927cd=a148_0xfa874e,_0x586fe4=_0x592ff4[_0x2927cd(0xd8)],_0x27dc50=_0x592ff4[_0x2927cd(0xb9)]||[];if(_0x27dc50[_0x2927cd(0xa5)]===0x0)return _0x2927cd(0xa6)+_0x586fe4[_0x2927cd(0xd3)]+'.'+_0x586fe4[_0x2927cd(0xca)]+_0x2927cd(0xd1)+_0x2e5e2b;const _0xc370b9=[_0x2927cd(0xc9)],_0x34bdc3=[];return _0x27dc50['forEach']((_0x4a846a,_0x451481)=>{const _0x413d1a=_0x2927cd,_0x1a003e='a'+_0x451481;_0x4a846a['columns'][_0x413d1a(0xa3)](_0x7d0332=>{const _0x1170c9=_0x413d1a,_0x29d062=quoteIdentifier(_0x7d0332[_0x1170c9(0xcd)]||_0x7d0332[_0x1170c9(0xa9)]);_0xc370b9[_0x1170c9(0xbe)](_0x1a003e+'.'+_0x7d0332[_0x1170c9(0xa9)]+'\x20AS\x20'+_0x29d062);}),_0x34bdc3[_0x413d1a(0xbe)](_0x413d1a(0xd0)+_0x4a846a[_0x413d1a(0xb1)][_0x413d1a(0xd3)]+'.'+_0x4a846a[_0x413d1a(0xb1)][_0x413d1a(0xca)]+'\x20'+_0x1a003e+_0x413d1a(0xb6)+_0x4a846a[_0x413d1a(0xc2)][_0x413d1a(0xcb)]+_0x413d1a(0xc6)+_0x1a003e+'.'+_0x4a846a[_0x413d1a(0xc2)][_0x413d1a(0xc3)]);}),(_0x2927cd(0xce)+_0xc370b9[_0x2927cd(0xc2)](',\x20')+_0x2927cd(0xbd)+_0x586fe4[_0x2927cd(0xd3)]+'.'+_0x586fe4[_0x2927cd(0xca)]+_0x2927cd(0xc5)+_0x34bdc3[_0x2927cd(0xc2)]('\x0a')+_0x2927cd(0xa0)+_0x2e5e2b+'\x0a')[_0x2927cd(0xab)]();}export function generateAttributeSchemaSQL(_0x121fcc,_0x162458){const _0x46eb98=a148_0xfa874e,_0x3f3b7e=_0x121fcc[_0x46eb98(0xd8)],_0x2c123b=_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xcb)],_0x3e2467=_0x162458[_0x46eb98(0xb8)][_0x46eb98(0xb7)](_0x16760c=>'a.'+_0x16760c[_0x46eb98(0xa9)])[_0x46eb98(0xc2)](',\x20');return(_0x46eb98(0xa2)+_0x2c123b+',\x20'+_0x3e2467+_0x46eb98(0xbd)+_0x3f3b7e[_0x46eb98(0xd3)]+'.'+_0x3f3b7e[_0x46eb98(0xca)]+'\x20m\x0aJOIN\x20'+_0x162458[_0x46eb98(0xb1)][_0x46eb98(0xd3)]+'.'+_0x162458[_0x46eb98(0xb1)][_0x46eb98(0xca)]+_0x46eb98(0xbc)+_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xcb)]+_0x46eb98(0xa1)+_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xc3)]+_0x46eb98(0xb2))[_0x46eb98(0xab)]();}export function generateBehaviorSchemaSQL(_0x5a1995,_0x370a75){const _0x565523=a148_0xfa874e,_0x148db9=_0x5a1995[_0x565523(0xd8)],_0x4cdc80=_0x370a75[_0x565523(0xc2)]['parent_key'];let _0x3cff37;if(_0x370a75[_0x565523(0xc1)])_0x3cff37=_0x565523(0xa7);else _0x370a75[_0x565523(0xb8)]&&_0x370a75[_0x565523(0xb8)][_0x565523(0xa5)]>0x0?_0x3cff37=_0x370a75[_0x565523(0xb8)]['map'](_0x39b75b=>'b.'+_0x39b75b[_0x565523(0xa9)])[_0x565523(0xc2)](',\x20'):_0x3cff37=_0x565523(0xa7);return(_0x565523(0xa2)+_0x4cdc80+',\x20'+_0x3cff37+_0x565523(0xbd)+_0x148db9['database']+'.'+_0x148db9[_0x565523(0xca)]+_0x565523(0xd5)+_0x370a75[_0x565523(0xb1)][_0x565523(0xd3)]+'.'+_0x370a75['source'][_0x565523(0xca)]+_0x565523(0xae)+_0x370a75[_0x565523(0xc2)]['parent_key']+_0x565523(0xbf)+_0x370a75['join']['child_key']+_0x565523(0xb2))[_0x565523(0xab)]();}export function getAttributeColumns(_0x195a28){const _0x3fccd8=a148_0xfa874e;return _0x195a28[_0x3fccd8(0xb8)][_0x3fccd8(0xb7)](_0x2c4c77=>({'label':_0x2c4c77['label']||_0x2c4c77['column'],'column':_0x2c4c77[_0x3fccd8(0xa9)]}));}export function getBehaviorColumns(_0x3ac49f){const _0x1ee824=a148_0xfa874e;if(_0x3ac49f[_0x1ee824(0xc1)])return[{'label':'(all\x20columns)','column':'*'}];if(_0x3ac49f[_0x1ee824(0xb8)]&&_0x3ac49f[_0x1ee824(0xb8)][_0x1ee824(0xa5)]>0x0)return _0x3ac49f[_0x1ee824(0xb8)]['map'](_0x2d94e0=>({'label':_0x2d94e0[_0x1ee824(0xcd)]||_0x2d94e0[_0x1ee824(0xa9)],'column':_0x2d94e0[_0x1ee824(0xa9)]}));return[{'label':_0x1ee824(0xd2),'column':'*'}];}export function findAttributeByName(_0x43900c,_0x9caa2c){const _0x2bf551=a148_0xfa874e;return _0x43900c[_0x2bf551(0xb9)]?.[_0x2bf551(0xcc)](_0xf9a751=>_0xf9a751[_0x2bf551(0xba)][_0x2bf551(0xd6)]()===_0x9caa2c[_0x2bf551(0xd6)]());}export function findBehaviorByName(_0x41f4c4,_0x2bc993){const _0x2561eb=a148_0xfa874e;return _0x41f4c4[_0x2561eb(0xbb)]?.[_0x2561eb(0xcc)](_0x5e4ea8=>_0x5e4ea8[_0x2561eb(0xba)][_0x2561eb(0xd6)]()===_0x2bc993[_0x2561eb(0xd6)]());}
1
+ const a148_0x4fa652=a148_0x425a;(function(_0x502c8d,_0x79f827){const _0x22fbe0=a148_0x425a,_0x288653=_0x502c8d();while(!![]){try{const _0xf9e2fa=parseInt(_0x22fbe0(0x165))/0x1+-parseInt(_0x22fbe0(0x15a))/0x2*(parseInt(_0x22fbe0(0x144))/0x3)+parseInt(_0x22fbe0(0x13d))/0x4+-parseInt(_0x22fbe0(0x145))/0x5+parseInt(_0x22fbe0(0x151))/0x6*(-parseInt(_0x22fbe0(0x13e))/0x7)+parseInt(_0x22fbe0(0x149))/0x8+-parseInt(_0x22fbe0(0x153))/0x9*(parseInt(_0x22fbe0(0x15d))/0xa);if(_0xf9e2fa===_0x79f827)break;else _0x288653['push'](_0x288653['shift']());}catch(_0x3f002d){_0x288653['push'](_0x288653['shift']());}}}(a148_0x3f5e,0x1c29a));export const DEFAULT_TIME_RANGE=a148_0x4fa652(0x15c);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x4cff03,_0x5b7e46,_0x163f5e){const _0x246892=a148_0x4fa652,_0x5d7422=_0x163f5e&&_0x163f5e[_0x246892(0x14d)]>0x0?_0x163f5e['join'](',\x20'):'*';return _0x246892(0x159)+_0x5d7422+'\x20FROM\x20'+_0x4cff03+'.'+_0x5b7e46+_0x246892(0x148);}export function generateMasterCountSQL(_0xcafed6){const _0x581c85=a148_0x4fa652,{database:_0x50e4ba,table:_0x2185d0}=_0xcafed6[_0x581c85(0x133)];return _0x581c85(0x150)+_0x50e4ba+'.'+_0x2185d0;}export function generateMasterSampleSQL(_0x317fac,_0x180644=0x5){const _0x475acd=a148_0x4fa652,{database:_0x324154,table:_0x4e5c1b}=_0x317fac[_0x475acd(0x133)];return'SELECT\x20*\x20FROM\x20'+_0x324154+'.'+_0x4e5c1b+'\x20LIMIT\x20'+_0x180644;}function a148_0x425a(_0x44774f,_0x5943b1){_0x44774f=_0x44774f-0x12f;const _0x3f5ebc=a148_0x3f5e();let _0x425ac8=_0x3f5ebc[_0x44774f];return _0x425ac8;}export function generateAttributeCoverageSQL(_0x4abcd9,_0x384487){const _0x49262c=a148_0x4fa652,_0x2087a1=_0x4abcd9[_0x49262c(0x133)];return(_0x49262c(0x15b)+_0x2087a1[_0x49262c(0x136)]+'.'+_0x2087a1[_0x49262c(0x13c)]+'\x20m\x0aLEFT\x20JOIN\x20'+_0x384487[_0x49262c(0x147)][_0x49262c(0x136)]+'.'+_0x384487[_0x49262c(0x147)][_0x49262c(0x13c)]+_0x49262c(0x14e)+_0x384487[_0x49262c(0x138)][_0x49262c(0x154)]+_0x49262c(0x163)+_0x384487[_0x49262c(0x138)]['child_key']+'\x0aWHERE\x20a.'+_0x384487[_0x49262c(0x138)][_0x49262c(0x14c)]+_0x49262c(0x143))['trim']();}function a148_0x3f5e(){const _0x512dc6=['find','\x0aSELECT\x20m.','\x20IS\x20NOT\x20NULL\x0a','6fxeJdI','230935DPRngV','LEFT\x20JOIN\x20','source','\x20LIMIT\x200','925392sEbkoq','\x0aLIMIT\x200\x0a','\x20m\x0aJOIN\x20','child_key','length','\x20a\x0a\x20\x20ON\x20m.','trim','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','6ilLIbF','attributes','513iYTOdt','parent_key','\x0aFROM\x20','\x0aLIMIT\x20','\x20b\x0a\x20\x20ON\x20m.','\x0aSELECT\x20','SELECT\x20','187448azTOnI','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','-1d','2290WFlkgF','\x20m\x0a','columns','forEach','\x27)\x0aLIMIT\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','\x20=\x20a.','toLowerCase','35876WWoLKG','test','label','b.*','name','master','column','map','database','all_columns','join','\x0a\x20\x20ON\x20m.','behaviors','m.*','table','845684RfSprp','6503elIDEF','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','push'];a148_0x3f5e=function(){return _0x512dc6;};return a148_0x3f5e();}export function generateBehaviorStatsSQL(_0x2f3c5e,_0x16354e,_0xc571bc=DEFAULT_TIME_RANGE){const _0x1986c6=a148_0x4fa652,_0x400769=_0x2f3c5e[_0x1986c6(0x133)];return(_0x1986c6(0x13f)+_0x16354e[_0x1986c6(0x138)][_0x1986c6(0x154)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x400769['database']+'.'+_0x400769[_0x1986c6(0x13c)]+_0x1986c6(0x14b)+_0x16354e[_0x1986c6(0x147)][_0x1986c6(0x136)]+'.'+_0x16354e['source'][_0x1986c6(0x13c)]+_0x1986c6(0x157)+_0x16354e[_0x1986c6(0x138)]['parent_key']+'\x20=\x20b.'+_0x16354e['join'][_0x1986c6(0x14c)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0xc571bc+'\x27)\x0a')['trim']();}export function generateAttributeSampleSQL(_0x2bee1e,_0x35e70e,_0x3c687c=0x5){const _0x35dea3=a148_0x4fa652,_0x4920d9=_0x2bee1e[_0x35dea3(0x133)],_0x54e469=_0x35e70e[_0x35dea3(0x138)][_0x35dea3(0x154)],_0x5d6e3e=_0x35e70e['columns'][_0x35dea3(0x135)](_0x210e1c=>'a.'+_0x210e1c[_0x35dea3(0x134)])[_0x35dea3(0x138)](',\x20');return(_0x35dea3(0x142)+_0x54e469+',\x20'+_0x5d6e3e+_0x35dea3(0x155)+_0x4920d9[_0x35dea3(0x136)]+'.'+_0x4920d9[_0x35dea3(0x13c)]+_0x35dea3(0x14b)+_0x35e70e[_0x35dea3(0x147)][_0x35dea3(0x136)]+'.'+_0x35e70e[_0x35dea3(0x147)][_0x35dea3(0x13c)]+_0x35dea3(0x14e)+_0x35e70e[_0x35dea3(0x138)][_0x35dea3(0x154)]+_0x35dea3(0x163)+_0x35e70e[_0x35dea3(0x138)][_0x35dea3(0x14c)]+_0x35dea3(0x156)+_0x3c687c+'\x0a')[_0x35dea3(0x14f)]();}export function generateBehaviorSampleSQL(_0x4d72bc,_0x4ba0d2,_0x5dfb8b=0x5,_0x5baccd=DEFAULT_TIME_RANGE){const _0x299d3c=a148_0x4fa652,_0x560852=_0x4d72bc[_0x299d3c(0x133)],_0x447a6a=_0x4ba0d2[_0x299d3c(0x138)][_0x299d3c(0x154)];let _0x1a73f8;if(_0x4ba0d2[_0x299d3c(0x137)])_0x1a73f8=_0x299d3c(0x131);else _0x4ba0d2['columns']&&_0x4ba0d2[_0x299d3c(0x15f)][_0x299d3c(0x14d)]>0x0?_0x1a73f8=_0x4ba0d2[_0x299d3c(0x15f)][_0x299d3c(0x135)](_0x291f5d=>'b.'+_0x291f5d['column'])[_0x299d3c(0x138)](',\x20'):_0x1a73f8=_0x299d3c(0x131);return(_0x299d3c(0x142)+_0x447a6a+',\x20'+_0x1a73f8+_0x299d3c(0x155)+_0x560852[_0x299d3c(0x136)]+'.'+_0x560852[_0x299d3c(0x13c)]+_0x299d3c(0x14b)+_0x4ba0d2[_0x299d3c(0x147)][_0x299d3c(0x136)]+'.'+_0x4ba0d2[_0x299d3c(0x147)][_0x299d3c(0x13c)]+_0x299d3c(0x157)+_0x4ba0d2[_0x299d3c(0x138)][_0x299d3c(0x154)]+'\x20=\x20b.'+_0x4ba0d2[_0x299d3c(0x138)][_0x299d3c(0x14c)]+_0x299d3c(0x162)+_0x5baccd+_0x299d3c(0x161)+_0x5dfb8b+'\x0a')[_0x299d3c(0x14f)]();}function quoteIdentifier(_0x27dd47){const _0x492b55=a148_0x4fa652;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x492b55(0x12f)](_0x27dd47))return'\x22'+_0x27dd47['replace'](/"/g,'\x22\x22')+'\x22';return _0x27dd47;}export function generateEnrichedSQL(_0x3d4339,_0x53189f=0x5){const _0x2aac50=a148_0x4fa652,_0x2f9348=_0x3d4339[_0x2aac50(0x133)],_0x36695e=_0x3d4339[_0x2aac50(0x152)]||[];if(_0x36695e[_0x2aac50(0x14d)]===0x0)return'SELECT\x20*\x20FROM\x20'+_0x2f9348[_0x2aac50(0x136)]+'.'+_0x2f9348[_0x2aac50(0x13c)]+'\x20LIMIT\x20'+_0x53189f;const _0x446a10=[_0x2aac50(0x13b)],_0x1a2ba2=[];return _0x36695e[_0x2aac50(0x160)]((_0x45c501,_0x1301a2)=>{const _0x45d5f6=_0x2aac50,_0x1fa160='a'+_0x1301a2;_0x45c501[_0x45d5f6(0x15f)][_0x45d5f6(0x160)](_0x2a4077=>{const _0x3d006e=_0x45d5f6,_0x585a6b=quoteIdentifier(_0x2a4077['label']||_0x2a4077[_0x3d006e(0x134)]);_0x446a10[_0x3d006e(0x140)](_0x1fa160+'.'+_0x2a4077[_0x3d006e(0x134)]+'\x20AS\x20'+_0x585a6b);}),_0x1a2ba2[_0x45d5f6(0x140)](_0x45d5f6(0x146)+_0x45c501[_0x45d5f6(0x147)][_0x45d5f6(0x136)]+'.'+_0x45c501[_0x45d5f6(0x147)]['table']+'\x20'+_0x1fa160+_0x45d5f6(0x139)+_0x45c501[_0x45d5f6(0x138)][_0x45d5f6(0x154)]+'\x20=\x20'+_0x1fa160+'.'+_0x45c501['join'][_0x45d5f6(0x14c)]);}),(_0x2aac50(0x158)+_0x446a10[_0x2aac50(0x138)](',\x20')+_0x2aac50(0x155)+_0x2f9348['database']+'.'+_0x2f9348[_0x2aac50(0x13c)]+_0x2aac50(0x15e)+_0x1a2ba2[_0x2aac50(0x138)]('\x0a')+_0x2aac50(0x156)+_0x53189f+'\x0a')[_0x2aac50(0x14f)]();}export function generateAttributeSchemaSQL(_0x21df22,_0x2890a5){const _0x208a31=a148_0x4fa652,_0xfb99ca=_0x21df22['master'],_0x278f44=_0x2890a5['join'][_0x208a31(0x154)],_0x542e96=_0x2890a5[_0x208a31(0x15f)]['map'](_0x4edf04=>'a.'+_0x4edf04[_0x208a31(0x134)])[_0x208a31(0x138)](',\x20');return('\x0aSELECT\x20m.'+_0x278f44+',\x20'+_0x542e96+'\x0aFROM\x20'+_0xfb99ca[_0x208a31(0x136)]+'.'+_0xfb99ca[_0x208a31(0x13c)]+_0x208a31(0x14b)+_0x2890a5[_0x208a31(0x147)][_0x208a31(0x136)]+'.'+_0x2890a5[_0x208a31(0x147)][_0x208a31(0x13c)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x2890a5[_0x208a31(0x138)]['parent_key']+_0x208a31(0x163)+_0x2890a5[_0x208a31(0x138)][_0x208a31(0x14c)]+_0x208a31(0x14a))[_0x208a31(0x14f)]();}export function generateBehaviorSchemaSQL(_0x252438,_0x20fc42){const _0xc8ee4f=a148_0x4fa652,_0x52724b=_0x252438[_0xc8ee4f(0x133)],_0x557755=_0x20fc42[_0xc8ee4f(0x138)][_0xc8ee4f(0x154)];let _0x267149;if(_0x20fc42[_0xc8ee4f(0x137)])_0x267149=_0xc8ee4f(0x131);else _0x20fc42[_0xc8ee4f(0x15f)]&&_0x20fc42[_0xc8ee4f(0x15f)][_0xc8ee4f(0x14d)]>0x0?_0x267149=_0x20fc42[_0xc8ee4f(0x15f)][_0xc8ee4f(0x135)](_0x23180e=>'b.'+_0x23180e['column'])['join'](',\x20'):_0x267149=_0xc8ee4f(0x131);return(_0xc8ee4f(0x142)+_0x557755+',\x20'+_0x267149+_0xc8ee4f(0x155)+_0x52724b[_0xc8ee4f(0x136)]+'.'+_0x52724b[_0xc8ee4f(0x13c)]+'\x20m\x0aJOIN\x20'+_0x20fc42[_0xc8ee4f(0x147)][_0xc8ee4f(0x136)]+'.'+_0x20fc42[_0xc8ee4f(0x147)][_0xc8ee4f(0x13c)]+_0xc8ee4f(0x157)+_0x20fc42[_0xc8ee4f(0x138)][_0xc8ee4f(0x154)]+'\x20=\x20b.'+_0x20fc42['join']['child_key']+'\x0aLIMIT\x200\x0a')[_0xc8ee4f(0x14f)]();}export function getAttributeColumns(_0x1ca29c){const _0x1c98e4=a148_0x4fa652;return _0x1ca29c[_0x1c98e4(0x15f)][_0x1c98e4(0x135)](_0x5e623e=>({'label':_0x5e623e['label']||_0x5e623e['column'],'column':_0x5e623e[_0x1c98e4(0x134)]}));}export function getBehaviorColumns(_0x56ec88){const _0x15f2b7=a148_0x4fa652;if(_0x56ec88[_0x15f2b7(0x137)])return[{'label':'(all\x20columns)','column':'*'}];if(_0x56ec88['columns']&&_0x56ec88[_0x15f2b7(0x15f)][_0x15f2b7(0x14d)]>0x0)return _0x56ec88[_0x15f2b7(0x15f)][_0x15f2b7(0x135)](_0x14da24=>({'label':_0x14da24[_0x15f2b7(0x130)]||_0x14da24[_0x15f2b7(0x134)],'column':_0x14da24[_0x15f2b7(0x134)]}));return[{'label':'(all\x20columns)','column':'*'}];}export function findAttributeByName(_0xfe0866,_0x424187){const _0x535a90=a148_0x4fa652;return _0xfe0866[_0x535a90(0x152)]?.[_0x535a90(0x141)](_0x1e6630=>_0x1e6630['name'][_0x535a90(0x164)]()===_0x424187['toLowerCase']());}export function findBehaviorByName(_0x337ee4,_0x52c820){const _0x10e1fb=a148_0x4fa652;return _0x337ee4[_0x10e1fb(0x13a)]?.[_0x10e1fb(0x141)](_0x4cfeae=>_0x4cfeae[_0x10e1fb(0x132)][_0x10e1fb(0x164)]()===_0x52c820[_0x10e1fb(0x164)]());}