@treasuredata/tdx 2026.4.12 → 2026.4.13
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x50448b,_0x53bf29){const _0x46dfc9=a146_0x4fe1,_0x18cefa=_0x50448b();while(!![]){try{const _0x56f8e7=parseInt(_0x46dfc9(0x100))/0x1+-parseInt(_0x46dfc9(0x121))/0x2+-parseInt(_0x46dfc9(0x160))/0x3*(parseInt(_0x46dfc9(0x159))/0x4)+parseInt(_0x46dfc9(0xc3))/0x5*(-parseInt(_0x46dfc9(0x15b))/0x6)+-parseInt(_0x46dfc9(0x15e))/0x7+parseInt(_0x46dfc9(0xed))/0x8*(parseInt(_0x46dfc9(0x13d))/0x9)+parseInt(_0x46dfc9(0x13c))/0xa*(parseInt(_0x46dfc9(0xc1))/0xb);if(_0x56f8e7===_0x53bf29)break;else _0x18cefa['push'](_0x18cefa['shift']());}catch(_0x5c1541){_0x18cefa['push'](_0x18cefa['shift']());}}}(a146_0x2890,0x38927));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x4b5003,_0x319f53,_0x487f4c,_0x1184ac,_0x2bce17,_0x1d37a7){const _0x460e54=a146_0x4fe1;return{'level':_0x4b5003,'path':_0x319f53,'code':_0x487f4c,'message':_0x1184ac,'location':getLocationFromPath(_0x2bce17[_0x460e54(0x155)],_0x2bce17[_0x460e54(0xb9)],pathToArray(_0x1d37a7??_0x319f53))};}function validateVersionStructure(_0x3e9301,_0xd30a08){const _0x4e82df=a146_0x4fe1,_0x14f7d1=[];return _0x3e9301[_0x4e82df(0x16e)]>MAX_STAGES&&_0x14f7d1[_0x4e82df(0x12a)](createIssue(_0x4e82df(0xe8),'stages',_0x4e82df(0x114),_0x4e82df(0x122)+_0x3e9301[_0x4e82df(0x16e)]+_0x4e82df(0x165)+MAX_STAGES,_0xd30a08)),_0x14f7d1;}function validateStageStructure(_0x2c0e35,_0x2937b9,_0x5e027f,_0x48b801){const _0x23c0d6=a146_0x4fe1,_0xa71de1=[],_0x202867=_0x23c0d6(0xcc)+_0x2937b9+']';_0x2937b9===0x0&&!_0x2c0e35[_0x23c0d6(0x132)]&&_0xa71de1[_0x23c0d6(0x12a)](createIssue('error',_0x202867+'.entry_criteria',_0x23c0d6(0xc7),_0x23c0d6(0x152)+_0x2c0e35['name']+_0x23c0d6(0x129),_0x48b801,_0x202867));const _0x3349e8=_0x2937b9===_0x5e027f-0x1;!_0x3349e8&&!_0x2c0e35[_0x23c0d6(0xca)]&&_0xa71de1[_0x23c0d6(0x12a)](createIssue(_0x23c0d6(0xe8),_0x202867+'.milestone',_0x23c0d6(0x137),_0x23c0d6(0x152)+_0x2c0e35['name']+_0x23c0d6(0x131),_0x48b801,_0x202867));(!_0x2c0e35['exit_criteria']||_0x2c0e35[_0x23c0d6(0xe9)][_0x23c0d6(0x16e)]===0x0)&&_0xa71de1['push'](createIssue(_0x23c0d6(0x116),_0x202867+_0x23c0d6(0xc0),_0x23c0d6(0x104),_0x23c0d6(0x152)+_0x2c0e35[_0x23c0d6(0x151)]+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x48b801,_0x202867));const _0x4b1016=_0x2c0e35[_0x23c0d6(0xe5)]?.[_0x23c0d6(0x16e)]??0x0;if(_0x4b1016===0x0)_0xa71de1[_0x23c0d6(0x12a)](createIssue(_0x23c0d6(0xe8),_0x202867+_0x23c0d6(0x112),_0x23c0d6(0x135),_0x23c0d6(0x152)+_0x2c0e35['name']+_0x23c0d6(0x150),_0x48b801,_0x202867+_0x23c0d6(0x112)));else{if(_0x4b1016===0x1)_0xa71de1[_0x23c0d6(0x12a)](createIssue(_0x23c0d6(0x116),_0x202867+_0x23c0d6(0x112),_0x23c0d6(0x135),_0x23c0d6(0x152)+_0x2c0e35['name']+'\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)',_0x48b801,_0x202867+'.steps'));else _0x4b1016<=0x3&&_0xa71de1[_0x23c0d6(0x12a)](createIssue(_0x23c0d6(0x116),_0x202867+'.steps',_0x23c0d6(0xc9),'Stage\x20\x27'+_0x2c0e35[_0x23c0d6(0x151)]+_0x23c0d6(0x103)+_0x4b1016+_0x23c0d6(0xd0),_0x48b801,_0x202867+_0x23c0d6(0x112)));}return _0xa71de1;}function validateStep(_0x52c09d,_0x584a47,_0x3b2205,_0x1298cd){const _0xbf8eed=a146_0x4fe1,_0x30cf77=[];if(_0x52c09d['type']==='end')return _0x52c09d['next']&&_0x30cf77['push'](createIssue(_0xbf8eed(0xe8),_0x584a47+_0xbf8eed(0x107),'END_STEP_HAS_NEXT_OR_WITH',_0xbf8eed(0x143)+_0x52c09d[_0xbf8eed(0x151)]+_0xbf8eed(0x16d),_0x3b2205)),_0xbf8eed(0xfc)in _0x52c09d&&_0x52c09d[_0xbf8eed(0xfc)]!==undefined&&_0x30cf77['push'](createIssue('error',_0x584a47+_0xbf8eed(0x13a),_0xbf8eed(0x130),_0xbf8eed(0x143)+_0x52c09d[_0xbf8eed(0x151)]+'\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',_0x3b2205)),_0x30cf77;_0x52c09d['next']&&(_0x3b2205[_0xbf8eed(0xdc)]&&!_0x3b2205[_0xbf8eed(0xdc)][_0xbf8eed(0xff)](_0x52c09d[_0xbf8eed(0x145)])&&_0x30cf77[_0xbf8eed(0x12a)](createIssue(_0xbf8eed(0xe8),_0x584a47+'.next',_0xbf8eed(0xf5),_0xbf8eed(0xec)+_0x52c09d[_0xbf8eed(0x145)]+'\x27',_0x3b2205)));switch(_0x52c09d[_0xbf8eed(0x148)]){case _0xbf8eed(0x147):_0x30cf77[_0xbf8eed(0x12a)](...validateWaitStep(_0x52c09d,_0x584a47,_0x3b2205,_0x1298cd));break;case'activation':_0x30cf77['push'](...validateActivationStep(_0x52c09d,_0x584a47,_0x3b2205));break;case'decision_point':_0x30cf77['push'](...validateDecisionPointStep(_0x52c09d,_0x584a47,_0x3b2205,_0x1298cd));break;case _0xbf8eed(0xf3):_0x30cf77[_0xbf8eed(0x12a)](...validateAbTestStep(_0x52c09d,_0x584a47,_0x3b2205,_0x1298cd));break;case'jump':_0x30cf77[_0xbf8eed(0x12a)](...validateJumpStep(_0x52c09d,_0x584a47,_0x3b2205));break;}return _0x30cf77;}function validateWaitStep(_0x3d5e5b,_0x5e03c5,_0x204c50,_0x99cb88){const _0x2a1550=a146_0x4fe1,_0x569f75=[];if(!_0x3d5e5b[_0x2a1550(0xfc)])return _0x569f75[_0x2a1550(0x12a)](createIssue('error',_0x5e03c5+_0x2a1550(0x13a),_0x2a1550(0x119),_0x2a1550(0x110),_0x204c50,_0x5e03c5)),_0x569f75;if(_0x3d5e5b[_0x2a1550(0xfc)][_0x2a1550(0xbf)]){const _0x22a29e=_0x3d5e5b[_0x2a1550(0xfc)][_0x2a1550(0xbf)];if(_0x22a29e[_0x2a1550(0xee)]){_0x204c50[_0x2a1550(0x11c)]?.[_0x2a1550(0x10a)](_0x22a29e['segment']);!_0x22a29e['segment']['startsWith'](_0x2a1550(0x13f))&&(_0x204c50['embeddedSegments']&&!_0x204c50['embeddedSegments'][_0x2a1550(0xff)](_0x22a29e['segment'])&&_0x569f75[_0x2a1550(0x12a)](createIssue(_0x2a1550(0xe8),_0x5e03c5+_0x2a1550(0x142),'MISSING_SEGMENT_REFERENCE',_0x2a1550(0x164)+_0x22a29e['segment']+_0x2a1550(0xe1),_0x204c50)));_0x22a29e[_0x2a1550(0x145)]&&_0x204c50['stepNames']&&!_0x204c50[_0x2a1550(0xdc)][_0x2a1550(0xff)](_0x22a29e[_0x2a1550(0x145)])&&_0x569f75[_0x2a1550(0x12a)](createIssue(_0x2a1550(0xe8),_0x5e03c5+_0x2a1550(0xbc),'INVALID_NEXT_REFERENCE',_0x2a1550(0x115)+_0x22a29e[_0x2a1550(0x145)]+'\x27',_0x204c50));_0x22a29e['timeout']?.[_0x2a1550(0x145)]&&_0x204c50[_0x2a1550(0xdc)]&&!_0x204c50[_0x2a1550(0xdc)]['has'](_0x22a29e[_0x2a1550(0xcd)][_0x2a1550(0x145)])&&_0x569f75['push'](createIssue(_0x2a1550(0xe8),_0x5e03c5+_0x2a1550(0xfa),_0x2a1550(0xf5),_0x2a1550(0x157)+_0x22a29e[_0x2a1550(0xcd)][_0x2a1550(0x145)]+'\x27',_0x204c50));const _0x3947fb=_0x22a29e[_0x2a1550(0x145)]||_0x3d5e5b[_0x2a1550(0x145)],_0x169976=_0x22a29e['timeout']?.['next']||_0x3d5e5b[_0x2a1550(0x145)];if(_0x3947fb){const _0x27c576=_0x99cb88['get'](_0x3947fb);_0x27c576?.[_0x2a1550(0x148)]===_0x2a1550(0xf4)&&_0x569f75[_0x2a1550(0x12a)](createIssue(_0x2a1550(0x116),_0x5e03c5+'.with.condition.next',_0x2a1550(0xc2),_0x2a1550(0x14f)+_0x3947fb+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x204c50,_0x5e03c5+'.with.condition'));}if(_0x169976){const _0x870378=_0x99cb88[_0x2a1550(0xfd)](_0x169976);_0x870378?.[_0x2a1550(0x148)]===_0x2a1550(0xf4)&&_0x569f75[_0x2a1550(0x12a)](createIssue(_0x2a1550(0x116),_0x5e03c5+_0x2a1550(0xfa),_0x2a1550(0xc2),'Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x169976+_0x2a1550(0x105),_0x204c50,_0x5e03c5+'.with.condition.timeout'));}}}return _0x569f75;}function validateActivationStep(_0x165821,_0x47183f,_0x5bd6a5){const _0x4366e8=a146_0x4fe1,_0x1792fd=[];if(!_0x165821['with']?.[_0x4366e8(0x15a)])return _0x1792fd[_0x4366e8(0x12a)](createIssue('error',_0x47183f+_0x4366e8(0x102),_0x4366e8(0xd4),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x5bd6a5,_0x47183f)),_0x1792fd;const _0x81c74c=_0x165821['with']['activation'];return _0x5bd6a5[_0x4366e8(0xd8)]&&!_0x81c74c['startsWith'](_0x4366e8(0x13f))&&(!_0x5bd6a5[_0x4366e8(0xd8)]['has'](_0x81c74c)&&_0x1792fd[_0x4366e8(0x12a)](createIssue('error',_0x47183f+_0x4366e8(0x102),_0x4366e8(0x111),'Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x81c74c+_0x4366e8(0x11f),_0x5bd6a5))),_0x1792fd;}function validateDecisionPointStep(_0x3a40dc,_0x264dec,_0x4606b2,_0x150e0b){const _0x3a3f5b=a146_0x4fe1,_0x15568d=[];if(!_0x3a40dc[_0x3a3f5b(0xfc)]?.['branches']||_0x3a40dc[_0x3a3f5b(0xfc)][_0x3a3f5b(0x134)][_0x3a3f5b(0x16e)]===0x0)return _0x15568d[_0x3a3f5b(0x12a)](createIssue('error',_0x264dec+_0x3a3f5b(0x138),'MISSING_CONDITIONS',_0x3a3f5b(0x11d),_0x4606b2,_0x264dec)),_0x15568d;for(let _0x4a006f=0x0;_0x4a006f<_0x3a40dc[_0x3a3f5b(0xfc)][_0x3a3f5b(0x134)][_0x3a3f5b(0x16e)];_0x4a006f++){const _0x5969d7=_0x3a40dc[_0x3a3f5b(0xfc)][_0x3a3f5b(0x134)][_0x4a006f],_0x4d6936=_0x264dec+_0x3a3f5b(0x15c)+_0x4a006f+']';_0x5969d7[_0x3a3f5b(0xee)]&&!_0x5969d7[_0x3a3f5b(0x141)]&&(_0x4606b2['referencedSegments']?.['add'](_0x5969d7[_0x3a3f5b(0xee)]),!_0x5969d7[_0x3a3f5b(0xee)][_0x3a3f5b(0x168)]('ref:')&&(_0x4606b2['embeddedSegments']&&!_0x4606b2[_0x3a3f5b(0x15f)][_0x3a3f5b(0xff)](_0x5969d7[_0x3a3f5b(0xee)])&&_0x15568d[_0x3a3f5b(0x12a)](createIssue(_0x3a3f5b(0xe8),_0x4d6936+'.segment','MISSING_SEGMENT_REFERENCE','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x5969d7['segment']+'\x27',_0x4606b2))));_0x5969d7[_0x3a3f5b(0x145)]&&_0x4606b2['stepNames']&&!_0x4606b2[_0x3a3f5b(0xdc)][_0x3a3f5b(0xff)](_0x5969d7['next'])&&_0x15568d[_0x3a3f5b(0x12a)](createIssue(_0x3a3f5b(0xe8),_0x4d6936+_0x3a3f5b(0x107),'INVALID_NEXT_REFERENCE',_0x3a3f5b(0x12e)+_0x5969d7[_0x3a3f5b(0x145)]+'\x27',_0x4606b2));if(_0x5969d7['next']){const _0x1d9688=_0x150e0b[_0x3a3f5b(0xfd)](_0x5969d7['next']);_0x1d9688?.[_0x3a3f5b(0x148)]==='merge'&&_0x15568d['push'](createIssue(_0x3a3f5b(0x116),_0x4d6936+'.next','BRANCH_DIRECTLY_TO_MERGE',_0x3a3f5b(0x125)+_0x5969d7[_0x3a3f5b(0x151)]+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x5969d7[_0x3a3f5b(0x145)]+_0x3a3f5b(0x166),_0x4606b2));}}return _0x15568d;}function validateAbTestStep(_0x5a867f,_0x219518,_0x2678f8,_0x82d70b){const _0x1c46fb=a146_0x4fe1,_0x251b0d=[];if(!_0x5a867f['with']?.[_0x1c46fb(0x118)]||_0x5a867f[_0x1c46fb(0xfc)]['variants']['length']===0x0)return _0x251b0d[_0x1c46fb(0x12a)](createIssue(_0x1c46fb(0xe8),_0x219518+_0x1c46fb(0x14a),_0x1c46fb(0x16b),_0x1c46fb(0x14b),_0x2678f8,_0x219518)),_0x251b0d;const _0x28f509=_0x5a867f[_0x1c46fb(0xfc)][_0x1c46fb(0x118)][_0x1c46fb(0xde)]((_0x20ad3f,_0xa4549d)=>_0x20ad3f+(_0xa4549d['percentage']||0x0),0x0);Math['abs'](_0x28f509-0x64)>0.01&&_0x251b0d[_0x1c46fb(0x12a)](createIssue(_0x1c46fb(0xe8),_0x219518+'.with.variants','INVALID_AB_TEST_PERCENTAGES','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20'+_0x28f509+'%)',_0x2678f8));for(let _0x292ca1=0x0;_0x292ca1<_0x5a867f[_0x1c46fb(0xfc)]['variants'][_0x1c46fb(0x16e)];_0x292ca1++){const _0x50c85b=_0x5a867f[_0x1c46fb(0xfc)]['variants'][_0x292ca1],_0x3aa393=_0x219518+_0x1c46fb(0x14c)+_0x292ca1+']';_0x50c85b[_0x1c46fb(0x145)]&&_0x2678f8[_0x1c46fb(0xdc)]&&!_0x2678f8[_0x1c46fb(0xdc)][_0x1c46fb(0xff)](_0x50c85b[_0x1c46fb(0x145)])&&_0x251b0d[_0x1c46fb(0x12a)](createIssue('error',_0x3aa393+_0x1c46fb(0x107),_0x1c46fb(0xf5),_0x1c46fb(0x128)+_0x50c85b[_0x1c46fb(0x145)]+'\x27',_0x2678f8));if(_0x50c85b['next']){const _0x314d9f=_0x82d70b['get'](_0x50c85b[_0x1c46fb(0x145)]);_0x314d9f?.['type']===_0x1c46fb(0xf4)&&_0x251b0d[_0x1c46fb(0x12a)](createIssue('warning',_0x3aa393+_0x1c46fb(0x107),_0x1c46fb(0xc2),_0x1c46fb(0x10c)+_0x50c85b[_0x1c46fb(0x151)]+_0x1c46fb(0x11b)+_0x50c85b[_0x1c46fb(0x145)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x2678f8));}}return _0x251b0d;}function a146_0x2890(){const _0x28a0a8=['source','Journey\x20has\x20no\x20goal\x20defined','description','.with.condition.next','.steps[','.exit_criteria[','condition','.exit_criteria','4482643wrInSg','BRANCH_DIRECTLY_TO_MERGE','5Qlqddn','sort','JOURNEY_SCHEMA_ERROR',').\x20Use\x20a\x20merge\x20step.','MISSING_ENTRY_CRITERIA','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','FEW_STEPS','milestone','segments','stages[','timeout','CONVERGENCE_WITHOUT_MERGE','goal','\x20steps\x20(may\x20be\x20too\x20simple)','.with.target','map','\x27\x20of\x20\x27','MISSING_ACTIVATION_REF','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','every','.milestone','activationKeys','versions[','MISSING_STAGES','MISSING_END_STEP','stepNames','launched','reduce','journey','INVALID_JUMP_TARGET','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','stage','replace','size','steps','Journey\x20can\x20have\x20at\x20most\x20one\x20','level','error','exit_criteria','safeParse','Embedded\x20segment\x20\x27','Step\x20references\x20non-existent\x20step\x20\x27','893064JcfzWe','segment','trim','target','path','SINGLE_INPUT_MERGE','ab_test','merge','INVALID_NEXT_REFERENCE','decision_point','stages','goalIsInherited','MISSING_NAME','.with.condition.timeout.next','timeout\x20of\x20\x27','with','get','state','has','63265BAFRIN','.type','.with.activation','\x27\x20has\x20only\x20','MISSING_EXIT_CRITERIA','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','\x27\x20(from:\x20','.next','.segment','issues','add','UNUSED_EMBEDDED_SEGMENT','A/B\x20test\x20variant\x20\x27','set','\x27\x20has\x20no\x20end\x20step','.stages','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','MISSING_ACTIVATION_DEFINITION','.steps','journey\x20entry','TOO_MANY_STAGES','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','warning','segments.','variants','MISSING_WAIT_PARAMS','activations','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','referencedSegments','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','journeys[','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',').\x20Merge\x20is\x20unnecessary.','856766znJWVk','Journey\x20has\x20','.rule','journeys','Decision\x20branch\x20\x27','data','version','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','push','journeys,\x20stages,\x20or\x20versions','code','symbol','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','\x20with\x20latest:\x20true','END_STEP_HAS_NEXT_OR_WITH','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','entry_criteria','versions','branches','INSUFFICIENT_STEPS','\x20(across\x20','MISSING_MILESTONE','.with.branches','match','.with','MISSING_GOAL','30mJnpcn','9dylCjN','variant\x20\x27','ref:','Merge\x20step\x20\x27','excluded','.with.condition.segment','End\x20step\x20\x27','Criteria\x20references\x20undefined\x20segment\x20\x27','next','\x27\x20(first\x20defined\x20at\x20steps[','wait','type','MERGE_TO_MERGE_CHAIN','.with.variants','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','.with.variants[','splice','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20has\x20no\x20steps','name','Stage\x20\x27','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','keys','document','join','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','message','849204PUWJND','activation','1763394afgltP','.with.branches[','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','131838hbnwmV','embeddedSegments','6mumKnf','rule','success','excluded_','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','\x20stages\x20but\x20maximum\x20is\x20','\x27\x20with\x20no\x20action\x20in\x20between','MISSING_SEGMENT_REFERENCE','startsWith','.entry_criteria','entries','MISSING_CONDITIONS','includes','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','length','endsWith','\x20versions)','Duplicate\x20step\x20name\x20\x27'];a146_0x2890=function(){return _0x28a0a8;};return a146_0x2890();}function validateJumpStep(_0x582074,_0xb0d979,_0x46be88){const _0x120aa5=a146_0x4fe1,_0xe79d1b=[];if(!_0x582074[_0x120aa5(0xfc)]?.[_0x120aa5(0xf0)])return _0xe79d1b['push'](createIssue(_0x120aa5(0xe8),_0xb0d979+'.with.target',_0x120aa5(0xe0),'Jump\x20step\x20requires\x20a\x20target',_0x46be88,_0xb0d979)),_0xe79d1b;return(!_0x582074['with'][_0x120aa5(0xf0)][_0x120aa5(0xdf)]||!_0x582074[_0x120aa5(0xfc)]['target'][_0x120aa5(0xe2)])&&_0xe79d1b[_0x120aa5(0x12a)](createIssue('error',_0xb0d979+_0x120aa5(0xd1),_0x120aa5(0xe0),_0x120aa5(0x14e),_0x46be88)),_0xe79d1b;}function buildConvergenceMap(_0x20e70e){const _0x5299d2=a146_0x4fe1,_0x729b47=new Map();function _0xa7d8c(_0x27afb5,_0x395948){const _0x11c23b=a146_0x4fe1,_0x5cb5ec=_0x729b47[_0x11c23b(0xfd)](_0x27afb5)||[];_0x5cb5ec['push'](_0x395948),_0x729b47[_0x11c23b(0x10d)](_0x27afb5,_0x5cb5ec);}for(const _0x102cc5 of _0x20e70e){_0x102cc5['next']&&_0xa7d8c(_0x102cc5[_0x5299d2(0x145)],{'stepName':_0x102cc5[_0x5299d2(0x151)],'description':'step\x20\x27'+_0x102cc5[_0x5299d2(0x151)]+'\x27'});if(_0x102cc5[_0x5299d2(0x148)]===_0x5299d2(0xf6)&&_0x102cc5['with']?.[_0x5299d2(0x134)])for(const _0x1297d9 of _0x102cc5['with'][_0x5299d2(0x134)]){_0x1297d9['next']&&_0xa7d8c(_0x1297d9[_0x5299d2(0x145)],{'stepName':_0x102cc5[_0x5299d2(0x151)],'description':'branch\x20\x27'+_0x1297d9[_0x5299d2(0x151)]+_0x5299d2(0xd3)+_0x102cc5[_0x5299d2(0x151)]+'\x27'});}if(_0x102cc5[_0x5299d2(0x148)]==='ab_test'&&_0x102cc5['with']?.['variants'])for(const _0x526b93 of _0x102cc5['with']['variants']){_0x526b93[_0x5299d2(0x145)]&&_0xa7d8c(_0x526b93[_0x5299d2(0x145)],{'stepName':_0x102cc5[_0x5299d2(0x151)],'description':_0x5299d2(0x13e)+_0x526b93[_0x5299d2(0x151)]+_0x5299d2(0xd3)+_0x102cc5[_0x5299d2(0x151)]+'\x27'});}_0x102cc5[_0x5299d2(0x148)]===_0x5299d2(0x147)&&_0x102cc5[_0x5299d2(0xfc)]?.['condition']&&(_0x102cc5[_0x5299d2(0xfc)][_0x5299d2(0xbf)][_0x5299d2(0x145)]&&_0xa7d8c(_0x102cc5[_0x5299d2(0xfc)]['condition'][_0x5299d2(0x145)],{'stepName':_0x102cc5[_0x5299d2(0x151)],'description':'condition\x20of\x20\x27'+_0x102cc5[_0x5299d2(0x151)]+'\x27'}),_0x102cc5[_0x5299d2(0xfc)]['condition'][_0x5299d2(0xcd)]?.[_0x5299d2(0x145)]&&_0xa7d8c(_0x102cc5[_0x5299d2(0xfc)][_0x5299d2(0xbf)][_0x5299d2(0xcd)][_0x5299d2(0x145)],{'stepName':_0x102cc5[_0x5299d2(0x151)],'description':_0x5299d2(0xfb)+_0x102cc5[_0x5299d2(0x151)]+'\x27'}));}return _0x729b47;}function validateFlowControl(_0x1bf713,_0x4cd48d,_0x4868dd){const _0x17295c=a146_0x4fe1,_0x51665f=[],_0x4aca3e=_0x17295c(0xcc)+_0x4cd48d+']',_0x2eeb00=_0x1bf713['steps']||[];if(_0x2eeb00[_0x17295c(0x16e)]===0x0)return _0x51665f;const _0x551ab0=new Map();for(const _0x218284 of _0x2eeb00){_0x218284['name']&&_0x551ab0[_0x17295c(0x10d)](_0x218284['name'],_0x218284);}const _0x3b4ec5=buildConvergenceMap(_0x2eeb00),_0x33c001=_0x2eeb00['some'](_0x234bd2=>_0x234bd2[_0x17295c(0x148)]==='end');!_0x33c001&&_0x51665f['push'](createIssue(_0x17295c(0xe8),_0x4aca3e+_0x17295c(0x112),_0x17295c(0xdb),'Stage\x20\x27'+_0x1bf713[_0x17295c(0x151)]+_0x17295c(0x10e),_0x4868dd));for(const [_0x263570,_0x5bda8f]of _0x3b4ec5){const _0x7ea7a7=_0x551ab0[_0x17295c(0xfd)](_0x263570);if(!_0x7ea7a7)continue;if(_0x5bda8f[_0x17295c(0x16e)]>0x1&&_0x7ea7a7[_0x17295c(0x148)]!==_0x17295c(0xf4)){const _0x2ec2b0=_0x5bda8f[_0x17295c(0xd2)](_0x1ebe42=>_0x1ebe42[_0x17295c(0xbb)])[_0x17295c(0x156)](',\x20');_0x51665f[_0x17295c(0x12a)](createIssue('error',_0x4aca3e+_0x17295c(0x112),_0x17295c(0xce),_0x17295c(0x153)+_0x263570+_0x17295c(0x106)+_0x2ec2b0+_0x17295c(0xc6),_0x4868dd));}_0x5bda8f[_0x17295c(0x16e)]===0x1&&_0x7ea7a7[_0x17295c(0x148)]==='merge'&&_0x51665f[_0x17295c(0x12a)](createIssue(_0x17295c(0x116),_0x4aca3e+_0x17295c(0x112),_0x17295c(0xf2),_0x17295c(0x140)+_0x263570+_0x17295c(0xc8)+_0x5bda8f[0x0][_0x17295c(0xbb)]+_0x17295c(0x120),_0x4868dd));}for(const _0x5e66e1 of _0x2eeb00){if(_0x5e66e1['type']===_0x17295c(0xf4)&&_0x5e66e1['next']){const _0x45ecb1=_0x551ab0['get'](_0x5e66e1[_0x17295c(0x145)]);_0x45ecb1?.[_0x17295c(0x148)]==='merge'&&_0x51665f['push'](createIssue('error',_0x4aca3e+_0x17295c(0x112),_0x17295c(0x149),_0x17295c(0x140)+_0x5e66e1[_0x17295c(0x151)]+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x5e66e1[_0x17295c(0x145)]+_0x17295c(0x15d),_0x4868dd));}}return _0x51665f;}function validateCriteria(_0x1eb4f1,_0x3415ed,_0x3a668d){const _0x1d9b7e=a146_0x4fe1,_0x2363ec=[];return _0x1eb4f1[_0x1d9b7e(0xee)]&&(_0x3a668d[_0x1d9b7e(0x11c)]?.['add'](_0x1eb4f1[_0x1d9b7e(0xee)]),!_0x1eb4f1[_0x1d9b7e(0xee)][_0x1d9b7e(0x168)](_0x1d9b7e(0x13f))&&(_0x3a668d[_0x1d9b7e(0x15f)]&&!_0x3a668d['embeddedSegments'][_0x1d9b7e(0xff)](_0x1eb4f1[_0x1d9b7e(0xee)])&&_0x2363ec[_0x1d9b7e(0x12a)](createIssue('error',_0x3415ed+_0x1d9b7e(0x108),_0x1d9b7e(0x167),_0x1d9b7e(0x144)+_0x1eb4f1['segment']+'\x27',_0x3a668d)))),_0x2363ec;}function validateEmbeddedSegment(_0x54c7e7,_0x31f89a,_0x6787bf){const _0x4ab922=a146_0x4fe1,_0x438e57=[];return _0x54c7e7[_0x4ab922(0x161)]&&_0x438e57[_0x4ab922(0x12a)](...validateRuleDef(_0x54c7e7[_0x4ab922(0x161)],_0x31f89a+_0x4ab922(0x123),_0x6787bf)),_0x438e57;}function validateStage(_0x38b672,_0x25f349,_0x27d9f0,_0x3e248a){const _0x327c61=a146_0x4fe1,_0x2c0c81=[],_0x245e5d='stages['+_0x25f349+']',_0x3f8a6a=new Map(),_0x4593b7=new Map();if(_0x38b672[_0x327c61(0xe5)]){for(let _0x340aa1=0x0;_0x340aa1<_0x38b672[_0x327c61(0xe5)][_0x327c61(0x16e)];_0x340aa1++){const _0x223e33=_0x38b672['steps'][_0x340aa1];_0x223e33[_0x327c61(0x151)]&&_0x3f8a6a[_0x327c61(0x10d)](_0x223e33[_0x327c61(0x151)],_0x223e33);}for(let _0x4a601a=0x0;_0x4a601a<_0x38b672['steps']['length'];_0x4a601a++){const _0x2852eb=_0x38b672[_0x327c61(0xe5)][_0x4a601a],_0x238eff=_0x245e5d+_0x327c61(0xbd)+_0x4a601a+']';if(_0x2852eb[_0x327c61(0x151)]){if(_0x4593b7[_0x327c61(0xff)](_0x2852eb[_0x327c61(0x151)])){const _0x3937a8=_0x4593b7[_0x327c61(0xfd)](_0x2852eb['name']);_0x2c0c81[_0x327c61(0x12a)](createIssue(_0x327c61(0xe8),_0x238eff+'.name','DUPLICATE_STEP_NAME',_0x327c61(0x171)+_0x2852eb[_0x327c61(0x151)]+_0x327c61(0x146)+_0x3937a8+'])',_0x3e248a));}else _0x4593b7[_0x327c61(0x10d)](_0x2852eb['name'],_0x4a601a);}_0x2c0c81[_0x327c61(0x12a)](...validateStep(_0x2852eb,_0x238eff,_0x3e248a,_0x3f8a6a));}}_0x38b672['entry_criteria']&&_0x2c0c81[_0x327c61(0x12a)](...validateCriteria(_0x38b672[_0x327c61(0x132)],_0x245e5d+_0x327c61(0x169),_0x3e248a));if(_0x38b672[_0x327c61(0xe9)])for(let _0xe5dd0b=0x0;_0xe5dd0b<_0x38b672[_0x327c61(0xe9)][_0x327c61(0x16e)];_0xe5dd0b++){_0x2c0c81['push'](...validateCriteria(_0x38b672[_0x327c61(0xe9)][_0xe5dd0b],_0x245e5d+_0x327c61(0xbe)+_0xe5dd0b+']',_0x3e248a));}return _0x38b672['milestone']&&_0x2c0c81[_0x327c61(0x12a)](...validateCriteria(_0x38b672[_0x327c61(0xca)],_0x245e5d+_0x327c61(0xd7),_0x3e248a)),_0x2c0c81[_0x327c61(0x12a)](...validateStageStructure(_0x38b672,_0x25f349,_0x27d9f0,_0x3e248a)),_0x2c0c81[_0x327c61(0x12a)](...validateFlowControl(_0x38b672,_0x25f349,_0x3e248a)),_0x2c0c81;}function validateStagesForVersion(_0xbaed00,_0x2d09fa,_0x58b310,_0x30c26a,_0xe46f92,_0x67d5aa,_0x3a538d){const _0x498ffb=a146_0x4fe1;if(_0xbaed00[_0x498ffb(0x16e)]===0x0){_0xe46f92[_0x498ffb(0x12a)]({'level':_0x498ffb(0xe8),'path':_0x30c26a+'stages','code':_0x498ffb(0xda),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x58b310[_0x498ffb(0x155)],_0x58b310[_0x498ffb(0xb9)],[_0x498ffb(0xf7)])});return;}const _0x163bed=new Set();for(const _0x34c3b1 of _0xbaed00){if(_0x34c3b1[_0x498ffb(0xe5)])for(const _0x3cd91d of _0x34c3b1['steps']){_0x3cd91d['name']&&_0x163bed['add'](_0x3cd91d[_0x498ffb(0x151)]);}}const _0x13c092={..._0x58b310,'stepNames':_0x163bed},_0x3291=validateVersionStructure(_0xbaed00,_0x13c092);for(const _0x1b1a9a of _0x3291){const _0x56f44a=_0x30c26a?{..._0x1b1a9a,'path':''+_0x30c26a+_0x1b1a9a[_0x498ffb(0xf1)]}:_0x1b1a9a;if(_0x56f44a['level']===_0x498ffb(0xe8))_0xe46f92[_0x498ffb(0x12a)](_0x56f44a);else _0x67d5aa[_0x498ffb(0x12a)](_0x56f44a);}for(let _0x40a54f=0x0;_0x40a54f<_0xbaed00[_0x498ffb(0x16e)];_0x40a54f++){const _0x482b28=validateStage(_0xbaed00[_0x40a54f],_0x40a54f,_0xbaed00[_0x498ffb(0x16e)],_0x13c092);for(const _0x5bb89f of _0x482b28){const _0x3a3b0b=_0x30c26a?{..._0x5bb89f,'path':''+_0x30c26a+_0x5bb89f['path']}:_0x5bb89f;if(_0x3a3b0b[_0x498ffb(0xe7)]==='error')_0xe46f92['push'](_0x3a3b0b);else _0x67d5aa[_0x498ffb(0x12a)](_0x3a3b0b);}}if(_0x2d09fa[_0x498ffb(0xcf)]){const _0x10770c=_0x3a538d?.[_0x498ffb(0xf8)]?_0x498ffb(0xcf):_0x30c26a+_0x498ffb(0xcf),_0x4e3109=validateCriteria(_0x2d09fa['goal'],_0x10770c,_0x13c092);for(const _0x34cc37 of _0x4e3109){if(_0x34cc37[_0x498ffb(0xe7)]==='error')_0xe46f92[_0x498ffb(0x12a)](_0x34cc37);else _0x67d5aa[_0x498ffb(0x12a)](_0x34cc37);}}}function extractVersionIndex(_0x28726a){const _0x2468ad=a146_0x4fe1,_0x499356=_0x28726a[_0x2468ad(0x139)](/^journeys\[(\d+)\]\./);return _0x499356?_0x499356[0x1]:undefined;}function deduplicateAcrossVersions(_0x281bc4){const _0x2e8f84=a146_0x4fe1,_0x19ca45=new Map();for(let _0x113857=0x0;_0x113857<_0x281bc4[_0x2e8f84(0x16e)];_0x113857++){const _0x1cb76b=_0x281bc4[_0x113857][_0x2e8f84(0x12c)]+':'+_0x281bc4[_0x113857]['message'],_0x50e28d=extractVersionIndex(_0x281bc4[_0x113857][_0x2e8f84(0xf1)]),_0x1586c6=_0x19ca45[_0x2e8f84(0xfd)](_0x1cb76b);if(_0x1586c6){_0x1586c6['indices'][_0x2e8f84(0x12a)](_0x113857);if(_0x50e28d)_0x1586c6['versions'][_0x2e8f84(0x10a)](_0x50e28d);}else _0x19ca45[_0x2e8f84(0x10d)](_0x1cb76b,{'indices':[_0x113857],'versions':new Set(_0x50e28d?[_0x50e28d]:[])});}const _0x5d646e=new Set();for(const {indices:_0x13c120,versions:_0x214d09}of _0x19ca45['values']()){if(_0x214d09[_0x2e8f84(0xe4)]<=0x1)continue;const _0x5ad86d=_0x281bc4[_0x13c120[0x0]];_0x5ad86d[_0x2e8f84(0xf1)]=_0x5ad86d[_0x2e8f84(0xf1)][_0x2e8f84(0xe3)](/^journeys\[\d+\]\./,''),_0x5ad86d[_0x2e8f84(0x158)]=_0x5ad86d['message']+_0x2e8f84(0x136)+_0x214d09[_0x2e8f84(0xe4)]+_0x2e8f84(0x170);for(let _0x3315c3=0x1;_0x3315c3<_0x13c120[_0x2e8f84(0x16e)];_0x3315c3++){_0x5d646e['add'](_0x13c120[_0x3315c3]);}}const _0x5d1f17=[..._0x5d646e][_0x2e8f84(0xc4)]((_0x1573c9,_0x5be72c)=>_0x5be72c-_0x1573c9);for(const _0x252840 of _0x5d1f17){_0x281bc4[_0x2e8f84(0x14d)](_0x252840,0x1);}}export function validateJourneyDef(_0x3ffe25,_0x484200={},_0x319b9b={}){const _0x5ce822=a146_0x4fe1;if(_0x319b9b['skipSchema'])return runJourneySemanticChecks(_0x3ffe25,_0x484200);const _0x1f1caa=JourneyDefSchema[_0x5ce822(0xea)](_0x3ffe25);if(_0x1f1caa[_0x5ce822(0x162)])return runJourneySemanticChecks(_0x1f1caa[_0x5ce822(0x126)],_0x484200);return zodErrorsToJourneyValidationResult(_0x1f1caa[_0x5ce822(0xe8)],_0x484200);}function a146_0x4fe1(_0x16bb32,_0x1c4269){_0x16bb32=_0x16bb32-0xb9;const _0x28908e=a146_0x2890();let _0x4fe143=_0x28908e[_0x16bb32];return _0x4fe143;}function zodErrorsToJourneyValidationResult(_0x59b4c8,_0x4b18db){const _0x3783e0=a146_0x4fe1,_0x208f6b=flattenZodIssues(_0x59b4c8[_0x3783e0(0x109)]),_0x40e872=_0x208f6b['map'](_0x17a696=>{const _0x5356ae=_0x3783e0,_0x36bf96=formatZodPath(_0x17a696['path']),_0x3cddb9=mapJourneyZodIssueToCode(_0x17a696,_0x36bf96),_0x1b4847=getLocationFromPath(_0x4b18db[_0x5356ae(0x155)],_0x4b18db[_0x5356ae(0xb9)],_0x17a696[_0x5356ae(0xf1)][_0x5356ae(0xd2)](_0x1920e3=>typeof _0x1920e3===_0x5356ae(0x12d)?String(_0x1920e3):_0x1920e3));return{'level':_0x5356ae(0xe8),'path':_0x36bf96,'code':_0x3cddb9,'message':_0x17a696[_0x5356ae(0x158)],..._0x1b4847&&{'location':_0x1b4847}};});return{'valid':![],'errors':_0x40e872,'warnings':[]};}function mapJourneyZodIssueToCode(_0x59d627,_0x5cef81){const _0x5b2c05=a146_0x4fe1;if(_0x5cef81===_0x5b2c05(0x151))return'MISSING_NAME';if(_0x5cef81[_0x5b2c05(0x16f)](_0x5b2c05(0x101))&&_0x5cef81[_0x5b2c05(0x16c)](_0x5b2c05(0xe5)))return _0x5b2c05(0xc5);if(_0x5cef81==='stages'||_0x5cef81[_0x5b2c05(0x16f)](_0x5b2c05(0x10f)))return'MISSING_STAGES';if(_0x5cef81===''&&_0x59d627['message'][_0x5b2c05(0x16c)](_0x5b2c05(0x12b)))return _0x5b2c05(0xda);if(_0x5cef81[_0x5b2c05(0x16c)](_0x5b2c05(0x15a)))return'ACTIVATION_SCHEMA_ERROR';return'JOURNEY_SCHEMA_ERROR';}function runJourneySemanticChecks(_0x972e29,_0x523050){const _0x17d6fc=a146_0x4fe1,_0x7b43fd=[],_0x5126e0=[];(!_0x972e29[_0x17d6fc(0x151)]||_0x972e29[_0x17d6fc(0x151)][_0x17d6fc(0xef)]()==='')&&_0x7b43fd[_0x17d6fc(0x12a)]({'level':_0x17d6fc(0xe8),'path':_0x17d6fc(0x151),'code':_0x17d6fc(0xf9),'message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x523050['document'],_0x523050[_0x17d6fc(0xb9)],[_0x17d6fc(0x151)])});const _0x381abf=new Set();if(_0x972e29[_0x17d6fc(0xcb)])for(const _0x139358 of Object['keys'](_0x972e29[_0x17d6fc(0xcb)])){_0x381abf[_0x17d6fc(0x10a)](_0x139358);}const _0x4e78f2=new Set();if(_0x972e29[_0x17d6fc(0x11a)])for(const _0xb19d9d of Object[_0x17d6fc(0x154)](_0x972e29['activations'])){_0x4e78f2[_0x17d6fc(0x10a)](_0xb19d9d);}const _0x1d5ccd=new Set(),_0x181afb={..._0x523050,'embeddedSegments':_0x381abf,'referencedSegments':_0x1d5ccd,'activationKeys':_0x4e78f2[_0x17d6fc(0xe4)]>0x0?_0x4e78f2:undefined};if(_0x972e29[_0x17d6fc(0xcb)])for(const [_0x24f117,_0x3c4f96]of Object[_0x17d6fc(0x16a)](_0x972e29[_0x17d6fc(0xcb)])){const _0x554983=validateEmbeddedSegment(_0x3c4f96,_0x17d6fc(0x117)+_0x24f117,_0x181afb);for(const _0x12f41d of _0x554983){if(_0x12f41d['level']===_0x17d6fc(0xe8))_0x7b43fd[_0x17d6fc(0x12a)](_0x12f41d);else _0x5126e0[_0x17d6fc(0x12a)](_0x12f41d);}}const _0x3c7d29=!!_0x972e29[_0x17d6fc(0xcf)],_0x5eca15=_0x972e29[_0x17d6fc(0x124)]?.[_0x17d6fc(0xd6)](_0x55e6bc=>!!_0x55e6bc[_0x17d6fc(0xcf)])??![];!_0x3c7d29&&!_0x5eca15&&_0x5126e0[_0x17d6fc(0x12a)]({'level':_0x17d6fc(0x116),'path':'goal','code':_0x17d6fc(0x13b),'message':_0x17d6fc(0xba),'location':getLocationFromPath(_0x523050[_0x17d6fc(0x155)],_0x523050[_0x17d6fc(0xb9)],[_0x17d6fc(0xcf)])});const _0x596592=_0x972e29['journeys']??_0x972e29[_0x17d6fc(0x133)];if(_0x596592&&_0x596592['filter'](_0x460588=>_0x460588['latest']===!![])[_0x17d6fc(0x16e)]>0x1){const _0x4d2d87=_0x972e29[_0x17d6fc(0x124)]?_0x17d6fc(0x124):_0x17d6fc(0x133);_0x7b43fd['push']({'level':_0x17d6fc(0xe8),'path':_0x4d2d87,'code':'DUPLICATE_LATEST','message':_0x17d6fc(0xe6)+(_0x4d2d87==='journeys'?_0x17d6fc(0x113):_0x17d6fc(0x127))+_0x17d6fc(0x12f),'location':getLocationFromPath(_0x523050[_0x17d6fc(0x155)],_0x523050[_0x17d6fc(0xb9)],[_0x4d2d87])});}if(_0x972e29['journeys']&&_0x972e29[_0x17d6fc(0x124)][_0x17d6fc(0x16e)]>0x0)for(let _0x337a62=0x0;_0x337a62<_0x972e29[_0x17d6fc(0x124)][_0x17d6fc(0x16e)];_0x337a62++){const _0x435702=_0x972e29[_0x17d6fc(0x124)][_0x337a62];if(_0x972e29[_0x17d6fc(0x124)][_0x17d6fc(0x16e)]>0x1&&_0x435702[_0x17d6fc(0xfe)]==='launched')continue;const _0x35be92=_0x435702[_0x17d6fc(0xf7)]||[],_0x781b8b=_0x17d6fc(0x11e)+_0x337a62+'].',_0xb08ac5=!!_0x435702[_0x17d6fc(0xcf)],_0x41cbee=_0xb08ac5?{..._0x972e29,'goal':_0x435702[_0x17d6fc(0xcf)]}:_0x972e29;validateStagesForVersion(_0x35be92,_0x41cbee,_0x181afb,_0x781b8b,_0x7b43fd,_0x5126e0,{'goalIsInherited':!_0xb08ac5});}else{if(_0x972e29[_0x17d6fc(0x133)]&&_0x972e29['versions'][_0x17d6fc(0x16e)]>0x0)for(let _0x73e51a=0x0;_0x73e51a<_0x972e29['versions'][_0x17d6fc(0x16e)];_0x73e51a++){const _0x5c3777=_0x972e29[_0x17d6fc(0x133)][_0x73e51a];if(_0x972e29['versions'][_0x17d6fc(0x16e)]>0x1&&_0x5c3777[_0x17d6fc(0xfe)]===_0x17d6fc(0xdd))continue;const _0x84ca58=_0x5c3777['stages']||[],_0x29d2d6=_0x17d6fc(0xd9)+_0x73e51a+'].';validateStagesForVersion(_0x84ca58,_0x972e29,_0x181afb,_0x29d2d6,_0x7b43fd,_0x5126e0);}else{const _0x19f36a=_0x972e29['stages']||[];validateStagesForVersion(_0x19f36a,_0x972e29,_0x181afb,'',_0x7b43fd,_0x5126e0);}}_0x972e29['journeys']&&_0x972e29['journeys']['length']>0x1&&(deduplicateAcrossVersions(_0x7b43fd),deduplicateAcrossVersions(_0x5126e0));for(const _0x1f4a9b of _0x381abf){!_0x1d5ccd[_0x17d6fc(0xff)](_0x1f4a9b)&&!_0x1f4a9b[_0x17d6fc(0x168)](_0x17d6fc(0x163))&&_0x5126e0[_0x17d6fc(0x12a)]({'level':_0x17d6fc(0x116),'path':_0x17d6fc(0x117)+_0x1f4a9b,'code':_0x17d6fc(0x10b),'message':_0x17d6fc(0xeb)+_0x1f4a9b+_0x17d6fc(0xd5),'location':getLocationFromPath(_0x523050[_0x17d6fc(0x155)],_0x523050['source'],[_0x17d6fc(0xcb),_0x1f4a9b])});}return{'valid':_0x7b43fd[_0x17d6fc(0x16e)]===0x0,'errors':_0x7b43fd,'warnings':_0x5126e0};}
|
|
1
|
+
(function(_0x8ff630,_0x18020d){const _0x2855fe=a146_0x5478,_0x560c15=_0x8ff630();while(!![]){try{const _0x167df6=-parseInt(_0x2855fe(0x17a))/0x1*(-parseInt(_0x2855fe(0x160))/0x2)+-parseInt(_0x2855fe(0x1d6))/0x3*(-parseInt(_0x2855fe(0x1ac))/0x4)+parseInt(_0x2855fe(0x17f))/0x5*(-parseInt(_0x2855fe(0x187))/0x6)+parseInt(_0x2855fe(0x1ba))/0x7*(-parseInt(_0x2855fe(0x197))/0x8)+-parseInt(_0x2855fe(0x183))/0x9+parseInt(_0x2855fe(0x1a8))/0xa+-parseInt(_0x2855fe(0x208))/0xb*(-parseInt(_0x2855fe(0x1a5))/0xc);if(_0x167df6===_0x18020d)break;else _0x560c15['push'](_0x560c15['shift']());}catch(_0xe12ceb){_0x560c15['push'](_0x560c15['shift']());}}}(a146_0x15f0,0x6c333));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x53d0f1,_0x1b1cbf,_0x33a664,_0x322be9,_0x2fe0d7,_0x3444cd){const _0x4a5e04=a146_0x5478;return{'level':_0x53d0f1,'path':_0x1b1cbf,'code':_0x33a664,'message':_0x322be9,'location':getLocationFromPath(_0x2fe0d7[_0x4a5e04(0x182)],_0x2fe0d7[_0x4a5e04(0x185)],pathToArray(_0x3444cd??_0x1b1cbf))};}function a146_0x5478(_0x4b2163,_0x446721){_0x4b2163=_0x4b2163-0x15d;const _0x15f094=a146_0x15f0();let _0x5478a7=_0x15f094[_0x4b2163];return _0x5478a7;}function validateVersionStructure(_0x7ea7c,_0x239327){const _0x598e10=a146_0x5478,_0x2a723c=[];return _0x7ea7c[_0x598e10(0x1fd)]>MAX_STAGES&&_0x2a723c[_0x598e10(0x1b5)](createIssue('error',_0x598e10(0x202),_0x598e10(0x1ce),_0x598e10(0x17d)+_0x7ea7c[_0x598e10(0x1fd)]+_0x598e10(0x1d5)+MAX_STAGES,_0x239327)),_0x2a723c;}function validateStageStructure(_0x47492f,_0x5995d9,_0x35a48a,_0x1e286a){const _0x428303=a146_0x5478,_0x1d57b0=[],_0x20dbbf='stages['+_0x5995d9+']';_0x5995d9===0x0&&!_0x47492f[_0x428303(0x15d)]&&_0x1d57b0['push'](createIssue(_0x428303(0x16b),_0x20dbbf+_0x428303(0x1ed),_0x428303(0x1c7),_0x428303(0x1a6)+_0x47492f[_0x428303(0x18a)]+_0x428303(0x168),_0x1e286a,_0x20dbbf));const _0x5264e0=_0x5995d9===_0x35a48a-0x1;!_0x5264e0&&!_0x47492f[_0x428303(0x1f2)]&&_0x1d57b0['push'](createIssue(_0x428303(0x16b),_0x20dbbf+_0x428303(0x190),_0x428303(0x1eb),_0x428303(0x1a6)+_0x47492f[_0x428303(0x18a)]+_0x428303(0x1db),_0x1e286a,_0x20dbbf));(!_0x47492f[_0x428303(0x1f8)]||_0x47492f[_0x428303(0x1f8)][_0x428303(0x1fd)]===0x0)&&_0x1d57b0[_0x428303(0x1b5)](createIssue('warning',_0x20dbbf+_0x428303(0x1b9),_0x428303(0x1a9),'Stage\x20\x27'+_0x47492f[_0x428303(0x18a)]+_0x428303(0x1f5),_0x1e286a,_0x20dbbf));const _0x1f615c=_0x47492f['steps']?.[_0x428303(0x1fd)]??0x0;if(_0x1f615c===0x0)_0x1d57b0[_0x428303(0x1b5)](createIssue(_0x428303(0x16b),_0x20dbbf+_0x428303(0x161),_0x428303(0x188),_0x428303(0x1a6)+_0x47492f[_0x428303(0x18a)]+_0x428303(0x1bb),_0x1e286a,_0x20dbbf+_0x428303(0x161)));else{if(_0x1f615c===0x1)_0x1d57b0[_0x428303(0x1b5)](createIssue(_0x428303(0x1e7),_0x20dbbf+_0x428303(0x161),_0x428303(0x188),'Stage\x20\x27'+_0x47492f[_0x428303(0x18a)]+_0x428303(0x1ca),_0x1e286a,_0x20dbbf+_0x428303(0x161)));else _0x1f615c<=0x3&&_0x1d57b0[_0x428303(0x1b5)](createIssue(_0x428303(0x1e7),_0x20dbbf+'.steps','FEW_STEPS','Stage\x20\x27'+_0x47492f[_0x428303(0x18a)]+_0x428303(0x1b6)+_0x1f615c+_0x428303(0x1f0),_0x1e286a,_0x20dbbf+'.steps'));}return _0x1d57b0;}function validateStep(_0x28a276,_0x3c6a2b,_0x53f483,_0x2f58bf){const _0x5b78d3=a146_0x5478,_0x40683c=[];if(_0x28a276[_0x5b78d3(0x1a3)]===_0x5b78d3(0x207))return _0x28a276[_0x5b78d3(0x1dc)]&&_0x40683c[_0x5b78d3(0x1b5)](createIssue('error',_0x3c6a2b+_0x5b78d3(0x16a),_0x5b78d3(0x20e),'End\x20step\x20\x27'+_0x28a276[_0x5b78d3(0x18a)]+'\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field',_0x53f483)),_0x5b78d3(0x1c1)in _0x28a276&&_0x28a276[_0x5b78d3(0x1c1)]!==undefined&&_0x40683c[_0x5b78d3(0x1b5)](createIssue(_0x5b78d3(0x16b),_0x3c6a2b+'.with','END_STEP_HAS_NEXT_OR_WITH',_0x5b78d3(0x16c)+_0x28a276[_0x5b78d3(0x18a)]+_0x5b78d3(0x1fb),_0x53f483)),_0x40683c;_0x28a276[_0x5b78d3(0x1dc)]&&(_0x53f483['stepNames']&&!_0x53f483[_0x5b78d3(0x192)][_0x5b78d3(0x18c)](_0x28a276[_0x5b78d3(0x1dc)])&&_0x40683c['push'](createIssue(_0x5b78d3(0x16b),_0x3c6a2b+_0x5b78d3(0x16a),_0x5b78d3(0x1a0),_0x5b78d3(0x19e)+_0x28a276[_0x5b78d3(0x1dc)]+'\x27',_0x53f483)));switch(_0x28a276[_0x5b78d3(0x1a3)]){case'wait':_0x40683c[_0x5b78d3(0x1b5)](...validateWaitStep(_0x28a276,_0x3c6a2b,_0x53f483,_0x2f58bf));break;case _0x5b78d3(0x16f):_0x40683c[_0x5b78d3(0x1b5)](...validateActivationStep(_0x28a276,_0x3c6a2b,_0x53f483));break;case _0x5b78d3(0x204):_0x40683c['push'](...validateDecisionPointStep(_0x28a276,_0x3c6a2b,_0x53f483,_0x2f58bf));break;case'ab_test':_0x40683c[_0x5b78d3(0x1b5)](...validateAbTestStep(_0x28a276,_0x3c6a2b,_0x53f483,_0x2f58bf));break;case'jump':_0x40683c[_0x5b78d3(0x1b5)](...validateJumpStep(_0x28a276,_0x3c6a2b,_0x53f483));break;}return _0x40683c;}function validateWaitStep(_0x5b1fe4,_0x29d728,_0x3eecb1,_0x4d9f75){const _0x21d64b=a146_0x5478,_0x12ff1f=[];if(!_0x5b1fe4[_0x21d64b(0x1c1)])return _0x12ff1f[_0x21d64b(0x1b5)](createIssue(_0x21d64b(0x16b),_0x29d728+'.with',_0x21d64b(0x184),_0x21d64b(0x181),_0x3eecb1,_0x29d728)),_0x12ff1f;if(_0x5b1fe4[_0x21d64b(0x1c1)]['condition']){const _0x287cb0=_0x5b1fe4[_0x21d64b(0x1c1)]['condition'];if(_0x287cb0[_0x21d64b(0x1f7)]){_0x3eecb1[_0x21d64b(0x162)]?.[_0x21d64b(0x196)](_0x287cb0[_0x21d64b(0x1f7)]);!_0x287cb0['segment']['startsWith']('ref:')&&(_0x3eecb1[_0x21d64b(0x1e4)]&&!_0x3eecb1[_0x21d64b(0x1e4)][_0x21d64b(0x18c)](_0x287cb0[_0x21d64b(0x1f7)])&&_0x12ff1f['push'](createIssue(_0x21d64b(0x16b),_0x29d728+'.with.condition.segment',_0x21d64b(0x1ea),_0x21d64b(0x1d1)+_0x287cb0[_0x21d64b(0x1f7)]+_0x21d64b(0x19c),_0x3eecb1)));_0x287cb0[_0x21d64b(0x1dc)]&&_0x3eecb1[_0x21d64b(0x192)]&&!_0x3eecb1[_0x21d64b(0x192)][_0x21d64b(0x18c)](_0x287cb0['next'])&&_0x12ff1f['push'](createIssue(_0x21d64b(0x16b),_0x29d728+_0x21d64b(0x1af),'INVALID_NEXT_REFERENCE','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x287cb0[_0x21d64b(0x1dc)]+'\x27',_0x3eecb1));_0x287cb0[_0x21d64b(0x20b)]?.[_0x21d64b(0x1dc)]&&_0x3eecb1[_0x21d64b(0x192)]&&!_0x3eecb1['stepNames'][_0x21d64b(0x18c)](_0x287cb0[_0x21d64b(0x20b)][_0x21d64b(0x1dc)])&&_0x12ff1f['push'](createIssue(_0x21d64b(0x16b),_0x29d728+'.with.condition.timeout.next',_0x21d64b(0x1a0),_0x21d64b(0x1b3)+_0x287cb0[_0x21d64b(0x20b)][_0x21d64b(0x1dc)]+'\x27',_0x3eecb1));const _0x1e54d3=_0x287cb0[_0x21d64b(0x1dc)]||_0x5b1fe4[_0x21d64b(0x1dc)],_0x5c9ecb=_0x287cb0['timeout']?.[_0x21d64b(0x1dc)]||_0x5b1fe4['next'];if(_0x1e54d3){const _0xbb0eaf=_0x4d9f75[_0x21d64b(0x17e)](_0x1e54d3);_0xbb0eaf?.[_0x21d64b(0x1a3)]===_0x21d64b(0x1e8)&&_0x12ff1f[_0x21d64b(0x1b5)](createIssue(_0x21d64b(0x1e7),_0x29d728+_0x21d64b(0x1af),'BRANCH_DIRECTLY_TO_MERGE','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x1e54d3+_0x21d64b(0x1e1),_0x3eecb1,_0x29d728+_0x21d64b(0x1aa)));}if(_0x5c9ecb){const _0x2ed576=_0x4d9f75[_0x21d64b(0x17e)](_0x5c9ecb);_0x2ed576?.[_0x21d64b(0x1a3)]===_0x21d64b(0x1e8)&&_0x12ff1f[_0x21d64b(0x1b5)](createIssue('warning',_0x29d728+_0x21d64b(0x1c3),_0x21d64b(0x1d7),_0x21d64b(0x1a7)+_0x5c9ecb+_0x21d64b(0x1e1),_0x3eecb1,_0x29d728+_0x21d64b(0x18d)));}}}return _0x12ff1f;}function validateActivationStep(_0xd05192,_0x4f72ca,_0x537808){const _0x8dd698=a146_0x5478,_0x1d53eb=[];if(!_0xd05192['with']?.[_0x8dd698(0x16f)])return _0x1d53eb[_0x8dd698(0x1b5)](createIssue('error',_0x4f72ca+_0x8dd698(0x165),_0x8dd698(0x1b7),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x537808,_0x4f72ca)),_0x1d53eb;const _0xbc0fa5=_0xd05192['with'][_0x8dd698(0x16f)];return _0x537808[_0x8dd698(0x1e9)]&&!_0xbc0fa5[_0x8dd698(0x175)]('ref:')&&(!_0x537808['activationKeys'][_0x8dd698(0x18c)](_0xbc0fa5)&&_0x1d53eb[_0x8dd698(0x1b5)](createIssue('error',_0x4f72ca+_0x8dd698(0x165),_0x8dd698(0x17c),_0x8dd698(0x1c0)+_0xbc0fa5+_0x8dd698(0x1d4),_0x537808))),_0x1d53eb;}function validateDecisionPointStep(_0x1f7880,_0x32622b,_0x5af0b5,_0x1ea0fc){const _0x43ade7=a146_0x5478,_0x550106=[];if(!_0x1f7880[_0x43ade7(0x1c1)]?.['branches']||_0x1f7880[_0x43ade7(0x1c1)][_0x43ade7(0x1d9)][_0x43ade7(0x1fd)]===0x0)return _0x550106[_0x43ade7(0x1b5)](createIssue('error',_0x32622b+_0x43ade7(0x163),_0x43ade7(0x1c2),'Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x5af0b5,_0x32622b)),_0x550106;for(let _0x2981ab=0x0;_0x2981ab<_0x1f7880['with']['branches'][_0x43ade7(0x1fd)];_0x2981ab++){const _0x21bbed=_0x1f7880[_0x43ade7(0x1c1)]['branches'][_0x2981ab],_0x3b6969=_0x32622b+_0x43ade7(0x203)+_0x2981ab+']';_0x21bbed[_0x43ade7(0x1f7)]&&!_0x21bbed[_0x43ade7(0x1cc)]&&(_0x5af0b5[_0x43ade7(0x162)]?.['add'](_0x21bbed[_0x43ade7(0x1f7)]),!_0x21bbed[_0x43ade7(0x1f7)][_0x43ade7(0x175)](_0x43ade7(0x177))&&(_0x5af0b5[_0x43ade7(0x1e4)]&&!_0x5af0b5[_0x43ade7(0x1e4)]['has'](_0x21bbed['segment'])&&_0x550106[_0x43ade7(0x1b5)](createIssue(_0x43ade7(0x16b),_0x3b6969+_0x43ade7(0x1f3),_0x43ade7(0x1ea),'Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x21bbed[_0x43ade7(0x1f7)]+'\x27',_0x5af0b5))));_0x21bbed[_0x43ade7(0x1dc)]&&_0x5af0b5['stepNames']&&!_0x5af0b5['stepNames'][_0x43ade7(0x18c)](_0x21bbed[_0x43ade7(0x1dc)])&&_0x550106[_0x43ade7(0x1b5)](createIssue('error',_0x3b6969+_0x43ade7(0x16a),_0x43ade7(0x1a0),'Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x21bbed[_0x43ade7(0x1dc)]+'\x27',_0x5af0b5));if(_0x21bbed[_0x43ade7(0x1dc)]){const _0x1974c6=_0x1ea0fc['get'](_0x21bbed[_0x43ade7(0x1dc)]);_0x1974c6?.['type']===_0x43ade7(0x1e8)&&_0x550106[_0x43ade7(0x1b5)](createIssue('warning',_0x3b6969+_0x43ade7(0x16a),'BRANCH_DIRECTLY_TO_MERGE','Decision\x20branch\x20\x27'+_0x21bbed[_0x43ade7(0x18a)]+_0x43ade7(0x211)+_0x21bbed[_0x43ade7(0x1dc)]+_0x43ade7(0x1f1),_0x5af0b5));}}return _0x550106;}function validateAbTestStep(_0x468730,_0x11d746,_0x2d4346,_0xd77fe1){const _0x4159e0=a146_0x5478,_0x5c55c2=[];if(!_0x468730[_0x4159e0(0x1c1)]?.[_0x4159e0(0x178)]||_0x468730[_0x4159e0(0x1c1)][_0x4159e0(0x178)][_0x4159e0(0x1fd)]===0x0)return _0x5c55c2['push'](createIssue(_0x4159e0(0x16b),_0x11d746+'.with.variants',_0x4159e0(0x1c2),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x2d4346,_0x11d746)),_0x5c55c2;const _0x593d56=_0x468730[_0x4159e0(0x1c1)]['variants']['reduce']((_0x58c286,_0x1b88a1)=>_0x58c286+(_0x1b88a1['percentage']||0x0),0x0);Math['abs'](_0x593d56-0x64)>0.01&&_0x5c55c2[_0x4159e0(0x1b5)](createIssue(_0x4159e0(0x16b),_0x11d746+_0x4159e0(0x1fe),_0x4159e0(0x1b8),_0x4159e0(0x19d)+_0x593d56+'%)',_0x2d4346));for(let _0x164cb1=0x0;_0x164cb1<_0x468730[_0x4159e0(0x1c1)]['variants']['length'];_0x164cb1++){const _0x20ffb3=_0x468730['with'][_0x4159e0(0x178)][_0x164cb1],_0x12595f=_0x11d746+_0x4159e0(0x1f4)+_0x164cb1+']';_0x20ffb3[_0x4159e0(0x1dc)]&&_0x2d4346[_0x4159e0(0x192)]&&!_0x2d4346['stepNames'][_0x4159e0(0x18c)](_0x20ffb3[_0x4159e0(0x1dc)])&&_0x5c55c2[_0x4159e0(0x1b5)](createIssue('error',_0x12595f+_0x4159e0(0x16a),_0x4159e0(0x1a0),_0x4159e0(0x1f6)+_0x20ffb3['next']+'\x27',_0x2d4346));if(_0x20ffb3[_0x4159e0(0x1dc)]){const _0x2b6b45=_0xd77fe1[_0x4159e0(0x17e)](_0x20ffb3['next']);_0x2b6b45?.['type']===_0x4159e0(0x1e8)&&_0x5c55c2[_0x4159e0(0x1b5)](createIssue(_0x4159e0(0x1e7),_0x12595f+_0x4159e0(0x16a),'BRANCH_DIRECTLY_TO_MERGE',_0x4159e0(0x1bd)+_0x20ffb3[_0x4159e0(0x18a)]+_0x4159e0(0x211)+_0x20ffb3[_0x4159e0(0x1dc)]+_0x4159e0(0x1f1),_0x2d4346));}}return _0x5c55c2;}function validateJumpStep(_0x4f8d45,_0x33345f,_0xbc932f){const _0x2f519f=a146_0x5478,_0x80c313=[];if(!_0x4f8d45[_0x2f519f(0x1c1)]?.['target'])return _0x80c313[_0x2f519f(0x1b5)](createIssue('error',_0x33345f+_0x2f519f(0x1b2),_0x2f519f(0x1f9),_0x2f519f(0x17b),_0xbc932f,_0x33345f)),_0x80c313;return(!_0x4f8d45['with'][_0x2f519f(0x1c8)][_0x2f519f(0x180)]||!_0x4f8d45['with'][_0x2f519f(0x1c8)]['stage'])&&_0x80c313['push'](createIssue(_0x2f519f(0x16b),_0x33345f+_0x2f519f(0x1b2),_0x2f519f(0x1f9),_0x2f519f(0x1e0),_0xbc932f)),_0x80c313;}function a146_0x15f0(){const _0x59bdf9=['\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','push','\x27\x20has\x20only\x20','MISSING_ACTIVATION_REF','INVALID_AB_TEST_PERCENTAGES','.exit_criteria','1130927tEWxnb','\x27\x20has\x20no\x20steps','splice','A/B\x20test\x20variant\x20\x27','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','Duplicate\x20step\x20name\x20\x27','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','with','MISSING_CONDITIONS','.with.condition.timeout.next','values','.type','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','MISSING_ENTRY_CRITERIA','target','Embedded\x20segment\x20\x27','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)',').\x20Merge\x20is\x20unnecessary.','excluded','UNUSED_EMBEDDED_SEGMENT','TOO_MANY_STAGES','match','description','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','.name','steps','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','\x20stages\x20but\x20maximum\x20is\x20','861207DBoaTo','BRANCH_DIRECTLY_TO_MERGE','message','branches','\x27\x20of\x20\x27','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','next','\x27\x20(first\x20defined\x20at\x20steps[','MERGE_TO_MERGE_CHAIN','\x27\x20has\x20no\x20end\x20step','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','journeys','data','embeddedSegments','CONVERGENCE_WITHOUT_MERGE','set','warning','merge','activationKeys','MISSING_SEGMENT_REFERENCE','MISSING_MILESTONE','.stages','.entry_criteria','goalIsInherited','map','\x20steps\x20(may\x20be\x20too\x20simple)','\x27\x20with\x20no\x20action\x20in\x20between','milestone','.segment','.with.variants[','\x27\x20has\x20no\x20exit_criteria\x20defined','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','segment','exit_criteria','INVALID_JUMP_TARGET','journeys,\x20stages,\x20or\x20versions','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',').\x20Use\x20a\x20merge\x20step.','length','.with.variants','journey\x20entry','.steps[','SINGLE_INPUT_MERGE','stages','.with.branches[','decision_point','version','keys','end','203643ohrvNT','indices','endsWith','timeout','MISSING_STAGES','condition\x20of\x20\x27','END_STEP_HAS_NEXT_OR_WITH','every','skipSchema','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','segments.','entry_criteria','goal','journeys[','28818okBkAI','.steps','referencedSegments','.with.branches','path','.with.activation','\x20versions)','trim','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','level','.next','error','End\x20step\x20\x27','Criteria\x20references\x20undefined\x20segment\x20\x27','success','activation','ACTIVATION_SCHEMA_ERROR','join','size','.rule','.exit_criteria[','startsWith','wait','ref:','variants','Merge\x20step\x20\x27','27PNQiFw','Jump\x20step\x20requires\x20a\x20target','MISSING_ACTIVATION_DEFINITION','Journey\x20has\x20','get','5BCEmxf','journey','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','document','5488182pIbUJF','MISSING_WAIT_PARAMS','source','condition','2072610LLnHev','INSUFFICIENT_STEPS','code','name','rule','has','.with.condition.timeout','includes','\x20(across\x20','.milestone','state','stepNames','JOURNEY_SCHEMA_ERROR','variant\x20\x27','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','add','16vvOlwz','filter','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','stages[','branch\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','Step\x20references\x20non-existent\x20step\x20\x27','latest','INVALID_NEXT_REFERENCE','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','versions','type','excluded_','180VqbyKs','Stage\x20\x27','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','7677350xbUdkF','MISSING_EXIT_CRITERIA','.with.condition','versions[','4eeUbjP','symbol','issues','.with.condition.next','segments','\x27\x20(from:\x20','.with.target','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'];a146_0x15f0=function(){return _0x59bdf9;};return a146_0x15f0();}function buildConvergenceMap(_0xd2824a){const _0x2c4203=a146_0x5478,_0x4aced6=new Map();function _0x56480e(_0x4db9b4,_0x56e62e){const _0x4c9062=a146_0x5478,_0x1e0ee9=_0x4aced6[_0x4c9062(0x17e)](_0x4db9b4)||[];_0x1e0ee9[_0x4c9062(0x1b5)](_0x56e62e),_0x4aced6[_0x4c9062(0x1e6)](_0x4db9b4,_0x1e0ee9);}for(const _0x5b6c8b of _0xd2824a){_0x5b6c8b['next']&&_0x56480e(_0x5b6c8b['next'],{'stepName':_0x5b6c8b[_0x2c4203(0x18a)],'description':'step\x20\x27'+_0x5b6c8b[_0x2c4203(0x18a)]+'\x27'});if(_0x5b6c8b[_0x2c4203(0x1a3)]==='decision_point'&&_0x5b6c8b[_0x2c4203(0x1c1)]?.[_0x2c4203(0x1d9)])for(const _0x38e756 of _0x5b6c8b['with']['branches']){_0x38e756[_0x2c4203(0x1dc)]&&_0x56480e(_0x38e756[_0x2c4203(0x1dc)],{'stepName':_0x5b6c8b[_0x2c4203(0x18a)],'description':_0x2c4203(0x19b)+_0x38e756[_0x2c4203(0x18a)]+_0x2c4203(0x1da)+_0x5b6c8b[_0x2c4203(0x18a)]+'\x27'});}if(_0x5b6c8b[_0x2c4203(0x1a3)]==='ab_test'&&_0x5b6c8b[_0x2c4203(0x1c1)]?.[_0x2c4203(0x178)])for(const _0x293c13 of _0x5b6c8b[_0x2c4203(0x1c1)][_0x2c4203(0x178)]){_0x293c13[_0x2c4203(0x1dc)]&&_0x56480e(_0x293c13['next'],{'stepName':_0x5b6c8b[_0x2c4203(0x18a)],'description':_0x2c4203(0x194)+_0x293c13[_0x2c4203(0x18a)]+_0x2c4203(0x1da)+_0x5b6c8b['name']+'\x27'});}_0x5b6c8b[_0x2c4203(0x1a3)]===_0x2c4203(0x176)&&_0x5b6c8b[_0x2c4203(0x1c1)]?.[_0x2c4203(0x186)]&&(_0x5b6c8b[_0x2c4203(0x1c1)]['condition'][_0x2c4203(0x1dc)]&&_0x56480e(_0x5b6c8b[_0x2c4203(0x1c1)][_0x2c4203(0x186)][_0x2c4203(0x1dc)],{'stepName':_0x5b6c8b['name'],'description':_0x2c4203(0x20d)+_0x5b6c8b[_0x2c4203(0x18a)]+'\x27'}),_0x5b6c8b['with']['condition']['timeout']?.[_0x2c4203(0x1dc)]&&_0x56480e(_0x5b6c8b['with'][_0x2c4203(0x186)][_0x2c4203(0x20b)][_0x2c4203(0x1dc)],{'stepName':_0x5b6c8b[_0x2c4203(0x18a)],'description':'timeout\x20of\x20\x27'+_0x5b6c8b[_0x2c4203(0x18a)]+'\x27'}));}return _0x4aced6;}function validateFlowControl(_0x4d832b,_0x51cb54,_0x41ea5b){const _0x3f542b=a146_0x5478,_0x567c6b=[],_0x52d4da='stages['+_0x51cb54+']',_0x5432df=_0x4d832b[_0x3f542b(0x1d3)]||[];if(_0x5432df[_0x3f542b(0x1fd)]===0x0)return _0x567c6b;const _0x1bfb37=new Map();for(const _0x3d69ae of _0x5432df){_0x3d69ae[_0x3f542b(0x18a)]&&_0x1bfb37['set'](_0x3d69ae[_0x3f542b(0x18a)],_0x3d69ae);}const _0x29ee49=buildConvergenceMap(_0x5432df),_0x246783=_0x5432df['some'](_0x15a8ec=>_0x15a8ec[_0x3f542b(0x1a3)]===_0x3f542b(0x207));!_0x246783&&_0x567c6b[_0x3f542b(0x1b5)](createIssue(_0x3f542b(0x16b),_0x52d4da+_0x3f542b(0x161),'MISSING_END_STEP',_0x3f542b(0x1a6)+_0x4d832b[_0x3f542b(0x18a)]+_0x3f542b(0x1df),_0x41ea5b));for(const [_0x5da84b,_0x3a2f5f]of _0x29ee49){const _0x3534b9=_0x1bfb37[_0x3f542b(0x17e)](_0x5da84b);if(!_0x3534b9)continue;if(_0x3a2f5f[_0x3f542b(0x1fd)]>0x1&&_0x3534b9['type']!==_0x3f542b(0x1e8)){const _0x1d8e38=_0x3a2f5f[_0x3f542b(0x1ef)](_0x170aa5=>_0x170aa5[_0x3f542b(0x1d0)])[_0x3f542b(0x171)](',\x20');_0x567c6b['push'](createIssue(_0x3f542b(0x16b),_0x52d4da+_0x3f542b(0x161),_0x3f542b(0x1e5),_0x3f542b(0x1c6)+_0x5da84b+_0x3f542b(0x1b1)+_0x1d8e38+_0x3f542b(0x1fc),_0x41ea5b));}_0x3a2f5f[_0x3f542b(0x1fd)]===0x1&&_0x3534b9[_0x3f542b(0x1a3)]===_0x3f542b(0x1e8)&&_0x567c6b['push'](createIssue(_0x3f542b(0x1e7),_0x52d4da+'.steps',_0x3f542b(0x201),_0x3f542b(0x179)+_0x5da84b+_0x3f542b(0x195)+_0x3a2f5f[0x0][_0x3f542b(0x1d0)]+_0x3f542b(0x1cb),_0x41ea5b));}for(const _0x54bee4 of _0x5432df){if(_0x54bee4[_0x3f542b(0x1a3)]===_0x3f542b(0x1e8)&&_0x54bee4[_0x3f542b(0x1dc)]){const _0x5430d8=_0x1bfb37[_0x3f542b(0x17e)](_0x54bee4[_0x3f542b(0x1dc)]);_0x5430d8?.[_0x3f542b(0x1a3)]===_0x3f542b(0x1e8)&&_0x567c6b[_0x3f542b(0x1b5)](createIssue(_0x3f542b(0x16b),_0x52d4da+_0x3f542b(0x161),_0x3f542b(0x1de),_0x3f542b(0x179)+_0x54bee4[_0x3f542b(0x18a)]+_0x3f542b(0x1a1)+_0x54bee4['next']+_0x3f542b(0x1b4),_0x41ea5b));}}return _0x567c6b;}function validateCriteria(_0x58c0c8,_0x1de13c,_0x18fed0){const _0x387d3e=a146_0x5478,_0x75796d=[];return _0x58c0c8['segment']&&(_0x18fed0[_0x387d3e(0x162)]?.[_0x387d3e(0x196)](_0x58c0c8['segment']),!_0x58c0c8[_0x387d3e(0x1f7)][_0x387d3e(0x175)](_0x387d3e(0x177))&&(_0x18fed0[_0x387d3e(0x1e4)]&&!_0x18fed0[_0x387d3e(0x1e4)]['has'](_0x58c0c8[_0x387d3e(0x1f7)])&&_0x75796d[_0x387d3e(0x1b5)](createIssue(_0x387d3e(0x16b),_0x1de13c+_0x387d3e(0x1f3),_0x387d3e(0x1ea),_0x387d3e(0x16d)+_0x58c0c8[_0x387d3e(0x1f7)]+'\x27',_0x18fed0)))),_0x75796d;}function validateEmbeddedSegment(_0x12874f,_0x261bf9,_0x3dee6d){const _0x25ebe1=a146_0x5478,_0x5ea2a3=[];return _0x12874f[_0x25ebe1(0x18b)]&&_0x5ea2a3[_0x25ebe1(0x1b5)](...validateRuleDef(_0x12874f[_0x25ebe1(0x18b)],_0x261bf9+_0x25ebe1(0x173),_0x3dee6d)),_0x5ea2a3;}function validateStage(_0x16e675,_0x4eb95d,_0x30a5a0,_0x356582){const _0x186da0=a146_0x5478,_0x13ffa0=[],_0x184cb9=_0x186da0(0x19a)+_0x4eb95d+']',_0x595e8d=new Map(),_0x229c63=new Map();if(_0x16e675[_0x186da0(0x1d3)]){for(let _0x4d3756=0x0;_0x4d3756<_0x16e675[_0x186da0(0x1d3)][_0x186da0(0x1fd)];_0x4d3756++){const _0x506365=_0x16e675[_0x186da0(0x1d3)][_0x4d3756];_0x506365[_0x186da0(0x18a)]&&_0x595e8d[_0x186da0(0x1e6)](_0x506365[_0x186da0(0x18a)],_0x506365);}for(let _0x5cea3a=0x0;_0x5cea3a<_0x16e675['steps'][_0x186da0(0x1fd)];_0x5cea3a++){const _0x2e6ffb=_0x16e675[_0x186da0(0x1d3)][_0x5cea3a],_0xc4f6ae=_0x184cb9+_0x186da0(0x200)+_0x5cea3a+']';if(_0x2e6ffb['name']){if(_0x229c63[_0x186da0(0x18c)](_0x2e6ffb[_0x186da0(0x18a)])){const _0x3d503e=_0x229c63['get'](_0x2e6ffb[_0x186da0(0x18a)]);_0x13ffa0['push'](createIssue('error',_0xc4f6ae+_0x186da0(0x1d2),'DUPLICATE_STEP_NAME',_0x186da0(0x1bf)+_0x2e6ffb[_0x186da0(0x18a)]+_0x186da0(0x1dd)+_0x3d503e+'])',_0x356582));}else _0x229c63['set'](_0x2e6ffb[_0x186da0(0x18a)],_0x5cea3a);}_0x13ffa0[_0x186da0(0x1b5)](...validateStep(_0x2e6ffb,_0xc4f6ae,_0x356582,_0x595e8d));}}_0x16e675[_0x186da0(0x15d)]&&_0x13ffa0[_0x186da0(0x1b5)](...validateCriteria(_0x16e675['entry_criteria'],_0x184cb9+'.entry_criteria',_0x356582));if(_0x16e675[_0x186da0(0x1f8)])for(let _0x318ba3=0x0;_0x318ba3<_0x16e675['exit_criteria'][_0x186da0(0x1fd)];_0x318ba3++){_0x13ffa0['push'](...validateCriteria(_0x16e675[_0x186da0(0x1f8)][_0x318ba3],_0x184cb9+_0x186da0(0x174)+_0x318ba3+']',_0x356582));}return _0x16e675[_0x186da0(0x1f2)]&&_0x13ffa0[_0x186da0(0x1b5)](...validateCriteria(_0x16e675[_0x186da0(0x1f2)],_0x184cb9+_0x186da0(0x190),_0x356582)),_0x13ffa0['push'](...validateStageStructure(_0x16e675,_0x4eb95d,_0x30a5a0,_0x356582)),_0x13ffa0[_0x186da0(0x1b5)](...validateFlowControl(_0x16e675,_0x4eb95d,_0x356582)),_0x13ffa0;}function validateStagesForVersion(_0x25c8b7,_0x19a9fe,_0x10d154,_0x1f8bd4,_0x576546,_0x86e217,_0x5a7faa){const _0x37b779=a146_0x5478;if(_0x25c8b7[_0x37b779(0x1fd)]===0x0){_0x576546['push']({'level':_0x37b779(0x16b),'path':_0x1f8bd4+_0x37b779(0x202),'code':_0x37b779(0x20c),'message':_0x37b779(0x1be),'location':getLocationFromPath(_0x10d154[_0x37b779(0x182)],_0x10d154[_0x37b779(0x185)],[_0x37b779(0x202)])});return;}const _0x230db4=new Set();for(const _0x565085 of _0x25c8b7){if(_0x565085[_0x37b779(0x1d3)])for(const _0x393473 of _0x565085[_0x37b779(0x1d3)]){_0x393473[_0x37b779(0x18a)]&&_0x230db4[_0x37b779(0x196)](_0x393473['name']);}}const _0x5ed1dd={..._0x10d154,'stepNames':_0x230db4},_0x499b23=validateVersionStructure(_0x25c8b7,_0x5ed1dd);for(const _0x55bde8 of _0x499b23){const _0x5a3f3a=_0x1f8bd4?{..._0x55bde8,'path':''+_0x1f8bd4+_0x55bde8[_0x37b779(0x164)]}:_0x55bde8;if(_0x5a3f3a[_0x37b779(0x169)]==='error')_0x576546['push'](_0x5a3f3a);else _0x86e217[_0x37b779(0x1b5)](_0x5a3f3a);}for(let _0x4f2417=0x0;_0x4f2417<_0x25c8b7[_0x37b779(0x1fd)];_0x4f2417++){const _0x197b49=validateStage(_0x25c8b7[_0x4f2417],_0x4f2417,_0x25c8b7[_0x37b779(0x1fd)],_0x5ed1dd);for(const _0x5db811 of _0x197b49){const _0x450da7=_0x1f8bd4?{..._0x5db811,'path':''+_0x1f8bd4+_0x5db811[_0x37b779(0x164)]}:_0x5db811;if(_0x450da7[_0x37b779(0x169)]===_0x37b779(0x16b))_0x576546[_0x37b779(0x1b5)](_0x450da7);else _0x86e217['push'](_0x450da7);}}if(_0x19a9fe[_0x37b779(0x15e)]){const _0x3292d5=_0x5a7faa?.[_0x37b779(0x1ee)]?_0x37b779(0x15e):_0x1f8bd4+_0x37b779(0x15e),_0x463c41=validateCriteria(_0x19a9fe['goal'],_0x3292d5,_0x5ed1dd);for(const _0x114b40 of _0x463c41){if(_0x114b40[_0x37b779(0x169)]==='error')_0x576546['push'](_0x114b40);else _0x86e217[_0x37b779(0x1b5)](_0x114b40);}}}function extractVersionIndex(_0x1d9450){const _0x5776ab=a146_0x5478,_0xe791d9=_0x1d9450[_0x5776ab(0x1cf)](/^journeys\[(\d+)\]\./);return _0xe791d9?_0xe791d9[0x1]:undefined;}function deduplicateAcrossVersions(_0x3a1dcc){const _0x366ae5=a146_0x5478,_0x4f00cb=new Map();for(let _0x1e5e15=0x0;_0x1e5e15<_0x3a1dcc[_0x366ae5(0x1fd)];_0x1e5e15++){const _0x5d5258=_0x3a1dcc[_0x1e5e15][_0x366ae5(0x189)]+':'+_0x3a1dcc[_0x1e5e15]['message'],_0x54b1aa=extractVersionIndex(_0x3a1dcc[_0x1e5e15][_0x366ae5(0x164)]),_0x361e94=_0x4f00cb[_0x366ae5(0x17e)](_0x5d5258);if(_0x361e94){_0x361e94[_0x366ae5(0x209)]['push'](_0x1e5e15);if(_0x54b1aa)_0x361e94['versions']['add'](_0x54b1aa);}else _0x4f00cb[_0x366ae5(0x1e6)](_0x5d5258,{'indices':[_0x1e5e15],'versions':new Set(_0x54b1aa?[_0x54b1aa]:[])});}const _0x520db3=new Set();for(const {indices:_0x54573e,versions:_0x58f582}of _0x4f00cb[_0x366ae5(0x1c4)]()){if(_0x58f582[_0x366ae5(0x172)]<=0x1)continue;const _0x36a252=_0x3a1dcc[_0x54573e[0x0]];_0x36a252[_0x366ae5(0x164)]=_0x36a252['path']['replace'](/^journeys\[\d+\]\./,''),_0x36a252[_0x366ae5(0x1d8)]=_0x36a252[_0x366ae5(0x1d8)]+_0x366ae5(0x18f)+_0x58f582[_0x366ae5(0x172)]+_0x366ae5(0x166);for(let _0x127ca1=0x1;_0x127ca1<_0x54573e[_0x366ae5(0x1fd)];_0x127ca1++){_0x520db3[_0x366ae5(0x196)](_0x54573e[_0x127ca1]);}}const _0x25f7c2=[..._0x520db3]['sort']((_0x40e813,_0x3f5aba)=>_0x3f5aba-_0x40e813);for(const _0x3d853f of _0x25f7c2){_0x3a1dcc[_0x366ae5(0x1bc)](_0x3d853f,0x1);}}export function validateJourneyDef(_0x2a306f,_0x320fdd={},_0x395f4c={}){const _0x1f057a=a146_0x5478;if(_0x395f4c[_0x1f057a(0x210)])return runJourneySemanticChecks(_0x2a306f,_0x320fdd);const _0x374aa5=JourneyDefSchema['safeParse'](_0x2a306f);if(_0x374aa5[_0x1f057a(0x16e)])return runJourneySemanticChecks(_0x374aa5[_0x1f057a(0x1e3)],_0x320fdd);return zodErrorsToJourneyValidationResult(_0x374aa5['error'],_0x320fdd);}function zodErrorsToJourneyValidationResult(_0xfa590b,_0x2b5fc2){const _0x27cc16=a146_0x5478,_0x233390=flattenZodIssues(_0xfa590b[_0x27cc16(0x1ae)]),_0x567a58=_0x233390[_0x27cc16(0x1ef)](_0x51a737=>{const _0x536f42=_0x27cc16,_0x220d4a=formatZodPath(_0x51a737['path']),_0x259ad7=mapJourneyZodIssueToCode(_0x51a737,_0x220d4a),_0x1d65dc=getLocationFromPath(_0x2b5fc2['document'],_0x2b5fc2['source'],_0x51a737[_0x536f42(0x164)][_0x536f42(0x1ef)](_0x23459d=>typeof _0x23459d===_0x536f42(0x1ad)?String(_0x23459d):_0x23459d));return{'level':'error','path':_0x220d4a,'code':_0x259ad7,'message':_0x51a737[_0x536f42(0x1d8)],..._0x1d65dc&&{'location':_0x1d65dc}};});return{'valid':![],'errors':_0x567a58,'warnings':[]};}function mapJourneyZodIssueToCode(_0x367a7f,_0x2e3382){const _0x253df3=a146_0x5478;if(_0x2e3382==='name')return'MISSING_NAME';if(_0x2e3382[_0x253df3(0x20a)](_0x253df3(0x1c5))&&_0x2e3382[_0x253df3(0x18e)]('steps'))return _0x253df3(0x193);if(_0x2e3382===_0x253df3(0x202)||_0x2e3382['endsWith'](_0x253df3(0x1ec)))return _0x253df3(0x20c);if(_0x2e3382===''&&_0x367a7f['message'][_0x253df3(0x18e)](_0x253df3(0x1fa)))return'MISSING_STAGES';if(_0x2e3382['includes'](_0x253df3(0x16f)))return _0x253df3(0x170);return _0x253df3(0x193);}function runJourneySemanticChecks(_0x4b7f07,_0x813a1d){const _0x254e98=a146_0x5478,_0x397fd3=[],_0x4a03c7=[];(!_0x4b7f07[_0x254e98(0x18a)]||_0x4b7f07['name'][_0x254e98(0x167)]()==='')&&_0x397fd3[_0x254e98(0x1b5)]({'level':_0x254e98(0x16b),'path':_0x254e98(0x18a),'code':'MISSING_NAME','message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x813a1d['document'],_0x813a1d[_0x254e98(0x185)],[_0x254e98(0x18a)])});const _0x249cad=new Set();if(_0x4b7f07[_0x254e98(0x1b0)])for(const _0x19c5c4 of Object['keys'](_0x4b7f07[_0x254e98(0x1b0)])){_0x249cad[_0x254e98(0x196)](_0x19c5c4);}const _0x3be81a=new Set();if(_0x4b7f07['activations'])for(const _0x186c88 of Object[_0x254e98(0x206)](_0x4b7f07['activations'])){_0x3be81a[_0x254e98(0x196)](_0x186c88);}const _0x57e0a7=new Set(),_0x26349d={..._0x813a1d,'embeddedSegments':_0x249cad,'referencedSegments':_0x57e0a7,'activationKeys':_0x3be81a[_0x254e98(0x172)]>0x0?_0x3be81a:undefined};if(_0x4b7f07[_0x254e98(0x1b0)])for(const [_0x1dfc40,_0x5e4ff5]of Object['entries'](_0x4b7f07[_0x254e98(0x1b0)])){const _0x1e40c6=validateEmbeddedSegment(_0x5e4ff5,_0x254e98(0x212)+_0x1dfc40,_0x26349d);for(const _0x304bcb of _0x1e40c6){if(_0x304bcb[_0x254e98(0x169)]===_0x254e98(0x16b))_0x397fd3['push'](_0x304bcb);else _0x4a03c7['push'](_0x304bcb);}}const _0x4fd709=!!_0x4b7f07[_0x254e98(0x15e)],_0x5ab649=_0x4b7f07[_0x254e98(0x1e2)]?.[_0x254e98(0x20f)](_0x5d6a90=>!!_0x5d6a90[_0x254e98(0x15e)])??![];!_0x4fd709&&!_0x5ab649&&_0x4a03c7[_0x254e98(0x1b5)]({'level':'warning','path':_0x254e98(0x15e),'code':'MISSING_GOAL','message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x813a1d[_0x254e98(0x182)],_0x813a1d['source'],[_0x254e98(0x15e)])});const _0x358ded=_0x4b7f07[_0x254e98(0x1e2)]??_0x4b7f07['versions'];if(_0x358ded&&_0x358ded[_0x254e98(0x198)](_0x26ad85=>_0x26ad85[_0x254e98(0x19f)]===!![])[_0x254e98(0x1fd)]>0x1){const _0x3d67af=_0x4b7f07[_0x254e98(0x1e2)]?'journeys':_0x254e98(0x1a2);_0x397fd3[_0x254e98(0x1b5)]({'level':'error','path':_0x3d67af,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x3d67af==='journeys'?_0x254e98(0x1ff):_0x254e98(0x205))+'\x20with\x20latest:\x20true','location':getLocationFromPath(_0x813a1d[_0x254e98(0x182)],_0x813a1d[_0x254e98(0x185)],[_0x3d67af])});}if(_0x4b7f07[_0x254e98(0x1e2)]&&_0x4b7f07[_0x254e98(0x1e2)][_0x254e98(0x1fd)]>0x0)for(let _0x6b1bbc=0x0;_0x6b1bbc<_0x4b7f07[_0x254e98(0x1e2)][_0x254e98(0x1fd)];_0x6b1bbc++){const _0x752035=_0x4b7f07[_0x254e98(0x1e2)][_0x6b1bbc];if(_0x4b7f07[_0x254e98(0x1e2)][_0x254e98(0x1fd)]>0x1&&_0x752035[_0x254e98(0x191)]==='launched')continue;const _0x49c2f7=_0x752035[_0x254e98(0x202)]||[],_0x144573=_0x254e98(0x15f)+_0x6b1bbc+'].',_0x5ca513=!!_0x752035[_0x254e98(0x15e)],_0x29544a=_0x5ca513?{..._0x4b7f07,'goal':_0x752035['goal']}:_0x4b7f07;validateStagesForVersion(_0x49c2f7,_0x29544a,_0x26349d,_0x144573,_0x397fd3,_0x4a03c7,{'goalIsInherited':!_0x5ca513});}else{if(_0x4b7f07[_0x254e98(0x1a2)]&&_0x4b7f07['versions'][_0x254e98(0x1fd)]>0x0)for(let _0x5c98aa=0x0;_0x5c98aa<_0x4b7f07[_0x254e98(0x1a2)][_0x254e98(0x1fd)];_0x5c98aa++){const _0xdfb7b1=_0x4b7f07[_0x254e98(0x1a2)][_0x5c98aa];if(_0x4b7f07[_0x254e98(0x1a2)]['length']>0x1&&_0xdfb7b1['state']==='launched')continue;const _0x5e7a73=_0xdfb7b1[_0x254e98(0x202)]||[],_0x3a724d=_0x254e98(0x1ab)+_0x5c98aa+'].';validateStagesForVersion(_0x5e7a73,_0x4b7f07,_0x26349d,_0x3a724d,_0x397fd3,_0x4a03c7);}else{const _0x3358cf=_0x4b7f07['stages']||[];validateStagesForVersion(_0x3358cf,_0x4b7f07,_0x26349d,'',_0x397fd3,_0x4a03c7);}}_0x4b7f07[_0x254e98(0x1e2)]&&_0x4b7f07[_0x254e98(0x1e2)][_0x254e98(0x1fd)]>0x1&&(deduplicateAcrossVersions(_0x397fd3),deduplicateAcrossVersions(_0x4a03c7));for(const _0x52d571 of _0x249cad){!_0x57e0a7[_0x254e98(0x18c)](_0x52d571)&&!_0x52d571[_0x254e98(0x175)](_0x254e98(0x1a4))&&_0x4a03c7[_0x254e98(0x1b5)]({'level':_0x254e98(0x1e7),'path':'segments.'+_0x52d571,'code':_0x254e98(0x1cd),'message':_0x254e98(0x1c9)+_0x52d571+_0x254e98(0x199),'location':getLocationFromPath(_0x813a1d[_0x254e98(0x182)],_0x813a1d[_0x254e98(0x185)],['segments',_0x52d571])});}return{'valid':_0x397fd3[_0x254e98(0x1fd)]===0x0,'errors':_0x397fd3,'warnings':_0x4a03c7};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a147_0x40cd8b=a147_0x476d;(function(_0x1f1622,_0x3ee64d){const _0x51afe4=a147_0x476d,_0xebae8d=_0x1f1622();while(!![]){try{const _0xedeb83=-parseInt(_0x51afe4(0xc7))/0x1+-parseInt(_0x51afe4(0x128))/0x2*(-parseInt(_0x51afe4(0xd9))/0x3)+parseInt(_0x51afe4(0xe8))/0x4+-parseInt(_0x51afe4(0x168))/0x5+-parseInt(_0x51afe4(0xe1))/0x6*(parseInt(_0x51afe4(0x13f))/0x7)+parseInt(_0x51afe4(0xb1))/0x8+parseInt(_0x51afe4(0x119))/0x9*(parseInt(_0x51afe4(0xb6))/0xa);if(_0xedeb83===_0x3ee64d)break;else _0xebae8d['push'](_0xebae8d['shift']());}catch(_0x292be6){_0xebae8d['push'](_0xebae8d['shift']());}}}(a147_0x467e,0x85c53));import*as a147_0x2decaa from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x1b1e4d){const _0x2656bd=a147_0x476d,_0x395681=_0x1b1e4d[_0x2656bd(0x10c)]();if(_0x395681==='days'||_0x395681===_0x2656bd(0xae))return _0x2656bd(0xae);if(_0x395681==='weeks'||_0x395681===_0x2656bd(0xe9))return _0x2656bd(0xe9);return _0x1b1e4d;}export function journeyResponseToDefSync(_0x55af6e){const _0x2c1820=a147_0x476d,_0x439b58=_0x55af6e['attributes'],_0x39ece0=_0x439b58[_0x2c1820(0x137)]||_0x439b58[_0x2c1820(0xf5)],_0x4f146a={'stages':_0x439b58[_0x2c1820(0x136)][_0x2c1820(0xd0)](convertApiStageToYaml),'id':_0x55af6e['id']};_0x439b58[_0x2c1820(0xb8)]&&(_0x4f146a[_0x2c1820(0xb8)]=convertApiCriteriaToYaml(_0x439b58['goal']));_0x439b58['name']&&_0x439b58[_0x2c1820(0xf5)]!==_0x39ece0&&(_0x4f146a[_0x2c1820(0x13c)]=_0x439b58[_0x2c1820(0xf5)]);_0x439b58[_0x2c1820(0xc0)]!==undefined&&(_0x4f146a[_0x2c1820(0x15f)]=_0x439b58[_0x2c1820(0xc0)]);_0x439b58[_0x2c1820(0x120)]&&(_0x4f146a[_0x2c1820(0x120)]=_0x439b58['state']===_0x2c1820(0x13b)?'launched':_0x2c1820(0xf2));const _0x5186cd={'type':_0x2c1820(0x123),'name':_0x39ece0,'journeys':[_0x4f146a]};_0x439b58[_0x2c1820(0xc2)]&&(_0x5186cd['description']=_0x439b58[_0x2c1820(0xc2)]);_0x439b58[_0x2c1820(0xb8)]&&(_0x5186cd['goal']=convertApiCriteriaToYaml(_0x439b58[_0x2c1820(0xb8)]));if(_0x439b58['reentryMode'])_0x5186cd[_0x2c1820(0xed)]=_0x439b58[_0x2c1820(0x125)];else _0x439b58[_0x2c1820(0xb4)]!==undefined&&(_0x5186cd[_0x2c1820(0xed)]=_0x439b58['allowReentry']?_0x2c1820(0x141):_0x2c1820(0xe6));return _0x439b58[_0x2c1820(0xd8)]&&(_0x5186cd[_0x2c1820(0xfa)]=_0x439b58[_0x2c1820(0xd8)]),_0x439b58[_0x2c1820(0x137)]&&(_0x5186cd[_0x2c1820(0x100)]=_0x439b58['journeyBundleName']),_0x55af6e[_0x2c1820(0x10a)]?.[_0x2c1820(0xd2)]?.['data']?.['id']&&(_0x5186cd[_0x2c1820(0xe2)]=_0x55af6e[_0x2c1820(0x10a)]['parentFolder'][_0x2c1820(0x15e)]['id']),_0x5186cd;}function a147_0x467e(){const _0x24cc66=['stageId','randomUUID','name','schedule','variants','get','attributes','bundle_id','wait','days_of_week','filter','object','sort','bundle_name','goal-segment','test','segments:','folder','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','journeys','shift','\x27:\x20','relationships','waitStepUnit','toLowerCase','target','ref:','branches','includes','resolveSegment','trim','activations','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','excludedPath','decision_point','waitStep','Duration','9pkjeAQ','stageName','waitCondition','add','behavior','DaysOfTheWeek','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','state','percentage','stage','journey','journeyId','reentryMode','resolveEmbeddedSegmentId','Stage\x201','49676pMZzBZ','notification','replace','type','resolveJourneyId','definition','entries','entryCriteria','find','goal:','exitCriterias','activation_template_id','resolveEmbeddedActivationId','*Max\x20wait\x20','journeyStages','journeyBundleName','End','journeyActivationStepId','duration','launched','version','conditionTimeoutDuration','versions:','1300747VHbNBt','root_step','reentry_always','embedded','stages:','resolveActivationId','size','First\x20stage\x20of\x20the\x20journey','conditions','match','waitStepType','has','segments','segmentId','Met\x20condition(s)','condition','(missing)','with','daysOfWeek','And','stages','Condition','resolveSegmentId','all','waitUntilDate','Journey\x20description','rule','versions','jump','Date','timeout','data','version_number','\x20\x20\x20\x20conditions:\x0a','exit_criteria','push','activations:','Wait\x201\x20Day','Goal\x20Achieved','stringify','length','4056505gIJCGM','connector_config','end','day','values','ABTest','3262792UBOapd','all_columns','merge','allowReentry','reentry:','3156530EIiyMi','resolveActivationName','goal','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','JOURNEY_SYNTAX_ERROR','milestone','Expected\x20format:\x0a','excluded','steps','resolveActivation','versionNumber','slice','description','keys','wait_until','ab_test','latest','967158HIUUHQ','timedOutPath','next','unit','conditionSegmentId','segment','\x20\x20rule:\x0a','Merge','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','map','conditionTimeoutUnit','parentFolder','Stage\x20Complete','exitCriteria','resolveStageId','isArray','entry_criteria','journeyBundleId','111ykSpoi','journeyStageId','from','resolveJumpTarget','customized_split','moveAfter','activation','unique_id','12MnTjVT','folder_id','isJourneyLocal','ref','WaitStep','no_reentry','your-activation-name','4222064vgECQo','week','resolveSegmentName','uuid','rootStep','reentry','set','null','Jump','journeyName','draft'];a147_0x467e=function(){return _0x24cc66;};return a147_0x467e();}export async function journeyResponseToDef(_0x1e12ef,_0x120368){const _0x4f1026=a147_0x476d,_0x2c87b8=journeyResponseToDefSync(_0x1e12ef);if(!_0x120368)return _0x2c87b8;const _0xce44c5=new Set();collectSegmentIdsFromJourney(_0x2c87b8,_0xce44c5);const _0x1bd9dc=new Set();collectActivationIdsFromJourney(_0x2c87b8,_0x1bd9dc);const _0x1187be={},_0x592066=new Map();for(const _0x220686 of Array[_0x4f1026(0xdb)](_0xce44c5)[_0x4f1026(0xff)]()){if(_0x120368[_0x4f1026(0x111)]){const _0x3c1d91=await _0x120368[_0x4f1026(0x111)](_0x220686);if(_0x3c1d91[_0x4f1026(0xe3)]){_0x592066[_0x4f1026(0xee)](_0x220686,_0x3c1d91[_0x4f1026(0xf5)]);if(_0x3c1d91[_0x4f1026(0x12d)]){const _0x22d101={..._0x3c1d91['definition'],'rule':deepSortObject(_0x3c1d91[_0x4f1026(0x12d)][_0x4f1026(0x159)])};_0x1187be[_0x3c1d91['name']]=_0x22d101;}}else _0x592066[_0x4f1026(0xee)](_0x220686,makeSegmentRef(_0x3c1d91['name']));}else{if(_0x120368['resolveSegmentName']){const _0x1e3729=await _0x120368[_0x4f1026(0xea)](_0x220686);_0x592066[_0x4f1026(0xee)](_0x220686,_0x1e3729);}}}const _0x2d7d3c={},_0x2b669f=new Map();for(const _0x53863c of Array['from'](_0x1bd9dc)['sort']()){if(_0x120368[_0x4f1026(0xbf)]){const _0x2a91a5=await _0x120368[_0x4f1026(0xbf)](_0x53863c);_0x2a91a5[_0x4f1026(0xe3)]?(_0x2b669f[_0x4f1026(0xee)](_0x53863c,_0x2a91a5[_0x4f1026(0xf5)]),_0x2a91a5['definition']&&(_0x2d7d3c[_0x2a91a5[_0x4f1026(0xf5)]]=_0x2a91a5[_0x4f1026(0x12d)])):_0x2b669f[_0x4f1026(0xee)](_0x53863c,makeSegmentRef(_0x2a91a5[_0x4f1026(0xf5)]));}else{if(_0x120368['resolveActivationName']){const _0x2e9261=await _0x120368[_0x4f1026(0xb7)](_0x53863c);_0x2b669f[_0x4f1026(0xee)](_0x53863c,_0x2e9261);}}}_0x592066['size']>0x0&&replaceSegmentIdsInJourney(_0x2c87b8,_0x592066);_0x2b669f[_0x4f1026(0x145)]>0x0&&replaceActivationIdsInJourney(_0x2c87b8,_0x2b669f);if(_0x120368['resolveJumpTarget']){const _0x29e474=[];collectJumpTargetsFromJourney(_0x2c87b8,_0x29e474);if(_0x29e474[_0x4f1026(0x167)]>0x0){const _0x43cb76=new Map();for(const _0x1a1869 of _0x29e474){try{const _0x383e22=await _0x120368[_0x4f1026(0xdc)](_0x1a1869[_0x4f1026(0x124)],_0x1a1869[_0x4f1026(0xf3)]);_0x43cb76['set'](_0x1a1869['journeyId']+':'+_0x1a1869[_0x4f1026(0xf3)],_0x383e22);}catch{}}_0x43cb76['size']>0x0&&replaceJumpTargetsInJourney(_0x2c87b8,_0x43cb76);}}return Object[_0x4f1026(0xc3)](_0x1187be)[_0x4f1026(0x167)]>0x0&&(_0x2c87b8['segments']=_0x1187be),Object[_0x4f1026(0xc3)](_0x2d7d3c)[_0x4f1026(0x167)]>0x0&&(_0x2c87b8['activations']=_0x2d7d3c),_0x2c87b8;}function collectSegmentIdsFromJourney(_0x48860d,_0x537a3f){const _0x56a911=a147_0x476d;_0x48860d[_0x56a911(0xb8)]?.[_0x56a911(0xcc)]&&_0x537a3f[_0x56a911(0x11c)](_0x48860d[_0x56a911(0xb8)]['segment']);const _0x1194c7=_0x25c598=>{const _0x2ecc4f=_0x56a911;for(const _0x3b499d of _0x25c598){_0x3b499d[_0x2ecc4f(0xd7)]?.[_0x2ecc4f(0xcc)]&&_0x537a3f[_0x2ecc4f(0x11c)](_0x3b499d[_0x2ecc4f(0xd7)][_0x2ecc4f(0xcc)]);if(_0x3b499d[_0x2ecc4f(0x161)])for(const _0x2d913a of _0x3b499d[_0x2ecc4f(0x161)]){_0x2d913a[_0x2ecc4f(0xcc)]&&_0x537a3f['add'](_0x2d913a[_0x2ecc4f(0xcc)]);}_0x3b499d[_0x2ecc4f(0xbb)]?.[_0x2ecc4f(0xcc)]&&_0x537a3f[_0x2ecc4f(0x11c)](_0x3b499d[_0x2ecc4f(0xbb)]['segment']);if(_0x3b499d[_0x2ecc4f(0xbe)])for(const _0x30a4fe of _0x3b499d['steps']){if(_0x30a4fe[_0x2ecc4f(0x12b)]==='decision_point'){const _0x397df7=_0x30a4fe;for(const _0xff1a80 of _0x397df7['with'][_0x2ecc4f(0x10f)]){_0xff1a80[_0x2ecc4f(0xcc)]&&_0x537a3f['add'](_0xff1a80[_0x2ecc4f(0xcc)]);}}else{if(_0x30a4fe[_0x2ecc4f(0x12b)]==='wait'){const _0x31665f=_0x30a4fe;_0x31665f[_0x2ecc4f(0x150)][_0x2ecc4f(0x14e)]?.[_0x2ecc4f(0xcc)]&&_0x537a3f['add'](_0x31665f['with'][_0x2ecc4f(0x14e)]['segment']);}}}}};if(_0x48860d[_0x56a911(0x107)])for(const _0x3cba0f of _0x48860d['journeys']){_0x3cba0f[_0x56a911(0xb8)]?.[_0x56a911(0xcc)]&&_0x537a3f[_0x56a911(0x11c)](_0x3cba0f[_0x56a911(0xb8)][_0x56a911(0xcc)]),_0x1194c7(_0x3cba0f[_0x56a911(0x153)]);}_0x48860d[_0x56a911(0x153)]&&_0x1194c7(_0x48860d[_0x56a911(0x153)]);if(_0x48860d[_0x56a911(0x15a)])for(const _0x1b56f6 of _0x48860d['versions']){_0x1194c7(_0x1b56f6[_0x56a911(0x153)]);}}function replaceSegmentIdsInJourney(_0xcb0870,_0x1d4f3d){const _0x4f7b27=a147_0x476d,_0x596f4a=_0x6d09c1=>_0x1d4f3d[_0x4f7b27(0xf8)](_0x6d09c1)||_0x6d09c1;_0xcb0870[_0x4f7b27(0xb8)]?.[_0x4f7b27(0xcc)]&&(_0xcb0870[_0x4f7b27(0xb8)][_0x4f7b27(0xcc)]=_0x596f4a(_0xcb0870[_0x4f7b27(0xb8)][_0x4f7b27(0xcc)]));const _0x6f86aa=_0x119557=>{const _0x58042e=_0x4f7b27;for(const _0x42904a of _0x119557){_0x42904a[_0x58042e(0xd7)]?.['segment']&&(_0x42904a['entry_criteria'][_0x58042e(0xcc)]=_0x596f4a(_0x42904a[_0x58042e(0xd7)]['segment']));if(_0x42904a[_0x58042e(0x161)])for(const _0x438e24 of _0x42904a[_0x58042e(0x161)]){_0x438e24[_0x58042e(0xcc)]&&(_0x438e24[_0x58042e(0xcc)]=_0x596f4a(_0x438e24[_0x58042e(0xcc)]));}_0x42904a[_0x58042e(0xbb)]?.['segment']&&(_0x42904a[_0x58042e(0xbb)][_0x58042e(0xcc)]=_0x596f4a(_0x42904a[_0x58042e(0xbb)][_0x58042e(0xcc)]));if(_0x42904a[_0x58042e(0xbe)])for(const _0xe08844 of _0x42904a[_0x58042e(0xbe)]){if(_0xe08844[_0x58042e(0x12b)]===_0x58042e(0x116)){const _0x27ca2a=_0xe08844;for(const _0x394cff of _0x27ca2a['with'][_0x58042e(0x10f)]){_0x394cff[_0x58042e(0xcc)]&&(_0x394cff[_0x58042e(0xcc)]=_0x596f4a(_0x394cff[_0x58042e(0xcc)]));}}else{if(_0xe08844[_0x58042e(0x12b)]==='wait'){const _0x135970=_0xe08844;_0x135970['with']['condition']?.['segment']&&(_0x135970[_0x58042e(0x150)][_0x58042e(0x14e)][_0x58042e(0xcc)]=_0x596f4a(_0x135970[_0x58042e(0x150)]['condition'][_0x58042e(0xcc)]));}}}}};if(_0xcb0870['journeys'])for(const _0x351b9c of _0xcb0870[_0x4f7b27(0x107)]){_0x351b9c[_0x4f7b27(0xb8)]?.[_0x4f7b27(0xcc)]&&(_0x351b9c[_0x4f7b27(0xb8)][_0x4f7b27(0xcc)]=_0x596f4a(_0x351b9c['goal']['segment'])),_0x6f86aa(_0x351b9c[_0x4f7b27(0x153)]);}_0xcb0870[_0x4f7b27(0x153)]&&_0x6f86aa(_0xcb0870[_0x4f7b27(0x153)]);if(_0xcb0870[_0x4f7b27(0x15a)])for(const _0x4d1fff of _0xcb0870['versions']){_0x6f86aa(_0x4d1fff[_0x4f7b27(0x153)]);}}function collectActivationIdsFromJourney(_0xdbd8fa,_0xcebf8f){const _0x1bca67=a147_0x476d,_0x2d104f=_0x260413=>{const _0x12411b=a147_0x476d;for(const _0x2d6996 of _0x260413){if(_0x2d6996['steps'])for(const _0x4e793d of _0x2d6996['steps']){if(_0x4e793d[_0x12411b(0x12b)]===_0x12411b(0xdf)){const _0x1312f8=_0x4e793d;_0x1312f8['with'][_0x12411b(0xdf)]&&/^\d+$/[_0x12411b(0x102)](_0x1312f8[_0x12411b(0x150)][_0x12411b(0xdf)])&&_0xcebf8f['add'](_0x1312f8['with'][_0x12411b(0xdf)]);}}}};if(_0xdbd8fa[_0x1bca67(0x107)])for(const _0x4959f1 of _0xdbd8fa[_0x1bca67(0x107)]){_0x2d104f(_0x4959f1[_0x1bca67(0x153)]);}_0xdbd8fa['stages']&&_0x2d104f(_0xdbd8fa[_0x1bca67(0x153)]);if(_0xdbd8fa[_0x1bca67(0x15a)])for(const _0x480c0f of _0xdbd8fa[_0x1bca67(0x15a)]){_0x2d104f(_0x480c0f[_0x1bca67(0x153)]);}}function replaceActivationIdsInJourney(_0x3352b0,_0x281656){const _0xa21bce=a147_0x476d,_0x439d9a=_0xdf9f03=>_0x281656[_0xa21bce(0xf8)](_0xdf9f03)||_0xdf9f03,_0x5ab896=_0xe018ea=>{const _0xe5bea=_0xa21bce;for(const _0xb6d16e of _0xe018ea){if(_0xb6d16e[_0xe5bea(0xbe)])for(const _0x52f3c4 of _0xb6d16e[_0xe5bea(0xbe)]){if(_0x52f3c4[_0xe5bea(0x12b)]===_0xe5bea(0xdf)){const _0x3d2390=_0x52f3c4;_0x3d2390[_0xe5bea(0x150)][_0xe5bea(0xdf)]&&(_0x3d2390[_0xe5bea(0x150)][_0xe5bea(0xdf)]=_0x439d9a(_0x3d2390[_0xe5bea(0x150)][_0xe5bea(0xdf)]));}}}};if(_0x3352b0['journeys'])for(const _0x5ca44a of _0x3352b0[_0xa21bce(0x107)]){_0x5ab896(_0x5ca44a[_0xa21bce(0x153)]);}_0x3352b0[_0xa21bce(0x153)]&&_0x5ab896(_0x3352b0['stages']);if(_0x3352b0[_0xa21bce(0x15a)])for(const _0x4580c3 of _0x3352b0[_0xa21bce(0x15a)]){_0x5ab896(_0x4580c3[_0xa21bce(0x153)]);}}function collectJumpTargetsFromJourney(_0x44d97d,_0x30de2f){const _0x3440c0=a147_0x476d,_0x2ecf37=new Set(),_0x3c9e44=_0x4dfbbd=>{const _0x4528a2=a147_0x476d;for(const _0x3d1489 of _0x4dfbbd){if(_0x3d1489['steps'])for(const _0x335714 of _0x3d1489[_0x4528a2(0xbe)]){if(_0x335714[_0x4528a2(0x12b)]===_0x4528a2(0x15b)){const _0xe05d38=_0x335714,_0x4b8a70=_0xe05d38['with'][_0x4528a2(0x10d)];if(_0x4b8a70[_0x4528a2(0x123)]&&_0x4b8a70['stage']&&/^\d+$/[_0x4528a2(0x102)](_0x4b8a70[_0x4528a2(0x123)])&&/^\d+$/[_0x4528a2(0x102)](_0x4b8a70[_0x4528a2(0x122)])){const _0x5849b2=_0x4b8a70[_0x4528a2(0x123)]+':'+_0x4b8a70[_0x4528a2(0x122)];!_0x2ecf37['has'](_0x5849b2)&&(_0x2ecf37[_0x4528a2(0x11c)](_0x5849b2),_0x30de2f[_0x4528a2(0x162)]({'journeyId':_0x4b8a70[_0x4528a2(0x123)],'stageId':_0x4b8a70[_0x4528a2(0x122)]}));}}}}};if(_0x44d97d[_0x3440c0(0x107)])for(const _0x223016 of _0x44d97d[_0x3440c0(0x107)]){_0x3c9e44(_0x223016[_0x3440c0(0x153)]);}_0x44d97d['stages']&&_0x3c9e44(_0x44d97d[_0x3440c0(0x153)]);if(_0x44d97d[_0x3440c0(0x15a)])for(const _0x12a115 of _0x44d97d[_0x3440c0(0x15a)]){_0x3c9e44(_0x12a115['stages']);}}function replaceJumpTargetsInJourney(_0x27933a,_0x2a049b){const _0x1e0040=a147_0x476d,_0xc832f8=_0x502b25=>{const _0x1b7613=a147_0x476d;for(const _0x5b57b8 of _0x502b25){if(_0x5b57b8['steps'])for(const _0x1dab55 of _0x5b57b8[_0x1b7613(0xbe)]){if(_0x1dab55['type']==='jump'){const _0x1085aa=_0x1dab55,_0x5db12a=_0x1085aa[_0x1b7613(0x150)][_0x1b7613(0x10d)],_0x46ef42=_0x5db12a['journey']+':'+_0x5db12a['stage'],_0x566f18=_0x2a049b[_0x1b7613(0xf8)](_0x46ef42);_0x566f18&&(_0x5db12a[_0x1b7613(0x123)]=_0x566f18[_0x1b7613(0xf1)],_0x5db12a[_0x1b7613(0x122)]=_0x566f18[_0x1b7613(0x11a)]);}}}};if(_0x27933a[_0x1e0040(0x107)])for(const _0x4fd5ee of _0x27933a[_0x1e0040(0x107)]){_0xc832f8(_0x4fd5ee[_0x1e0040(0x153)]);}_0x27933a[_0x1e0040(0x153)]&&_0xc832f8(_0x27933a[_0x1e0040(0x153)]);if(_0x27933a[_0x1e0040(0x15a)])for(const _0x26fd66 of _0x27933a[_0x1e0040(0x15a)]){_0xc832f8(_0x26fd66[_0x1e0040(0x153)]);}}function generateReadableStepName(_0x374a94,_0x52fe1a){const _0x17e76a=a147_0x476d;if(_0x374a94['name']&&_0x374a94['name']!==_0x374a94[_0x17e76a(0x12b)]){const _0x1b6a58=_0x374a94[_0x17e76a(0xf5)]['trim']();if(_0x1b6a58&&/[a-z0-9\p{L}]/iu['test'](_0x1b6a58))return _0x1b6a58;}const _0x50e528=_0x374a94[_0x17e76a(0x12b)][_0x17e76a(0x10c)]()[_0x17e76a(0x12a)](/step$/i,'');return _0x50e528+'_'+(_0x52fe1a+0x1);}function getStepNextRefs(_0x58957b){const _0x30104f=a147_0x476d,_0x20ce44=[];if(_0x58957b['next'])_0x20ce44[_0x30104f(0x162)](_0x58957b['next']);if(_0x58957b['branches'])for(const _0x41a259 of _0x58957b['branches']){if(_0x41a259[_0x30104f(0xc9)])_0x20ce44[_0x30104f(0x162)](_0x41a259[_0x30104f(0xc9)]);}if(_0x58957b['variants'])for(const _0x38fcda of _0x58957b['variants']){if(_0x38fcda[_0x30104f(0xc9)])_0x20ce44[_0x30104f(0x162)](_0x38fcda[_0x30104f(0xc9)]);}if(_0x58957b[_0x30104f(0x147)])for(const _0x21dc46 of _0x58957b[_0x30104f(0x147)]){if(_0x21dc46[_0x30104f(0xc9)])_0x20ce44[_0x30104f(0x162)](_0x21dc46[_0x30104f(0xc9)]);}return _0x20ce44;}function parseJumpTargetDisplayName(_0x9a72eb){const _0x18ab9c=a147_0x476d,_0x1037ed=_0x9a72eb[_0x18ab9c(0x148)](/^(.+?)\s*\(([^/)]+)/);if(!_0x1037ed)return undefined;const _0x26e82a=_0x1037ed[0x1][_0x18ab9c(0x112)](),_0x23d019=_0x1037ed[0x2][_0x18ab9c(0x112)]();if(!_0x26e82a||!_0x23d019)return undefined;return{'stageName':_0x26e82a,'journeyName':_0x23d019};}function orderStepsFromRoot(_0x28d40e,_0xe57806){const _0x1c7795=a147_0x476d,_0x5512ab=Object[_0x1c7795(0x12e)](_0x28d40e);if(_0x5512ab[_0x1c7795(0x167)]===0x0)return[];const _0x489a26=new Set(_0x5512ab[_0x1c7795(0xd0)](([_0x3ded74])=>_0x3ded74)),_0x1aa949=new Set();for(const [,_0x4e5cb3]of _0x5512ab){for(const _0x5c6bbe of getStepNextRefs(_0x4e5cb3)){if(_0x489a26[_0x1c7795(0x14a)](_0x5c6bbe))_0x1aa949[_0x1c7795(0x11c)](_0x5c6bbe);}}let _0x41ff99=_0xe57806&&_0x489a26['has'](_0xe57806)?_0xe57806:undefined;if(!_0x41ff99){const _0x2dc6a4=_0x5512ab['filter'](([_0x4985ea])=>!_0x1aa949[_0x1c7795(0x14a)](_0x4985ea));_0x2dc6a4[_0x1c7795(0x167)]>0x0?_0x41ff99=_0x2dc6a4[0x0][0x0]:_0x41ff99=_0x5512ab[0x0][0x0];}const _0x331746=[],_0xb1407b=new Set(),_0x533f3e=[_0x41ff99];while(_0x533f3e[_0x1c7795(0x167)]>0x0){const _0x1a468e=_0x533f3e[_0x1c7795(0x108)]();if(_0xb1407b['has'](_0x1a468e))continue;_0xb1407b[_0x1c7795(0x11c)](_0x1a468e);const _0x200e18=_0x28d40e[_0x1a468e];if(!_0x200e18)continue;_0x331746[_0x1c7795(0x162)]({'uuid':_0x1a468e,'step':_0x200e18});for(const _0x3e684d of getStepNextRefs(_0x200e18)){_0x489a26[_0x1c7795(0x14a)](_0x3e684d)&&!_0xb1407b['has'](_0x3e684d)&&_0x533f3e[_0x1c7795(0x162)](_0x3e684d);}}for(const [_0x43e5ef,_0x559bb4]of _0x5512ab){!_0xb1407b[_0x1c7795(0x14a)](_0x43e5ef)&&_0x331746['push']({'uuid':_0x43e5ef,'step':_0x559bb4});}return _0x331746;}function resolveStepReferences(_0x29067b,_0x54d9cb,_0x10ffe1,_0x12a68f){const _0x537178=a147_0x476d;if(_0x29067b[_0x537178(0x12b)]!=='end'){_0x29067b[_0x537178(0xc9)]&&_0x12a68f[_0x537178(0x14a)](_0x29067b['next'])&&(_0x29067b['next']=_0x12a68f['get'](_0x29067b['next']));const _0x269beb=_0x54d9cb+0x1;if(_0x269beb<_0x10ffe1['length']){const _0x352082=_0x12a68f[_0x537178(0xf8)](_0x10ffe1[_0x269beb][_0x537178(0xeb)]);_0x29067b[_0x537178(0xc9)]===_0x352082&&delete _0x29067b[_0x537178(0xc9)];}}if(_0x29067b['type']==='decision_point')for(const _0x4b1c0a of _0x29067b[_0x537178(0x150)]['branches']){_0x4b1c0a[_0x537178(0xc9)]&&_0x12a68f[_0x537178(0x14a)](_0x4b1c0a[_0x537178(0xc9)])&&(_0x4b1c0a[_0x537178(0xc9)]=_0x12a68f[_0x537178(0xf8)](_0x4b1c0a['next']));}if(_0x29067b[_0x537178(0x12b)]===_0x537178(0xc5))for(const _0x25294d of _0x29067b[_0x537178(0x150)][_0x537178(0xf7)]){_0x25294d[_0x537178(0xc9)]&&_0x12a68f[_0x537178(0x14a)](_0x25294d[_0x537178(0xc9)])&&(_0x25294d['next']=_0x12a68f[_0x537178(0xf8)](_0x25294d['next']));}if(_0x29067b[_0x537178(0x12b)]===_0x537178(0xfb)&&_0x29067b[_0x537178(0x150)][_0x537178(0x14e)]){const _0x336206=_0x29067b[_0x537178(0x150)][_0x537178(0x14e)];_0x336206['next']&&_0x12a68f[_0x537178(0x14a)](_0x336206[_0x537178(0xc9)])&&(_0x336206[_0x537178(0xc9)]=_0x12a68f[_0x537178(0xf8)](_0x336206[_0x537178(0xc9)])),_0x336206[_0x537178(0x15d)]?.['next']&&_0x12a68f[_0x537178(0x14a)](_0x336206[_0x537178(0x15d)]['next'])&&(_0x336206[_0x537178(0x15d)][_0x537178(0xc9)]=_0x12a68f[_0x537178(0xf8)](_0x336206[_0x537178(0x15d)][_0x537178(0xc9)]));}}function convertApiStageToYaml(_0xd20215){const _0x59f14f=a147_0x476d,_0x423add={'name':_0xd20215[_0x59f14f(0xf5)]};_0xd20215['id']&&(_0x423add['id']=_0xd20215['id']);_0xd20215[_0x59f14f(0xc2)]&&(_0x423add['description']=_0xd20215[_0x59f14f(0xc2)]);_0xd20215['entryCriteria']&&(_0x423add[_0x59f14f(0xd7)]=convertApiCriteriaToYaml(_0xd20215['entryCriteria']));_0xd20215['exitCriterias']&&_0xd20215[_0x59f14f(0x132)]['length']>0x0&&(_0x423add[_0x59f14f(0x161)]=_0xd20215[_0x59f14f(0x132)]['map'](convertApiCriteriaToYaml));_0xd20215[_0x59f14f(0xbb)]&&(_0x423add[_0x59f14f(0xbb)]=convertApiCriteriaToYaml(_0xd20215[_0x59f14f(0xbb)]));if(_0xd20215['steps']&&Object[_0x59f14f(0xc3)](_0xd20215[_0x59f14f(0xbe)])['length']>0x0){const _0x1c2d70=orderStepsFromRoot(_0xd20215[_0x59f14f(0xbe)],_0xd20215[_0x59f14f(0xec)]),_0x28c83d=new Map(),_0x299b7c=new Set();for(let _0x4522fe=0x0;_0x4522fe<_0x1c2d70['length'];_0x4522fe++){const {uuid:_0x58471e,step:_0x3e5ab1}=_0x1c2d70[_0x4522fe];let _0x1e65cc=generateReadableStepName(_0x3e5ab1,_0x4522fe),_0x9b8542=_0x1e65cc,_0x52a4d7=0x2;while(_0x299b7c[_0x59f14f(0x14a)](_0x9b8542)){_0x9b8542=_0x1e65cc+'_'+_0x52a4d7,_0x52a4d7++;}_0x299b7c[_0x59f14f(0x11c)](_0x9b8542),_0x28c83d['set'](_0x58471e,_0x9b8542);}_0x423add['steps']=_0x1c2d70[_0x59f14f(0xd0)](({uuid:_0x11cade,step:_0x58580d},_0x11c083)=>{const _0x45a44e=_0x59f14f,_0x464a4d=convertApiStepToYaml(_0x58580d,_0x28c83d[_0x45a44e(0xf8)](_0x11cade));return resolveStepReferences(_0x464a4d,_0x11c083,_0x1c2d70,_0x28c83d),_0x464a4d;});}return _0x423add;}function convertApiCriteriaToYaml(_0x4cc304){const _0xa1f197=a147_0x476d,_0x4de331={'name':_0x4cc304[_0xa1f197(0xf5)],'segment':_0x4cc304[_0xa1f197(0x14c)]};_0x4cc304[_0xa1f197(0xc2)]&&(_0x4de331[_0xa1f197(0xc2)]=_0x4cc304[_0xa1f197(0xc2)]);if(_0x4cc304['target']){let _0x5ef754=_0x4cc304[_0xa1f197(0x10d)]['journeyId'],_0x3e309e=_0x4cc304['target']['journeyStageId'];if(_0x4cc304[_0xa1f197(0x10d)][_0xa1f197(0xf1)]){const _0x5c16a5=parseJumpTargetDisplayName(_0x4cc304[_0xa1f197(0x10d)][_0xa1f197(0xf1)]);_0x5c16a5&&(_0x3e309e=_0x5c16a5[_0xa1f197(0x11a)],_0x5ef754=_0x5c16a5[_0xa1f197(0xf1)]);}_0x4de331[_0xa1f197(0x10d)]={'journey':_0x5ef754,'stage':_0x3e309e},_0x4cc304[_0xa1f197(0x10d)][_0xa1f197(0xd8)]&&(_0x4de331['target'][_0xa1f197(0xfa)]=_0x4cc304[_0xa1f197(0x10d)][_0xa1f197(0xd8)]);}return _0x4de331;}function convertApiStepToYaml(_0x2b4a5e,_0x33dcc3){const _0x28b4e9=a147_0x476d;switch(_0x2b4a5e[_0x28b4e9(0x12b)]){case _0x28b4e9(0xe5):{const _0x5894af={};if(_0x2b4a5e[_0x28b4e9(0x149)]==='Duration'&&_0x2b4a5e[_0x28b4e9(0x117)]!==undefined)_0x5894af[_0x28b4e9(0x13a)]=_0x2b4a5e[_0x28b4e9(0x117)],_0x5894af[_0x28b4e9(0xca)]=_0x2b4a5e[_0x28b4e9(0x10b)];else{if(_0x2b4a5e[_0x28b4e9(0x149)]==='Date'&&_0x2b4a5e[_0x28b4e9(0x157)])_0x5894af[_0x28b4e9(0xc4)]=_0x2b4a5e[_0x28b4e9(0x157)];else{if(_0x2b4a5e[_0x28b4e9(0x149)]===_0x28b4e9(0x11e)&&_0x2b4a5e[_0x28b4e9(0x151)])_0x5894af[_0x28b4e9(0xfc)]=_0x2b4a5e['daysOfWeek'];else{if(_0x2b4a5e[_0x28b4e9(0x149)]===_0x28b4e9(0x154)){if(_0x2b4a5e[_0x28b4e9(0x147)]&&_0x2b4a5e['conditions'][_0x28b4e9(0x167)]>0x0){const _0x120c94=_0x2b4a5e['conditions'][_0x28b4e9(0x130)](_0x4a4d69=>!_0x4a4d69[_0x28b4e9(0xc8)]),_0x47e03d=_0x2b4a5e[_0x28b4e9(0x147)]['find'](_0x42cd7b=>_0x42cd7b[_0x28b4e9(0xc8)]);_0x120c94?.[_0x28b4e9(0x14c)]&&(_0x5894af['condition']={'segment':_0x120c94[_0x28b4e9(0x14c)],..._0x120c94[_0x28b4e9(0xc9)]?{'next':_0x120c94[_0x28b4e9(0xc9)]}:{}},_0x47e03d&&_0x47e03d[_0x28b4e9(0xde)]!==undefined&&_0x47e03d[_0x28b4e9(0xca)]&&(_0x5894af['condition'][_0x28b4e9(0x15d)]={'duration':_0x47e03d[_0x28b4e9(0xde)],'unit':_0x47e03d[_0x28b4e9(0xca)],..._0x47e03d[_0x28b4e9(0xc9)]?{'next':_0x47e03d[_0x28b4e9(0xc9)]}:{}}));}else _0x2b4a5e[_0x28b4e9(0xcb)]&&(_0x5894af[_0x28b4e9(0x14e)]={'segment':_0x2b4a5e[_0x28b4e9(0xcb)]},_0x2b4a5e[_0x28b4e9(0x13d)]!==undefined&&_0x2b4a5e[_0x28b4e9(0xd1)]&&(_0x5894af[_0x28b4e9(0x14e)][_0x28b4e9(0x15d)]={'duration':_0x2b4a5e['conditionTimeoutDuration'],'unit':_0x2b4a5e[_0x28b4e9(0xd1)]}));}}}}const _0x539e1d={'type':_0x28b4e9(0xfb),'name':_0x33dcc3,..._0x2b4a5e[_0x28b4e9(0xc9)]?{'next':_0x2b4a5e[_0x28b4e9(0xc9)]}:{},'with':_0x5894af};return _0x539e1d;}case'Activation':{const _0x2d9bf4={'type':_0x28b4e9(0xdf),'name':_0x33dcc3,..._0x2b4a5e[_0x28b4e9(0xc9)]?{'next':_0x2b4a5e['next']}:{},'with':{'activation':_0x2b4a5e[_0x28b4e9(0x139)]||''}};return _0x2d9bf4;}case'DecisionPoint':{const _0x52fb16={'type':_0x28b4e9(0x116),'name':_0x33dcc3,..._0x2b4a5e[_0x28b4e9(0xc9)]?{'next':_0x2b4a5e['next']}:{},'with':{'branches':(_0x2b4a5e[_0x28b4e9(0x10f)]||[])[_0x28b4e9(0xd0)](_0x34b898=>({'name':_0x34b898[_0x28b4e9(0xf5)],'segment':_0x34b898[_0x28b4e9(0x14c)],'excluded':_0x34b898[_0x28b4e9(0x115)],..._0x34b898['next']?{'next':_0x34b898[_0x28b4e9(0xc9)]}:{}}))}};return _0x52fb16;}case _0x28b4e9(0xb0):case'AbTest':case'Variant':{const _0x4c487b=_0x2b4a5e[_0x28b4e9(0xf7)]||(_0x2b4a5e['branches']||[])[_0x28b4e9(0xd0)](_0x7598bb=>({'name':_0x7598bb[_0x28b4e9(0xf5)],'percentage':0x0,'next':_0x7598bb[_0x28b4e9(0xc9)]})),_0xab4ce2={'type':_0x28b4e9(0xc5),'name':_0x33dcc3,..._0x2b4a5e['next']?{'next':_0x2b4a5e[_0x28b4e9(0xc9)]}:{},'with':{'customized_split':_0x2b4a5e['customizedSplit'],'unique_id':_0x2b4a5e['uniqueId'],'variants':_0x4c487b[_0x28b4e9(0xd0)](_0x193e7e=>({'name':_0x193e7e[_0x28b4e9(0xf5)],'percentage':_0x193e7e[_0x28b4e9(0x121)],..._0x193e7e['next']?{'next':_0x193e7e['next']}:{}}))}};return _0xab4ce2;}case _0x28b4e9(0xce):{const _0x42a762={'type':_0x28b4e9(0xb3),'name':_0x33dcc3,..._0x2b4a5e['next']?{'next':_0x2b4a5e[_0x28b4e9(0xc9)]}:{}};return _0x42a762;}case _0x28b4e9(0xf0):{let _0x52e6b8='',_0x497397='',_0x584ab3;if(_0x2b4a5e[_0x28b4e9(0x10d)]){_0x52e6b8=_0x2b4a5e[_0x28b4e9(0x10d)][_0x28b4e9(0x124)],_0x497397=_0x2b4a5e['target'][_0x28b4e9(0xda)],_0x584ab3=_0x2b4a5e[_0x28b4e9(0x10d)]['journeyBundleId'];if(_0x2b4a5e[_0x28b4e9(0x10d)][_0x28b4e9(0xf1)]){const _0x2d5e06=parseJumpTargetDisplayName(_0x2b4a5e[_0x28b4e9(0x10d)][_0x28b4e9(0xf1)]);_0x2d5e06&&(_0x497397=_0x2d5e06[_0x28b4e9(0x11a)],_0x52e6b8=_0x2d5e06[_0x28b4e9(0xf1)]);}}const _0x4b5c7c={'type':'jump','name':_0x33dcc3,..._0x2b4a5e[_0x28b4e9(0xc9)]?{'next':_0x2b4a5e[_0x28b4e9(0xc9)]}:{},'with':{'target':{'journey':_0x52e6b8,'stage':_0x497397,..._0x584ab3?{'bundle_id':_0x584ab3}:{}}}};return _0x4b5c7c;}case'End':{const _0x2bba24={'type':_0x28b4e9(0xad),'name':_0x33dcc3};return _0x2bba24;}default:{const _0x1dcbc4={'type':_0x28b4e9(0xad),'name':_0x33dcc3};return _0x1dcbc4;}}}export async function journeyDefToRequest(_0x252088,_0x4524b6,_0x4cbd4c){const _0x59d962=a147_0x476d,_0x4407eb=_0x252088[_0x59d962(0x153)]||getActiveStages(_0x252088),_0x21da51=isJourneysArrayMode(_0x252088)||isMultiVersionMode(_0x252088)?getLatestJourneyEntry(_0x252088):undefined,_0x2d1916=_0x21da51?.[_0x59d962(0x13c)]??_0x252088[_0x59d962(0xf5)],_0x5655b7=_0x252088[_0x59d962(0x14b)]||{},_0x212ce4=_0x252088[_0x59d962(0x113)]||{},_0x22b6ac={'type':_0x59d962(0x123),'attributes':{'name':_0x2d1916,'audienceId':_0x4524b6,'journeyStages':await Promise['all'](_0x4407eb['map'](_0xe47ee1=>convertYamlStageToApi(_0xe47ee1,_0x4cbd4c,_0x5655b7,_0x212ce4)))}},_0x1620e0=_0x21da51?.['id']??_0x252088['id'];_0x1620e0&&(_0x22b6ac['id']=_0x1620e0);_0x252088[_0x59d962(0xc2)]&&(_0x22b6ac[_0x59d962(0xf9)]['description']=_0x252088[_0x59d962(0xc2)]);const _0x3e9414=getEffectiveGoal(_0x252088);_0x3e9414&&(_0x22b6ac[_0x59d962(0xf9)][_0x59d962(0xb8)]=await convertYamlCriteriaToApi(_0x3e9414,_0x4cbd4c,_0x5655b7));const _0x56c933=getEffectiveReentry(_0x252088);return _0x56c933&&(_0x22b6ac[_0x59d962(0xf9)][_0x59d962(0x125)]=_0x56c933,_0x22b6ac['attributes'][_0x59d962(0xb4)]=_0x56c933!==_0x59d962(0xe6)),_0x252088[_0x59d962(0xe2)]&&(_0x22b6ac['relationships']={'parentFolder':{'data':{'id':_0x252088['folder_id'],'type':_0x59d962(0x104)}}}),_0x22b6ac;}async function convertYamlStageToApi(_0x532aec,_0x503ac5,_0x2baa18={},_0x4f28ab={}){const _0x34f52e=a147_0x476d,_0x43f11d={'name':_0x532aec['name']};_0x532aec['id']&&(_0x43f11d['id']=_0x532aec['id']);_0x532aec[_0x34f52e(0xc2)]&&(_0x43f11d[_0x34f52e(0xc2)]=_0x532aec[_0x34f52e(0xc2)]);_0x532aec['entry_criteria']&&(_0x43f11d[_0x34f52e(0x12f)]=await convertYamlCriteriaToApi(_0x532aec['entry_criteria'],_0x503ac5,_0x2baa18));_0x532aec['exit_criteria']&&_0x532aec[_0x34f52e(0x161)][_0x34f52e(0x167)]>0x0&&(_0x43f11d[_0x34f52e(0x132)]=await Promise['all'](_0x532aec[_0x34f52e(0x161)]['map'](_0x3a3043=>convertYamlCriteriaToApi(_0x3a3043,_0x503ac5,_0x2baa18))));_0x532aec['milestone']&&(_0x43f11d[_0x34f52e(0xbb)]=await convertYamlCriteriaToApi(_0x532aec[_0x34f52e(0xbb)],_0x503ac5,_0x2baa18));if(_0x532aec['steps']&&_0x532aec[_0x34f52e(0xbe)]['length']>0x0){const _0x8c9298={},_0x4eae9a=_0x532aec[_0x34f52e(0xbe)]['map']((_0x110f32,_0x3d2a53)=>{const _0x1186b9=_0x34f52e,_0x23c7e2=_0x110f32[_0x1186b9(0xeb)]||generateUUID(),_0x1f22a0=_0x110f32[_0x1186b9(0xf5)]||_0x110f32[_0x1186b9(0x12b)]+'_'+_0x3d2a53;return _0x8c9298[_0x1f22a0]=_0x23c7e2,{..._0x110f32,'name':_0x1f22a0};});_0x43f11d[_0x34f52e(0xec)]=_0x8c9298[_0x4eae9a[0x0][_0x34f52e(0xf5)]],_0x43f11d['steps']={};for(let _0x66c8d1=0x0;_0x66c8d1<_0x4eae9a[_0x34f52e(0x167)];_0x66c8d1++){const _0x576c09=_0x4eae9a[_0x66c8d1],_0x13c997=_0x8c9298[_0x576c09[_0x34f52e(0xf5)]],_0x238955=!_0x576c09[_0x34f52e(0xc9)]&&_0x66c8d1<_0x4eae9a[_0x34f52e(0x167)]-0x1&&_0x576c09['type']!==_0x34f52e(0xad)?_0x4eae9a[_0x66c8d1+0x1][_0x34f52e(0xf5)]:_0x576c09[_0x34f52e(0xc9)],_0xda101e=_0x238955!==_0x576c09[_0x34f52e(0xc9)]?{..._0x576c09,'next':_0x238955}:_0x576c09;_0x43f11d[_0x34f52e(0xbe)][_0x13c997]=await convertYamlStepToApi(_0xda101e,_0x503ac5,_0x2baa18,_0x8c9298,_0x4f28ab);}}else _0x532aec[_0x34f52e(0x140)]&&(_0x43f11d[_0x34f52e(0xec)]=_0x532aec[_0x34f52e(0x140)]);return _0x43f11d;}async function convertYamlCriteriaToApi(_0x31d5e1,_0x5b2641,_0x2d4d56={}){const _0x143828=a147_0x476d;let _0x37a1b7=_0x31d5e1['segment'];if(_0x37a1b7&&!/^\d+$/[_0x143828(0x102)](_0x37a1b7)){const _0x1a8517=parseSegmentRef(_0x37a1b7);if(_0x1a8517[_0x143828(0x12b)]===_0x143828(0xe4))_0x5b2641?.[_0x143828(0x155)]&&(_0x37a1b7=await _0x5b2641['resolveSegmentId'](_0x1a8517[_0x143828(0xf5)]));else{if(_0x1a8517[_0x143828(0x12b)]===_0x143828(0x142)&&_0x2d4d56[_0x1a8517[_0x143828(0xf5)]])_0x5b2641?.['resolveEmbeddedSegmentId']&&(_0x37a1b7=await _0x5b2641[_0x143828(0x126)](_0x1a8517[_0x143828(0xf5)],_0x2d4d56[_0x1a8517[_0x143828(0xf5)]]));else _0x5b2641?.[_0x143828(0x155)]&&(_0x37a1b7=await _0x5b2641[_0x143828(0x155)](_0x1a8517[_0x143828(0xf5)]));}}const _0x3ccbcc={'name':_0x31d5e1[_0x143828(0xf5)],'segmentId':_0x37a1b7};_0x31d5e1[_0x143828(0xc2)]&&(_0x3ccbcc['description']=_0x31d5e1[_0x143828(0xc2)]);if(_0x31d5e1['target']){const _0x46813d=_0x31d5e1[_0x143828(0x10d)]['journey'],_0x658415=_0x31d5e1[_0x143828(0x10d)][_0x143828(0x122)];let _0x293fcd=_0x31d5e1['target'][_0x143828(0x123)];_0x5b2641?.[_0x143828(0x12c)]&&!/^\d+$/['test'](_0x293fcd)&&(_0x293fcd=await _0x5b2641[_0x143828(0x12c)](_0x293fcd));let _0x17d94e=_0x31d5e1[_0x143828(0x10d)][_0x143828(0x122)];_0x5b2641?.[_0x143828(0xd5)]&&!/^\d+$/['test'](_0x17d94e)&&(_0x17d94e=await _0x5b2641[_0x143828(0xd5)](_0x293fcd,_0x17d94e));const _0x71cb87=!/^\d+$/[_0x143828(0x102)](_0x46813d)&&!isLocalJourneyRef(_0x46813d)?formatApiJourneyName(_0x46813d,_0x658415):undefined;_0x3ccbcc[_0x143828(0x10d)]={'journeyId':_0x293fcd,'journeyStageId':_0x17d94e,'journeyName':_0x71cb87,'confirmed':!![]},_0x31d5e1[_0x143828(0x10d)][_0x143828(0xfa)]&&(_0x3ccbcc[_0x143828(0x10d)][_0x143828(0xd8)]=_0x31d5e1['target']['bundle_id']);}return _0x3ccbcc;}async function convertYamlStepToApi(_0x59c80f,_0x597f13,_0x1d067f={},_0x21d514={},_0x1f051e={}){const _0x505350=a147_0x476d,_0xdd2c51=async _0xb47ed2=>{const _0x3e4848=a147_0x476d;if(/^\d+$/[_0x3e4848(0x102)](_0xb47ed2))return _0xb47ed2;const _0x1d765d=parseSegmentRef(_0xb47ed2);if(_0x1d765d[_0x3e4848(0x12b)]==='ref'){if(_0x597f13?.[_0x3e4848(0x155)])return await _0x597f13[_0x3e4848(0x155)](_0x1d765d[_0x3e4848(0xf5)]);}else{if(_0x1d765d[_0x3e4848(0x12b)]===_0x3e4848(0x142)&&_0x1d067f[_0x1d765d[_0x3e4848(0xf5)]]){if(_0x597f13?.['resolveEmbeddedSegmentId'])return await _0x597f13[_0x3e4848(0x126)](_0x1d765d[_0x3e4848(0xf5)],_0x1d067f[_0x1d765d[_0x3e4848(0xf5)]]);}else{if(_0x597f13?.[_0x3e4848(0x155)])return await _0x597f13[_0x3e4848(0x155)](_0x1d765d[_0x3e4848(0xf5)]);}}return _0xb47ed2;},_0x54828b=async _0x36bfe4=>{const _0x26b4a7=a147_0x476d;if(/^\d+$/[_0x26b4a7(0x102)](_0x36bfe4))return _0x36bfe4;const _0x52f073=parseSegmentRef(_0x36bfe4);if(_0x52f073[_0x26b4a7(0x12b)]===_0x26b4a7(0xe4)){if(_0x597f13?.[_0x26b4a7(0x144)])return await _0x597f13[_0x26b4a7(0x144)](_0x52f073[_0x26b4a7(0xf5)]);return _0x52f073[_0x26b4a7(0xf5)];}else{if(_0x52f073[_0x26b4a7(0x12b)]===_0x26b4a7(0x142)&&_0x1f051e[_0x52f073[_0x26b4a7(0xf5)]]){if(_0x597f13?.[_0x26b4a7(0x134)])return await _0x597f13[_0x26b4a7(0x134)](_0x52f073[_0x26b4a7(0xf5)],_0x1f051e[_0x52f073[_0x26b4a7(0xf5)]]);if(_0x597f13?.[_0x26b4a7(0x144)])return await _0x597f13[_0x26b4a7(0x144)](_0x52f073[_0x26b4a7(0xf5)]);}else{if(_0x597f13?.['resolveActivationId'])return await _0x597f13[_0x26b4a7(0x144)](_0x52f073[_0x26b4a7(0xf5)]);}}return _0x36bfe4;},_0x1ea156=_0x7a682b=>{const _0x2bf19c=a147_0x476d;if(!_0x7a682b)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x2bf19c(0x102)](_0x7a682b))return _0x7a682b;return _0x21d514[_0x7a682b]||_0x7a682b;};switch(_0x59c80f[_0x505350(0x12b)]){case'wait':{const _0x4d8ed0=_0x59c80f,_0x9fa34e=_0x4d8ed0[_0x505350(0x150)],_0x44e374={'type':_0x505350(0xe5),'name':_0x4d8ed0['name'],'next':_0x1ea156(_0x4d8ed0[_0x505350(0xc9)])};if(_0x9fa34e['duration']!==undefined&&_0x9fa34e[_0x505350(0xca)])_0x44e374[_0x505350(0x149)]=_0x505350(0x118),_0x44e374[_0x505350(0x117)]=_0x9fa34e['duration'],_0x44e374['waitStepUnit']=normalizeWaitUnit(_0x9fa34e[_0x505350(0xca)]);else{if(_0x9fa34e[_0x505350(0xc4)])_0x44e374['waitStepType']=_0x505350(0x15c),_0x44e374[_0x505350(0x157)]=_0x9fa34e[_0x505350(0xc4)];else{if(_0x9fa34e[_0x505350(0xfc)])_0x44e374[_0x505350(0x149)]='DaysOfTheWeek',_0x44e374[_0x505350(0x151)]=_0x9fa34e['days_of_week'];else{if(_0x9fa34e[_0x505350(0x14e)]){_0x44e374[_0x505350(0x149)]=_0x505350(0x154);const _0x39ea4f=await _0xdd2c51(_0x9fa34e['condition'][_0x505350(0xcc)]),_0x43786d=_0x9fa34e[_0x505350(0x14e)][_0x505350(0x15d)]?.[_0x505350(0xc9)]!==undefined;if(_0x43786d){const _0x38b5fa=[];_0x38b5fa[_0x505350(0x162)]({'id':generateUUID(),'segmentId':_0x39ea4f,'timedOutPath':![],'name':_0x505350(0x14d),'next':_0x1ea156(_0x9fa34e['condition']['next']??_0x4d8ed0['next'])});if(_0x9fa34e[_0x505350(0x14e)][_0x505350(0x15d)]){const _0x1042fc=_0x9fa34e['condition'][_0x505350(0x15d)]['duration'],_0x322317=normalizeWaitUnit(_0x9fa34e['condition'][_0x505350(0x15d)]['unit']);_0x38b5fa['push']({'id':generateUUID(),'timedOutPath':!![],'name':_0x505350(0x135)+_0x1042fc+'\x20'+_0x322317,'moveAfter':_0x1042fc,'unit':_0x322317,'next':_0x1ea156(_0x9fa34e['condition'][_0x505350(0x15d)][_0x505350(0xc9)])});}_0x44e374[_0x505350(0x147)]=_0x38b5fa,delete _0x44e374[_0x505350(0xc9)];}else _0x44e374[_0x505350(0xcb)]=_0x39ea4f,_0x9fa34e[_0x505350(0x14e)][_0x505350(0x15d)]&&(_0x44e374[_0x505350(0x13d)]=_0x9fa34e[_0x505350(0x14e)][_0x505350(0x15d)][_0x505350(0x13a)],_0x9fa34e['condition'][_0x505350(0x15d)][_0x505350(0xca)]&&(_0x44e374[_0x505350(0xd1)]=normalizeWaitUnit(_0x9fa34e[_0x505350(0x14e)][_0x505350(0x15d)][_0x505350(0xca)])));}}}}return _0x44e374;}case _0x505350(0xdf):{const _0x55f534=_0x59c80f,_0x81b1ab=_0x55f534[_0x505350(0x150)][_0x505350(0xdf)],_0x1b7fce=await _0x54828b(_0x81b1ab);return{'type':'Activation','name':_0x55f534[_0x505350(0xf5)],'journeyActivationStepId':_0x1b7fce,'next':_0x1ea156(_0x55f534[_0x505350(0xc9)])};}case _0x505350(0x116):{const _0x2e1f07=_0x59c80f,_0x51a84e=_0x2e1f07['with']['branches'];return{'type':'DecisionPoint','name':_0x2e1f07[_0x505350(0xf5)],'branches':await Promise[_0x505350(0x156)](_0x51a84e['map'](async _0x55912f=>{const _0x32d5c9=_0x505350;let _0x50e662='';if(!_0x55912f[_0x32d5c9(0xbd)]){const _0x5c3b79=_0x55912f[_0x32d5c9(0xcc)]||_0x55912f['segment_id']||'';_0x50e662=_0x5c3b79?await _0xdd2c51(_0x5c3b79):'';}return{'id':crypto[_0x32d5c9(0xf4)](),'name':_0x55912f[_0x32d5c9(0xf5)],'description':null,'segmentId':_0x50e662,'excludedPath':_0x55912f['excluded']??![],'next':_0x1ea156(_0x55912f['next'])};})),'next':_0x1ea156(_0x2e1f07[_0x505350(0xc9)])};}case _0x505350(0xc5):{const _0x4c267e=_0x59c80f,_0x24850e=_0x4c267e[_0x505350(0x150)];return{'type':_0x505350(0xb0),'name':_0x4c267e[_0x505350(0xf5)],'customizedSplit':_0x24850e[_0x505350(0xdd)],'uniqueId':_0x24850e[_0x505350(0xe0)],'variants':_0x24850e[_0x505350(0xf7)][_0x505350(0xd0)](_0x196988=>({'id':_0x196988['id']||generateUUID(),'name':_0x196988[_0x505350(0xf5)],'percentage':_0x196988[_0x505350(0x121)],'next':_0x1ea156(_0x196988['next'])})),'next':_0x1ea156(_0x4c267e[_0x505350(0xc9)])};}case'merge':return{'type':'Merge','name':_0x59c80f[_0x505350(0xf5)],'next':_0x1ea156(_0x59c80f[_0x505350(0xc9)])};case _0x505350(0x15b):{const _0x42dcbb=_0x59c80f,_0x402519=_0x42dcbb[_0x505350(0x150)]['target'],_0x3fd176=_0x402519[_0x505350(0x123)],_0x15f297=_0x402519[_0x505350(0x122)];let _0x1a7ff4=_0x402519[_0x505350(0x123)];_0x597f13?.[_0x505350(0x12c)]&&!/^\d+$/[_0x505350(0x102)](_0x1a7ff4)&&(_0x1a7ff4=await _0x597f13[_0x505350(0x12c)](_0x1a7ff4));let _0x4f0321=_0x402519['stage'];_0x597f13?.['resolveStageId']&&!/^\d+$/[_0x505350(0x102)](_0x4f0321)&&(_0x4f0321=await _0x597f13['resolveStageId'](_0x1a7ff4,_0x4f0321));const _0x2aa204=!/^\d+$/[_0x505350(0x102)](_0x3fd176)&&!isLocalJourneyRef(_0x3fd176)?formatApiJourneyName(_0x3fd176,_0x15f297):undefined;return{'type':'Jump','name':_0x42dcbb[_0x505350(0xf5)],'target':{'journeyId':_0x1a7ff4,'journeyStageId':_0x4f0321,'journeyBundleId':_0x402519[_0x505350(0xfa)],'journeyName':_0x2aa204,'confirmed':!![]},'next':_0x1ea156(_0x42dcbb['next'])};}case _0x505350(0xad):return{'type':_0x505350(0x138),'name':_0x59c80f[_0x505350(0xf5)]};default:{const _0xd61911=_0x59c80f;return{'type':_0x505350(0x138),'name':_0xd61911[_0x505350(0xf5)]};}}}export function toYamlString(_0x506bca){const _0x438afe=a147_0x476d,_0x802ea7=stripInternalFields(_0x506bca),_0x425ee5=a147_0x2decaa[_0x438afe(0x166)](_0x802ea7,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x438afe(0xef)}),_0x11dd22=[_0x438afe(0x103),_0x438afe(0x163),_0x438afe(0x131),_0x438afe(0xb5),'journeys:',_0x438afe(0x143),_0x438afe(0x13e)];let _0x4daeec=_0x425ee5;for(const _0x2ed696 of _0x11dd22){_0x4daeec=_0x4daeec['replace'](new RegExp('^('+_0x2ed696+')','m'),(_0xe63503,_0x1a43de,_0x124a97)=>{if(_0x124a97===0x0||_0x4daeec[_0x124a97-0x1]==='\x0a'&&_0x4daeec[_0x124a97-0x2]==='\x0a')return _0x1a43de;return'\x0a'+_0x1a43de;});}return _0x4daeec;}function stripInternalFields(_0x2ff4c5){const _0x35b0d4=a147_0x476d,{id:_0x5de127,folder_id:_0x662ff0,bundle_id:_0x5b8307,bundle_name:_0x3c7da1,version:_0x54c6a4,allow_reentry:_0x189408,..._0xcdefee}=_0x2ff4c5;return _0xcdefee[_0x35b0d4(0x107)]&&(_0xcdefee['journeys']=_0xcdefee[_0x35b0d4(0x107)]['map'](_0x13e5a7=>{const _0x4cb76c=_0x35b0d4,{id:_0x1f65e4,..._0x2fcc8d}=_0x13e5a7;return{..._0x2fcc8d,'stages':_0x2fcc8d[_0x4cb76c(0x153)][_0x4cb76c(0xd0)](stripStageInternalFields),..._0x13e5a7['latest']===!![]?{'latest':!![]}:{},..._0xcdefee[_0x4cb76c(0x107)][_0x4cb76c(0x167)]===0x1&&_0x2fcc8d[_0x4cb76c(0x13c)]==='v1'?{'version':undefined}:{}};})),_0xcdefee['stages']&&(_0xcdefee[_0x35b0d4(0x153)]=_0xcdefee[_0x35b0d4(0x153)][_0x35b0d4(0xd0)](stripStageInternalFields)),_0xcdefee[_0x35b0d4(0x15a)]&&(_0xcdefee[_0x35b0d4(0x15a)]=_0xcdefee[_0x35b0d4(0x15a)]['map'](_0x2d8fd0=>{const _0x2ef14d=_0x35b0d4,{id:_0x2d0e93,..._0x51c564}=_0x2d8fd0;return{..._0x51c564,'stages':_0x51c564[_0x2ef14d(0x153)]['map'](stripStageInternalFields),..._0x2d8fd0['latest']===!![]?{'latest':!![]}:{}};})),_0xcdefee;}function stripStageInternalFields(_0x5a9ef6){const {id:_0x34533c,..._0x480e5f}=_0x5a9ef6;return _0x480e5f;}export function parseYamlString(_0x1b904e){return safeParseYaml(_0x1b904e,JourneyDefSchema);}export function isJourneyDef(_0x4d666d){const _0x194ed2=a147_0x476d;return typeof _0x4d666d===_0x194ed2(0xfe)&&_0x4d666d!==null&&_0x194ed2(0x12b)in _0x4d666d&&_0x4d666d['type']===_0x194ed2(0x123);}export function generateTemplate(_0x58825b,_0x1ca63b){const _0x517aaf=a147_0x476d,_0x45a4f9={'type':'journey','name':_0x58825b,'description':_0x517aaf(0x158),'reentry':'no_reentry','goal':{'name':_0x517aaf(0x165),'segment':_0x517aaf(0x101)},'stages':[{'name':_0x517aaf(0x127),'description':_0x517aaf(0x146),'entry_criteria':{'name':'Entry\x20Criteria','segment':_0x1ca63b},'steps':[{'type':_0x517aaf(0xfb),'name':_0x517aaf(0x164),'with':{'duration':0x1,'unit':_0x517aaf(0xae)}},{'type':_0x517aaf(0xdf),'name':'Send\x20Notification','with':{'activation':_0x517aaf(0xe7)}},{'type':_0x517aaf(0xad),'name':_0x517aaf(0xd3)}]}]};return toYamlString(_0x45a4f9);}function generateUUID(){const _0x369cba=a147_0x476d;return crypto[_0x369cba(0xf4)]();}export const SEGMENT_REF_PREFIX=a147_0x40cd8b(0x10e);export function parseSegmentRef(_0x1cfd99){const _0x594855=a147_0x40cd8b;if(_0x1cfd99['startsWith'](SEGMENT_REF_PREFIX))return{'type':_0x594855(0xe4),'name':_0x1cfd99[_0x594855(0xc1)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/['test'](_0x1cfd99))return{'type':'id','name':_0x1cfd99};return{'type':'embedded','name':_0x1cfd99};}export function makeSegmentRef(_0x2ab007){return''+SEGMENT_REF_PREFIX+_0x2ab007;}export function isExternalSegmentRef(_0x217752){return _0x217752['startsWith'](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x30d434){const _0x2e63f3=a147_0x40cd8b;return!!(_0x30d434['journeys']&&_0x30d434[_0x2e63f3(0x107)][_0x2e63f3(0x167)]>0x0);}export function isMultiVersionMode(_0x33df4a){const _0x55299b=a147_0x40cd8b;return!!(_0x33df4a[_0x55299b(0x15a)]&&_0x33df4a[_0x55299b(0x15a)]['length']>0x0);}export function isSingleVersionMode(_0x37aca5){const _0x12687a=a147_0x40cd8b;return!!(_0x37aca5['stages']&&_0x37aca5[_0x12687a(0x153)][_0x12687a(0x167)]>0x0);}export function hasMultipleVersions(_0x1f1eb2){const _0xe72d02=a147_0x40cd8b;if(isJourneysArrayMode(_0x1f1eb2))return(_0x1f1eb2[_0xe72d02(0x107)]?.[_0xe72d02(0x167)]||0x0)>0x1;if(isMultiVersionMode(_0x1f1eb2))return(_0x1f1eb2[_0xe72d02(0x15a)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0xf4e8f2){const _0x5b8c6c=a147_0x40cd8b;if(isJourneysArrayMode(_0xf4e8f2))return _0xf4e8f2;if(isSingleVersionMode(_0xf4e8f2)){const {stages:_0x1a1030,id:_0x2f4b78,version:_0x467077,version_number:_0x2c27d2,..._0x43c5d7}=_0xf4e8f2;return{..._0x43c5d7,'journeys':[{'version':_0x467077||'v1','stages':_0x1a1030||[],'id':_0x2f4b78,'version_number':_0x2c27d2}]};}if(isMultiVersionMode(_0xf4e8f2)){const {versions:_0x93233e,..._0x47e5a9}=_0xf4e8f2;return{..._0x47e5a9,'journeys':(_0x93233e||[])[_0x5b8c6c(0xd0)](_0x243299=>({'version':_0x243299[_0x5b8c6c(0xf5)],'state':_0x243299[_0x5b8c6c(0x120)],'latest':_0x243299['latest'],'stages':_0x243299[_0x5b8c6c(0x153)],'id':_0x243299['id'],'version_number':_0x243299[_0x5b8c6c(0x15f)]}))};}return _0xf4e8f2;}export function normalizeJourneyDef(_0x5c2ab5,_0x513391){const _0x2cf84b=a147_0x40cd8b,_0x2f36b4=normalizeToJourneysFormat(_0x5c2ab5),_0x13797c=_0x513391?.[_0x2cf84b(0x14b)]?Object[_0x2cf84b(0xc3)](_0x513391[_0x2cf84b(0x14b)]):undefined,_0x24d4a8=_0x513391?.[_0x2cf84b(0x113)]?Object[_0x2cf84b(0xc3)](_0x513391[_0x2cf84b(0x113)]):undefined;return{'type':'journey','name':_0x2f36b4[_0x2cf84b(0xf5)],..._0x2f36b4[_0x2cf84b(0xc2)]!==undefined&&{'description':_0x2f36b4[_0x2cf84b(0xc2)]},..._0x2f36b4[_0x2cf84b(0xb8)]&&{'goal':normalizeJourneyCriteria(_0x2f36b4[_0x2cf84b(0xb8)])},..._0x2f36b4[_0x2cf84b(0xed)]!==undefined&&{'reentry':_0x2f36b4['reentry']},..._0x2f36b4['segments']&&{'segments':normalizeEmbeddedSegments(_0x2f36b4[_0x2cf84b(0x14b)],_0x13797c)},..._0x2f36b4[_0x2cf84b(0x113)]&&{'activations':normalizeEmbeddedActivations(_0x2f36b4['activations'],_0x24d4a8)},..._0x2f36b4[_0x2cf84b(0x107)]&&{'journeys':_0x2f36b4[_0x2cf84b(0x107)][_0x2cf84b(0xd0)](_0x3db34c=>normalizeJourneyEntry(_0x3db34c,_0x2f36b4[_0x2cf84b(0x107)][_0x2cf84b(0x167)]===0x1))}};}function normalizeJourneyEntry(_0x323da5,_0x385648){const _0x4e1eb2=a147_0x40cd8b;return{...!_0x385648&&_0x323da5[_0x4e1eb2(0x13c)]!==undefined&&{'version':_0x323da5['version']},..._0x323da5[_0x4e1eb2(0x120)]!==undefined&&{'state':_0x323da5[_0x4e1eb2(0x120)]},...!_0x385648&&_0x323da5[_0x4e1eb2(0xc6)]!==undefined&&{'latest':_0x323da5['latest']},..._0x323da5[_0x4e1eb2(0x15f)]!==undefined&&{'version_number':_0x323da5[_0x4e1eb2(0x15f)]},..._0x323da5['goal']&&{'goal':normalizeJourneyCriteria(_0x323da5['goal'])},..._0x323da5['reentry']!==undefined&&{'reentry':_0x323da5[_0x4e1eb2(0xed)]},'stages':_0x323da5[_0x4e1eb2(0x153)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x4fc075){const _0x4d83ba=a147_0x40cd8b;return{'name':_0x4fc075['name'],..._0x4fc075[_0x4d83ba(0xc2)]!==undefined&&{'description':_0x4fc075[_0x4d83ba(0xc2)]},..._0x4fc075[_0x4d83ba(0xd7)]&&{'entry_criteria':normalizeJourneyCriteria(_0x4fc075[_0x4d83ba(0xd7)])},..._0x4fc075[_0x4d83ba(0x161)]&&{'exit_criteria':_0x4fc075[_0x4d83ba(0x161)]['map'](normalizeJourneyCriteria)},..._0x4fc075[_0x4d83ba(0xbb)]&&{'milestone':normalizeJourneyCriteria(_0x4fc075['milestone'])},..._0x4fc075[_0x4d83ba(0xbe)]&&{'steps':normalizeStepsWithImplicitNext(_0x4fc075[_0x4d83ba(0xbe)])}};}function normalizeStepsWithImplicitNext(_0x4b82d3){const _0x1ff698=a147_0x40cd8b;return _0x4b82d3[_0x1ff698(0xd0)]((_0x4d7a26,_0x49fe88)=>{const _0x52a503=_0x1ff698,_0x4870ca=_0x49fe88<_0x4b82d3['length']-0x1?_0x4b82d3[_0x49fe88+0x1][_0x52a503(0xf5)]:undefined;return normalizeJourneyStep(_0x4d7a26,_0x4870ca);});}function normalizeJourneyCriteria(_0x1219c0){const _0x85fc35=a147_0x40cd8b;return{'name':_0x1219c0[_0x85fc35(0xf5)],..._0x1219c0['description']!==undefined&&{'description':_0x1219c0['description']},'segment':_0x1219c0['segment'],..._0x1219c0[_0x85fc35(0x10d)]&&{'target':normalizeJumpTarget(_0x1219c0['target'])}};}function normalizeJourneyStep(_0x16c91f,_0x4927f4){const _0x4d88fc=a147_0x40cd8b,_0x2a93e8=_0x16c91f['next']!==undefined&&_0x16c91f[_0x4d88fc(0xc9)]!==_0x4927f4,_0x3c160e={'type':_0x16c91f[_0x4d88fc(0x12b)],'name':_0x16c91f['name'],..._0x2a93e8&&{'next':_0x16c91f[_0x4d88fc(0xc9)]}};if(_0x4d88fc(0x150)in _0x16c91f&&_0x16c91f[_0x4d88fc(0x150)])return{..._0x3c160e,'with':normalizeStepParams(_0x16c91f[_0x4d88fc(0x12b)],_0x16c91f[_0x4d88fc(0x150)])};return _0x3c160e;}function normalizeStepParams(_0x34bf19,_0x3596aa){const _0x2fcb79=a147_0x40cd8b;switch(_0x34bf19){case _0x2fcb79(0xfb):{const _0x376fd0=_0x3596aa;let _0xc189d2;return _0x376fd0[_0x2fcb79(0x14e)]&&(_0xc189d2={'segment':_0x376fd0[_0x2fcb79(0x14e)][_0x2fcb79(0xcc)],..._0x376fd0[_0x2fcb79(0x14e)]['next']!==undefined&&{'next':_0x376fd0[_0x2fcb79(0x14e)][_0x2fcb79(0xc9)]},..._0x376fd0[_0x2fcb79(0x14e)][_0x2fcb79(0x15d)]&&{'timeout':{'duration':_0x376fd0[_0x2fcb79(0x14e)][_0x2fcb79(0x15d)][_0x2fcb79(0x13a)],'unit':_0x376fd0[_0x2fcb79(0x14e)][_0x2fcb79(0x15d)][_0x2fcb79(0xca)],..._0x376fd0[_0x2fcb79(0x14e)][_0x2fcb79(0x15d)][_0x2fcb79(0xc9)]!==undefined&&{'next':_0x376fd0[_0x2fcb79(0x14e)]['timeout'][_0x2fcb79(0xc9)]}}}}),{..._0x376fd0[_0x2fcb79(0x13a)]!==undefined&&{'duration':_0x376fd0['duration']},..._0x376fd0[_0x2fcb79(0xca)]!==undefined&&{'unit':_0x376fd0['unit']},..._0x376fd0['wait_until']!==undefined&&{'wait_until':_0x376fd0['wait_until']},..._0x376fd0[_0x2fcb79(0xfc)]!==undefined&&{'days_of_week':_0x376fd0[_0x2fcb79(0xfc)]},..._0xc189d2&&{'condition':_0xc189d2}};}case _0x2fcb79(0xdf):{const _0x4e9783=_0x3596aa;return{'activation':_0x4e9783[_0x2fcb79(0xdf)]};}case _0x2fcb79(0x116):{const _0x17c8c7=_0x3596aa;return{'branches':_0x17c8c7[_0x2fcb79(0x10f)][_0x2fcb79(0xd0)](normalizeDecisionBranch)};}case _0x2fcb79(0xc5):{const _0x10aa23=_0x3596aa;return{..._0x10aa23[_0x2fcb79(0xdd)]!==undefined&&{'customized_split':_0x10aa23[_0x2fcb79(0xdd)]},..._0x10aa23['unique_id']!==undefined&&{'unique_id':_0x10aa23[_0x2fcb79(0xe0)]},'variants':_0x10aa23[_0x2fcb79(0xf7)][_0x2fcb79(0xd0)](normalizeAbTestVariant)};}case'jump':{const _0x114ba5=_0x3596aa;return{'target':normalizeJumpTarget(_0x114ba5[_0x2fcb79(0x10d)])};}default:return _0x3596aa;}}function normalizeDecisionBranch(_0x5652a4){const _0x3c64fc=a147_0x40cd8b;return{'name':_0x5652a4['name'],..._0x5652a4[_0x3c64fc(0xcc)]!==undefined&&{'segment':_0x5652a4[_0x3c64fc(0xcc)]},..._0x5652a4[_0x3c64fc(0xbd)]!==undefined&&{'excluded':_0x5652a4[_0x3c64fc(0xbd)]},..._0x5652a4[_0x3c64fc(0xc9)]!==undefined&&{'next':_0x5652a4[_0x3c64fc(0xc9)]}};}function normalizeAbTestVariant(_0x297f0c){const _0x34725e=a147_0x40cd8b;return{..._0x297f0c['id']!==undefined&&{'id':_0x297f0c['id']},'name':_0x297f0c[_0x34725e(0xf5)],'percentage':_0x297f0c[_0x34725e(0x121)],..._0x297f0c['next']!==undefined&&{'next':_0x297f0c[_0x34725e(0xc9)]}};}function normalizeJumpTarget(_0x383ea2){const _0x14c287=a147_0x40cd8b;return{'journey':_0x383ea2['journey'],'stage':_0x383ea2['stage'],..._0x383ea2[_0x14c287(0xfa)]!==undefined&&{'bundle_id':_0x383ea2[_0x14c287(0xfa)]}};}function a147_0x476d(_0x36dcfc,_0x1d9724){_0x36dcfc=_0x36dcfc-0xad;const _0x467e31=a147_0x467e();let _0x476da6=_0x467e31[_0x36dcfc];return _0x476da6;}function normalizeEmbeddedSegments(_0x50738b,_0x4c5855){const _0x3da83e=a147_0x40cd8b,_0x5d8c2a={},_0x2ee9e7=Object[_0x3da83e(0xc3)](_0x50738b),_0x2d7e0b=_0x4c5855?[..._0x4c5855[_0x3da83e(0xfd)](_0x925180=>_0x2ee9e7[_0x3da83e(0x110)](_0x925180)),..._0x2ee9e7[_0x3da83e(0xfd)](_0x186d7e=>!_0x4c5855[_0x3da83e(0x110)](_0x186d7e))[_0x3da83e(0xff)]()]:_0x2ee9e7[_0x3da83e(0xff)]();for(const _0x370902 of _0x2d7e0b){const _0x5826c2=_0x50738b[_0x370902];if(_0x5826c2[_0x3da83e(0x159)]){const _0x5a925c=_0x5826c2['rule'];if(_0x5a925c['type']!==_0x3da83e(0x152)&&_0x5a925c[_0x3da83e(0x12b)]!=='Or'){const _0x236af3=_0x5a925c[_0x3da83e(0x12b)]??_0x3da83e(0x14f);throw new SDKError(ErrorCode[_0x3da83e(0xba)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x370902+_0x3da83e(0x109)+('rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27'+_0x236af3+'\x27.\x0a')+_0x3da83e(0xbc)+_0x3da83e(0xcd)+'\x20\x20\x20\x20type:\x20And\x0a'+_0x3da83e(0x160)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x3da83e(0x11f)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x5a925c[_0x3da83e(0x147)]||!Array['isArray'](_0x5a925c[_0x3da83e(0x147)]))throw new SDKError(ErrorCode[_0x3da83e(0xba)],_0x3da83e(0x106)+_0x370902+_0x3da83e(0x109)+_0x3da83e(0xb9)+_0x3da83e(0xbc)+_0x3da83e(0xcd)+('\x20\x20\x20\x20type:\x20'+_0x5a925c[_0x3da83e(0x12b)]+'\x0a')+_0x3da83e(0x160)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x3da83e(0x11f)+_0x3da83e(0x114));}_0x5d8c2a[_0x370902]={..._0x5826c2[_0x3da83e(0xc2)]&&_0x5826c2[_0x3da83e(0xc2)][_0x3da83e(0x112)]()&&{'description':_0x5826c2[_0x3da83e(0xc2)]},..._0x5826c2[_0x3da83e(0x159)]&&{'rule':deepSortObject(_0x5826c2[_0x3da83e(0x159)])}};}return _0x5d8c2a;}function normalizeEmbeddedActivations(_0x18f17f,_0x33c968){const _0x4a6305=a147_0x40cd8b,_0x181d38={},_0x515acb=Object[_0x4a6305(0xc3)](_0x18f17f),_0x3536dc=_0x33c968?[..._0x33c968[_0x4a6305(0xfd)](_0x49db7c=>_0x515acb[_0x4a6305(0x110)](_0x49db7c)),..._0x515acb[_0x4a6305(0xfd)](_0x16e519=>!_0x33c968[_0x4a6305(0x110)](_0x16e519))[_0x4a6305(0xff)]()]:_0x515acb[_0x4a6305(0xff)]();for(const _0x25804c of _0x3536dc){const _0x4d00fb=_0x18f17f[_0x25804c];_0x181d38[_0x25804c]={'name':_0x4d00fb['name'],'connection':_0x4d00fb['connection'],..._0x4d00fb[_0x4a6305(0xc2)]!==undefined&&{'description':_0x4d00fb[_0x4a6305(0xc2)]},..._0x4d00fb[_0x4a6305(0xb2)]!==undefined&&{'all_columns':_0x4d00fb['all_columns']},..._0x4d00fb['columns']!==undefined&&{'columns':_0x4d00fb['columns']},..._0x4d00fb[_0x4a6305(0x11d)]!==undefined&&{'behavior':_0x4d00fb[_0x4a6305(0x11d)]},..._0x4d00fb[_0x4a6305(0xf6)]!==undefined&&{'schedule':_0x4d00fb[_0x4a6305(0xf6)]},..._0x4d00fb[_0x4a6305(0x129)]!==undefined&&{'notification':_0x4d00fb[_0x4a6305(0x129)]},..._0x4d00fb[_0x4a6305(0x169)]!==undefined&&{'connector_config':_0x4d00fb[_0x4a6305(0x169)]},..._0x4d00fb[_0x4a6305(0x133)]!==undefined&&{'activation_template_id':_0x4d00fb[_0x4a6305(0x133)]}};}return _0x181d38;}export function getActiveStages(_0x39db23){const _0x414831=a147_0x40cd8b;if(isJourneysArrayMode(_0x39db23)){const _0x242e08=_0x39db23[_0x414831(0x107)]||[],_0x156813=_0x242e08[_0x414831(0x130)](_0x37cfd1=>_0x37cfd1[_0x414831(0xc6)]===!![])||_0x242e08[0x0];return _0x156813?.['stages']||[];}if(isSingleVersionMode(_0x39db23))return _0x39db23[_0x414831(0x153)]||[];if(isMultiVersionMode(_0x39db23)){const _0x314a4f=_0x39db23[_0x414831(0x15a)]||[],_0x205d4c=_0x314a4f[_0x414831(0x130)](_0x1752e8=>_0x1752e8['latest']===!![])||_0x314a4f[0x0];return _0x205d4c?.[_0x414831(0x153)]||[];}return[];}export function getLatestJourneyEntry(_0x28a8cc){const _0x57b871=a147_0x40cd8b;if(isJourneysArrayMode(_0x28a8cc)){const _0x511e96=_0x28a8cc[_0x57b871(0x107)]||[];return _0x511e96['find'](_0x183804=>_0x183804[_0x57b871(0xc6)]===!![])||_0x511e96[0x0];}if(isMultiVersionMode(_0x28a8cc)){const _0x544f17=_0x28a8cc[_0x57b871(0x15a)]||[],_0x40a3dd=_0x544f17[_0x57b871(0x130)](_0x1d2c7b=>_0x1d2c7b[_0x57b871(0xc6)]===!![])||_0x544f17[0x0];if(_0x40a3dd)return{'version':_0x40a3dd[_0x57b871(0xf5)],'state':_0x40a3dd[_0x57b871(0x120)],'latest':_0x40a3dd[_0x57b871(0xc6)],'stages':_0x40a3dd[_0x57b871(0x153)],'id':_0x40a3dd['id'],'version_number':_0x40a3dd[_0x57b871(0x15f)]};}if(isSingleVersionMode(_0x28a8cc))return{'version':_0x28a8cc[_0x57b871(0x13c)]||'v1','state':_0x57b871(0xf2),'stages':_0x28a8cc['stages']||[],'id':_0x28a8cc['id'],'version_number':_0x28a8cc[_0x57b871(0x15f)],'goal':_0x28a8cc['goal'],'reentry':_0x28a8cc[_0x57b871(0xed)]};return undefined;}export function getLatestVersion(_0x5acf20){const _0x5fcbb9=a147_0x40cd8b;if(!isMultiVersionMode(_0x5acf20))return undefined;const _0x18cdda=_0x5acf20[_0x5fcbb9(0x15a)]||[];return _0x18cdda[_0x5fcbb9(0x130)](_0x59084d=>_0x59084d[_0x5fcbb9(0xc6)]===!![])||_0x18cdda[0x0];}export function getEffectiveGoal(_0x221d2c){const _0x5da992=a147_0x40cd8b,_0x5003e4=getLatestJourneyEntry(_0x221d2c);return _0x5003e4?.[_0x5da992(0xb8)]||_0x221d2c['goal'];}export function getEffectiveReentry(_0x492d32){const _0x248b70=a147_0x40cd8b,_0x1e1424=getLatestJourneyEntry(_0x492d32);return _0x1e1424?.[_0x248b70(0xed)]||_0x492d32[_0x248b70(0xed)];}export function collectSegmentRefs(_0x31d4fe){const _0x5adfba=a147_0x40cd8b,_0x1994d3=new Set();_0x31d4fe[_0x5adfba(0xb8)]?.['segment']&&_0x1994d3['add'](_0x31d4fe[_0x5adfba(0xb8)]['segment']);const _0x5cef18=_0xbf7724=>{const _0x14391b=_0x5adfba;for(const _0x35e49a of _0xbf7724){_0x35e49a['entry_criteria']?.[_0x14391b(0xcc)]&&_0x1994d3[_0x14391b(0x11c)](_0x35e49a[_0x14391b(0xd7)][_0x14391b(0xcc)]);if(_0x35e49a[_0x14391b(0x161)])for(const _0x3e9e8f of _0x35e49a[_0x14391b(0x161)]){_0x3e9e8f[_0x14391b(0xcc)]&&_0x1994d3[_0x14391b(0x11c)](_0x3e9e8f['segment']);}_0x35e49a[_0x14391b(0xbb)]?.['segment']&&_0x1994d3['add'](_0x35e49a[_0x14391b(0xbb)][_0x14391b(0xcc)]);if(_0x35e49a[_0x14391b(0xbe)])for(const _0x92a341 of _0x35e49a[_0x14391b(0xbe)]){if(_0x92a341[_0x14391b(0x12b)]==='decision_point'){const _0x51272e=_0x92a341;for(const _0x27337e of _0x51272e['with'][_0x14391b(0x10f)]){_0x27337e[_0x14391b(0xcc)]&&_0x1994d3['add'](_0x27337e[_0x14391b(0xcc)]);}}else{if(_0x92a341[_0x14391b(0x12b)]===_0x14391b(0xfb)){const _0xcd1159=_0x92a341;_0xcd1159[_0x14391b(0x150)]['condition']?.['segment']&&_0x1994d3[_0x14391b(0x11c)](_0xcd1159['with'][_0x14391b(0x14e)][_0x14391b(0xcc)]);}}}}};_0x31d4fe[_0x5adfba(0x153)]&&_0x5cef18(_0x31d4fe[_0x5adfba(0x153)]);if(_0x31d4fe[_0x5adfba(0x15a)])for(const _0x5a5045 of _0x31d4fe[_0x5adfba(0x15a)]){_0x5cef18(_0x5a5045[_0x5adfba(0x153)]);}return _0x1994d3;}export function validateSegmentRefs(_0x59a811){const _0x5e96e1=a147_0x40cd8b,_0x3f686e=[],_0x21358f=collectSegmentRefs(_0x59a811),_0x365608=new Set(Object[_0x5e96e1(0xc3)](_0x59a811['segments']||{}));for(const _0x57859b of _0x21358f){const _0x734825=parseSegmentRef(_0x57859b);_0x734825[_0x5e96e1(0x12b)]===_0x5e96e1(0x142)&&!_0x365608[_0x5e96e1(0x14a)](_0x734825[_0x5e96e1(0xf5)])&&_0x3f686e[_0x5e96e1(0x162)]('Unknown\x20segment\x20\x22'+_0x734825[_0x5e96e1(0xf5)]+_0x5e96e1(0xcf)+_0x734825[_0x5e96e1(0xf5)]+_0x5e96e1(0x105));}return _0x3f686e;}export function collectSegmentIdsFromJourneyApi(_0x5c194b){const _0xd55215=a147_0x40cd8b,_0x14405b=new Set();_0x5c194b[_0xd55215(0xf9)]['goal']?.[_0xd55215(0x14c)]&&_0x14405b[_0xd55215(0x11c)](_0x5c194b[_0xd55215(0xf9)][_0xd55215(0xb8)][_0xd55215(0x14c)]);const _0x13ca4f=_0x5c194b[_0xd55215(0xf9)][_0xd55215(0x136)];if(Array[_0xd55215(0xd6)](_0x13ca4f))for(const _0x3a2e82 of _0x13ca4f){_0x3a2e82[_0xd55215(0x12f)]?.[_0xd55215(0x14c)]&&_0x14405b[_0xd55215(0x11c)](_0x3a2e82[_0xd55215(0x12f)][_0xd55215(0x14c)]);const _0x3d4626=_0x3a2e82[_0xd55215(0x132)]??_0x3a2e82[_0xd55215(0xd4)];if(Array[_0xd55215(0xd6)](_0x3d4626))for(const _0x405f8c of _0x3d4626){_0x405f8c[_0xd55215(0x14c)]&&_0x14405b['add'](_0x405f8c[_0xd55215(0x14c)]);}_0x3a2e82[_0xd55215(0xbb)]?.[_0xd55215(0x14c)]&&_0x14405b[_0xd55215(0x11c)](_0x3a2e82['milestone'][_0xd55215(0x14c)]);if(_0x3a2e82[_0xd55215(0xbe)]&&typeof _0x3a2e82[_0xd55215(0xbe)]==='object'){const _0x5563cb=Array[_0xd55215(0xd6)](_0x3a2e82[_0xd55215(0xbe)])?_0x3a2e82[_0xd55215(0xbe)]:Object[_0xd55215(0xaf)](_0x3a2e82[_0xd55215(0xbe)]);for(const _0x15152e of _0x5563cb){_0x15152e[_0xd55215(0x11b)]?.[_0xd55215(0x14c)]&&_0x14405b['add'](_0x15152e[_0xd55215(0x11b)][_0xd55215(0x14c)]);const _0x10e2f0=_0x15152e;_0x10e2f0[_0xd55215(0xcb)]&&_0x14405b[_0xd55215(0x11c)](_0x10e2f0[_0xd55215(0xcb)]);if(Array[_0xd55215(0xd6)](_0x10e2f0['conditions']))for(const _0x27b76b of _0x10e2f0[_0xd55215(0x147)]){_0x27b76b['segmentId']&&_0x14405b['add'](_0x27b76b['segmentId']);}if(Array[_0xd55215(0xd6)](_0x15152e[_0xd55215(0x10f)]))for(const _0xae811f of _0x15152e[_0xd55215(0x10f)]){_0xae811f[_0xd55215(0x14c)]&&_0x14405b[_0xd55215(0x11c)](_0xae811f[_0xd55215(0x14c)]);}}}}return _0x14405b;}
|
|
1
|
+
const a147_0x5735bb=a147_0x4df6;(function(_0x5e0de0,_0x4d03e0){const _0x4698dc=a147_0x4df6,_0x3a4997=_0x5e0de0();while(!![]){try{const _0x2a0f6c=parseInt(_0x4698dc(0x295))/0x1*(parseInt(_0x4698dc(0x22e))/0x2)+parseInt(_0x4698dc(0x231))/0x3*(-parseInt(_0x4698dc(0x27c))/0x4)+parseInt(_0x4698dc(0x278))/0x5*(parseInt(_0x4698dc(0x239))/0x6)+-parseInt(_0x4698dc(0x282))/0x7*(-parseInt(_0x4698dc(0x200))/0x8)+-parseInt(_0x4698dc(0x286))/0x9+-parseInt(_0x4698dc(0x220))/0xa*(-parseInt(_0x4698dc(0x242))/0xb)+-parseInt(_0x4698dc(0x285))/0xc*(parseInt(_0x4698dc(0x22d))/0xd);if(_0x2a0f6c===_0x4d03e0)break;else _0x3a4997['push'](_0x3a4997['shift']());}catch(_0x651b3){_0x3a4997['push'](_0x3a4997['shift']());}}}(a147_0x8703,0xba98e));import*as a147_0x26aee1 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x3753a1){const _0x4fbd70=a147_0x4df6,_0xc3138e=_0x3753a1[_0x4fbd70(0x2a4)]();if(_0xc3138e===_0x4fbd70(0x215)||_0xc3138e===_0x4fbd70(0x23d))return'day';if(_0xc3138e==='weeks'||_0xc3138e===_0x4fbd70(0x26c))return _0x4fbd70(0x26c);return _0x3753a1;}export function journeyResponseToDefSync(_0x510bee){const _0x295633=a147_0x4df6,_0x281646=_0x510bee[_0x295633(0x20c)],_0x30d7b7=_0x281646[_0x295633(0x201)]||_0x281646[_0x295633(0x24e)],_0x3e7520={'stages':_0x281646[_0x295633(0x284)]['map'](convertApiStageToYaml),'id':_0x510bee['id']};_0x281646['goal']&&(_0x3e7520[_0x295633(0x2a8)]=convertApiCriteriaToYaml(_0x281646[_0x295633(0x2a8)]));_0x281646[_0x295633(0x24e)]&&_0x281646[_0x295633(0x24e)]!==_0x30d7b7&&(_0x3e7520[_0x295633(0x281)]=_0x281646[_0x295633(0x24e)]);_0x281646[_0x295633(0x26a)]!==undefined&&(_0x3e7520[_0x295633(0x294)]=_0x281646[_0x295633(0x26a)]);_0x281646['state']&&(_0x3e7520['state']=_0x281646[_0x295633(0x203)]===_0x295633(0x28a)?_0x295633(0x28a):_0x295633(0x240));const _0xc0c554={'type':_0x295633(0x20d),'name':_0x30d7b7,'journeys':[_0x3e7520]};_0x281646[_0x295633(0x26e)]&&(_0xc0c554[_0x295633(0x26e)]=_0x281646[_0x295633(0x26e)]);_0x281646['goal']&&(_0xc0c554[_0x295633(0x2a8)]=convertApiCriteriaToYaml(_0x281646['goal']));if(_0x281646[_0x295633(0x290)])_0xc0c554[_0x295633(0x27d)]=_0x281646[_0x295633(0x290)];else _0x281646[_0x295633(0x21d)]!==undefined&&(_0xc0c554[_0x295633(0x27d)]=_0x281646['allowReentry']?'reentry_always':_0x295633(0x1fe));return _0x281646[_0x295633(0x26d)]&&(_0xc0c554[_0x295633(0x254)]=_0x281646[_0x295633(0x26d)]),_0x281646['journeyBundleName']&&(_0xc0c554[_0x295633(0x1f2)]=_0x281646[_0x295633(0x201)]),_0x510bee['relationships']?.[_0x295633(0x225)]?.[_0x295633(0x21f)]?.['id']&&(_0xc0c554[_0x295633(0x25f)]=_0x510bee['relationships'][_0x295633(0x225)][_0x295633(0x21f)]['id']),_0xc0c554;}export async function journeyResponseToDef(_0x1ccf5f,_0x411dee){const _0x3f3981=a147_0x4df6,_0x136299=journeyResponseToDefSync(_0x1ccf5f);if(!_0x411dee)return _0x136299;const _0x2c8954=new Set();collectSegmentIdsFromJourney(_0x136299,_0x2c8954);const _0x78b106=new Set();collectActivationIdsFromJourney(_0x136299,_0x78b106);const _0xccc289={},_0x50db05=new Map();for(const _0x58d8d8 of Array[_0x3f3981(0x227)](_0x2c8954)['sort']()){if(_0x411dee[_0x3f3981(0x261)]){const _0x359406=await _0x411dee[_0x3f3981(0x261)](_0x58d8d8);if(_0x359406[_0x3f3981(0x266)]){_0x50db05[_0x3f3981(0x23c)](_0x58d8d8,_0x359406[_0x3f3981(0x24e)]);if(_0x359406['definition']){const _0x1f57c5={..._0x359406[_0x3f3981(0x226)],'rule':deepSortObject(_0x359406[_0x3f3981(0x226)][_0x3f3981(0x24c)])};_0xccc289[_0x359406[_0x3f3981(0x24e)]]=_0x1f57c5;}}else _0x50db05['set'](_0x58d8d8,makeSegmentRef(_0x359406[_0x3f3981(0x24e)]));}else{if(_0x411dee['resolveSegmentName']){const _0x2cd343=await _0x411dee['resolveSegmentName'](_0x58d8d8);_0x50db05[_0x3f3981(0x23c)](_0x58d8d8,_0x2cd343);}}}const _0x3c579a={},_0x2b4318=new Map();for(const _0x421a25 of Array[_0x3f3981(0x227)](_0x78b106)[_0x3f3981(0x26b)]()){if(_0x411dee[_0x3f3981(0x21b)]){const _0x37c387=await _0x411dee[_0x3f3981(0x21b)](_0x421a25);_0x37c387[_0x3f3981(0x266)]?(_0x2b4318['set'](_0x421a25,_0x37c387[_0x3f3981(0x24e)]),_0x37c387[_0x3f3981(0x226)]&&(_0x3c579a[_0x37c387[_0x3f3981(0x24e)]]=_0x37c387[_0x3f3981(0x226)])):_0x2b4318[_0x3f3981(0x23c)](_0x421a25,makeSegmentRef(_0x37c387[_0x3f3981(0x24e)]));}else{if(_0x411dee[_0x3f3981(0x205)]){const _0x4c9a16=await _0x411dee[_0x3f3981(0x205)](_0x421a25);_0x2b4318[_0x3f3981(0x23c)](_0x421a25,_0x4c9a16);}}}_0x50db05['size']>0x0&&replaceSegmentIdsInJourney(_0x136299,_0x50db05);_0x2b4318[_0x3f3981(0x25e)]>0x0&&replaceActivationIdsInJourney(_0x136299,_0x2b4318);if(_0x411dee['resolveJumpTarget']){const _0x4efe42=[];collectJumpTargetsFromJourney(_0x136299,_0x4efe42);if(_0x4efe42[_0x3f3981(0x234)]>0x0){const _0x296109=new Map();for(const _0x438312 of _0x4efe42){try{const _0x40ddaf=await _0x411dee[_0x3f3981(0x24b)](_0x438312['journeyId'],_0x438312['stageId']);_0x296109[_0x3f3981(0x23c)](_0x438312[_0x3f3981(0x214)]+':'+_0x438312['stageId'],_0x40ddaf);}catch{}}_0x296109[_0x3f3981(0x25e)]>0x0&&replaceJumpTargetsInJourney(_0x136299,_0x296109);}}return Object[_0x3f3981(0x274)](_0xccc289)[_0x3f3981(0x234)]>0x0&&(_0x136299['segments']=_0xccc289),Object[_0x3f3981(0x274)](_0x3c579a)[_0x3f3981(0x234)]>0x0&&(_0x136299[_0x3f3981(0x235)]=_0x3c579a),_0x136299;}function collectSegmentIdsFromJourney(_0x4adacc,_0x1a60a2){const _0x37fc96=a147_0x4df6;_0x4adacc['goal']?.[_0x37fc96(0x283)]&&_0x1a60a2['add'](_0x4adacc[_0x37fc96(0x2a8)][_0x37fc96(0x283)]);const _0x2863e0=_0x2adccb=>{const _0x28493f=_0x37fc96;for(const _0x3584e0 of _0x2adccb){_0x3584e0['entry_criteria']?.[_0x28493f(0x283)]&&_0x1a60a2[_0x28493f(0x22b)](_0x3584e0[_0x28493f(0x1fd)][_0x28493f(0x283)]);if(_0x3584e0[_0x28493f(0x248)])for(const _0x18ed70 of _0x3584e0['exit_criteria']){_0x18ed70[_0x28493f(0x283)]&&_0x1a60a2[_0x28493f(0x22b)](_0x18ed70[_0x28493f(0x283)]);}_0x3584e0[_0x28493f(0x28d)]?.[_0x28493f(0x283)]&&_0x1a60a2[_0x28493f(0x22b)](_0x3584e0['milestone'][_0x28493f(0x283)]);if(_0x3584e0[_0x28493f(0x28f)])for(const _0x5e29cd of _0x3584e0[_0x28493f(0x28f)]){if(_0x5e29cd[_0x28493f(0x259)]==='decision_point'){const _0x1750b1=_0x5e29cd;for(const _0x2a37f5 of _0x1750b1[_0x28493f(0x252)][_0x28493f(0x29c)]){_0x2a37f5[_0x28493f(0x283)]&&_0x1a60a2['add'](_0x2a37f5['segment']);}}else{if(_0x5e29cd['type']===_0x28493f(0x1f3)){const _0x35b527=_0x5e29cd;_0x35b527[_0x28493f(0x252)][_0x28493f(0x25b)]?.[_0x28493f(0x283)]&&_0x1a60a2['add'](_0x35b527['with'][_0x28493f(0x25b)][_0x28493f(0x283)]);}}}}};if(_0x4adacc[_0x37fc96(0x241)])for(const _0x95976a of _0x4adacc[_0x37fc96(0x241)]){_0x95976a['goal']?.['segment']&&_0x1a60a2[_0x37fc96(0x22b)](_0x95976a['goal']['segment']),_0x2863e0(_0x95976a[_0x37fc96(0x279)]);}_0x4adacc[_0x37fc96(0x279)]&&_0x2863e0(_0x4adacc['stages']);if(_0x4adacc[_0x37fc96(0x24d)])for(const _0x284990 of _0x4adacc[_0x37fc96(0x24d)]){_0x2863e0(_0x284990[_0x37fc96(0x279)]);}}function replaceSegmentIdsInJourney(_0x1829c7,_0x1142e6){const _0x45d7dc=a147_0x4df6,_0x26c208=_0x19734a=>_0x1142e6[_0x45d7dc(0x21e)](_0x19734a)||_0x19734a;_0x1829c7['goal']?.[_0x45d7dc(0x283)]&&(_0x1829c7[_0x45d7dc(0x2a8)][_0x45d7dc(0x283)]=_0x26c208(_0x1829c7[_0x45d7dc(0x2a8)][_0x45d7dc(0x283)]));const _0x465afd=_0x5ee491=>{const _0x526ad7=_0x45d7dc;for(const _0x325545 of _0x5ee491){_0x325545[_0x526ad7(0x1fd)]?.[_0x526ad7(0x283)]&&(_0x325545[_0x526ad7(0x1fd)][_0x526ad7(0x283)]=_0x26c208(_0x325545[_0x526ad7(0x1fd)][_0x526ad7(0x283)]));if(_0x325545[_0x526ad7(0x248)])for(const _0x3c65c2 of _0x325545[_0x526ad7(0x248)]){_0x3c65c2[_0x526ad7(0x283)]&&(_0x3c65c2[_0x526ad7(0x283)]=_0x26c208(_0x3c65c2[_0x526ad7(0x283)]));}_0x325545[_0x526ad7(0x28d)]?.[_0x526ad7(0x283)]&&(_0x325545[_0x526ad7(0x28d)][_0x526ad7(0x283)]=_0x26c208(_0x325545[_0x526ad7(0x28d)]['segment']));if(_0x325545['steps'])for(const _0x2c6029 of _0x325545[_0x526ad7(0x28f)]){if(_0x2c6029[_0x526ad7(0x259)]===_0x526ad7(0x2a5)){const _0x157576=_0x2c6029;for(const _0xf7f4ea of _0x157576[_0x526ad7(0x252)][_0x526ad7(0x29c)]){_0xf7f4ea['segment']&&(_0xf7f4ea['segment']=_0x26c208(_0xf7f4ea[_0x526ad7(0x283)]));}}else{if(_0x2c6029[_0x526ad7(0x259)]===_0x526ad7(0x1f3)){const _0x469bd5=_0x2c6029;_0x469bd5[_0x526ad7(0x252)][_0x526ad7(0x25b)]?.[_0x526ad7(0x283)]&&(_0x469bd5[_0x526ad7(0x252)][_0x526ad7(0x25b)][_0x526ad7(0x283)]=_0x26c208(_0x469bd5[_0x526ad7(0x252)][_0x526ad7(0x25b)][_0x526ad7(0x283)]));}}}}};if(_0x1829c7[_0x45d7dc(0x241)])for(const _0x8d72f6 of _0x1829c7['journeys']){_0x8d72f6[_0x45d7dc(0x2a8)]?.[_0x45d7dc(0x283)]&&(_0x8d72f6['goal'][_0x45d7dc(0x283)]=_0x26c208(_0x8d72f6['goal']['segment'])),_0x465afd(_0x8d72f6[_0x45d7dc(0x279)]);}_0x1829c7[_0x45d7dc(0x279)]&&_0x465afd(_0x1829c7['stages']);if(_0x1829c7['versions'])for(const _0x103e2a of _0x1829c7[_0x45d7dc(0x24d)]){_0x465afd(_0x103e2a['stages']);}}function collectActivationIdsFromJourney(_0x487d40,_0x31a447){const _0x26e5f3=a147_0x4df6,_0x2f77ee=_0x55930b=>{const _0x26c6df=a147_0x4df6;for(const _0x2e909b of _0x55930b){if(_0x2e909b[_0x26c6df(0x28f)])for(const _0x18349e of _0x2e909b[_0x26c6df(0x28f)]){if(_0x18349e[_0x26c6df(0x259)]===_0x26c6df(0x27b)){const _0x5bca35=_0x18349e;_0x5bca35[_0x26c6df(0x252)]['activation']&&/^\d+$/['test'](_0x5bca35[_0x26c6df(0x252)][_0x26c6df(0x27b)])&&_0x31a447[_0x26c6df(0x22b)](_0x5bca35[_0x26c6df(0x252)][_0x26c6df(0x27b)]);}}}};if(_0x487d40[_0x26e5f3(0x241)])for(const _0x47e45e of _0x487d40[_0x26e5f3(0x241)]){_0x2f77ee(_0x47e45e[_0x26e5f3(0x279)]);}_0x487d40[_0x26e5f3(0x279)]&&_0x2f77ee(_0x487d40[_0x26e5f3(0x279)]);if(_0x487d40[_0x26e5f3(0x24d)])for(const _0x27697a of _0x487d40[_0x26e5f3(0x24d)]){_0x2f77ee(_0x27697a[_0x26e5f3(0x279)]);}}function replaceActivationIdsInJourney(_0x80f3db,_0xeca1bf){const _0x50a8fc=a147_0x4df6,_0x3d6c53=_0x27bb9b=>_0xeca1bf[_0x50a8fc(0x21e)](_0x27bb9b)||_0x27bb9b,_0x10f2e6=_0x20e094=>{const _0x19486a=_0x50a8fc;for(const _0x46e249 of _0x20e094){if(_0x46e249[_0x19486a(0x28f)])for(const _0x3a6c81 of _0x46e249[_0x19486a(0x28f)]){if(_0x3a6c81['type']===_0x19486a(0x27b)){const _0x1040e5=_0x3a6c81;_0x1040e5[_0x19486a(0x252)][_0x19486a(0x27b)]&&(_0x1040e5[_0x19486a(0x252)][_0x19486a(0x27b)]=_0x3d6c53(_0x1040e5['with'][_0x19486a(0x27b)]));}}}};if(_0x80f3db['journeys'])for(const _0x163ea0 of _0x80f3db[_0x50a8fc(0x241)]){_0x10f2e6(_0x163ea0['stages']);}_0x80f3db[_0x50a8fc(0x279)]&&_0x10f2e6(_0x80f3db['stages']);if(_0x80f3db[_0x50a8fc(0x24d)])for(const _0x8605e6 of _0x80f3db[_0x50a8fc(0x24d)]){_0x10f2e6(_0x8605e6[_0x50a8fc(0x279)]);}}function collectJumpTargetsFromJourney(_0x3997ed,_0x5cb9cd){const _0x54409e=a147_0x4df6,_0x4675da=new Set(),_0x2fd2ea=_0x4685ef=>{const _0x3bb7c=a147_0x4df6;for(const _0x46d635 of _0x4685ef){if(_0x46d635[_0x3bb7c(0x28f)])for(const _0x53beed of _0x46d635['steps']){if(_0x53beed[_0x3bb7c(0x259)]===_0x3bb7c(0x28b)){const _0x1468f3=_0x53beed,_0x3d3996=_0x1468f3[_0x3bb7c(0x252)][_0x3bb7c(0x1f4)];if(_0x3d3996[_0x3bb7c(0x20d)]&&_0x3d3996[_0x3bb7c(0x24a)]&&/^\d+$/[_0x3bb7c(0x202)](_0x3d3996[_0x3bb7c(0x20d)])&&/^\d+$/['test'](_0x3d3996[_0x3bb7c(0x24a)])){const _0x4d842b=_0x3d3996[_0x3bb7c(0x20d)]+':'+_0x3d3996['stage'];!_0x4675da[_0x3bb7c(0x288)](_0x4d842b)&&(_0x4675da[_0x3bb7c(0x22b)](_0x4d842b),_0x5cb9cd[_0x3bb7c(0x221)]({'journeyId':_0x3d3996['journey'],'stageId':_0x3d3996[_0x3bb7c(0x24a)]}));}}}}};if(_0x3997ed[_0x54409e(0x241)])for(const _0x5c12c4 of _0x3997ed[_0x54409e(0x241)]){_0x2fd2ea(_0x5c12c4[_0x54409e(0x279)]);}_0x3997ed[_0x54409e(0x279)]&&_0x2fd2ea(_0x3997ed[_0x54409e(0x279)]);if(_0x3997ed['versions'])for(const _0x48383c of _0x3997ed[_0x54409e(0x24d)]){_0x2fd2ea(_0x48383c[_0x54409e(0x279)]);}}function replaceJumpTargetsInJourney(_0x110db7,_0x3c7ce5){const _0xb6252d=a147_0x4df6,_0x50f266=_0x303aa5=>{const _0x928468=a147_0x4df6;for(const _0x941113 of _0x303aa5){if(_0x941113[_0x928468(0x28f)])for(const _0x564c98 of _0x941113['steps']){if(_0x564c98[_0x928468(0x259)]===_0x928468(0x28b)){const _0x28874c=_0x564c98,_0x5b8ff8=_0x28874c['with'][_0x928468(0x1f4)],_0x3f1624=_0x5b8ff8['journey']+':'+_0x5b8ff8['stage'],_0x2e5968=_0x3c7ce5[_0x928468(0x21e)](_0x3f1624);_0x2e5968&&(_0x5b8ff8[_0x928468(0x20d)]=_0x2e5968['journeyName'],_0x5b8ff8['stage']=_0x2e5968[_0x928468(0x211)]);}}}};if(_0x110db7[_0xb6252d(0x241)])for(const _0xb1bd63 of _0x110db7[_0xb6252d(0x241)]){_0x50f266(_0xb1bd63[_0xb6252d(0x279)]);}_0x110db7[_0xb6252d(0x279)]&&_0x50f266(_0x110db7[_0xb6252d(0x279)]);if(_0x110db7[_0xb6252d(0x24d)])for(const _0x1d31c0 of _0x110db7[_0xb6252d(0x24d)]){_0x50f266(_0x1d31c0['stages']);}}function generateReadableStepName(_0x53a96c,_0x5865cb){const _0x45b511=a147_0x4df6;if(_0x53a96c[_0x45b511(0x24e)]&&_0x53a96c[_0x45b511(0x24e)]!==_0x53a96c['type']){const _0x115fd9=_0x53a96c[_0x45b511(0x24e)][_0x45b511(0x206)]();if(_0x115fd9&&/[a-z0-9\p{L}]/iu[_0x45b511(0x202)](_0x115fd9))return _0x115fd9;}const _0x461994=_0x53a96c[_0x45b511(0x259)][_0x45b511(0x2a4)]()[_0x45b511(0x20e)](/step$/i,'');return _0x461994+'_'+(_0x5865cb+0x1);}function getStepNextRefs(_0x2e244d){const _0x132624=a147_0x4df6,_0x3b02cf=[];if(_0x2e244d[_0x132624(0x29e)])_0x3b02cf[_0x132624(0x221)](_0x2e244d[_0x132624(0x29e)]);if(_0x2e244d['branches'])for(const _0x53eb9 of _0x2e244d['branches']){if(_0x53eb9[_0x132624(0x29e)])_0x3b02cf[_0x132624(0x221)](_0x53eb9['next']);}if(_0x2e244d[_0x132624(0x264)])for(const _0x5f3b3c of _0x2e244d[_0x132624(0x264)]){if(_0x5f3b3c[_0x132624(0x29e)])_0x3b02cf[_0x132624(0x221)](_0x5f3b3c[_0x132624(0x29e)]);}if(_0x2e244d[_0x132624(0x1f1)])for(const _0x296df6 of _0x2e244d[_0x132624(0x1f1)]){if(_0x296df6[_0x132624(0x29e)])_0x3b02cf[_0x132624(0x221)](_0x296df6[_0x132624(0x29e)]);}return _0x3b02cf;}function parseJumpTargetDisplayName(_0x90ae5c){const _0x258cdc=a147_0x4df6,_0x309965=_0x90ae5c[_0x258cdc(0x20a)](/^(.+?)\s*\(([^/)]+)/);if(!_0x309965)return undefined;const _0x3e73e3=_0x309965[0x1][_0x258cdc(0x206)](),_0x4ccc17=_0x309965[0x2][_0x258cdc(0x206)]();if(!_0x3e73e3||!_0x4ccc17)return undefined;return{'stageName':_0x3e73e3,'journeyName':_0x4ccc17};}function orderStepsFromRoot(_0x34b68c,_0x114a59){const _0x66026c=a147_0x4df6,_0x41f5fe=Object[_0x66026c(0x289)](_0x34b68c);if(_0x41f5fe[_0x66026c(0x234)]===0x0)return[];const _0x18bbbd=new Set(_0x41f5fe['map'](([_0x128a72])=>_0x128a72)),_0x1be376=new Set();for(const [,_0x2f2a3b]of _0x41f5fe){for(const _0x454c8e of getStepNextRefs(_0x2f2a3b)){if(_0x18bbbd[_0x66026c(0x288)](_0x454c8e))_0x1be376[_0x66026c(0x22b)](_0x454c8e);}}let _0x393e23=_0x114a59&&_0x18bbbd[_0x66026c(0x288)](_0x114a59)?_0x114a59:undefined;if(!_0x393e23){const _0x44f959=_0x41f5fe[_0x66026c(0x224)](([_0x3c538d])=>!_0x1be376['has'](_0x3c538d));_0x44f959[_0x66026c(0x234)]>0x0?_0x393e23=_0x44f959[0x0][0x0]:_0x393e23=_0x41f5fe[0x0][0x0];}const _0x266aa4=[],_0x2a8ed5=new Set(),_0x2aa309=[_0x393e23];while(_0x2aa309[_0x66026c(0x234)]>0x0){const _0x36d351=_0x2aa309[_0x66026c(0x293)]();if(_0x2a8ed5[_0x66026c(0x288)](_0x36d351))continue;_0x2a8ed5[_0x66026c(0x22b)](_0x36d351);const _0x4e4510=_0x34b68c[_0x36d351];if(!_0x4e4510)continue;_0x266aa4[_0x66026c(0x221)]({'uuid':_0x36d351,'step':_0x4e4510});for(const _0x49245c of getStepNextRefs(_0x4e4510)){_0x18bbbd['has'](_0x49245c)&&!_0x2a8ed5[_0x66026c(0x288)](_0x49245c)&&_0x2aa309['push'](_0x49245c);}}for(const [_0x507604,_0x2e6ab1]of _0x41f5fe){!_0x2a8ed5[_0x66026c(0x288)](_0x507604)&&_0x266aa4[_0x66026c(0x221)]({'uuid':_0x507604,'step':_0x2e6ab1});}return _0x266aa4;}function resolveStepReferences(_0x263e11,_0xbe395f,_0x4891fd,_0x16ef8f){const _0x99ab00=a147_0x4df6;if(_0x263e11[_0x99ab00(0x259)]!==_0x99ab00(0x280)){_0x263e11[_0x99ab00(0x29e)]&&_0x16ef8f[_0x99ab00(0x288)](_0x263e11['next'])&&(_0x263e11['next']=_0x16ef8f[_0x99ab00(0x21e)](_0x263e11[_0x99ab00(0x29e)]));const _0x5c24fe=_0xbe395f+0x1;if(_0x5c24fe<_0x4891fd['length']){const _0x332bef=_0x16ef8f[_0x99ab00(0x21e)](_0x4891fd[_0x5c24fe][_0x99ab00(0x2a1)]);_0x263e11[_0x99ab00(0x29e)]===_0x332bef&&delete _0x263e11[_0x99ab00(0x29e)];}}if(_0x263e11[_0x99ab00(0x259)]===_0x99ab00(0x2a5))for(const _0x415ad0 of _0x263e11['with'][_0x99ab00(0x29c)]){_0x415ad0[_0x99ab00(0x29e)]&&_0x16ef8f[_0x99ab00(0x288)](_0x415ad0['next'])&&(_0x415ad0[_0x99ab00(0x29e)]=_0x16ef8f[_0x99ab00(0x21e)](_0x415ad0[_0x99ab00(0x29e)]));}if(_0x263e11['type']===_0x99ab00(0x1f5))for(const _0x31852b of _0x263e11[_0x99ab00(0x252)][_0x99ab00(0x264)]){_0x31852b[_0x99ab00(0x29e)]&&_0x16ef8f['has'](_0x31852b[_0x99ab00(0x29e)])&&(_0x31852b['next']=_0x16ef8f[_0x99ab00(0x21e)](_0x31852b[_0x99ab00(0x29e)]));}if(_0x263e11['type']==='wait'&&_0x263e11[_0x99ab00(0x252)][_0x99ab00(0x25b)]){const _0x413a1c=_0x263e11[_0x99ab00(0x252)][_0x99ab00(0x25b)];_0x413a1c[_0x99ab00(0x29e)]&&_0x16ef8f['has'](_0x413a1c[_0x99ab00(0x29e)])&&(_0x413a1c[_0x99ab00(0x29e)]=_0x16ef8f[_0x99ab00(0x21e)](_0x413a1c[_0x99ab00(0x29e)])),_0x413a1c['timeout']?.[_0x99ab00(0x29e)]&&_0x16ef8f[_0x99ab00(0x288)](_0x413a1c[_0x99ab00(0x2a0)]['next'])&&(_0x413a1c['timeout'][_0x99ab00(0x29e)]=_0x16ef8f[_0x99ab00(0x21e)](_0x413a1c['timeout']['next']));}}function convertApiStageToYaml(_0x2a00aa){const _0x1088eb=a147_0x4df6,_0x41b84a={'name':_0x2a00aa['name']};_0x2a00aa['id']&&(_0x41b84a['id']=_0x2a00aa['id']);_0x2a00aa[_0x1088eb(0x26e)]&&(_0x41b84a[_0x1088eb(0x26e)]=_0x2a00aa[_0x1088eb(0x26e)]);_0x2a00aa['entryCriteria']&&(_0x41b84a[_0x1088eb(0x1fd)]=convertApiCriteriaToYaml(_0x2a00aa[_0x1088eb(0x230)]));_0x2a00aa['exitCriterias']&&_0x2a00aa[_0x1088eb(0x263)]['length']>0x0&&(_0x41b84a[_0x1088eb(0x248)]=_0x2a00aa[_0x1088eb(0x263)]['map'](convertApiCriteriaToYaml));_0x2a00aa[_0x1088eb(0x28d)]&&(_0x41b84a[_0x1088eb(0x28d)]=convertApiCriteriaToYaml(_0x2a00aa[_0x1088eb(0x28d)]));if(_0x2a00aa['steps']&&Object[_0x1088eb(0x274)](_0x2a00aa[_0x1088eb(0x28f)])['length']>0x0){const _0x39b96e=orderStepsFromRoot(_0x2a00aa[_0x1088eb(0x28f)],_0x2a00aa[_0x1088eb(0x29a)]),_0x8f52b4=new Map(),_0x4174ca=new Set();for(let _0x5ea802=0x0;_0x5ea802<_0x39b96e[_0x1088eb(0x234)];_0x5ea802++){const {uuid:_0x2a49ce,step:_0x1907fd}=_0x39b96e[_0x5ea802];let _0x11c52c=generateReadableStepName(_0x1907fd,_0x5ea802),_0x1a8d35=_0x11c52c,_0x4da9f8=0x2;while(_0x4174ca[_0x1088eb(0x288)](_0x1a8d35)){_0x1a8d35=_0x11c52c+'_'+_0x4da9f8,_0x4da9f8++;}_0x4174ca[_0x1088eb(0x22b)](_0x1a8d35),_0x8f52b4[_0x1088eb(0x23c)](_0x2a49ce,_0x1a8d35);}_0x41b84a[_0x1088eb(0x28f)]=_0x39b96e[_0x1088eb(0x21a)](({uuid:_0x5a4a61,step:_0x8744fd},_0x30a160)=>{const _0x377c2a=_0x1088eb,_0x14d229=convertApiStepToYaml(_0x8744fd,_0x8f52b4[_0x377c2a(0x21e)](_0x5a4a61));return resolveStepReferences(_0x14d229,_0x30a160,_0x39b96e,_0x8f52b4),_0x14d229;});}return _0x41b84a;}function convertApiCriteriaToYaml(_0x5b1587){const _0xc97c50=a147_0x4df6,_0x45db9e={'name':_0x5b1587[_0xc97c50(0x24e)],'segment':_0x5b1587[_0xc97c50(0x271)]};_0x5b1587[_0xc97c50(0x26e)]&&(_0x45db9e[_0xc97c50(0x26e)]=_0x5b1587[_0xc97c50(0x26e)]);if(_0x5b1587[_0xc97c50(0x1f4)]){let _0x8ff09d=_0x5b1587[_0xc97c50(0x1f4)]['journeyId'],_0xdef77c=_0x5b1587[_0xc97c50(0x1f4)][_0xc97c50(0x275)];if(_0x5b1587[_0xc97c50(0x1f4)][_0xc97c50(0x216)]){const _0x28f765=parseJumpTargetDisplayName(_0x5b1587['target'][_0xc97c50(0x216)]);_0x28f765&&(_0xdef77c=_0x28f765[_0xc97c50(0x211)],_0x8ff09d=_0x28f765['journeyName']);}_0x45db9e['target']={'journey':_0x8ff09d,'stage':_0xdef77c},_0x5b1587[_0xc97c50(0x1f4)]['journeyBundleId']&&(_0x45db9e[_0xc97c50(0x1f4)][_0xc97c50(0x254)]=_0x5b1587[_0xc97c50(0x1f4)][_0xc97c50(0x26d)]);}return _0x45db9e;}function convertApiStepToYaml(_0x46c653,_0x4c540c){const _0x345e82=a147_0x4df6;switch(_0x46c653[_0x345e82(0x259)]){case'WaitStep':{const _0x28e1d8={};if(_0x46c653[_0x345e82(0x1f7)]===_0x345e82(0x2ad)&&_0x46c653[_0x345e82(0x298)]!==undefined)_0x28e1d8[_0x345e82(0x27f)]=_0x46c653['waitStep'],_0x28e1d8['unit']=_0x46c653[_0x345e82(0x247)];else{if(_0x46c653[_0x345e82(0x1f7)]===_0x345e82(0x23b)&&_0x46c653['waitUntilDate'])_0x28e1d8[_0x345e82(0x244)]=_0x46c653[_0x345e82(0x2a2)];else{if(_0x46c653['waitStepType']==='DaysOfTheWeek'&&_0x46c653[_0x345e82(0x29d)])_0x28e1d8[_0x345e82(0x268)]=_0x46c653[_0x345e82(0x29d)];else{if(_0x46c653[_0x345e82(0x1f7)]===_0x345e82(0x22c)){if(_0x46c653[_0x345e82(0x1f1)]&&_0x46c653['conditions'][_0x345e82(0x234)]>0x0){const _0x112b1d=_0x46c653[_0x345e82(0x1f1)][_0x345e82(0x238)](_0xfc52c7=>!_0xfc52c7['timedOutPath']),_0x35a739=_0x46c653['conditions'][_0x345e82(0x238)](_0x1cf356=>_0x1cf356[_0x345e82(0x1f9)]);_0x112b1d?.['segmentId']&&(_0x28e1d8['condition']={'segment':_0x112b1d[_0x345e82(0x271)],..._0x112b1d[_0x345e82(0x29e)]?{'next':_0x112b1d['next']}:{}},_0x35a739&&_0x35a739[_0x345e82(0x24f)]!==undefined&&_0x35a739[_0x345e82(0x276)]&&(_0x28e1d8['condition'][_0x345e82(0x2a0)]={'duration':_0x35a739[_0x345e82(0x24f)],'unit':_0x35a739[_0x345e82(0x276)],..._0x35a739[_0x345e82(0x29e)]?{'next':_0x35a739[_0x345e82(0x29e)]}:{}}));}else _0x46c653[_0x345e82(0x292)]&&(_0x28e1d8[_0x345e82(0x25b)]={'segment':_0x46c653[_0x345e82(0x292)]},_0x46c653[_0x345e82(0x22f)]!==undefined&&_0x46c653[_0x345e82(0x232)]&&(_0x28e1d8['condition'][_0x345e82(0x2a0)]={'duration':_0x46c653['conditionTimeoutDuration'],'unit':_0x46c653['conditionTimeoutUnit']}));}}}}const _0x22d3c6={'type':_0x345e82(0x1f3),'name':_0x4c540c,..._0x46c653[_0x345e82(0x29e)]?{'next':_0x46c653[_0x345e82(0x29e)]}:{},'with':_0x28e1d8};return _0x22d3c6;}case _0x345e82(0x267):{const _0x1c41d3={'type':_0x345e82(0x27b),'name':_0x4c540c,..._0x46c653[_0x345e82(0x29e)]?{'next':_0x46c653['next']}:{},'with':{'activation':_0x46c653[_0x345e82(0x217)]||''}};return _0x1c41d3;}case _0x345e82(0x2ab):{const _0x2fba77={'type':'decision_point','name':_0x4c540c,..._0x46c653[_0x345e82(0x29e)]?{'next':_0x46c653['next']}:{},'with':{'branches':(_0x46c653['branches']||[])[_0x345e82(0x21a)](_0x2673da=>({'name':_0x2673da[_0x345e82(0x24e)],'segment':_0x2673da[_0x345e82(0x271)],'excluded':_0x2673da[_0x345e82(0x258)],..._0x2673da['next']?{'next':_0x2673da[_0x345e82(0x29e)]}:{}}))}};return _0x2fba77;}case _0x345e82(0x249):case _0x345e82(0x262):case _0x345e82(0x296):{const _0x224f74=_0x46c653[_0x345e82(0x264)]||(_0x46c653[_0x345e82(0x29c)]||[])[_0x345e82(0x21a)](_0x3ff09d=>({'name':_0x3ff09d['name'],'percentage':0x0,'next':_0x3ff09d[_0x345e82(0x29e)]})),_0x4ea9f3={'type':'ab_test','name':_0x4c540c,..._0x46c653[_0x345e82(0x29e)]?{'next':_0x46c653[_0x345e82(0x29e)]}:{},'with':{'customized_split':_0x46c653[_0x345e82(0x297)],'unique_id':_0x46c653[_0x345e82(0x256)],'variants':_0x224f74[_0x345e82(0x21a)](_0x6347b7=>({'name':_0x6347b7[_0x345e82(0x24e)],'percentage':_0x6347b7[_0x345e82(0x287)],..._0x6347b7[_0x345e82(0x29e)]?{'next':_0x6347b7['next']}:{}}))}};return _0x4ea9f3;}case'Merge':{const _0x26b054={'type':'merge','name':_0x4c540c,..._0x46c653[_0x345e82(0x29e)]?{'next':_0x46c653[_0x345e82(0x29e)]}:{}};return _0x26b054;}case _0x345e82(0x299):{let _0x271015='',_0x2eb8d9='',_0x3ed667;if(_0x46c653[_0x345e82(0x1f4)]){_0x271015=_0x46c653[_0x345e82(0x1f4)][_0x345e82(0x214)],_0x2eb8d9=_0x46c653[_0x345e82(0x1f4)][_0x345e82(0x275)],_0x3ed667=_0x46c653[_0x345e82(0x1f4)]['journeyBundleId'];if(_0x46c653[_0x345e82(0x1f4)][_0x345e82(0x216)]){const _0x331ce4=parseJumpTargetDisplayName(_0x46c653[_0x345e82(0x1f4)]['journeyName']);_0x331ce4&&(_0x2eb8d9=_0x331ce4[_0x345e82(0x211)],_0x271015=_0x331ce4[_0x345e82(0x216)]);}}const _0x1d83e0={'type':_0x345e82(0x28b),'name':_0x4c540c,..._0x46c653[_0x345e82(0x29e)]?{'next':_0x46c653[_0x345e82(0x29e)]}:{},'with':{'target':{'journey':_0x271015,'stage':_0x2eb8d9,..._0x3ed667?{'bundle_id':_0x3ed667}:{}}}};return _0x1d83e0;}case _0x345e82(0x273):{const _0x425d80={'type':_0x345e82(0x280),'name':_0x4c540c};return _0x425d80;}default:{const _0x1257c3={'type':_0x345e82(0x280),'name':_0x4c540c};return _0x1257c3;}}}export async function journeyDefToRequest(_0x4e2fb0,_0x5ce762,_0x4971f3){const _0xee09de=a147_0x4df6,_0x58a8dd=_0x4e2fb0[_0xee09de(0x279)]||getActiveStages(_0x4e2fb0),_0x5e6ebe=isJourneysArrayMode(_0x4e2fb0)||isMultiVersionMode(_0x4e2fb0)?getLatestJourneyEntry(_0x4e2fb0):undefined,_0x16b866=_0x5e6ebe?.['version']??_0x4e2fb0['name'],_0x23728b=_0x4e2fb0[_0xee09de(0x251)]||{},_0x3559d2=_0x4e2fb0['activations']||{},_0x274ee4={'type':_0xee09de(0x20d),'attributes':{'name':_0x16b866,'audienceId':_0x5ce762,'journeyStages':await Promise[_0xee09de(0x2ac)](_0x58a8dd[_0xee09de(0x21a)](_0x4d8340=>convertYamlStageToApi(_0x4d8340,_0x4971f3,_0x23728b,_0x3559d2)))}},_0x9ad037=_0x5e6ebe?.['id']??_0x4e2fb0['id'];_0x9ad037&&(_0x274ee4['id']=_0x9ad037);_0x4e2fb0[_0xee09de(0x26e)]&&(_0x274ee4[_0xee09de(0x20c)]['description']=_0x4e2fb0[_0xee09de(0x26e)]);const _0x442a98=getEffectiveGoal(_0x4e2fb0);_0x442a98&&(_0x274ee4[_0xee09de(0x20c)][_0xee09de(0x2a8)]=await convertYamlCriteriaToApi(_0x442a98,_0x4971f3,_0x23728b));const _0x11a594=getEffectiveReentry(_0x4e2fb0);return _0x11a594&&(_0x274ee4['attributes'][_0xee09de(0x290)]=_0x11a594,_0x274ee4['attributes'][_0xee09de(0x21d)]=_0x11a594!=='no_reentry'),_0x4e2fb0[_0xee09de(0x25f)]&&(_0x274ee4[_0xee09de(0x2aa)]={'parentFolder':{'data':{'id':_0x4e2fb0[_0xee09de(0x25f)],'type':_0xee09de(0x228)}}}),_0x274ee4;}async function convertYamlStageToApi(_0xd7d434,_0x17eaa3,_0x5a5b48={},_0x5d8a87={}){const _0x5b5b59=a147_0x4df6,_0x577f31={'name':_0xd7d434[_0x5b5b59(0x24e)]};_0xd7d434['id']&&(_0x577f31['id']=_0xd7d434['id']);_0xd7d434[_0x5b5b59(0x26e)]&&(_0x577f31['description']=_0xd7d434['description']);_0xd7d434[_0x5b5b59(0x1fd)]&&(_0x577f31['entryCriteria']=await convertYamlCriteriaToApi(_0xd7d434[_0x5b5b59(0x1fd)],_0x17eaa3,_0x5a5b48));_0xd7d434['exit_criteria']&&_0xd7d434[_0x5b5b59(0x248)][_0x5b5b59(0x234)]>0x0&&(_0x577f31[_0x5b5b59(0x263)]=await Promise[_0x5b5b59(0x2ac)](_0xd7d434['exit_criteria'][_0x5b5b59(0x21a)](_0x340a87=>convertYamlCriteriaToApi(_0x340a87,_0x17eaa3,_0x5a5b48))));_0xd7d434[_0x5b5b59(0x28d)]&&(_0x577f31['milestone']=await convertYamlCriteriaToApi(_0xd7d434[_0x5b5b59(0x28d)],_0x17eaa3,_0x5a5b48));if(_0xd7d434[_0x5b5b59(0x28f)]&&_0xd7d434[_0x5b5b59(0x28f)][_0x5b5b59(0x234)]>0x0){const _0x5bec95={},_0x90fe85=_0xd7d434[_0x5b5b59(0x28f)][_0x5b5b59(0x21a)]((_0x25d65a,_0x8d1303)=>{const _0x102fa9=_0x5b5b59,_0x4a2dd1=_0x25d65a[_0x102fa9(0x2a1)]||generateUUID(),_0x3ef9ff=_0x25d65a['name']||_0x25d65a[_0x102fa9(0x259)]+'_'+_0x8d1303;return _0x5bec95[_0x3ef9ff]=_0x4a2dd1,{..._0x25d65a,'name':_0x3ef9ff};});_0x577f31[_0x5b5b59(0x29a)]=_0x5bec95[_0x90fe85[0x0][_0x5b5b59(0x24e)]],_0x577f31[_0x5b5b59(0x28f)]={};for(let _0x465729=0x0;_0x465729<_0x90fe85[_0x5b5b59(0x234)];_0x465729++){const _0x1b7b02=_0x90fe85[_0x465729],_0x4f8c5f=_0x5bec95[_0x1b7b02['name']],_0x172ed6=!_0x1b7b02['next']&&_0x465729<_0x90fe85[_0x5b5b59(0x234)]-0x1&&_0x1b7b02['type']!=='end'?_0x90fe85[_0x465729+0x1][_0x5b5b59(0x24e)]:_0x1b7b02[_0x5b5b59(0x29e)],_0x3aa391=_0x172ed6!==_0x1b7b02[_0x5b5b59(0x29e)]?{..._0x1b7b02,'next':_0x172ed6}:_0x1b7b02;_0x577f31[_0x5b5b59(0x28f)][_0x4f8c5f]=await convertYamlStepToApi(_0x3aa391,_0x17eaa3,_0x5a5b48,_0x5bec95,_0x5d8a87);}}else _0xd7d434['root_step']&&(_0x577f31[_0x5b5b59(0x29a)]=_0xd7d434[_0x5b5b59(0x25d)]);return _0x577f31;}async function convertYamlCriteriaToApi(_0x123cb,_0x4115f8,_0x1fa199={}){const _0xdf1fb3=a147_0x4df6;let _0x2eb55f=_0x123cb[_0xdf1fb3(0x283)];if(_0x2eb55f&&!/^\d+$/['test'](_0x2eb55f)){const _0x2a2731=parseSegmentRef(_0x2eb55f);if(_0x2a2731[_0xdf1fb3(0x259)]==='ref')_0x4115f8?.[_0xdf1fb3(0x260)]&&(_0x2eb55f=await _0x4115f8['resolveSegmentId'](_0x2a2731[_0xdf1fb3(0x24e)]));else{if(_0x2a2731[_0xdf1fb3(0x259)]===_0xdf1fb3(0x2ae)&&_0x1fa199[_0x2a2731['name']])_0x4115f8?.[_0xdf1fb3(0x2a6)]&&(_0x2eb55f=await _0x4115f8[_0xdf1fb3(0x2a6)](_0x2a2731['name'],_0x1fa199[_0x2a2731['name']]));else _0x4115f8?.['resolveSegmentId']&&(_0x2eb55f=await _0x4115f8[_0xdf1fb3(0x260)](_0x2a2731['name']));}}const _0x3ebc91={'name':_0x123cb[_0xdf1fb3(0x24e)],'segmentId':_0x2eb55f};_0x123cb[_0xdf1fb3(0x26e)]&&(_0x3ebc91['description']=_0x123cb[_0xdf1fb3(0x26e)]);if(_0x123cb[_0xdf1fb3(0x1f4)]){const _0x527e7a=_0x123cb['target'][_0xdf1fb3(0x20d)],_0x3957c7=_0x123cb[_0xdf1fb3(0x1f4)]['stage'];let _0x2a9138=_0x123cb['target'][_0xdf1fb3(0x20d)];_0x4115f8?.['resolveJourneyId']&&!/^\d+$/[_0xdf1fb3(0x202)](_0x2a9138)&&(_0x2a9138=await _0x4115f8[_0xdf1fb3(0x245)](_0x2a9138));let _0x5166e5=_0x123cb[_0xdf1fb3(0x1f4)][_0xdf1fb3(0x24a)];_0x4115f8?.[_0xdf1fb3(0x2a7)]&&!/^\d+$/['test'](_0x5166e5)&&(_0x5166e5=await _0x4115f8['resolveStageId'](_0x2a9138,_0x5166e5));const _0xf27a8b=!/^\d+$/[_0xdf1fb3(0x202)](_0x527e7a)&&!isLocalJourneyRef(_0x527e7a)?formatApiJourneyName(_0x527e7a,_0x3957c7):undefined;_0x3ebc91['target']={'journeyId':_0x2a9138,'journeyStageId':_0x5166e5,'journeyName':_0xf27a8b,'confirmed':!![]},_0x123cb[_0xdf1fb3(0x1f4)][_0xdf1fb3(0x254)]&&(_0x3ebc91[_0xdf1fb3(0x1f4)][_0xdf1fb3(0x26d)]=_0x123cb['target'][_0xdf1fb3(0x254)]);}return _0x3ebc91;}async function convertYamlStepToApi(_0x54762f,_0x1d2476,_0x503fec={},_0x4ddea4={},_0x1ce649={}){const _0x58e4bd=a147_0x4df6,_0x11474f=async _0x208d3a=>{const _0x37ed33=a147_0x4df6;if(/^\d+$/[_0x37ed33(0x202)](_0x208d3a))return _0x208d3a;const _0x16c5fd=parseSegmentRef(_0x208d3a);if(_0x16c5fd[_0x37ed33(0x259)]===_0x37ed33(0x237)){if(_0x1d2476?.[_0x37ed33(0x260)])return await _0x1d2476['resolveSegmentId'](_0x16c5fd[_0x37ed33(0x24e)]);}else{if(_0x16c5fd[_0x37ed33(0x259)]==='embedded'&&_0x503fec[_0x16c5fd['name']]){if(_0x1d2476?.[_0x37ed33(0x2a6)])return await _0x1d2476['resolveEmbeddedSegmentId'](_0x16c5fd['name'],_0x503fec[_0x16c5fd['name']]);}else{if(_0x1d2476?.[_0x37ed33(0x260)])return await _0x1d2476[_0x37ed33(0x260)](_0x16c5fd[_0x37ed33(0x24e)]);}}return _0x208d3a;},_0x36a52e=async _0x8025ab=>{const _0x506d0e=a147_0x4df6;if(/^\d+$/[_0x506d0e(0x202)](_0x8025ab))return _0x8025ab;const _0x43af70=parseSegmentRef(_0x8025ab);if(_0x43af70[_0x506d0e(0x259)]==='ref'){if(_0x1d2476?.[_0x506d0e(0x1f8)])return await _0x1d2476[_0x506d0e(0x1f8)](_0x43af70[_0x506d0e(0x24e)]);return _0x43af70[_0x506d0e(0x24e)];}else{if(_0x43af70[_0x506d0e(0x259)]===_0x506d0e(0x2ae)&&_0x1ce649[_0x43af70[_0x506d0e(0x24e)]]){if(_0x1d2476?.['resolveEmbeddedActivationId'])return await _0x1d2476[_0x506d0e(0x257)](_0x43af70[_0x506d0e(0x24e)],_0x1ce649[_0x43af70[_0x506d0e(0x24e)]]);if(_0x1d2476?.[_0x506d0e(0x1f8)])return await _0x1d2476[_0x506d0e(0x1f8)](_0x43af70[_0x506d0e(0x24e)]);}else{if(_0x1d2476?.[_0x506d0e(0x1f8)])return await _0x1d2476['resolveActivationId'](_0x43af70[_0x506d0e(0x24e)]);}}return _0x8025ab;},_0x55f5a5=_0x578ae0=>{const _0xa7a172=a147_0x4df6;if(!_0x578ae0)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0xa7a172(0x202)](_0x578ae0))return _0x578ae0;return _0x4ddea4[_0x578ae0]||_0x578ae0;};switch(_0x54762f[_0x58e4bd(0x259)]){case _0x58e4bd(0x1f3):{const _0x52a892=_0x54762f,_0x51a0eb=_0x52a892[_0x58e4bd(0x252)],_0x463442={'type':_0x58e4bd(0x222),'name':_0x52a892['name'],'next':_0x55f5a5(_0x52a892[_0x58e4bd(0x29e)])};if(_0x51a0eb[_0x58e4bd(0x27f)]!==undefined&&_0x51a0eb[_0x58e4bd(0x276)])_0x463442[_0x58e4bd(0x1f7)]=_0x58e4bd(0x2ad),_0x463442[_0x58e4bd(0x298)]=_0x51a0eb[_0x58e4bd(0x27f)],_0x463442[_0x58e4bd(0x247)]=normalizeWaitUnit(_0x51a0eb[_0x58e4bd(0x276)]);else{if(_0x51a0eb[_0x58e4bd(0x244)])_0x463442[_0x58e4bd(0x1f7)]=_0x58e4bd(0x23b),_0x463442[_0x58e4bd(0x2a2)]=_0x51a0eb[_0x58e4bd(0x244)];else{if(_0x51a0eb[_0x58e4bd(0x268)])_0x463442[_0x58e4bd(0x1f7)]=_0x58e4bd(0x29f),_0x463442[_0x58e4bd(0x29d)]=_0x51a0eb[_0x58e4bd(0x268)];else{if(_0x51a0eb[_0x58e4bd(0x25b)]){_0x463442[_0x58e4bd(0x1f7)]=_0x58e4bd(0x22c);const _0x520658=await _0x11474f(_0x51a0eb[_0x58e4bd(0x25b)][_0x58e4bd(0x283)]),_0x2177d3=_0x51a0eb[_0x58e4bd(0x25b)][_0x58e4bd(0x2a0)]?.[_0x58e4bd(0x29e)]!==undefined;if(_0x2177d3){const _0x263af4=[];_0x263af4[_0x58e4bd(0x221)]({'id':generateUUID(),'segmentId':_0x520658,'timedOutPath':![],'name':_0x58e4bd(0x2b0),'next':_0x55f5a5(_0x51a0eb[_0x58e4bd(0x25b)][_0x58e4bd(0x29e)]??_0x52a892[_0x58e4bd(0x29e)])});if(_0x51a0eb[_0x58e4bd(0x25b)]['timeout']){const _0x118f25=_0x51a0eb[_0x58e4bd(0x25b)]['timeout']['duration'],_0x48b495=normalizeWaitUnit(_0x51a0eb['condition'][_0x58e4bd(0x2a0)][_0x58e4bd(0x276)]);_0x263af4[_0x58e4bd(0x221)]({'id':generateUUID(),'timedOutPath':!![],'name':'*Max\x20wait\x20'+_0x118f25+'\x20'+_0x48b495,'moveAfter':_0x118f25,'unit':_0x48b495,'next':_0x55f5a5(_0x51a0eb[_0x58e4bd(0x25b)][_0x58e4bd(0x2a0)]['next'])});}_0x463442[_0x58e4bd(0x1f1)]=_0x263af4,delete _0x463442['next'];}else _0x463442['conditionSegmentId']=_0x520658,_0x51a0eb[_0x58e4bd(0x25b)][_0x58e4bd(0x2a0)]&&(_0x463442['conditionTimeoutDuration']=_0x51a0eb['condition']['timeout'][_0x58e4bd(0x27f)],_0x51a0eb[_0x58e4bd(0x25b)]['timeout'][_0x58e4bd(0x276)]&&(_0x463442['conditionTimeoutUnit']=normalizeWaitUnit(_0x51a0eb[_0x58e4bd(0x25b)][_0x58e4bd(0x2a0)][_0x58e4bd(0x276)])));}}}}return _0x463442;}case _0x58e4bd(0x27b):{const _0x305ee3=_0x54762f,_0x21e3ee=_0x305ee3[_0x58e4bd(0x252)][_0x58e4bd(0x27b)],_0xe1282e=await _0x36a52e(_0x21e3ee);return{'type':'Activation','name':_0x305ee3[_0x58e4bd(0x24e)],'journeyActivationStepId':_0xe1282e,'next':_0x55f5a5(_0x305ee3[_0x58e4bd(0x29e)])};}case _0x58e4bd(0x2a5):{const _0xc4400b=_0x54762f,_0x1d7dfc=_0xc4400b[_0x58e4bd(0x252)][_0x58e4bd(0x29c)];return{'type':_0x58e4bd(0x2ab),'name':_0xc4400b[_0x58e4bd(0x24e)],'branches':await Promise[_0x58e4bd(0x2ac)](_0x1d7dfc[_0x58e4bd(0x21a)](async _0xc3d5f4=>{const _0xb11fe6=_0x58e4bd;let _0x5d7eef='';if(!_0xc3d5f4['excluded']){const _0x1634e7=_0xc3d5f4[_0xb11fe6(0x283)]||_0xc3d5f4[_0xb11fe6(0x265)]||'';_0x5d7eef=_0x1634e7?await _0x11474f(_0x1634e7):'';}return{'id':crypto['randomUUID'](),'name':_0xc3d5f4['name'],'description':null,'segmentId':_0x5d7eef,'excludedPath':_0xc3d5f4[_0xb11fe6(0x236)]??![],'next':_0x55f5a5(_0xc3d5f4[_0xb11fe6(0x29e)])};})),'next':_0x55f5a5(_0xc4400b[_0x58e4bd(0x29e)])};}case _0x58e4bd(0x1f5):{const _0x324302=_0x54762f,_0x19a04c=_0x324302[_0x58e4bd(0x252)];return{'type':'ABTest','name':_0x324302[_0x58e4bd(0x24e)],'customizedSplit':_0x19a04c[_0x58e4bd(0x2a3)],'uniqueId':_0x19a04c[_0x58e4bd(0x28e)],'variants':_0x19a04c[_0x58e4bd(0x264)][_0x58e4bd(0x21a)](_0x3a724c=>({'id':_0x3a724c['id']||generateUUID(),'name':_0x3a724c[_0x58e4bd(0x24e)],'percentage':_0x3a724c[_0x58e4bd(0x287)],'next':_0x55f5a5(_0x3a724c['next'])})),'next':_0x55f5a5(_0x324302[_0x58e4bd(0x29e)])};}case _0x58e4bd(0x272):return{'type':_0x58e4bd(0x25c),'name':_0x54762f[_0x58e4bd(0x24e)],'next':_0x55f5a5(_0x54762f[_0x58e4bd(0x29e)])};case _0x58e4bd(0x28b):{const _0x525eb0=_0x54762f,_0x585a6a=_0x525eb0[_0x58e4bd(0x252)][_0x58e4bd(0x1f4)],_0x47b746=_0x585a6a[_0x58e4bd(0x20d)],_0x327f9c=_0x585a6a[_0x58e4bd(0x24a)];let _0x4b970a=_0x585a6a['journey'];_0x1d2476?.[_0x58e4bd(0x245)]&&!/^\d+$/['test'](_0x4b970a)&&(_0x4b970a=await _0x1d2476[_0x58e4bd(0x245)](_0x4b970a));let _0x313868=_0x585a6a[_0x58e4bd(0x24a)];_0x1d2476?.['resolveStageId']&&!/^\d+$/[_0x58e4bd(0x202)](_0x313868)&&(_0x313868=await _0x1d2476[_0x58e4bd(0x2a7)](_0x4b970a,_0x313868));const _0x2119ca=!/^\d+$/[_0x58e4bd(0x202)](_0x47b746)&&!isLocalJourneyRef(_0x47b746)?formatApiJourneyName(_0x47b746,_0x327f9c):undefined;return{'type':_0x58e4bd(0x299),'name':_0x525eb0['name'],'target':{'journeyId':_0x4b970a,'journeyStageId':_0x313868,'journeyBundleId':_0x585a6a[_0x58e4bd(0x254)],'journeyName':_0x2119ca,'confirmed':!![]},'next':_0x55f5a5(_0x525eb0['next'])};}case _0x58e4bd(0x280):return{'type':_0x58e4bd(0x273),'name':_0x54762f[_0x58e4bd(0x24e)]};default:{const _0x1765ae=_0x54762f;return{'type':'End','name':_0x1765ae[_0x58e4bd(0x24e)]};}}}export function toYamlString(_0x38a557){const _0x3ba773=a147_0x4df6,_0x224364=stripInternalFields(_0x38a557),_0x313be9=a147_0x26aee1[_0x3ba773(0x1fb)](_0x224364,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3ba773(0x27e)}),_0x486b12=[_0x3ba773(0x204),_0x3ba773(0x219),_0x3ba773(0x213),_0x3ba773(0x20b),'journeys:','stages:','versions:'];let _0x5e80bd=_0x313be9;for(const _0x31c781 of _0x486b12){_0x5e80bd=_0x5e80bd[_0x3ba773(0x20e)](new RegExp('^('+_0x31c781+')','m'),(_0x41d16e,_0x575349,_0x50c0d3)=>{if(_0x50c0d3===0x0||_0x5e80bd[_0x50c0d3-0x1]==='\x0a'&&_0x5e80bd[_0x50c0d3-0x2]==='\x0a')return _0x575349;return'\x0a'+_0x575349;});}return _0x5e80bd;}function stripInternalFields(_0x5250e3){const _0x2ca2cf=a147_0x4df6,{id:_0x178f69,folder_id:_0x591c89,bundle_id:_0x12dfdf,bundle_name:_0x3d5cdf,version:_0x13905a,allow_reentry:_0x13fb76,..._0x2e3425}=_0x5250e3;return _0x2e3425['journeys']&&(_0x2e3425[_0x2ca2cf(0x241)]=_0x2e3425[_0x2ca2cf(0x241)][_0x2ca2cf(0x21a)](_0x132bae=>{const _0x5b8f14=_0x2ca2cf,{id:_0x46abbd,..._0x5e6702}=_0x132bae;return{..._0x5e6702,'stages':_0x5e6702[_0x5b8f14(0x279)][_0x5b8f14(0x21a)](stripStageInternalFields),..._0x132bae[_0x5b8f14(0x23f)]===!![]?{'latest':!![]}:{},..._0x2e3425[_0x5b8f14(0x241)][_0x5b8f14(0x234)]===0x1&&_0x5e6702[_0x5b8f14(0x281)]==='v1'?{'version':undefined}:{}};})),_0x2e3425['stages']&&(_0x2e3425[_0x2ca2cf(0x279)]=_0x2e3425['stages']['map'](stripStageInternalFields)),_0x2e3425[_0x2ca2cf(0x24d)]&&(_0x2e3425[_0x2ca2cf(0x24d)]=_0x2e3425[_0x2ca2cf(0x24d)][_0x2ca2cf(0x21a)](_0x1d290f=>{const _0x5947f7=_0x2ca2cf,{id:_0x18e0f6,..._0x2ee273}=_0x1d290f;return{..._0x2ee273,'stages':_0x2ee273['stages'][_0x5947f7(0x21a)](stripStageInternalFields),..._0x1d290f[_0x5947f7(0x23f)]===!![]?{'latest':!![]}:{}};})),_0x2e3425;}function stripStageInternalFields(_0xc3c56f){const {id:_0x506e13,..._0x57c245}=_0xc3c56f;return _0x57c245;}export function parseYamlString(_0x3ebaeb){return safeParseYaml(_0x3ebaeb,JourneyDefSchema);}export function isJourneyDef(_0x2e707e){const _0xa1b586=a147_0x4df6;return typeof _0x2e707e===_0xa1b586(0x1f6)&&_0x2e707e!==null&&_0xa1b586(0x259)in _0x2e707e&&_0x2e707e['type']==='journey';}export function generateTemplate(_0x475d36,_0x5c074f){const _0x2358bf=a147_0x4df6,_0x4bb90c={'type':_0x2358bf(0x20d),'name':_0x475d36,'description':_0x2358bf(0x2af),'reentry':_0x2358bf(0x1fe),'goal':{'name':'Goal\x20Achieved','segment':_0x2358bf(0x212)},'stages':[{'name':_0x2358bf(0x1fa),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':_0x2358bf(0x250),'segment':_0x5c074f},'steps':[{'type':_0x2358bf(0x1f3),'name':'Wait\x201\x20Day','with':{'duration':0x1,'unit':'day'}},{'type':'activation','name':_0x2358bf(0x218),'with':{'activation':_0x2358bf(0x277)}},{'type':'end','name':_0x2358bf(0x1fc)}]}]};return toYamlString(_0x4bb90c);}function generateUUID(){const _0xd91fea=a147_0x4df6;return crypto[_0xd91fea(0x253)]();}function a147_0x8703(){const _0x1668f8=['journeyBundleName','test','state','segments:','resolveActivationName','trim','includes','\x20\x20\x20\x20conditions:\x0a','activation_template_id','match','reentry:','attributes','journey','replace','\x20\x20rule:\x0a','connection','stageName','goal-segment','goal:','journeyId','days','journeyName','journeyActivationStepId','Send\x20Notification','activations:','map','resolveActivation','\x20\x20\x20\x20type:\x20','allowReentry','get','data','2060GHxbzG','push','WaitStep','(missing)','filter','parentFolder','definition','from','folder','Unknown\x20segment\x20\x22','ref:','add','Condition','13iCRViE','2GMqCLP','conditionTimeoutDuration','entryCriteria','351uvmgWR','conditionTimeoutUnit','\x27:\x20','length','activations','excluded','ref','find','310470BqTeRn','\x20\x20\x20\x20type:\x20And\x0a','Date','set','day','waitCondition','latest','draft','journeys','12034cVRBCW','JOURNEY_SYNTAX_ERROR','wait_until','resolveJourneyId','And','waitStepUnit','exit_criteria','ABTest','stage','resolveJumpTarget','rule','versions','name','moveAfter','Entry\x20Criteria','segments','with','randomUUID','bundle_id','all_columns','uniqueId','resolveEmbeddedActivationId','excludedPath','type','isArray','condition','Merge','root_step','size','folder_id','resolveSegmentId','resolveSegment','AbTest','exitCriterias','variants','segment_id','isJourneyLocal','Activation','days_of_week','startsWith','versionNumber','sort','week','journeyBundleId','description','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','\x27.\x0a','segmentId','merge','End','keys','journeyStageId','unit','your-activation-name','15eVklWO','stages','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','activation','16260JobtRY','reentry','null','duration','end','version','1119797VFYLFE','segment','journeyStages','12560976QRVJpV','31158zXSkll','percentage','has','entries','launched','jump','values','milestone','unique_id','steps','reentryMode','Expected\x20format:\x0a','conditionSegmentId','shift','version_number','1429605grUKqs','Variant','customizedSplit','waitStep','Jump','rootStep','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','branches','daysOfWeek','next','DaysOfTheWeek','timeout','uuid','waitUntilDate','customized_split','toLowerCase','decision_point','resolveEmbeddedSegmentId','resolveStageId','goal','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','relationships','DecisionPoint','all','Duration','embedded','Journey\x20description','Met\x20condition(s)','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','conditions','bundle_name','wait','target','ab_test','object','waitStepType','resolveActivationId','timedOutPath','Stage\x201','stringify','Stage\x20Complete','entry_criteria','no_reentry','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','24TEkMpV'];a147_0x8703=function(){return _0x1668f8;};return a147_0x8703();}export const SEGMENT_REF_PREFIX=a147_0x5735bb(0x22a);function a147_0x4df6(_0x2aa260,_0x2eade5){_0x2aa260=_0x2aa260-0x1f1;const _0x8703d0=a147_0x8703();let _0x4df698=_0x8703d0[_0x2aa260];return _0x4df698;}export function parseSegmentRef(_0x24a182){const _0x5e7b2d=a147_0x5735bb;if(_0x24a182[_0x5e7b2d(0x269)](SEGMENT_REF_PREFIX))return{'type':_0x5e7b2d(0x237),'name':_0x24a182['slice'](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x5e7b2d(0x202)](_0x24a182))return{'type':'id','name':_0x24a182};return{'type':_0x5e7b2d(0x2ae),'name':_0x24a182};}export function makeSegmentRef(_0x51896f){return''+SEGMENT_REF_PREFIX+_0x51896f;}export function isExternalSegmentRef(_0x64053a){const _0x2d9e6f=a147_0x5735bb;return _0x64053a[_0x2d9e6f(0x269)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x14e207){const _0x310c67=a147_0x5735bb;return!!(_0x14e207[_0x310c67(0x241)]&&_0x14e207[_0x310c67(0x241)]['length']>0x0);}export function isMultiVersionMode(_0xcf15fa){const _0x2693f9=a147_0x5735bb;return!!(_0xcf15fa[_0x2693f9(0x24d)]&&_0xcf15fa[_0x2693f9(0x24d)][_0x2693f9(0x234)]>0x0);}export function isSingleVersionMode(_0x1d09f1){const _0x42230f=a147_0x5735bb;return!!(_0x1d09f1[_0x42230f(0x279)]&&_0x1d09f1['stages'][_0x42230f(0x234)]>0x0);}export function hasMultipleVersions(_0x3b0b30){const _0x59ff48=a147_0x5735bb;if(isJourneysArrayMode(_0x3b0b30))return(_0x3b0b30[_0x59ff48(0x241)]?.[_0x59ff48(0x234)]||0x0)>0x1;if(isMultiVersionMode(_0x3b0b30))return(_0x3b0b30[_0x59ff48(0x24d)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x23f21e){const _0x80fff4=a147_0x5735bb;if(isJourneysArrayMode(_0x23f21e))return _0x23f21e;if(isSingleVersionMode(_0x23f21e)){const {stages:_0x1eea96,id:_0x20693e,version:_0x3ee182,version_number:_0x56677d,..._0xf30de2}=_0x23f21e;return{..._0xf30de2,'journeys':[{'version':_0x3ee182||'v1','stages':_0x1eea96||[],'id':_0x20693e,'version_number':_0x56677d}]};}if(isMultiVersionMode(_0x23f21e)){const {versions:_0x486f48,..._0xcdc282}=_0x23f21e;return{..._0xcdc282,'journeys':(_0x486f48||[])[_0x80fff4(0x21a)](_0x53460b=>({'version':_0x53460b[_0x80fff4(0x24e)],'state':_0x53460b[_0x80fff4(0x203)],'latest':_0x53460b[_0x80fff4(0x23f)],'stages':_0x53460b[_0x80fff4(0x279)],'id':_0x53460b['id'],'version_number':_0x53460b[_0x80fff4(0x294)]}))};}return _0x23f21e;}export function normalizeJourneyDef(_0x5b2563,_0x21edce){const _0x1a5c25=a147_0x5735bb,_0x34f2d4=normalizeToJourneysFormat(_0x5b2563),_0x265858=_0x21edce?.[_0x1a5c25(0x251)]?Object['keys'](_0x21edce[_0x1a5c25(0x251)]):undefined,_0x123b79=_0x21edce?.[_0x1a5c25(0x235)]?Object[_0x1a5c25(0x274)](_0x21edce['activations']):undefined;return{'type':_0x1a5c25(0x20d),'name':_0x34f2d4['name'],..._0x34f2d4[_0x1a5c25(0x26e)]!==undefined&&{'description':_0x34f2d4[_0x1a5c25(0x26e)]},..._0x34f2d4[_0x1a5c25(0x2a8)]&&{'goal':normalizeJourneyCriteria(_0x34f2d4[_0x1a5c25(0x2a8)])},..._0x34f2d4[_0x1a5c25(0x27d)]!==undefined&&{'reentry':_0x34f2d4[_0x1a5c25(0x27d)]},..._0x34f2d4['segments']&&{'segments':normalizeEmbeddedSegments(_0x34f2d4['segments'],_0x265858)},..._0x34f2d4[_0x1a5c25(0x235)]&&{'activations':normalizeEmbeddedActivations(_0x34f2d4[_0x1a5c25(0x235)],_0x123b79)},..._0x34f2d4[_0x1a5c25(0x241)]&&{'journeys':_0x34f2d4[_0x1a5c25(0x241)][_0x1a5c25(0x21a)](_0x4f51f6=>normalizeJourneyEntry(_0x4f51f6,_0x34f2d4[_0x1a5c25(0x241)][_0x1a5c25(0x234)]===0x1))}};}function normalizeJourneyEntry(_0xf09d84,_0x14bfc8){const _0x50dd0b=a147_0x5735bb;return{...!_0x14bfc8&&_0xf09d84[_0x50dd0b(0x281)]!==undefined&&{'version':_0xf09d84[_0x50dd0b(0x281)]},..._0xf09d84[_0x50dd0b(0x203)]!==undefined&&{'state':_0xf09d84[_0x50dd0b(0x203)]},...!_0x14bfc8&&_0xf09d84['latest']!==undefined&&{'latest':_0xf09d84[_0x50dd0b(0x23f)]},..._0xf09d84[_0x50dd0b(0x294)]!==undefined&&{'version_number':_0xf09d84['version_number']},..._0xf09d84[_0x50dd0b(0x2a8)]&&{'goal':normalizeJourneyCriteria(_0xf09d84[_0x50dd0b(0x2a8)])},..._0xf09d84[_0x50dd0b(0x27d)]!==undefined&&{'reentry':_0xf09d84[_0x50dd0b(0x27d)]},'stages':_0xf09d84[_0x50dd0b(0x279)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x5acd7d){const _0x1505f5=a147_0x5735bb;return{'name':_0x5acd7d['name'],..._0x5acd7d['description']!==undefined&&{'description':_0x5acd7d[_0x1505f5(0x26e)]},..._0x5acd7d['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0x5acd7d[_0x1505f5(0x1fd)])},..._0x5acd7d[_0x1505f5(0x248)]&&{'exit_criteria':_0x5acd7d['exit_criteria'][_0x1505f5(0x21a)](normalizeJourneyCriteria)},..._0x5acd7d[_0x1505f5(0x28d)]&&{'milestone':normalizeJourneyCriteria(_0x5acd7d['milestone'])},..._0x5acd7d[_0x1505f5(0x28f)]&&{'steps':normalizeStepsWithImplicitNext(_0x5acd7d[_0x1505f5(0x28f)])}};}function normalizeStepsWithImplicitNext(_0x5eb6d9){const _0x2b6d61=a147_0x5735bb;return _0x5eb6d9[_0x2b6d61(0x21a)]((_0x518352,_0x39aaa1)=>{const _0x166211=_0x2b6d61,_0x56ef39=_0x39aaa1<_0x5eb6d9[_0x166211(0x234)]-0x1?_0x5eb6d9[_0x39aaa1+0x1][_0x166211(0x24e)]:undefined;return normalizeJourneyStep(_0x518352,_0x56ef39);});}function normalizeJourneyCriteria(_0x8b953d){const _0x4dd794=a147_0x5735bb;return{'name':_0x8b953d[_0x4dd794(0x24e)],..._0x8b953d[_0x4dd794(0x26e)]!==undefined&&{'description':_0x8b953d[_0x4dd794(0x26e)]},'segment':_0x8b953d[_0x4dd794(0x283)],..._0x8b953d['target']&&{'target':normalizeJumpTarget(_0x8b953d['target'])}};}function normalizeJourneyStep(_0x34e547,_0x54a94f){const _0x342413=a147_0x5735bb,_0x199b27=_0x34e547[_0x342413(0x29e)]!==undefined&&_0x34e547['next']!==_0x54a94f,_0x1fc594={'type':_0x34e547['type'],'name':_0x34e547['name'],..._0x199b27&&{'next':_0x34e547[_0x342413(0x29e)]}};if(_0x342413(0x252)in _0x34e547&&_0x34e547[_0x342413(0x252)])return{..._0x1fc594,'with':normalizeStepParams(_0x34e547[_0x342413(0x259)],_0x34e547['with'])};return _0x1fc594;}function normalizeStepParams(_0x567a3c,_0x4a6920){const _0x21a8b2=a147_0x5735bb;switch(_0x567a3c){case _0x21a8b2(0x1f3):{const _0x27ec04=_0x4a6920;let _0x4b0021;return _0x27ec04[_0x21a8b2(0x25b)]&&(_0x4b0021={'segment':_0x27ec04[_0x21a8b2(0x25b)]['segment'],..._0x27ec04['condition'][_0x21a8b2(0x29e)]!==undefined&&{'next':_0x27ec04[_0x21a8b2(0x25b)][_0x21a8b2(0x29e)]},..._0x27ec04[_0x21a8b2(0x25b)]['timeout']&&{'timeout':{'duration':_0x27ec04[_0x21a8b2(0x25b)][_0x21a8b2(0x2a0)][_0x21a8b2(0x27f)],'unit':_0x27ec04[_0x21a8b2(0x25b)][_0x21a8b2(0x2a0)]['unit'],..._0x27ec04[_0x21a8b2(0x25b)][_0x21a8b2(0x2a0)][_0x21a8b2(0x29e)]!==undefined&&{'next':_0x27ec04[_0x21a8b2(0x25b)]['timeout']['next']}}}}),{..._0x27ec04[_0x21a8b2(0x27f)]!==undefined&&{'duration':_0x27ec04['duration']},..._0x27ec04['unit']!==undefined&&{'unit':_0x27ec04[_0x21a8b2(0x276)]},..._0x27ec04[_0x21a8b2(0x244)]!==undefined&&{'wait_until':_0x27ec04[_0x21a8b2(0x244)]},..._0x27ec04['days_of_week']!==undefined&&{'days_of_week':_0x27ec04[_0x21a8b2(0x268)]},..._0x4b0021&&{'condition':_0x4b0021}};}case _0x21a8b2(0x27b):{const _0x56f23d=_0x4a6920;return{'activation':_0x56f23d[_0x21a8b2(0x27b)]};}case'decision_point':{const _0x42eacb=_0x4a6920;return{'branches':_0x42eacb[_0x21a8b2(0x29c)][_0x21a8b2(0x21a)](normalizeDecisionBranch)};}case _0x21a8b2(0x1f5):{const _0x1aad2b=_0x4a6920;return{..._0x1aad2b[_0x21a8b2(0x2a3)]!==undefined&&{'customized_split':_0x1aad2b[_0x21a8b2(0x2a3)]},..._0x1aad2b[_0x21a8b2(0x28e)]!==undefined&&{'unique_id':_0x1aad2b[_0x21a8b2(0x28e)]},'variants':_0x1aad2b['variants'][_0x21a8b2(0x21a)](normalizeAbTestVariant)};}case _0x21a8b2(0x28b):{const _0x338e06=_0x4a6920;return{'target':normalizeJumpTarget(_0x338e06['target'])};}default:return _0x4a6920;}}function normalizeDecisionBranch(_0x3dc7f9){const _0x4cc0d3=a147_0x5735bb;return{'name':_0x3dc7f9[_0x4cc0d3(0x24e)],..._0x3dc7f9[_0x4cc0d3(0x283)]!==undefined&&{'segment':_0x3dc7f9['segment']},..._0x3dc7f9[_0x4cc0d3(0x236)]!==undefined&&{'excluded':_0x3dc7f9[_0x4cc0d3(0x236)]},..._0x3dc7f9[_0x4cc0d3(0x29e)]!==undefined&&{'next':_0x3dc7f9[_0x4cc0d3(0x29e)]}};}function normalizeAbTestVariant(_0x39316f){const _0xc61ffd=a147_0x5735bb;return{..._0x39316f['id']!==undefined&&{'id':_0x39316f['id']},'name':_0x39316f[_0xc61ffd(0x24e)],'percentage':_0x39316f['percentage'],..._0x39316f[_0xc61ffd(0x29e)]!==undefined&&{'next':_0x39316f[_0xc61ffd(0x29e)]}};}function normalizeJumpTarget(_0x38f4ba){const _0x211e0e=a147_0x5735bb;return{'journey':_0x38f4ba[_0x211e0e(0x20d)],'stage':_0x38f4ba['stage'],..._0x38f4ba[_0x211e0e(0x254)]!==undefined&&{'bundle_id':_0x38f4ba[_0x211e0e(0x254)]}};}function normalizeEmbeddedSegments(_0x234507,_0x3541b4){const _0x489a60=a147_0x5735bb,_0xdf18b4={},_0x5e1eea=Object['keys'](_0x234507),_0x34cdc6=_0x3541b4?[..._0x3541b4['filter'](_0x3ccb79=>_0x5e1eea[_0x489a60(0x207)](_0x3ccb79)),..._0x5e1eea['filter'](_0x47ed04=>!_0x3541b4[_0x489a60(0x207)](_0x47ed04))[_0x489a60(0x26b)]()]:_0x5e1eea['sort']();for(const _0x36399a of _0x34cdc6){const _0x38bffd=_0x234507[_0x36399a];if(_0x38bffd[_0x489a60(0x24c)]){const _0x411c25=_0x38bffd['rule'];if(_0x411c25[_0x489a60(0x259)]!==_0x489a60(0x246)&&_0x411c25[_0x489a60(0x259)]!=='Or'){const _0x5bbfbf=_0x411c25['type']??_0x489a60(0x223);throw new SDKError(ErrorCode[_0x489a60(0x243)],_0x489a60(0x2a9)+_0x36399a+_0x489a60(0x233)+(_0x489a60(0x27a)+_0x5bbfbf+_0x489a60(0x270))+_0x489a60(0x291)+_0x489a60(0x20f)+_0x489a60(0x23a)+_0x489a60(0x208)+_0x489a60(0x1ff)+_0x489a60(0x2b1)+_0x489a60(0x29b));}if(!_0x411c25[_0x489a60(0x1f1)]||!Array['isArray'](_0x411c25[_0x489a60(0x1f1)]))throw new SDKError(ErrorCode[_0x489a60(0x243)],_0x489a60(0x2a9)+_0x36399a+_0x489a60(0x233)+_0x489a60(0x26f)+_0x489a60(0x291)+_0x489a60(0x20f)+(_0x489a60(0x21c)+_0x411c25[_0x489a60(0x259)]+'\x0a')+'\x20\x20\x20\x20conditions:\x0a'+_0x489a60(0x1ff)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x489a60(0x29b));}_0xdf18b4[_0x36399a]={..._0x38bffd[_0x489a60(0x26e)]&&_0x38bffd['description'][_0x489a60(0x206)]()&&{'description':_0x38bffd[_0x489a60(0x26e)]},..._0x38bffd['rule']&&{'rule':deepSortObject(_0x38bffd[_0x489a60(0x24c)])}};}return _0xdf18b4;}function normalizeEmbeddedActivations(_0x462dd7,_0x138f63){const _0x52cf44=a147_0x5735bb,_0x4898ca={},_0x3f1c6d=Object[_0x52cf44(0x274)](_0x462dd7),_0x5e767c=_0x138f63?[..._0x138f63['filter'](_0x250650=>_0x3f1c6d['includes'](_0x250650)),..._0x3f1c6d[_0x52cf44(0x224)](_0x408572=>!_0x138f63[_0x52cf44(0x207)](_0x408572))[_0x52cf44(0x26b)]()]:_0x3f1c6d[_0x52cf44(0x26b)]();for(const _0x3ecbd6 of _0x5e767c){const _0x1053b5=_0x462dd7[_0x3ecbd6];_0x4898ca[_0x3ecbd6]={'name':_0x1053b5['name'],'connection':_0x1053b5[_0x52cf44(0x210)],..._0x1053b5[_0x52cf44(0x26e)]!==undefined&&{'description':_0x1053b5[_0x52cf44(0x26e)]},..._0x1053b5[_0x52cf44(0x255)]!==undefined&&{'all_columns':_0x1053b5[_0x52cf44(0x255)]},..._0x1053b5['columns']!==undefined&&{'columns':_0x1053b5['columns']},..._0x1053b5['behavior']!==undefined&&{'behavior':_0x1053b5['behavior']},..._0x1053b5['schedule']!==undefined&&{'schedule':_0x1053b5['schedule']},..._0x1053b5['notification']!==undefined&&{'notification':_0x1053b5['notification']},..._0x1053b5['connector_config']!==undefined&&{'connector_config':_0x1053b5['connector_config']},..._0x1053b5['activation_template_id']!==undefined&&{'activation_template_id':_0x1053b5[_0x52cf44(0x209)]}};}return _0x4898ca;}export function getActiveStages(_0x2b209e){const _0x47082b=a147_0x5735bb;if(isJourneysArrayMode(_0x2b209e)){const _0x356035=_0x2b209e[_0x47082b(0x241)]||[],_0x5a176e=_0x356035[_0x47082b(0x238)](_0x43e46c=>_0x43e46c['latest']===!![])||_0x356035[0x0];return _0x5a176e?.['stages']||[];}if(isSingleVersionMode(_0x2b209e))return _0x2b209e[_0x47082b(0x279)]||[];if(isMultiVersionMode(_0x2b209e)){const _0x26d3af=_0x2b209e[_0x47082b(0x24d)]||[],_0x58e81e=_0x26d3af[_0x47082b(0x238)](_0x456b78=>_0x456b78[_0x47082b(0x23f)]===!![])||_0x26d3af[0x0];return _0x58e81e?.[_0x47082b(0x279)]||[];}return[];}export function getLatestJourneyEntry(_0x222697){const _0x39d92d=a147_0x5735bb;if(isJourneysArrayMode(_0x222697)){const _0x41b7fb=_0x222697[_0x39d92d(0x241)]||[];return _0x41b7fb[_0x39d92d(0x238)](_0x473023=>_0x473023[_0x39d92d(0x23f)]===!![])||_0x41b7fb[0x0];}if(isMultiVersionMode(_0x222697)){const _0x218900=_0x222697[_0x39d92d(0x24d)]||[],_0x503d34=_0x218900[_0x39d92d(0x238)](_0x5cceb9=>_0x5cceb9[_0x39d92d(0x23f)]===!![])||_0x218900[0x0];if(_0x503d34)return{'version':_0x503d34[_0x39d92d(0x24e)],'state':_0x503d34[_0x39d92d(0x203)],'latest':_0x503d34[_0x39d92d(0x23f)],'stages':_0x503d34['stages'],'id':_0x503d34['id'],'version_number':_0x503d34[_0x39d92d(0x294)]};}if(isSingleVersionMode(_0x222697))return{'version':_0x222697[_0x39d92d(0x281)]||'v1','state':_0x39d92d(0x240),'stages':_0x222697[_0x39d92d(0x279)]||[],'id':_0x222697['id'],'version_number':_0x222697['version_number'],'goal':_0x222697[_0x39d92d(0x2a8)],'reentry':_0x222697[_0x39d92d(0x27d)]};return undefined;}export function getLatestVersion(_0x3cfa51){const _0x1e4da3=a147_0x5735bb;if(!isMultiVersionMode(_0x3cfa51))return undefined;const _0x53f4d3=_0x3cfa51['versions']||[];return _0x53f4d3[_0x1e4da3(0x238)](_0x7426d6=>_0x7426d6[_0x1e4da3(0x23f)]===!![])||_0x53f4d3[0x0];}export function getEffectiveGoal(_0x3232f3){const _0x3b21b8=a147_0x5735bb,_0x2e80e9=getLatestJourneyEntry(_0x3232f3);return _0x2e80e9?.['goal']||_0x3232f3[_0x3b21b8(0x2a8)];}export function getEffectiveReentry(_0x2bfb12){const _0x4bef0c=a147_0x5735bb,_0x53efc6=getLatestJourneyEntry(_0x2bfb12);return _0x53efc6?.[_0x4bef0c(0x27d)]||_0x2bfb12['reentry'];}export function collectSegmentRefs(_0x4cb6ca){const _0x41ff41=a147_0x5735bb,_0x11b35b=new Set();_0x4cb6ca['goal']?.[_0x41ff41(0x283)]&&_0x11b35b['add'](_0x4cb6ca['goal']['segment']);const _0x277891=_0x3f94ef=>{const _0x1f91f9=_0x41ff41;for(const _0x9c4ec4 of _0x3f94ef){_0x9c4ec4[_0x1f91f9(0x1fd)]?.[_0x1f91f9(0x283)]&&_0x11b35b[_0x1f91f9(0x22b)](_0x9c4ec4[_0x1f91f9(0x1fd)]['segment']);if(_0x9c4ec4['exit_criteria'])for(const _0x14defe of _0x9c4ec4[_0x1f91f9(0x248)]){_0x14defe[_0x1f91f9(0x283)]&&_0x11b35b[_0x1f91f9(0x22b)](_0x14defe[_0x1f91f9(0x283)]);}_0x9c4ec4[_0x1f91f9(0x28d)]?.[_0x1f91f9(0x283)]&&_0x11b35b[_0x1f91f9(0x22b)](_0x9c4ec4[_0x1f91f9(0x28d)][_0x1f91f9(0x283)]);if(_0x9c4ec4[_0x1f91f9(0x28f)])for(const _0x162f71 of _0x9c4ec4['steps']){if(_0x162f71[_0x1f91f9(0x259)]===_0x1f91f9(0x2a5)){const _0x404213=_0x162f71;for(const _0x56bf9b of _0x404213[_0x1f91f9(0x252)]['branches']){_0x56bf9b['segment']&&_0x11b35b[_0x1f91f9(0x22b)](_0x56bf9b[_0x1f91f9(0x283)]);}}else{if(_0x162f71[_0x1f91f9(0x259)]===_0x1f91f9(0x1f3)){const _0x2cea5e=_0x162f71;_0x2cea5e[_0x1f91f9(0x252)][_0x1f91f9(0x25b)]?.[_0x1f91f9(0x283)]&&_0x11b35b['add'](_0x2cea5e[_0x1f91f9(0x252)][_0x1f91f9(0x25b)][_0x1f91f9(0x283)]);}}}}};_0x4cb6ca['stages']&&_0x277891(_0x4cb6ca['stages']);if(_0x4cb6ca[_0x41ff41(0x24d)])for(const _0x12b3fb of _0x4cb6ca[_0x41ff41(0x24d)]){_0x277891(_0x12b3fb[_0x41ff41(0x279)]);}return _0x11b35b;}export function validateSegmentRefs(_0x2020d3){const _0x590615=a147_0x5735bb,_0x422388=[],_0x4d1fb1=collectSegmentRefs(_0x2020d3),_0x103035=new Set(Object[_0x590615(0x274)](_0x2020d3[_0x590615(0x251)]||{}));for(const _0x457a76 of _0x4d1fb1){const _0x54501c=parseSegmentRef(_0x457a76);_0x54501c[_0x590615(0x259)]==='embedded'&&!_0x103035[_0x590615(0x288)](_0x54501c['name'])&&_0x422388[_0x590615(0x221)](_0x590615(0x229)+_0x54501c[_0x590615(0x24e)]+'\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:'+_0x54501c[_0x590615(0x24e)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x422388;}export function collectSegmentIdsFromJourneyApi(_0x323a30){const _0x5ec796=a147_0x5735bb,_0x44f890=new Set();_0x323a30[_0x5ec796(0x20c)][_0x5ec796(0x2a8)]?.['segmentId']&&_0x44f890[_0x5ec796(0x22b)](_0x323a30[_0x5ec796(0x20c)][_0x5ec796(0x2a8)][_0x5ec796(0x271)]);const _0x162c6c=_0x323a30[_0x5ec796(0x20c)]['journeyStages'];if(Array[_0x5ec796(0x25a)](_0x162c6c))for(const _0x96aab3 of _0x162c6c){_0x96aab3[_0x5ec796(0x230)]?.[_0x5ec796(0x271)]&&_0x44f890[_0x5ec796(0x22b)](_0x96aab3[_0x5ec796(0x230)][_0x5ec796(0x271)]);const _0x4ec4ff=_0x96aab3['exitCriterias']??_0x96aab3['exitCriteria'];if(Array[_0x5ec796(0x25a)](_0x4ec4ff))for(const _0x332953 of _0x4ec4ff){_0x332953[_0x5ec796(0x271)]&&_0x44f890[_0x5ec796(0x22b)](_0x332953[_0x5ec796(0x271)]);}_0x96aab3['milestone']?.[_0x5ec796(0x271)]&&_0x44f890[_0x5ec796(0x22b)](_0x96aab3[_0x5ec796(0x28d)][_0x5ec796(0x271)]);if(_0x96aab3[_0x5ec796(0x28f)]&&typeof _0x96aab3[_0x5ec796(0x28f)]===_0x5ec796(0x1f6)){const _0x194b82=Array[_0x5ec796(0x25a)](_0x96aab3[_0x5ec796(0x28f)])?_0x96aab3['steps']:Object[_0x5ec796(0x28c)](_0x96aab3[_0x5ec796(0x28f)]);for(const _0x66850e of _0x194b82){_0x66850e[_0x5ec796(0x23e)]?.['segmentId']&&_0x44f890[_0x5ec796(0x22b)](_0x66850e[_0x5ec796(0x23e)]['segmentId']);const _0x484ac6=_0x66850e;_0x484ac6[_0x5ec796(0x292)]&&_0x44f890[_0x5ec796(0x22b)](_0x484ac6[_0x5ec796(0x292)]);if(Array[_0x5ec796(0x25a)](_0x484ac6[_0x5ec796(0x1f1)]))for(const _0x5b8087 of _0x484ac6[_0x5ec796(0x1f1)]){_0x5b8087[_0x5ec796(0x271)]&&_0x44f890['add'](_0x5b8087[_0x5ec796(0x271)]);}if(Array[_0x5ec796(0x25a)](_0x66850e['branches']))for(const _0x213e04 of _0x66850e[_0x5ec796(0x29c)]){_0x213e04[_0x5ec796(0x271)]&&_0x44f890[_0x5ec796(0x22b)](_0x213e04[_0x5ec796(0x271)]);}}}}return _0x44f890;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a148_0x2504(){const _0x2c6cd5=['\x20LIMIT\x20','LEFT\x20JOIN\x20','length','\x0aLIMIT\x20','source','88734NxCDTV','\x0aWHERE\x20a.','label','SELECT\x20','(all\x20columns)','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x20a\x0a\x20\x20ON\x20m.','27cjlurY','child_key','table','\x0a\x20\x20ON\x20m.','push','\x20IS\x20NOT\x20NULL\x0a','\x0aFROM\x20','database','b.*','29467vPVrUg','\x20b\x0a\x20\x20ON\x20m.','trim','parent_key','213720vIAFcf','SELECT\x20*\x20FROM\x20','replace','\x20AS\x20','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','forEach','master','40hwlExQ','6MKtwac','\x0aSELECT\x20m.','-1d','name','columns','393944oNGHOi','join','\x20=\x20','2046772IqfsZl','\x20m\x0aJOIN\x20','\x0aSELECT\x20','639920TtGyTC','\x20FROM\x20','\x27)\x0aLIMIT\x20','\x20=\x20a.','m.*','\x20m\x0a','toLowerCase','attributes','column','\x20LIMIT\x200','map','\x0aLIMIT\x200\x0a','find','\x20=\x20b.','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','276984rihkSU'];a148_0x2504=function(){return _0x2c6cd5;};return a148_0x2504();}const a148_0xa45dd6=a148_0xb5f2;(function(_0x22ec32,_0x1de74c){const _0x408ff0=a148_0xb5f2,_0x5dd85c=_0x22ec32();while(!![]){try{const _0x5f511c=-parseInt(_0x408ff0(0x1f0))/0x1+-parseInt(_0x408ff0(0x1fd))/0x2*(-parseInt(_0x408ff0(0x1da))/0x3)+parseInt(_0x408ff0(0x202))/0x4+-parseInt(_0x408ff0(0x1fc))/0x5*(-parseInt(_0x408ff0(0x1e0))/0x6)+-parseInt(_0x408ff0(0x205))/0x7+-parseInt(_0x408ff0(0x1f4))/0x8*(parseInt(_0x408ff0(0x1e7))/0x9)+parseInt(_0x408ff0(0x208))/0xa;if(_0x5f511c===_0x1de74c)break;else _0x5dd85c['push'](_0x5dd85c['shift']());}catch(_0x4d6a74){_0x5dd85c['push'](_0x5dd85c['shift']());}}}(a148_0x2504,0x26076));export const DEFAULT_TIME_RANGE=a148_0xa45dd6(0x1ff);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x57ab0a,_0x33078b,_0x4286b1){const _0x20e3cd=a148_0xa45dd6,_0x4fc650=_0x4286b1&&_0x4286b1[_0x20e3cd(0x1dd)]>0x0?_0x4286b1[_0x20e3cd(0x203)](',\x20'):'*';return _0x20e3cd(0x1e3)+_0x4fc650+_0x20e3cd(0x209)+_0x57ab0a+'.'+_0x33078b+_0x20e3cd(0x211);}export function generateMasterCountSQL(_0x1782c3){const _0x53d964=a148_0xa45dd6,{database:_0x2d6c51,table:_0x218af5}=_0x1782c3['master'];return _0x53d964(0x1f8)+_0x2d6c51+'.'+_0x218af5;}export function generateMasterSampleSQL(_0x1b89b9,_0x133cb2=0x5){const _0x36e540=a148_0xa45dd6,{database:_0x5a0dca,table:_0x5f2ad6}=_0x1b89b9[_0x36e540(0x1fb)];return'SELECT\x20*\x20FROM\x20'+_0x5a0dca+'.'+_0x5f2ad6+_0x36e540(0x1db)+_0x133cb2;}export function generateAttributeCoverageSQL(_0x4f5dd5,_0x2e3f69){const _0x5018f7=a148_0xa45dd6,_0x25203f=_0x4f5dd5[_0x5018f7(0x1fb)];return(_0x5018f7(0x1e5)+_0x25203f[_0x5018f7(0x1ee)]+'.'+_0x25203f['table']+'\x20m\x0aLEFT\x20JOIN\x20'+_0x2e3f69[_0x5018f7(0x1df)]['database']+'.'+_0x2e3f69['source']['table']+_0x5018f7(0x1e6)+_0x2e3f69['join'][_0x5018f7(0x1f3)]+_0x5018f7(0x20b)+_0x2e3f69[_0x5018f7(0x203)][_0x5018f7(0x1e8)]+_0x5018f7(0x1e1)+_0x2e3f69[_0x5018f7(0x203)][_0x5018f7(0x1e8)]+_0x5018f7(0x1ec))[_0x5018f7(0x1f2)]();}export function generateBehaviorStatsSQL(_0x56757a,_0xf45412,_0x4563dc=DEFAULT_TIME_RANGE){const _0x435ae5=a148_0xa45dd6,_0x2c0c87=_0x56757a[_0x435ae5(0x1fb)];return(_0x435ae5(0x1f9)+_0xf45412['join'][_0x435ae5(0x1f3)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x2c0c87[_0x435ae5(0x1ee)]+'.'+_0x2c0c87['table']+_0x435ae5(0x206)+_0xf45412[_0x435ae5(0x1df)]['database']+'.'+_0xf45412[_0x435ae5(0x1df)][_0x435ae5(0x1e9)]+_0x435ae5(0x1f1)+_0xf45412[_0x435ae5(0x203)][_0x435ae5(0x1f3)]+_0x435ae5(0x1d8)+_0xf45412[_0x435ae5(0x203)]['child_key']+_0x435ae5(0x1d9)+_0x4563dc+'\x27)\x0a')[_0x435ae5(0x1f2)]();}export function generateAttributeSampleSQL(_0x11bd50,_0x27137f,_0x1c760e=0x5){const _0x3da5dc=a148_0xa45dd6,_0x279e66=_0x11bd50[_0x3da5dc(0x1fb)],_0x331a6=_0x27137f[_0x3da5dc(0x203)][_0x3da5dc(0x1f3)],_0x262a03=_0x27137f[_0x3da5dc(0x201)][_0x3da5dc(0x1d5)](_0x1e7c25=>'a.'+_0x1e7c25[_0x3da5dc(0x210)])['join'](',\x20');return('\x0aSELECT\x20m.'+_0x331a6+',\x20'+_0x262a03+_0x3da5dc(0x1ed)+_0x279e66[_0x3da5dc(0x1ee)]+'.'+_0x279e66['table']+_0x3da5dc(0x206)+_0x27137f[_0x3da5dc(0x1df)][_0x3da5dc(0x1ee)]+'.'+_0x27137f[_0x3da5dc(0x1df)][_0x3da5dc(0x1e9)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x27137f[_0x3da5dc(0x203)]['parent_key']+_0x3da5dc(0x20b)+_0x27137f['join'][_0x3da5dc(0x1e8)]+_0x3da5dc(0x1de)+_0x1c760e+'\x0a')[_0x3da5dc(0x1f2)]();}export function generateBehaviorSampleSQL(_0x406288,_0x252193,_0x471bd3=0x5,_0x4efa2b=DEFAULT_TIME_RANGE){const _0x43c4ab=a148_0xa45dd6,_0x3dce56=_0x406288['master'],_0x5a100a=_0x252193[_0x43c4ab(0x203)][_0x43c4ab(0x1f3)];let _0x43a3ac;if(_0x252193['all_columns'])_0x43a3ac=_0x43c4ab(0x1ef);else _0x252193[_0x43c4ab(0x201)]&&_0x252193[_0x43c4ab(0x201)]['length']>0x0?_0x43a3ac=_0x252193[_0x43c4ab(0x201)][_0x43c4ab(0x1d5)](_0x5c173a=>'b.'+_0x5c173a[_0x43c4ab(0x210)])[_0x43c4ab(0x203)](',\x20'):_0x43a3ac=_0x43c4ab(0x1ef);return(_0x43c4ab(0x1fe)+_0x5a100a+',\x20'+_0x43a3ac+_0x43c4ab(0x1ed)+_0x3dce56['database']+'.'+_0x3dce56[_0x43c4ab(0x1e9)]+_0x43c4ab(0x206)+_0x252193[_0x43c4ab(0x1df)]['database']+'.'+_0x252193[_0x43c4ab(0x1df)][_0x43c4ab(0x1e9)]+_0x43c4ab(0x1f1)+_0x252193[_0x43c4ab(0x203)][_0x43c4ab(0x1f3)]+_0x43c4ab(0x1d8)+_0x252193[_0x43c4ab(0x203)][_0x43c4ab(0x1e8)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x4efa2b+_0x43c4ab(0x20a)+_0x471bd3+'\x0a')[_0x43c4ab(0x1f2)]();}function a148_0xb5f2(_0x1b57ac,_0x10e664){_0x1b57ac=_0x1b57ac-0x1d5;const _0x25041d=a148_0x2504();let _0xb5f2ce=_0x25041d[_0x1b57ac];return _0xb5f2ce;}function quoteIdentifier(_0x24b8b9){const _0x1a39b6=a148_0xa45dd6;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/['test'](_0x24b8b9))return'\x22'+_0x24b8b9[_0x1a39b6(0x1f6)](/"/g,'\x22\x22')+'\x22';return _0x24b8b9;}export function generateEnrichedSQL(_0xd3417f,_0x3049f7=0x5){const _0x2436ab=a148_0xa45dd6,_0x26efa1=_0xd3417f[_0x2436ab(0x1fb)],_0x58496b=_0xd3417f['attributes']||[];if(_0x58496b[_0x2436ab(0x1dd)]===0x0)return _0x2436ab(0x1f5)+_0x26efa1['database']+'.'+_0x26efa1[_0x2436ab(0x1e9)]+_0x2436ab(0x1db)+_0x3049f7;const _0x44756d=[_0x2436ab(0x20c)],_0x3cb492=[];return _0x58496b[_0x2436ab(0x1fa)]((_0x903a39,_0x3c7431)=>{const _0x5bc41f=_0x2436ab,_0x32f7d1='a'+_0x3c7431;_0x903a39[_0x5bc41f(0x201)][_0x5bc41f(0x1fa)](_0x349bac=>{const _0x583920=_0x5bc41f,_0x28dd02=quoteIdentifier(_0x349bac['label']||_0x349bac[_0x583920(0x210)]);_0x44756d[_0x583920(0x1eb)](_0x32f7d1+'.'+_0x349bac[_0x583920(0x210)]+_0x583920(0x1f7)+_0x28dd02);}),_0x3cb492[_0x5bc41f(0x1eb)](_0x5bc41f(0x1dc)+_0x903a39[_0x5bc41f(0x1df)][_0x5bc41f(0x1ee)]+'.'+_0x903a39[_0x5bc41f(0x1df)][_0x5bc41f(0x1e9)]+'\x20'+_0x32f7d1+_0x5bc41f(0x1ea)+_0x903a39[_0x5bc41f(0x203)][_0x5bc41f(0x1f3)]+_0x5bc41f(0x204)+_0x32f7d1+'.'+_0x903a39[_0x5bc41f(0x203)][_0x5bc41f(0x1e8)]);}),(_0x2436ab(0x207)+_0x44756d[_0x2436ab(0x203)](',\x20')+_0x2436ab(0x1ed)+_0x26efa1[_0x2436ab(0x1ee)]+'.'+_0x26efa1[_0x2436ab(0x1e9)]+_0x2436ab(0x20d)+_0x3cb492[_0x2436ab(0x203)]('\x0a')+'\x0aLIMIT\x20'+_0x3049f7+'\x0a')[_0x2436ab(0x1f2)]();}export function generateAttributeSchemaSQL(_0x43ba2a,_0x713598){const _0x3f2838=a148_0xa45dd6,_0x1d63ac=_0x43ba2a[_0x3f2838(0x1fb)],_0x4ff1ab=_0x713598[_0x3f2838(0x203)][_0x3f2838(0x1f3)],_0x327515=_0x713598[_0x3f2838(0x201)][_0x3f2838(0x1d5)](_0x4b07a2=>'a.'+_0x4b07a2['column'])['join'](',\x20');return(_0x3f2838(0x1fe)+_0x4ff1ab+',\x20'+_0x327515+_0x3f2838(0x1ed)+_0x1d63ac[_0x3f2838(0x1ee)]+'.'+_0x1d63ac[_0x3f2838(0x1e9)]+'\x20m\x0aJOIN\x20'+_0x713598[_0x3f2838(0x1df)][_0x3f2838(0x1ee)]+'.'+_0x713598[_0x3f2838(0x1df)][_0x3f2838(0x1e9)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x713598['join']['parent_key']+_0x3f2838(0x20b)+_0x713598[_0x3f2838(0x203)][_0x3f2838(0x1e8)]+_0x3f2838(0x1d6))[_0x3f2838(0x1f2)]();}export function generateBehaviorSchemaSQL(_0x34f0ad,_0x26384f){const _0x196bbb=a148_0xa45dd6,_0x394d26=_0x34f0ad[_0x196bbb(0x1fb)],_0x470f41=_0x26384f[_0x196bbb(0x203)][_0x196bbb(0x1f3)];let _0x3a6fb2;if(_0x26384f['all_columns'])_0x3a6fb2=_0x196bbb(0x1ef);else _0x26384f[_0x196bbb(0x201)]&&_0x26384f['columns']['length']>0x0?_0x3a6fb2=_0x26384f[_0x196bbb(0x201)]['map'](_0x43f842=>'b.'+_0x43f842[_0x196bbb(0x210)])[_0x196bbb(0x203)](',\x20'):_0x3a6fb2='b.*';return('\x0aSELECT\x20m.'+_0x470f41+',\x20'+_0x3a6fb2+'\x0aFROM\x20'+_0x394d26['database']+'.'+_0x394d26[_0x196bbb(0x1e9)]+_0x196bbb(0x206)+_0x26384f[_0x196bbb(0x1df)][_0x196bbb(0x1ee)]+'.'+_0x26384f['source'][_0x196bbb(0x1e9)]+_0x196bbb(0x1f1)+_0x26384f[_0x196bbb(0x203)][_0x196bbb(0x1f3)]+_0x196bbb(0x1d8)+_0x26384f['join'][_0x196bbb(0x1e8)]+'\x0aLIMIT\x200\x0a')[_0x196bbb(0x1f2)]();}export function getAttributeColumns(_0x5adf36){const _0x44b371=a148_0xa45dd6;return _0x5adf36[_0x44b371(0x201)][_0x44b371(0x1d5)](_0x3f6a52=>({'label':_0x3f6a52[_0x44b371(0x1e2)]||_0x3f6a52[_0x44b371(0x210)],'column':_0x3f6a52['column']}));}export function getBehaviorColumns(_0x5c32af){const _0x9ace94=a148_0xa45dd6;if(_0x5c32af['all_columns'])return[{'label':_0x9ace94(0x1e4),'column':'*'}];if(_0x5c32af[_0x9ace94(0x201)]&&_0x5c32af['columns'][_0x9ace94(0x1dd)]>0x0)return _0x5c32af['columns'][_0x9ace94(0x1d5)](_0x550cc4=>({'label':_0x550cc4[_0x9ace94(0x1e2)]||_0x550cc4['column'],'column':_0x550cc4[_0x9ace94(0x210)]}));return[{'label':_0x9ace94(0x1e4),'column':'*'}];}export function findAttributeByName(_0x4673d8,_0x47ff48){const _0x46b666=a148_0xa45dd6;return _0x4673d8[_0x46b666(0x20f)]?.[_0x46b666(0x1d7)](_0x38256a=>_0x38256a[_0x46b666(0x200)][_0x46b666(0x20e)]()===_0x47ff48['toLowerCase']());}export function findBehaviorByName(_0x4ba25e,_0x4cb547){const _0x1b8760=a148_0xa45dd6;return _0x4ba25e['behaviors']?.[_0x1b8760(0x1d7)](_0x47a356=>_0x47a356['name'][_0x1b8760(0x20e)]()===_0x4cb547['toLowerCase']());}
|