@treasuredata/tdx 2026.4.19 → 2026.4.20
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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.d.ts +1 -0
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +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.d.ts +1 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +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.d.ts +7 -0
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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.d.ts +14 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.d.ts +65 -0
- package/dist/sdk/workflow/task-graph.d.ts.map +1 -0
- package/dist/sdk/workflow/task-graph.js +1 -0
- package/dist/sdk/workflow/task-graph.js.map +1 -0
- 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(_0x118703,_0x435ee3){const _0x5042b9=a146_0x5c22,_0x43313a=_0x118703();while(!![]){try{const _0x4259bc=parseInt(_0x5042b9(0x1f7))/0x1*(parseInt(_0x5042b9(0x218))/0x2)+parseInt(_0x5042b9(0x1fd))/0x3*(parseInt(_0x5042b9(0x282))/0x4)+parseInt(_0x5042b9(0x219))/0x5*(-parseInt(_0x5042b9(0x224))/0x6)+parseInt(_0x5042b9(0x23a))/0x7+-parseInt(_0x5042b9(0x265))/0x8*(parseInt(_0x5042b9(0x28e))/0x9)+-parseInt(_0x5042b9(0x1ed))/0xa*(-parseInt(_0x5042b9(0x210))/0xb)+-parseInt(_0x5042b9(0x270))/0xc*(parseInt(_0x5042b9(0x269))/0xd);if(_0x4259bc===_0x435ee3)break;else _0x43313a['push'](_0x43313a['shift']());}catch(_0x4d0205){_0x43313a['push'](_0x43313a['shift']());}}}(a146_0x5622,0x8f175));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x217744,_0x589d33,_0x181980,_0x79590a,_0x2e8e14,_0x4716a6){const _0x4a1b89=a146_0x5c22;return{'level':_0x217744,'path':_0x589d33,'code':_0x181980,'message':_0x79590a,'location':getLocationFromPath(_0x2e8e14[_0x4a1b89(0x27b)],_0x2e8e14['source'],pathToArray(_0x4716a6??_0x589d33))};}function validateVersionStructure(_0x8e4c90,_0x1845d1){const _0x34b594=a146_0x5c22,_0x2e7f7c=[];return _0x8e4c90['length']>MAX_STAGES&&_0x2e7f7c[_0x34b594(0x1dd)](createIssue('error',_0x34b594(0x21e),_0x34b594(0x27c),_0x34b594(0x1f8)+_0x8e4c90['length']+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x1845d1)),_0x2e7f7c;}function validateStageStructure(_0x5ae0f3,_0x20fee9,_0x45ac36,_0x7a1059){const _0x301547=a146_0x5c22,_0x271613=[],_0x47e946='stages['+_0x20fee9+']';_0x20fee9===0x0&&!_0x5ae0f3[_0x301547(0x1fb)]&&_0x271613[_0x301547(0x1dd)](createIssue(_0x301547(0x228),_0x47e946+'.entry_criteria','MISSING_ENTRY_CRITERIA',_0x301547(0x205)+_0x5ae0f3[_0x301547(0x215)]+_0x301547(0x249),_0x7a1059,_0x47e946));const _0x47342c=_0x20fee9===_0x45ac36-0x1;!_0x47342c&&!_0x5ae0f3['milestone']&&_0x271613[_0x301547(0x1dd)](createIssue(_0x301547(0x228),_0x47e946+_0x301547(0x273),_0x301547(0x1e2),_0x301547(0x205)+_0x5ae0f3[_0x301547(0x215)]+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0x7a1059,_0x47e946));(!_0x5ae0f3[_0x301547(0x1eb)]||_0x5ae0f3[_0x301547(0x1eb)]['length']===0x0)&&_0x271613[_0x301547(0x1dd)](createIssue('warning',_0x47e946+_0x301547(0x231),_0x301547(0x27e),_0x301547(0x205)+_0x5ae0f3[_0x301547(0x215)]+_0x301547(0x206),_0x7a1059,_0x47e946));const _0x5a2656=_0x5ae0f3['steps']?.[_0x301547(0x20e)]??0x0;if(_0x5a2656===0x0)_0x271613[_0x301547(0x1dd)](createIssue(_0x301547(0x228),_0x47e946+_0x301547(0x26b),_0x301547(0x278),'Stage\x20\x27'+_0x5ae0f3[_0x301547(0x215)]+_0x301547(0x225),_0x7a1059,_0x47e946+_0x301547(0x26b)));else{if(_0x5a2656===0x1)_0x271613[_0x301547(0x1dd)](createIssue(_0x301547(0x264),_0x47e946+_0x301547(0x26b),'INSUFFICIENT_STEPS',_0x301547(0x205)+_0x5ae0f3['name']+_0x301547(0x207),_0x7a1059,_0x47e946+'.steps'));else _0x5a2656<=0x3&&_0x271613[_0x301547(0x1dd)](createIssue(_0x301547(0x264),_0x47e946+_0x301547(0x26b),_0x301547(0x241),_0x301547(0x205)+_0x5ae0f3[_0x301547(0x215)]+'\x27\x20has\x20only\x20'+_0x5a2656+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x7a1059,_0x47e946+_0x301547(0x26b)));}return _0x271613;}function validateStep(_0x19c9b7,_0x1c9e60,_0xb8e982,_0x28b93f){const _0x2c029c=a146_0x5c22,_0x1b7374=[];if(_0x19c9b7[_0x2c029c(0x279)]==='end')return _0x19c9b7[_0x2c029c(0x27f)]&&_0x1b7374['push'](createIssue(_0x2c029c(0x228),_0x1c9e60+_0x2c029c(0x220),_0x2c029c(0x201),_0x2c029c(0x1ea)+_0x19c9b7[_0x2c029c(0x215)]+_0x2c029c(0x223),_0xb8e982)),_0x2c029c(0x202)in _0x19c9b7&&_0x19c9b7[_0x2c029c(0x202)]!==undefined&&_0x1b7374[_0x2c029c(0x1dd)](createIssue(_0x2c029c(0x228),_0x1c9e60+_0x2c029c(0x1f6),'END_STEP_HAS_NEXT_OR_WITH',_0x2c029c(0x1ea)+_0x19c9b7[_0x2c029c(0x215)]+_0x2c029c(0x1e0),_0xb8e982)),_0x1b7374;_0x19c9b7[_0x2c029c(0x27f)]&&(_0xb8e982[_0x2c029c(0x213)]&&!_0xb8e982[_0x2c029c(0x213)][_0x2c029c(0x280)](_0x19c9b7[_0x2c029c(0x27f)])&&_0x1b7374[_0x2c029c(0x1dd)](createIssue('error',_0x1c9e60+'.next','INVALID_NEXT_REFERENCE',_0x2c029c(0x262)+_0x19c9b7['next']+'\x27',_0xb8e982)));switch(_0x19c9b7[_0x2c029c(0x279)]){case'wait':_0x1b7374['push'](...validateWaitStep(_0x19c9b7,_0x1c9e60,_0xb8e982,_0x28b93f));break;case _0x2c029c(0x24e):_0x1b7374[_0x2c029c(0x1dd)](...validateActivationStep(_0x19c9b7,_0x1c9e60,_0xb8e982));break;case _0x2c029c(0x22c):_0x1b7374[_0x2c029c(0x1dd)](...validateDecisionPointStep(_0x19c9b7,_0x1c9e60,_0xb8e982,_0x28b93f));break;case'ab_test':_0x1b7374[_0x2c029c(0x1dd)](...validateAbTestStep(_0x19c9b7,_0x1c9e60,_0xb8e982,_0x28b93f));break;case _0x2c029c(0x209):_0x1b7374['push'](...validateJumpStep(_0x19c9b7,_0x1c9e60,_0xb8e982));break;}return _0x1b7374;}function validateWaitStep(_0x14b837,_0x5a8054,_0x58db04,_0x2636c0){const _0x2a27d2=a146_0x5c22,_0x33ffba=[];if(!_0x14b837[_0x2a27d2(0x202)])return _0x33ffba[_0x2a27d2(0x1dd)](createIssue(_0x2a27d2(0x228),_0x5a8054+'.with',_0x2a27d2(0x1ff),_0x2a27d2(0x285),_0x58db04,_0x5a8054)),_0x33ffba;if(_0x14b837['with'][_0x2a27d2(0x257)]){const _0x182356=_0x14b837[_0x2a27d2(0x202)]['condition'];if(_0x182356[_0x2a27d2(0x1e6)]){_0x58db04[_0x2a27d2(0x1ee)]?.[_0x2a27d2(0x1ef)](_0x182356['segment']);!_0x182356[_0x2a27d2(0x1e6)][_0x2a27d2(0x284)](_0x2a27d2(0x289))&&(_0x58db04[_0x2a27d2(0x21a)]&&!_0x58db04[_0x2a27d2(0x21a)][_0x2a27d2(0x280)](_0x182356[_0x2a27d2(0x1e6)])&&_0x33ffba[_0x2a27d2(0x1dd)](createIssue(_0x2a27d2(0x228),_0x5a8054+_0x2a27d2(0x256),_0x2a27d2(0x28a),_0x2a27d2(0x1f1)+_0x182356[_0x2a27d2(0x1e6)]+_0x2a27d2(0x255),_0x58db04)));_0x182356[_0x2a27d2(0x27f)]&&_0x58db04[_0x2a27d2(0x213)]&&!_0x58db04[_0x2a27d2(0x213)][_0x2a27d2(0x280)](_0x182356[_0x2a27d2(0x27f)])&&_0x33ffba[_0x2a27d2(0x1dd)](createIssue(_0x2a27d2(0x228),_0x5a8054+_0x2a27d2(0x28f),'INVALID_NEXT_REFERENCE','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x182356[_0x2a27d2(0x27f)]+'\x27',_0x58db04));_0x182356[_0x2a27d2(0x1fc)]?.[_0x2a27d2(0x27f)]&&_0x58db04[_0x2a27d2(0x213)]&&!_0x58db04['stepNames']['has'](_0x182356[_0x2a27d2(0x1fc)][_0x2a27d2(0x27f)])&&_0x33ffba['push'](createIssue('error',_0x5a8054+_0x2a27d2(0x236),_0x2a27d2(0x233),_0x2a27d2(0x1f0)+_0x182356[_0x2a27d2(0x1fc)][_0x2a27d2(0x27f)]+'\x27',_0x58db04));const _0x20a6f8=_0x182356[_0x2a27d2(0x27f)]||_0x14b837[_0x2a27d2(0x27f)],_0x23e256=_0x182356['timeout']?.['next']||_0x14b837[_0x2a27d2(0x27f)];if(_0x20a6f8){const _0x1e3219=_0x2636c0['get'](_0x20a6f8);_0x1e3219?.[_0x2a27d2(0x279)]===_0x2a27d2(0x25f)&&_0x33ffba[_0x2a27d2(0x1dd)](createIssue('warning',_0x5a8054+'.with.condition.next',_0x2a27d2(0x23f),_0x2a27d2(0x290)+_0x20a6f8+_0x2a27d2(0x1dc),_0x58db04,_0x5a8054+_0x2a27d2(0x21d)));}if(_0x23e256){const _0xe18ee6=_0x2636c0[_0x2a27d2(0x26c)](_0x23e256);_0xe18ee6?.[_0x2a27d2(0x279)]===_0x2a27d2(0x25f)&&_0x33ffba['push'](createIssue(_0x2a27d2(0x264),_0x5a8054+_0x2a27d2(0x236),_0x2a27d2(0x23f),_0x2a27d2(0x252)+_0x23e256+_0x2a27d2(0x1dc),_0x58db04,_0x5a8054+'.with.condition.timeout'));}}}return _0x33ffba;}function validateActivationStep(_0x1aa058,_0x53feec,_0x3960ec){const _0x1d2ec7=a146_0x5c22,_0x19f833=[];if(!_0x1aa058[_0x1d2ec7(0x202)]?.[_0x1d2ec7(0x24e)])return _0x19f833['push'](createIssue('error',_0x53feec+_0x1d2ec7(0x23d),_0x1d2ec7(0x216),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x3960ec,_0x53feec)),_0x19f833;const _0xdde251=_0x1aa058[_0x1d2ec7(0x202)][_0x1d2ec7(0x24e)];return _0x3960ec[_0x1d2ec7(0x260)]&&!_0xdde251['startsWith'](_0x1d2ec7(0x289))&&(!_0x3960ec[_0x1d2ec7(0x260)][_0x1d2ec7(0x280)](_0xdde251)&&_0x19f833[_0x1d2ec7(0x1dd)](createIssue(_0x1d2ec7(0x228),_0x53feec+_0x1d2ec7(0x23d),_0x1d2ec7(0x275),'Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0xdde251+_0x1d2ec7(0x25b),_0x3960ec))),_0x19f833;}function validateDecisionPointStep(_0xa644ab,_0x45c4f7,_0x2c9fd5,_0x40aad1){const _0x4648cc=a146_0x5c22,_0x300d13=[];if(!_0xa644ab[_0x4648cc(0x202)]?.[_0x4648cc(0x242)]||_0xa644ab['with'][_0x4648cc(0x242)][_0x4648cc(0x20e)]===0x0)return _0x300d13[_0x4648cc(0x1dd)](createIssue(_0x4648cc(0x228),_0x45c4f7+_0x4648cc(0x21f),_0x4648cc(0x259),_0x4648cc(0x221),_0x2c9fd5,_0x45c4f7)),_0x300d13;for(let _0x5aa78a=0x0;_0x5aa78a<_0xa644ab[_0x4648cc(0x202)]['branches'][_0x4648cc(0x20e)];_0x5aa78a++){const _0x562af9=_0xa644ab[_0x4648cc(0x202)]['branches'][_0x5aa78a],_0x5f3752=_0x45c4f7+'.with.branches['+_0x5aa78a+']';_0x562af9['segment']&&!_0x562af9['excluded']&&(_0x2c9fd5[_0x4648cc(0x1ee)]?.[_0x4648cc(0x1ef)](_0x562af9['segment']),!_0x562af9['segment'][_0x4648cc(0x284)](_0x4648cc(0x289))&&(_0x2c9fd5[_0x4648cc(0x21a)]&&!_0x2c9fd5['embeddedSegments']['has'](_0x562af9[_0x4648cc(0x1e6)])&&_0x300d13['push'](createIssue(_0x4648cc(0x228),_0x5f3752+_0x4648cc(0x286),_0x4648cc(0x28a),_0x4648cc(0x204)+_0x562af9[_0x4648cc(0x1e6)]+'\x27',_0x2c9fd5))));_0x562af9[_0x4648cc(0x27f)]&&_0x2c9fd5['stepNames']&&!_0x2c9fd5[_0x4648cc(0x213)][_0x4648cc(0x280)](_0x562af9[_0x4648cc(0x27f)])&&_0x300d13[_0x4648cc(0x1dd)](createIssue(_0x4648cc(0x228),_0x5f3752+_0x4648cc(0x220),'INVALID_NEXT_REFERENCE',_0x4648cc(0x1e5)+_0x562af9[_0x4648cc(0x27f)]+'\x27',_0x2c9fd5));if(_0x562af9[_0x4648cc(0x27f)]){const _0x262d48=_0x40aad1['get'](_0x562af9[_0x4648cc(0x27f)]);_0x262d48?.[_0x4648cc(0x279)]===_0x4648cc(0x25f)&&_0x300d13['push'](createIssue(_0x4648cc(0x264),_0x5f3752+_0x4648cc(0x220),'BRANCH_DIRECTLY_TO_MERGE',_0x4648cc(0x288)+_0x562af9[_0x4648cc(0x215)]+_0x4648cc(0x261)+_0x562af9['next']+_0x4648cc(0x237),_0x2c9fd5));}}return _0x300d13;}function validateAbTestStep(_0x14b524,_0x5b1666,_0x13b275,_0x1e071b){const _0x5d159e=a146_0x5c22,_0x4b10bb=[];if(!_0x14b524[_0x5d159e(0x202)]?.[_0x5d159e(0x1e1)]||_0x14b524[_0x5d159e(0x202)][_0x5d159e(0x1e1)][_0x5d159e(0x20e)]===0x0)return _0x4b10bb['push'](createIssue(_0x5d159e(0x228),_0x5b1666+_0x5d159e(0x263),_0x5d159e(0x259),_0x5d159e(0x222),_0x13b275,_0x5b1666)),_0x4b10bb;const _0x85d0cf=_0x14b524['with']['variants']['reduce']((_0x543bc6,_0x45921e)=>_0x543bc6+(_0x45921e[_0x5d159e(0x20f)]||0x0),0x0);Math['abs'](_0x85d0cf-0x64)>0.01&&_0x4b10bb[_0x5d159e(0x1dd)](createIssue(_0x5d159e(0x228),_0x5b1666+'.with.variants',_0x5d159e(0x243),_0x5d159e(0x20a)+_0x85d0cf+'%)',_0x13b275));for(let _0x4724cd=0x0;_0x4724cd<_0x14b524['with'][_0x5d159e(0x1e1)][_0x5d159e(0x20e)];_0x4724cd++){const _0x36e95e=_0x14b524['with']['variants'][_0x4724cd],_0x53e162=_0x5b1666+'.with.variants['+_0x4724cd+']';_0x36e95e[_0x5d159e(0x27f)]&&_0x13b275[_0x5d159e(0x213)]&&!_0x13b275[_0x5d159e(0x213)]['has'](_0x36e95e[_0x5d159e(0x27f)])&&_0x4b10bb['push'](createIssue(_0x5d159e(0x228),_0x53e162+_0x5d159e(0x220),_0x5d159e(0x233),_0x5d159e(0x229)+_0x36e95e[_0x5d159e(0x27f)]+'\x27',_0x13b275));if(_0x36e95e[_0x5d159e(0x27f)]){const _0x397e25=_0x1e071b['get'](_0x36e95e[_0x5d159e(0x27f)]);_0x397e25?.[_0x5d159e(0x279)]===_0x5d159e(0x25f)&&_0x4b10bb[_0x5d159e(0x1dd)](createIssue(_0x5d159e(0x264),_0x53e162+_0x5d159e(0x220),_0x5d159e(0x23f),_0x5d159e(0x244)+_0x36e95e[_0x5d159e(0x215)]+_0x5d159e(0x261)+_0x36e95e[_0x5d159e(0x27f)]+_0x5d159e(0x237),_0x13b275));}}return _0x4b10bb;}function validateJumpStep(_0x3d50d4,_0x207ba0,_0x4ffcf1){const _0x34d0a7=a146_0x5c22,_0x2394fb=[];if(!_0x3d50d4[_0x34d0a7(0x202)]?.['target'])return _0x2394fb['push'](createIssue(_0x34d0a7(0x228),_0x207ba0+'.with.target',_0x34d0a7(0x22f),_0x34d0a7(0x26a),_0x4ffcf1,_0x207ba0)),_0x2394fb;return(!_0x3d50d4[_0x34d0a7(0x202)][_0x34d0a7(0x20d)]['journey']||!_0x3d50d4[_0x34d0a7(0x202)][_0x34d0a7(0x20d)][_0x34d0a7(0x1ec)])&&_0x2394fb[_0x34d0a7(0x1dd)](createIssue(_0x34d0a7(0x228),_0x207ba0+_0x34d0a7(0x254),'INVALID_JUMP_TARGET','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',_0x4ffcf1)),_0x2394fb;}function buildConvergenceMap(_0x514760){const _0x622bae=a146_0x5c22,_0x32f50b=new Map();function _0x4c9736(_0x3e84cd,_0x5f5993){const _0x37f85b=a146_0x5c22,_0x4f8bb6=_0x32f50b['get'](_0x3e84cd)||[];_0x4f8bb6[_0x37f85b(0x1dd)](_0x5f5993),_0x32f50b[_0x37f85b(0x267)](_0x3e84cd,_0x4f8bb6);}for(const _0x156675 of _0x514760){_0x156675[_0x622bae(0x27f)]&&_0x4c9736(_0x156675[_0x622bae(0x27f)],{'stepName':_0x156675[_0x622bae(0x215)],'description':_0x622bae(0x1db)+_0x156675[_0x622bae(0x215)]+'\x27'});if(_0x156675['type']==='decision_point'&&_0x156675[_0x622bae(0x202)]?.[_0x622bae(0x242)])for(const _0xa18ad6 of _0x156675[_0x622bae(0x202)]['branches']){_0xa18ad6['next']&&_0x4c9736(_0xa18ad6['next'],{'stepName':_0x156675[_0x622bae(0x215)],'description':_0x622bae(0x287)+_0xa18ad6[_0x622bae(0x215)]+'\x27\x20of\x20\x27'+_0x156675['name']+'\x27'});}if(_0x156675['type']===_0x622bae(0x1e3)&&_0x156675[_0x622bae(0x202)]?.['variants'])for(const _0x1a4489 of _0x156675[_0x622bae(0x202)][_0x622bae(0x1e1)]){_0x1a4489[_0x622bae(0x27f)]&&_0x4c9736(_0x1a4489['next'],{'stepName':_0x156675[_0x622bae(0x215)],'description':'variant\x20\x27'+_0x1a4489['name']+_0x622bae(0x27a)+_0x156675[_0x622bae(0x215)]+'\x27'});}_0x156675[_0x622bae(0x279)]==='wait'&&_0x156675[_0x622bae(0x202)]?.[_0x622bae(0x257)]&&(_0x156675['with'][_0x622bae(0x257)][_0x622bae(0x27f)]&&_0x4c9736(_0x156675[_0x622bae(0x202)][_0x622bae(0x257)][_0x622bae(0x27f)],{'stepName':_0x156675[_0x622bae(0x215)],'description':_0x622bae(0x217)+_0x156675[_0x622bae(0x215)]+'\x27'}),_0x156675[_0x622bae(0x202)][_0x622bae(0x257)][_0x622bae(0x1fc)]?.[_0x622bae(0x27f)]&&_0x4c9736(_0x156675[_0x622bae(0x202)]['condition'][_0x622bae(0x1fc)][_0x622bae(0x27f)],{'stepName':_0x156675[_0x622bae(0x215)],'description':'timeout\x20of\x20\x27'+_0x156675[_0x622bae(0x215)]+'\x27'}));}return _0x32f50b;}function validateFlowControl(_0x3f3682,_0x14ff4c,_0x2074c6){const _0x49823d=a146_0x5c22,_0x534056=[],_0x18520c=_0x49823d(0x1e4)+_0x14ff4c+']',_0x586fde=_0x3f3682[_0x49823d(0x235)]||[];if(_0x586fde[_0x49823d(0x20e)]===0x0)return _0x534056;const _0x3a7af9=new Map();for(const _0x59252d of _0x586fde){_0x59252d[_0x49823d(0x215)]&&_0x3a7af9[_0x49823d(0x267)](_0x59252d[_0x49823d(0x215)],_0x59252d);}const _0x1a5d85=buildConvergenceMap(_0x586fde),_0x53b80a=_0x586fde[_0x49823d(0x27d)](_0x28dd6c=>_0x28dd6c[_0x49823d(0x279)]===_0x49823d(0x274));!_0x53b80a&&_0x534056[_0x49823d(0x1dd)](createIssue(_0x49823d(0x228),_0x18520c+_0x49823d(0x26b),_0x49823d(0x253),_0x49823d(0x205)+_0x3f3682[_0x49823d(0x215)]+_0x49823d(0x26e),_0x2074c6));for(const [_0x2063a7,_0xb0b226]of _0x1a5d85){const _0x15f9f0=_0x3a7af9[_0x49823d(0x26c)](_0x2063a7);if(!_0x15f9f0)continue;if(_0xb0b226[_0x49823d(0x20e)]>0x1&&_0x15f9f0[_0x49823d(0x279)]!=='merge'){const _0xf5eb58=_0xb0b226['map'](_0x53b0ca=>_0x53b0ca[_0x49823d(0x24c)])['join'](',\x20');_0x534056[_0x49823d(0x1dd)](createIssue(_0x49823d(0x228),_0x18520c+'.steps',_0x49823d(0x200),'Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x2063a7+_0x49823d(0x24a)+_0xf5eb58+').\x20Use\x20a\x20merge\x20step.',_0x2074c6));}_0xb0b226[_0x49823d(0x20e)]===0x1&&_0x15f9f0[_0x49823d(0x279)]==='merge'&&_0x534056[_0x49823d(0x1dd)](createIssue(_0x49823d(0x264),_0x18520c+'.steps',_0x49823d(0x22a),_0x49823d(0x266)+_0x2063a7+_0x49823d(0x23c)+_0xb0b226[0x0][_0x49823d(0x24c)]+_0x49823d(0x1e8),_0x2074c6));}for(const _0x24ce91 of _0x586fde){if(_0x24ce91[_0x49823d(0x279)]===_0x49823d(0x25f)&&_0x24ce91[_0x49823d(0x27f)]){const _0x5d55e2=_0x3a7af9['get'](_0x24ce91[_0x49823d(0x27f)]);_0x5d55e2?.['type']===_0x49823d(0x25f)&&_0x534056['push'](createIssue(_0x49823d(0x228),_0x18520c+_0x49823d(0x26b),_0x49823d(0x25c),'Merge\x20step\x20\x27'+_0x24ce91[_0x49823d(0x215)]+_0x49823d(0x239)+_0x24ce91['next']+_0x49823d(0x20c),_0x2074c6));}}return _0x534056;}function validateCriteria(_0x1a641e,_0x551c8d,_0x4d6656){const _0x251c9a=a146_0x5c22,_0x32b1dc=[];return _0x1a641e['segment']&&(_0x4d6656[_0x251c9a(0x1ee)]?.['add'](_0x1a641e[_0x251c9a(0x1e6)]),!_0x1a641e['segment'][_0x251c9a(0x284)]('ref:')&&(_0x4d6656[_0x251c9a(0x21a)]&&!_0x4d6656[_0x251c9a(0x21a)][_0x251c9a(0x280)](_0x1a641e[_0x251c9a(0x1e6)])&&_0x32b1dc[_0x251c9a(0x1dd)](createIssue(_0x251c9a(0x228),_0x551c8d+_0x251c9a(0x286),_0x251c9a(0x28a),_0x251c9a(0x208)+_0x1a641e[_0x251c9a(0x1e6)]+'\x27',_0x4d6656)))),_0x32b1dc;}function validateEmbeddedSegment(_0x2f66cd,_0x53696e,_0x15987e){const _0x30f1ab=a146_0x5c22,_0x5bf7c1=[];return _0x2f66cd[_0x30f1ab(0x28b)]&&_0x5bf7c1['push'](...validateRuleDef(_0x2f66cd['rule'],_0x53696e+_0x30f1ab(0x227),_0x15987e)),_0x5bf7c1;}function validateStage(_0x326749,_0x5be508,_0x4c6248,_0x11ffd5){const _0x1fa8ca=a146_0x5c22,_0x5553b8=[],_0x3da03f=_0x1fa8ca(0x1e4)+_0x5be508+']',_0x3543fd=new Map(),_0x768887=new Map();if(_0x326749['steps']){for(let _0x54ee5e=0x0;_0x54ee5e<_0x326749[_0x1fa8ca(0x235)][_0x1fa8ca(0x20e)];_0x54ee5e++){const _0x49710f=_0x326749['steps'][_0x54ee5e];_0x49710f[_0x1fa8ca(0x215)]&&_0x3543fd[_0x1fa8ca(0x267)](_0x49710f[_0x1fa8ca(0x215)],_0x49710f);}for(let _0x69ee05=0x0;_0x69ee05<_0x326749['steps'][_0x1fa8ca(0x20e)];_0x69ee05++){const _0x435397=_0x326749[_0x1fa8ca(0x235)][_0x69ee05],_0x4a1c1f=_0x3da03f+_0x1fa8ca(0x1de)+_0x69ee05+']';if(_0x435397['name']){if(_0x768887['has'](_0x435397['name'])){const _0x39b24b=_0x768887[_0x1fa8ca(0x26c)](_0x435397[_0x1fa8ca(0x215)]);_0x5553b8['push'](createIssue(_0x1fa8ca(0x228),_0x4a1c1f+_0x1fa8ca(0x245),_0x1fa8ca(0x1f3),_0x1fa8ca(0x203)+_0x435397['name']+'\x27\x20(first\x20defined\x20at\x20steps['+_0x39b24b+'])',_0x11ffd5));}else _0x768887[_0x1fa8ca(0x267)](_0x435397['name'],_0x69ee05);}_0x5553b8[_0x1fa8ca(0x1dd)](...validateStep(_0x435397,_0x4a1c1f,_0x11ffd5,_0x3543fd));}}_0x326749['entry_criteria']&&_0x5553b8[_0x1fa8ca(0x1dd)](...validateCriteria(_0x326749[_0x1fa8ca(0x1fb)],_0x3da03f+_0x1fa8ca(0x212),_0x11ffd5));if(_0x326749[_0x1fa8ca(0x1eb)])for(let _0x4303a4=0x0;_0x4303a4<_0x326749[_0x1fa8ca(0x1eb)][_0x1fa8ca(0x20e)];_0x4303a4++){_0x5553b8[_0x1fa8ca(0x1dd)](...validateCriteria(_0x326749['exit_criteria'][_0x4303a4],_0x3da03f+_0x1fa8ca(0x26f)+_0x4303a4+']',_0x11ffd5));}return _0x326749[_0x1fa8ca(0x1f2)]&&_0x5553b8[_0x1fa8ca(0x1dd)](...validateCriteria(_0x326749['milestone'],_0x3da03f+_0x1fa8ca(0x273),_0x11ffd5)),_0x5553b8[_0x1fa8ca(0x1dd)](...validateStageStructure(_0x326749,_0x5be508,_0x4c6248,_0x11ffd5)),_0x5553b8[_0x1fa8ca(0x1dd)](...validateFlowControl(_0x326749,_0x5be508,_0x11ffd5)),_0x5553b8;}function a146_0x5622(){const _0x8a7221=['13910NJOQRG','referencedSegments','add','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','milestone','DUPLICATE_STEP_NAME','Embedded\x20segment\x20\x27','every','.with','1tyibYO','Journey\x20has\x20','path','journeys,\x20stages,\x20or\x20versions','entry_criteria','timeout','387YaUzCS','size','MISSING_WAIT_PARAMS','CONVERGENCE_WITHOUT_MERGE','END_STEP_HAS_NEXT_OR_WITH','with','Duplicate\x20step\x20name\x20\x27','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','Stage\x20\x27','\x27\x20has\x20no\x20exit_criteria\x20defined','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','Criteria\x20references\x20undefined\x20segment\x20\x27','jump','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','data','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','target','length','percentage','165rTAGMf','indices','.entry_criteria','stepNames','source','name','MISSING_ACTIVATION_REF','condition\x20of\x20\x27','374614LlCsYW','5DRqNCT','embeddedSegments','.type','ACTIVATION_SCHEMA_ERROR','.with.condition','stages','.with.branches','.next','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','1687038GUBzGB','\x27\x20has\x20no\x20steps','journeys','.rule','error','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','SINGLE_INPUT_MERGE','includes','decision_point','match','message','INVALID_JUMP_TARGET','DUPLICATE_LATEST','.exit_criteria','Journey\x20can\x20have\x20at\x20most\x20one\x20','INVALID_NEXT_REFERENCE','launched','steps','.with.condition.timeout.next','\x27\x20with\x20no\x20action\x20in\x20between','journeys[','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','7275667TCwvvA','\x20versions)','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','.with.activation','level','BRANCH_DIRECTLY_TO_MERGE','success','FEW_STEPS','branches','INVALID_AB_TEST_PERCENTAGES','A/B\x20test\x20variant\x20\x27','.name','JOURNEY_SCHEMA_ERROR','goal','skipSchema','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','\x27\x20(from:\x20','segments.','description','values','activation','sort','segments','state','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','MISSING_END_STEP','.with.target','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','.with.condition.segment','condition','trim','MISSING_CONDITIONS','UNUSED_EMBEDDED_SEGMENT','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','MERGE_TO_MERGE_CHAIN','Journey\x20has\x20no\x20goal\x20defined','keys','merge','activationKeys','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Step\x20references\x20non-existent\x20step\x20\x27','.with.variants','warning','4400FnmMNj','Merge\x20step\x20\x27','set','entries','199030jBcOXk','Jump\x20step\x20requires\x20a\x20target','.steps','get','map','\x27\x20has\x20no\x20end\x20step','.exit_criteria[','24MTcCEt','versions','goalIsInherited','.milestone','end','MISSING_ACTIVATION_DEFINITION','\x20with\x20latest:\x20true','endsWith','INSUFFICIENT_STEPS','type','\x27\x20of\x20\x27','document','TOO_MANY_STAGES','some','MISSING_EXIT_CRITERIA','next','has','journey\x20entry','20316GGSXiJ','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','startsWith','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','.segment','branch\x20\x27','Decision\x20branch\x20\x27','ref:','MISSING_SEGMENT_REFERENCE','rule','activations','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','16443MenCyA','.with.condition.next','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','step\x20\x27','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','push','.steps[','latest','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','variants','MISSING_MILESTONE','ab_test','stages[','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','segment','MISSING_NAME',').\x20Merge\x20is\x20unnecessary.','MISSING_STAGES','End\x20step\x20\x27','exit_criteria','stage'];a146_0x5622=function(){return _0x8a7221;};return a146_0x5622();}function validateStagesForVersion(_0x43c602,_0x425ef1,_0x48b603,_0x4e3250,_0xb0b51d,_0x594a7a,_0x20fd25){const _0x281df8=a146_0x5c22;if(_0x43c602[_0x281df8(0x20e)]===0x0){_0xb0b51d['push']({'level':'error','path':_0x4e3250+_0x281df8(0x21e),'code':_0x281df8(0x1e9),'message':_0x281df8(0x28d),'location':getLocationFromPath(_0x48b603['document'],_0x48b603[_0x281df8(0x214)],[_0x281df8(0x21e)])});return;}const _0xb6cc3c=new Set();for(const _0x15c56b of _0x43c602){if(_0x15c56b[_0x281df8(0x235)])for(const _0x2f7579 of _0x15c56b[_0x281df8(0x235)]){_0x2f7579[_0x281df8(0x215)]&&_0xb6cc3c[_0x281df8(0x1ef)](_0x2f7579['name']);}}const _0x467c58={..._0x48b603,'stepNames':_0xb6cc3c},_0x4a4ceb=validateVersionStructure(_0x43c602,_0x467c58);for(const _0x56ebaf of _0x4a4ceb){const _0x2b05a4=_0x4e3250?{..._0x56ebaf,'path':''+_0x4e3250+_0x56ebaf[_0x281df8(0x1f9)]}:_0x56ebaf;if(_0x2b05a4[_0x281df8(0x23e)]===_0x281df8(0x228))_0xb0b51d[_0x281df8(0x1dd)](_0x2b05a4);else _0x594a7a['push'](_0x2b05a4);}for(let _0x3cab3e=0x0;_0x3cab3e<_0x43c602['length'];_0x3cab3e++){const _0x50854a=validateStage(_0x43c602[_0x3cab3e],_0x3cab3e,_0x43c602[_0x281df8(0x20e)],_0x467c58);for(const _0x32f2e8 of _0x50854a){const _0x1c2e30=_0x4e3250?{..._0x32f2e8,'path':''+_0x4e3250+_0x32f2e8[_0x281df8(0x1f9)]}:_0x32f2e8;if(_0x1c2e30[_0x281df8(0x23e)]==='error')_0xb0b51d[_0x281df8(0x1dd)](_0x1c2e30);else _0x594a7a[_0x281df8(0x1dd)](_0x1c2e30);}}if(_0x425ef1[_0x281df8(0x247)]){const _0x4162f7=_0x20fd25?.[_0x281df8(0x272)]?'goal':_0x4e3250+'goal',_0x173da3=validateCriteria(_0x425ef1[_0x281df8(0x247)],_0x4162f7,_0x467c58);for(const _0xb1322e of _0x173da3){if(_0xb1322e['level']===_0x281df8(0x228))_0xb0b51d['push'](_0xb1322e);else _0x594a7a[_0x281df8(0x1dd)](_0xb1322e);}}}function extractVersionIndex(_0x516055){const _0x3578ae=a146_0x5c22,_0x15aacb=_0x516055[_0x3578ae(0x22d)](/^journeys\[(\d+)\]\./);return _0x15aacb?_0x15aacb[0x1]:undefined;}function deduplicateAcrossVersions(_0x96b239){const _0x546215=a146_0x5c22,_0x57beb1=new Map();for(let _0x13e8a3=0x0;_0x13e8a3<_0x96b239['length'];_0x13e8a3++){const _0x3cb360=_0x96b239[_0x13e8a3]['code']+':'+_0x96b239[_0x13e8a3]['message'],_0x4ee905=extractVersionIndex(_0x96b239[_0x13e8a3][_0x546215(0x1f9)]),_0x503425=_0x57beb1[_0x546215(0x26c)](_0x3cb360);if(_0x503425){_0x503425[_0x546215(0x211)][_0x546215(0x1dd)](_0x13e8a3);if(_0x4ee905)_0x503425[_0x546215(0x271)][_0x546215(0x1ef)](_0x4ee905);}else _0x57beb1[_0x546215(0x267)](_0x3cb360,{'indices':[_0x13e8a3],'versions':new Set(_0x4ee905?[_0x4ee905]:[])});}const _0x3a0f3b=new Set();for(const {indices:_0x5e393c,versions:_0x4c3052}of _0x57beb1[_0x546215(0x24d)]()){if(_0x4c3052[_0x546215(0x1fe)]<=0x1)continue;const _0x4b3d6f=_0x96b239[_0x5e393c[0x0]];_0x4b3d6f['path']=_0x4b3d6f[_0x546215(0x1f9)]['replace'](/^journeys\[\d+\]\./,''),_0x4b3d6f['message']=_0x4b3d6f[_0x546215(0x22e)]+'\x20(across\x20'+_0x4c3052['size']+_0x546215(0x23b);for(let _0x313145=0x1;_0x313145<_0x5e393c[_0x546215(0x20e)];_0x313145++){_0x3a0f3b[_0x546215(0x1ef)](_0x5e393c[_0x313145]);}}const _0xe8e20a=[..._0x3a0f3b][_0x546215(0x24f)]((_0x49fbfb,_0x5e8718)=>_0x5e8718-_0x49fbfb);for(const _0x56dc5d of _0xe8e20a){_0x96b239['splice'](_0x56dc5d,0x1);}}function a146_0x5c22(_0x3a2383,_0x1ceb5d){_0x3a2383=_0x3a2383-0x1db;const _0x56229d=a146_0x5622();let _0x5c2232=_0x56229d[_0x3a2383];return _0x5c2232;}export function validateJourneyDef(_0x53c281,_0x3c62db={},_0x3b5576={}){const _0x137513=a146_0x5c22;if(_0x3b5576[_0x137513(0x248)])return runJourneySemanticChecks(_0x53c281,_0x3c62db);const _0x4d6ef9=JourneyDefSchema['safeParse'](_0x53c281);if(_0x4d6ef9[_0x137513(0x240)])return runJourneySemanticChecks(_0x4d6ef9[_0x137513(0x20b)],_0x3c62db);return zodErrorsToJourneyValidationResult(_0x4d6ef9[_0x137513(0x228)],_0x3c62db);}function zodErrorsToJourneyValidationResult(_0x19d7e8,_0x233758){const _0x51f1db=a146_0x5c22,_0x5b687=flattenZodIssues(_0x19d7e8['issues']),_0xb87d50=_0x5b687[_0x51f1db(0x26d)](_0x414323=>{const _0x21d489=_0x51f1db,_0x529eed=formatZodPath(_0x414323[_0x21d489(0x1f9)]),_0x51e20e=mapJourneyZodIssueToCode(_0x414323,_0x529eed),_0x1d95eb=getLocationFromPath(_0x233758['document'],_0x233758[_0x21d489(0x214)],_0x414323[_0x21d489(0x1f9)][_0x21d489(0x26d)](_0x34be35=>typeof _0x34be35==='symbol'?String(_0x34be35):_0x34be35));return{'level':_0x21d489(0x228),'path':_0x529eed,'code':_0x51e20e,'message':_0x414323['message'],..._0x1d95eb&&{'location':_0x1d95eb}};});return{'valid':![],'errors':_0xb87d50,'warnings':[]};}function mapJourneyZodIssueToCode(_0x3497a2,_0x524bf9){const _0x3b607f=a146_0x5c22;if(_0x524bf9===_0x3b607f(0x215))return _0x3b607f(0x1e7);if(_0x524bf9[_0x3b607f(0x277)](_0x3b607f(0x21b))&&_0x524bf9[_0x3b607f(0x22b)](_0x3b607f(0x235)))return'JOURNEY_SCHEMA_ERROR';if(_0x524bf9===_0x3b607f(0x21e)||_0x524bf9[_0x3b607f(0x277)]('.stages'))return _0x3b607f(0x1e9);if(_0x524bf9===''&&_0x3497a2[_0x3b607f(0x22e)][_0x3b607f(0x22b)](_0x3b607f(0x1fa)))return _0x3b607f(0x1e9);if(_0x524bf9[_0x3b607f(0x22b)](_0x3b607f(0x24e)))return _0x3b607f(0x21c);return _0x3b607f(0x246);}function runJourneySemanticChecks(_0xb1b23b,_0x52074f){const _0x17281d=a146_0x5c22,_0xb960b1=[],_0x4dbfc8=[];(!_0xb1b23b['name']||_0xb1b23b[_0x17281d(0x215)][_0x17281d(0x258)]()==='')&&_0xb960b1[_0x17281d(0x1dd)]({'level':'error','path':_0x17281d(0x215),'code':'MISSING_NAME','message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x52074f['document'],_0x52074f[_0x17281d(0x214)],[_0x17281d(0x215)])});const _0x10ece0=new Set();if(_0xb1b23b[_0x17281d(0x250)])for(const _0x387e24 of Object[_0x17281d(0x25e)](_0xb1b23b[_0x17281d(0x250)])){_0x10ece0[_0x17281d(0x1ef)](_0x387e24);}const _0x2e9443=new Set();if(_0xb1b23b[_0x17281d(0x28c)])for(const _0x17d40b of Object['keys'](_0xb1b23b[_0x17281d(0x28c)])){_0x2e9443[_0x17281d(0x1ef)](_0x17d40b);}const _0x600b30=new Set(),_0x69cc78={..._0x52074f,'embeddedSegments':_0x10ece0,'referencedSegments':_0x600b30,'activationKeys':_0x2e9443[_0x17281d(0x1fe)]>0x0?_0x2e9443:undefined};if(_0xb1b23b['segments'])for(const [_0x5c6d75,_0x54cd0a]of Object[_0x17281d(0x268)](_0xb1b23b[_0x17281d(0x250)])){const _0x81906a=validateEmbeddedSegment(_0x54cd0a,_0x17281d(0x24b)+_0x5c6d75,_0x69cc78);for(const _0x3c44e4 of _0x81906a){if(_0x3c44e4['level']==='error')_0xb960b1[_0x17281d(0x1dd)](_0x3c44e4);else _0x4dbfc8[_0x17281d(0x1dd)](_0x3c44e4);}}const _0x1878e2=!!_0xb1b23b[_0x17281d(0x247)],_0x316530=_0xb1b23b[_0x17281d(0x226)]?.[_0x17281d(0x1f5)](_0x3bdba9=>!!_0x3bdba9['goal'])??![];!_0x1878e2&&!_0x316530&&_0x4dbfc8[_0x17281d(0x1dd)]({'level':_0x17281d(0x264),'path':_0x17281d(0x247),'code':'MISSING_GOAL','message':_0x17281d(0x25d),'location':getLocationFromPath(_0x52074f[_0x17281d(0x27b)],_0x52074f['source'],[_0x17281d(0x247)])});const _0x5df0b7=_0xb1b23b[_0x17281d(0x226)]??_0xb1b23b[_0x17281d(0x271)];if(_0x5df0b7&&_0x5df0b7['filter'](_0x4911dd=>_0x4911dd[_0x17281d(0x1df)]===!![])[_0x17281d(0x20e)]>0x1){const _0x42983e=_0xb1b23b[_0x17281d(0x226)]?_0x17281d(0x226):_0x17281d(0x271);_0xb960b1[_0x17281d(0x1dd)]({'level':_0x17281d(0x228),'path':_0x42983e,'code':_0x17281d(0x230),'message':_0x17281d(0x232)+(_0x42983e===_0x17281d(0x226)?_0x17281d(0x281):'version')+_0x17281d(0x276),'location':getLocationFromPath(_0x52074f[_0x17281d(0x27b)],_0x52074f[_0x17281d(0x214)],[_0x42983e])});}if(_0xb1b23b[_0x17281d(0x226)]&&_0xb1b23b[_0x17281d(0x226)][_0x17281d(0x20e)]>0x0)for(let _0x492c55=0x0;_0x492c55<_0xb1b23b['journeys']['length'];_0x492c55++){const _0x52b1ae=_0xb1b23b[_0x17281d(0x226)][_0x492c55];if(_0xb1b23b[_0x17281d(0x226)]['length']>0x1&&_0x52b1ae['state']===_0x17281d(0x234))continue;const _0x516e54=_0x52b1ae[_0x17281d(0x21e)]||[],_0x1482c7=_0x17281d(0x238)+_0x492c55+'].',_0x3b6253=!!_0x52b1ae[_0x17281d(0x247)],_0x47d1ff=_0x3b6253?{..._0xb1b23b,'goal':_0x52b1ae[_0x17281d(0x247)]}:_0xb1b23b;validateStagesForVersion(_0x516e54,_0x47d1ff,_0x69cc78,_0x1482c7,_0xb960b1,_0x4dbfc8,{'goalIsInherited':!_0x3b6253});}else{if(_0xb1b23b[_0x17281d(0x271)]&&_0xb1b23b['versions'][_0x17281d(0x20e)]>0x0)for(let _0x167046=0x0;_0x167046<_0xb1b23b[_0x17281d(0x271)][_0x17281d(0x20e)];_0x167046++){const _0x448081=_0xb1b23b[_0x17281d(0x271)][_0x167046];if(_0xb1b23b['versions'][_0x17281d(0x20e)]>0x1&&_0x448081[_0x17281d(0x251)]===_0x17281d(0x234))continue;const _0x40c14f=_0x448081[_0x17281d(0x21e)]||[],_0x1d7a97='versions['+_0x167046+'].';validateStagesForVersion(_0x40c14f,_0xb1b23b,_0x69cc78,_0x1d7a97,_0xb960b1,_0x4dbfc8);}else{const _0x51aba8=_0xb1b23b[_0x17281d(0x21e)]||[];validateStagesForVersion(_0x51aba8,_0xb1b23b,_0x69cc78,'',_0xb960b1,_0x4dbfc8);}}_0xb1b23b[_0x17281d(0x226)]&&_0xb1b23b[_0x17281d(0x226)][_0x17281d(0x20e)]>0x1&&(deduplicateAcrossVersions(_0xb960b1),deduplicateAcrossVersions(_0x4dbfc8));for(const _0x24f5d3 of _0x10ece0){!_0x600b30[_0x17281d(0x280)](_0x24f5d3)&&!_0x24f5d3[_0x17281d(0x284)]('excluded_')&&_0x4dbfc8['push']({'level':_0x17281d(0x264),'path':_0x17281d(0x24b)+_0x24f5d3,'code':_0x17281d(0x25a),'message':_0x17281d(0x1f4)+_0x24f5d3+_0x17281d(0x283),'location':getLocationFromPath(_0x52074f[_0x17281d(0x27b)],_0x52074f['source'],['segments',_0x24f5d3])});}return{'valid':_0xb960b1[_0x17281d(0x20e)]===0x0,'errors':_0xb960b1,'warnings':_0x4dbfc8};}
|
|
1
|
+
(function(_0x3a8e1d,_0x2585d2){const _0x1a005e=a146_0x13e4,_0x3b6d50=_0x3a8e1d();while(!![]){try{const _0x15a9fb=parseInt(_0x1a005e(0x1e4))/0x1*(parseInt(_0x1a005e(0x191))/0x2)+parseInt(_0x1a005e(0x1d5))/0x3+parseInt(_0x1a005e(0x1ed))/0x4+-parseInt(_0x1a005e(0x20c))/0x5*(-parseInt(_0x1a005e(0x20b))/0x6)+-parseInt(_0x1a005e(0x1ca))/0x7*(-parseInt(_0x1a005e(0x21e))/0x8)+-parseInt(_0x1a005e(0x23b))/0x9+parseInt(_0x1a005e(0x1c4))/0xa*(-parseInt(_0x1a005e(0x1f3))/0xb);if(_0x15a9fb===_0x2585d2)break;else _0x3b6d50['push'](_0x3b6d50['shift']());}catch(_0x10dfea){_0x3b6d50['push'](_0x3b6d50['shift']());}}}(a146_0x1513,0xbda82));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function a146_0x1513(){const _0x2530f9=['launched','branch\x20\x27','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','variants','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','INVALID_AB_TEST_PERCENTAGES','Stage\x20\x27','Duplicate\x20step\x20name\x20\x27','INVALID_JUMP_TARGET','MISSING_SEGMENT_REFERENCE','length','MISSING_ACTIVATION_DEFINITION','version','startsWith','embeddedSegments','keys','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','condition','abs','\x27\x20of\x20\x27','MISSING_ACTIVATION_REF','.with.condition.segment','ref:','.with.branches','Embedded\x20segment\x20\x27','goalIsInherited','MISSING_WAIT_PARAMS','\x27\x20with\x20no\x20action\x20in\x20between','values','set','rule','Decision\x20branch\x20\x27','.steps[','Criteria\x20references\x20undefined\x20segment\x20\x27','exit_criteria','\x20(across\x20','name','19223540cQanFk','steps','ACTIVATION_SCHEMA_ERROR','path','segments','\x27\x20(from:\x20','9315733AljqAn','has','splice','journey','.with.activation','endsWith','some','Step\x20references\x20non-existent\x20step\x20\x27','\x20with\x20latest:\x20true','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','2365287DGMXKs','FEW_STEPS','MISSING_STAGES','timeout','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','replace','.with','INVALID_NEXT_REFERENCE','MISSING_NAME','reduce','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','entry_criteria','state','error','2182Ylbbnf','Jump\x20step\x20requires\x20a\x20target','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','level','Journey\x20name\x20is\x20required','.segment','UNUSED_EMBEDDED_SEGMENT','\x27\x20has\x20no\x20steps','activation','4812008cYNSjo','\x27\x20(first\x20defined\x20at\x20steps[','add','stage','push','.with.branches[','22Bchdsn','timeout\x20of\x20\x27','merge','MISSING_MILESTONE','decision_point','End\x20step\x20\x27','message','SINGLE_INPUT_MERGE','sort','INSUFFICIENT_STEPS','activationKeys','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','\x27\x20has\x20only\x20','JOURNEY_SCHEMA_ERROR','source','DUPLICATE_STEP_NAME','step\x20\x27','.entry_criteria','.milestone','.exit_criteria','versions','journeys','Merge\x20step\x20\x27','symbol','2301336cWadRi','15bBGIcD','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','skipSchema','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.next','referencedSegments','warning','CONVERGENCE_WITHOUT_MERGE','MISSING_END_STEP','goal','excluded','journeys[','get','segment','MISSING_EXIT_CRITERIA','latest','segments.','issues','8BxdLYH','Activation\x20step\x20requires\x20an\x20activation\x20reference','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','MISSING_GOAL','.stages','milestone','document','activations','.with.target','journeys,\x20stages,\x20or\x20versions','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','wait','includes','.steps','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','END_STEP_HAS_NEXT_OR_WITH','.with.condition.timeout.next','stepNames','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','safeParse','MISSING_CONDITIONS','size','\x27\x20has\x20no\x20end\x20step','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',').\x20Merge\x20is\x20unnecessary.','join','end','.type','data','3041658NXVoyu','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','type','entries','.with.condition','stages','branches','jump','filter','next','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','446BiFhpy','.with.condition.next','target','BRANCH_DIRECTLY_TO_MERGE','\x20stages\x20but\x20maximum\x20is\x20','TOO_MANY_STAGES','with','.rule','ab_test','variant\x20\x27','stages[','condition\x20of\x20\x27','map'];a146_0x1513=function(){return _0x2530f9;};return a146_0x1513();}function createIssue(_0x5f2e9d,_0x2e66de,_0x282c1d,_0x3b2a7a,_0x495e19,_0x7c0421){const _0x1b46ed=a146_0x13e4;return{'level':_0x5f2e9d,'path':_0x2e66de,'code':_0x282c1d,'message':_0x3b2a7a,'location':getLocationFromPath(_0x495e19[_0x1b46ed(0x224)],_0x495e19['source'],pathToArray(_0x7c0421??_0x2e66de))};}function validateVersionStructure(_0x2df7d7,_0x5b56a9){const _0x5e2c93=a146_0x13e4,_0x5d4107=[];return _0x2df7d7[_0x5e2c93(0x1a8)]>MAX_STAGES&&_0x5d4107[_0x5e2c93(0x1f1)](createIssue(_0x5e2c93(0x1e3),_0x5e2c93(0x18b),_0x5e2c93(0x196),'Journey\x20has\x20'+_0x2df7d7[_0x5e2c93(0x1a8)]+_0x5e2c93(0x195)+MAX_STAGES,_0x5b56a9)),_0x5d4107;}function validateStageStructure(_0x156df4,_0x4d3867,_0x3a1cd4,_0x1d7172){const _0x4961f4=a146_0x13e4,_0x3e181f=[],_0x25e0fc=_0x4961f4(0x19b)+_0x4d3867+']';_0x4d3867===0x0&&!_0x156df4[_0x4961f4(0x1e1)]&&_0x3e181f[_0x4961f4(0x1f1)](createIssue('error',_0x25e0fc+'.entry_criteria','MISSING_ENTRY_CRITERIA',_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x1d7172,_0x25e0fc));const _0xb98e6c=_0x4d3867===_0x3a1cd4-0x1;!_0xb98e6c&&!_0x156df4[_0x4961f4(0x223)]&&_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x1e3),_0x25e0fc+_0x4961f4(0x205),_0x4961f4(0x1f6),_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1a0),_0x1d7172,_0x25e0fc));(!_0x156df4['exit_criteria']||_0x156df4[_0x4961f4(0x1c1)][_0x4961f4(0x1a8)]===0x0)&&_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x206),_0x4961f4(0x21a),_0x4961f4(0x1a4)+_0x156df4['name']+'\x27\x20has\x20no\x20exit_criteria\x20defined',_0x1d7172,_0x25e0fc));const _0xf3eb9c=_0x156df4[_0x4961f4(0x1c5)]?.[_0x4961f4(0x1a8)]??0x0;if(_0xf3eb9c===0x0)_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x1e3),_0x25e0fc+_0x4961f4(0x22b),_0x4961f4(0x1fc),'Stage\x20\x27'+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1eb),_0x1d7172,_0x25e0fc+_0x4961f4(0x22b)));else{if(_0xf3eb9c===0x1)_0x3e181f[_0x4961f4(0x1f1)](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x22b),'INSUFFICIENT_STEPS',_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x23d),_0x1d7172,_0x25e0fc+'.steps'));else _0xf3eb9c<=0x3&&_0x3e181f['push'](createIssue(_0x4961f4(0x212),_0x25e0fc+_0x4961f4(0x22b),_0x4961f4(0x1d6),_0x4961f4(0x1a4)+_0x156df4[_0x4961f4(0x1c3)]+_0x4961f4(0x1ff)+_0xf3eb9c+'\x20steps\x20(may\x20be\x20too\x20simple)',_0x1d7172,_0x25e0fc+'.steps'));}return _0x3e181f;}function validateStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a){const _0x4cf71b=a146_0x13e4,_0x565ddd=[];if(_0x356637[_0x4cf71b(0x188)]===_0x4cf71b(0x238))return _0x356637[_0x4cf71b(0x18f)]&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue('error',_0x225fde+_0x4cf71b(0x210),_0x4cf71b(0x22d),_0x4cf71b(0x1f8)+_0x356637[_0x4cf71b(0x1c3)]+_0x4cf71b(0x20f),_0x42b51e)),_0x4cf71b(0x197)in _0x356637&&_0x356637[_0x4cf71b(0x197)]!==undefined&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue(_0x4cf71b(0x1e3),_0x225fde+_0x4cf71b(0x1dc),_0x4cf71b(0x22d),'End\x20step\x20\x27'+_0x356637['name']+_0x4cf71b(0x228),_0x42b51e)),_0x565ddd;_0x356637[_0x4cf71b(0x18f)]&&(_0x42b51e[_0x4cf71b(0x22f)]&&!_0x42b51e['stepNames'][_0x4cf71b(0x1cb)](_0x356637[_0x4cf71b(0x18f)])&&_0x565ddd[_0x4cf71b(0x1f1)](createIssue('error',_0x225fde+_0x4cf71b(0x210),'INVALID_NEXT_REFERENCE',_0x4cf71b(0x1d1)+_0x356637[_0x4cf71b(0x18f)]+'\x27',_0x42b51e)));switch(_0x356637[_0x4cf71b(0x188)]){case _0x4cf71b(0x229):_0x565ddd[_0x4cf71b(0x1f1)](...validateWaitStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x1ec):_0x565ddd[_0x4cf71b(0x1f1)](...validateActivationStep(_0x356637,_0x225fde,_0x42b51e));break;case _0x4cf71b(0x1f7):_0x565ddd['push'](...validateDecisionPointStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x199):_0x565ddd[_0x4cf71b(0x1f1)](...validateAbTestStep(_0x356637,_0x225fde,_0x42b51e,_0x29383a));break;case _0x4cf71b(0x18d):_0x565ddd['push'](...validateJumpStep(_0x356637,_0x225fde,_0x42b51e));break;}return _0x565ddd;}function validateWaitStep(_0x167cbd,_0x31f3ce,_0x449895,_0x2a9e36){const _0x539f68=a146_0x13e4,_0x4987d8=[];if(!_0x167cbd[_0x539f68(0x197)])return _0x4987d8['push'](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x1dc),_0x539f68(0x1b9),_0x539f68(0x187),_0x449895,_0x31f3ce)),_0x4987d8;if(_0x167cbd[_0x539f68(0x197)]['condition']){const _0x75a963=_0x167cbd[_0x539f68(0x197)][_0x539f68(0x1b0)];if(_0x75a963[_0x539f68(0x219)]){_0x449895['referencedSegments']?.[_0x539f68(0x1ef)](_0x75a963[_0x539f68(0x219)]);!_0x75a963[_0x539f68(0x219)]['startsWith'](_0x539f68(0x1b5))&&(_0x449895[_0x539f68(0x1ac)]&&!_0x449895[_0x539f68(0x1ac)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x219)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x1b4),_0x539f68(0x1a7),'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x75a963[_0x539f68(0x219)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.',_0x449895)));_0x75a963[_0x539f68(0x18f)]&&_0x449895[_0x539f68(0x22f)]&&!_0x449895[_0x539f68(0x22f)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x18f)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x1e3),_0x31f3ce+_0x539f68(0x192),'INVALID_NEXT_REFERENCE','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x75a963[_0x539f68(0x18f)]+'\x27',_0x449895));_0x75a963[_0x539f68(0x1d8)]?.['next']&&_0x449895[_0x539f68(0x22f)]&&!_0x449895[_0x539f68(0x22f)][_0x539f68(0x1cb)](_0x75a963[_0x539f68(0x1d8)][_0x539f68(0x18f)])&&_0x4987d8[_0x539f68(0x1f1)](createIssue('error',_0x31f3ce+'.with.condition.timeout.next',_0x539f68(0x1dd),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x75a963[_0x539f68(0x1d8)][_0x539f68(0x18f)]+'\x27',_0x449895));const _0xe552e4=_0x75a963[_0x539f68(0x18f)]||_0x167cbd['next'],_0x40b5d1=_0x75a963[_0x539f68(0x1d8)]?.['next']||_0x167cbd[_0x539f68(0x18f)];if(_0xe552e4){const _0xd2eb62=_0x2a9e36[_0x539f68(0x218)](_0xe552e4);_0xd2eb62?.[_0x539f68(0x188)]==='merge'&&_0x4987d8['push'](createIssue(_0x539f68(0x212),_0x31f3ce+'.with.condition.next',_0x539f68(0x194),_0x539f68(0x1af)+_0xe552e4+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x449895,_0x31f3ce+_0x539f68(0x18a)));}if(_0x40b5d1){const _0x315968=_0x2a9e36[_0x539f68(0x218)](_0x40b5d1);_0x315968?.[_0x539f68(0x188)]===_0x539f68(0x1f5)&&_0x4987d8[_0x539f68(0x1f1)](createIssue(_0x539f68(0x212),_0x31f3ce+_0x539f68(0x22e),'BRANCH_DIRECTLY_TO_MERGE',_0x539f68(0x1d9)+_0x40b5d1+_0x539f68(0x22c),_0x449895,_0x31f3ce+'.with.condition.timeout'));}}}return _0x4987d8;}function validateActivationStep(_0x892c39,_0x5bc3d8,_0x4c714f){const _0x20ac3c=a146_0x13e4,_0x46d3cc=[];if(!_0x892c39[_0x20ac3c(0x197)]?.[_0x20ac3c(0x1ec)])return _0x46d3cc[_0x20ac3c(0x1f1)](createIssue('error',_0x5bc3d8+'.with.activation',_0x20ac3c(0x1b3),_0x20ac3c(0x21f),_0x4c714f,_0x5bc3d8)),_0x46d3cc;const _0x5dfeec=_0x892c39[_0x20ac3c(0x197)]['activation'];return _0x4c714f['activationKeys']&&!_0x5dfeec[_0x20ac3c(0x1ab)](_0x20ac3c(0x1b5))&&(!_0x4c714f[_0x20ac3c(0x1fd)][_0x20ac3c(0x1cb)](_0x5dfeec)&&_0x46d3cc[_0x20ac3c(0x1f1)](createIssue(_0x20ac3c(0x1e3),_0x5bc3d8+_0x20ac3c(0x1ce),_0x20ac3c(0x1a9),_0x20ac3c(0x1d4)+_0x5dfeec+_0x20ac3c(0x1a2),_0x4c714f))),_0x46d3cc;}function validateDecisionPointStep(_0x158770,_0x456aa4,_0x37682f,_0x5a568e){const _0x59e4b6=a146_0x13e4,_0x4e108b=[];if(!_0x158770[_0x59e4b6(0x197)]?.[_0x59e4b6(0x18c)]||_0x158770[_0x59e4b6(0x197)]['branches'][_0x59e4b6(0x1a8)]===0x0)return _0x4e108b[_0x59e4b6(0x1f1)](createIssue(_0x59e4b6(0x1e3),_0x456aa4+_0x59e4b6(0x1b6),_0x59e4b6(0x232),_0x59e4b6(0x1ae),_0x37682f,_0x456aa4)),_0x4e108b;for(let _0x265d89=0x0;_0x265d89<_0x158770[_0x59e4b6(0x197)]['branches'][_0x59e4b6(0x1a8)];_0x265d89++){const _0x1b5d2b=_0x158770['with'][_0x59e4b6(0x18c)][_0x265d89],_0x4351f8=_0x456aa4+_0x59e4b6(0x1f2)+_0x265d89+']';_0x1b5d2b[_0x59e4b6(0x219)]&&!_0x1b5d2b[_0x59e4b6(0x216)]&&(_0x37682f[_0x59e4b6(0x211)]?.[_0x59e4b6(0x1ef)](_0x1b5d2b[_0x59e4b6(0x219)]),!_0x1b5d2b[_0x59e4b6(0x219)][_0x59e4b6(0x1ab)](_0x59e4b6(0x1b5))&&(_0x37682f['embeddedSegments']&&!_0x37682f['embeddedSegments'][_0x59e4b6(0x1cb)](_0x1b5d2b[_0x59e4b6(0x219)])&&_0x4e108b['push'](createIssue(_0x59e4b6(0x1e3),_0x4351f8+_0x59e4b6(0x1e9),'MISSING_SEGMENT_REFERENCE',_0x59e4b6(0x230)+_0x1b5d2b[_0x59e4b6(0x219)]+'\x27',_0x37682f))));_0x1b5d2b[_0x59e4b6(0x18f)]&&_0x37682f[_0x59e4b6(0x22f)]&&!_0x37682f['stepNames']['has'](_0x1b5d2b[_0x59e4b6(0x18f)])&&_0x4e108b['push'](createIssue(_0x59e4b6(0x1e3),_0x4351f8+_0x59e4b6(0x210),'INVALID_NEXT_REFERENCE','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x1b5d2b[_0x59e4b6(0x18f)]+'\x27',_0x37682f));if(_0x1b5d2b[_0x59e4b6(0x18f)]){const _0xc9de6b=_0x5a568e['get'](_0x1b5d2b[_0x59e4b6(0x18f)]);_0xc9de6b?.['type']===_0x59e4b6(0x1f5)&&_0x4e108b[_0x59e4b6(0x1f1)](createIssue(_0x59e4b6(0x212),_0x4351f8+_0x59e4b6(0x210),_0x59e4b6(0x194),_0x59e4b6(0x1be)+_0x1b5d2b[_0x59e4b6(0x1c3)]+_0x59e4b6(0x1d3)+_0x1b5d2b[_0x59e4b6(0x18f)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x37682f));}}return _0x4e108b;}function validateAbTestStep(_0x25eba2,_0x5d2449,_0x3cafcf,_0xe9fb6a){const _0x14d217=a146_0x13e4,_0x12e24e=[];if(!_0x25eba2['with']?.[_0x14d217(0x1a1)]||_0x25eba2[_0x14d217(0x197)]['variants'][_0x14d217(0x1a8)]===0x0)return _0x12e24e['push'](createIssue('error',_0x5d2449+'.with.variants',_0x14d217(0x232),'A/B\x20test\x20requires\x20at\x20least\x20one\x20variant',_0x3cafcf,_0x5d2449)),_0x12e24e;const _0x249553=_0x25eba2[_0x14d217(0x197)][_0x14d217(0x1a1)][_0x14d217(0x1df)]((_0x58d0c5,_0xb77f87)=>_0x58d0c5+(_0xb77f87['percentage']||0x0),0x0);Math[_0x14d217(0x1b1)](_0x249553-0x64)>0.01&&_0x12e24e[_0x14d217(0x1f1)](createIssue('error',_0x5d2449+'.with.variants',_0x14d217(0x1a3),_0x14d217(0x190)+_0x249553+'%)',_0x3cafcf));for(let _0x267dd4=0x0;_0x267dd4<_0x25eba2['with'][_0x14d217(0x1a1)]['length'];_0x267dd4++){const _0xd7fb51=_0x25eba2[_0x14d217(0x197)]['variants'][_0x267dd4],_0x5aba97=_0x5d2449+'.with.variants['+_0x267dd4+']';_0xd7fb51[_0x14d217(0x18f)]&&_0x3cafcf[_0x14d217(0x22f)]&&!_0x3cafcf[_0x14d217(0x22f)][_0x14d217(0x1cb)](_0xd7fb51['next'])&&_0x12e24e['push'](createIssue(_0x14d217(0x1e3),_0x5aba97+_0x14d217(0x210),_0x14d217(0x1dd),_0x14d217(0x1da)+_0xd7fb51['next']+'\x27',_0x3cafcf));if(_0xd7fb51[_0x14d217(0x18f)]){const _0x322152=_0xe9fb6a[_0x14d217(0x218)](_0xd7fb51[_0x14d217(0x18f)]);_0x322152?.[_0x14d217(0x188)]==='merge'&&_0x12e24e[_0x14d217(0x1f1)](createIssue(_0x14d217(0x212),_0x5aba97+_0x14d217(0x210),_0x14d217(0x194),'A/B\x20test\x20variant\x20\x27'+_0xd7fb51['name']+_0x14d217(0x1d3)+_0xd7fb51['next']+_0x14d217(0x1ba),_0x3cafcf));}}return _0x12e24e;}function validateJumpStep(_0x5cbfe6,_0x4f7fcf,_0x55cea4){const _0x216322=a146_0x13e4,_0x1779f0=[];if(!_0x5cbfe6[_0x216322(0x197)]?.[_0x216322(0x193)])return _0x1779f0[_0x216322(0x1f1)](createIssue(_0x216322(0x1e3),_0x4f7fcf+'.with.target',_0x216322(0x1a6),_0x216322(0x1e5),_0x55cea4,_0x4f7fcf)),_0x1779f0;return(!_0x5cbfe6[_0x216322(0x197)][_0x216322(0x193)][_0x216322(0x1cd)]||!_0x5cbfe6[_0x216322(0x197)][_0x216322(0x193)][_0x216322(0x1f0)])&&_0x1779f0[_0x216322(0x1f1)](createIssue(_0x216322(0x1e3),_0x4f7fcf+_0x216322(0x226),'INVALID_JUMP_TARGET',_0x216322(0x235),_0x55cea4)),_0x1779f0;}function buildConvergenceMap(_0x16ce01){const _0x5402bf=a146_0x13e4,_0x2d0f0f=new Map();function _0x492627(_0x52a920,_0x16453e){const _0x36d891=a146_0x13e4,_0x57e5e0=_0x2d0f0f[_0x36d891(0x218)](_0x52a920)||[];_0x57e5e0[_0x36d891(0x1f1)](_0x16453e),_0x2d0f0f[_0x36d891(0x1bc)](_0x52a920,_0x57e5e0);}for(const _0x43db20 of _0x16ce01){_0x43db20[_0x5402bf(0x18f)]&&_0x492627(_0x43db20[_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x203)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});if(_0x43db20['type']===_0x5402bf(0x1f7)&&_0x43db20[_0x5402bf(0x197)]?.['branches'])for(const _0x54842f of _0x43db20[_0x5402bf(0x197)]['branches']){_0x54842f[_0x5402bf(0x18f)]&&_0x492627(_0x54842f[_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19f)+_0x54842f[_0x5402bf(0x1c3)]+_0x5402bf(0x1b2)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});}if(_0x43db20[_0x5402bf(0x188)]===_0x5402bf(0x199)&&_0x43db20[_0x5402bf(0x197)]?.[_0x5402bf(0x1a1)])for(const _0x10f547 of _0x43db20[_0x5402bf(0x197)]['variants']){_0x10f547[_0x5402bf(0x18f)]&&_0x492627(_0x10f547['next'],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19a)+_0x10f547[_0x5402bf(0x1c3)]+'\x27\x20of\x20\x27'+_0x43db20[_0x5402bf(0x1c3)]+'\x27'});}_0x43db20[_0x5402bf(0x188)]===_0x5402bf(0x229)&&_0x43db20['with']?.[_0x5402bf(0x1b0)]&&(_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)][_0x5402bf(0x18f)]&&_0x492627(_0x43db20['with']['condition'][_0x5402bf(0x18f)],{'stepName':_0x43db20[_0x5402bf(0x1c3)],'description':_0x5402bf(0x19c)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'}),_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)]['timeout']?.[_0x5402bf(0x18f)]&&_0x492627(_0x43db20[_0x5402bf(0x197)][_0x5402bf(0x1b0)][_0x5402bf(0x1d8)]['next'],{'stepName':_0x43db20['name'],'description':_0x5402bf(0x1f4)+_0x43db20[_0x5402bf(0x1c3)]+'\x27'}));}return _0x2d0f0f;}function a146_0x13e4(_0x16eac6,_0x53221e){_0x16eac6=_0x16eac6-0x187;const _0x151379=a146_0x1513();let _0x13e49e=_0x151379[_0x16eac6];return _0x13e49e;}function validateFlowControl(_0xde982b,_0x1ac113,_0x26d74b){const _0x3b30bb=a146_0x13e4,_0x55b828=[],_0x5eb467='stages['+_0x1ac113+']',_0x1fa47b=_0xde982b['steps']||[];if(_0x1fa47b[_0x3b30bb(0x1a8)]===0x0)return _0x55b828;const _0x574e21=new Map();for(const _0x384606 of _0x1fa47b){_0x384606[_0x3b30bb(0x1c3)]&&_0x574e21[_0x3b30bb(0x1bc)](_0x384606[_0x3b30bb(0x1c3)],_0x384606);}const _0x176565=buildConvergenceMap(_0x1fa47b),_0x195a5e=_0x1fa47b[_0x3b30bb(0x1d0)](_0x1b3855=>_0x1b3855[_0x3b30bb(0x188)]==='end');!_0x195a5e&&_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+_0x3b30bb(0x22b),_0x3b30bb(0x214),'Stage\x20\x27'+_0xde982b[_0x3b30bb(0x1c3)]+_0x3b30bb(0x234),_0x26d74b));for(const [_0x17add3,_0x332986]of _0x176565){const _0x721eb=_0x574e21['get'](_0x17add3);if(!_0x721eb)continue;if(_0x332986[_0x3b30bb(0x1a8)]>0x1&&_0x721eb[_0x3b30bb(0x188)]!=='merge'){const _0x57330a=_0x332986['map'](_0x12111f=>_0x12111f['description'])[_0x3b30bb(0x237)](',\x20');_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+_0x3b30bb(0x22b),_0x3b30bb(0x213),_0x3b30bb(0x23c)+_0x17add3+_0x3b30bb(0x1c9)+_0x57330a+').\x20Use\x20a\x20merge\x20step.',_0x26d74b));}_0x332986[_0x3b30bb(0x1a8)]===0x1&&_0x721eb['type']===_0x3b30bb(0x1f5)&&_0x55b828['push'](createIssue(_0x3b30bb(0x212),_0x5eb467+'.steps',_0x3b30bb(0x1fa),_0x3b30bb(0x209)+_0x17add3+_0x3b30bb(0x1e0)+_0x332986[0x0]['description']+_0x3b30bb(0x236),_0x26d74b));}for(const _0x17141a of _0x1fa47b){if(_0x17141a[_0x3b30bb(0x188)]===_0x3b30bb(0x1f5)&&_0x17141a[_0x3b30bb(0x18f)]){const _0x4695b9=_0x574e21[_0x3b30bb(0x218)](_0x17141a[_0x3b30bb(0x18f)]);_0x4695b9?.[_0x3b30bb(0x188)]==='merge'&&_0x55b828[_0x3b30bb(0x1f1)](createIssue(_0x3b30bb(0x1e3),_0x5eb467+'.steps','MERGE_TO_MERGE_CHAIN',_0x3b30bb(0x209)+_0x17141a[_0x3b30bb(0x1c3)]+_0x3b30bb(0x20d)+_0x17141a[_0x3b30bb(0x18f)]+_0x3b30bb(0x1fe),_0x26d74b));}}return _0x55b828;}function validateCriteria(_0x10756b,_0x4d55dc,_0x5913e5){const _0x4809ff=a146_0x13e4,_0x22982f=[];return _0x10756b[_0x4809ff(0x219)]&&(_0x5913e5[_0x4809ff(0x211)]?.[_0x4809ff(0x1ef)](_0x10756b[_0x4809ff(0x219)]),!_0x10756b[_0x4809ff(0x219)][_0x4809ff(0x1ab)](_0x4809ff(0x1b5))&&(_0x5913e5[_0x4809ff(0x1ac)]&&!_0x5913e5[_0x4809ff(0x1ac)][_0x4809ff(0x1cb)](_0x10756b[_0x4809ff(0x219)])&&_0x22982f[_0x4809ff(0x1f1)](createIssue(_0x4809ff(0x1e3),_0x4d55dc+_0x4809ff(0x1e9),_0x4809ff(0x1a7),_0x4809ff(0x1c0)+_0x10756b[_0x4809ff(0x219)]+'\x27',_0x5913e5)))),_0x22982f;}function validateEmbeddedSegment(_0x28440f,_0x1c9816,_0x5651af){const _0x401780=a146_0x13e4,_0x4367d5=[];return _0x28440f[_0x401780(0x1bd)]&&_0x4367d5['push'](...validateRuleDef(_0x28440f[_0x401780(0x1bd)],_0x1c9816+_0x401780(0x198),_0x5651af)),_0x4367d5;}function validateStage(_0x132f3e,_0x5de3f9,_0x35fa4a,_0x75bbab){const _0x3e5dde=a146_0x13e4,_0x596e0f=[],_0x28a385=_0x3e5dde(0x19b)+_0x5de3f9+']',_0x6f28a4=new Map(),_0x5cb50e=new Map();if(_0x132f3e[_0x3e5dde(0x1c5)]){for(let _0x2b561a=0x0;_0x2b561a<_0x132f3e[_0x3e5dde(0x1c5)][_0x3e5dde(0x1a8)];_0x2b561a++){const _0x392a77=_0x132f3e[_0x3e5dde(0x1c5)][_0x2b561a];_0x392a77['name']&&_0x6f28a4[_0x3e5dde(0x1bc)](_0x392a77[_0x3e5dde(0x1c3)],_0x392a77);}for(let _0x1a1b92=0x0;_0x1a1b92<_0x132f3e[_0x3e5dde(0x1c5)][_0x3e5dde(0x1a8)];_0x1a1b92++){const _0x1413a3=_0x132f3e[_0x3e5dde(0x1c5)][_0x1a1b92],_0x2acf6c=_0x28a385+_0x3e5dde(0x1bf)+_0x1a1b92+']';if(_0x1413a3['name']){if(_0x5cb50e[_0x3e5dde(0x1cb)](_0x1413a3['name'])){const _0x4bf0c3=_0x5cb50e['get'](_0x1413a3['name']);_0x596e0f['push'](createIssue('error',_0x2acf6c+'.name',_0x3e5dde(0x202),_0x3e5dde(0x1a5)+_0x1413a3[_0x3e5dde(0x1c3)]+_0x3e5dde(0x1ee)+_0x4bf0c3+'])',_0x75bbab));}else _0x5cb50e[_0x3e5dde(0x1bc)](_0x1413a3[_0x3e5dde(0x1c3)],_0x1a1b92);}_0x596e0f[_0x3e5dde(0x1f1)](...validateStep(_0x1413a3,_0x2acf6c,_0x75bbab,_0x6f28a4));}}_0x132f3e[_0x3e5dde(0x1e1)]&&_0x596e0f[_0x3e5dde(0x1f1)](...validateCriteria(_0x132f3e['entry_criteria'],_0x28a385+_0x3e5dde(0x204),_0x75bbab));if(_0x132f3e[_0x3e5dde(0x1c1)])for(let _0x1ffe49=0x0;_0x1ffe49<_0x132f3e[_0x3e5dde(0x1c1)][_0x3e5dde(0x1a8)];_0x1ffe49++){_0x596e0f['push'](...validateCriteria(_0x132f3e['exit_criteria'][_0x1ffe49],_0x28a385+'.exit_criteria['+_0x1ffe49+']',_0x75bbab));}return _0x132f3e[_0x3e5dde(0x223)]&&_0x596e0f['push'](...validateCriteria(_0x132f3e[_0x3e5dde(0x223)],_0x28a385+'.milestone',_0x75bbab)),_0x596e0f[_0x3e5dde(0x1f1)](...validateStageStructure(_0x132f3e,_0x5de3f9,_0x35fa4a,_0x75bbab)),_0x596e0f[_0x3e5dde(0x1f1)](...validateFlowControl(_0x132f3e,_0x5de3f9,_0x75bbab)),_0x596e0f;}function validateStagesForVersion(_0x1a4c81,_0xefe251,_0x3abe5e,_0x48cf11,_0x114add,_0x4dabe6,_0x2e71b0){const _0x306a44=a146_0x13e4;if(_0x1a4c81[_0x306a44(0x1a8)]===0x0){_0x114add[_0x306a44(0x1f1)]({'level':_0x306a44(0x1e3),'path':_0x48cf11+_0x306a44(0x18b),'code':_0x306a44(0x1d7),'message':_0x306a44(0x1e6),'location':getLocationFromPath(_0x3abe5e['document'],_0x3abe5e[_0x306a44(0x201)],[_0x306a44(0x18b)])});return;}const _0x2c5f7a=new Set();for(const _0x19ef31 of _0x1a4c81){if(_0x19ef31['steps'])for(const _0x5f3b23 of _0x19ef31[_0x306a44(0x1c5)]){_0x5f3b23[_0x306a44(0x1c3)]&&_0x2c5f7a[_0x306a44(0x1ef)](_0x5f3b23['name']);}}const _0x5849af={..._0x3abe5e,'stepNames':_0x2c5f7a},_0x16d835=validateVersionStructure(_0x1a4c81,_0x5849af);for(const _0x4125ce of _0x16d835){const _0xfa51a=_0x48cf11?{..._0x4125ce,'path':''+_0x48cf11+_0x4125ce[_0x306a44(0x1c7)]}:_0x4125ce;if(_0xfa51a[_0x306a44(0x1e7)]==='error')_0x114add[_0x306a44(0x1f1)](_0xfa51a);else _0x4dabe6[_0x306a44(0x1f1)](_0xfa51a);}for(let _0x9d3135=0x0;_0x9d3135<_0x1a4c81[_0x306a44(0x1a8)];_0x9d3135++){const _0x523e5c=validateStage(_0x1a4c81[_0x9d3135],_0x9d3135,_0x1a4c81[_0x306a44(0x1a8)],_0x5849af);for(const _0x570d01 of _0x523e5c){const _0x3500fb=_0x48cf11?{..._0x570d01,'path':''+_0x48cf11+_0x570d01[_0x306a44(0x1c7)]}:_0x570d01;if(_0x3500fb[_0x306a44(0x1e7)]==='error')_0x114add['push'](_0x3500fb);else _0x4dabe6['push'](_0x3500fb);}}if(_0xefe251[_0x306a44(0x215)]){const _0x52346d=_0x2e71b0?.[_0x306a44(0x1b8)]?'goal':_0x48cf11+'goal',_0x4e0bf8=validateCriteria(_0xefe251[_0x306a44(0x215)],_0x52346d,_0x5849af);for(const _0x27d82e of _0x4e0bf8){if(_0x27d82e['level']===_0x306a44(0x1e3))_0x114add[_0x306a44(0x1f1)](_0x27d82e);else _0x4dabe6[_0x306a44(0x1f1)](_0x27d82e);}}}function extractVersionIndex(_0x4ef1d6){const _0x20d4c6=_0x4ef1d6['match'](/^journeys\[(\d+)\]\./);return _0x20d4c6?_0x20d4c6[0x1]:undefined;}function deduplicateAcrossVersions(_0x1c45bd){const _0xef5f39=a146_0x13e4,_0x262f9e=new Map();for(let _0x39bd16=0x0;_0x39bd16<_0x1c45bd[_0xef5f39(0x1a8)];_0x39bd16++){const _0x5bb11e=_0x1c45bd[_0x39bd16]['code']+':'+_0x1c45bd[_0x39bd16][_0xef5f39(0x1f9)],_0x50eb9a=extractVersionIndex(_0x1c45bd[_0x39bd16][_0xef5f39(0x1c7)]),_0x361b60=_0x262f9e['get'](_0x5bb11e);if(_0x361b60){_0x361b60['indices'][_0xef5f39(0x1f1)](_0x39bd16);if(_0x50eb9a)_0x361b60['versions'][_0xef5f39(0x1ef)](_0x50eb9a);}else _0x262f9e[_0xef5f39(0x1bc)](_0x5bb11e,{'indices':[_0x39bd16],'versions':new Set(_0x50eb9a?[_0x50eb9a]:[])});}const _0x17ca41=new Set();for(const {indices:_0x4e461d,versions:_0x47a45e}of _0x262f9e[_0xef5f39(0x1bb)]()){if(_0x47a45e[_0xef5f39(0x233)]<=0x1)continue;const _0x1d9fa6=_0x1c45bd[_0x4e461d[0x0]];_0x1d9fa6[_0xef5f39(0x1c7)]=_0x1d9fa6['path'][_0xef5f39(0x1db)](/^journeys\[\d+\]\./,''),_0x1d9fa6[_0xef5f39(0x1f9)]=_0x1d9fa6['message']+_0xef5f39(0x1c2)+_0x47a45e[_0xef5f39(0x233)]+'\x20versions)';for(let _0x2cccd8=0x1;_0x2cccd8<_0x4e461d['length'];_0x2cccd8++){_0x17ca41[_0xef5f39(0x1ef)](_0x4e461d[_0x2cccd8]);}}const _0x399967=[..._0x17ca41][_0xef5f39(0x1fb)]((_0x520356,_0x3f6a90)=>_0x3f6a90-_0x520356);for(const _0x19dfc3 of _0x399967){_0x1c45bd[_0xef5f39(0x1cc)](_0x19dfc3,0x1);}}export function validateJourneyDef(_0x3c4053,_0x525174={},_0x370478={}){const _0x10caad=a146_0x13e4;if(_0x370478[_0x10caad(0x20e)])return runJourneySemanticChecks(_0x3c4053,_0x525174);const _0x4f71c7=JourneyDefSchema[_0x10caad(0x231)](_0x3c4053);if(_0x4f71c7['success'])return runJourneySemanticChecks(_0x4f71c7[_0x10caad(0x23a)],_0x525174);return zodErrorsToJourneyValidationResult(_0x4f71c7[_0x10caad(0x1e3)],_0x525174);}function zodErrorsToJourneyValidationResult(_0x49e553,_0x7d0f41){const _0x12e0f1=a146_0x13e4,_0x2b9664=flattenZodIssues(_0x49e553[_0x12e0f1(0x21d)]),_0x779c40=_0x2b9664[_0x12e0f1(0x19d)](_0x249527=>{const _0xb4f947=_0x12e0f1,_0x2f2028=formatZodPath(_0x249527[_0xb4f947(0x1c7)]),_0x51a8d5=mapJourneyZodIssueToCode(_0x249527,_0x2f2028),_0x40d7b7=getLocationFromPath(_0x7d0f41[_0xb4f947(0x224)],_0x7d0f41['source'],_0x249527[_0xb4f947(0x1c7)][_0xb4f947(0x19d)](_0x4461fd=>typeof _0x4461fd===_0xb4f947(0x20a)?String(_0x4461fd):_0x4461fd));return{'level':_0xb4f947(0x1e3),'path':_0x2f2028,'code':_0x51a8d5,'message':_0x249527[_0xb4f947(0x1f9)],..._0x40d7b7&&{'location':_0x40d7b7}};});return{'valid':![],'errors':_0x779c40,'warnings':[]};}function mapJourneyZodIssueToCode(_0x4cdb8b,_0x22c939){const _0x3dfe90=a146_0x13e4;if(_0x22c939===_0x3dfe90(0x1c3))return'MISSING_NAME';if(_0x22c939['endsWith'](_0x3dfe90(0x239))&&_0x22c939[_0x3dfe90(0x22a)](_0x3dfe90(0x1c5)))return _0x3dfe90(0x200);if(_0x22c939===_0x3dfe90(0x18b)||_0x22c939[_0x3dfe90(0x1cf)](_0x3dfe90(0x222)))return _0x3dfe90(0x1d7);if(_0x22c939===''&&_0x4cdb8b[_0x3dfe90(0x1f9)][_0x3dfe90(0x22a)](_0x3dfe90(0x227)))return _0x3dfe90(0x1d7);if(_0x22c939['includes'](_0x3dfe90(0x1ec)))return _0x3dfe90(0x1c6);return _0x3dfe90(0x200);}function runJourneySemanticChecks(_0x144293,_0x2f0981){const _0x2f1a30=a146_0x13e4,_0x2a40b5=[],_0x3b1c00=[];(!_0x144293['name']||_0x144293[_0x2f1a30(0x1c3)]['trim']()==='')&&_0x2a40b5['push']({'level':_0x2f1a30(0x1e3),'path':_0x2f1a30(0x1c3),'code':_0x2f1a30(0x1de),'message':_0x2f1a30(0x1e8),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x2f1a30(0x1c3)])});const _0x1b7813=new Set();if(_0x144293[_0x2f1a30(0x1c8)])for(const _0xeedde3 of Object[_0x2f1a30(0x1ad)](_0x144293[_0x2f1a30(0x1c8)])){_0x1b7813[_0x2f1a30(0x1ef)](_0xeedde3);}const _0x4d9734=new Set();if(_0x144293['activations'])for(const _0x18e3a1 of Object[_0x2f1a30(0x1ad)](_0x144293[_0x2f1a30(0x225)])){_0x4d9734[_0x2f1a30(0x1ef)](_0x18e3a1);}const _0x159409=new Set(),_0x256978={..._0x2f0981,'embeddedSegments':_0x1b7813,'referencedSegments':_0x159409,'activationKeys':_0x4d9734['size']>0x0?_0x4d9734:undefined};if(_0x144293['segments'])for(const [_0x7e2442,_0x243a1e]of Object[_0x2f1a30(0x189)](_0x144293[_0x2f1a30(0x1c8)])){const _0x1999c0=validateEmbeddedSegment(_0x243a1e,_0x2f1a30(0x21c)+_0x7e2442,_0x256978);for(const _0x53acc6 of _0x1999c0){if(_0x53acc6[_0x2f1a30(0x1e7)]===_0x2f1a30(0x1e3))_0x2a40b5[_0x2f1a30(0x1f1)](_0x53acc6);else _0x3b1c00[_0x2f1a30(0x1f1)](_0x53acc6);}}const _0x29121b=!!_0x144293[_0x2f1a30(0x215)],_0x2f9d10=_0x144293[_0x2f1a30(0x208)]?.['every'](_0x1cf337=>!!_0x1cf337[_0x2f1a30(0x215)])??![];!_0x29121b&&!_0x2f9d10&&_0x3b1c00[_0x2f1a30(0x1f1)]({'level':_0x2f1a30(0x212),'path':_0x2f1a30(0x215),'code':_0x2f1a30(0x221),'message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x2f1a30(0x215)])});const _0xb902da=_0x144293['journeys']??_0x144293[_0x2f1a30(0x207)];if(_0xb902da&&_0xb902da[_0x2f1a30(0x18e)](_0x16f166=>_0x16f166[_0x2f1a30(0x21b)]===!![])[_0x2f1a30(0x1a8)]>0x1){const _0x134dd2=_0x144293[_0x2f1a30(0x208)]?_0x2f1a30(0x208):_0x2f1a30(0x207);_0x2a40b5[_0x2f1a30(0x1f1)]({'level':_0x2f1a30(0x1e3),'path':_0x134dd2,'code':'DUPLICATE_LATEST','message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x134dd2==='journeys'?'journey\x20entry':_0x2f1a30(0x1aa))+_0x2f1a30(0x1d2),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981[_0x2f1a30(0x201)],[_0x134dd2])});}if(_0x144293['journeys']&&_0x144293[_0x2f1a30(0x208)][_0x2f1a30(0x1a8)]>0x0)for(let _0x481677=0x0;_0x481677<_0x144293[_0x2f1a30(0x208)]['length'];_0x481677++){const _0x20890c=_0x144293['journeys'][_0x481677];if(_0x144293['journeys'][_0x2f1a30(0x1a8)]>0x1&&_0x20890c[_0x2f1a30(0x1e2)]==='launched')continue;const _0x287788=_0x20890c['stages']||[],_0x53f4bd=_0x2f1a30(0x217)+_0x481677+'].',_0x100381=!!_0x20890c[_0x2f1a30(0x215)],_0x4f55b3=_0x100381?{..._0x144293,'goal':_0x20890c[_0x2f1a30(0x215)]}:_0x144293;validateStagesForVersion(_0x287788,_0x4f55b3,_0x256978,_0x53f4bd,_0x2a40b5,_0x3b1c00,{'goalIsInherited':!_0x100381});}else{if(_0x144293['versions']&&_0x144293[_0x2f1a30(0x207)]['length']>0x0)for(let _0x5a57ad=0x0;_0x5a57ad<_0x144293[_0x2f1a30(0x207)][_0x2f1a30(0x1a8)];_0x5a57ad++){const _0x522de6=_0x144293['versions'][_0x5a57ad];if(_0x144293[_0x2f1a30(0x207)][_0x2f1a30(0x1a8)]>0x1&&_0x522de6['state']===_0x2f1a30(0x19e))continue;const _0x3523ae=_0x522de6[_0x2f1a30(0x18b)]||[],_0x1c21b6='versions['+_0x5a57ad+'].';validateStagesForVersion(_0x3523ae,_0x144293,_0x256978,_0x1c21b6,_0x2a40b5,_0x3b1c00);}else{const _0x3c9fba=_0x144293[_0x2f1a30(0x18b)]||[];validateStagesForVersion(_0x3c9fba,_0x144293,_0x256978,'',_0x2a40b5,_0x3b1c00);}}_0x144293[_0x2f1a30(0x208)]&&_0x144293[_0x2f1a30(0x208)][_0x2f1a30(0x1a8)]>0x1&&(deduplicateAcrossVersions(_0x2a40b5),deduplicateAcrossVersions(_0x3b1c00));for(const _0x13cfc1 of _0x1b7813){!_0x159409['has'](_0x13cfc1)&&!_0x13cfc1['startsWith']('excluded_')&&_0x3b1c00['push']({'level':_0x2f1a30(0x212),'path':_0x2f1a30(0x21c)+_0x13cfc1,'code':_0x2f1a30(0x1ea),'message':_0x2f1a30(0x1b7)+_0x13cfc1+_0x2f1a30(0x220),'location':getLocationFromPath(_0x2f0981[_0x2f1a30(0x224)],_0x2f0981['source'],[_0x2f1a30(0x1c8),_0x13cfc1])});}return{'valid':_0x2a40b5[_0x2f1a30(0x1a8)]===0x0,'errors':_0x2a40b5,'warnings':_0x3b1c00};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a147_0x24788c=a147_0x81bd;(function(_0x11ee0e,_0x2a83ba){const _0x47a2d0=a147_0x81bd,_0x47d58f=_0x11ee0e();while(!![]){try{const _0x197cbe=parseInt(_0x47a2d0(0x20d))/0x1+-parseInt(_0x47a2d0(0x21d))/0x2*(parseInt(_0x47a2d0(0x203))/0x3)+parseInt(_0x47a2d0(0x248))/0x4*(parseInt(_0x47a2d0(0x21f))/0x5)+parseInt(_0x47a2d0(0x205))/0x6*(parseInt(_0x47a2d0(0x263))/0x7)+-parseInt(_0x47a2d0(0x282))/0x8*(-parseInt(_0x47a2d0(0x29a))/0x9)+parseInt(_0x47a2d0(0x288))/0xa*(parseInt(_0x47a2d0(0x1f5))/0xb)+-parseInt(_0x47a2d0(0x209))/0xc*(parseInt(_0x47a2d0(0x23d))/0xd);if(_0x197cbe===_0x2a83ba)break;else _0x47d58f['push'](_0x47d58f['shift']());}catch(_0x1c6e02){_0x47d58f['push'](_0x47d58f['shift']());}}}(a147_0x5471,0xd6a7c));import*as a147_0x4c61b4 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';function a147_0x5471(){const _0x429171=['Variant','day','waitStep','Expected\x20format:\x0a','resolveActivationId','3294654aOpGKQ','trim','17350nYqmPd','isArray','slice','journeyBundleId','reentryMode','Duration','stageId','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','excludedPath','ABTest','next','reentry','milestone','rootStep','journeys','keys','uuid','customizedSplit','Condition','attributes','conditions','folder','find','End','waitStepType','Journey\x20description','percentage','JOURNEY_SYNTAX_ERROR','WaitStep','activations','624013cfAdzH','resolveSegmentName','waitStepUnit','timeout','Stage\x20Complete','sort','size','days','stage','startsWith','conditionTimeoutUnit','964laUGHu','replace','decision_point','columns','Stage\x201','toLowerCase','stages','\x20\x20\x20\x20type:\x20And\x0a','has','null','schedule','embedded','your-activation-name','conditionSegmentId','(missing)','connection','randomUUID','resolveJumpTarget','Send\x20Notification','days_of_week','goal','versions','segment','stageName','activation','state','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','1155hsWNsD','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','conditionTimeoutDuration','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','journeyId','test','Wait\x201\x20Day','First\x20stage\x20of\x20the\x20journey','with','resolveJourneyId','isJourneyLocal','versions:','Unknown\x20segment\x20\x22','Goal\x20Achieved','Date','exitCriteria','waitUntilDate','wait_until','no_reentry','bundle_id','goal:','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','condition','Entry\x20Criteria','exitCriterias','all_columns','journeyStageId','goal-segment','moveAfter','notification','exit_criteria','387208vqQthk','includes','rule','wait','DaysOfTheWeek','resolveActivation','20HtWjwk','journeys:','version_number','unit','weeks','daysOfWeek','Activation','get','draft','steps','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','parentFolder','merge','segment_id','duration','name','ref:','journeyBundleName','270ScrbZI','latest','all','resolveSegment','data','entryCriteria','reentry:','folder_id','excluded','filter','journeyStages','resolveActivationName','type','bundle_name','length','definition','jump','activations:','unique_id','root_step','\x20\x20rule:\x0a','And','activation_template_id','connector_config','map','relationships','timedOutPath','Merge','set','values','ref','target','\x20\x20\x20\x20type:\x20','customized_split','reentry_always','\x27:\x20','allowReentry','add','3836393tpIWhj','Jump','resolveStageId','resolveEmbeddedSegmentId','journey','branches','week','shift','segmentId','version','entry_criteria','push','resolveSegmentId','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','3DhLpQt','waitCondition','4710CxhvBF','description','variants','\x27.\x0a','216sxNgak','stringify','journeyName','segments:','275222VdarJf','journeyActivationStepId','launched','from','object','AbTest','segments','end','\x20\x20\x20\x20conditions:\x0a','*Max\x20wait\x20','versionNumber'];a147_0x5471=function(){return _0x429171;};return a147_0x5471();}import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x57135e){const _0x14c171=a147_0x81bd,_0x1cfc7a=_0x57135e[_0x14c171(0x24d)]();if(_0x1cfc7a===_0x14c171(0x244)||_0x1cfc7a==='day')return _0x14c171(0x219);if(_0x1cfc7a===_0x14c171(0x28c)||_0x1cfc7a===_0x14c171(0x1fb))return _0x14c171(0x1fb);return _0x57135e;}export function journeyResponseToDefSync(_0x44ab40){const _0x3c1b59=a147_0x81bd,_0x4854d6=_0x44ab40[_0x3c1b59(0x232)],_0x199b81=_0x4854d6[_0x3c1b59(0x299)]||_0x4854d6['name'],_0x5433ce={'stages':_0x4854d6[_0x3c1b59(0x2a4)][_0x3c1b59(0x2b2)](convertApiStageToYaml),'id':_0x44ab40['id']};_0x4854d6['goal']&&(_0x5433ce[_0x3c1b59(0x25c)]=convertApiCriteriaToYaml(_0x4854d6['goal']));_0x4854d6[_0x3c1b59(0x297)]&&_0x4854d6[_0x3c1b59(0x297)]!==_0x199b81&&(_0x5433ce[_0x3c1b59(0x1fe)]=_0x4854d6['name']);_0x4854d6[_0x3c1b59(0x217)]!==undefined&&(_0x5433ce['version_number']=_0x4854d6[_0x3c1b59(0x217)]);_0x4854d6[_0x3c1b59(0x261)]&&(_0x5433ce[_0x3c1b59(0x261)]=_0x4854d6[_0x3c1b59(0x261)]===_0x3c1b59(0x20f)?'launched':_0x3c1b59(0x290));const _0x2fad58={'type':_0x3c1b59(0x1f9),'name':_0x199b81,'journeys':[_0x5433ce]};_0x4854d6['description']&&(_0x2fad58[_0x3c1b59(0x206)]=_0x4854d6[_0x3c1b59(0x206)]);_0x4854d6[_0x3c1b59(0x25c)]&&(_0x2fad58[_0x3c1b59(0x25c)]=convertApiCriteriaToYaml(_0x4854d6[_0x3c1b59(0x25c)]));if(_0x4854d6[_0x3c1b59(0x223)])_0x2fad58[_0x3c1b59(0x22a)]=_0x4854d6['reentryMode'];else _0x4854d6[_0x3c1b59(0x2be)]!==undefined&&(_0x2fad58['reentry']=_0x4854d6[_0x3c1b59(0x2be)]?_0x3c1b59(0x2bc):_0x3c1b59(0x275));return _0x4854d6[_0x3c1b59(0x222)]&&(_0x2fad58['bundle_id']=_0x4854d6['journeyBundleId']),_0x4854d6[_0x3c1b59(0x299)]&&(_0x2fad58[_0x3c1b59(0x2a7)]=_0x4854d6[_0x3c1b59(0x299)]),_0x44ab40[_0x3c1b59(0x2b3)]?.[_0x3c1b59(0x293)]?.[_0x3c1b59(0x29e)]?.['id']&&(_0x2fad58[_0x3c1b59(0x2a1)]=_0x44ab40[_0x3c1b59(0x2b3)]['parentFolder'][_0x3c1b59(0x29e)]['id']),_0x2fad58;}export async function journeyResponseToDef(_0x302856,_0xedde71){const _0x177bc1=a147_0x81bd,_0x304a90=journeyResponseToDefSync(_0x302856);if(!_0xedde71)return _0x304a90;const _0x2d2381=new Set();collectSegmentIdsFromJourney(_0x304a90,_0x2d2381);const _0x173ca4=new Set();collectActivationIdsFromJourney(_0x304a90,_0x173ca4);const _0x3c5e6f={},_0x5000ce=new Map();for(const _0x432efa of Array[_0x177bc1(0x210)](_0x2d2381)[_0x177bc1(0x242)]()){if(_0xedde71[_0x177bc1(0x29d)]){const _0x31a5fb=await _0xedde71['resolveSegment'](_0x432efa);if(_0x31a5fb[_0x177bc1(0x26d)]){_0x5000ce['set'](_0x432efa,_0x31a5fb['name']);if(_0x31a5fb[_0x177bc1(0x2a9)]){const _0x1f0b69={..._0x31a5fb[_0x177bc1(0x2a9)],'rule':deepSortObject(_0x31a5fb[_0x177bc1(0x2a9)][_0x177bc1(0x284)])};_0x3c5e6f[_0x31a5fb['name']]=_0x1f0b69;}}else _0x5000ce['set'](_0x432efa,makeSegmentRef(_0x31a5fb[_0x177bc1(0x297)]));}else{if(_0xedde71[_0x177bc1(0x23e)]){const _0x1ec94f=await _0xedde71[_0x177bc1(0x23e)](_0x432efa);_0x5000ce[_0x177bc1(0x2b6)](_0x432efa,_0x1ec94f);}}}const _0x23a125={},_0x40efc6=new Map();for(const _0x3e8c24 of Array[_0x177bc1(0x210)](_0x173ca4)[_0x177bc1(0x242)]()){if(_0xedde71[_0x177bc1(0x287)]){const _0x45f911=await _0xedde71['resolveActivation'](_0x3e8c24);_0x45f911[_0x177bc1(0x26d)]?(_0x40efc6[_0x177bc1(0x2b6)](_0x3e8c24,_0x45f911[_0x177bc1(0x297)]),_0x45f911[_0x177bc1(0x2a9)]&&(_0x23a125[_0x45f911[_0x177bc1(0x297)]]=_0x45f911[_0x177bc1(0x2a9)])):_0x40efc6[_0x177bc1(0x2b6)](_0x3e8c24,makeSegmentRef(_0x45f911[_0x177bc1(0x297)]));}else{if(_0xedde71[_0x177bc1(0x2a5)]){const _0x335711=await _0xedde71[_0x177bc1(0x2a5)](_0x3e8c24);_0x40efc6[_0x177bc1(0x2b6)](_0x3e8c24,_0x335711);}}}_0x5000ce[_0x177bc1(0x243)]>0x0&&replaceSegmentIdsInJourney(_0x304a90,_0x5000ce);_0x40efc6[_0x177bc1(0x243)]>0x0&&replaceActivationIdsInJourney(_0x304a90,_0x40efc6);if(_0xedde71[_0x177bc1(0x259)]){const _0x39afdc=[];collectJumpTargetsFromJourney(_0x304a90,_0x39afdc);if(_0x39afdc[_0x177bc1(0x2a8)]>0x0){const _0x25f311=new Map();for(const _0xc6b21e of _0x39afdc){try{const _0x52ccf2=await _0xedde71[_0x177bc1(0x259)](_0xc6b21e[_0x177bc1(0x267)],_0xc6b21e['stageId']);_0x25f311[_0x177bc1(0x2b6)](_0xc6b21e[_0x177bc1(0x267)]+':'+_0xc6b21e[_0x177bc1(0x225)],_0x52ccf2);}catch{}}_0x25f311['size']>0x0&&replaceJumpTargetsInJourney(_0x304a90,_0x25f311);}}return Object[_0x177bc1(0x22e)](_0x3c5e6f)[_0x177bc1(0x2a8)]>0x0&&(_0x304a90[_0x177bc1(0x213)]=_0x3c5e6f),Object[_0x177bc1(0x22e)](_0x23a125)[_0x177bc1(0x2a8)]>0x0&&(_0x304a90[_0x177bc1(0x23c)]=_0x23a125),_0x304a90;}function collectSegmentIdsFromJourney(_0x5427b4,_0x80198a){const _0x55787b=a147_0x81bd;_0x5427b4['goal']?.['segment']&&_0x80198a[_0x55787b(0x1f4)](_0x5427b4[_0x55787b(0x25c)][_0x55787b(0x25e)]);const _0x1104d0=_0x334c1e=>{const _0x38444a=_0x55787b;for(const _0x7c7c48 of _0x334c1e){_0x7c7c48['entry_criteria']?.['segment']&&_0x80198a[_0x38444a(0x1f4)](_0x7c7c48[_0x38444a(0x1ff)][_0x38444a(0x25e)]);if(_0x7c7c48['exit_criteria'])for(const _0x39de11 of _0x7c7c48['exit_criteria']){_0x39de11[_0x38444a(0x25e)]&&_0x80198a[_0x38444a(0x1f4)](_0x39de11[_0x38444a(0x25e)]);}_0x7c7c48['milestone']?.[_0x38444a(0x25e)]&&_0x80198a[_0x38444a(0x1f4)](_0x7c7c48[_0x38444a(0x22b)][_0x38444a(0x25e)]);if(_0x7c7c48['steps'])for(const _0x5f2a5f of _0x7c7c48[_0x38444a(0x291)]){if(_0x5f2a5f[_0x38444a(0x2a6)]==='decision_point'){const _0x21c743=_0x5f2a5f;for(const _0x3ccc5f of _0x21c743[_0x38444a(0x26b)]['branches']){_0x3ccc5f['segment']&&_0x80198a[_0x38444a(0x1f4)](_0x3ccc5f[_0x38444a(0x25e)]);}}else{if(_0x5f2a5f[_0x38444a(0x2a6)]==='wait'){const _0x3ca2e0=_0x5f2a5f;_0x3ca2e0[_0x38444a(0x26b)][_0x38444a(0x279)]?.[_0x38444a(0x25e)]&&_0x80198a[_0x38444a(0x1f4)](_0x3ca2e0[_0x38444a(0x26b)][_0x38444a(0x279)][_0x38444a(0x25e)]);}}}}};if(_0x5427b4[_0x55787b(0x22d)])for(const _0x5825c1 of _0x5427b4[_0x55787b(0x22d)]){_0x5825c1['goal']?.['segment']&&_0x80198a[_0x55787b(0x1f4)](_0x5825c1[_0x55787b(0x25c)][_0x55787b(0x25e)]),_0x1104d0(_0x5825c1[_0x55787b(0x24e)]);}_0x5427b4[_0x55787b(0x24e)]&&_0x1104d0(_0x5427b4['stages']);if(_0x5427b4[_0x55787b(0x25d)])for(const _0x316f29 of _0x5427b4[_0x55787b(0x25d)]){_0x1104d0(_0x316f29[_0x55787b(0x24e)]);}}function replaceSegmentIdsInJourney(_0x53a367,_0x1e2d5a){const _0xf3effd=a147_0x81bd,_0xb00165=_0x1396d2=>_0x1e2d5a[_0xf3effd(0x28f)](_0x1396d2)||_0x1396d2;_0x53a367[_0xf3effd(0x25c)]?.['segment']&&(_0x53a367[_0xf3effd(0x25c)][_0xf3effd(0x25e)]=_0xb00165(_0x53a367[_0xf3effd(0x25c)][_0xf3effd(0x25e)]));const _0x674d53=_0x52dc2c=>{const _0x3e3fa0=_0xf3effd;for(const _0x49cb7 of _0x52dc2c){_0x49cb7[_0x3e3fa0(0x1ff)]?.[_0x3e3fa0(0x25e)]&&(_0x49cb7[_0x3e3fa0(0x1ff)][_0x3e3fa0(0x25e)]=_0xb00165(_0x49cb7['entry_criteria'][_0x3e3fa0(0x25e)]));if(_0x49cb7['exit_criteria'])for(const _0x1e7dab of _0x49cb7['exit_criteria']){_0x1e7dab[_0x3e3fa0(0x25e)]&&(_0x1e7dab[_0x3e3fa0(0x25e)]=_0xb00165(_0x1e7dab['segment']));}_0x49cb7[_0x3e3fa0(0x22b)]?.[_0x3e3fa0(0x25e)]&&(_0x49cb7['milestone'][_0x3e3fa0(0x25e)]=_0xb00165(_0x49cb7[_0x3e3fa0(0x22b)]['segment']));if(_0x49cb7[_0x3e3fa0(0x291)])for(const _0x3a7d9d of _0x49cb7['steps']){if(_0x3a7d9d[_0x3e3fa0(0x2a6)]===_0x3e3fa0(0x24a)){const _0x4b220a=_0x3a7d9d;for(const _0x1f4df7 of _0x4b220a[_0x3e3fa0(0x26b)][_0x3e3fa0(0x1fa)]){_0x1f4df7[_0x3e3fa0(0x25e)]&&(_0x1f4df7['segment']=_0xb00165(_0x1f4df7[_0x3e3fa0(0x25e)]));}}else{if(_0x3a7d9d[_0x3e3fa0(0x2a6)]===_0x3e3fa0(0x285)){const _0xeb1cf2=_0x3a7d9d;_0xeb1cf2[_0x3e3fa0(0x26b)][_0x3e3fa0(0x279)]?.[_0x3e3fa0(0x25e)]&&(_0xeb1cf2[_0x3e3fa0(0x26b)]['condition'][_0x3e3fa0(0x25e)]=_0xb00165(_0xeb1cf2[_0x3e3fa0(0x26b)][_0x3e3fa0(0x279)]['segment']));}}}}};if(_0x53a367[_0xf3effd(0x22d)])for(const _0x59e8cb of _0x53a367[_0xf3effd(0x22d)]){_0x59e8cb['goal']?.[_0xf3effd(0x25e)]&&(_0x59e8cb[_0xf3effd(0x25c)][_0xf3effd(0x25e)]=_0xb00165(_0x59e8cb[_0xf3effd(0x25c)]['segment'])),_0x674d53(_0x59e8cb[_0xf3effd(0x24e)]);}_0x53a367[_0xf3effd(0x24e)]&&_0x674d53(_0x53a367[_0xf3effd(0x24e)]);if(_0x53a367[_0xf3effd(0x25d)])for(const _0x5e3526 of _0x53a367['versions']){_0x674d53(_0x5e3526[_0xf3effd(0x24e)]);}}function collectActivationIdsFromJourney(_0x8113c4,_0x51172b){const _0x54f18b=a147_0x81bd,_0x39a0e4=_0x78aa29=>{const _0x55b0ff=a147_0x81bd;for(const _0x410644 of _0x78aa29){if(_0x410644[_0x55b0ff(0x291)])for(const _0xe074eb of _0x410644['steps']){if(_0xe074eb[_0x55b0ff(0x2a6)]===_0x55b0ff(0x260)){const _0x1f20c5=_0xe074eb;_0x1f20c5[_0x55b0ff(0x26b)][_0x55b0ff(0x260)]&&/^\d+$/[_0x55b0ff(0x268)](_0x1f20c5[_0x55b0ff(0x26b)][_0x55b0ff(0x260)])&&_0x51172b[_0x55b0ff(0x1f4)](_0x1f20c5['with'][_0x55b0ff(0x260)]);}}}};if(_0x8113c4[_0x54f18b(0x22d)])for(const _0x5bc29c of _0x8113c4[_0x54f18b(0x22d)]){_0x39a0e4(_0x5bc29c[_0x54f18b(0x24e)]);}_0x8113c4[_0x54f18b(0x24e)]&&_0x39a0e4(_0x8113c4[_0x54f18b(0x24e)]);if(_0x8113c4[_0x54f18b(0x25d)])for(const _0x4d4943 of _0x8113c4[_0x54f18b(0x25d)]){_0x39a0e4(_0x4d4943[_0x54f18b(0x24e)]);}}function replaceActivationIdsInJourney(_0x5d7f8f,_0xd6bf18){const _0x23799c=a147_0x81bd,_0x2e5841=_0x5d96f6=>_0xd6bf18[_0x23799c(0x28f)](_0x5d96f6)||_0x5d96f6,_0x3664cc=_0x5519d9=>{const _0x1ce007=_0x23799c;for(const _0x3997f6 of _0x5519d9){if(_0x3997f6[_0x1ce007(0x291)])for(const _0x3ed522 of _0x3997f6[_0x1ce007(0x291)]){if(_0x3ed522[_0x1ce007(0x2a6)]===_0x1ce007(0x260)){const _0x45697e=_0x3ed522;_0x45697e['with'][_0x1ce007(0x260)]&&(_0x45697e[_0x1ce007(0x26b)][_0x1ce007(0x260)]=_0x2e5841(_0x45697e[_0x1ce007(0x26b)][_0x1ce007(0x260)]));}}}};if(_0x5d7f8f[_0x23799c(0x22d)])for(const _0x12399d of _0x5d7f8f[_0x23799c(0x22d)]){_0x3664cc(_0x12399d[_0x23799c(0x24e)]);}_0x5d7f8f['stages']&&_0x3664cc(_0x5d7f8f[_0x23799c(0x24e)]);if(_0x5d7f8f[_0x23799c(0x25d)])for(const _0x1b0d16 of _0x5d7f8f['versions']){_0x3664cc(_0x1b0d16[_0x23799c(0x24e)]);}}function collectJumpTargetsFromJourney(_0x4d617d,_0x5ed5ed){const _0x19d4db=a147_0x81bd,_0x409b21=new Set(),_0x257215=_0x323eb3=>{const _0x235215=a147_0x81bd;for(const _0x57b099 of _0x323eb3){if(_0x57b099[_0x235215(0x291)])for(const _0x308071 of _0x57b099[_0x235215(0x291)]){if(_0x308071['type']==='jump'){const _0x555301=_0x308071,_0x23d891=_0x555301[_0x235215(0x26b)][_0x235215(0x2b9)];if(_0x23d891[_0x235215(0x1f9)]&&_0x23d891[_0x235215(0x245)]&&/^\d+$/[_0x235215(0x268)](_0x23d891['journey'])&&/^\d+$/[_0x235215(0x268)](_0x23d891[_0x235215(0x245)])){const _0x181573=_0x23d891[_0x235215(0x1f9)]+':'+_0x23d891['stage'];!_0x409b21[_0x235215(0x250)](_0x181573)&&(_0x409b21[_0x235215(0x1f4)](_0x181573),_0x5ed5ed[_0x235215(0x200)]({'journeyId':_0x23d891[_0x235215(0x1f9)],'stageId':_0x23d891[_0x235215(0x245)]}));}}}}};if(_0x4d617d['journeys'])for(const _0x1ad10a of _0x4d617d[_0x19d4db(0x22d)]){_0x257215(_0x1ad10a[_0x19d4db(0x24e)]);}_0x4d617d[_0x19d4db(0x24e)]&&_0x257215(_0x4d617d[_0x19d4db(0x24e)]);if(_0x4d617d[_0x19d4db(0x25d)])for(const _0x4c05fd of _0x4d617d['versions']){_0x257215(_0x4c05fd['stages']);}}function replaceJumpTargetsInJourney(_0x4cb9f1,_0x11f3b6){const _0x123c16=a147_0x81bd,_0x234bed=_0x7d97a=>{const _0x5071eb=a147_0x81bd;for(const _0x22cfa2 of _0x7d97a){if(_0x22cfa2[_0x5071eb(0x291)])for(const _0x4477ca of _0x22cfa2[_0x5071eb(0x291)]){if(_0x4477ca[_0x5071eb(0x2a6)]===_0x5071eb(0x2aa)){const _0x47d724=_0x4477ca,_0x219ccc=_0x47d724[_0x5071eb(0x26b)][_0x5071eb(0x2b9)],_0x49aadc=_0x219ccc['journey']+':'+_0x219ccc[_0x5071eb(0x245)],_0x16cc76=_0x11f3b6[_0x5071eb(0x28f)](_0x49aadc);_0x16cc76&&(_0x219ccc['journey']=_0x16cc76['journeyName'],_0x219ccc['stage']=_0x16cc76[_0x5071eb(0x25f)]);}}}};if(_0x4cb9f1[_0x123c16(0x22d)])for(const _0x27d892 of _0x4cb9f1[_0x123c16(0x22d)]){_0x234bed(_0x27d892['stages']);}_0x4cb9f1[_0x123c16(0x24e)]&&_0x234bed(_0x4cb9f1[_0x123c16(0x24e)]);if(_0x4cb9f1[_0x123c16(0x25d)])for(const _0x28d55e of _0x4cb9f1['versions']){_0x234bed(_0x28d55e[_0x123c16(0x24e)]);}}function generateReadableStepName(_0xb0520f,_0xef847a){const _0xca5fa6=a147_0x81bd;if(_0xb0520f['name']&&_0xb0520f['name']!==_0xb0520f[_0xca5fa6(0x2a6)]){const _0x40166a=_0xb0520f['name'][_0xca5fa6(0x21e)]();if(_0x40166a&&/[a-z0-9\p{L}]/iu[_0xca5fa6(0x268)](_0x40166a))return _0x40166a;}const _0x58798b=_0xb0520f[_0xca5fa6(0x2a6)][_0xca5fa6(0x24d)]()[_0xca5fa6(0x249)](/step$/i,'');return _0x58798b+'_'+(_0xef847a+0x1);}function getStepNextRefs(_0x381d2d){const _0x37d015=a147_0x81bd,_0xcac395=[];if(_0x381d2d[_0x37d015(0x229)])_0xcac395[_0x37d015(0x200)](_0x381d2d[_0x37d015(0x229)]);if(_0x381d2d[_0x37d015(0x1fa)])for(const _0x4d29c6 of _0x381d2d[_0x37d015(0x1fa)]){if(_0x4d29c6[_0x37d015(0x229)])_0xcac395[_0x37d015(0x200)](_0x4d29c6[_0x37d015(0x229)]);}if(_0x381d2d[_0x37d015(0x207)])for(const _0x4739e3 of _0x381d2d[_0x37d015(0x207)]){if(_0x4739e3[_0x37d015(0x229)])_0xcac395[_0x37d015(0x200)](_0x4739e3[_0x37d015(0x229)]);}if(_0x381d2d['conditions'])for(const _0x1d8542 of _0x381d2d[_0x37d015(0x233)]){if(_0x1d8542[_0x37d015(0x229)])_0xcac395['push'](_0x1d8542[_0x37d015(0x229)]);}return _0xcac395;}function a147_0x81bd(_0x413555,_0x11c18a){_0x413555=_0x413555-0x1f4;const _0x5471ba=a147_0x5471();let _0x81bd97=_0x5471ba[_0x413555];return _0x81bd97;}function parseJumpTargetDisplayName(_0x1b40d5){const _0x9adb87=a147_0x81bd,_0xd40966=_0x1b40d5['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0xd40966)return undefined;const _0x1d7035=_0xd40966[0x1][_0x9adb87(0x21e)](),_0x3ba9b5=_0xd40966[0x2]['trim']();if(!_0x1d7035||!_0x3ba9b5)return undefined;return{'stageName':_0x1d7035,'journeyName':_0x3ba9b5};}function orderStepsFromRoot(_0x5a84be,_0x327622){const _0x5eeb8c=a147_0x81bd,_0x59f997=Object['entries'](_0x5a84be);if(_0x59f997['length']===0x0)return[];const _0x2fbef4=new Set(_0x59f997[_0x5eeb8c(0x2b2)](([_0x230f4a])=>_0x230f4a)),_0xb8993b=new Set();for(const [,_0x4e7c43]of _0x59f997){for(const _0x4f53a3 of getStepNextRefs(_0x4e7c43)){if(_0x2fbef4[_0x5eeb8c(0x250)](_0x4f53a3))_0xb8993b[_0x5eeb8c(0x1f4)](_0x4f53a3);}}let _0xabaac5=_0x327622&&_0x2fbef4[_0x5eeb8c(0x250)](_0x327622)?_0x327622:undefined;if(!_0xabaac5){const _0x9136a1=_0x59f997[_0x5eeb8c(0x2a3)](([_0x1d7da3])=>!_0xb8993b[_0x5eeb8c(0x250)](_0x1d7da3));_0x9136a1[_0x5eeb8c(0x2a8)]>0x0?_0xabaac5=_0x9136a1[0x0][0x0]:_0xabaac5=_0x59f997[0x0][0x0];}const _0x115067=[],_0x8bf74e=new Set(),_0x3151ef=[_0xabaac5];while(_0x3151ef[_0x5eeb8c(0x2a8)]>0x0){const _0x243b20=_0x3151ef[_0x5eeb8c(0x1fc)]();if(_0x8bf74e['has'](_0x243b20))continue;_0x8bf74e[_0x5eeb8c(0x1f4)](_0x243b20);const _0x4d665c=_0x5a84be[_0x243b20];if(!_0x4d665c)continue;_0x115067['push']({'uuid':_0x243b20,'step':_0x4d665c});for(const _0x3c848e of getStepNextRefs(_0x4d665c)){_0x2fbef4[_0x5eeb8c(0x250)](_0x3c848e)&&!_0x8bf74e['has'](_0x3c848e)&&_0x3151ef[_0x5eeb8c(0x200)](_0x3c848e);}}for(const [_0x5e22c7,_0x4c29a4]of _0x59f997){!_0x8bf74e['has'](_0x5e22c7)&&_0x115067['push']({'uuid':_0x5e22c7,'step':_0x4c29a4});}return _0x115067;}function resolveStepReferences(_0x5e853d,_0x5740e5,_0x3deb7a,_0x221834){const _0x44a87e=a147_0x81bd;if(_0x5e853d[_0x44a87e(0x2a6)]!==_0x44a87e(0x214)){_0x5e853d[_0x44a87e(0x229)]&&_0x221834['has'](_0x5e853d['next'])&&(_0x5e853d[_0x44a87e(0x229)]=_0x221834[_0x44a87e(0x28f)](_0x5e853d[_0x44a87e(0x229)]));const _0x12c0f6=_0x5740e5+0x1;if(_0x12c0f6<_0x3deb7a['length']){const _0x1a4830=_0x221834[_0x44a87e(0x28f)](_0x3deb7a[_0x12c0f6][_0x44a87e(0x22f)]);_0x5e853d[_0x44a87e(0x229)]===_0x1a4830&&delete _0x5e853d[_0x44a87e(0x229)];}}if(_0x5e853d[_0x44a87e(0x2a6)]===_0x44a87e(0x24a))for(const _0x2e7f54 of _0x5e853d[_0x44a87e(0x26b)][_0x44a87e(0x1fa)]){_0x2e7f54['next']&&_0x221834[_0x44a87e(0x250)](_0x2e7f54[_0x44a87e(0x229)])&&(_0x2e7f54[_0x44a87e(0x229)]=_0x221834[_0x44a87e(0x28f)](_0x2e7f54[_0x44a87e(0x229)]));}if(_0x5e853d['type']==='ab_test')for(const _0xb28704 of _0x5e853d['with'][_0x44a87e(0x207)]){_0xb28704[_0x44a87e(0x229)]&&_0x221834[_0x44a87e(0x250)](_0xb28704[_0x44a87e(0x229)])&&(_0xb28704['next']=_0x221834[_0x44a87e(0x28f)](_0xb28704[_0x44a87e(0x229)]));}if(_0x5e853d[_0x44a87e(0x2a6)]===_0x44a87e(0x285)&&_0x5e853d[_0x44a87e(0x26b)][_0x44a87e(0x279)]){const _0x26cc21=_0x5e853d['with'][_0x44a87e(0x279)];_0x26cc21[_0x44a87e(0x229)]&&_0x221834[_0x44a87e(0x250)](_0x26cc21[_0x44a87e(0x229)])&&(_0x26cc21[_0x44a87e(0x229)]=_0x221834['get'](_0x26cc21[_0x44a87e(0x229)])),_0x26cc21['timeout']?.[_0x44a87e(0x229)]&&_0x221834[_0x44a87e(0x250)](_0x26cc21[_0x44a87e(0x240)][_0x44a87e(0x229)])&&(_0x26cc21['timeout'][_0x44a87e(0x229)]=_0x221834[_0x44a87e(0x28f)](_0x26cc21[_0x44a87e(0x240)][_0x44a87e(0x229)]));}}function convertApiStageToYaml(_0x12294a){const _0x33f8a9=a147_0x81bd,_0x529b4a={'name':_0x12294a[_0x33f8a9(0x297)]};_0x12294a['id']&&(_0x529b4a['id']=_0x12294a['id']);_0x12294a[_0x33f8a9(0x206)]&&(_0x529b4a[_0x33f8a9(0x206)]=_0x12294a['description']);_0x12294a[_0x33f8a9(0x29f)]&&(_0x529b4a[_0x33f8a9(0x1ff)]=convertApiCriteriaToYaml(_0x12294a[_0x33f8a9(0x29f)]));_0x12294a[_0x33f8a9(0x27b)]&&_0x12294a['exitCriterias']['length']>0x0&&(_0x529b4a[_0x33f8a9(0x281)]=_0x12294a[_0x33f8a9(0x27b)]['map'](convertApiCriteriaToYaml));_0x12294a[_0x33f8a9(0x22b)]&&(_0x529b4a[_0x33f8a9(0x22b)]=convertApiCriteriaToYaml(_0x12294a[_0x33f8a9(0x22b)]));if(_0x12294a[_0x33f8a9(0x291)]&&Object[_0x33f8a9(0x22e)](_0x12294a[_0x33f8a9(0x291)])['length']>0x0){const _0x180935=orderStepsFromRoot(_0x12294a[_0x33f8a9(0x291)],_0x12294a[_0x33f8a9(0x22c)]),_0x56af20=new Map(),_0x516bf4=new Set();for(let _0x4d7f53=0x0;_0x4d7f53<_0x180935['length'];_0x4d7f53++){const {uuid:_0x42899d,step:_0x5508eb}=_0x180935[_0x4d7f53];let _0x3ff3df=generateReadableStepName(_0x5508eb,_0x4d7f53),_0x92eed3=_0x3ff3df,_0x40cefc=0x2;while(_0x516bf4['has'](_0x92eed3)){_0x92eed3=_0x3ff3df+'_'+_0x40cefc,_0x40cefc++;}_0x516bf4[_0x33f8a9(0x1f4)](_0x92eed3),_0x56af20[_0x33f8a9(0x2b6)](_0x42899d,_0x92eed3);}_0x529b4a['steps']=_0x180935[_0x33f8a9(0x2b2)](({uuid:_0x376f88,step:_0x37f8ef},_0x54d0f7)=>{const _0x3986d3=_0x33f8a9,_0x376b22=convertApiStepToYaml(_0x37f8ef,_0x56af20[_0x3986d3(0x28f)](_0x376f88));return resolveStepReferences(_0x376b22,_0x54d0f7,_0x180935,_0x56af20),_0x376b22;});}return _0x529b4a;}function convertApiCriteriaToYaml(_0x388f43){const _0x252707=a147_0x81bd,_0x196fa4={'name':_0x388f43[_0x252707(0x297)],'segment':_0x388f43[_0x252707(0x1fd)]};_0x388f43[_0x252707(0x206)]&&(_0x196fa4[_0x252707(0x206)]=_0x388f43[_0x252707(0x206)]);if(_0x388f43[_0x252707(0x2b9)]){let _0x521236=_0x388f43[_0x252707(0x2b9)][_0x252707(0x267)],_0x37c9e4=_0x388f43[_0x252707(0x2b9)][_0x252707(0x27d)];if(_0x388f43[_0x252707(0x2b9)][_0x252707(0x20b)]){const _0x23c1fd=parseJumpTargetDisplayName(_0x388f43[_0x252707(0x2b9)][_0x252707(0x20b)]);_0x23c1fd&&(_0x37c9e4=_0x23c1fd[_0x252707(0x25f)],_0x521236=_0x23c1fd['journeyName']);}_0x196fa4[_0x252707(0x2b9)]={'journey':_0x521236,'stage':_0x37c9e4},_0x388f43['target'][_0x252707(0x222)]&&(_0x196fa4[_0x252707(0x2b9)][_0x252707(0x276)]=_0x388f43['target'][_0x252707(0x222)]);}return _0x196fa4;}function convertApiStepToYaml(_0x4933a9,_0x4dd772){const _0x302194=a147_0x81bd;switch(_0x4933a9['type']){case _0x302194(0x23b):{const _0x4d0d46={};if(_0x4933a9[_0x302194(0x237)]===_0x302194(0x224)&&_0x4933a9[_0x302194(0x21a)]!==undefined)_0x4d0d46['duration']=_0x4933a9[_0x302194(0x21a)],_0x4d0d46[_0x302194(0x28b)]=_0x4933a9['waitStepUnit'];else{if(_0x4933a9[_0x302194(0x237)]===_0x302194(0x271)&&_0x4933a9[_0x302194(0x273)])_0x4d0d46[_0x302194(0x274)]=_0x4933a9[_0x302194(0x273)];else{if(_0x4933a9['waitStepType']===_0x302194(0x286)&&_0x4933a9['daysOfWeek'])_0x4d0d46[_0x302194(0x25b)]=_0x4933a9['daysOfWeek'];else{if(_0x4933a9[_0x302194(0x237)]===_0x302194(0x231)){if(_0x4933a9[_0x302194(0x233)]&&_0x4933a9[_0x302194(0x233)][_0x302194(0x2a8)]>0x0){const _0x2930e0=_0x4933a9[_0x302194(0x233)][_0x302194(0x235)](_0x5b5a7c=>!_0x5b5a7c[_0x302194(0x2b4)]),_0x6ea2ab=_0x4933a9[_0x302194(0x233)][_0x302194(0x235)](_0x3a2593=>_0x3a2593['timedOutPath']);_0x2930e0?.['segmentId']&&(_0x4d0d46[_0x302194(0x279)]={'segment':_0x2930e0[_0x302194(0x1fd)],..._0x2930e0[_0x302194(0x229)]?{'next':_0x2930e0['next']}:{}},_0x6ea2ab&&_0x6ea2ab[_0x302194(0x27f)]!==undefined&&_0x6ea2ab[_0x302194(0x28b)]&&(_0x4d0d46['condition'][_0x302194(0x240)]={'duration':_0x6ea2ab[_0x302194(0x27f)],'unit':_0x6ea2ab[_0x302194(0x28b)],..._0x6ea2ab[_0x302194(0x229)]?{'next':_0x6ea2ab[_0x302194(0x229)]}:{}}));}else _0x4933a9[_0x302194(0x255)]&&(_0x4d0d46[_0x302194(0x279)]={'segment':_0x4933a9[_0x302194(0x255)]},_0x4933a9[_0x302194(0x265)]!==undefined&&_0x4933a9[_0x302194(0x247)]&&(_0x4d0d46[_0x302194(0x279)][_0x302194(0x240)]={'duration':_0x4933a9['conditionTimeoutDuration'],'unit':_0x4933a9[_0x302194(0x247)]}));}}}}const _0x20a912={'type':_0x302194(0x285),'name':_0x4dd772,..._0x4933a9[_0x302194(0x229)]?{'next':_0x4933a9[_0x302194(0x229)]}:{},'with':_0x4d0d46};return _0x20a912;}case _0x302194(0x28e):{const _0x3b4a7e={'type':'activation','name':_0x4dd772,..._0x4933a9[_0x302194(0x229)]?{'next':_0x4933a9['next']}:{},'with':{'activation':_0x4933a9[_0x302194(0x20e)]||''}};return _0x3b4a7e;}case'DecisionPoint':{const _0x150285={'type':_0x302194(0x24a),'name':_0x4dd772,..._0x4933a9[_0x302194(0x229)]?{'next':_0x4933a9['next']}:{},'with':{'branches':(_0x4933a9[_0x302194(0x1fa)]||[])['map'](_0x301186=>({'name':_0x301186[_0x302194(0x297)],'segment':_0x301186[_0x302194(0x1fd)],'excluded':_0x301186[_0x302194(0x227)],..._0x301186[_0x302194(0x229)]?{'next':_0x301186[_0x302194(0x229)]}:{}}))}};return _0x150285;}case _0x302194(0x228):case _0x302194(0x212):case _0x302194(0x218):{const _0x6cfd76=_0x4933a9[_0x302194(0x207)]||(_0x4933a9[_0x302194(0x1fa)]||[])[_0x302194(0x2b2)](_0xaf0061=>({'name':_0xaf0061[_0x302194(0x297)],'percentage':0x0,'next':_0xaf0061['next']})),_0x13337c={'type':'ab_test','name':_0x4dd772,..._0x4933a9['next']?{'next':_0x4933a9['next']}:{},'with':{'customized_split':_0x4933a9[_0x302194(0x230)],'unique_id':_0x4933a9['uniqueId'],'variants':_0x6cfd76['map'](_0x2de3bb=>({'name':_0x2de3bb[_0x302194(0x297)],'percentage':_0x2de3bb[_0x302194(0x239)],..._0x2de3bb[_0x302194(0x229)]?{'next':_0x2de3bb[_0x302194(0x229)]}:{}}))}};return _0x13337c;}case'Merge':{const _0x5d4a5b={'type':_0x302194(0x294),'name':_0x4dd772,..._0x4933a9[_0x302194(0x229)]?{'next':_0x4933a9[_0x302194(0x229)]}:{}};return _0x5d4a5b;}case _0x302194(0x1f6):{let _0x1c8ae9='',_0x5c0f78='',_0x5ad734;if(_0x4933a9['target']){_0x1c8ae9=_0x4933a9[_0x302194(0x2b9)][_0x302194(0x267)],_0x5c0f78=_0x4933a9[_0x302194(0x2b9)][_0x302194(0x27d)],_0x5ad734=_0x4933a9[_0x302194(0x2b9)][_0x302194(0x222)];if(_0x4933a9[_0x302194(0x2b9)][_0x302194(0x20b)]){const _0x52c10d=parseJumpTargetDisplayName(_0x4933a9[_0x302194(0x2b9)][_0x302194(0x20b)]);_0x52c10d&&(_0x5c0f78=_0x52c10d[_0x302194(0x25f)],_0x1c8ae9=_0x52c10d['journeyName']);}}const _0x16bbc0={'type':_0x302194(0x2aa),'name':_0x4dd772,..._0x4933a9[_0x302194(0x229)]?{'next':_0x4933a9[_0x302194(0x229)]}:{},'with':{'target':{'journey':_0x1c8ae9,'stage':_0x5c0f78,..._0x5ad734?{'bundle_id':_0x5ad734}:{}}}};return _0x16bbc0;}case _0x302194(0x236):{const _0x34b2b5={'type':'end','name':_0x4dd772};return _0x34b2b5;}default:{const _0x568fe1={'type':_0x302194(0x214),'name':_0x4dd772};return _0x568fe1;}}}export async function journeyDefToRequest(_0x31f2f8,_0xf431ab,_0x4d2263){const _0x4e1f0=a147_0x81bd,_0x4cbe9b=_0x31f2f8[_0x4e1f0(0x24e)]||getActiveStages(_0x31f2f8),_0xd4e232=isJourneysArrayMode(_0x31f2f8)||isMultiVersionMode(_0x31f2f8)?getLatestJourneyEntry(_0x31f2f8):undefined,_0x2f2e48=_0xd4e232?.['version']??_0x31f2f8[_0x4e1f0(0x297)],_0x147fdc=_0x31f2f8[_0x4e1f0(0x213)]||{},_0x5dd5dc=_0x31f2f8[_0x4e1f0(0x23c)]||{},_0x1eccd8={'type':_0x4e1f0(0x1f9),'attributes':{'name':_0x2f2e48,'audienceId':_0xf431ab,'journeyStages':await Promise[_0x4e1f0(0x29c)](_0x4cbe9b[_0x4e1f0(0x2b2)](_0x486dd8=>convertYamlStageToApi(_0x486dd8,_0x4d2263,_0x147fdc,_0x5dd5dc)))}},_0xc17014=_0xd4e232?.['id']??_0x31f2f8['id'];_0xc17014&&(_0x1eccd8['id']=_0xc17014);_0x31f2f8[_0x4e1f0(0x206)]&&(_0x1eccd8[_0x4e1f0(0x232)][_0x4e1f0(0x206)]=_0x31f2f8[_0x4e1f0(0x206)]);const _0xe17e8=getEffectiveGoal(_0x31f2f8);_0xe17e8&&(_0x1eccd8[_0x4e1f0(0x232)][_0x4e1f0(0x25c)]=await convertYamlCriteriaToApi(_0xe17e8,_0x4d2263,_0x147fdc));const _0x1401b6=getEffectiveReentry(_0x31f2f8);return _0x1401b6&&(_0x1eccd8[_0x4e1f0(0x232)][_0x4e1f0(0x223)]=_0x1401b6,_0x1eccd8['attributes'][_0x4e1f0(0x2be)]=_0x1401b6!=='no_reentry'),_0x31f2f8[_0x4e1f0(0x2a1)]&&(_0x1eccd8[_0x4e1f0(0x2b3)]={'parentFolder':{'data':{'id':_0x31f2f8['folder_id'],'type':_0x4e1f0(0x234)}}}),_0x1eccd8;}async function convertYamlStageToApi(_0x4177df,_0x1461c6,_0x573827={},_0x15e15e={}){const _0x14ef2c=a147_0x81bd,_0x47b32a={'name':_0x4177df[_0x14ef2c(0x297)]};_0x4177df['id']&&(_0x47b32a['id']=_0x4177df['id']);_0x4177df[_0x14ef2c(0x206)]&&(_0x47b32a[_0x14ef2c(0x206)]=_0x4177df[_0x14ef2c(0x206)]);_0x4177df[_0x14ef2c(0x1ff)]&&(_0x47b32a[_0x14ef2c(0x29f)]=await convertYamlCriteriaToApi(_0x4177df[_0x14ef2c(0x1ff)],_0x1461c6,_0x573827));_0x4177df['exit_criteria']&&_0x4177df[_0x14ef2c(0x281)][_0x14ef2c(0x2a8)]>0x0&&(_0x47b32a[_0x14ef2c(0x27b)]=await Promise['all'](_0x4177df[_0x14ef2c(0x281)][_0x14ef2c(0x2b2)](_0x15f608=>convertYamlCriteriaToApi(_0x15f608,_0x1461c6,_0x573827))));_0x4177df[_0x14ef2c(0x22b)]&&(_0x47b32a[_0x14ef2c(0x22b)]=await convertYamlCriteriaToApi(_0x4177df['milestone'],_0x1461c6,_0x573827));if(_0x4177df[_0x14ef2c(0x291)]&&_0x4177df[_0x14ef2c(0x291)][_0x14ef2c(0x2a8)]>0x0){const _0x588443={},_0x5bb5d2=_0x4177df['steps'][_0x14ef2c(0x2b2)]((_0x433e9e,_0x2a03e0)=>{const _0x1085e7=_0x14ef2c,_0x40c65d=_0x433e9e['uuid']||generateUUID(),_0x48807c=_0x433e9e[_0x1085e7(0x297)]||_0x433e9e[_0x1085e7(0x2a6)]+'_'+_0x2a03e0;return _0x588443[_0x48807c]=_0x40c65d,{..._0x433e9e,'name':_0x48807c};});_0x47b32a[_0x14ef2c(0x22c)]=_0x588443[_0x5bb5d2[0x0][_0x14ef2c(0x297)]],_0x47b32a[_0x14ef2c(0x291)]={};for(let _0x422d66=0x0;_0x422d66<_0x5bb5d2[_0x14ef2c(0x2a8)];_0x422d66++){const _0x4b4d3d=_0x5bb5d2[_0x422d66],_0x50f944=_0x588443[_0x4b4d3d[_0x14ef2c(0x297)]],_0x443786=!_0x4b4d3d['next']&&_0x422d66<_0x5bb5d2[_0x14ef2c(0x2a8)]-0x1&&_0x4b4d3d[_0x14ef2c(0x2a6)]!==_0x14ef2c(0x214)?_0x5bb5d2[_0x422d66+0x1][_0x14ef2c(0x297)]:_0x4b4d3d['next'],_0x4bea86=_0x443786!==_0x4b4d3d[_0x14ef2c(0x229)]?{..._0x4b4d3d,'next':_0x443786}:_0x4b4d3d;_0x47b32a[_0x14ef2c(0x291)][_0x50f944]=await convertYamlStepToApi(_0x4bea86,_0x1461c6,_0x573827,_0x588443,_0x15e15e);}}else _0x4177df[_0x14ef2c(0x2ad)]&&(_0x47b32a[_0x14ef2c(0x22c)]=_0x4177df['root_step']);return _0x47b32a;}async function convertYamlCriteriaToApi(_0x509e3f,_0x286d8c,_0xe62a2a={}){const _0x152732=a147_0x81bd;let _0x1b1e56=_0x509e3f[_0x152732(0x25e)];if(_0x1b1e56&&!/^\d+$/[_0x152732(0x268)](_0x1b1e56)){const _0x162515=parseSegmentRef(_0x1b1e56);if(_0x162515[_0x152732(0x2a6)]==='ref')_0x286d8c?.[_0x152732(0x201)]&&(_0x1b1e56=await _0x286d8c[_0x152732(0x201)](_0x162515[_0x152732(0x297)]));else{if(_0x162515[_0x152732(0x2a6)]===_0x152732(0x253)&&_0xe62a2a[_0x162515['name']])_0x286d8c?.['resolveEmbeddedSegmentId']&&(_0x1b1e56=await _0x286d8c[_0x152732(0x1f8)](_0x162515[_0x152732(0x297)],_0xe62a2a[_0x162515[_0x152732(0x297)]]));else _0x286d8c?.[_0x152732(0x201)]&&(_0x1b1e56=await _0x286d8c[_0x152732(0x201)](_0x162515['name']));}}const _0x422a66={'name':_0x509e3f[_0x152732(0x297)],'segmentId':_0x1b1e56};_0x509e3f[_0x152732(0x206)]&&(_0x422a66[_0x152732(0x206)]=_0x509e3f[_0x152732(0x206)]);if(_0x509e3f[_0x152732(0x2b9)]){const _0x33cd52=_0x509e3f[_0x152732(0x2b9)][_0x152732(0x1f9)],_0x21944a=_0x509e3f[_0x152732(0x2b9)][_0x152732(0x245)];let _0x279fbf=_0x509e3f[_0x152732(0x2b9)][_0x152732(0x1f9)];_0x286d8c?.[_0x152732(0x26c)]&&!/^\d+$/[_0x152732(0x268)](_0x279fbf)&&(_0x279fbf=await _0x286d8c['resolveJourneyId'](_0x279fbf));let _0x2e4753=_0x509e3f[_0x152732(0x2b9)][_0x152732(0x245)];_0x286d8c?.[_0x152732(0x1f7)]&&!/^\d+$/['test'](_0x2e4753)&&(_0x2e4753=await _0x286d8c[_0x152732(0x1f7)](_0x279fbf,_0x2e4753));const _0x2ae23a=!/^\d+$/['test'](_0x33cd52)&&!isLocalJourneyRef(_0x33cd52)?formatApiJourneyName(_0x33cd52,_0x21944a):undefined;_0x422a66['target']={'journeyId':_0x279fbf,'journeyStageId':_0x2e4753,'journeyName':_0x2ae23a,'confirmed':!![]},_0x509e3f['target'][_0x152732(0x276)]&&(_0x422a66[_0x152732(0x2b9)][_0x152732(0x222)]=_0x509e3f[_0x152732(0x2b9)][_0x152732(0x276)]);}return _0x422a66;}async function convertYamlStepToApi(_0x4186a8,_0x3d17cc,_0x58e499={},_0x2306dc={},_0x175902={}){const _0x4182f0=a147_0x81bd,_0x4e698c=async _0x1e6bcd=>{const _0x39afb6=a147_0x81bd;if(/^\d+$/[_0x39afb6(0x268)](_0x1e6bcd))return _0x1e6bcd;const _0x3789c6=parseSegmentRef(_0x1e6bcd);if(_0x3789c6[_0x39afb6(0x2a6)]===_0x39afb6(0x2b8)){if(_0x3d17cc?.[_0x39afb6(0x201)])return await _0x3d17cc['resolveSegmentId'](_0x3789c6[_0x39afb6(0x297)]);}else{if(_0x3789c6['type']===_0x39afb6(0x253)&&_0x58e499[_0x3789c6[_0x39afb6(0x297)]]){if(_0x3d17cc?.[_0x39afb6(0x1f8)])return await _0x3d17cc[_0x39afb6(0x1f8)](_0x3789c6[_0x39afb6(0x297)],_0x58e499[_0x3789c6['name']]);}else{if(_0x3d17cc?.[_0x39afb6(0x201)])return await _0x3d17cc[_0x39afb6(0x201)](_0x3789c6[_0x39afb6(0x297)]);}}return _0x1e6bcd;},_0x1f8120=async _0x329854=>{const _0x313495=a147_0x81bd;if(/^\d+$/[_0x313495(0x268)](_0x329854))return _0x329854;const _0x6b8269=parseSegmentRef(_0x329854);if(_0x6b8269['type']==='ref'){if(_0x3d17cc?.['resolveActivationId'])return await _0x3d17cc[_0x313495(0x21c)](_0x6b8269[_0x313495(0x297)]);return _0x6b8269[_0x313495(0x297)];}else{if(_0x6b8269[_0x313495(0x2a6)]===_0x313495(0x253)&&_0x175902[_0x6b8269['name']]){if(_0x3d17cc?.['resolveEmbeddedActivationId'])return await _0x3d17cc['resolveEmbeddedActivationId'](_0x6b8269[_0x313495(0x297)],_0x175902[_0x6b8269['name']]);if(_0x3d17cc?.[_0x313495(0x21c)])return await _0x3d17cc[_0x313495(0x21c)](_0x6b8269[_0x313495(0x297)]);}else{if(_0x3d17cc?.[_0x313495(0x21c)])return await _0x3d17cc[_0x313495(0x21c)](_0x6b8269['name']);}}return _0x329854;},_0x3b847e=_0x16e456=>{const _0x6e52b1=a147_0x81bd;if(!_0x16e456)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x6e52b1(0x268)](_0x16e456))return _0x16e456;return _0x2306dc[_0x16e456]||_0x16e456;};switch(_0x4186a8[_0x4182f0(0x2a6)]){case _0x4182f0(0x285):{const _0x505590=_0x4186a8,_0x3b42f9=_0x505590['with'],_0x45af6f={'type':_0x4182f0(0x23b),'name':_0x505590[_0x4182f0(0x297)],'next':_0x3b847e(_0x505590[_0x4182f0(0x229)])};if(_0x3b42f9[_0x4182f0(0x296)]!==undefined&&_0x3b42f9['unit'])_0x45af6f['waitStepType']=_0x4182f0(0x224),_0x45af6f[_0x4182f0(0x21a)]=_0x3b42f9[_0x4182f0(0x296)],_0x45af6f[_0x4182f0(0x23f)]=normalizeWaitUnit(_0x3b42f9['unit']);else{if(_0x3b42f9[_0x4182f0(0x274)])_0x45af6f['waitStepType']=_0x4182f0(0x271),_0x45af6f['waitUntilDate']=_0x3b42f9['wait_until'];else{if(_0x3b42f9['days_of_week'])_0x45af6f[_0x4182f0(0x237)]=_0x4182f0(0x286),_0x45af6f[_0x4182f0(0x28d)]=_0x3b42f9[_0x4182f0(0x25b)];else{if(_0x3b42f9[_0x4182f0(0x279)]){_0x45af6f[_0x4182f0(0x237)]=_0x4182f0(0x231);const _0x507ed7=await _0x4e698c(_0x3b42f9[_0x4182f0(0x279)][_0x4182f0(0x25e)]),_0x3c8f73=_0x3b42f9[_0x4182f0(0x279)][_0x4182f0(0x240)]?.[_0x4182f0(0x229)]!==undefined;if(_0x3c8f73){const _0x41a93e=[];_0x41a93e[_0x4182f0(0x200)]({'id':generateUUID(),'segmentId':_0x507ed7,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x3b847e(_0x3b42f9['condition']['next']??_0x505590[_0x4182f0(0x229)])});if(_0x3b42f9[_0x4182f0(0x279)][_0x4182f0(0x240)]){const _0x17b5ac=_0x3b42f9['condition']['timeout'][_0x4182f0(0x296)],_0x2cd6b2=normalizeWaitUnit(_0x3b42f9[_0x4182f0(0x279)]['timeout'][_0x4182f0(0x28b)]);_0x41a93e[_0x4182f0(0x200)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x4182f0(0x216)+_0x17b5ac+'\x20'+_0x2cd6b2,'moveAfter':_0x17b5ac,'unit':_0x2cd6b2,'next':_0x3b847e(_0x3b42f9[_0x4182f0(0x279)]['timeout'][_0x4182f0(0x229)])});}_0x45af6f[_0x4182f0(0x233)]=_0x41a93e,delete _0x45af6f[_0x4182f0(0x229)];}else _0x45af6f['conditionSegmentId']=_0x507ed7,_0x3b42f9[_0x4182f0(0x279)][_0x4182f0(0x240)]&&(_0x45af6f['conditionTimeoutDuration']=_0x3b42f9[_0x4182f0(0x279)][_0x4182f0(0x240)]['duration'],_0x3b42f9[_0x4182f0(0x279)][_0x4182f0(0x240)][_0x4182f0(0x28b)]&&(_0x45af6f[_0x4182f0(0x247)]=normalizeWaitUnit(_0x3b42f9[_0x4182f0(0x279)][_0x4182f0(0x240)][_0x4182f0(0x28b)])));}}}}return _0x45af6f;}case _0x4182f0(0x260):{const _0x23f49e=_0x4186a8,_0x4a72f3=_0x23f49e[_0x4182f0(0x26b)][_0x4182f0(0x260)],_0x54760d=await _0x1f8120(_0x4a72f3);return{'type':_0x4182f0(0x28e),'name':_0x23f49e[_0x4182f0(0x297)],'journeyActivationStepId':_0x54760d,'next':_0x3b847e(_0x23f49e['next'])};}case _0x4182f0(0x24a):{const _0x3ad3b7=_0x4186a8,_0x4e40a8=_0x3ad3b7['with'][_0x4182f0(0x1fa)];return{'type':'DecisionPoint','name':_0x3ad3b7['name'],'branches':await Promise[_0x4182f0(0x29c)](_0x4e40a8[_0x4182f0(0x2b2)](async _0x311423=>{const _0x53883b=_0x4182f0;let _0x4ec5f3='';if(!_0x311423[_0x53883b(0x2a2)]){const _0x38c323=_0x311423[_0x53883b(0x25e)]||_0x311423[_0x53883b(0x295)]||'';_0x4ec5f3=_0x38c323?await _0x4e698c(_0x38c323):'';}return{'id':crypto[_0x53883b(0x258)](),'name':_0x311423[_0x53883b(0x297)],'description':null,'segmentId':_0x4ec5f3,'excludedPath':_0x311423[_0x53883b(0x2a2)]??![],'next':_0x3b847e(_0x311423['next'])};})),'next':_0x3b847e(_0x3ad3b7[_0x4182f0(0x229)])};}case'ab_test':{const _0x31a205=_0x4186a8,_0x2b3608=_0x31a205['with'];return{'type':_0x4182f0(0x228),'name':_0x31a205[_0x4182f0(0x297)],'customizedSplit':_0x2b3608[_0x4182f0(0x2bb)],'uniqueId':_0x2b3608[_0x4182f0(0x2ac)],'variants':_0x2b3608[_0x4182f0(0x207)][_0x4182f0(0x2b2)](_0x584905=>({'id':_0x584905['id']||generateUUID(),'name':_0x584905[_0x4182f0(0x297)],'percentage':_0x584905[_0x4182f0(0x239)],'next':_0x3b847e(_0x584905[_0x4182f0(0x229)])})),'next':_0x3b847e(_0x31a205['next'])};}case _0x4182f0(0x294):return{'type':_0x4182f0(0x2b5),'name':_0x4186a8[_0x4182f0(0x297)],'next':_0x3b847e(_0x4186a8[_0x4182f0(0x229)])};case _0x4182f0(0x2aa):{const _0x53872c=_0x4186a8,_0x6b6264=_0x53872c[_0x4182f0(0x26b)][_0x4182f0(0x2b9)],_0x2769af=_0x6b6264[_0x4182f0(0x1f9)],_0x28035=_0x6b6264[_0x4182f0(0x245)];let _0xd5b02f=_0x6b6264[_0x4182f0(0x1f9)];_0x3d17cc?.[_0x4182f0(0x26c)]&&!/^\d+$/[_0x4182f0(0x268)](_0xd5b02f)&&(_0xd5b02f=await _0x3d17cc[_0x4182f0(0x26c)](_0xd5b02f));let _0x361438=_0x6b6264['stage'];_0x3d17cc?.[_0x4182f0(0x1f7)]&&!/^\d+$/[_0x4182f0(0x268)](_0x361438)&&(_0x361438=await _0x3d17cc[_0x4182f0(0x1f7)](_0xd5b02f,_0x361438));const _0x5dcadb=!/^\d+$/[_0x4182f0(0x268)](_0x2769af)&&!isLocalJourneyRef(_0x2769af)?formatApiJourneyName(_0x2769af,_0x28035):undefined;return{'type':'Jump','name':_0x53872c[_0x4182f0(0x297)],'target':{'journeyId':_0xd5b02f,'journeyStageId':_0x361438,'journeyBundleId':_0x6b6264[_0x4182f0(0x276)],'journeyName':_0x5dcadb,'confirmed':!![]},'next':_0x3b847e(_0x53872c[_0x4182f0(0x229)])};}case _0x4182f0(0x214):return{'type':_0x4182f0(0x236),'name':_0x4186a8['name']};default:{const _0x49ae4d=_0x4186a8;return{'type':_0x4182f0(0x236),'name':_0x49ae4d[_0x4182f0(0x297)]};}}}export function toYamlString(_0x28e3f3){const _0x86d05d=a147_0x81bd,_0x169854=stripInternalFields(_0x28e3f3),_0x435090=a147_0x4c61b4[_0x86d05d(0x20a)](_0x169854,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x86d05d(0x251)}),_0x404fee=[_0x86d05d(0x20c),_0x86d05d(0x2ab),_0x86d05d(0x277),_0x86d05d(0x2a0),_0x86d05d(0x289),'stages:',_0x86d05d(0x26e)];let _0x28a3fb=_0x435090;for(const _0x373c65 of _0x404fee){_0x28a3fb=_0x28a3fb[_0x86d05d(0x249)](new RegExp('^('+_0x373c65+')','m'),(_0x3e8b86,_0x3b99db,_0x2bd5d2)=>{if(_0x2bd5d2===0x0||_0x28a3fb[_0x2bd5d2-0x1]==='\x0a'&&_0x28a3fb[_0x2bd5d2-0x2]==='\x0a')return _0x3b99db;return'\x0a'+_0x3b99db;});}return _0x28a3fb;}function stripInternalFields(_0x45a155){const _0x390b09=a147_0x81bd,{id:_0x29753c,folder_id:_0x598e7d,bundle_id:_0x5634b8,bundle_name:_0x5cab30,version:_0x3015df,allow_reentry:_0x1e7ef6,..._0x3b1017}=_0x45a155;return _0x3b1017[_0x390b09(0x22d)]&&(_0x3b1017[_0x390b09(0x22d)]=_0x3b1017['journeys'][_0x390b09(0x2b2)](_0x4c0dcb=>{const _0x429b20=_0x390b09,{id:_0x320fd8,..._0x18cde6}=_0x4c0dcb;return{..._0x18cde6,'stages':_0x18cde6[_0x429b20(0x24e)][_0x429b20(0x2b2)](stripStageInternalFields),..._0x4c0dcb['latest']===!![]?{'latest':!![]}:{},..._0x3b1017['journeys'][_0x429b20(0x2a8)]===0x1&&_0x18cde6[_0x429b20(0x1fe)]==='v1'?{'version':undefined}:{}};})),_0x3b1017['stages']&&(_0x3b1017[_0x390b09(0x24e)]=_0x3b1017[_0x390b09(0x24e)][_0x390b09(0x2b2)](stripStageInternalFields)),_0x3b1017[_0x390b09(0x25d)]&&(_0x3b1017[_0x390b09(0x25d)]=_0x3b1017['versions'][_0x390b09(0x2b2)](_0x4dce13=>{const _0x583680=_0x390b09,{id:_0x588e30,..._0x23d636}=_0x4dce13;return{..._0x23d636,'stages':_0x23d636[_0x583680(0x24e)][_0x583680(0x2b2)](stripStageInternalFields),..._0x4dce13[_0x583680(0x29b)]===!![]?{'latest':!![]}:{}};})),_0x3b1017;}function stripStageInternalFields(_0x2bd3d7){const {id:_0x20bfdb,..._0x54545e}=_0x2bd3d7;return _0x54545e;}export function parseYamlString(_0x4b6d13){return safeParseYaml(_0x4b6d13,JourneyDefSchema);}export function isJourneyDef(_0x1403cd){const _0x2ffc2e=a147_0x81bd;return typeof _0x1403cd===_0x2ffc2e(0x211)&&_0x1403cd!==null&&_0x2ffc2e(0x2a6)in _0x1403cd&&_0x1403cd[_0x2ffc2e(0x2a6)]===_0x2ffc2e(0x1f9);}export function generateTemplate(_0x2d2298,_0x1b98bf){const _0x5ad821=a147_0x81bd,_0x347aa3={'type':_0x5ad821(0x1f9),'name':_0x2d2298,'description':_0x5ad821(0x238),'reentry':_0x5ad821(0x275),'goal':{'name':_0x5ad821(0x270),'segment':_0x5ad821(0x27e)},'stages':[{'name':_0x5ad821(0x24c),'description':_0x5ad821(0x26a),'entry_criteria':{'name':_0x5ad821(0x27a),'segment':_0x1b98bf},'steps':[{'type':_0x5ad821(0x285),'name':_0x5ad821(0x269),'with':{'duration':0x1,'unit':_0x5ad821(0x219)}},{'type':_0x5ad821(0x260),'name':_0x5ad821(0x25a),'with':{'activation':_0x5ad821(0x254)}},{'type':_0x5ad821(0x214),'name':_0x5ad821(0x241)}]}]};return toYamlString(_0x347aa3);}function generateUUID(){const _0x4fa1c1=a147_0x81bd;return crypto[_0x4fa1c1(0x258)]();}export const SEGMENT_REF_PREFIX=a147_0x24788c(0x298);export function parseSegmentRef(_0x3bebb7){const _0x4f268a=a147_0x24788c;if(_0x3bebb7[_0x4f268a(0x246)](SEGMENT_REF_PREFIX))return{'type':_0x4f268a(0x2b8),'name':_0x3bebb7[_0x4f268a(0x221)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x4f268a(0x268)](_0x3bebb7))return{'type':'id','name':_0x3bebb7};return{'type':_0x4f268a(0x253),'name':_0x3bebb7};}export function makeSegmentRef(_0x22a92b){return''+SEGMENT_REF_PREFIX+_0x22a92b;}export function isExternalSegmentRef(_0x1e09b5){const _0x5a7581=a147_0x24788c;return _0x1e09b5[_0x5a7581(0x246)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x38bac0){const _0x5fff6d=a147_0x24788c;return!!(_0x38bac0[_0x5fff6d(0x22d)]&&_0x38bac0['journeys']['length']>0x0);}export function isMultiVersionMode(_0x19c5aa){const _0x2f0554=a147_0x24788c;return!!(_0x19c5aa[_0x2f0554(0x25d)]&&_0x19c5aa['versions'][_0x2f0554(0x2a8)]>0x0);}export function isSingleVersionMode(_0x84880e){const _0x330d52=a147_0x24788c;return!!(_0x84880e[_0x330d52(0x24e)]&&_0x84880e['stages'][_0x330d52(0x2a8)]>0x0);}export function hasMultipleVersions(_0x30ef58){const _0x42bef7=a147_0x24788c;if(isJourneysArrayMode(_0x30ef58))return(_0x30ef58[_0x42bef7(0x22d)]?.[_0x42bef7(0x2a8)]||0x0)>0x1;if(isMultiVersionMode(_0x30ef58))return(_0x30ef58['versions']?.[_0x42bef7(0x2a8)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x923d20){const _0x326d5e=a147_0x24788c;if(isJourneysArrayMode(_0x923d20))return _0x923d20;if(isSingleVersionMode(_0x923d20)){const {stages:_0x4c706b,id:_0x1bbfdd,version:_0x57c31c,version_number:_0x5467d8,..._0x31e163}=_0x923d20;return{..._0x31e163,'journeys':[{'version':_0x57c31c||'v1','stages':_0x4c706b||[],'id':_0x1bbfdd,'version_number':_0x5467d8}]};}if(isMultiVersionMode(_0x923d20)){const {versions:_0x71bdbd,..._0x3bc18b}=_0x923d20;return{..._0x3bc18b,'journeys':(_0x71bdbd||[])[_0x326d5e(0x2b2)](_0x9169cc=>({'version':_0x9169cc[_0x326d5e(0x297)],'state':_0x9169cc['state'],'latest':_0x9169cc[_0x326d5e(0x29b)],'stages':_0x9169cc[_0x326d5e(0x24e)],'id':_0x9169cc['id'],'version_number':_0x9169cc[_0x326d5e(0x28a)]}))};}return _0x923d20;}export function normalizeJourneyDef(_0x41aea6,_0x52b5ba){const _0x32102c=a147_0x24788c,_0x25c963=normalizeToJourneysFormat(_0x41aea6),_0x1cc622=_0x52b5ba?.[_0x32102c(0x213)]?Object['keys'](_0x52b5ba[_0x32102c(0x213)]):undefined,_0x1dc334=_0x52b5ba?.[_0x32102c(0x23c)]?Object[_0x32102c(0x22e)](_0x52b5ba[_0x32102c(0x23c)]):undefined;return{'type':'journey','name':_0x25c963[_0x32102c(0x297)],..._0x25c963[_0x32102c(0x206)]!==undefined&&{'description':_0x25c963['description']},..._0x25c963[_0x32102c(0x25c)]&&{'goal':normalizeJourneyCriteria(_0x25c963[_0x32102c(0x25c)])},..._0x25c963[_0x32102c(0x22a)]!==undefined&&{'reentry':_0x25c963[_0x32102c(0x22a)]},..._0x25c963[_0x32102c(0x213)]&&{'segments':normalizeEmbeddedSegments(_0x25c963['segments'],_0x1cc622)},..._0x25c963[_0x32102c(0x23c)]&&{'activations':normalizeEmbeddedActivations(_0x25c963[_0x32102c(0x23c)],_0x1dc334)},..._0x25c963['journeys']&&{'journeys':_0x25c963[_0x32102c(0x22d)][_0x32102c(0x2b2)](_0xede43b=>normalizeJourneyEntry(_0xede43b,_0x25c963[_0x32102c(0x22d)][_0x32102c(0x2a8)]===0x1))}};}function normalizeJourneyEntry(_0x4bd5e2,_0x1291d6){const _0x1ca5ca=a147_0x24788c;return{...!_0x1291d6&&_0x4bd5e2['version']!==undefined&&{'version':_0x4bd5e2['version']},..._0x4bd5e2[_0x1ca5ca(0x261)]!==undefined&&{'state':_0x4bd5e2[_0x1ca5ca(0x261)]},...!_0x1291d6&&_0x4bd5e2['latest']!==undefined&&{'latest':_0x4bd5e2[_0x1ca5ca(0x29b)]},..._0x4bd5e2[_0x1ca5ca(0x28a)]!==undefined&&{'version_number':_0x4bd5e2[_0x1ca5ca(0x28a)]},..._0x4bd5e2[_0x1ca5ca(0x25c)]&&{'goal':normalizeJourneyCriteria(_0x4bd5e2[_0x1ca5ca(0x25c)])},..._0x4bd5e2[_0x1ca5ca(0x22a)]!==undefined&&{'reentry':_0x4bd5e2[_0x1ca5ca(0x22a)]},'stages':_0x4bd5e2[_0x1ca5ca(0x24e)][_0x1ca5ca(0x2b2)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x363df9){const _0x3f9186=a147_0x24788c;return{'name':_0x363df9[_0x3f9186(0x297)],..._0x363df9[_0x3f9186(0x206)]!==undefined&&{'description':_0x363df9[_0x3f9186(0x206)]},..._0x363df9[_0x3f9186(0x1ff)]&&{'entry_criteria':normalizeJourneyCriteria(_0x363df9[_0x3f9186(0x1ff)])},..._0x363df9[_0x3f9186(0x281)]&&{'exit_criteria':_0x363df9[_0x3f9186(0x281)][_0x3f9186(0x2b2)](normalizeJourneyCriteria)},..._0x363df9[_0x3f9186(0x22b)]&&{'milestone':normalizeJourneyCriteria(_0x363df9[_0x3f9186(0x22b)])},..._0x363df9[_0x3f9186(0x291)]&&{'steps':normalizeStepsWithImplicitNext(_0x363df9[_0x3f9186(0x291)])}};}function normalizeStepsWithImplicitNext(_0x35770a){const _0xe9edca=a147_0x24788c;return _0x35770a[_0xe9edca(0x2b2)]((_0x775fd3,_0x3531af)=>{const _0x5f0091=_0xe9edca,_0x534068=_0x3531af<_0x35770a[_0x5f0091(0x2a8)]-0x1?_0x35770a[_0x3531af+0x1]['name']:undefined;return normalizeJourneyStep(_0x775fd3,_0x534068);});}function normalizeJourneyCriteria(_0x3a3e22){const _0x274031=a147_0x24788c;return{'name':_0x3a3e22[_0x274031(0x297)],..._0x3a3e22[_0x274031(0x206)]!==undefined&&{'description':_0x3a3e22[_0x274031(0x206)]},'segment':_0x3a3e22[_0x274031(0x25e)],..._0x3a3e22['target']&&{'target':normalizeJumpTarget(_0x3a3e22[_0x274031(0x2b9)])}};}function normalizeJourneyStep(_0x16a3bd,_0x4fe186){const _0x438afc=a147_0x24788c,_0x1b7544=_0x16a3bd[_0x438afc(0x229)]!==undefined&&_0x16a3bd[_0x438afc(0x229)]!==_0x4fe186,_0x1f802c={'type':_0x16a3bd['type'],'name':_0x16a3bd['name'],..._0x1b7544&&{'next':_0x16a3bd[_0x438afc(0x229)]}};if(_0x438afc(0x26b)in _0x16a3bd&&_0x16a3bd[_0x438afc(0x26b)])return{..._0x1f802c,'with':normalizeStepParams(_0x16a3bd[_0x438afc(0x2a6)],_0x16a3bd[_0x438afc(0x26b)])};return _0x1f802c;}function normalizeStepParams(_0x428419,_0x56b836){const _0x1b9e57=a147_0x24788c;switch(_0x428419){case _0x1b9e57(0x285):{const _0x39032e=_0x56b836;let _0x103429;return _0x39032e[_0x1b9e57(0x279)]&&(_0x103429={'segment':_0x39032e['condition']['segment'],..._0x39032e[_0x1b9e57(0x279)]['next']!==undefined&&{'next':_0x39032e[_0x1b9e57(0x279)][_0x1b9e57(0x229)]},..._0x39032e[_0x1b9e57(0x279)]['timeout']&&{'timeout':{'duration':_0x39032e[_0x1b9e57(0x279)][_0x1b9e57(0x240)][_0x1b9e57(0x296)],'unit':_0x39032e[_0x1b9e57(0x279)][_0x1b9e57(0x240)]['unit'],..._0x39032e[_0x1b9e57(0x279)][_0x1b9e57(0x240)][_0x1b9e57(0x229)]!==undefined&&{'next':_0x39032e[_0x1b9e57(0x279)]['timeout'][_0x1b9e57(0x229)]}}}}),{..._0x39032e['duration']!==undefined&&{'duration':_0x39032e[_0x1b9e57(0x296)]},..._0x39032e[_0x1b9e57(0x28b)]!==undefined&&{'unit':_0x39032e[_0x1b9e57(0x28b)]},..._0x39032e[_0x1b9e57(0x274)]!==undefined&&{'wait_until':_0x39032e['wait_until']},..._0x39032e[_0x1b9e57(0x25b)]!==undefined&&{'days_of_week':_0x39032e['days_of_week']},..._0x103429&&{'condition':_0x103429}};}case _0x1b9e57(0x260):{const _0x5ada08=_0x56b836;return{'activation':_0x5ada08[_0x1b9e57(0x260)]};}case _0x1b9e57(0x24a):{const _0x2ef887=_0x56b836;return{'branches':_0x2ef887[_0x1b9e57(0x1fa)][_0x1b9e57(0x2b2)](normalizeDecisionBranch)};}case'ab_test':{const _0xf715ff=_0x56b836;return{..._0xf715ff[_0x1b9e57(0x2bb)]!==undefined&&{'customized_split':_0xf715ff[_0x1b9e57(0x2bb)]},..._0xf715ff[_0x1b9e57(0x2ac)]!==undefined&&{'unique_id':_0xf715ff['unique_id']},'variants':_0xf715ff[_0x1b9e57(0x207)][_0x1b9e57(0x2b2)](normalizeAbTestVariant)};}case _0x1b9e57(0x2aa):{const _0x172274=_0x56b836;return{'target':normalizeJumpTarget(_0x172274['target'])};}default:return _0x56b836;}}function normalizeDecisionBranch(_0x3e04a3){const _0x49ff6a=a147_0x24788c;return{'name':_0x3e04a3[_0x49ff6a(0x297)],..._0x3e04a3[_0x49ff6a(0x25e)]!==undefined&&{'segment':_0x3e04a3['segment']},..._0x3e04a3[_0x49ff6a(0x2a2)]!==undefined&&{'excluded':_0x3e04a3[_0x49ff6a(0x2a2)]},..._0x3e04a3[_0x49ff6a(0x229)]!==undefined&&{'next':_0x3e04a3['next']}};}function normalizeAbTestVariant(_0x246c5e){const _0x911639=a147_0x24788c;return{..._0x246c5e['id']!==undefined&&{'id':_0x246c5e['id']},'name':_0x246c5e['name'],'percentage':_0x246c5e[_0x911639(0x239)],..._0x246c5e[_0x911639(0x229)]!==undefined&&{'next':_0x246c5e[_0x911639(0x229)]}};}function normalizeJumpTarget(_0x51f65a){const _0x4dbfb8=a147_0x24788c;return{'journey':_0x51f65a['journey'],'stage':_0x51f65a[_0x4dbfb8(0x245)],..._0x51f65a[_0x4dbfb8(0x276)]!==undefined&&{'bundle_id':_0x51f65a['bundle_id']}};}function normalizeEmbeddedSegments(_0x1074fc,_0xbe4470){const _0xddf081=a147_0x24788c,_0x4d16e0={},_0x12efa8=Object[_0xddf081(0x22e)](_0x1074fc),_0x3abb41=_0xbe4470?[..._0xbe4470[_0xddf081(0x2a3)](_0x22db92=>_0x12efa8[_0xddf081(0x283)](_0x22db92)),..._0x12efa8[_0xddf081(0x2a3)](_0x2b4fd3=>!_0xbe4470[_0xddf081(0x283)](_0x2b4fd3))['sort']()]:_0x12efa8[_0xddf081(0x242)]();for(const _0x5b4dc1 of _0x3abb41){const _0x1a3110=_0x1074fc[_0x5b4dc1];if(_0x1a3110['rule']){const _0x1b164b=_0x1a3110['rule'];if(_0x1b164b[_0xddf081(0x2a6)]!==_0xddf081(0x2af)&&_0x1b164b[_0xddf081(0x2a6)]!=='Or'){const _0x3ee690=_0x1b164b[_0xddf081(0x2a6)]??_0xddf081(0x256);throw new SDKError(ErrorCode[_0xddf081(0x23a)],_0xddf081(0x292)+_0x5b4dc1+_0xddf081(0x2bd)+(_0xddf081(0x226)+_0x3ee690+_0xddf081(0x208))+_0xddf081(0x21b)+_0xddf081(0x2ae)+_0xddf081(0x24f)+'\x20\x20\x20\x20conditions:\x0a'+_0xddf081(0x262)+_0xddf081(0x278)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x1b164b[_0xddf081(0x233)]||!Array[_0xddf081(0x220)](_0x1b164b[_0xddf081(0x233)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0xddf081(0x292)+_0x5b4dc1+'\x27:\x20'+_0xddf081(0x264)+'Expected\x20format:\x0a'+_0xddf081(0x2ae)+(_0xddf081(0x2ba)+_0x1b164b['type']+'\x0a')+_0xddf081(0x215)+_0xddf081(0x262)+_0xddf081(0x278)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x4d16e0[_0x5b4dc1]={..._0x1a3110[_0xddf081(0x206)]&&_0x1a3110[_0xddf081(0x206)][_0xddf081(0x21e)]()&&{'description':_0x1a3110[_0xddf081(0x206)]},..._0x1a3110['rule']&&{'rule':deepSortObject(_0x1a3110['rule'])}};}return _0x4d16e0;}function normalizeEmbeddedActivations(_0x58bc4a,_0x326565){const _0xc8395b=a147_0x24788c,_0x336f78={},_0x26d2a9=Object[_0xc8395b(0x22e)](_0x58bc4a),_0x569e76=_0x326565?[..._0x326565['filter'](_0x2fbe60=>_0x26d2a9[_0xc8395b(0x283)](_0x2fbe60)),..._0x26d2a9['filter'](_0x11980b=>!_0x326565[_0xc8395b(0x283)](_0x11980b))[_0xc8395b(0x242)]()]:_0x26d2a9[_0xc8395b(0x242)]();for(const _0x5899ab of _0x569e76){const _0xd3752e=_0x58bc4a[_0x5899ab];_0x336f78[_0x5899ab]={'name':_0xd3752e[_0xc8395b(0x297)],'connection':_0xd3752e[_0xc8395b(0x257)],..._0xd3752e['description']!==undefined&&{'description':_0xd3752e[_0xc8395b(0x206)]},..._0xd3752e[_0xc8395b(0x27c)]!==undefined&&{'all_columns':_0xd3752e[_0xc8395b(0x27c)]},..._0xd3752e[_0xc8395b(0x24b)]!==undefined&&{'columns':_0xd3752e[_0xc8395b(0x24b)]},..._0xd3752e['behavior']!==undefined&&{'behavior':_0xd3752e['behavior']},..._0xd3752e[_0xc8395b(0x252)]!==undefined&&{'schedule':_0xd3752e[_0xc8395b(0x252)]},..._0xd3752e['notification']!==undefined&&{'notification':_0xd3752e[_0xc8395b(0x280)]},..._0xd3752e[_0xc8395b(0x2b1)]!==undefined&&{'connector_config':_0xd3752e[_0xc8395b(0x2b1)]},..._0xd3752e['activation_template_id']!==undefined&&{'activation_template_id':_0xd3752e[_0xc8395b(0x2b0)]}};}return _0x336f78;}export function getActiveStages(_0x39a358){const _0x5b5729=a147_0x24788c;if(isJourneysArrayMode(_0x39a358)){const _0x1eee4b=_0x39a358['journeys']||[],_0x194fee=_0x1eee4b[_0x5b5729(0x235)](_0x51348c=>_0x51348c[_0x5b5729(0x29b)]===!![])||_0x1eee4b[0x0];return _0x194fee?.['stages']||[];}if(isSingleVersionMode(_0x39a358))return _0x39a358[_0x5b5729(0x24e)]||[];if(isMultiVersionMode(_0x39a358)){const _0x448ddf=_0x39a358[_0x5b5729(0x25d)]||[],_0x2d370f=_0x448ddf['find'](_0x939ac1=>_0x939ac1[_0x5b5729(0x29b)]===!![])||_0x448ddf[0x0];return _0x2d370f?.[_0x5b5729(0x24e)]||[];}return[];}export function getLatestJourneyEntry(_0x1ed21a){const _0x9c8b9c=a147_0x24788c;if(isJourneysArrayMode(_0x1ed21a)){const _0x317fec=_0x1ed21a[_0x9c8b9c(0x22d)]||[];return _0x317fec[_0x9c8b9c(0x235)](_0x2d5893=>_0x2d5893[_0x9c8b9c(0x29b)]===!![])||_0x317fec[0x0];}if(isMultiVersionMode(_0x1ed21a)){const _0x1ac932=_0x1ed21a[_0x9c8b9c(0x25d)]||[],_0x250ede=_0x1ac932[_0x9c8b9c(0x235)](_0x77ec2=>_0x77ec2[_0x9c8b9c(0x29b)]===!![])||_0x1ac932[0x0];if(_0x250ede)return{'version':_0x250ede[_0x9c8b9c(0x297)],'state':_0x250ede[_0x9c8b9c(0x261)],'latest':_0x250ede[_0x9c8b9c(0x29b)],'stages':_0x250ede[_0x9c8b9c(0x24e)],'id':_0x250ede['id'],'version_number':_0x250ede[_0x9c8b9c(0x28a)]};}if(isSingleVersionMode(_0x1ed21a))return{'version':_0x1ed21a[_0x9c8b9c(0x1fe)]||'v1','state':'draft','stages':_0x1ed21a[_0x9c8b9c(0x24e)]||[],'id':_0x1ed21a['id'],'version_number':_0x1ed21a[_0x9c8b9c(0x28a)],'goal':_0x1ed21a[_0x9c8b9c(0x25c)],'reentry':_0x1ed21a[_0x9c8b9c(0x22a)]};return undefined;}export function getLatestVersion(_0x2031b9){const _0x39a534=a147_0x24788c;if(!isMultiVersionMode(_0x2031b9))return undefined;const _0x2c640f=_0x2031b9['versions']||[];return _0x2c640f[_0x39a534(0x235)](_0x2bdefc=>_0x2bdefc[_0x39a534(0x29b)]===!![])||_0x2c640f[0x0];}export function getEffectiveGoal(_0x38d04b){const _0x1411de=a147_0x24788c,_0x1bbad9=getLatestJourneyEntry(_0x38d04b);return _0x1bbad9?.[_0x1411de(0x25c)]||_0x38d04b[_0x1411de(0x25c)];}export function getEffectiveReentry(_0x3f51eb){const _0x5797bf=a147_0x24788c,_0x2682d3=getLatestJourneyEntry(_0x3f51eb);return _0x2682d3?.[_0x5797bf(0x22a)]||_0x3f51eb[_0x5797bf(0x22a)];}export function collectSegmentRefs(_0x17d828){const _0x3839f7=a147_0x24788c,_0x2bc41e=new Set();_0x17d828['goal']?.['segment']&&_0x2bc41e['add'](_0x17d828['goal'][_0x3839f7(0x25e)]);const _0x2fb7bf=_0xc8cefe=>{const _0x34f27d=_0x3839f7;for(const _0x3adfdc of _0xc8cefe){_0x3adfdc[_0x34f27d(0x1ff)]?.['segment']&&_0x2bc41e[_0x34f27d(0x1f4)](_0x3adfdc[_0x34f27d(0x1ff)][_0x34f27d(0x25e)]);if(_0x3adfdc[_0x34f27d(0x281)])for(const _0x4e5bc9 of _0x3adfdc[_0x34f27d(0x281)]){_0x4e5bc9[_0x34f27d(0x25e)]&&_0x2bc41e[_0x34f27d(0x1f4)](_0x4e5bc9[_0x34f27d(0x25e)]);}_0x3adfdc[_0x34f27d(0x22b)]?.[_0x34f27d(0x25e)]&&_0x2bc41e[_0x34f27d(0x1f4)](_0x3adfdc['milestone'][_0x34f27d(0x25e)]);if(_0x3adfdc['steps'])for(const _0x16a18a of _0x3adfdc[_0x34f27d(0x291)]){if(_0x16a18a[_0x34f27d(0x2a6)]===_0x34f27d(0x24a)){const _0x47b74d=_0x16a18a;for(const _0x3c3ddf of _0x47b74d[_0x34f27d(0x26b)][_0x34f27d(0x1fa)]){_0x3c3ddf[_0x34f27d(0x25e)]&&_0x2bc41e['add'](_0x3c3ddf[_0x34f27d(0x25e)]);}}else{if(_0x16a18a[_0x34f27d(0x2a6)]===_0x34f27d(0x285)){const _0x5177c7=_0x16a18a;_0x5177c7['with'][_0x34f27d(0x279)]?.[_0x34f27d(0x25e)]&&_0x2bc41e[_0x34f27d(0x1f4)](_0x5177c7['with'][_0x34f27d(0x279)]['segment']);}}}}};_0x17d828[_0x3839f7(0x24e)]&&_0x2fb7bf(_0x17d828['stages']);if(_0x17d828[_0x3839f7(0x25d)])for(const _0x46f5b7 of _0x17d828[_0x3839f7(0x25d)]){_0x2fb7bf(_0x46f5b7[_0x3839f7(0x24e)]);}return _0x2bc41e;}export function validateSegmentRefs(_0x321b82){const _0x12d738=a147_0x24788c,_0x4b6f08=[],_0x432ee5=collectSegmentRefs(_0x321b82),_0x103658=new Set(Object[_0x12d738(0x22e)](_0x321b82[_0x12d738(0x213)]||{}));for(const _0x18e4e0 of _0x432ee5){const _0x98be65=parseSegmentRef(_0x18e4e0);_0x98be65[_0x12d738(0x2a6)]===_0x12d738(0x253)&&!_0x103658['has'](_0x98be65[_0x12d738(0x297)])&&_0x4b6f08[_0x12d738(0x200)](_0x12d738(0x26f)+_0x98be65[_0x12d738(0x297)]+_0x12d738(0x266)+_0x98be65[_0x12d738(0x297)]+_0x12d738(0x202));}return _0x4b6f08;}export function collectSegmentIdsFromJourneyApi(_0x4f7e6d){const _0x4d5fdd=a147_0x24788c,_0x342a88=new Set();_0x4f7e6d['attributes'][_0x4d5fdd(0x25c)]?.[_0x4d5fdd(0x1fd)]&&_0x342a88[_0x4d5fdd(0x1f4)](_0x4f7e6d['attributes'][_0x4d5fdd(0x25c)]['segmentId']);const _0xce960e=_0x4f7e6d[_0x4d5fdd(0x232)]['journeyStages'];if(Array['isArray'](_0xce960e))for(const _0x10d166 of _0xce960e){_0x10d166[_0x4d5fdd(0x29f)]?.[_0x4d5fdd(0x1fd)]&&_0x342a88['add'](_0x10d166[_0x4d5fdd(0x29f)][_0x4d5fdd(0x1fd)]);const _0x19d855=_0x10d166['exitCriterias']??_0x10d166[_0x4d5fdd(0x272)];if(Array['isArray'](_0x19d855))for(const _0x4b83d5 of _0x19d855){_0x4b83d5[_0x4d5fdd(0x1fd)]&&_0x342a88[_0x4d5fdd(0x1f4)](_0x4b83d5[_0x4d5fdd(0x1fd)]);}_0x10d166[_0x4d5fdd(0x22b)]?.[_0x4d5fdd(0x1fd)]&&_0x342a88[_0x4d5fdd(0x1f4)](_0x10d166[_0x4d5fdd(0x22b)][_0x4d5fdd(0x1fd)]);if(_0x10d166['steps']&&typeof _0x10d166['steps']===_0x4d5fdd(0x211)){const _0xe98ccc=Array[_0x4d5fdd(0x220)](_0x10d166[_0x4d5fdd(0x291)])?_0x10d166['steps']:Object[_0x4d5fdd(0x2b7)](_0x10d166[_0x4d5fdd(0x291)]);for(const _0x49b4d9 of _0xe98ccc){_0x49b4d9[_0x4d5fdd(0x204)]?.[_0x4d5fdd(0x1fd)]&&_0x342a88[_0x4d5fdd(0x1f4)](_0x49b4d9[_0x4d5fdd(0x204)][_0x4d5fdd(0x1fd)]);const _0x51d7b6=_0x49b4d9;_0x51d7b6['conditionSegmentId']&&_0x342a88[_0x4d5fdd(0x1f4)](_0x51d7b6[_0x4d5fdd(0x255)]);if(Array[_0x4d5fdd(0x220)](_0x51d7b6[_0x4d5fdd(0x233)]))for(const _0x3f590e of _0x51d7b6[_0x4d5fdd(0x233)]){_0x3f590e['segmentId']&&_0x342a88[_0x4d5fdd(0x1f4)](_0x3f590e['segmentId']);}if(Array[_0x4d5fdd(0x220)](_0x49b4d9[_0x4d5fdd(0x1fa)]))for(const _0x52a28c of _0x49b4d9[_0x4d5fdd(0x1fa)]){_0x52a28c[_0x4d5fdd(0x1fd)]&&_0x342a88[_0x4d5fdd(0x1f4)](_0x52a28c[_0x4d5fdd(0x1fd)]);}}}}return _0x342a88;}
|
|
1
|
+
function a147_0x3a14(_0x27eb77,_0x100db0){_0x27eb77=_0x27eb77-0x194;const _0x28af54=a147_0x28af();let _0x3a140a=_0x28af54[_0x27eb77];return _0x3a140a;}const a147_0x4d9c99=a147_0x3a14;(function(_0x39e0cc,_0x220508){const _0x49036d=a147_0x3a14,_0x9fea87=_0x39e0cc();while(!![]){try{const _0x57742a=parseInt(_0x49036d(0x246))/0x1*(parseInt(_0x49036d(0x1d2))/0x2)+parseInt(_0x49036d(0x20b))/0x3+parseInt(_0x49036d(0x1ca))/0x4*(-parseInt(_0x49036d(0x1d8))/0x5)+-parseInt(_0x49036d(0x1ab))/0x6+-parseInt(_0x49036d(0x224))/0x7+-parseInt(_0x49036d(0x1e0))/0x8*(-parseInt(_0x49036d(0x1cd))/0x9)+parseInt(_0x49036d(0x1d6))/0xa;if(_0x57742a===_0x220508)break;else _0x9fea87['push'](_0x9fea87['shift']());}catch(_0x5c71fc){_0x9fea87['push'](_0x9fea87['shift']());}}}(a147_0x28af,0x206db));import*as a147_0x327dd2 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x43c424){const _0xadcb22=a147_0x3a14,_0x386446=_0x43c424[_0xadcb22(0x247)]();if(_0x386446===_0xadcb22(0x22d)||_0x386446===_0xadcb22(0x1ae))return _0xadcb22(0x1ae);if(_0x386446===_0xadcb22(0x1f0)||_0x386446===_0xadcb22(0x213))return _0xadcb22(0x213);return _0x43c424;}export function journeyResponseToDefSync(_0x2e3a2e){const _0x4f481c=a147_0x3a14,_0x35210e=_0x2e3a2e[_0x4f481c(0x202)],_0x7f1008=_0x35210e[_0x4f481c(0x19e)]||_0x35210e[_0x4f481c(0x1a5)],_0x2c714f={'stages':_0x35210e[_0x4f481c(0x228)][_0x4f481c(0x1ef)](convertApiStageToYaml),'id':_0x2e3a2e['id']};_0x35210e[_0x4f481c(0x22b)]&&(_0x2c714f[_0x4f481c(0x22b)]=convertApiCriteriaToYaml(_0x35210e[_0x4f481c(0x22b)]));_0x35210e[_0x4f481c(0x1a5)]&&_0x35210e[_0x4f481c(0x1a5)]!==_0x7f1008&&(_0x2c714f[_0x4f481c(0x226)]=_0x35210e[_0x4f481c(0x1a5)]);_0x35210e[_0x4f481c(0x1a7)]!==undefined&&(_0x2c714f['version_number']=_0x35210e[_0x4f481c(0x1a7)]);_0x35210e['state']&&(_0x2c714f[_0x4f481c(0x1cf)]=_0x35210e['state']==='launched'?_0x4f481c(0x1b1):_0x4f481c(0x1f1));const _0x5be2ec={'type':_0x4f481c(0x237),'name':_0x7f1008,'journeys':[_0x2c714f]};_0x35210e[_0x4f481c(0x225)]&&(_0x5be2ec[_0x4f481c(0x225)]=_0x35210e['description']);_0x35210e['goal']&&(_0x5be2ec[_0x4f481c(0x22b)]=convertApiCriteriaToYaml(_0x35210e[_0x4f481c(0x22b)]));if(_0x35210e[_0x4f481c(0x1f8)])_0x5be2ec['reentry']=_0x35210e[_0x4f481c(0x1f8)];else _0x35210e['allowReentry']!==undefined&&(_0x5be2ec[_0x4f481c(0x1e9)]=_0x35210e[_0x4f481c(0x23f)]?_0x4f481c(0x1d4):_0x4f481c(0x221));return _0x35210e[_0x4f481c(0x1bd)]&&(_0x5be2ec['bundle_id']=_0x35210e[_0x4f481c(0x1bd)]),_0x35210e[_0x4f481c(0x19e)]&&(_0x5be2ec[_0x4f481c(0x211)]=_0x35210e[_0x4f481c(0x19e)]),_0x2e3a2e[_0x4f481c(0x1d9)]?.['parentFolder']?.[_0x4f481c(0x1fe)]?.['id']&&(_0x5be2ec[_0x4f481c(0x19f)]=_0x2e3a2e[_0x4f481c(0x1d9)][_0x4f481c(0x1f4)][_0x4f481c(0x1fe)]['id']),_0x5be2ec;}export async function journeyResponseToDef(_0x2f340d,_0x26639d){const _0x1a4430=a147_0x3a14,_0x2ecf2a=journeyResponseToDefSync(_0x2f340d);if(!_0x26639d)return _0x2ecf2a;const _0xfdf875=new Set();collectSegmentIdsFromJourney(_0x2ecf2a,_0xfdf875);const _0x2d175e=new Set();collectActivationIdsFromJourney(_0x2ecf2a,_0x2d175e);const _0x143a99={},_0x5add38=new Map();for(const _0x37683e of Array['from'](_0xfdf875)[_0x1a4430(0x1bf)]()){if(_0x26639d[_0x1a4430(0x1cc)]){const _0x51498c=await _0x26639d[_0x1a4430(0x1cc)](_0x37683e);if(_0x51498c[_0x1a4430(0x1f7)]){_0x5add38[_0x1a4430(0x1b8)](_0x37683e,_0x51498c[_0x1a4430(0x1a5)]);if(_0x51498c[_0x1a4430(0x200)]){const _0x4722d3={..._0x51498c[_0x1a4430(0x200)],'rule':deepSortObject(_0x51498c[_0x1a4430(0x200)][_0x1a4430(0x1f3)])};_0x143a99[_0x51498c[_0x1a4430(0x1a5)]]=_0x4722d3;}}else _0x5add38[_0x1a4430(0x1b8)](_0x37683e,makeSegmentRef(_0x51498c['name']));}else{if(_0x26639d[_0x1a4430(0x212)]){const _0x1bf34f=await _0x26639d[_0x1a4430(0x212)](_0x37683e);_0x5add38[_0x1a4430(0x1b8)](_0x37683e,_0x1bf34f);}}}const _0x478f31={},_0x1b44b3=new Map();for(const _0x47613f of Array[_0x1a4430(0x19a)](_0x2d175e)[_0x1a4430(0x1bf)]()){if(_0x26639d['resolveActivation']){const _0x4e6cb3=await _0x26639d[_0x1a4430(0x1dc)](_0x47613f);_0x4e6cb3['isJourneyLocal']?(_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,_0x4e6cb3['name']),_0x4e6cb3[_0x1a4430(0x200)]&&(_0x478f31[_0x4e6cb3['name']]=_0x4e6cb3['definition'])):_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,makeSegmentRef(_0x4e6cb3[_0x1a4430(0x1a5)]));}else{if(_0x26639d[_0x1a4430(0x1e1)]){const _0x3bb4d0=await _0x26639d['resolveActivationName'](_0x47613f);_0x1b44b3[_0x1a4430(0x1b8)](_0x47613f,_0x3bb4d0);}}}_0x5add38['size']>0x0&&replaceSegmentIdsInJourney(_0x2ecf2a,_0x5add38);_0x1b44b3['size']>0x0&&replaceActivationIdsInJourney(_0x2ecf2a,_0x1b44b3);if(_0x26639d[_0x1a4430(0x1ea)]){const _0x5de1c3=[];collectJumpTargetsFromJourney(_0x2ecf2a,_0x5de1c3);if(_0x5de1c3[_0x1a4430(0x1e2)]>0x0){const _0x54d8a0=new Map();for(const _0x24633b of _0x5de1c3){try{const _0x3c54d1=await _0x26639d[_0x1a4430(0x1ea)](_0x24633b[_0x1a4430(0x22a)],_0x24633b[_0x1a4430(0x234)]);_0x54d8a0['set'](_0x24633b[_0x1a4430(0x22a)]+':'+_0x24633b[_0x1a4430(0x234)],_0x3c54d1);}catch{}}_0x54d8a0[_0x1a4430(0x1e8)]>0x0&&replaceJumpTargetsInJourney(_0x2ecf2a,_0x54d8a0);}}return Object['keys'](_0x143a99)[_0x1a4430(0x1e2)]>0x0&&(_0x2ecf2a['segments']=_0x143a99),Object[_0x1a4430(0x1c7)](_0x478f31)[_0x1a4430(0x1e2)]>0x0&&(_0x2ecf2a[_0x1a4430(0x1b6)]=_0x478f31),_0x2ecf2a;}function collectSegmentIdsFromJourney(_0x2d6418,_0x244525){const _0x43600b=a147_0x3a14;_0x2d6418[_0x43600b(0x22b)]?.['segment']&&_0x244525[_0x43600b(0x195)](_0x2d6418[_0x43600b(0x22b)][_0x43600b(0x208)]);const _0x52e211=_0x729efc=>{const _0x648ef0=_0x43600b;for(const _0x569897 of _0x729efc){_0x569897[_0x648ef0(0x21f)]?.[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x569897[_0x648ef0(0x21f)][_0x648ef0(0x208)]);if(_0x569897[_0x648ef0(0x1c6)])for(const _0x5bef17 of _0x569897[_0x648ef0(0x1c6)]){_0x5bef17[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x5bef17[_0x648ef0(0x208)]);}_0x569897[_0x648ef0(0x1ec)]?.['segment']&&_0x244525['add'](_0x569897[_0x648ef0(0x1ec)]['segment']);if(_0x569897['steps'])for(const _0x3939ac of _0x569897[_0x648ef0(0x206)]){if(_0x3939ac[_0x648ef0(0x1fb)]===_0x648ef0(0x255)){const _0x44836e=_0x3939ac;for(const _0x241e69 of _0x44836e[_0x648ef0(0x20f)][_0x648ef0(0x216)]){_0x241e69[_0x648ef0(0x208)]&&_0x244525[_0x648ef0(0x195)](_0x241e69[_0x648ef0(0x208)]);}}else{if(_0x3939ac[_0x648ef0(0x1fb)]===_0x648ef0(0x1b7)){const _0x1c2479=_0x3939ac;_0x1c2479[_0x648ef0(0x20f)][_0x648ef0(0x24b)]?.[_0x648ef0(0x208)]&&_0x244525['add'](_0x1c2479[_0x648ef0(0x20f)][_0x648ef0(0x24b)]['segment']);}}}}};if(_0x2d6418['journeys'])for(const _0x454c6b of _0x2d6418[_0x43600b(0x1e5)]){_0x454c6b[_0x43600b(0x22b)]?.['segment']&&_0x244525['add'](_0x454c6b[_0x43600b(0x22b)][_0x43600b(0x208)]),_0x52e211(_0x454c6b[_0x43600b(0x1a9)]);}_0x2d6418[_0x43600b(0x1a9)]&&_0x52e211(_0x2d6418[_0x43600b(0x1a9)]);if(_0x2d6418[_0x43600b(0x1c0)])for(const _0x58c2a1 of _0x2d6418[_0x43600b(0x1c0)]){_0x52e211(_0x58c2a1[_0x43600b(0x1a9)]);}}function replaceSegmentIdsInJourney(_0x351ea2,_0x3d0003){const _0x49ca66=a147_0x3a14,_0x250633=_0x42faf1=>_0x3d0003[_0x49ca66(0x232)](_0x42faf1)||_0x42faf1;_0x351ea2['goal']?.[_0x49ca66(0x208)]&&(_0x351ea2[_0x49ca66(0x22b)][_0x49ca66(0x208)]=_0x250633(_0x351ea2['goal'][_0x49ca66(0x208)]));const _0x27d492=_0x19b86a=>{const _0x5b878c=_0x49ca66;for(const _0x15dc43 of _0x19b86a){_0x15dc43[_0x5b878c(0x21f)]?.[_0x5b878c(0x208)]&&(_0x15dc43[_0x5b878c(0x21f)][_0x5b878c(0x208)]=_0x250633(_0x15dc43[_0x5b878c(0x21f)][_0x5b878c(0x208)]));if(_0x15dc43[_0x5b878c(0x1c6)])for(const _0x2b67a8 of _0x15dc43[_0x5b878c(0x1c6)]){_0x2b67a8['segment']&&(_0x2b67a8['segment']=_0x250633(_0x2b67a8[_0x5b878c(0x208)]));}_0x15dc43[_0x5b878c(0x1ec)]?.[_0x5b878c(0x208)]&&(_0x15dc43[_0x5b878c(0x1ec)][_0x5b878c(0x208)]=_0x250633(_0x15dc43['milestone']['segment']));if(_0x15dc43[_0x5b878c(0x206)])for(const _0x20e726 of _0x15dc43['steps']){if(_0x20e726[_0x5b878c(0x1fb)]==='decision_point'){const _0x11174b=_0x20e726;for(const _0x139594 of _0x11174b[_0x5b878c(0x20f)][_0x5b878c(0x216)]){_0x139594[_0x5b878c(0x208)]&&(_0x139594['segment']=_0x250633(_0x139594[_0x5b878c(0x208)]));}}else{if(_0x20e726[_0x5b878c(0x1fb)]===_0x5b878c(0x1b7)){const _0x3e60cb=_0x20e726;_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)]?.[_0x5b878c(0x208)]&&(_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)][_0x5b878c(0x208)]=_0x250633(_0x3e60cb[_0x5b878c(0x20f)][_0x5b878c(0x24b)][_0x5b878c(0x208)]));}}}}};if(_0x351ea2[_0x49ca66(0x1e5)])for(const _0x3222c3 of _0x351ea2[_0x49ca66(0x1e5)]){_0x3222c3[_0x49ca66(0x22b)]?.[_0x49ca66(0x208)]&&(_0x3222c3['goal'][_0x49ca66(0x208)]=_0x250633(_0x3222c3[_0x49ca66(0x22b)][_0x49ca66(0x208)])),_0x27d492(_0x3222c3['stages']);}_0x351ea2['stages']&&_0x27d492(_0x351ea2[_0x49ca66(0x1a9)]);if(_0x351ea2[_0x49ca66(0x1c0)])for(const _0x5d6eaf of _0x351ea2[_0x49ca66(0x1c0)]){_0x27d492(_0x5d6eaf[_0x49ca66(0x1a9)]);}}function collectActivationIdsFromJourney(_0x1200ff,_0x22d11e){const _0x4920f6=a147_0x3a14,_0x50e107=_0x332201=>{const _0x5c2533=a147_0x3a14;for(const _0x33cbef of _0x332201){if(_0x33cbef[_0x5c2533(0x206)])for(const _0x3d4e5d of _0x33cbef['steps']){if(_0x3d4e5d[_0x5c2533(0x1fb)]==='activation'){const _0x2ff2ef=_0x3d4e5d;_0x2ff2ef[_0x5c2533(0x20f)]['activation']&&/^\d+$/['test'](_0x2ff2ef[_0x5c2533(0x20f)][_0x5c2533(0x1a6)])&&_0x22d11e[_0x5c2533(0x195)](_0x2ff2ef[_0x5c2533(0x20f)][_0x5c2533(0x1a6)]);}}}};if(_0x1200ff[_0x4920f6(0x1e5)])for(const _0x4a04fa of _0x1200ff[_0x4920f6(0x1e5)]){_0x50e107(_0x4a04fa[_0x4920f6(0x1a9)]);}_0x1200ff[_0x4920f6(0x1a9)]&&_0x50e107(_0x1200ff[_0x4920f6(0x1a9)]);if(_0x1200ff[_0x4920f6(0x1c0)])for(const _0x571a40 of _0x1200ff[_0x4920f6(0x1c0)]){_0x50e107(_0x571a40[_0x4920f6(0x1a9)]);}}function replaceActivationIdsInJourney(_0x475001,_0x33dd1c){const _0x376325=a147_0x3a14,_0x568ce6=_0x59df81=>_0x33dd1c['get'](_0x59df81)||_0x59df81,_0x5af813=_0x4b28c1=>{const _0x48472e=a147_0x3a14;for(const _0x5dfceb of _0x4b28c1){if(_0x5dfceb['steps'])for(const _0x64b39f of _0x5dfceb['steps']){if(_0x64b39f['type']===_0x48472e(0x1a6)){const _0x1355a7=_0x64b39f;_0x1355a7[_0x48472e(0x20f)][_0x48472e(0x1a6)]&&(_0x1355a7[_0x48472e(0x20f)]['activation']=_0x568ce6(_0x1355a7[_0x48472e(0x20f)][_0x48472e(0x1a6)]));}}}};if(_0x475001[_0x376325(0x1e5)])for(const _0x4ec9b0 of _0x475001['journeys']){_0x5af813(_0x4ec9b0[_0x376325(0x1a9)]);}_0x475001['stages']&&_0x5af813(_0x475001[_0x376325(0x1a9)]);if(_0x475001[_0x376325(0x1c0)])for(const _0xd2e01a of _0x475001[_0x376325(0x1c0)]){_0x5af813(_0xd2e01a['stages']);}}function collectJumpTargetsFromJourney(_0x28aa44,_0x2c7160){const _0x3a9b10=a147_0x3a14,_0xf2ac45=new Set(),_0x43d162=_0x111481=>{const _0x20c713=a147_0x3a14;for(const _0x13313a of _0x111481){if(_0x13313a[_0x20c713(0x206)])for(const _0x2471de of _0x13313a[_0x20c713(0x206)]){if(_0x2471de['type']==='jump'){const _0x14370c=_0x2471de,_0xf3ffe3=_0x14370c['with']['target'];if(_0xf3ffe3[_0x20c713(0x237)]&&_0xf3ffe3[_0x20c713(0x1e3)]&&/^\d+$/['test'](_0xf3ffe3[_0x20c713(0x237)])&&/^\d+$/[_0x20c713(0x210)](_0xf3ffe3[_0x20c713(0x1e3)])){const _0xbe834b=_0xf3ffe3[_0x20c713(0x237)]+':'+_0xf3ffe3[_0x20c713(0x1e3)];!_0xf2ac45['has'](_0xbe834b)&&(_0xf2ac45[_0x20c713(0x195)](_0xbe834b),_0x2c7160['push']({'journeyId':_0xf3ffe3['journey'],'stageId':_0xf3ffe3[_0x20c713(0x1e3)]}));}}}}};if(_0x28aa44[_0x3a9b10(0x1e5)])for(const _0xcd88f9 of _0x28aa44['journeys']){_0x43d162(_0xcd88f9[_0x3a9b10(0x1a9)]);}_0x28aa44[_0x3a9b10(0x1a9)]&&_0x43d162(_0x28aa44[_0x3a9b10(0x1a9)]);if(_0x28aa44[_0x3a9b10(0x1c0)])for(const _0x186207 of _0x28aa44[_0x3a9b10(0x1c0)]){_0x43d162(_0x186207[_0x3a9b10(0x1a9)]);}}function replaceJumpTargetsInJourney(_0x616ca1,_0x4a0d8e){const _0x22fcdc=a147_0x3a14,_0x146b29=_0x1dcd92=>{const _0x3e7a91=a147_0x3a14;for(const _0x2075f3 of _0x1dcd92){if(_0x2075f3[_0x3e7a91(0x206)])for(const _0x5a6b28 of _0x2075f3[_0x3e7a91(0x206)]){if(_0x5a6b28[_0x3e7a91(0x1fb)]==='jump'){const _0xf4be15=_0x5a6b28,_0x2a22bc=_0xf4be15[_0x3e7a91(0x20f)]['target'],_0x3a5aed=_0x2a22bc[_0x3e7a91(0x237)]+':'+_0x2a22bc[_0x3e7a91(0x1e3)],_0x376d46=_0x4a0d8e[_0x3e7a91(0x232)](_0x3a5aed);_0x376d46&&(_0x2a22bc['journey']=_0x376d46[_0x3e7a91(0x242)],_0x2a22bc['stage']=_0x376d46[_0x3e7a91(0x1ba)]);}}}};if(_0x616ca1[_0x22fcdc(0x1e5)])for(const _0xf72cb6 of _0x616ca1[_0x22fcdc(0x1e5)]){_0x146b29(_0xf72cb6[_0x22fcdc(0x1a9)]);}_0x616ca1[_0x22fcdc(0x1a9)]&&_0x146b29(_0x616ca1[_0x22fcdc(0x1a9)]);if(_0x616ca1[_0x22fcdc(0x1c0)])for(const _0x323d10 of _0x616ca1['versions']){_0x146b29(_0x323d10['stages']);}}function generateReadableStepName(_0x9fe728,_0x4e1204){const _0x4e09dc=a147_0x3a14;if(_0x9fe728[_0x4e09dc(0x1a5)]&&_0x9fe728[_0x4e09dc(0x1a5)]!==_0x9fe728['type']){const _0x3ee81c=_0x9fe728[_0x4e09dc(0x1a5)]['trim']();if(_0x3ee81c&&/[a-z0-9\p{L}]/iu[_0x4e09dc(0x210)](_0x3ee81c))return _0x3ee81c;}const _0x3296ad=_0x9fe728[_0x4e09dc(0x1fb)][_0x4e09dc(0x247)]()[_0x4e09dc(0x1ad)](/step$/i,'');return _0x3296ad+'_'+(_0x4e1204+0x1);}function getStepNextRefs(_0x228eb9){const _0x4bb1a5=a147_0x3a14,_0xb4aac1=[];if(_0x228eb9[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x228eb9['next']);if(_0x228eb9[_0x4bb1a5(0x216)])for(const _0x13f66b of _0x228eb9['branches']){if(_0x13f66b[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x13f66b[_0x4bb1a5(0x253)]);}if(_0x228eb9[_0x4bb1a5(0x1ff)])for(const _0x210f57 of _0x228eb9[_0x4bb1a5(0x1ff)]){if(_0x210f57[_0x4bb1a5(0x253)])_0xb4aac1[_0x4bb1a5(0x20c)](_0x210f57[_0x4bb1a5(0x253)]);}if(_0x228eb9[_0x4bb1a5(0x1af)])for(const _0x5f5261 of _0x228eb9['conditions']){if(_0x5f5261[_0x4bb1a5(0x253)])_0xb4aac1['push'](_0x5f5261['next']);}return _0xb4aac1;}function parseJumpTargetDisplayName(_0x4f4a6c){const _0x1b7e99=a147_0x3a14,_0x45a149=_0x4f4a6c[_0x1b7e99(0x256)](/^(.+?)\s*\(([^/)]+)/);if(!_0x45a149)return undefined;const _0xabc774=_0x45a149[0x1][_0x1b7e99(0x1fd)](),_0x7e6b62=_0x45a149[0x2]['trim']();if(!_0xabc774||!_0x7e6b62)return undefined;return{'stageName':_0xabc774,'journeyName':_0x7e6b62};}function orderStepsFromRoot(_0x28c014,_0x1d5813){const _0x5cdfb4=a147_0x3a14,_0x30e151=Object[_0x5cdfb4(0x251)](_0x28c014);if(_0x30e151[_0x5cdfb4(0x1e2)]===0x0)return[];const _0x233389=new Set(_0x30e151[_0x5cdfb4(0x1ef)](([_0x34c533])=>_0x34c533)),_0x27bd75=new Set();for(const [,_0x3ca697]of _0x30e151){for(const _0xe964fd of getStepNextRefs(_0x3ca697)){if(_0x233389[_0x5cdfb4(0x21d)](_0xe964fd))_0x27bd75['add'](_0xe964fd);}}let _0x4fdc8d=_0x1d5813&&_0x233389[_0x5cdfb4(0x21d)](_0x1d5813)?_0x1d5813:undefined;if(!_0x4fdc8d){const _0x201b30=_0x30e151['filter'](([_0x5b1046])=>!_0x27bd75[_0x5cdfb4(0x21d)](_0x5b1046));_0x201b30[_0x5cdfb4(0x1e2)]>0x0?_0x4fdc8d=_0x201b30[0x0][0x0]:_0x4fdc8d=_0x30e151[0x0][0x0];}const _0x4fa739=[],_0x35f15e=new Set(),_0x5cdd58=[_0x4fdc8d];while(_0x5cdd58['length']>0x0){const _0x3f1a73=_0x5cdd58[_0x5cdfb4(0x207)]();if(_0x35f15e[_0x5cdfb4(0x21d)](_0x3f1a73))continue;_0x35f15e[_0x5cdfb4(0x195)](_0x3f1a73);const _0x546188=_0x28c014[_0x3f1a73];if(!_0x546188)continue;_0x4fa739[_0x5cdfb4(0x20c)]({'uuid':_0x3f1a73,'step':_0x546188});for(const _0x13a79b of getStepNextRefs(_0x546188)){_0x233389['has'](_0x13a79b)&&!_0x35f15e[_0x5cdfb4(0x21d)](_0x13a79b)&&_0x5cdd58['push'](_0x13a79b);}}for(const [_0x24e766,_0x54e1bf]of _0x30e151){!_0x35f15e[_0x5cdfb4(0x21d)](_0x24e766)&&_0x4fa739[_0x5cdfb4(0x20c)]({'uuid':_0x24e766,'step':_0x54e1bf});}return _0x4fa739;}function resolveStepReferences(_0x4a9d1d,_0x1265a8,_0x50087c,_0x50501f){const _0x2a97f9=a147_0x3a14;if(_0x4a9d1d[_0x2a97f9(0x1fb)]!==_0x2a97f9(0x1f5)){_0x4a9d1d['next']&&_0x50501f[_0x2a97f9(0x21d)](_0x4a9d1d[_0x2a97f9(0x253)])&&(_0x4a9d1d['next']=_0x50501f['get'](_0x4a9d1d['next']));const _0x4058ef=_0x1265a8+0x1;if(_0x4058ef<_0x50087c[_0x2a97f9(0x1e2)]){const _0x578b81=_0x50501f[_0x2a97f9(0x232)](_0x50087c[_0x4058ef][_0x2a97f9(0x1cb)]);_0x4a9d1d['next']===_0x578b81&&delete _0x4a9d1d[_0x2a97f9(0x253)];}}if(_0x4a9d1d['type']==='decision_point')for(const _0xfe17cc of _0x4a9d1d[_0x2a97f9(0x20f)]['branches']){_0xfe17cc['next']&&_0x50501f[_0x2a97f9(0x21d)](_0xfe17cc[_0x2a97f9(0x253)])&&(_0xfe17cc[_0x2a97f9(0x253)]=_0x50501f[_0x2a97f9(0x232)](_0xfe17cc['next']));}if(_0x4a9d1d[_0x2a97f9(0x1fb)]==='ab_test')for(const _0x1107bf of _0x4a9d1d[_0x2a97f9(0x20f)]['variants']){_0x1107bf['next']&&_0x50501f['has'](_0x1107bf[_0x2a97f9(0x253)])&&(_0x1107bf[_0x2a97f9(0x253)]=_0x50501f[_0x2a97f9(0x232)](_0x1107bf[_0x2a97f9(0x253)]));}if(_0x4a9d1d['type']===_0x2a97f9(0x1b7)&&_0x4a9d1d[_0x2a97f9(0x20f)][_0x2a97f9(0x24b)]){const _0x115692=_0x4a9d1d[_0x2a97f9(0x20f)][_0x2a97f9(0x24b)];_0x115692[_0x2a97f9(0x253)]&&_0x50501f[_0x2a97f9(0x21d)](_0x115692[_0x2a97f9(0x253)])&&(_0x115692['next']=_0x50501f['get'](_0x115692[_0x2a97f9(0x253)])),_0x115692['timeout']?.[_0x2a97f9(0x253)]&&_0x50501f[_0x2a97f9(0x21d)](_0x115692[_0x2a97f9(0x201)]['next'])&&(_0x115692[_0x2a97f9(0x201)][_0x2a97f9(0x253)]=_0x50501f['get'](_0x115692[_0x2a97f9(0x201)][_0x2a97f9(0x253)]));}}function convertApiStageToYaml(_0x527c53){const _0x27cfbe=a147_0x3a14,_0x1bb06c={'name':_0x527c53[_0x27cfbe(0x1a5)]};_0x527c53['id']&&(_0x1bb06c['id']=_0x527c53['id']);_0x527c53[_0x27cfbe(0x225)]&&(_0x1bb06c['description']=_0x527c53[_0x27cfbe(0x225)]);_0x527c53[_0x27cfbe(0x227)]&&(_0x1bb06c[_0x27cfbe(0x21f)]=convertApiCriteriaToYaml(_0x527c53[_0x27cfbe(0x227)]));_0x527c53[_0x27cfbe(0x1b9)]&&_0x527c53[_0x27cfbe(0x1b9)][_0x27cfbe(0x1e2)]>0x0&&(_0x1bb06c[_0x27cfbe(0x1c6)]=_0x527c53[_0x27cfbe(0x1b9)]['map'](convertApiCriteriaToYaml));_0x527c53[_0x27cfbe(0x1ec)]&&(_0x1bb06c[_0x27cfbe(0x1ec)]=convertApiCriteriaToYaml(_0x527c53['milestone']));if(_0x527c53['steps']&&Object[_0x27cfbe(0x1c7)](_0x527c53[_0x27cfbe(0x206)])[_0x27cfbe(0x1e2)]>0x0){const _0x22f910=orderStepsFromRoot(_0x527c53[_0x27cfbe(0x206)],_0x527c53['rootStep']),_0x44657c=new Map(),_0x321a83=new Set();for(let _0x2e7261=0x0;_0x2e7261<_0x22f910['length'];_0x2e7261++){const {uuid:_0x2a5ad5,step:_0x31bd8b}=_0x22f910[_0x2e7261];let _0xb8059c=generateReadableStepName(_0x31bd8b,_0x2e7261),_0x150173=_0xb8059c,_0x429da9=0x2;while(_0x321a83[_0x27cfbe(0x21d)](_0x150173)){_0x150173=_0xb8059c+'_'+_0x429da9,_0x429da9++;}_0x321a83['add'](_0x150173),_0x44657c[_0x27cfbe(0x1b8)](_0x2a5ad5,_0x150173);}_0x1bb06c['steps']=_0x22f910[_0x27cfbe(0x1ef)](({uuid:_0x15a0db,step:_0x2f239c},_0x33e328)=>{const _0x7b1ead=_0x27cfbe,_0x1e512b=convertApiStepToYaml(_0x2f239c,_0x44657c[_0x7b1ead(0x232)](_0x15a0db));return resolveStepReferences(_0x1e512b,_0x33e328,_0x22f910,_0x44657c),_0x1e512b;});}return _0x1bb06c;}function convertApiCriteriaToYaml(_0x737a9e){const _0x457a59=a147_0x3a14,_0xb7df49={'name':_0x737a9e['name'],'segment':_0x737a9e[_0x457a59(0x22e)]};_0x737a9e[_0x457a59(0x225)]&&(_0xb7df49['description']=_0x737a9e[_0x457a59(0x225)]);if(_0x737a9e['target']){let _0x128eac=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x22a)],_0x3d2cda=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x219)];if(_0x737a9e['target']['journeyName']){const _0x25f1a2=parseJumpTargetDisplayName(_0x737a9e[_0x457a59(0x215)][_0x457a59(0x242)]);_0x25f1a2&&(_0x3d2cda=_0x25f1a2[_0x457a59(0x1ba)],_0x128eac=_0x25f1a2[_0x457a59(0x242)]);}_0xb7df49['target']={'journey':_0x128eac,'stage':_0x3d2cda},_0x737a9e[_0x457a59(0x215)][_0x457a59(0x1bd)]&&(_0xb7df49['target'][_0x457a59(0x223)]=_0x737a9e[_0x457a59(0x215)][_0x457a59(0x1bd)]);}return _0xb7df49;}function convertApiStepToYaml(_0x48d1b7,_0x24d189){const _0x31ef26=a147_0x3a14;switch(_0x48d1b7[_0x31ef26(0x1fb)]){case _0x31ef26(0x1e4):{const _0x1c75ac={};if(_0x48d1b7['waitStepType']===_0x31ef26(0x214)&&_0x48d1b7[_0x31ef26(0x231)]!==undefined)_0x1c75ac[_0x31ef26(0x1eb)]=_0x48d1b7[_0x31ef26(0x231)],_0x1c75ac[_0x31ef26(0x222)]=_0x48d1b7[_0x31ef26(0x1d0)];else{if(_0x48d1b7['waitStepType']==='Date'&&_0x48d1b7[_0x31ef26(0x194)])_0x1c75ac[_0x31ef26(0x218)]=_0x48d1b7[_0x31ef26(0x194)];else{if(_0x48d1b7[_0x31ef26(0x22c)]===_0x31ef26(0x24d)&&_0x48d1b7['daysOfWeek'])_0x1c75ac['days_of_week']=_0x48d1b7[_0x31ef26(0x24f)];else{if(_0x48d1b7[_0x31ef26(0x22c)]===_0x31ef26(0x1e6)){if(_0x48d1b7['conditions']&&_0x48d1b7[_0x31ef26(0x1af)][_0x31ef26(0x1e2)]>0x0){const _0x21e6db=_0x48d1b7['conditions'][_0x31ef26(0x23a)](_0x1c9441=>!_0x1c9441[_0x31ef26(0x240)]),_0x49c646=_0x48d1b7['conditions']['find'](_0x20ac2c=>_0x20ac2c['timedOutPath']);_0x21e6db?.[_0x31ef26(0x22e)]&&(_0x1c75ac['condition']={'segment':_0x21e6db[_0x31ef26(0x22e)],..._0x21e6db[_0x31ef26(0x253)]?{'next':_0x21e6db['next']}:{}},_0x49c646&&_0x49c646[_0x31ef26(0x1ee)]!==undefined&&_0x49c646[_0x31ef26(0x222)]&&(_0x1c75ac[_0x31ef26(0x24b)][_0x31ef26(0x201)]={'duration':_0x49c646[_0x31ef26(0x1ee)],'unit':_0x49c646[_0x31ef26(0x222)],..._0x49c646[_0x31ef26(0x253)]?{'next':_0x49c646[_0x31ef26(0x253)]}:{}}));}else _0x48d1b7['conditionSegmentId']&&(_0x1c75ac[_0x31ef26(0x24b)]={'segment':_0x48d1b7['conditionSegmentId']},_0x48d1b7['conditionTimeoutDuration']!==undefined&&_0x48d1b7[_0x31ef26(0x1de)]&&(_0x1c75ac[_0x31ef26(0x24b)][_0x31ef26(0x201)]={'duration':_0x48d1b7[_0x31ef26(0x1db)],'unit':_0x48d1b7[_0x31ef26(0x1de)]}));}}}}const _0x5829bd={'type':_0x31ef26(0x1b7),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':_0x1c75ac};return _0x5829bd;}case _0x31ef26(0x21c):{const _0x4f7601={'type':'activation','name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7['next']}:{},'with':{'activation':_0x48d1b7[_0x31ef26(0x1bb)]||''}};return _0x4f7601;}case _0x31ef26(0x235):{const _0x451e82={'type':_0x31ef26(0x255),'name':_0x24d189,..._0x48d1b7['next']?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':{'branches':(_0x48d1b7[_0x31ef26(0x216)]||[])[_0x31ef26(0x1ef)](_0x162d25=>({'name':_0x162d25[_0x31ef26(0x1a5)],'segment':_0x162d25['segmentId'],'excluded':_0x162d25[_0x31ef26(0x204)],..._0x162d25[_0x31ef26(0x253)]?{'next':_0x162d25[_0x31ef26(0x253)]}:{}}))}};return _0x451e82;}case _0x31ef26(0x1bc):case _0x31ef26(0x1d7):case'Variant':{const _0x591756=_0x48d1b7[_0x31ef26(0x1ff)]||(_0x48d1b7[_0x31ef26(0x216)]||[])['map'](_0x4d1d82=>({'name':_0x4d1d82[_0x31ef26(0x1a5)],'percentage':0x0,'next':_0x4d1d82[_0x31ef26(0x253)]})),_0x428def={'type':_0x31ef26(0x1c3),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7['next']}:{},'with':{'customized_split':_0x48d1b7['customizedSplit'],'unique_id':_0x48d1b7[_0x31ef26(0x196)],'variants':_0x591756['map'](_0x4f0047=>({'name':_0x4f0047[_0x31ef26(0x1a5)],'percentage':_0x4f0047[_0x31ef26(0x1e7)],..._0x4f0047[_0x31ef26(0x253)]?{'next':_0x4f0047[_0x31ef26(0x253)]}:{}}))}};return _0x428def;}case'Merge':{const _0x1106eb={'type':_0x31ef26(0x24e),'name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{}};return _0x1106eb;}case _0x31ef26(0x1ac):{let _0x4fbc33='',_0x4da378='',_0x4e74d9;if(_0x48d1b7[_0x31ef26(0x215)]){_0x4fbc33=_0x48d1b7[_0x31ef26(0x215)][_0x31ef26(0x22a)],_0x4da378=_0x48d1b7[_0x31ef26(0x215)]['journeyStageId'],_0x4e74d9=_0x48d1b7[_0x31ef26(0x215)][_0x31ef26(0x1bd)];if(_0x48d1b7['target'][_0x31ef26(0x242)]){const _0x1c54f5=parseJumpTargetDisplayName(_0x48d1b7[_0x31ef26(0x215)]['journeyName']);_0x1c54f5&&(_0x4da378=_0x1c54f5['stageName'],_0x4fbc33=_0x1c54f5[_0x31ef26(0x242)]);}}const _0x4892e1={'type':'jump','name':_0x24d189,..._0x48d1b7[_0x31ef26(0x253)]?{'next':_0x48d1b7[_0x31ef26(0x253)]}:{},'with':{'target':{'journey':_0x4fbc33,'stage':_0x4da378,..._0x4e74d9?{'bundle_id':_0x4e74d9}:{}}}};return _0x4892e1;}case'End':{const _0x4ad49f={'type':_0x31ef26(0x1f5),'name':_0x24d189};return _0x4ad49f;}default:{const _0x3f45ad={'type':_0x31ef26(0x1f5),'name':_0x24d189};return _0x3f45ad;}}}export async function journeyDefToRequest(_0x36e74a,_0x11024e,_0x3a9ea3){const _0x2b9442=a147_0x3a14,_0xf784ab=_0x36e74a[_0x2b9442(0x1a9)]||getActiveStages(_0x36e74a),_0x315a14=isJourneysArrayMode(_0x36e74a)||isMultiVersionMode(_0x36e74a)?getLatestJourneyEntry(_0x36e74a):undefined,_0x2fcd60=_0x315a14?.['version']??_0x36e74a[_0x2b9442(0x1a5)],_0x5b138a=_0x36e74a[_0x2b9442(0x20d)]||{},_0x30097e=_0x36e74a[_0x2b9442(0x1b6)]||{},_0x348aaa={'type':_0x2b9442(0x237),'attributes':{'name':_0x2fcd60,'audienceId':_0x11024e,'journeyStages':await Promise[_0x2b9442(0x1c1)](_0xf784ab['map'](_0x12f895=>convertYamlStageToApi(_0x12f895,_0x3a9ea3,_0x5b138a,_0x30097e)))}},_0x55b6ea=_0x315a14?.['id']??_0x36e74a['id'];_0x55b6ea&&(_0x348aaa['id']=_0x55b6ea);_0x36e74a['description']&&(_0x348aaa['attributes'][_0x2b9442(0x225)]=_0x36e74a[_0x2b9442(0x225)]);const _0x1b0ed2=getEffectiveGoal(_0x36e74a);_0x1b0ed2&&(_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x22b)]=await convertYamlCriteriaToApi(_0x1b0ed2,_0x3a9ea3,_0x5b138a));const _0x304192=getEffectiveReentry(_0x36e74a);return _0x304192&&(_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x1f8)]=_0x304192,_0x348aaa[_0x2b9442(0x202)][_0x2b9442(0x23f)]=_0x304192!==_0x2b9442(0x221)),_0x36e74a[_0x2b9442(0x19f)]&&(_0x348aaa[_0x2b9442(0x1d9)]={'parentFolder':{'data':{'id':_0x36e74a['folder_id'],'type':_0x2b9442(0x1f9)}}}),_0x348aaa;}async function convertYamlStageToApi(_0x5b9619,_0xe93332,_0x4a00dd={},_0x1acd12={}){const _0x3163b2=a147_0x3a14,_0x413658={'name':_0x5b9619[_0x3163b2(0x1a5)]};_0x5b9619['id']&&(_0x413658['id']=_0x5b9619['id']);_0x5b9619[_0x3163b2(0x225)]&&(_0x413658[_0x3163b2(0x225)]=_0x5b9619[_0x3163b2(0x225)]);_0x5b9619[_0x3163b2(0x21f)]&&(_0x413658[_0x3163b2(0x227)]=await convertYamlCriteriaToApi(_0x5b9619['entry_criteria'],_0xe93332,_0x4a00dd));_0x5b9619[_0x3163b2(0x1c6)]&&_0x5b9619[_0x3163b2(0x1c6)]['length']>0x0&&(_0x413658[_0x3163b2(0x1b9)]=await Promise[_0x3163b2(0x1c1)](_0x5b9619[_0x3163b2(0x1c6)]['map'](_0x421553=>convertYamlCriteriaToApi(_0x421553,_0xe93332,_0x4a00dd))));_0x5b9619['milestone']&&(_0x413658['milestone']=await convertYamlCriteriaToApi(_0x5b9619[_0x3163b2(0x1ec)],_0xe93332,_0x4a00dd));if(_0x5b9619[_0x3163b2(0x206)]&&_0x5b9619[_0x3163b2(0x206)]['length']>0x0){const _0x5d3e35={},_0x275a54=_0x5b9619['steps'][_0x3163b2(0x1ef)]((_0x440653,_0x42e842)=>{const _0x2cd20d=_0x3163b2,_0x26e410=_0x440653[_0x2cd20d(0x1cb)]||generateUUID(),_0x1a37c4=_0x440653[_0x2cd20d(0x1a5)]||_0x440653['type']+'_'+_0x42e842;return _0x5d3e35[_0x1a37c4]=_0x26e410,{..._0x440653,'name':_0x1a37c4};});_0x413658['rootStep']=_0x5d3e35[_0x275a54[0x0][_0x3163b2(0x1a5)]],_0x413658['steps']={};for(let _0x198f43=0x0;_0x198f43<_0x275a54[_0x3163b2(0x1e2)];_0x198f43++){const _0x1283ec=_0x275a54[_0x198f43],_0xf2cb3f=_0x5d3e35[_0x1283ec['name']],_0x26fb03=!_0x1283ec['next']&&_0x198f43<_0x275a54['length']-0x1&&_0x1283ec[_0x3163b2(0x1fb)]!==_0x3163b2(0x1f5)?_0x275a54[_0x198f43+0x1][_0x3163b2(0x1a5)]:_0x1283ec[_0x3163b2(0x253)],_0x4b904f=_0x26fb03!==_0x1283ec[_0x3163b2(0x253)]?{..._0x1283ec,'next':_0x26fb03}:_0x1283ec;_0x413658[_0x3163b2(0x206)][_0xf2cb3f]=await convertYamlStepToApi(_0x4b904f,_0xe93332,_0x4a00dd,_0x5d3e35,_0x1acd12);}}else _0x5b9619[_0x3163b2(0x1be)]&&(_0x413658['rootStep']=_0x5b9619['root_step']);return _0x413658;}async function convertYamlCriteriaToApi(_0x34c517,_0x15637f,_0x59b345={}){const _0x247652=a147_0x3a14;let _0x565010=_0x34c517[_0x247652(0x208)];if(_0x565010&&!/^\d+$/[_0x247652(0x210)](_0x565010)){const _0x171629=parseSegmentRef(_0x565010);if(_0x171629['type']===_0x247652(0x1c2))_0x15637f?.[_0x247652(0x198)]&&(_0x565010=await _0x15637f[_0x247652(0x198)](_0x171629['name']));else{if(_0x171629[_0x247652(0x1fb)]==='embedded'&&_0x59b345[_0x171629[_0x247652(0x1a5)]])_0x15637f?.['resolveEmbeddedSegmentId']&&(_0x565010=await _0x15637f[_0x247652(0x220)](_0x171629[_0x247652(0x1a5)],_0x59b345[_0x171629[_0x247652(0x1a5)]]));else _0x15637f?.[_0x247652(0x198)]&&(_0x565010=await _0x15637f[_0x247652(0x198)](_0x171629[_0x247652(0x1a5)]));}}const _0xe28c84={'name':_0x34c517['name'],'segmentId':_0x565010};_0x34c517[_0x247652(0x225)]&&(_0xe28c84[_0x247652(0x225)]=_0x34c517[_0x247652(0x225)]);if(_0x34c517['target']){const _0x288d90=_0x34c517['target']['journey'],_0x136d29=_0x34c517['target'][_0x247652(0x1e3)];let _0x545acf=_0x34c517[_0x247652(0x215)][_0x247652(0x237)];_0x15637f?.[_0x247652(0x19c)]&&!/^\d+$/[_0x247652(0x210)](_0x545acf)&&(_0x545acf=await _0x15637f[_0x247652(0x19c)](_0x545acf));let _0x37b9a7=_0x34c517[_0x247652(0x215)][_0x247652(0x1e3)];_0x15637f?.[_0x247652(0x197)]&&!/^\d+$/[_0x247652(0x210)](_0x37b9a7)&&(_0x37b9a7=await _0x15637f[_0x247652(0x197)](_0x545acf,_0x37b9a7));const _0xe2b486=!/^\d+$/['test'](_0x288d90)&&!isLocalJourneyRef(_0x288d90)?formatApiJourneyName(_0x288d90,_0x136d29):undefined;_0xe28c84[_0x247652(0x215)]={'journeyId':_0x545acf,'journeyStageId':_0x37b9a7,'journeyName':_0xe2b486,'confirmed':!![]},_0x34c517[_0x247652(0x215)][_0x247652(0x223)]&&(_0xe28c84[_0x247652(0x215)][_0x247652(0x1bd)]=_0x34c517[_0x247652(0x215)]['bundle_id']);}return _0xe28c84;}async function convertYamlStepToApi(_0x18609d,_0x3cdcb2,_0x32ec3c={},_0x1a70c4={},_0x4d6dad={}){const _0x3993c9=a147_0x3a14,_0x2979a8=async _0x76a450=>{const _0x1c5707=a147_0x3a14;if(/^\d+$/['test'](_0x76a450))return _0x76a450;const _0x1be3fb=parseSegmentRef(_0x76a450);if(_0x1be3fb['type']==='ref'){if(_0x3cdcb2?.[_0x1c5707(0x198)])return await _0x3cdcb2[_0x1c5707(0x198)](_0x1be3fb[_0x1c5707(0x1a5)]);}else{if(_0x1be3fb['type']===_0x1c5707(0x1a4)&&_0x32ec3c[_0x1be3fb[_0x1c5707(0x1a5)]]){if(_0x3cdcb2?.[_0x1c5707(0x220)])return await _0x3cdcb2['resolveEmbeddedSegmentId'](_0x1be3fb[_0x1c5707(0x1a5)],_0x32ec3c[_0x1be3fb[_0x1c5707(0x1a5)]]);}else{if(_0x3cdcb2?.[_0x1c5707(0x198)])return await _0x3cdcb2[_0x1c5707(0x198)](_0x1be3fb[_0x1c5707(0x1a5)]);}}return _0x76a450;},_0x254c21=async _0x382d37=>{const _0x5be8d9=a147_0x3a14;if(/^\d+$/[_0x5be8d9(0x210)](_0x382d37))return _0x382d37;const _0x8ce631=parseSegmentRef(_0x382d37);if(_0x8ce631[_0x5be8d9(0x1fb)]===_0x5be8d9(0x1c2)){if(_0x3cdcb2?.['resolveActivationId'])return await _0x3cdcb2['resolveActivationId'](_0x8ce631['name']);return _0x8ce631[_0x5be8d9(0x1a5)];}else{if(_0x8ce631['type']==='embedded'&&_0x4d6dad[_0x8ce631[_0x5be8d9(0x1a5)]]){if(_0x3cdcb2?.[_0x5be8d9(0x1a2)])return await _0x3cdcb2[_0x5be8d9(0x1a2)](_0x8ce631['name'],_0x4d6dad[_0x8ce631[_0x5be8d9(0x1a5)]]);if(_0x3cdcb2?.[_0x5be8d9(0x250)])return await _0x3cdcb2['resolveActivationId'](_0x8ce631[_0x5be8d9(0x1a5)]);}else{if(_0x3cdcb2?.[_0x5be8d9(0x250)])return await _0x3cdcb2[_0x5be8d9(0x250)](_0x8ce631[_0x5be8d9(0x1a5)]);}}return _0x382d37;},_0x4158ca=_0xa5604a=>{const _0x476c43=a147_0x3a14;if(!_0xa5604a)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x476c43(0x210)](_0xa5604a))return _0xa5604a;return _0x1a70c4[_0xa5604a]||_0xa5604a;};switch(_0x18609d['type']){case _0x3993c9(0x1b7):{const _0x400cf2=_0x18609d,_0x5056d9=_0x400cf2[_0x3993c9(0x20f)],_0x5cbf0f={'type':_0x3993c9(0x1e4),'name':_0x400cf2[_0x3993c9(0x1a5)],'next':_0x4158ca(_0x400cf2[_0x3993c9(0x253)])};if(_0x5056d9['duration']!==undefined&&_0x5056d9['unit'])_0x5cbf0f[_0x3993c9(0x22c)]='Duration',_0x5cbf0f['waitStep']=_0x5056d9[_0x3993c9(0x1eb)],_0x5cbf0f[_0x3993c9(0x1d0)]=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x222)]);else{if(_0x5056d9[_0x3993c9(0x218)])_0x5cbf0f['waitStepType']=_0x3993c9(0x24a),_0x5cbf0f[_0x3993c9(0x194)]=_0x5056d9['wait_until'];else{if(_0x5056d9[_0x3993c9(0x1f2)])_0x5cbf0f[_0x3993c9(0x22c)]='DaysOfTheWeek',_0x5cbf0f[_0x3993c9(0x24f)]=_0x5056d9[_0x3993c9(0x1f2)];else{if(_0x5056d9[_0x3993c9(0x24b)]){_0x5cbf0f[_0x3993c9(0x22c)]=_0x3993c9(0x1e6);const _0x17ea8b=await _0x2979a8(_0x5056d9['condition'][_0x3993c9(0x208)]),_0x3b02d9=_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]?.['next']!==undefined;if(_0x3b02d9){const _0x426091=[];_0x426091[_0x3993c9(0x20c)]({'id':generateUUID(),'segmentId':_0x17ea8b,'timedOutPath':![],'name':_0x3993c9(0x1a8),'next':_0x4158ca(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x253)]??_0x400cf2[_0x3993c9(0x253)])});if(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]){const _0x19dae0=_0x5056d9[_0x3993c9(0x24b)]['timeout'][_0x3993c9(0x1eb)],_0x1ac83e=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)]['unit']);_0x426091[_0x3993c9(0x20c)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x3993c9(0x1d3)+_0x19dae0+'\x20'+_0x1ac83e,'moveAfter':_0x19dae0,'unit':_0x1ac83e,'next':_0x4158ca(_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)][_0x3993c9(0x253)])});}_0x5cbf0f[_0x3993c9(0x1af)]=_0x426091,delete _0x5cbf0f[_0x3993c9(0x253)];}else _0x5cbf0f[_0x3993c9(0x243)]=_0x17ea8b,_0x5056d9['condition']['timeout']&&(_0x5cbf0f[_0x3993c9(0x1db)]=_0x5056d9['condition'][_0x3993c9(0x201)][_0x3993c9(0x1eb)],_0x5056d9[_0x3993c9(0x24b)][_0x3993c9(0x201)][_0x3993c9(0x222)]&&(_0x5cbf0f[_0x3993c9(0x1de)]=normalizeWaitUnit(_0x5056d9[_0x3993c9(0x24b)]['timeout'][_0x3993c9(0x222)])));}}}}return _0x5cbf0f;}case _0x3993c9(0x1a6):{const _0x177ab0=_0x18609d,_0x34551c=_0x177ab0[_0x3993c9(0x20f)][_0x3993c9(0x1a6)],_0x33cfbc=await _0x254c21(_0x34551c);return{'type':_0x3993c9(0x21c),'name':_0x177ab0[_0x3993c9(0x1a5)],'journeyActivationStepId':_0x33cfbc,'next':_0x4158ca(_0x177ab0[_0x3993c9(0x253)])};}case _0x3993c9(0x255):{const _0x17191b=_0x18609d,_0x5e2288=_0x17191b[_0x3993c9(0x20f)]['branches'];return{'type':'DecisionPoint','name':_0x17191b[_0x3993c9(0x1a5)],'branches':await Promise[_0x3993c9(0x1c1)](_0x5e2288[_0x3993c9(0x1ef)](async _0x4428b2=>{const _0x200b53=_0x3993c9;let _0x2d03c6='';if(!_0x4428b2[_0x200b53(0x19b)]){const _0x5931e6=_0x4428b2['segment']||_0x4428b2[_0x200b53(0x1a1)]||'';_0x2d03c6=_0x5931e6?await _0x2979a8(_0x5931e6):'';}return{'id':crypto[_0x200b53(0x1f6)](),'name':_0x4428b2['name'],'description':null,'segmentId':_0x2d03c6,'excludedPath':_0x4428b2[_0x200b53(0x19b)]??![],'next':_0x4158ca(_0x4428b2[_0x200b53(0x253)])};})),'next':_0x4158ca(_0x17191b[_0x3993c9(0x253)])};}case _0x3993c9(0x1c3):{const _0x44b6e3=_0x18609d,_0x25cf59=_0x44b6e3[_0x3993c9(0x20f)];return{'type':'ABTest','name':_0x44b6e3['name'],'customizedSplit':_0x25cf59[_0x3993c9(0x22f)],'uniqueId':_0x25cf59[_0x3993c9(0x199)],'variants':_0x25cf59[_0x3993c9(0x1ff)][_0x3993c9(0x1ef)](_0x51ba17=>({'id':_0x51ba17['id']||generateUUID(),'name':_0x51ba17[_0x3993c9(0x1a5)],'percentage':_0x51ba17['percentage'],'next':_0x4158ca(_0x51ba17[_0x3993c9(0x253)])})),'next':_0x4158ca(_0x44b6e3['next'])};}case _0x3993c9(0x24e):return{'type':'Merge','name':_0x18609d[_0x3993c9(0x1a5)],'next':_0x4158ca(_0x18609d[_0x3993c9(0x253)])};case _0x3993c9(0x20a):{const _0x389220=_0x18609d,_0x46db92=_0x389220[_0x3993c9(0x20f)]['target'],_0x918cc0=_0x46db92[_0x3993c9(0x237)],_0x10edaa=_0x46db92[_0x3993c9(0x1e3)];let _0x3b9cfa=_0x46db92[_0x3993c9(0x237)];_0x3cdcb2?.['resolveJourneyId']&&!/^\d+$/['test'](_0x3b9cfa)&&(_0x3b9cfa=await _0x3cdcb2[_0x3993c9(0x19c)](_0x3b9cfa));let _0x58b203=_0x46db92['stage'];_0x3cdcb2?.[_0x3993c9(0x197)]&&!/^\d+$/[_0x3993c9(0x210)](_0x58b203)&&(_0x58b203=await _0x3cdcb2['resolveStageId'](_0x3b9cfa,_0x58b203));const _0x4a1aad=!/^\d+$/[_0x3993c9(0x210)](_0x918cc0)&&!isLocalJourneyRef(_0x918cc0)?formatApiJourneyName(_0x918cc0,_0x10edaa):undefined;return{'type':_0x3993c9(0x1ac),'name':_0x389220[_0x3993c9(0x1a5)],'target':{'journeyId':_0x3b9cfa,'journeyStageId':_0x58b203,'journeyBundleId':_0x46db92[_0x3993c9(0x223)],'journeyName':_0x4a1aad,'confirmed':!![]},'next':_0x4158ca(_0x389220[_0x3993c9(0x253)])};}case _0x3993c9(0x1f5):return{'type':_0x3993c9(0x205),'name':_0x18609d[_0x3993c9(0x1a5)]};default:{const _0x2b39fc=_0x18609d;return{'type':'End','name':_0x2b39fc[_0x3993c9(0x1a5)]};}}}export function toYamlString(_0xa3190){const _0x2111af=a147_0x3a14,_0x3ed2b0=stripInternalFields(_0xa3190),_0x3be74e=a147_0x327dd2[_0x2111af(0x239)](_0x3ed2b0,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x2111af(0x1d1)}),_0x29a113=[_0x2111af(0x252),'activations:',_0x2111af(0x1ce),_0x2111af(0x248),_0x2111af(0x23d),'stages:','versions:'];let _0x1166ed=_0x3be74e;for(const _0x4471cb of _0x29a113){_0x1166ed=_0x1166ed[_0x2111af(0x1ad)](new RegExp('^('+_0x4471cb+')','m'),(_0x1c5fba,_0x27fba8,_0x5d4ff5)=>{if(_0x5d4ff5===0x0||_0x1166ed[_0x5d4ff5-0x1]==='\x0a'&&_0x1166ed[_0x5d4ff5-0x2]==='\x0a')return _0x27fba8;return'\x0a'+_0x27fba8;});}return _0x1166ed;}function stripInternalFields(_0x56d6f8){const _0x51ed1f=a147_0x3a14,{id:_0x39471c,folder_id:_0x2b15d1,bundle_id:_0x48c497,bundle_name:_0x22d7fe,version:_0x4f23b0,allow_reentry:_0x170995,..._0x517586}=_0x56d6f8;return _0x517586[_0x51ed1f(0x1e5)]&&(_0x517586['journeys']=_0x517586['journeys'][_0x51ed1f(0x1ef)](_0x3d8371=>{const _0x4c80cb=_0x51ed1f,{id:_0x580e55,..._0x10afc7}=_0x3d8371;return{..._0x10afc7,'stages':_0x10afc7['stages'][_0x4c80cb(0x1ef)](stripStageInternalFields),..._0x3d8371[_0x4c80cb(0x1dd)]===!![]?{'latest':!![]}:{},..._0x517586[_0x4c80cb(0x1e5)]['length']===0x1&&_0x10afc7[_0x4c80cb(0x226)]==='v1'?{'version':undefined}:{}};})),_0x517586[_0x51ed1f(0x1a9)]&&(_0x517586[_0x51ed1f(0x1a9)]=_0x517586[_0x51ed1f(0x1a9)][_0x51ed1f(0x1ef)](stripStageInternalFields)),_0x517586['versions']&&(_0x517586[_0x51ed1f(0x1c0)]=_0x517586[_0x51ed1f(0x1c0)]['map'](_0xcbc584=>{const _0x3ccf46=_0x51ed1f,{id:_0x237546,..._0x584504}=_0xcbc584;return{..._0x584504,'stages':_0x584504['stages'][_0x3ccf46(0x1ef)](stripStageInternalFields),..._0xcbc584[_0x3ccf46(0x1dd)]===!![]?{'latest':!![]}:{}};})),_0x517586;}function stripStageInternalFields(_0x50a488){const {id:_0x1be010,..._0x3434be}=_0x50a488;return _0x3434be;}export function parseYamlString(_0x49b1fd){return safeParseYaml(_0x49b1fd,JourneyDefSchema);}export function isJourneyDef(_0x2bc9bb){const _0x4f856a=a147_0x3a14;return typeof _0x2bc9bb==='object'&&_0x2bc9bb!==null&&_0x4f856a(0x1fb)in _0x2bc9bb&&_0x2bc9bb['type']===_0x4f856a(0x237);}export function generateTemplate(_0x1a65e8,_0x1d8967){const _0xda4d16=a147_0x3a14,_0x1f973f={'type':_0xda4d16(0x237),'name':_0x1a65e8,'description':'Journey\x20description','reentry':_0xda4d16(0x221),'goal':{'name':'Goal\x20Achieved','segment':'goal-segment'},'stages':[{'name':_0xda4d16(0x1c5),'description':_0xda4d16(0x1df),'entry_criteria':{'name':_0xda4d16(0x1d5),'segment':_0x1d8967},'steps':[{'type':_0xda4d16(0x1b7),'name':_0xda4d16(0x21b),'with':{'duration':0x1,'unit':_0xda4d16(0x1ae)}},{'type':_0xda4d16(0x1a6),'name':_0xda4d16(0x1da),'with':{'activation':_0xda4d16(0x23b)}},{'type':_0xda4d16(0x1f5),'name':_0xda4d16(0x1c4)}]}]};return toYamlString(_0x1f973f);}function generateUUID(){const _0x13e520=a147_0x3a14;return crypto[_0x13e520(0x1f6)]();}export const SEGMENT_REF_PREFIX=a147_0x4d9c99(0x24c);export function parseSegmentRef(_0x7cb59d){const _0x3c44bb=a147_0x4d9c99;if(_0x7cb59d[_0x3c44bb(0x217)](SEGMENT_REF_PREFIX))return{'type':_0x3c44bb(0x1c2),'name':_0x7cb59d['slice'](SEGMENT_REF_PREFIX[_0x3c44bb(0x1e2)])};if(/^\d+$/[_0x3c44bb(0x210)](_0x7cb59d))return{'type':'id','name':_0x7cb59d};return{'type':_0x3c44bb(0x1a4),'name':_0x7cb59d};}export function makeSegmentRef(_0x3c3e54){return''+SEGMENT_REF_PREFIX+_0x3c3e54;}export function isExternalSegmentRef(_0x2b9ddb){const _0x4b9286=a147_0x4d9c99;return _0x2b9ddb[_0x4b9286(0x217)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x2f2fc7){const _0x35d137=a147_0x4d9c99;return!!(_0x2f2fc7[_0x35d137(0x1e5)]&&_0x2f2fc7[_0x35d137(0x1e5)][_0x35d137(0x1e2)]>0x0);}export function isMultiVersionMode(_0x4e75d0){const _0x48459c=a147_0x4d9c99;return!!(_0x4e75d0['versions']&&_0x4e75d0[_0x48459c(0x1c0)][_0x48459c(0x1e2)]>0x0);}export function isSingleVersionMode(_0x3fb2f5){const _0xd52df6=a147_0x4d9c99;return!!(_0x3fb2f5['stages']&&_0x3fb2f5[_0xd52df6(0x1a9)]['length']>0x0);}export function hasMultipleVersions(_0x402313){const _0x2c4b19=a147_0x4d9c99;if(isJourneysArrayMode(_0x402313))return(_0x402313['journeys']?.[_0x2c4b19(0x1e2)]||0x0)>0x1;if(isMultiVersionMode(_0x402313))return(_0x402313['versions']?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x24a4e0){const _0x15865d=a147_0x4d9c99;if(isJourneysArrayMode(_0x24a4e0))return _0x24a4e0;if(isSingleVersionMode(_0x24a4e0)){const {stages:_0x572561,id:_0x2d0b25,version:_0x92c3b1,version_number:_0x44ec48,..._0x4c08af}=_0x24a4e0;return{..._0x4c08af,'journeys':[{'version':_0x92c3b1||'v1','stages':_0x572561||[],'id':_0x2d0b25,'version_number':_0x44ec48}]};}if(isMultiVersionMode(_0x24a4e0)){const {versions:_0x27b10,..._0xa26995}=_0x24a4e0;return{..._0xa26995,'journeys':(_0x27b10||[])['map'](_0x47be59=>({'version':_0x47be59['name'],'state':_0x47be59[_0x15865d(0x1cf)],'latest':_0x47be59['latest'],'stages':_0x47be59[_0x15865d(0x1a9)],'id':_0x47be59['id'],'version_number':_0x47be59['version_number']}))};}return _0x24a4e0;}export function normalizeJourneyDef(_0x49dc4c,_0x5a369f){const _0x38d313=a147_0x4d9c99,_0xb3b7c5=normalizeToJourneysFormat(_0x49dc4c),_0x1710ab=_0x5a369f?.[_0x38d313(0x20d)]?Object[_0x38d313(0x1c7)](_0x5a369f[_0x38d313(0x20d)]):undefined,_0x1bd692=_0x5a369f?.[_0x38d313(0x1b6)]?Object[_0x38d313(0x1c7)](_0x5a369f[_0x38d313(0x1b6)]):undefined;return{'type':_0x38d313(0x237),'name':_0xb3b7c5['name'],..._0xb3b7c5[_0x38d313(0x225)]!==undefined&&{'description':_0xb3b7c5['description']},..._0xb3b7c5[_0x38d313(0x22b)]&&{'goal':normalizeJourneyCriteria(_0xb3b7c5[_0x38d313(0x22b)])},..._0xb3b7c5['reentry']!==undefined&&{'reentry':_0xb3b7c5[_0x38d313(0x1e9)]},..._0xb3b7c5[_0x38d313(0x20d)]&&{'segments':normalizeEmbeddedSegments(_0xb3b7c5[_0x38d313(0x20d)],_0x1710ab)},..._0xb3b7c5[_0x38d313(0x1b6)]&&{'activations':normalizeEmbeddedActivations(_0xb3b7c5['activations'],_0x1bd692)},..._0xb3b7c5[_0x38d313(0x1e5)]&&{'journeys':_0xb3b7c5[_0x38d313(0x1e5)][_0x38d313(0x1ef)](_0x114b63=>normalizeJourneyEntry(_0x114b63,_0xb3b7c5[_0x38d313(0x1e5)][_0x38d313(0x1e2)]===0x1))}};}function normalizeJourneyEntry(_0xf012b6,_0x560c49){const _0xbaacc0=a147_0x4d9c99;return{...!_0x560c49&&_0xf012b6[_0xbaacc0(0x226)]!==undefined&&{'version':_0xf012b6['version']},..._0xf012b6[_0xbaacc0(0x1cf)]!==undefined&&{'state':_0xf012b6['state']},...!_0x560c49&&_0xf012b6['latest']!==undefined&&{'latest':_0xf012b6['latest']},..._0xf012b6[_0xbaacc0(0x1c9)]!==undefined&&{'version_number':_0xf012b6[_0xbaacc0(0x1c9)]},..._0xf012b6[_0xbaacc0(0x22b)]&&{'goal':normalizeJourneyCriteria(_0xf012b6['goal'])},..._0xf012b6[_0xbaacc0(0x1e9)]!==undefined&&{'reentry':_0xf012b6[_0xbaacc0(0x1e9)]},'stages':_0xf012b6[_0xbaacc0(0x1a9)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x1d341f){const _0x29c1b8=a147_0x4d9c99;return{'name':_0x1d341f[_0x29c1b8(0x1a5)],..._0x1d341f['description']!==undefined&&{'description':_0x1d341f[_0x29c1b8(0x225)]},..._0x1d341f[_0x29c1b8(0x21f)]&&{'entry_criteria':normalizeJourneyCriteria(_0x1d341f[_0x29c1b8(0x21f)])},..._0x1d341f[_0x29c1b8(0x1c6)]&&{'exit_criteria':_0x1d341f[_0x29c1b8(0x1c6)]['map'](normalizeJourneyCriteria)},..._0x1d341f[_0x29c1b8(0x1ec)]&&{'milestone':normalizeJourneyCriteria(_0x1d341f['milestone'])},..._0x1d341f['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x1d341f[_0x29c1b8(0x206)])}};}function normalizeStepsWithImplicitNext(_0x35a906){const _0x47c17f=a147_0x4d9c99;return _0x35a906[_0x47c17f(0x1ef)]((_0x57a6d1,_0x31018b)=>{const _0x5c160e=_0x47c17f,_0x58314c=_0x31018b<_0x35a906['length']-0x1?_0x35a906[_0x31018b+0x1][_0x5c160e(0x1a5)]:undefined;return normalizeJourneyStep(_0x57a6d1,_0x58314c);});}function normalizeJourneyCriteria(_0x1c74cd){const _0xe29a16=a147_0x4d9c99;return{'name':_0x1c74cd[_0xe29a16(0x1a5)],..._0x1c74cd[_0xe29a16(0x225)]!==undefined&&{'description':_0x1c74cd[_0xe29a16(0x225)]},'segment':_0x1c74cd[_0xe29a16(0x208)],..._0x1c74cd['target']&&{'target':normalizeJumpTarget(_0x1c74cd['target'])}};}function normalizeJourneyStep(_0xbb80af,_0xb3260a){const _0x5557f2=a147_0x4d9c99,_0x793ec=_0xbb80af[_0x5557f2(0x253)]!==undefined&&_0xbb80af[_0x5557f2(0x253)]!==_0xb3260a,_0x3500a9={'type':_0xbb80af[_0x5557f2(0x1fb)],'name':_0xbb80af[_0x5557f2(0x1a5)],..._0x793ec&&{'next':_0xbb80af[_0x5557f2(0x253)]}};if(_0x5557f2(0x20f)in _0xbb80af&&_0xbb80af[_0x5557f2(0x20f)])return{..._0x3500a9,'with':normalizeStepParams(_0xbb80af['type'],_0xbb80af[_0x5557f2(0x20f)])};return _0x3500a9;}function normalizeStepParams(_0x55a2ab,_0xad3320){const _0x51c4c1=a147_0x4d9c99;switch(_0x55a2ab){case _0x51c4c1(0x1b7):{const _0x27a2e2=_0xad3320;let _0x33f83f;return _0x27a2e2[_0x51c4c1(0x24b)]&&(_0x33f83f={'segment':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x208)],..._0x27a2e2['condition'][_0x51c4c1(0x253)]!==undefined&&{'next':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x253)]},..._0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)]&&{'timeout':{'duration':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x1eb)],'unit':_0x27a2e2['condition']['timeout'][_0x51c4c1(0x222)],..._0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x253)]!==undefined&&{'next':_0x27a2e2[_0x51c4c1(0x24b)][_0x51c4c1(0x201)][_0x51c4c1(0x253)]}}}}),{..._0x27a2e2['duration']!==undefined&&{'duration':_0x27a2e2[_0x51c4c1(0x1eb)]},..._0x27a2e2[_0x51c4c1(0x222)]!==undefined&&{'unit':_0x27a2e2['unit']},..._0x27a2e2[_0x51c4c1(0x218)]!==undefined&&{'wait_until':_0x27a2e2[_0x51c4c1(0x218)]},..._0x27a2e2[_0x51c4c1(0x1f2)]!==undefined&&{'days_of_week':_0x27a2e2[_0x51c4c1(0x1f2)]},..._0x33f83f&&{'condition':_0x33f83f}};}case _0x51c4c1(0x1a6):{const _0x799d24=_0xad3320;return{'activation':_0x799d24[_0x51c4c1(0x1a6)]};}case _0x51c4c1(0x255):{const _0x57e474=_0xad3320;return{'branches':_0x57e474[_0x51c4c1(0x216)][_0x51c4c1(0x1ef)](normalizeDecisionBranch)};}case _0x51c4c1(0x1c3):{const _0xb621b=_0xad3320;return{..._0xb621b[_0x51c4c1(0x22f)]!==undefined&&{'customized_split':_0xb621b[_0x51c4c1(0x22f)]},..._0xb621b[_0x51c4c1(0x199)]!==undefined&&{'unique_id':_0xb621b[_0x51c4c1(0x199)]},'variants':_0xb621b['variants']['map'](normalizeAbTestVariant)};}case _0x51c4c1(0x20a):{const _0x433eb4=_0xad3320;return{'target':normalizeJumpTarget(_0x433eb4[_0x51c4c1(0x215)])};}default:return _0xad3320;}}function normalizeDecisionBranch(_0x31bd47){const _0x569631=a147_0x4d9c99;return{'name':_0x31bd47[_0x569631(0x1a5)],..._0x31bd47[_0x569631(0x208)]!==undefined&&{'segment':_0x31bd47[_0x569631(0x208)]},..._0x31bd47[_0x569631(0x19b)]!==undefined&&{'excluded':_0x31bd47[_0x569631(0x19b)]},..._0x31bd47[_0x569631(0x253)]!==undefined&&{'next':_0x31bd47[_0x569631(0x253)]}};}function normalizeAbTestVariant(_0x58fd3e){const _0x5cdbb0=a147_0x4d9c99;return{..._0x58fd3e['id']!==undefined&&{'id':_0x58fd3e['id']},'name':_0x58fd3e[_0x5cdbb0(0x1a5)],'percentage':_0x58fd3e[_0x5cdbb0(0x1e7)],..._0x58fd3e[_0x5cdbb0(0x253)]!==undefined&&{'next':_0x58fd3e[_0x5cdbb0(0x253)]}};}function normalizeJumpTarget(_0x557476){const _0x138ba4=a147_0x4d9c99;return{'journey':_0x557476[_0x138ba4(0x237)],'stage':_0x557476[_0x138ba4(0x1e3)],..._0x557476[_0x138ba4(0x223)]!==undefined&&{'bundle_id':_0x557476[_0x138ba4(0x223)]}};}function normalizeEmbeddedSegments(_0x24ac8e,_0x5d63a8){const _0x4cb77a=a147_0x4d9c99,_0x167eeb={},_0x409e14=Object[_0x4cb77a(0x1c7)](_0x24ac8e),_0xc6aa30=_0x5d63a8?[..._0x5d63a8['filter'](_0x28b262=>_0x409e14[_0x4cb77a(0x209)](_0x28b262)),..._0x409e14[_0x4cb77a(0x236)](_0x2611d8=>!_0x5d63a8[_0x4cb77a(0x209)](_0x2611d8))[_0x4cb77a(0x1bf)]()]:_0x409e14[_0x4cb77a(0x1bf)]();for(const _0x36a177 of _0xc6aa30){const _0x34728f=_0x24ac8e[_0x36a177];if(_0x34728f[_0x4cb77a(0x1f3)]){const _0x3892a5=_0x34728f[_0x4cb77a(0x1f3)];if(_0x3892a5[_0x4cb77a(0x1fb)]!==_0x4cb77a(0x254)&&_0x3892a5['type']!=='Or'){const _0x5ad812=_0x3892a5[_0x4cb77a(0x1fb)]??_0x4cb77a(0x20e);throw new SDKError(ErrorCode[_0x4cb77a(0x230)],_0x4cb77a(0x1a0)+_0x36a177+'\x27:\x20'+(_0x4cb77a(0x1b5)+_0x5ad812+_0x4cb77a(0x21a))+'Expected\x20format:\x0a'+_0x4cb77a(0x1fa)+_0x4cb77a(0x1a3)+'\x20\x20\x20\x20conditions:\x0a'+_0x4cb77a(0x19d)+_0x4cb77a(0x203)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x3892a5[_0x4cb77a(0x1af)]||!Array[_0x4cb77a(0x241)](_0x3892a5['conditions']))throw new SDKError(ErrorCode[_0x4cb77a(0x230)],_0x4cb77a(0x1a0)+_0x36a177+_0x4cb77a(0x21e)+_0x4cb77a(0x1aa)+_0x4cb77a(0x1b3)+_0x4cb77a(0x1fa)+(_0x4cb77a(0x1ed)+_0x3892a5[_0x4cb77a(0x1fb)]+'\x0a')+_0x4cb77a(0x233)+_0x4cb77a(0x19d)+_0x4cb77a(0x203)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}_0x167eeb[_0x36a177]={..._0x34728f[_0x4cb77a(0x225)]&&_0x34728f[_0x4cb77a(0x225)]['trim']()&&{'description':_0x34728f['description']},..._0x34728f[_0x4cb77a(0x1f3)]&&{'rule':deepSortObject(_0x34728f[_0x4cb77a(0x1f3)])}};}return _0x167eeb;}function normalizeEmbeddedActivations(_0x5fd6a4,_0x4ea807){const _0x47f741=a147_0x4d9c99,_0x5040e1={},_0x536b58=Object[_0x47f741(0x1c7)](_0x5fd6a4),_0x360092=_0x4ea807?[..._0x4ea807[_0x47f741(0x236)](_0x41b4e1=>_0x536b58[_0x47f741(0x209)](_0x41b4e1)),..._0x536b58['filter'](_0x3e6fc4=>!_0x4ea807['includes'](_0x3e6fc4))[_0x47f741(0x1bf)]()]:_0x536b58['sort']();for(const _0x8bf5b7 of _0x360092){const _0x36c148=_0x5fd6a4[_0x8bf5b7];_0x5040e1[_0x8bf5b7]={'name':_0x36c148['name'],'connection':_0x36c148[_0x47f741(0x229)],..._0x36c148[_0x47f741(0x225)]!==undefined&&{'description':_0x36c148[_0x47f741(0x225)]},..._0x36c148['all_columns']!==undefined&&{'all_columns':_0x36c148['all_columns']},..._0x36c148['columns']!==undefined&&{'columns':_0x36c148[_0x47f741(0x1c8)]},..._0x36c148[_0x47f741(0x1b4)]!==undefined&&{'behavior':_0x36c148[_0x47f741(0x1b4)]},..._0x36c148[_0x47f741(0x1b2)]!==undefined&&{'schedule':_0x36c148['schedule']},..._0x36c148[_0x47f741(0x249)]!==undefined&&{'notification':_0x36c148[_0x47f741(0x249)]},..._0x36c148['connector_config']!==undefined&&{'connector_config':_0x36c148[_0x47f741(0x244)]},..._0x36c148[_0x47f741(0x23e)]!==undefined&&{'activation_template_id':_0x36c148[_0x47f741(0x23e)]}};}return _0x5040e1;}export function getActiveStages(_0x14282f){const _0x1134ac=a147_0x4d9c99;if(isJourneysArrayMode(_0x14282f)){const _0x1a5829=_0x14282f['journeys']||[],_0x3a1ab4=_0x1a5829[_0x1134ac(0x23a)](_0x7826ef=>_0x7826ef[_0x1134ac(0x1dd)]===!![])||_0x1a5829[0x0];return _0x3a1ab4?.['stages']||[];}if(isSingleVersionMode(_0x14282f))return _0x14282f[_0x1134ac(0x1a9)]||[];if(isMultiVersionMode(_0x14282f)){const _0x1fde7b=_0x14282f[_0x1134ac(0x1c0)]||[],_0x36ef07=_0x1fde7b['find'](_0x1288b6=>_0x1288b6['latest']===!![])||_0x1fde7b[0x0];return _0x36ef07?.[_0x1134ac(0x1a9)]||[];}return[];}export function getLatestJourneyEntry(_0x1d2edd){const _0x45f5a9=a147_0x4d9c99;if(isJourneysArrayMode(_0x1d2edd)){const _0x5945c1=_0x1d2edd[_0x45f5a9(0x1e5)]||[];return _0x5945c1['find'](_0x1c2738=>_0x1c2738['latest']===!![])||_0x5945c1[0x0];}if(isMultiVersionMode(_0x1d2edd)){const _0x1d5fd0=_0x1d2edd[_0x45f5a9(0x1c0)]||[],_0x1e4f3b=_0x1d5fd0['find'](_0x2f2a44=>_0x2f2a44[_0x45f5a9(0x1dd)]===!![])||_0x1d5fd0[0x0];if(_0x1e4f3b)return{'version':_0x1e4f3b[_0x45f5a9(0x1a5)],'state':_0x1e4f3b[_0x45f5a9(0x1cf)],'latest':_0x1e4f3b[_0x45f5a9(0x1dd)],'stages':_0x1e4f3b[_0x45f5a9(0x1a9)],'id':_0x1e4f3b['id'],'version_number':_0x1e4f3b[_0x45f5a9(0x1c9)]};}if(isSingleVersionMode(_0x1d2edd))return{'version':_0x1d2edd[_0x45f5a9(0x226)]||'v1','state':_0x45f5a9(0x1f1),'stages':_0x1d2edd[_0x45f5a9(0x1a9)]||[],'id':_0x1d2edd['id'],'version_number':_0x1d2edd['version_number'],'goal':_0x1d2edd[_0x45f5a9(0x22b)],'reentry':_0x1d2edd[_0x45f5a9(0x1e9)]};return undefined;}export function getLatestVersion(_0x48ac2d){const _0x40d348=a147_0x4d9c99;if(!isMultiVersionMode(_0x48ac2d))return undefined;const _0x47fdc6=_0x48ac2d[_0x40d348(0x1c0)]||[];return _0x47fdc6[_0x40d348(0x23a)](_0x3daf2a=>_0x3daf2a[_0x40d348(0x1dd)]===!![])||_0x47fdc6[0x0];}export function getEffectiveGoal(_0x3cc17f){const _0x15f102=a147_0x4d9c99,_0x26f14c=getLatestJourneyEntry(_0x3cc17f);return _0x26f14c?.[_0x15f102(0x22b)]||_0x3cc17f['goal'];}export function getEffectiveReentry(_0x195a6b){const _0x3726f2=a147_0x4d9c99,_0x34bafb=getLatestJourneyEntry(_0x195a6b);return _0x34bafb?.[_0x3726f2(0x1e9)]||_0x195a6b['reentry'];}export function collectSegmentRefs(_0x4b9264){const _0x2d4e29=a147_0x4d9c99,_0x1dc97b=new Set();_0x4b9264[_0x2d4e29(0x22b)]?.[_0x2d4e29(0x208)]&&_0x1dc97b[_0x2d4e29(0x195)](_0x4b9264['goal'][_0x2d4e29(0x208)]);const _0x294274=_0x10c8c4=>{const _0x164012=_0x2d4e29;for(const _0xf6b5cd of _0x10c8c4){_0xf6b5cd[_0x164012(0x21f)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0xf6b5cd[_0x164012(0x21f)]['segment']);if(_0xf6b5cd['exit_criteria'])for(const _0x560d88 of _0xf6b5cd[_0x164012(0x1c6)]){_0x560d88[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0x560d88['segment']);}_0xf6b5cd[_0x164012(0x1ec)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0xf6b5cd[_0x164012(0x1ec)]['segment']);if(_0xf6b5cd[_0x164012(0x206)])for(const _0x40db62 of _0xf6b5cd[_0x164012(0x206)]){if(_0x40db62['type']==='decision_point'){const _0x58ffe7=_0x40db62;for(const _0x40b447 of _0x58ffe7[_0x164012(0x20f)][_0x164012(0x216)]){_0x40b447[_0x164012(0x208)]&&_0x1dc97b['add'](_0x40b447[_0x164012(0x208)]);}}else{if(_0x40db62[_0x164012(0x1fb)]===_0x164012(0x1b7)){const _0x54f56d=_0x40db62;_0x54f56d['with'][_0x164012(0x24b)]?.[_0x164012(0x208)]&&_0x1dc97b[_0x164012(0x195)](_0x54f56d[_0x164012(0x20f)]['condition'][_0x164012(0x208)]);}}}}};_0x4b9264[_0x2d4e29(0x1a9)]&&_0x294274(_0x4b9264[_0x2d4e29(0x1a9)]);if(_0x4b9264[_0x2d4e29(0x1c0)])for(const _0x1b41a5 of _0x4b9264[_0x2d4e29(0x1c0)]){_0x294274(_0x1b41a5[_0x2d4e29(0x1a9)]);}return _0x1dc97b;}export function validateSegmentRefs(_0x1739ba){const _0x2bff00=a147_0x4d9c99,_0xd7d76c=[],_0xb546a3=collectSegmentRefs(_0x1739ba),_0x16d0f7=new Set(Object[_0x2bff00(0x1c7)](_0x1739ba['segments']||{}));for(const _0x30e5bf of _0xb546a3){const _0xd0db04=parseSegmentRef(_0x30e5bf);_0xd0db04['type']===_0x2bff00(0x1a4)&&!_0x16d0f7[_0x2bff00(0x21d)](_0xd0db04[_0x2bff00(0x1a5)])&&_0xd7d76c[_0x2bff00(0x20c)](_0x2bff00(0x1b0)+_0xd0db04[_0x2bff00(0x1a5)]+_0x2bff00(0x1fc)+_0xd0db04[_0x2bff00(0x1a5)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0xd7d76c;}function a147_0x28af(){const _0x591466=['\x20\x20\x20\x20type:\x20And\x0a','embedded','name','activation','versionNumber','Met\x20condition(s)','stages','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','951246JLAsbb','Jump','replace','day','conditions','Unknown\x20segment\x20\x22','launched','schedule','Expected\x20format:\x0a','behavior','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','activations','wait','set','exitCriterias','stageName','journeyActivationStepId','ABTest','journeyBundleId','root_step','sort','versions','all','ref','ab_test','Stage\x20Complete','Stage\x201','exit_criteria','keys','columns','version_number','4iGqsts','uuid','resolveSegment','189693MpxHTa','goal:','state','waitStepUnit','null','26ibJSgI','*Max\x20wait\x20','reentry_always','Entry\x20Criteria','197920StoGAZ','AbTest','210970hixZsf','relationships','Send\x20Notification','conditionTimeoutDuration','resolveActivation','latest','conditionTimeoutUnit','First\x20stage\x20of\x20the\x20journey','8GUnBng','resolveActivationName','length','stage','WaitStep','journeys','Condition','percentage','size','reentry','resolveJumpTarget','duration','milestone','\x20\x20\x20\x20type:\x20','moveAfter','map','weeks','draft','days_of_week','rule','parentFolder','end','randomUUID','isJourneyLocal','reentryMode','folder','\x20\x20rule:\x0a','type','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','trim','data','variants','definition','timeout','attributes','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','excludedPath','End','steps','shift','segment','includes','jump','676920vLbLEd','push','segments','(missing)','with','test','bundle_name','resolveSegmentName','week','Duration','target','branches','startsWith','wait_until','journeyStageId','\x27.\x0a','Wait\x201\x20Day','Activation','has','\x27:\x20','entry_criteria','resolveEmbeddedSegmentId','no_reentry','unit','bundle_id','1297758nsgILC','description','version','entryCriteria','journeyStages','connection','journeyId','goal','waitStepType','days','segmentId','customized_split','JOURNEY_SYNTAX_ERROR','waitStep','get','\x20\x20\x20\x20conditions:\x0a','stageId','DecisionPoint','filter','journey','waitCondition','stringify','find','your-activation-name','object','journeys:','activation_template_id','allowReentry','timedOutPath','isArray','journeyName','conditionSegmentId','connector_config','exitCriteria','19419cQIbAP','toLowerCase','reentry:','notification','Date','condition','ref:','DaysOfTheWeek','merge','daysOfWeek','resolveActivationId','entries','segments:','next','And','decision_point','match','waitUntilDate','add','uniqueId','resolveStageId','resolveSegmentId','unique_id','from','excluded','resolveJourneyId','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','journeyBundleName','folder_id','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','segment_id','resolveEmbeddedActivationId'];a147_0x28af=function(){return _0x591466;};return a147_0x28af();}export function collectSegmentIdsFromJourneyApi(_0x40d09a){const _0x34af5b=a147_0x4d9c99,_0xf284e1=new Set();_0x40d09a['attributes'][_0x34af5b(0x22b)]?.[_0x34af5b(0x22e)]&&_0xf284e1['add'](_0x40d09a['attributes'][_0x34af5b(0x22b)][_0x34af5b(0x22e)]);const _0x2cbf1b=_0x40d09a['attributes'][_0x34af5b(0x228)];if(Array['isArray'](_0x2cbf1b))for(const _0x56f551 of _0x2cbf1b){_0x56f551['entryCriteria']?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x56f551['entryCriteria'][_0x34af5b(0x22e)]);const _0x249f8c=_0x56f551[_0x34af5b(0x1b9)]??_0x56f551[_0x34af5b(0x245)];if(Array[_0x34af5b(0x241)](_0x249f8c))for(const _0x5ec46f of _0x249f8c){_0x5ec46f['segmentId']&&_0xf284e1[_0x34af5b(0x195)](_0x5ec46f[_0x34af5b(0x22e)]);}_0x56f551[_0x34af5b(0x1ec)]?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x56f551[_0x34af5b(0x1ec)][_0x34af5b(0x22e)]);if(_0x56f551[_0x34af5b(0x206)]&&typeof _0x56f551[_0x34af5b(0x206)]===_0x34af5b(0x23c)){const _0x143afc=Array[_0x34af5b(0x241)](_0x56f551[_0x34af5b(0x206)])?_0x56f551[_0x34af5b(0x206)]:Object['values'](_0x56f551[_0x34af5b(0x206)]);for(const _0x4a6b19 of _0x143afc){_0x4a6b19[_0x34af5b(0x238)]?.[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x4a6b19[_0x34af5b(0x238)][_0x34af5b(0x22e)]);const _0x4cb0f7=_0x4a6b19;_0x4cb0f7[_0x34af5b(0x243)]&&_0xf284e1[_0x34af5b(0x195)](_0x4cb0f7['conditionSegmentId']);if(Array[_0x34af5b(0x241)](_0x4cb0f7[_0x34af5b(0x1af)]))for(const _0x4cad0e of _0x4cb0f7[_0x34af5b(0x1af)]){_0x4cad0e[_0x34af5b(0x22e)]&&_0xf284e1[_0x34af5b(0x195)](_0x4cad0e[_0x34af5b(0x22e)]);}if(Array[_0x34af5b(0x241)](_0x4a6b19[_0x34af5b(0x216)]))for(const _0x294e51 of _0x4a6b19['branches']){_0x294e51['segmentId']&&_0xf284e1[_0x34af5b(0x195)](_0x294e51[_0x34af5b(0x22e)]);}}}}return _0xf284e1;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a148_0xfa874e=a148_0x1d58;(function(_0x4a1123,_0x5ad0c2){const _0x27e079=a148_0x1d58,_0x4ec10f=_0x4a1123();while(!![]){try{const _0x2e9136=-parseInt(_0x27e079(0x9e))/0x1+parseInt(_0x27e079(0xa8))/0x2+-parseInt(_0x27e079(0xd4))/0x3+parseInt(_0x27e079(0xb4))/0x4*(-parseInt(_0x27e079(0xad))/0x5)+parseInt(_0x27e079(0x9b))/0x6*(parseInt(_0x27e079(0x9c))/0x7)+-parseInt(_0x27e079(0xc0))/0x8*(-parseInt(_0x27e079(0xa4))/0x9)+parseInt(_0x27e079(0xb5))/0xa;if(_0x2e9136===_0x5ad0c2)break;else _0x4ec10f['push'](_0x4ec10f['shift']());}catch(_0x6acfe1){_0x4ec10f['push'](_0x4ec10f['shift']());}}}(a148_0x288c,0x4b3df));export const DEFAULT_TIME_RANGE=a148_0xfa874e(0x9f);function a148_0x288c(){const _0x2daeeb=['\x20LIMIT\x200','master','890508qFdWsB','7ylcFHE','\x27)\x0aLIMIT\x20','339871fOmKWt','-1d','\x0aLIMIT\x20','\x20=\x20a.','\x0aSELECT\x20m.','forEach','12105ZITfix','length','SELECT\x20*\x20FROM\x20','b.*','737332hPaNDl','column',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','trim','\x27)\x0a','4105hqWbbv','\x20b\x0a\x20\x20ON\x20m.','\x20m\x0aLEFT\x20JOIN\x20','SELECT\x20','source','\x0aLIMIT\x200\x0a','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','2540PgKQsy','11665960NPjxKB','\x0a\x20\x20ON\x20m.','map','columns','attributes','name','behaviors','\x20a\x0a\x20\x20ON\x20m.','\x0aFROM\x20','push','\x20=\x20b.','88KMBMgZ','all_columns','join','child_key','\x20IS\x20NOT\x20NULL\x0a','\x20m\x0a','\x20=\x20','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','\x0aWHERE\x20a.','m.*','table','parent_key','find','label','\x0aSELECT\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','LEFT\x20JOIN\x20','\x20LIMIT\x20','(all\x20columns)','database','1587234bWFgPt','\x20m\x0aJOIN\x20','toLowerCase'];a148_0x288c=function(){return _0x2daeeb;};return a148_0x288c();}export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x557060,_0x5529ef,_0x1fb490){const _0x16eb5f=a148_0xfa874e,_0x28b516=_0x1fb490&&_0x1fb490[_0x16eb5f(0xa5)]>0x0?_0x1fb490[_0x16eb5f(0xc2)](',\x20'):'*';return _0x16eb5f(0xb0)+_0x28b516+'\x20FROM\x20'+_0x557060+'.'+_0x5529ef+_0x16eb5f(0xd7);}export function generateMasterCountSQL(_0x5df542){const _0x32606c=a148_0xfa874e,{database:_0x5df9ee,table:_0x5bc3fa}=_0x5df542['master'];return _0x32606c(0xb3)+_0x5df9ee+'.'+_0x5bc3fa;}function a148_0x1d58(_0x1986ed,_0x34f9fb){_0x1986ed=_0x1986ed-0x9b;const _0x288c46=a148_0x288c();let _0x1d58c5=_0x288c46[_0x1986ed];return _0x1d58c5;}export function generateMasterSampleSQL(_0x4faf32,_0x451e6d=0x5){const {database:_0x3be31e,table:_0x2fd58c}=_0x4faf32['master'];return'SELECT\x20*\x20FROM\x20'+_0x3be31e+'.'+_0x2fd58c+'\x20LIMIT\x20'+_0x451e6d;}export function generateAttributeCoverageSQL(_0xb1c02b,_0x45990d){const _0x25ca6a=a148_0xfa874e,_0x505c66=_0xb1c02b[_0x25ca6a(0xd8)];return('\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20'+_0x505c66['database']+'.'+_0x505c66[_0x25ca6a(0xca)]+_0x25ca6a(0xaf)+_0x45990d['source'][_0x25ca6a(0xd3)]+'.'+_0x45990d[_0x25ca6a(0xb1)][_0x25ca6a(0xca)]+_0x25ca6a(0xbc)+_0x45990d[_0x25ca6a(0xc2)]['parent_key']+_0x25ca6a(0xa1)+_0x45990d[_0x25ca6a(0xc2)]['child_key']+_0x25ca6a(0xc8)+_0x45990d['join']['child_key']+_0x25ca6a(0xc4))[_0x25ca6a(0xab)]();}export function generateBehaviorStatsSQL(_0x5bef8e,_0x3fb7e0,_0x1f1502=DEFAULT_TIME_RANGE){const _0x362748=a148_0xfa874e,_0x553820=_0x5bef8e[_0x362748(0xd8)];return(_0x362748(0xc7)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xcb)]+_0x362748(0xaa)+_0x553820['database']+'.'+_0x553820[_0x362748(0xca)]+_0x362748(0xd5)+_0x3fb7e0[_0x362748(0xb1)]['database']+'.'+_0x3fb7e0[_0x362748(0xb1)]['table']+_0x362748(0xae)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xcb)]+_0x362748(0xbf)+_0x3fb7e0[_0x362748(0xc2)][_0x362748(0xc3)]+_0x362748(0xcf)+_0x1f1502+_0x362748(0xac))['trim']();}export function generateAttributeSampleSQL(_0x52acd4,_0x3313d3,_0x340681=0x5){const _0x503aed=a148_0xfa874e,_0x23190d=_0x52acd4[_0x503aed(0xd8)],_0x20ebf2=_0x3313d3[_0x503aed(0xc2)]['parent_key'],_0x53fb9b=_0x3313d3[_0x503aed(0xb8)][_0x503aed(0xb7)](_0x27aa65=>'a.'+_0x27aa65[_0x503aed(0xa9)])['join'](',\x20');return(_0x503aed(0xa2)+_0x20ebf2+',\x20'+_0x53fb9b+_0x503aed(0xbd)+_0x23190d[_0x503aed(0xd3)]+'.'+_0x23190d[_0x503aed(0xca)]+'\x20m\x0aJOIN\x20'+_0x3313d3[_0x503aed(0xb1)][_0x503aed(0xd3)]+'.'+_0x3313d3[_0x503aed(0xb1)][_0x503aed(0xca)]+_0x503aed(0xbc)+_0x3313d3['join'][_0x503aed(0xcb)]+_0x503aed(0xa1)+_0x3313d3['join'][_0x503aed(0xc3)]+'\x0aLIMIT\x20'+_0x340681+'\x0a')['trim']();}export function generateBehaviorSampleSQL(_0x36484e,_0x22ca94,_0x106b18=0x5,_0x41aafd=DEFAULT_TIME_RANGE){const _0x35db29=a148_0xfa874e,_0x540452=_0x36484e[_0x35db29(0xd8)],_0x2c6af0=_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xcb)];let _0x4f250c;if(_0x22ca94[_0x35db29(0xc1)])_0x4f250c=_0x35db29(0xa7);else _0x22ca94['columns']&&_0x22ca94[_0x35db29(0xb8)][_0x35db29(0xa5)]>0x0?_0x4f250c=_0x22ca94[_0x35db29(0xb8)]['map'](_0x18ee4c=>'b.'+_0x18ee4c[_0x35db29(0xa9)])[_0x35db29(0xc2)](',\x20'):_0x4f250c=_0x35db29(0xa7);return('\x0aSELECT\x20m.'+_0x2c6af0+',\x20'+_0x4f250c+_0x35db29(0xbd)+_0x540452[_0x35db29(0xd3)]+'.'+_0x540452[_0x35db29(0xca)]+_0x35db29(0xd5)+_0x22ca94[_0x35db29(0xb1)][_0x35db29(0xd3)]+'.'+_0x22ca94[_0x35db29(0xb1)]['table']+_0x35db29(0xae)+_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xcb)]+'\x20=\x20b.'+_0x22ca94[_0x35db29(0xc2)][_0x35db29(0xc3)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x41aafd+_0x35db29(0x9d)+_0x106b18+'\x0a')[_0x35db29(0xab)]();}function quoteIdentifier(_0xabe715){if(/[\s\-\.\#\[\]\(\)]|^[0-9]/['test'](_0xabe715))return'\x22'+_0xabe715['replace'](/"/g,'\x22\x22')+'\x22';return _0xabe715;}export function generateEnrichedSQL(_0x592ff4,_0x2e5e2b=0x5){const _0x2927cd=a148_0xfa874e,_0x586fe4=_0x592ff4[_0x2927cd(0xd8)],_0x27dc50=_0x592ff4[_0x2927cd(0xb9)]||[];if(_0x27dc50[_0x2927cd(0xa5)]===0x0)return _0x2927cd(0xa6)+_0x586fe4[_0x2927cd(0xd3)]+'.'+_0x586fe4[_0x2927cd(0xca)]+_0x2927cd(0xd1)+_0x2e5e2b;const _0xc370b9=[_0x2927cd(0xc9)],_0x34bdc3=[];return _0x27dc50['forEach']((_0x4a846a,_0x451481)=>{const _0x413d1a=_0x2927cd,_0x1a003e='a'+_0x451481;_0x4a846a['columns'][_0x413d1a(0xa3)](_0x7d0332=>{const _0x1170c9=_0x413d1a,_0x29d062=quoteIdentifier(_0x7d0332[_0x1170c9(0xcd)]||_0x7d0332[_0x1170c9(0xa9)]);_0xc370b9[_0x1170c9(0xbe)](_0x1a003e+'.'+_0x7d0332[_0x1170c9(0xa9)]+'\x20AS\x20'+_0x29d062);}),_0x34bdc3[_0x413d1a(0xbe)](_0x413d1a(0xd0)+_0x4a846a[_0x413d1a(0xb1)][_0x413d1a(0xd3)]+'.'+_0x4a846a[_0x413d1a(0xb1)][_0x413d1a(0xca)]+'\x20'+_0x1a003e+_0x413d1a(0xb6)+_0x4a846a[_0x413d1a(0xc2)][_0x413d1a(0xcb)]+_0x413d1a(0xc6)+_0x1a003e+'.'+_0x4a846a[_0x413d1a(0xc2)][_0x413d1a(0xc3)]);}),(_0x2927cd(0xce)+_0xc370b9[_0x2927cd(0xc2)](',\x20')+_0x2927cd(0xbd)+_0x586fe4[_0x2927cd(0xd3)]+'.'+_0x586fe4[_0x2927cd(0xca)]+_0x2927cd(0xc5)+_0x34bdc3[_0x2927cd(0xc2)]('\x0a')+_0x2927cd(0xa0)+_0x2e5e2b+'\x0a')[_0x2927cd(0xab)]();}export function generateAttributeSchemaSQL(_0x121fcc,_0x162458){const _0x46eb98=a148_0xfa874e,_0x3f3b7e=_0x121fcc[_0x46eb98(0xd8)],_0x2c123b=_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xcb)],_0x3e2467=_0x162458[_0x46eb98(0xb8)][_0x46eb98(0xb7)](_0x16760c=>'a.'+_0x16760c[_0x46eb98(0xa9)])[_0x46eb98(0xc2)](',\x20');return(_0x46eb98(0xa2)+_0x2c123b+',\x20'+_0x3e2467+_0x46eb98(0xbd)+_0x3f3b7e[_0x46eb98(0xd3)]+'.'+_0x3f3b7e[_0x46eb98(0xca)]+'\x20m\x0aJOIN\x20'+_0x162458[_0x46eb98(0xb1)][_0x46eb98(0xd3)]+'.'+_0x162458[_0x46eb98(0xb1)][_0x46eb98(0xca)]+_0x46eb98(0xbc)+_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xcb)]+_0x46eb98(0xa1)+_0x162458[_0x46eb98(0xc2)][_0x46eb98(0xc3)]+_0x46eb98(0xb2))[_0x46eb98(0xab)]();}export function generateBehaviorSchemaSQL(_0x5a1995,_0x370a75){const _0x565523=a148_0xfa874e,_0x148db9=_0x5a1995[_0x565523(0xd8)],_0x4cdc80=_0x370a75[_0x565523(0xc2)]['parent_key'];let _0x3cff37;if(_0x370a75[_0x565523(0xc1)])_0x3cff37=_0x565523(0xa7);else _0x370a75[_0x565523(0xb8)]&&_0x370a75[_0x565523(0xb8)][_0x565523(0xa5)]>0x0?_0x3cff37=_0x370a75[_0x565523(0xb8)]['map'](_0x39b75b=>'b.'+_0x39b75b[_0x565523(0xa9)])[_0x565523(0xc2)](',\x20'):_0x3cff37=_0x565523(0xa7);return(_0x565523(0xa2)+_0x4cdc80+',\x20'+_0x3cff37+_0x565523(0xbd)+_0x148db9['database']+'.'+_0x148db9[_0x565523(0xca)]+_0x565523(0xd5)+_0x370a75[_0x565523(0xb1)][_0x565523(0xd3)]+'.'+_0x370a75['source'][_0x565523(0xca)]+_0x565523(0xae)+_0x370a75[_0x565523(0xc2)]['parent_key']+_0x565523(0xbf)+_0x370a75['join']['child_key']+_0x565523(0xb2))[_0x565523(0xab)]();}export function getAttributeColumns(_0x195a28){const _0x3fccd8=a148_0xfa874e;return _0x195a28[_0x3fccd8(0xb8)][_0x3fccd8(0xb7)](_0x2c4c77=>({'label':_0x2c4c77['label']||_0x2c4c77['column'],'column':_0x2c4c77[_0x3fccd8(0xa9)]}));}export function getBehaviorColumns(_0x3ac49f){const _0x1ee824=a148_0xfa874e;if(_0x3ac49f[_0x1ee824(0xc1)])return[{'label':'(all\x20columns)','column':'*'}];if(_0x3ac49f[_0x1ee824(0xb8)]&&_0x3ac49f[_0x1ee824(0xb8)][_0x1ee824(0xa5)]>0x0)return _0x3ac49f[_0x1ee824(0xb8)]['map'](_0x2d94e0=>({'label':_0x2d94e0[_0x1ee824(0xcd)]||_0x2d94e0[_0x1ee824(0xa9)],'column':_0x2d94e0[_0x1ee824(0xa9)]}));return[{'label':_0x1ee824(0xd2),'column':'*'}];}export function findAttributeByName(_0x43900c,_0x9caa2c){const _0x2bf551=a148_0xfa874e;return _0x43900c[_0x2bf551(0xb9)]?.[_0x2bf551(0xcc)](_0xf9a751=>_0xf9a751[_0x2bf551(0xba)][_0x2bf551(0xd6)]()===_0x9caa2c[_0x2bf551(0xd6)]());}export function findBehaviorByName(_0x41f4c4,_0x2bc993){const _0x2561eb=a148_0xfa874e;return _0x41f4c4[_0x2561eb(0xbb)]?.[_0x2561eb(0xcc)](_0x5e4ea8=>_0x5e4ea8[_0x2561eb(0xba)][_0x2561eb(0xd6)]()===_0x2bc993[_0x2561eb(0xd6)]());}
|