@treasuredata/tdx 0.25.8 → 0.26.0

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 (167) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/personalization.js +1 -1
  99. package/dist/sdk/query/index.js +1 -1
  100. package/dist/sdk/query/sql-parser.js +1 -1
  101. package/dist/sdk/realtime.js +1 -1
  102. package/dist/sdk/schedule.js +1 -1
  103. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  104. package/dist/sdk/segment/fields-display.js +1 -1
  105. package/dist/sdk/segment/file-discovery.js +1 -1
  106. package/dist/sdk/segment/journey-utils.js +1 -1
  107. package/dist/sdk/segment/journey-validator.js +1 -1
  108. package/dist/sdk/segment/journey-yaml.js +1 -1
  109. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  110. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  111. package/dist/sdk/segment/pull-workflow.js +1 -1
  112. package/dist/sdk/segment/push-recovery.js +1 -1
  113. package/dist/sdk/segment/push-workflow.js +1 -1
  114. package/dist/sdk/segment/resolution-context.js +1 -1
  115. package/dist/sdk/segment/segment-path-parser.js +1 -1
  116. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  117. package/dist/sdk/segment/target-resolution.js +1 -1
  118. package/dist/sdk/segment/tdx-config.js +1 -1
  119. package/dist/sdk/segment/validate-files.js +1 -1
  120. package/dist/sdk/segment/yaml-validator.js +1 -1
  121. package/dist/sdk/segment.js +1 -1
  122. package/dist/sdk/types/index.js +1 -1
  123. package/dist/sdk/types/progress.js +1 -1
  124. package/dist/sdk/user.js +1 -1
  125. package/dist/sdk/util/format-detector.js +1 -1
  126. package/dist/sdk/util/formatters.js +1 -1
  127. package/dist/sdk/util/index.js +1 -1
  128. package/dist/sdk/util/tree-formatter.js +1 -1
  129. package/dist/sdk/workflow/archive-validation.js +1 -1
  130. package/dist/sdk/workflow/clone-workflow.js +1 -1
  131. package/dist/sdk/workflow/index.js +1 -1
  132. package/dist/sdk/workflow/pull-workflow.js +1 -1
  133. package/dist/sdk/workflow/push-workflow.js +1 -1
  134. package/dist/sdk/workflow/tdx-config.js +1 -1
  135. package/dist/sdk/workflow/workflow-utils.js +1 -1
  136. package/dist/test-utils/command-runner.js +1 -1
  137. package/dist/test-utils/factories.js +1 -1
  138. package/dist/test-utils/fixtures.js +1 -1
  139. package/dist/test-utils/http-mock.js +1 -1
  140. package/dist/test-utils/index.js +1 -1
  141. package/dist/utils/async.js +1 -1
  142. package/dist/utils/colors.js +1 -1
  143. package/dist/utils/diff.js +1 -1
  144. package/dist/utils/file-permissions.js +1 -1
  145. package/dist/utils/global-cache.js +1 -1
  146. package/dist/utils/json-loader.js +1 -1
  147. package/dist/utils/local-cache.js +1 -1
  148. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  149. package/dist/utils/logger/formatters/index.js +1 -1
  150. package/dist/utils/logger/handlers/console-handler.js +1 -1
  151. package/dist/utils/logger/handlers/file-handler.js +1 -1
  152. package/dist/utils/logger/handlers/index.js +1 -1
  153. package/dist/utils/logger/handlers/null-handler.js +1 -1
  154. package/dist/utils/logger/index.js +1 -1
  155. package/dist/utils/logger/logger.js +1 -1
  156. package/dist/utils/logger/types.js +1 -1
  157. package/dist/utils/option-validation.js +1 -1
  158. package/dist/utils/port.js +1 -1
  159. package/dist/utils/process.js +1 -1
  160. package/dist/utils/prompt.js +1 -1
  161. package/dist/utils/spinner.js +1 -1
  162. package/dist/utils/sse-parser.js +1 -1
  163. package/dist/utils/string-utils.js +1 -1
  164. package/dist/utils/table-ref-parser.js +1 -1
  165. package/dist/utils/tdx-logger.js +1 -1
  166. package/dist/utils/version-check.js +1 -1
  167. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x42ee1b,_0x3f9604){const _0x5e5e82=a106_0x54f9,_0x3e5f6a=_0x42ee1b();while(!![]){try{const _0x5ed28d=-parseInt(_0x5e5e82(0xb5))/0x1+-parseInt(_0x5e5e82(0xc3))/0x2+-parseInt(_0x5e5e82(0xb2))/0x3*(parseInt(_0x5e5e82(0xb8))/0x4)+parseInt(_0x5e5e82(0xb7))/0x5*(parseInt(_0x5e5e82(0xc4))/0x6)+-parseInt(_0x5e5e82(0xb6))/0x7*(-parseInt(_0x5e5e82(0xb4))/0x8)+-parseInt(_0x5e5e82(0xbc))/0x9+parseInt(_0x5e5e82(0xbb))/0xa*(parseInt(_0x5e5e82(0xc0))/0xb);if(_0x5ed28d===_0x3f9604)break;else _0x3e5f6a['push'](_0x3e5f6a['shift']());}catch(_0x15e673){_0x3e5f6a['push'](_0x3e5f6a['shift']());}}}(a106_0x3578,0x37304));function a106_0x3578(){const _0x54a3fc=['.yml','739460MAeOts','566172FqvRGm','429nEoija','extname','536ngFYxZ','273853JfMhEt','45556JmpXiV','10EEgYKH','1760ygmdSe','relative','.yaml','4407140jgvKIw','1196271pyuwVj','endsWith','dirname','name','11pDgANb','join'];a106_0x3578=function(){return _0x54a3fc;};return a106_0x3578();}function a106_0x54f9(_0x25c459,_0x45f012){_0x25c459=_0x25c459-0xb2;const _0x3578b9=a106_0x3578();let _0x54f9f1=_0x3578b9[_0x25c459];return _0x54f9f1;}import{readdirSync,statSync}from'fs';import a106_0x289a36 from'path';export function findYamlFiles(_0x34dc1c){const _0x19b2fa=[];function _0x4ae1d7(_0x6c7c6e){const _0x334839=a106_0x54f9,_0x31d395=readdirSync(_0x6c7c6e,{'withFileTypes':!![]});for(const _0x4051d3 of _0x31d395){const _0x49a1f6=a106_0x289a36[_0x334839(0xc1)](_0x6c7c6e,_0x4051d3['name']);if(_0x4051d3['isDirectory']())_0x4ae1d7(_0x49a1f6);else(_0x4051d3[_0x334839(0xbf)][_0x334839(0xbd)]('.yml')||_0x4051d3[_0x334839(0xbf)][_0x334839(0xbd)](_0x334839(0xba)))&&_0x19b2fa['push'](_0x49a1f6);}}return _0x4ae1d7(_0x34dc1c),_0x19b2fa;}export function discoverYamlFiles(_0x108147){const _0x119b7c=findYamlFiles(_0x108147);return _0x119b7c['map'](_0x19a405=>{const _0x30d640=a106_0x54f9,_0x259e9e=a106_0x289a36[_0x30d640(0xb9)](_0x108147,_0x19a405),_0x36e9f1=a106_0x289a36[_0x30d640(0xbe)](_0x259e9e);return{'absolutePath':_0x19a405,'relativePath':_0x259e9e,'folderPath':_0x36e9f1==='.'?'':_0x36e9f1};});}export function isYamlFile(_0x2d9a78){const _0x5aface=a106_0x54f9;try{const _0x3e087c=statSync(_0x2d9a78);if(!_0x3e087c['isFile']())return![];const _0x166370=a106_0x289a36[_0x5aface(0xb3)](_0x2d9a78)['toLowerCase']();return _0x166370===_0x5aface(0xc2)||_0x166370===_0x5aface(0xba);}catch{return![];}}
1
+ (function(_0x15db4d,_0x50e473){const _0x51d6ec=a106_0x3b81,_0x5b63b5=_0x15db4d();while(!![]){try{const _0x2f4006=parseInt(_0x51d6ec(0x156))/0x1*(-parseInt(_0x51d6ec(0x15a))/0x2)+parseInt(_0x51d6ec(0x167))/0x3+parseInt(_0x51d6ec(0x155))/0x4+parseInt(_0x51d6ec(0x165))/0x5+-parseInt(_0x51d6ec(0x162))/0x6+-parseInt(_0x51d6ec(0x158))/0x7+parseInt(_0x51d6ec(0x166))/0x8;if(_0x2f4006===_0x50e473)break;else _0x5b63b5['push'](_0x5b63b5['shift']());}catch(_0x483a34){_0x5b63b5['push'](_0x5b63b5['shift']());}}}(a106_0x62fb,0x88f3d));import{readdirSync,statSync}from'fs';import a106_0xf12187 from'path';function a106_0x3b81(_0x32ff6d,_0x421e5c){_0x32ff6d=_0x32ff6d-0x155;const _0x62fbb7=a106_0x62fb();let _0x3b81df=_0x62fbb7[_0x32ff6d];return _0x3b81df;}export function findYamlFiles(_0x1047a7){const _0x4814ee=[];function _0x43b8a1(_0x2c7b3c){const _0xdd33ba=a106_0x3b81,_0x1e6b9b=readdirSync(_0x2c7b3c,{'withFileTypes':!![]});for(const _0x5459c4 of _0x1e6b9b){const _0x439ee5=a106_0xf12187[_0xdd33ba(0x15f)](_0x2c7b3c,_0x5459c4[_0xdd33ba(0x161)]);if(_0x5459c4[_0xdd33ba(0x163)]())_0x43b8a1(_0x439ee5);else(_0x5459c4['name'][_0xdd33ba(0x164)](_0xdd33ba(0x159))||_0x5459c4[_0xdd33ba(0x161)]['endsWith'](_0xdd33ba(0x15c)))&&_0x4814ee['push'](_0x439ee5);}}return _0x43b8a1(_0x1047a7),_0x4814ee;}function a106_0x62fb(){const _0x470ec9=['1973545toPDtk','634168kTnkTG','2860044ZiJDHZ','4046476jrNJNd','185vhQCkg','toLowerCase','4223800ZuCAEG','.yml','5530YwlIBO','isFile','.yaml','relative','extname','join','map','name','4578390VwaRfy','isDirectory','endsWith'];a106_0x62fb=function(){return _0x470ec9;};return a106_0x62fb();}export function discoverYamlFiles(_0x4cfa3e){const _0x556386=a106_0x3b81,_0xf47627=findYamlFiles(_0x4cfa3e);return _0xf47627[_0x556386(0x160)](_0x36dcba=>{const _0x1d58b7=_0x556386,_0x125e73=a106_0xf12187[_0x1d58b7(0x15d)](_0x4cfa3e,_0x36dcba),_0x160eba=a106_0xf12187['dirname'](_0x125e73);return{'absolutePath':_0x36dcba,'relativePath':_0x125e73,'folderPath':_0x160eba==='.'?'':_0x160eba};});}export function isYamlFile(_0x5a0e05){const _0x19ea90=a106_0x3b81;try{const _0x1aa345=statSync(_0x5a0e05);if(!_0x1aa345[_0x19ea90(0x15b)]())return![];const _0x132aab=a106_0xf12187[_0x19ea90(0x15e)](_0x5a0e05)[_0x19ea90(0x157)]();return _0x132aab===_0x19ea90(0x159)||_0x132aab===_0x19ea90(0x15c);}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0xa40a80,_0x450b12){const _0x2159ed=a107_0x2f6f,_0x8f7ea9=_0xa40a80();while(!![]){try{const _0x2fd36b=parseInt(_0x2159ed(0x14c))/0x1*(parseInt(_0x2159ed(0x13e))/0x2)+-parseInt(_0x2159ed(0x10f))/0x3+-parseInt(_0x2159ed(0x138))/0x4*(-parseInt(_0x2159ed(0x120))/0x5)+parseInt(_0x2159ed(0x13b))/0x6*(-parseInt(_0x2159ed(0x14a))/0x7)+-parseInt(_0x2159ed(0x153))/0x8*(parseInt(_0x2159ed(0x11d))/0x9)+parseInt(_0x2159ed(0x13f))/0xa*(-parseInt(_0x2159ed(0xff))/0xb)+-parseInt(_0x2159ed(0x12f))/0xc*(-parseInt(_0x2159ed(0x109))/0xd);if(_0x2fd36b===_0x450b12)break;else _0x8f7ea9['push'](_0x8f7ea9['shift']());}catch(_0x50c321){_0x8f7ea9['push'](_0x8f7ea9['shift']());}}}(a107_0xf751,0x58285));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x1202f4){const _0x154834=a107_0x2f6f;return _0x1202f4[_0x154834(0x13c)]()[_0x154834(0x114)](/\s+/g,'_')[_0x154834(0x114)](/[^a-z0-9_]/g,'')[_0x154834(0x114)](/_+/g,'_')[_0x154834(0x114)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x3531eb){const _0x166c59=a107_0x2f6f,_0x31423f=_0x3531eb[_0x166c59(0x13a)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x31423f){const _0x492efd=_0x31423f[0x1][_0x166c59(0x13c)](),_0x1a48bb=_0x31423f[0x2],_0xfff8ed=_0x1a48bb[_0x166c59(0x114)](/-/g,'')[_0x166c59(0x104)](0x0,0x4)[_0x166c59(0x13c)]();return _0x492efd+'_'+_0xfff8ed;}const _0x3f2f5f=_0x3531eb[_0x166c59(0x13a)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x3f2f5f){const _0x5adf7a=_0x3f2f5f[0x1],_0x58fdac=_0x3f2f5f[0x2][_0x166c59(0x13c)](),_0x5d2367=_0x5adf7a[_0x166c59(0x114)](/-/g,'')[_0x166c59(0x104)](0x0,0x4)[_0x166c59(0x13c)]();return _0x58fdac+'_'+_0x5d2367;}return undefined;}function stableStringify(_0x3aaffd){const _0x557880=a107_0x2f6f;if(Array['isArray'](_0x3aaffd))return'['+_0x3aaffd[_0x557880(0x111)](_0x93d240=>stableStringify(_0x93d240))[_0x557880(0x11a)](',')+']';if(_0x3aaffd&&typeof _0x3aaffd===_0x557880(0x151)){const _0x47ae5a=_0x3aaffd,_0x5a39e9=Object[_0x557880(0x113)](_0x47ae5a)[_0x557880(0x117)](),_0x5f0a5e=_0x5a39e9[_0x557880(0x111)](_0xaa858=>'\x22'+_0xaa858+'\x22:'+stableStringify(_0x47ae5a[_0xaa858]));return'{'+_0x5f0a5e[_0x557880(0x11a)](',')+'}';}const _0x212cb7=JSON[_0x557880(0x139)](_0x3aaffd);return _0x212cb7===undefined?_0x557880(0x101):_0x212cb7;}export function consolidateActivationsByContent(_0x2decae){const _0x23d164=a107_0x2f6f,_0x18bc41={},_0x170344=new Map(),_0x154205=new Map();for(const _0x4dc6c1 of _0x2decae){if(!_0x4dc6c1)continue;for(const [_0x291cd0,_0x152d85]of Object['entries'](_0x4dc6c1)){const _0x38154c={'connection':_0x152d85[_0x23d164(0x142)],..._0x152d85['all_columns']!==undefined&&{'all_columns':_0x152d85[_0x23d164(0x12a)]},..._0x152d85[_0x23d164(0x100)]!==undefined&&{'columns':_0x152d85[_0x23d164(0x100)]},..._0x152d85['behavior']!==undefined&&{'behavior':_0x152d85['behavior']},..._0x152d85[_0x23d164(0x10a)]!==undefined&&{'schedule':_0x152d85[_0x23d164(0x10a)]},..._0x152d85['notification']!==undefined&&{'notification':_0x152d85[_0x23d164(0x10d)]},..._0x152d85[_0x23d164(0x149)]!==undefined&&{'connector_config':_0x152d85[_0x23d164(0x149)]},..._0x152d85['activation_template_id']!==undefined&&{'activation_template_id':_0x152d85[_0x23d164(0x107)]}},_0x40d3a8=stableStringify(_0x38154c),_0x47764f=_0x154205[_0x23d164(0x118)](_0x40d3a8);_0x47764f?_0x170344[_0x23d164(0x140)](_0x291cd0,_0x47764f):(_0x18bc41[_0x291cd0]=_0x152d85,_0x170344[_0x23d164(0x140)](_0x291cd0,_0x291cd0),_0x154205[_0x23d164(0x140)](_0x40d3a8,_0x291cd0));}}return{'merged':_0x18bc41,'nameMapping':_0x170344};}export function updateActivationReferences(_0x521794,_0x2a3426){const _0x51e60a=a107_0x2f6f;if(!_0x521794)return;for(const _0x58f013 of _0x521794){if(!_0x58f013[_0x51e60a(0x122)])continue;for(const _0x4fae24 of _0x58f013['steps']){if(_0x4fae24[_0x51e60a(0x148)]===_0x51e60a(0x119)&&_0x4fae24[_0x51e60a(0x10b)]?.[_0x51e60a(0x119)]){const _0x4bb4b2=_0x2a3426[_0x51e60a(0x118)](_0x4fae24[_0x51e60a(0x10b)][_0x51e60a(0x119)]);_0x4bb4b2&&_0x4bb4b2!==_0x4fae24[_0x51e60a(0x10b)][_0x51e60a(0x119)]&&(_0x4fae24[_0x51e60a(0x10b)][_0x51e60a(0x119)]=_0x4bb4b2);}}}}export function consolidateSegmentsByContent(_0x47417f,_0xfafd0d){const _0x5c15aa=a107_0x2f6f,_0x59d26b={},_0x22a6c3=new Map(),_0x20d890=new Map();for(const _0x169a27 of _0x47417f){if(!_0x169a27)continue;for(const [_0x4fec96,_0x5ac22c]of Object[_0x5c15aa(0x133)](_0x169a27)){if(!_0x5ac22c['rule']){_0x59d26b[_0x4fec96]=_0x5ac22c,_0x22a6c3['set'](_0x4fec96,_0x4fec96);continue;}const _0x1912ba=_0x5ac22c[_0x5c15aa(0x127)]&&_0x5ac22c[_0x5c15aa(0x127)][_0x5c15aa(0x10c)]()?_0x5ac22c['description']:undefined,_0x5a95d3=JSON['stringify']({'description':_0x1912ba,'rule':deepSortObject(_0x5ac22c[_0x5c15aa(0x13d)])}),_0x495607=_0x20d890[_0x5c15aa(0x118)](_0x5a95d3);if(_0x495607){const _0x4765d2={..._0x5ac22c[_0x5c15aa(0x127)]!==undefined&&{'description':_0x5ac22c[_0x5c15aa(0x127)]},'rule':_0x5ac22c[_0x5c15aa(0x13d)]?deepSortObject(_0x5ac22c['rule']):_0x5ac22c[_0x5c15aa(0x13d)]};if(_0x4fec96<_0x495607){_0x59d26b[_0x4fec96]=_0x4765d2,delete _0x59d26b[_0x495607];for(const [_0x31533c,_0x2afb7f]of _0x22a6c3['entries']()){_0x2afb7f===_0x495607&&_0x22a6c3[_0x5c15aa(0x140)](_0x31533c,_0x4fec96);}_0x22a6c3[_0x5c15aa(0x140)](_0x4fec96,_0x4fec96),_0x20d890[_0x5c15aa(0x140)](_0x5a95d3,_0x4fec96);}else _0x59d26b[_0x495607]=_0x4765d2,_0x22a6c3['set'](_0x4fec96,_0x495607);}else{let _0x597eff=_0x4fec96;if(_0xfafd0d){const _0xd0059=_0xfafd0d[_0x5c15aa(0x118)](_0x5a95d3);_0xd0059&&_0xd0059[_0x5c15aa(0x14b)]>0x0&&(_0x597eff=_0xd0059[_0x5c15aa(0x104)]()['sort']()[0x0]);}const _0x324a9a={..._0x5ac22c[_0x5c15aa(0x127)]!==undefined&&{'description':_0x5ac22c['description']},'rule':_0x5ac22c['rule']?deepSortObject(_0x5ac22c[_0x5c15aa(0x13d)]):_0x5ac22c['rule']};_0x59d26b[_0x597eff]=_0x324a9a,_0x22a6c3[_0x5c15aa(0x140)](_0x4fec96,_0x597eff),_0x20d890[_0x5c15aa(0x140)](_0x5a95d3,_0x597eff);}}}return{'merged':_0x59d26b,'nameMapping':_0x22a6c3};}export function updateSegmentReferences(_0x471eb6,_0x3c44b8){const _0x31d125=a107_0x2f6f;if(!_0x471eb6)return;for(const _0x158a17 of _0x471eb6){if(_0x158a17[_0x31d125(0x152)]?.[_0x31d125(0xfd)]){const _0x567e70=_0x3c44b8[_0x31d125(0x118)](_0x158a17[_0x31d125(0x152)][_0x31d125(0xfd)]);_0x567e70&&(_0x158a17[_0x31d125(0x152)][_0x31d125(0xfd)]=_0x567e70);}if(_0x158a17['steps'])for(const _0xf63524 of _0x158a17[_0x31d125(0x122)]){if(_0xf63524[_0x31d125(0x148)]==='decision_point'&&_0xf63524[_0x31d125(0x10b)]?.['branches'])for(const _0x40d10a of _0xf63524[_0x31d125(0x10b)][_0x31d125(0x12c)]){if(_0x40d10a[_0x31d125(0xfd)]){const _0x3132df=_0x3c44b8[_0x31d125(0x118)](_0x40d10a['segment']);_0x3132df&&(_0x40d10a[_0x31d125(0xfd)]=_0x3132df);}}}}}export function updateSegmentRefsInSegments(_0xecc731,_0x5e88c9){const _0x52eb6d=a107_0x2f6f;for(const _0x10e79e of Object['values'](_0xecc731)){_0x10e79e[_0x52eb6d(0x13d)]&&updateSegmentRefsInRule(_0x10e79e[_0x52eb6d(0x13d)],_0x5e88c9);}}function updateSegmentRefsInRule(_0x159183,_0x56df54){const _0x436c7d=a107_0x2f6f;if(_0x159183===null||typeof _0x159183!=='object')return;if(Array[_0x436c7d(0x121)](_0x159183)){for(const _0x1c5e5b of _0x159183){updateSegmentRefsInRule(_0x1c5e5b,_0x56df54);}return;}const _0x50402f=_0x159183;if((_0x50402f[_0x436c7d(0x148)]==='include'||_0x50402f[_0x436c7d(0x148)]===_0x436c7d(0x105))&&typeof _0x50402f['segment']===_0x436c7d(0x132)){const _0xd2d10=_0x56df54[_0x436c7d(0x118)](_0x50402f[_0x436c7d(0xfd)]);_0xd2d10&&(_0x50402f[_0x436c7d(0xfd)]=_0xd2d10);}if(_0x50402f[_0x436c7d(0x12b)]&&Array[_0x436c7d(0x121)](_0x50402f[_0x436c7d(0x12b)]))for(const _0x5e437d of _0x50402f[_0x436c7d(0x12b)]){updateSegmentRefsInRule(_0x5e437d,_0x56df54);}}export function buildJourneysArray(_0x4d202f){const _0x3b1600=a107_0x2f6f,_0x335eda=Math[_0x3b1600(0x12e)](..._0x4d202f['map'](_0x21cd69=>_0x21cd69[_0x3b1600(0x126)][_0x3b1600(0x145)]||0x0));return _0x4d202f[_0x3b1600(0x111)](_0x3b69d8=>{const _0x4e828f=_0x3b1600,_0x3f66d1=(_0x3b69d8[_0x4e828f(0x126)][_0x4e828f(0x145)]||0x0)===_0x335eda,_0x5c3e9d=_0x3b69d8[_0x4e828f(0x136)][_0x4e828f(0x12d)]?.[0x0],_0x454714={'version':_0x5c3e9d?.[_0x4e828f(0x108)]||_0x3b69d8[_0x4e828f(0x136)]['version']||_0x3b69d8[_0x4e828f(0x126)][_0x4e828f(0xfc)],'state':_0x3b69d8[_0x4e828f(0x126)][_0x4e828f(0x14e)]===_0x4e828f(0x124)?_0x4e828f(0x124):_0x4e828f(0x141),'stages':_0x5c3e9d?.['stages']||_0x3b69d8[_0x4e828f(0x136)][_0x4e828f(0x11b)]||[],'id':_0x5c3e9d?.['id']||_0x3b69d8['yaml']['id'],'version_number':_0x5c3e9d?.[_0x4e828f(0x146)]||_0x3b69d8[_0x4e828f(0x136)]['version_number']};return _0x3f66d1&&(_0x454714[_0x4e828f(0x110)]=!![]),_0x454714;});}export function buildMergedJourneyDef(_0xdcc413,_0x230a4e){const _0x2bf2e5=a107_0x2f6f,_0x1b85cb=_0xdcc413[0x0]['yaml'],_0x50591b=buildJourneysArray(_0xdcc413),{merged:_0x214602,nameMapping:_0x1a5c70}=consolidateSegmentsByContent(_0xdcc413[_0x2bf2e5(0x111)](_0x5b89b4=>_0x5b89b4['yaml'][_0x2bf2e5(0x11c)]),_0x230a4e);updateSegmentRefsInSegments(_0x214602,_0x1a5c70);const _0xd7969d=Array[_0x2bf2e5(0x106)](_0x1a5c70[_0x2bf2e5(0x133)]())[_0x2bf2e5(0x134)](([_0x18359,_0x229e86])=>_0x18359!==_0x229e86&&_0x18359[_0x2bf2e5(0x10e)](_0x2bf2e5(0x152)));let _0x220077=_0x214602,_0x2563a4=new Map();if(_0xd7969d){const _0x26255c=consolidateSegmentsByContent([_0x214602],_0x230a4e);_0x220077=_0x26255c[_0x2bf2e5(0x144)],_0x2563a4=_0x26255c[_0x2bf2e5(0x125)];}const _0x573607=new Map(_0x1a5c70);for(const [_0x357a46,_0x3b6596]of _0x2563a4['entries']()){_0x573607['set'](_0x357a46,_0x3b6596);}for(const [_0x31203d,_0x38947e]of _0x573607[_0x2bf2e5(0x133)]()){let _0x303a58=_0x38947e,_0x9be13a=0x0;while(_0x573607[_0x2bf2e5(0x103)](_0x303a58)&&_0x573607[_0x2bf2e5(0x118)](_0x303a58)!==_0x303a58&&_0x9be13a<MAX_MAPPING_CHAIN_DEPTH){_0x303a58=_0x573607[_0x2bf2e5(0x118)](_0x303a58),_0x9be13a++;}_0x303a58!==_0x38947e&&_0x573607[_0x2bf2e5(0x140)](_0x31203d,_0x303a58);}for(const _0x942c9f of _0x50591b){updateSegmentReferences(_0x942c9f['stages'],_0x573607);}const {merged:_0x337154,nameMapping:_0x450421}=consolidateActivationsByContent(_0xdcc413[_0x2bf2e5(0x111)](_0x5dcc63=>_0x5dcc63[_0x2bf2e5(0x136)]['activations']));for(const _0x746f4f of _0x50591b){updateActivationReferences(_0x746f4f[_0x2bf2e5(0x11b)],_0x450421);}let _0x42bb36=_0x1b85cb[_0x2bf2e5(0x147)];if(_0x42bb36?.[_0x2bf2e5(0xfd)]){const _0x521a18=_0x573607[_0x2bf2e5(0x118)](_0x42bb36[_0x2bf2e5(0xfd)]);_0x521a18&&(_0x42bb36={..._0x42bb36,'segment':_0x521a18});}for(const _0x497e9f of _0x50591b){if(_0x497e9f[_0x2bf2e5(0x147)]?.[_0x2bf2e5(0xfd)]){const _0x2a8d3c=_0x573607[_0x2bf2e5(0x118)](_0x497e9f['goal'][_0x2bf2e5(0xfd)]);_0x2a8d3c&&(_0x497e9f[_0x2bf2e5(0x147)]={..._0x497e9f[_0x2bf2e5(0x147)],'segment':_0x2a8d3c});}}return{'type':_0x2bf2e5(0x143),'name':_0x1b85cb[_0x2bf2e5(0xfc)],'description':_0x1b85cb[_0x2bf2e5(0x127)],'goal':_0x42bb36,'reentry':_0x1b85cb[_0x2bf2e5(0x128)],'segments':Object[_0x2bf2e5(0x113)](_0x220077)[_0x2bf2e5(0x14b)]>0x0?_0x220077:undefined,'activations':Object[_0x2bf2e5(0x113)](_0x337154)[_0x2bf2e5(0x14b)]>0x0?_0x337154:undefined,'journeys':_0x50591b,'bundle_id':_0x1b85cb[_0x2bf2e5(0x116)],'bundle_name':_0x1b85cb[_0x2bf2e5(0x135)]};}function a107_0x2f6f(_0x5ee190,_0xdd2caa){_0x5ee190=_0x5ee190-0xfc;const _0xf7517=a107_0xf751();let _0x2f6f60=_0xf7517[_0x5ee190];return _0x2f6f60;}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x5d29ff,_0x2df80a,_0x28e0c2,_0x13e4e0){const _0xf6ec86=a107_0x2f6f,_0x4ecc83=_0x5d29ff+':'+_0x2df80a,_0x20e7c0=_0x28e0c2[_0xf6ec86(0x118)](_0x4ecc83);if(_0x20e7c0)return _0x20e7c0;const _0x3ae668=await _0x13e4e0(_0x5d29ff),_0x1f0bb9=_0x3ae668['attributes'][_0xf6ec86(0x130)]||_0x3ae668[_0xf6ec86(0x115)]['name'],_0x1e079d=_0x3ae668[_0xf6ec86(0x115)][_0xf6ec86(0x137)][_0xf6ec86(0x123)](_0x1e3d34=>String(_0x1e3d34['id'])===String(_0x2df80a)),_0x3f2268=_0x1e079d?.[_0xf6ec86(0xfc)]||_0x2df80a,_0x57364f={'journeyName':_0x1f0bb9,'stageName':_0x3f2268};return _0x28e0c2['set'](_0x4ecc83,_0x57364f),_0x57364f;}export function formatApiJourneyName(_0x48f21d,_0x306ded){return _0x306ded+'\x20('+_0x48f21d+')';}export function isLocalJourneyRef(_0x2dd6e9){const _0x23fe99=a107_0x2f6f;return _0x2dd6e9[_0x23fe99(0x112)]('.yml')||_0x2dd6e9[_0x23fe99(0x112)](_0x23fe99(0x14f));}function a107_0xf751(){const _0x582fb6=['.yaml','versions','object','entry_criteria','584DrehLJ','name','segment','index','451AEJIkg','columns','null','decision_point','has','slice','exclude','from','activation_template_id','version','7900724cnMnyk','schedule','with','trim','notification','startsWith','1588263OlncsH','latest','map','endsWith','keys','replace','attributes','bundle_id','sort','get','activation','join','stages','segments','909AWubhG','condition','wait','50550DwvDyW','isArray','steps','find','launched','nameMapping','item','description','reentry','milestone','all_columns','conditions','branches','journeys','max','12mKTlze','journeyBundleName','push','string','entries','some','bundle_name','yaml','journeyStages','92TXUFhc','stringify','match','6nYSFoQ','toLowerCase','rule','668lWYfbr','13350HOkhEi','set','draft','connection','journey','merged','versionNumber','version_number','goal','type','connector_config','2554594CjhPiy','length','1429xTCVys','exit_criteria','state'];a107_0xf751=function(){return _0x582fb6;};return a107_0xf751();}export function buildLocalRuleToNameMapping(_0x4c3ec1){const _0x59aaf6=a107_0x2f6f,_0x4f07cd=new Map();if(!_0x4c3ec1)return _0x4f07cd;for(const [_0x331772,_0x150c11]of Object[_0x59aaf6(0x133)](_0x4c3ec1)){if(_0x150c11[_0x59aaf6(0x13d)]){const _0x5c76ec=serializeRule(_0x150c11['rule']),_0x9d8c59=_0x4f07cd['get'](_0x5c76ec)||[];_0x9d8c59[_0x59aaf6(0x131)](_0x331772),_0x4f07cd['set'](_0x5c76ec,_0x9d8c59);}}return _0x4f07cd;}export function buildLocalRuleToNameMappingFromJourney(_0x36ed64){const _0x466755=a107_0x2f6f,_0x102bee=_0x36ed64[_0x466755(0x11c)];if(!_0x102bee)return new Map();const _0x2d1c2b=collectSegmentUsageCounts(_0x36ed64),_0x30836c=new Map();let _0x3ab01d=0x0;for(const [_0x3d0398,_0x26dc7f]of Object['entries'](_0x102bee)){if(!_0x26dc7f[_0x466755(0x13d)]){_0x3ab01d++;continue;}const _0x3165c1=serializeRule(_0x26dc7f[_0x466755(0x13d)]),_0x2a74f0=_0x30836c['get'](_0x3165c1)||[];_0x2a74f0[_0x466755(0x131)]({'name':_0x3d0398,'index':_0x3ab01d}),_0x30836c[_0x466755(0x140)](_0x3165c1,_0x2a74f0),_0x3ab01d++;}const _0x505cf2=new Map();for(const [_0x4ce927,_0x1130bc]of _0x30836c){const _0x51285a=_0x1130bc[_0x466755(0x104)]()[_0x466755(0x117)]((_0x2b96d7,_0x518da0)=>{const _0x3b1f58=_0x466755,_0xc65f6e=_0x2d1c2b['get'](_0x2b96d7[_0x3b1f58(0xfc)])||0x0,_0x39998b=_0x2d1c2b[_0x3b1f58(0x118)](_0x518da0[_0x3b1f58(0xfc)])||0x0;if(_0xc65f6e!==_0x39998b)return _0x39998b-_0xc65f6e;return _0x2b96d7[_0x3b1f58(0xfe)]-_0x518da0[_0x3b1f58(0xfe)];})[_0x466755(0x111)](_0x11f763=>_0x11f763[_0x466755(0xfc)]);_0x505cf2['set'](_0x4ce927,_0x51285a);}return _0x505cf2;}export function collectSegmentUsageCounts(_0x279880){const _0x28f33a=a107_0x2f6f,_0x3638a8=new Map(),_0x95b7e=_0x4db19b=>{const _0x24ab7c=a107_0x2f6f;if(!_0x4db19b)return;_0x3638a8[_0x24ab7c(0x140)](_0x4db19b,(_0x3638a8[_0x24ab7c(0x118)](_0x4db19b)||0x0)+0x1);},_0x59d587=_0x1d3d98=>{const _0x51fcf2=a107_0x2f6f;for(const _0x52e1a8 of _0x1d3d98){_0x95b7e(_0x52e1a8[_0x51fcf2(0x152)]?.[_0x51fcf2(0xfd)]);if(_0x52e1a8[_0x51fcf2(0x14d)])for(const _0x5f5a07 of _0x52e1a8['exit_criteria']){_0x95b7e(_0x5f5a07[_0x51fcf2(0xfd)]);}_0x95b7e(_0x52e1a8[_0x51fcf2(0x129)]?.[_0x51fcf2(0xfd)]);if(_0x52e1a8[_0x51fcf2(0x122)])for(const _0x144637 of _0x52e1a8[_0x51fcf2(0x122)]){if(_0x144637[_0x51fcf2(0x148)]===_0x51fcf2(0x102))for(const _0x440325 of _0x144637[_0x51fcf2(0x10b)][_0x51fcf2(0x12c)]){_0x95b7e(_0x440325[_0x51fcf2(0xfd)]);}else _0x144637[_0x51fcf2(0x148)]===_0x51fcf2(0x11f)&&_0x95b7e(_0x144637[_0x51fcf2(0x10b)][_0x51fcf2(0x11e)]?.[_0x51fcf2(0xfd)]);}}};_0x95b7e(_0x279880[_0x28f33a(0x147)]?.[_0x28f33a(0xfd)]);if(_0x279880['journeys'])for(const _0x3e4225 of _0x279880[_0x28f33a(0x12d)]){_0x95b7e(_0x3e4225[_0x28f33a(0x147)]?.[_0x28f33a(0xfd)]),_0x59d587(_0x3e4225[_0x28f33a(0x11b)]);}_0x279880[_0x28f33a(0x11b)]&&_0x59d587(_0x279880[_0x28f33a(0x11b)]);if(_0x279880[_0x28f33a(0x150)])for(const _0x5c8b8e of _0x279880[_0x28f33a(0x150)]){_0x59d587(_0x5c8b8e[_0x28f33a(0x11b)]);}return _0x3638a8;}
1
+ (function(_0x3bf40f,_0x3e6431){const _0x34c1a7=a107_0x35d0,_0x29b0ef=_0x3bf40f();while(!![]){try{const _0x1a8fe5=parseInt(_0x34c1a7(0x110))/0x1+-parseInt(_0x34c1a7(0x15d))/0x2+-parseInt(_0x34c1a7(0x13d))/0x3+parseInt(_0x34c1a7(0x150))/0x4*(-parseInt(_0x34c1a7(0x15f))/0x5)+-parseInt(_0x34c1a7(0x11b))/0x6+parseInt(_0x34c1a7(0x127))/0x7*(-parseInt(_0x34c1a7(0x14f))/0x8)+-parseInt(_0x34c1a7(0x14c))/0x9*(-parseInt(_0x34c1a7(0x124))/0xa);if(_0x1a8fe5===_0x3e6431)break;else _0x29b0ef['push'](_0x29b0ef['shift']());}catch(_0x5e2a9d){_0x29b0ef['push'](_0x29b0ef['shift']());}}}(a107_0x2be8,0x66984));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;function a107_0x35d0(_0x4de99f,_0x625ebc){_0x4de99f=_0x4de99f-0x10f;const _0x2be843=a107_0x2be8();let _0x35d071=_0x2be843[_0x4de99f];return _0x35d071;}export function sanitizeYamlKey(_0x38d2ba){const _0x4fe6f2=a107_0x35d0;return _0x38d2ba[_0x4fe6f2(0x14e)]()[_0x4fe6f2(0x14d)](/\s+/g,'_')[_0x4fe6f2(0x14d)](/[^a-z0-9_]/g,'')[_0x4fe6f2(0x14d)](/_+/g,'_')[_0x4fe6f2(0x14d)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x59eab6){const _0x48a0e2=a107_0x35d0,_0x6b7e49=_0x59eab6[_0x48a0e2(0x164)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x6b7e49){const _0x5a4e3d=_0x6b7e49[0x1]['toLowerCase'](),_0x3f5e2e=_0x6b7e49[0x2],_0x3a6bba=_0x3f5e2e[_0x48a0e2(0x14d)](/-/g,'')[_0x48a0e2(0x144)](0x0,0x4)[_0x48a0e2(0x14e)]();return _0x5a4e3d+'_'+_0x3a6bba;}const _0x1db479=_0x59eab6[_0x48a0e2(0x164)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x1db479){const _0x496ac0=_0x1db479[0x1],_0x3e329c=_0x1db479[0x2][_0x48a0e2(0x14e)](),_0xdc44b7=_0x496ac0[_0x48a0e2(0x14d)](/-/g,'')[_0x48a0e2(0x144)](0x0,0x4)[_0x48a0e2(0x14e)]();return _0x3e329c+'_'+_0xdc44b7;}return undefined;}function stableStringify(_0xdb5109){const _0x31a816=a107_0x35d0;if(Array['isArray'](_0xdb5109))return'['+_0xdb5109[_0x31a816(0x143)](_0x221944=>stableStringify(_0x221944))[_0x31a816(0x15a)](',')+']';if(_0xdb5109&&typeof _0xdb5109===_0x31a816(0x155)){const _0x3a0a44=_0xdb5109,_0x4b0a45=Object[_0x31a816(0x158)](_0x3a0a44)[_0x31a816(0x12f)](),_0x4a4856=_0x4b0a45[_0x31a816(0x143)](_0x15a53f=>'\x22'+_0x15a53f+'\x22:'+stableStringify(_0x3a0a44[_0x15a53f]));return'{'+_0x4a4856[_0x31a816(0x15a)](',')+'}';}const _0x203176=JSON[_0x31a816(0x125)](_0xdb5109);return _0x203176===undefined?_0x31a816(0x163):_0x203176;}export function consolidateActivationsByContent(_0x101172){const _0x2d94e6=a107_0x35d0,_0x21d608={},_0x14325d=new Map(),_0x563c4b=new Map();for(const _0xf8ca91 of _0x101172){if(!_0xf8ca91)continue;for(const [_0x248c26,_0xcdfbea]of Object[_0x2d94e6(0x15b)](_0xf8ca91)){const _0x250371={'connection':_0xcdfbea[_0x2d94e6(0x162)],..._0xcdfbea['all_columns']!==undefined&&{'all_columns':_0xcdfbea['all_columns']},..._0xcdfbea['columns']!==undefined&&{'columns':_0xcdfbea['columns']},..._0xcdfbea[_0x2d94e6(0x111)]!==undefined&&{'behavior':_0xcdfbea[_0x2d94e6(0x111)]},..._0xcdfbea[_0x2d94e6(0x136)]!==undefined&&{'schedule':_0xcdfbea[_0x2d94e6(0x136)]},..._0xcdfbea[_0x2d94e6(0x11c)]!==undefined&&{'notification':_0xcdfbea[_0x2d94e6(0x11c)]},..._0xcdfbea[_0x2d94e6(0x12d)]!==undefined&&{'connector_config':_0xcdfbea['connector_config']},..._0xcdfbea['activation_template_id']!==undefined&&{'activation_template_id':_0xcdfbea[_0x2d94e6(0x161)]}},_0x18ea38=stableStringify(_0x250371),_0x56dd39=_0x563c4b[_0x2d94e6(0x132)](_0x18ea38);_0x56dd39?_0x14325d['set'](_0x248c26,_0x56dd39):(_0x21d608[_0x248c26]=_0xcdfbea,_0x14325d[_0x2d94e6(0x119)](_0x248c26,_0x248c26),_0x563c4b['set'](_0x18ea38,_0x248c26));}}return{'merged':_0x21d608,'nameMapping':_0x14325d};}function a107_0x2be8(){const _0x1b1bad=['15672LPgwpc','version','description','nameMapping','values','object','reentry','conditions','keys','has','join','entries','wait','158844chXYyr','state','860kMUwzW','type','activation_template_id','connection','null','match','.yaml','689897HWRush','behavior','merged','journey','journeyBundleName','segments','find','draft','max','set','with','948336JDjxQs','notification','rule','versions','length','string','item','milestone','branches','16412190hVfVbA','stringify','push','5168653rrIrSy','some','from','entry_criteria','activations','decision_point','connector_config','journeyStages','sort','version_number','exit_criteria','get','activation','bundle_id','isArray','schedule','index','include','endsWith','journeys','condition','steps','783405bVrpZL','versionNumber','startsWith','trim','goal','launched','map','slice','attributes','segment','latest','yaml','.yml','name','stages','9SLajnz','replace','toLowerCase','8eBUEuF'];a107_0x2be8=function(){return _0x1b1bad;};return a107_0x2be8();}export function updateActivationReferences(_0x26b885,_0x99b69b){const _0x49d414=a107_0x35d0;if(!_0x26b885)return;for(const _0xcfa79c of _0x26b885){if(!_0xcfa79c['steps'])continue;for(const _0x160b69 of _0xcfa79c[_0x49d414(0x13c)]){if(_0x160b69[_0x49d414(0x160)]===_0x49d414(0x133)&&_0x160b69[_0x49d414(0x11a)]?.[_0x49d414(0x133)]){const _0x4de0a0=_0x99b69b[_0x49d414(0x132)](_0x160b69['with'][_0x49d414(0x133)]);_0x4de0a0&&_0x4de0a0!==_0x160b69[_0x49d414(0x11a)]['activation']&&(_0x160b69['with'][_0x49d414(0x133)]=_0x4de0a0);}}}}export function consolidateSegmentsByContent(_0x5c8a0f,_0x491e6a){const _0x2f1401=a107_0x35d0,_0x421b74={},_0x4fca78=new Map(),_0x4f8bc3=new Map();for(const _0x1543d5 of _0x5c8a0f){if(!_0x1543d5)continue;for(const [_0x46a02a,_0x83bfa2]of Object[_0x2f1401(0x15b)](_0x1543d5)){if(!_0x83bfa2[_0x2f1401(0x11d)]){_0x421b74[_0x46a02a]=_0x83bfa2,_0x4fca78[_0x2f1401(0x119)](_0x46a02a,_0x46a02a);continue;}const _0x2a512e=_0x83bfa2[_0x2f1401(0x152)]&&_0x83bfa2[_0x2f1401(0x152)][_0x2f1401(0x140)]()?_0x83bfa2[_0x2f1401(0x152)]:undefined,_0x2bd1af=JSON[_0x2f1401(0x125)]({'description':_0x2a512e,'rule':deepSortObject(_0x83bfa2[_0x2f1401(0x11d)])}),_0x2ba70f=_0x4f8bc3[_0x2f1401(0x132)](_0x2bd1af);if(_0x2ba70f){const _0x53f0a1={..._0x83bfa2[_0x2f1401(0x152)]!==undefined&&{'description':_0x83bfa2[_0x2f1401(0x152)]},'rule':_0x83bfa2['rule']?deepSortObject(_0x83bfa2[_0x2f1401(0x11d)]):_0x83bfa2['rule']};if(_0x46a02a<_0x2ba70f){_0x421b74[_0x46a02a]=_0x53f0a1,delete _0x421b74[_0x2ba70f];for(const [_0x1e0596,_0xfbfcdc]of _0x4fca78[_0x2f1401(0x15b)]()){_0xfbfcdc===_0x2ba70f&&_0x4fca78[_0x2f1401(0x119)](_0x1e0596,_0x46a02a);}_0x4fca78[_0x2f1401(0x119)](_0x46a02a,_0x46a02a),_0x4f8bc3['set'](_0x2bd1af,_0x46a02a);}else _0x421b74[_0x2ba70f]=_0x53f0a1,_0x4fca78[_0x2f1401(0x119)](_0x46a02a,_0x2ba70f);}else{let _0x2629e4=_0x46a02a;if(_0x491e6a){const _0x39c322=_0x491e6a[_0x2f1401(0x132)](_0x2bd1af);_0x39c322&&_0x39c322[_0x2f1401(0x11f)]>0x0&&(_0x2629e4=_0x39c322[_0x2f1401(0x144)]()[_0x2f1401(0x12f)]()[0x0]);}const _0x5384e5={..._0x83bfa2[_0x2f1401(0x152)]!==undefined&&{'description':_0x83bfa2[_0x2f1401(0x152)]},'rule':_0x83bfa2['rule']?deepSortObject(_0x83bfa2[_0x2f1401(0x11d)]):_0x83bfa2[_0x2f1401(0x11d)]};_0x421b74[_0x2629e4]=_0x5384e5,_0x4fca78['set'](_0x46a02a,_0x2629e4),_0x4f8bc3[_0x2f1401(0x119)](_0x2bd1af,_0x2629e4);}}}return{'merged':_0x421b74,'nameMapping':_0x4fca78};}export function updateSegmentReferences(_0x93c719,_0x51e9ef){const _0xf0e2e5=a107_0x35d0;if(!_0x93c719)return;for(const _0x3312dd of _0x93c719){if(_0x3312dd[_0xf0e2e5(0x12a)]?.[_0xf0e2e5(0x146)]){const _0x55305a=_0x51e9ef[_0xf0e2e5(0x132)](_0x3312dd['entry_criteria'][_0xf0e2e5(0x146)]);_0x55305a&&(_0x3312dd[_0xf0e2e5(0x12a)][_0xf0e2e5(0x146)]=_0x55305a);}if(_0x3312dd[_0xf0e2e5(0x13c)])for(const _0x45e1f5 of _0x3312dd['steps']){if(_0x45e1f5[_0xf0e2e5(0x160)]===_0xf0e2e5(0x12c)&&_0x45e1f5[_0xf0e2e5(0x11a)]?.['branches'])for(const _0x1a3d90 of _0x45e1f5['with'][_0xf0e2e5(0x123)]){if(_0x1a3d90[_0xf0e2e5(0x146)]){const _0x539daa=_0x51e9ef[_0xf0e2e5(0x132)](_0x1a3d90[_0xf0e2e5(0x146)]);_0x539daa&&(_0x1a3d90['segment']=_0x539daa);}}}}}export function updateSegmentRefsInSegments(_0x5c174b,_0x1c1334){const _0x3ad287=a107_0x35d0;for(const _0x566082 of Object[_0x3ad287(0x154)](_0x5c174b)){_0x566082[_0x3ad287(0x11d)]&&updateSegmentRefsInRule(_0x566082['rule'],_0x1c1334);}}function updateSegmentRefsInRule(_0x57bfc7,_0x1f7d36){const _0x4f2881=a107_0x35d0;if(_0x57bfc7===null||typeof _0x57bfc7!==_0x4f2881(0x155))return;if(Array[_0x4f2881(0x135)](_0x57bfc7)){for(const _0x7ffdd9 of _0x57bfc7){updateSegmentRefsInRule(_0x7ffdd9,_0x1f7d36);}return;}const _0x2f2215=_0x57bfc7;if((_0x2f2215[_0x4f2881(0x160)]===_0x4f2881(0x138)||_0x2f2215[_0x4f2881(0x160)]==='exclude')&&typeof _0x2f2215[_0x4f2881(0x146)]===_0x4f2881(0x120)){const _0x372c64=_0x1f7d36[_0x4f2881(0x132)](_0x2f2215[_0x4f2881(0x146)]);_0x372c64&&(_0x2f2215[_0x4f2881(0x146)]=_0x372c64);}if(_0x2f2215[_0x4f2881(0x157)]&&Array[_0x4f2881(0x135)](_0x2f2215['conditions']))for(const _0x3a0517 of _0x2f2215[_0x4f2881(0x157)]){updateSegmentRefsInRule(_0x3a0517,_0x1f7d36);}}export function buildJourneysArray(_0x28780b){const _0x52a8b2=a107_0x35d0,_0x1993d6=Math[_0x52a8b2(0x118)](..._0x28780b[_0x52a8b2(0x143)](_0x1b2ff6=>_0x1b2ff6[_0x52a8b2(0x121)][_0x52a8b2(0x13e)]||0x0));return _0x28780b[_0x52a8b2(0x143)](_0x48f06f=>{const _0xe3efa8=_0x52a8b2,_0x42fb60=(_0x48f06f[_0xe3efa8(0x121)][_0xe3efa8(0x13e)]||0x0)===_0x1993d6,_0x2dd1ce=_0x48f06f['yaml'][_0xe3efa8(0x13a)]?.[0x0],_0x392d31={'version':_0x2dd1ce?.[_0xe3efa8(0x151)]||_0x48f06f[_0xe3efa8(0x148)][_0xe3efa8(0x151)]||_0x48f06f[_0xe3efa8(0x121)]['name'],'state':_0x48f06f[_0xe3efa8(0x121)][_0xe3efa8(0x15e)]===_0xe3efa8(0x142)?_0xe3efa8(0x142):_0xe3efa8(0x117),'stages':_0x2dd1ce?.['stages']||_0x48f06f['yaml'][_0xe3efa8(0x14b)]||[],'id':_0x2dd1ce?.['id']||_0x48f06f['yaml']['id'],'version_number':_0x2dd1ce?.[_0xe3efa8(0x130)]||_0x48f06f['yaml'][_0xe3efa8(0x130)]};return _0x42fb60&&(_0x392d31[_0xe3efa8(0x147)]=!![]),_0x392d31;});}export function buildMergedJourneyDef(_0x36fe32,_0x32362e){const _0xc89258=a107_0x35d0,_0x105e9d=_0x36fe32[0x0]['yaml'],_0x48550e=buildJourneysArray(_0x36fe32),{merged:_0x1756c6,nameMapping:_0x3201ea}=consolidateSegmentsByContent(_0x36fe32['map'](_0x49e497=>_0x49e497[_0xc89258(0x148)][_0xc89258(0x115)]),_0x32362e);updateSegmentRefsInSegments(_0x1756c6,_0x3201ea);const _0x39df44=Array[_0xc89258(0x129)](_0x3201ea[_0xc89258(0x15b)]())[_0xc89258(0x128)](([_0x23f4f1,_0x30dd33])=>_0x23f4f1!==_0x30dd33&&_0x23f4f1[_0xc89258(0x13f)]('entry_criteria'));let _0x1d4c88=_0x1756c6,_0x2ac3ec=new Map();if(_0x39df44){const _0x4c671f=consolidateSegmentsByContent([_0x1756c6],_0x32362e);_0x1d4c88=_0x4c671f[_0xc89258(0x112)],_0x2ac3ec=_0x4c671f[_0xc89258(0x153)];}const _0x262283=new Map(_0x3201ea);for(const [_0x1def7a,_0xadba5]of _0x2ac3ec[_0xc89258(0x15b)]()){_0x262283['set'](_0x1def7a,_0xadba5);}for(const [_0x3eef99,_0x113259]of _0x262283[_0xc89258(0x15b)]()){let _0x11339e=_0x113259,_0x641c24=0x0;while(_0x262283[_0xc89258(0x159)](_0x11339e)&&_0x262283[_0xc89258(0x132)](_0x11339e)!==_0x11339e&&_0x641c24<MAX_MAPPING_CHAIN_DEPTH){_0x11339e=_0x262283[_0xc89258(0x132)](_0x11339e),_0x641c24++;}_0x11339e!==_0x113259&&_0x262283[_0xc89258(0x119)](_0x3eef99,_0x11339e);}for(const _0x4e00b4 of _0x48550e){updateSegmentReferences(_0x4e00b4['stages'],_0x262283);}const {merged:_0x4e0c49,nameMapping:_0x9162d4}=consolidateActivationsByContent(_0x36fe32['map'](_0x18510a=>_0x18510a[_0xc89258(0x148)][_0xc89258(0x12b)]));for(const _0x50a4fc of _0x48550e){updateActivationReferences(_0x50a4fc[_0xc89258(0x14b)],_0x9162d4);}let _0x552bec=_0x105e9d[_0xc89258(0x141)];if(_0x552bec?.[_0xc89258(0x146)]){const _0x3d2dfb=_0x262283[_0xc89258(0x132)](_0x552bec[_0xc89258(0x146)]);_0x3d2dfb&&(_0x552bec={..._0x552bec,'segment':_0x3d2dfb});}for(const _0x48c7cd of _0x48550e){if(_0x48c7cd['goal']?.[_0xc89258(0x146)]){const _0x4ff9fb=_0x262283[_0xc89258(0x132)](_0x48c7cd['goal'][_0xc89258(0x146)]);_0x4ff9fb&&(_0x48c7cd['goal']={..._0x48c7cd['goal'],'segment':_0x4ff9fb});}}return{'type':_0xc89258(0x113),'name':_0x105e9d[_0xc89258(0x14a)],'description':_0x105e9d[_0xc89258(0x152)],'goal':_0x552bec,'reentry':_0x105e9d[_0xc89258(0x156)],'segments':Object[_0xc89258(0x158)](_0x1d4c88)['length']>0x0?_0x1d4c88:undefined,'activations':Object[_0xc89258(0x158)](_0x4e0c49)[_0xc89258(0x11f)]>0x0?_0x4e0c49:undefined,'journeys':_0x48550e,'bundle_id':_0x105e9d[_0xc89258(0x134)],'bundle_name':_0x105e9d['bundle_name']};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x46c66b,_0x1891c0,_0x28b48e,_0x462ea9){const _0x1d449f=a107_0x35d0,_0x5c0e7d=_0x46c66b+':'+_0x1891c0,_0x28afe2=_0x28b48e[_0x1d449f(0x132)](_0x5c0e7d);if(_0x28afe2)return _0x28afe2;const _0x4f0d7b=await _0x462ea9(_0x46c66b),_0x521364=_0x4f0d7b[_0x1d449f(0x145)][_0x1d449f(0x114)]||_0x4f0d7b[_0x1d449f(0x145)][_0x1d449f(0x14a)],_0x4cb059=_0x4f0d7b[_0x1d449f(0x145)][_0x1d449f(0x12e)][_0x1d449f(0x116)](_0x3e5c2b=>String(_0x3e5c2b['id'])===String(_0x1891c0)),_0x3d6d3a=_0x4cb059?.[_0x1d449f(0x14a)]||_0x1891c0,_0x9630a1={'journeyName':_0x521364,'stageName':_0x3d6d3a};return _0x28b48e['set'](_0x5c0e7d,_0x9630a1),_0x9630a1;}export function formatApiJourneyName(_0x399b5a,_0x2d95fe){return _0x2d95fe+'\x20('+_0x399b5a+')';}export function isLocalJourneyRef(_0x931676){const _0x43b9bb=a107_0x35d0;return _0x931676['endsWith'](_0x43b9bb(0x149))||_0x931676[_0x43b9bb(0x139)](_0x43b9bb(0x10f));}export function buildLocalRuleToNameMapping(_0x184f60){const _0x1bc548=a107_0x35d0,_0x25567c=new Map();if(!_0x184f60)return _0x25567c;for(const [_0x26e85c,_0x577e09]of Object[_0x1bc548(0x15b)](_0x184f60)){if(_0x577e09[_0x1bc548(0x11d)]){const _0x405f37=serializeRule(_0x577e09[_0x1bc548(0x11d)]),_0x28b696=_0x25567c[_0x1bc548(0x132)](_0x405f37)||[];_0x28b696['push'](_0x26e85c),_0x25567c[_0x1bc548(0x119)](_0x405f37,_0x28b696);}}return _0x25567c;}export function buildLocalRuleToNameMappingFromJourney(_0x440a05){const _0x21b0ba=a107_0x35d0,_0x473ce5=_0x440a05[_0x21b0ba(0x115)];if(!_0x473ce5)return new Map();const _0x11eb28=collectSegmentUsageCounts(_0x440a05),_0x4462dc=new Map();let _0xbc3630=0x0;for(const [_0x136d59,_0x48d76a]of Object[_0x21b0ba(0x15b)](_0x473ce5)){if(!_0x48d76a[_0x21b0ba(0x11d)]){_0xbc3630++;continue;}const _0x1a40be=serializeRule(_0x48d76a[_0x21b0ba(0x11d)]),_0x108937=_0x4462dc[_0x21b0ba(0x132)](_0x1a40be)||[];_0x108937[_0x21b0ba(0x126)]({'name':_0x136d59,'index':_0xbc3630}),_0x4462dc[_0x21b0ba(0x119)](_0x1a40be,_0x108937),_0xbc3630++;}const _0x1156dc=new Map();for(const [_0x2da02d,_0x173609]of _0x4462dc){const _0x178763=_0x173609['slice']()[_0x21b0ba(0x12f)]((_0xf2d525,_0x5bc471)=>{const _0x52b88e=_0x21b0ba,_0x52026b=_0x11eb28[_0x52b88e(0x132)](_0xf2d525[_0x52b88e(0x14a)])||0x0,_0x33b040=_0x11eb28[_0x52b88e(0x132)](_0x5bc471[_0x52b88e(0x14a)])||0x0;if(_0x52026b!==_0x33b040)return _0x33b040-_0x52026b;return _0xf2d525[_0x52b88e(0x137)]-_0x5bc471[_0x52b88e(0x137)];})[_0x21b0ba(0x143)](_0x3d108f=>_0x3d108f[_0x21b0ba(0x14a)]);_0x1156dc[_0x21b0ba(0x119)](_0x2da02d,_0x178763);}return _0x1156dc;}export function collectSegmentUsageCounts(_0x1c5413){const _0x481bd7=a107_0x35d0,_0x26d689=new Map(),_0x603447=_0x9598a3=>{const _0x28fb75=a107_0x35d0;if(!_0x9598a3)return;_0x26d689['set'](_0x9598a3,(_0x26d689[_0x28fb75(0x132)](_0x9598a3)||0x0)+0x1);},_0x4d6e5d=_0x3f3f59=>{const _0x1be404=a107_0x35d0;for(const _0x5695f8 of _0x3f3f59){_0x603447(_0x5695f8[_0x1be404(0x12a)]?.[_0x1be404(0x146)]);if(_0x5695f8['exit_criteria'])for(const _0x140a70 of _0x5695f8[_0x1be404(0x131)]){_0x603447(_0x140a70[_0x1be404(0x146)]);}_0x603447(_0x5695f8[_0x1be404(0x122)]?.[_0x1be404(0x146)]);if(_0x5695f8['steps'])for(const _0x30898a of _0x5695f8[_0x1be404(0x13c)]){if(_0x30898a[_0x1be404(0x160)]==='decision_point')for(const _0x16dca6 of _0x30898a[_0x1be404(0x11a)][_0x1be404(0x123)]){_0x603447(_0x16dca6[_0x1be404(0x146)]);}else _0x30898a[_0x1be404(0x160)]===_0x1be404(0x15c)&&_0x603447(_0x30898a[_0x1be404(0x11a)][_0x1be404(0x13b)]?.[_0x1be404(0x146)]);}}};_0x603447(_0x1c5413[_0x481bd7(0x141)]?.[_0x481bd7(0x146)]);if(_0x1c5413[_0x481bd7(0x13a)])for(const _0x2fdd1c of _0x1c5413[_0x481bd7(0x13a)]){_0x603447(_0x2fdd1c[_0x481bd7(0x141)]?.[_0x481bd7(0x146)]),_0x4d6e5d(_0x2fdd1c[_0x481bd7(0x14b)]);}_0x1c5413['stages']&&_0x4d6e5d(_0x1c5413['stages']);if(_0x1c5413[_0x481bd7(0x11e)])for(const _0x455ac3 of _0x1c5413[_0x481bd7(0x11e)]){_0x4d6e5d(_0x455ac3['stages']);}return _0x26d689;}
@@ -1 +1 @@
1
- function a108_0x1ea1(){const _0x1e7cb8=['MISSING_ACTIVATION_DEFINITION','exit_criteria','.with.condition.segment','merge','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','set','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','\x27\x20has\x20','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','494318vqRDjc','level','activations','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','.entry_criteria','segments.','segments','entry_criteria','880470EOxJHq','source','.with.condition','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','map','abs','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',').\x20Merge\x20is\x20unnecessary.','Decision\x20branch\x20\x27','477524vvcQWG','MISSING_EXIT_CRITERIA','INVALID_NEXT_REFERENCE','document','MISSING_NAME','.segment','MISSING_CONDITIONS','MISSING_WAIT_PARAMS','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','branches','.with.variants','\x27\x20(from:\x20','warning','startsWith','with','condition\x20of\x20\x27','ab_test','ref:','stepNames','versions','wait','\x27\x20with\x20no\x20action\x20in\x20between','end','embeddedSegments','Criteria\x20references\x20undefined\x20segment\x20\x27','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','excluded','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','411579eLkyvE','\x27\x20has\x20no\x20end\x20step','timeout','stages','\x27\x20of\x20\x27','Journey\x20name\x20is\x20required','.with.activation','.exit_criteria[','INVALID_JUMP_TARGET','type','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','Activation\x20step\x20requires\x20an\x20activation\x20reference','goal','.with.condition.timeout','keys','variants','FEW_STEPS','has','DUPLICATE_STEP_NAME','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','3615913wvJVro','MISSING_ACTIVATION_REF','reduce','.with.condition.next','\x20step(s)\x20but\x20needs\x20at\x20least\x202','stage','next','\x27\x20has\x20no\x20exit_criteria\x20defined','stages[','MISSING_ENTRY_CRITERIA','.with.target','step\x20\x27','activationKeys','flatMap','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','jump','End\x20step\x20\x27','referencedSegments','.steps','.with.variants[','name','\x27\x20(first\x20defined\x20at\x20steps[','Merge\x20step\x20\x27','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','decision_point','variant\x20\x27','get','trim','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','BRANCH_DIRECTLY_TO_MERGE','1484658tPGoKc','UNUSED_EMBEDDED_SEGMENT','length','entries','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','description','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','segment','activation','.with','condition','221525pmmiNR','join','INVALID_AB_TEST_PERCENTAGES','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','milestone','add','size','timeout\x20of\x20\x27','.name','MISSING_END_STEP',').\x20Use\x20a\x20merge\x20step.','journeys','percentage','.milestone','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','error','some','.next','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','rule','CONVERGENCE_WITHOUT_MERGE','steps','push','Stage\x20\x27','SINGLE_INPUT_MERGE','MISSING_SEGMENT_REFERENCE','.with.condition.timeout.next'];a108_0x1ea1=function(){return _0x1e7cb8;};return a108_0x1ea1();}(function(_0x3cca57,_0x77da93){const _0x2aab91=a108_0x18dc,_0x425a66=_0x3cca57();while(!![]){try{const _0x58b2cb=parseInt(_0x2aab91(0x168))/0x1+-parseInt(_0x2aab91(0x18d))/0x2+parseInt(_0x2aab91(0x12b))/0x3+parseInt(_0x2aab91(0x19e))/0x4+parseInt(_0x2aab91(0x195))/0x5+parseInt(_0x2aab91(0x15d))/0x6+-parseInt(_0x2aab91(0x13f))/0x7;if(_0x58b2cb===_0x77da93)break;else _0x425a66['push'](_0x425a66['shift']());}catch(_0x3e1b69){_0x425a66['push'](_0x425a66['shift']());}}}(a108_0x1ea1,0x21abe));import{getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x30d274,_0x8ed1bd,_0x379364,_0x41f7e6,_0x1fffcc,_0x42df37){const _0x4f9572=a108_0x18dc;return{'level':_0x30d274,'path':_0x8ed1bd,'code':_0x379364,'message':_0x41f7e6,'location':getLocationFromPath(_0x1fffcc[_0x4f9572(0x1a1)],_0x1fffcc['source'],pathToArray(_0x42df37??_0x8ed1bd))};}function a108_0x18dc(_0x1e7eb2,_0x177bcf){_0x1e7eb2=_0x1e7eb2-0x122;const _0x1ea1dc=a108_0x1ea1();let _0x18dc2c=_0x1ea1dc[_0x1e7eb2];return _0x18dc2c;}function validateJourneyStructure(_0x47e2cd,_0x30bb9e,_0x4b12f7){const _0x4157cb=a108_0x18dc,_0x122f85=[];return _0x30bb9e[_0x4157cb(0x15f)]>MAX_STAGES&&_0x122f85[_0x4157cb(0x17f)](createIssue(_0x4157cb(0x178),'stages','TOO_MANY_STAGES','Journey\x20has\x20'+_0x30bb9e[_0x4157cb(0x15f)]+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x4b12f7)),!_0x47e2cd[_0x4157cb(0x137)]&&_0x122f85[_0x4157cb(0x17f)](createIssue(_0x4157cb(0x178),_0x4157cb(0x137),'MISSING_GOAL','Journey\x20must\x20have\x20a\x20goal\x20defined',_0x4b12f7)),_0x122f85;}function validateStageStructure(_0x17cea3,_0x47664a,_0x3616a6,_0x299079){const _0x387a3c=a108_0x18dc,_0x1590c2=[],_0x3c3231=_0x387a3c(0x147)+_0x47664a+']';_0x47664a===0x0&&!_0x17cea3[_0x387a3c(0x194)]&&_0x1590c2[_0x387a3c(0x17f)](createIssue(_0x387a3c(0x178),_0x3c3231+_0x387a3c(0x191),_0x387a3c(0x148),_0x387a3c(0x180)+_0x17cea3[_0x387a3c(0x153)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x299079,_0x3c3231));const _0x13e9d1=_0x47664a===_0x3616a6-0x1;!_0x13e9d1&&!_0x17cea3[_0x387a3c(0x16c)]&&_0x1590c2['push'](createIssue(_0x387a3c(0x178),_0x3c3231+_0x387a3c(0x175),'MISSING_MILESTONE',_0x387a3c(0x180)+_0x17cea3[_0x387a3c(0x153)]+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0x299079,_0x3c3231));(!_0x17cea3[_0x387a3c(0x185)]||_0x17cea3[_0x387a3c(0x185)][_0x387a3c(0x15f)]===0x0)&&_0x1590c2[_0x387a3c(0x17f)](createIssue(_0x387a3c(0x1aa),_0x3c3231+'.exit_criteria',_0x387a3c(0x19f),_0x387a3c(0x180)+_0x17cea3[_0x387a3c(0x153)]+_0x387a3c(0x146),_0x299079,_0x3c3231));const _0x31b51c=_0x17cea3[_0x387a3c(0x17e)]?.[_0x387a3c(0x15f)]??0x0;if(_0x31b51c<=0x1)_0x1590c2['push'](createIssue(_0x387a3c(0x178),_0x3c3231+_0x387a3c(0x151),'INSUFFICIENT_STEPS',_0x387a3c(0x180)+_0x17cea3[_0x387a3c(0x153)]+_0x387a3c(0x18b)+_0x31b51c+_0x387a3c(0x143),_0x299079,_0x3c3231+_0x387a3c(0x151)));else _0x31b51c<=0x3&&_0x1590c2[_0x387a3c(0x17f)](createIssue(_0x387a3c(0x1aa),_0x3c3231+_0x387a3c(0x151),_0x387a3c(0x13b),'Stage\x20\x27'+_0x17cea3['name']+'\x27\x20has\x20only\x20'+_0x31b51c+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x299079,_0x3c3231+_0x387a3c(0x151)));return _0x1590c2;}function validateStep(_0xf3b183,_0x316a0d,_0x1e4d8f,_0x3c4ce8){const _0x33ee52=a108_0x18dc,_0x5da232=[];if(_0xf3b183[_0x33ee52(0x134)]===_0x33ee52(0x124))return _0xf3b183[_0x33ee52(0x145)]&&_0x5da232[_0x33ee52(0x17f)](createIssue(_0x33ee52(0x178),_0x316a0d+_0x33ee52(0x17a),'END_STEP_HAS_NEXT_OR_WITH',_0x33ee52(0x14f)+_0xf3b183[_0x33ee52(0x153)]+'\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field',_0x1e4d8f)),_0x33ee52(0x1ac)in _0xf3b183&&_0xf3b183[_0x33ee52(0x1ac)]!==undefined&&_0x5da232[_0x33ee52(0x17f)](createIssue(_0x33ee52(0x178),_0x316a0d+_0x33ee52(0x166),'END_STEP_HAS_NEXT_OR_WITH',_0x33ee52(0x14f)+_0xf3b183[_0x33ee52(0x153)]+_0x33ee52(0x163),_0x1e4d8f)),_0x5da232;_0xf3b183[_0x33ee52(0x145)]&&(_0x1e4d8f[_0x33ee52(0x1b0)]&&!_0x1e4d8f['stepNames'][_0x33ee52(0x13c)](_0xf3b183[_0x33ee52(0x145)])&&_0x5da232['push'](createIssue(_0x33ee52(0x178),_0x316a0d+_0x33ee52(0x17a),_0x33ee52(0x1a0),'Step\x20references\x20non-existent\x20step\x20\x27'+_0xf3b183[_0x33ee52(0x145)]+'\x27',_0x1e4d8f)));switch(_0xf3b183[_0x33ee52(0x134)]){case _0x33ee52(0x122):_0x5da232[_0x33ee52(0x17f)](...validateWaitStep(_0xf3b183,_0x316a0d,_0x1e4d8f,_0x3c4ce8));break;case'activation':_0x5da232[_0x33ee52(0x17f)](...validateActivationStep(_0xf3b183,_0x316a0d,_0x1e4d8f));break;case'decision_point':_0x5da232[_0x33ee52(0x17f)](...validateDecisionPointStep(_0xf3b183,_0x316a0d,_0x1e4d8f,_0x3c4ce8));break;case'ab_test':_0x5da232[_0x33ee52(0x17f)](...validateAbTestStep(_0xf3b183,_0x316a0d,_0x1e4d8f,_0x3c4ce8));break;case _0x33ee52(0x14e):_0x5da232[_0x33ee52(0x17f)](...validateJumpStep(_0xf3b183,_0x316a0d,_0x1e4d8f));break;}return _0x5da232;}function validateWaitStep(_0xcda789,_0x10d7ae,_0x593b62,_0xb6861a){const _0x302ecc=a108_0x18dc,_0x1526c1=[];if(!_0xcda789[_0x302ecc(0x1ac)])return _0x1526c1['push'](createIssue('error',_0x10d7ae+_0x302ecc(0x166),_0x302ecc(0x1a5),_0x302ecc(0x156),_0x593b62,_0x10d7ae)),_0x1526c1;if(_0xcda789[_0x302ecc(0x1ac)]['condition']){const _0x12c108=_0xcda789[_0x302ecc(0x1ac)][_0x302ecc(0x167)];if(_0x12c108[_0x302ecc(0x164)]){_0x593b62[_0x302ecc(0x150)]?.[_0x302ecc(0x16d)](_0x12c108['segment']);!_0x12c108[_0x302ecc(0x164)]['startsWith'](_0x302ecc(0x1af))&&(_0x593b62['embeddedSegments']&&!_0x593b62[_0x302ecc(0x125)]['has'](_0x12c108['segment'])&&_0x1526c1[_0x302ecc(0x17f)](createIssue(_0x302ecc(0x178),_0x10d7ae+_0x302ecc(0x186),'MISSING_SEGMENT_REFERENCE',_0x302ecc(0x198)+_0x12c108[_0x302ecc(0x164)]+_0x302ecc(0x129),_0x593b62)));_0x12c108[_0x302ecc(0x145)]&&_0x593b62[_0x302ecc(0x1b0)]&&!_0x593b62['stepNames'][_0x302ecc(0x13c)](_0x12c108[_0x302ecc(0x145)])&&_0x1526c1[_0x302ecc(0x17f)](createIssue(_0x302ecc(0x178),_0x10d7ae+'.with.condition.next','INVALID_NEXT_REFERENCE',_0x302ecc(0x13e)+_0x12c108[_0x302ecc(0x145)]+'\x27',_0x593b62));_0x12c108[_0x302ecc(0x12d)]?.['next']&&_0x593b62[_0x302ecc(0x1b0)]&&!_0x593b62['stepNames'][_0x302ecc(0x13c)](_0x12c108[_0x302ecc(0x12d)][_0x302ecc(0x145)])&&_0x1526c1[_0x302ecc(0x17f)](createIssue(_0x302ecc(0x178),_0x10d7ae+_0x302ecc(0x183),_0x302ecc(0x1a0),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x12c108[_0x302ecc(0x12d)][_0x302ecc(0x145)]+'\x27',_0x593b62));const _0x16c537=_0x12c108['next']||_0xcda789['next'],_0xfe9b80=_0x12c108[_0x302ecc(0x12d)]?.[_0x302ecc(0x145)]||_0xcda789[_0x302ecc(0x145)];if(_0x16c537){const _0x2ff733=_0xb6861a[_0x302ecc(0x159)](_0x16c537);_0x2ff733?.[_0x302ecc(0x134)]==='merge'&&_0x1526c1[_0x302ecc(0x17f)](createIssue(_0x302ecc(0x178),_0x10d7ae+_0x302ecc(0x142),_0x302ecc(0x15c),_0x302ecc(0x1a6)+_0x16c537+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x593b62,_0x10d7ae+_0x302ecc(0x197)));}if(_0xfe9b80){const _0x488482=_0xb6861a[_0x302ecc(0x159)](_0xfe9b80);_0x488482?.[_0x302ecc(0x134)]===_0x302ecc(0x187)&&_0x1526c1[_0x302ecc(0x17f)](createIssue(_0x302ecc(0x178),_0x10d7ae+_0x302ecc(0x183),_0x302ecc(0x15c),_0x302ecc(0x127)+_0xfe9b80+_0x302ecc(0x15b),_0x593b62,_0x10d7ae+_0x302ecc(0x138)));}}}return _0x1526c1;}function validateActivationStep(_0x24e272,_0x5289ac,_0xd6ab56){const _0x2eb4b2=a108_0x18dc,_0x98a7b8=[];if(!_0x24e272['with']?.[_0x2eb4b2(0x165)])return _0x98a7b8[_0x2eb4b2(0x17f)](createIssue(_0x2eb4b2(0x178),_0x5289ac+_0x2eb4b2(0x131),_0x2eb4b2(0x140),_0x2eb4b2(0x136),_0xd6ab56,_0x5289ac)),_0x98a7b8;const _0x5bde31=_0x24e272[_0x2eb4b2(0x1ac)][_0x2eb4b2(0x165)];return _0xd6ab56['activationKeys']&&!_0x5bde31[_0x2eb4b2(0x1ab)](_0x2eb4b2(0x1af))&&(!_0xd6ab56[_0x2eb4b2(0x14b)][_0x2eb4b2(0x13c)](_0x5bde31)&&_0x98a7b8[_0x2eb4b2(0x17f)](createIssue(_0x2eb4b2(0x178),_0x5289ac+_0x2eb4b2(0x131),_0x2eb4b2(0x184),_0x2eb4b2(0x177)+_0x5bde31+_0x2eb4b2(0x18a),_0xd6ab56))),_0x98a7b8;}function validateDecisionPointStep(_0x2bdbf1,_0x1123c8,_0x587121,_0x1a79c0){const _0x57143e=a108_0x18dc,_0x410546=[];if(!_0x2bdbf1['with']?.[_0x57143e(0x1a7)]||_0x2bdbf1[_0x57143e(0x1ac)][_0x57143e(0x1a7)][_0x57143e(0x15f)]===0x0)return _0x410546[_0x57143e(0x17f)](createIssue(_0x57143e(0x178),_0x1123c8+'.with.branches','MISSING_CONDITIONS',_0x57143e(0x190),_0x587121,_0x1123c8)),_0x410546;for(let _0x3131c3=0x0;_0x3131c3<_0x2bdbf1[_0x57143e(0x1ac)][_0x57143e(0x1a7)][_0x57143e(0x15f)];_0x3131c3++){const _0x2e1a54=_0x2bdbf1[_0x57143e(0x1ac)][_0x57143e(0x1a7)][_0x3131c3],_0x5b7485=_0x1123c8+'.with.branches['+_0x3131c3+']';_0x2e1a54[_0x57143e(0x164)]&&!_0x2e1a54[_0x57143e(0x128)]&&(_0x587121[_0x57143e(0x150)]?.[_0x57143e(0x16d)](_0x2e1a54[_0x57143e(0x164)]),!_0x2e1a54[_0x57143e(0x164)]['startsWith'](_0x57143e(0x1af))&&(_0x587121[_0x57143e(0x125)]&&!_0x587121[_0x57143e(0x125)][_0x57143e(0x13c)](_0x2e1a54['segment'])&&_0x410546[_0x57143e(0x17f)](createIssue('error',_0x5b7485+_0x57143e(0x1a3),'MISSING_SEGMENT_REFERENCE','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x2e1a54[_0x57143e(0x164)]+'\x27',_0x587121))));_0x2e1a54[_0x57143e(0x145)]&&_0x587121[_0x57143e(0x1b0)]&&!_0x587121[_0x57143e(0x1b0)][_0x57143e(0x13c)](_0x2e1a54[_0x57143e(0x145)])&&_0x410546[_0x57143e(0x17f)](createIssue(_0x57143e(0x178),_0x5b7485+_0x57143e(0x17a),_0x57143e(0x1a0),_0x57143e(0x16b)+_0x2e1a54['next']+'\x27',_0x587121));if(_0x2e1a54['next']){const _0x5396e2=_0x1a79c0[_0x57143e(0x159)](_0x2e1a54[_0x57143e(0x145)]);_0x5396e2?.[_0x57143e(0x134)]==='merge'&&_0x410546['push'](createIssue(_0x57143e(0x178),_0x5b7485+_0x57143e(0x17a),_0x57143e(0x15c),_0x57143e(0x19d)+_0x2e1a54['name']+_0x57143e(0x188)+_0x2e1a54['next']+_0x57143e(0x123),_0x587121));}}return _0x410546;}function validateAbTestStep(_0x46e084,_0x14bf1a,_0x2c28f0,_0x1bdc4f){const _0x578f26=a108_0x18dc,_0x186167=[];if(!_0x46e084[_0x578f26(0x1ac)]?.[_0x578f26(0x13a)]||_0x46e084['with']['variants'][_0x578f26(0x15f)]===0x0)return _0x186167[_0x578f26(0x17f)](createIssue(_0x578f26(0x178),_0x14bf1a+'.with.variants',_0x578f26(0x1a4),_0x578f26(0x19b),_0x2c28f0,_0x14bf1a)),_0x186167;const _0x47a231=_0x46e084['with'][_0x578f26(0x13a)][_0x578f26(0x141)]((_0x6a282d,_0x59a298)=>_0x6a282d+(_0x59a298[_0x578f26(0x174)]||0x0),0x0);Math[_0x578f26(0x19a)](_0x47a231-0x64)>0.01&&_0x186167['push'](createIssue(_0x578f26(0x178),_0x14bf1a+_0x578f26(0x1a8),_0x578f26(0x16a),_0x578f26(0x12a)+_0x47a231+'%)',_0x2c28f0));for(let _0xb36999=0x0;_0xb36999<_0x46e084[_0x578f26(0x1ac)]['variants']['length'];_0xb36999++){const _0x2c8ca9=_0x46e084[_0x578f26(0x1ac)][_0x578f26(0x13a)][_0xb36999],_0x58880e=_0x14bf1a+_0x578f26(0x152)+_0xb36999+']';_0x2c8ca9[_0x578f26(0x145)]&&_0x2c28f0[_0x578f26(0x1b0)]&&!_0x2c28f0['stepNames'][_0x578f26(0x13c)](_0x2c8ca9[_0x578f26(0x145)])&&_0x186167[_0x578f26(0x17f)](createIssue(_0x578f26(0x178),_0x58880e+_0x578f26(0x17a),_0x578f26(0x1a0),'A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x2c8ca9[_0x578f26(0x145)]+'\x27',_0x2c28f0));if(_0x2c8ca9[_0x578f26(0x145)]){const _0x3877ef=_0x1bdc4f[_0x578f26(0x159)](_0x2c8ca9['next']);_0x3877ef?.[_0x578f26(0x134)]===_0x578f26(0x187)&&_0x186167[_0x578f26(0x17f)](createIssue(_0x578f26(0x178),_0x58880e+_0x578f26(0x17a),_0x578f26(0x15c),'A/B\x20test\x20variant\x20\x27'+_0x2c8ca9[_0x578f26(0x153)]+_0x578f26(0x188)+_0x2c8ca9['next']+_0x578f26(0x123),_0x2c28f0));}}return _0x186167;}function validateJumpStep(_0x10b025,_0x4c4d1b,_0x180b20){const _0x1fd06b=a108_0x18dc,_0x10c9b3=[];if(!_0x10b025[_0x1fd06b(0x1ac)]?.['target'])return _0x10c9b3[_0x1fd06b(0x17f)](createIssue(_0x1fd06b(0x178),_0x4c4d1b+_0x1fd06b(0x149),'INVALID_JUMP_TARGET','Jump\x20step\x20requires\x20a\x20target',_0x180b20,_0x4c4d1b)),_0x10c9b3;return(!_0x10b025[_0x1fd06b(0x1ac)]['target']['journey']||!_0x10b025['with']['target'][_0x1fd06b(0x144)])&&_0x10c9b3[_0x1fd06b(0x17f)](createIssue('error',_0x4c4d1b+_0x1fd06b(0x149),_0x1fd06b(0x133),_0x1fd06b(0x135),_0x180b20)),_0x10c9b3;}function buildConvergenceMap(_0x32588e){const _0x45fed4=a108_0x18dc,_0x3ef1a5=new Map();function _0x534d6b(_0x275f8b,_0x35f7a2){const _0x37ef2b=a108_0x18dc,_0x84f7a7=_0x3ef1a5['get'](_0x275f8b)||[];_0x84f7a7[_0x37ef2b(0x17f)](_0x35f7a2),_0x3ef1a5[_0x37ef2b(0x189)](_0x275f8b,_0x84f7a7);}for(const _0x357307 of _0x32588e){_0x357307[_0x45fed4(0x145)]&&_0x534d6b(_0x357307[_0x45fed4(0x145)],{'stepName':_0x357307[_0x45fed4(0x153)],'description':_0x45fed4(0x14a)+_0x357307['name']+'\x27'});if(_0x357307['type']===_0x45fed4(0x157)&&_0x357307['with']?.[_0x45fed4(0x1a7)])for(const _0x5c8da2 of _0x357307[_0x45fed4(0x1ac)][_0x45fed4(0x1a7)]){_0x5c8da2[_0x45fed4(0x145)]&&_0x534d6b(_0x5c8da2[_0x45fed4(0x145)],{'stepName':_0x357307[_0x45fed4(0x153)],'description':'branch\x20\x27'+_0x5c8da2['name']+_0x45fed4(0x12f)+_0x357307[_0x45fed4(0x153)]+'\x27'});}if(_0x357307['type']===_0x45fed4(0x1ae)&&_0x357307[_0x45fed4(0x1ac)]?.[_0x45fed4(0x13a)])for(const _0x3f5176 of _0x357307[_0x45fed4(0x1ac)][_0x45fed4(0x13a)]){_0x3f5176[_0x45fed4(0x145)]&&_0x534d6b(_0x3f5176[_0x45fed4(0x145)],{'stepName':_0x357307[_0x45fed4(0x153)],'description':_0x45fed4(0x158)+_0x3f5176[_0x45fed4(0x153)]+_0x45fed4(0x12f)+_0x357307[_0x45fed4(0x153)]+'\x27'});}_0x357307[_0x45fed4(0x134)]==='wait'&&_0x357307[_0x45fed4(0x1ac)]?.[_0x45fed4(0x167)]&&(_0x357307[_0x45fed4(0x1ac)][_0x45fed4(0x167)][_0x45fed4(0x145)]&&_0x534d6b(_0x357307[_0x45fed4(0x1ac)][_0x45fed4(0x167)][_0x45fed4(0x145)],{'stepName':_0x357307[_0x45fed4(0x153)],'description':_0x45fed4(0x1ad)+_0x357307[_0x45fed4(0x153)]+'\x27'}),_0x357307['with'][_0x45fed4(0x167)][_0x45fed4(0x12d)]?.[_0x45fed4(0x145)]&&_0x534d6b(_0x357307[_0x45fed4(0x1ac)][_0x45fed4(0x167)][_0x45fed4(0x12d)][_0x45fed4(0x145)],{'stepName':_0x357307[_0x45fed4(0x153)],'description':_0x45fed4(0x16f)+_0x357307['name']+'\x27'}));}return _0x3ef1a5;}function validateFlowControl(_0x59aacf,_0x1b3b4f,_0x5b4fe9){const _0x1075c9=a108_0x18dc,_0x487752=[],_0x5b1904=_0x1075c9(0x147)+_0x1b3b4f+']',_0x556f3e=_0x59aacf[_0x1075c9(0x17e)]||[];if(_0x556f3e[_0x1075c9(0x15f)]===0x0)return _0x487752;const _0x2bdd3f=new Map();for(const _0xc6d0e1 of _0x556f3e){_0xc6d0e1[_0x1075c9(0x153)]&&_0x2bdd3f[_0x1075c9(0x189)](_0xc6d0e1[_0x1075c9(0x153)],_0xc6d0e1);}const _0xed0c53=buildConvergenceMap(_0x556f3e),_0x287430=_0x556f3e[_0x1075c9(0x179)](_0x5dae3e=>_0x5dae3e[_0x1075c9(0x134)]===_0x1075c9(0x124));!_0x287430&&_0x487752['push'](createIssue(_0x1075c9(0x178),_0x5b1904+_0x1075c9(0x151),_0x1075c9(0x171),_0x1075c9(0x180)+_0x59aacf[_0x1075c9(0x153)]+_0x1075c9(0x12c),_0x5b4fe9));for(const [_0x466126,_0x5e18d9]of _0xed0c53){const _0x47b862=_0x2bdd3f[_0x1075c9(0x159)](_0x466126);if(!_0x47b862)continue;if(_0x5e18d9[_0x1075c9(0x15f)]>0x1&&_0x47b862[_0x1075c9(0x134)]!==_0x1075c9(0x187)){const _0x50dbbd=_0x5e18d9[_0x1075c9(0x199)](_0x231754=>_0x231754[_0x1075c9(0x162)])[_0x1075c9(0x169)](',\x20');_0x487752['push'](createIssue(_0x1075c9(0x178),_0x5b1904+_0x1075c9(0x151),_0x1075c9(0x17d),_0x1075c9(0x17b)+_0x466126+_0x1075c9(0x1a9)+_0x50dbbd+_0x1075c9(0x172),_0x5b4fe9));}_0x5e18d9[_0x1075c9(0x15f)]===0x1&&_0x47b862[_0x1075c9(0x134)]===_0x1075c9(0x187)&&_0x487752[_0x1075c9(0x17f)](createIssue('warning',_0x5b1904+_0x1075c9(0x151),_0x1075c9(0x181),_0x1075c9(0x155)+_0x466126+_0x1075c9(0x176)+_0x5e18d9[0x0][_0x1075c9(0x162)]+_0x1075c9(0x19c),_0x5b4fe9));}for(const _0x2b52e5 of _0x556f3e){if(_0x2b52e5[_0x1075c9(0x134)]==='merge'&&_0x2b52e5[_0x1075c9(0x145)]){const _0x4f8f7f=_0x2bdd3f[_0x1075c9(0x159)](_0x2b52e5[_0x1075c9(0x145)]);_0x4f8f7f?.[_0x1075c9(0x134)]==='merge'&&_0x487752[_0x1075c9(0x17f)](createIssue(_0x1075c9(0x178),_0x5b1904+_0x1075c9(0x151),'MERGE_TO_MERGE_CHAIN',_0x1075c9(0x155)+_0x2b52e5[_0x1075c9(0x153)]+_0x1075c9(0x18c)+_0x2b52e5[_0x1075c9(0x145)]+_0x1075c9(0x14d),_0x5b4fe9));}}return _0x487752;}function validateCriteria(_0x3d92f0,_0x4f95b8,_0x238b90){const _0x4f43e4=a108_0x18dc,_0x661852=[];return _0x3d92f0['segment']&&(_0x238b90[_0x4f43e4(0x150)]?.[_0x4f43e4(0x16d)](_0x3d92f0[_0x4f43e4(0x164)]),!_0x3d92f0['segment'][_0x4f43e4(0x1ab)](_0x4f43e4(0x1af))&&(_0x238b90[_0x4f43e4(0x125)]&&!_0x238b90[_0x4f43e4(0x125)]['has'](_0x3d92f0['segment'])&&_0x661852[_0x4f43e4(0x17f)](createIssue(_0x4f43e4(0x178),_0x4f95b8+_0x4f43e4(0x1a3),_0x4f43e4(0x182),_0x4f43e4(0x126)+_0x3d92f0['segment']+'\x27',_0x238b90)))),_0x661852;}function validateEmbeddedSegment(_0xe17d1e,_0x38fb05,_0x512c6e){const _0x58f050=a108_0x18dc,_0x5da8d2=[];return _0xe17d1e[_0x58f050(0x17c)]&&_0x5da8d2['push'](...validateRuleDef(_0xe17d1e[_0x58f050(0x17c)],_0x38fb05+'.rule',_0x512c6e)),_0x5da8d2;}function getJourneyStages(_0x3a43dc){const _0x14bf09=a108_0x18dc;if(_0x3a43dc['stages']&&_0x3a43dc[_0x14bf09(0x12e)][_0x14bf09(0x15f)]>0x0)return _0x3a43dc['stages'];if(_0x3a43dc[_0x14bf09(0x173)]&&_0x3a43dc[_0x14bf09(0x173)][_0x14bf09(0x15f)]>0x0)return _0x3a43dc[_0x14bf09(0x173)][_0x14bf09(0x14c)](_0xae48db=>_0xae48db['stages']||[]);if(_0x3a43dc['versions']&&_0x3a43dc['versions'][_0x14bf09(0x15f)]>0x0)return _0x3a43dc[_0x14bf09(0x1b1)][_0x14bf09(0x14c)](_0x2c8a74=>_0x2c8a74['stages']||[]);return[];}function validateStage(_0x2c1658,_0x3b233b,_0x28b425,_0xee3f33){const _0x89cca9=a108_0x18dc,_0x12dd17=[],_0x3710b2=_0x89cca9(0x147)+_0x3b233b+']',_0x475682=new Map(),_0x5a9136=new Map();if(_0x2c1658['steps']){for(let _0x399729=0x0;_0x399729<_0x2c1658[_0x89cca9(0x17e)][_0x89cca9(0x15f)];_0x399729++){const _0x1e4876=_0x2c1658[_0x89cca9(0x17e)][_0x399729];_0x1e4876[_0x89cca9(0x153)]&&_0x475682[_0x89cca9(0x189)](_0x1e4876[_0x89cca9(0x153)],_0x1e4876);}for(let _0x11c073=0x0;_0x11c073<_0x2c1658[_0x89cca9(0x17e)][_0x89cca9(0x15f)];_0x11c073++){const _0x4da8be=_0x2c1658[_0x89cca9(0x17e)][_0x11c073],_0x296130=_0x3710b2+'.steps['+_0x11c073+']';if(_0x4da8be['name']){if(_0x5a9136['has'](_0x4da8be[_0x89cca9(0x153)])){const _0x323892=_0x5a9136['get'](_0x4da8be[_0x89cca9(0x153)]);_0x12dd17[_0x89cca9(0x17f)](createIssue(_0x89cca9(0x178),_0x296130+_0x89cca9(0x170),_0x89cca9(0x13d),'Duplicate\x20step\x20name\x20\x27'+_0x4da8be[_0x89cca9(0x153)]+_0x89cca9(0x154)+_0x323892+'])',_0xee3f33));}else _0x5a9136['set'](_0x4da8be['name'],_0x11c073);}_0x12dd17['push'](...validateStep(_0x4da8be,_0x296130,_0xee3f33,_0x475682));}}_0x2c1658[_0x89cca9(0x194)]&&_0x12dd17[_0x89cca9(0x17f)](...validateCriteria(_0x2c1658[_0x89cca9(0x194)],_0x3710b2+'.entry_criteria',_0xee3f33));if(_0x2c1658[_0x89cca9(0x185)])for(let _0x557345=0x0;_0x557345<_0x2c1658[_0x89cca9(0x185)][_0x89cca9(0x15f)];_0x557345++){_0x12dd17['push'](...validateCriteria(_0x2c1658[_0x89cca9(0x185)][_0x557345],_0x3710b2+_0x89cca9(0x132)+_0x557345+']',_0xee3f33));}return _0x2c1658[_0x89cca9(0x16c)]&&_0x12dd17[_0x89cca9(0x17f)](...validateCriteria(_0x2c1658[_0x89cca9(0x16c)],_0x3710b2+_0x89cca9(0x175),_0xee3f33)),_0x12dd17[_0x89cca9(0x17f)](...validateStageStructure(_0x2c1658,_0x3b233b,_0x28b425,_0xee3f33)),_0x12dd17[_0x89cca9(0x17f)](...validateFlowControl(_0x2c1658,_0x3b233b,_0xee3f33)),_0x12dd17;}export function validateJourneyDef(_0xc7823c,_0x467db7={}){const _0x4a93d7=a108_0x18dc,_0x413f31=[],_0x563b82=[];(!_0xc7823c[_0x4a93d7(0x153)]||_0xc7823c[_0x4a93d7(0x153)][_0x4a93d7(0x15a)]()==='')&&_0x413f31[_0x4a93d7(0x17f)]({'level':'error','path':'name','code':_0x4a93d7(0x1a2),'message':_0x4a93d7(0x130),'location':getLocationFromPath(_0x467db7[_0x4a93d7(0x1a1)],_0x467db7[_0x4a93d7(0x196)],['name'])});const _0x38793a=new Set();if(_0xc7823c[_0x4a93d7(0x193)])for(const _0x226803 of Object[_0x4a93d7(0x139)](_0xc7823c['segments'])){_0x38793a['add'](_0x226803);}const _0x1c33ab=new Set();if(_0xc7823c[_0x4a93d7(0x18f)])for(const _0x29cda2 of Object[_0x4a93d7(0x139)](_0xc7823c[_0x4a93d7(0x18f)])){_0x1c33ab['add'](_0x29cda2);}const _0x3afd30=new Set(),_0x53eec8={..._0x467db7,'embeddedSegments':_0x38793a,'referencedSegments':_0x3afd30,'activationKeys':_0x1c33ab[_0x4a93d7(0x16e)]>0x0?_0x1c33ab:undefined};if(_0xc7823c[_0x4a93d7(0x193)])for(const [_0x2d03e9,_0xe0d406]of Object[_0x4a93d7(0x160)](_0xc7823c[_0x4a93d7(0x193)])){const _0x57e40e=validateEmbeddedSegment(_0xe0d406,_0x4a93d7(0x192)+_0x2d03e9,_0x53eec8);for(const _0x1b25c8 of _0x57e40e){if(_0x1b25c8[_0x4a93d7(0x18e)]==='error')_0x413f31[_0x4a93d7(0x17f)](_0x1b25c8);else _0x563b82[_0x4a93d7(0x17f)](_0x1b25c8);}}const _0x2987e7=getJourneyStages(_0xc7823c);_0x2987e7[_0x4a93d7(0x15f)]===0x0&&_0x413f31[_0x4a93d7(0x17f)]({'level':_0x4a93d7(0x178),'path':_0x4a93d7(0x12e),'code':'MISSING_STAGES','message':_0x4a93d7(0x161),'location':getLocationFromPath(_0x467db7['document'],_0x467db7[_0x4a93d7(0x196)],[_0x4a93d7(0x12e)])});const _0x283f32=new Set();for(const _0x83cb5e of _0x2987e7){if(_0x83cb5e[_0x4a93d7(0x17e)])for(const _0xd53546 of _0x83cb5e[_0x4a93d7(0x17e)]){_0xd53546[_0x4a93d7(0x153)]&&_0x283f32['add'](_0xd53546[_0x4a93d7(0x153)]);}}_0x53eec8[_0x4a93d7(0x1b0)]=_0x283f32;if(_0x2987e7[_0x4a93d7(0x15f)]>0x0){const _0x316084=validateJourneyStructure(_0xc7823c,_0x2987e7,_0x53eec8);for(const _0x5e173e of _0x316084){if(_0x5e173e[_0x4a93d7(0x18e)]===_0x4a93d7(0x178))_0x413f31[_0x4a93d7(0x17f)](_0x5e173e);else _0x563b82[_0x4a93d7(0x17f)](_0x5e173e);}}for(let _0x3df591=0x0;_0x3df591<_0x2987e7[_0x4a93d7(0x15f)];_0x3df591++){const _0x5b1a17=validateStage(_0x2987e7[_0x3df591],_0x3df591,_0x2987e7[_0x4a93d7(0x15f)],_0x53eec8);for(const _0x3d0186 of _0x5b1a17){if(_0x3d0186[_0x4a93d7(0x18e)]==='error')_0x413f31['push'](_0x3d0186);else _0x563b82['push'](_0x3d0186);}}if(_0xc7823c['goal']){const _0x2e0b73=validateCriteria(_0xc7823c['goal'],_0x4a93d7(0x137),_0x53eec8);for(const _0x1eef25 of _0x2e0b73){if(_0x1eef25[_0x4a93d7(0x18e)]==='error')_0x413f31[_0x4a93d7(0x17f)](_0x1eef25);else _0x563b82[_0x4a93d7(0x17f)](_0x1eef25);}}for(const _0xef5cf7 of _0x38793a){!_0x3afd30['has'](_0xef5cf7)&&!_0xef5cf7[_0x4a93d7(0x1ab)]('excluded_')&&_0x563b82[_0x4a93d7(0x17f)]({'level':_0x4a93d7(0x1aa),'path':_0x4a93d7(0x192)+_0xef5cf7,'code':_0x4a93d7(0x15e),'message':'Embedded\x20segment\x20\x27'+_0xef5cf7+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x467db7['document'],_0x467db7['source'],[_0x4a93d7(0x193),_0xef5cf7])});}return{'valid':_0x413f31[_0x4a93d7(0x15f)]===0x0,'errors':_0x413f31,'warnings':_0x563b82};}
1
+ (function(_0x357de3,_0x1b985c){const _0x2b2a78=a108_0x2a91,_0x5595ce=_0x357de3();while(!![]){try{const _0x488f2b=parseInt(_0x2b2a78(0x1cf))/0x1+parseInt(_0x2b2a78(0x1c4))/0x2+parseInt(_0x2b2a78(0x1eb))/0x3+-parseInt(_0x2b2a78(0x1e5))/0x4*(parseInt(_0x2b2a78(0x1dc))/0x5)+-parseInt(_0x2b2a78(0x20a))/0x6+parseInt(_0x2b2a78(0x1e9))/0x7+-parseInt(_0x2b2a78(0x205))/0x8;if(_0x488f2b===_0x1b985c)break;else _0x5595ce['push'](_0x5595ce['shift']());}catch(_0xbed09){_0x5595ce['push'](_0x5595ce['shift']());}}}(a108_0x40c9,0xe792c));import{getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function a108_0x2a91(_0x3f9e33,_0xa66060){_0x3f9e33=_0x3f9e33-0x193;const _0x40c9b6=a108_0x40c9();let _0x2a91ca=_0x40c9b6[_0x3f9e33];return _0x2a91ca;}function createIssue(_0x2c32f1,_0xac0a80,_0x576f58,_0x47ac02,_0x217153,_0x51db39){const _0x39a8fa=a108_0x2a91;return{'level':_0x2c32f1,'path':_0xac0a80,'code':_0x576f58,'message':_0x47ac02,'location':getLocationFromPath(_0x217153[_0x39a8fa(0x214)],_0x217153[_0x39a8fa(0x222)],pathToArray(_0x51db39??_0xac0a80))};}function validateJourneyStructure(_0x4af15b,_0xf470f5,_0x1b127e){const _0x27a277=a108_0x2a91,_0xf467a3=[];return _0xf470f5[_0x27a277(0x1bf)]>MAX_STAGES&&_0xf467a3[_0x27a277(0x218)](createIssue(_0x27a277(0x1e0),_0x27a277(0x1a1),_0x27a277(0x22a),_0x27a277(0x1b1)+_0xf470f5[_0x27a277(0x1bf)]+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x1b127e)),!_0x4af15b[_0x27a277(0x1b0)]&&_0xf467a3[_0x27a277(0x218)](createIssue(_0x27a277(0x1e0),_0x27a277(0x1b0),_0x27a277(0x198),_0x27a277(0x1dd),_0x1b127e)),_0xf467a3;}function validateStageStructure(_0x8d93cc,_0x392dfb,_0x4fc47e,_0xe9bc84){const _0x444794=a108_0x2a91,_0xc76749=[],_0x5a82a3=_0x444794(0x1b8)+_0x392dfb+']';_0x392dfb===0x0&&!_0x8d93cc[_0x444794(0x1c0)]&&_0xc76749[_0x444794(0x218)](createIssue('error',_0x5a82a3+_0x444794(0x21f),_0x444794(0x19e),_0x444794(0x1ee)+_0x8d93cc[_0x444794(0x1d3)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0xe9bc84,_0x5a82a3));const _0x5751be=_0x392dfb===_0x4fc47e-0x1;!_0x5751be&&!_0x8d93cc[_0x444794(0x195)]&&_0xc76749[_0x444794(0x218)](createIssue(_0x444794(0x1e0),_0x5a82a3+'.milestone',_0x444794(0x1c3),'Stage\x20\x27'+_0x8d93cc['name']+_0x444794(0x226),_0xe9bc84,_0x5a82a3));(!_0x8d93cc[_0x444794(0x1a6)]||_0x8d93cc[_0x444794(0x1a6)][_0x444794(0x1bf)]===0x0)&&_0xc76749['push'](createIssue('warning',_0x5a82a3+_0x444794(0x1d4),_0x444794(0x208),_0x444794(0x1ee)+_0x8d93cc[_0x444794(0x1d3)]+_0x444794(0x1fe),_0xe9bc84,_0x5a82a3));const _0x2daa66=_0x8d93cc[_0x444794(0x21c)]?.[_0x444794(0x1bf)]??0x0;if(_0x2daa66<=0x1)_0xc76749[_0x444794(0x218)](createIssue(_0x444794(0x1e0),_0x5a82a3+_0x444794(0x193),_0x444794(0x1bc),_0x444794(0x1ee)+_0x8d93cc['name']+_0x444794(0x224)+_0x2daa66+_0x444794(0x21a),_0xe9bc84,_0x5a82a3+_0x444794(0x193)));else _0x2daa66<=0x3&&_0xc76749[_0x444794(0x218)](createIssue(_0x444794(0x1ae),_0x5a82a3+'.steps',_0x444794(0x1b4),'Stage\x20\x27'+_0x8d93cc['name']+_0x444794(0x212)+_0x2daa66+_0x444794(0x199),_0xe9bc84,_0x5a82a3+_0x444794(0x193)));return _0xc76749;}function validateStep(_0xece993,_0x173e57,_0x166eb0,_0x277f06){const _0x3489c6=a108_0x2a91,_0x4e6613=[];if(_0xece993[_0x3489c6(0x194)]===_0x3489c6(0x1b6))return _0xece993[_0x3489c6(0x1f1)]&&_0x4e6613[_0x3489c6(0x218)](createIssue(_0x3489c6(0x1e0),_0x173e57+_0x3489c6(0x197),_0x3489c6(0x1a7),_0x3489c6(0x1d7)+_0xece993[_0x3489c6(0x1d3)]+_0x3489c6(0x209),_0x166eb0)),_0x3489c6(0x1a8)in _0xece993&&_0xece993[_0x3489c6(0x1a8)]!==undefined&&_0x4e6613['push'](createIssue(_0x3489c6(0x1e0),_0x173e57+_0x3489c6(0x1d1),_0x3489c6(0x1a7),_0x3489c6(0x1d7)+_0xece993['name']+_0x3489c6(0x1be),_0x166eb0)),_0x4e6613;_0xece993[_0x3489c6(0x1f1)]&&(_0x166eb0[_0x3489c6(0x1f5)]&&!_0x166eb0[_0x3489c6(0x1f5)]['has'](_0xece993['next'])&&_0x4e6613[_0x3489c6(0x218)](createIssue('error',_0x173e57+'.next',_0x3489c6(0x1fc),_0x3489c6(0x21b)+_0xece993['next']+'\x27',_0x166eb0)));switch(_0xece993['type']){case _0x3489c6(0x1e4):_0x4e6613[_0x3489c6(0x218)](...validateWaitStep(_0xece993,_0x173e57,_0x166eb0,_0x277f06));break;case _0x3489c6(0x204):_0x4e6613[_0x3489c6(0x218)](...validateActivationStep(_0xece993,_0x173e57,_0x166eb0));break;case'decision_point':_0x4e6613['push'](...validateDecisionPointStep(_0xece993,_0x173e57,_0x166eb0,_0x277f06));break;case _0x3489c6(0x1f6):_0x4e6613[_0x3489c6(0x218)](...validateAbTestStep(_0xece993,_0x173e57,_0x166eb0,_0x277f06));break;case _0x3489c6(0x19b):_0x4e6613['push'](...validateJumpStep(_0xece993,_0x173e57,_0x166eb0));break;}return _0x4e6613;}function validateWaitStep(_0x1311ab,_0x1b4357,_0x22b990,_0x402af1){const _0x2936a4=a108_0x2a91,_0x91d9e5=[];if(!_0x1311ab['with'])return _0x91d9e5[_0x2936a4(0x218)](createIssue(_0x2936a4(0x1e0),_0x1b4357+_0x2936a4(0x1d1),_0x2936a4(0x1b2),_0x2936a4(0x1ab),_0x22b990,_0x1b4357)),_0x91d9e5;if(_0x1311ab[_0x2936a4(0x1a8)][_0x2936a4(0x1ce)]){const _0x927fa7=_0x1311ab[_0x2936a4(0x1a8)]['condition'];if(_0x927fa7[_0x2936a4(0x1af)]){_0x22b990['referencedSegments']?.[_0x2936a4(0x1d5)](_0x927fa7[_0x2936a4(0x1af)]);!_0x927fa7['segment'][_0x2936a4(0x19d)]('ref:')&&(_0x22b990[_0x2936a4(0x1d9)]&&!_0x22b990[_0x2936a4(0x1d9)][_0x2936a4(0x1e2)](_0x927fa7['segment'])&&_0x91d9e5[_0x2936a4(0x218)](createIssue('error',_0x1b4357+_0x2936a4(0x1b3),_0x2936a4(0x22b),_0x2936a4(0x1b9)+_0x927fa7['segment']+_0x2936a4(0x1d0),_0x22b990)));_0x927fa7[_0x2936a4(0x1f1)]&&_0x22b990[_0x2936a4(0x1f5)]&&!_0x22b990['stepNames']['has'](_0x927fa7[_0x2936a4(0x1f1)])&&_0x91d9e5[_0x2936a4(0x218)](createIssue('error',_0x1b4357+_0x2936a4(0x1f7),_0x2936a4(0x1fc),'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x927fa7[_0x2936a4(0x1f1)]+'\x27',_0x22b990));_0x927fa7[_0x2936a4(0x1f2)]?.[_0x2936a4(0x1f1)]&&_0x22b990[_0x2936a4(0x1f5)]&&!_0x22b990[_0x2936a4(0x1f5)][_0x2936a4(0x1e2)](_0x927fa7[_0x2936a4(0x1f2)][_0x2936a4(0x1f1)])&&_0x91d9e5[_0x2936a4(0x218)](createIssue(_0x2936a4(0x1e0),_0x1b4357+_0x2936a4(0x22d),_0x2936a4(0x1fc),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x927fa7[_0x2936a4(0x1f2)][_0x2936a4(0x1f1)]+'\x27',_0x22b990));const _0x57af19=_0x927fa7[_0x2936a4(0x1f1)]||_0x1311ab[_0x2936a4(0x1f1)],_0x452b34=_0x927fa7['timeout']?.[_0x2936a4(0x1f1)]||_0x1311ab[_0x2936a4(0x1f1)];if(_0x57af19){const _0xcb4543=_0x402af1[_0x2936a4(0x1f8)](_0x57af19);_0xcb4543?.[_0x2936a4(0x194)]===_0x2936a4(0x1a9)&&_0x91d9e5['push'](createIssue(_0x2936a4(0x1e0),_0x1b4357+_0x2936a4(0x1f7),_0x2936a4(0x1ad),_0x2936a4(0x229)+_0x57af19+_0x2936a4(0x216),_0x22b990,_0x1b4357+_0x2936a4(0x1a0)));}if(_0x452b34){const _0x15a613=_0x402af1[_0x2936a4(0x1f8)](_0x452b34);_0x15a613?.['type']==='merge'&&_0x91d9e5[_0x2936a4(0x218)](createIssue(_0x2936a4(0x1e0),_0x1b4357+'.with.condition.timeout.next',_0x2936a4(0x1ad),_0x2936a4(0x1df)+_0x452b34+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x22b990,_0x1b4357+_0x2936a4(0x227)));}}}return _0x91d9e5;}function validateActivationStep(_0x5ab6a9,_0x266c0d,_0x3565d1){const _0x513f93=a108_0x2a91,_0x321026=[];if(!_0x5ab6a9[_0x513f93(0x1a8)]?.[_0x513f93(0x204)])return _0x321026[_0x513f93(0x218)](createIssue('error',_0x266c0d+'.with.activation',_0x513f93(0x1c9),_0x513f93(0x1ca),_0x3565d1,_0x266c0d)),_0x321026;const _0x1d5629=_0x5ab6a9[_0x513f93(0x1a8)][_0x513f93(0x204)];return _0x3565d1[_0x513f93(0x1bb)]&&!_0x1d5629[_0x513f93(0x19d)](_0x513f93(0x206))&&(!_0x3565d1[_0x513f93(0x1bb)][_0x513f93(0x1e2)](_0x1d5629)&&_0x321026[_0x513f93(0x218)](createIssue(_0x513f93(0x1e0),_0x266c0d+_0x513f93(0x21d),_0x513f93(0x1a4),_0x513f93(0x1b7)+_0x1d5629+_0x513f93(0x1f0),_0x3565d1))),_0x321026;}function validateDecisionPointStep(_0xc174ce,_0x2e9612,_0x35c6e3,_0x2a794d){const _0xf672cd=a108_0x2a91,_0x5eddfe=[];if(!_0xc174ce['with']?.[_0xf672cd(0x19a)]||_0xc174ce[_0xf672cd(0x1a8)][_0xf672cd(0x19a)][_0xf672cd(0x1bf)]===0x0)return _0x5eddfe[_0xf672cd(0x218)](createIssue('error',_0x2e9612+'.with.branches',_0xf672cd(0x20f),_0xf672cd(0x1f9),_0x35c6e3,_0x2e9612)),_0x5eddfe;for(let _0x2cf6d2=0x0;_0x2cf6d2<_0xc174ce[_0xf672cd(0x1a8)]['branches'][_0xf672cd(0x1bf)];_0x2cf6d2++){const _0x390c0d=_0xc174ce[_0xf672cd(0x1a8)][_0xf672cd(0x19a)][_0x2cf6d2],_0x4241a1=_0x2e9612+_0xf672cd(0x1ff)+_0x2cf6d2+']';_0x390c0d[_0xf672cd(0x1af)]&&!_0x390c0d[_0xf672cd(0x1fd)]&&(_0x35c6e3[_0xf672cd(0x20d)]?.[_0xf672cd(0x1d5)](_0x390c0d[_0xf672cd(0x1af)]),!_0x390c0d['segment'][_0xf672cd(0x19d)](_0xf672cd(0x206))&&(_0x35c6e3['embeddedSegments']&&!_0x35c6e3[_0xf672cd(0x1d9)][_0xf672cd(0x1e2)](_0x390c0d[_0xf672cd(0x1af)])&&_0x5eddfe[_0xf672cd(0x218)](createIssue(_0xf672cd(0x1e0),_0x4241a1+'.segment',_0xf672cd(0x22b),'Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x390c0d['segment']+'\x27',_0x35c6e3))));_0x390c0d[_0xf672cd(0x1f1)]&&_0x35c6e3['stepNames']&&!_0x35c6e3[_0xf672cd(0x1f5)][_0xf672cd(0x1e2)](_0x390c0d[_0xf672cd(0x1f1)])&&_0x5eddfe['push'](createIssue(_0xf672cd(0x1e0),_0x4241a1+'.next',_0xf672cd(0x1fc),_0xf672cd(0x1f4)+_0x390c0d[_0xf672cd(0x1f1)]+'\x27',_0x35c6e3));if(_0x390c0d[_0xf672cd(0x1f1)]){const _0x561f65=_0x2a794d['get'](_0x390c0d[_0xf672cd(0x1f1)]);_0x561f65?.['type']===_0xf672cd(0x1a9)&&_0x5eddfe[_0xf672cd(0x218)](createIssue('error',_0x4241a1+_0xf672cd(0x197),_0xf672cd(0x1ad),_0xf672cd(0x1c2)+_0x390c0d[_0xf672cd(0x1d3)]+_0xf672cd(0x1a2)+_0x390c0d[_0xf672cd(0x1f1)]+_0xf672cd(0x19f),_0x35c6e3));}}return _0x5eddfe;}function validateAbTestStep(_0x4909fc,_0x19bd67,_0x209a37,_0x1096c2){const _0x7972f7=a108_0x2a91,_0x21d7fc=[];if(!_0x4909fc[_0x7972f7(0x1a8)]?.['variants']||_0x4909fc[_0x7972f7(0x1a8)][_0x7972f7(0x1da)][_0x7972f7(0x1bf)]===0x0)return _0x21d7fc['push'](createIssue(_0x7972f7(0x1e0),_0x19bd67+_0x7972f7(0x20c),_0x7972f7(0x20f),_0x7972f7(0x200),_0x209a37,_0x19bd67)),_0x21d7fc;const _0x456594=_0x4909fc['with'][_0x7972f7(0x1da)][_0x7972f7(0x1cb)]((_0x686140,_0x36d2a5)=>_0x686140+(_0x36d2a5[_0x7972f7(0x221)]||0x0),0x0);Math['abs'](_0x456594-0x64)>0.01&&_0x21d7fc['push'](createIssue(_0x7972f7(0x1e0),_0x19bd67+_0x7972f7(0x20c),'INVALID_AB_TEST_PERCENTAGES',_0x7972f7(0x228)+_0x456594+'%)',_0x209a37));for(let _0x34c782=0x0;_0x34c782<_0x4909fc[_0x7972f7(0x1a8)]['variants']['length'];_0x34c782++){const _0x8c02f2=_0x4909fc[_0x7972f7(0x1a8)]['variants'][_0x34c782],_0x3890cc=_0x19bd67+_0x7972f7(0x1c6)+_0x34c782+']';_0x8c02f2[_0x7972f7(0x1f1)]&&_0x209a37[_0x7972f7(0x1f5)]&&!_0x209a37[_0x7972f7(0x1f5)]['has'](_0x8c02f2[_0x7972f7(0x1f1)])&&_0x21d7fc[_0x7972f7(0x218)](createIssue(_0x7972f7(0x1e0),_0x3890cc+_0x7972f7(0x197),_0x7972f7(0x1fc),_0x7972f7(0x1ec)+_0x8c02f2[_0x7972f7(0x1f1)]+'\x27',_0x209a37));if(_0x8c02f2[_0x7972f7(0x1f1)]){const _0x26e118=_0x1096c2[_0x7972f7(0x1f8)](_0x8c02f2[_0x7972f7(0x1f1)]);_0x26e118?.['type']==='merge'&&_0x21d7fc[_0x7972f7(0x218)](createIssue(_0x7972f7(0x1e0),_0x3890cc+_0x7972f7(0x197),_0x7972f7(0x1ad),_0x7972f7(0x1c7)+_0x8c02f2[_0x7972f7(0x1d3)]+_0x7972f7(0x1a2)+_0x8c02f2[_0x7972f7(0x1f1)]+_0x7972f7(0x19f),_0x209a37));}}return _0x21d7fc;}function validateJumpStep(_0x8b05a1,_0x3d4e3c,_0x94279e){const _0x35174c=a108_0x2a91,_0x3625ad=[];if(!_0x8b05a1[_0x35174c(0x1a8)]?.[_0x35174c(0x1e7)])return _0x3625ad[_0x35174c(0x218)](createIssue(_0x35174c(0x1e0),_0x3d4e3c+'.with.target',_0x35174c(0x1db),_0x35174c(0x1a5),_0x94279e,_0x3d4e3c)),_0x3625ad;return(!_0x8b05a1['with'][_0x35174c(0x1e7)][_0x35174c(0x223)]||!_0x8b05a1['with'][_0x35174c(0x1e7)]['stage'])&&_0x3625ad[_0x35174c(0x218)](createIssue(_0x35174c(0x1e0),_0x3d4e3c+'.with.target',_0x35174c(0x1db),_0x35174c(0x1fb),_0x94279e)),_0x3625ad;}function buildConvergenceMap(_0x414784){const _0x34e7ff=a108_0x2a91,_0x59d936=new Map();function _0x1324cd(_0x53a273,_0x4851ed){const _0x571d3e=a108_0x2a91,_0x453380=_0x59d936[_0x571d3e(0x1f8)](_0x53a273)||[];_0x453380['push'](_0x4851ed),_0x59d936[_0x571d3e(0x21e)](_0x53a273,_0x453380);}for(const _0x172c12 of _0x414784){_0x172c12[_0x34e7ff(0x1f1)]&&_0x1324cd(_0x172c12['next'],{'stepName':_0x172c12[_0x34e7ff(0x1d3)],'description':_0x34e7ff(0x207)+_0x172c12[_0x34e7ff(0x1d3)]+'\x27'});if(_0x172c12[_0x34e7ff(0x194)]==='decision_point'&&_0x172c12['with']?.[_0x34e7ff(0x19a)])for(const _0x68e053 of _0x172c12['with'][_0x34e7ff(0x19a)]){_0x68e053[_0x34e7ff(0x1f1)]&&_0x1324cd(_0x68e053['next'],{'stepName':_0x172c12[_0x34e7ff(0x1d3)],'description':_0x34e7ff(0x210)+_0x68e053[_0x34e7ff(0x1d3)]+_0x34e7ff(0x1e6)+_0x172c12['name']+'\x27'});}if(_0x172c12['type']===_0x34e7ff(0x1f6)&&_0x172c12[_0x34e7ff(0x1a8)]?.[_0x34e7ff(0x1da)])for(const _0x27d244 of _0x172c12[_0x34e7ff(0x1a8)][_0x34e7ff(0x1da)]){_0x27d244[_0x34e7ff(0x1f1)]&&_0x1324cd(_0x27d244[_0x34e7ff(0x1f1)],{'stepName':_0x172c12[_0x34e7ff(0x1d3)],'description':'variant\x20\x27'+_0x27d244[_0x34e7ff(0x1d3)]+_0x34e7ff(0x1e6)+_0x172c12[_0x34e7ff(0x1d3)]+'\x27'});}_0x172c12[_0x34e7ff(0x194)]===_0x34e7ff(0x1e4)&&_0x172c12['with']?.[_0x34e7ff(0x1ce)]&&(_0x172c12['with'][_0x34e7ff(0x1ce)][_0x34e7ff(0x1f1)]&&_0x1324cd(_0x172c12[_0x34e7ff(0x1a8)]['condition'][_0x34e7ff(0x1f1)],{'stepName':_0x172c12['name'],'description':_0x34e7ff(0x19c)+_0x172c12[_0x34e7ff(0x1d3)]+'\x27'}),_0x172c12['with'][_0x34e7ff(0x1ce)][_0x34e7ff(0x1f2)]?.[_0x34e7ff(0x1f1)]&&_0x1324cd(_0x172c12[_0x34e7ff(0x1a8)][_0x34e7ff(0x1ce)][_0x34e7ff(0x1f2)][_0x34e7ff(0x1f1)],{'stepName':_0x172c12['name'],'description':'timeout\x20of\x20\x27'+_0x172c12['name']+'\x27'}));}return _0x59d936;}function validateFlowControl(_0x36a19a,_0x232f1b,_0x1f471d){const _0x2392ac=a108_0x2a91,_0x236638=[],_0x325899=_0x2392ac(0x1b8)+_0x232f1b+']',_0xe0757e=_0x36a19a['steps']||[];if(_0xe0757e['length']===0x0)return _0x236638;const _0xdb7f82=new Map();for(const _0x3f4e64 of _0xe0757e){_0x3f4e64['name']&&_0xdb7f82[_0x2392ac(0x21e)](_0x3f4e64[_0x2392ac(0x1d3)],_0x3f4e64);}const _0x21bf35=buildConvergenceMap(_0xe0757e),_0x364977=_0xe0757e['some'](_0x41ae4d=>_0x41ae4d[_0x2392ac(0x194)]==='end');!_0x364977&&_0x236638[_0x2392ac(0x218)](createIssue(_0x2392ac(0x1e0),_0x325899+_0x2392ac(0x193),_0x2392ac(0x215),'Stage\x20\x27'+_0x36a19a[_0x2392ac(0x1d3)]+_0x2392ac(0x225),_0x1f471d));for(const [_0x3b7671,_0x1286d0]of _0x21bf35){const _0xd57264=_0xdb7f82['get'](_0x3b7671);if(!_0xd57264)continue;if(_0x1286d0['length']>0x1&&_0xd57264['type']!==_0x2392ac(0x1a9)){const _0x1425b7=_0x1286d0[_0x2392ac(0x1bd)](_0x5df5d6=>_0x5df5d6[_0x2392ac(0x201)])[_0x2392ac(0x20e)](',\x20');_0x236638[_0x2392ac(0x218)](createIssue('error',_0x325899+_0x2392ac(0x193),_0x2392ac(0x1ed),_0x2392ac(0x1a3)+_0x3b7671+'\x27\x20(from:\x20'+_0x1425b7+_0x2392ac(0x203),_0x1f471d));}_0x1286d0[_0x2392ac(0x1bf)]===0x1&&_0xd57264[_0x2392ac(0x194)]===_0x2392ac(0x1a9)&&_0x236638[_0x2392ac(0x218)](createIssue('warning',_0x325899+_0x2392ac(0x193),_0x2392ac(0x1e1),'Merge\x20step\x20\x27'+_0x3b7671+_0x2392ac(0x1ba)+_0x1286d0[0x0][_0x2392ac(0x201)]+_0x2392ac(0x1d2),_0x1f471d));}for(const _0x154227 of _0xe0757e){if(_0x154227[_0x2392ac(0x194)]==='merge'&&_0x154227[_0x2392ac(0x1f1)]){const _0x4dba23=_0xdb7f82[_0x2392ac(0x1f8)](_0x154227[_0x2392ac(0x1f1)]);_0x4dba23?.['type']===_0x2392ac(0x1a9)&&_0x236638[_0x2392ac(0x218)](createIssue(_0x2392ac(0x1e0),_0x325899+_0x2392ac(0x193),'MERGE_TO_MERGE_CHAIN',_0x2392ac(0x213)+_0x154227[_0x2392ac(0x1d3)]+_0x2392ac(0x219)+_0x154227[_0x2392ac(0x1f1)]+_0x2392ac(0x1b5),_0x1f471d));}}return _0x236638;}function validateCriteria(_0x3abc25,_0x327475,_0x14e640){const _0x1ca1f0=a108_0x2a91,_0x849227=[];return _0x3abc25['segment']&&(_0x14e640['referencedSegments']?.[_0x1ca1f0(0x1d5)](_0x3abc25[_0x1ca1f0(0x1af)]),!_0x3abc25[_0x1ca1f0(0x1af)]['startsWith']('ref:')&&(_0x14e640['embeddedSegments']&&!_0x14e640[_0x1ca1f0(0x1d9)][_0x1ca1f0(0x1e2)](_0x3abc25['segment'])&&_0x849227[_0x1ca1f0(0x218)](createIssue(_0x1ca1f0(0x1e0),_0x327475+_0x1ca1f0(0x217),_0x1ca1f0(0x22b),_0x1ca1f0(0x1de)+_0x3abc25[_0x1ca1f0(0x1af)]+'\x27',_0x14e640)))),_0x849227;}function validateEmbeddedSegment(_0x554f32,_0x3c5005,_0x5f34e1){const _0x24e800=a108_0x2a91,_0x137c22=[];return _0x554f32[_0x24e800(0x1cd)]&&_0x137c22[_0x24e800(0x218)](...validateRuleDef(_0x554f32[_0x24e800(0x1cd)],_0x3c5005+'.rule',_0x5f34e1)),_0x137c22;}function getJourneyStages(_0xa39cff){const _0x368683=a108_0x2a91;if(_0xa39cff['stages']&&_0xa39cff[_0x368683(0x1a1)][_0x368683(0x1bf)]>0x0)return _0xa39cff[_0x368683(0x1a1)];if(_0xa39cff['journeys']&&_0xa39cff[_0x368683(0x1c5)][_0x368683(0x1bf)]>0x0)return _0xa39cff[_0x368683(0x1c5)]['flatMap'](_0xc187d7=>_0xc187d7[_0x368683(0x1a1)]||[]);if(_0xa39cff[_0x368683(0x220)]&&_0xa39cff[_0x368683(0x220)][_0x368683(0x1bf)]>0x0)return _0xa39cff[_0x368683(0x220)]['flatMap'](_0x5420a9=>_0x5420a9['stages']||[]);return[];}function validateStage(_0x122d81,_0x21ed09,_0x38fa8b,_0xf1146a){const _0x2aa09c=a108_0x2a91,_0x2a2401=[],_0x529fc8=_0x2aa09c(0x1b8)+_0x21ed09+']',_0x32267d=new Map(),_0x39188c=new Map();if(_0x122d81['steps']){for(let _0x290402=0x0;_0x290402<_0x122d81['steps'][_0x2aa09c(0x1bf)];_0x290402++){const _0x17a5ed=_0x122d81[_0x2aa09c(0x21c)][_0x290402];_0x17a5ed[_0x2aa09c(0x1d3)]&&_0x32267d[_0x2aa09c(0x21e)](_0x17a5ed[_0x2aa09c(0x1d3)],_0x17a5ed);}for(let _0x4fcecd=0x0;_0x4fcecd<_0x122d81['steps'][_0x2aa09c(0x1bf)];_0x4fcecd++){const _0x174b68=_0x122d81[_0x2aa09c(0x21c)][_0x4fcecd],_0x1bce23=_0x529fc8+_0x2aa09c(0x1ac)+_0x4fcecd+']';if(_0x174b68[_0x2aa09c(0x1d3)]){if(_0x39188c[_0x2aa09c(0x1e2)](_0x174b68['name'])){const _0x775d53=_0x39188c[_0x2aa09c(0x1f8)](_0x174b68['name']);_0x2a2401[_0x2aa09c(0x218)](createIssue(_0x2aa09c(0x1e0),_0x1bce23+_0x2aa09c(0x1ea),'DUPLICATE_STEP_NAME',_0x2aa09c(0x1d8)+_0x174b68[_0x2aa09c(0x1d3)]+_0x2aa09c(0x1d6)+_0x775d53+'])',_0xf1146a));}else _0x39188c[_0x2aa09c(0x21e)](_0x174b68[_0x2aa09c(0x1d3)],_0x4fcecd);}_0x2a2401[_0x2aa09c(0x218)](...validateStep(_0x174b68,_0x1bce23,_0xf1146a,_0x32267d));}}_0x122d81[_0x2aa09c(0x1c0)]&&_0x2a2401['push'](...validateCriteria(_0x122d81[_0x2aa09c(0x1c0)],_0x529fc8+_0x2aa09c(0x21f),_0xf1146a));if(_0x122d81[_0x2aa09c(0x1a6)])for(let _0x557444=0x0;_0x557444<_0x122d81[_0x2aa09c(0x1a6)][_0x2aa09c(0x1bf)];_0x557444++){_0x2a2401[_0x2aa09c(0x218)](...validateCriteria(_0x122d81['exit_criteria'][_0x557444],_0x529fc8+_0x2aa09c(0x1c1)+_0x557444+']',_0xf1146a));}return _0x122d81['milestone']&&_0x2a2401[_0x2aa09c(0x218)](...validateCriteria(_0x122d81[_0x2aa09c(0x195)],_0x529fc8+_0x2aa09c(0x22c),_0xf1146a)),_0x2a2401[_0x2aa09c(0x218)](...validateStageStructure(_0x122d81,_0x21ed09,_0x38fa8b,_0xf1146a)),_0x2a2401[_0x2aa09c(0x218)](...validateFlowControl(_0x122d81,_0x21ed09,_0xf1146a)),_0x2a2401;}function a108_0x40c9(){const _0x446e89=['length','entry_criteria','.exit_criteria[','Decision\x20branch\x20\x27','MISSING_MILESTONE','2498598KuAeeE','journeys','.with.variants[','A/B\x20test\x20variant\x20\x27','entries','MISSING_ACTIVATION_REF','Activation\x20step\x20requires\x20an\x20activation\x20reference','reduce','segments','rule','condition','1051865rFBWEm','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','.with',').\x20Merge\x20is\x20unnecessary.','name','.exit_criteria','add','\x27\x20(first\x20defined\x20at\x20steps[','End\x20step\x20\x27','Duplicate\x20step\x20name\x20\x27','embeddedSegments','variants','INVALID_JUMP_TARGET','4558445KaqiwN','Journey\x20must\x20have\x20a\x20goal\x20defined','Criteria\x20references\x20undefined\x20segment\x20\x27','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','error','SINGLE_INPUT_MERGE','has','level','wait','8YYGBxC','\x27\x20of\x20\x27','target','size','13041574RTkPRW','.name','2337453NUZpyf','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','CONVERGENCE_WITHOUT_MERGE','Stage\x20\x27','segments.','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','next','timeout','Embedded\x20segment\x20\x27','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','stepNames','ab_test','.with.condition.next','get','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','MISSING_STAGES','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','INVALID_NEXT_REFERENCE','excluded','\x27\x20has\x20no\x20exit_criteria\x20defined','.with.branches[','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','description','MISSING_NAME',').\x20Use\x20a\x20merge\x20step.','activation','4669352iaLASd','ref:','step\x20\x27','MISSING_EXIT_CRITERIA','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','9526956kyLoQu','keys','.with.variants','referencedSegments','join','MISSING_CONDITIONS','branch\x20\x27','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','\x27\x20has\x20only\x20','Merge\x20step\x20\x27','document','MISSING_END_STEP','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','.segment','push','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','\x20step(s)\x20but\x20needs\x20at\x20least\x202','Step\x20references\x20non-existent\x20step\x20\x27','steps','.with.activation','set','.entry_criteria','versions','percentage','source','journey','\x27\x20has\x20','\x27\x20has\x20no\x20end\x20step','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','.with.condition.timeout','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','TOO_MANY_STAGES','MISSING_SEGMENT_REFERENCE','.milestone','.with.condition.timeout.next','.steps','type','milestone','activations','.next','MISSING_GOAL','\x20steps\x20(may\x20be\x20too\x20simple)','branches','jump','condition\x20of\x20\x27','startsWith','MISSING_ENTRY_CRITERIA','\x27\x20with\x20no\x20action\x20in\x20between','.with.condition','stages','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','MISSING_ACTIVATION_DEFINITION','Jump\x20step\x20requires\x20a\x20target','exit_criteria','END_STEP_HAS_NEXT_OR_WITH','with','merge','Journey\x20name\x20is\x20required','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','.steps[','BRANCH_DIRECTLY_TO_MERGE','warning','segment','goal','Journey\x20has\x20','MISSING_WAIT_PARAMS','.with.condition.segment','FEW_STEPS','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','end','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','stages[','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','activationKeys','INSUFFICIENT_STEPS','map','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field'];a108_0x40c9=function(){return _0x446e89;};return a108_0x40c9();}export function validateJourneyDef(_0x42e014,_0x3813f4={}){const _0x1e94dd=a108_0x2a91,_0x153363=[],_0x5b4c37=[];(!_0x42e014['name']||_0x42e014[_0x1e94dd(0x1d3)]['trim']()==='')&&_0x153363['push']({'level':_0x1e94dd(0x1e0),'path':'name','code':_0x1e94dd(0x202),'message':_0x1e94dd(0x1aa),'location':getLocationFromPath(_0x3813f4[_0x1e94dd(0x214)],_0x3813f4[_0x1e94dd(0x222)],[_0x1e94dd(0x1d3)])});const _0x5cfbdb=new Set();if(_0x42e014['segments'])for(const _0x457315 of Object[_0x1e94dd(0x20b)](_0x42e014[_0x1e94dd(0x1cc)])){_0x5cfbdb['add'](_0x457315);}const _0x186f42=new Set();if(_0x42e014[_0x1e94dd(0x196)])for(const _0x2995e1 of Object[_0x1e94dd(0x20b)](_0x42e014[_0x1e94dd(0x196)])){_0x186f42['add'](_0x2995e1);}const _0x5cb72e=new Set(),_0x6d2eed={..._0x3813f4,'embeddedSegments':_0x5cfbdb,'referencedSegments':_0x5cb72e,'activationKeys':_0x186f42[_0x1e94dd(0x1e8)]>0x0?_0x186f42:undefined};if(_0x42e014[_0x1e94dd(0x1cc)])for(const [_0xd79104,_0x438bb3]of Object[_0x1e94dd(0x1c8)](_0x42e014[_0x1e94dd(0x1cc)])){const _0x42bd16=validateEmbeddedSegment(_0x438bb3,_0x1e94dd(0x1ef)+_0xd79104,_0x6d2eed);for(const _0x3c8fb2 of _0x42bd16){if(_0x3c8fb2[_0x1e94dd(0x1e3)]===_0x1e94dd(0x1e0))_0x153363[_0x1e94dd(0x218)](_0x3c8fb2);else _0x5b4c37[_0x1e94dd(0x218)](_0x3c8fb2);}}const _0x2aa17a=getJourneyStages(_0x42e014);_0x2aa17a[_0x1e94dd(0x1bf)]===0x0&&_0x153363[_0x1e94dd(0x218)]({'level':'error','path':_0x1e94dd(0x1a1),'code':_0x1e94dd(0x1fa),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x3813f4[_0x1e94dd(0x214)],_0x3813f4[_0x1e94dd(0x222)],[_0x1e94dd(0x1a1)])});const _0x5d1cea=new Set();for(const _0x9f5395 of _0x2aa17a){if(_0x9f5395[_0x1e94dd(0x21c)])for(const _0x71384e of _0x9f5395[_0x1e94dd(0x21c)]){_0x71384e['name']&&_0x5d1cea[_0x1e94dd(0x1d5)](_0x71384e[_0x1e94dd(0x1d3)]);}}_0x6d2eed[_0x1e94dd(0x1f5)]=_0x5d1cea;if(_0x2aa17a[_0x1e94dd(0x1bf)]>0x0){const _0x493d85=validateJourneyStructure(_0x42e014,_0x2aa17a,_0x6d2eed);for(const _0x380da5 of _0x493d85){if(_0x380da5[_0x1e94dd(0x1e3)]===_0x1e94dd(0x1e0))_0x153363[_0x1e94dd(0x218)](_0x380da5);else _0x5b4c37[_0x1e94dd(0x218)](_0x380da5);}}for(let _0x1a7ff8=0x0;_0x1a7ff8<_0x2aa17a[_0x1e94dd(0x1bf)];_0x1a7ff8++){const _0x5c5886=validateStage(_0x2aa17a[_0x1a7ff8],_0x1a7ff8,_0x2aa17a[_0x1e94dd(0x1bf)],_0x6d2eed);for(const _0x14011f of _0x5c5886){if(_0x14011f[_0x1e94dd(0x1e3)]===_0x1e94dd(0x1e0))_0x153363[_0x1e94dd(0x218)](_0x14011f);else _0x5b4c37['push'](_0x14011f);}}if(_0x42e014[_0x1e94dd(0x1b0)]){const _0x228c51=validateCriteria(_0x42e014[_0x1e94dd(0x1b0)],_0x1e94dd(0x1b0),_0x6d2eed);for(const _0x2bc76e of _0x228c51){if(_0x2bc76e[_0x1e94dd(0x1e3)]===_0x1e94dd(0x1e0))_0x153363['push'](_0x2bc76e);else _0x5b4c37[_0x1e94dd(0x218)](_0x2bc76e);}}for(const _0x13a966 of _0x5cfbdb){!_0x5cb72e['has'](_0x13a966)&&!_0x13a966[_0x1e94dd(0x19d)]('excluded_')&&_0x5b4c37[_0x1e94dd(0x218)]({'level':_0x1e94dd(0x1ae),'path':_0x1e94dd(0x1ef)+_0x13a966,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x1e94dd(0x1f3)+_0x13a966+_0x1e94dd(0x211),'location':getLocationFromPath(_0x3813f4[_0x1e94dd(0x214)],_0x3813f4[_0x1e94dd(0x222)],[_0x1e94dd(0x1cc),_0x13a966])});}return{'valid':_0x153363[_0x1e94dd(0x1bf)]===0x0,'errors':_0x153363,'warnings':_0x5b4c37};}
@@ -1 +1 @@
1
- (function(_0x25ee0b,_0x35a212){const _0x36783b=a109_0x34fc,_0x25ddce=_0x25ee0b();while(!![]){try{const _0x392a4b=-parseInt(_0x36783b(0x197))/0x1*(-parseInt(_0x36783b(0xdb))/0x2)+parseInt(_0x36783b(0x146))/0x3*(parseInt(_0x36783b(0x190))/0x4)+-parseInt(_0x36783b(0x131))/0x5*(-parseInt(_0x36783b(0x16d))/0x6)+-parseInt(_0x36783b(0x15a))/0x7+-parseInt(_0x36783b(0x12c))/0x8*(-parseInt(_0x36783b(0xf7))/0x9)+-parseInt(_0x36783b(0xd2))/0xa*(-parseInt(_0x36783b(0x199))/0xb)+-parseInt(_0x36783b(0x139))/0xc;if(_0x392a4b===_0x35a212)break;else _0x25ddce['push'](_0x25ddce['shift']());}catch(_0x379b5c){_0x25ddce['push'](_0x25ddce['shift']());}}}(a109_0x4430,0xa7f62));import*as a109_0x5b586d from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x45bbf9){const _0x570e80=a109_0x34fc,_0x541162=_0x45bbf9[_0x570e80(0x18e)]();if(_0x541162==='days'||_0x541162===_0x570e80(0x186))return _0x570e80(0x186);if(_0x541162===_0x570e80(0x122)||_0x541162===_0x570e80(0x13f))return _0x570e80(0x13f);return _0x45bbf9;}export function journeyResponseToDefSync(_0x5a30df){const _0xf36dd3=a109_0x34fc,_0xbd84fa=_0x5a30df[_0xf36dd3(0x101)],_0xb15b31=_0xbd84fa[_0xf36dd3(0x12e)]||_0xbd84fa[_0xf36dd3(0x12a)],_0x2e3967={'stages':_0xbd84fa[_0xf36dd3(0xff)][_0xf36dd3(0xd0)](convertApiStageToYaml),'id':_0x5a30df['id']};_0xbd84fa[_0xf36dd3(0x12a)]&&_0xbd84fa[_0xf36dd3(0x12a)]!==_0xb15b31&&(_0x2e3967[_0xf36dd3(0x188)]=_0xbd84fa[_0xf36dd3(0x12a)]);_0xbd84fa[_0xf36dd3(0x112)]!==undefined&&(_0x2e3967[_0xf36dd3(0xd7)]=_0xbd84fa[_0xf36dd3(0x112)]);_0xbd84fa[_0xf36dd3(0x19a)]&&(_0x2e3967[_0xf36dd3(0x19a)]=_0xbd84fa['state']===_0xf36dd3(0xf2)?_0xf36dd3(0xf2):_0xf36dd3(0x106));const _0x868bb6={'type':_0xf36dd3(0xc9),'name':_0xb15b31,'journeys':[_0x2e3967]};_0xbd84fa[_0xf36dd3(0xdf)]&&(_0x868bb6['description']=_0xbd84fa[_0xf36dd3(0xdf)]);_0xbd84fa[_0xf36dd3(0x175)]&&(_0x868bb6[_0xf36dd3(0x175)]=convertApiCriteriaToYaml(_0xbd84fa[_0xf36dd3(0x175)]));if(_0xbd84fa[_0xf36dd3(0x163)])_0x868bb6[_0xf36dd3(0x10b)]=_0xbd84fa['reentryMode'];else _0xbd84fa[_0xf36dd3(0x124)]!==undefined&&(_0x868bb6[_0xf36dd3(0x10b)]=_0xbd84fa['allowReentry']?_0xf36dd3(0x153):_0xf36dd3(0xfd));return _0xbd84fa[_0xf36dd3(0x128)]&&(_0x868bb6[_0xf36dd3(0xd1)]=_0xbd84fa[_0xf36dd3(0x128)]),_0xbd84fa[_0xf36dd3(0x12e)]&&(_0x868bb6[_0xf36dd3(0x173)]=_0xbd84fa['journeyBundleName']),_0x5a30df['relationships']?.[_0xf36dd3(0xde)]?.['data']?.['id']&&(_0x868bb6[_0xf36dd3(0x160)]=_0x5a30df[_0xf36dd3(0xf8)][_0xf36dd3(0xde)]['data']['id']),_0x868bb6;}export async function journeyResponseToDef(_0x403ae6,_0x5b55d5){const _0x511d98=a109_0x34fc,_0x11b084=journeyResponseToDefSync(_0x403ae6);if(!_0x5b55d5)return _0x11b084;const _0x42c51e=new Set();collectSegmentIdsFromJourney(_0x11b084,_0x42c51e);const _0x5c714c=new Set();collectActivationIdsFromJourney(_0x11b084,_0x5c714c);const _0x568afc={},_0x553f77=new Map();for(const _0x4bbd7c of Array[_0x511d98(0x17c)](_0x42c51e)[_0x511d98(0x102)]()){if(_0x5b55d5[_0x511d98(0x100)]){const _0x2eda3d=await _0x5b55d5['resolveSegment'](_0x4bbd7c);if(_0x2eda3d[_0x511d98(0x150)]){_0x553f77[_0x511d98(0x18f)](_0x4bbd7c,_0x2eda3d[_0x511d98(0x12a)]);if(_0x2eda3d[_0x511d98(0x15e)]){const _0x24fb5a={..._0x2eda3d[_0x511d98(0x15e)],'rule':deepSortObject(_0x2eda3d[_0x511d98(0x15e)]['rule'])};_0x568afc[_0x2eda3d[_0x511d98(0x12a)]]=_0x24fb5a;}}else _0x553f77[_0x511d98(0x18f)](_0x4bbd7c,makeSegmentRef(_0x2eda3d['name']));}else{if(_0x5b55d5['resolveSegmentName']){const _0x407f83=await _0x5b55d5[_0x511d98(0x136)](_0x4bbd7c);_0x553f77['set'](_0x4bbd7c,_0x407f83);}}}const _0x1a85a6={},_0x4d8028=new Map();for(const _0x699ee0 of Array[_0x511d98(0x17c)](_0x5c714c)[_0x511d98(0x102)]()){if(_0x5b55d5[_0x511d98(0x141)]){const _0x17c095=await _0x5b55d5[_0x511d98(0x141)](_0x699ee0);_0x17c095[_0x511d98(0x150)]?(_0x4d8028['set'](_0x699ee0,_0x17c095[_0x511d98(0x12a)]),_0x17c095['definition']&&(_0x1a85a6[_0x17c095[_0x511d98(0x12a)]]=_0x17c095[_0x511d98(0x15e)])):_0x4d8028[_0x511d98(0x18f)](_0x699ee0,makeSegmentRef(_0x17c095[_0x511d98(0x12a)]));}else{if(_0x5b55d5['resolveActivationName']){const _0x5964c8=await _0x5b55d5[_0x511d98(0x198)](_0x699ee0);_0x4d8028[_0x511d98(0x18f)](_0x699ee0,_0x5964c8);}}}_0x553f77[_0x511d98(0xfe)]>0x0&&replaceSegmentIdsInJourney(_0x11b084,_0x553f77);_0x4d8028[_0x511d98(0xfe)]>0x0&&replaceActivationIdsInJourney(_0x11b084,_0x4d8028);if(_0x5b55d5[_0x511d98(0x154)]){const _0x593025=[];collectJumpTargetsFromJourney(_0x11b084,_0x593025);if(_0x593025[_0x511d98(0x15d)]>0x0){const _0x42819d=new Map();for(const _0x37c962 of _0x593025){try{const _0x4c1f7b=await _0x5b55d5[_0x511d98(0x154)](_0x37c962[_0x511d98(0x1a2)],_0x37c962['stageId']);_0x42819d['set'](_0x37c962[_0x511d98(0x1a2)]+':'+_0x37c962['stageId'],_0x4c1f7b);}catch{}}_0x42819d[_0x511d98(0xfe)]>0x0&&replaceJumpTargetsInJourney(_0x11b084,_0x42819d);}}return Object[_0x511d98(0x162)](_0x568afc)[_0x511d98(0x15d)]>0x0&&(_0x11b084[_0x511d98(0x18b)]=_0x568afc),Object['keys'](_0x1a85a6)[_0x511d98(0x15d)]>0x0&&(_0x11b084[_0x511d98(0x174)]=_0x1a85a6),_0x11b084;}function collectSegmentIdsFromJourney(_0x37c52c,_0x1c73e1){const _0x2a76db=a109_0x34fc;_0x37c52c[_0x2a76db(0x175)]?.[_0x2a76db(0x16b)]&&_0x1c73e1['add'](_0x37c52c[_0x2a76db(0x175)]['segment']);const _0x25521d=_0x2c4007=>{const _0x16e8eb=_0x2a76db;for(const _0x1b4678 of _0x2c4007){_0x1b4678[_0x16e8eb(0xcc)]?.['segment']&&_0x1c73e1[_0x16e8eb(0x119)](_0x1b4678[_0x16e8eb(0xcc)]['segment']);if(_0x1b4678[_0x16e8eb(0x12b)])for(const _0x16cc94 of _0x1b4678[_0x16e8eb(0x12b)]){_0x16cc94['segment']&&_0x1c73e1[_0x16e8eb(0x119)](_0x16cc94['segment']);}_0x1b4678[_0x16e8eb(0x10f)]?.[_0x16e8eb(0x16b)]&&_0x1c73e1[_0x16e8eb(0x119)](_0x1b4678[_0x16e8eb(0x10f)][_0x16e8eb(0x16b)]);if(_0x1b4678[_0x16e8eb(0x123)])for(const _0x5287e6 of _0x1b4678[_0x16e8eb(0x123)]){if(_0x5287e6['type']==='decision_point'){const _0x1c0004=_0x5287e6;for(const _0x49c473 of _0x1c0004['with'][_0x16e8eb(0x1a0)]){_0x49c473['segment']&&_0x1c73e1[_0x16e8eb(0x119)](_0x49c473[_0x16e8eb(0x16b)]);}}else{if(_0x5287e6['type']===_0x16e8eb(0x16c)){const _0x54f0db=_0x5287e6;_0x54f0db[_0x16e8eb(0x127)][_0x16e8eb(0x195)]?.[_0x16e8eb(0x16b)]&&_0x1c73e1['add'](_0x54f0db[_0x16e8eb(0x127)][_0x16e8eb(0x195)]['segment']);}}}}};if(_0x37c52c['journeys'])for(const _0x209e6e of _0x37c52c[_0x2a76db(0xf0)]){_0x209e6e[_0x2a76db(0x175)]?.[_0x2a76db(0x16b)]&&_0x1c73e1['add'](_0x209e6e[_0x2a76db(0x175)][_0x2a76db(0x16b)]),_0x25521d(_0x209e6e[_0x2a76db(0x13b)]);}_0x37c52c['stages']&&_0x25521d(_0x37c52c[_0x2a76db(0x13b)]);if(_0x37c52c[_0x2a76db(0x148)])for(const _0x2f0355 of _0x37c52c[_0x2a76db(0x148)]){_0x25521d(_0x2f0355['stages']);}}function replaceSegmentIdsInJourney(_0x1d5f4c,_0xa7d887){const _0x221d35=a109_0x34fc,_0x309a33=_0x3f748f=>_0xa7d887[_0x221d35(0x187)](_0x3f748f)||_0x3f748f;_0x1d5f4c['goal']?.[_0x221d35(0x16b)]&&(_0x1d5f4c['goal'][_0x221d35(0x16b)]=_0x309a33(_0x1d5f4c[_0x221d35(0x175)][_0x221d35(0x16b)]));const _0x3dff0b=_0x355b3b=>{const _0x5993ee=_0x221d35;for(const _0x433fa5 of _0x355b3b){_0x433fa5['entry_criteria']?.[_0x5993ee(0x16b)]&&(_0x433fa5[_0x5993ee(0xcc)][_0x5993ee(0x16b)]=_0x309a33(_0x433fa5[_0x5993ee(0xcc)][_0x5993ee(0x16b)]));if(_0x433fa5[_0x5993ee(0x12b)])for(const _0x127200 of _0x433fa5[_0x5993ee(0x12b)]){_0x127200[_0x5993ee(0x16b)]&&(_0x127200[_0x5993ee(0x16b)]=_0x309a33(_0x127200[_0x5993ee(0x16b)]));}_0x433fa5[_0x5993ee(0x10f)]?.[_0x5993ee(0x16b)]&&(_0x433fa5[_0x5993ee(0x10f)][_0x5993ee(0x16b)]=_0x309a33(_0x433fa5[_0x5993ee(0x10f)][_0x5993ee(0x16b)]));if(_0x433fa5[_0x5993ee(0x123)])for(const _0x470b94 of _0x433fa5[_0x5993ee(0x123)]){if(_0x470b94[_0x5993ee(0x15c)]===_0x5993ee(0x10d)){const _0x9ad937=_0x470b94;for(const _0x233e12 of _0x9ad937[_0x5993ee(0x127)][_0x5993ee(0x1a0)]){_0x233e12[_0x5993ee(0x16b)]&&(_0x233e12['segment']=_0x309a33(_0x233e12['segment']));}}else{if(_0x470b94[_0x5993ee(0x15c)]===_0x5993ee(0x16c)){const _0x5e6e50=_0x470b94;_0x5e6e50['with'][_0x5993ee(0x195)]?.[_0x5993ee(0x16b)]&&(_0x5e6e50[_0x5993ee(0x127)][_0x5993ee(0x195)][_0x5993ee(0x16b)]=_0x309a33(_0x5e6e50[_0x5993ee(0x127)]['condition'][_0x5993ee(0x16b)]));}}}}};if(_0x1d5f4c[_0x221d35(0xf0)])for(const _0x27ac02 of _0x1d5f4c[_0x221d35(0xf0)]){_0x27ac02[_0x221d35(0x175)]?.['segment']&&(_0x27ac02['goal'][_0x221d35(0x16b)]=_0x309a33(_0x27ac02[_0x221d35(0x175)]['segment'])),_0x3dff0b(_0x27ac02[_0x221d35(0x13b)]);}_0x1d5f4c['stages']&&_0x3dff0b(_0x1d5f4c[_0x221d35(0x13b)]);if(_0x1d5f4c[_0x221d35(0x148)])for(const _0x3da206 of _0x1d5f4c[_0x221d35(0x148)]){_0x3dff0b(_0x3da206[_0x221d35(0x13b)]);}}function collectActivationIdsFromJourney(_0x30da88,_0x54064e){const _0x438fac=a109_0x34fc,_0x2a06d8=_0x3aff32=>{const _0x492103=a109_0x34fc;for(const _0x1beb84 of _0x3aff32){if(_0x1beb84[_0x492103(0x123)])for(const _0x8fe49a of _0x1beb84['steps']){if(_0x8fe49a[_0x492103(0x15c)]==='activation'){const _0x177526=_0x8fe49a;_0x177526[_0x492103(0x127)][_0x492103(0x19d)]&&/^\d+$/[_0x492103(0x176)](_0x177526['with'][_0x492103(0x19d)])&&_0x54064e[_0x492103(0x119)](_0x177526['with']['activation']);}}}};if(_0x30da88['journeys'])for(const _0x32c121 of _0x30da88[_0x438fac(0xf0)]){_0x2a06d8(_0x32c121[_0x438fac(0x13b)]);}_0x30da88[_0x438fac(0x13b)]&&_0x2a06d8(_0x30da88[_0x438fac(0x13b)]);if(_0x30da88[_0x438fac(0x148)])for(const _0x31123f of _0x30da88[_0x438fac(0x148)]){_0x2a06d8(_0x31123f[_0x438fac(0x13b)]);}}function replaceActivationIdsInJourney(_0x178016,_0x5184d9){const _0x14319f=a109_0x34fc,_0x469331=_0x44054f=>_0x5184d9[_0x14319f(0x187)](_0x44054f)||_0x44054f,_0x30d5fb=_0x4fdf6c=>{const _0x34325c=_0x14319f;for(const _0x52d60f of _0x4fdf6c){if(_0x52d60f['steps'])for(const _0x159bc1 of _0x52d60f[_0x34325c(0x123)]){if(_0x159bc1[_0x34325c(0x15c)]===_0x34325c(0x19d)){const _0x4967d6=_0x159bc1;_0x4967d6[_0x34325c(0x127)][_0x34325c(0x19d)]&&(_0x4967d6[_0x34325c(0x127)]['activation']=_0x469331(_0x4967d6[_0x34325c(0x127)]['activation']));}}}};if(_0x178016['journeys'])for(const _0x4d6f19 of _0x178016[_0x14319f(0xf0)]){_0x30d5fb(_0x4d6f19[_0x14319f(0x13b)]);}_0x178016[_0x14319f(0x13b)]&&_0x30d5fb(_0x178016['stages']);if(_0x178016['versions'])for(const _0x3c33c7 of _0x178016['versions']){_0x30d5fb(_0x3c33c7[_0x14319f(0x13b)]);}}function a109_0x34fc(_0x1c2f9c,_0x32c632){_0x1c2f9c=_0x1c2f9c-0xc9;const _0x443065=a109_0x4430();let _0x34fc2a=_0x443065[_0x1c2f9c];return _0x34fc2a;}function collectJumpTargetsFromJourney(_0x372d2b,_0x4be18f){const _0x564e72=a109_0x34fc,_0x2406a5=new Set(),_0x55ffa5=_0x1f2023=>{const _0x1ec210=a109_0x34fc;for(const _0x51aee5 of _0x1f2023){if(_0x51aee5['steps'])for(const _0x37cf2f of _0x51aee5[_0x1ec210(0x123)]){if(_0x37cf2f[_0x1ec210(0x15c)]===_0x1ec210(0xf4)){const _0x44a98f=_0x37cf2f,_0x319b30=_0x44a98f['with'][_0x1ec210(0xe6)];if(_0x319b30[_0x1ec210(0xc9)]&&_0x319b30[_0x1ec210(0x105)]&&/^\d+$/[_0x1ec210(0x176)](_0x319b30[_0x1ec210(0xc9)])&&/^\d+$/[_0x1ec210(0x176)](_0x319b30[_0x1ec210(0x105)])){const _0x4d5267=_0x319b30[_0x1ec210(0xc9)]+':'+_0x319b30[_0x1ec210(0x105)];!_0x2406a5[_0x1ec210(0x10c)](_0x4d5267)&&(_0x2406a5[_0x1ec210(0x119)](_0x4d5267),_0x4be18f[_0x1ec210(0x134)]({'journeyId':_0x319b30['journey'],'stageId':_0x319b30[_0x1ec210(0x105)]}));}}}}};if(_0x372d2b[_0x564e72(0xf0)])for(const _0x38486e of _0x372d2b[_0x564e72(0xf0)]){_0x55ffa5(_0x38486e[_0x564e72(0x13b)]);}_0x372d2b['stages']&&_0x55ffa5(_0x372d2b[_0x564e72(0x13b)]);if(_0x372d2b[_0x564e72(0x148)])for(const _0x280b86 of _0x372d2b['versions']){_0x55ffa5(_0x280b86[_0x564e72(0x13b)]);}}function replaceJumpTargetsInJourney(_0x2aba66,_0x1052cc){const _0x1c5984=a109_0x34fc,_0x244499=_0x3daf23=>{const _0x303d16=a109_0x34fc;for(const _0x5a318c of _0x3daf23){if(_0x5a318c[_0x303d16(0x123)])for(const _0x275ff5 of _0x5a318c[_0x303d16(0x123)]){if(_0x275ff5[_0x303d16(0x15c)]===_0x303d16(0xf4)){const _0x1013ba=_0x275ff5,_0x5b1f53=_0x1013ba['with']['target'],_0x53232d=_0x5b1f53[_0x303d16(0xc9)]+':'+_0x5b1f53[_0x303d16(0x105)],_0x47c850=_0x1052cc['get'](_0x53232d);_0x47c850&&(_0x5b1f53[_0x303d16(0xc9)]=_0x47c850['journeyName'],_0x5b1f53[_0x303d16(0x105)]=_0x47c850[_0x303d16(0xf9)]);}}}};if(_0x2aba66[_0x1c5984(0xf0)])for(const _0x1a0d19 of _0x2aba66[_0x1c5984(0xf0)]){_0x244499(_0x1a0d19[_0x1c5984(0x13b)]);}_0x2aba66['stages']&&_0x244499(_0x2aba66[_0x1c5984(0x13b)]);if(_0x2aba66[_0x1c5984(0x148)])for(const _0x31727b of _0x2aba66[_0x1c5984(0x148)]){_0x244499(_0x31727b['stages']);}}function generateReadableStepName(_0x3c3698,_0x39358e){const _0x212fb9=a109_0x34fc;if(_0x3c3698[_0x212fb9(0x12a)]&&_0x3c3698['name']!==_0x3c3698[_0x212fb9(0x15c)]){const _0x474927=_0x3c3698[_0x212fb9(0x12a)][_0x212fb9(0xe3)]();if(_0x474927&&/[a-z0-9]/i['test'](_0x474927))return _0x474927;}const _0x41cddb=_0x3c3698[_0x212fb9(0x15c)][_0x212fb9(0x18e)]()[_0x212fb9(0x11f)](/step$/i,'');return _0x41cddb+'_'+(_0x39358e+0x1);}function getStepNextRefs(_0x530101){const _0x1c3156=a109_0x34fc,_0x5b34a1=[];if(_0x530101[_0x1c3156(0x11c)])_0x5b34a1[_0x1c3156(0x134)](_0x530101[_0x1c3156(0x11c)]);if(_0x530101[_0x1c3156(0x1a0)])for(const _0x92518f of _0x530101[_0x1c3156(0x1a0)]){if(_0x92518f['next'])_0x5b34a1['push'](_0x92518f[_0x1c3156(0x11c)]);}if(_0x530101[_0x1c3156(0xd9)])for(const _0x3ae17b of _0x530101['variants']){if(_0x3ae17b['next'])_0x5b34a1[_0x1c3156(0x134)](_0x3ae17b[_0x1c3156(0x11c)]);}if(_0x530101['conditions'])for(const _0x49fee6 of _0x530101[_0x1c3156(0x133)]){if(_0x49fee6[_0x1c3156(0x11c)])_0x5b34a1[_0x1c3156(0x134)](_0x49fee6[_0x1c3156(0x11c)]);}return _0x5b34a1;}function parseJumpTargetDisplayName(_0x2c9af0){const _0xbe7466=a109_0x34fc,_0x26c722=_0x2c9af0[_0xbe7466(0x181)](/^(.+?)\s*\(([^/)]+)/);if(!_0x26c722)return undefined;const _0x2e2be5=_0x26c722[0x1][_0xbe7466(0xe3)](),_0x193fdc=_0x26c722[0x2][_0xbe7466(0xe3)]();if(!_0x2e2be5||!_0x193fdc)return undefined;return{'stageName':_0x2e2be5,'journeyName':_0x193fdc};}function orderStepsFromRoot(_0x54fedc,_0x4e799f){const _0x488f0f=a109_0x34fc,_0x282e20=Object[_0x488f0f(0x114)](_0x54fedc);if(_0x282e20[_0x488f0f(0x15d)]===0x0)return[];const _0x284ac0=new Set(_0x282e20[_0x488f0f(0xd0)](([_0x4410a7])=>_0x4410a7)),_0x33fa06=new Set();for(const [,_0xb0743f]of _0x282e20){for(const _0x417149 of getStepNextRefs(_0xb0743f)){if(_0x284ac0['has'](_0x417149))_0x33fa06['add'](_0x417149);}}let _0x19e0ad=_0x4e799f&&_0x284ac0[_0x488f0f(0x10c)](_0x4e799f)?_0x4e799f:undefined;if(!_0x19e0ad){const _0x57948b=_0x282e20[_0x488f0f(0x15f)](([_0x532d8c])=>!_0x33fa06[_0x488f0f(0x10c)](_0x532d8c));_0x57948b[_0x488f0f(0x15d)]>0x0?_0x19e0ad=_0x57948b[0x0][0x0]:_0x19e0ad=_0x282e20[0x0][0x0];}const _0x324fec=[],_0x2f7b3f=new Set(),_0x10b810=[_0x19e0ad];while(_0x10b810['length']>0x0){const _0x463b12=_0x10b810['shift']();if(_0x2f7b3f[_0x488f0f(0x10c)](_0x463b12))continue;_0x2f7b3f[_0x488f0f(0x119)](_0x463b12);const _0x44f07a=_0x54fedc[_0x463b12];if(!_0x44f07a)continue;_0x324fec[_0x488f0f(0x134)]({'uuid':_0x463b12,'step':_0x44f07a});for(const _0x73d6e0 of getStepNextRefs(_0x44f07a)){_0x284ac0[_0x488f0f(0x10c)](_0x73d6e0)&&!_0x2f7b3f[_0x488f0f(0x10c)](_0x73d6e0)&&_0x10b810[_0x488f0f(0x134)](_0x73d6e0);}}for(const [_0x12505a,_0x4bcf96]of _0x282e20){!_0x2f7b3f['has'](_0x12505a)&&_0x324fec[_0x488f0f(0x134)]({'uuid':_0x12505a,'step':_0x4bcf96});}return _0x324fec;}function resolveStepReferences(_0x5b1e4d,_0x1e8d74,_0x2239d8,_0x47e6cb){const _0x3497ec=a109_0x34fc;if(_0x5b1e4d[_0x3497ec(0x15c)]!==_0x3497ec(0xd6)){_0x5b1e4d['next']&&_0x47e6cb['has'](_0x5b1e4d[_0x3497ec(0x11c)])&&(_0x5b1e4d[_0x3497ec(0x11c)]=_0x47e6cb[_0x3497ec(0x187)](_0x5b1e4d[_0x3497ec(0x11c)]));const _0x5a7987=_0x1e8d74+0x1;if(_0x5a7987<_0x2239d8[_0x3497ec(0x15d)]){const _0x538039=_0x47e6cb[_0x3497ec(0x187)](_0x2239d8[_0x5a7987][_0x3497ec(0xe1)]);_0x5b1e4d[_0x3497ec(0x11c)]===_0x538039&&delete _0x5b1e4d[_0x3497ec(0x11c)];}}if(_0x5b1e4d['type']==='decision_point')for(const _0x56af41 of _0x5b1e4d['with']['branches']){_0x56af41[_0x3497ec(0x11c)]&&_0x47e6cb[_0x3497ec(0x10c)](_0x56af41[_0x3497ec(0x11c)])&&(_0x56af41[_0x3497ec(0x11c)]=_0x47e6cb[_0x3497ec(0x187)](_0x56af41['next']));}if(_0x5b1e4d[_0x3497ec(0x15c)]===_0x3497ec(0xed))for(const _0x632bd4 of _0x5b1e4d[_0x3497ec(0x127)][_0x3497ec(0xd9)]){_0x632bd4[_0x3497ec(0x11c)]&&_0x47e6cb[_0x3497ec(0x10c)](_0x632bd4[_0x3497ec(0x11c)])&&(_0x632bd4['next']=_0x47e6cb['get'](_0x632bd4[_0x3497ec(0x11c)]));}if(_0x5b1e4d[_0x3497ec(0x15c)]==='wait'&&_0x5b1e4d[_0x3497ec(0x127)][_0x3497ec(0x195)]){const _0x2edfc8=_0x5b1e4d[_0x3497ec(0x127)]['condition'];_0x2edfc8[_0x3497ec(0x11c)]&&_0x47e6cb['has'](_0x2edfc8[_0x3497ec(0x11c)])&&(_0x2edfc8['next']=_0x47e6cb[_0x3497ec(0x187)](_0x2edfc8['next'])),_0x2edfc8[_0x3497ec(0x15b)]?.['next']&&_0x47e6cb[_0x3497ec(0x10c)](_0x2edfc8[_0x3497ec(0x15b)][_0x3497ec(0x11c)])&&(_0x2edfc8['timeout']['next']=_0x47e6cb[_0x3497ec(0x187)](_0x2edfc8[_0x3497ec(0x15b)][_0x3497ec(0x11c)]));}}function convertApiStageToYaml(_0x141617){const _0x2843ca=a109_0x34fc,_0x2dab68={'name':_0x141617[_0x2843ca(0x12a)]};_0x141617['id']&&(_0x2dab68['id']=_0x141617['id']);_0x141617['description']&&(_0x2dab68[_0x2843ca(0xdf)]=_0x141617[_0x2843ca(0xdf)]);_0x141617[_0x2843ca(0x168)]&&(_0x2dab68[_0x2843ca(0xcc)]=convertApiCriteriaToYaml(_0x141617[_0x2843ca(0x168)]));_0x141617[_0x2843ca(0xf5)]&&_0x141617[_0x2843ca(0xf5)]['length']>0x0&&(_0x2dab68[_0x2843ca(0x12b)]=_0x141617[_0x2843ca(0xf5)][_0x2843ca(0xd0)](convertApiCriteriaToYaml));_0x141617[_0x2843ca(0x10f)]&&(_0x2dab68[_0x2843ca(0x10f)]=convertApiCriteriaToYaml(_0x141617[_0x2843ca(0x10f)]));if(_0x141617['steps']&&Object[_0x2843ca(0x162)](_0x141617[_0x2843ca(0x123)])['length']>0x0){const _0x371b8b=orderStepsFromRoot(_0x141617['steps'],_0x141617[_0x2843ca(0xdc)]),_0x53b669=new Map(),_0x2bc6dc=new Set();for(let _0x156f4c=0x0;_0x156f4c<_0x371b8b[_0x2843ca(0x15d)];_0x156f4c++){const {uuid:_0xbe38ac,step:_0x46a1dc}=_0x371b8b[_0x156f4c];let _0x5d7d6b=generateReadableStepName(_0x46a1dc,_0x156f4c),_0x35dba3=_0x5d7d6b,_0x52ef44=0x2;while(_0x2bc6dc[_0x2843ca(0x10c)](_0x35dba3)){_0x35dba3=_0x5d7d6b+'_'+_0x52ef44,_0x52ef44++;}_0x2bc6dc[_0x2843ca(0x119)](_0x35dba3),_0x53b669[_0x2843ca(0x18f)](_0xbe38ac,_0x35dba3);}_0x2dab68[_0x2843ca(0x123)]=_0x371b8b['map'](({uuid:_0x4d3968,step:_0x5ba01b},_0x73502)=>{const _0x5bdaf9=_0x2843ca,_0xe5cbe7=convertApiStepToYaml(_0x5ba01b,_0x53b669[_0x5bdaf9(0x187)](_0x4d3968));return resolveStepReferences(_0xe5cbe7,_0x73502,_0x371b8b,_0x53b669),_0xe5cbe7;});}return _0x2dab68;}function convertApiCriteriaToYaml(_0x2fe3b6){const _0x8ac32a=a109_0x34fc,_0x1afe2a={'name':_0x2fe3b6[_0x8ac32a(0x12a)],'segment':_0x2fe3b6['segmentId']};_0x2fe3b6['description']&&(_0x1afe2a[_0x8ac32a(0xdf)]=_0x2fe3b6[_0x8ac32a(0xdf)]);if(_0x2fe3b6[_0x8ac32a(0xe6)]){let _0x3b45b2=_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x1a2)],_0x508122=_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x196)];if(_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x167)]){const _0x50cce4=parseJumpTargetDisplayName(_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x167)]);_0x50cce4&&(_0x508122=_0x50cce4[_0x8ac32a(0xf9)],_0x3b45b2=_0x50cce4[_0x8ac32a(0x167)]);}_0x1afe2a[_0x8ac32a(0xe6)]={'journey':_0x3b45b2,'stage':_0x508122},_0x2fe3b6['target'][_0x8ac32a(0x128)]&&(_0x1afe2a[_0x8ac32a(0xe6)]['bundle_id']=_0x2fe3b6['target'][_0x8ac32a(0x128)]);}return _0x1afe2a;}function convertApiStepToYaml(_0x2160ec,_0x367f10){const _0x34030c=a109_0x34fc;switch(_0x2160ec[_0x34030c(0x15c)]){case _0x34030c(0x166):{const _0x360aa8={};if(_0x2160ec[_0x34030c(0x193)]==='Duration'&&_0x2160ec[_0x34030c(0x12f)]!==undefined)_0x360aa8[_0x34030c(0xf1)]=_0x2160ec[_0x34030c(0x12f)],_0x360aa8[_0x34030c(0x18c)]=_0x2160ec[_0x34030c(0x147)];else{if(_0x2160ec[_0x34030c(0x193)]===_0x34030c(0x121)&&_0x2160ec[_0x34030c(0x170)])_0x360aa8[_0x34030c(0xd3)]=_0x2160ec[_0x34030c(0x170)];else{if(_0x2160ec[_0x34030c(0x193)]===_0x34030c(0x14e)&&_0x2160ec['daysOfWeek'])_0x360aa8[_0x34030c(0xf3)]=_0x2160ec[_0x34030c(0xef)];else{if(_0x2160ec[_0x34030c(0x193)]===_0x34030c(0x115)){if(_0x2160ec[_0x34030c(0x133)]&&_0x2160ec[_0x34030c(0x133)][_0x34030c(0x15d)]>0x0){const _0x1ca204=_0x2160ec[_0x34030c(0x133)]['find'](_0x417232=>!_0x417232[_0x34030c(0x18a)]),_0xfdb1e1=_0x2160ec['conditions'][_0x34030c(0x16a)](_0x4b4fb4=>_0x4b4fb4[_0x34030c(0x18a)]);_0x1ca204?.['segmentId']&&(_0x360aa8[_0x34030c(0x195)]={'segment':_0x1ca204[_0x34030c(0x19c)],..._0x1ca204[_0x34030c(0x11c)]?{'next':_0x1ca204[_0x34030c(0x11c)]}:{}},_0xfdb1e1&&_0xfdb1e1[_0x34030c(0xfc)]!==undefined&&_0xfdb1e1['unit']&&(_0x360aa8[_0x34030c(0x195)][_0x34030c(0x15b)]={'duration':_0xfdb1e1[_0x34030c(0xfc)],'unit':_0xfdb1e1['unit'],..._0xfdb1e1['next']?{'next':_0xfdb1e1[_0x34030c(0x11c)]}:{}}));}else _0x2160ec[_0x34030c(0x16f)]&&(_0x360aa8[_0x34030c(0x195)]={'segment':_0x2160ec['conditionSegmentId']},_0x2160ec[_0x34030c(0x14f)]!==undefined&&_0x2160ec[_0x34030c(0xe0)]&&(_0x360aa8[_0x34030c(0x195)]['timeout']={'duration':_0x2160ec[_0x34030c(0x14f)],'unit':_0x2160ec['conditionTimeoutUnit']}));}}}}const _0x8eb312={'type':'wait','name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec['next']}:{},'with':_0x360aa8};return _0x8eb312;}case _0x34030c(0xf6):{const _0x2e9b55={'type':_0x34030c(0x19d),'name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec[_0x34030c(0x11c)]}:{},'with':{'activation':_0x2160ec[_0x34030c(0x13e)]||''}};return _0x2e9b55;}case _0x34030c(0x17a):{const _0x57ca90={'type':'decision_point','name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec['next']}:{},'with':{'branches':(_0x2160ec[_0x34030c(0x1a0)]||[])[_0x34030c(0xd0)](_0x1fca46=>({'name':_0x1fca46[_0x34030c(0x12a)],'segment':_0x1fca46[_0x34030c(0x19c)],'excluded':_0x1fca46[_0x34030c(0x129)],..._0x1fca46[_0x34030c(0x11c)]?{'next':_0x1fca46['next']}:{}}))}};return _0x57ca90;}case _0x34030c(0xda):case _0x34030c(0x169):case _0x34030c(0xfb):{const _0x23bce0=_0x2160ec[_0x34030c(0xd9)]||(_0x2160ec[_0x34030c(0x1a0)]||[])[_0x34030c(0xd0)](_0x46915d=>({'name':_0x46915d[_0x34030c(0x12a)],'percentage':0x0,'next':_0x46915d[_0x34030c(0x11c)]})),_0x45dc65={'type':'ab_test','name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec[_0x34030c(0x11c)]}:{},'with':{'customized_split':_0x2160ec['customizedSplit'],'unique_id':_0x2160ec[_0x34030c(0x17b)],'variants':_0x23bce0['map'](_0x3073d7=>({'name':_0x3073d7[_0x34030c(0x12a)],'percentage':_0x3073d7[_0x34030c(0x151)],..._0x3073d7[_0x34030c(0x11c)]?{'next':_0x3073d7[_0x34030c(0x11c)]}:{}}))}};return _0x45dc65;}case _0x34030c(0x165):{const _0x1b3f59={'type':_0x34030c(0xe2),'name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec['next']}:{}};return _0x1b3f59;}case _0x34030c(0x194):{if(!_0x2160ec[_0x34030c(0xe6)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Jump\x20step\x20\x22'+(_0x2160ec[_0x34030c(0x12a)]||_0x367f10)+_0x34030c(0x117));let _0x280af0=_0x2160ec[_0x34030c(0xe6)][_0x34030c(0x1a2)],_0x1aa04e=_0x2160ec['target']['journeyStageId'];if(_0x2160ec['target'][_0x34030c(0x167)]){const _0x1a5c8f=parseJumpTargetDisplayName(_0x2160ec[_0x34030c(0xe6)]['journeyName']);_0x1a5c8f&&(_0x1aa04e=_0x1a5c8f['stageName'],_0x280af0=_0x1a5c8f['journeyName']);}const _0xb02ee0={'type':_0x34030c(0xf4),'name':_0x367f10,..._0x2160ec['next']?{'next':_0x2160ec[_0x34030c(0x11c)]}:{},'with':{'target':{'journey':_0x280af0,'stage':_0x1aa04e,'bundle_id':_0x2160ec['target'][_0x34030c(0x128)]}}};return _0xb02ee0;}case _0x34030c(0x185):{const _0x174243={'type':'end','name':_0x367f10};return _0x174243;}default:{const _0x116b3e={'type':_0x34030c(0xd6),'name':_0x367f10};return _0x116b3e;}}}export async function journeyDefToRequest(_0x365454,_0x41d393,_0x46d26d){const _0x261de5=a109_0x34fc,_0x38c332=_0x365454[_0x261de5(0x13b)]||getActiveStages(_0x365454),_0x56160c=_0x365454[_0x261de5(0x18b)]||{},_0xc80217=_0x365454[_0x261de5(0x174)]||{},_0x66bcb4={'type':_0x261de5(0xc9),'attributes':{'name':_0x365454[_0x261de5(0x12a)],'audienceId':_0x41d393,'journeyStages':await Promise[_0x261de5(0xcb)](_0x38c332[_0x261de5(0xd0)](_0x54f95f=>convertYamlStageToApi(_0x54f95f,_0x46d26d,_0x56160c,_0xc80217)))}};_0x365454['id']&&(_0x66bcb4['id']=_0x365454['id']);_0x365454[_0x261de5(0xdf)]&&(_0x66bcb4[_0x261de5(0x101)][_0x261de5(0xdf)]=_0x365454[_0x261de5(0xdf)]);const _0x51e0cf=getEffectiveGoal(_0x365454);_0x51e0cf&&(_0x66bcb4[_0x261de5(0x101)]['goal']=await convertYamlCriteriaToApi(_0x51e0cf,_0x46d26d,_0x56160c));const _0x266b50=getEffectiveReentry(_0x365454);return _0x266b50&&(_0x66bcb4['attributes'][_0x261de5(0x163)]=_0x266b50,_0x66bcb4['attributes'][_0x261de5(0x124)]=_0x266b50!==_0x261de5(0xfd)),_0x365454['folder_id']&&(_0x66bcb4[_0x261de5(0xf8)]={'parentFolder':{'data':{'id':_0x365454[_0x261de5(0x160)],'type':_0x261de5(0x108)}}}),_0x66bcb4;}async function convertYamlStageToApi(_0x176f03,_0x34f263,_0x233af9={},_0x5c20fe={}){const _0x4ad8d1=a109_0x34fc,_0x5e8d0b={'name':_0x176f03[_0x4ad8d1(0x12a)]};_0x176f03['id']&&(_0x5e8d0b['id']=_0x176f03['id']);_0x176f03['description']&&(_0x5e8d0b[_0x4ad8d1(0xdf)]=_0x176f03[_0x4ad8d1(0xdf)]);_0x176f03[_0x4ad8d1(0xcc)]&&(_0x5e8d0b['entryCriteria']=await convertYamlCriteriaToApi(_0x176f03['entry_criteria'],_0x34f263,_0x233af9));_0x176f03[_0x4ad8d1(0x12b)]&&_0x176f03['exit_criteria'][_0x4ad8d1(0x15d)]>0x0&&(_0x5e8d0b['exitCriterias']=await Promise[_0x4ad8d1(0xcb)](_0x176f03['exit_criteria'][_0x4ad8d1(0xd0)](_0x8211d3=>convertYamlCriteriaToApi(_0x8211d3,_0x34f263,_0x233af9))));_0x176f03[_0x4ad8d1(0x10f)]&&(_0x5e8d0b[_0x4ad8d1(0x10f)]=await convertYamlCriteriaToApi(_0x176f03['milestone'],_0x34f263,_0x233af9));if(_0x176f03[_0x4ad8d1(0x123)]&&_0x176f03[_0x4ad8d1(0x123)]['length']>0x0){const _0x43e021={},_0x46e4a6=_0x176f03[_0x4ad8d1(0x123)][_0x4ad8d1(0xd0)]((_0x2fa94e,_0x19266b)=>{const _0x3e8c40=_0x4ad8d1,_0x3036f6=_0x2fa94e[_0x3e8c40(0xe1)]||generateUUID(),_0x102944=_0x2fa94e[_0x3e8c40(0x12a)]||_0x2fa94e[_0x3e8c40(0x15c)]+'_'+_0x19266b;return _0x43e021[_0x102944]=_0x3036f6,{..._0x2fa94e,'name':_0x102944};});_0x5e8d0b['rootStep']=_0x43e021[_0x46e4a6[0x0][_0x4ad8d1(0x12a)]],_0x5e8d0b[_0x4ad8d1(0x123)]={};for(let _0x50cf43=0x0;_0x50cf43<_0x46e4a6[_0x4ad8d1(0x15d)];_0x50cf43++){const _0x1ed38a=_0x46e4a6[_0x50cf43],_0xe04a06=_0x43e021[_0x1ed38a[_0x4ad8d1(0x12a)]],_0x3be6c1=!_0x1ed38a['next']&&_0x50cf43<_0x46e4a6[_0x4ad8d1(0x15d)]-0x1&&_0x1ed38a[_0x4ad8d1(0x15c)]!==_0x4ad8d1(0xd6)?_0x46e4a6[_0x50cf43+0x1][_0x4ad8d1(0x12a)]:_0x1ed38a[_0x4ad8d1(0x11c)],_0x20ce2d=_0x3be6c1!==_0x1ed38a[_0x4ad8d1(0x11c)]?{..._0x1ed38a,'next':_0x3be6c1}:_0x1ed38a;_0x5e8d0b[_0x4ad8d1(0x123)][_0xe04a06]=await convertYamlStepToApi(_0x20ce2d,_0x34f263,_0x233af9,_0x43e021,_0x5c20fe);}}else _0x176f03['root_step']&&(_0x5e8d0b[_0x4ad8d1(0xdc)]=_0x176f03[_0x4ad8d1(0x125)]);return _0x5e8d0b;}async function convertYamlCriteriaToApi(_0x56b2d5,_0x107ffa,_0x4f8c0e={}){const _0x3ce7be=a109_0x34fc;let _0x192fef=_0x56b2d5[_0x3ce7be(0x16b)];if(_0x192fef&&!/^\d+$/[_0x3ce7be(0x176)](_0x192fef)){const _0x268fb8=parseSegmentRef(_0x192fef);if(_0x268fb8[_0x3ce7be(0x15c)]===_0x3ce7be(0x180))_0x107ffa?.[_0x3ce7be(0x192)]&&(_0x192fef=await _0x107ffa[_0x3ce7be(0x192)](_0x268fb8[_0x3ce7be(0x12a)]));else{if(_0x268fb8[_0x3ce7be(0x15c)]===_0x3ce7be(0x157)&&_0x4f8c0e[_0x268fb8[_0x3ce7be(0x12a)]])_0x107ffa?.[_0x3ce7be(0x11a)]&&(_0x192fef=await _0x107ffa[_0x3ce7be(0x11a)](_0x268fb8[_0x3ce7be(0x12a)],_0x4f8c0e[_0x268fb8[_0x3ce7be(0x12a)]]));else _0x107ffa?.[_0x3ce7be(0x192)]&&(_0x192fef=await _0x107ffa['resolveSegmentId'](_0x268fb8[_0x3ce7be(0x12a)]));}}const _0x1c789f={'name':_0x56b2d5[_0x3ce7be(0x12a)],'segmentId':_0x192fef};_0x56b2d5[_0x3ce7be(0xdf)]&&(_0x1c789f[_0x3ce7be(0xdf)]=_0x56b2d5[_0x3ce7be(0xdf)]);if(_0x56b2d5[_0x3ce7be(0xe6)]){const _0x5bd914=_0x56b2d5[_0x3ce7be(0xe6)][_0x3ce7be(0xc9)],_0x3fd123=_0x56b2d5['target'][_0x3ce7be(0x105)];let _0x5a8445=_0x56b2d5[_0x3ce7be(0xe6)][_0x3ce7be(0xc9)];_0x107ffa?.[_0x3ce7be(0x111)]&&!/^\d+$/[_0x3ce7be(0x176)](_0x5a8445)&&(_0x5a8445=await _0x107ffa['resolveJourneyId'](_0x5a8445));let _0x5cdb9f=_0x56b2d5[_0x3ce7be(0xe6)]['stage'];_0x107ffa?.[_0x3ce7be(0x171)]&&!/^\d+$/[_0x3ce7be(0x176)](_0x5cdb9f)&&(_0x5cdb9f=await _0x107ffa['resolveStageId'](_0x5a8445,_0x5cdb9f));const _0xdff02b=!/^\d+$/[_0x3ce7be(0x176)](_0x5bd914)&&!isLocalJourneyRef(_0x5bd914)?formatApiJourneyName(_0x5bd914,_0x3fd123):undefined;_0x1c789f['target']={'journeyId':_0x5a8445,'journeyStageId':_0x5cdb9f,'journeyName':_0xdff02b,'confirmed':!![]},_0x56b2d5[_0x3ce7be(0xe6)]['bundle_id']&&(_0x1c789f[_0x3ce7be(0xe6)][_0x3ce7be(0x128)]=_0x56b2d5[_0x3ce7be(0xe6)][_0x3ce7be(0xd1)]);}return _0x1c789f;}async function convertYamlStepToApi(_0x3af478,_0x48e1fe,_0x34cf21={},_0x2d32b7={},_0x12b1a0={}){const _0x5a34d6=a109_0x34fc,_0x4b9ed6=async _0x155969=>{const _0x249b34=a109_0x34fc;if(/^\d+$/[_0x249b34(0x176)](_0x155969))return _0x155969;const _0x476208=parseSegmentRef(_0x155969);if(_0x476208[_0x249b34(0x15c)]==='ref'){if(_0x48e1fe?.[_0x249b34(0x192)])return await _0x48e1fe[_0x249b34(0x192)](_0x476208['name']);}else{if(_0x476208[_0x249b34(0x15c)]==='embedded'&&_0x34cf21[_0x476208[_0x249b34(0x12a)]]){if(_0x48e1fe?.[_0x249b34(0x11a)])return await _0x48e1fe[_0x249b34(0x11a)](_0x476208[_0x249b34(0x12a)],_0x34cf21[_0x476208[_0x249b34(0x12a)]]);}else{if(_0x48e1fe?.['resolveSegmentId'])return await _0x48e1fe['resolveSegmentId'](_0x476208[_0x249b34(0x12a)]);}}return _0x155969;},_0x43d896=async _0x2fec8e=>{const _0x4f641c=a109_0x34fc;if(/^\d+$/[_0x4f641c(0x176)](_0x2fec8e))return _0x2fec8e;const _0x421781=parseSegmentRef(_0x2fec8e);if(_0x421781[_0x4f641c(0x15c)]===_0x4f641c(0x180)){if(_0x48e1fe?.[_0x4f641c(0x132)])return await _0x48e1fe[_0x4f641c(0x132)](_0x421781[_0x4f641c(0x12a)]);return _0x421781[_0x4f641c(0x12a)];}else{if(_0x421781[_0x4f641c(0x15c)]===_0x4f641c(0x157)&&_0x12b1a0[_0x421781['name']]){if(_0x48e1fe?.[_0x4f641c(0xee)])return await _0x48e1fe[_0x4f641c(0xee)](_0x421781[_0x4f641c(0x12a)],_0x12b1a0[_0x421781[_0x4f641c(0x12a)]]);if(_0x48e1fe?.[_0x4f641c(0x132)])return await _0x48e1fe[_0x4f641c(0x132)](_0x421781[_0x4f641c(0x12a)]);}else{if(_0x48e1fe?.['resolveActivationId'])return await _0x48e1fe[_0x4f641c(0x132)](_0x421781[_0x4f641c(0x12a)]);}}return _0x2fec8e;},_0x4a2d84=_0x7bdba9=>{const _0x4f45fe=a109_0x34fc;if(!_0x7bdba9)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x4f45fe(0x176)](_0x7bdba9))return _0x7bdba9;return _0x2d32b7[_0x7bdba9]||_0x7bdba9;};switch(_0x3af478['type']){case _0x5a34d6(0x16c):{const _0x39710c=_0x3af478,_0x1cf8e1=_0x39710c['with'],_0x58b6f9={'type':_0x5a34d6(0x166),'name':_0x39710c[_0x5a34d6(0x12a)],'next':_0x4a2d84(_0x39710c['next'])};if(_0x1cf8e1[_0x5a34d6(0xf1)]!==undefined&&_0x1cf8e1[_0x5a34d6(0x18c)])_0x58b6f9[_0x5a34d6(0x193)]=_0x5a34d6(0x11d),_0x58b6f9[_0x5a34d6(0x12f)]=_0x1cf8e1[_0x5a34d6(0xf1)],_0x58b6f9[_0x5a34d6(0x147)]=normalizeWaitUnit(_0x1cf8e1[_0x5a34d6(0x18c)]);else{if(_0x1cf8e1[_0x5a34d6(0xd3)])_0x58b6f9[_0x5a34d6(0x193)]=_0x5a34d6(0x121),_0x58b6f9[_0x5a34d6(0x170)]=_0x1cf8e1[_0x5a34d6(0xd3)];else{if(_0x1cf8e1[_0x5a34d6(0xf3)])_0x58b6f9['waitStepType']='DaysOfTheWeek',_0x58b6f9[_0x5a34d6(0xef)]=_0x1cf8e1[_0x5a34d6(0xf3)];else{if(_0x1cf8e1[_0x5a34d6(0x195)]){_0x58b6f9[_0x5a34d6(0x193)]='Condition';const _0xfaff75=await _0x4b9ed6(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x16b)]),_0x7c46a9=_0x1cf8e1[_0x5a34d6(0x195)]['timeout']?.[_0x5a34d6(0x11c)]!==undefined;if(_0x7c46a9){const _0x57289e=[];_0x57289e[_0x5a34d6(0x134)]({'id':generateUUID(),'segmentId':_0xfaff75,'timedOutPath':![],'name':_0x5a34d6(0x107),'next':_0x4a2d84(_0x1cf8e1['condition'][_0x5a34d6(0x11c)]??_0x39710c['next'])});if(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)]){const _0x5d22d0=_0x1cf8e1['condition'][_0x5a34d6(0x15b)][_0x5a34d6(0xf1)],_0x4730dc=normalizeWaitUnit(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0x18c)]);_0x57289e[_0x5a34d6(0x134)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x5a34d6(0x113)+_0x5d22d0+'\x20'+_0x4730dc,'moveAfter':_0x5d22d0,'unit':_0x4730dc,'next':_0x4a2d84(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0x11c)])});}_0x58b6f9[_0x5a34d6(0x133)]=_0x57289e,delete _0x58b6f9[_0x5a34d6(0x11c)];}else _0x58b6f9[_0x5a34d6(0x16f)]=_0xfaff75,_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)]&&(_0x58b6f9[_0x5a34d6(0x14f)]=_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0xf1)],_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)]['unit']&&(_0x58b6f9[_0x5a34d6(0xe0)]=normalizeWaitUnit(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0x18c)])));}}}}return _0x58b6f9;}case'activation':{const _0x388abe=_0x3af478,_0x3dd6ad=_0x388abe[_0x5a34d6(0x127)]['activation'],_0x41f0d2=await _0x43d896(_0x3dd6ad);return{'type':_0x5a34d6(0xf6),'name':_0x388abe['name'],'journeyActivationStepId':_0x41f0d2,'next':_0x4a2d84(_0x388abe[_0x5a34d6(0x11c)])};}case _0x5a34d6(0x10d):{const _0x528b20=_0x3af478,_0xa98a27=_0x528b20[_0x5a34d6(0x127)][_0x5a34d6(0x1a0)];return{'type':'DecisionPoint','name':_0x528b20[_0x5a34d6(0x12a)],'branches':await Promise['all'](_0xa98a27['map'](async _0x3df127=>{const _0x3db844=_0x5a34d6;let _0x58b5a6='';if(!_0x3df127[_0x3db844(0x11b)]){const _0x5ed6f5=_0x3df127[_0x3db844(0x16b)]||_0x3df127[_0x3db844(0x118)]||'';_0x58b5a6=_0x5ed6f5?await _0x4b9ed6(_0x5ed6f5):'';}return{'id':crypto[_0x3db844(0x189)](),'name':_0x3df127[_0x3db844(0x12a)],'description':null,'segmentId':_0x58b5a6,'excludedPath':_0x3df127[_0x3db844(0x11b)]??![],'next':_0x4a2d84(_0x3df127[_0x3db844(0x11c)])};})),'next':_0x4a2d84(_0x528b20[_0x5a34d6(0x11c)])};}case'ab_test':{const _0x71d8dc=_0x3af478,_0x478d28=_0x71d8dc[_0x5a34d6(0x127)];return{'type':'ABTest','name':_0x71d8dc[_0x5a34d6(0x12a)],'customizedSplit':_0x478d28['customized_split'],'uniqueId':_0x478d28[_0x5a34d6(0xce)],'variants':_0x478d28[_0x5a34d6(0xd9)]['map'](_0x4e8cbd=>({'id':_0x4e8cbd['id']||generateUUID(),'name':_0x4e8cbd[_0x5a34d6(0x12a)],'percentage':_0x4e8cbd['percentage'],'next':_0x4a2d84(_0x4e8cbd['next'])})),'next':_0x4a2d84(_0x71d8dc[_0x5a34d6(0x11c)])};}case'merge':return{'type':_0x5a34d6(0x165),'name':_0x3af478[_0x5a34d6(0x12a)],'next':_0x4a2d84(_0x3af478[_0x5a34d6(0x11c)])};case'jump':{const _0x4101f9=_0x3af478,_0x4a229a=_0x4101f9[_0x5a34d6(0x127)][_0x5a34d6(0xe6)],_0x3d51c5=_0x4a229a['journey'],_0x3ffc53=_0x4a229a['stage'];let _0x3c688b=_0x4a229a[_0x5a34d6(0xc9)];_0x48e1fe?.[_0x5a34d6(0x111)]&&!/^\d+$/['test'](_0x3c688b)&&(_0x3c688b=await _0x48e1fe[_0x5a34d6(0x111)](_0x3c688b));let _0x54bea5=_0x4a229a[_0x5a34d6(0x105)];_0x48e1fe?.[_0x5a34d6(0x171)]&&!/^\d+$/[_0x5a34d6(0x176)](_0x54bea5)&&(_0x54bea5=await _0x48e1fe[_0x5a34d6(0x171)](_0x3c688b,_0x54bea5));const _0x5e0256=!/^\d+$/['test'](_0x3d51c5)&&!isLocalJourneyRef(_0x3d51c5)?formatApiJourneyName(_0x3d51c5,_0x3ffc53):undefined;return{'type':_0x5a34d6(0x194),'name':_0x4101f9[_0x5a34d6(0x12a)],'target':{'journeyId':_0x3c688b,'journeyStageId':_0x54bea5,'journeyBundleId':_0x4a229a[_0x5a34d6(0xd1)],'journeyName':_0x5e0256,'confirmed':!![]},'next':_0x4a2d84(_0x4101f9[_0x5a34d6(0x11c)])};}case _0x5a34d6(0xd6):return{'type':_0x5a34d6(0x185),'name':_0x3af478[_0x5a34d6(0x12a)]};default:{const _0x30e4a3=_0x3af478;return{'type':_0x5a34d6(0x185),'name':_0x30e4a3['name']};}}}export function toYamlString(_0x623897){const _0x3db933=a109_0x34fc,_0x181803=stripInternalFields(_0x623897),_0x1c3c8d=a109_0x5b586d[_0x3db933(0x149)](_0x181803,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3db933(0x143)}),_0x47f0cb=[_0x3db933(0x12d),'activations:',_0x3db933(0x14a),_0x3db933(0x138),_0x3db933(0x103),_0x3db933(0x110),_0x3db933(0xe7)];let _0x21ef5a=_0x1c3c8d;for(const _0x40eb7b of _0x47f0cb){_0x21ef5a=_0x21ef5a[_0x3db933(0x11f)](new RegExp('^('+_0x40eb7b+')','m'),(_0x226fbc,_0x548d3b,_0x2ed19b)=>{if(_0x2ed19b===0x0||_0x21ef5a[_0x2ed19b-0x1]==='\x0a'&&_0x21ef5a[_0x2ed19b-0x2]==='\x0a')return _0x548d3b;return'\x0a'+_0x548d3b;});}return _0x21ef5a;}function stripInternalFields(_0x578366){const _0x3465d6=a109_0x34fc,{id:_0x5c0de3,folder_id:_0x10ada2,bundle_id:_0x428320,bundle_name:_0xd9817a,version:_0x1dd580,version_number:_0x5085d5,allow_reentry:_0x3d3b23,..._0x125475}=_0x578366;return _0x125475[_0x3465d6(0xf0)]&&(_0x125475['journeys']=_0x125475['journeys'][_0x3465d6(0xd0)](_0x3ddbe6=>{const _0x42d7a4=_0x3465d6,{id:_0x24376b,version_number:_0x532330,..._0xcab163}=_0x3ddbe6;return{..._0xcab163,'stages':_0xcab163[_0x42d7a4(0x13b)][_0x42d7a4(0xd0)](stripStageInternalFields),..._0x3ddbe6[_0x42d7a4(0x109)]===!![]?{'latest':!![]}:{},..._0x125475[_0x42d7a4(0xf0)][_0x42d7a4(0x15d)]===0x1&&_0xcab163[_0x42d7a4(0x188)]==='v1'?{'version':undefined}:{}};})),_0x125475[_0x3465d6(0x13b)]&&(_0x125475[_0x3465d6(0x13b)]=_0x125475['stages'][_0x3465d6(0xd0)](stripStageInternalFields)),_0x125475['versions']&&(_0x125475[_0x3465d6(0x148)]=_0x125475[_0x3465d6(0x148)][_0x3465d6(0xd0)](_0x568662=>{const _0x9e4b97=_0x3465d6,{id:_0x3b780a,version_number:_0x1abdb8,..._0x5ed4a6}=_0x568662;return{..._0x5ed4a6,'stages':_0x5ed4a6[_0x9e4b97(0x13b)][_0x9e4b97(0xd0)](stripStageInternalFields),..._0x568662[_0x9e4b97(0x109)]===!![]?{'latest':!![]}:{}};})),_0x125475;}function stripStageInternalFields(_0x5985c0){const {id:_0x313bb8,..._0x298ad3}=_0x5985c0;return _0x298ad3;}export function parseYamlString(_0x49fc6e){const _0x13e53d=a109_0x34fc,_0x46960f=a109_0x5b586d['parse'](_0x49fc6e);if(_0x46960f['type']!==_0x13e53d(0xc9))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x13e53d(0xdd));if(!_0x46960f[_0x13e53d(0x12a)])throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0xe8));const _0x17906c=_0x46960f[_0x13e53d(0xf0)]&&Array['isArray'](_0x46960f[_0x13e53d(0xf0)])&&_0x46960f['journeys'][_0x13e53d(0x15d)]>0x0,_0x473dc0=_0x46960f[_0x13e53d(0x13b)]&&Array[_0x13e53d(0x19b)](_0x46960f['stages'])&&_0x46960f[_0x13e53d(0x13b)]['length']>0x0,_0x33d144=_0x46960f[_0x13e53d(0x148)]&&Array[_0x13e53d(0x19b)](_0x46960f['versions'])&&_0x46960f[_0x13e53d(0x148)]['length']>0x0,_0x4d5398=[_0x17906c,_0x473dc0,_0x33d144][_0x13e53d(0x15f)](Boolean)[_0x13e53d(0x15d)];if(_0x4d5398>0x1)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x158));if(_0x4d5398===0x0)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x13d));if(_0x17906c){for(let _0x5d7339=0x0;_0x5d7339<_0x46960f[_0x13e53d(0xf0)][_0x13e53d(0x15d)];_0x5d7339++){const _0x534196=_0x46960f['journeys'][_0x5d7339];if(!_0x534196[_0x13e53d(0x13b)]||!Array['isArray'](_0x534196['stages'])||_0x534196[_0x13e53d(0x13b)][_0x13e53d(0x15d)]===0x0)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x1a1)+_0x5d7339+']\x20missing\x20required\x20field:\x20stages');if(_0x534196[_0x13e53d(0x19a)]&&!['draft',_0x13e53d(0xf2)][_0x13e53d(0x164)](_0x534196['state']))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x13e53d(0x1a1)+_0x5d7339+_0x13e53d(0x135)+_0x534196['state']+_0x13e53d(0xec));validateStages(_0x534196[_0x13e53d(0x13b)],_0x13e53d(0x177)+_0x5d7339+_0x13e53d(0x14b));}const _0x1a5404=_0x46960f[_0x13e53d(0xf0)][_0x13e53d(0x15f)](_0x326c7e=>_0x326c7e[_0x13e53d(0x109)]===!![])[_0x13e53d(0x15d)];if(_0x1a5404>0x1)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x156));}_0x473dc0&&validateStages(_0x46960f[_0x13e53d(0x13b)],_0x13e53d(0x13b));if(_0x33d144){for(let _0x53070d=0x0;_0x53070d<_0x46960f[_0x13e53d(0x148)]['length'];_0x53070d++){const _0x12a5ee=_0x46960f[_0x13e53d(0x148)][_0x53070d];if(!_0x12a5ee['name'])throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x19f)+_0x53070d+_0x13e53d(0x183));if(!_0x12a5ee[_0x13e53d(0x19a)]||![_0x13e53d(0x106),_0x13e53d(0xf2)][_0x13e53d(0x164)](_0x12a5ee[_0x13e53d(0x19a)]))throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x19f)+_0x53070d+_0x13e53d(0x135)+_0x12a5ee[_0x13e53d(0x19a)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');if(!_0x12a5ee['stages']||!Array['isArray'](_0x12a5ee[_0x13e53d(0x13b)])||_0x12a5ee['stages'][_0x13e53d(0x15d)]===0x0)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x19f)+_0x53070d+_0x13e53d(0xfa));validateStages(_0x12a5ee[_0x13e53d(0x13b)],_0x13e53d(0xeb)+_0x53070d+_0x13e53d(0x14b));}const _0x49c21b=_0x46960f['versions'][_0x13e53d(0x15f)](_0x25120b=>_0x25120b[_0x13e53d(0x109)]===!![])['length'];if(_0x49c21b>0x1)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x152));}return _0x46960f;}function validateStages(_0x3c4c22,_0x4c662b){const _0x1dc7c7=a109_0x34fc;if(_0x3c4c22[_0x1dc7c7(0x15d)]>0x8)throw new SDKError(ErrorCode[_0x1dc7c7(0xd8)],_0x1dc7c7(0x184)+_0x4c662b+_0x1dc7c7(0x17d));}export function isJourneyDef(_0x1146a1){const _0x5c0b23=a109_0x34fc;return typeof _0x1146a1===_0x5c0b23(0x104)&&_0x1146a1!==null&&_0x5c0b23(0x15c)in _0x1146a1&&_0x1146a1[_0x5c0b23(0x15c)]===_0x5c0b23(0xc9);}export function generateTemplate(_0x48dd1c,_0x27a01b){const _0x4d77d1=a109_0x34fc,_0x2ade6c={'type':_0x4d77d1(0xc9),'name':_0x48dd1c,'description':_0x4d77d1(0x178),'reentry':_0x4d77d1(0xfd),'goal':{'name':_0x4d77d1(0x140),'segment':_0x4d77d1(0x10e)},'stages':[{'name':'Stage\x201','description':_0x4d77d1(0xe5),'entry_criteria':{'name':_0x4d77d1(0xea),'segment':_0x27a01b},'steps':[{'type':_0x4d77d1(0x16c),'name':'Wait\x201\x20Day','with':{'duration':0x1,'unit':'day'}},{'type':'activation','name':_0x4d77d1(0x18d),'with':{'activation':'your-activation-name'}},{'type':_0x4d77d1(0xd6),'name':_0x4d77d1(0x172)}]}]};return toYamlString(_0x2ade6c);}function generateUUID(){const _0xcac295=a109_0x34fc;return crypto[_0xcac295(0x189)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x22b120){const _0x67f3ed=a109_0x34fc;if(_0x22b120[_0x67f3ed(0x144)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x22b120[_0x67f3ed(0x126)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x67f3ed(0x176)](_0x22b120))return{'type':'id','name':_0x22b120};return{'type':'embedded','name':_0x22b120};}export function makeSegmentRef(_0x501a2d){return''+SEGMENT_REF_PREFIX+_0x501a2d;}export function isExternalSegmentRef(_0x417c16){const _0xd1d5c5=a109_0x34fc;return _0x417c16[_0xd1d5c5(0x144)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x1ab6bc){const _0x103ebb=a109_0x34fc;return!!(_0x1ab6bc['journeys']&&_0x1ab6bc[_0x103ebb(0xf0)][_0x103ebb(0x15d)]>0x0);}export function isMultiVersionMode(_0x254216){const _0x11bca3=a109_0x34fc;return!!(_0x254216['versions']&&_0x254216[_0x11bca3(0x148)][_0x11bca3(0x15d)]>0x0);}export function isSingleVersionMode(_0x504c6b){const _0x19c020=a109_0x34fc;return!!(_0x504c6b[_0x19c020(0x13b)]&&_0x504c6b[_0x19c020(0x13b)][_0x19c020(0x15d)]>0x0);}export function hasMultipleVersions(_0x370784){const _0x339e8b=a109_0x34fc;if(isJourneysArrayMode(_0x370784))return(_0x370784['journeys']?.[_0x339e8b(0x15d)]||0x0)>0x1;if(isMultiVersionMode(_0x370784))return(_0x370784[_0x339e8b(0x148)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x58212b){const _0x40b887=a109_0x34fc;if(isJourneysArrayMode(_0x58212b))return _0x58212b;if(isSingleVersionMode(_0x58212b)){const {stages:_0x1cb648,id:_0x5becde,version:_0x1b105f,version_number:_0xc29a19,..._0x3bce86}=_0x58212b;return{..._0x3bce86,'journeys':[{'version':_0x1b105f||'v1','stages':_0x1cb648||[],'id':_0x5becde,'version_number':_0xc29a19}]};}if(isMultiVersionMode(_0x58212b)){const {versions:_0x1402d9,..._0x4fefa7}=_0x58212b;return{..._0x4fefa7,'journeys':(_0x1402d9||[])['map'](_0x30e175=>({'version':_0x30e175['name'],'state':_0x30e175[_0x40b887(0x19a)],'latest':_0x30e175[_0x40b887(0x109)],'stages':_0x30e175[_0x40b887(0x13b)],'id':_0x30e175['id'],'version_number':_0x30e175['version_number']}))};}return _0x58212b;}export function normalizeJourneyDef(_0x543c00,_0x29ecae){const _0x2c5924=a109_0x34fc,_0x1fde5c=normalizeToJourneysFormat(_0x543c00),_0x22ac71=_0x29ecae?.['segments']?Object[_0x2c5924(0x162)](_0x29ecae[_0x2c5924(0x18b)]):undefined,_0x410169=_0x29ecae?.['activations']?Object[_0x2c5924(0x162)](_0x29ecae[_0x2c5924(0x174)]):undefined;return{'type':_0x2c5924(0xc9),'name':_0x1fde5c[_0x2c5924(0x12a)],..._0x1fde5c[_0x2c5924(0xdf)]!==undefined&&{'description':_0x1fde5c[_0x2c5924(0xdf)]},..._0x1fde5c[_0x2c5924(0x175)]&&{'goal':normalizeJourneyCriteria(_0x1fde5c['goal'])},..._0x1fde5c[_0x2c5924(0x10b)]!==undefined&&{'reentry':_0x1fde5c[_0x2c5924(0x10b)]},..._0x1fde5c['segments']&&{'segments':normalizeEmbeddedSegments(_0x1fde5c['segments'],_0x22ac71)},..._0x1fde5c[_0x2c5924(0x174)]&&{'activations':normalizeEmbeddedActivations(_0x1fde5c['activations'],_0x410169)},..._0x1fde5c[_0x2c5924(0xf0)]&&{'journeys':_0x1fde5c[_0x2c5924(0xf0)]['map'](_0x27262d=>normalizeJourneyEntry(_0x27262d,_0x1fde5c[_0x2c5924(0xf0)][_0x2c5924(0x15d)]===0x1))}};}function normalizeJourneyEntry(_0x540d27,_0x2b4ff9){const _0xe529de=a109_0x34fc;return{...!_0x2b4ff9&&_0x540d27['version']!==undefined&&{'version':_0x540d27[_0xe529de(0x188)]},..._0x540d27[_0xe529de(0x19a)]!==undefined&&{'state':_0x540d27[_0xe529de(0x19a)]},...!_0x2b4ff9&&_0x540d27[_0xe529de(0x109)]!==undefined&&{'latest':_0x540d27[_0xe529de(0x109)]},..._0x540d27['goal']&&{'goal':normalizeJourneyCriteria(_0x540d27['goal'])},..._0x540d27[_0xe529de(0x10b)]!==undefined&&{'reentry':_0x540d27[_0xe529de(0x10b)]},'stages':_0x540d27[_0xe529de(0x13b)][_0xe529de(0xd0)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x28ee0f){const _0x44d75e=a109_0x34fc;return{'name':_0x28ee0f['name'],..._0x28ee0f['description']!==undefined&&{'description':_0x28ee0f[_0x44d75e(0xdf)]},..._0x28ee0f[_0x44d75e(0xcc)]&&{'entry_criteria':normalizeJourneyCriteria(_0x28ee0f[_0x44d75e(0xcc)])},..._0x28ee0f[_0x44d75e(0x12b)]&&{'exit_criteria':_0x28ee0f['exit_criteria'][_0x44d75e(0xd0)](normalizeJourneyCriteria)},..._0x28ee0f[_0x44d75e(0x10f)]&&{'milestone':normalizeJourneyCriteria(_0x28ee0f[_0x44d75e(0x10f)])},..._0x28ee0f[_0x44d75e(0x123)]&&{'steps':normalizeStepsWithImplicitNext(_0x28ee0f[_0x44d75e(0x123)])}};}function normalizeStepsWithImplicitNext(_0x4e9f86){const _0x235e8c=a109_0x34fc;return _0x4e9f86[_0x235e8c(0xd0)]((_0x3dac10,_0x45256e)=>{const _0x552a6e=_0x235e8c,_0x1abb3a=_0x45256e<_0x4e9f86[_0x552a6e(0x15d)]-0x1?_0x4e9f86[_0x45256e+0x1][_0x552a6e(0x12a)]:undefined;return normalizeJourneyStep(_0x3dac10,_0x1abb3a);});}function normalizeJourneyCriteria(_0x37fa46){const _0x586d17=a109_0x34fc;return{'name':_0x37fa46[_0x586d17(0x12a)],..._0x37fa46[_0x586d17(0xdf)]!==undefined&&{'description':_0x37fa46[_0x586d17(0xdf)]},'segment':_0x37fa46[_0x586d17(0x16b)],..._0x37fa46[_0x586d17(0xe6)]&&{'target':normalizeJumpTarget(_0x37fa46['target'])}};}function normalizeJourneyStep(_0x13f2c8,_0xf666a8){const _0x5ac90b=a109_0x34fc,_0x53743d=_0x13f2c8['next']!==undefined&&_0x13f2c8[_0x5ac90b(0x11c)]!==_0xf666a8,_0x436689={'type':_0x13f2c8['type'],'name':_0x13f2c8[_0x5ac90b(0x12a)],..._0x53743d&&{'next':_0x13f2c8[_0x5ac90b(0x11c)]}};if(_0x5ac90b(0x127)in _0x13f2c8&&_0x13f2c8[_0x5ac90b(0x127)])return{..._0x436689,'with':normalizeStepParams(_0x13f2c8[_0x5ac90b(0x15c)],_0x13f2c8[_0x5ac90b(0x127)])};return _0x436689;}function normalizeStepParams(_0x276629,_0x93e592){const _0x5b4c1a=a109_0x34fc;switch(_0x276629){case _0x5b4c1a(0x16c):{const _0x426310=_0x93e592;let _0x21d484;return _0x426310[_0x5b4c1a(0x195)]&&(_0x21d484={'segment':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x16b)],..._0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x11c)]!==undefined&&{'next':_0x426310['condition'][_0x5b4c1a(0x11c)]},..._0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]&&{'timeout':{'duration':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]['duration'],'unit':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)][_0x5b4c1a(0x18c)],..._0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]['next']!==undefined&&{'next':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]['next']}}}}),{..._0x426310[_0x5b4c1a(0xf1)]!==undefined&&{'duration':_0x426310[_0x5b4c1a(0xf1)]},..._0x426310['unit']!==undefined&&{'unit':_0x426310['unit']},..._0x426310[_0x5b4c1a(0xd3)]!==undefined&&{'wait_until':_0x426310[_0x5b4c1a(0xd3)]},..._0x426310[_0x5b4c1a(0xf3)]!==undefined&&{'days_of_week':_0x426310[_0x5b4c1a(0xf3)]},..._0x21d484&&{'condition':_0x21d484}};}case _0x5b4c1a(0x19d):{const _0x32e771=_0x93e592;return{'activation':_0x32e771[_0x5b4c1a(0x19d)]};}case'decision_point':{const _0x20b591=_0x93e592;return{'branches':_0x20b591['branches'][_0x5b4c1a(0xd0)](normalizeDecisionBranch)};}case _0x5b4c1a(0xed):{const _0x297197=_0x93e592;return{..._0x297197[_0x5b4c1a(0xe4)]!==undefined&&{'customized_split':_0x297197[_0x5b4c1a(0xe4)]},..._0x297197[_0x5b4c1a(0xce)]!==undefined&&{'unique_id':_0x297197[_0x5b4c1a(0xce)]},'variants':_0x297197['variants']['map'](normalizeAbTestVariant)};}case _0x5b4c1a(0xf4):{const _0x487381=_0x93e592;return{'target':normalizeJumpTarget(_0x487381[_0x5b4c1a(0xe6)])};}default:return _0x93e592;}}function normalizeDecisionBranch(_0x567df2){const _0x45914b=a109_0x34fc;return{'name':_0x567df2['name'],..._0x567df2[_0x45914b(0x16b)]!==undefined&&{'segment':_0x567df2['segment']},..._0x567df2[_0x45914b(0x11b)]!==undefined&&{'excluded':_0x567df2['excluded']},..._0x567df2['next']!==undefined&&{'next':_0x567df2[_0x45914b(0x11c)]}};}function normalizeAbTestVariant(_0x144aa0){const _0x21a1c8=a109_0x34fc;return{..._0x144aa0['id']!==undefined&&{'id':_0x144aa0['id']},'name':_0x144aa0[_0x21a1c8(0x12a)],'percentage':_0x144aa0['percentage'],..._0x144aa0[_0x21a1c8(0x11c)]!==undefined&&{'next':_0x144aa0[_0x21a1c8(0x11c)]}};}function normalizeJumpTarget(_0xb1f7b0){const _0xea02fa=a109_0x34fc;return{'journey':_0xb1f7b0['journey'],'stage':_0xb1f7b0['stage'],..._0xb1f7b0[_0xea02fa(0xd1)]!==undefined&&{'bundle_id':_0xb1f7b0[_0xea02fa(0xd1)]}};}function normalizeEmbeddedSegments(_0x573818,_0x394630){const _0x55a857=a109_0x34fc,_0x31154b={},_0x431c4e=Object[_0x55a857(0x162)](_0x573818),_0x233e77=_0x394630?[..._0x394630[_0x55a857(0x15f)](_0x278ed3=>_0x431c4e[_0x55a857(0x164)](_0x278ed3)),..._0x431c4e[_0x55a857(0x15f)](_0x5389eb=>!_0x394630['includes'](_0x5389eb))[_0x55a857(0x102)]()]:_0x431c4e[_0x55a857(0x102)]();for(const _0x4f3777 of _0x233e77){const _0x4aab49=_0x573818[_0x4f3777];if(_0x4aab49[_0x55a857(0x155)]){const _0x352567=_0x4aab49['rule'];if(_0x352567[_0x55a857(0x15c)]!==_0x55a857(0x13a)&&_0x352567['type']!=='Or'){const _0x1e23a9=_0x352567[_0x55a857(0x15c)]??_0x55a857(0x179);throw new SDKError(ErrorCode[_0x55a857(0xd8)],_0x55a857(0x10a)+_0x4f3777+'\x27:\x20'+(_0x55a857(0x120)+_0x1e23a9+_0x55a857(0xcf))+'Expected\x20format:\x0a'+_0x55a857(0x142)+_0x55a857(0x159)+'\x20\x20\x20\x20conditions:\x0a'+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x55a857(0x14d)+_0x55a857(0x14c));}if(!_0x352567[_0x55a857(0x133)]||!Array[_0x55a857(0x19b)](_0x352567[_0x55a857(0x133)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x55a857(0x10a)+_0x4f3777+_0x55a857(0x161)+_0x55a857(0xd4)+_0x55a857(0xcd)+_0x55a857(0x142)+(_0x55a857(0x16e)+_0x352567[_0x55a857(0x15c)]+'\x0a')+_0x55a857(0x17f)+_0x55a857(0x191)+_0x55a857(0x14d)+_0x55a857(0x14c));}_0x31154b[_0x4f3777]={..._0x4aab49[_0x55a857(0xdf)]&&_0x4aab49['description'][_0x55a857(0xe3)]()&&{'description':_0x4aab49[_0x55a857(0xdf)]},..._0x4aab49[_0x55a857(0x155)]&&{'rule':deepSortObject(_0x4aab49[_0x55a857(0x155)])}};}return _0x31154b;}function normalizeEmbeddedActivations(_0x10beff,_0x4ee300){const _0x32e114=a109_0x34fc,_0x3c5d9b={},_0x3fc9c6=Object[_0x32e114(0x162)](_0x10beff),_0x40c914=_0x4ee300?[..._0x4ee300[_0x32e114(0x15f)](_0x5b6942=>_0x3fc9c6[_0x32e114(0x164)](_0x5b6942)),..._0x3fc9c6[_0x32e114(0x15f)](_0x2b3838=>!_0x4ee300[_0x32e114(0x164)](_0x2b3838))[_0x32e114(0x102)]()]:_0x3fc9c6[_0x32e114(0x102)]();for(const _0x512009 of _0x40c914){const _0x311627=_0x10beff[_0x512009];_0x3c5d9b[_0x512009]={'name':_0x311627['name'],'connection':_0x311627[_0x32e114(0x11e)],..._0x311627[_0x32e114(0xdf)]!==undefined&&{'description':_0x311627[_0x32e114(0xdf)]},..._0x311627[_0x32e114(0x145)]!==undefined&&{'all_columns':_0x311627['all_columns']},..._0x311627[_0x32e114(0x137)]!==undefined&&{'columns':_0x311627[_0x32e114(0x137)]},..._0x311627[_0x32e114(0x116)]!==undefined&&{'behavior':_0x311627[_0x32e114(0x116)]},..._0x311627[_0x32e114(0xca)]!==undefined&&{'schedule':_0x311627[_0x32e114(0xca)]},..._0x311627['notification']!==undefined&&{'notification':_0x311627['notification']},..._0x311627['connector_config']!==undefined&&{'connector_config':_0x311627[_0x32e114(0x17e)]},..._0x311627[_0x32e114(0xd5)]!==undefined&&{'activation_template_id':_0x311627[_0x32e114(0xd5)]}};}return _0x3c5d9b;}export function getActiveStages(_0x3198b7){const _0x27814e=a109_0x34fc;if(isJourneysArrayMode(_0x3198b7)){const _0x3deebb=_0x3198b7[_0x27814e(0xf0)]||[],_0x59361c=_0x3deebb[_0x27814e(0x16a)](_0x22f25b=>_0x22f25b[_0x27814e(0x109)]===!![])||_0x3deebb[0x0];return _0x59361c?.[_0x27814e(0x13b)]||[];}if(isSingleVersionMode(_0x3198b7))return _0x3198b7[_0x27814e(0x13b)]||[];if(isMultiVersionMode(_0x3198b7)){const _0x42b91f=_0x3198b7[_0x27814e(0x148)]||[],_0x25ecea=_0x42b91f[_0x27814e(0x16a)](_0x6ff564=>_0x6ff564['latest']===!![])||_0x42b91f[0x0];return _0x25ecea?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x11232b){const _0x4506e9=a109_0x34fc;if(isJourneysArrayMode(_0x11232b)){const _0x40d5c9=_0x11232b['journeys']||[];return _0x40d5c9[_0x4506e9(0x16a)](_0x136769=>_0x136769['latest']===!![])||_0x40d5c9[0x0];}if(isMultiVersionMode(_0x11232b)){const _0xf9b921=_0x11232b[_0x4506e9(0x148)]||[],_0x52107c=_0xf9b921['find'](_0x1bc02f=>_0x1bc02f[_0x4506e9(0x109)]===!![])||_0xf9b921[0x0];if(_0x52107c)return{'version':_0x52107c[_0x4506e9(0x12a)],'state':_0x52107c[_0x4506e9(0x19a)],'latest':_0x52107c[_0x4506e9(0x109)],'stages':_0x52107c[_0x4506e9(0x13b)],'id':_0x52107c['id'],'version_number':_0x52107c[_0x4506e9(0xd7)]};}if(isSingleVersionMode(_0x11232b))return{'version':_0x11232b[_0x4506e9(0x188)]||'v1','state':'draft','stages':_0x11232b['stages']||[],'id':_0x11232b['id'],'version_number':_0x11232b['version_number'],'goal':_0x11232b[_0x4506e9(0x175)],'reentry':_0x11232b['reentry']};return undefined;}export function getLatestVersion(_0x6a53f4){const _0xbc31ab=a109_0x34fc;if(!isMultiVersionMode(_0x6a53f4))return undefined;const _0x38a413=_0x6a53f4[_0xbc31ab(0x148)]||[];return _0x38a413[_0xbc31ab(0x16a)](_0x5456e1=>_0x5456e1['latest']===!![])||_0x38a413[0x0];}export function getEffectiveGoal(_0x1315a4){const _0x521686=a109_0x34fc,_0x3da0bc=getLatestJourneyEntry(_0x1315a4);return _0x3da0bc?.[_0x521686(0x175)]||_0x1315a4['goal'];}function a109_0x4430(){const _0x106602=['\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)','segment_id','add','resolveEmbeddedSegmentId','excluded','next','Duration','connection','replace','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','Date','weeks','steps','allowReentry','root_step','slice','with','journeyBundleId','excludedPath','name','exit_criteria','32CbomIl','segments:','journeyBundleName','waitStep','waitCondition','1676710yctJnH','resolveActivationId','conditions','push',']\x20has\x20invalid\x20state:\x20','resolveSegmentName','columns','reentry:','21261096svbRKp','And','stages','exitCriteria','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','journeyActivationStepId','week','Goal\x20Achieved','resolveActivation','\x20\x20rule:\x0a','null','startsWith','all_columns','39gnNKyK','waitStepUnit','versions','stringify','goal:','].stages','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','DaysOfTheWeek','conditionTimeoutDuration','isJourneyLocal','percentage','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','reentry_always','resolveJumpTarget','rule','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','embedded','Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.','\x20\x20\x20\x20type:\x20And\x0a','7003325KvjgGK','timeout','type','length','definition','filter','folder_id','\x27:\x20','keys','reentryMode','includes','Merge','WaitStep','journeyName','entryCriteria','AbTest','find','segment','wait','18OLuvMD','\x20\x20\x20\x20type:\x20','conditionSegmentId','waitUntilDate','resolveStageId','Stage\x20Complete','bundle_name','activations','goal','test','journeys[','Journey\x20description','(missing)','DecisionPoint','uniqueId','from',':\x20maximum\x208\x20stages\x20allowed','connector_config','\x20\x20\x20\x20conditions:\x0a','ref','match','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.',']\x20missing\x20required\x20field:\x20name','Journey\x20YAML\x20','End','day','get','version','randomUUID','timedOutPath','segments','unit','Send\x20Notification','toLowerCase','set','63952UBVnlG','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','resolveSegmentId','waitStepType','Jump','condition','journeyStageId','11239Onzmeh','resolveActivationName','11RPUrpk','state','isArray','segmentId','activation','values','Journey\x20YAML\x20versions[','branches','Journey\x20YAML\x20journeys[','journeyId','journey','schedule','all','entry_criteria','Expected\x20format:\x0a','unique_id','\x27.\x0a','map','bundle_id','11764580eegJyI','wait_until','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','activation_template_id','end','version_number','JOURNEY_SYNTAX_ERROR','variants','ABTest','114OfKqRP','rootStep','Journey\x20YAML\x20must\x20have\x20type:\x20journey','parentFolder','description','conditionTimeoutUnit','uuid','merge','trim','customized_split','First\x20stage\x20of\x20the\x20journey','target','versions:','Journey\x20YAML\x20missing\x20required\x20field:\x20name','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','Entry\x20Criteria','versions[','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','ab_test','resolveEmbeddedActivationId','daysOfWeek','journeys','duration','launched','days_of_week','jump','exitCriterias','Activation','965817KjQAJJ','relationships','stageName',']\x20missing\x20required\x20field:\x20stages','Variant','moveAfter','no_reentry','size','journeyStages','resolveSegment','attributes','sort','journeys:','object','stage','draft','Met\x20condition(s)','folder','latest','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','reentry','has','decision_point','goal-segment','milestone','stages:','resolveJourneyId','versionNumber','*Max\x20wait\x20','entries','Condition','behavior'];a109_0x4430=function(){return _0x106602;};return a109_0x4430();}export function getEffectiveReentry(_0x3b0986){const _0x4e024c=a109_0x34fc,_0x208110=getLatestJourneyEntry(_0x3b0986);return _0x208110?.[_0x4e024c(0x10b)]||_0x3b0986['reentry'];}export function collectSegmentRefs(_0x3fcce4){const _0xef68a4=a109_0x34fc,_0x481c8a=new Set();_0x3fcce4[_0xef68a4(0x175)]?.['segment']&&_0x481c8a[_0xef68a4(0x119)](_0x3fcce4[_0xef68a4(0x175)][_0xef68a4(0x16b)]);const _0x267b01=_0x1d9ae0=>{const _0x3a335b=_0xef68a4;for(const _0x5b3c3b of _0x1d9ae0){_0x5b3c3b['entry_criteria']?.['segment']&&_0x481c8a['add'](_0x5b3c3b[_0x3a335b(0xcc)][_0x3a335b(0x16b)]);if(_0x5b3c3b['exit_criteria'])for(const _0x12cb1f of _0x5b3c3b[_0x3a335b(0x12b)]){_0x12cb1f['segment']&&_0x481c8a['add'](_0x12cb1f[_0x3a335b(0x16b)]);}_0x5b3c3b['milestone']?.[_0x3a335b(0x16b)]&&_0x481c8a[_0x3a335b(0x119)](_0x5b3c3b[_0x3a335b(0x10f)][_0x3a335b(0x16b)]);if(_0x5b3c3b['steps'])for(const _0x5911e0 of _0x5b3c3b[_0x3a335b(0x123)]){if(_0x5911e0['type']===_0x3a335b(0x10d)){const _0x4f3207=_0x5911e0;for(const _0xb9e64b of _0x4f3207['with'][_0x3a335b(0x1a0)]){_0xb9e64b['segment']&&_0x481c8a[_0x3a335b(0x119)](_0xb9e64b[_0x3a335b(0x16b)]);}}else{if(_0x5911e0[_0x3a335b(0x15c)]===_0x3a335b(0x16c)){const _0x56bdb7=_0x5911e0;_0x56bdb7[_0x3a335b(0x127)][_0x3a335b(0x195)]?.[_0x3a335b(0x16b)]&&_0x481c8a[_0x3a335b(0x119)](_0x56bdb7[_0x3a335b(0x127)][_0x3a335b(0x195)][_0x3a335b(0x16b)]);}}}}};_0x3fcce4[_0xef68a4(0x13b)]&&_0x267b01(_0x3fcce4[_0xef68a4(0x13b)]);if(_0x3fcce4[_0xef68a4(0x148)])for(const _0x2eff38 of _0x3fcce4[_0xef68a4(0x148)]){_0x267b01(_0x2eff38[_0xef68a4(0x13b)]);}return _0x481c8a;}export function validateSegmentRefs(_0x32f9ff){const _0x330057=a109_0x34fc,_0x4d6481=[],_0x58e9ea=collectSegmentRefs(_0x32f9ff),_0x3b7917=new Set(Object[_0x330057(0x162)](_0x32f9ff[_0x330057(0x18b)]||{}));for(const _0x3dd697 of _0x58e9ea){const _0x366eb9=parseSegmentRef(_0x3dd697);_0x366eb9['type']===_0x330057(0x157)&&!_0x3b7917[_0x330057(0x10c)](_0x366eb9[_0x330057(0x12a)])&&_0x4d6481['push']('Unknown\x20segment\x20\x22'+_0x366eb9[_0x330057(0x12a)]+_0x330057(0xe9)+_0x366eb9[_0x330057(0x12a)]+_0x330057(0x182));}return _0x4d6481;}export function collectSegmentIdsFromJourneyApi(_0x262240){const _0x5065f9=a109_0x34fc,_0x46dcb7=new Set();_0x262240['attributes'][_0x5065f9(0x175)]?.[_0x5065f9(0x19c)]&&_0x46dcb7['add'](_0x262240['attributes'][_0x5065f9(0x175)][_0x5065f9(0x19c)]);const _0x3ae875=_0x262240[_0x5065f9(0x101)][_0x5065f9(0xff)];if(Array[_0x5065f9(0x19b)](_0x3ae875))for(const _0x4986a2 of _0x3ae875){_0x4986a2['entryCriteria']?.[_0x5065f9(0x19c)]&&_0x46dcb7[_0x5065f9(0x119)](_0x4986a2[_0x5065f9(0x168)][_0x5065f9(0x19c)]);const _0x461642=_0x4986a2[_0x5065f9(0xf5)]??_0x4986a2[_0x5065f9(0x13c)];if(Array[_0x5065f9(0x19b)](_0x461642))for(const _0x1cf239 of _0x461642){_0x1cf239[_0x5065f9(0x19c)]&&_0x46dcb7[_0x5065f9(0x119)](_0x1cf239[_0x5065f9(0x19c)]);}_0x4986a2[_0x5065f9(0x10f)]?.[_0x5065f9(0x19c)]&&_0x46dcb7['add'](_0x4986a2[_0x5065f9(0x10f)][_0x5065f9(0x19c)]);if(_0x4986a2['steps']&&typeof _0x4986a2[_0x5065f9(0x123)]===_0x5065f9(0x104)){const _0x554c36=Array['isArray'](_0x4986a2[_0x5065f9(0x123)])?_0x4986a2[_0x5065f9(0x123)]:Object[_0x5065f9(0x19e)](_0x4986a2[_0x5065f9(0x123)]);for(const _0x52fa1b of _0x554c36){_0x52fa1b[_0x5065f9(0x130)]?.['segmentId']&&_0x46dcb7[_0x5065f9(0x119)](_0x52fa1b[_0x5065f9(0x130)][_0x5065f9(0x19c)]);const _0x477231=_0x52fa1b;_0x477231['conditionSegmentId']&&_0x46dcb7['add'](_0x477231[_0x5065f9(0x16f)]);if(Array[_0x5065f9(0x19b)](_0x477231[_0x5065f9(0x133)]))for(const _0x25c38b of _0x477231[_0x5065f9(0x133)]){_0x25c38b[_0x5065f9(0x19c)]&&_0x46dcb7[_0x5065f9(0x119)](_0x25c38b[_0x5065f9(0x19c)]);}if(Array['isArray'](_0x52fa1b[_0x5065f9(0x1a0)]))for(const _0x37c12b of _0x52fa1b[_0x5065f9(0x1a0)]){_0x37c12b['segmentId']&&_0x46dcb7[_0x5065f9(0x119)](_0x37c12b['segmentId']);}}}}return _0x46dcb7;}
1
+ const a109_0x447522=a109_0x1b1c;(function(_0x3b2eff,_0x46372d){const _0x54872f=a109_0x1b1c,_0x1bd9af=_0x3b2eff();while(!![]){try{const _0x50ff64=parseInt(_0x54872f(0xe7))/0x1+-parseInt(_0x54872f(0x12e))/0x2+parseInt(_0x54872f(0x13d))/0x3*(-parseInt(_0x54872f(0x13b))/0x4)+-parseInt(_0x54872f(0x190))/0x5+-parseInt(_0x54872f(0xf5))/0x6+parseInt(_0x54872f(0xf1))/0x7*(-parseInt(_0x54872f(0x170))/0x8)+parseInt(_0x54872f(0x136))/0x9*(parseInt(_0x54872f(0xcd))/0xa);if(_0x50ff64===_0x46372d)break;else _0x1bd9af['push'](_0x1bd9af['shift']());}catch(_0x1a4434){_0x1bd9af['push'](_0x1bd9af['shift']());}}}(a109_0x2e1b,0xe1dbe));function a109_0x2e1b(){const _0x31a176=['resolveEmbeddedSegmentId','DaysOfTheWeek','78160KtZBRm','journeyId','\x20\x20\x20\x20type:\x20And\x0a','reentry','reentry_always','branches','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','resolveActivationName','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','daysOfWeek','rootStep','jump','journeyBundleId','stages','all_columns','Jump\x20step\x20\x22','day','*Max\x20wait\x20','name','condition','isArray','add','waitStepUnit','size','keys','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','276987HJILGO','from','entryCriteria','attributes','DecisionPoint','stages:','Expected\x20format:\x0a','Duration','versionNumber','journeyActivationStepId','74809zjAfYe','conditions','launched','Journey\x20description','6736494Syhjsk','End','AbTest','activations','wait_until','week','moveAfter','stageId','conditionTimeoutDuration','merge','Unknown\x20segment\x20\x22','Stage\x201','journeys','Journey\x20YAML\x20','Journey\x20YAML\x20versions[','waitCondition','And','].stages','goal-segment',':\x20maximum\x208\x20stages\x20allowed','resolveJumpTarget','reentryMode','connection','includes','(missing)','\x27:\x20','journeyName','Variant','steps','test','draft','\x20\x20rule:\x0a','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','Journey\x20YAML\x20must\x20have\x20type:\x20journey','randomUUID','find','latest','timeout',']\x20missing\x20required\x20field:\x20stages','conditionTimeoutUnit','segments:','replace','set','duration','Jump','ref','customized_split','description','wait','get','segment','has','weeks','customizedSplit','shift','journeyStages','JOURNEY_SYNTAX_ERROR','1247812qpnEdN','goal','waitStep','activation_template_id','parentFolder','exitCriteria','Condition','unit','5157GyElOL','excludedPath','Send\x20Notification','conditionSegmentId','values','212536ziODnw','all','66xeDOfI','trim','segments',']\x20missing\x20required\x20field:\x20name','resolveActivation','Wait\x201\x20Day','percentage','\x20\x20\x20\x20conditions:\x0a','WaitStep','version_number','next','isJourneyLocal','folder','milestone','journeyStageId','slice','entries','First\x20stage\x20of\x20the\x20journey','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','versions','journeys:','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','definition','exit_criteria','sort','filter','variants','allowReentry','journeyBundleName','map','behavior',']\x20has\x20invalid\x20state:\x20','resolveEmbeddedActivationId','push','days','version','resolveSegment','timedOutPath','\x20\x20\x20\x20type:\x20','stage','embedded','state','Date','your-activation-name','data','type','waitStepType','with','ABTest','relationships','resolveSegmentName','432dUgUpC','Entry\x20Criteria','bundle_name','match','decision_point','uuid','waitUntilDate','columns','end','resolveStageId','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','resolveJourneyId','Goal\x20Achieved','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','length','Journey\x20YAML\x20journeys[','object','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','root_step','goal:','exitCriterias','rule','target','ref:','resolveActivationId','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','stringify','\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)','entry_criteria','schedule','unique_id','no_reentry','1688680ywkFgQ','Activation','parse','Met\x20condition(s)','resolveSegmentId','notification','excluded','journeys[','bundle_id','segment_id','activations:','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','ab_test','segmentId','folder_id','journey','days_of_week','activation','connector_config'];a109_0x2e1b=function(){return _0x31a176;};return a109_0x2e1b();}import*as a109_0x5d0f75 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x206beb){const _0x51570e=a109_0x1b1c,_0xe705e=_0x206beb['toLowerCase']();if(_0xe705e===_0x51570e(0x15f)||_0xe705e===_0x51570e(0xdd))return'day';if(_0xe705e===_0x51570e(0x129)||_0xe705e===_0x51570e(0xfa))return _0x51570e(0xfa);return _0x206beb;}export function journeyResponseToDefSync(_0x477aa6){const _0x202be3=a109_0x1b1c,_0x4b4a8b=_0x477aa6[_0x202be3(0xea)],_0x270dc5=_0x4b4a8b['journeyBundleName']||_0x4b4a8b[_0x202be3(0xdf)],_0x4486eb={'stages':_0x4b4a8b[_0x202be3(0x12c)][_0x202be3(0x15a)](convertApiStageToYaml),'id':_0x477aa6['id']};_0x4b4a8b[_0x202be3(0xdf)]&&_0x4b4a8b[_0x202be3(0xdf)]!==_0x270dc5&&(_0x4486eb[_0x202be3(0x160)]=_0x4b4a8b[_0x202be3(0xdf)]);_0x4b4a8b[_0x202be3(0xef)]!==undefined&&(_0x4486eb[_0x202be3(0x146)]=_0x4b4a8b[_0x202be3(0xef)]);_0x4b4a8b[_0x202be3(0x166)]&&(_0x4486eb[_0x202be3(0x166)]=_0x4b4a8b['state']===_0x202be3(0xf3)?'launched':'draft');const _0x53a186={'type':'journey','name':_0x270dc5,'journeys':[_0x4486eb]};_0x4b4a8b[_0x202be3(0x124)]&&(_0x53a186[_0x202be3(0x124)]=_0x4b4a8b[_0x202be3(0x124)]);_0x4b4a8b[_0x202be3(0x12f)]&&(_0x53a186[_0x202be3(0x12f)]=convertApiCriteriaToYaml(_0x4b4a8b[_0x202be3(0x12f)]));if(_0x4b4a8b['reentryMode'])_0x53a186['reentry']=_0x4b4a8b[_0x202be3(0x10a)];else _0x4b4a8b['allowReentry']!==undefined&&(_0x53a186[_0x202be3(0xd0)]=_0x4b4a8b[_0x202be3(0x158)]?_0x202be3(0xd1):_0x202be3(0x18f));return _0x4b4a8b[_0x202be3(0xd9)]&&(_0x53a186[_0x202be3(0x198)]=_0x4b4a8b['journeyBundleId']),_0x4b4a8b[_0x202be3(0x159)]&&(_0x53a186[_0x202be3(0x172)]=_0x4b4a8b[_0x202be3(0x159)]),_0x477aa6['relationships']?.[_0x202be3(0x132)]?.[_0x202be3(0x169)]?.['id']&&(_0x53a186[_0x202be3(0x19e)]=_0x477aa6[_0x202be3(0x16e)][_0x202be3(0x132)][_0x202be3(0x169)]['id']),_0x53a186;}export async function journeyResponseToDef(_0x84ea44,_0x3422cc){const _0x476c68=a109_0x1b1c,_0x22d67=journeyResponseToDefSync(_0x84ea44);if(!_0x3422cc)return _0x22d67;const _0x377c64=new Set();collectSegmentIdsFromJourney(_0x22d67,_0x377c64);const _0x24e73b=new Set();collectActivationIdsFromJourney(_0x22d67,_0x24e73b);const _0x5b9faf={},_0x32f879=new Map();for(const _0x3b9af9 of Array[_0x476c68(0xe8)](_0x377c64)[_0x476c68(0x155)]()){if(_0x3422cc[_0x476c68(0x161)]){const _0x489539=await _0x3422cc[_0x476c68(0x161)](_0x3b9af9);if(_0x489539['isJourneyLocal']){_0x32f879[_0x476c68(0x11f)](_0x3b9af9,_0x489539[_0x476c68(0xdf)]);if(_0x489539[_0x476c68(0x153)]){const _0x2407ca={..._0x489539[_0x476c68(0x153)],'rule':deepSortObject(_0x489539[_0x476c68(0x153)][_0x476c68(0x185)])};_0x5b9faf[_0x489539['name']]=_0x2407ca;}}else _0x32f879[_0x476c68(0x11f)](_0x3b9af9,makeSegmentRef(_0x489539[_0x476c68(0xdf)]));}else{if(_0x3422cc[_0x476c68(0x16f)]){const _0x27c264=await _0x3422cc['resolveSegmentName'](_0x3b9af9);_0x32f879['set'](_0x3b9af9,_0x27c264);}}}const _0x2669f8={},_0x485a7d=new Map();for(const _0x538032 of Array[_0x476c68(0xe8)](_0x24e73b)[_0x476c68(0x155)]()){if(_0x3422cc['resolveActivation']){const _0x298d09=await _0x3422cc[_0x476c68(0x141)](_0x538032);_0x298d09[_0x476c68(0x148)]?(_0x485a7d[_0x476c68(0x11f)](_0x538032,_0x298d09[_0x476c68(0xdf)]),_0x298d09['definition']&&(_0x2669f8[_0x298d09[_0x476c68(0xdf)]]=_0x298d09[_0x476c68(0x153)])):_0x485a7d[_0x476c68(0x11f)](_0x538032,makeSegmentRef(_0x298d09['name']));}else{if(_0x3422cc[_0x476c68(0xd4)]){const _0xcd2125=await _0x3422cc[_0x476c68(0xd4)](_0x538032);_0x485a7d['set'](_0x538032,_0xcd2125);}}}_0x32f879[_0x476c68(0xe4)]>0x0&&replaceSegmentIdsInJourney(_0x22d67,_0x32f879);_0x485a7d[_0x476c68(0xe4)]>0x0&&replaceActivationIdsInJourney(_0x22d67,_0x485a7d);if(_0x3422cc[_0x476c68(0x109)]){const _0x5d75f8=[];collectJumpTargetsFromJourney(_0x22d67,_0x5d75f8);if(_0x5d75f8[_0x476c68(0x17e)]>0x0){const _0x46d583=new Map();for(const _0x136c8c of _0x5d75f8){try{const _0x46a3bc=await _0x3422cc[_0x476c68(0x109)](_0x136c8c[_0x476c68(0xce)],_0x136c8c[_0x476c68(0xfc)]);_0x46d583['set'](_0x136c8c[_0x476c68(0xce)]+':'+_0x136c8c[_0x476c68(0xfc)],_0x46a3bc);}catch{}}_0x46d583[_0x476c68(0xe4)]>0x0&&replaceJumpTargetsInJourney(_0x22d67,_0x46d583);}}return Object[_0x476c68(0xe5)](_0x5b9faf)[_0x476c68(0x17e)]>0x0&&(_0x22d67[_0x476c68(0x13f)]=_0x5b9faf),Object[_0x476c68(0xe5)](_0x2669f8)[_0x476c68(0x17e)]>0x0&&(_0x22d67[_0x476c68(0xf8)]=_0x2669f8),_0x22d67;}function collectSegmentIdsFromJourney(_0x128019,_0x8785fb){const _0x3aa9cb=a109_0x1b1c;_0x128019[_0x3aa9cb(0x12f)]?.['segment']&&_0x8785fb[_0x3aa9cb(0xe2)](_0x128019[_0x3aa9cb(0x12f)][_0x3aa9cb(0x127)]);const _0x5cef20=_0x58a815=>{const _0x148bad=_0x3aa9cb;for(const _0x1fa920 of _0x58a815){_0x1fa920[_0x148bad(0x18c)]?.[_0x148bad(0x127)]&&_0x8785fb[_0x148bad(0xe2)](_0x1fa920[_0x148bad(0x18c)]['segment']);if(_0x1fa920['exit_criteria'])for(const _0x294639 of _0x1fa920[_0x148bad(0x154)]){_0x294639[_0x148bad(0x127)]&&_0x8785fb[_0x148bad(0xe2)](_0x294639[_0x148bad(0x127)]);}_0x1fa920[_0x148bad(0x14a)]?.[_0x148bad(0x127)]&&_0x8785fb[_0x148bad(0xe2)](_0x1fa920['milestone'][_0x148bad(0x127)]);if(_0x1fa920[_0x148bad(0x111)])for(const _0x20bf18 of _0x1fa920[_0x148bad(0x111)]){if(_0x20bf18['type']===_0x148bad(0x174)){const _0x5a28a1=_0x20bf18;for(const _0x3820e9 of _0x5a28a1[_0x148bad(0x16c)][_0x148bad(0xd2)]){_0x3820e9[_0x148bad(0x127)]&&_0x8785fb[_0x148bad(0xe2)](_0x3820e9['segment']);}}else{if(_0x20bf18['type']===_0x148bad(0x125)){const _0x44c3f6=_0x20bf18;_0x44c3f6['with'][_0x148bad(0xe0)]?.[_0x148bad(0x127)]&&_0x8785fb[_0x148bad(0xe2)](_0x44c3f6[_0x148bad(0x16c)]['condition'][_0x148bad(0x127)]);}}}}};if(_0x128019[_0x3aa9cb(0x101)])for(const _0x99bb76 of _0x128019[_0x3aa9cb(0x101)]){_0x99bb76['goal']?.['segment']&&_0x8785fb[_0x3aa9cb(0xe2)](_0x99bb76[_0x3aa9cb(0x12f)][_0x3aa9cb(0x127)]),_0x5cef20(_0x99bb76['stages']);}_0x128019[_0x3aa9cb(0xda)]&&_0x5cef20(_0x128019[_0x3aa9cb(0xda)]);if(_0x128019[_0x3aa9cb(0x150)])for(const _0x3b0795 of _0x128019['versions']){_0x5cef20(_0x3b0795[_0x3aa9cb(0xda)]);}}function replaceSegmentIdsInJourney(_0x4815b7,_0x2877d6){const _0x4094cc=a109_0x1b1c,_0x33212e=_0x53569a=>_0x2877d6[_0x4094cc(0x126)](_0x53569a)||_0x53569a;_0x4815b7[_0x4094cc(0x12f)]?.[_0x4094cc(0x127)]&&(_0x4815b7[_0x4094cc(0x12f)]['segment']=_0x33212e(_0x4815b7[_0x4094cc(0x12f)]['segment']));const _0x282ae5=_0x22eb77=>{const _0x22fdff=_0x4094cc;for(const _0x443fe8 of _0x22eb77){_0x443fe8['entry_criteria']?.['segment']&&(_0x443fe8['entry_criteria'][_0x22fdff(0x127)]=_0x33212e(_0x443fe8[_0x22fdff(0x18c)][_0x22fdff(0x127)]));if(_0x443fe8[_0x22fdff(0x154)])for(const _0x3e8ac0 of _0x443fe8[_0x22fdff(0x154)]){_0x3e8ac0[_0x22fdff(0x127)]&&(_0x3e8ac0[_0x22fdff(0x127)]=_0x33212e(_0x3e8ac0[_0x22fdff(0x127)]));}_0x443fe8[_0x22fdff(0x14a)]?.[_0x22fdff(0x127)]&&(_0x443fe8[_0x22fdff(0x14a)][_0x22fdff(0x127)]=_0x33212e(_0x443fe8['milestone'][_0x22fdff(0x127)]));if(_0x443fe8[_0x22fdff(0x111)])for(const _0x1a641e of _0x443fe8[_0x22fdff(0x111)]){if(_0x1a641e['type']===_0x22fdff(0x174)){const _0x226579=_0x1a641e;for(const _0x3148d6 of _0x226579['with'][_0x22fdff(0xd2)]){_0x3148d6[_0x22fdff(0x127)]&&(_0x3148d6[_0x22fdff(0x127)]=_0x33212e(_0x3148d6['segment']));}}else{if(_0x1a641e['type']==='wait'){const _0x26eaa5=_0x1a641e;_0x26eaa5['with'][_0x22fdff(0xe0)]?.[_0x22fdff(0x127)]&&(_0x26eaa5[_0x22fdff(0x16c)][_0x22fdff(0xe0)][_0x22fdff(0x127)]=_0x33212e(_0x26eaa5[_0x22fdff(0x16c)][_0x22fdff(0xe0)][_0x22fdff(0x127)]));}}}}};if(_0x4815b7[_0x4094cc(0x101)])for(const _0x251f86 of _0x4815b7['journeys']){_0x251f86[_0x4094cc(0x12f)]?.[_0x4094cc(0x127)]&&(_0x251f86[_0x4094cc(0x12f)]['segment']=_0x33212e(_0x251f86[_0x4094cc(0x12f)][_0x4094cc(0x127)])),_0x282ae5(_0x251f86['stages']);}_0x4815b7['stages']&&_0x282ae5(_0x4815b7[_0x4094cc(0xda)]);if(_0x4815b7[_0x4094cc(0x150)])for(const _0x1ddbfd of _0x4815b7[_0x4094cc(0x150)]){_0x282ae5(_0x1ddbfd[_0x4094cc(0xda)]);}}function collectActivationIdsFromJourney(_0x50c301,_0x1e9b37){const _0x42e8be=a109_0x1b1c,_0x53d7e0=_0x161b0c=>{const _0x24bb20=a109_0x1b1c;for(const _0x1509fc of _0x161b0c){if(_0x1509fc[_0x24bb20(0x111)])for(const _0x1b16b9 of _0x1509fc[_0x24bb20(0x111)]){if(_0x1b16b9[_0x24bb20(0x16a)]===_0x24bb20(0x1a1)){const _0x3d2793=_0x1b16b9;_0x3d2793[_0x24bb20(0x16c)][_0x24bb20(0x1a1)]&&/^\d+$/[_0x24bb20(0x112)](_0x3d2793['with']['activation'])&&_0x1e9b37['add'](_0x3d2793[_0x24bb20(0x16c)][_0x24bb20(0x1a1)]);}}}};if(_0x50c301[_0x42e8be(0x101)])for(const _0x40650b of _0x50c301[_0x42e8be(0x101)]){_0x53d7e0(_0x40650b[_0x42e8be(0xda)]);}_0x50c301[_0x42e8be(0xda)]&&_0x53d7e0(_0x50c301[_0x42e8be(0xda)]);if(_0x50c301[_0x42e8be(0x150)])for(const _0x3b3d59 of _0x50c301[_0x42e8be(0x150)]){_0x53d7e0(_0x3b3d59[_0x42e8be(0xda)]);}}function replaceActivationIdsInJourney(_0x5390f5,_0xb6f253){const _0x524397=a109_0x1b1c,_0x2532c1=_0x13d7dc=>_0xb6f253[_0x524397(0x126)](_0x13d7dc)||_0x13d7dc,_0x4c7f22=_0x21834f=>{const _0x33b33a=_0x524397;for(const _0x357223 of _0x21834f){if(_0x357223[_0x33b33a(0x111)])for(const _0x16c818 of _0x357223[_0x33b33a(0x111)]){if(_0x16c818[_0x33b33a(0x16a)]===_0x33b33a(0x1a1)){const _0x5e6028=_0x16c818;_0x5e6028[_0x33b33a(0x16c)]['activation']&&(_0x5e6028[_0x33b33a(0x16c)][_0x33b33a(0x1a1)]=_0x2532c1(_0x5e6028[_0x33b33a(0x16c)][_0x33b33a(0x1a1)]));}}}};if(_0x5390f5['journeys'])for(const _0x4f5718 of _0x5390f5[_0x524397(0x101)]){_0x4c7f22(_0x4f5718[_0x524397(0xda)]);}_0x5390f5[_0x524397(0xda)]&&_0x4c7f22(_0x5390f5[_0x524397(0xda)]);if(_0x5390f5['versions'])for(const _0x403645 of _0x5390f5[_0x524397(0x150)]){_0x4c7f22(_0x403645[_0x524397(0xda)]);}}function collectJumpTargetsFromJourney(_0x628061,_0xdafd80){const _0x243586=a109_0x1b1c,_0x312c70=new Set(),_0x189058=_0x23bf5a=>{const _0x1b06b0=a109_0x1b1c;for(const _0x2b8a94 of _0x23bf5a){if(_0x2b8a94[_0x1b06b0(0x111)])for(const _0x2dfa45 of _0x2b8a94[_0x1b06b0(0x111)]){if(_0x2dfa45[_0x1b06b0(0x16a)]===_0x1b06b0(0xd8)){const _0x37ff96=_0x2dfa45,_0x3995af=_0x37ff96[_0x1b06b0(0x16c)]['target'];if(_0x3995af[_0x1b06b0(0x19f)]&&_0x3995af[_0x1b06b0(0x164)]&&/^\d+$/[_0x1b06b0(0x112)](_0x3995af[_0x1b06b0(0x19f)])&&/^\d+$/['test'](_0x3995af[_0x1b06b0(0x164)])){const _0x8e5ed7=_0x3995af[_0x1b06b0(0x19f)]+':'+_0x3995af[_0x1b06b0(0x164)];!_0x312c70[_0x1b06b0(0x128)](_0x8e5ed7)&&(_0x312c70[_0x1b06b0(0xe2)](_0x8e5ed7),_0xdafd80['push']({'journeyId':_0x3995af[_0x1b06b0(0x19f)],'stageId':_0x3995af['stage']}));}}}}};if(_0x628061[_0x243586(0x101)])for(const _0x37fb1a of _0x628061[_0x243586(0x101)]){_0x189058(_0x37fb1a[_0x243586(0xda)]);}_0x628061['stages']&&_0x189058(_0x628061[_0x243586(0xda)]);if(_0x628061[_0x243586(0x150)])for(const _0x14e03f of _0x628061[_0x243586(0x150)]){_0x189058(_0x14e03f['stages']);}}function replaceJumpTargetsInJourney(_0x51e1bd,_0x5b717e){const _0x34cc85=a109_0x1b1c,_0x5e230c=_0x374345=>{const _0x41f1af=a109_0x1b1c;for(const _0xe27078 of _0x374345){if(_0xe27078[_0x41f1af(0x111)])for(const _0x111a86 of _0xe27078[_0x41f1af(0x111)]){if(_0x111a86[_0x41f1af(0x16a)]===_0x41f1af(0xd8)){const _0x47f484=_0x111a86,_0x12eb10=_0x47f484['with'][_0x41f1af(0x186)],_0x5c13fa=_0x12eb10[_0x41f1af(0x19f)]+':'+_0x12eb10[_0x41f1af(0x164)],_0x9213c3=_0x5b717e['get'](_0x5c13fa);_0x9213c3&&(_0x12eb10['journey']=_0x9213c3[_0x41f1af(0x10f)],_0x12eb10[_0x41f1af(0x164)]=_0x9213c3['stageName']);}}}};if(_0x51e1bd[_0x34cc85(0x101)])for(const _0x281255 of _0x51e1bd[_0x34cc85(0x101)]){_0x5e230c(_0x281255[_0x34cc85(0xda)]);}_0x51e1bd['stages']&&_0x5e230c(_0x51e1bd[_0x34cc85(0xda)]);if(_0x51e1bd[_0x34cc85(0x150)])for(const _0xe48d7b of _0x51e1bd[_0x34cc85(0x150)]){_0x5e230c(_0xe48d7b[_0x34cc85(0xda)]);}}function generateReadableStepName(_0x1e0116,_0x5cbde0){const _0x3d6d41=a109_0x1b1c;if(_0x1e0116[_0x3d6d41(0xdf)]&&_0x1e0116['name']!==_0x1e0116[_0x3d6d41(0x16a)]){const _0x4fbfa3=_0x1e0116['name'][_0x3d6d41(0x13e)]();if(_0x4fbfa3&&/[a-z0-9]/i[_0x3d6d41(0x112)](_0x4fbfa3))return _0x4fbfa3;}const _0x554022=_0x1e0116[_0x3d6d41(0x16a)]['toLowerCase']()[_0x3d6d41(0x11e)](/step$/i,'');return _0x554022+'_'+(_0x5cbde0+0x1);}function getStepNextRefs(_0x350469){const _0x1a2f16=a109_0x1b1c,_0xa87a73=[];if(_0x350469[_0x1a2f16(0x147)])_0xa87a73[_0x1a2f16(0x15e)](_0x350469[_0x1a2f16(0x147)]);if(_0x350469[_0x1a2f16(0xd2)])for(const _0x303bba of _0x350469[_0x1a2f16(0xd2)]){if(_0x303bba[_0x1a2f16(0x147)])_0xa87a73[_0x1a2f16(0x15e)](_0x303bba[_0x1a2f16(0x147)]);}if(_0x350469['variants'])for(const _0x16af81 of _0x350469[_0x1a2f16(0x157)]){if(_0x16af81[_0x1a2f16(0x147)])_0xa87a73[_0x1a2f16(0x15e)](_0x16af81[_0x1a2f16(0x147)]);}if(_0x350469[_0x1a2f16(0xf2)])for(const _0xb5ef2b of _0x350469[_0x1a2f16(0xf2)]){if(_0xb5ef2b['next'])_0xa87a73['push'](_0xb5ef2b[_0x1a2f16(0x147)]);}return _0xa87a73;}function parseJumpTargetDisplayName(_0x4113e1){const _0x260362=a109_0x1b1c,_0x4d9525=_0x4113e1[_0x260362(0x173)](/^(.+?)\s*\(([^/)]+)/);if(!_0x4d9525)return undefined;const _0x3c776d=_0x4d9525[0x1][_0x260362(0x13e)](),_0x3f7354=_0x4d9525[0x2][_0x260362(0x13e)]();if(!_0x3c776d||!_0x3f7354)return undefined;return{'stageName':_0x3c776d,'journeyName':_0x3f7354};}function orderStepsFromRoot(_0x4d7ac4,_0x34b8ca){const _0x47cd91=a109_0x1b1c,_0x81abf7=Object[_0x47cd91(0x14d)](_0x4d7ac4);if(_0x81abf7['length']===0x0)return[];const _0x3f8a55=new Set(_0x81abf7[_0x47cd91(0x15a)](([_0x3282df])=>_0x3282df)),_0x404a46=new Set();for(const [,_0x14fcf2]of _0x81abf7){for(const _0x50f041 of getStepNextRefs(_0x14fcf2)){if(_0x3f8a55[_0x47cd91(0x128)](_0x50f041))_0x404a46['add'](_0x50f041);}}let _0x195f4d=_0x34b8ca&&_0x3f8a55['has'](_0x34b8ca)?_0x34b8ca:undefined;if(!_0x195f4d){const _0x2d675c=_0x81abf7[_0x47cd91(0x156)](([_0x5d5302])=>!_0x404a46[_0x47cd91(0x128)](_0x5d5302));_0x2d675c[_0x47cd91(0x17e)]>0x0?_0x195f4d=_0x2d675c[0x0][0x0]:_0x195f4d=_0x81abf7[0x0][0x0];}const _0x51e7c1=[],_0x2f8544=new Set(),_0x2cdfc9=[_0x195f4d];while(_0x2cdfc9[_0x47cd91(0x17e)]>0x0){const _0x45e80e=_0x2cdfc9[_0x47cd91(0x12b)]();if(_0x2f8544['has'](_0x45e80e))continue;_0x2f8544[_0x47cd91(0xe2)](_0x45e80e);const _0x4a5efc=_0x4d7ac4[_0x45e80e];if(!_0x4a5efc)continue;_0x51e7c1[_0x47cd91(0x15e)]({'uuid':_0x45e80e,'step':_0x4a5efc});for(const _0x1e22ff of getStepNextRefs(_0x4a5efc)){_0x3f8a55[_0x47cd91(0x128)](_0x1e22ff)&&!_0x2f8544[_0x47cd91(0x128)](_0x1e22ff)&&_0x2cdfc9[_0x47cd91(0x15e)](_0x1e22ff);}}for(const [_0x3216aa,_0x55b31b]of _0x81abf7){!_0x2f8544[_0x47cd91(0x128)](_0x3216aa)&&_0x51e7c1[_0x47cd91(0x15e)]({'uuid':_0x3216aa,'step':_0x55b31b});}return _0x51e7c1;}function resolveStepReferences(_0x159ad8,_0x44b6e7,_0x23f448,_0x496a22){const _0x13b885=a109_0x1b1c;if(_0x159ad8[_0x13b885(0x16a)]!==_0x13b885(0x178)){_0x159ad8[_0x13b885(0x147)]&&_0x496a22[_0x13b885(0x128)](_0x159ad8[_0x13b885(0x147)])&&(_0x159ad8[_0x13b885(0x147)]=_0x496a22[_0x13b885(0x126)](_0x159ad8[_0x13b885(0x147)]));const _0x571fe1=_0x44b6e7+0x1;if(_0x571fe1<_0x23f448[_0x13b885(0x17e)]){const _0x496553=_0x496a22[_0x13b885(0x126)](_0x23f448[_0x571fe1][_0x13b885(0x175)]);_0x159ad8['next']===_0x496553&&delete _0x159ad8[_0x13b885(0x147)];}}if(_0x159ad8[_0x13b885(0x16a)]===_0x13b885(0x174))for(const _0x2ebdd3 of _0x159ad8['with'][_0x13b885(0xd2)]){_0x2ebdd3[_0x13b885(0x147)]&&_0x496a22[_0x13b885(0x128)](_0x2ebdd3[_0x13b885(0x147)])&&(_0x2ebdd3[_0x13b885(0x147)]=_0x496a22[_0x13b885(0x126)](_0x2ebdd3[_0x13b885(0x147)]));}if(_0x159ad8['type']===_0x13b885(0x19c))for(const _0x314d73 of _0x159ad8[_0x13b885(0x16c)]['variants']){_0x314d73[_0x13b885(0x147)]&&_0x496a22[_0x13b885(0x128)](_0x314d73[_0x13b885(0x147)])&&(_0x314d73[_0x13b885(0x147)]=_0x496a22['get'](_0x314d73[_0x13b885(0x147)]));}if(_0x159ad8[_0x13b885(0x16a)]===_0x13b885(0x125)&&_0x159ad8['with'][_0x13b885(0xe0)]){const _0x432302=_0x159ad8[_0x13b885(0x16c)][_0x13b885(0xe0)];_0x432302[_0x13b885(0x147)]&&_0x496a22[_0x13b885(0x128)](_0x432302[_0x13b885(0x147)])&&(_0x432302['next']=_0x496a22[_0x13b885(0x126)](_0x432302[_0x13b885(0x147)])),_0x432302['timeout']?.['next']&&_0x496a22['has'](_0x432302[_0x13b885(0x11a)][_0x13b885(0x147)])&&(_0x432302['timeout'][_0x13b885(0x147)]=_0x496a22[_0x13b885(0x126)](_0x432302[_0x13b885(0x11a)][_0x13b885(0x147)]));}}function convertApiStageToYaml(_0x48cee4){const _0x37e0f9=a109_0x1b1c,_0x468c76={'name':_0x48cee4['name']};_0x48cee4['id']&&(_0x468c76['id']=_0x48cee4['id']);_0x48cee4[_0x37e0f9(0x124)]&&(_0x468c76[_0x37e0f9(0x124)]=_0x48cee4[_0x37e0f9(0x124)]);_0x48cee4[_0x37e0f9(0xe9)]&&(_0x468c76['entry_criteria']=convertApiCriteriaToYaml(_0x48cee4[_0x37e0f9(0xe9)]));_0x48cee4[_0x37e0f9(0x184)]&&_0x48cee4['exitCriterias'][_0x37e0f9(0x17e)]>0x0&&(_0x468c76[_0x37e0f9(0x154)]=_0x48cee4['exitCriterias'][_0x37e0f9(0x15a)](convertApiCriteriaToYaml));_0x48cee4[_0x37e0f9(0x14a)]&&(_0x468c76[_0x37e0f9(0x14a)]=convertApiCriteriaToYaml(_0x48cee4['milestone']));if(_0x48cee4['steps']&&Object['keys'](_0x48cee4['steps'])['length']>0x0){const _0x27caed=orderStepsFromRoot(_0x48cee4[_0x37e0f9(0x111)],_0x48cee4[_0x37e0f9(0xd7)]),_0x45ac47=new Map(),_0x3ebed2=new Set();for(let _0x126831=0x0;_0x126831<_0x27caed[_0x37e0f9(0x17e)];_0x126831++){const {uuid:_0xc24b7f,step:_0x31d958}=_0x27caed[_0x126831];let _0x5311b3=generateReadableStepName(_0x31d958,_0x126831),_0x2b0952=_0x5311b3,_0x17d219=0x2;while(_0x3ebed2[_0x37e0f9(0x128)](_0x2b0952)){_0x2b0952=_0x5311b3+'_'+_0x17d219,_0x17d219++;}_0x3ebed2[_0x37e0f9(0xe2)](_0x2b0952),_0x45ac47[_0x37e0f9(0x11f)](_0xc24b7f,_0x2b0952);}_0x468c76[_0x37e0f9(0x111)]=_0x27caed['map'](({uuid:_0x21285d,step:_0x7dfb52},_0x5455cb)=>{const _0x390a63=_0x37e0f9,_0x4f2732=convertApiStepToYaml(_0x7dfb52,_0x45ac47[_0x390a63(0x126)](_0x21285d));return resolveStepReferences(_0x4f2732,_0x5455cb,_0x27caed,_0x45ac47),_0x4f2732;});}return _0x468c76;}function convertApiCriteriaToYaml(_0x5f58f7){const _0x172c81=a109_0x1b1c,_0x351679={'name':_0x5f58f7[_0x172c81(0xdf)],'segment':_0x5f58f7['segmentId']};_0x5f58f7[_0x172c81(0x124)]&&(_0x351679[_0x172c81(0x124)]=_0x5f58f7[_0x172c81(0x124)]);if(_0x5f58f7['target']){let _0x2313d8=_0x5f58f7['target'][_0x172c81(0xce)],_0x30b993=_0x5f58f7[_0x172c81(0x186)][_0x172c81(0x14b)];if(_0x5f58f7[_0x172c81(0x186)]['journeyName']){const _0x4b60d9=parseJumpTargetDisplayName(_0x5f58f7['target']['journeyName']);_0x4b60d9&&(_0x30b993=_0x4b60d9['stageName'],_0x2313d8=_0x4b60d9[_0x172c81(0x10f)]);}_0x351679[_0x172c81(0x186)]={'journey':_0x2313d8,'stage':_0x30b993},_0x5f58f7[_0x172c81(0x186)][_0x172c81(0xd9)]&&(_0x351679[_0x172c81(0x186)][_0x172c81(0x198)]=_0x5f58f7[_0x172c81(0x186)]['journeyBundleId']);}return _0x351679;}function convertApiStepToYaml(_0x2a982c,_0x504f32){const _0x35c61f=a109_0x1b1c;switch(_0x2a982c[_0x35c61f(0x16a)]){case _0x35c61f(0x145):{const _0x2c59d9={};if(_0x2a982c[_0x35c61f(0x16b)]==='Duration'&&_0x2a982c[_0x35c61f(0x130)]!==undefined)_0x2c59d9['duration']=_0x2a982c[_0x35c61f(0x130)],_0x2c59d9[_0x35c61f(0x135)]=_0x2a982c[_0x35c61f(0xe3)];else{if(_0x2a982c['waitStepType']===_0x35c61f(0x167)&&_0x2a982c[_0x35c61f(0x176)])_0x2c59d9[_0x35c61f(0xf9)]=_0x2a982c[_0x35c61f(0x176)];else{if(_0x2a982c[_0x35c61f(0x16b)]==='DaysOfTheWeek'&&_0x2a982c['daysOfWeek'])_0x2c59d9[_0x35c61f(0x1a0)]=_0x2a982c[_0x35c61f(0xd6)];else{if(_0x2a982c['waitStepType']===_0x35c61f(0x134)){if(_0x2a982c[_0x35c61f(0xf2)]&&_0x2a982c[_0x35c61f(0xf2)][_0x35c61f(0x17e)]>0x0){const _0x61f6e7=_0x2a982c[_0x35c61f(0xf2)][_0x35c61f(0x118)](_0x2c2f5e=>!_0x2c2f5e['timedOutPath']),_0x4c542d=_0x2a982c[_0x35c61f(0xf2)]['find'](_0x4583e2=>_0x4583e2[_0x35c61f(0x162)]);_0x61f6e7?.['segmentId']&&(_0x2c59d9[_0x35c61f(0xe0)]={'segment':_0x61f6e7[_0x35c61f(0x19d)],..._0x61f6e7[_0x35c61f(0x147)]?{'next':_0x61f6e7[_0x35c61f(0x147)]}:{}},_0x4c542d&&_0x4c542d[_0x35c61f(0xfb)]!==undefined&&_0x4c542d[_0x35c61f(0x135)]&&(_0x2c59d9[_0x35c61f(0xe0)]['timeout']={'duration':_0x4c542d['moveAfter'],'unit':_0x4c542d[_0x35c61f(0x135)],..._0x4c542d['next']?{'next':_0x4c542d[_0x35c61f(0x147)]}:{}}));}else _0x2a982c[_0x35c61f(0x139)]&&(_0x2c59d9[_0x35c61f(0xe0)]={'segment':_0x2a982c[_0x35c61f(0x139)]},_0x2a982c['conditionTimeoutDuration']!==undefined&&_0x2a982c['conditionTimeoutUnit']&&(_0x2c59d9[_0x35c61f(0xe0)][_0x35c61f(0x11a)]={'duration':_0x2a982c[_0x35c61f(0xfd)],'unit':_0x2a982c[_0x35c61f(0x11c)]}));}}}}const _0x5ac204={'type':_0x35c61f(0x125),'name':_0x504f32,..._0x2a982c[_0x35c61f(0x147)]?{'next':_0x2a982c[_0x35c61f(0x147)]}:{},'with':_0x2c59d9};return _0x5ac204;}case _0x35c61f(0x191):{const _0x46076d={'type':_0x35c61f(0x1a1),'name':_0x504f32,..._0x2a982c[_0x35c61f(0x147)]?{'next':_0x2a982c[_0x35c61f(0x147)]}:{},'with':{'activation':_0x2a982c[_0x35c61f(0xf0)]||''}};return _0x46076d;}case _0x35c61f(0xeb):{const _0x5dde0e={'type':_0x35c61f(0x174),'name':_0x504f32,..._0x2a982c[_0x35c61f(0x147)]?{'next':_0x2a982c['next']}:{},'with':{'branches':(_0x2a982c['branches']||[])['map'](_0x54f126=>({'name':_0x54f126['name'],'segment':_0x54f126[_0x35c61f(0x19d)],'excluded':_0x54f126[_0x35c61f(0x137)],..._0x54f126[_0x35c61f(0x147)]?{'next':_0x54f126[_0x35c61f(0x147)]}:{}}))}};return _0x5dde0e;}case _0x35c61f(0x16d):case _0x35c61f(0xf7):case _0x35c61f(0x110):{const _0x2fbfa3=_0x2a982c[_0x35c61f(0x157)]||(_0x2a982c[_0x35c61f(0xd2)]||[])[_0x35c61f(0x15a)](_0x506df9=>({'name':_0x506df9[_0x35c61f(0xdf)],'percentage':0x0,'next':_0x506df9['next']})),_0x2b4ffb={'type':'ab_test','name':_0x504f32,..._0x2a982c[_0x35c61f(0x147)]?{'next':_0x2a982c[_0x35c61f(0x147)]}:{},'with':{'customized_split':_0x2a982c[_0x35c61f(0x12a)],'unique_id':_0x2a982c['uniqueId'],'variants':_0x2fbfa3[_0x35c61f(0x15a)](_0x219e01=>({'name':_0x219e01[_0x35c61f(0xdf)],'percentage':_0x219e01['percentage'],..._0x219e01[_0x35c61f(0x147)]?{'next':_0x219e01[_0x35c61f(0x147)]}:{}}))}};return _0x2b4ffb;}case'Merge':{const _0x5f14a6={'type':_0x35c61f(0xfe),'name':_0x504f32,..._0x2a982c[_0x35c61f(0x147)]?{'next':_0x2a982c['next']}:{}};return _0x5f14a6;}case _0x35c61f(0x121):{if(!_0x2a982c[_0x35c61f(0x186)])throw new SDKError(ErrorCode[_0x35c61f(0x12d)],_0x35c61f(0xdc)+(_0x2a982c[_0x35c61f(0xdf)]||_0x504f32)+_0x35c61f(0x18b));let _0x257af2=_0x2a982c[_0x35c61f(0x186)]['journeyId'],_0x4b59b8=_0x2a982c[_0x35c61f(0x186)]['journeyStageId'];if(_0x2a982c['target'][_0x35c61f(0x10f)]){const _0x35505d=parseJumpTargetDisplayName(_0x2a982c[_0x35c61f(0x186)]['journeyName']);_0x35505d&&(_0x4b59b8=_0x35505d['stageName'],_0x257af2=_0x35505d['journeyName']);}const _0x3accaa={'type':_0x35c61f(0xd8),'name':_0x504f32,..._0x2a982c[_0x35c61f(0x147)]?{'next':_0x2a982c['next']}:{},'with':{'target':{'journey':_0x257af2,'stage':_0x4b59b8,'bundle_id':_0x2a982c['target'][_0x35c61f(0xd9)]}}};return _0x3accaa;}case'End':{const _0x2c5df6={'type':'end','name':_0x504f32};return _0x2c5df6;}default:{const _0x42a5f1={'type':_0x35c61f(0x178),'name':_0x504f32};return _0x42a5f1;}}}export async function journeyDefToRequest(_0x3069b5,_0x1cf14d,_0x3ebb30){const _0x375cd3=a109_0x1b1c,_0xdb44a8=_0x3069b5[_0x375cd3(0xda)]||getActiveStages(_0x3069b5),_0x3085d6=_0x3069b5['segments']||{},_0x1998bc=_0x3069b5[_0x375cd3(0xf8)]||{},_0x4950f5={'type':_0x375cd3(0x19f),'attributes':{'name':_0x3069b5['name'],'audienceId':_0x1cf14d,'journeyStages':await Promise[_0x375cd3(0x13c)](_0xdb44a8[_0x375cd3(0x15a)](_0x1d5ba6=>convertYamlStageToApi(_0x1d5ba6,_0x3ebb30,_0x3085d6,_0x1998bc)))}};_0x3069b5['id']&&(_0x4950f5['id']=_0x3069b5['id']);_0x3069b5[_0x375cd3(0x124)]&&(_0x4950f5['attributes'][_0x375cd3(0x124)]=_0x3069b5[_0x375cd3(0x124)]);const _0xaf5333=getEffectiveGoal(_0x3069b5);_0xaf5333&&(_0x4950f5[_0x375cd3(0xea)][_0x375cd3(0x12f)]=await convertYamlCriteriaToApi(_0xaf5333,_0x3ebb30,_0x3085d6));const _0x297eec=getEffectiveReentry(_0x3069b5);return _0x297eec&&(_0x4950f5[_0x375cd3(0xea)][_0x375cd3(0x10a)]=_0x297eec,_0x4950f5[_0x375cd3(0xea)]['allowReentry']=_0x297eec!=='no_reentry'),_0x3069b5[_0x375cd3(0x19e)]&&(_0x4950f5[_0x375cd3(0x16e)]={'parentFolder':{'data':{'id':_0x3069b5[_0x375cd3(0x19e)],'type':_0x375cd3(0x149)}}}),_0x4950f5;}async function convertYamlStageToApi(_0x5ad65b,_0x4c58d3,_0x13157a={},_0x1e34e6={}){const _0xdd5205=a109_0x1b1c,_0x11663f={'name':_0x5ad65b['name']};_0x5ad65b['id']&&(_0x11663f['id']=_0x5ad65b['id']);_0x5ad65b[_0xdd5205(0x124)]&&(_0x11663f[_0xdd5205(0x124)]=_0x5ad65b['description']);_0x5ad65b[_0xdd5205(0x18c)]&&(_0x11663f[_0xdd5205(0xe9)]=await convertYamlCriteriaToApi(_0x5ad65b[_0xdd5205(0x18c)],_0x4c58d3,_0x13157a));_0x5ad65b[_0xdd5205(0x154)]&&_0x5ad65b['exit_criteria'][_0xdd5205(0x17e)]>0x0&&(_0x11663f['exitCriterias']=await Promise[_0xdd5205(0x13c)](_0x5ad65b[_0xdd5205(0x154)]['map'](_0x165911=>convertYamlCriteriaToApi(_0x165911,_0x4c58d3,_0x13157a))));_0x5ad65b['milestone']&&(_0x11663f['milestone']=await convertYamlCriteriaToApi(_0x5ad65b[_0xdd5205(0x14a)],_0x4c58d3,_0x13157a));if(_0x5ad65b[_0xdd5205(0x111)]&&_0x5ad65b['steps'][_0xdd5205(0x17e)]>0x0){const _0x2fdd08={},_0x301213=_0x5ad65b['steps'][_0xdd5205(0x15a)]((_0x176326,_0x4c9503)=>{const _0x2ada2b=_0xdd5205,_0x8f9a58=_0x176326[_0x2ada2b(0x175)]||generateUUID(),_0x28aafb=_0x176326[_0x2ada2b(0xdf)]||_0x176326[_0x2ada2b(0x16a)]+'_'+_0x4c9503;return _0x2fdd08[_0x28aafb]=_0x8f9a58,{..._0x176326,'name':_0x28aafb};});_0x11663f['rootStep']=_0x2fdd08[_0x301213[0x0][_0xdd5205(0xdf)]],_0x11663f[_0xdd5205(0x111)]={};for(let _0x5ac6e6=0x0;_0x5ac6e6<_0x301213[_0xdd5205(0x17e)];_0x5ac6e6++){const _0x46c288=_0x301213[_0x5ac6e6],_0x21049c=_0x2fdd08[_0x46c288[_0xdd5205(0xdf)]],_0x3c2bbe=!_0x46c288['next']&&_0x5ac6e6<_0x301213[_0xdd5205(0x17e)]-0x1&&_0x46c288['type']!=='end'?_0x301213[_0x5ac6e6+0x1][_0xdd5205(0xdf)]:_0x46c288['next'],_0x576821=_0x3c2bbe!==_0x46c288[_0xdd5205(0x147)]?{..._0x46c288,'next':_0x3c2bbe}:_0x46c288;_0x11663f[_0xdd5205(0x111)][_0x21049c]=await convertYamlStepToApi(_0x576821,_0x4c58d3,_0x13157a,_0x2fdd08,_0x1e34e6);}}else _0x5ad65b[_0xdd5205(0x182)]&&(_0x11663f[_0xdd5205(0xd7)]=_0x5ad65b['root_step']);return _0x11663f;}async function convertYamlCriteriaToApi(_0x3e1b4e,_0xadd4ff,_0x6449f9={}){const _0x22474f=a109_0x1b1c;let _0x66d79c=_0x3e1b4e['segment'];if(_0x66d79c&&!/^\d+$/[_0x22474f(0x112)](_0x66d79c)){const _0x5648cf=parseSegmentRef(_0x66d79c);if(_0x5648cf[_0x22474f(0x16a)]===_0x22474f(0x122))_0xadd4ff?.['resolveSegmentId']&&(_0x66d79c=await _0xadd4ff[_0x22474f(0x194)](_0x5648cf[_0x22474f(0xdf)]));else{if(_0x5648cf[_0x22474f(0x16a)]===_0x22474f(0x165)&&_0x6449f9[_0x5648cf[_0x22474f(0xdf)]])_0xadd4ff?.['resolveEmbeddedSegmentId']&&(_0x66d79c=await _0xadd4ff[_0x22474f(0x1a3)](_0x5648cf['name'],_0x6449f9[_0x5648cf[_0x22474f(0xdf)]]));else _0xadd4ff?.[_0x22474f(0x194)]&&(_0x66d79c=await _0xadd4ff[_0x22474f(0x194)](_0x5648cf[_0x22474f(0xdf)]));}}const _0x57cb67={'name':_0x3e1b4e[_0x22474f(0xdf)],'segmentId':_0x66d79c};_0x3e1b4e[_0x22474f(0x124)]&&(_0x57cb67[_0x22474f(0x124)]=_0x3e1b4e[_0x22474f(0x124)]);if(_0x3e1b4e[_0x22474f(0x186)]){const _0x22a3fd=_0x3e1b4e[_0x22474f(0x186)][_0x22474f(0x19f)],_0x58ff25=_0x3e1b4e[_0x22474f(0x186)][_0x22474f(0x164)];let _0x4943d4=_0x3e1b4e[_0x22474f(0x186)]['journey'];_0xadd4ff?.[_0x22474f(0x17b)]&&!/^\d+$/[_0x22474f(0x112)](_0x4943d4)&&(_0x4943d4=await _0xadd4ff[_0x22474f(0x17b)](_0x4943d4));let _0x8c27de=_0x3e1b4e[_0x22474f(0x186)][_0x22474f(0x164)];_0xadd4ff?.[_0x22474f(0x179)]&&!/^\d+$/[_0x22474f(0x112)](_0x8c27de)&&(_0x8c27de=await _0xadd4ff[_0x22474f(0x179)](_0x4943d4,_0x8c27de));const _0x5678fe=!/^\d+$/[_0x22474f(0x112)](_0x22a3fd)&&!isLocalJourneyRef(_0x22a3fd)?formatApiJourneyName(_0x22a3fd,_0x58ff25):undefined;_0x57cb67['target']={'journeyId':_0x4943d4,'journeyStageId':_0x8c27de,'journeyName':_0x5678fe,'confirmed':!![]},_0x3e1b4e[_0x22474f(0x186)]['bundle_id']&&(_0x57cb67[_0x22474f(0x186)]['journeyBundleId']=_0x3e1b4e['target'][_0x22474f(0x198)]);}return _0x57cb67;}async function convertYamlStepToApi(_0x1ddaf8,_0x10335c,_0x5ea923={},_0x20896f={},_0x563e48={}){const _0x1b18d2=a109_0x1b1c,_0x568ecc=async _0x122aa0=>{const _0x2eb1e1=a109_0x1b1c;if(/^\d+$/[_0x2eb1e1(0x112)](_0x122aa0))return _0x122aa0;const _0x58d864=parseSegmentRef(_0x122aa0);if(_0x58d864[_0x2eb1e1(0x16a)]===_0x2eb1e1(0x122)){if(_0x10335c?.[_0x2eb1e1(0x194)])return await _0x10335c[_0x2eb1e1(0x194)](_0x58d864[_0x2eb1e1(0xdf)]);}else{if(_0x58d864[_0x2eb1e1(0x16a)]===_0x2eb1e1(0x165)&&_0x5ea923[_0x58d864[_0x2eb1e1(0xdf)]]){if(_0x10335c?.[_0x2eb1e1(0x1a3)])return await _0x10335c[_0x2eb1e1(0x1a3)](_0x58d864['name'],_0x5ea923[_0x58d864['name']]);}else{if(_0x10335c?.[_0x2eb1e1(0x194)])return await _0x10335c[_0x2eb1e1(0x194)](_0x58d864[_0x2eb1e1(0xdf)]);}}return _0x122aa0;},_0x21ec5f=async _0x387d32=>{const _0x34b936=a109_0x1b1c;if(/^\d+$/[_0x34b936(0x112)](_0x387d32))return _0x387d32;const _0x522372=parseSegmentRef(_0x387d32);if(_0x522372[_0x34b936(0x16a)]===_0x34b936(0x122)){if(_0x10335c?.[_0x34b936(0x188)])return await _0x10335c['resolveActivationId'](_0x522372[_0x34b936(0xdf)]);return _0x522372[_0x34b936(0xdf)];}else{if(_0x522372[_0x34b936(0x16a)]===_0x34b936(0x165)&&_0x563e48[_0x522372[_0x34b936(0xdf)]]){if(_0x10335c?.[_0x34b936(0x15d)])return await _0x10335c['resolveEmbeddedActivationId'](_0x522372['name'],_0x563e48[_0x522372[_0x34b936(0xdf)]]);if(_0x10335c?.[_0x34b936(0x188)])return await _0x10335c[_0x34b936(0x188)](_0x522372[_0x34b936(0xdf)]);}else{if(_0x10335c?.['resolveActivationId'])return await _0x10335c[_0x34b936(0x188)](_0x522372[_0x34b936(0xdf)]);}}return _0x387d32;},_0x1ec11e=_0xa1239b=>{const _0x2569ec=a109_0x1b1c;if(!_0xa1239b)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x2569ec(0x112)](_0xa1239b))return _0xa1239b;return _0x20896f[_0xa1239b]||_0xa1239b;};switch(_0x1ddaf8[_0x1b18d2(0x16a)]){case _0x1b18d2(0x125):{const _0x2d335b=_0x1ddaf8,_0x4cbda1=_0x2d335b[_0x1b18d2(0x16c)],_0xc8865b={'type':'WaitStep','name':_0x2d335b[_0x1b18d2(0xdf)],'next':_0x1ec11e(_0x2d335b[_0x1b18d2(0x147)])};if(_0x4cbda1[_0x1b18d2(0x120)]!==undefined&&_0x4cbda1['unit'])_0xc8865b[_0x1b18d2(0x16b)]=_0x1b18d2(0xee),_0xc8865b[_0x1b18d2(0x130)]=_0x4cbda1[_0x1b18d2(0x120)],_0xc8865b[_0x1b18d2(0xe3)]=normalizeWaitUnit(_0x4cbda1[_0x1b18d2(0x135)]);else{if(_0x4cbda1[_0x1b18d2(0xf9)])_0xc8865b[_0x1b18d2(0x16b)]=_0x1b18d2(0x167),_0xc8865b[_0x1b18d2(0x176)]=_0x4cbda1[_0x1b18d2(0xf9)];else{if(_0x4cbda1[_0x1b18d2(0x1a0)])_0xc8865b[_0x1b18d2(0x16b)]=_0x1b18d2(0x1a4),_0xc8865b[_0x1b18d2(0xd6)]=_0x4cbda1[_0x1b18d2(0x1a0)];else{if(_0x4cbda1['condition']){_0xc8865b[_0x1b18d2(0x16b)]=_0x1b18d2(0x134);const _0x22d482=await _0x568ecc(_0x4cbda1[_0x1b18d2(0xe0)]['segment']),_0x4e6b3a=_0x4cbda1[_0x1b18d2(0xe0)][_0x1b18d2(0x11a)]?.[_0x1b18d2(0x147)]!==undefined;if(_0x4e6b3a){const _0x10b9ea=[];_0x10b9ea[_0x1b18d2(0x15e)]({'id':generateUUID(),'segmentId':_0x22d482,'timedOutPath':![],'name':_0x1b18d2(0x193),'next':_0x1ec11e(_0x4cbda1['condition'][_0x1b18d2(0x147)]??_0x2d335b['next'])});if(_0x4cbda1[_0x1b18d2(0xe0)][_0x1b18d2(0x11a)]){const _0xdad439=_0x4cbda1[_0x1b18d2(0xe0)][_0x1b18d2(0x11a)][_0x1b18d2(0x120)],_0x291609=normalizeWaitUnit(_0x4cbda1[_0x1b18d2(0xe0)][_0x1b18d2(0x11a)]['unit']);_0x10b9ea[_0x1b18d2(0x15e)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x1b18d2(0xde)+_0xdad439+'\x20'+_0x291609,'moveAfter':_0xdad439,'unit':_0x291609,'next':_0x1ec11e(_0x4cbda1[_0x1b18d2(0xe0)][_0x1b18d2(0x11a)][_0x1b18d2(0x147)])});}_0xc8865b['conditions']=_0x10b9ea,delete _0xc8865b[_0x1b18d2(0x147)];}else _0xc8865b['conditionSegmentId']=_0x22d482,_0x4cbda1[_0x1b18d2(0xe0)][_0x1b18d2(0x11a)]&&(_0xc8865b[_0x1b18d2(0xfd)]=_0x4cbda1[_0x1b18d2(0xe0)]['timeout'][_0x1b18d2(0x120)],_0x4cbda1[_0x1b18d2(0xe0)][_0x1b18d2(0x11a)][_0x1b18d2(0x135)]&&(_0xc8865b[_0x1b18d2(0x11c)]=normalizeWaitUnit(_0x4cbda1['condition'][_0x1b18d2(0x11a)]['unit'])));}}}}return _0xc8865b;}case'activation':{const _0x233b49=_0x1ddaf8,_0x127114=_0x233b49[_0x1b18d2(0x16c)][_0x1b18d2(0x1a1)],_0x4ebb9e=await _0x21ec5f(_0x127114);return{'type':_0x1b18d2(0x191),'name':_0x233b49[_0x1b18d2(0xdf)],'journeyActivationStepId':_0x4ebb9e,'next':_0x1ec11e(_0x233b49[_0x1b18d2(0x147)])};}case _0x1b18d2(0x174):{const _0x19d5b2=_0x1ddaf8,_0x5769e8=_0x19d5b2[_0x1b18d2(0x16c)][_0x1b18d2(0xd2)];return{'type':_0x1b18d2(0xeb),'name':_0x19d5b2[_0x1b18d2(0xdf)],'branches':await Promise['all'](_0x5769e8[_0x1b18d2(0x15a)](async _0x3fb055=>{const _0x2079fa=_0x1b18d2;let _0x4f1d4e='';if(!_0x3fb055['excluded']){const _0x14e3ea=_0x3fb055[_0x2079fa(0x127)]||_0x3fb055[_0x2079fa(0x199)]||'';_0x4f1d4e=_0x14e3ea?await _0x568ecc(_0x14e3ea):'';}return{'id':crypto['randomUUID'](),'name':_0x3fb055['name'],'description':null,'segmentId':_0x4f1d4e,'excludedPath':_0x3fb055[_0x2079fa(0x196)]??![],'next':_0x1ec11e(_0x3fb055[_0x2079fa(0x147)])};})),'next':_0x1ec11e(_0x19d5b2[_0x1b18d2(0x147)])};}case _0x1b18d2(0x19c):{const _0x2f604d=_0x1ddaf8,_0xdd7548=_0x2f604d[_0x1b18d2(0x16c)];return{'type':'ABTest','name':_0x2f604d['name'],'customizedSplit':_0xdd7548[_0x1b18d2(0x123)],'uniqueId':_0xdd7548[_0x1b18d2(0x18e)],'variants':_0xdd7548[_0x1b18d2(0x157)][_0x1b18d2(0x15a)](_0x1c21c2=>({'id':_0x1c21c2['id']||generateUUID(),'name':_0x1c21c2[_0x1b18d2(0xdf)],'percentage':_0x1c21c2[_0x1b18d2(0x143)],'next':_0x1ec11e(_0x1c21c2[_0x1b18d2(0x147)])})),'next':_0x1ec11e(_0x2f604d[_0x1b18d2(0x147)])};}case'merge':return{'type':'Merge','name':_0x1ddaf8[_0x1b18d2(0xdf)],'next':_0x1ec11e(_0x1ddaf8[_0x1b18d2(0x147)])};case _0x1b18d2(0xd8):{const _0x317073=_0x1ddaf8,_0x159f7d=_0x317073[_0x1b18d2(0x16c)][_0x1b18d2(0x186)],_0x10b903=_0x159f7d[_0x1b18d2(0x19f)],_0x27ac10=_0x159f7d['stage'];let _0x4233a0=_0x159f7d[_0x1b18d2(0x19f)];_0x10335c?.['resolveJourneyId']&&!/^\d+$/[_0x1b18d2(0x112)](_0x4233a0)&&(_0x4233a0=await _0x10335c['resolveJourneyId'](_0x4233a0));let _0x2f6b19=_0x159f7d[_0x1b18d2(0x164)];_0x10335c?.[_0x1b18d2(0x179)]&&!/^\d+$/[_0x1b18d2(0x112)](_0x2f6b19)&&(_0x2f6b19=await _0x10335c[_0x1b18d2(0x179)](_0x4233a0,_0x2f6b19));const _0x268158=!/^\d+$/[_0x1b18d2(0x112)](_0x10b903)&&!isLocalJourneyRef(_0x10b903)?formatApiJourneyName(_0x10b903,_0x27ac10):undefined;return{'type':'Jump','name':_0x317073[_0x1b18d2(0xdf)],'target':{'journeyId':_0x4233a0,'journeyStageId':_0x2f6b19,'journeyBundleId':_0x159f7d['bundle_id'],'journeyName':_0x268158,'confirmed':!![]},'next':_0x1ec11e(_0x317073[_0x1b18d2(0x147)])};}case _0x1b18d2(0x178):return{'type':_0x1b18d2(0xf6),'name':_0x1ddaf8[_0x1b18d2(0xdf)]};default:{const _0x374fa0=_0x1ddaf8;return{'type':_0x1b18d2(0xf6),'name':_0x374fa0['name']};}}}export function toYamlString(_0x39fbef){const _0x126504=a109_0x1b1c,_0x5d2d5b=stripInternalFields(_0x39fbef),_0x4e8c23=a109_0x5d0f75[_0x126504(0x18a)](_0x5d2d5b,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x3439d9=[_0x126504(0x11d),_0x126504(0x19a),_0x126504(0x183),'reentry:',_0x126504(0x151),_0x126504(0xec),'versions:'];let _0x4b338a=_0x4e8c23;for(const _0x2cc6e6 of _0x3439d9){_0x4b338a=_0x4b338a[_0x126504(0x11e)](new RegExp('^('+_0x2cc6e6+')','m'),(_0x12ade0,_0xd8b3ae,_0x1006dc)=>{if(_0x1006dc===0x0||_0x4b338a[_0x1006dc-0x1]==='\x0a'&&_0x4b338a[_0x1006dc-0x2]==='\x0a')return _0xd8b3ae;return'\x0a'+_0xd8b3ae;});}return _0x4b338a;}function stripInternalFields(_0x18a4d6){const _0x544a27=a109_0x1b1c,{id:_0x1bd3f2,folder_id:_0x7f0cb1,bundle_id:_0xbfca06,bundle_name:_0x33f2ce,version:_0x4e6bf6,version_number:_0x5707a6,allow_reentry:_0x105d1f,..._0x631c69}=_0x18a4d6;return _0x631c69['journeys']&&(_0x631c69[_0x544a27(0x101)]=_0x631c69[_0x544a27(0x101)][_0x544a27(0x15a)](_0x501e78=>{const _0x2bcfe6=_0x544a27,{id:_0x12d15f,version_number:_0x37151a,..._0x36f09b}=_0x501e78;return{..._0x36f09b,'stages':_0x36f09b[_0x2bcfe6(0xda)][_0x2bcfe6(0x15a)](stripStageInternalFields),..._0x501e78[_0x2bcfe6(0x119)]===!![]?{'latest':!![]}:{},..._0x631c69[_0x2bcfe6(0x101)]['length']===0x1&&_0x36f09b[_0x2bcfe6(0x160)]==='v1'?{'version':undefined}:{}};})),_0x631c69[_0x544a27(0xda)]&&(_0x631c69[_0x544a27(0xda)]=_0x631c69[_0x544a27(0xda)][_0x544a27(0x15a)](stripStageInternalFields)),_0x631c69['versions']&&(_0x631c69[_0x544a27(0x150)]=_0x631c69[_0x544a27(0x150)][_0x544a27(0x15a)](_0x57175a=>{const _0x49aea9=_0x544a27,{id:_0x26da1a,version_number:_0x3cce6f,..._0x1bdcf6}=_0x57175a;return{..._0x1bdcf6,'stages':_0x1bdcf6[_0x49aea9(0xda)][_0x49aea9(0x15a)](stripStageInternalFields),..._0x57175a[_0x49aea9(0x119)]===!![]?{'latest':!![]}:{}};})),_0x631c69;}function stripStageInternalFields(_0x294b53){const {id:_0x12c38b,..._0xb631d}=_0x294b53;return _0xb631d;}export function parseYamlString(_0xdba80d){const _0x250cc3=a109_0x1b1c,_0x2395fd=a109_0x5d0f75[_0x250cc3(0x192)](_0xdba80d);if(_0x2395fd[_0x250cc3(0x16a)]!==_0x250cc3(0x19f))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x250cc3(0x116));if(!_0x2395fd[_0x250cc3(0xdf)])throw new SDKError(ErrorCode[_0x250cc3(0x12d)],'Journey\x20YAML\x20missing\x20required\x20field:\x20name');const _0x2c1afe=_0x2395fd[_0x250cc3(0x101)]&&Array[_0x250cc3(0xe1)](_0x2395fd[_0x250cc3(0x101)])&&_0x2395fd[_0x250cc3(0x101)][_0x250cc3(0x17e)]>0x0,_0x511a18=_0x2395fd[_0x250cc3(0xda)]&&Array[_0x250cc3(0xe1)](_0x2395fd[_0x250cc3(0xda)])&&_0x2395fd[_0x250cc3(0xda)][_0x250cc3(0x17e)]>0x0,_0x567414=_0x2395fd[_0x250cc3(0x150)]&&Array[_0x250cc3(0xe1)](_0x2395fd[_0x250cc3(0x150)])&&_0x2395fd[_0x250cc3(0x150)]['length']>0x0,_0x7d2747=[_0x2c1afe,_0x511a18,_0x567414][_0x250cc3(0x156)](Boolean)['length'];if(_0x7d2747>0x1)throw new SDKError(ErrorCode[_0x250cc3(0x12d)],'Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.');if(_0x7d2747===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x250cc3(0x152));if(_0x2c1afe){for(let _0x47efaf=0x0;_0x47efaf<_0x2395fd[_0x250cc3(0x101)][_0x250cc3(0x17e)];_0x47efaf++){const _0x35561c=_0x2395fd[_0x250cc3(0x101)][_0x47efaf];if(!_0x35561c['stages']||!Array[_0x250cc3(0xe1)](_0x35561c[_0x250cc3(0xda)])||_0x35561c['stages'][_0x250cc3(0x17e)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x250cc3(0x17f)+_0x47efaf+_0x250cc3(0x11b));if(_0x35561c[_0x250cc3(0x166)]&&![_0x250cc3(0x113),'launched'][_0x250cc3(0x10c)](_0x35561c['state']))throw new SDKError(ErrorCode[_0x250cc3(0x12d)],'Journey\x20YAML\x20journeys['+_0x47efaf+_0x250cc3(0x15c)+_0x35561c['state']+_0x250cc3(0x14f));validateStages(_0x35561c['stages'],_0x250cc3(0x197)+_0x47efaf+_0x250cc3(0x106));}const _0x50b9c5=_0x2395fd['journeys']['filter'](_0x2acff1=>_0x2acff1['latest']===!![])[_0x250cc3(0x17e)];if(_0x50b9c5>0x1)throw new SDKError(ErrorCode[_0x250cc3(0x12d)],'Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true');}_0x511a18&&validateStages(_0x2395fd[_0x250cc3(0xda)],_0x250cc3(0xda));if(_0x567414){for(let _0x4c9158=0x0;_0x4c9158<_0x2395fd[_0x250cc3(0x150)][_0x250cc3(0x17e)];_0x4c9158++){const _0x5f22ba=_0x2395fd['versions'][_0x4c9158];if(!_0x5f22ba[_0x250cc3(0xdf)])throw new SDKError(ErrorCode[_0x250cc3(0x12d)],_0x250cc3(0x103)+_0x4c9158+_0x250cc3(0x140));if(!_0x5f22ba[_0x250cc3(0x166)]||!['draft',_0x250cc3(0xf3)][_0x250cc3(0x10c)](_0x5f22ba[_0x250cc3(0x166)]))throw new SDKError(ErrorCode[_0x250cc3(0x12d)],_0x250cc3(0x103)+_0x4c9158+_0x250cc3(0x15c)+_0x5f22ba[_0x250cc3(0x166)]+_0x250cc3(0x14f));if(!_0x5f22ba['stages']||!Array['isArray'](_0x5f22ba[_0x250cc3(0xda)])||_0x5f22ba[_0x250cc3(0xda)][_0x250cc3(0x17e)]===0x0)throw new SDKError(ErrorCode[_0x250cc3(0x12d)],_0x250cc3(0x103)+_0x4c9158+_0x250cc3(0x11b));validateStages(_0x5f22ba['stages'],'versions['+_0x4c9158+'].stages');}const _0x181d02=_0x2395fd[_0x250cc3(0x150)][_0x250cc3(0x156)](_0x268357=>_0x268357['latest']===!![])[_0x250cc3(0x17e)];if(_0x181d02>0x1)throw new SDKError(ErrorCode[_0x250cc3(0x12d)],_0x250cc3(0x181));}return _0x2395fd;}function validateStages(_0x34a391,_0x41b63f){const _0x32388e=a109_0x1b1c;if(_0x34a391[_0x32388e(0x17e)]>0x8)throw new SDKError(ErrorCode[_0x32388e(0x12d)],_0x32388e(0x102)+_0x41b63f+_0x32388e(0x108));}export function isJourneyDef(_0x544d45){const _0x2b2844=a109_0x1b1c;return typeof _0x544d45===_0x2b2844(0x180)&&_0x544d45!==null&&_0x2b2844(0x16a)in _0x544d45&&_0x544d45[_0x2b2844(0x16a)]===_0x2b2844(0x19f);}export function generateTemplate(_0x303071,_0x43ec57){const _0x4715ce=a109_0x1b1c,_0x55b137={'type':_0x4715ce(0x19f),'name':_0x303071,'description':_0x4715ce(0xf4),'reentry':'no_reentry','goal':{'name':_0x4715ce(0x17c),'segment':_0x4715ce(0x107)},'stages':[{'name':_0x4715ce(0x100),'description':_0x4715ce(0x14e),'entry_criteria':{'name':_0x4715ce(0x171),'segment':_0x43ec57},'steps':[{'type':_0x4715ce(0x125),'name':_0x4715ce(0x142),'with':{'duration':0x1,'unit':'day'}},{'type':'activation','name':_0x4715ce(0x138),'with':{'activation':_0x4715ce(0x168)}},{'type':_0x4715ce(0x178),'name':'Stage\x20Complete'}]}]};return toYamlString(_0x55b137);}function generateUUID(){const _0x4f9b03=a109_0x1b1c;return crypto[_0x4f9b03(0x117)]();}export const SEGMENT_REF_PREFIX=a109_0x447522(0x187);export function parseSegmentRef(_0x6f8d8c){const _0x5a05df=a109_0x447522;if(_0x6f8d8c['startsWith'](SEGMENT_REF_PREFIX))return{'type':_0x5a05df(0x122),'name':_0x6f8d8c[_0x5a05df(0x14c)](SEGMENT_REF_PREFIX[_0x5a05df(0x17e)])};if(/^\d+$/[_0x5a05df(0x112)](_0x6f8d8c))return{'type':'id','name':_0x6f8d8c};return{'type':_0x5a05df(0x165),'name':_0x6f8d8c};}export function makeSegmentRef(_0x1cd716){return''+SEGMENT_REF_PREFIX+_0x1cd716;}export function isExternalSegmentRef(_0x1663bb){return _0x1663bb['startsWith'](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x5ce359){const _0xdd5b94=a109_0x447522;return!!(_0x5ce359[_0xdd5b94(0x101)]&&_0x5ce359['journeys'][_0xdd5b94(0x17e)]>0x0);}export function isMultiVersionMode(_0x55b180){const _0x2d4d26=a109_0x447522;return!!(_0x55b180[_0x2d4d26(0x150)]&&_0x55b180[_0x2d4d26(0x150)]['length']>0x0);}export function isSingleVersionMode(_0x4b4da9){const _0x35fe42=a109_0x447522;return!!(_0x4b4da9['stages']&&_0x4b4da9[_0x35fe42(0xda)]['length']>0x0);}export function hasMultipleVersions(_0x100023){const _0x977e47=a109_0x447522;if(isJourneysArrayMode(_0x100023))return(_0x100023[_0x977e47(0x101)]?.[_0x977e47(0x17e)]||0x0)>0x1;if(isMultiVersionMode(_0x100023))return(_0x100023[_0x977e47(0x150)]?.[_0x977e47(0x17e)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x5e8866){const _0x33a172=a109_0x447522;if(isJourneysArrayMode(_0x5e8866))return _0x5e8866;if(isSingleVersionMode(_0x5e8866)){const {stages:_0x4cfc8e,id:_0x3b25ce,version:_0x478e1c,version_number:_0x3c23b6,..._0x2c22b0}=_0x5e8866;return{..._0x2c22b0,'journeys':[{'version':_0x478e1c||'v1','stages':_0x4cfc8e||[],'id':_0x3b25ce,'version_number':_0x3c23b6}]};}if(isMultiVersionMode(_0x5e8866)){const {versions:_0x110e7e,..._0xcabdb4}=_0x5e8866;return{..._0xcabdb4,'journeys':(_0x110e7e||[])[_0x33a172(0x15a)](_0x46cbac=>({'version':_0x46cbac[_0x33a172(0xdf)],'state':_0x46cbac[_0x33a172(0x166)],'latest':_0x46cbac[_0x33a172(0x119)],'stages':_0x46cbac[_0x33a172(0xda)],'id':_0x46cbac['id'],'version_number':_0x46cbac[_0x33a172(0x146)]}))};}return _0x5e8866;}export function normalizeJourneyDef(_0x4ff890,_0x34517a){const _0x430460=a109_0x447522,_0x4ad612=normalizeToJourneysFormat(_0x4ff890),_0xdac22a=_0x34517a?.['segments']?Object['keys'](_0x34517a[_0x430460(0x13f)]):undefined,_0x11dd73=_0x34517a?.[_0x430460(0xf8)]?Object[_0x430460(0xe5)](_0x34517a[_0x430460(0xf8)]):undefined;return{'type':_0x430460(0x19f),'name':_0x4ad612[_0x430460(0xdf)],..._0x4ad612[_0x430460(0x124)]!==undefined&&{'description':_0x4ad612['description']},..._0x4ad612[_0x430460(0x12f)]&&{'goal':normalizeJourneyCriteria(_0x4ad612[_0x430460(0x12f)])},..._0x4ad612[_0x430460(0xd0)]!==undefined&&{'reentry':_0x4ad612[_0x430460(0xd0)]},..._0x4ad612['segments']&&{'segments':normalizeEmbeddedSegments(_0x4ad612[_0x430460(0x13f)],_0xdac22a)},..._0x4ad612[_0x430460(0xf8)]&&{'activations':normalizeEmbeddedActivations(_0x4ad612['activations'],_0x11dd73)},..._0x4ad612[_0x430460(0x101)]&&{'journeys':_0x4ad612[_0x430460(0x101)][_0x430460(0x15a)](_0x5a83e7=>normalizeJourneyEntry(_0x5a83e7,_0x4ad612['journeys'][_0x430460(0x17e)]===0x1))}};}function normalizeJourneyEntry(_0x5d1301,_0x2bb8ca){const _0x263563=a109_0x447522;return{...!_0x2bb8ca&&_0x5d1301[_0x263563(0x160)]!==undefined&&{'version':_0x5d1301['version']},..._0x5d1301[_0x263563(0x166)]!==undefined&&{'state':_0x5d1301[_0x263563(0x166)]},...!_0x2bb8ca&&_0x5d1301[_0x263563(0x119)]!==undefined&&{'latest':_0x5d1301[_0x263563(0x119)]},..._0x5d1301[_0x263563(0x12f)]&&{'goal':normalizeJourneyCriteria(_0x5d1301[_0x263563(0x12f)])},..._0x5d1301[_0x263563(0xd0)]!==undefined&&{'reentry':_0x5d1301['reentry']},'stages':_0x5d1301['stages']['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x22fc63){const _0x21e970=a109_0x447522;return{'name':_0x22fc63[_0x21e970(0xdf)],..._0x22fc63['description']!==undefined&&{'description':_0x22fc63[_0x21e970(0x124)]},..._0x22fc63[_0x21e970(0x18c)]&&{'entry_criteria':normalizeJourneyCriteria(_0x22fc63[_0x21e970(0x18c)])},..._0x22fc63[_0x21e970(0x154)]&&{'exit_criteria':_0x22fc63['exit_criteria'][_0x21e970(0x15a)](normalizeJourneyCriteria)},..._0x22fc63[_0x21e970(0x14a)]&&{'milestone':normalizeJourneyCriteria(_0x22fc63[_0x21e970(0x14a)])},..._0x22fc63[_0x21e970(0x111)]&&{'steps':normalizeStepsWithImplicitNext(_0x22fc63[_0x21e970(0x111)])}};}function normalizeStepsWithImplicitNext(_0x3524e2){const _0x327667=a109_0x447522;return _0x3524e2[_0x327667(0x15a)]((_0x20a310,_0x3d2653)=>{const _0x179125=_0x327667,_0x4b60f8=_0x3d2653<_0x3524e2[_0x179125(0x17e)]-0x1?_0x3524e2[_0x3d2653+0x1][_0x179125(0xdf)]:undefined;return normalizeJourneyStep(_0x20a310,_0x4b60f8);});}function normalizeJourneyCriteria(_0x3ed184){const _0x3f5bf0=a109_0x447522;return{'name':_0x3ed184[_0x3f5bf0(0xdf)],..._0x3ed184[_0x3f5bf0(0x124)]!==undefined&&{'description':_0x3ed184[_0x3f5bf0(0x124)]},'segment':_0x3ed184[_0x3f5bf0(0x127)],..._0x3ed184[_0x3f5bf0(0x186)]&&{'target':normalizeJumpTarget(_0x3ed184[_0x3f5bf0(0x186)])}};}function normalizeJourneyStep(_0xe4f067,_0x3d1b2e){const _0x4729c8=a109_0x447522,_0x46a267=_0xe4f067['next']!==undefined&&_0xe4f067[_0x4729c8(0x147)]!==_0x3d1b2e,_0x1ff2ca={'type':_0xe4f067[_0x4729c8(0x16a)],'name':_0xe4f067[_0x4729c8(0xdf)],..._0x46a267&&{'next':_0xe4f067['next']}};if('with'in _0xe4f067&&_0xe4f067[_0x4729c8(0x16c)])return{..._0x1ff2ca,'with':normalizeStepParams(_0xe4f067[_0x4729c8(0x16a)],_0xe4f067[_0x4729c8(0x16c)])};return _0x1ff2ca;}function normalizeStepParams(_0xfb9c4,_0x280f65){const _0x30007f=a109_0x447522;switch(_0xfb9c4){case _0x30007f(0x125):{const _0x128b7c=_0x280f65;let _0x21c08e;return _0x128b7c['condition']&&(_0x21c08e={'segment':_0x128b7c[_0x30007f(0xe0)]['segment'],..._0x128b7c['condition'][_0x30007f(0x147)]!==undefined&&{'next':_0x128b7c[_0x30007f(0xe0)][_0x30007f(0x147)]},..._0x128b7c[_0x30007f(0xe0)][_0x30007f(0x11a)]&&{'timeout':{'duration':_0x128b7c[_0x30007f(0xe0)][_0x30007f(0x11a)][_0x30007f(0x120)],'unit':_0x128b7c['condition'][_0x30007f(0x11a)][_0x30007f(0x135)],..._0x128b7c[_0x30007f(0xe0)][_0x30007f(0x11a)][_0x30007f(0x147)]!==undefined&&{'next':_0x128b7c['condition'][_0x30007f(0x11a)][_0x30007f(0x147)]}}}}),{..._0x128b7c['duration']!==undefined&&{'duration':_0x128b7c[_0x30007f(0x120)]},..._0x128b7c['unit']!==undefined&&{'unit':_0x128b7c['unit']},..._0x128b7c['wait_until']!==undefined&&{'wait_until':_0x128b7c[_0x30007f(0xf9)]},..._0x128b7c[_0x30007f(0x1a0)]!==undefined&&{'days_of_week':_0x128b7c[_0x30007f(0x1a0)]},..._0x21c08e&&{'condition':_0x21c08e}};}case _0x30007f(0x1a1):{const _0x39dae3=_0x280f65;return{'activation':_0x39dae3[_0x30007f(0x1a1)]};}case _0x30007f(0x174):{const _0x28dac4=_0x280f65;return{'branches':_0x28dac4['branches'][_0x30007f(0x15a)](normalizeDecisionBranch)};}case _0x30007f(0x19c):{const _0x24dcf5=_0x280f65;return{..._0x24dcf5[_0x30007f(0x123)]!==undefined&&{'customized_split':_0x24dcf5[_0x30007f(0x123)]},..._0x24dcf5[_0x30007f(0x18e)]!==undefined&&{'unique_id':_0x24dcf5[_0x30007f(0x18e)]},'variants':_0x24dcf5[_0x30007f(0x157)]['map'](normalizeAbTestVariant)};}case'jump':{const _0x113c8e=_0x280f65;return{'target':normalizeJumpTarget(_0x113c8e[_0x30007f(0x186)])};}default:return _0x280f65;}}function normalizeDecisionBranch(_0x344d11){const _0x50d2af=a109_0x447522;return{'name':_0x344d11[_0x50d2af(0xdf)],..._0x344d11[_0x50d2af(0x127)]!==undefined&&{'segment':_0x344d11[_0x50d2af(0x127)]},..._0x344d11['excluded']!==undefined&&{'excluded':_0x344d11['excluded']},..._0x344d11['next']!==undefined&&{'next':_0x344d11[_0x50d2af(0x147)]}};}function normalizeAbTestVariant(_0x43c169){const _0x3dc32d=a109_0x447522;return{..._0x43c169['id']!==undefined&&{'id':_0x43c169['id']},'name':_0x43c169[_0x3dc32d(0xdf)],'percentage':_0x43c169[_0x3dc32d(0x143)],..._0x43c169[_0x3dc32d(0x147)]!==undefined&&{'next':_0x43c169[_0x3dc32d(0x147)]}};}function normalizeJumpTarget(_0x26f6c5){const _0x3a561c=a109_0x447522;return{'journey':_0x26f6c5[_0x3a561c(0x19f)],'stage':_0x26f6c5[_0x3a561c(0x164)],..._0x26f6c5[_0x3a561c(0x198)]!==undefined&&{'bundle_id':_0x26f6c5['bundle_id']}};}function normalizeEmbeddedSegments(_0x23d938,_0x2aea05){const _0x4256d6=a109_0x447522,_0x23d450={},_0x30d044=Object[_0x4256d6(0xe5)](_0x23d938),_0x2e90ff=_0x2aea05?[..._0x2aea05['filter'](_0x5eb18e=>_0x30d044['includes'](_0x5eb18e)),..._0x30d044[_0x4256d6(0x156)](_0x593564=>!_0x2aea05[_0x4256d6(0x10c)](_0x593564))[_0x4256d6(0x155)]()]:_0x30d044[_0x4256d6(0x155)]();for(const _0x3dc66e of _0x2e90ff){const _0x4f17b3=_0x23d938[_0x3dc66e];if(_0x4f17b3['rule']){const _0x3f3feb=_0x4f17b3[_0x4256d6(0x185)];if(_0x3f3feb['type']!==_0x4256d6(0x105)&&_0x3f3feb['type']!=='Or'){const _0x4e53ff=_0x3f3feb[_0x4256d6(0x16a)]??_0x4256d6(0x10d);throw new SDKError(ErrorCode[_0x4256d6(0x12d)],_0x4256d6(0x17d)+_0x3dc66e+'\x27:\x20'+(_0x4256d6(0x189)+_0x4e53ff+'\x27.\x0a')+'Expected\x20format:\x0a'+_0x4256d6(0x114)+_0x4256d6(0xcf)+_0x4256d6(0x144)+_0x4256d6(0x17a)+_0x4256d6(0xd5)+_0x4256d6(0xd3));}if(!_0x3f3feb['conditions']||!Array[_0x4256d6(0xe1)](_0x3f3feb['conditions']))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x4256d6(0x17d)+_0x3dc66e+_0x4256d6(0x10e)+_0x4256d6(0xe6)+_0x4256d6(0xed)+_0x4256d6(0x114)+(_0x4256d6(0x163)+_0x3f3feb['type']+'\x0a')+_0x4256d6(0x144)+_0x4256d6(0x17a)+_0x4256d6(0xd5)+_0x4256d6(0xd3));}_0x23d450[_0x3dc66e]={..._0x4f17b3[_0x4256d6(0x124)]&&_0x4f17b3[_0x4256d6(0x124)][_0x4256d6(0x13e)]()&&{'description':_0x4f17b3['description']},..._0x4f17b3['rule']&&{'rule':deepSortObject(_0x4f17b3['rule'])}};}return _0x23d450;}function normalizeEmbeddedActivations(_0x509919,_0xf190b6){const _0x3a2262=a109_0x447522,_0x94ad23={},_0x4cdd05=Object[_0x3a2262(0xe5)](_0x509919),_0x2fc6ba=_0xf190b6?[..._0xf190b6[_0x3a2262(0x156)](_0x3a4812=>_0x4cdd05[_0x3a2262(0x10c)](_0x3a4812)),..._0x4cdd05[_0x3a2262(0x156)](_0xa46d77=>!_0xf190b6['includes'](_0xa46d77))[_0x3a2262(0x155)]()]:_0x4cdd05['sort']();for(const _0x3177de of _0x2fc6ba){const _0x185291=_0x509919[_0x3177de];_0x94ad23[_0x3177de]={'name':_0x185291[_0x3a2262(0xdf)],'connection':_0x185291[_0x3a2262(0x10b)],..._0x185291[_0x3a2262(0x124)]!==undefined&&{'description':_0x185291['description']},..._0x185291['all_columns']!==undefined&&{'all_columns':_0x185291[_0x3a2262(0xdb)]},..._0x185291[_0x3a2262(0x177)]!==undefined&&{'columns':_0x185291[_0x3a2262(0x177)]},..._0x185291[_0x3a2262(0x15b)]!==undefined&&{'behavior':_0x185291['behavior']},..._0x185291['schedule']!==undefined&&{'schedule':_0x185291[_0x3a2262(0x18d)]},..._0x185291[_0x3a2262(0x195)]!==undefined&&{'notification':_0x185291[_0x3a2262(0x195)]},..._0x185291[_0x3a2262(0x1a2)]!==undefined&&{'connector_config':_0x185291[_0x3a2262(0x1a2)]},..._0x185291['activation_template_id']!==undefined&&{'activation_template_id':_0x185291[_0x3a2262(0x131)]}};}return _0x94ad23;}export function getActiveStages(_0x48e38e){const _0x359c20=a109_0x447522;if(isJourneysArrayMode(_0x48e38e)){const _0xc120d5=_0x48e38e[_0x359c20(0x101)]||[],_0x20cd79=_0xc120d5[_0x359c20(0x118)](_0xa5da3d=>_0xa5da3d[_0x359c20(0x119)]===!![])||_0xc120d5[0x0];return _0x20cd79?.[_0x359c20(0xda)]||[];}if(isSingleVersionMode(_0x48e38e))return _0x48e38e['stages']||[];if(isMultiVersionMode(_0x48e38e)){const _0x45df59=_0x48e38e[_0x359c20(0x150)]||[],_0x3b3c7c=_0x45df59[_0x359c20(0x118)](_0x1d2f87=>_0x1d2f87[_0x359c20(0x119)]===!![])||_0x45df59[0x0];return _0x3b3c7c?.[_0x359c20(0xda)]||[];}return[];}export function getLatestJourneyEntry(_0x3be2ce){const _0x61752d=a109_0x447522;if(isJourneysArrayMode(_0x3be2ce)){const _0x1f2bce=_0x3be2ce[_0x61752d(0x101)]||[];return _0x1f2bce['find'](_0x57afb3=>_0x57afb3[_0x61752d(0x119)]===!![])||_0x1f2bce[0x0];}if(isMultiVersionMode(_0x3be2ce)){const _0x987dab=_0x3be2ce[_0x61752d(0x150)]||[],_0x24ac7d=_0x987dab[_0x61752d(0x118)](_0x4e2bda=>_0x4e2bda[_0x61752d(0x119)]===!![])||_0x987dab[0x0];if(_0x24ac7d)return{'version':_0x24ac7d[_0x61752d(0xdf)],'state':_0x24ac7d['state'],'latest':_0x24ac7d[_0x61752d(0x119)],'stages':_0x24ac7d['stages'],'id':_0x24ac7d['id'],'version_number':_0x24ac7d[_0x61752d(0x146)]};}if(isSingleVersionMode(_0x3be2ce))return{'version':_0x3be2ce[_0x61752d(0x160)]||'v1','state':_0x61752d(0x113),'stages':_0x3be2ce[_0x61752d(0xda)]||[],'id':_0x3be2ce['id'],'version_number':_0x3be2ce[_0x61752d(0x146)],'goal':_0x3be2ce[_0x61752d(0x12f)],'reentry':_0x3be2ce[_0x61752d(0xd0)]};return undefined;}export function getLatestVersion(_0x4e033a){const _0x486796=a109_0x447522;if(!isMultiVersionMode(_0x4e033a))return undefined;const _0x473100=_0x4e033a[_0x486796(0x150)]||[];return _0x473100[_0x486796(0x118)](_0x39639a=>_0x39639a['latest']===!![])||_0x473100[0x0];}export function getEffectiveGoal(_0x5f0a9e){const _0x14f77d=a109_0x447522,_0x10dd05=getLatestJourneyEntry(_0x5f0a9e);return _0x10dd05?.['goal']||_0x5f0a9e[_0x14f77d(0x12f)];}function a109_0x1b1c(_0x216ad4,_0x4f007c){_0x216ad4=_0x216ad4-0xcd;const _0x2e1b21=a109_0x2e1b();let _0x1b1cc2=_0x2e1b21[_0x216ad4];return _0x1b1cc2;}export function getEffectiveReentry(_0x498972){const _0x1c8239=a109_0x447522,_0x3df12e=getLatestJourneyEntry(_0x498972);return _0x3df12e?.[_0x1c8239(0xd0)]||_0x498972[_0x1c8239(0xd0)];}export function collectSegmentRefs(_0x571b51){const _0x4e58e3=a109_0x447522,_0x2b9c75=new Set();_0x571b51['goal']?.[_0x4e58e3(0x127)]&&_0x2b9c75['add'](_0x571b51[_0x4e58e3(0x12f)]['segment']);const _0x42dabb=_0x263d47=>{const _0x1425f7=_0x4e58e3;for(const _0x5d96d5 of _0x263d47){_0x5d96d5[_0x1425f7(0x18c)]?.[_0x1425f7(0x127)]&&_0x2b9c75[_0x1425f7(0xe2)](_0x5d96d5[_0x1425f7(0x18c)][_0x1425f7(0x127)]);if(_0x5d96d5['exit_criteria'])for(const _0x482ed6 of _0x5d96d5['exit_criteria']){_0x482ed6['segment']&&_0x2b9c75[_0x1425f7(0xe2)](_0x482ed6[_0x1425f7(0x127)]);}_0x5d96d5[_0x1425f7(0x14a)]?.[_0x1425f7(0x127)]&&_0x2b9c75[_0x1425f7(0xe2)](_0x5d96d5['milestone']['segment']);if(_0x5d96d5['steps'])for(const _0x5530c6 of _0x5d96d5['steps']){if(_0x5530c6[_0x1425f7(0x16a)]===_0x1425f7(0x174)){const _0x5263a4=_0x5530c6;for(const _0x1be0ad of _0x5263a4[_0x1425f7(0x16c)][_0x1425f7(0xd2)]){_0x1be0ad[_0x1425f7(0x127)]&&_0x2b9c75[_0x1425f7(0xe2)](_0x1be0ad['segment']);}}else{if(_0x5530c6[_0x1425f7(0x16a)]===_0x1425f7(0x125)){const _0x938db7=_0x5530c6;_0x938db7['with'][_0x1425f7(0xe0)]?.['segment']&&_0x2b9c75[_0x1425f7(0xe2)](_0x938db7[_0x1425f7(0x16c)][_0x1425f7(0xe0)][_0x1425f7(0x127)]);}}}}};_0x571b51['stages']&&_0x42dabb(_0x571b51[_0x4e58e3(0xda)]);if(_0x571b51['versions'])for(const _0x4b2087 of _0x571b51[_0x4e58e3(0x150)]){_0x42dabb(_0x4b2087['stages']);}return _0x2b9c75;}export function validateSegmentRefs(_0x270a96){const _0x1e0cbb=a109_0x447522,_0x17280c=[],_0x1938af=collectSegmentRefs(_0x270a96),_0x4907f2=new Set(Object[_0x1e0cbb(0xe5)](_0x270a96['segments']||{}));for(const _0x3a1d91 of _0x1938af){const _0x20ffbd=parseSegmentRef(_0x3a1d91);_0x20ffbd[_0x1e0cbb(0x16a)]===_0x1e0cbb(0x165)&&!_0x4907f2[_0x1e0cbb(0x128)](_0x20ffbd[_0x1e0cbb(0xdf)])&&_0x17280c['push'](_0x1e0cbb(0xff)+_0x20ffbd[_0x1e0cbb(0xdf)]+_0x1e0cbb(0x19b)+_0x20ffbd['name']+_0x1e0cbb(0x115));}return _0x17280c;}export function collectSegmentIdsFromJourneyApi(_0x2a7cec){const _0x18f758=a109_0x447522,_0x323764=new Set();_0x2a7cec['attributes'][_0x18f758(0x12f)]?.[_0x18f758(0x19d)]&&_0x323764[_0x18f758(0xe2)](_0x2a7cec['attributes'][_0x18f758(0x12f)][_0x18f758(0x19d)]);const _0x1ef587=_0x2a7cec[_0x18f758(0xea)][_0x18f758(0x12c)];if(Array['isArray'](_0x1ef587))for(const _0x259251 of _0x1ef587){_0x259251['entryCriteria']?.[_0x18f758(0x19d)]&&_0x323764[_0x18f758(0xe2)](_0x259251[_0x18f758(0xe9)][_0x18f758(0x19d)]);const _0x20763e=_0x259251[_0x18f758(0x184)]??_0x259251[_0x18f758(0x133)];if(Array[_0x18f758(0xe1)](_0x20763e))for(const _0x40c12f of _0x20763e){_0x40c12f[_0x18f758(0x19d)]&&_0x323764[_0x18f758(0xe2)](_0x40c12f[_0x18f758(0x19d)]);}_0x259251['milestone']?.[_0x18f758(0x19d)]&&_0x323764[_0x18f758(0xe2)](_0x259251[_0x18f758(0x14a)]['segmentId']);if(_0x259251[_0x18f758(0x111)]&&typeof _0x259251['steps']===_0x18f758(0x180)){const _0x4a6c04=Array['isArray'](_0x259251['steps'])?_0x259251[_0x18f758(0x111)]:Object[_0x18f758(0x13a)](_0x259251[_0x18f758(0x111)]);for(const _0x236d4b of _0x4a6c04){_0x236d4b[_0x18f758(0x104)]?.['segmentId']&&_0x323764[_0x18f758(0xe2)](_0x236d4b[_0x18f758(0x104)]['segmentId']);const _0xa21104=_0x236d4b;_0xa21104['conditionSegmentId']&&_0x323764[_0x18f758(0xe2)](_0xa21104[_0x18f758(0x139)]);if(Array['isArray'](_0xa21104[_0x18f758(0xf2)]))for(const _0x4f88f9 of _0xa21104[_0x18f758(0xf2)]){_0x4f88f9[_0x18f758(0x19d)]&&_0x323764[_0x18f758(0xe2)](_0x4f88f9['segmentId']);}if(Array['isArray'](_0x236d4b[_0x18f758(0xd2)]))for(const _0x28b2ed of _0x236d4b[_0x18f758(0xd2)]){_0x28b2ed[_0x18f758(0x19d)]&&_0x323764['add'](_0x28b2ed[_0x18f758(0x19d)]);}}}}return _0x323764;}