@treasuredata/tdx 0.26.2 → 0.26.3

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(_0x5220cc,_0x4aa124){const _0x421333=a106_0x5a61,_0x2cc4d1=_0x5220cc();while(!![]){try{const _0x18c5bd=-parseInt(_0x421333(0xab))/0x1*(parseInt(_0x421333(0x9f))/0x2)+parseInt(_0x421333(0xa7))/0x3+-parseInt(_0x421333(0x9e))/0x4*(parseInt(_0x421333(0xa1))/0x5)+-parseInt(_0x421333(0xa4))/0x6+-parseInt(_0x421333(0x9a))/0x7+parseInt(_0x421333(0xac))/0x8*(-parseInt(_0x421333(0xad))/0x9)+parseInt(_0x421333(0xa0))/0xa;if(_0x18c5bd===_0x4aa124)break;else _0x2cc4d1['push'](_0x2cc4d1['shift']());}catch(_0x3ab374){_0x2cc4d1['push'](_0x2cc4d1['shift']());}}}(a106_0x1475,0x99c51));import{readdirSync,statSync}from'fs';import a106_0x3cd9b6 from'path';export function findYamlFiles(_0x21730e){const _0x3f8ea1=[];function _0x476824(_0x48e710){const _0x5c3717=a106_0x5a61,_0x521837=readdirSync(_0x48e710,{'withFileTypes':!![]});for(const _0xe006df of _0x521837){const _0x2258be=a106_0x3cd9b6['join'](_0x48e710,_0xe006df[_0x5c3717(0xa9)]);if(_0xe006df[_0x5c3717(0xa8)]())_0x476824(_0x2258be);else(_0xe006df[_0x5c3717(0xa9)][_0x5c3717(0xa3)](_0x5c3717(0xaa))||_0xe006df['name'][_0x5c3717(0xa3)](_0x5c3717(0x9d)))&&_0x3f8ea1[_0x5c3717(0xa5)](_0x2258be);}}return _0x476824(_0x21730e),_0x3f8ea1;}export function discoverYamlFiles(_0x45b186){const _0x5b95ca=a106_0x5a61,_0x17cb02=findYamlFiles(_0x45b186);return _0x17cb02[_0x5b95ca(0xa2)](_0x257a5a=>{const _0x11de3c=_0x5b95ca,_0x37f226=a106_0x3cd9b6[_0x11de3c(0xa6)](_0x45b186,_0x257a5a),_0x3f5a09=a106_0x3cd9b6['dirname'](_0x37f226);return{'absolutePath':_0x257a5a,'relativePath':_0x37f226,'folderPath':_0x3f5a09==='.'?'':_0x3f5a09};});}function a106_0x5a61(_0x588654,_0x5b8a65){_0x588654=_0x588654-0x9a;const _0x147567=a106_0x1475();let _0x5a61d=_0x147567[_0x588654];return _0x5a61d;}export function isYamlFile(_0x1d8821){const _0x258efa=a106_0x5a61;try{const _0x116044=statSync(_0x1d8821);if(!_0x116044[_0x258efa(0x9b)]())return![];const _0x552a49=a106_0x3cd9b6[_0x258efa(0x9c)](_0x1d8821)['toLowerCase']();return _0x552a49===_0x258efa(0xaa)||_0x552a49===_0x258efa(0x9d);}catch{return![];}}function a106_0x1475(){const _0x3527fc=['9uVWCqn','7837529thxcfj','isFile','extname','.yaml','8qdYlYQ','6714OpBGRC','41969690wxdeow','709970HwIYyh','map','endsWith','4955454creJmo','push','relative','1127754TwPqbF','isDirectory','name','.yml','219DsICGj','7826552iENxVY'];a106_0x1475=function(){return _0x3527fc;};return a106_0x1475();}
1
+ function a106_0x347b(_0x329ee3,_0xfe4aa2){_0x329ee3=_0x329ee3-0x1b3;const _0x4a968c=a106_0x4a96();let _0x347b9e=_0x4a968c[_0x329ee3];return _0x347b9e;}function a106_0x4a96(){const _0x53bf07=['push','3060nHjWzu','2jVtDle','346462yiTEbp','toLowerCase','name','256ZZJfAD','isDirectory','relative','169113AiFerx','4923470eHGauA','7080FHSeOU','.yaml','2295171iyeiEh','.yml','extname','map','dirname','11086785OPJaJO','4145180wOlYPp'];a106_0x4a96=function(){return _0x53bf07;};return a106_0x4a96();}(function(_0x6777ce,_0x4c1c0c){const _0x2ca743=a106_0x347b,_0x5689f1=_0x6777ce();while(!![]){try{const _0x2b61e5=parseInt(_0x2ca743(0x1c5))/0x1*(-parseInt(_0x2ca743(0x1c6))/0x2)+parseInt(_0x2ca743(0x1bc))/0x3+parseInt(_0x2ca743(0x1c2))/0x4+parseInt(_0x2ca743(0x1ba))/0x5*(parseInt(_0x2ca743(0x1c4))/0x6)+parseInt(_0x2ca743(0x1b8))/0x7*(-parseInt(_0x2ca743(0x1b5))/0x8)+-parseInt(_0x2ca743(0x1c1))/0x9+parseInt(_0x2ca743(0x1b9))/0xa;if(_0x2b61e5===_0x4c1c0c)break;else _0x5689f1['push'](_0x5689f1['shift']());}catch(_0x40c69c){_0x5689f1['push'](_0x5689f1['shift']());}}}(a106_0x4a96,0xa237c));import{readdirSync,statSync}from'fs';import a106_0x21f352 from'path';export function findYamlFiles(_0x343124){const _0x48b59d=[];function _0x39f4a6(_0x57c6eb){const _0x424d6d=a106_0x347b,_0x2cedb2=readdirSync(_0x57c6eb,{'withFileTypes':!![]});for(const _0x3746eb of _0x2cedb2){const _0x28822d=a106_0x21f352['join'](_0x57c6eb,_0x3746eb[_0x424d6d(0x1b4)]);if(_0x3746eb[_0x424d6d(0x1b6)]())_0x39f4a6(_0x28822d);else(_0x3746eb[_0x424d6d(0x1b4)]['endsWith'](_0x424d6d(0x1bd))||_0x3746eb[_0x424d6d(0x1b4)]['endsWith'](_0x424d6d(0x1bb)))&&_0x48b59d[_0x424d6d(0x1c3)](_0x28822d);}}return _0x39f4a6(_0x343124),_0x48b59d;}export function discoverYamlFiles(_0x3334fe){const _0xb492cf=a106_0x347b,_0x2a6605=findYamlFiles(_0x3334fe);return _0x2a6605[_0xb492cf(0x1bf)](_0x339ae3=>{const _0x47e9ef=_0xb492cf,_0x354557=a106_0x21f352[_0x47e9ef(0x1b7)](_0x3334fe,_0x339ae3),_0x3b2e87=a106_0x21f352[_0x47e9ef(0x1c0)](_0x354557);return{'absolutePath':_0x339ae3,'relativePath':_0x354557,'folderPath':_0x3b2e87==='.'?'':_0x3b2e87};});}export function isYamlFile(_0x10e6b2){const _0xd206aa=a106_0x347b;try{const _0x42b617=statSync(_0x10e6b2);if(!_0x42b617['isFile']())return![];const _0xd6cc27=a106_0x21f352[_0xd206aa(0x1be)](_0x10e6b2)[_0xd206aa(0x1b3)]();return _0xd6cc27==='.yml'||_0xd6cc27==='.yaml';}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x382615,_0x1809d9){const _0x5e4b8c=a107_0x2b6f,_0x21a2e7=_0x382615();while(!![]){try{const _0x3bf820=-parseInt(_0x5e4b8c(0x163))/0x1*(parseInt(_0x5e4b8c(0x17e))/0x2)+parseInt(_0x5e4b8c(0x185))/0x3*(-parseInt(_0x5e4b8c(0x14f))/0x4)+-parseInt(_0x5e4b8c(0x152))/0x5*(parseInt(_0x5e4b8c(0x199))/0x6)+-parseInt(_0x5e4b8c(0x179))/0x7*(-parseInt(_0x5e4b8c(0x154))/0x8)+parseInt(_0x5e4b8c(0x195))/0x9+-parseInt(_0x5e4b8c(0x15b))/0xa*(-parseInt(_0x5e4b8c(0x198))/0xb)+parseInt(_0x5e4b8c(0x17d))/0xc;if(_0x3bf820===_0x1809d9)break;else _0x21a2e7['push'](_0x21a2e7['shift']());}catch(_0x518c90){_0x21a2e7['push'](_0x21a2e7['shift']());}}}(a107_0x2c66,0xa59a5));function a107_0x2b6f(_0x4bb515,_0x223d27){_0x4bb515=_0x4bb515-0x148;const _0x2c6603=a107_0x2c66();let _0x2b6f88=_0x2c6603[_0x4bb515];return _0x2b6f88;}import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x200da0){const _0x57ffbf=a107_0x2b6f;return _0x200da0[_0x57ffbf(0x159)]()[_0x57ffbf(0x14d)](/\s+/g,'_')['replace'](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')[_0x57ffbf(0x14d)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x6fcf46){const _0x5128ff=a107_0x2b6f,_0x1baa53=_0x6fcf46['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x1baa53){const _0x2f4a0e=_0x1baa53[0x1][_0x5128ff(0x159)](),_0x3323e3=_0x1baa53[0x2],_0x2aa8f1=_0x3323e3[_0x5128ff(0x14d)](/-/g,'')[_0x5128ff(0x171)](0x0,0x4)[_0x5128ff(0x159)]();return _0x2f4a0e+'_'+_0x2aa8f1;}const _0x4bdc94=_0x6fcf46[_0x5128ff(0x16e)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x4bdc94){const _0x504963=_0x4bdc94[0x1],_0x2ff2b8=_0x4bdc94[0x2][_0x5128ff(0x159)](),_0x1e7b76=_0x504963[_0x5128ff(0x14d)](/-/g,'')[_0x5128ff(0x171)](0x0,0x4)[_0x5128ff(0x159)]();return _0x2ff2b8+'_'+_0x1e7b76;}return undefined;}function stableStringify(_0xd4879b){const _0x5ca649=a107_0x2b6f;if(Array['isArray'](_0xd4879b))return'['+_0xd4879b[_0x5ca649(0x184)](_0x1625be=>stableStringify(_0x1625be))[_0x5ca649(0x14b)](',')+']';if(_0xd4879b&&typeof _0xd4879b===_0x5ca649(0x18e)){const _0x53a4ec=_0xd4879b,_0x3d267b=Object[_0x5ca649(0x196)](_0x53a4ec)['sort'](),_0x124d85=_0x3d267b['map'](_0x165898=>'\x22'+_0x165898+'\x22:'+stableStringify(_0x53a4ec[_0x165898]));return'{'+_0x124d85[_0x5ca649(0x14b)](',')+'}';}const _0x1d89c1=JSON[_0x5ca649(0x14e)](_0xd4879b);return _0x1d89c1===undefined?_0x5ca649(0x191):_0x1d89c1;}export function consolidateActivationsByContent(_0x41c7ad){const _0x3ec28a=a107_0x2b6f,_0x286405={},_0x4b33ea=new Map(),_0x4140d4=new Map();for(const _0x5c6778 of _0x41c7ad){if(!_0x5c6778)continue;for(const [_0x5c64f1,_0x32c446]of Object['entries'](_0x5c6778)){const _0x6d535c={'connection':_0x32c446['connection'],..._0x32c446['all_columns']!==undefined&&{'all_columns':_0x32c446[_0x3ec28a(0x153)]},..._0x32c446[_0x3ec28a(0x170)]!==undefined&&{'columns':_0x32c446[_0x3ec28a(0x170)]},..._0x32c446[_0x3ec28a(0x151)]!==undefined&&{'behavior':_0x32c446[_0x3ec28a(0x151)]},..._0x32c446[_0x3ec28a(0x15c)]!==undefined&&{'schedule':_0x32c446[_0x3ec28a(0x15c)]},..._0x32c446[_0x3ec28a(0x182)]!==undefined&&{'notification':_0x32c446[_0x3ec28a(0x182)]},..._0x32c446[_0x3ec28a(0x160)]!==undefined&&{'connector_config':_0x32c446['connector_config']},..._0x32c446[_0x3ec28a(0x18a)]!==undefined&&{'activation_template_id':_0x32c446[_0x3ec28a(0x18a)]}},_0x5ea6f0=stableStringify(_0x6d535c),_0x32c8f1=_0x4140d4['get'](_0x5ea6f0);_0x32c8f1?_0x4b33ea['set'](_0x5c64f1,_0x32c8f1):(_0x286405[_0x5c64f1]=_0x32c446,_0x4b33ea[_0x3ec28a(0x164)](_0x5c64f1,_0x5c64f1),_0x4140d4[_0x3ec28a(0x164)](_0x5ea6f0,_0x5c64f1));}}return{'merged':_0x286405,'nameMapping':_0x4b33ea};}export function updateActivationReferences(_0x170a76,_0x1dc452){const _0x575e76=a107_0x2b6f;if(!_0x170a76)return;for(const _0x31518d of _0x170a76){if(!_0x31518d[_0x575e76(0x156)])continue;for(const _0x483690 of _0x31518d[_0x575e76(0x156)]){if(_0x483690[_0x575e76(0x18d)]==='activation'&&_0x483690[_0x575e76(0x192)]?.[_0x575e76(0x169)]){const _0x2388a6=_0x1dc452[_0x575e76(0x17f)](_0x483690[_0x575e76(0x192)][_0x575e76(0x169)]);_0x2388a6&&_0x2388a6!==_0x483690[_0x575e76(0x192)]['activation']&&(_0x483690[_0x575e76(0x192)][_0x575e76(0x169)]=_0x2388a6);}}}}export function consolidateSegmentsByContent(_0x51ff98,_0x2f036d){const _0x1a967f=a107_0x2b6f,_0x183be6={},_0x1db88b=new Map(),_0x3e3f8e=new Map();for(const _0x499f1d of _0x51ff98){if(!_0x499f1d)continue;for(const [_0x27006d,_0x11dbff]of Object[_0x1a967f(0x17b)](_0x499f1d)){if(!_0x11dbff[_0x1a967f(0x15e)]){_0x183be6[_0x27006d]=_0x11dbff,_0x1db88b['set'](_0x27006d,_0x27006d);continue;}const _0x50ec54=_0x11dbff['description']&&_0x11dbff[_0x1a967f(0x180)]['trim']()?_0x11dbff['description']:undefined,_0x54dcc2=JSON[_0x1a967f(0x14e)]({'description':_0x50ec54,'rule':deepSortObject(_0x11dbff[_0x1a967f(0x15e)])}),_0x50f3d0=_0x3e3f8e[_0x1a967f(0x17f)](_0x54dcc2);if(_0x50f3d0){const _0xfca576={..._0x11dbff[_0x1a967f(0x180)]!==undefined&&{'description':_0x11dbff['description']},'rule':_0x11dbff[_0x1a967f(0x15e)]?deepSortObject(_0x11dbff[_0x1a967f(0x15e)]):_0x11dbff['rule']};if(_0x27006d<_0x50f3d0){_0x183be6[_0x27006d]=_0xfca576,delete _0x183be6[_0x50f3d0];for(const [_0x140687,_0x4bdf8f]of _0x1db88b[_0x1a967f(0x17b)]()){_0x4bdf8f===_0x50f3d0&&_0x1db88b[_0x1a967f(0x164)](_0x140687,_0x27006d);}_0x1db88b[_0x1a967f(0x164)](_0x27006d,_0x27006d),_0x3e3f8e[_0x1a967f(0x164)](_0x54dcc2,_0x27006d);}else _0x183be6[_0x50f3d0]=_0xfca576,_0x1db88b[_0x1a967f(0x164)](_0x27006d,_0x50f3d0);}else{let _0x1cf09f=_0x27006d;if(_0x2f036d){const _0x41d674=_0x2f036d[_0x1a967f(0x17f)](_0x54dcc2);_0x41d674&&_0x41d674[_0x1a967f(0x194)]>0x0&&(_0x1cf09f=_0x41d674[_0x1a967f(0x171)]()[_0x1a967f(0x181)]()[0x0]);}const _0x2a2517={..._0x11dbff[_0x1a967f(0x180)]!==undefined&&{'description':_0x11dbff[_0x1a967f(0x180)]},'rule':_0x11dbff[_0x1a967f(0x15e)]?deepSortObject(_0x11dbff[_0x1a967f(0x15e)]):_0x11dbff[_0x1a967f(0x15e)]};_0x183be6[_0x1cf09f]=_0x2a2517,_0x1db88b['set'](_0x27006d,_0x1cf09f),_0x3e3f8e[_0x1a967f(0x164)](_0x54dcc2,_0x1cf09f);}}}return{'merged':_0x183be6,'nameMapping':_0x1db88b};}export function updateSegmentReferences(_0x4cfc46,_0x5c2008){const _0x42bbd6=a107_0x2b6f;if(!_0x4cfc46)return;for(const _0x3fdf30 of _0x4cfc46){if(_0x3fdf30['entry_criteria']?.[_0x42bbd6(0x148)]){const _0x534644=_0x5c2008['get'](_0x3fdf30[_0x42bbd6(0x18b)][_0x42bbd6(0x148)]);_0x534644&&(_0x3fdf30[_0x42bbd6(0x18b)][_0x42bbd6(0x148)]=_0x534644);}if(_0x3fdf30[_0x42bbd6(0x156)])for(const _0x318df8 of _0x3fdf30[_0x42bbd6(0x156)]){if(_0x318df8[_0x42bbd6(0x18d)]===_0x42bbd6(0x173)&&_0x318df8[_0x42bbd6(0x192)]?.[_0x42bbd6(0x18f)])for(const _0x2dbb3f of _0x318df8[_0x42bbd6(0x192)][_0x42bbd6(0x18f)]){if(_0x2dbb3f[_0x42bbd6(0x148)]){const _0x54e44b=_0x5c2008[_0x42bbd6(0x17f)](_0x2dbb3f[_0x42bbd6(0x148)]);_0x54e44b&&(_0x2dbb3f['segment']=_0x54e44b);}}}}}export function updateSegmentRefsInSegments(_0x491915,_0x67a42a){const _0x22e4c6=a107_0x2b6f;for(const _0x3ccf8e of Object[_0x22e4c6(0x190)](_0x491915)){_0x3ccf8e['rule']&&updateSegmentRefsInRule(_0x3ccf8e[_0x22e4c6(0x15e)],_0x67a42a);}}function updateSegmentRefsInRule(_0x5def61,_0x7e50cb){const _0x17b45e=a107_0x2b6f;if(_0x5def61===null||typeof _0x5def61!==_0x17b45e(0x18e))return;if(Array['isArray'](_0x5def61)){for(const _0x3c1272 of _0x5def61){updateSegmentRefsInRule(_0x3c1272,_0x7e50cb);}return;}const _0x296f97=_0x5def61;if((_0x296f97[_0x17b45e(0x18d)]===_0x17b45e(0x166)||_0x296f97['type']===_0x17b45e(0x15a))&&typeof _0x296f97[_0x17b45e(0x148)]==='string'){const _0x1571a9=_0x7e50cb[_0x17b45e(0x17f)](_0x296f97[_0x17b45e(0x148)]);_0x1571a9&&(_0x296f97[_0x17b45e(0x148)]=_0x1571a9);}if(_0x296f97[_0x17b45e(0x15f)]&&Array[_0x17b45e(0x161)](_0x296f97[_0x17b45e(0x15f)]))for(const _0x4af820 of _0x296f97[_0x17b45e(0x15f)]){updateSegmentRefsInRule(_0x4af820,_0x7e50cb);}}export function buildJourneysArray(_0x2399b7){const _0x4db4b1=a107_0x2b6f,_0xe02b=Math[_0x4db4b1(0x178)](..._0x2399b7[_0x4db4b1(0x184)](_0x285b13=>_0x285b13['item'][_0x4db4b1(0x162)]||0x0));return _0x2399b7[_0x4db4b1(0x184)](_0x18be81=>{const _0x5b5ef7=_0x4db4b1,_0x51a338=(_0x18be81[_0x5b5ef7(0x155)][_0x5b5ef7(0x162)]||0x0)===_0xe02b,_0x496ab3=_0x18be81[_0x5b5ef7(0x149)][_0x5b5ef7(0x18c)]?.[0x0],_0x16b29c={'version':_0x496ab3?.[_0x5b5ef7(0x183)]||_0x18be81[_0x5b5ef7(0x149)][_0x5b5ef7(0x183)]||_0x18be81['item'][_0x5b5ef7(0x16b)],'state':_0x18be81[_0x5b5ef7(0x155)][_0x5b5ef7(0x17a)]==='launched'?_0x5b5ef7(0x16f):'draft','stages':_0x496ab3?.[_0x5b5ef7(0x189)]||_0x18be81[_0x5b5ef7(0x149)][_0x5b5ef7(0x189)]||[],'id':_0x496ab3?.['id']||_0x18be81['yaml']['id'],'version_number':_0x496ab3?.[_0x5b5ef7(0x174)]||_0x18be81['yaml'][_0x5b5ef7(0x174)]};return _0x51a338&&(_0x16b29c[_0x5b5ef7(0x157)]=!![]),_0x16b29c;});}export function buildMergedJourneyDef(_0x4ba7df,_0x4170d2){const _0x152edb=a107_0x2b6f,_0x216797=_0x4ba7df[0x0][_0x152edb(0x149)],_0x12070b=buildJourneysArray(_0x4ba7df),{merged:_0x377c04,nameMapping:_0x499595}=consolidateSegmentsByContent(_0x4ba7df[_0x152edb(0x184)](_0x19d9d4=>_0x19d9d4[_0x152edb(0x149)][_0x152edb(0x176)]),_0x4170d2);updateSegmentRefsInSegments(_0x377c04,_0x499595);const _0x37009c=Array[_0x152edb(0x16a)](_0x499595[_0x152edb(0x17b)]())[_0x152edb(0x14c)](([_0x4d5d18,_0x31b241])=>_0x4d5d18!==_0x31b241&&_0x4d5d18[_0x152edb(0x16c)](_0x152edb(0x18b)));let _0x5d2e02=_0x377c04,_0x46f69b=new Map();if(_0x37009c){const _0x564999=consolidateSegmentsByContent([_0x377c04],_0x4170d2);_0x5d2e02=_0x564999['merged'],_0x46f69b=_0x564999[_0x152edb(0x165)];}const _0x408b97=new Map(_0x499595);for(const [_0x40cea1,_0x35403d]of _0x46f69b[_0x152edb(0x17b)]()){_0x408b97[_0x152edb(0x164)](_0x40cea1,_0x35403d);}for(const [_0x4decd9,_0x988d1]of _0x408b97['entries']()){let _0x1e6477=_0x988d1,_0x344a15=0x0;while(_0x408b97[_0x152edb(0x197)](_0x1e6477)&&_0x408b97[_0x152edb(0x17f)](_0x1e6477)!==_0x1e6477&&_0x344a15<MAX_MAPPING_CHAIN_DEPTH){_0x1e6477=_0x408b97[_0x152edb(0x17f)](_0x1e6477),_0x344a15++;}_0x1e6477!==_0x988d1&&_0x408b97[_0x152edb(0x164)](_0x4decd9,_0x1e6477);}for(const _0x411537 of _0x12070b){updateSegmentReferences(_0x411537[_0x152edb(0x189)],_0x408b97);}const {merged:_0x13bdbc,nameMapping:_0x241ee5}=consolidateActivationsByContent(_0x4ba7df[_0x152edb(0x184)](_0x3bfdad=>_0x3bfdad[_0x152edb(0x149)][_0x152edb(0x14a)]));for(const _0x563bd3 of _0x12070b){updateActivationReferences(_0x563bd3[_0x152edb(0x189)],_0x241ee5);}let _0x347352=_0x216797[_0x152edb(0x17c)];if(_0x347352?.[_0x152edb(0x148)]){const _0x4a0ed1=_0x408b97[_0x152edb(0x17f)](_0x347352[_0x152edb(0x148)]);_0x4a0ed1&&(_0x347352={..._0x347352,'segment':_0x4a0ed1});}for(const _0x4f5cd0 of _0x12070b){if(_0x4f5cd0[_0x152edb(0x17c)]?.[_0x152edb(0x148)]){const _0x4363fe=_0x408b97[_0x152edb(0x17f)](_0x4f5cd0[_0x152edb(0x17c)][_0x152edb(0x148)]);_0x4363fe&&(_0x4f5cd0['goal']={..._0x4f5cd0['goal'],'segment':_0x4363fe});}}return{'type':_0x152edb(0x177),'name':_0x216797[_0x152edb(0x16b)],'description':_0x216797[_0x152edb(0x180)],'goal':_0x347352,'reentry':_0x216797['reentry'],'segments':Object[_0x152edb(0x196)](_0x5d2e02)[_0x152edb(0x194)]>0x0?_0x5d2e02:undefined,'activations':Object[_0x152edb(0x196)](_0x13bdbc)['length']>0x0?_0x13bdbc:undefined,'journeys':_0x12070b,'bundle_id':_0x216797['bundle_id'],'bundle_name':_0x216797[_0x152edb(0x150)]};}export function createJumpTargetCache(){return new Map();}function a107_0x2c66(){const _0x5d98c6=['slice','endsWith','decision_point','version_number','journeyBundleName','segments','journey','max','7EislBq','state','entries','goal','718008LidOJD','2612452ARsRQR','get','description','sort','notification','version','map','3DqMUbS','journeyStages','push','attributes','stages','activation_template_id','entry_criteria','journeys','type','object','branches','values','null','with','index','length','11869821nzgZtV','keys','has','18491TQqibA','245316ziYEtx','segment','yaml','activations','join','some','replace','stringify','360028IFHjHk','bundle_name','behavior','150jQiScy','all_columns','7014696TyVdaY','item','steps','latest','versions','toLowerCase','exclude','6220qHQjWx','schedule','wait','rule','conditions','connector_config','isArray','versionNumber','1PYeFAv','set','nameMapping','include','exit_criteria','.yaml','activation','from','name','startsWith','milestone','match','launched','columns'];a107_0x2c66=function(){return _0x5d98c6;};return a107_0x2c66();}export async function resolveJumpTarget(_0x3440ae,_0x14a693,_0x575e35,_0x351b5f){const _0x21a7af=a107_0x2b6f,_0x2e6f33=_0x3440ae+':'+_0x14a693,_0x3ae47a=_0x575e35[_0x21a7af(0x17f)](_0x2e6f33);if(_0x3ae47a)return _0x3ae47a;const _0x48ba8b=await _0x351b5f(_0x3440ae),_0x170c09=_0x48ba8b[_0x21a7af(0x188)][_0x21a7af(0x175)]||_0x48ba8b[_0x21a7af(0x188)]['name'],_0x137aee=_0x48ba8b[_0x21a7af(0x188)][_0x21a7af(0x186)]['find'](_0x29d774=>String(_0x29d774['id'])===String(_0x14a693)),_0x2b9127=_0x137aee?.[_0x21a7af(0x16b)]||_0x14a693,_0x4a1c81={'journeyName':_0x170c09,'stageName':_0x2b9127};return _0x575e35[_0x21a7af(0x164)](_0x2e6f33,_0x4a1c81),_0x4a1c81;}export function formatApiJourneyName(_0xc3f499,_0x48b372){return _0x48b372+'\x20('+_0xc3f499+')';}export function isLocalJourneyRef(_0x41cb22){const _0x1f950d=a107_0x2b6f;return _0x41cb22[_0x1f950d(0x172)]('.yml')||_0x41cb22[_0x1f950d(0x172)](_0x1f950d(0x168));}export function buildLocalRuleToNameMapping(_0x43df71){const _0x50fde5=a107_0x2b6f,_0x482fce=new Map();if(!_0x43df71)return _0x482fce;for(const [_0xd1f1fb,_0x363a8c]of Object[_0x50fde5(0x17b)](_0x43df71)){if(_0x363a8c['rule']){const _0x109647=serializeRule(_0x363a8c[_0x50fde5(0x15e)]),_0x254622=_0x482fce[_0x50fde5(0x17f)](_0x109647)||[];_0x254622[_0x50fde5(0x187)](_0xd1f1fb),_0x482fce['set'](_0x109647,_0x254622);}}return _0x482fce;}export function buildLocalRuleToNameMappingFromJourney(_0x39c974){const _0x57bf84=a107_0x2b6f,_0x32fd7c=_0x39c974[_0x57bf84(0x176)];if(!_0x32fd7c)return new Map();const _0x2533c6=collectSegmentUsageCounts(_0x39c974),_0x351e4a=new Map();let _0x26e9a6=0x0;for(const [_0x2d9606,_0x39b6ef]of Object[_0x57bf84(0x17b)](_0x32fd7c)){if(!_0x39b6ef['rule']){_0x26e9a6++;continue;}const _0x6092b6=serializeRule(_0x39b6ef[_0x57bf84(0x15e)]),_0x1916d0=_0x351e4a[_0x57bf84(0x17f)](_0x6092b6)||[];_0x1916d0[_0x57bf84(0x187)]({'name':_0x2d9606,'index':_0x26e9a6}),_0x351e4a[_0x57bf84(0x164)](_0x6092b6,_0x1916d0),_0x26e9a6++;}const _0x108e8a=new Map();for(const [_0x527afa,_0x390ea5]of _0x351e4a){const _0xeb2dbe=_0x390ea5[_0x57bf84(0x171)]()[_0x57bf84(0x181)]((_0x280d61,_0x313de6)=>{const _0xfd0ad=_0x57bf84,_0x17c148=_0x2533c6[_0xfd0ad(0x17f)](_0x280d61[_0xfd0ad(0x16b)])||0x0,_0x482215=_0x2533c6['get'](_0x313de6[_0xfd0ad(0x16b)])||0x0;if(_0x17c148!==_0x482215)return _0x482215-_0x17c148;return _0x280d61[_0xfd0ad(0x193)]-_0x313de6[_0xfd0ad(0x193)];})[_0x57bf84(0x184)](_0x43e140=>_0x43e140[_0x57bf84(0x16b)]);_0x108e8a[_0x57bf84(0x164)](_0x527afa,_0xeb2dbe);}return _0x108e8a;}export function collectSegmentUsageCounts(_0xa2b55e){const _0x20bcf4=a107_0x2b6f,_0x117b73=new Map(),_0x4baf9b=_0x14e6cb=>{const _0x2f3801=a107_0x2b6f;if(!_0x14e6cb)return;_0x117b73[_0x2f3801(0x164)](_0x14e6cb,(_0x117b73[_0x2f3801(0x17f)](_0x14e6cb)||0x0)+0x1);},_0x251564=_0x54a1de=>{const _0x4aed7d=a107_0x2b6f;for(const _0x469a35 of _0x54a1de){_0x4baf9b(_0x469a35[_0x4aed7d(0x18b)]?.['segment']);if(_0x469a35[_0x4aed7d(0x167)])for(const _0x3e4452 of _0x469a35[_0x4aed7d(0x167)]){_0x4baf9b(_0x3e4452['segment']);}_0x4baf9b(_0x469a35[_0x4aed7d(0x16d)]?.['segment']);if(_0x469a35[_0x4aed7d(0x156)])for(const _0x53ab8e of _0x469a35[_0x4aed7d(0x156)]){if(_0x53ab8e[_0x4aed7d(0x18d)]===_0x4aed7d(0x173))for(const _0x2d69f7 of _0x53ab8e[_0x4aed7d(0x192)][_0x4aed7d(0x18f)]){_0x4baf9b(_0x2d69f7['segment']);}else _0x53ab8e[_0x4aed7d(0x18d)]===_0x4aed7d(0x15d)&&_0x4baf9b(_0x53ab8e['with']['condition']?.['segment']);}}};_0x4baf9b(_0xa2b55e['goal']?.['segment']);if(_0xa2b55e[_0x20bcf4(0x18c)])for(const _0x227c01 of _0xa2b55e['journeys']){_0x4baf9b(_0x227c01[_0x20bcf4(0x17c)]?.[_0x20bcf4(0x148)]),_0x251564(_0x227c01[_0x20bcf4(0x189)]);}_0xa2b55e[_0x20bcf4(0x189)]&&_0x251564(_0xa2b55e[_0x20bcf4(0x189)]);if(_0xa2b55e['versions'])for(const _0x4c9aa3 of _0xa2b55e[_0x20bcf4(0x158)]){_0x251564(_0x4c9aa3[_0x20bcf4(0x189)]);}return _0x117b73;}
1
+ (function(_0x1dd096,_0xf6c181){const _0x4b20f3=a107_0xdd56,_0x23f79c=_0x1dd096();while(!![]){try{const _0x3d3406=-parseInt(_0x4b20f3(0x20a))/0x1+-parseInt(_0x4b20f3(0x20f))/0x2+-parseInt(_0x4b20f3(0x224))/0x3+parseInt(_0x4b20f3(0x1ff))/0x4+-parseInt(_0x4b20f3(0x20c))/0x5*(-parseInt(_0x4b20f3(0x200))/0x6)+parseInt(_0x4b20f3(0x218))/0x7*(parseInt(_0x4b20f3(0x22e))/0x8)+parseInt(_0x4b20f3(0x235))/0x9;if(_0x3d3406===_0xf6c181)break;else _0x23f79c['push'](_0x23f79c['shift']());}catch(_0xaaef95){_0x23f79c['push'](_0x23f79c['shift']());}}}(a107_0x5328,0x59536));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x1eaaff){const _0x22dbdd=a107_0xdd56;return _0x1eaaff[_0x22dbdd(0x220)]()['replace'](/\s+/g,'_')[_0x22dbdd(0x221)](/[^a-z0-9_]/g,'')[_0x22dbdd(0x221)](/_+/g,'_')[_0x22dbdd(0x221)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x27b115){const _0x570c9a=a107_0xdd56,_0x3a614f=_0x27b115[_0x570c9a(0x211)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x3a614f){const _0xa56dd=_0x3a614f[0x1]['toLowerCase'](),_0x1b6b7a=_0x3a614f[0x2],_0x2e2781=_0x1b6b7a[_0x570c9a(0x221)](/-/g,'')[_0x570c9a(0x237)](0x0,0x4)[_0x570c9a(0x220)]();return _0xa56dd+'_'+_0x2e2781;}const _0x430c1b=_0x27b115[_0x570c9a(0x211)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x430c1b){const _0x2f2096=_0x430c1b[0x1],_0x32addf=_0x430c1b[0x2][_0x570c9a(0x220)](),_0xb280e9=_0x2f2096[_0x570c9a(0x221)](/-/g,'')[_0x570c9a(0x237)](0x0,0x4)[_0x570c9a(0x220)]();return _0x32addf+'_'+_0xb280e9;}return undefined;}function stableStringify(_0x56e9bf){const _0x7471a0=a107_0xdd56;if(Array[_0x7471a0(0x212)](_0x56e9bf))return'['+_0x56e9bf[_0x7471a0(0x234)](_0x30e96d=>stableStringify(_0x30e96d))[_0x7471a0(0x21f)](',')+']';if(_0x56e9bf&&typeof _0x56e9bf===_0x7471a0(0x1fe)){const _0x47d070=_0x56e9bf,_0x47164c=Object['keys'](_0x47d070)[_0x7471a0(0x230)](),_0x572d56=_0x47164c[_0x7471a0(0x234)](_0x40d39c=>'\x22'+_0x40d39c+'\x22:'+stableStringify(_0x47d070[_0x40d39c]));return'{'+_0x572d56[_0x7471a0(0x21f)](',')+'}';}const _0x1e5e5f=JSON['stringify'](_0x56e9bf);return _0x1e5e5f===undefined?_0x7471a0(0x232):_0x1e5e5f;}export function consolidateActivationsByContent(_0x530104){const _0x1fd900=a107_0xdd56,_0x85560b={},_0x2cce6c=new Map(),_0x2b9571=new Map();for(const _0x351518 of _0x530104){if(!_0x351518)continue;for(const [_0x2b2d15,_0x1d2b01]of Object[_0x1fd900(0x201)](_0x351518)){const _0x285edc={'connection':_0x1d2b01[_0x1fd900(0x204)],..._0x1d2b01[_0x1fd900(0x228)]!==undefined&&{'all_columns':_0x1d2b01[_0x1fd900(0x228)]},..._0x1d2b01[_0x1fd900(0x21a)]!==undefined&&{'columns':_0x1d2b01[_0x1fd900(0x21a)]},..._0x1d2b01[_0x1fd900(0x1f3)]!==undefined&&{'behavior':_0x1d2b01[_0x1fd900(0x1f3)]},..._0x1d2b01[_0x1fd900(0x203)]!==undefined&&{'schedule':_0x1d2b01[_0x1fd900(0x203)]},..._0x1d2b01[_0x1fd900(0x1f1)]!==undefined&&{'notification':_0x1d2b01[_0x1fd900(0x1f1)]},..._0x1d2b01[_0x1fd900(0x1ed)]!==undefined&&{'connector_config':_0x1d2b01['connector_config']},..._0x1d2b01[_0x1fd900(0x20e)]!==undefined&&{'activation_template_id':_0x1d2b01[_0x1fd900(0x20e)]}},_0x5d4418=stableStringify(_0x285edc),_0x1ad5bb=_0x2b9571[_0x1fd900(0x233)](_0x5d4418);_0x1ad5bb?_0x2cce6c[_0x1fd900(0x216)](_0x2b2d15,_0x1ad5bb):(_0x85560b[_0x2b2d15]=_0x1d2b01,_0x2cce6c[_0x1fd900(0x216)](_0x2b2d15,_0x2b2d15),_0x2b9571['set'](_0x5d4418,_0x2b2d15));}}return{'merged':_0x85560b,'nameMapping':_0x2cce6c};}function a107_0x5328(){const _0x2d35b0=['exit_criteria','8rCJfZx','branches','sort','journeys','null','get','map','1358802JAEfGU','conditions','slice','journeyStages','max','bundle_id','yaml','connector_config','decision_point','condition','name','notification','version_number','behavior','find','exclude','with','journey','versionNumber','draft','latest','string','description','index','object','2436096JUzZNB','1194heZZZz','entries','goal','schedule','connection','push','merged','stringify','entry_criteria','segment','10982EDWqap','version','12640PPHYfF','activation','activation_template_id','1171448OSwnDv','bundle_name','match','isArray','stages','segments','some','set','versions','2138297fjxTcJ','length','columns','keys','journeyBundleName','wait','rule','join','toLowerCase','replace','type','item','1817883xnvNWM','nameMapping','launched','.yml','all_columns','reentry','attributes','endsWith','steps'];a107_0x5328=function(){return _0x2d35b0;};return a107_0x5328();}export function updateActivationReferences(_0x38523b,_0x596de7){const _0x1b3462=a107_0xdd56;if(!_0x38523b)return;for(const _0x37a5ab of _0x38523b){if(!_0x37a5ab[_0x1b3462(0x22c)])continue;for(const _0x4cf346 of _0x37a5ab[_0x1b3462(0x22c)]){if(_0x4cf346[_0x1b3462(0x222)]===_0x1b3462(0x20d)&&_0x4cf346[_0x1b3462(0x1f6)]?.[_0x1b3462(0x20d)]){const _0x476b38=_0x596de7['get'](_0x4cf346[_0x1b3462(0x1f6)][_0x1b3462(0x20d)]);_0x476b38&&_0x476b38!==_0x4cf346[_0x1b3462(0x1f6)][_0x1b3462(0x20d)]&&(_0x4cf346['with'][_0x1b3462(0x20d)]=_0x476b38);}}}}export function consolidateSegmentsByContent(_0x312dd2,_0x290511){const _0x4c1539=a107_0xdd56,_0x3b8828={},_0x4f261a=new Map(),_0xf842dd=new Map();for(const _0x532fb8 of _0x312dd2){if(!_0x532fb8)continue;for(const [_0x3c3233,_0x1047f7]of Object['entries'](_0x532fb8)){if(!_0x1047f7['rule']){_0x3b8828[_0x3c3233]=_0x1047f7,_0x4f261a['set'](_0x3c3233,_0x3c3233);continue;}const _0x39399d=_0x1047f7[_0x4c1539(0x1fc)]&&_0x1047f7[_0x4c1539(0x1fc)]['trim']()?_0x1047f7[_0x4c1539(0x1fc)]:undefined,_0x3d34c1=JSON[_0x4c1539(0x207)]({'description':_0x39399d,'rule':deepSortObject(_0x1047f7[_0x4c1539(0x21e)])}),_0x44effe=_0xf842dd[_0x4c1539(0x233)](_0x3d34c1);if(_0x44effe){const _0x369126={..._0x1047f7[_0x4c1539(0x1fc)]!==undefined&&{'description':_0x1047f7[_0x4c1539(0x1fc)]},'rule':_0x1047f7[_0x4c1539(0x21e)]?deepSortObject(_0x1047f7['rule']):_0x1047f7[_0x4c1539(0x21e)]};if(_0x3c3233<_0x44effe){_0x3b8828[_0x3c3233]=_0x369126,delete _0x3b8828[_0x44effe];for(const [_0x84ec7f,_0x442edb]of _0x4f261a[_0x4c1539(0x201)]()){_0x442edb===_0x44effe&&_0x4f261a['set'](_0x84ec7f,_0x3c3233);}_0x4f261a[_0x4c1539(0x216)](_0x3c3233,_0x3c3233),_0xf842dd[_0x4c1539(0x216)](_0x3d34c1,_0x3c3233);}else _0x3b8828[_0x44effe]=_0x369126,_0x4f261a[_0x4c1539(0x216)](_0x3c3233,_0x44effe);}else{let _0xa575b6=_0x3c3233;if(_0x290511){const _0x33a5b4=_0x290511[_0x4c1539(0x233)](_0x3d34c1);_0x33a5b4&&_0x33a5b4[_0x4c1539(0x219)]>0x0&&(_0xa575b6=_0x33a5b4[_0x4c1539(0x237)]()[_0x4c1539(0x230)]()[0x0]);}const _0x3428bb={..._0x1047f7[_0x4c1539(0x1fc)]!==undefined&&{'description':_0x1047f7[_0x4c1539(0x1fc)]},'rule':_0x1047f7[_0x4c1539(0x21e)]?deepSortObject(_0x1047f7[_0x4c1539(0x21e)]):_0x1047f7[_0x4c1539(0x21e)]};_0x3b8828[_0xa575b6]=_0x3428bb,_0x4f261a[_0x4c1539(0x216)](_0x3c3233,_0xa575b6),_0xf842dd[_0x4c1539(0x216)](_0x3d34c1,_0xa575b6);}}}return{'merged':_0x3b8828,'nameMapping':_0x4f261a};}export function updateSegmentReferences(_0x4a6d95,_0x37dc9b){const _0x3c2424=a107_0xdd56;if(!_0x4a6d95)return;for(const _0x1864d6 of _0x4a6d95){if(_0x1864d6[_0x3c2424(0x208)]?.['segment']){const _0x5c14bb=_0x37dc9b[_0x3c2424(0x233)](_0x1864d6[_0x3c2424(0x208)][_0x3c2424(0x209)]);_0x5c14bb&&(_0x1864d6[_0x3c2424(0x208)][_0x3c2424(0x209)]=_0x5c14bb);}if(_0x1864d6[_0x3c2424(0x22c)])for(const _0x2fd9e6 of _0x1864d6['steps']){if(_0x2fd9e6[_0x3c2424(0x222)]===_0x3c2424(0x1ee)&&_0x2fd9e6[_0x3c2424(0x1f6)]?.[_0x3c2424(0x22f)])for(const _0x2ed364 of _0x2fd9e6['with'][_0x3c2424(0x22f)]){if(_0x2ed364['segment']){const _0x13771c=_0x37dc9b[_0x3c2424(0x233)](_0x2ed364[_0x3c2424(0x209)]);_0x13771c&&(_0x2ed364[_0x3c2424(0x209)]=_0x13771c);}}}}}export function updateSegmentRefsInSegments(_0x2ad243,_0x596da2){const _0x325088=a107_0xdd56;for(const _0x4e7eab of Object['values'](_0x2ad243)){_0x4e7eab['rule']&&updateSegmentRefsInRule(_0x4e7eab[_0x325088(0x21e)],_0x596da2);}}function updateSegmentRefsInRule(_0x26b9bc,_0x341961){const _0x26ef01=a107_0xdd56;if(_0x26b9bc===null||typeof _0x26b9bc!==_0x26ef01(0x1fe))return;if(Array[_0x26ef01(0x212)](_0x26b9bc)){for(const _0x57f408 of _0x26b9bc){updateSegmentRefsInRule(_0x57f408,_0x341961);}return;}const _0x3cf750=_0x26b9bc;if((_0x3cf750[_0x26ef01(0x222)]==='include'||_0x3cf750[_0x26ef01(0x222)]===_0x26ef01(0x1f5))&&typeof _0x3cf750[_0x26ef01(0x209)]===_0x26ef01(0x1fb)){const _0x328aa0=_0x341961[_0x26ef01(0x233)](_0x3cf750[_0x26ef01(0x209)]);_0x328aa0&&(_0x3cf750['segment']=_0x328aa0);}if(_0x3cf750[_0x26ef01(0x236)]&&Array['isArray'](_0x3cf750[_0x26ef01(0x236)]))for(const _0x4c5910 of _0x3cf750[_0x26ef01(0x236)]){updateSegmentRefsInRule(_0x4c5910,_0x341961);}}export function buildJourneysArray(_0x4d5ac8){const _0x260fc1=a107_0xdd56,_0x2992c7=Math[_0x260fc1(0x239)](..._0x4d5ac8[_0x260fc1(0x234)](_0x186302=>_0x186302[_0x260fc1(0x223)][_0x260fc1(0x1f8)]||0x0));return _0x4d5ac8[_0x260fc1(0x234)](_0x398056=>{const _0x50428c=_0x260fc1,_0x3a1b28=(_0x398056[_0x50428c(0x223)][_0x50428c(0x1f8)]||0x0)===_0x2992c7,_0x17566c=_0x398056[_0x50428c(0x1ec)][_0x50428c(0x231)]?.[0x0],_0x706c86={'version':_0x17566c?.[_0x50428c(0x20b)]||_0x398056[_0x50428c(0x1ec)][_0x50428c(0x20b)]||_0x398056[_0x50428c(0x223)][_0x50428c(0x1f0)],'state':_0x398056[_0x50428c(0x223)]['state']===_0x50428c(0x226)?_0x50428c(0x226):_0x50428c(0x1f9),'stages':_0x17566c?.[_0x50428c(0x213)]||_0x398056['yaml'][_0x50428c(0x213)]||[],'id':_0x17566c?.['id']||_0x398056[_0x50428c(0x1ec)]['id'],'version_number':_0x17566c?.['version_number']||_0x398056[_0x50428c(0x1ec)][_0x50428c(0x1f2)]};return _0x3a1b28&&(_0x706c86[_0x50428c(0x1fa)]=!![]),_0x706c86;});}export function buildMergedJourneyDef(_0xf6f013,_0x5e3013){const _0x5006cf=a107_0xdd56,_0x5f101d=_0xf6f013[0x0][_0x5006cf(0x1ec)],_0x3b0afe=buildJourneysArray(_0xf6f013),{merged:_0x5693d9,nameMapping:_0x3c21d0}=consolidateSegmentsByContent(_0xf6f013[_0x5006cf(0x234)](_0x50b6e9=>_0x50b6e9[_0x5006cf(0x1ec)][_0x5006cf(0x214)]),_0x5e3013);updateSegmentRefsInSegments(_0x5693d9,_0x3c21d0);const _0x308cfd=Array['from'](_0x3c21d0['entries']())[_0x5006cf(0x215)](([_0x51f1dc,_0x17bbb9])=>_0x51f1dc!==_0x17bbb9&&_0x51f1dc['startsWith'](_0x5006cf(0x208)));let _0x1c6b3a=_0x5693d9,_0x27f2eb=new Map();if(_0x308cfd){const _0x3c18a4=consolidateSegmentsByContent([_0x5693d9],_0x5e3013);_0x1c6b3a=_0x3c18a4[_0x5006cf(0x206)],_0x27f2eb=_0x3c18a4[_0x5006cf(0x225)];}const _0x261772=new Map(_0x3c21d0);for(const [_0x155a13,_0x209b32]of _0x27f2eb[_0x5006cf(0x201)]()){_0x261772[_0x5006cf(0x216)](_0x155a13,_0x209b32);}for(const [_0x3d8c6a,_0x2b6468]of _0x261772[_0x5006cf(0x201)]()){let _0x1372c8=_0x2b6468,_0xe0a8b7=0x0;while(_0x261772['has'](_0x1372c8)&&_0x261772[_0x5006cf(0x233)](_0x1372c8)!==_0x1372c8&&_0xe0a8b7<MAX_MAPPING_CHAIN_DEPTH){_0x1372c8=_0x261772[_0x5006cf(0x233)](_0x1372c8),_0xe0a8b7++;}_0x1372c8!==_0x2b6468&&_0x261772[_0x5006cf(0x216)](_0x3d8c6a,_0x1372c8);}for(const _0x174876 of _0x3b0afe){updateSegmentReferences(_0x174876[_0x5006cf(0x213)],_0x261772);}const {merged:_0x4f34c7,nameMapping:_0x27adc8}=consolidateActivationsByContent(_0xf6f013[_0x5006cf(0x234)](_0x593fd4=>_0x593fd4['yaml']['activations']));for(const _0x46e089 of _0x3b0afe){updateActivationReferences(_0x46e089['stages'],_0x27adc8);}let _0x2ba909=_0x5f101d[_0x5006cf(0x202)];if(_0x2ba909?.[_0x5006cf(0x209)]){const _0x48e730=_0x261772[_0x5006cf(0x233)](_0x2ba909[_0x5006cf(0x209)]);_0x48e730&&(_0x2ba909={..._0x2ba909,'segment':_0x48e730});}for(const _0x467364 of _0x3b0afe){if(_0x467364['goal']?.[_0x5006cf(0x209)]){const _0x4c9591=_0x261772['get'](_0x467364['goal'][_0x5006cf(0x209)]);_0x4c9591&&(_0x467364['goal']={..._0x467364[_0x5006cf(0x202)],'segment':_0x4c9591});}}return{'type':_0x5006cf(0x1f7),'name':_0x5f101d['name'],'description':_0x5f101d['description'],'goal':_0x2ba909,'reentry':_0x5f101d[_0x5006cf(0x229)],'segments':Object[_0x5006cf(0x21b)](_0x1c6b3a)[_0x5006cf(0x219)]>0x0?_0x1c6b3a:undefined,'activations':Object['keys'](_0x4f34c7)[_0x5006cf(0x219)]>0x0?_0x4f34c7:undefined,'journeys':_0x3b0afe,'bundle_id':_0x5f101d[_0x5006cf(0x23a)],'bundle_name':_0x5f101d[_0x5006cf(0x210)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x3ab800,_0x3b787c,_0x49d3b8,_0x3cd2e5){const _0x2e416c=a107_0xdd56,_0x30fae9=_0x3ab800+':'+_0x3b787c,_0x44578b=_0x49d3b8[_0x2e416c(0x233)](_0x30fae9);if(_0x44578b)return _0x44578b;const _0x137381=await _0x3cd2e5(_0x3ab800),_0x3cdecd=_0x137381[_0x2e416c(0x22a)][_0x2e416c(0x21c)]||_0x137381[_0x2e416c(0x22a)][_0x2e416c(0x1f0)],_0x1aa763=_0x137381[_0x2e416c(0x22a)][_0x2e416c(0x238)][_0x2e416c(0x1f4)](_0xd07d7=>String(_0xd07d7['id'])===String(_0x3b787c)),_0x1fd82f=_0x1aa763?.[_0x2e416c(0x1f0)]||_0x3b787c,_0x37beb0={'journeyName':_0x3cdecd,'stageName':_0x1fd82f};return _0x49d3b8[_0x2e416c(0x216)](_0x30fae9,_0x37beb0),_0x37beb0;}export function formatApiJourneyName(_0x20fd4c,_0x74487b){return _0x74487b+'\x20('+_0x20fd4c+')';}export function isLocalJourneyRef(_0x1ea32d){const _0x1e0b79=a107_0xdd56;return _0x1ea32d[_0x1e0b79(0x22b)](_0x1e0b79(0x227))||_0x1ea32d['endsWith']('.yaml');}export function buildLocalRuleToNameMapping(_0x446542){const _0x5ac1c8=a107_0xdd56,_0x26f138=new Map();if(!_0x446542)return _0x26f138;for(const [_0x2632d9,_0x4dc8ec]of Object[_0x5ac1c8(0x201)](_0x446542)){if(_0x4dc8ec[_0x5ac1c8(0x21e)]){const _0xe4f1d9=serializeRule(_0x4dc8ec[_0x5ac1c8(0x21e)]),_0x48df75=_0x26f138['get'](_0xe4f1d9)||[];_0x48df75[_0x5ac1c8(0x205)](_0x2632d9),_0x26f138['set'](_0xe4f1d9,_0x48df75);}}return _0x26f138;}function a107_0xdd56(_0x352a95,_0x394975){_0x352a95=_0x352a95-0x1ec;const _0x532887=a107_0x5328();let _0xdd56d5=_0x532887[_0x352a95];return _0xdd56d5;}export function buildLocalRuleToNameMappingFromJourney(_0x44bc43){const _0x5a45c2=a107_0xdd56,_0x5a0e89=_0x44bc43[_0x5a45c2(0x214)];if(!_0x5a0e89)return new Map();const _0x36941b=collectSegmentUsageCounts(_0x44bc43),_0x33af40=new Map();let _0x5d2ee8=0x0;for(const [_0x2010a0,_0x3bdec5]of Object[_0x5a45c2(0x201)](_0x5a0e89)){if(!_0x3bdec5[_0x5a45c2(0x21e)]){_0x5d2ee8++;continue;}const _0x13e7c1=serializeRule(_0x3bdec5[_0x5a45c2(0x21e)]),_0x34e9c5=_0x33af40[_0x5a45c2(0x233)](_0x13e7c1)||[];_0x34e9c5[_0x5a45c2(0x205)]({'name':_0x2010a0,'index':_0x5d2ee8}),_0x33af40[_0x5a45c2(0x216)](_0x13e7c1,_0x34e9c5),_0x5d2ee8++;}const _0x2459f2=new Map();for(const [_0x4daf9a,_0xadb6d7]of _0x33af40){const _0x2d5e5a=_0xadb6d7[_0x5a45c2(0x237)]()[_0x5a45c2(0x230)]((_0x792218,_0x5ee1c2)=>{const _0x487235=_0x5a45c2,_0x5da891=_0x36941b[_0x487235(0x233)](_0x792218[_0x487235(0x1f0)])||0x0,_0x354b09=_0x36941b[_0x487235(0x233)](_0x5ee1c2[_0x487235(0x1f0)])||0x0;if(_0x5da891!==_0x354b09)return _0x354b09-_0x5da891;return _0x792218['index']-_0x5ee1c2[_0x487235(0x1fd)];})['map'](_0x100a91=>_0x100a91[_0x5a45c2(0x1f0)]);_0x2459f2[_0x5a45c2(0x216)](_0x4daf9a,_0x2d5e5a);}return _0x2459f2;}export function collectSegmentUsageCounts(_0x3cd80a){const _0x50cfa5=a107_0xdd56,_0x585ae9=new Map(),_0x560f7c=_0x31ce54=>{const _0x39afe0=a107_0xdd56;if(!_0x31ce54)return;_0x585ae9[_0x39afe0(0x216)](_0x31ce54,(_0x585ae9[_0x39afe0(0x233)](_0x31ce54)||0x0)+0x1);},_0x1d21d0=_0x21a614=>{const _0x292a85=a107_0xdd56;for(const _0x2a27ce of _0x21a614){_0x560f7c(_0x2a27ce[_0x292a85(0x208)]?.['segment']);if(_0x2a27ce[_0x292a85(0x22d)])for(const _0x37920e of _0x2a27ce['exit_criteria']){_0x560f7c(_0x37920e['segment']);}_0x560f7c(_0x2a27ce['milestone']?.[_0x292a85(0x209)]);if(_0x2a27ce['steps'])for(const _0x1b4ef9 of _0x2a27ce[_0x292a85(0x22c)]){if(_0x1b4ef9[_0x292a85(0x222)]===_0x292a85(0x1ee))for(const _0x5ffc6f of _0x1b4ef9[_0x292a85(0x1f6)][_0x292a85(0x22f)]){_0x560f7c(_0x5ffc6f['segment']);}else _0x1b4ef9[_0x292a85(0x222)]===_0x292a85(0x21d)&&_0x560f7c(_0x1b4ef9[_0x292a85(0x1f6)][_0x292a85(0x1ef)]?.['segment']);}}};_0x560f7c(_0x3cd80a['goal']?.[_0x50cfa5(0x209)]);if(_0x3cd80a['journeys'])for(const _0x1ce4e4 of _0x3cd80a[_0x50cfa5(0x231)]){_0x560f7c(_0x1ce4e4[_0x50cfa5(0x202)]?.[_0x50cfa5(0x209)]),_0x1d21d0(_0x1ce4e4[_0x50cfa5(0x213)]);}_0x3cd80a[_0x50cfa5(0x213)]&&_0x1d21d0(_0x3cd80a['stages']);if(_0x3cd80a[_0x50cfa5(0x217)])for(const _0x21ca2d of _0x3cd80a['versions']){_0x1d21d0(_0x21ca2d['stages']);}return _0x585ae9;}
@@ -1 +1 @@
1
- (function(_0x15824e,_0x2fc0ec){const _0x565de4=a108_0x279c,_0xec7e8a=_0x15824e();while(!![]){try{const _0xe9b532=-parseInt(_0x565de4(0x118))/0x1+-parseInt(_0x565de4(0x100))/0x2+-parseInt(_0x565de4(0xa1))/0x3*(-parseInt(_0x565de4(0x8c))/0x4)+parseInt(_0x565de4(0x111))/0x5*(-parseInt(_0x565de4(0xe1))/0x6)+parseInt(_0x565de4(0xf9))/0x7*(-parseInt(_0x565de4(0xd3))/0x8)+-parseInt(_0x565de4(0xba))/0x9+parseInt(_0x565de4(0x89))/0xa;if(_0xe9b532===_0x2fc0ec)break;else _0xec7e8a['push'](_0xec7e8a['shift']());}catch(_0x3a6ae5){_0xec7e8a['push'](_0xec7e8a['shift']());}}}(a108_0x1ce2,0xcd32a));import{getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function a108_0x279c(_0x3e2baf,_0x4f7443){_0x3e2baf=_0x3e2baf-0x87;const _0x1ce257=a108_0x1ce2();let _0x279c9c=_0x1ce257[_0x3e2baf];return _0x279c9c;}function createIssue(_0x2863fc,_0x1739bd,_0x21ca3a,_0x456fa2,_0x365adf,_0x2a6c28){const _0xacd4b4=a108_0x279c;return{'level':_0x2863fc,'path':_0x1739bd,'code':_0x21ca3a,'message':_0x456fa2,'location':getLocationFromPath(_0x365adf[_0xacd4b4(0x104)],_0x365adf[_0xacd4b4(0xbf)],pathToArray(_0x2a6c28??_0x1739bd))};}function validateJourneyStructure(_0x181cdd,_0x40fa3c,_0x249a2e){const _0xca749=a108_0x279c,_0x335214=[];return _0x40fa3c[_0xca749(0x115)]>MAX_STAGES&&_0x335214['push'](createIssue(_0xca749(0xe9),'stages',_0xca749(0x103),_0xca749(0x10a)+_0x40fa3c[_0xca749(0x115)]+_0xca749(0xc8)+MAX_STAGES,_0x249a2e)),!_0x181cdd[_0xca749(0x99)]&&_0x335214[_0xca749(0x106)](createIssue(_0xca749(0xe9),'goal',_0xca749(0x110),_0xca749(0xa6),_0x249a2e)),_0x335214;}function validateStageStructure(_0x1f413d,_0x56c509,_0x18b5ac,_0x311d38){const _0x2505de=a108_0x279c,_0x1f4c37=[],_0x5bcb2e=_0x2505de(0xc7)+_0x56c509+']';_0x56c509===0x0&&!_0x1f413d[_0x2505de(0xe8)]&&_0x1f4c37[_0x2505de(0x106)](createIssue('error',_0x5bcb2e+_0x2505de(0xfc),_0x2505de(0xb0),_0x2505de(0xf0)+_0x1f413d[_0x2505de(0xaf)]+_0x2505de(0x10e),_0x311d38,_0x5bcb2e));const _0xe406a7=_0x56c509===_0x18b5ac-0x1;!_0xe406a7&&!_0x1f413d[_0x2505de(0xc0)]&&_0x1f4c37['push'](createIssue(_0x2505de(0xe9),_0x5bcb2e+_0x2505de(0xa7),_0x2505de(0xbe),_0x2505de(0xf0)+_0x1f413d[_0x2505de(0xaf)]+_0x2505de(0x109),_0x311d38,_0x5bcb2e));(!_0x1f413d['exit_criteria']||_0x1f413d[_0x2505de(0xfe)][_0x2505de(0x115)]===0x0)&&_0x1f4c37[_0x2505de(0x106)](createIssue('warning',_0x5bcb2e+_0x2505de(0x9e),_0x2505de(0x8a),'Stage\x20\x27'+_0x1f413d[_0x2505de(0xaf)]+_0x2505de(0x9f),_0x311d38,_0x5bcb2e));const _0x56d0d6=_0x1f413d[_0x2505de(0xcf)]?.[_0x2505de(0x115)]??0x0;if(_0x56d0d6<=0x1)_0x1f4c37[_0x2505de(0x106)](createIssue(_0x2505de(0xe9),_0x5bcb2e+_0x2505de(0xed),_0x2505de(0xbb),_0x2505de(0xf0)+_0x1f413d[_0x2505de(0xaf)]+'\x27\x20has\x20'+_0x56d0d6+'\x20step(s)\x20but\x20needs\x20at\x20least\x202',_0x311d38,_0x5bcb2e+_0x2505de(0xed)));else _0x56d0d6<=0x3&&_0x1f4c37[_0x2505de(0x106)](createIssue(_0x2505de(0xa2),_0x5bcb2e+_0x2505de(0xed),'FEW_STEPS',_0x2505de(0xf0)+_0x1f413d['name']+_0x2505de(0xa9)+_0x56d0d6+_0x2505de(0xeb),_0x311d38,_0x5bcb2e+_0x2505de(0xed)));return _0x1f4c37;}function validateStep(_0x5bf069,_0x16a02,_0x4c76e2,_0x12d55b){const _0x328c4d=a108_0x279c,_0x498b2d=[];if(_0x5bf069[_0x328c4d(0xb5)]===_0x328c4d(0xfb))return _0x5bf069['next']&&_0x498b2d['push'](createIssue(_0x328c4d(0xe9),_0x16a02+_0x328c4d(0xb3),_0x328c4d(0xc2),_0x328c4d(0x101)+_0x5bf069['name']+_0x328c4d(0xe0),_0x4c76e2)),_0x328c4d(0xfa)in _0x5bf069&&_0x5bf069[_0x328c4d(0xfa)]!==undefined&&_0x498b2d[_0x328c4d(0x106)](createIssue('error',_0x16a02+_0x328c4d(0x98),_0x328c4d(0xc2),_0x328c4d(0x101)+_0x5bf069[_0x328c4d(0xaf)]+_0x328c4d(0x113),_0x4c76e2)),_0x498b2d;_0x5bf069[_0x328c4d(0xf5)]&&(_0x4c76e2['stepNames']&&!_0x4c76e2[_0x328c4d(0x112)][_0x328c4d(0x114)](_0x5bf069[_0x328c4d(0xf5)])&&_0x498b2d[_0x328c4d(0x106)](createIssue(_0x328c4d(0xe9),_0x16a02+_0x328c4d(0xb3),_0x328c4d(0x96),_0x328c4d(0x102)+_0x5bf069['next']+'\x27',_0x4c76e2)));switch(_0x5bf069[_0x328c4d(0xb5)]){case _0x328c4d(0x8b):_0x498b2d[_0x328c4d(0x106)](...validateWaitStep(_0x5bf069,_0x16a02,_0x4c76e2,_0x12d55b));break;case _0x328c4d(0x108):_0x498b2d[_0x328c4d(0x106)](...validateActivationStep(_0x5bf069,_0x16a02,_0x4c76e2));break;case _0x328c4d(0x9c):_0x498b2d[_0x328c4d(0x106)](...validateDecisionPointStep(_0x5bf069,_0x16a02,_0x4c76e2,_0x12d55b));break;case _0x328c4d(0xce):_0x498b2d['push'](...validateAbTestStep(_0x5bf069,_0x16a02,_0x4c76e2,_0x12d55b));break;case _0x328c4d(0xa8):_0x498b2d[_0x328c4d(0x106)](...validateJumpStep(_0x5bf069,_0x16a02,_0x4c76e2));break;}return _0x498b2d;}function validateWaitStep(_0x52fc56,_0x351056,_0x1cf9e2,_0x25e175){const _0x3dece2=a108_0x279c,_0x2212bc=[];if(!_0x52fc56[_0x3dece2(0xfa)])return _0x2212bc['push'](createIssue(_0x3dece2(0xe9),_0x351056+_0x3dece2(0x98),_0x3dece2(0xad),_0x3dece2(0xf2),_0x1cf9e2,_0x351056)),_0x2212bc;if(_0x52fc56[_0x3dece2(0xfa)][_0x3dece2(0x88)]){const _0x4c7259=_0x52fc56[_0x3dece2(0xfa)][_0x3dece2(0x88)];if(_0x4c7259[_0x3dece2(0x105)]){_0x1cf9e2[_0x3dece2(0xee)]?.['add'](_0x4c7259[_0x3dece2(0x105)]);!_0x4c7259[_0x3dece2(0x105)][_0x3dece2(0xab)]('ref:')&&(_0x1cf9e2['embeddedSegments']&&!_0x1cf9e2[_0x3dece2(0xf6)][_0x3dece2(0x114)](_0x4c7259[_0x3dece2(0x105)])&&_0x2212bc['push'](createIssue(_0x3dece2(0xe9),_0x351056+'.with.condition.segment',_0x3dece2(0x90),'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x4c7259[_0x3dece2(0x105)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.',_0x1cf9e2)));_0x4c7259[_0x3dece2(0xf5)]&&_0x1cf9e2[_0x3dece2(0x112)]&&!_0x1cf9e2['stepNames']['has'](_0x4c7259[_0x3dece2(0xf5)])&&_0x2212bc['push'](createIssue('error',_0x351056+_0x3dece2(0xdb),_0x3dece2(0x96),'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x4c7259[_0x3dece2(0xf5)]+'\x27',_0x1cf9e2));_0x4c7259[_0x3dece2(0xe5)]?.[_0x3dece2(0xf5)]&&_0x1cf9e2['stepNames']&&!_0x1cf9e2[_0x3dece2(0x112)][_0x3dece2(0x114)](_0x4c7259[_0x3dece2(0xe5)]['next'])&&_0x2212bc['push'](createIssue('error',_0x351056+_0x3dece2(0xff),'INVALID_NEXT_REFERENCE',_0x3dece2(0xca)+_0x4c7259[_0x3dece2(0xe5)][_0x3dece2(0xf5)]+'\x27',_0x1cf9e2));const _0x470374=_0x4c7259[_0x3dece2(0xf5)]||_0x52fc56[_0x3dece2(0xf5)],_0x5b5de=_0x4c7259[_0x3dece2(0xe5)]?.[_0x3dece2(0xf5)]||_0x52fc56[_0x3dece2(0xf5)];if(_0x470374){const _0x679331=_0x25e175[_0x3dece2(0xd6)](_0x470374);_0x679331?.[_0x3dece2(0xb5)]===_0x3dece2(0xb6)&&_0x2212bc['push'](createIssue(_0x3dece2(0xe9),_0x351056+_0x3dece2(0xdb),_0x3dece2(0x95),'Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x470374+_0x3dece2(0x8f),_0x1cf9e2,_0x351056+_0x3dece2(0x97)));}if(_0x5b5de){const _0x261acf=_0x25e175[_0x3dece2(0xd6)](_0x5b5de);_0x261acf?.[_0x3dece2(0xb5)]===_0x3dece2(0xb6)&&_0x2212bc[_0x3dece2(0x106)](createIssue(_0x3dece2(0xe9),_0x351056+'.with.condition.timeout.next',_0x3dece2(0x95),'Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x5b5de+_0x3dece2(0x8f),_0x1cf9e2,_0x351056+_0x3dece2(0xd7)));}}}return _0x2212bc;}function validateActivationStep(_0x3bbe87,_0x251cfc,_0x55b2a5){const _0x186e63=a108_0x279c,_0x2bb6c7=[];if(!_0x3bbe87[_0x186e63(0xfa)]?.[_0x186e63(0x108)])return _0x2bb6c7['push'](createIssue('error',_0x251cfc+_0x186e63(0xcb),_0x186e63(0x10d),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x55b2a5,_0x251cfc)),_0x2bb6c7;const _0x53bd13=_0x3bbe87['with']['activation'];return _0x55b2a5['activationKeys']&&!_0x53bd13[_0x186e63(0xab)](_0x186e63(0xf1))&&(!_0x55b2a5[_0x186e63(0xbd)][_0x186e63(0x114)](_0x53bd13)&&_0x2bb6c7[_0x186e63(0x106)](createIssue(_0x186e63(0xe9),_0x251cfc+'.with.activation',_0x186e63(0xb1),_0x186e63(0x10f)+_0x53bd13+_0x186e63(0x11b),_0x55b2a5))),_0x2bb6c7;}function validateDecisionPointStep(_0x573444,_0x143a36,_0x117c29,_0x22a339){const _0x33c4dc=a108_0x279c,_0x3c9526=[];if(!_0x573444['with']?.[_0x33c4dc(0x117)]||_0x573444[_0x33c4dc(0xfa)][_0x33c4dc(0x117)][_0x33c4dc(0x115)]===0x0)return _0x3c9526['push'](createIssue(_0x33c4dc(0xe9),_0x143a36+'.with.branches',_0x33c4dc(0xda),_0x33c4dc(0xef),_0x117c29,_0x143a36)),_0x3c9526;for(let _0x14511f=0x0;_0x14511f<_0x573444[_0x33c4dc(0xfa)][_0x33c4dc(0x117)][_0x33c4dc(0x115)];_0x14511f++){const _0x53beb9=_0x573444[_0x33c4dc(0xfa)]['branches'][_0x14511f],_0x476358=_0x143a36+_0x33c4dc(0x9b)+_0x14511f+']';_0x53beb9[_0x33c4dc(0x105)]&&!_0x53beb9[_0x33c4dc(0x8d)]&&(_0x117c29[_0x33c4dc(0xee)]?.[_0x33c4dc(0xe2)](_0x53beb9['segment']),!_0x53beb9[_0x33c4dc(0x105)][_0x33c4dc(0xab)](_0x33c4dc(0xf1))&&(_0x117c29[_0x33c4dc(0xf6)]&&!_0x117c29['embeddedSegments']['has'](_0x53beb9[_0x33c4dc(0x105)])&&_0x3c9526[_0x33c4dc(0x106)](createIssue(_0x33c4dc(0xe9),_0x476358+_0x33c4dc(0xd9),_0x33c4dc(0x90),_0x33c4dc(0xa3)+_0x53beb9[_0x33c4dc(0x105)]+'\x27',_0x117c29))));_0x53beb9[_0x33c4dc(0xf5)]&&_0x117c29['stepNames']&&!_0x117c29[_0x33c4dc(0x112)][_0x33c4dc(0x114)](_0x53beb9[_0x33c4dc(0xf5)])&&_0x3c9526['push'](createIssue(_0x33c4dc(0xe9),_0x476358+_0x33c4dc(0xb3),'INVALID_NEXT_REFERENCE',_0x33c4dc(0xb4)+_0x53beb9[_0x33c4dc(0xf5)]+'\x27',_0x117c29));if(_0x53beb9[_0x33c4dc(0xf5)]){const _0x1b8718=_0x22a339[_0x33c4dc(0xd6)](_0x53beb9[_0x33c4dc(0xf5)]);_0x1b8718?.[_0x33c4dc(0xb5)]==='merge'&&_0x3c9526[_0x33c4dc(0x106)](createIssue(_0x33c4dc(0xe9),_0x476358+_0x33c4dc(0xb3),_0x33c4dc(0x95),'Decision\x20branch\x20\x27'+_0x53beb9['name']+_0x33c4dc(0xd1)+_0x53beb9['next']+_0x33c4dc(0xd0),_0x117c29));}}return _0x3c9526;}function validateAbTestStep(_0x3f92d6,_0x14b138,_0x20b557,_0x3cc616){const _0x340634=a108_0x279c,_0x55da84=[];if(!_0x3f92d6[_0x340634(0xfa)]?.[_0x340634(0xdf)]||_0x3f92d6[_0x340634(0xfa)]['variants']['length']===0x0)return _0x55da84[_0x340634(0x106)](createIssue(_0x340634(0xe9),_0x14b138+_0x340634(0x11d),_0x340634(0xda),_0x340634(0xb7),_0x20b557,_0x14b138)),_0x55da84;const _0x5506f8=_0x3f92d6['with']['variants'][_0x340634(0xe7)]((_0x1ed5fd,_0x5115da)=>_0x1ed5fd+(_0x5115da[_0x340634(0xcc)]||0x0),0x0);Math[_0x340634(0xa5)](_0x5506f8-0x64)>0.01&&_0x55da84[_0x340634(0x106)](createIssue(_0x340634(0xe9),_0x14b138+_0x340634(0x11d),'INVALID_AB_TEST_PERCENTAGES',_0x340634(0xe4)+_0x5506f8+'%)',_0x20b557));for(let _0xd67c8a=0x0;_0xd67c8a<_0x3f92d6['with']['variants'][_0x340634(0x115)];_0xd67c8a++){const _0x236666=_0x3f92d6['with'][_0x340634(0xdf)][_0xd67c8a],_0x5d7137=_0x14b138+_0x340634(0x94)+_0xd67c8a+']';_0x236666[_0x340634(0xf5)]&&_0x20b557[_0x340634(0x112)]&&!_0x20b557[_0x340634(0x112)]['has'](_0x236666[_0x340634(0xf5)])&&_0x55da84[_0x340634(0x106)](createIssue('error',_0x5d7137+_0x340634(0xb3),_0x340634(0x96),_0x340634(0xf7)+_0x236666[_0x340634(0xf5)]+'\x27',_0x20b557));if(_0x236666[_0x340634(0xf5)]){const _0x2e1caa=_0x3cc616[_0x340634(0xd6)](_0x236666[_0x340634(0xf5)]);_0x2e1caa?.[_0x340634(0xb5)]===_0x340634(0xb6)&&_0x55da84[_0x340634(0x106)](createIssue(_0x340634(0xe9),_0x5d7137+_0x340634(0xb3),_0x340634(0x95),_0x340634(0x93)+_0x236666['name']+_0x340634(0xd1)+_0x236666[_0x340634(0xf5)]+_0x340634(0xd0),_0x20b557));}}return _0x55da84;}function validateJumpStep(_0x920470,_0x3d460f,_0x317c9f){const _0x40085d=a108_0x279c,_0x2cea37=[];if(!_0x920470['with']?.[_0x40085d(0xde)])return _0x2cea37[_0x40085d(0x106)](createIssue(_0x40085d(0xe9),_0x3d460f+'.with.target',_0x40085d(0xe6),_0x40085d(0x11c),_0x317c9f,_0x3d460f)),_0x2cea37;return(!_0x920470[_0x40085d(0xfa)][_0x40085d(0xde)][_0x40085d(0xac)]||!_0x920470[_0x40085d(0xfa)][_0x40085d(0xde)][_0x40085d(0xc5)])&&_0x2cea37[_0x40085d(0x106)](createIssue(_0x40085d(0xe9),_0x3d460f+_0x40085d(0xd2),'INVALID_JUMP_TARGET',_0x40085d(0x11e),_0x317c9f)),_0x2cea37;}function buildConvergenceMap(_0xa2303b){const _0xa0898c=a108_0x279c,_0x26c6dc=new Map();function _0x5695ec(_0x2edd9a,_0x1482a5){const _0x2267a8=a108_0x279c,_0x5e34ff=_0x26c6dc['get'](_0x2edd9a)||[];_0x5e34ff[_0x2267a8(0x106)](_0x1482a5),_0x26c6dc[_0x2267a8(0xdd)](_0x2edd9a,_0x5e34ff);}for(const _0x41d2fb of _0xa2303b){_0x41d2fb[_0xa0898c(0xf5)]&&_0x5695ec(_0x41d2fb[_0xa0898c(0xf5)],{'stepName':_0x41d2fb[_0xa0898c(0xaf)],'description':_0xa0898c(0xb9)+_0x41d2fb[_0xa0898c(0xaf)]+'\x27'});if(_0x41d2fb[_0xa0898c(0xb5)]===_0xa0898c(0x9c)&&_0x41d2fb[_0xa0898c(0xfa)]?.[_0xa0898c(0x117)])for(const _0x3b9f90 of _0x41d2fb['with'][_0xa0898c(0x117)]){_0x3b9f90[_0xa0898c(0xf5)]&&_0x5695ec(_0x3b9f90['next'],{'stepName':_0x41d2fb[_0xa0898c(0xaf)],'description':'branch\x20\x27'+_0x3b9f90[_0xa0898c(0xaf)]+_0xa0898c(0xd8)+_0x41d2fb[_0xa0898c(0xaf)]+'\x27'});}if(_0x41d2fb[_0xa0898c(0xb5)]===_0xa0898c(0xce)&&_0x41d2fb[_0xa0898c(0xfa)]?.[_0xa0898c(0xdf)])for(const _0x5a4ad4 of _0x41d2fb[_0xa0898c(0xfa)][_0xa0898c(0xdf)]){_0x5a4ad4[_0xa0898c(0xf5)]&&_0x5695ec(_0x5a4ad4[_0xa0898c(0xf5)],{'stepName':_0x41d2fb[_0xa0898c(0xaf)],'description':_0xa0898c(0xae)+_0x5a4ad4[_0xa0898c(0xaf)]+'\x27\x20of\x20\x27'+_0x41d2fb[_0xa0898c(0xaf)]+'\x27'});}_0x41d2fb[_0xa0898c(0xb5)]===_0xa0898c(0x8b)&&_0x41d2fb[_0xa0898c(0xfa)]?.[_0xa0898c(0x88)]&&(_0x41d2fb[_0xa0898c(0xfa)][_0xa0898c(0x88)]['next']&&_0x5695ec(_0x41d2fb['with']['condition'][_0xa0898c(0xf5)],{'stepName':_0x41d2fb[_0xa0898c(0xaf)],'description':'condition\x20of\x20\x27'+_0x41d2fb['name']+'\x27'}),_0x41d2fb[_0xa0898c(0xfa)][_0xa0898c(0x88)]['timeout']?.[_0xa0898c(0xf5)]&&_0x5695ec(_0x41d2fb[_0xa0898c(0xfa)]['condition'][_0xa0898c(0xe5)]['next'],{'stepName':_0x41d2fb[_0xa0898c(0xaf)],'description':_0xa0898c(0x10c)+_0x41d2fb[_0xa0898c(0xaf)]+'\x27'}));}return _0x26c6dc;}function validateFlowControl(_0x2c4890,_0x126735,_0x134b77){const _0x20119f=a108_0x279c,_0x20b7d0=[],_0x110f8c=_0x20119f(0xc7)+_0x126735+']',_0x21ceda=_0x2c4890[_0x20119f(0xcf)]||[];if(_0x21ceda['length']===0x0)return _0x20b7d0;const _0x2f2b4d=new Map();for(const _0x450cc3 of _0x21ceda){_0x450cc3['name']&&_0x2f2b4d[_0x20119f(0xdd)](_0x450cc3[_0x20119f(0xaf)],_0x450cc3);}const _0x3b9987=buildConvergenceMap(_0x21ceda),_0xeaadfe=_0x21ceda[_0x20119f(0xfd)](_0x78ee3b=>_0x78ee3b[_0x20119f(0xb5)]==='end');!_0xeaadfe&&_0x20b7d0[_0x20119f(0x106)](createIssue('error',_0x110f8c+'.steps',_0x20119f(0xc4),_0x20119f(0xf0)+_0x2c4890[_0x20119f(0xaf)]+_0x20119f(0x11a),_0x134b77));for(const [_0x3eb8a2,_0x3b1ace]of _0x3b9987){const _0x496647=_0x2f2b4d[_0x20119f(0xd6)](_0x3eb8a2);if(!_0x496647)continue;if(_0x3b1ace[_0x20119f(0x115)]>0x1&&_0x496647[_0x20119f(0xb5)]!=='merge'){const _0x50b2f0=_0x3b1ace['map'](_0x409926=>_0x409926[_0x20119f(0x9d)])['join'](',\x20');_0x20b7d0['push'](createIssue(_0x20119f(0xe9),_0x110f8c+_0x20119f(0xed),_0x20119f(0xec),_0x20119f(0xb2)+_0x3eb8a2+_0x20119f(0xbc)+_0x50b2f0+_0x20119f(0xc9),_0x134b77));}_0x3b1ace[_0x20119f(0x115)]===0x1&&_0x496647[_0x20119f(0xb5)]==='merge'&&_0x20b7d0[_0x20119f(0x106)](createIssue('warning',_0x110f8c+'.steps',_0x20119f(0xaa),_0x20119f(0x91)+_0x3eb8a2+_0x20119f(0x9a)+_0x3b1ace[0x0]['description']+').\x20Merge\x20is\x20unnecessary.',_0x134b77));}for(const _0x3fd00b of _0x21ceda){if(_0x3fd00b[_0x20119f(0xb5)]===_0x20119f(0xb6)&&_0x3fd00b[_0x20119f(0xf5)]){const _0x10ead1=_0x2f2b4d[_0x20119f(0xd6)](_0x3fd00b[_0x20119f(0xf5)]);_0x10ead1?.['type']==='merge'&&_0x20b7d0['push'](createIssue('error',_0x110f8c+_0x20119f(0xed),'MERGE_TO_MERGE_CHAIN',_0x20119f(0x91)+_0x3fd00b[_0x20119f(0xaf)]+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x3fd00b[_0x20119f(0xf5)]+'\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.',_0x134b77));}}return _0x20b7d0;}function validateCriteria(_0x3ec030,_0x213a65,_0x23b53a){const _0x151964=a108_0x279c,_0x252b27=[];return _0x3ec030[_0x151964(0x105)]&&(_0x23b53a['referencedSegments']?.[_0x151964(0xe2)](_0x3ec030[_0x151964(0x105)]),!_0x3ec030[_0x151964(0x105)][_0x151964(0xab)](_0x151964(0xf1))&&(_0x23b53a[_0x151964(0xf6)]&&!_0x23b53a[_0x151964(0xf6)]['has'](_0x3ec030[_0x151964(0x105)])&&_0x252b27['push'](createIssue('error',_0x213a65+'.segment',_0x151964(0x90),_0x151964(0x87)+_0x3ec030[_0x151964(0x105)]+'\x27',_0x23b53a)))),_0x252b27;}function validateEmbeddedSegment(_0x14c3fa,_0x12af48,_0xea8e6a){const _0x57e919=a108_0x279c,_0xba741a=[];return _0x14c3fa[_0x57e919(0xe3)]&&_0xba741a['push'](...validateRuleDef(_0x14c3fa['rule'],_0x12af48+_0x57e919(0x107),_0xea8e6a)),_0xba741a;}function getJourneyStages(_0xd16c25){const _0xc415af=a108_0x279c;if(_0xd16c25[_0xc415af(0xd5)]&&_0xd16c25[_0xc415af(0xd5)][_0xc415af(0x115)]>0x0)return _0xd16c25[_0xc415af(0xd5)];if(_0xd16c25[_0xc415af(0x119)]&&_0xd16c25[_0xc415af(0x119)][_0xc415af(0x115)]>0x0)return _0xd16c25['journeys'][_0xc415af(0xd4)](_0x3e0c99=>_0x3e0c99['stages']||[]);if(_0xd16c25['versions']&&_0xd16c25[_0xc415af(0xa0)][_0xc415af(0x115)]>0x0)return _0xd16c25['versions'][_0xc415af(0xd4)](_0x2ceee0=>_0x2ceee0[_0xc415af(0xd5)]||[]);return[];}function validateStage(_0x5d8ac7,_0x197389,_0x388f95,_0x277094){const _0x76f447=a108_0x279c,_0x4aa154=[],_0x3f281a=_0x76f447(0xc7)+_0x197389+']',_0x5aed5d=new Map(),_0x3316d8=new Map();if(_0x5d8ac7['steps']){for(let _0x3b706d=0x0;_0x3b706d<_0x5d8ac7[_0x76f447(0xcf)][_0x76f447(0x115)];_0x3b706d++){const _0x524126=_0x5d8ac7[_0x76f447(0xcf)][_0x3b706d];_0x524126[_0x76f447(0xaf)]&&_0x5aed5d[_0x76f447(0xdd)](_0x524126[_0x76f447(0xaf)],_0x524126);}for(let _0x115cbc=0x0;_0x115cbc<_0x5d8ac7['steps'][_0x76f447(0x115)];_0x115cbc++){const _0x1cb720=_0x5d8ac7[_0x76f447(0xcf)][_0x115cbc],_0xd27843=_0x3f281a+_0x76f447(0xdc)+_0x115cbc+']';if(_0x1cb720[_0x76f447(0xaf)]){if(_0x3316d8[_0x76f447(0x114)](_0x1cb720['name'])){const _0x21c8ae=_0x3316d8['get'](_0x1cb720['name']);_0x4aa154[_0x76f447(0x106)](createIssue(_0x76f447(0xe9),_0xd27843+'.name','DUPLICATE_STEP_NAME',_0x76f447(0xa4)+_0x1cb720[_0x76f447(0xaf)]+'\x27\x20(first\x20defined\x20at\x20steps['+_0x21c8ae+'])',_0x277094));}else _0x3316d8[_0x76f447(0xdd)](_0x1cb720['name'],_0x115cbc);}_0x4aa154[_0x76f447(0x106)](...validateStep(_0x1cb720,_0xd27843,_0x277094,_0x5aed5d));}}_0x5d8ac7['entry_criteria']&&_0x4aa154[_0x76f447(0x106)](...validateCriteria(_0x5d8ac7[_0x76f447(0xe8)],_0x3f281a+_0x76f447(0xfc),_0x277094));if(_0x5d8ac7[_0x76f447(0xfe)])for(let _0xdbf4d2=0x0;_0xdbf4d2<_0x5d8ac7[_0x76f447(0xfe)][_0x76f447(0x115)];_0xdbf4d2++){_0x4aa154['push'](...validateCriteria(_0x5d8ac7['exit_criteria'][_0xdbf4d2],_0x3f281a+'.exit_criteria['+_0xdbf4d2+']',_0x277094));}return _0x5d8ac7[_0x76f447(0xc0)]&&_0x4aa154['push'](...validateCriteria(_0x5d8ac7[_0x76f447(0xc0)],_0x3f281a+'.milestone',_0x277094)),_0x4aa154[_0x76f447(0x106)](...validateStageStructure(_0x5d8ac7,_0x197389,_0x388f95,_0x277094)),_0x4aa154['push'](...validateFlowControl(_0x5d8ac7,_0x197389,_0x277094)),_0x4aa154;}export function validateJourneyDef(_0x4a52b7,_0x118064={}){const _0x23ec47=a108_0x279c,_0x44204b=[],_0x111e0a=[];(!_0x4a52b7['name']||_0x4a52b7[_0x23ec47(0xaf)][_0x23ec47(0xc6)]()==='')&&_0x44204b[_0x23ec47(0x106)]({'level':'error','path':_0x23ec47(0xaf),'code':_0x23ec47(0xea),'message':_0x23ec47(0xf4),'location':getLocationFromPath(_0x118064[_0x23ec47(0x104)],_0x118064[_0x23ec47(0xbf)],[_0x23ec47(0xaf)])});const _0x1aa56d=new Set();if(_0x4a52b7['segments'])for(const _0x1689ea of Object['keys'](_0x4a52b7['segments'])){_0x1aa56d[_0x23ec47(0xe2)](_0x1689ea);}const _0x3fa32f=new Set();if(_0x4a52b7[_0x23ec47(0xf3)])for(const _0x160387 of Object[_0x23ec47(0xf8)](_0x4a52b7[_0x23ec47(0xf3)])){_0x3fa32f['add'](_0x160387);}const _0x1347a9=new Set(),_0x17ad3c={..._0x118064,'embeddedSegments':_0x1aa56d,'referencedSegments':_0x1347a9,'activationKeys':_0x3fa32f['size']>0x0?_0x3fa32f:undefined};if(_0x4a52b7[_0x23ec47(0xcd)])for(const [_0x22fac4,_0x358c50]of Object['entries'](_0x4a52b7['segments'])){const _0x4a6365=validateEmbeddedSegment(_0x358c50,_0x23ec47(0xc1)+_0x22fac4,_0x17ad3c);for(const _0x44a82f of _0x4a6365){if(_0x44a82f[_0x23ec47(0x8e)]==='error')_0x44204b[_0x23ec47(0x106)](_0x44a82f);else _0x111e0a[_0x23ec47(0x106)](_0x44a82f);}}const _0x4b4d3d=getJourneyStages(_0x4a52b7);_0x4b4d3d[_0x23ec47(0x115)]===0x0&&_0x44204b[_0x23ec47(0x106)]({'level':_0x23ec47(0xe9),'path':_0x23ec47(0xd5),'code':'MISSING_STAGES','message':_0x23ec47(0x116),'location':getLocationFromPath(_0x118064[_0x23ec47(0x104)],_0x118064[_0x23ec47(0xbf)],['stages'])});const _0x1089ef=new Set();for(const _0xc68dc5 of _0x4b4d3d){if(_0xc68dc5[_0x23ec47(0xcf)])for(const _0x3b65e8 of _0xc68dc5['steps']){_0x3b65e8['name']&&_0x1089ef[_0x23ec47(0xe2)](_0x3b65e8['name']);}}_0x17ad3c[_0x23ec47(0x112)]=_0x1089ef;if(_0x4b4d3d[_0x23ec47(0x115)]>0x0){const _0x1c2dcb=validateJourneyStructure(_0x4a52b7,_0x4b4d3d,_0x17ad3c);for(const _0x57962d of _0x1c2dcb){if(_0x57962d[_0x23ec47(0x8e)]==='error')_0x44204b[_0x23ec47(0x106)](_0x57962d);else _0x111e0a[_0x23ec47(0x106)](_0x57962d);}}for(let _0x621991=0x0;_0x621991<_0x4b4d3d['length'];_0x621991++){const _0x5f4dd6=validateStage(_0x4b4d3d[_0x621991],_0x621991,_0x4b4d3d[_0x23ec47(0x115)],_0x17ad3c);for(const _0x389042 of _0x5f4dd6){if(_0x389042['level']===_0x23ec47(0xe9))_0x44204b['push'](_0x389042);else _0x111e0a[_0x23ec47(0x106)](_0x389042);}}if(_0x4a52b7[_0x23ec47(0x99)]){const _0x10ca6f=validateCriteria(_0x4a52b7['goal'],_0x23ec47(0x99),_0x17ad3c);for(const _0x3f27eb of _0x10ca6f){if(_0x3f27eb[_0x23ec47(0x8e)]==='error')_0x44204b[_0x23ec47(0x106)](_0x3f27eb);else _0x111e0a['push'](_0x3f27eb);}}for(const _0x52d482 of _0x1aa56d){!_0x1347a9[_0x23ec47(0x114)](_0x52d482)&&!_0x52d482[_0x23ec47(0xab)](_0x23ec47(0xb8))&&_0x111e0a[_0x23ec47(0x106)]({'level':_0x23ec47(0xa2),'path':'segments.'+_0x52d482,'code':_0x23ec47(0x10b),'message':_0x23ec47(0x92)+_0x52d482+_0x23ec47(0xc3),'location':getLocationFromPath(_0x118064[_0x23ec47(0x104)],_0x118064[_0x23ec47(0xbf)],['segments',_0x52d482])});}return{'valid':_0x44204b[_0x23ec47(0x115)]===0x0,'errors':_0x44204b,'warnings':_0x111e0a};}function a108_0x1ce2(){const _0x90942c=['MISSING_ENTRY_CRITERIA','MISSING_ACTIVATION_DEFINITION','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','.next','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','type','merge','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','excluded_','step\x20\x27','5814297EvyaGe','INSUFFICIENT_STEPS','\x27\x20(from:\x20','activationKeys','MISSING_MILESTONE','source','milestone','segments.','END_STEP_HAS_NEXT_OR_WITH','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','MISSING_END_STEP','stage','trim','stages[','\x20stages\x20but\x20maximum\x20is\x20',').\x20Use\x20a\x20merge\x20step.','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','.with.activation','percentage','segments','ab_test','steps','\x27\x20with\x20no\x20action\x20in\x20between','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.with.target','568KFxWFC','flatMap','stages','get','.with.condition.timeout','\x27\x20of\x20\x27','.segment','MISSING_CONDITIONS','.with.condition.next','.steps[','set','target','variants','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','7944300ssWxeI','add','rule','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','timeout','INVALID_JUMP_TARGET','reduce','entry_criteria','error','MISSING_NAME','\x20steps\x20(may\x20be\x20too\x20simple)','CONVERGENCE_WITHOUT_MERGE','.steps','referencedSegments','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','Stage\x20\x27','ref:','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','activations','Journey\x20name\x20is\x20required','next','embeddedSegments','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','keys','125951pYYOjd','with','end','.entry_criteria','some','exit_criteria','.with.condition.timeout.next','827790KEqpIv','End\x20step\x20\x27','Step\x20references\x20non-existent\x20step\x20\x27','TOO_MANY_STAGES','document','segment','push','.rule','activation','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','Journey\x20has\x20','UNUSED_EMBEDDED_SEGMENT','timeout\x20of\x20\x27','MISSING_ACTIVATION_REF','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','MISSING_GOAL','5gBFeRH','stepNames','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','has','length','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','branches','712811NEDYPG','journeys','\x27\x20has\x20no\x20end\x20step','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','Jump\x20step\x20requires\x20a\x20target','.with.variants','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','Criteria\x20references\x20undefined\x20segment\x20\x27','condition','48620680peCmKN','MISSING_EXIT_CRITERIA','wait','1410856cLQNBq','excluded','level','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','MISSING_SEGMENT_REFERENCE','Merge\x20step\x20\x27','Embedded\x20segment\x20\x27','A/B\x20test\x20variant\x20\x27','.with.variants[','BRANCH_DIRECTLY_TO_MERGE','INVALID_NEXT_REFERENCE','.with.condition','.with','goal','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','.with.branches[','decision_point','description','.exit_criteria','\x27\x20has\x20no\x20exit_criteria\x20defined','versions','3MyPuKf','warning','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','Duplicate\x20step\x20name\x20\x27','abs','Journey\x20must\x20have\x20a\x20goal\x20defined','.milestone','jump','\x27\x20has\x20only\x20','SINGLE_INPUT_MERGE','startsWith','journey','MISSING_WAIT_PARAMS','variant\x20\x27','name'];a108_0x1ce2=function(){return _0x90942c;};return a108_0x1ce2();}
1
+ function a108_0x173b(_0x442821,_0x43a3ac){_0x442821=_0x442821-0x113;const _0x5dec81=a108_0x5dec();let _0x173bb4=_0x5dec81[_0x442821];return _0x173bb4;}(function(_0x56f40f,_0x17ba5e){const _0x39d6e5=a108_0x173b,_0xc4debc=_0x56f40f();while(!![]){try{const _0x3b5332=parseInt(_0x39d6e5(0x172))/0x1*(parseInt(_0x39d6e5(0x12f))/0x2)+parseInt(_0x39d6e5(0x134))/0x3*(parseInt(_0x39d6e5(0x18e))/0x4)+-parseInt(_0x39d6e5(0x136))/0x5+-parseInt(_0x39d6e5(0x171))/0x6*(-parseInt(_0x39d6e5(0x174))/0x7)+-parseInt(_0x39d6e5(0x19e))/0x8*(parseInt(_0x39d6e5(0x178))/0x9)+-parseInt(_0x39d6e5(0x159))/0xa+parseInt(_0x39d6e5(0x16d))/0xb;if(_0x3b5332===_0x17ba5e)break;else _0xc4debc['push'](_0xc4debc['shift']());}catch(_0x4cd4a6){_0xc4debc['push'](_0xc4debc['shift']());}}}(a108_0x5dec,0x5d0f9));import{getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x353ba9,_0x1b695e,_0x45a33d,_0x22daaa,_0x1dfc3c,_0x141d59){const _0x385704=a108_0x173b;return{'level':_0x353ba9,'path':_0x1b695e,'code':_0x45a33d,'message':_0x22daaa,'location':getLocationFromPath(_0x1dfc3c[_0x385704(0x120)],_0x1dfc3c[_0x385704(0x170)],pathToArray(_0x141d59??_0x1b695e))};}function validateJourneyStructure(_0x27dd29,_0x1d4f6c,_0x146a01){const _0x52984b=a108_0x173b,_0x31b432=[];return _0x1d4f6c[_0x52984b(0x160)]>MAX_STAGES&&_0x31b432[_0x52984b(0x186)](createIssue(_0x52984b(0x175),_0x52984b(0x126),'TOO_MANY_STAGES',_0x52984b(0x139)+_0x1d4f6c['length']+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x146a01)),!_0x27dd29[_0x52984b(0x132)]&&_0x31b432[_0x52984b(0x186)](createIssue('error',_0x52984b(0x132),_0x52984b(0x141),'Journey\x20must\x20have\x20a\x20goal\x20defined',_0x146a01)),_0x31b432;}function validateStageStructure(_0x1aafc3,_0x2f636e,_0x43a443,_0x3e78db){const _0x3700e2=a108_0x173b,_0x89b33e=[],_0x451c87=_0x3700e2(0x198)+_0x2f636e+']';_0x2f636e===0x0&&!_0x1aafc3[_0x3700e2(0x199)]&&_0x89b33e[_0x3700e2(0x186)](createIssue('error',_0x451c87+_0x3700e2(0x16f),_0x3700e2(0x151),_0x3700e2(0x124)+_0x1aafc3['name']+_0x3700e2(0x17a),_0x3e78db,_0x451c87));const _0x52ce73=_0x2f636e===_0x43a443-0x1;!_0x52ce73&&!_0x1aafc3[_0x3700e2(0x1a1)]&&_0x89b33e[_0x3700e2(0x186)](createIssue(_0x3700e2(0x175),_0x451c87+_0x3700e2(0x13e),_0x3700e2(0x17f),_0x3700e2(0x124)+_0x1aafc3[_0x3700e2(0x130)]+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0x3e78db,_0x451c87));(!_0x1aafc3['exit_criteria']||_0x1aafc3['exit_criteria'][_0x3700e2(0x160)]===0x0)&&_0x89b33e[_0x3700e2(0x186)](createIssue(_0x3700e2(0x1a4),_0x451c87+_0x3700e2(0x173),_0x3700e2(0x155),'Stage\x20\x27'+_0x1aafc3[_0x3700e2(0x130)]+_0x3700e2(0x164),_0x3e78db,_0x451c87));const _0x107791=_0x1aafc3[_0x3700e2(0x176)]?.[_0x3700e2(0x160)]??0x0;if(_0x107791<=0x1)_0x89b33e[_0x3700e2(0x186)](createIssue(_0x3700e2(0x175),_0x451c87+_0x3700e2(0x129),_0x3700e2(0x14c),_0x3700e2(0x124)+_0x1aafc3[_0x3700e2(0x130)]+'\x27\x20has\x20'+_0x107791+_0x3700e2(0x1a0),_0x3e78db,_0x451c87+_0x3700e2(0x129)));else _0x107791<=0x3&&_0x89b33e[_0x3700e2(0x186)](createIssue('warning',_0x451c87+_0x3700e2(0x129),'FEW_STEPS','Stage\x20\x27'+_0x1aafc3[_0x3700e2(0x130)]+_0x3700e2(0x128)+_0x107791+_0x3700e2(0x12c),_0x3e78db,_0x451c87+'.steps'));return _0x89b33e;}function validateStep(_0x522b28,_0xb9255b,_0x206390,_0x44d59a){const _0x20a4a0=a108_0x173b,_0x148b3b=[];if(_0x522b28['type']===_0x20a4a0(0x113))return _0x522b28[_0x20a4a0(0x162)]&&_0x148b3b[_0x20a4a0(0x186)](createIssue('error',_0xb9255b+_0x20a4a0(0x137),_0x20a4a0(0x11b),_0x20a4a0(0x167)+_0x522b28[_0x20a4a0(0x130)]+_0x20a4a0(0x18b),_0x206390)),_0x20a4a0(0x152)in _0x522b28&&_0x522b28[_0x20a4a0(0x152)]!==undefined&&_0x148b3b['push'](createIssue('error',_0xb9255b+_0x20a4a0(0x15a),_0x20a4a0(0x11b),'End\x20step\x20\x27'+_0x522b28[_0x20a4a0(0x130)]+_0x20a4a0(0x197),_0x206390)),_0x148b3b;_0x522b28[_0x20a4a0(0x162)]&&(_0x206390['stepNames']&&!_0x206390[_0x20a4a0(0x183)][_0x20a4a0(0x16c)](_0x522b28['next'])&&_0x148b3b[_0x20a4a0(0x186)](createIssue(_0x20a4a0(0x175),_0xb9255b+'.next',_0x20a4a0(0x13a),_0x20a4a0(0x18a)+_0x522b28[_0x20a4a0(0x162)]+'\x27',_0x206390)));switch(_0x522b28[_0x20a4a0(0x16b)]){case'wait':_0x148b3b['push'](...validateWaitStep(_0x522b28,_0xb9255b,_0x206390,_0x44d59a));break;case _0x20a4a0(0x142):_0x148b3b['push'](...validateActivationStep(_0x522b28,_0xb9255b,_0x206390));break;case _0x20a4a0(0x13c):_0x148b3b[_0x20a4a0(0x186)](...validateDecisionPointStep(_0x522b28,_0xb9255b,_0x206390,_0x44d59a));break;case _0x20a4a0(0x147):_0x148b3b[_0x20a4a0(0x186)](...validateAbTestStep(_0x522b28,_0xb9255b,_0x206390,_0x44d59a));break;case'jump':_0x148b3b['push'](...validateJumpStep(_0x522b28,_0xb9255b,_0x206390));break;}return _0x148b3b;}function validateWaitStep(_0x277717,_0xa12684,_0x58562c,_0x539d2b){const _0x3e591b=a108_0x173b,_0x497c5a=[];if(!_0x277717[_0x3e591b(0x152)])return _0x497c5a[_0x3e591b(0x186)](createIssue('error',_0xa12684+_0x3e591b(0x15a),'MISSING_WAIT_PARAMS',_0x3e591b(0x115),_0x58562c,_0xa12684)),_0x497c5a;if(_0x277717[_0x3e591b(0x152)][_0x3e591b(0x11d)]){const _0x539717=_0x277717[_0x3e591b(0x152)][_0x3e591b(0x11d)];if(_0x539717['segment']){_0x58562c['referencedSegments']?.['add'](_0x539717['segment']);!_0x539717[_0x3e591b(0x116)][_0x3e591b(0x187)]('ref:')&&(_0x58562c[_0x3e591b(0x153)]&&!_0x58562c[_0x3e591b(0x153)][_0x3e591b(0x16c)](_0x539717[_0x3e591b(0x116)])&&_0x497c5a['push'](createIssue(_0x3e591b(0x175),_0xa12684+'.with.condition.segment',_0x3e591b(0x185),_0x3e591b(0x15c)+_0x539717['segment']+_0x3e591b(0x168),_0x58562c)));_0x539717[_0x3e591b(0x162)]&&_0x58562c[_0x3e591b(0x183)]&&!_0x58562c[_0x3e591b(0x183)][_0x3e591b(0x16c)](_0x539717['next'])&&_0x497c5a['push'](createIssue('error',_0xa12684+_0x3e591b(0x140),_0x3e591b(0x13a),'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x539717['next']+'\x27',_0x58562c));_0x539717[_0x3e591b(0x138)]?.[_0x3e591b(0x162)]&&_0x58562c['stepNames']&&!_0x58562c[_0x3e591b(0x183)]['has'](_0x539717[_0x3e591b(0x138)][_0x3e591b(0x162)])&&_0x497c5a[_0x3e591b(0x186)](createIssue(_0x3e591b(0x175),_0xa12684+_0x3e591b(0x1a2),_0x3e591b(0x13a),_0x3e591b(0x156)+_0x539717[_0x3e591b(0x138)][_0x3e591b(0x162)]+'\x27',_0x58562c));const _0x4b367e=_0x539717[_0x3e591b(0x162)]||_0x277717[_0x3e591b(0x162)],_0x54f583=_0x539717[_0x3e591b(0x138)]?.[_0x3e591b(0x162)]||_0x277717[_0x3e591b(0x162)];if(_0x4b367e){const _0x19f7c1=_0x539d2b[_0x3e591b(0x1a5)](_0x4b367e);_0x19f7c1?.[_0x3e591b(0x16b)]===_0x3e591b(0x11a)&&_0x497c5a[_0x3e591b(0x186)](createIssue('error',_0xa12684+_0x3e591b(0x140),_0x3e591b(0x12a),_0x3e591b(0x196)+_0x4b367e+_0x3e591b(0x184),_0x58562c,_0xa12684+_0x3e591b(0x15b)));}if(_0x54f583){const _0x5ebe65=_0x539d2b[_0x3e591b(0x1a5)](_0x54f583);_0x5ebe65?.[_0x3e591b(0x16b)]==='merge'&&_0x497c5a['push'](createIssue(_0x3e591b(0x175),_0xa12684+_0x3e591b(0x1a2),_0x3e591b(0x12a),'Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x54f583+_0x3e591b(0x184),_0x58562c,_0xa12684+_0x3e591b(0x154)));}}}return _0x497c5a;}function validateActivationStep(_0x3273e6,_0x51f35e,_0x4a1ae4){const _0x4393b3=a108_0x173b,_0x47925d=[];if(!_0x3273e6[_0x4393b3(0x152)]?.[_0x4393b3(0x142)])return _0x47925d[_0x4393b3(0x186)](createIssue(_0x4393b3(0x175),_0x51f35e+_0x4393b3(0x122),_0x4393b3(0x11e),_0x4393b3(0x17c),_0x4a1ae4,_0x51f35e)),_0x47925d;const _0x3517e7=_0x3273e6['with'][_0x4393b3(0x142)];return _0x4a1ae4['activationKeys']&&!_0x3517e7[_0x4393b3(0x187)](_0x4393b3(0x127))&&(!_0x4a1ae4[_0x4393b3(0x118)][_0x4393b3(0x16c)](_0x3517e7)&&_0x47925d[_0x4393b3(0x186)](createIssue(_0x4393b3(0x175),_0x51f35e+_0x4393b3(0x122),_0x4393b3(0x18d),'Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x3517e7+'\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',_0x4a1ae4))),_0x47925d;}function validateDecisionPointStep(_0x4f0cec,_0x5e03bd,_0x4664dc,_0x274119){const _0x367fd0=a108_0x173b,_0x15ea62=[];if(!_0x4f0cec['with']?.[_0x367fd0(0x165)]||_0x4f0cec[_0x367fd0(0x152)][_0x367fd0(0x165)][_0x367fd0(0x160)]===0x0)return _0x15ea62[_0x367fd0(0x186)](createIssue(_0x367fd0(0x175),_0x5e03bd+_0x367fd0(0x149),_0x367fd0(0x146),_0x367fd0(0x119),_0x4664dc,_0x5e03bd)),_0x15ea62;for(let _0x420a60=0x0;_0x420a60<_0x4f0cec[_0x367fd0(0x152)]['branches'][_0x367fd0(0x160)];_0x420a60++){const _0x1d78a6=_0x4f0cec[_0x367fd0(0x152)][_0x367fd0(0x165)][_0x420a60],_0x239324=_0x5e03bd+_0x367fd0(0x123)+_0x420a60+']';_0x1d78a6[_0x367fd0(0x116)]&&!_0x1d78a6[_0x367fd0(0x179)]&&(_0x4664dc[_0x367fd0(0x17d)]?.[_0x367fd0(0x19d)](_0x1d78a6[_0x367fd0(0x116)]),!_0x1d78a6['segment'][_0x367fd0(0x187)](_0x367fd0(0x127))&&(_0x4664dc[_0x367fd0(0x153)]&&!_0x4664dc[_0x367fd0(0x153)][_0x367fd0(0x16c)](_0x1d78a6[_0x367fd0(0x116)])&&_0x15ea62[_0x367fd0(0x186)](createIssue(_0x367fd0(0x175),_0x239324+'.segment','MISSING_SEGMENT_REFERENCE',_0x367fd0(0x182)+_0x1d78a6[_0x367fd0(0x116)]+'\x27',_0x4664dc))));_0x1d78a6[_0x367fd0(0x162)]&&_0x4664dc[_0x367fd0(0x183)]&&!_0x4664dc[_0x367fd0(0x183)]['has'](_0x1d78a6[_0x367fd0(0x162)])&&_0x15ea62[_0x367fd0(0x186)](createIssue(_0x367fd0(0x175),_0x239324+_0x367fd0(0x137),_0x367fd0(0x13a),'Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x1d78a6['next']+'\x27',_0x4664dc));if(_0x1d78a6['next']){const _0x154722=_0x274119[_0x367fd0(0x1a5)](_0x1d78a6[_0x367fd0(0x162)]);_0x154722?.['type']===_0x367fd0(0x11a)&&_0x15ea62['push'](createIssue('error',_0x239324+_0x367fd0(0x137),'BRANCH_DIRECTLY_TO_MERGE',_0x367fd0(0x12e)+_0x1d78a6[_0x367fd0(0x130)]+_0x367fd0(0x11f)+_0x1d78a6[_0x367fd0(0x162)]+_0x367fd0(0x144),_0x4664dc));}}return _0x15ea62;}function validateAbTestStep(_0x5729c4,_0x5b319,_0x46cc9b,_0x18e5e7){const _0xdf5a00=a108_0x173b,_0x1eb967=[];if(!_0x5729c4[_0xdf5a00(0x152)]?.[_0xdf5a00(0x16a)]||_0x5729c4['with']['variants'][_0xdf5a00(0x160)]===0x0)return _0x1eb967['push'](createIssue(_0xdf5a00(0x175),_0x5b319+_0xdf5a00(0x193),_0xdf5a00(0x146),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x46cc9b,_0x5b319)),_0x1eb967;const _0x4a9d96=_0x5729c4[_0xdf5a00(0x152)][_0xdf5a00(0x16a)][_0xdf5a00(0x14e)]((_0xf133ef,_0x659abf)=>_0xf133ef+(_0x659abf['percentage']||0x0),0x0);Math['abs'](_0x4a9d96-0x64)>0.01&&_0x1eb967[_0xdf5a00(0x186)](createIssue(_0xdf5a00(0x175),_0x5b319+'.with.variants','INVALID_AB_TEST_PERCENTAGES',_0xdf5a00(0x18c)+_0x4a9d96+'%)',_0x46cc9b));for(let _0x3f5ccf=0x0;_0x3f5ccf<_0x5729c4['with']['variants'][_0xdf5a00(0x160)];_0x3f5ccf++){const _0x4cb49f=_0x5729c4[_0xdf5a00(0x152)][_0xdf5a00(0x16a)][_0x3f5ccf],_0x386080=_0x5b319+_0xdf5a00(0x177)+_0x3f5ccf+']';_0x4cb49f[_0xdf5a00(0x162)]&&_0x46cc9b['stepNames']&&!_0x46cc9b['stepNames']['has'](_0x4cb49f['next'])&&_0x1eb967[_0xdf5a00(0x186)](createIssue('error',_0x386080+_0xdf5a00(0x137),_0xdf5a00(0x13a),_0xdf5a00(0x188)+_0x4cb49f[_0xdf5a00(0x162)]+'\x27',_0x46cc9b));if(_0x4cb49f[_0xdf5a00(0x162)]){const _0x25eb3c=_0x18e5e7[_0xdf5a00(0x1a5)](_0x4cb49f[_0xdf5a00(0x162)]);_0x25eb3c?.[_0xdf5a00(0x16b)]==='merge'&&_0x1eb967['push'](createIssue(_0xdf5a00(0x175),_0x386080+_0xdf5a00(0x137),'BRANCH_DIRECTLY_TO_MERGE','A/B\x20test\x20variant\x20\x27'+_0x4cb49f['name']+_0xdf5a00(0x11f)+_0x4cb49f['next']+'\x27\x20with\x20no\x20action\x20in\x20between',_0x46cc9b));}}return _0x1eb967;}function validateJumpStep(_0x24f37e,_0xf020d7,_0x390f0b){const _0x3614a2=a108_0x173b,_0x42487e=[];if(!_0x24f37e[_0x3614a2(0x152)]?.[_0x3614a2(0x161)])return _0x42487e[_0x3614a2(0x186)](createIssue(_0x3614a2(0x175),_0xf020d7+_0x3614a2(0x181),_0x3614a2(0x12b),_0x3614a2(0x125),_0x390f0b,_0xf020d7)),_0x42487e;return(!_0x24f37e[_0x3614a2(0x152)]['target']['journey']||!_0x24f37e[_0x3614a2(0x152)]['target']['stage'])&&_0x42487e[_0x3614a2(0x186)](createIssue(_0x3614a2(0x175),_0xf020d7+_0x3614a2(0x181),_0x3614a2(0x12b),'Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',_0x390f0b)),_0x42487e;}function buildConvergenceMap(_0x2ce953){const _0x55872c=a108_0x173b,_0x1850ad=new Map();function _0x11d24f(_0x21d93d,_0x284c16){const _0x13b29a=a108_0x173b,_0x170c32=_0x1850ad[_0x13b29a(0x1a5)](_0x21d93d)||[];_0x170c32[_0x13b29a(0x186)](_0x284c16),_0x1850ad[_0x13b29a(0x12d)](_0x21d93d,_0x170c32);}for(const _0xfa62df of _0x2ce953){_0xfa62df[_0x55872c(0x162)]&&_0x11d24f(_0xfa62df['next'],{'stepName':_0xfa62df['name'],'description':_0x55872c(0x143)+_0xfa62df[_0x55872c(0x130)]+'\x27'});if(_0xfa62df[_0x55872c(0x16b)]==='decision_point'&&_0xfa62df[_0x55872c(0x152)]?.['branches'])for(const _0xc478c2 of _0xfa62df[_0x55872c(0x152)]['branches']){_0xc478c2['next']&&_0x11d24f(_0xc478c2[_0x55872c(0x162)],{'stepName':_0xfa62df['name'],'description':'branch\x20\x27'+_0xc478c2['name']+_0x55872c(0x14b)+_0xfa62df[_0x55872c(0x130)]+'\x27'});}if(_0xfa62df['type']===_0x55872c(0x147)&&_0xfa62df[_0x55872c(0x152)]?.[_0x55872c(0x16a)])for(const _0x2f1930 of _0xfa62df[_0x55872c(0x152)][_0x55872c(0x16a)]){_0x2f1930[_0x55872c(0x162)]&&_0x11d24f(_0x2f1930[_0x55872c(0x162)],{'stepName':_0xfa62df[_0x55872c(0x130)],'description':_0x55872c(0x195)+_0x2f1930[_0x55872c(0x130)]+_0x55872c(0x14b)+_0xfa62df['name']+'\x27'});}_0xfa62df[_0x55872c(0x16b)]===_0x55872c(0x13b)&&_0xfa62df[_0x55872c(0x152)]?.[_0x55872c(0x11d)]&&(_0xfa62df[_0x55872c(0x152)]['condition'][_0x55872c(0x162)]&&_0x11d24f(_0xfa62df[_0x55872c(0x152)][_0x55872c(0x11d)][_0x55872c(0x162)],{'stepName':_0xfa62df[_0x55872c(0x130)],'description':_0x55872c(0x189)+_0xfa62df[_0x55872c(0x130)]+'\x27'}),_0xfa62df['with']['condition'][_0x55872c(0x138)]?.[_0x55872c(0x162)]&&_0x11d24f(_0xfa62df[_0x55872c(0x152)]['condition'][_0x55872c(0x138)][_0x55872c(0x162)],{'stepName':_0xfa62df[_0x55872c(0x130)],'description':_0x55872c(0x13f)+_0xfa62df['name']+'\x27'}));}return _0x1850ad;}function validateFlowControl(_0x4b223b,_0x72a787,_0x34b854){const _0x353f65=a108_0x173b,_0x5c136e=[],_0x87f09a='stages['+_0x72a787+']',_0x519f89=_0x4b223b[_0x353f65(0x176)]||[];if(_0x519f89[_0x353f65(0x160)]===0x0)return _0x5c136e;const _0x25c010=new Map();for(const _0x1c2707 of _0x519f89){_0x1c2707[_0x353f65(0x130)]&&_0x25c010[_0x353f65(0x12d)](_0x1c2707[_0x353f65(0x130)],_0x1c2707);}const _0xf86ac5=buildConvergenceMap(_0x519f89),_0x1e007e=_0x519f89[_0x353f65(0x15f)](_0x513c04=>_0x513c04['type']===_0x353f65(0x113));!_0x1e007e&&_0x5c136e[_0x353f65(0x186)](createIssue(_0x353f65(0x175),_0x87f09a+_0x353f65(0x129),'MISSING_END_STEP',_0x353f65(0x124)+_0x4b223b[_0x353f65(0x130)]+_0x353f65(0x145),_0x34b854));for(const [_0x3b09c2,_0x2097b2]of _0xf86ac5){const _0x5c667c=_0x25c010['get'](_0x3b09c2);if(!_0x5c667c)continue;if(_0x2097b2[_0x353f65(0x160)]>0x1&&_0x5c667c[_0x353f65(0x16b)]!==_0x353f65(0x11a)){const _0x369e54=_0x2097b2[_0x353f65(0x166)](_0x53d9b6=>_0x53d9b6[_0x353f65(0x1a6)])['join'](',\x20');_0x5c136e['push'](createIssue('error',_0x87f09a+_0x353f65(0x129),_0x353f65(0x192),_0x353f65(0x150)+_0x3b09c2+_0x353f65(0x19c)+_0x369e54+').\x20Use\x20a\x20merge\x20step.',_0x34b854));}_0x2097b2[_0x353f65(0x160)]===0x1&&_0x5c667c[_0x353f65(0x16b)]===_0x353f65(0x11a)&&_0x5c136e[_0x353f65(0x186)](createIssue(_0x353f65(0x1a4),_0x87f09a+_0x353f65(0x129),_0x353f65(0x19b),_0x353f65(0x169)+_0x3b09c2+_0x353f65(0x117)+_0x2097b2[0x0][_0x353f65(0x1a6)]+_0x353f65(0x16e),_0x34b854));}for(const _0x2f207b of _0x519f89){if(_0x2f207b[_0x353f65(0x16b)]==='merge'&&_0x2f207b['next']){const _0x2f7b87=_0x25c010['get'](_0x2f207b[_0x353f65(0x162)]);_0x2f7b87?.[_0x353f65(0x16b)]==='merge'&&_0x5c136e[_0x353f65(0x186)](createIssue('error',_0x87f09a+_0x353f65(0x129),'MERGE_TO_MERGE_CHAIN','Merge\x20step\x20\x27'+_0x2f207b[_0x353f65(0x130)]+_0x353f65(0x148)+_0x2f207b[_0x353f65(0x162)]+_0x353f65(0x135),_0x34b854));}}return _0x5c136e;}function validateCriteria(_0x4233d2,_0x114880,_0x5e3c6f){const _0x4ba91d=a108_0x173b,_0x29269b=[];return _0x4233d2[_0x4ba91d(0x116)]&&(_0x5e3c6f[_0x4ba91d(0x17d)]?.[_0x4ba91d(0x19d)](_0x4233d2[_0x4ba91d(0x116)]),!_0x4233d2[_0x4ba91d(0x116)]['startsWith'](_0x4ba91d(0x127))&&(_0x5e3c6f[_0x4ba91d(0x153)]&&!_0x5e3c6f[_0x4ba91d(0x153)][_0x4ba91d(0x16c)](_0x4233d2['segment'])&&_0x29269b[_0x4ba91d(0x186)](createIssue('error',_0x114880+_0x4ba91d(0x14a),_0x4ba91d(0x185),'Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x4233d2['segment']+'\x27',_0x5e3c6f)))),_0x29269b;}function validateEmbeddedSegment(_0x55ef74,_0x4506d1,_0x45cb94){const _0x19e4c9=a108_0x173b,_0x29506f=[];return _0x55ef74[_0x19e4c9(0x190)]&&_0x29506f[_0x19e4c9(0x186)](...validateRuleDef(_0x55ef74[_0x19e4c9(0x190)],_0x4506d1+'.rule',_0x45cb94)),_0x29506f;}function getJourneyStages(_0x3bdc08){const _0x1fcd80=a108_0x173b;if(_0x3bdc08['stages']&&_0x3bdc08[_0x1fcd80(0x126)]['length']>0x0)return _0x3bdc08[_0x1fcd80(0x126)];if(_0x3bdc08['journeys']&&_0x3bdc08[_0x1fcd80(0x17e)][_0x1fcd80(0x160)]>0x0)return _0x3bdc08[_0x1fcd80(0x17e)][_0x1fcd80(0x194)](_0x45ebd4=>_0x45ebd4[_0x1fcd80(0x126)]||[]);if(_0x3bdc08[_0x1fcd80(0x158)]&&_0x3bdc08[_0x1fcd80(0x158)]['length']>0x0)return _0x3bdc08[_0x1fcd80(0x158)][_0x1fcd80(0x194)](_0x149c61=>_0x149c61[_0x1fcd80(0x126)]||[]);return[];}function validateStage(_0x47817b,_0x566391,_0x378918,_0x4a0bb3){const _0x1df2ae=a108_0x173b,_0x491506=[],_0xc74a9d=_0x1df2ae(0x198)+_0x566391+']',_0x4f001e=new Map(),_0x8f8ed1=new Map();if(_0x47817b['steps']){for(let _0x2a548c=0x0;_0x2a548c<_0x47817b[_0x1df2ae(0x176)][_0x1df2ae(0x160)];_0x2a548c++){const _0x16a002=_0x47817b['steps'][_0x2a548c];_0x16a002['name']&&_0x4f001e[_0x1df2ae(0x12d)](_0x16a002[_0x1df2ae(0x130)],_0x16a002);}for(let _0xd07ac0=0x0;_0xd07ac0<_0x47817b[_0x1df2ae(0x176)][_0x1df2ae(0x160)];_0xd07ac0++){const _0x304fbf=_0x47817b[_0x1df2ae(0x176)][_0xd07ac0],_0xc3b8b1=_0xc74a9d+_0x1df2ae(0x191)+_0xd07ac0+']';if(_0x304fbf[_0x1df2ae(0x130)]){if(_0x8f8ed1[_0x1df2ae(0x16c)](_0x304fbf['name'])){const _0xebf751=_0x8f8ed1['get'](_0x304fbf[_0x1df2ae(0x130)]);_0x491506[_0x1df2ae(0x186)](createIssue(_0x1df2ae(0x175),_0xc3b8b1+_0x1df2ae(0x15e),_0x1df2ae(0x133),_0x1df2ae(0x1a3)+_0x304fbf[_0x1df2ae(0x130)]+'\x27\x20(first\x20defined\x20at\x20steps['+_0xebf751+'])',_0x4a0bb3));}else _0x8f8ed1[_0x1df2ae(0x12d)](_0x304fbf[_0x1df2ae(0x130)],_0xd07ac0);}_0x491506['push'](...validateStep(_0x304fbf,_0xc3b8b1,_0x4a0bb3,_0x4f001e));}}_0x47817b[_0x1df2ae(0x199)]&&_0x491506[_0x1df2ae(0x186)](...validateCriteria(_0x47817b[_0x1df2ae(0x199)],_0xc74a9d+_0x1df2ae(0x16f),_0x4a0bb3));if(_0x47817b['exit_criteria'])for(let _0x1a87ca=0x0;_0x1a87ca<_0x47817b[_0x1df2ae(0x18f)]['length'];_0x1a87ca++){_0x491506[_0x1df2ae(0x186)](...validateCriteria(_0x47817b[_0x1df2ae(0x18f)][_0x1a87ca],_0xc74a9d+_0x1df2ae(0x13d)+_0x1a87ca+']',_0x4a0bb3));}return _0x47817b[_0x1df2ae(0x1a1)]&&_0x491506['push'](...validateCriteria(_0x47817b[_0x1df2ae(0x1a1)],_0xc74a9d+'.milestone',_0x4a0bb3)),_0x491506[_0x1df2ae(0x186)](...validateStageStructure(_0x47817b,_0x566391,_0x378918,_0x4a0bb3)),_0x491506[_0x1df2ae(0x186)](...validateFlowControl(_0x47817b,_0x566391,_0x4a0bb3)),_0x491506;}export function validateJourneyDef(_0x6349cf,_0x5bb3ea={}){const _0x5e7c4d=a108_0x173b,_0x44bf6e=[],_0x4af61e=[];(!_0x6349cf['name']||_0x6349cf['name'][_0x5e7c4d(0x14f)]()==='')&&_0x44bf6e[_0x5e7c4d(0x186)]({'level':'error','path':'name','code':_0x5e7c4d(0x15d),'message':_0x5e7c4d(0x19f),'location':getLocationFromPath(_0x5bb3ea[_0x5e7c4d(0x120)],_0x5bb3ea['source'],[_0x5e7c4d(0x130)])});const _0x13a580=new Set();if(_0x6349cf[_0x5e7c4d(0x17b)])for(const _0x328b9c of Object[_0x5e7c4d(0x163)](_0x6349cf[_0x5e7c4d(0x17b)])){_0x13a580[_0x5e7c4d(0x19d)](_0x328b9c);}const _0xe24308=new Set();if(_0x6349cf[_0x5e7c4d(0x180)])for(const _0x489c9c of Object[_0x5e7c4d(0x163)](_0x6349cf[_0x5e7c4d(0x180)])){_0xe24308[_0x5e7c4d(0x19d)](_0x489c9c);}const _0x3bbbc3=new Set(),_0x111d38={..._0x5bb3ea,'embeddedSegments':_0x13a580,'referencedSegments':_0x3bbbc3,'activationKeys':_0xe24308[_0x5e7c4d(0x121)]>0x0?_0xe24308:undefined};if(_0x6349cf['segments'])for(const [_0x23ad87,_0x3c6091]of Object[_0x5e7c4d(0x131)](_0x6349cf['segments'])){const _0x52e502=validateEmbeddedSegment(_0x3c6091,_0x5e7c4d(0x19a)+_0x23ad87,_0x111d38);for(const _0x5c89fd of _0x52e502){if(_0x5c89fd[_0x5e7c4d(0x157)]==='error')_0x44bf6e[_0x5e7c4d(0x186)](_0x5c89fd);else _0x4af61e[_0x5e7c4d(0x186)](_0x5c89fd);}}const _0x4d03d3=getJourneyStages(_0x6349cf);_0x4d03d3[_0x5e7c4d(0x160)]===0x0&&_0x44bf6e[_0x5e7c4d(0x186)]({'level':_0x5e7c4d(0x175),'path':'stages','code':_0x5e7c4d(0x11c),'message':_0x5e7c4d(0x114),'location':getLocationFromPath(_0x5bb3ea[_0x5e7c4d(0x120)],_0x5bb3ea[_0x5e7c4d(0x170)],['stages'])});const _0x31ff9c=new Set();for(const _0x1c6156 of _0x4d03d3){if(_0x1c6156[_0x5e7c4d(0x176)])for(const _0x2cd4d3 of _0x1c6156[_0x5e7c4d(0x176)]){_0x2cd4d3[_0x5e7c4d(0x130)]&&_0x31ff9c[_0x5e7c4d(0x19d)](_0x2cd4d3[_0x5e7c4d(0x130)]);}}_0x111d38[_0x5e7c4d(0x183)]=_0x31ff9c;if(_0x4d03d3[_0x5e7c4d(0x160)]>0x0){const _0x58b24e=validateJourneyStructure(_0x6349cf,_0x4d03d3,_0x111d38);for(const _0x3ed816 of _0x58b24e){if(_0x3ed816[_0x5e7c4d(0x157)]===_0x5e7c4d(0x175))_0x44bf6e[_0x5e7c4d(0x186)](_0x3ed816);else _0x4af61e[_0x5e7c4d(0x186)](_0x3ed816);}}for(let _0x19f272=0x0;_0x19f272<_0x4d03d3[_0x5e7c4d(0x160)];_0x19f272++){const _0x54e371=validateStage(_0x4d03d3[_0x19f272],_0x19f272,_0x4d03d3[_0x5e7c4d(0x160)],_0x111d38);for(const _0x34eaa6 of _0x54e371){if(_0x34eaa6[_0x5e7c4d(0x157)]==='error')_0x44bf6e[_0x5e7c4d(0x186)](_0x34eaa6);else _0x4af61e['push'](_0x34eaa6);}}if(_0x6349cf[_0x5e7c4d(0x132)]){const _0x3aec23=validateCriteria(_0x6349cf[_0x5e7c4d(0x132)],'goal',_0x111d38);for(const _0x23c692 of _0x3aec23){if(_0x23c692[_0x5e7c4d(0x157)]===_0x5e7c4d(0x175))_0x44bf6e[_0x5e7c4d(0x186)](_0x23c692);else _0x4af61e['push'](_0x23c692);}}for(const _0x2c2321 of _0x13a580){!_0x3bbbc3[_0x5e7c4d(0x16c)](_0x2c2321)&&!_0x2c2321['startsWith']('excluded_')&&_0x4af61e[_0x5e7c4d(0x186)]({'level':_0x5e7c4d(0x1a4),'path':_0x5e7c4d(0x19a)+_0x2c2321,'code':_0x5e7c4d(0x14d),'message':'Embedded\x20segment\x20\x27'+_0x2c2321+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x5bb3ea[_0x5e7c4d(0x120)],_0x5bb3ea['source'],['segments',_0x2c2321])});}return{'valid':_0x44bf6e[_0x5e7c4d(0x160)]===0x0,'errors':_0x44bf6e,'warnings':_0x4af61e};}function a108_0x5dec(){const _0x184def=['warning','get','description','end','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','segment','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','activationKeys','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','merge','END_STEP_HAS_NEXT_OR_WITH','MISSING_STAGES','condition','MISSING_ACTIVATION_REF','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','document','size','.with.activation','.with.branches[','Stage\x20\x27','Jump\x20step\x20requires\x20a\x20target','stages','ref:','\x27\x20has\x20only\x20','.steps','BRANCH_DIRECTLY_TO_MERGE','INVALID_JUMP_TARGET','\x20steps\x20(may\x20be\x20too\x20simple)','set','Decision\x20branch\x20\x27','12BZGHyj','name','entries','goal','DUPLICATE_STEP_NAME','135798oCFpmo','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','2132865LavaVM','.next','timeout','Journey\x20has\x20','INVALID_NEXT_REFERENCE','wait','decision_point','.exit_criteria[','.milestone','timeout\x20of\x20\x27','.with.condition.next','MISSING_GOAL','activation','step\x20\x27','\x27\x20with\x20no\x20action\x20in\x20between','\x27\x20has\x20no\x20end\x20step','MISSING_CONDITIONS','ab_test','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','.with.branches','.segment','\x27\x20of\x20\x27','INSUFFICIENT_STEPS','UNUSED_EMBEDDED_SEGMENT','reduce','trim','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','MISSING_ENTRY_CRITERIA','with','embeddedSegments','.with.condition.timeout','MISSING_EXIT_CRITERIA','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','level','versions','7189610vYNGud','.with','.with.condition','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','MISSING_NAME','.name','some','length','target','next','keys','\x27\x20has\x20no\x20exit_criteria\x20defined','branches','map','End\x20step\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','Merge\x20step\x20\x27','variants','type','has','2773562JAqJaO',').\x20Merge\x20is\x20unnecessary.','.entry_criteria','source','12IIoefh','27481xUIJYw','.exit_criteria','1729049gQoHMZ','error','steps','.with.variants[','977283cVrSEw','excluded','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','segments','Activation\x20step\x20requires\x20an\x20activation\x20reference','referencedSegments','journeys','MISSING_MILESTONE','activations','.with.target','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','stepNames','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','MISSING_SEGMENT_REFERENCE','push','startsWith','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','condition\x20of\x20\x27','Step\x20references\x20non-existent\x20step\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','MISSING_ACTIVATION_DEFINITION','64ARumse','exit_criteria','rule','.steps[','CONVERGENCE_WITHOUT_MERGE','.with.variants','flatMap','variant\x20\x27','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','stages[','entry_criteria','segments.','SINGLE_INPUT_MERGE','\x27\x20(from:\x20','add','8ipwCpZ','Journey\x20name\x20is\x20required','\x20step(s)\x20but\x20needs\x20at\x20least\x202','milestone','.with.condition.timeout.next','Duplicate\x20step\x20name\x20\x27'];a108_0x5dec=function(){return _0x184def;};return a108_0x5dec();}
@@ -1 +1 @@
1
- const a109_0x104d50=a109_0x57df;(function(_0x19540c,_0x495cbe){const _0x1882be=a109_0x57df,_0x1d168a=_0x19540c();while(!![]){try{const _0x316f12=parseInt(_0x1882be(0x1d1))/0x1+parseInt(_0x1882be(0x1f7))/0x2*(-parseInt(_0x1882be(0x213))/0x3)+-parseInt(_0x1882be(0x282))/0x4*(-parseInt(_0x1882be(0x26e))/0x5)+parseInt(_0x1882be(0x1f1))/0x6+-parseInt(_0x1882be(0x20e))/0x7+-parseInt(_0x1882be(0x235))/0x8*(parseInt(_0x1882be(0x20d))/0x9)+parseInt(_0x1882be(0x1f3))/0xa*(-parseInt(_0x1882be(0x229))/0xb);if(_0x316f12===_0x495cbe)break;else _0x1d168a['push'](_0x1d168a['shift']());}catch(_0x275448){_0x1d168a['push'](_0x1d168a['shift']());}}}(a109_0x402f,0x288ab));import*as a109_0x2ecc46 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(_0xd8007c){const _0x2fce00=a109_0x57df,_0x3c217e=_0xd8007c[_0x2fce00(0x227)]();if(_0x3c217e===_0x2fce00(0x205)||_0x3c217e===_0x2fce00(0x28d))return _0x2fce00(0x28d);if(_0x3c217e==='weeks'||_0x3c217e===_0x2fce00(0x238))return _0x2fce00(0x238);return _0xd8007c;}export function journeyResponseToDefSync(_0x39c9f6){const _0x3a495e=a109_0x57df,_0x1a7620=_0x39c9f6[_0x3a495e(0x20c)],_0x11e5d6=_0x1a7620[_0x3a495e(0x218)]||_0x1a7620[_0x3a495e(0x26c)],_0xc079de={'stages':_0x1a7620[_0x3a495e(0x233)][_0x3a495e(0x211)](convertApiStageToYaml),'id':_0x39c9f6['id']};_0x1a7620[_0x3a495e(0x26c)]&&_0x1a7620['name']!==_0x11e5d6&&(_0xc079de[_0x3a495e(0x21e)]=_0x1a7620[_0x3a495e(0x26c)]);_0x1a7620[_0x3a495e(0x1f9)]!==undefined&&(_0xc079de[_0x3a495e(0x1e3)]=_0x1a7620[_0x3a495e(0x1f9)]);_0x1a7620['state']&&(_0xc079de[_0x3a495e(0x1ef)]=_0x1a7620[_0x3a495e(0x1ef)]===_0x3a495e(0x266)?'launched':'draft');const _0x3edab3={'type':_0x3a495e(0x279),'name':_0x11e5d6,'journeys':[_0xc079de]};_0x1a7620['description']&&(_0x3edab3[_0x3a495e(0x247)]=_0x1a7620[_0x3a495e(0x247)]);_0x1a7620['goal']&&(_0x3edab3['goal']=convertApiCriteriaToYaml(_0x1a7620[_0x3a495e(0x1ed)]));if(_0x1a7620['reentryMode'])_0x3edab3['reentry']=_0x1a7620[_0x3a495e(0x208)];else _0x1a7620['allowReentry']!==undefined&&(_0x3edab3[_0x3a495e(0x264)]=_0x1a7620['allowReentry']?'reentry_always':_0x3a495e(0x1e8));return _0x1a7620[_0x3a495e(0x20a)]&&(_0x3edab3[_0x3a495e(0x1d6)]=_0x1a7620[_0x3a495e(0x20a)]),_0x1a7620[_0x3a495e(0x218)]&&(_0x3edab3[_0x3a495e(0x1ff)]=_0x1a7620['journeyBundleName']),_0x39c9f6[_0x3a495e(0x287)]?.[_0x3a495e(0x1fb)]?.[_0x3a495e(0x292)]?.['id']&&(_0x3edab3['folder_id']=_0x39c9f6[_0x3a495e(0x287)][_0x3a495e(0x1fb)][_0x3a495e(0x292)]['id']),_0x3edab3;}export async function journeyResponseToDef(_0x2b710e,_0x3fb97d){const _0x406a6c=a109_0x57df,_0x394920=journeyResponseToDefSync(_0x2b710e);if(!_0x3fb97d)return _0x394920;const _0x4f79cf=new Set();collectSegmentIdsFromJourney(_0x394920,_0x4f79cf);const _0xe9605e=new Set();collectActivationIdsFromJourney(_0x394920,_0xe9605e);const _0x445694={},_0x433135=new Map();for(const _0xbb45f3 of Array[_0x406a6c(0x276)](_0x4f79cf)['sort']()){if(_0x3fb97d[_0x406a6c(0x262)]){const _0x10f4b1=await _0x3fb97d[_0x406a6c(0x262)](_0xbb45f3);if(_0x10f4b1[_0x406a6c(0x26d)]){_0x433135[_0x406a6c(0x254)](_0xbb45f3,_0x10f4b1[_0x406a6c(0x26c)]);if(_0x10f4b1['definition']){const _0x3adc65={..._0x10f4b1[_0x406a6c(0x28b)],'rule':deepSortObject(_0x10f4b1[_0x406a6c(0x28b)][_0x406a6c(0x1ce)])};_0x445694[_0x10f4b1[_0x406a6c(0x26c)]]=_0x3adc65;}}else _0x433135['set'](_0xbb45f3,makeSegmentRef(_0x10f4b1['name']));}else{if(_0x3fb97d['resolveSegmentName']){const _0x5210f8=await _0x3fb97d[_0x406a6c(0x286)](_0xbb45f3);_0x433135[_0x406a6c(0x254)](_0xbb45f3,_0x5210f8);}}}const _0x3a983a={},_0x4e106b=new Map();for(const _0x59e887 of Array[_0x406a6c(0x276)](_0xe9605e)[_0x406a6c(0x22c)]()){if(_0x3fb97d[_0x406a6c(0x290)]){const _0x2cfd0f=await _0x3fb97d[_0x406a6c(0x290)](_0x59e887);_0x2cfd0f[_0x406a6c(0x26d)]?(_0x4e106b[_0x406a6c(0x254)](_0x59e887,_0x2cfd0f[_0x406a6c(0x26c)]),_0x2cfd0f[_0x406a6c(0x28b)]&&(_0x3a983a[_0x2cfd0f[_0x406a6c(0x26c)]]=_0x2cfd0f['definition'])):_0x4e106b[_0x406a6c(0x254)](_0x59e887,makeSegmentRef(_0x2cfd0f[_0x406a6c(0x26c)]));}else{if(_0x3fb97d['resolveActivationName']){const _0x125795=await _0x3fb97d[_0x406a6c(0x25a)](_0x59e887);_0x4e106b[_0x406a6c(0x254)](_0x59e887,_0x125795);}}}_0x433135[_0x406a6c(0x226)]>0x0&&replaceSegmentIdsInJourney(_0x394920,_0x433135);_0x4e106b[_0x406a6c(0x226)]>0x0&&replaceActivationIdsInJourney(_0x394920,_0x4e106b);if(_0x3fb97d[_0x406a6c(0x1f0)]){const _0x4dcdb5=[];collectJumpTargetsFromJourney(_0x394920,_0x4dcdb5);if(_0x4dcdb5[_0x406a6c(0x1dc)]>0x0){const _0x1d8f7a=new Map();for(const _0xda9642 of _0x4dcdb5){try{const _0xac61a4=await _0x3fb97d[_0x406a6c(0x1f0)](_0xda9642['journeyId'],_0xda9642['stageId']);_0x1d8f7a[_0x406a6c(0x254)](_0xda9642['journeyId']+':'+_0xda9642['stageId'],_0xac61a4);}catch{}}_0x1d8f7a[_0x406a6c(0x226)]>0x0&&replaceJumpTargetsInJourney(_0x394920,_0x1d8f7a);}}return Object['keys'](_0x445694)[_0x406a6c(0x1dc)]>0x0&&(_0x394920[_0x406a6c(0x271)]=_0x445694),Object[_0x406a6c(0x281)](_0x3a983a)['length']>0x0&&(_0x394920[_0x406a6c(0x1d5)]=_0x3a983a),_0x394920;}function a109_0x402f(){const _0x289744=['folder','decision_point','resolveEmbeddedSegmentId','from','waitCondition','timeout','journey','journeys:','\x20\x20\x20\x20type:\x20','segment','test','Entry\x20Criteria','Stage\x20Complete','behavior','keys','102352spOyUG','columns','unique_id','parse','resolveSegmentName','relationships','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','activation','Variant','definition','shift','day','reentry:','First\x20stage\x20of\x20the\x20journey','resolveActivation','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','data',':\x20maximum\x208\x20stages\x20allowed','excluded','ref','add','journeys','Journey\x20YAML\x20journeys[','rule','waitStepType','Condition','316686SaDyeU','get','\x20\x20rule:\x0a','stageName','activations','bundle_id','object','wait','unit','rootStep','condition','length','replace','filter','Unknown\x20segment\x20\x22','stage','\x27.\x0a','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','version_number','startsWith','conditionTimeoutUnit','Journey\x20description','connector_config','no_reentry','jump','folder_id','Expected\x20format:\x0a','segments:','goal','resolveJourneyId','state','resolveJumpTarget','1401738kiLuCj','trim','419470vltfgv','exit_criteria','JOURNEY_SYNTAX_ERROR','activations:','186zWCOAU','next','versionNumber','Journey\x20YAML\x20versions[','parentFolder','\x27:\x20','exitCriterias','customizedSplit','bundle_name','timedOutPath','entryCriteria','Duration','includes','excludedPath','days','resolveSegmentId','entry_criteria','reentryMode','push','journeyBundleId','resolveActivationId','attributes','669168TbDsUZ','709520GZbdXw','type','Stage\x201','map','isArray','9501xfqLfw','wait_until','customized_split','embedded','Merge','journeyBundleName','waitStepUnit','journeyStageId','with','DecisionPoint','segmentId','version','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','your-activation-name','resolveEmbeddedActivationId','slice','steps','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','find','size','toLowerCase','end','11jxZjOZ','has',']\x20has\x20invalid\x20state:\x20','sort','uuid','\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)','percentage','notification','ab_test','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','journeyStages','waitUntilDate','8qepcTk','draft','Journey\x20YAML\x20','week','\x20\x20\x20\x20conditions:\x0a','Jump\x20step\x20\x22','branches','End','merge','journeys[','connection','randomUUID','versions','Met\x20condition(s)',']\x20missing\x20required\x20field:\x20name','journeyId','Wait\x201\x20Day','AbTest','description','values','ABTest','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','conditions','duration','all','variants','WaitStep','moveAfter','Send\x20Notification','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','Activation','set','uniqueId','waitStep','Journey\x20YAML\x20must\x20have\x20type:\x20journey','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','latest','resolveActivationName','stages','].stages','segment_id','ref:','daysOfWeek',']\x20missing\x20required\x20field:\x20stages','activation_template_id','resolveSegment','conditionSegmentId','reentry','root_step','launched','Jump','journeyName','target','conditionTimeoutDuration','days_of_week','name','isJourneyLocal','25GofxKg','milestone','DaysOfTheWeek','segments','all_columns'];a109_0x402f=function(){return _0x289744;};return a109_0x402f();}function collectSegmentIdsFromJourney(_0x2ceecb,_0xac2ea8){const _0x1ab759=a109_0x57df;_0x2ceecb[_0x1ab759(0x1ed)]?.[_0x1ab759(0x27c)]&&_0xac2ea8[_0x1ab759(0x1cb)](_0x2ceecb[_0x1ab759(0x1ed)][_0x1ab759(0x27c)]);const _0x35142a=_0x13bda2=>{const _0x2b96a4=_0x1ab759;for(const _0x4aad37 of _0x13bda2){_0x4aad37['entry_criteria']?.['segment']&&_0xac2ea8[_0x2b96a4(0x1cb)](_0x4aad37[_0x2b96a4(0x207)][_0x2b96a4(0x27c)]);if(_0x4aad37['exit_criteria'])for(const _0x870862 of _0x4aad37[_0x2b96a4(0x1f4)]){_0x870862['segment']&&_0xac2ea8[_0x2b96a4(0x1cb)](_0x870862[_0x2b96a4(0x27c)]);}_0x4aad37[_0x2b96a4(0x26f)]?.[_0x2b96a4(0x27c)]&&_0xac2ea8[_0x2b96a4(0x1cb)](_0x4aad37[_0x2b96a4(0x26f)]['segment']);if(_0x4aad37[_0x2b96a4(0x223)])for(const _0x4df19e of _0x4aad37['steps']){if(_0x4df19e[_0x2b96a4(0x20f)]==='decision_point'){const _0x224f8a=_0x4df19e;for(const _0x15d395 of _0x224f8a[_0x2b96a4(0x21b)]['branches']){_0x15d395[_0x2b96a4(0x27c)]&&_0xac2ea8['add'](_0x15d395[_0x2b96a4(0x27c)]);}}else{if(_0x4df19e['type']==='wait'){const _0x492428=_0x4df19e;_0x492428['with'][_0x2b96a4(0x1db)]?.['segment']&&_0xac2ea8[_0x2b96a4(0x1cb)](_0x492428[_0x2b96a4(0x21b)]['condition'][_0x2b96a4(0x27c)]);}}}}};if(_0x2ceecb[_0x1ab759(0x1cc)])for(const _0x4cdda9 of _0x2ceecb[_0x1ab759(0x1cc)]){_0x4cdda9['goal']?.[_0x1ab759(0x27c)]&&_0xac2ea8[_0x1ab759(0x1cb)](_0x4cdda9[_0x1ab759(0x1ed)][_0x1ab759(0x27c)]),_0x35142a(_0x4cdda9[_0x1ab759(0x25b)]);}_0x2ceecb[_0x1ab759(0x25b)]&&_0x35142a(_0x2ceecb[_0x1ab759(0x25b)]);if(_0x2ceecb[_0x1ab759(0x241)])for(const _0x2bec80 of _0x2ceecb[_0x1ab759(0x241)]){_0x35142a(_0x2bec80['stages']);}}function replaceSegmentIdsInJourney(_0x18351a,_0x5963db){const _0x22840a=a109_0x57df,_0x2d0718=_0x114238=>_0x5963db[_0x22840a(0x1d2)](_0x114238)||_0x114238;_0x18351a['goal']?.[_0x22840a(0x27c)]&&(_0x18351a[_0x22840a(0x1ed)][_0x22840a(0x27c)]=_0x2d0718(_0x18351a[_0x22840a(0x1ed)][_0x22840a(0x27c)]));const _0x18e03b=_0x18117e=>{const _0x42e2f2=_0x22840a;for(const _0x2ba0e2 of _0x18117e){_0x2ba0e2[_0x42e2f2(0x207)]?.[_0x42e2f2(0x27c)]&&(_0x2ba0e2[_0x42e2f2(0x207)]['segment']=_0x2d0718(_0x2ba0e2['entry_criteria']['segment']));if(_0x2ba0e2[_0x42e2f2(0x1f4)])for(const _0x1e48b5 of _0x2ba0e2[_0x42e2f2(0x1f4)]){_0x1e48b5['segment']&&(_0x1e48b5[_0x42e2f2(0x27c)]=_0x2d0718(_0x1e48b5[_0x42e2f2(0x27c)]));}_0x2ba0e2[_0x42e2f2(0x26f)]?.[_0x42e2f2(0x27c)]&&(_0x2ba0e2[_0x42e2f2(0x26f)]['segment']=_0x2d0718(_0x2ba0e2[_0x42e2f2(0x26f)]['segment']));if(_0x2ba0e2[_0x42e2f2(0x223)])for(const _0x22056c of _0x2ba0e2[_0x42e2f2(0x223)]){if(_0x22056c[_0x42e2f2(0x20f)]==='decision_point'){const _0x3617a1=_0x22056c;for(const _0x154a8a of _0x3617a1[_0x42e2f2(0x21b)][_0x42e2f2(0x23b)]){_0x154a8a['segment']&&(_0x154a8a[_0x42e2f2(0x27c)]=_0x2d0718(_0x154a8a[_0x42e2f2(0x27c)]));}}else{if(_0x22056c['type']===_0x42e2f2(0x1d8)){const _0x5ad690=_0x22056c;_0x5ad690[_0x42e2f2(0x21b)][_0x42e2f2(0x1db)]?.[_0x42e2f2(0x27c)]&&(_0x5ad690[_0x42e2f2(0x21b)]['condition'][_0x42e2f2(0x27c)]=_0x2d0718(_0x5ad690['with']['condition'][_0x42e2f2(0x27c)]));}}}}};if(_0x18351a[_0x22840a(0x1cc)])for(const _0x5811d8 of _0x18351a[_0x22840a(0x1cc)]){_0x5811d8[_0x22840a(0x1ed)]?.['segment']&&(_0x5811d8[_0x22840a(0x1ed)][_0x22840a(0x27c)]=_0x2d0718(_0x5811d8[_0x22840a(0x1ed)][_0x22840a(0x27c)])),_0x18e03b(_0x5811d8[_0x22840a(0x25b)]);}_0x18351a[_0x22840a(0x25b)]&&_0x18e03b(_0x18351a[_0x22840a(0x25b)]);if(_0x18351a[_0x22840a(0x241)])for(const _0x2f1619 of _0x18351a[_0x22840a(0x241)]){_0x18e03b(_0x2f1619[_0x22840a(0x25b)]);}}function collectActivationIdsFromJourney(_0x49b429,_0x27274d){const _0xdab05d=a109_0x57df,_0x233b4d=_0x16ab32=>{const _0x3b594d=a109_0x57df;for(const _0x3571b7 of _0x16ab32){if(_0x3571b7['steps'])for(const _0x28262b of _0x3571b7[_0x3b594d(0x223)]){if(_0x28262b[_0x3b594d(0x20f)]==='activation'){const _0x239ebf=_0x28262b;_0x239ebf[_0x3b594d(0x21b)][_0x3b594d(0x289)]&&/^\d+$/['test'](_0x239ebf[_0x3b594d(0x21b)][_0x3b594d(0x289)])&&_0x27274d[_0x3b594d(0x1cb)](_0x239ebf[_0x3b594d(0x21b)][_0x3b594d(0x289)]);}}}};if(_0x49b429[_0xdab05d(0x1cc)])for(const _0x2beb1d of _0x49b429['journeys']){_0x233b4d(_0x2beb1d['stages']);}_0x49b429[_0xdab05d(0x25b)]&&_0x233b4d(_0x49b429[_0xdab05d(0x25b)]);if(_0x49b429['versions'])for(const _0x154a65 of _0x49b429[_0xdab05d(0x241)]){_0x233b4d(_0x154a65[_0xdab05d(0x25b)]);}}function replaceActivationIdsInJourney(_0x1ca58c,_0x1dfc79){const _0x45854c=a109_0x57df,_0x262446=_0x5359f6=>_0x1dfc79[_0x45854c(0x1d2)](_0x5359f6)||_0x5359f6,_0x5336b0=_0x50e14b=>{const _0xdef485=_0x45854c;for(const _0x494fd3 of _0x50e14b){if(_0x494fd3[_0xdef485(0x223)])for(const _0x5b8324 of _0x494fd3[_0xdef485(0x223)]){if(_0x5b8324['type']==='activation'){const _0x62fc0d=_0x5b8324;_0x62fc0d['with'][_0xdef485(0x289)]&&(_0x62fc0d[_0xdef485(0x21b)][_0xdef485(0x289)]=_0x262446(_0x62fc0d[_0xdef485(0x21b)][_0xdef485(0x289)]));}}}};if(_0x1ca58c[_0x45854c(0x1cc)])for(const _0x3366b4 of _0x1ca58c['journeys']){_0x5336b0(_0x3366b4['stages']);}_0x1ca58c['stages']&&_0x5336b0(_0x1ca58c[_0x45854c(0x25b)]);if(_0x1ca58c[_0x45854c(0x241)])for(const _0x86bd30 of _0x1ca58c[_0x45854c(0x241)]){_0x5336b0(_0x86bd30[_0x45854c(0x25b)]);}}function collectJumpTargetsFromJourney(_0x5d20a8,_0x3b5a75){const _0x1cf0f2=a109_0x57df,_0x4a81df=new Set(),_0x22fe60=_0x7c6e60=>{const _0x318129=a109_0x57df;for(const _0x2eb5e5 of _0x7c6e60){if(_0x2eb5e5['steps'])for(const _0x560bf3 of _0x2eb5e5[_0x318129(0x223)]){if(_0x560bf3[_0x318129(0x20f)]===_0x318129(0x1e9)){const _0x6d9271=_0x560bf3,_0x46349b=_0x6d9271['with'][_0x318129(0x269)];if(_0x46349b[_0x318129(0x279)]&&_0x46349b[_0x318129(0x1e0)]&&/^\d+$/[_0x318129(0x27d)](_0x46349b[_0x318129(0x279)])&&/^\d+$/[_0x318129(0x27d)](_0x46349b['stage'])){const _0x1af681=_0x46349b['journey']+':'+_0x46349b['stage'];!_0x4a81df['has'](_0x1af681)&&(_0x4a81df[_0x318129(0x1cb)](_0x1af681),_0x3b5a75['push']({'journeyId':_0x46349b[_0x318129(0x279)],'stageId':_0x46349b[_0x318129(0x1e0)]}));}}}}};if(_0x5d20a8[_0x1cf0f2(0x1cc)])for(const _0x4c4280 of _0x5d20a8[_0x1cf0f2(0x1cc)]){_0x22fe60(_0x4c4280[_0x1cf0f2(0x25b)]);}_0x5d20a8[_0x1cf0f2(0x25b)]&&_0x22fe60(_0x5d20a8[_0x1cf0f2(0x25b)]);if(_0x5d20a8[_0x1cf0f2(0x241)])for(const _0x183d14 of _0x5d20a8[_0x1cf0f2(0x241)]){_0x22fe60(_0x183d14[_0x1cf0f2(0x25b)]);}}function replaceJumpTargetsInJourney(_0x366b9b,_0xf88e){const _0x7ae9a=a109_0x57df,_0x4eec50=_0x5b1b94=>{const _0x1c77de=a109_0x57df;for(const _0x3c4df0 of _0x5b1b94){if(_0x3c4df0[_0x1c77de(0x223)])for(const _0x5cbaef of _0x3c4df0[_0x1c77de(0x223)]){if(_0x5cbaef['type']==='jump'){const _0xca72a2=_0x5cbaef,_0x1cb4bc=_0xca72a2[_0x1c77de(0x21b)][_0x1c77de(0x269)],_0xc354b0=_0x1cb4bc['journey']+':'+_0x1cb4bc[_0x1c77de(0x1e0)],_0x1ccdda=_0xf88e[_0x1c77de(0x1d2)](_0xc354b0);_0x1ccdda&&(_0x1cb4bc[_0x1c77de(0x279)]=_0x1ccdda['journeyName'],_0x1cb4bc[_0x1c77de(0x1e0)]=_0x1ccdda[_0x1c77de(0x1d4)]);}}}};if(_0x366b9b[_0x7ae9a(0x1cc)])for(const _0x2ea228 of _0x366b9b[_0x7ae9a(0x1cc)]){_0x4eec50(_0x2ea228[_0x7ae9a(0x25b)]);}_0x366b9b[_0x7ae9a(0x25b)]&&_0x4eec50(_0x366b9b[_0x7ae9a(0x25b)]);if(_0x366b9b[_0x7ae9a(0x241)])for(const _0x29a4d4 of _0x366b9b[_0x7ae9a(0x241)]){_0x4eec50(_0x29a4d4['stages']);}}function generateReadableStepName(_0x44a2ac,_0x24992d){const _0x1361b7=a109_0x57df;if(_0x44a2ac[_0x1361b7(0x26c)]&&_0x44a2ac[_0x1361b7(0x26c)]!==_0x44a2ac[_0x1361b7(0x20f)]){const _0x58ff2a=_0x44a2ac[_0x1361b7(0x26c)][_0x1361b7(0x1f2)]();if(_0x58ff2a&&/[a-z0-9]/i['test'](_0x58ff2a))return _0x58ff2a;}const _0x40b439=_0x44a2ac[_0x1361b7(0x20f)][_0x1361b7(0x227)]()[_0x1361b7(0x1dd)](/step$/i,'');return _0x40b439+'_'+(_0x24992d+0x1);}function getStepNextRefs(_0x2e2e77){const _0x4f54c0=a109_0x57df,_0x14fd22=[];if(_0x2e2e77[_0x4f54c0(0x1f8)])_0x14fd22[_0x4f54c0(0x209)](_0x2e2e77[_0x4f54c0(0x1f8)]);if(_0x2e2e77[_0x4f54c0(0x23b)])for(const _0x45e3fc of _0x2e2e77[_0x4f54c0(0x23b)]){if(_0x45e3fc[_0x4f54c0(0x1f8)])_0x14fd22['push'](_0x45e3fc['next']);}if(_0x2e2e77[_0x4f54c0(0x24e)])for(const _0x6d9447 of _0x2e2e77[_0x4f54c0(0x24e)]){if(_0x6d9447['next'])_0x14fd22['push'](_0x6d9447[_0x4f54c0(0x1f8)]);}if(_0x2e2e77[_0x4f54c0(0x24b)])for(const _0x332e6b of _0x2e2e77[_0x4f54c0(0x24b)]){if(_0x332e6b[_0x4f54c0(0x1f8)])_0x14fd22[_0x4f54c0(0x209)](_0x332e6b['next']);}return _0x14fd22;}function parseJumpTargetDisplayName(_0x1fa31a){const _0x4f36d2=a109_0x57df,_0x2f37a1=_0x1fa31a['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x2f37a1)return undefined;const _0xe41aad=_0x2f37a1[0x1][_0x4f36d2(0x1f2)](),_0x4067b5=_0x2f37a1[0x2]['trim']();if(!_0xe41aad||!_0x4067b5)return undefined;return{'stageName':_0xe41aad,'journeyName':_0x4067b5};}function orderStepsFromRoot(_0x2db29a,_0x5ed58e){const _0x538e81=a109_0x57df,_0x1d2263=Object['entries'](_0x2db29a);if(_0x1d2263[_0x538e81(0x1dc)]===0x0)return[];const _0x51602e=new Set(_0x1d2263['map'](([_0x735982])=>_0x735982)),_0x342738=new Set();for(const [,_0x5c7e22]of _0x1d2263){for(const _0x24dff0 of getStepNextRefs(_0x5c7e22)){if(_0x51602e['has'](_0x24dff0))_0x342738[_0x538e81(0x1cb)](_0x24dff0);}}let _0x5e7432=_0x5ed58e&&_0x51602e[_0x538e81(0x22a)](_0x5ed58e)?_0x5ed58e:undefined;if(!_0x5e7432){const _0x507ab5=_0x1d2263[_0x538e81(0x1de)](([_0x623192])=>!_0x342738[_0x538e81(0x22a)](_0x623192));_0x507ab5[_0x538e81(0x1dc)]>0x0?_0x5e7432=_0x507ab5[0x0][0x0]:_0x5e7432=_0x1d2263[0x0][0x0];}const _0x58d49f=[],_0x2a418e=new Set(),_0x59ca42=[_0x5e7432];while(_0x59ca42['length']>0x0){const _0x246435=_0x59ca42[_0x538e81(0x28c)]();if(_0x2a418e[_0x538e81(0x22a)](_0x246435))continue;_0x2a418e[_0x538e81(0x1cb)](_0x246435);const _0x3dff0d=_0x2db29a[_0x246435];if(!_0x3dff0d)continue;_0x58d49f['push']({'uuid':_0x246435,'step':_0x3dff0d});for(const _0x5d2123 of getStepNextRefs(_0x3dff0d)){_0x51602e['has'](_0x5d2123)&&!_0x2a418e[_0x538e81(0x22a)](_0x5d2123)&&_0x59ca42[_0x538e81(0x209)](_0x5d2123);}}for(const [_0x2d6f14,_0x34d19f]of _0x1d2263){!_0x2a418e[_0x538e81(0x22a)](_0x2d6f14)&&_0x58d49f['push']({'uuid':_0x2d6f14,'step':_0x34d19f});}return _0x58d49f;}function resolveStepReferences(_0x3de229,_0xa104e9,_0x6340a4,_0x25009b){const _0x3c8249=a109_0x57df;if(_0x3de229[_0x3c8249(0x20f)]!==_0x3c8249(0x228)){_0x3de229['next']&&_0x25009b['has'](_0x3de229['next'])&&(_0x3de229[_0x3c8249(0x1f8)]=_0x25009b[_0x3c8249(0x1d2)](_0x3de229[_0x3c8249(0x1f8)]));const _0x1ad44c=_0xa104e9+0x1;if(_0x1ad44c<_0x6340a4[_0x3c8249(0x1dc)]){const _0x38c22a=_0x25009b['get'](_0x6340a4[_0x1ad44c][_0x3c8249(0x22d)]);_0x3de229[_0x3c8249(0x1f8)]===_0x38c22a&&delete _0x3de229[_0x3c8249(0x1f8)];}}if(_0x3de229[_0x3c8249(0x20f)]===_0x3c8249(0x274))for(const _0x79f614 of _0x3de229[_0x3c8249(0x21b)][_0x3c8249(0x23b)]){_0x79f614[_0x3c8249(0x1f8)]&&_0x25009b[_0x3c8249(0x22a)](_0x79f614['next'])&&(_0x79f614[_0x3c8249(0x1f8)]=_0x25009b[_0x3c8249(0x1d2)](_0x79f614[_0x3c8249(0x1f8)]));}if(_0x3de229[_0x3c8249(0x20f)]===_0x3c8249(0x231))for(const _0x1efa75 of _0x3de229[_0x3c8249(0x21b)]['variants']){_0x1efa75[_0x3c8249(0x1f8)]&&_0x25009b[_0x3c8249(0x22a)](_0x1efa75['next'])&&(_0x1efa75[_0x3c8249(0x1f8)]=_0x25009b['get'](_0x1efa75[_0x3c8249(0x1f8)]));}if(_0x3de229[_0x3c8249(0x20f)]===_0x3c8249(0x1d8)&&_0x3de229[_0x3c8249(0x21b)][_0x3c8249(0x1db)]){const _0x49b0a0=_0x3de229['with'][_0x3c8249(0x1db)];_0x49b0a0[_0x3c8249(0x1f8)]&&_0x25009b[_0x3c8249(0x22a)](_0x49b0a0[_0x3c8249(0x1f8)])&&(_0x49b0a0[_0x3c8249(0x1f8)]=_0x25009b[_0x3c8249(0x1d2)](_0x49b0a0[_0x3c8249(0x1f8)])),_0x49b0a0[_0x3c8249(0x278)]?.[_0x3c8249(0x1f8)]&&_0x25009b[_0x3c8249(0x22a)](_0x49b0a0[_0x3c8249(0x278)][_0x3c8249(0x1f8)])&&(_0x49b0a0['timeout']['next']=_0x25009b[_0x3c8249(0x1d2)](_0x49b0a0[_0x3c8249(0x278)][_0x3c8249(0x1f8)]));}}function convertApiStageToYaml(_0x2ccf74){const _0x3d1de=a109_0x57df,_0x473a96={'name':_0x2ccf74[_0x3d1de(0x26c)]};_0x2ccf74['id']&&(_0x473a96['id']=_0x2ccf74['id']);_0x2ccf74['description']&&(_0x473a96[_0x3d1de(0x247)]=_0x2ccf74[_0x3d1de(0x247)]);_0x2ccf74[_0x3d1de(0x201)]&&(_0x473a96[_0x3d1de(0x207)]=convertApiCriteriaToYaml(_0x2ccf74['entryCriteria']));_0x2ccf74[_0x3d1de(0x1fd)]&&_0x2ccf74[_0x3d1de(0x1fd)][_0x3d1de(0x1dc)]>0x0&&(_0x473a96[_0x3d1de(0x1f4)]=_0x2ccf74[_0x3d1de(0x1fd)][_0x3d1de(0x211)](convertApiCriteriaToYaml));_0x2ccf74[_0x3d1de(0x26f)]&&(_0x473a96['milestone']=convertApiCriteriaToYaml(_0x2ccf74[_0x3d1de(0x26f)]));if(_0x2ccf74['steps']&&Object[_0x3d1de(0x281)](_0x2ccf74[_0x3d1de(0x223)])[_0x3d1de(0x1dc)]>0x0){const _0x341917=orderStepsFromRoot(_0x2ccf74[_0x3d1de(0x223)],_0x2ccf74[_0x3d1de(0x1da)]),_0x28ed4c=new Map(),_0xb7e174=new Set();for(let _0x539af4=0x0;_0x539af4<_0x341917[_0x3d1de(0x1dc)];_0x539af4++){const {uuid:_0x117797,step:_0x427df2}=_0x341917[_0x539af4];let _0x388fb8=generateReadableStepName(_0x427df2,_0x539af4),_0x27f522=_0x388fb8,_0x84588b=0x2;while(_0xb7e174['has'](_0x27f522)){_0x27f522=_0x388fb8+'_'+_0x84588b,_0x84588b++;}_0xb7e174[_0x3d1de(0x1cb)](_0x27f522),_0x28ed4c['set'](_0x117797,_0x27f522);}_0x473a96[_0x3d1de(0x223)]=_0x341917[_0x3d1de(0x211)](({uuid:_0x1e74a1,step:_0x465b8a},_0xc33426)=>{const _0xd6ae1c=convertApiStepToYaml(_0x465b8a,_0x28ed4c['get'](_0x1e74a1));return resolveStepReferences(_0xd6ae1c,_0xc33426,_0x341917,_0x28ed4c),_0xd6ae1c;});}return _0x473a96;}function convertApiCriteriaToYaml(_0x15a5ba){const _0x143208=a109_0x57df,_0x10d37f={'name':_0x15a5ba[_0x143208(0x26c)],'segment':_0x15a5ba['segmentId']};_0x15a5ba[_0x143208(0x247)]&&(_0x10d37f[_0x143208(0x247)]=_0x15a5ba[_0x143208(0x247)]);if(_0x15a5ba[_0x143208(0x269)]){let _0x4b5067=_0x15a5ba['target'][_0x143208(0x244)],_0x706cda=_0x15a5ba[_0x143208(0x269)][_0x143208(0x21a)];if(_0x15a5ba[_0x143208(0x269)][_0x143208(0x268)]){const _0xafaef5=parseJumpTargetDisplayName(_0x15a5ba[_0x143208(0x269)][_0x143208(0x268)]);_0xafaef5&&(_0x706cda=_0xafaef5['stageName'],_0x4b5067=_0xafaef5[_0x143208(0x268)]);}_0x10d37f[_0x143208(0x269)]={'journey':_0x4b5067,'stage':_0x706cda},_0x15a5ba[_0x143208(0x269)][_0x143208(0x20a)]&&(_0x10d37f[_0x143208(0x269)][_0x143208(0x1d6)]=_0x15a5ba['target'][_0x143208(0x20a)]);}return _0x10d37f;}function convertApiStepToYaml(_0x58f2ef,_0x2b0bdb){const _0x9c9181=a109_0x57df;switch(_0x58f2ef['type']){case _0x9c9181(0x24f):{const _0x7e3ed9={};if(_0x58f2ef[_0x9c9181(0x1cf)]==='Duration'&&_0x58f2ef['waitStep']!==undefined)_0x7e3ed9[_0x9c9181(0x24c)]=_0x58f2ef[_0x9c9181(0x256)],_0x7e3ed9['unit']=_0x58f2ef[_0x9c9181(0x219)];else{if(_0x58f2ef[_0x9c9181(0x1cf)]==='Date'&&_0x58f2ef[_0x9c9181(0x234)])_0x7e3ed9[_0x9c9181(0x214)]=_0x58f2ef[_0x9c9181(0x234)];else{if(_0x58f2ef[_0x9c9181(0x1cf)]===_0x9c9181(0x270)&&_0x58f2ef[_0x9c9181(0x25f)])_0x7e3ed9[_0x9c9181(0x26b)]=_0x58f2ef['daysOfWeek'];else{if(_0x58f2ef[_0x9c9181(0x1cf)]===_0x9c9181(0x1d0)){if(_0x58f2ef[_0x9c9181(0x24b)]&&_0x58f2ef['conditions']['length']>0x0){const _0x408277=_0x58f2ef['conditions'][_0x9c9181(0x225)](_0x4cc127=>!_0x4cc127[_0x9c9181(0x200)]),_0x1c38ff=_0x58f2ef[_0x9c9181(0x24b)]['find'](_0x30f1bb=>_0x30f1bb[_0x9c9181(0x200)]);_0x408277?.[_0x9c9181(0x21d)]&&(_0x7e3ed9[_0x9c9181(0x1db)]={'segment':_0x408277[_0x9c9181(0x21d)],..._0x408277[_0x9c9181(0x1f8)]?{'next':_0x408277[_0x9c9181(0x1f8)]}:{}},_0x1c38ff&&_0x1c38ff['moveAfter']!==undefined&&_0x1c38ff['unit']&&(_0x7e3ed9[_0x9c9181(0x1db)][_0x9c9181(0x278)]={'duration':_0x1c38ff[_0x9c9181(0x250)],'unit':_0x1c38ff[_0x9c9181(0x1d9)],..._0x1c38ff[_0x9c9181(0x1f8)]?{'next':_0x1c38ff[_0x9c9181(0x1f8)]}:{}}));}else _0x58f2ef[_0x9c9181(0x263)]&&(_0x7e3ed9['condition']={'segment':_0x58f2ef['conditionSegmentId']},_0x58f2ef['conditionTimeoutDuration']!==undefined&&_0x58f2ef[_0x9c9181(0x1e5)]&&(_0x7e3ed9[_0x9c9181(0x1db)][_0x9c9181(0x278)]={'duration':_0x58f2ef['conditionTimeoutDuration'],'unit':_0x58f2ef[_0x9c9181(0x1e5)]}));}}}}const _0x4da021={'type':'wait','name':_0x2b0bdb,..._0x58f2ef[_0x9c9181(0x1f8)]?{'next':_0x58f2ef[_0x9c9181(0x1f8)]}:{},'with':_0x7e3ed9};return _0x4da021;}case _0x9c9181(0x253):{const _0x4b8c0b={'type':'activation','name':_0x2b0bdb,..._0x58f2ef[_0x9c9181(0x1f8)]?{'next':_0x58f2ef[_0x9c9181(0x1f8)]}:{},'with':{'activation':_0x58f2ef['journeyActivationStepId']||''}};return _0x4b8c0b;}case _0x9c9181(0x21c):{const _0x404e7f={'type':_0x9c9181(0x274),'name':_0x2b0bdb,..._0x58f2ef[_0x9c9181(0x1f8)]?{'next':_0x58f2ef[_0x9c9181(0x1f8)]}:{},'with':{'branches':(_0x58f2ef[_0x9c9181(0x23b)]||[])[_0x9c9181(0x211)](_0x182647=>({'name':_0x182647[_0x9c9181(0x26c)],'segment':_0x182647[_0x9c9181(0x21d)],'excluded':_0x182647[_0x9c9181(0x204)],..._0x182647[_0x9c9181(0x1f8)]?{'next':_0x182647[_0x9c9181(0x1f8)]}:{}}))}};return _0x404e7f;}case _0x9c9181(0x249):case _0x9c9181(0x246):case _0x9c9181(0x28a):{const _0x453fc0=_0x58f2ef[_0x9c9181(0x24e)]||(_0x58f2ef[_0x9c9181(0x23b)]||[])[_0x9c9181(0x211)](_0x3a6e1c=>({'name':_0x3a6e1c['name'],'percentage':0x0,'next':_0x3a6e1c[_0x9c9181(0x1f8)]})),_0x36d564={'type':_0x9c9181(0x231),'name':_0x2b0bdb,..._0x58f2ef[_0x9c9181(0x1f8)]?{'next':_0x58f2ef[_0x9c9181(0x1f8)]}:{},'with':{'customized_split':_0x58f2ef[_0x9c9181(0x1fe)],'unique_id':_0x58f2ef[_0x9c9181(0x255)],'variants':_0x453fc0[_0x9c9181(0x211)](_0x25c60a=>({'name':_0x25c60a['name'],'percentage':_0x25c60a['percentage'],..._0x25c60a['next']?{'next':_0x25c60a[_0x9c9181(0x1f8)]}:{}}))}};return _0x36d564;}case _0x9c9181(0x217):{const _0x23551e={'type':_0x9c9181(0x23d),'name':_0x2b0bdb,..._0x58f2ef[_0x9c9181(0x1f8)]?{'next':_0x58f2ef[_0x9c9181(0x1f8)]}:{}};return _0x23551e;}case _0x9c9181(0x267):{if(!_0x58f2ef[_0x9c9181(0x269)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x9c9181(0x23a)+(_0x58f2ef[_0x9c9181(0x26c)]||_0x2b0bdb)+_0x9c9181(0x22e));let _0x700c65=_0x58f2ef[_0x9c9181(0x269)][_0x9c9181(0x244)],_0x83bdf3=_0x58f2ef[_0x9c9181(0x269)][_0x9c9181(0x21a)];if(_0x58f2ef[_0x9c9181(0x269)][_0x9c9181(0x268)]){const _0x2e9afd=parseJumpTargetDisplayName(_0x58f2ef[_0x9c9181(0x269)]['journeyName']);_0x2e9afd&&(_0x83bdf3=_0x2e9afd[_0x9c9181(0x1d4)],_0x700c65=_0x2e9afd[_0x9c9181(0x268)]);}const _0x140acb={'type':_0x9c9181(0x1e9),'name':_0x2b0bdb,..._0x58f2ef['next']?{'next':_0x58f2ef['next']}:{},'with':{'target':{'journey':_0x700c65,'stage':_0x83bdf3,'bundle_id':_0x58f2ef[_0x9c9181(0x269)][_0x9c9181(0x20a)]}}};return _0x140acb;}case'End':{const _0x181b43={'type':_0x9c9181(0x228),'name':_0x2b0bdb};return _0x181b43;}default:{const _0x8da3c6={'type':_0x9c9181(0x228),'name':_0x2b0bdb};return _0x8da3c6;}}}function a109_0x57df(_0x2fb490,_0x2fc8a4){_0x2fb490=_0x2fb490-0x1ca;const _0x402fed=a109_0x402f();let _0x57df3=_0x402fed[_0x2fb490];return _0x57df3;}export async function journeyDefToRequest(_0x2a88f0,_0x10e5fa,_0x29783e){const _0x658581=a109_0x57df,_0x1eb9d9=_0x2a88f0[_0x658581(0x25b)]||getActiveStages(_0x2a88f0),_0x488063=_0x2a88f0['segments']||{},_0x1e4528=_0x2a88f0[_0x658581(0x1d5)]||{},_0x2e4d1d={'type':'journey','attributes':{'name':_0x2a88f0['name'],'audienceId':_0x10e5fa,'journeyStages':await Promise[_0x658581(0x24d)](_0x1eb9d9[_0x658581(0x211)](_0x1699bb=>convertYamlStageToApi(_0x1699bb,_0x29783e,_0x488063,_0x1e4528)))}};_0x2a88f0['id']&&(_0x2e4d1d['id']=_0x2a88f0['id']);_0x2a88f0[_0x658581(0x247)]&&(_0x2e4d1d[_0x658581(0x20c)]['description']=_0x2a88f0[_0x658581(0x247)]);const _0xd67cff=getEffectiveGoal(_0x2a88f0);_0xd67cff&&(_0x2e4d1d[_0x658581(0x20c)][_0x658581(0x1ed)]=await convertYamlCriteriaToApi(_0xd67cff,_0x29783e,_0x488063));const _0x4642c9=getEffectiveReentry(_0x2a88f0);return _0x4642c9&&(_0x2e4d1d[_0x658581(0x20c)][_0x658581(0x208)]=_0x4642c9,_0x2e4d1d['attributes']['allowReentry']=_0x4642c9!==_0x658581(0x1e8)),_0x2a88f0[_0x658581(0x1ea)]&&(_0x2e4d1d[_0x658581(0x287)]={'parentFolder':{'data':{'id':_0x2a88f0['folder_id'],'type':_0x658581(0x273)}}}),_0x2e4d1d;}async function convertYamlStageToApi(_0x68cebc,_0x2e9591,_0x2be700={},_0x380727={}){const _0x119208=a109_0x57df,_0x364d30={'name':_0x68cebc[_0x119208(0x26c)]};_0x68cebc['id']&&(_0x364d30['id']=_0x68cebc['id']);_0x68cebc[_0x119208(0x247)]&&(_0x364d30[_0x119208(0x247)]=_0x68cebc['description']);_0x68cebc[_0x119208(0x207)]&&(_0x364d30['entryCriteria']=await convertYamlCriteriaToApi(_0x68cebc[_0x119208(0x207)],_0x2e9591,_0x2be700));_0x68cebc[_0x119208(0x1f4)]&&_0x68cebc[_0x119208(0x1f4)][_0x119208(0x1dc)]>0x0&&(_0x364d30[_0x119208(0x1fd)]=await Promise[_0x119208(0x24d)](_0x68cebc[_0x119208(0x1f4)][_0x119208(0x211)](_0x194a92=>convertYamlCriteriaToApi(_0x194a92,_0x2e9591,_0x2be700))));_0x68cebc[_0x119208(0x26f)]&&(_0x364d30[_0x119208(0x26f)]=await convertYamlCriteriaToApi(_0x68cebc[_0x119208(0x26f)],_0x2e9591,_0x2be700));if(_0x68cebc['steps']&&_0x68cebc[_0x119208(0x223)][_0x119208(0x1dc)]>0x0){const _0x216c55={},_0x57a1f6=_0x68cebc[_0x119208(0x223)][_0x119208(0x211)]((_0x294a7a,_0x3e554e)=>{const _0x3954d7=_0x119208,_0x6cd93a=_0x294a7a[_0x3954d7(0x22d)]||generateUUID(),_0x35773b=_0x294a7a['name']||_0x294a7a['type']+'_'+_0x3e554e;return _0x216c55[_0x35773b]=_0x6cd93a,{..._0x294a7a,'name':_0x35773b};});_0x364d30[_0x119208(0x1da)]=_0x216c55[_0x57a1f6[0x0]['name']],_0x364d30[_0x119208(0x223)]={};for(let _0x51c20d=0x0;_0x51c20d<_0x57a1f6['length'];_0x51c20d++){const _0x41b5a9=_0x57a1f6[_0x51c20d],_0x304710=_0x216c55[_0x41b5a9['name']],_0x1a2cb5=!_0x41b5a9['next']&&_0x51c20d<_0x57a1f6[_0x119208(0x1dc)]-0x1&&_0x41b5a9[_0x119208(0x20f)]!==_0x119208(0x228)?_0x57a1f6[_0x51c20d+0x1][_0x119208(0x26c)]:_0x41b5a9[_0x119208(0x1f8)],_0x497053=_0x1a2cb5!==_0x41b5a9[_0x119208(0x1f8)]?{..._0x41b5a9,'next':_0x1a2cb5}:_0x41b5a9;_0x364d30[_0x119208(0x223)][_0x304710]=await convertYamlStepToApi(_0x497053,_0x2e9591,_0x2be700,_0x216c55,_0x380727);}}else _0x68cebc[_0x119208(0x265)]&&(_0x364d30['rootStep']=_0x68cebc[_0x119208(0x265)]);return _0x364d30;}async function convertYamlCriteriaToApi(_0x517d7c,_0x276275,_0x392985={}){const _0x3cf6fa=a109_0x57df;let _0x56435a=_0x517d7c[_0x3cf6fa(0x27c)];if(_0x56435a&&!/^\d+$/[_0x3cf6fa(0x27d)](_0x56435a)){const _0x41a083=parseSegmentRef(_0x56435a);if(_0x41a083['type']===_0x3cf6fa(0x1ca))_0x276275?.[_0x3cf6fa(0x206)]&&(_0x56435a=await _0x276275[_0x3cf6fa(0x206)](_0x41a083['name']));else{if(_0x41a083[_0x3cf6fa(0x20f)]===_0x3cf6fa(0x216)&&_0x392985[_0x41a083[_0x3cf6fa(0x26c)]])_0x276275?.[_0x3cf6fa(0x275)]&&(_0x56435a=await _0x276275[_0x3cf6fa(0x275)](_0x41a083[_0x3cf6fa(0x26c)],_0x392985[_0x41a083[_0x3cf6fa(0x26c)]]));else _0x276275?.[_0x3cf6fa(0x206)]&&(_0x56435a=await _0x276275['resolveSegmentId'](_0x41a083[_0x3cf6fa(0x26c)]));}}const _0x13d958={'name':_0x517d7c[_0x3cf6fa(0x26c)],'segmentId':_0x56435a};_0x517d7c['description']&&(_0x13d958['description']=_0x517d7c[_0x3cf6fa(0x247)]);if(_0x517d7c['target']){const _0xacdabe=_0x517d7c[_0x3cf6fa(0x269)][_0x3cf6fa(0x279)],_0xc336ea=_0x517d7c[_0x3cf6fa(0x269)][_0x3cf6fa(0x1e0)];let _0x2f1b30=_0x517d7c[_0x3cf6fa(0x269)][_0x3cf6fa(0x279)];_0x276275?.[_0x3cf6fa(0x1ee)]&&!/^\d+$/[_0x3cf6fa(0x27d)](_0x2f1b30)&&(_0x2f1b30=await _0x276275[_0x3cf6fa(0x1ee)](_0x2f1b30));let _0x127d40=_0x517d7c[_0x3cf6fa(0x269)][_0x3cf6fa(0x1e0)];_0x276275?.['resolveStageId']&&!/^\d+$/[_0x3cf6fa(0x27d)](_0x127d40)&&(_0x127d40=await _0x276275['resolveStageId'](_0x2f1b30,_0x127d40));const _0x8bed0b=!/^\d+$/[_0x3cf6fa(0x27d)](_0xacdabe)&&!isLocalJourneyRef(_0xacdabe)?formatApiJourneyName(_0xacdabe,_0xc336ea):undefined;_0x13d958[_0x3cf6fa(0x269)]={'journeyId':_0x2f1b30,'journeyStageId':_0x127d40,'journeyName':_0x8bed0b,'confirmed':!![]},_0x517d7c[_0x3cf6fa(0x269)][_0x3cf6fa(0x1d6)]&&(_0x13d958[_0x3cf6fa(0x269)][_0x3cf6fa(0x20a)]=_0x517d7c[_0x3cf6fa(0x269)][_0x3cf6fa(0x1d6)]);}return _0x13d958;}async function convertYamlStepToApi(_0x491c81,_0x905866,_0x2904f1={},_0x2ce7d2={},_0x7c19f2={}){const _0x341ca4=a109_0x57df,_0x489015=async _0x1f1b73=>{const _0x2d19ee=a109_0x57df;if(/^\d+$/['test'](_0x1f1b73))return _0x1f1b73;const _0x4ab598=parseSegmentRef(_0x1f1b73);if(_0x4ab598[_0x2d19ee(0x20f)]===_0x2d19ee(0x1ca)){if(_0x905866?.['resolveSegmentId'])return await _0x905866['resolveSegmentId'](_0x4ab598[_0x2d19ee(0x26c)]);}else{if(_0x4ab598[_0x2d19ee(0x20f)]===_0x2d19ee(0x216)&&_0x2904f1[_0x4ab598[_0x2d19ee(0x26c)]]){if(_0x905866?.[_0x2d19ee(0x275)])return await _0x905866[_0x2d19ee(0x275)](_0x4ab598[_0x2d19ee(0x26c)],_0x2904f1[_0x4ab598[_0x2d19ee(0x26c)]]);}else{if(_0x905866?.['resolveSegmentId'])return await _0x905866['resolveSegmentId'](_0x4ab598[_0x2d19ee(0x26c)]);}}return _0x1f1b73;},_0x3c03af=async _0x2f0f3f=>{const _0x1c1bfd=a109_0x57df;if(/^\d+$/[_0x1c1bfd(0x27d)](_0x2f0f3f))return _0x2f0f3f;const _0x32fdf7=parseSegmentRef(_0x2f0f3f);if(_0x32fdf7[_0x1c1bfd(0x20f)]===_0x1c1bfd(0x1ca)){if(_0x905866?.[_0x1c1bfd(0x20b)])return await _0x905866[_0x1c1bfd(0x20b)](_0x32fdf7['name']);return _0x32fdf7[_0x1c1bfd(0x26c)];}else{if(_0x32fdf7[_0x1c1bfd(0x20f)]===_0x1c1bfd(0x216)&&_0x7c19f2[_0x32fdf7[_0x1c1bfd(0x26c)]]){if(_0x905866?.[_0x1c1bfd(0x221)])return await _0x905866[_0x1c1bfd(0x221)](_0x32fdf7['name'],_0x7c19f2[_0x32fdf7[_0x1c1bfd(0x26c)]]);if(_0x905866?.[_0x1c1bfd(0x20b)])return await _0x905866[_0x1c1bfd(0x20b)](_0x32fdf7[_0x1c1bfd(0x26c)]);}else{if(_0x905866?.[_0x1c1bfd(0x20b)])return await _0x905866['resolveActivationId'](_0x32fdf7[_0x1c1bfd(0x26c)]);}}return _0x2f0f3f;},_0x22724f=_0x1917c7=>{const _0x4f90ab=a109_0x57df;if(!_0x1917c7)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x4f90ab(0x27d)](_0x1917c7))return _0x1917c7;return _0x2ce7d2[_0x1917c7]||_0x1917c7;};switch(_0x491c81['type']){case _0x341ca4(0x1d8):{const _0xc34fbf=_0x491c81,_0x4106ec=_0xc34fbf[_0x341ca4(0x21b)],_0x243d25={'type':'WaitStep','name':_0xc34fbf[_0x341ca4(0x26c)],'next':_0x22724f(_0xc34fbf['next'])};if(_0x4106ec[_0x341ca4(0x24c)]!==undefined&&_0x4106ec['unit'])_0x243d25[_0x341ca4(0x1cf)]=_0x341ca4(0x202),_0x243d25[_0x341ca4(0x256)]=_0x4106ec['duration'],_0x243d25[_0x341ca4(0x219)]=normalizeWaitUnit(_0x4106ec[_0x341ca4(0x1d9)]);else{if(_0x4106ec[_0x341ca4(0x214)])_0x243d25[_0x341ca4(0x1cf)]='Date',_0x243d25[_0x341ca4(0x234)]=_0x4106ec[_0x341ca4(0x214)];else{if(_0x4106ec[_0x341ca4(0x26b)])_0x243d25[_0x341ca4(0x1cf)]=_0x341ca4(0x270),_0x243d25[_0x341ca4(0x25f)]=_0x4106ec[_0x341ca4(0x26b)];else{if(_0x4106ec[_0x341ca4(0x1db)]){_0x243d25[_0x341ca4(0x1cf)]=_0x341ca4(0x1d0);const _0x477f07=await _0x489015(_0x4106ec[_0x341ca4(0x1db)][_0x341ca4(0x27c)]),_0x5bf0df=_0x4106ec['condition']['timeout']?.[_0x341ca4(0x1f8)]!==undefined;if(_0x5bf0df){const _0x3dc59b=[];_0x3dc59b[_0x341ca4(0x209)]({'id':generateUUID(),'segmentId':_0x477f07,'timedOutPath':![],'name':_0x341ca4(0x242),'next':_0x22724f(_0x4106ec['condition'][_0x341ca4(0x1f8)]??_0xc34fbf[_0x341ca4(0x1f8)])});if(_0x4106ec[_0x341ca4(0x1db)][_0x341ca4(0x278)]){const _0x1b5d4b=_0x4106ec['condition']['timeout'][_0x341ca4(0x24c)],_0x2f9940=normalizeWaitUnit(_0x4106ec[_0x341ca4(0x1db)][_0x341ca4(0x278)][_0x341ca4(0x1d9)]);_0x3dc59b[_0x341ca4(0x209)]({'id':generateUUID(),'timedOutPath':!![],'name':'*Max\x20wait\x20'+_0x1b5d4b+'\x20'+_0x2f9940,'moveAfter':_0x1b5d4b,'unit':_0x2f9940,'next':_0x22724f(_0x4106ec[_0x341ca4(0x1db)][_0x341ca4(0x278)][_0x341ca4(0x1f8)])});}_0x243d25['conditions']=_0x3dc59b,delete _0x243d25[_0x341ca4(0x1f8)];}else _0x243d25['conditionSegmentId']=_0x477f07,_0x4106ec[_0x341ca4(0x1db)]['timeout']&&(_0x243d25[_0x341ca4(0x26a)]=_0x4106ec[_0x341ca4(0x1db)]['timeout']['duration'],_0x4106ec[_0x341ca4(0x1db)][_0x341ca4(0x278)]['unit']&&(_0x243d25[_0x341ca4(0x1e5)]=normalizeWaitUnit(_0x4106ec[_0x341ca4(0x1db)][_0x341ca4(0x278)][_0x341ca4(0x1d9)])));}}}}return _0x243d25;}case'activation':{const _0x1d0a78=_0x491c81,_0x40d48f=_0x1d0a78[_0x341ca4(0x21b)][_0x341ca4(0x289)],_0x3bc2bb=await _0x3c03af(_0x40d48f);return{'type':_0x341ca4(0x253),'name':_0x1d0a78[_0x341ca4(0x26c)],'journeyActivationStepId':_0x3bc2bb,'next':_0x22724f(_0x1d0a78[_0x341ca4(0x1f8)])};}case _0x341ca4(0x274):{const _0x1ace1a=_0x491c81,_0x47ad5f=_0x1ace1a[_0x341ca4(0x21b)]['branches'];return{'type':_0x341ca4(0x21c),'name':_0x1ace1a[_0x341ca4(0x26c)],'branches':await Promise['all'](_0x47ad5f[_0x341ca4(0x211)](async _0x5721ef=>{const _0x1ddae3=_0x341ca4;let _0x3fbb77='';if(!_0x5721ef[_0x1ddae3(0x294)]){const _0x3e501c=_0x5721ef['segment']||_0x5721ef[_0x1ddae3(0x25d)]||'';_0x3fbb77=_0x3e501c?await _0x489015(_0x3e501c):'';}return{'id':crypto[_0x1ddae3(0x240)](),'name':_0x5721ef[_0x1ddae3(0x26c)],'description':null,'segmentId':_0x3fbb77,'excludedPath':_0x5721ef[_0x1ddae3(0x294)]??![],'next':_0x22724f(_0x5721ef[_0x1ddae3(0x1f8)])};})),'next':_0x22724f(_0x1ace1a[_0x341ca4(0x1f8)])};}case _0x341ca4(0x231):{const _0x28e583=_0x491c81,_0x1471e7=_0x28e583[_0x341ca4(0x21b)];return{'type':_0x341ca4(0x249),'name':_0x28e583['name'],'customizedSplit':_0x1471e7['customized_split'],'uniqueId':_0x1471e7[_0x341ca4(0x284)],'variants':_0x1471e7['variants'][_0x341ca4(0x211)](_0x5a79d1=>({'id':_0x5a79d1['id']||generateUUID(),'name':_0x5a79d1['name'],'percentage':_0x5a79d1[_0x341ca4(0x22f)],'next':_0x22724f(_0x5a79d1[_0x341ca4(0x1f8)])})),'next':_0x22724f(_0x28e583[_0x341ca4(0x1f8)])};}case _0x341ca4(0x23d):return{'type':'Merge','name':_0x491c81[_0x341ca4(0x26c)],'next':_0x22724f(_0x491c81['next'])};case _0x341ca4(0x1e9):{const _0x562543=_0x491c81,_0xd8e0b9=_0x562543[_0x341ca4(0x21b)][_0x341ca4(0x269)],_0x1867ea=_0xd8e0b9[_0x341ca4(0x279)],_0x280bce=_0xd8e0b9[_0x341ca4(0x1e0)];let _0x245808=_0xd8e0b9[_0x341ca4(0x279)];_0x905866?.['resolveJourneyId']&&!/^\d+$/['test'](_0x245808)&&(_0x245808=await _0x905866[_0x341ca4(0x1ee)](_0x245808));let _0x3810ab=_0xd8e0b9[_0x341ca4(0x1e0)];_0x905866?.['resolveStageId']&&!/^\d+$/[_0x341ca4(0x27d)](_0x3810ab)&&(_0x3810ab=await _0x905866['resolveStageId'](_0x245808,_0x3810ab));const _0x1e926e=!/^\d+$/[_0x341ca4(0x27d)](_0x1867ea)&&!isLocalJourneyRef(_0x1867ea)?formatApiJourneyName(_0x1867ea,_0x280bce):undefined;return{'type':'Jump','name':_0x562543['name'],'target':{'journeyId':_0x245808,'journeyStageId':_0x3810ab,'journeyBundleId':_0xd8e0b9[_0x341ca4(0x1d6)],'journeyName':_0x1e926e,'confirmed':!![]},'next':_0x22724f(_0x562543[_0x341ca4(0x1f8)])};}case _0x341ca4(0x228):return{'type':_0x341ca4(0x23c),'name':_0x491c81['name']};default:{const _0xea2176=_0x491c81;return{'type':_0x341ca4(0x23c),'name':_0xea2176[_0x341ca4(0x26c)]};}}}export function toYamlString(_0x437b03){const _0x4f4b3d=a109_0x57df,_0x106d9f=stripInternalFields(_0x437b03),_0x35a906=a109_0x2ecc46['stringify'](_0x106d9f,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x1806ac=[_0x4f4b3d(0x1ec),_0x4f4b3d(0x1f6),'goal:',_0x4f4b3d(0x28e),_0x4f4b3d(0x27a),'stages:','versions:'];let _0x531652=_0x35a906;for(const _0x280c13 of _0x1806ac){_0x531652=_0x531652['replace'](new RegExp('^('+_0x280c13+')','m'),(_0x2716c9,_0xe5f9a8,_0xba73c4)=>{if(_0xba73c4===0x0||_0x531652[_0xba73c4-0x1]==='\x0a'&&_0x531652[_0xba73c4-0x2]==='\x0a')return _0xe5f9a8;return'\x0a'+_0xe5f9a8;});}return _0x531652;}function stripInternalFields(_0x34d855){const _0x35536c=a109_0x57df,{id:_0x3b8e4b,folder_id:_0x38dc84,bundle_id:_0x5b6aeb,bundle_name:_0x164118,version:_0x3f49b9,version_number:_0x3693a4,allow_reentry:_0x591d57,..._0x455516}=_0x34d855;return _0x455516['journeys']&&(_0x455516['journeys']=_0x455516[_0x35536c(0x1cc)][_0x35536c(0x211)](_0x44cd9a=>{const _0x32051a=_0x35536c,{id:_0x2396cc,version_number:_0x517fee,..._0x49cafd}=_0x44cd9a;return{..._0x49cafd,'stages':_0x49cafd[_0x32051a(0x25b)]['map'](stripStageInternalFields),..._0x44cd9a[_0x32051a(0x259)]===!![]?{'latest':!![]}:{},..._0x455516['journeys'][_0x32051a(0x1dc)]===0x1&&_0x49cafd[_0x32051a(0x21e)]==='v1'?{'version':undefined}:{}};})),_0x455516[_0x35536c(0x25b)]&&(_0x455516['stages']=_0x455516[_0x35536c(0x25b)][_0x35536c(0x211)](stripStageInternalFields)),_0x455516[_0x35536c(0x241)]&&(_0x455516[_0x35536c(0x241)]=_0x455516[_0x35536c(0x241)][_0x35536c(0x211)](_0x3e6ca1=>{const _0x70e799=_0x35536c,{id:_0x3aeff7,version_number:_0x528f01,..._0x5edafa}=_0x3e6ca1;return{..._0x5edafa,'stages':_0x5edafa[_0x70e799(0x25b)][_0x70e799(0x211)](stripStageInternalFields),..._0x3e6ca1[_0x70e799(0x259)]===!![]?{'latest':!![]}:{}};})),_0x455516;}function stripStageInternalFields(_0x1d2a02){const {id:_0x1e1380,..._0x455954}=_0x1d2a02;return _0x455954;}export function parseYamlString(_0x5a4636){const _0x114ac2=a109_0x57df,_0xe5453b=a109_0x2ecc46[_0x114ac2(0x285)](_0x5a4636);if(_0xe5453b[_0x114ac2(0x20f)]!==_0x114ac2(0x279))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x114ac2(0x257));if(!_0xe5453b[_0x114ac2(0x26c)])throw new SDKError(ErrorCode[_0x114ac2(0x1f5)],'Journey\x20YAML\x20missing\x20required\x20field:\x20name');const _0x3d34ff=_0xe5453b[_0x114ac2(0x1cc)]&&Array[_0x114ac2(0x212)](_0xe5453b[_0x114ac2(0x1cc)])&&_0xe5453b[_0x114ac2(0x1cc)][_0x114ac2(0x1dc)]>0x0,_0x4bf258=_0xe5453b[_0x114ac2(0x25b)]&&Array[_0x114ac2(0x212)](_0xe5453b['stages'])&&_0xe5453b[_0x114ac2(0x25b)][_0x114ac2(0x1dc)]>0x0,_0x4973d=_0xe5453b[_0x114ac2(0x241)]&&Array[_0x114ac2(0x212)](_0xe5453b[_0x114ac2(0x241)])&&_0xe5453b[_0x114ac2(0x241)][_0x114ac2(0x1dc)]>0x0,_0x328749=[_0x3d34ff,_0x4bf258,_0x4973d][_0x114ac2(0x1de)](Boolean)['length'];if(_0x328749>0x1)throw new SDKError(ErrorCode[_0x114ac2(0x1f5)],'Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.');if(_0x328749===0x0)throw new SDKError(ErrorCode[_0x114ac2(0x1f5)],'Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)');if(_0x3d34ff){for(let _0x3dc1a1=0x0;_0x3dc1a1<_0xe5453b[_0x114ac2(0x1cc)][_0x114ac2(0x1dc)];_0x3dc1a1++){const _0x131d03=_0xe5453b['journeys'][_0x3dc1a1];if(!_0x131d03[_0x114ac2(0x25b)]||!Array['isArray'](_0x131d03['stages'])||_0x131d03['stages'][_0x114ac2(0x1dc)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x114ac2(0x1cd)+_0x3dc1a1+_0x114ac2(0x260));if(_0x131d03['state']&&![_0x114ac2(0x236),_0x114ac2(0x266)][_0x114ac2(0x203)](_0x131d03[_0x114ac2(0x1ef)]))throw new SDKError(ErrorCode[_0x114ac2(0x1f5)],_0x114ac2(0x1cd)+_0x3dc1a1+_0x114ac2(0x22b)+_0x131d03[_0x114ac2(0x1ef)]+_0x114ac2(0x21f));validateStages(_0x131d03[_0x114ac2(0x25b)],_0x114ac2(0x23e)+_0x3dc1a1+_0x114ac2(0x25c));}const _0x296189=_0xe5453b[_0x114ac2(0x1cc)]['filter'](_0x3cda9c=>_0x3cda9c[_0x114ac2(0x259)]===!![])['length'];if(_0x296189>0x1)throw new SDKError(ErrorCode[_0x114ac2(0x1f5)],'Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true');}_0x4bf258&&validateStages(_0xe5453b[_0x114ac2(0x25b)],'stages');if(_0x4973d){for(let _0x263902=0x0;_0x263902<_0xe5453b['versions'][_0x114ac2(0x1dc)];_0x263902++){const _0x252839=_0xe5453b[_0x114ac2(0x241)][_0x263902];if(!_0x252839[_0x114ac2(0x26c)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20versions['+_0x263902+_0x114ac2(0x243));if(!_0x252839[_0x114ac2(0x1ef)]||![_0x114ac2(0x236),_0x114ac2(0x266)][_0x114ac2(0x203)](_0x252839[_0x114ac2(0x1ef)]))throw new SDKError(ErrorCode[_0x114ac2(0x1f5)],'Journey\x20YAML\x20versions['+_0x263902+_0x114ac2(0x22b)+_0x252839[_0x114ac2(0x1ef)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');if(!_0x252839[_0x114ac2(0x25b)]||!Array[_0x114ac2(0x212)](_0x252839['stages'])||_0x252839[_0x114ac2(0x25b)][_0x114ac2(0x1dc)]===0x0)throw new SDKError(ErrorCode[_0x114ac2(0x1f5)],_0x114ac2(0x1fa)+_0x263902+']\x20missing\x20required\x20field:\x20stages');validateStages(_0x252839[_0x114ac2(0x25b)],'versions['+_0x263902+_0x114ac2(0x25c));}const _0x2f3c17=_0xe5453b[_0x114ac2(0x241)][_0x114ac2(0x1de)](_0x36197c=>_0x36197c[_0x114ac2(0x259)]===!![])[_0x114ac2(0x1dc)];if(_0x2f3c17>0x1)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x114ac2(0x291));}return _0xe5453b;}function validateStages(_0x5eb0db,_0xbdc2b2){const _0x56e169=a109_0x57df;if(_0x5eb0db[_0x56e169(0x1dc)]>0x8)throw new SDKError(ErrorCode[_0x56e169(0x1f5)],_0x56e169(0x237)+_0xbdc2b2+_0x56e169(0x293));}export function isJourneyDef(_0x1a19b4){const _0x3f96ce=a109_0x57df;return typeof _0x1a19b4===_0x3f96ce(0x1d7)&&_0x1a19b4!==null&&_0x3f96ce(0x20f)in _0x1a19b4&&_0x1a19b4[_0x3f96ce(0x20f)]==='journey';}export function generateTemplate(_0x4d31b2,_0x1a85ce){const _0x39a1ae=a109_0x57df,_0x50af0e={'type':'journey','name':_0x4d31b2,'description':_0x39a1ae(0x1e6),'reentry':_0x39a1ae(0x1e8),'goal':{'name':'Goal\x20Achieved','segment':'goal-segment'},'stages':[{'name':_0x39a1ae(0x210),'description':_0x39a1ae(0x28f),'entry_criteria':{'name':_0x39a1ae(0x27e),'segment':_0x1a85ce},'steps':[{'type':_0x39a1ae(0x1d8),'name':_0x39a1ae(0x245),'with':{'duration':0x1,'unit':_0x39a1ae(0x28d)}},{'type':_0x39a1ae(0x289),'name':_0x39a1ae(0x251),'with':{'activation':_0x39a1ae(0x220)}},{'type':_0x39a1ae(0x228),'name':_0x39a1ae(0x27f)}]}]};return toYamlString(_0x50af0e);}function generateUUID(){const _0x2adc3d=a109_0x57df;return crypto[_0x2adc3d(0x240)]();}export const SEGMENT_REF_PREFIX=a109_0x104d50(0x25e);export function parseSegmentRef(_0x558b1d){const _0x4bfd8f=a109_0x104d50;if(_0x558b1d[_0x4bfd8f(0x1e4)](SEGMENT_REF_PREFIX))return{'type':_0x4bfd8f(0x1ca),'name':_0x558b1d[_0x4bfd8f(0x222)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x4bfd8f(0x27d)](_0x558b1d))return{'type':'id','name':_0x558b1d};return{'type':_0x4bfd8f(0x216),'name':_0x558b1d};}export function makeSegmentRef(_0x1e4cee){return''+SEGMENT_REF_PREFIX+_0x1e4cee;}export function isExternalSegmentRef(_0x520a0f){const _0x4d526c=a109_0x104d50;return _0x520a0f[_0x4d526c(0x1e4)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x507655){const _0x33a0ca=a109_0x104d50;return!!(_0x507655['journeys']&&_0x507655[_0x33a0ca(0x1cc)][_0x33a0ca(0x1dc)]>0x0);}export function isMultiVersionMode(_0x200cfe){const _0x33aef1=a109_0x104d50;return!!(_0x200cfe[_0x33aef1(0x241)]&&_0x200cfe[_0x33aef1(0x241)][_0x33aef1(0x1dc)]>0x0);}export function isSingleVersionMode(_0x2a1461){const _0x773882=a109_0x104d50;return!!(_0x2a1461[_0x773882(0x25b)]&&_0x2a1461[_0x773882(0x25b)][_0x773882(0x1dc)]>0x0);}export function hasMultipleVersions(_0x2a319b){const _0x88ea92=a109_0x104d50;if(isJourneysArrayMode(_0x2a319b))return(_0x2a319b[_0x88ea92(0x1cc)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x2a319b))return(_0x2a319b['versions']?.[_0x88ea92(0x1dc)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x1368a1){const _0x3cc652=a109_0x104d50;if(isJourneysArrayMode(_0x1368a1))return _0x1368a1;if(isSingleVersionMode(_0x1368a1)){const {stages:_0x325a73,id:_0x9368d5,version:_0x15ea17,version_number:_0x468741,..._0x3f4b97}=_0x1368a1;return{..._0x3f4b97,'journeys':[{'version':_0x15ea17||'v1','stages':_0x325a73||[],'id':_0x9368d5,'version_number':_0x468741}]};}if(isMultiVersionMode(_0x1368a1)){const {versions:_0x2ff3a9,..._0x477aa5}=_0x1368a1;return{..._0x477aa5,'journeys':(_0x2ff3a9||[])[_0x3cc652(0x211)](_0x1a185f=>({'version':_0x1a185f[_0x3cc652(0x26c)],'state':_0x1a185f[_0x3cc652(0x1ef)],'latest':_0x1a185f[_0x3cc652(0x259)],'stages':_0x1a185f[_0x3cc652(0x25b)],'id':_0x1a185f['id'],'version_number':_0x1a185f[_0x3cc652(0x1e3)]}))};}return _0x1368a1;}export function normalizeJourneyDef(_0xd0a5a8,_0x5bde9b){const _0x3740c3=a109_0x104d50,_0xcce014=normalizeToJourneysFormat(_0xd0a5a8),_0x36d383=_0x5bde9b?.['segments']?Object[_0x3740c3(0x281)](_0x5bde9b['segments']):undefined,_0x53f758=_0x5bde9b?.[_0x3740c3(0x1d5)]?Object['keys'](_0x5bde9b['activations']):undefined;return{'type':_0x3740c3(0x279),'name':_0xcce014[_0x3740c3(0x26c)],..._0xcce014['description']!==undefined&&{'description':_0xcce014[_0x3740c3(0x247)]},..._0xcce014[_0x3740c3(0x1ed)]&&{'goal':normalizeJourneyCriteria(_0xcce014['goal'])},..._0xcce014[_0x3740c3(0x264)]!==undefined&&{'reentry':_0xcce014['reentry']},..._0xcce014['segments']&&{'segments':normalizeEmbeddedSegments(_0xcce014[_0x3740c3(0x271)],_0x36d383)},..._0xcce014[_0x3740c3(0x1d5)]&&{'activations':normalizeEmbeddedActivations(_0xcce014[_0x3740c3(0x1d5)],_0x53f758)},..._0xcce014[_0x3740c3(0x1cc)]&&{'journeys':_0xcce014['journeys']['map'](_0x263fc4=>normalizeJourneyEntry(_0x263fc4,_0xcce014[_0x3740c3(0x1cc)][_0x3740c3(0x1dc)]===0x1))}};}function normalizeJourneyEntry(_0x36f9d8,_0x28f4da){const _0x485c6f=a109_0x104d50;return{...!_0x28f4da&&_0x36f9d8[_0x485c6f(0x21e)]!==undefined&&{'version':_0x36f9d8[_0x485c6f(0x21e)]},..._0x36f9d8[_0x485c6f(0x1ef)]!==undefined&&{'state':_0x36f9d8[_0x485c6f(0x1ef)]},...!_0x28f4da&&_0x36f9d8[_0x485c6f(0x259)]!==undefined&&{'latest':_0x36f9d8[_0x485c6f(0x259)]},..._0x36f9d8[_0x485c6f(0x1ed)]&&{'goal':normalizeJourneyCriteria(_0x36f9d8[_0x485c6f(0x1ed)])},..._0x36f9d8['reentry']!==undefined&&{'reentry':_0x36f9d8[_0x485c6f(0x264)]},'stages':_0x36f9d8[_0x485c6f(0x25b)][_0x485c6f(0x211)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x1377a1){const _0x411aa1=a109_0x104d50;return{'name':_0x1377a1['name'],..._0x1377a1[_0x411aa1(0x247)]!==undefined&&{'description':_0x1377a1[_0x411aa1(0x247)]},..._0x1377a1['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0x1377a1[_0x411aa1(0x207)])},..._0x1377a1[_0x411aa1(0x1f4)]&&{'exit_criteria':_0x1377a1[_0x411aa1(0x1f4)][_0x411aa1(0x211)](normalizeJourneyCriteria)},..._0x1377a1[_0x411aa1(0x26f)]&&{'milestone':normalizeJourneyCriteria(_0x1377a1[_0x411aa1(0x26f)])},..._0x1377a1[_0x411aa1(0x223)]&&{'steps':normalizeStepsWithImplicitNext(_0x1377a1['steps'])}};}function normalizeStepsWithImplicitNext(_0x2fae4f){const _0x2272fe=a109_0x104d50;return _0x2fae4f[_0x2272fe(0x211)]((_0x434ce4,_0x3f9bde)=>{const _0x2550f5=_0x2272fe,_0x223b0f=_0x3f9bde<_0x2fae4f[_0x2550f5(0x1dc)]-0x1?_0x2fae4f[_0x3f9bde+0x1][_0x2550f5(0x26c)]:undefined;return normalizeJourneyStep(_0x434ce4,_0x223b0f);});}function normalizeJourneyCriteria(_0x38d2e6){const _0x33cbab=a109_0x104d50;return{'name':_0x38d2e6[_0x33cbab(0x26c)],..._0x38d2e6[_0x33cbab(0x247)]!==undefined&&{'description':_0x38d2e6[_0x33cbab(0x247)]},'segment':_0x38d2e6[_0x33cbab(0x27c)],..._0x38d2e6[_0x33cbab(0x269)]&&{'target':normalizeJumpTarget(_0x38d2e6[_0x33cbab(0x269)])}};}function normalizeJourneyStep(_0x27553c,_0x5a993f){const _0x51e05f=a109_0x104d50,_0x4c419c=_0x27553c[_0x51e05f(0x1f8)]!==undefined&&_0x27553c[_0x51e05f(0x1f8)]!==_0x5a993f,_0x4eb610={'type':_0x27553c['type'],'name':_0x27553c[_0x51e05f(0x26c)],..._0x4c419c&&{'next':_0x27553c[_0x51e05f(0x1f8)]}};if(_0x51e05f(0x21b)in _0x27553c&&_0x27553c[_0x51e05f(0x21b)])return{..._0x4eb610,'with':normalizeStepParams(_0x27553c[_0x51e05f(0x20f)],_0x27553c[_0x51e05f(0x21b)])};return _0x4eb610;}function normalizeStepParams(_0x518674,_0x184edf){const _0x41cd01=a109_0x104d50;switch(_0x518674){case _0x41cd01(0x1d8):{const _0x54dc08=_0x184edf;let _0x3bd305;return _0x54dc08[_0x41cd01(0x1db)]&&(_0x3bd305={'segment':_0x54dc08[_0x41cd01(0x1db)][_0x41cd01(0x27c)],..._0x54dc08[_0x41cd01(0x1db)][_0x41cd01(0x1f8)]!==undefined&&{'next':_0x54dc08[_0x41cd01(0x1db)]['next']},..._0x54dc08['condition'][_0x41cd01(0x278)]&&{'timeout':{'duration':_0x54dc08[_0x41cd01(0x1db)][_0x41cd01(0x278)][_0x41cd01(0x24c)],'unit':_0x54dc08[_0x41cd01(0x1db)][_0x41cd01(0x278)][_0x41cd01(0x1d9)],..._0x54dc08[_0x41cd01(0x1db)][_0x41cd01(0x278)][_0x41cd01(0x1f8)]!==undefined&&{'next':_0x54dc08[_0x41cd01(0x1db)][_0x41cd01(0x278)]['next']}}}}),{..._0x54dc08[_0x41cd01(0x24c)]!==undefined&&{'duration':_0x54dc08[_0x41cd01(0x24c)]},..._0x54dc08[_0x41cd01(0x1d9)]!==undefined&&{'unit':_0x54dc08['unit']},..._0x54dc08[_0x41cd01(0x214)]!==undefined&&{'wait_until':_0x54dc08['wait_until']},..._0x54dc08[_0x41cd01(0x26b)]!==undefined&&{'days_of_week':_0x54dc08['days_of_week']},..._0x3bd305&&{'condition':_0x3bd305}};}case _0x41cd01(0x289):{const _0x5f5313=_0x184edf;return{'activation':_0x5f5313[_0x41cd01(0x289)]};}case _0x41cd01(0x274):{const _0x54133b=_0x184edf;return{'branches':_0x54133b[_0x41cd01(0x23b)][_0x41cd01(0x211)](normalizeDecisionBranch)};}case'ab_test':{const _0x50a15e=_0x184edf;return{..._0x50a15e[_0x41cd01(0x215)]!==undefined&&{'customized_split':_0x50a15e['customized_split']},..._0x50a15e[_0x41cd01(0x284)]!==undefined&&{'unique_id':_0x50a15e[_0x41cd01(0x284)]},'variants':_0x50a15e[_0x41cd01(0x24e)][_0x41cd01(0x211)](normalizeAbTestVariant)};}case _0x41cd01(0x1e9):{const _0x10a35b=_0x184edf;return{'target':normalizeJumpTarget(_0x10a35b[_0x41cd01(0x269)])};}default:return _0x184edf;}}function normalizeDecisionBranch(_0x396453){const _0x1867f7=a109_0x104d50;return{'name':_0x396453['name'],..._0x396453[_0x1867f7(0x27c)]!==undefined&&{'segment':_0x396453[_0x1867f7(0x27c)]},..._0x396453['excluded']!==undefined&&{'excluded':_0x396453[_0x1867f7(0x294)]},..._0x396453['next']!==undefined&&{'next':_0x396453['next']}};}function normalizeAbTestVariant(_0x476f7d){const _0x170a2c=a109_0x104d50;return{..._0x476f7d['id']!==undefined&&{'id':_0x476f7d['id']},'name':_0x476f7d['name'],'percentage':_0x476f7d[_0x170a2c(0x22f)],..._0x476f7d[_0x170a2c(0x1f8)]!==undefined&&{'next':_0x476f7d[_0x170a2c(0x1f8)]}};}function normalizeJumpTarget(_0x388288){const _0x54f4e1=a109_0x104d50;return{'journey':_0x388288[_0x54f4e1(0x279)],'stage':_0x388288[_0x54f4e1(0x1e0)],..._0x388288[_0x54f4e1(0x1d6)]!==undefined&&{'bundle_id':_0x388288[_0x54f4e1(0x1d6)]}};}function normalizeEmbeddedSegments(_0x264580,_0x15fc30){const _0x3300cf=a109_0x104d50,_0x4a3521={},_0x379319=Object[_0x3300cf(0x281)](_0x264580),_0x16fd9d=_0x15fc30?[..._0x15fc30[_0x3300cf(0x1de)](_0x441731=>_0x379319[_0x3300cf(0x203)](_0x441731)),..._0x379319[_0x3300cf(0x1de)](_0x45e385=>!_0x15fc30['includes'](_0x45e385))[_0x3300cf(0x22c)]()]:_0x379319[_0x3300cf(0x22c)]();for(const _0x54f6ea of _0x16fd9d){const _0x5a6d60=_0x264580[_0x54f6ea];if(_0x5a6d60[_0x3300cf(0x1ce)]){const _0x2f92c8=_0x5a6d60[_0x3300cf(0x1ce)];if(_0x2f92c8[_0x3300cf(0x20f)]!=='And'&&_0x2f92c8[_0x3300cf(0x20f)]!=='Or'){const _0x1c4b44=_0x2f92c8['type']??'(missing)';throw new SDKError(ErrorCode[_0x3300cf(0x1f5)],_0x3300cf(0x252)+_0x54f6ea+_0x3300cf(0x1fc)+('rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27'+_0x1c4b44+_0x3300cf(0x1e1))+'Expected\x20format:\x0a'+'\x20\x20rule:\x0a'+'\x20\x20\x20\x20type:\x20And\x0a'+_0x3300cf(0x239)+_0x3300cf(0x24a)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x3300cf(0x288));}if(!_0x2f92c8[_0x3300cf(0x24b)]||!Array[_0x3300cf(0x212)](_0x2f92c8[_0x3300cf(0x24b)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x3300cf(0x252)+_0x54f6ea+_0x3300cf(0x1fc)+_0x3300cf(0x232)+_0x3300cf(0x1eb)+_0x3300cf(0x1d3)+(_0x3300cf(0x27b)+_0x2f92c8[_0x3300cf(0x20f)]+'\x0a')+_0x3300cf(0x239)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x3300cf(0x258)+_0x3300cf(0x288));}_0x4a3521[_0x54f6ea]={..._0x5a6d60[_0x3300cf(0x247)]&&_0x5a6d60['description']['trim']()&&{'description':_0x5a6d60[_0x3300cf(0x247)]},..._0x5a6d60[_0x3300cf(0x1ce)]&&{'rule':deepSortObject(_0x5a6d60['rule'])}};}return _0x4a3521;}function normalizeEmbeddedActivations(_0x47086a,_0x246cc2){const _0x26a40f=a109_0x104d50,_0x50a350={},_0x5b0f34=Object[_0x26a40f(0x281)](_0x47086a),_0x100306=_0x246cc2?[..._0x246cc2[_0x26a40f(0x1de)](_0x26e1fa=>_0x5b0f34[_0x26a40f(0x203)](_0x26e1fa)),..._0x5b0f34[_0x26a40f(0x1de)](_0x5f4ce6=>!_0x246cc2[_0x26a40f(0x203)](_0x5f4ce6))[_0x26a40f(0x22c)]()]:_0x5b0f34[_0x26a40f(0x22c)]();for(const _0x1d1f7f of _0x100306){const _0x19731d=_0x47086a[_0x1d1f7f];_0x50a350[_0x1d1f7f]={'name':_0x19731d[_0x26a40f(0x26c)],'connection':_0x19731d[_0x26a40f(0x23f)],..._0x19731d[_0x26a40f(0x247)]!==undefined&&{'description':_0x19731d[_0x26a40f(0x247)]},..._0x19731d[_0x26a40f(0x272)]!==undefined&&{'all_columns':_0x19731d[_0x26a40f(0x272)]},..._0x19731d[_0x26a40f(0x283)]!==undefined&&{'columns':_0x19731d[_0x26a40f(0x283)]},..._0x19731d[_0x26a40f(0x280)]!==undefined&&{'behavior':_0x19731d[_0x26a40f(0x280)]},..._0x19731d['schedule']!==undefined&&{'schedule':_0x19731d['schedule']},..._0x19731d[_0x26a40f(0x230)]!==undefined&&{'notification':_0x19731d[_0x26a40f(0x230)]},..._0x19731d[_0x26a40f(0x1e7)]!==undefined&&{'connector_config':_0x19731d[_0x26a40f(0x1e7)]},..._0x19731d[_0x26a40f(0x261)]!==undefined&&{'activation_template_id':_0x19731d[_0x26a40f(0x261)]}};}return _0x50a350;}export function getActiveStages(_0x50cc53){const _0x409928=a109_0x104d50;if(isJourneysArrayMode(_0x50cc53)){const _0x2c8edc=_0x50cc53[_0x409928(0x1cc)]||[],_0x46f8d3=_0x2c8edc[_0x409928(0x225)](_0x2d8775=>_0x2d8775[_0x409928(0x259)]===!![])||_0x2c8edc[0x0];return _0x46f8d3?.[_0x409928(0x25b)]||[];}if(isSingleVersionMode(_0x50cc53))return _0x50cc53[_0x409928(0x25b)]||[];if(isMultiVersionMode(_0x50cc53)){const _0x578db4=_0x50cc53[_0x409928(0x241)]||[],_0x50226c=_0x578db4[_0x409928(0x225)](_0x5d0528=>_0x5d0528[_0x409928(0x259)]===!![])||_0x578db4[0x0];return _0x50226c?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x3df840){const _0x4a1881=a109_0x104d50;if(isJourneysArrayMode(_0x3df840)){const _0x19f50d=_0x3df840[_0x4a1881(0x1cc)]||[];return _0x19f50d[_0x4a1881(0x225)](_0x1ba3f7=>_0x1ba3f7[_0x4a1881(0x259)]===!![])||_0x19f50d[0x0];}if(isMultiVersionMode(_0x3df840)){const _0x3cf008=_0x3df840[_0x4a1881(0x241)]||[],_0x391906=_0x3cf008[_0x4a1881(0x225)](_0x55f050=>_0x55f050[_0x4a1881(0x259)]===!![])||_0x3cf008[0x0];if(_0x391906)return{'version':_0x391906[_0x4a1881(0x26c)],'state':_0x391906[_0x4a1881(0x1ef)],'latest':_0x391906[_0x4a1881(0x259)],'stages':_0x391906['stages'],'id':_0x391906['id'],'version_number':_0x391906[_0x4a1881(0x1e3)]};}if(isSingleVersionMode(_0x3df840))return{'version':_0x3df840[_0x4a1881(0x21e)]||'v1','state':'draft','stages':_0x3df840[_0x4a1881(0x25b)]||[],'id':_0x3df840['id'],'version_number':_0x3df840[_0x4a1881(0x1e3)],'goal':_0x3df840['goal'],'reentry':_0x3df840['reentry']};return undefined;}export function getLatestVersion(_0xdac421){const _0x1d87c2=a109_0x104d50;if(!isMultiVersionMode(_0xdac421))return undefined;const _0x47fc40=_0xdac421[_0x1d87c2(0x241)]||[];return _0x47fc40[_0x1d87c2(0x225)](_0x57bfad=>_0x57bfad[_0x1d87c2(0x259)]===!![])||_0x47fc40[0x0];}export function getEffectiveGoal(_0xac8895){const _0x57b7fa=a109_0x104d50,_0x56fc51=getLatestJourneyEntry(_0xac8895);return _0x56fc51?.['goal']||_0xac8895[_0x57b7fa(0x1ed)];}export function getEffectiveReentry(_0x2df3ac){const _0xb3496a=a109_0x104d50,_0x24f24e=getLatestJourneyEntry(_0x2df3ac);return _0x24f24e?.[_0xb3496a(0x264)]||_0x2df3ac[_0xb3496a(0x264)];}export function collectSegmentRefs(_0x1d256d){const _0x53c7b7=a109_0x104d50,_0xb5e5d9=new Set();_0x1d256d['goal']?.[_0x53c7b7(0x27c)]&&_0xb5e5d9[_0x53c7b7(0x1cb)](_0x1d256d[_0x53c7b7(0x1ed)]['segment']);const _0x1e72f9=_0x353ab5=>{const _0x5d61ae=_0x53c7b7;for(const _0x390718 of _0x353ab5){_0x390718[_0x5d61ae(0x207)]?.['segment']&&_0xb5e5d9[_0x5d61ae(0x1cb)](_0x390718[_0x5d61ae(0x207)][_0x5d61ae(0x27c)]);if(_0x390718[_0x5d61ae(0x1f4)])for(const _0x5b23a8 of _0x390718['exit_criteria']){_0x5b23a8[_0x5d61ae(0x27c)]&&_0xb5e5d9[_0x5d61ae(0x1cb)](_0x5b23a8['segment']);}_0x390718[_0x5d61ae(0x26f)]?.[_0x5d61ae(0x27c)]&&_0xb5e5d9[_0x5d61ae(0x1cb)](_0x390718[_0x5d61ae(0x26f)][_0x5d61ae(0x27c)]);if(_0x390718[_0x5d61ae(0x223)])for(const _0x1cc03b of _0x390718['steps']){if(_0x1cc03b[_0x5d61ae(0x20f)]===_0x5d61ae(0x274)){const _0x5788dc=_0x1cc03b;for(const _0x54f807 of _0x5788dc[_0x5d61ae(0x21b)][_0x5d61ae(0x23b)]){_0x54f807[_0x5d61ae(0x27c)]&&_0xb5e5d9[_0x5d61ae(0x1cb)](_0x54f807[_0x5d61ae(0x27c)]);}}else{if(_0x1cc03b[_0x5d61ae(0x20f)]===_0x5d61ae(0x1d8)){const _0x88208a=_0x1cc03b;_0x88208a['with']['condition']?.[_0x5d61ae(0x27c)]&&_0xb5e5d9[_0x5d61ae(0x1cb)](_0x88208a[_0x5d61ae(0x21b)][_0x5d61ae(0x1db)][_0x5d61ae(0x27c)]);}}}}};_0x1d256d[_0x53c7b7(0x25b)]&&_0x1e72f9(_0x1d256d[_0x53c7b7(0x25b)]);if(_0x1d256d[_0x53c7b7(0x241)])for(const _0x4b1f1e of _0x1d256d[_0x53c7b7(0x241)]){_0x1e72f9(_0x4b1f1e[_0x53c7b7(0x25b)]);}return _0xb5e5d9;}export function validateSegmentRefs(_0x31a5fa){const _0x5970a5=a109_0x104d50,_0x4fb3f0=[],_0x1b5529=collectSegmentRefs(_0x31a5fa),_0x344ca4=new Set(Object[_0x5970a5(0x281)](_0x31a5fa[_0x5970a5(0x271)]||{}));for(const _0x279cbd of _0x1b5529){const _0x329d0d=parseSegmentRef(_0x279cbd);_0x329d0d['type']===_0x5970a5(0x216)&&!_0x344ca4[_0x5970a5(0x22a)](_0x329d0d['name'])&&_0x4fb3f0[_0x5970a5(0x209)](_0x5970a5(0x1df)+_0x329d0d[_0x5970a5(0x26c)]+_0x5970a5(0x1e2)+_0x329d0d[_0x5970a5(0x26c)]+_0x5970a5(0x224));}return _0x4fb3f0;}export function collectSegmentIdsFromJourneyApi(_0x550ca8){const _0x24f14c=a109_0x104d50,_0x13dd87=new Set();_0x550ca8['attributes'][_0x24f14c(0x1ed)]?.[_0x24f14c(0x21d)]&&_0x13dd87['add'](_0x550ca8[_0x24f14c(0x20c)][_0x24f14c(0x1ed)][_0x24f14c(0x21d)]);const _0x3ac508=_0x550ca8[_0x24f14c(0x20c)]['journeyStages'];if(Array['isArray'](_0x3ac508))for(const _0x4e6150 of _0x3ac508){_0x4e6150[_0x24f14c(0x201)]?.[_0x24f14c(0x21d)]&&_0x13dd87[_0x24f14c(0x1cb)](_0x4e6150['entryCriteria'][_0x24f14c(0x21d)]);const _0x54bc6d=_0x4e6150[_0x24f14c(0x1fd)]??_0x4e6150['exitCriteria'];if(Array['isArray'](_0x54bc6d))for(const _0x286181 of _0x54bc6d){_0x286181[_0x24f14c(0x21d)]&&_0x13dd87[_0x24f14c(0x1cb)](_0x286181['segmentId']);}_0x4e6150[_0x24f14c(0x26f)]?.[_0x24f14c(0x21d)]&&_0x13dd87[_0x24f14c(0x1cb)](_0x4e6150[_0x24f14c(0x26f)][_0x24f14c(0x21d)]);if(_0x4e6150[_0x24f14c(0x223)]&&typeof _0x4e6150[_0x24f14c(0x223)]===_0x24f14c(0x1d7)){const _0x29d470=Array[_0x24f14c(0x212)](_0x4e6150[_0x24f14c(0x223)])?_0x4e6150[_0x24f14c(0x223)]:Object[_0x24f14c(0x248)](_0x4e6150[_0x24f14c(0x223)]);for(const _0x172ed3 of _0x29d470){_0x172ed3[_0x24f14c(0x277)]?.[_0x24f14c(0x21d)]&&_0x13dd87[_0x24f14c(0x1cb)](_0x172ed3[_0x24f14c(0x277)][_0x24f14c(0x21d)]);const _0x10b65b=_0x172ed3;_0x10b65b[_0x24f14c(0x263)]&&_0x13dd87[_0x24f14c(0x1cb)](_0x10b65b[_0x24f14c(0x263)]);if(Array[_0x24f14c(0x212)](_0x10b65b[_0x24f14c(0x24b)]))for(const _0x4d1ed6 of _0x10b65b['conditions']){_0x4d1ed6[_0x24f14c(0x21d)]&&_0x13dd87[_0x24f14c(0x1cb)](_0x4d1ed6[_0x24f14c(0x21d)]);}if(Array[_0x24f14c(0x212)](_0x172ed3[_0x24f14c(0x23b)]))for(const _0x333fb5 of _0x172ed3['branches']){_0x333fb5['segmentId']&&_0x13dd87['add'](_0x333fb5[_0x24f14c(0x21d)]);}}}}return _0x13dd87;}
1
+ (function(_0x3da6a8,_0x55282c){const _0x47efe6=a109_0x4373,_0x5e6ef7=_0x3da6a8();while(!![]){try{const _0xd79702=-parseInt(_0x47efe6(0x18b))/0x1*(parseInt(_0x47efe6(0x1a1))/0x2)+-parseInt(_0x47efe6(0x16d))/0x3*(parseInt(_0x47efe6(0x1e4))/0x4)+parseInt(_0x47efe6(0x1f8))/0x5+parseInt(_0x47efe6(0x140))/0x6*(parseInt(_0x47efe6(0x1c3))/0x7)+-parseInt(_0x47efe6(0x178))/0x8*(parseInt(_0x47efe6(0x187))/0x9)+parseInt(_0x47efe6(0x1b1))/0xa+parseInt(_0x47efe6(0x183))/0xb;if(_0xd79702===_0x55282c)break;else _0x5e6ef7['push'](_0x5e6ef7['shift']());}catch(_0x1fdf8a){_0x5e6ef7['push'](_0x5e6ef7['shift']());}}}(a109_0x30c1,0x6695f));import*as a109_0x109bc7 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(_0x3e0461){const _0x39e73e=a109_0x4373,_0x2f6c8f=_0x3e0461[_0x39e73e(0x161)]();if(_0x2f6c8f===_0x39e73e(0x17a)||_0x2f6c8f===_0x39e73e(0x168))return _0x39e73e(0x168);if(_0x2f6c8f===_0x39e73e(0x1b0)||_0x2f6c8f==='week')return _0x39e73e(0x1d8);return _0x3e0461;}export function journeyResponseToDefSync(_0x564908){const _0x948b67=a109_0x4373,_0x2c675d=_0x564908[_0x948b67(0x185)],_0xd0e13b=_0x2c675d[_0x948b67(0x142)]||_0x2c675d['name'],_0x48c0bc={'stages':_0x2c675d[_0x948b67(0x1b7)]['map'](convertApiStageToYaml),'id':_0x564908['id']};_0x2c675d['name']&&_0x2c675d[_0x948b67(0x1f0)]!==_0xd0e13b&&(_0x48c0bc['version']=_0x2c675d[_0x948b67(0x1f0)]);_0x2c675d[_0x948b67(0x188)]!==undefined&&(_0x48c0bc['version_number']=_0x2c675d['versionNumber']);_0x2c675d['state']&&(_0x48c0bc[_0x948b67(0x13e)]=_0x2c675d[_0x948b67(0x13e)]===_0x948b67(0x147)?'launched':'draft');const _0x151e1d={'type':_0x948b67(0x1ba),'name':_0xd0e13b,'journeys':[_0x48c0bc]};_0x2c675d[_0x948b67(0x1c4)]&&(_0x151e1d[_0x948b67(0x1c4)]=_0x2c675d[_0x948b67(0x1c4)]);_0x2c675d[_0x948b67(0x14c)]&&(_0x151e1d[_0x948b67(0x14c)]=convertApiCriteriaToYaml(_0x2c675d['goal']));if(_0x2c675d[_0x948b67(0x19c)])_0x151e1d[_0x948b67(0x1ee)]=_0x2c675d[_0x948b67(0x19c)];else _0x2c675d[_0x948b67(0x1ce)]!==undefined&&(_0x151e1d[_0x948b67(0x1ee)]=_0x2c675d['allowReentry']?_0x948b67(0x1e3):'no_reentry');return _0x2c675d['journeyBundleId']&&(_0x151e1d[_0x948b67(0x1d1)]=_0x2c675d[_0x948b67(0x181)]),_0x2c675d[_0x948b67(0x142)]&&(_0x151e1d['bundle_name']=_0x2c675d[_0x948b67(0x142)]),_0x564908[_0x948b67(0x1a4)]?.[_0x948b67(0x172)]?.[_0x948b67(0x1a9)]?.['id']&&(_0x151e1d[_0x948b67(0x150)]=_0x564908['relationships'][_0x948b67(0x172)]['data']['id']),_0x151e1d;}export async function journeyResponseToDef(_0x37bb4e,_0xf4855){const _0x3ac4be=a109_0x4373,_0x1dcb0d=journeyResponseToDefSync(_0x37bb4e);if(!_0xf4855)return _0x1dcb0d;const _0x5d65b0=new Set();collectSegmentIdsFromJourney(_0x1dcb0d,_0x5d65b0);const _0x591a15=new Set();collectActivationIdsFromJourney(_0x1dcb0d,_0x591a15);const _0x29f587={},_0x4a3f54=new Map();for(const _0x54f1e3 of Array[_0x3ac4be(0x1b5)](_0x5d65b0)[_0x3ac4be(0x1cd)]()){if(_0xf4855[_0x3ac4be(0x1c9)]){const _0x78456a=await _0xf4855[_0x3ac4be(0x1c9)](_0x54f1e3);if(_0x78456a[_0x3ac4be(0x1c6)]){_0x4a3f54['set'](_0x54f1e3,_0x78456a[_0x3ac4be(0x1f0)]);if(_0x78456a[_0x3ac4be(0x17b)]){const _0x1c983f={..._0x78456a[_0x3ac4be(0x17b)],'rule':deepSortObject(_0x78456a[_0x3ac4be(0x17b)]['rule'])};_0x29f587[_0x78456a[_0x3ac4be(0x1f0)]]=_0x1c983f;}}else _0x4a3f54[_0x3ac4be(0x1be)](_0x54f1e3,makeSegmentRef(_0x78456a[_0x3ac4be(0x1f0)]));}else{if(_0xf4855[_0x3ac4be(0x148)]){const _0x2e30f1=await _0xf4855[_0x3ac4be(0x148)](_0x54f1e3);_0x4a3f54[_0x3ac4be(0x1be)](_0x54f1e3,_0x2e30f1);}}}const _0x58fb6f={},_0x22bfe7=new Map();for(const _0x2e525a of Array[_0x3ac4be(0x1b5)](_0x591a15)['sort']()){if(_0xf4855[_0x3ac4be(0x1ff)]){const _0x18e618=await _0xf4855[_0x3ac4be(0x1ff)](_0x2e525a);_0x18e618[_0x3ac4be(0x1c6)]?(_0x22bfe7['set'](_0x2e525a,_0x18e618[_0x3ac4be(0x1f0)]),_0x18e618['definition']&&(_0x58fb6f[_0x18e618[_0x3ac4be(0x1f0)]]=_0x18e618[_0x3ac4be(0x17b)])):_0x22bfe7[_0x3ac4be(0x1be)](_0x2e525a,makeSegmentRef(_0x18e618[_0x3ac4be(0x1f0)]));}else{if(_0xf4855[_0x3ac4be(0x153)]){const _0x52036d=await _0xf4855[_0x3ac4be(0x153)](_0x2e525a);_0x22bfe7[_0x3ac4be(0x1be)](_0x2e525a,_0x52036d);}}}_0x4a3f54[_0x3ac4be(0x179)]>0x0&&replaceSegmentIdsInJourney(_0x1dcb0d,_0x4a3f54);_0x22bfe7[_0x3ac4be(0x179)]>0x0&&replaceActivationIdsInJourney(_0x1dcb0d,_0x22bfe7);if(_0xf4855[_0x3ac4be(0x1a3)]){const _0x21e4a1=[];collectJumpTargetsFromJourney(_0x1dcb0d,_0x21e4a1);if(_0x21e4a1['length']>0x0){const _0x58bf43=new Map();for(const _0x593402 of _0x21e4a1){try{const _0xfdc8f5=await _0xf4855[_0x3ac4be(0x1a3)](_0x593402[_0x3ac4be(0x1fc)],_0x593402[_0x3ac4be(0x154)]);_0x58bf43[_0x3ac4be(0x1be)](_0x593402['journeyId']+':'+_0x593402[_0x3ac4be(0x154)],_0xfdc8f5);}catch{}}_0x58bf43[_0x3ac4be(0x179)]>0x0&&replaceJumpTargetsInJourney(_0x1dcb0d,_0x58bf43);}}return Object[_0x3ac4be(0x1c8)](_0x29f587)[_0x3ac4be(0x1fd)]>0x0&&(_0x1dcb0d[_0x3ac4be(0x1a8)]=_0x29f587),Object[_0x3ac4be(0x1c8)](_0x58fb6f)[_0x3ac4be(0x1fd)]>0x0&&(_0x1dcb0d[_0x3ac4be(0x1b9)]=_0x58fb6f),_0x1dcb0d;}function collectSegmentIdsFromJourney(_0x558a4c,_0x338f77){const _0x23ebda=a109_0x4373;_0x558a4c[_0x23ebda(0x14c)]?.[_0x23ebda(0x1e0)]&&_0x338f77[_0x23ebda(0x1de)](_0x558a4c[_0x23ebda(0x14c)][_0x23ebda(0x1e0)]);const _0x3e29d0=_0x65d0fc=>{const _0x58dc58=_0x23ebda;for(const _0x42ff5c of _0x65d0fc){_0x42ff5c[_0x58dc58(0x14f)]?.[_0x58dc58(0x1e0)]&&_0x338f77['add'](_0x42ff5c[_0x58dc58(0x14f)][_0x58dc58(0x1e0)]);if(_0x42ff5c['exit_criteria'])for(const _0x5dd505 of _0x42ff5c[_0x58dc58(0x1bc)]){_0x5dd505[_0x58dc58(0x1e0)]&&_0x338f77[_0x58dc58(0x1de)](_0x5dd505[_0x58dc58(0x1e0)]);}_0x42ff5c[_0x58dc58(0x180)]?.[_0x58dc58(0x1e0)]&&_0x338f77['add'](_0x42ff5c[_0x58dc58(0x180)][_0x58dc58(0x1e0)]);if(_0x42ff5c[_0x58dc58(0x1ec)])for(const _0x34b7e3 of _0x42ff5c['steps']){if(_0x34b7e3[_0x58dc58(0x138)]===_0x58dc58(0x1d7)){const _0x3ea1c7=_0x34b7e3;for(const _0x4a8a98 of _0x3ea1c7[_0x58dc58(0x14a)][_0x58dc58(0x15c)]){_0x4a8a98[_0x58dc58(0x1e0)]&&_0x338f77[_0x58dc58(0x1de)](_0x4a8a98[_0x58dc58(0x1e0)]);}}else{if(_0x34b7e3['type']===_0x58dc58(0x1fe)){const _0x5ae077=_0x34b7e3;_0x5ae077[_0x58dc58(0x14a)][_0x58dc58(0x1c2)]?.['segment']&&_0x338f77[_0x58dc58(0x1de)](_0x5ae077['with'][_0x58dc58(0x1c2)]['segment']);}}}}};if(_0x558a4c['journeys'])for(const _0x2edd73 of _0x558a4c['journeys']){_0x2edd73[_0x23ebda(0x14c)]?.[_0x23ebda(0x1e0)]&&_0x338f77[_0x23ebda(0x1de)](_0x2edd73['goal']['segment']),_0x3e29d0(_0x2edd73['stages']);}_0x558a4c[_0x23ebda(0x1ca)]&&_0x3e29d0(_0x558a4c['stages']);if(_0x558a4c[_0x23ebda(0x1ae)])for(const _0x3dfbbb of _0x558a4c['versions']){_0x3e29d0(_0x3dfbbb[_0x23ebda(0x1ca)]);}}function replaceSegmentIdsInJourney(_0x12f704,_0x283046){const _0x252e0a=a109_0x4373,_0x2ae424=_0xf096b=>_0x283046[_0x252e0a(0x204)](_0xf096b)||_0xf096b;_0x12f704[_0x252e0a(0x14c)]?.[_0x252e0a(0x1e0)]&&(_0x12f704[_0x252e0a(0x14c)][_0x252e0a(0x1e0)]=_0x2ae424(_0x12f704[_0x252e0a(0x14c)][_0x252e0a(0x1e0)]));const _0x4b499f=_0x474cd9=>{const _0x4ae7a6=_0x252e0a;for(const _0x4d448d of _0x474cd9){_0x4d448d[_0x4ae7a6(0x14f)]?.[_0x4ae7a6(0x1e0)]&&(_0x4d448d['entry_criteria'][_0x4ae7a6(0x1e0)]=_0x2ae424(_0x4d448d['entry_criteria'][_0x4ae7a6(0x1e0)]));if(_0x4d448d[_0x4ae7a6(0x1bc)])for(const _0x142bc9 of _0x4d448d[_0x4ae7a6(0x1bc)]){_0x142bc9['segment']&&(_0x142bc9[_0x4ae7a6(0x1e0)]=_0x2ae424(_0x142bc9[_0x4ae7a6(0x1e0)]));}_0x4d448d[_0x4ae7a6(0x180)]?.[_0x4ae7a6(0x1e0)]&&(_0x4d448d[_0x4ae7a6(0x180)][_0x4ae7a6(0x1e0)]=_0x2ae424(_0x4d448d[_0x4ae7a6(0x180)][_0x4ae7a6(0x1e0)]));if(_0x4d448d[_0x4ae7a6(0x1ec)])for(const _0x399eb4 of _0x4d448d[_0x4ae7a6(0x1ec)]){if(_0x399eb4[_0x4ae7a6(0x138)]===_0x4ae7a6(0x1d7)){const _0x47f6da=_0x399eb4;for(const _0x3b4614 of _0x47f6da[_0x4ae7a6(0x14a)][_0x4ae7a6(0x15c)]){_0x3b4614[_0x4ae7a6(0x1e0)]&&(_0x3b4614[_0x4ae7a6(0x1e0)]=_0x2ae424(_0x3b4614[_0x4ae7a6(0x1e0)]));}}else{if(_0x399eb4[_0x4ae7a6(0x138)]==='wait'){const _0x5da180=_0x399eb4;_0x5da180[_0x4ae7a6(0x14a)][_0x4ae7a6(0x1c2)]?.[_0x4ae7a6(0x1e0)]&&(_0x5da180[_0x4ae7a6(0x14a)][_0x4ae7a6(0x1c2)][_0x4ae7a6(0x1e0)]=_0x2ae424(_0x5da180[_0x4ae7a6(0x14a)][_0x4ae7a6(0x1c2)][_0x4ae7a6(0x1e0)]));}}}}};if(_0x12f704[_0x252e0a(0x1df)])for(const _0x516cb4 of _0x12f704['journeys']){_0x516cb4[_0x252e0a(0x14c)]?.[_0x252e0a(0x1e0)]&&(_0x516cb4[_0x252e0a(0x14c)][_0x252e0a(0x1e0)]=_0x2ae424(_0x516cb4[_0x252e0a(0x14c)][_0x252e0a(0x1e0)])),_0x4b499f(_0x516cb4[_0x252e0a(0x1ca)]);}_0x12f704[_0x252e0a(0x1ca)]&&_0x4b499f(_0x12f704['stages']);if(_0x12f704['versions'])for(const _0x373132 of _0x12f704['versions']){_0x4b499f(_0x373132['stages']);}}function collectActivationIdsFromJourney(_0x4787f0,_0x635897){const _0x2c45e9=a109_0x4373,_0x14788a=_0x1af34d=>{const _0x3566dd=a109_0x4373;for(const _0x672d17 of _0x1af34d){if(_0x672d17[_0x3566dd(0x1ec)])for(const _0xed7c34 of _0x672d17[_0x3566dd(0x1ec)]){if(_0xed7c34[_0x3566dd(0x138)]===_0x3566dd(0x19a)){const _0x5b8291=_0xed7c34;_0x5b8291[_0x3566dd(0x14a)]['activation']&&/^\d+$/[_0x3566dd(0x16e)](_0x5b8291['with'][_0x3566dd(0x19a)])&&_0x635897[_0x3566dd(0x1de)](_0x5b8291['with'][_0x3566dd(0x19a)]);}}}};if(_0x4787f0[_0x2c45e9(0x1df)])for(const _0x5c3743 of _0x4787f0['journeys']){_0x14788a(_0x5c3743[_0x2c45e9(0x1ca)]);}_0x4787f0['stages']&&_0x14788a(_0x4787f0[_0x2c45e9(0x1ca)]);if(_0x4787f0[_0x2c45e9(0x1ae)])for(const _0x35bbd2 of _0x4787f0[_0x2c45e9(0x1ae)]){_0x14788a(_0x35bbd2['stages']);}}function replaceActivationIdsInJourney(_0x18e5ff,_0x4a31dd){const _0x104acc=a109_0x4373,_0xaf6929=_0x31ad0b=>_0x4a31dd[_0x104acc(0x204)](_0x31ad0b)||_0x31ad0b,_0x2e9ddb=_0x2895ec=>{const _0x5cd210=_0x104acc;for(const _0x33956f of _0x2895ec){if(_0x33956f[_0x5cd210(0x1ec)])for(const _0x28a6f3 of _0x33956f[_0x5cd210(0x1ec)]){if(_0x28a6f3['type']===_0x5cd210(0x19a)){const _0x270ab6=_0x28a6f3;_0x270ab6['with']['activation']&&(_0x270ab6[_0x5cd210(0x14a)]['activation']=_0xaf6929(_0x270ab6[_0x5cd210(0x14a)][_0x5cd210(0x19a)]));}}}};if(_0x18e5ff[_0x104acc(0x1df)])for(const _0xfe4993 of _0x18e5ff[_0x104acc(0x1df)]){_0x2e9ddb(_0xfe4993[_0x104acc(0x1ca)]);}_0x18e5ff['stages']&&_0x2e9ddb(_0x18e5ff[_0x104acc(0x1ca)]);if(_0x18e5ff[_0x104acc(0x1ae)])for(const _0x3aa6ea of _0x18e5ff[_0x104acc(0x1ae)]){_0x2e9ddb(_0x3aa6ea['stages']);}}function collectJumpTargetsFromJourney(_0x36b6bd,_0x20f6e9){const _0x461d10=a109_0x4373,_0x1e8378=new Set(),_0x29db18=_0x5d7734=>{const _0x4fa57a=a109_0x4373;for(const _0x3aafee of _0x5d7734){if(_0x3aafee['steps'])for(const _0x5c896e of _0x3aafee[_0x4fa57a(0x1ec)]){if(_0x5c896e[_0x4fa57a(0x138)]==='jump'){const _0x58cfa8=_0x5c896e,_0x2f13a9=_0x58cfa8[_0x4fa57a(0x14a)][_0x4fa57a(0x1e7)];if(_0x2f13a9[_0x4fa57a(0x1ba)]&&_0x2f13a9[_0x4fa57a(0x19e)]&&/^\d+$/[_0x4fa57a(0x16e)](_0x2f13a9[_0x4fa57a(0x1ba)])&&/^\d+$/[_0x4fa57a(0x16e)](_0x2f13a9[_0x4fa57a(0x19e)])){const _0x552816=_0x2f13a9['journey']+':'+_0x2f13a9['stage'];!_0x1e8378[_0x4fa57a(0x1ea)](_0x552816)&&(_0x1e8378[_0x4fa57a(0x1de)](_0x552816),_0x20f6e9['push']({'journeyId':_0x2f13a9[_0x4fa57a(0x1ba)],'stageId':_0x2f13a9[_0x4fa57a(0x19e)]}));}}}}};if(_0x36b6bd[_0x461d10(0x1df)])for(const _0x192807 of _0x36b6bd[_0x461d10(0x1df)]){_0x29db18(_0x192807[_0x461d10(0x1ca)]);}_0x36b6bd[_0x461d10(0x1ca)]&&_0x29db18(_0x36b6bd[_0x461d10(0x1ca)]);if(_0x36b6bd[_0x461d10(0x1ae)])for(const _0x125297 of _0x36b6bd[_0x461d10(0x1ae)]){_0x29db18(_0x125297[_0x461d10(0x1ca)]);}}function replaceJumpTargetsInJourney(_0x3ae8fe,_0x222362){const _0x462085=a109_0x4373,_0x1892cf=_0x2e2fb8=>{const _0x3f4c1f=a109_0x4373;for(const _0x5dc97a of _0x2e2fb8){if(_0x5dc97a[_0x3f4c1f(0x1ec)])for(const _0x54daa4 of _0x5dc97a[_0x3f4c1f(0x1ec)]){if(_0x54daa4[_0x3f4c1f(0x138)]===_0x3f4c1f(0x13a)){const _0x5acd37=_0x54daa4,_0x58d3cc=_0x5acd37[_0x3f4c1f(0x14a)]['target'],_0x492ff5=_0x58d3cc['journey']+':'+_0x58d3cc[_0x3f4c1f(0x19e)],_0x165bbd=_0x222362[_0x3f4c1f(0x204)](_0x492ff5);_0x165bbd&&(_0x58d3cc[_0x3f4c1f(0x1ba)]=_0x165bbd['journeyName'],_0x58d3cc['stage']=_0x165bbd['stageName']);}}}};if(_0x3ae8fe['journeys'])for(const _0x1d7f96 of _0x3ae8fe[_0x462085(0x1df)]){_0x1892cf(_0x1d7f96['stages']);}_0x3ae8fe[_0x462085(0x1ca)]&&_0x1892cf(_0x3ae8fe[_0x462085(0x1ca)]);if(_0x3ae8fe[_0x462085(0x1ae)])for(const _0x3a536a of _0x3ae8fe[_0x462085(0x1ae)]){_0x1892cf(_0x3a536a[_0x462085(0x1ca)]);}}function generateReadableStepName(_0x162ea4,_0x4049a7){const _0x5dd58e=a109_0x4373;if(_0x162ea4[_0x5dd58e(0x1f0)]&&_0x162ea4[_0x5dd58e(0x1f0)]!==_0x162ea4[_0x5dd58e(0x138)]){const _0x54165b=_0x162ea4[_0x5dd58e(0x1f0)]['trim']();if(_0x54165b&&/[a-z0-9]/i['test'](_0x54165b))return _0x54165b;}const _0x46bee4=_0x162ea4[_0x5dd58e(0x138)][_0x5dd58e(0x161)]()[_0x5dd58e(0x160)](/step$/i,'');return _0x46bee4+'_'+(_0x4049a7+0x1);}function getStepNextRefs(_0x44493e){const _0x109a77=a109_0x4373,_0x383e90=[];if(_0x44493e[_0x109a77(0x1b8)])_0x383e90[_0x109a77(0x1ef)](_0x44493e[_0x109a77(0x1b8)]);if(_0x44493e[_0x109a77(0x15c)])for(const _0x483cf0 of _0x44493e[_0x109a77(0x15c)]){if(_0x483cf0[_0x109a77(0x1b8)])_0x383e90[_0x109a77(0x1ef)](_0x483cf0['next']);}if(_0x44493e[_0x109a77(0x13d)])for(const _0x3f493f of _0x44493e['variants']){if(_0x3f493f[_0x109a77(0x1b8)])_0x383e90['push'](_0x3f493f[_0x109a77(0x1b8)]);}if(_0x44493e[_0x109a77(0x143)])for(const _0x975735 of _0x44493e['conditions']){if(_0x975735[_0x109a77(0x1b8)])_0x383e90[_0x109a77(0x1ef)](_0x975735[_0x109a77(0x1b8)]);}return _0x383e90;}function parseJumpTargetDisplayName(_0x339531){const _0x516feb=a109_0x4373,_0x2fb939=_0x339531[_0x516feb(0x198)](/^(.+?)\s*\(([^/)]+)/);if(!_0x2fb939)return undefined;const _0x5df941=_0x2fb939[0x1]['trim'](),_0x123523=_0x2fb939[0x2][_0x516feb(0x205)]();if(!_0x5df941||!_0x123523)return undefined;return{'stageName':_0x5df941,'journeyName':_0x123523};}function orderStepsFromRoot(_0x2aed18,_0x5e3f38){const _0x203080=a109_0x4373,_0x520018=Object[_0x203080(0x159)](_0x2aed18);if(_0x520018[_0x203080(0x1fd)]===0x0)return[];const _0x75c817=new Set(_0x520018[_0x203080(0x164)](([_0x24d76b])=>_0x24d76b)),_0xc780db=new Set();for(const [,_0x36f454]of _0x520018){for(const _0x453caa of getStepNextRefs(_0x36f454)){if(_0x75c817[_0x203080(0x1ea)](_0x453caa))_0xc780db[_0x203080(0x1de)](_0x453caa);}}let _0x7f5e34=_0x5e3f38&&_0x75c817[_0x203080(0x1ea)](_0x5e3f38)?_0x5e3f38:undefined;if(!_0x7f5e34){const _0x475a72=_0x520018[_0x203080(0x17f)](([_0x417aff])=>!_0xc780db['has'](_0x417aff));_0x475a72[_0x203080(0x1fd)]>0x0?_0x7f5e34=_0x475a72[0x0][0x0]:_0x7f5e34=_0x520018[0x0][0x0];}const _0x3282e1=[],_0x1392c7=new Set(),_0x58c1e4=[_0x7f5e34];while(_0x58c1e4['length']>0x0){const _0xb9fa2d=_0x58c1e4['shift']();if(_0x1392c7[_0x203080(0x1ea)](_0xb9fa2d))continue;_0x1392c7[_0x203080(0x1de)](_0xb9fa2d);const _0x2e351f=_0x2aed18[_0xb9fa2d];if(!_0x2e351f)continue;_0x3282e1['push']({'uuid':_0xb9fa2d,'step':_0x2e351f});for(const _0x27a0e7 of getStepNextRefs(_0x2e351f)){_0x75c817['has'](_0x27a0e7)&&!_0x1392c7[_0x203080(0x1ea)](_0x27a0e7)&&_0x58c1e4[_0x203080(0x1ef)](_0x27a0e7);}}for(const [_0x3e2acb,_0x4a1fa5]of _0x520018){!_0x1392c7[_0x203080(0x1ea)](_0x3e2acb)&&_0x3282e1[_0x203080(0x1ef)]({'uuid':_0x3e2acb,'step':_0x4a1fa5});}return _0x3282e1;}function resolveStepReferences(_0x5e32bb,_0x151e21,_0x53cd66,_0x95ad1){const _0x4e6046=a109_0x4373;if(_0x5e32bb['type']!==_0x4e6046(0x1af)){_0x5e32bb[_0x4e6046(0x1b8)]&&_0x95ad1[_0x4e6046(0x1ea)](_0x5e32bb['next'])&&(_0x5e32bb[_0x4e6046(0x1b8)]=_0x95ad1[_0x4e6046(0x204)](_0x5e32bb[_0x4e6046(0x1b8)]));const _0x32df6f=_0x151e21+0x1;if(_0x32df6f<_0x53cd66[_0x4e6046(0x1fd)]){const _0x2ced05=_0x95ad1[_0x4e6046(0x204)](_0x53cd66[_0x32df6f][_0x4e6046(0x1cb)]);_0x5e32bb[_0x4e6046(0x1b8)]===_0x2ced05&&delete _0x5e32bb[_0x4e6046(0x1b8)];}}if(_0x5e32bb[_0x4e6046(0x138)]===_0x4e6046(0x1d7))for(const _0x25d9cb of _0x5e32bb[_0x4e6046(0x14a)][_0x4e6046(0x15c)]){_0x25d9cb[_0x4e6046(0x1b8)]&&_0x95ad1['has'](_0x25d9cb[_0x4e6046(0x1b8)])&&(_0x25d9cb[_0x4e6046(0x1b8)]=_0x95ad1['get'](_0x25d9cb[_0x4e6046(0x1b8)]));}if(_0x5e32bb[_0x4e6046(0x138)]==='ab_test')for(const _0x46dcbb of _0x5e32bb[_0x4e6046(0x14a)][_0x4e6046(0x13d)]){_0x46dcbb[_0x4e6046(0x1b8)]&&_0x95ad1[_0x4e6046(0x1ea)](_0x46dcbb[_0x4e6046(0x1b8)])&&(_0x46dcbb[_0x4e6046(0x1b8)]=_0x95ad1[_0x4e6046(0x204)](_0x46dcbb[_0x4e6046(0x1b8)]));}if(_0x5e32bb[_0x4e6046(0x138)]===_0x4e6046(0x1fe)&&_0x5e32bb[_0x4e6046(0x14a)][_0x4e6046(0x1c2)]){const _0x192d24=_0x5e32bb[_0x4e6046(0x14a)][_0x4e6046(0x1c2)];_0x192d24[_0x4e6046(0x1b8)]&&_0x95ad1[_0x4e6046(0x1ea)](_0x192d24[_0x4e6046(0x1b8)])&&(_0x192d24[_0x4e6046(0x1b8)]=_0x95ad1[_0x4e6046(0x204)](_0x192d24[_0x4e6046(0x1b8)])),_0x192d24[_0x4e6046(0x1a5)]?.['next']&&_0x95ad1[_0x4e6046(0x1ea)](_0x192d24['timeout']['next'])&&(_0x192d24[_0x4e6046(0x1a5)][_0x4e6046(0x1b8)]=_0x95ad1[_0x4e6046(0x204)](_0x192d24[_0x4e6046(0x1a5)]['next']));}}function convertApiStageToYaml(_0x1e6464){const _0xbec7e2=a109_0x4373,_0x3bb6e6={'name':_0x1e6464[_0xbec7e2(0x1f0)]};_0x1e6464['id']&&(_0x3bb6e6['id']=_0x1e6464['id']);_0x1e6464[_0xbec7e2(0x1c4)]&&(_0x3bb6e6[_0xbec7e2(0x1c4)]=_0x1e6464['description']);_0x1e6464[_0xbec7e2(0x1b2)]&&(_0x3bb6e6[_0xbec7e2(0x14f)]=convertApiCriteriaToYaml(_0x1e6464[_0xbec7e2(0x1b2)]));_0x1e6464[_0xbec7e2(0x19d)]&&_0x1e6464[_0xbec7e2(0x19d)][_0xbec7e2(0x1fd)]>0x0&&(_0x3bb6e6[_0xbec7e2(0x1bc)]=_0x1e6464[_0xbec7e2(0x19d)][_0xbec7e2(0x164)](convertApiCriteriaToYaml));_0x1e6464['milestone']&&(_0x3bb6e6[_0xbec7e2(0x180)]=convertApiCriteriaToYaml(_0x1e6464[_0xbec7e2(0x180)]));if(_0x1e6464['steps']&&Object[_0xbec7e2(0x1c8)](_0x1e6464[_0xbec7e2(0x1ec)])[_0xbec7e2(0x1fd)]>0x0){const _0x4e3eba=orderStepsFromRoot(_0x1e6464['steps'],_0x1e6464[_0xbec7e2(0x1d4)]),_0x1bfdf1=new Map(),_0x242793=new Set();for(let _0x152456=0x0;_0x152456<_0x4e3eba[_0xbec7e2(0x1fd)];_0x152456++){const {uuid:_0x218619,step:_0x45e470}=_0x4e3eba[_0x152456];let _0xf84c75=generateReadableStepName(_0x45e470,_0x152456),_0x4fdc6a=_0xf84c75,_0x5191a5=0x2;while(_0x242793[_0xbec7e2(0x1ea)](_0x4fdc6a)){_0x4fdc6a=_0xf84c75+'_'+_0x5191a5,_0x5191a5++;}_0x242793[_0xbec7e2(0x1de)](_0x4fdc6a),_0x1bfdf1['set'](_0x218619,_0x4fdc6a);}_0x3bb6e6[_0xbec7e2(0x1ec)]=_0x4e3eba['map'](({uuid:_0x560e3b,step:_0x2252f7},_0x1b9527)=>{const _0x4e1b92=_0xbec7e2,_0x2e2f43=convertApiStepToYaml(_0x2252f7,_0x1bfdf1[_0x4e1b92(0x204)](_0x560e3b));return resolveStepReferences(_0x2e2f43,_0x1b9527,_0x4e3eba,_0x1bfdf1),_0x2e2f43;});}return _0x3bb6e6;}function convertApiCriteriaToYaml(_0x22d1d8){const _0x2443bb=a109_0x4373,_0x45d037={'name':_0x22d1d8[_0x2443bb(0x1f0)],'segment':_0x22d1d8[_0x2443bb(0x165)]};_0x22d1d8['description']&&(_0x45d037['description']=_0x22d1d8[_0x2443bb(0x1c4)]);if(_0x22d1d8['target']){let _0x5302a9=_0x22d1d8[_0x2443bb(0x1e7)][_0x2443bb(0x1fc)],_0x37a334=_0x22d1d8[_0x2443bb(0x1e7)]['journeyStageId'];if(_0x22d1d8[_0x2443bb(0x1e7)][_0x2443bb(0x196)]){const _0x475a66=parseJumpTargetDisplayName(_0x22d1d8[_0x2443bb(0x1e7)][_0x2443bb(0x196)]);_0x475a66&&(_0x37a334=_0x475a66[_0x2443bb(0x15f)],_0x5302a9=_0x475a66[_0x2443bb(0x196)]);}_0x45d037[_0x2443bb(0x1e7)]={'journey':_0x5302a9,'stage':_0x37a334},_0x22d1d8[_0x2443bb(0x1e7)][_0x2443bb(0x181)]&&(_0x45d037[_0x2443bb(0x1e7)][_0x2443bb(0x1d1)]=_0x22d1d8['target'][_0x2443bb(0x181)]);}return _0x45d037;}function convertApiStepToYaml(_0x233e0a,_0x2ebeeb){const _0x3d74ee=a109_0x4373;switch(_0x233e0a[_0x3d74ee(0x138)]){case _0x3d74ee(0x186):{const _0x5dc071={};if(_0x233e0a[_0x3d74ee(0x162)]===_0x3d74ee(0x158)&&_0x233e0a[_0x3d74ee(0x19b)]!==undefined)_0x5dc071[_0x3d74ee(0x14d)]=_0x233e0a[_0x3d74ee(0x19b)],_0x5dc071[_0x3d74ee(0x1e1)]=_0x233e0a[_0x3d74ee(0x16b)];else{if(_0x233e0a['waitStepType']==='Date'&&_0x233e0a[_0x3d74ee(0x18f)])_0x5dc071[_0x3d74ee(0x146)]=_0x233e0a[_0x3d74ee(0x18f)];else{if(_0x233e0a[_0x3d74ee(0x162)]===_0x3d74ee(0x1c1)&&_0x233e0a['daysOfWeek'])_0x5dc071[_0x3d74ee(0x156)]=_0x233e0a[_0x3d74ee(0x139)];else{if(_0x233e0a[_0x3d74ee(0x162)]===_0x3d74ee(0x1d5)){if(_0x233e0a['conditions']&&_0x233e0a[_0x3d74ee(0x143)]['length']>0x0){const _0x57c0f1=_0x233e0a[_0x3d74ee(0x143)]['find'](_0x2d455a=>!_0x2d455a[_0x3d74ee(0x166)]),_0x779724=_0x233e0a[_0x3d74ee(0x143)][_0x3d74ee(0x1fa)](_0x5c5e32=>_0x5c5e32[_0x3d74ee(0x166)]);_0x57c0f1?.['segmentId']&&(_0x5dc071['condition']={'segment':_0x57c0f1[_0x3d74ee(0x165)],..._0x57c0f1[_0x3d74ee(0x1b8)]?{'next':_0x57c0f1['next']}:{}},_0x779724&&_0x779724[_0x3d74ee(0x1e5)]!==undefined&&_0x779724[_0x3d74ee(0x1e1)]&&(_0x5dc071[_0x3d74ee(0x1c2)]['timeout']={'duration':_0x779724['moveAfter'],'unit':_0x779724['unit'],..._0x779724[_0x3d74ee(0x1b8)]?{'next':_0x779724[_0x3d74ee(0x1b8)]}:{}}));}else _0x233e0a[_0x3d74ee(0x17e)]&&(_0x5dc071[_0x3d74ee(0x1c2)]={'segment':_0x233e0a[_0x3d74ee(0x17e)]},_0x233e0a[_0x3d74ee(0x15b)]!==undefined&&_0x233e0a[_0x3d74ee(0x1eb)]&&(_0x5dc071['condition'][_0x3d74ee(0x1a5)]={'duration':_0x233e0a[_0x3d74ee(0x15b)],'unit':_0x233e0a['conditionTimeoutUnit']}));}}}}const _0x4bf9a7={'type':_0x3d74ee(0x1fe),'name':_0x2ebeeb,..._0x233e0a['next']?{'next':_0x233e0a[_0x3d74ee(0x1b8)]}:{},'with':_0x5dc071};return _0x4bf9a7;}case _0x3d74ee(0x1d6):{const _0x46d0dd={'type':_0x3d74ee(0x19a),'name':_0x2ebeeb,..._0x233e0a[_0x3d74ee(0x1b8)]?{'next':_0x233e0a[_0x3d74ee(0x1b8)]}:{},'with':{'activation':_0x233e0a['journeyActivationStepId']||''}};return _0x46d0dd;}case'DecisionPoint':{const _0x20bb97={'type':_0x3d74ee(0x1d7),'name':_0x2ebeeb,..._0x233e0a[_0x3d74ee(0x1b8)]?{'next':_0x233e0a[_0x3d74ee(0x1b8)]}:{},'with':{'branches':(_0x233e0a[_0x3d74ee(0x15c)]||[])[_0x3d74ee(0x164)](_0x2ce2be=>({'name':_0x2ce2be[_0x3d74ee(0x1f0)],'segment':_0x2ce2be[_0x3d74ee(0x165)],'excluded':_0x2ce2be[_0x3d74ee(0x1d2)],..._0x2ce2be[_0x3d74ee(0x1b8)]?{'next':_0x2ce2be[_0x3d74ee(0x1b8)]}:{}}))}};return _0x20bb97;}case _0x3d74ee(0x202):case _0x3d74ee(0x174):case'Variant':{const _0x4831ca=_0x233e0a[_0x3d74ee(0x13d)]||(_0x233e0a['branches']||[])[_0x3d74ee(0x164)](_0x545690=>({'name':_0x545690['name'],'percentage':0x0,'next':_0x545690[_0x3d74ee(0x1b8)]})),_0x2de78a={'type':'ab_test','name':_0x2ebeeb,..._0x233e0a['next']?{'next':_0x233e0a[_0x3d74ee(0x1b8)]}:{},'with':{'customized_split':_0x233e0a['customizedSplit'],'unique_id':_0x233e0a[_0x3d74ee(0x182)],'variants':_0x4831ca[_0x3d74ee(0x164)](_0x153b0c=>({'name':_0x153b0c[_0x3d74ee(0x1f0)],'percentage':_0x153b0c[_0x3d74ee(0x1ed)],..._0x153b0c[_0x3d74ee(0x1b8)]?{'next':_0x153b0c[_0x3d74ee(0x1b8)]}:{}}))}};return _0x2de78a;}case'Merge':{const _0x17af3c={'type':'merge','name':_0x2ebeeb,..._0x233e0a[_0x3d74ee(0x1b8)]?{'next':_0x233e0a[_0x3d74ee(0x1b8)]}:{}};return _0x17af3c;}case'Jump':{if(!_0x233e0a['target'])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x3d74ee(0x19f)+(_0x233e0a[_0x3d74ee(0x1f0)]||_0x2ebeeb)+_0x3d74ee(0x1f2));let _0x1cf5ad=_0x233e0a[_0x3d74ee(0x1e7)][_0x3d74ee(0x1fc)],_0x5db19a=_0x233e0a['target'][_0x3d74ee(0x1ac)];if(_0x233e0a[_0x3d74ee(0x1e7)]['journeyName']){const _0x1742ce=parseJumpTargetDisplayName(_0x233e0a[_0x3d74ee(0x1e7)][_0x3d74ee(0x196)]);_0x1742ce&&(_0x5db19a=_0x1742ce[_0x3d74ee(0x15f)],_0x1cf5ad=_0x1742ce[_0x3d74ee(0x196)]);}const _0x7b6241={'type':'jump','name':_0x2ebeeb,..._0x233e0a[_0x3d74ee(0x1b8)]?{'next':_0x233e0a[_0x3d74ee(0x1b8)]}:{},'with':{'target':{'journey':_0x1cf5ad,'stage':_0x5db19a,'bundle_id':_0x233e0a[_0x3d74ee(0x1e7)][_0x3d74ee(0x181)]}}};return _0x7b6241;}case _0x3d74ee(0x194):{const _0xe004f5={'type':'end','name':_0x2ebeeb};return _0xe004f5;}default:{const _0x7250e2={'type':'end','name':_0x2ebeeb};return _0x7250e2;}}}export async function journeyDefToRequest(_0x4c7b95,_0x5f3ec2,_0x215801){const _0x1c02c8=a109_0x4373,_0x2a4c40=_0x4c7b95['stages']||getActiveStages(_0x4c7b95),_0x10dfc5=_0x4c7b95[_0x1c02c8(0x1a8)]||{},_0xc0cf=_0x4c7b95[_0x1c02c8(0x1b9)]||{},_0x534c05={'type':_0x1c02c8(0x1ba),'attributes':{'name':_0x4c7b95[_0x1c02c8(0x1f0)],'audienceId':_0x5f3ec2,'journeyStages':await Promise[_0x1c02c8(0x1e2)](_0x2a4c40['map'](_0x379e52=>convertYamlStageToApi(_0x379e52,_0x215801,_0x10dfc5,_0xc0cf)))}};_0x4c7b95['id']&&(_0x534c05['id']=_0x4c7b95['id']);_0x4c7b95[_0x1c02c8(0x1c4)]&&(_0x534c05['attributes'][_0x1c02c8(0x1c4)]=_0x4c7b95[_0x1c02c8(0x1c4)]);const _0x2ce658=getEffectiveGoal(_0x4c7b95);_0x2ce658&&(_0x534c05[_0x1c02c8(0x185)][_0x1c02c8(0x14c)]=await convertYamlCriteriaToApi(_0x2ce658,_0x215801,_0x10dfc5));const _0x276ff4=getEffectiveReentry(_0x4c7b95);return _0x276ff4&&(_0x534c05[_0x1c02c8(0x185)][_0x1c02c8(0x19c)]=_0x276ff4,_0x534c05['attributes'][_0x1c02c8(0x1ce)]=_0x276ff4!==_0x1c02c8(0x189)),_0x4c7b95[_0x1c02c8(0x150)]&&(_0x534c05[_0x1c02c8(0x1a4)]={'parentFolder':{'data':{'id':_0x4c7b95[_0x1c02c8(0x150)],'type':'folder'}}}),_0x534c05;}async function convertYamlStageToApi(_0xab47e6,_0x36d488,_0x62283={},_0x37cf9c={}){const _0x230fd0=a109_0x4373,_0x3984e2={'name':_0xab47e6[_0x230fd0(0x1f0)]};_0xab47e6['id']&&(_0x3984e2['id']=_0xab47e6['id']);_0xab47e6['description']&&(_0x3984e2[_0x230fd0(0x1c4)]=_0xab47e6[_0x230fd0(0x1c4)]);_0xab47e6[_0x230fd0(0x14f)]&&(_0x3984e2[_0x230fd0(0x1b2)]=await convertYamlCriteriaToApi(_0xab47e6[_0x230fd0(0x14f)],_0x36d488,_0x62283));_0xab47e6['exit_criteria']&&_0xab47e6[_0x230fd0(0x1bc)]['length']>0x0&&(_0x3984e2['exitCriterias']=await Promise['all'](_0xab47e6[_0x230fd0(0x1bc)][_0x230fd0(0x164)](_0x3f3ef5=>convertYamlCriteriaToApi(_0x3f3ef5,_0x36d488,_0x62283))));_0xab47e6[_0x230fd0(0x180)]&&(_0x3984e2[_0x230fd0(0x180)]=await convertYamlCriteriaToApi(_0xab47e6[_0x230fd0(0x180)],_0x36d488,_0x62283));if(_0xab47e6['steps']&&_0xab47e6[_0x230fd0(0x1ec)][_0x230fd0(0x1fd)]>0x0){const _0x3033c8={},_0x1b7868=_0xab47e6[_0x230fd0(0x1ec)][_0x230fd0(0x164)]((_0xf4dd71,_0x1927ec)=>{const _0x14e3c9=_0x230fd0,_0x3917ce=_0xf4dd71[_0x14e3c9(0x1cb)]||generateUUID(),_0xf4c5b7=_0xf4dd71[_0x14e3c9(0x1f0)]||_0xf4dd71[_0x14e3c9(0x138)]+'_'+_0x1927ec;return _0x3033c8[_0xf4c5b7]=_0x3917ce,{..._0xf4dd71,'name':_0xf4c5b7};});_0x3984e2[_0x230fd0(0x1d4)]=_0x3033c8[_0x1b7868[0x0]['name']],_0x3984e2[_0x230fd0(0x1ec)]={};for(let _0x5a0d22=0x0;_0x5a0d22<_0x1b7868[_0x230fd0(0x1fd)];_0x5a0d22++){const _0x287276=_0x1b7868[_0x5a0d22],_0x9c33d3=_0x3033c8[_0x287276['name']],_0x3c716b=!_0x287276[_0x230fd0(0x1b8)]&&_0x5a0d22<_0x1b7868[_0x230fd0(0x1fd)]-0x1&&_0x287276[_0x230fd0(0x138)]!==_0x230fd0(0x1af)?_0x1b7868[_0x5a0d22+0x1][_0x230fd0(0x1f0)]:_0x287276[_0x230fd0(0x1b8)],_0x3baccf=_0x3c716b!==_0x287276[_0x230fd0(0x1b8)]?{..._0x287276,'next':_0x3c716b}:_0x287276;_0x3984e2[_0x230fd0(0x1ec)][_0x9c33d3]=await convertYamlStepToApi(_0x3baccf,_0x36d488,_0x62283,_0x3033c8,_0x37cf9c);}}else _0xab47e6[_0x230fd0(0x1c7)]&&(_0x3984e2[_0x230fd0(0x1d4)]=_0xab47e6['root_step']);return _0x3984e2;}async function convertYamlCriteriaToApi(_0x1d5bd5,_0x478a96,_0x50c886={}){const _0x224120=a109_0x4373;let _0x354821=_0x1d5bd5['segment'];if(_0x354821&&!/^\d+$/['test'](_0x354821)){const _0x22853c=parseSegmentRef(_0x354821);if(_0x22853c['type']===_0x224120(0x14b))_0x478a96?.['resolveSegmentId']&&(_0x354821=await _0x478a96[_0x224120(0x1e6)](_0x22853c['name']));else{if(_0x22853c['type']===_0x224120(0x145)&&_0x50c886[_0x22853c['name']])_0x478a96?.[_0x224120(0x13b)]&&(_0x354821=await _0x478a96[_0x224120(0x13b)](_0x22853c['name'],_0x50c886[_0x22853c[_0x224120(0x1f0)]]));else _0x478a96?.[_0x224120(0x1e6)]&&(_0x354821=await _0x478a96[_0x224120(0x1e6)](_0x22853c[_0x224120(0x1f0)]));}}const _0x3bda63={'name':_0x1d5bd5[_0x224120(0x1f0)],'segmentId':_0x354821};_0x1d5bd5[_0x224120(0x1c4)]&&(_0x3bda63[_0x224120(0x1c4)]=_0x1d5bd5[_0x224120(0x1c4)]);if(_0x1d5bd5[_0x224120(0x1e7)]){const _0x3e47bb=_0x1d5bd5[_0x224120(0x1e7)]['journey'],_0x2186bf=_0x1d5bd5['target'][_0x224120(0x19e)];let _0x515164=_0x1d5bd5[_0x224120(0x1e7)][_0x224120(0x1ba)];_0x478a96?.[_0x224120(0x157)]&&!/^\d+$/[_0x224120(0x16e)](_0x515164)&&(_0x515164=await _0x478a96['resolveJourneyId'](_0x515164));let _0x284fd9=_0x1d5bd5[_0x224120(0x1e7)]['stage'];_0x478a96?.['resolveStageId']&&!/^\d+$/[_0x224120(0x16e)](_0x284fd9)&&(_0x284fd9=await _0x478a96[_0x224120(0x1c0)](_0x515164,_0x284fd9));const _0xdb3dc3=!/^\d+$/['test'](_0x3e47bb)&&!isLocalJourneyRef(_0x3e47bb)?formatApiJourneyName(_0x3e47bb,_0x2186bf):undefined;_0x3bda63['target']={'journeyId':_0x515164,'journeyStageId':_0x284fd9,'journeyName':_0xdb3dc3,'confirmed':!![]},_0x1d5bd5[_0x224120(0x1e7)][_0x224120(0x1d1)]&&(_0x3bda63[_0x224120(0x1e7)][_0x224120(0x181)]=_0x1d5bd5['target'][_0x224120(0x1d1)]);}return _0x3bda63;}async function convertYamlStepToApi(_0x391750,_0x1168a4,_0x59018c={},_0x4a43bc={},_0x1af7cf={}){const _0x479cf0=a109_0x4373,_0x130b1e=async _0x44a6d3=>{const _0xe90239=a109_0x4373;if(/^\d+$/['test'](_0x44a6d3))return _0x44a6d3;const _0x4be1ad=parseSegmentRef(_0x44a6d3);if(_0x4be1ad[_0xe90239(0x138)]===_0xe90239(0x14b)){if(_0x1168a4?.[_0xe90239(0x1e6)])return await _0x1168a4[_0xe90239(0x1e6)](_0x4be1ad[_0xe90239(0x1f0)]);}else{if(_0x4be1ad[_0xe90239(0x138)]==='embedded'&&_0x59018c[_0x4be1ad[_0xe90239(0x1f0)]]){if(_0x1168a4?.['resolveEmbeddedSegmentId'])return await _0x1168a4[_0xe90239(0x13b)](_0x4be1ad['name'],_0x59018c[_0x4be1ad[_0xe90239(0x1f0)]]);}else{if(_0x1168a4?.[_0xe90239(0x1e6)])return await _0x1168a4[_0xe90239(0x1e6)](_0x4be1ad[_0xe90239(0x1f0)]);}}return _0x44a6d3;},_0x45218d=async _0x14a499=>{const _0x3ff4d8=a109_0x4373;if(/^\d+$/['test'](_0x14a499))return _0x14a499;const _0x3003d8=parseSegmentRef(_0x14a499);if(_0x3003d8[_0x3ff4d8(0x138)]===_0x3ff4d8(0x14b)){if(_0x1168a4?.['resolveActivationId'])return await _0x1168a4[_0x3ff4d8(0x177)](_0x3003d8[_0x3ff4d8(0x1f0)]);return _0x3003d8[_0x3ff4d8(0x1f0)];}else{if(_0x3003d8[_0x3ff4d8(0x138)]===_0x3ff4d8(0x145)&&_0x1af7cf[_0x3003d8[_0x3ff4d8(0x1f0)]]){if(_0x1168a4?.[_0x3ff4d8(0x197)])return await _0x1168a4[_0x3ff4d8(0x197)](_0x3003d8[_0x3ff4d8(0x1f0)],_0x1af7cf[_0x3003d8['name']]);if(_0x1168a4?.[_0x3ff4d8(0x177)])return await _0x1168a4[_0x3ff4d8(0x177)](_0x3003d8[_0x3ff4d8(0x1f0)]);}else{if(_0x1168a4?.[_0x3ff4d8(0x177)])return await _0x1168a4[_0x3ff4d8(0x177)](_0x3003d8['name']);}}return _0x14a499;},_0x31937f=_0x3eaa53=>{if(!_0x3eaa53)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x3eaa53))return _0x3eaa53;return _0x4a43bc[_0x3eaa53]||_0x3eaa53;};switch(_0x391750[_0x479cf0(0x138)]){case _0x479cf0(0x1fe):{const _0xbd2d8b=_0x391750,_0x5a97dd=_0xbd2d8b[_0x479cf0(0x14a)],_0x3256b4={'type':_0x479cf0(0x186),'name':_0xbd2d8b[_0x479cf0(0x1f0)],'next':_0x31937f(_0xbd2d8b[_0x479cf0(0x1b8)])};if(_0x5a97dd[_0x479cf0(0x14d)]!==undefined&&_0x5a97dd[_0x479cf0(0x1e1)])_0x3256b4['waitStepType']=_0x479cf0(0x158),_0x3256b4['waitStep']=_0x5a97dd['duration'],_0x3256b4['waitStepUnit']=normalizeWaitUnit(_0x5a97dd[_0x479cf0(0x1e1)]);else{if(_0x5a97dd[_0x479cf0(0x146)])_0x3256b4[_0x479cf0(0x162)]=_0x479cf0(0x1a6),_0x3256b4[_0x479cf0(0x18f)]=_0x5a97dd['wait_until'];else{if(_0x5a97dd['days_of_week'])_0x3256b4[_0x479cf0(0x162)]='DaysOfTheWeek',_0x3256b4[_0x479cf0(0x139)]=_0x5a97dd['days_of_week'];else{if(_0x5a97dd[_0x479cf0(0x1c2)]){_0x3256b4[_0x479cf0(0x162)]=_0x479cf0(0x1d5);const _0x2f9271=await _0x130b1e(_0x5a97dd[_0x479cf0(0x1c2)][_0x479cf0(0x1e0)]),_0x232a38=_0x5a97dd[_0x479cf0(0x1c2)][_0x479cf0(0x1a5)]?.[_0x479cf0(0x1b8)]!==undefined;if(_0x232a38){const _0x2cd3de=[];_0x2cd3de['push']({'id':generateUUID(),'segmentId':_0x2f9271,'timedOutPath':![],'name':_0x479cf0(0x201),'next':_0x31937f(_0x5a97dd['condition'][_0x479cf0(0x1b8)]??_0xbd2d8b['next'])});if(_0x5a97dd['condition'][_0x479cf0(0x1a5)]){const _0x2ff71a=_0x5a97dd[_0x479cf0(0x1c2)]['timeout'][_0x479cf0(0x14d)],_0xe19858=normalizeWaitUnit(_0x5a97dd[_0x479cf0(0x1c2)][_0x479cf0(0x1a5)][_0x479cf0(0x1e1)]);_0x2cd3de[_0x479cf0(0x1ef)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x479cf0(0x1fb)+_0x2ff71a+'\x20'+_0xe19858,'moveAfter':_0x2ff71a,'unit':_0xe19858,'next':_0x31937f(_0x5a97dd[_0x479cf0(0x1c2)][_0x479cf0(0x1a5)][_0x479cf0(0x1b8)])});}_0x3256b4['conditions']=_0x2cd3de,delete _0x3256b4['next'];}else _0x3256b4[_0x479cf0(0x17e)]=_0x2f9271,_0x5a97dd['condition']['timeout']&&(_0x3256b4['conditionTimeoutDuration']=_0x5a97dd[_0x479cf0(0x1c2)][_0x479cf0(0x1a5)][_0x479cf0(0x14d)],_0x5a97dd['condition']['timeout'][_0x479cf0(0x1e1)]&&(_0x3256b4[_0x479cf0(0x1eb)]=normalizeWaitUnit(_0x5a97dd[_0x479cf0(0x1c2)][_0x479cf0(0x1a5)]['unit'])));}}}}return _0x3256b4;}case _0x479cf0(0x19a):{const _0x2f4904=_0x391750,_0x2634cd=_0x2f4904[_0x479cf0(0x14a)][_0x479cf0(0x19a)],_0x44aee8=await _0x45218d(_0x2634cd);return{'type':_0x479cf0(0x1d6),'name':_0x2f4904[_0x479cf0(0x1f0)],'journeyActivationStepId':_0x44aee8,'next':_0x31937f(_0x2f4904['next'])};}case _0x479cf0(0x1d7):{const _0x592a9b=_0x391750,_0x162118=_0x592a9b[_0x479cf0(0x14a)]['branches'];return{'type':_0x479cf0(0x1e8),'name':_0x592a9b[_0x479cf0(0x1f0)],'branches':await Promise[_0x479cf0(0x1e2)](_0x162118['map'](async _0x40e817=>{const _0x48957a=_0x479cf0;let _0x5dad60='';if(!_0x40e817[_0x48957a(0x1a0)]){const _0x52bfb1=_0x40e817['segment']||_0x40e817[_0x48957a(0x1b6)]||'';_0x5dad60=_0x52bfb1?await _0x130b1e(_0x52bfb1):'';}return{'id':crypto['randomUUID'](),'name':_0x40e817['name'],'description':null,'segmentId':_0x5dad60,'excludedPath':_0x40e817[_0x48957a(0x1a0)]??![],'next':_0x31937f(_0x40e817['next'])};})),'next':_0x31937f(_0x592a9b['next'])};}case _0x479cf0(0x151):{const _0x4e3e41=_0x391750,_0x8bc6a=_0x4e3e41[_0x479cf0(0x14a)];return{'type':'ABTest','name':_0x4e3e41[_0x479cf0(0x1f0)],'customizedSplit':_0x8bc6a[_0x479cf0(0x195)],'uniqueId':_0x8bc6a[_0x479cf0(0x18c)],'variants':_0x8bc6a['variants'][_0x479cf0(0x164)](_0x57d3ea=>({'id':_0x57d3ea['id']||generateUUID(),'name':_0x57d3ea[_0x479cf0(0x1f0)],'percentage':_0x57d3ea['percentage'],'next':_0x31937f(_0x57d3ea[_0x479cf0(0x1b8)])})),'next':_0x31937f(_0x4e3e41['next'])};}case'merge':return{'type':_0x479cf0(0x1dd),'name':_0x391750[_0x479cf0(0x1f0)],'next':_0x31937f(_0x391750[_0x479cf0(0x1b8)])};case _0x479cf0(0x13a):{const _0xef9cba=_0x391750,_0x89de56=_0xef9cba[_0x479cf0(0x14a)][_0x479cf0(0x1e7)],_0x2b4a84=_0x89de56['journey'],_0x2b991f=_0x89de56[_0x479cf0(0x19e)];let _0x2b7000=_0x89de56['journey'];_0x1168a4?.['resolveJourneyId']&&!/^\d+$/[_0x479cf0(0x16e)](_0x2b7000)&&(_0x2b7000=await _0x1168a4[_0x479cf0(0x157)](_0x2b7000));let _0x4b1696=_0x89de56[_0x479cf0(0x19e)];_0x1168a4?.[_0x479cf0(0x1c0)]&&!/^\d+$/[_0x479cf0(0x16e)](_0x4b1696)&&(_0x4b1696=await _0x1168a4[_0x479cf0(0x1c0)](_0x2b7000,_0x4b1696));const _0xce3b8e=!/^\d+$/[_0x479cf0(0x16e)](_0x2b4a84)&&!isLocalJourneyRef(_0x2b4a84)?formatApiJourneyName(_0x2b4a84,_0x2b991f):undefined;return{'type':_0x479cf0(0x1a7),'name':_0xef9cba[_0x479cf0(0x1f0)],'target':{'journeyId':_0x2b7000,'journeyStageId':_0x4b1696,'journeyBundleId':_0x89de56[_0x479cf0(0x1d1)],'journeyName':_0xce3b8e,'confirmed':!![]},'next':_0x31937f(_0xef9cba[_0x479cf0(0x1b8)])};}case'end':return{'type':_0x479cf0(0x194),'name':_0x391750[_0x479cf0(0x1f0)]};default:{const _0x56af46=_0x391750;return{'type':_0x479cf0(0x194),'name':_0x56af46['name']};}}}export function toYamlString(_0x2c52ac){const _0x56d655=a109_0x4373,_0x1ee01f=stripInternalFields(_0x2c52ac),_0x3b8a8f=a109_0x109bc7['stringify'](_0x1ee01f,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x5eea80=[_0x56d655(0x175),'activations:','goal:','reentry:','journeys:','stages:',_0x56d655(0x191)];let _0xa93761=_0x3b8a8f;for(const _0x54d8f0 of _0x5eea80){_0xa93761=_0xa93761[_0x56d655(0x160)](new RegExp('^('+_0x54d8f0+')','m'),(_0x10fdc9,_0x2922c5,_0x3db3a9)=>{if(_0x3db3a9===0x0||_0xa93761[_0x3db3a9-0x1]==='\x0a'&&_0xa93761[_0x3db3a9-0x2]==='\x0a')return _0x2922c5;return'\x0a'+_0x2922c5;});}return _0xa93761;}function stripInternalFields(_0x12a5f6){const _0x483d6d=a109_0x4373,{id:_0x48950a,folder_id:_0x5e0c5a,bundle_id:_0x27800f,bundle_name:_0x8158d9,version:_0x1f8a06,version_number:_0x28ea54,allow_reentry:_0x39c0a6,..._0x36c3df}=_0x12a5f6;return _0x36c3df['journeys']&&(_0x36c3df[_0x483d6d(0x1df)]=_0x36c3df['journeys'][_0x483d6d(0x164)](_0x4d4394=>{const _0x50f54a=_0x483d6d,{id:_0x3d2f85,version_number:_0x4b25f6,..._0x372965}=_0x4d4394;return{..._0x372965,'stages':_0x372965[_0x50f54a(0x1ca)][_0x50f54a(0x164)](stripStageInternalFields),..._0x4d4394[_0x50f54a(0x1aa)]===!![]?{'latest':!![]}:{},..._0x36c3df['journeys'][_0x50f54a(0x1fd)]===0x1&&_0x372965[_0x50f54a(0x1f1)]==='v1'?{'version':undefined}:{}};})),_0x36c3df[_0x483d6d(0x1ca)]&&(_0x36c3df[_0x483d6d(0x1ca)]=_0x36c3df[_0x483d6d(0x1ca)][_0x483d6d(0x164)](stripStageInternalFields)),_0x36c3df[_0x483d6d(0x1ae)]&&(_0x36c3df['versions']=_0x36c3df[_0x483d6d(0x1ae)]['map'](_0x24b0f4=>{const _0x48baeb=_0x483d6d,{id:_0x1c2bba,version_number:_0x170e8c,..._0x5c8237}=_0x24b0f4;return{..._0x5c8237,'stages':_0x5c8237[_0x48baeb(0x1ca)][_0x48baeb(0x164)](stripStageInternalFields),..._0x24b0f4[_0x48baeb(0x1aa)]===!![]?{'latest':!![]}:{}};})),_0x36c3df;}function stripStageInternalFields(_0x524cd6){const {id:_0x237f2d,..._0x4f565b}=_0x524cd6;return _0x4f565b;}export function parseYamlString(_0x1a313b){const _0x527f60=a109_0x4373,_0x18fd7d=a109_0x109bc7[_0x527f60(0x1f9)](_0x1a313b);if(_0x18fd7d[_0x527f60(0x138)]!==_0x527f60(0x1ba))throw new SDKError(ErrorCode[_0x527f60(0x13c)],_0x527f60(0x170));if(!_0x18fd7d[_0x527f60(0x1f0)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x527f60(0x199));const _0x53319a=_0x18fd7d[_0x527f60(0x1df)]&&Array[_0x527f60(0x163)](_0x18fd7d[_0x527f60(0x1df)])&&_0x18fd7d['journeys'][_0x527f60(0x1fd)]>0x0,_0x156cb6=_0x18fd7d[_0x527f60(0x1ca)]&&Array[_0x527f60(0x163)](_0x18fd7d[_0x527f60(0x1ca)])&&_0x18fd7d[_0x527f60(0x1ca)]['length']>0x0,_0x3595d1=_0x18fd7d['versions']&&Array[_0x527f60(0x163)](_0x18fd7d[_0x527f60(0x1ae)])&&_0x18fd7d[_0x527f60(0x1ae)][_0x527f60(0x1fd)]>0x0,_0x5ef8db=[_0x53319a,_0x156cb6,_0x3595d1]['filter'](Boolean)[_0x527f60(0x1fd)];if(_0x5ef8db>0x1)throw new SDKError(ErrorCode[_0x527f60(0x13c)],_0x527f60(0x16f));if(_0x5ef8db===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x527f60(0x1b4));if(_0x53319a){for(let _0x4e946f=0x0;_0x4e946f<_0x18fd7d[_0x527f60(0x1df)][_0x527f60(0x1fd)];_0x4e946f++){const _0x40050b=_0x18fd7d[_0x527f60(0x1df)][_0x4e946f];if(!_0x40050b[_0x527f60(0x1ca)]||!Array[_0x527f60(0x163)](_0x40050b[_0x527f60(0x1ca)])||_0x40050b[_0x527f60(0x1ca)][_0x527f60(0x1fd)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20journeys['+_0x4e946f+_0x527f60(0x17c));if(_0x40050b[_0x527f60(0x13e)]&&!['draft','launched'][_0x527f60(0x1ab)](_0x40050b['state']))throw new SDKError(ErrorCode[_0x527f60(0x13c)],_0x527f60(0x1d9)+_0x4e946f+']\x20has\x20invalid\x20state:\x20'+_0x40050b[_0x527f60(0x13e)]+_0x527f60(0x1f6));validateStages(_0x40050b[_0x527f60(0x1ca)],_0x527f60(0x15d)+_0x4e946f+_0x527f60(0x18d));}const _0x191856=_0x18fd7d['journeys'][_0x527f60(0x17f)](_0x1f0e93=>_0x1f0e93[_0x527f60(0x1aa)]===!![])['length'];if(_0x191856>0x1)throw new SDKError(ErrorCode[_0x527f60(0x13c)],_0x527f60(0x152));}_0x156cb6&&validateStages(_0x18fd7d[_0x527f60(0x1ca)],_0x527f60(0x1ca));if(_0x3595d1){for(let _0x4a456b=0x0;_0x4a456b<_0x18fd7d[_0x527f60(0x1ae)][_0x527f60(0x1fd)];_0x4a456b++){const _0x5632d1=_0x18fd7d[_0x527f60(0x1ae)][_0x4a456b];if(!_0x5632d1[_0x527f60(0x1f0)])throw new SDKError(ErrorCode[_0x527f60(0x13c)],_0x527f60(0x16c)+_0x4a456b+_0x527f60(0x192));if(!_0x5632d1[_0x527f60(0x13e)]||!['draft',_0x527f60(0x147)]['includes'](_0x5632d1[_0x527f60(0x13e)]))throw new SDKError(ErrorCode[_0x527f60(0x13c)],_0x527f60(0x16c)+_0x4a456b+_0x527f60(0x193)+_0x5632d1[_0x527f60(0x13e)]+_0x527f60(0x1f6));if(!_0x5632d1['stages']||!Array[_0x527f60(0x163)](_0x5632d1[_0x527f60(0x1ca)])||_0x5632d1[_0x527f60(0x1ca)][_0x527f60(0x1fd)]===0x0)throw new SDKError(ErrorCode[_0x527f60(0x13c)],'Journey\x20YAML\x20versions['+_0x4a456b+']\x20missing\x20required\x20field:\x20stages');validateStages(_0x5632d1[_0x527f60(0x1ca)],_0x527f60(0x1cf)+_0x4a456b+'].stages');}const _0x21048d=_0x18fd7d[_0x527f60(0x1ae)]['filter'](_0x32f47f=>_0x32f47f['latest']===!![])['length'];if(_0x21048d>0x1)throw new SDKError(ErrorCode[_0x527f60(0x13c)],'Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true');}return _0x18fd7d;}function validateStages(_0x56799a,_0x4c1622){const _0x3c66ac=a109_0x4373;if(_0x56799a['length']>0x8)throw new SDKError(ErrorCode[_0x3c66ac(0x13c)],_0x3c66ac(0x1e9)+_0x4c1622+':\x20maximum\x208\x20stages\x20allowed');}export function isJourneyDef(_0x43f971){const _0x30422a=a109_0x4373;return typeof _0x43f971===_0x30422a(0x1cc)&&_0x43f971!==null&&_0x30422a(0x138)in _0x43f971&&_0x43f971[_0x30422a(0x138)]==='journey';}export function generateTemplate(_0x2866d9,_0x158cc5){const _0x29241e=a109_0x4373,_0xcc6786={'type':_0x29241e(0x1ba),'name':_0x2866d9,'description':_0x29241e(0x1bd),'reentry':'no_reentry','goal':{'name':_0x29241e(0x1a2),'segment':'goal-segment'},'stages':[{'name':_0x29241e(0x169),'description':_0x29241e(0x173),'entry_criteria':{'name':_0x29241e(0x17d),'segment':_0x158cc5},'steps':[{'type':_0x29241e(0x1fe),'name':_0x29241e(0x203),'with':{'duration':0x1,'unit':_0x29241e(0x168)}},{'type':_0x29241e(0x19a),'name':_0x29241e(0x15a),'with':{'activation':_0x29241e(0x1d0)}},{'type':'end','name':_0x29241e(0x13f)}]}]};return toYamlString(_0xcc6786);}function generateUUID(){const _0x5e4df3=a109_0x4373;return crypto[_0x5e4df3(0x144)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x24bf50){const _0x150676=a109_0x4373;if(_0x24bf50[_0x150676(0x1dc)](SEGMENT_REF_PREFIX))return{'type':_0x150676(0x14b),'name':_0x24bf50[_0x150676(0x18e)](SEGMENT_REF_PREFIX[_0x150676(0x1fd)])};if(/^\d+$/[_0x150676(0x16e)](_0x24bf50))return{'type':'id','name':_0x24bf50};return{'type':_0x150676(0x145),'name':_0x24bf50};}export function makeSegmentRef(_0x2acd07){return''+SEGMENT_REF_PREFIX+_0x2acd07;}export function isExternalSegmentRef(_0x3b7f11){const _0x4f288d=a109_0x4373;return _0x3b7f11[_0x4f288d(0x1dc)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x215f4b){const _0x2d02da=a109_0x4373;return!!(_0x215f4b[_0x2d02da(0x1df)]&&_0x215f4b['journeys'][_0x2d02da(0x1fd)]>0x0);}export function isMultiVersionMode(_0x4c76c9){const _0x2d1a29=a109_0x4373;return!!(_0x4c76c9['versions']&&_0x4c76c9['versions'][_0x2d1a29(0x1fd)]>0x0);}export function isSingleVersionMode(_0x270503){const _0x478e4a=a109_0x4373;return!!(_0x270503[_0x478e4a(0x1ca)]&&_0x270503[_0x478e4a(0x1ca)]['length']>0x0);}export function hasMultipleVersions(_0x30262e){const _0x1f2fb9=a109_0x4373;if(isJourneysArrayMode(_0x30262e))return(_0x30262e[_0x1f2fb9(0x1df)]?.[_0x1f2fb9(0x1fd)]||0x0)>0x1;if(isMultiVersionMode(_0x30262e))return(_0x30262e['versions']?.[_0x1f2fb9(0x1fd)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x4c025f){const _0xe5c045=a109_0x4373;if(isJourneysArrayMode(_0x4c025f))return _0x4c025f;if(isSingleVersionMode(_0x4c025f)){const {stages:_0x259145,id:_0x504fae,version:_0x36f734,version_number:_0x598e60,..._0x1bf91c}=_0x4c025f;return{..._0x1bf91c,'journeys':[{'version':_0x36f734||'v1','stages':_0x259145||[],'id':_0x504fae,'version_number':_0x598e60}]};}if(isMultiVersionMode(_0x4c025f)){const {versions:_0x56069d,..._0x1751e5}=_0x4c025f;return{..._0x1751e5,'journeys':(_0x56069d||[])['map'](_0x40bf8e=>({'version':_0x40bf8e['name'],'state':_0x40bf8e[_0xe5c045(0x13e)],'latest':_0x40bf8e['latest'],'stages':_0x40bf8e[_0xe5c045(0x1ca)],'id':_0x40bf8e['id'],'version_number':_0x40bf8e[_0xe5c045(0x1db)]}))};}return _0x4c025f;}export function normalizeJourneyDef(_0x5a1bfe,_0xf62cae){const _0x2180d9=a109_0x4373,_0x9980dd=normalizeToJourneysFormat(_0x5a1bfe),_0x40694b=_0xf62cae?.[_0x2180d9(0x1a8)]?Object[_0x2180d9(0x1c8)](_0xf62cae[_0x2180d9(0x1a8)]):undefined,_0x2996b8=_0xf62cae?.[_0x2180d9(0x1b9)]?Object[_0x2180d9(0x1c8)](_0xf62cae[_0x2180d9(0x1b9)]):undefined;return{'type':'journey','name':_0x9980dd[_0x2180d9(0x1f0)],..._0x9980dd[_0x2180d9(0x1c4)]!==undefined&&{'description':_0x9980dd[_0x2180d9(0x1c4)]},..._0x9980dd[_0x2180d9(0x14c)]&&{'goal':normalizeJourneyCriteria(_0x9980dd['goal'])},..._0x9980dd[_0x2180d9(0x1ee)]!==undefined&&{'reentry':_0x9980dd[_0x2180d9(0x1ee)]},..._0x9980dd['segments']&&{'segments':normalizeEmbeddedSegments(_0x9980dd[_0x2180d9(0x1a8)],_0x40694b)},..._0x9980dd[_0x2180d9(0x1b9)]&&{'activations':normalizeEmbeddedActivations(_0x9980dd[_0x2180d9(0x1b9)],_0x2996b8)},..._0x9980dd[_0x2180d9(0x1df)]&&{'journeys':_0x9980dd[_0x2180d9(0x1df)]['map'](_0x3714b7=>normalizeJourneyEntry(_0x3714b7,_0x9980dd['journeys'][_0x2180d9(0x1fd)]===0x1))}};}function a109_0x30c1(){const _0x2b1177=['resolveSegmentName','(missing)','with','ref','goal','duration','waitCondition','entry_criteria','folder_id','ab_test','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','resolveActivationName','stageId','\x20\x20\x20\x20type:\x20','days_of_week','resolveJourneyId','Duration','entries','Send\x20Notification','conditionTimeoutDuration','branches','journeys[','\x20\x20rule:\x0a','stageName','replace','toLowerCase','waitStepType','isArray','map','segmentId','timedOutPath','draft','day','Stage\x201','exitCriteria','waitStepUnit','Journey\x20YAML\x20versions[','69051bYiJCt','test','Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.','Journey\x20YAML\x20must\x20have\x20type:\x20journey','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','parentFolder','First\x20stage\x20of\x20the\x20journey','AbTest','segments:','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','resolveActivationId','5845336ruDakS','size','days','definition',']\x20missing\x20required\x20field:\x20stages','Entry\x20Criteria','conditionSegmentId','filter','milestone','journeyBundleId','uniqueId','9574983bJWQtc','values','attributes','WaitStep','9gjYJIa','versionNumber','no_reentry','schedule','116DjwpSX','unique_id','].stages','slice','waitUntilDate','columns','versions:',']\x20missing\x20required\x20field:\x20name',']\x20has\x20invalid\x20state:\x20','End','customized_split','journeyName','resolveEmbeddedActivationId','match','Journey\x20YAML\x20missing\x20required\x20field:\x20name','activation','waitStep','reentryMode','exitCriterias','stage','Jump\x20step\x20\x22','excluded','13632lwERra','Goal\x20Achieved','resolveJumpTarget','relationships','timeout','Date','Jump','segments','data','latest','includes','journeyStageId','And','versions','end','weeks','45570OwVFqs','entryCriteria','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','from','segment_id','journeyStages','next','activations','journey','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','exit_criteria','Journey\x20description','set','Expected\x20format:\x0a','resolveStageId','DaysOfTheWeek','condition','7QrkAaK','description','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','isJourneyLocal','root_step','keys','resolveSegment','stages','uuid','object','sort','allowReentry','versions[','your-activation-name','bundle_id','excludedPath','behavior','rootStep','Condition','Activation','decision_point','week','Journey\x20YAML\x20journeys[','connection','version_number','startsWith','Merge','add','journeys','segment','unit','all','reentry_always','20VhYlCv','moveAfter','resolveSegmentId','target','DecisionPoint','Journey\x20YAML\x20','has','conditionTimeoutUnit','steps','percentage','reentry','push','name','version','\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)','all_columns','\x20\x20\x20\x20conditions:\x0a','activation_template_id','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','rule','1955725AvDAVg','parse','find','*Max\x20wait\x20','journeyId','length','wait','resolveActivation','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','Met\x20condition(s)','ABTest','Wait\x201\x20Day','get','trim','type','daysOfWeek','jump','resolveEmbeddedSegmentId','JOURNEY_SYNTAX_ERROR','variants','state','Stage\x20Complete','4742664nCojKU','\x27:\x20','journeyBundleName','conditions','randomUUID','embedded','wait_until','launched'];a109_0x30c1=function(){return _0x2b1177;};return a109_0x30c1();}function normalizeJourneyEntry(_0x256a05,_0x56b6ce){const _0xe99cb3=a109_0x4373;return{...!_0x56b6ce&&_0x256a05[_0xe99cb3(0x1f1)]!==undefined&&{'version':_0x256a05[_0xe99cb3(0x1f1)]},..._0x256a05['state']!==undefined&&{'state':_0x256a05[_0xe99cb3(0x13e)]},...!_0x56b6ce&&_0x256a05['latest']!==undefined&&{'latest':_0x256a05['latest']},..._0x256a05[_0xe99cb3(0x14c)]&&{'goal':normalizeJourneyCriteria(_0x256a05[_0xe99cb3(0x14c)])},..._0x256a05['reentry']!==undefined&&{'reentry':_0x256a05['reentry']},'stages':_0x256a05[_0xe99cb3(0x1ca)][_0xe99cb3(0x164)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x303d36){const _0x59fd91=a109_0x4373;return{'name':_0x303d36[_0x59fd91(0x1f0)],..._0x303d36[_0x59fd91(0x1c4)]!==undefined&&{'description':_0x303d36[_0x59fd91(0x1c4)]},..._0x303d36[_0x59fd91(0x14f)]&&{'entry_criteria':normalizeJourneyCriteria(_0x303d36['entry_criteria'])},..._0x303d36[_0x59fd91(0x1bc)]&&{'exit_criteria':_0x303d36[_0x59fd91(0x1bc)][_0x59fd91(0x164)](normalizeJourneyCriteria)},..._0x303d36[_0x59fd91(0x180)]&&{'milestone':normalizeJourneyCriteria(_0x303d36[_0x59fd91(0x180)])},..._0x303d36[_0x59fd91(0x1ec)]&&{'steps':normalizeStepsWithImplicitNext(_0x303d36['steps'])}};}function a109_0x4373(_0x47b61b,_0x2137f3){_0x47b61b=_0x47b61b-0x138;const _0x30c1ff=a109_0x30c1();let _0x437364=_0x30c1ff[_0x47b61b];return _0x437364;}function normalizeStepsWithImplicitNext(_0x1e0380){const _0x6a5f23=a109_0x4373;return _0x1e0380[_0x6a5f23(0x164)]((_0x2a162f,_0x56f3b0)=>{const _0x280ce9=_0x6a5f23,_0x21265a=_0x56f3b0<_0x1e0380[_0x280ce9(0x1fd)]-0x1?_0x1e0380[_0x56f3b0+0x1][_0x280ce9(0x1f0)]:undefined;return normalizeJourneyStep(_0x2a162f,_0x21265a);});}function normalizeJourneyCriteria(_0x318828){const _0x41b725=a109_0x4373;return{'name':_0x318828[_0x41b725(0x1f0)],..._0x318828[_0x41b725(0x1c4)]!==undefined&&{'description':_0x318828[_0x41b725(0x1c4)]},'segment':_0x318828['segment'],..._0x318828['target']&&{'target':normalizeJumpTarget(_0x318828[_0x41b725(0x1e7)])}};}function normalizeJourneyStep(_0x486fd0,_0x499bf4){const _0x4b746d=a109_0x4373,_0x34786e=_0x486fd0[_0x4b746d(0x1b8)]!==undefined&&_0x486fd0[_0x4b746d(0x1b8)]!==_0x499bf4,_0x5be085={'type':_0x486fd0['type'],'name':_0x486fd0[_0x4b746d(0x1f0)],..._0x34786e&&{'next':_0x486fd0['next']}};if('with'in _0x486fd0&&_0x486fd0[_0x4b746d(0x14a)])return{..._0x5be085,'with':normalizeStepParams(_0x486fd0[_0x4b746d(0x138)],_0x486fd0['with'])};return _0x5be085;}function normalizeStepParams(_0x30bf26,_0x567c99){const _0x47ad3a=a109_0x4373;switch(_0x30bf26){case _0x47ad3a(0x1fe):{const _0x4f6a9a=_0x567c99;let _0x4bb6ea;return _0x4f6a9a[_0x47ad3a(0x1c2)]&&(_0x4bb6ea={'segment':_0x4f6a9a[_0x47ad3a(0x1c2)][_0x47ad3a(0x1e0)],..._0x4f6a9a['condition']['next']!==undefined&&{'next':_0x4f6a9a[_0x47ad3a(0x1c2)][_0x47ad3a(0x1b8)]},..._0x4f6a9a[_0x47ad3a(0x1c2)]['timeout']&&{'timeout':{'duration':_0x4f6a9a['condition']['timeout']['duration'],'unit':_0x4f6a9a[_0x47ad3a(0x1c2)][_0x47ad3a(0x1a5)][_0x47ad3a(0x1e1)],..._0x4f6a9a[_0x47ad3a(0x1c2)][_0x47ad3a(0x1a5)]['next']!==undefined&&{'next':_0x4f6a9a[_0x47ad3a(0x1c2)][_0x47ad3a(0x1a5)]['next']}}}}),{..._0x4f6a9a[_0x47ad3a(0x14d)]!==undefined&&{'duration':_0x4f6a9a[_0x47ad3a(0x14d)]},..._0x4f6a9a[_0x47ad3a(0x1e1)]!==undefined&&{'unit':_0x4f6a9a[_0x47ad3a(0x1e1)]},..._0x4f6a9a['wait_until']!==undefined&&{'wait_until':_0x4f6a9a[_0x47ad3a(0x146)]},..._0x4f6a9a[_0x47ad3a(0x156)]!==undefined&&{'days_of_week':_0x4f6a9a[_0x47ad3a(0x156)]},..._0x4bb6ea&&{'condition':_0x4bb6ea}};}case'activation':{const _0x4996b8=_0x567c99;return{'activation':_0x4996b8[_0x47ad3a(0x19a)]};}case _0x47ad3a(0x1d7):{const _0x275b43=_0x567c99;return{'branches':_0x275b43[_0x47ad3a(0x15c)]['map'](normalizeDecisionBranch)};}case _0x47ad3a(0x151):{const _0x1f7be7=_0x567c99;return{..._0x1f7be7[_0x47ad3a(0x195)]!==undefined&&{'customized_split':_0x1f7be7[_0x47ad3a(0x195)]},..._0x1f7be7[_0x47ad3a(0x18c)]!==undefined&&{'unique_id':_0x1f7be7[_0x47ad3a(0x18c)]},'variants':_0x1f7be7['variants'][_0x47ad3a(0x164)](normalizeAbTestVariant)};}case'jump':{const _0x5e641e=_0x567c99;return{'target':normalizeJumpTarget(_0x5e641e['target'])};}default:return _0x567c99;}}function normalizeDecisionBranch(_0x2f2bc6){const _0x491ac8=a109_0x4373;return{'name':_0x2f2bc6[_0x491ac8(0x1f0)],..._0x2f2bc6[_0x491ac8(0x1e0)]!==undefined&&{'segment':_0x2f2bc6[_0x491ac8(0x1e0)]},..._0x2f2bc6[_0x491ac8(0x1a0)]!==undefined&&{'excluded':_0x2f2bc6[_0x491ac8(0x1a0)]},..._0x2f2bc6[_0x491ac8(0x1b8)]!==undefined&&{'next':_0x2f2bc6[_0x491ac8(0x1b8)]}};}function normalizeAbTestVariant(_0x511806){const _0x942a16=a109_0x4373;return{..._0x511806['id']!==undefined&&{'id':_0x511806['id']},'name':_0x511806[_0x942a16(0x1f0)],'percentage':_0x511806[_0x942a16(0x1ed)],..._0x511806['next']!==undefined&&{'next':_0x511806[_0x942a16(0x1b8)]}};}function normalizeJumpTarget(_0x472571){const _0x3dc0e3=a109_0x4373;return{'journey':_0x472571[_0x3dc0e3(0x1ba)],'stage':_0x472571['stage'],..._0x472571[_0x3dc0e3(0x1d1)]!==undefined&&{'bundle_id':_0x472571[_0x3dc0e3(0x1d1)]}};}function normalizeEmbeddedSegments(_0x4f0a12,_0x8f5e55){const _0x56b8a2=a109_0x4373,_0x57c0d1={},_0x555149=Object[_0x56b8a2(0x1c8)](_0x4f0a12),_0x44afd3=_0x8f5e55?[..._0x8f5e55['filter'](_0xeda3c4=>_0x555149[_0x56b8a2(0x1ab)](_0xeda3c4)),..._0x555149[_0x56b8a2(0x17f)](_0xe5dc63=>!_0x8f5e55[_0x56b8a2(0x1ab)](_0xe5dc63))[_0x56b8a2(0x1cd)]()]:_0x555149[_0x56b8a2(0x1cd)]();for(const _0x4ff125 of _0x44afd3){const _0x2511c1=_0x4f0a12[_0x4ff125];if(_0x2511c1[_0x56b8a2(0x1f7)]){const _0x59b356=_0x2511c1[_0x56b8a2(0x1f7)];if(_0x59b356[_0x56b8a2(0x138)]!==_0x56b8a2(0x1ad)&&_0x59b356[_0x56b8a2(0x138)]!=='Or'){const _0x440a2e=_0x59b356[_0x56b8a2(0x138)]??_0x56b8a2(0x149);throw new SDKError(ErrorCode[_0x56b8a2(0x13c)],_0x56b8a2(0x1bb)+_0x4ff125+'\x27:\x20'+(_0x56b8a2(0x1c5)+_0x440a2e+'\x27.\x0a')+_0x56b8a2(0x1bf)+_0x56b8a2(0x15e)+'\x20\x20\x20\x20type:\x20And\x0a'+_0x56b8a2(0x1f4)+_0x56b8a2(0x176)+_0x56b8a2(0x171)+_0x56b8a2(0x1b3));}if(!_0x59b356['conditions']||!Array[_0x56b8a2(0x163)](_0x59b356[_0x56b8a2(0x143)]))throw new SDKError(ErrorCode[_0x56b8a2(0x13c)],_0x56b8a2(0x1bb)+_0x4ff125+_0x56b8a2(0x141)+'rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a'+_0x56b8a2(0x1bf)+'\x20\x20rule:\x0a'+(_0x56b8a2(0x155)+_0x59b356[_0x56b8a2(0x138)]+'\x0a')+_0x56b8a2(0x1f4)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x56b8a2(0x171)+_0x56b8a2(0x1b3));}_0x57c0d1[_0x4ff125]={..._0x2511c1[_0x56b8a2(0x1c4)]&&_0x2511c1[_0x56b8a2(0x1c4)][_0x56b8a2(0x205)]()&&{'description':_0x2511c1[_0x56b8a2(0x1c4)]},..._0x2511c1[_0x56b8a2(0x1f7)]&&{'rule':deepSortObject(_0x2511c1['rule'])}};}return _0x57c0d1;}function normalizeEmbeddedActivations(_0x445dda,_0x53522b){const _0x2f12a7=a109_0x4373,_0x237605={},_0x58d39a=Object[_0x2f12a7(0x1c8)](_0x445dda),_0x5f521c=_0x53522b?[..._0x53522b[_0x2f12a7(0x17f)](_0x51c232=>_0x58d39a[_0x2f12a7(0x1ab)](_0x51c232)),..._0x58d39a[_0x2f12a7(0x17f)](_0xd768af=>!_0x53522b[_0x2f12a7(0x1ab)](_0xd768af))[_0x2f12a7(0x1cd)]()]:_0x58d39a[_0x2f12a7(0x1cd)]();for(const _0x55c21b of _0x5f521c){const _0x5e7372=_0x445dda[_0x55c21b];_0x237605[_0x55c21b]={'name':_0x5e7372['name'],'connection':_0x5e7372[_0x2f12a7(0x1da)],..._0x5e7372[_0x2f12a7(0x1c4)]!==undefined&&{'description':_0x5e7372[_0x2f12a7(0x1c4)]},..._0x5e7372[_0x2f12a7(0x1f3)]!==undefined&&{'all_columns':_0x5e7372[_0x2f12a7(0x1f3)]},..._0x5e7372['columns']!==undefined&&{'columns':_0x5e7372[_0x2f12a7(0x190)]},..._0x5e7372[_0x2f12a7(0x1d3)]!==undefined&&{'behavior':_0x5e7372[_0x2f12a7(0x1d3)]},..._0x5e7372[_0x2f12a7(0x18a)]!==undefined&&{'schedule':_0x5e7372['schedule']},..._0x5e7372['notification']!==undefined&&{'notification':_0x5e7372['notification']},..._0x5e7372['connector_config']!==undefined&&{'connector_config':_0x5e7372['connector_config']},..._0x5e7372[_0x2f12a7(0x1f5)]!==undefined&&{'activation_template_id':_0x5e7372[_0x2f12a7(0x1f5)]}};}return _0x237605;}export function getActiveStages(_0x51056b){const _0x1f3685=a109_0x4373;if(isJourneysArrayMode(_0x51056b)){const _0x3caa96=_0x51056b[_0x1f3685(0x1df)]||[],_0x3ea5f0=_0x3caa96[_0x1f3685(0x1fa)](_0x3ea8b3=>_0x3ea8b3[_0x1f3685(0x1aa)]===!![])||_0x3caa96[0x0];return _0x3ea5f0?.[_0x1f3685(0x1ca)]||[];}if(isSingleVersionMode(_0x51056b))return _0x51056b[_0x1f3685(0x1ca)]||[];if(isMultiVersionMode(_0x51056b)){const _0x55db5c=_0x51056b['versions']||[],_0x1a1aae=_0x55db5c[_0x1f3685(0x1fa)](_0x572ab9=>_0x572ab9[_0x1f3685(0x1aa)]===!![])||_0x55db5c[0x0];return _0x1a1aae?.[_0x1f3685(0x1ca)]||[];}return[];}export function getLatestJourneyEntry(_0x2bd709){const _0xe6ea72=a109_0x4373;if(isJourneysArrayMode(_0x2bd709)){const _0x4bcea3=_0x2bd709['journeys']||[];return _0x4bcea3['find'](_0x46ea44=>_0x46ea44[_0xe6ea72(0x1aa)]===!![])||_0x4bcea3[0x0];}if(isMultiVersionMode(_0x2bd709)){const _0xc051e1=_0x2bd709[_0xe6ea72(0x1ae)]||[],_0x19c656=_0xc051e1['find'](_0x47fd28=>_0x47fd28[_0xe6ea72(0x1aa)]===!![])||_0xc051e1[0x0];if(_0x19c656)return{'version':_0x19c656['name'],'state':_0x19c656[_0xe6ea72(0x13e)],'latest':_0x19c656[_0xe6ea72(0x1aa)],'stages':_0x19c656[_0xe6ea72(0x1ca)],'id':_0x19c656['id'],'version_number':_0x19c656[_0xe6ea72(0x1db)]};}if(isSingleVersionMode(_0x2bd709))return{'version':_0x2bd709[_0xe6ea72(0x1f1)]||'v1','state':_0xe6ea72(0x167),'stages':_0x2bd709[_0xe6ea72(0x1ca)]||[],'id':_0x2bd709['id'],'version_number':_0x2bd709['version_number'],'goal':_0x2bd709[_0xe6ea72(0x14c)],'reentry':_0x2bd709[_0xe6ea72(0x1ee)]};return undefined;}export function getLatestVersion(_0x3ffa33){const _0x4b08bd=a109_0x4373;if(!isMultiVersionMode(_0x3ffa33))return undefined;const _0x102b00=_0x3ffa33[_0x4b08bd(0x1ae)]||[];return _0x102b00[_0x4b08bd(0x1fa)](_0x5ede19=>_0x5ede19[_0x4b08bd(0x1aa)]===!![])||_0x102b00[0x0];}export function getEffectiveGoal(_0x18e4f4){const _0x14d756=a109_0x4373,_0x433527=getLatestJourneyEntry(_0x18e4f4);return _0x433527?.[_0x14d756(0x14c)]||_0x18e4f4[_0x14d756(0x14c)];}export function getEffectiveReentry(_0x2067c4){const _0x5f4a6c=a109_0x4373,_0x376548=getLatestJourneyEntry(_0x2067c4);return _0x376548?.[_0x5f4a6c(0x1ee)]||_0x2067c4[_0x5f4a6c(0x1ee)];}export function collectSegmentRefs(_0x210f8d){const _0x5aa66d=a109_0x4373,_0x54fc4c=new Set();_0x210f8d[_0x5aa66d(0x14c)]?.[_0x5aa66d(0x1e0)]&&_0x54fc4c[_0x5aa66d(0x1de)](_0x210f8d[_0x5aa66d(0x14c)][_0x5aa66d(0x1e0)]);const _0x9b64d3=_0x43cb2c=>{const _0x3a2619=_0x5aa66d;for(const _0x5c5c08 of _0x43cb2c){_0x5c5c08[_0x3a2619(0x14f)]?.[_0x3a2619(0x1e0)]&&_0x54fc4c[_0x3a2619(0x1de)](_0x5c5c08['entry_criteria'][_0x3a2619(0x1e0)]);if(_0x5c5c08[_0x3a2619(0x1bc)])for(const _0x1fb1e4 of _0x5c5c08['exit_criteria']){_0x1fb1e4[_0x3a2619(0x1e0)]&&_0x54fc4c[_0x3a2619(0x1de)](_0x1fb1e4['segment']);}_0x5c5c08[_0x3a2619(0x180)]?.[_0x3a2619(0x1e0)]&&_0x54fc4c[_0x3a2619(0x1de)](_0x5c5c08[_0x3a2619(0x180)]['segment']);if(_0x5c5c08[_0x3a2619(0x1ec)])for(const _0x100a0f of _0x5c5c08['steps']){if(_0x100a0f[_0x3a2619(0x138)]===_0x3a2619(0x1d7)){const _0xf198b4=_0x100a0f;for(const _0x5d63f5 of _0xf198b4['with'][_0x3a2619(0x15c)]){_0x5d63f5[_0x3a2619(0x1e0)]&&_0x54fc4c['add'](_0x5d63f5['segment']);}}else{if(_0x100a0f[_0x3a2619(0x138)]==='wait'){const _0x2ae5b9=_0x100a0f;_0x2ae5b9[_0x3a2619(0x14a)][_0x3a2619(0x1c2)]?.[_0x3a2619(0x1e0)]&&_0x54fc4c[_0x3a2619(0x1de)](_0x2ae5b9[_0x3a2619(0x14a)]['condition'][_0x3a2619(0x1e0)]);}}}}};_0x210f8d[_0x5aa66d(0x1ca)]&&_0x9b64d3(_0x210f8d[_0x5aa66d(0x1ca)]);if(_0x210f8d[_0x5aa66d(0x1ae)])for(const _0x43ee58 of _0x210f8d[_0x5aa66d(0x1ae)]){_0x9b64d3(_0x43ee58[_0x5aa66d(0x1ca)]);}return _0x54fc4c;}export function validateSegmentRefs(_0xd6e4d9){const _0x111f97=a109_0x4373,_0x1bc8b0=[],_0x1977ff=collectSegmentRefs(_0xd6e4d9),_0x5313a6=new Set(Object[_0x111f97(0x1c8)](_0xd6e4d9['segments']||{}));for(const _0x6214e5 of _0x1977ff){const _0x4a9f63=parseSegmentRef(_0x6214e5);_0x4a9f63[_0x111f97(0x138)]===_0x111f97(0x145)&&!_0x5313a6[_0x111f97(0x1ea)](_0x4a9f63[_0x111f97(0x1f0)])&&_0x1bc8b0[_0x111f97(0x1ef)]('Unknown\x20segment\x20\x22'+_0x4a9f63[_0x111f97(0x1f0)]+_0x111f97(0x200)+_0x4a9f63[_0x111f97(0x1f0)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x1bc8b0;}export function collectSegmentIdsFromJourneyApi(_0x3d9371){const _0x355d8d=a109_0x4373,_0x1bee63=new Set();_0x3d9371['attributes'][_0x355d8d(0x14c)]?.[_0x355d8d(0x165)]&&_0x1bee63['add'](_0x3d9371[_0x355d8d(0x185)][_0x355d8d(0x14c)]['segmentId']);const _0x12502c=_0x3d9371[_0x355d8d(0x185)]['journeyStages'];if(Array[_0x355d8d(0x163)](_0x12502c))for(const _0x5eecb5 of _0x12502c){_0x5eecb5[_0x355d8d(0x1b2)]?.['segmentId']&&_0x1bee63[_0x355d8d(0x1de)](_0x5eecb5[_0x355d8d(0x1b2)][_0x355d8d(0x165)]);const _0x3fed87=_0x5eecb5[_0x355d8d(0x19d)]??_0x5eecb5[_0x355d8d(0x16a)];if(Array[_0x355d8d(0x163)](_0x3fed87))for(const _0x21e67d of _0x3fed87){_0x21e67d[_0x355d8d(0x165)]&&_0x1bee63[_0x355d8d(0x1de)](_0x21e67d['segmentId']);}_0x5eecb5[_0x355d8d(0x180)]?.['segmentId']&&_0x1bee63[_0x355d8d(0x1de)](_0x5eecb5[_0x355d8d(0x180)][_0x355d8d(0x165)]);if(_0x5eecb5['steps']&&typeof _0x5eecb5[_0x355d8d(0x1ec)]===_0x355d8d(0x1cc)){const _0x247fbd=Array[_0x355d8d(0x163)](_0x5eecb5[_0x355d8d(0x1ec)])?_0x5eecb5[_0x355d8d(0x1ec)]:Object[_0x355d8d(0x184)](_0x5eecb5['steps']);for(const _0x3aca38 of _0x247fbd){_0x3aca38[_0x355d8d(0x14e)]?.[_0x355d8d(0x165)]&&_0x1bee63[_0x355d8d(0x1de)](_0x3aca38[_0x355d8d(0x14e)]['segmentId']);const _0x33a8bf=_0x3aca38;_0x33a8bf['conditionSegmentId']&&_0x1bee63[_0x355d8d(0x1de)](_0x33a8bf[_0x355d8d(0x17e)]);if(Array[_0x355d8d(0x163)](_0x33a8bf[_0x355d8d(0x143)]))for(const _0x1256ea of _0x33a8bf[_0x355d8d(0x143)]){_0x1256ea[_0x355d8d(0x165)]&&_0x1bee63['add'](_0x1256ea[_0x355d8d(0x165)]);}if(Array['isArray'](_0x3aca38[_0x355d8d(0x15c)]))for(const _0x14914b of _0x3aca38['branches']){_0x14914b[_0x355d8d(0x165)]&&_0x1bee63['add'](_0x14914b['segmentId']);}}}}return _0x1bee63;}