@treasuredata/tdx 2026.3.37 → 2026.3.38
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/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.d.ts +8 -2
- package/dist/commands/work-command.d.ts.map +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/work-command.js.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/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.d.ts.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js.map +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +9 -7
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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/push-workflow.js.map +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.d.ts +3 -0
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js.map +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/cas.d.ts +2 -1
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/cdp.d.ts +16 -1
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +19 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +12 -4
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +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(_0x654ae5,_0x39e872){const _0x23d409=a145_0xb495,_0xd194c2=_0x654ae5();while(!![]){try{const _0x43bf2e=-parseInt(_0x23d409(0x10e))/0x1+-parseInt(_0x23d409(0xf5))/0x2+parseInt(_0x23d409(0x11b))/0x3*(parseInt(_0x23d409(0x106))/0x4)+parseInt(_0x23d409(0x12b))/0x5*(-parseInt(_0x23d409(0x112))/0x6)+-parseInt(_0x23d409(0xf4))/0x7+parseInt(_0x23d409(0x123))/0x8+-parseInt(_0x23d409(0x125))/0x9*(-parseInt(_0x23d409(0xe2))/0xa);if(_0x43bf2e===_0x39e872)break;else _0xd194c2['push'](_0xd194c2['shift']());}catch(_0x215d8a){_0xd194c2['push'](_0xd194c2['shift']());}}}(a145_0x2d02,0x78464));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x724126){const _0xf18b20=a145_0xb495;return _0x724126[_0xf18b20(0xf0)]()['replace'](/\s+/g,'_')[_0xf18b20(0x11a)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0xf18b20(0x11a)](/_+/g,'_')[_0xf18b20(0x11a)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x2e9834){const _0x4c78d6=a145_0xb495,_0x1cf95b=_0x2e9834[_0x4c78d6(0x124)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x1cf95b){const _0x589200=_0x1cf95b[0x1][_0x4c78d6(0xf0)](),_0xd47cbe=_0x1cf95b[0x2],_0x300e98=_0xd47cbe[_0x4c78d6(0x11a)](/-/g,'')['slice'](0x0,0x4)[_0x4c78d6(0xf0)]();return _0x589200+'_'+_0x300e98;}const _0x4b901e=_0x2e9834[_0x4c78d6(0x124)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x4b901e){const _0x4b904f=_0x4b901e[0x1],_0x3bde5f=_0x4b901e[0x2][_0x4c78d6(0xf0)](),_0x30b397=_0x4b904f[_0x4c78d6(0x11a)](/-/g,'')[_0x4c78d6(0x105)](0x0,0x4)[_0x4c78d6(0xf0)]();return _0x3bde5f+'_'+_0x30b397;}return undefined;}function stableStringify(_0x3d673b){const _0x2c387a=a145_0xb495;if(Array[_0x2c387a(0x103)](_0x3d673b))return'['+_0x3d673b[_0x2c387a(0xe7)](_0x48d1fd=>stableStringify(_0x48d1fd))[_0x2c387a(0xf8)](',')+']';if(_0x3d673b&&typeof _0x3d673b===_0x2c387a(0x104)){const _0x457a7a=_0x3d673b,_0x102089=Object[_0x2c387a(0x117)](_0x457a7a)[_0x2c387a(0x107)](),_0x3a9ef0=_0x102089['map'](_0x4d1831=>'\x22'+_0x4d1831+'\x22:'+stableStringify(_0x457a7a[_0x4d1831]));return'{'+_0x3a9ef0[_0x2c387a(0xf8)](',')+'}';}const _0x5d6924=JSON[_0x2c387a(0xfe)](_0x3d673b);return _0x5d6924===undefined?_0x2c387a(0xea):_0x5d6924;}function a145_0x2d02(){const _0x5ef138=['keys','versions','find','replace','444051jXcMsl','milestone','segments','yaml','launched','trim','journeyBundleName','with','1259328BcCswB','match','9RHWdqC','from','version_number','activation_template_id','rule','type','5RvkEjb','name','24967990lpYUkH','entries','description','columns','segment','map','attributes','exit_criteria','null','branches','activations','endsWith','some','version','toLowerCase','string','has','goal','5976698xaXziX','1762804SWccCw','condition','push','join','decision_point','activation','schedule','wait','startsWith','stringify','journeys','connector_config','latest','conditions','isArray','object','slice','8hRaprb','sort','behavior','include','all_columns','length','get','merged','144369IujwTI','notification','.yaml','steps','3468120mVQHFs','stages','item','set','entry_criteria'];a145_0x2d02=function(){return _0x5ef138;};return a145_0x2d02();}export function consolidateActivationsByContent(_0x3de93f){const _0x579a6b=a145_0xb495,_0x5dba9c={},_0x33f88a=new Map(),_0x36aca4=new Map();for(const _0x52e2b5 of _0x3de93f){if(!_0x52e2b5)continue;for(const [_0x1d4aae,_0x24837e]of Object[_0x579a6b(0xe3)](_0x52e2b5)){const _0x6e5c49={'name':_0x24837e[_0x579a6b(0xe1)],'connection':_0x24837e['connection'],..._0x24837e['all_columns']!==undefined&&{'all_columns':_0x24837e[_0x579a6b(0x10a)]},..._0x24837e[_0x579a6b(0xe5)]!==undefined&&{'columns':_0x24837e[_0x579a6b(0xe5)]},..._0x24837e[_0x579a6b(0x108)]!==undefined&&{'behavior':_0x24837e[_0x579a6b(0x108)]},..._0x24837e[_0x579a6b(0xfb)]!==undefined&&{'schedule':_0x24837e[_0x579a6b(0xfb)]},..._0x24837e[_0x579a6b(0x10f)]!==undefined&&{'notification':_0x24837e['notification']},..._0x24837e[_0x579a6b(0x100)]!==undefined&&{'connector_config':_0x24837e[_0x579a6b(0x100)]},..._0x24837e[_0x579a6b(0x128)]!==undefined&&{'activation_template_id':_0x24837e['activation_template_id']}},_0x1bc930=stableStringify(_0x6e5c49),_0x4af207=_0x36aca4[_0x579a6b(0x10c)](_0x1bc930);_0x4af207?_0x33f88a[_0x579a6b(0x115)](_0x1d4aae,_0x4af207):(_0x5dba9c[_0x1d4aae]=_0x24837e,_0x33f88a[_0x579a6b(0x115)](_0x1d4aae,_0x1d4aae),_0x36aca4[_0x579a6b(0x115)](_0x1bc930,_0x1d4aae));}}return{'merged':_0x5dba9c,'nameMapping':_0x33f88a};}export function updateActivationReferences(_0x2f04ca,_0x5643c1){const _0x562948=a145_0xb495;if(!_0x2f04ca)return;for(const _0x3c66ae of _0x2f04ca){if(!_0x3c66ae[_0x562948(0x111)])continue;for(const _0xcd5f1d of _0x3c66ae['steps']){if(_0xcd5f1d[_0x562948(0x12a)]===_0x562948(0xfa)&&_0xcd5f1d['with']?.[_0x562948(0xfa)]){const _0x5a2804=_0x5643c1['get'](_0xcd5f1d['with'][_0x562948(0xfa)]);_0x5a2804&&_0x5a2804!==_0xcd5f1d['with'][_0x562948(0xfa)]&&(_0xcd5f1d[_0x562948(0x122)][_0x562948(0xfa)]=_0x5a2804);}}}}function a145_0xb495(_0x30f090,_0x327616){_0x30f090=_0x30f090-0xe1;const _0x2d0229=a145_0x2d02();let _0xb495ef=_0x2d0229[_0x30f090];return _0xb495ef;}export function consolidateSegmentsByContent(_0x2b4f8a,_0x12d2d3){const _0x4ecc48=a145_0xb495,_0x503ca7={},_0x5956de=new Map(),_0x18c961=new Map();for(const _0x5d227d of _0x2b4f8a){if(!_0x5d227d)continue;for(const [_0x94043d,_0x42959a]of Object[_0x4ecc48(0xe3)](_0x5d227d)){if(!_0x42959a['rule']){_0x503ca7[_0x94043d]=_0x42959a,_0x5956de[_0x4ecc48(0x115)](_0x94043d,_0x94043d);continue;}const _0x3b8d59=_0x42959a[_0x4ecc48(0xe4)]&&_0x42959a['description'][_0x4ecc48(0x120)]()?_0x42959a[_0x4ecc48(0xe4)]:undefined,_0x2383ac=JSON[_0x4ecc48(0xfe)]({'description':_0x3b8d59,'rule':deepSortObject(_0x42959a[_0x4ecc48(0x129)])}),_0x104216=_0x18c961[_0x4ecc48(0x10c)](_0x2383ac);if(_0x104216){const _0x140b94={..._0x42959a[_0x4ecc48(0xe4)]!==undefined&&{'description':_0x42959a['description']},'rule':_0x42959a[_0x4ecc48(0x129)]?deepSortObject(_0x42959a[_0x4ecc48(0x129)]):_0x42959a[_0x4ecc48(0x129)]};if(_0x94043d<_0x104216){_0x503ca7[_0x94043d]=_0x140b94,delete _0x503ca7[_0x104216];for(const [_0x43e932,_0x4465c0]of _0x5956de[_0x4ecc48(0xe3)]()){_0x4465c0===_0x104216&&_0x5956de[_0x4ecc48(0x115)](_0x43e932,_0x94043d);}_0x5956de[_0x4ecc48(0x115)](_0x94043d,_0x94043d),_0x18c961['set'](_0x2383ac,_0x94043d);}else _0x503ca7[_0x104216]=_0x140b94,_0x5956de[_0x4ecc48(0x115)](_0x94043d,_0x104216);}else{let _0x4f9153=_0x94043d;if(_0x12d2d3){const _0x8bf69c=_0x12d2d3[_0x4ecc48(0x10c)](_0x2383ac);_0x8bf69c&&_0x8bf69c[_0x4ecc48(0x10b)]>0x0&&(_0x4f9153=_0x8bf69c['slice']()[_0x4ecc48(0x107)]()[0x0]);}const _0x350a3d={..._0x42959a[_0x4ecc48(0xe4)]!==undefined&&{'description':_0x42959a[_0x4ecc48(0xe4)]},'rule':_0x42959a[_0x4ecc48(0x129)]?deepSortObject(_0x42959a[_0x4ecc48(0x129)]):_0x42959a[_0x4ecc48(0x129)]};_0x503ca7[_0x4f9153]=_0x350a3d,_0x5956de['set'](_0x94043d,_0x4f9153),_0x18c961[_0x4ecc48(0x115)](_0x2383ac,_0x4f9153);}}}return{'merged':_0x503ca7,'nameMapping':_0x5956de};}export function updateSegmentReferences(_0x46447b,_0x45f3a9){const _0x1310fe=a145_0xb495;if(!_0x46447b)return;for(const _0x3c8353 of _0x46447b){if(_0x3c8353[_0x1310fe(0x116)]?.[_0x1310fe(0xe6)]){const _0x4068f2=_0x45f3a9[_0x1310fe(0x10c)](_0x3c8353[_0x1310fe(0x116)][_0x1310fe(0xe6)]);_0x4068f2&&(_0x3c8353[_0x1310fe(0x116)][_0x1310fe(0xe6)]=_0x4068f2);}if(_0x3c8353['exit_criteria'])for(const _0x3c0184 of _0x3c8353['exit_criteria']){if(_0x3c0184['segment']){const _0x33f7f6=_0x45f3a9[_0x1310fe(0x10c)](_0x3c0184['segment']);_0x33f7f6&&(_0x3c0184[_0x1310fe(0xe6)]=_0x33f7f6);}}if(_0x3c8353[_0x1310fe(0x11c)]?.[_0x1310fe(0xe6)]){const _0x1ba652=_0x45f3a9[_0x1310fe(0x10c)](_0x3c8353[_0x1310fe(0x11c)]['segment']);_0x1ba652&&(_0x3c8353[_0x1310fe(0x11c)][_0x1310fe(0xe6)]=_0x1ba652);}if(_0x3c8353['steps'])for(const _0x1a7be7 of _0x3c8353[_0x1310fe(0x111)]){if(_0x1a7be7['type']===_0x1310fe(0xf9)&&_0x1a7be7[_0x1310fe(0x122)]?.['branches'])for(const _0x14da06 of _0x1a7be7[_0x1310fe(0x122)]['branches']){if(_0x14da06[_0x1310fe(0xe6)]){const _0x4d237b=_0x45f3a9[_0x1310fe(0x10c)](_0x14da06[_0x1310fe(0xe6)]);_0x4d237b&&(_0x14da06[_0x1310fe(0xe6)]=_0x4d237b);}}if(_0x1a7be7[_0x1310fe(0x12a)]===_0x1310fe(0xfc)&&_0x1a7be7['with']?.[_0x1310fe(0xf6)]?.['segment']){const _0x23b189=_0x45f3a9[_0x1310fe(0x10c)](_0x1a7be7[_0x1310fe(0x122)][_0x1310fe(0xf6)][_0x1310fe(0xe6)]);_0x23b189&&(_0x1a7be7[_0x1310fe(0x122)]['condition'][_0x1310fe(0xe6)]=_0x23b189);}}}}export function updateSegmentRefsInSegments(_0x1cb96d,_0x5669b8){const _0x203494=a145_0xb495;for(const _0x48bd21 of Object['values'](_0x1cb96d)){_0x48bd21[_0x203494(0x129)]&&updateSegmentRefsInRule(_0x48bd21[_0x203494(0x129)],_0x5669b8);}}function updateSegmentRefsInRule(_0x47c08a,_0x341cd6){const _0x3d429c=a145_0xb495;if(_0x47c08a===null||typeof _0x47c08a!==_0x3d429c(0x104))return;if(Array[_0x3d429c(0x103)](_0x47c08a)){for(const _0x3118fd of _0x47c08a){updateSegmentRefsInRule(_0x3118fd,_0x341cd6);}return;}const _0x3d4ac0=_0x47c08a;if((_0x3d4ac0[_0x3d429c(0x12a)]===_0x3d429c(0x109)||_0x3d4ac0[_0x3d429c(0x12a)]==='exclude')&&typeof _0x3d4ac0[_0x3d429c(0xe6)]===_0x3d429c(0xf1)){const _0x4f26d8=_0x341cd6['get'](_0x3d4ac0['segment']);_0x4f26d8&&(_0x3d4ac0['segment']=_0x4f26d8);}if(_0x3d4ac0['conditions']&&Array['isArray'](_0x3d4ac0[_0x3d429c(0x102)]))for(const _0xc5e7a6 of _0x3d4ac0[_0x3d429c(0x102)]){updateSegmentRefsInRule(_0xc5e7a6,_0x341cd6);}}export function buildJourneysArray(_0x1dc70d,_0x1e01ac){return _0x1dc70d['map'](_0x354162=>{const _0x346ddf=a145_0xb495,_0x50c8c3=_0x1e01ac?_0x354162[_0x346ddf(0x114)]['id']===_0x1e01ac:_0x1dc70d['length']===0x1,_0x3a402e=_0x354162['yaml'][_0x346ddf(0xff)]?.[0x0],_0x3b909e=_0x3a402e?.['goal']||_0x354162[_0x346ddf(0x11e)][_0x346ddf(0xf3)],_0x30de7e={'version':_0x3a402e?.['version']||_0x354162[_0x346ddf(0x11e)][_0x346ddf(0xef)]||_0x354162['item'][_0x346ddf(0xe1)],'state':_0x354162['item']['state']===_0x346ddf(0x11f)?'launched':'draft','stages':_0x3a402e?.[_0x346ddf(0x113)]||_0x354162[_0x346ddf(0x11e)][_0x346ddf(0x113)]||[],'id':_0x3a402e?.['id']||_0x354162[_0x346ddf(0x11e)]['id'],'version_number':_0x3a402e?.[_0x346ddf(0x127)]||_0x354162[_0x346ddf(0x11e)][_0x346ddf(0x127)]};return _0x3b909e&&(_0x30de7e['goal']=_0x3b909e),_0x50c8c3&&(_0x30de7e[_0x346ddf(0x101)]=!![]),_0x30de7e;});}export function buildMergedJourneyDef(_0x15e418,_0x469df3,_0x3a8152){const _0x30b5d6=a145_0xb495,_0x48c82f=_0x15e418[0x0]['yaml'],_0x251ba8=buildJourneysArray(_0x15e418,_0x3a8152),{merged:_0x4f332a,nameMapping:_0x1e2020}=consolidateSegmentsByContent(_0x15e418['map'](_0x3ad493=>_0x3ad493[_0x30b5d6(0x11e)][_0x30b5d6(0x11d)]),_0x469df3);updateSegmentRefsInSegments(_0x4f332a,_0x1e2020);const _0xca1a71=Array[_0x30b5d6(0x126)](_0x1e2020[_0x30b5d6(0xe3)]())[_0x30b5d6(0xee)](([_0x206dd6,_0xc403eb])=>_0x206dd6!==_0xc403eb&&_0x206dd6[_0x30b5d6(0xfd)](_0x30b5d6(0x116)));let _0x2e0ff4=_0x4f332a,_0x2bbcc4=new Map();if(_0xca1a71){const _0x2c69c6=consolidateSegmentsByContent([_0x4f332a],_0x469df3);_0x2e0ff4=_0x2c69c6[_0x30b5d6(0x10d)],_0x2bbcc4=_0x2c69c6['nameMapping'];}const _0xf8db77=new Map(_0x1e2020);for(const [_0x3cefc1,_0x27df92]of _0x2bbcc4[_0x30b5d6(0xe3)]()){_0xf8db77[_0x30b5d6(0x115)](_0x3cefc1,_0x27df92);}for(const [_0x528c3b,_0x53d68c]of _0xf8db77['entries']()){let _0x3f898c=_0x53d68c,_0x2cd8e8=0x0;while(_0xf8db77[_0x30b5d6(0xf2)](_0x3f898c)&&_0xf8db77[_0x30b5d6(0x10c)](_0x3f898c)!==_0x3f898c&&_0x2cd8e8<MAX_MAPPING_CHAIN_DEPTH){_0x3f898c=_0xf8db77['get'](_0x3f898c),_0x2cd8e8++;}_0x3f898c!==_0x53d68c&&_0xf8db77['set'](_0x528c3b,_0x3f898c);}for(const _0x21f139 of _0x251ba8){updateSegmentReferences(_0x21f139[_0x30b5d6(0x113)],_0xf8db77);}const {merged:_0x143c95,nameMapping:_0x320d28}=consolidateActivationsByContent(_0x15e418[_0x30b5d6(0xe7)](_0x4a1ee9=>_0x4a1ee9[_0x30b5d6(0x11e)][_0x30b5d6(0xec)]));for(const _0x5bb115 of _0x251ba8){updateActivationReferences(_0x5bb115[_0x30b5d6(0x113)],_0x320d28);}let _0x4c705a=_0x48c82f[_0x30b5d6(0xf3)];if(_0x4c705a?.[_0x30b5d6(0xe6)]){const _0xbebe30=_0xf8db77[_0x30b5d6(0x10c)](_0x4c705a[_0x30b5d6(0xe6)]);_0xbebe30&&(_0x4c705a={..._0x4c705a,'segment':_0xbebe30});}for(const _0xa98f6f of _0x251ba8){if(_0xa98f6f[_0x30b5d6(0xf3)]?.['segment']){const _0x4be77c=_0xf8db77[_0x30b5d6(0x10c)](_0xa98f6f[_0x30b5d6(0xf3)][_0x30b5d6(0xe6)]);_0x4be77c&&(_0xa98f6f['goal']={..._0xa98f6f[_0x30b5d6(0xf3)],'segment':_0x4be77c});}}return _0x251ba8['some'](_0xf1cc80=>_0xf1cc80[_0x30b5d6(0xf3)])&&(_0x4c705a=undefined),{'type':'journey','name':_0x48c82f[_0x30b5d6(0xe1)],'description':_0x48c82f[_0x30b5d6(0xe4)],'goal':_0x4c705a,'reentry':_0x48c82f['reentry'],'segments':Object[_0x30b5d6(0x117)](_0x2e0ff4)[_0x30b5d6(0x10b)]>0x0?_0x2e0ff4:undefined,'activations':Object[_0x30b5d6(0x117)](_0x143c95)['length']>0x0?_0x143c95:undefined,'journeys':_0x251ba8,'bundle_id':_0x48c82f['bundle_id'],'bundle_name':_0x48c82f['bundle_name']};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x34c886,_0x5aa837,_0x46b657,_0x4d64ab){const _0x5939fe=a145_0xb495,_0x4d9dc6=_0x34c886+':'+_0x5aa837,_0x34dfdb=_0x46b657['get'](_0x4d9dc6);if(_0x34dfdb)return _0x34dfdb;const _0x1eef3d=await _0x4d64ab(_0x34c886),_0x2adae6=_0x1eef3d[_0x5939fe(0xe8)][_0x5939fe(0x121)]||_0x1eef3d[_0x5939fe(0xe8)][_0x5939fe(0xe1)],_0x54a5a8=_0x1eef3d[_0x5939fe(0xe8)]['journeyStages'][_0x5939fe(0x119)](_0x7c4284=>String(_0x7c4284['id'])===String(_0x5aa837)),_0x6dc33d=_0x54a5a8?.['name']||_0x5aa837,_0x45abff={'journeyName':_0x2adae6,'stageName':_0x6dc33d};return _0x46b657[_0x5939fe(0x115)](_0x4d9dc6,_0x45abff),_0x45abff;}export function formatApiJourneyName(_0x4dd2e4,_0x5ef58f){return _0x5ef58f+'\x20('+_0x4dd2e4+')';}export function isLocalJourneyRef(_0x20c7fa){const _0x4e029a=a145_0xb495;return _0x20c7fa[_0x4e029a(0xed)]('.yml')||_0x20c7fa[_0x4e029a(0xed)](_0x4e029a(0x110));}export function buildLocalRuleToNameMapping(_0xe330e4){const _0x1c9b31=a145_0xb495,_0x153f8f=new Map();if(!_0xe330e4)return _0x153f8f;for(const [_0xfb2eb0,_0x12e935]of Object['entries'](_0xe330e4)){if(_0x12e935[_0x1c9b31(0x129)]){const _0x35f86c=serializeRule(_0x12e935[_0x1c9b31(0x129)]),_0x2b280c=_0x153f8f[_0x1c9b31(0x10c)](_0x35f86c)||[];_0x2b280c['push'](_0xfb2eb0),_0x153f8f[_0x1c9b31(0x115)](_0x35f86c,_0x2b280c);}}return _0x153f8f;}export function buildLocalRuleToNameMappingFromJourney(_0xf80497){const _0x250f30=a145_0xb495,_0x3cadd7=_0xf80497[_0x250f30(0x11d)];if(!_0x3cadd7)return new Map();const _0x529b39=collectSegmentUsageCounts(_0xf80497),_0x490a9c=new Map();let _0x3ead0e=0x0;for(const [_0x523d9b,_0x44f8a2]of Object['entries'](_0x3cadd7)){if(!_0x44f8a2['rule']){_0x3ead0e++;continue;}const _0x1c215a=serializeRule(_0x44f8a2[_0x250f30(0x129)]),_0x14c639=_0x490a9c['get'](_0x1c215a)||[];_0x14c639[_0x250f30(0xf7)]({'name':_0x523d9b,'index':_0x3ead0e}),_0x490a9c[_0x250f30(0x115)](_0x1c215a,_0x14c639),_0x3ead0e++;}const _0x47676e=new Map();for(const [_0x517e59,_0x3b07d5]of _0x490a9c){const _0x353c68=_0x3b07d5[_0x250f30(0x105)]()[_0x250f30(0x107)]((_0x31b900,_0x23450e)=>{const _0x2a9a41=_0x250f30,_0x76202f=_0x529b39['get'](_0x31b900[_0x2a9a41(0xe1)])||0x0,_0x4e9a77=_0x529b39['get'](_0x23450e['name'])||0x0;if(_0x76202f!==_0x4e9a77)return _0x4e9a77-_0x76202f;return _0x31b900['index']-_0x23450e['index'];})[_0x250f30(0xe7)](_0x22a604=>_0x22a604[_0x250f30(0xe1)]);_0x47676e[_0x250f30(0x115)](_0x517e59,_0x353c68);}return _0x47676e;}export function collectSegmentUsageCounts(_0x593279){const _0x42967a=a145_0xb495,_0x297371=new Map(),_0x246d47=_0x56354a=>{const _0x506307=a145_0xb495;if(!_0x56354a)return;_0x297371['set'](_0x56354a,(_0x297371[_0x506307(0x10c)](_0x56354a)||0x0)+0x1);},_0x148d19=_0xf91bfc=>{const _0x46d44b=a145_0xb495;for(const _0x138dc8 of _0xf91bfc){_0x246d47(_0x138dc8[_0x46d44b(0x116)]?.['segment']);if(_0x138dc8[_0x46d44b(0xe9)])for(const _0x30a9f2 of _0x138dc8[_0x46d44b(0xe9)]){_0x246d47(_0x30a9f2[_0x46d44b(0xe6)]);}_0x246d47(_0x138dc8[_0x46d44b(0x11c)]?.[_0x46d44b(0xe6)]);if(_0x138dc8[_0x46d44b(0x111)])for(const _0x1f1a69 of _0x138dc8[_0x46d44b(0x111)]){if(_0x1f1a69[_0x46d44b(0x12a)]===_0x46d44b(0xf9))for(const _0x342335 of _0x1f1a69[_0x46d44b(0x122)][_0x46d44b(0xeb)]){_0x246d47(_0x342335['segment']);}else _0x1f1a69[_0x46d44b(0x12a)]===_0x46d44b(0xfc)&&_0x246d47(_0x1f1a69[_0x46d44b(0x122)][_0x46d44b(0xf6)]?.[_0x46d44b(0xe6)]);}}};_0x246d47(_0x593279[_0x42967a(0xf3)]?.[_0x42967a(0xe6)]);if(_0x593279[_0x42967a(0xff)])for(const _0x3a2f42 of _0x593279[_0x42967a(0xff)]){_0x246d47(_0x3a2f42['goal']?.['segment']),_0x148d19(_0x3a2f42[_0x42967a(0x113)]);}_0x593279[_0x42967a(0x113)]&&_0x148d19(_0x593279['stages']);if(_0x593279[_0x42967a(0x118)])for(const _0x338726 of _0x593279[_0x42967a(0x118)]){_0x148d19(_0x338726[_0x42967a(0x113)]);}return _0x297371;}
|
|
1
|
+
(function(_0xb840c7,_0x15eabf){const _0x215171=a145_0x3e23,_0x3bb491=_0xb840c7();while(!![]){try{const _0xe89e12=-parseInt(_0x215171(0x20c))/0x1+parseInt(_0x215171(0x1d9))/0x2+-parseInt(_0x215171(0x1da))/0x3+-parseInt(_0x215171(0x1e4))/0x4+parseInt(_0x215171(0x206))/0x5*(parseInt(_0x215171(0x1d4))/0x6)+parseInt(_0x215171(0x1ed))/0x7*(-parseInt(_0x215171(0x1c8))/0x8)+parseInt(_0x215171(0x209))/0x9*(parseInt(_0x215171(0x1c3))/0xa);if(_0xe89e12===_0x15eabf)break;else _0x3bb491['push'](_0x3bb491['shift']());}catch(_0x27e58a){_0x3bb491['push'](_0x3bb491['shift']());}}}(a145_0x32e6,0xb3f80));function a145_0x3e23(_0x409a7c,_0x49396c){_0x409a7c=_0x409a7c-0x1c0;const _0x32e6ea=a145_0x32e6();let _0x3e23fc=_0x32e6ea[_0x409a7c];return _0x3e23fc;}import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x5ad46f){const _0xaa4667=a145_0x3e23;return _0x5ad46f['toLowerCase']()['replace'](/\s+/g,'_')[_0xaa4667(0x1e5)](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')[_0xaa4667(0x1e5)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x3e08a1){const _0x5d6e35=a145_0x3e23,_0x7db41=_0x3e08a1['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x7db41){const _0x460b18=_0x7db41[0x1][_0x5d6e35(0x1f7)](),_0xf8decb=_0x7db41[0x2],_0x4ca869=_0xf8decb[_0x5d6e35(0x1e5)](/-/g,'')[_0x5d6e35(0x1f2)](0x0,0x4)[_0x5d6e35(0x1f7)]();return _0x460b18+'_'+_0x4ca869;}const _0x306211=_0x3e08a1[_0x5d6e35(0x1f1)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x306211){const _0x15712b=_0x306211[0x1],_0x177032=_0x306211[0x2][_0x5d6e35(0x1f7)](),_0x2aa396=_0x15712b[_0x5d6e35(0x1e5)](/-/g,'')['slice'](0x0,0x4)['toLowerCase']();return _0x177032+'_'+_0x2aa396;}return undefined;}function stableStringify(_0x189c0a){const _0x59c53a=a145_0x3e23;if(Array[_0x59c53a(0x207)](_0x189c0a))return'['+_0x189c0a[_0x59c53a(0x1ef)](_0x181ab0=>stableStringify(_0x181ab0))[_0x59c53a(0x1c9)](',')+']';if(_0x189c0a&&typeof _0x189c0a==='object'){const _0x38b45b=_0x189c0a,_0x26c498=Object[_0x59c53a(0x1e1)](_0x38b45b)[_0x59c53a(0x1d1)](),_0x48bfc8=_0x26c498[_0x59c53a(0x1ef)](_0x516627=>'\x22'+_0x516627+'\x22:'+stableStringify(_0x38b45b[_0x516627]));return'{'+_0x48bfc8['join'](',')+'}';}const _0x1ec6ee=JSON[_0x59c53a(0x1e8)](_0x189c0a);return _0x1ec6ee===undefined?_0x59c53a(0x1e6):_0x1ec6ee;}export function consolidateActivationsByContent(_0x3fdd97){const _0x128811=a145_0x3e23,_0x3c8a32={},_0x3cf4ca=new Map(),_0xa3d208=new Map();for(const _0x1249e of _0x3fdd97){if(!_0x1249e)continue;for(const [_0x3b8d5f,_0x670fd0]of Object[_0x128811(0x1dc)](_0x1249e)){const _0x38e0c1={'name':_0x670fd0[_0x128811(0x1f5)],'connection':_0x670fd0[_0x128811(0x1db)],..._0x670fd0[_0x128811(0x1e3)]!==undefined&&{'all_columns':_0x670fd0[_0x128811(0x1e3)]},..._0x670fd0[_0x128811(0x1cb)]!==undefined&&{'columns':_0x670fd0[_0x128811(0x1cb)]},..._0x670fd0[_0x128811(0x1fd)]!==undefined&&{'behavior':_0x670fd0['behavior']},..._0x670fd0[_0x128811(0x1c4)]!==undefined&&{'schedule':_0x670fd0['schedule']},..._0x670fd0[_0x128811(0x20d)]!==undefined&&{'notification':_0x670fd0[_0x128811(0x20d)]},..._0x670fd0[_0x128811(0x1e9)]!==undefined&&{'connector_config':_0x670fd0[_0x128811(0x1e9)]},..._0x670fd0['activation_template_id']!==undefined&&{'activation_template_id':_0x670fd0[_0x128811(0x1df)]}},_0x485cf6=stableStringify(_0x38e0c1),_0x5459a8=_0xa3d208['get'](_0x485cf6);_0x5459a8?_0x3cf4ca[_0x128811(0x1c5)](_0x3b8d5f,_0x5459a8):(_0x3c8a32[_0x3b8d5f]=_0x670fd0,_0x3cf4ca['set'](_0x3b8d5f,_0x3b8d5f),_0xa3d208[_0x128811(0x1c5)](_0x485cf6,_0x3b8d5f));}}return{'merged':_0x3c8a32,'nameMapping':_0x3cf4ca};}function a145_0x32e6(){const _0x2452be=['name','push','toLowerCase','version','segments','conditions','yaml','attributes','behavior','string','endsWith','version_number','include','bundle_name','entry_criteria','bundle_id','activation','20nJlvcC','isArray','versions','297VynDte','goal','object','613618LuqOIs','notification','activations','get','has','.yaml','280130ppHOgf','schedule','set','merged','steps','24xEwfrq','join','rule','columns','segment','journeys','length','find','condition','sort','from','draft','1526166mLZbbC','stages','state','milestone','wait','1916774qcGZLM','3273615LcWAOG','connection','entries','index','type','activation_template_id','description','keys','exit_criteria','all_columns','147464MbcQys','replace','null','latest','stringify','connector_config','branches','reentry','startsWith','983311rYtdZu','decision_point','map','with','match','slice','some','item'];a145_0x32e6=function(){return _0x2452be;};return a145_0x32e6();}export function updateActivationReferences(_0x53f6d4,_0x150842){const _0x205d7f=a145_0x3e23;if(!_0x53f6d4)return;for(const _0x24106b of _0x53f6d4){if(!_0x24106b[_0x205d7f(0x1c7)])continue;for(const _0x17289d of _0x24106b[_0x205d7f(0x1c7)]){if(_0x17289d[_0x205d7f(0x1de)]===_0x205d7f(0x205)&&_0x17289d[_0x205d7f(0x1f0)]?.['activation']){const _0x4ca76a=_0x150842[_0x205d7f(0x1c0)](_0x17289d[_0x205d7f(0x1f0)]['activation']);_0x4ca76a&&_0x4ca76a!==_0x17289d[_0x205d7f(0x1f0)]['activation']&&(_0x17289d[_0x205d7f(0x1f0)][_0x205d7f(0x205)]=_0x4ca76a);}}}}export function consolidateSegmentsByContent(_0xe9831e,_0x334360){const _0x81c3b1=a145_0x3e23,_0x239736={},_0x4b4a02=new Map(),_0x39f78c=new Map();for(const _0x388a4f of _0xe9831e){if(!_0x388a4f)continue;for(const [_0x446bad,_0x52cff6]of Object[_0x81c3b1(0x1dc)](_0x388a4f)){if(!_0x52cff6['rule']){_0x239736[_0x446bad]=_0x52cff6,_0x4b4a02[_0x81c3b1(0x1c5)](_0x446bad,_0x446bad);continue;}const _0x30e92c=_0x52cff6[_0x81c3b1(0x1e0)]&&_0x52cff6['description']['trim']()?_0x52cff6['description']:undefined,_0x4c2494=JSON['stringify']({'description':_0x30e92c,'rule':deepSortObject(_0x52cff6[_0x81c3b1(0x1ca)])}),_0x6e9591=_0x39f78c[_0x81c3b1(0x1c0)](_0x4c2494);if(_0x6e9591){const _0x4e57ac={..._0x52cff6['description']!==undefined&&{'description':_0x52cff6[_0x81c3b1(0x1e0)]},'rule':_0x52cff6[_0x81c3b1(0x1ca)]?deepSortObject(_0x52cff6[_0x81c3b1(0x1ca)]):_0x52cff6['rule']};if(_0x446bad<_0x6e9591){_0x239736[_0x446bad]=_0x4e57ac,delete _0x239736[_0x6e9591];for(const [_0x18bba8,_0x39523c]of _0x4b4a02[_0x81c3b1(0x1dc)]()){_0x39523c===_0x6e9591&&_0x4b4a02[_0x81c3b1(0x1c5)](_0x18bba8,_0x446bad);}_0x4b4a02[_0x81c3b1(0x1c5)](_0x446bad,_0x446bad),_0x39f78c[_0x81c3b1(0x1c5)](_0x4c2494,_0x446bad);}else _0x239736[_0x6e9591]=_0x4e57ac,_0x4b4a02[_0x81c3b1(0x1c5)](_0x446bad,_0x6e9591);}else{let _0x4bc688=_0x446bad;if(_0x334360){const _0x5dff15=_0x334360[_0x81c3b1(0x1c0)](_0x4c2494);_0x5dff15&&_0x5dff15[_0x81c3b1(0x1ce)]>0x0&&(_0x4bc688=_0x5dff15[_0x81c3b1(0x1f2)]()[_0x81c3b1(0x1d1)]()[0x0]);}const _0x359ae9={..._0x52cff6[_0x81c3b1(0x1e0)]!==undefined&&{'description':_0x52cff6[_0x81c3b1(0x1e0)]},'rule':_0x52cff6[_0x81c3b1(0x1ca)]?deepSortObject(_0x52cff6['rule']):_0x52cff6[_0x81c3b1(0x1ca)]};_0x239736[_0x4bc688]=_0x359ae9,_0x4b4a02[_0x81c3b1(0x1c5)](_0x446bad,_0x4bc688),_0x39f78c[_0x81c3b1(0x1c5)](_0x4c2494,_0x4bc688);}}}return{'merged':_0x239736,'nameMapping':_0x4b4a02};}export function updateSegmentReferences(_0x4e93bb,_0x1f2794){const _0xb22ba2=a145_0x3e23;if(!_0x4e93bb)return;for(const _0xc7bba3 of _0x4e93bb){if(_0xc7bba3['entry_criteria']?.[_0xb22ba2(0x1cc)]){const _0x4d8466=_0x1f2794['get'](_0xc7bba3[_0xb22ba2(0x203)][_0xb22ba2(0x1cc)]);_0x4d8466&&(_0xc7bba3[_0xb22ba2(0x203)][_0xb22ba2(0x1cc)]=_0x4d8466);}if(_0xc7bba3[_0xb22ba2(0x1e2)])for(const _0x9f1da8 of _0xc7bba3[_0xb22ba2(0x1e2)]){if(_0x9f1da8[_0xb22ba2(0x1cc)]){const _0x12c3de=_0x1f2794[_0xb22ba2(0x1c0)](_0x9f1da8['segment']);_0x12c3de&&(_0x9f1da8['segment']=_0x12c3de);}}if(_0xc7bba3[_0xb22ba2(0x1d7)]?.['segment']){const _0x1fea66=_0x1f2794[_0xb22ba2(0x1c0)](_0xc7bba3['milestone']['segment']);_0x1fea66&&(_0xc7bba3[_0xb22ba2(0x1d7)][_0xb22ba2(0x1cc)]=_0x1fea66);}if(_0xc7bba3['steps'])for(const _0x5c9508 of _0xc7bba3[_0xb22ba2(0x1c7)]){if(_0x5c9508[_0xb22ba2(0x1de)]===_0xb22ba2(0x1ee)&&_0x5c9508[_0xb22ba2(0x1f0)]?.['branches'])for(const _0x561403 of _0x5c9508[_0xb22ba2(0x1f0)][_0xb22ba2(0x1ea)]){if(_0x561403['segment']){const _0x191106=_0x1f2794[_0xb22ba2(0x1c0)](_0x561403[_0xb22ba2(0x1cc)]);_0x191106&&(_0x561403[_0xb22ba2(0x1cc)]=_0x191106);}}if(_0x5c9508['type']===_0xb22ba2(0x1d8)&&_0x5c9508[_0xb22ba2(0x1f0)]?.['condition']?.['segment']){const _0x4727a5=_0x1f2794[_0xb22ba2(0x1c0)](_0x5c9508['with'][_0xb22ba2(0x1d0)][_0xb22ba2(0x1cc)]);_0x4727a5&&(_0x5c9508[_0xb22ba2(0x1f0)][_0xb22ba2(0x1d0)]['segment']=_0x4727a5);}}}}export function updateSegmentRefsInSegments(_0x353440,_0x18d56f){const _0x8936a6=a145_0x3e23;for(const _0x5b066e of Object['values'](_0x353440)){_0x5b066e[_0x8936a6(0x1ca)]&&updateSegmentRefsInRule(_0x5b066e[_0x8936a6(0x1ca)],_0x18d56f);}}function updateSegmentRefsInRule(_0x466d60,_0x38f28b){const _0x3996eb=a145_0x3e23;if(_0x466d60===null||typeof _0x466d60!==_0x3996eb(0x20b))return;if(Array[_0x3996eb(0x207)](_0x466d60)){for(const _0x451e7b of _0x466d60){updateSegmentRefsInRule(_0x451e7b,_0x38f28b);}return;}const _0x1c3f3d=_0x466d60;if((_0x1c3f3d['type']===_0x3996eb(0x201)||_0x1c3f3d[_0x3996eb(0x1de)]==='exclude')&&typeof _0x1c3f3d['segment']===_0x3996eb(0x1fe)){const _0x57bd7e=_0x38f28b[_0x3996eb(0x1c0)](_0x1c3f3d[_0x3996eb(0x1cc)]);_0x57bd7e&&(_0x1c3f3d[_0x3996eb(0x1cc)]=_0x57bd7e);}if(_0x1c3f3d['conditions']&&Array[_0x3996eb(0x207)](_0x1c3f3d['conditions']))for(const _0x4e81b7 of _0x1c3f3d[_0x3996eb(0x1fa)]){updateSegmentRefsInRule(_0x4e81b7,_0x38f28b);}}export function buildJourneysArray(_0x27e932,_0x5666f4){return _0x27e932['map'](_0x2f4d5b=>{const _0x10f1ab=a145_0x3e23,_0x45e44d=_0x5666f4?_0x2f4d5b['item']['id']===_0x5666f4:_0x27e932[_0x10f1ab(0x1ce)]===0x1,_0x324dcd=_0x2f4d5b['yaml'][_0x10f1ab(0x1cd)]?.[0x0],_0x360be0=_0x324dcd?.[_0x10f1ab(0x20a)]||_0x2f4d5b[_0x10f1ab(0x1fb)][_0x10f1ab(0x20a)],_0x2234e1={'version':_0x324dcd?.[_0x10f1ab(0x1f8)]||_0x2f4d5b[_0x10f1ab(0x1fb)][_0x10f1ab(0x1f8)]||_0x2f4d5b[_0x10f1ab(0x1f4)][_0x10f1ab(0x1f5)],'state':_0x2f4d5b[_0x10f1ab(0x1f4)][_0x10f1ab(0x1d6)]==='launched'?'launched':_0x10f1ab(0x1d3),'stages':_0x324dcd?.['stages']||_0x2f4d5b[_0x10f1ab(0x1fb)]['stages']||[],'id':_0x324dcd?.['id']||_0x2f4d5b[_0x10f1ab(0x1fb)]['id'],'version_number':_0x324dcd?.[_0x10f1ab(0x200)]||_0x2f4d5b[_0x10f1ab(0x1fb)][_0x10f1ab(0x200)]};return _0x360be0&&(_0x2234e1[_0x10f1ab(0x20a)]=_0x360be0),_0x45e44d&&(_0x2234e1[_0x10f1ab(0x1e7)]=!![]),_0x2234e1;});}export function buildMergedJourneyDef(_0x206035,_0x42aa2d,_0x3e53a1){const _0x4219af=a145_0x3e23,_0x3969e8=_0x206035[0x0]['yaml'],_0x3bb156=buildJourneysArray(_0x206035,_0x3e53a1),{merged:_0x4a4c91,nameMapping:_0x12425e}=consolidateSegmentsByContent(_0x206035[_0x4219af(0x1ef)](_0x229c27=>_0x229c27[_0x4219af(0x1fb)]['segments']),_0x42aa2d);updateSegmentRefsInSegments(_0x4a4c91,_0x12425e);const _0x89e74b=Array[_0x4219af(0x1d2)](_0x12425e['entries']())[_0x4219af(0x1f3)](([_0x48d8f8,_0x418a93])=>_0x48d8f8!==_0x418a93&&_0x48d8f8[_0x4219af(0x1ec)](_0x4219af(0x203)));let _0x26e0be=_0x4a4c91,_0x3ebc3c=new Map();if(_0x89e74b){const _0x2cd671=consolidateSegmentsByContent([_0x4a4c91],_0x42aa2d);_0x26e0be=_0x2cd671[_0x4219af(0x1c6)],_0x3ebc3c=_0x2cd671['nameMapping'];}const _0x4d7974=new Map(_0x12425e);for(const [_0x33485f,_0x5ecf7e]of _0x3ebc3c[_0x4219af(0x1dc)]()){_0x4d7974[_0x4219af(0x1c5)](_0x33485f,_0x5ecf7e);}for(const [_0x16c047,_0x344707]of _0x4d7974[_0x4219af(0x1dc)]()){let _0x4d30d5=_0x344707,_0x4c03ae=0x0;while(_0x4d7974[_0x4219af(0x1c1)](_0x4d30d5)&&_0x4d7974['get'](_0x4d30d5)!==_0x4d30d5&&_0x4c03ae<MAX_MAPPING_CHAIN_DEPTH){_0x4d30d5=_0x4d7974[_0x4219af(0x1c0)](_0x4d30d5),_0x4c03ae++;}_0x4d30d5!==_0x344707&&_0x4d7974[_0x4219af(0x1c5)](_0x16c047,_0x4d30d5);}for(const _0x481381 of _0x3bb156){updateSegmentReferences(_0x481381[_0x4219af(0x1d5)],_0x4d7974);}const {merged:_0x1ddbaa,nameMapping:_0x3bfcd3}=consolidateActivationsByContent(_0x206035[_0x4219af(0x1ef)](_0x18ce54=>_0x18ce54[_0x4219af(0x1fb)][_0x4219af(0x20e)]));for(const _0x5b95d4 of _0x3bb156){updateActivationReferences(_0x5b95d4[_0x4219af(0x1d5)],_0x3bfcd3);}let _0x57bc5a=_0x3969e8[_0x4219af(0x20a)];if(_0x57bc5a?.[_0x4219af(0x1cc)]){const _0x47611c=_0x4d7974[_0x4219af(0x1c0)](_0x57bc5a[_0x4219af(0x1cc)]);_0x47611c&&(_0x57bc5a={..._0x57bc5a,'segment':_0x47611c});}for(const _0x278a5c of _0x3bb156){if(_0x278a5c[_0x4219af(0x20a)]?.['segment']){const _0x594dc4=_0x4d7974[_0x4219af(0x1c0)](_0x278a5c['goal'][_0x4219af(0x1cc)]);_0x594dc4&&(_0x278a5c[_0x4219af(0x20a)]={..._0x278a5c[_0x4219af(0x20a)],'segment':_0x594dc4});}}return _0x3bb156[_0x4219af(0x1f3)](_0x1c1538=>_0x1c1538[_0x4219af(0x20a)])&&(_0x57bc5a=undefined),{'type':'journey','name':_0x3969e8[_0x4219af(0x1f5)],'description':_0x3969e8['description'],'goal':_0x57bc5a,'reentry':_0x3969e8[_0x4219af(0x1eb)],'segments':Object[_0x4219af(0x1e1)](_0x26e0be)[_0x4219af(0x1ce)]>0x0?_0x26e0be:undefined,'activations':Object['keys'](_0x1ddbaa)[_0x4219af(0x1ce)]>0x0?_0x1ddbaa:undefined,'journeys':_0x3bb156,'bundle_id':_0x3969e8[_0x4219af(0x204)],'bundle_name':_0x3969e8[_0x4219af(0x202)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x3859d3,_0x59d2b2,_0x46963f,_0x5d12d3){const _0xf13e1e=a145_0x3e23,_0x2aeb50=_0x3859d3+':'+_0x59d2b2,_0x122c08=_0x46963f[_0xf13e1e(0x1c0)](_0x2aeb50);if(_0x122c08)return _0x122c08;const _0x2e0d1f=await _0x5d12d3(_0x3859d3),_0xf01617=_0x2e0d1f[_0xf13e1e(0x1fc)]['journeyBundleName']||_0x2e0d1f[_0xf13e1e(0x1fc)][_0xf13e1e(0x1f5)],_0x382e0=_0x2e0d1f[_0xf13e1e(0x1fc)]['journeyStages'][_0xf13e1e(0x1cf)](_0x5da753=>String(_0x5da753['id'])===String(_0x59d2b2)),_0x1dd44e=_0x382e0?.[_0xf13e1e(0x1f5)]||_0x59d2b2,_0xa6dbb5={'journeyName':_0xf01617,'stageName':_0x1dd44e};return _0x46963f[_0xf13e1e(0x1c5)](_0x2aeb50,_0xa6dbb5),_0xa6dbb5;}export function formatApiJourneyName(_0x156ed8,_0x99b2fe){return _0x99b2fe+'\x20('+_0x156ed8+')';}export function isLocalJourneyRef(_0x13f94c){const _0x3166a0=a145_0x3e23;return _0x13f94c[_0x3166a0(0x1ff)]('.yml')||_0x13f94c[_0x3166a0(0x1ff)](_0x3166a0(0x1c2));}export function buildLocalRuleToNameMapping(_0x291cc8){const _0x5a0dfc=a145_0x3e23,_0x2eeae5=new Map();if(!_0x291cc8)return _0x2eeae5;for(const [_0x324fef,_0x267faa]of Object[_0x5a0dfc(0x1dc)](_0x291cc8)){if(_0x267faa[_0x5a0dfc(0x1ca)]){const _0x1e6bf1=serializeRule(_0x267faa[_0x5a0dfc(0x1ca)]),_0x15ea6e=_0x2eeae5['get'](_0x1e6bf1)||[];_0x15ea6e[_0x5a0dfc(0x1f6)](_0x324fef),_0x2eeae5[_0x5a0dfc(0x1c5)](_0x1e6bf1,_0x15ea6e);}}return _0x2eeae5;}export function buildLocalRuleToNameMappingFromJourney(_0x3047b6){const _0x1228a3=a145_0x3e23,_0x3ed36e=_0x3047b6[_0x1228a3(0x1f9)];if(!_0x3ed36e)return new Map();const _0x591e6c=collectSegmentUsageCounts(_0x3047b6),_0x3bafdb=new Map();let _0x3359d2=0x0;for(const [_0x565da4,_0xfa9420]of Object['entries'](_0x3ed36e)){if(!_0xfa9420['rule']){_0x3359d2++;continue;}const _0x40b9d9=serializeRule(_0xfa9420['rule']),_0x5af6c2=_0x3bafdb['get'](_0x40b9d9)||[];_0x5af6c2['push']({'name':_0x565da4,'index':_0x3359d2}),_0x3bafdb[_0x1228a3(0x1c5)](_0x40b9d9,_0x5af6c2),_0x3359d2++;}const _0x4de8be=new Map();for(const [_0x3eb2f8,_0xb21086]of _0x3bafdb){const _0x504f42=_0xb21086[_0x1228a3(0x1f2)]()['sort']((_0x4b7ea4,_0x5d0da0)=>{const _0x213533=_0x1228a3,_0x415a80=_0x591e6c[_0x213533(0x1c0)](_0x4b7ea4['name'])||0x0,_0x596b65=_0x591e6c[_0x213533(0x1c0)](_0x5d0da0[_0x213533(0x1f5)])||0x0;if(_0x415a80!==_0x596b65)return _0x596b65-_0x415a80;return _0x4b7ea4[_0x213533(0x1dd)]-_0x5d0da0[_0x213533(0x1dd)];})['map'](_0x356187=>_0x356187[_0x1228a3(0x1f5)]);_0x4de8be[_0x1228a3(0x1c5)](_0x3eb2f8,_0x504f42);}return _0x4de8be;}export function collectSegmentUsageCounts(_0x424046){const _0x549236=a145_0x3e23,_0x5e5c66=new Map(),_0x3122e5=_0x321b4c=>{const _0x13a5b2=a145_0x3e23;if(!_0x321b4c)return;_0x5e5c66[_0x13a5b2(0x1c5)](_0x321b4c,(_0x5e5c66[_0x13a5b2(0x1c0)](_0x321b4c)||0x0)+0x1);},_0x1141f2=_0x449e00=>{const _0x1d9719=a145_0x3e23;for(const _0x44560f of _0x449e00){_0x3122e5(_0x44560f[_0x1d9719(0x203)]?.[_0x1d9719(0x1cc)]);if(_0x44560f[_0x1d9719(0x1e2)])for(const _0x5872ab of _0x44560f[_0x1d9719(0x1e2)]){_0x3122e5(_0x5872ab[_0x1d9719(0x1cc)]);}_0x3122e5(_0x44560f[_0x1d9719(0x1d7)]?.[_0x1d9719(0x1cc)]);if(_0x44560f[_0x1d9719(0x1c7)])for(const _0x2c0829 of _0x44560f[_0x1d9719(0x1c7)]){if(_0x2c0829[_0x1d9719(0x1de)]===_0x1d9719(0x1ee))for(const _0x43e170 of _0x2c0829[_0x1d9719(0x1f0)][_0x1d9719(0x1ea)]){_0x3122e5(_0x43e170[_0x1d9719(0x1cc)]);}else _0x2c0829[_0x1d9719(0x1de)]==='wait'&&_0x3122e5(_0x2c0829[_0x1d9719(0x1f0)][_0x1d9719(0x1d0)]?.[_0x1d9719(0x1cc)]);}}};_0x3122e5(_0x424046[_0x549236(0x20a)]?.[_0x549236(0x1cc)]);if(_0x424046[_0x549236(0x1cd)])for(const _0x5473b7 of _0x424046[_0x549236(0x1cd)]){_0x3122e5(_0x5473b7['goal']?.[_0x549236(0x1cc)]),_0x1141f2(_0x5473b7[_0x549236(0x1d5)]);}_0x424046['stages']&&_0x1141f2(_0x424046['stages']);if(_0x424046[_0x549236(0x208)])for(const _0x332672 of _0x424046[_0x549236(0x208)]){_0x1141f2(_0x332672['stages']);}return _0x5e5c66;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4f99a7,_0x3aa85b){const _0xc2e7a4=a146_0x3f91,_0x31282e=_0x4f99a7();while(!![]){try{const _0x317415=-parseInt(_0xc2e7a4(0x119))/0x1+-parseInt(_0xc2e7a4(0xb2))/0x2+parseInt(_0xc2e7a4(0x12f))/0x3*(-parseInt(_0xc2e7a4(0x128))/0x4)+parseInt(_0xc2e7a4(0xa3))/0x5+parseInt(_0xc2e7a4(0xe5))/0x6+-parseInt(_0xc2e7a4(0xc4))/0x7+parseInt(_0xc2e7a4(0xf7))/0x8;if(_0x317415===_0x3aa85b)break;else _0x31282e['push'](_0x31282e['shift']());}catch(_0x4d656e){_0x31282e['push'](_0x31282e['shift']());}}}(a146_0x5ca5,0x5e130));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x447996,_0x5035e3,_0x1f6226,_0x4e8e02,_0x6f27cb,_0x3531fe){const _0x194656=a146_0x3f91;return{'level':_0x447996,'path':_0x5035e3,'code':_0x1f6226,'message':_0x4e8e02,'location':getLocationFromPath(_0x6f27cb[_0x194656(0x11b)],_0x6f27cb['source'],pathToArray(_0x3531fe??_0x5035e3))};}function validateVersionStructure(_0x3a854e,_0x719ad8){const _0x362214=a146_0x3f91,_0x44d366=[];return _0x3a854e[_0x362214(0xf1)]>MAX_STAGES&&_0x44d366[_0x362214(0x12d)](createIssue(_0x362214(0xf2),_0x362214(0x8b),_0x362214(0xba),_0x362214(0x82)+_0x3a854e[_0x362214(0xf1)]+_0x362214(0xc1)+MAX_STAGES,_0x719ad8)),_0x44d366;}function validateStageStructure(_0x52b9a3,_0x3876ec,_0x4a95e6,_0xc089d1){const _0x2505e9=a146_0x3f91,_0x2b68b2=[],_0x5408a4='stages['+_0x3876ec+']';_0x3876ec===0x0&&!_0x52b9a3[_0x2505e9(0xd0)]&&_0x2b68b2['push'](createIssue(_0x2505e9(0xf2),_0x5408a4+_0x2505e9(0x89),_0x2505e9(0xf8),_0x2505e9(0xdb)+_0x52b9a3[_0x2505e9(0x10a)]+_0x2505e9(0x117),_0xc089d1,_0x5408a4));const _0x4a68fc=_0x3876ec===_0x4a95e6-0x1;!_0x4a68fc&&!_0x52b9a3[_0x2505e9(0xa5)]&&_0x2b68b2[_0x2505e9(0x12d)](createIssue(_0x2505e9(0xf2),_0x5408a4+_0x2505e9(0x115),_0x2505e9(0x112),'Stage\x20\x27'+_0x52b9a3['name']+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0xc089d1,_0x5408a4));(!_0x52b9a3[_0x2505e9(0xfa)]||_0x52b9a3[_0x2505e9(0xfa)][_0x2505e9(0xf1)]===0x0)&&_0x2b68b2[_0x2505e9(0x12d)](createIssue('warning',_0x5408a4+_0x2505e9(0x81),_0x2505e9(0x100),_0x2505e9(0xdb)+_0x52b9a3[_0x2505e9(0x10a)]+_0x2505e9(0xc7),_0xc089d1,_0x5408a4));const _0x7c784c=_0x52b9a3['steps']?.[_0x2505e9(0xf1)]??0x0;if(_0x7c784c===0x0)_0x2b68b2[_0x2505e9(0x12d)](createIssue('error',_0x5408a4+_0x2505e9(0x94),_0x2505e9(0x7f),_0x2505e9(0xdb)+_0x52b9a3[_0x2505e9(0x10a)]+_0x2505e9(0xe2),_0xc089d1,_0x5408a4+_0x2505e9(0x94)));else{if(_0x7c784c===0x1)_0x2b68b2['push'](createIssue(_0x2505e9(0xc0),_0x5408a4+_0x2505e9(0x94),_0x2505e9(0x7f),_0x2505e9(0xdb)+_0x52b9a3[_0x2505e9(0x10a)]+_0x2505e9(0xbd),_0xc089d1,_0x5408a4+_0x2505e9(0x94)));else _0x7c784c<=0x3&&_0x2b68b2[_0x2505e9(0x12d)](createIssue(_0x2505e9(0xc0),_0x5408a4+_0x2505e9(0x94),_0x2505e9(0x7e),'Stage\x20\x27'+_0x52b9a3[_0x2505e9(0x10a)]+_0x2505e9(0x109)+_0x7c784c+_0x2505e9(0xa4),_0xc089d1,_0x5408a4+_0x2505e9(0x94)));}return _0x2b68b2;}function a146_0x3f91(_0xd2c0fd,_0x5d26c6){_0xd2c0fd=_0xd2c0fd-0x7e;const _0x5ca53c=a146_0x5ca5();let _0x3f9197=_0x5ca53c[_0xd2c0fd];return _0x3f9197;}function validateStep(_0x44d829,_0x5f15a4,_0x59bf1d,_0x54ae04){const _0x11beb7=a146_0x3f91,_0x1fea97=[];if(_0x44d829[_0x11beb7(0x87)]===_0x11beb7(0xc5))return _0x44d829['next']&&_0x1fea97[_0x11beb7(0x12d)](createIssue(_0x11beb7(0xf2),_0x5f15a4+'.next',_0x11beb7(0xcc),_0x11beb7(0xb1)+_0x44d829[_0x11beb7(0x10a)]+_0x11beb7(0x11c),_0x59bf1d)),_0x11beb7(0x9a)in _0x44d829&&_0x44d829['with']!==undefined&&_0x1fea97[_0x11beb7(0x12d)](createIssue('error',_0x5f15a4+'.with',_0x11beb7(0xcc),_0x11beb7(0xb1)+_0x44d829[_0x11beb7(0x10a)]+_0x11beb7(0xe1),_0x59bf1d)),_0x1fea97;_0x44d829[_0x11beb7(0x107)]&&(_0x59bf1d[_0x11beb7(0x88)]&&!_0x59bf1d[_0x11beb7(0x88)][_0x11beb7(0xb7)](_0x44d829[_0x11beb7(0x107)])&&_0x1fea97[_0x11beb7(0x12d)](createIssue('error',_0x5f15a4+'.next','INVALID_NEXT_REFERENCE',_0x11beb7(0xea)+_0x44d829[_0x11beb7(0x107)]+'\x27',_0x59bf1d)));switch(_0x44d829[_0x11beb7(0x87)]){case'wait':_0x1fea97[_0x11beb7(0x12d)](...validateWaitStep(_0x44d829,_0x5f15a4,_0x59bf1d,_0x54ae04));break;case _0x11beb7(0x12a):_0x1fea97['push'](...validateActivationStep(_0x44d829,_0x5f15a4,_0x59bf1d));break;case _0x11beb7(0x101):_0x1fea97[_0x11beb7(0x12d)](...validateDecisionPointStep(_0x44d829,_0x5f15a4,_0x59bf1d,_0x54ae04));break;case'ab_test':_0x1fea97['push'](...validateAbTestStep(_0x44d829,_0x5f15a4,_0x59bf1d,_0x54ae04));break;case _0x11beb7(0x10f):_0x1fea97[_0x11beb7(0x12d)](...validateJumpStep(_0x44d829,_0x5f15a4,_0x59bf1d));break;}return _0x1fea97;}function validateWaitStep(_0x4f8d00,_0x2b6612,_0xd51c82,_0x3061f0){const _0x2e8c61=a146_0x3f91,_0xb3dbab=[];if(!_0x4f8d00['with'])return _0xb3dbab[_0x2e8c61(0x12d)](createIssue(_0x2e8c61(0xf2),_0x2b6612+_0x2e8c61(0xa1),'MISSING_WAIT_PARAMS',_0x2e8c61(0x86),_0xd51c82,_0x2b6612)),_0xb3dbab;if(_0x4f8d00[_0x2e8c61(0x9a)]['condition']){const _0x236918=_0x4f8d00['with']['condition'];if(_0x236918[_0x2e8c61(0x8d)]){_0xd51c82[_0x2e8c61(0x97)]?.[_0x2e8c61(0x95)](_0x236918['segment']);!_0x236918[_0x2e8c61(0x8d)][_0x2e8c61(0xd5)]('ref:')&&(_0xd51c82[_0x2e8c61(0x104)]&&!_0xd51c82[_0x2e8c61(0x104)]['has'](_0x236918[_0x2e8c61(0x8d)])&&_0xb3dbab[_0x2e8c61(0x12d)](createIssue(_0x2e8c61(0xf2),_0x2b6612+_0x2e8c61(0x123),_0x2e8c61(0xa2),_0x2e8c61(0x130)+_0x236918[_0x2e8c61(0x8d)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.',_0xd51c82)));_0x236918[_0x2e8c61(0x107)]&&_0xd51c82[_0x2e8c61(0x88)]&&!_0xd51c82[_0x2e8c61(0x88)][_0x2e8c61(0xb7)](_0x236918['next'])&&_0xb3dbab[_0x2e8c61(0x12d)](createIssue('error',_0x2b6612+_0x2e8c61(0xa9),'INVALID_NEXT_REFERENCE','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x236918[_0x2e8c61(0x107)]+'\x27',_0xd51c82));_0x236918['timeout']?.[_0x2e8c61(0x107)]&&_0xd51c82[_0x2e8c61(0x88)]&&!_0xd51c82[_0x2e8c61(0x88)][_0x2e8c61(0xb7)](_0x236918['timeout'][_0x2e8c61(0x107)])&&_0xb3dbab['push'](createIssue(_0x2e8c61(0xf2),_0x2b6612+_0x2e8c61(0xe3),_0x2e8c61(0x108),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x236918[_0x2e8c61(0xf3)][_0x2e8c61(0x107)]+'\x27',_0xd51c82));const _0x29dc98=_0x236918[_0x2e8c61(0x107)]||_0x4f8d00[_0x2e8c61(0x107)],_0x40784d=_0x236918[_0x2e8c61(0xf3)]?.['next']||_0x4f8d00['next'];if(_0x29dc98){const _0x19c5ab=_0x3061f0[_0x2e8c61(0xb5)](_0x29dc98);_0x19c5ab?.[_0x2e8c61(0x87)]===_0x2e8c61(0x90)&&_0xb3dbab[_0x2e8c61(0x12d)](createIssue(_0x2e8c61(0xc0),_0x2b6612+_0x2e8c61(0xa9),_0x2e8c61(0xe6),'Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x29dc98+_0x2e8c61(0xb6),_0xd51c82,_0x2b6612+_0x2e8c61(0x11f)));}if(_0x40784d){const _0x2c93c5=_0x3061f0[_0x2e8c61(0xb5)](_0x40784d);_0x2c93c5?.[_0x2e8c61(0x87)]===_0x2e8c61(0x90)&&_0xb3dbab[_0x2e8c61(0x12d)](createIssue('warning',_0x2b6612+_0x2e8c61(0xe3),'BRANCH_DIRECTLY_TO_MERGE',_0x2e8c61(0xeb)+_0x40784d+_0x2e8c61(0xb6),_0xd51c82,_0x2b6612+_0x2e8c61(0xc2)));}}}return _0xb3dbab;}function validateActivationStep(_0x4f65f2,_0x497e5a,_0x95e179){const _0xe00a41=a146_0x3f91,_0x239955=[];if(!_0x4f65f2[_0xe00a41(0x9a)]?.[_0xe00a41(0x12a)])return _0x239955[_0xe00a41(0x12d)](createIssue(_0xe00a41(0xf2),_0x497e5a+_0xe00a41(0x9b),_0xe00a41(0xaf),_0xe00a41(0x114),_0x95e179,_0x497e5a)),_0x239955;const _0x34852e=_0x4f65f2[_0xe00a41(0x9a)][_0xe00a41(0x12a)];return _0x95e179[_0xe00a41(0xbf)]&&!_0x34852e[_0xe00a41(0xd5)](_0xe00a41(0x99))&&(!_0x95e179[_0xe00a41(0xbf)][_0xe00a41(0xb7)](_0x34852e)&&_0x239955[_0xe00a41(0x12d)](createIssue('error',_0x497e5a+_0xe00a41(0x9b),_0xe00a41(0x8a),_0xe00a41(0xa7)+_0x34852e+'\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',_0x95e179))),_0x239955;}function validateDecisionPointStep(_0x53448c,_0x21e294,_0x39ca13,_0x45de27){const _0x116496=a146_0x3f91,_0x2d3264=[];if(!_0x53448c['with']?.['branches']||_0x53448c['with']['branches'][_0x116496(0xf1)]===0x0)return _0x2d3264[_0x116496(0x12d)](createIssue(_0x116496(0xf2),_0x21e294+_0x116496(0x113),_0x116496(0x102),'Decision\x20point\x20requires\x20at\x20least\x20one\x20branch',_0x39ca13,_0x21e294)),_0x2d3264;for(let _0xae55eb=0x0;_0xae55eb<_0x53448c[_0x116496(0x9a)][_0x116496(0x85)][_0x116496(0xf1)];_0xae55eb++){const _0x2fe645=_0x53448c[_0x116496(0x9a)][_0x116496(0x85)][_0xae55eb],_0x523b8f=_0x21e294+'.with.branches['+_0xae55eb+']';_0x2fe645['segment']&&!_0x2fe645[_0x116496(0xad)]&&(_0x39ca13[_0x116496(0x97)]?.['add'](_0x2fe645[_0x116496(0x8d)]),!_0x2fe645['segment'][_0x116496(0xd5)](_0x116496(0x99))&&(_0x39ca13['embeddedSegments']&&!_0x39ca13[_0x116496(0x104)][_0x116496(0xb7)](_0x2fe645[_0x116496(0x8d)])&&_0x2d3264[_0x116496(0x12d)](createIssue('error',_0x523b8f+_0x116496(0x96),_0x116496(0xa2),_0x116496(0x12e)+_0x2fe645[_0x116496(0x8d)]+'\x27',_0x39ca13))));_0x2fe645[_0x116496(0x107)]&&_0x39ca13[_0x116496(0x88)]&&!_0x39ca13[_0x116496(0x88)][_0x116496(0xb7)](_0x2fe645[_0x116496(0x107)])&&_0x2d3264['push'](createIssue(_0x116496(0xf2),_0x523b8f+_0x116496(0xd6),_0x116496(0x108),_0x116496(0x83)+_0x2fe645[_0x116496(0x107)]+'\x27',_0x39ca13));if(_0x2fe645[_0x116496(0x107)]){const _0x313123=_0x45de27[_0x116496(0xb5)](_0x2fe645[_0x116496(0x107)]);_0x313123?.[_0x116496(0x87)]===_0x116496(0x90)&&_0x2d3264['push'](createIssue(_0x116496(0xc0),_0x523b8f+_0x116496(0xd6),'BRANCH_DIRECTLY_TO_MERGE',_0x116496(0xc9)+_0x2fe645['name']+'\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x2fe645[_0x116496(0x107)]+_0x116496(0x84),_0x39ca13));}}return _0x2d3264;}function validateAbTestStep(_0x2d13ba,_0x368664,_0xe19675,_0x34ac76){const _0x204f77=a146_0x3f91,_0xcc7aa4=[];if(!_0x2d13ba[_0x204f77(0x9a)]?.[_0x204f77(0x125)]||_0x2d13ba['with']['variants'][_0x204f77(0xf1)]===0x0)return _0xcc7aa4[_0x204f77(0x12d)](createIssue(_0x204f77(0xf2),_0x368664+_0x204f77(0xcd),_0x204f77(0x102),_0x204f77(0xd1),_0xe19675,_0x368664)),_0xcc7aa4;const _0x35780e=_0x2d13ba[_0x204f77(0x9a)]['variants'][_0x204f77(0xd8)]((_0x5ce674,_0xdaf6b3)=>_0x5ce674+(_0xdaf6b3[_0x204f77(0xde)]||0x0),0x0);Math[_0x204f77(0xfd)](_0x35780e-0x64)>0.01&&_0xcc7aa4[_0x204f77(0x12d)](createIssue(_0x204f77(0xf2),_0x368664+_0x204f77(0xcd),_0x204f77(0xf0),_0x204f77(0x8e)+_0x35780e+'%)',_0xe19675));for(let _0x3f0f2b=0x0;_0x3f0f2b<_0x2d13ba[_0x204f77(0x9a)]['variants']['length'];_0x3f0f2b++){const _0x46002e=_0x2d13ba['with'][_0x204f77(0x125)][_0x3f0f2b],_0x5b0873=_0x368664+_0x204f77(0x11a)+_0x3f0f2b+']';_0x46002e[_0x204f77(0x107)]&&_0xe19675[_0x204f77(0x88)]&&!_0xe19675[_0x204f77(0x88)][_0x204f77(0xb7)](_0x46002e[_0x204f77(0x107)])&&_0xcc7aa4[_0x204f77(0x12d)](createIssue(_0x204f77(0xf2),_0x5b0873+_0x204f77(0xd6),_0x204f77(0x108),_0x204f77(0x11e)+_0x46002e['next']+'\x27',_0xe19675));if(_0x46002e['next']){const _0x1fe72d=_0x34ac76[_0x204f77(0xb5)](_0x46002e[_0x204f77(0x107)]);_0x1fe72d?.['type']==='merge'&&_0xcc7aa4['push'](createIssue(_0x204f77(0xc0),_0x5b0873+_0x204f77(0xd6),_0x204f77(0xe6),'A/B\x20test\x20variant\x20\x27'+_0x46002e[_0x204f77(0x10a)]+_0x204f77(0xe0)+_0x46002e[_0x204f77(0x107)]+_0x204f77(0x84),_0xe19675));}}return _0xcc7aa4;}function validateJumpStep(_0x59474e,_0x5c11c5,_0x3f1b68){const _0x251543=a146_0x3f91,_0x475718=[];if(!_0x59474e[_0x251543(0x9a)]?.[_0x251543(0xd2)])return _0x475718[_0x251543(0x12d)](createIssue(_0x251543(0xf2),_0x5c11c5+_0x251543(0x9d),'INVALID_JUMP_TARGET','Jump\x20step\x20requires\x20a\x20target',_0x3f1b68,_0x5c11c5)),_0x475718;return(!_0x59474e[_0x251543(0x9a)]['target'][_0x251543(0xc6)]||!_0x59474e['with'][_0x251543(0xd2)][_0x251543(0xe7)])&&_0x475718[_0x251543(0x12d)](createIssue(_0x251543(0xf2),_0x5c11c5+_0x251543(0x9d),_0x251543(0x124),'Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',_0x3f1b68)),_0x475718;}function buildConvergenceMap(_0x223078){const _0x3b76c1=a146_0x3f91,_0x818f98=new Map();function _0x43ea09(_0x2a16af,_0x1332b1){const _0x1586b9=a146_0x3f91,_0x1c1da6=_0x818f98[_0x1586b9(0xb5)](_0x2a16af)||[];_0x1c1da6[_0x1586b9(0x12d)](_0x1332b1),_0x818f98[_0x1586b9(0x93)](_0x2a16af,_0x1c1da6);}for(const _0x1790f0 of _0x223078){_0x1790f0['next']&&_0x43ea09(_0x1790f0[_0x3b76c1(0x107)],{'stepName':_0x1790f0[_0x3b76c1(0x10a)],'description':'step\x20\x27'+_0x1790f0[_0x3b76c1(0x10a)]+'\x27'});if(_0x1790f0[_0x3b76c1(0x87)]===_0x3b76c1(0x101)&&_0x1790f0[_0x3b76c1(0x9a)]?.['branches'])for(const _0x3f22ce of _0x1790f0[_0x3b76c1(0x9a)][_0x3b76c1(0x85)]){_0x3f22ce['next']&&_0x43ea09(_0x3f22ce[_0x3b76c1(0x107)],{'stepName':_0x1790f0[_0x3b76c1(0x10a)],'description':_0x3b76c1(0x92)+_0x3f22ce[_0x3b76c1(0x10a)]+'\x27\x20of\x20\x27'+_0x1790f0[_0x3b76c1(0x10a)]+'\x27'});}if(_0x1790f0[_0x3b76c1(0x87)]===_0x3b76c1(0x98)&&_0x1790f0['with']?.[_0x3b76c1(0x125)])for(const _0x28af12 of _0x1790f0[_0x3b76c1(0x9a)][_0x3b76c1(0x125)]){_0x28af12[_0x3b76c1(0x107)]&&_0x43ea09(_0x28af12['next'],{'stepName':_0x1790f0['name'],'description':_0x3b76c1(0xed)+_0x28af12[_0x3b76c1(0x10a)]+_0x3b76c1(0xca)+_0x1790f0[_0x3b76c1(0x10a)]+'\x27'});}_0x1790f0['type']===_0x3b76c1(0xfb)&&_0x1790f0[_0x3b76c1(0x9a)]?.['condition']&&(_0x1790f0['with'][_0x3b76c1(0xd9)]['next']&&_0x43ea09(_0x1790f0[_0x3b76c1(0x9a)][_0x3b76c1(0xd9)][_0x3b76c1(0x107)],{'stepName':_0x1790f0[_0x3b76c1(0x10a)],'description':_0x3b76c1(0xa6)+_0x1790f0['name']+'\x27'}),_0x1790f0[_0x3b76c1(0x9a)][_0x3b76c1(0xd9)][_0x3b76c1(0xf3)]?.[_0x3b76c1(0x107)]&&_0x43ea09(_0x1790f0['with'][_0x3b76c1(0xd9)][_0x3b76c1(0xf3)][_0x3b76c1(0x107)],{'stepName':_0x1790f0[_0x3b76c1(0x10a)],'description':_0x3b76c1(0xee)+_0x1790f0[_0x3b76c1(0x10a)]+'\x27'}));}return _0x818f98;}function validateFlowControl(_0x48da26,_0x54c75d,_0x2c4368){const _0x532266=a146_0x3f91,_0x2a00c8=[],_0x11eb71=_0x532266(0xd3)+_0x54c75d+']',_0x1a9c2f=_0x48da26[_0x532266(0xc3)]||[];if(_0x1a9c2f[_0x532266(0xf1)]===0x0)return _0x2a00c8;const _0x2d692a=new Map();for(const _0x3774f1 of _0x1a9c2f){_0x3774f1[_0x532266(0x10a)]&&_0x2d692a[_0x532266(0x93)](_0x3774f1['name'],_0x3774f1);}const _0x1abc0c=buildConvergenceMap(_0x1a9c2f),_0x5e582f=_0x1a9c2f[_0x532266(0xe8)](_0x2d82c1=>_0x2d82c1[_0x532266(0x87)]===_0x532266(0xc5));!_0x5e582f&&_0x2a00c8[_0x532266(0x12d)](createIssue(_0x532266(0xf2),_0x11eb71+_0x532266(0x94),_0x532266(0x8f),_0x532266(0xdb)+_0x48da26[_0x532266(0x10a)]+'\x27\x20has\x20no\x20end\x20step',_0x2c4368));for(const [_0x28feb7,_0x3688d9]of _0x1abc0c){const _0x35f624=_0x2d692a['get'](_0x28feb7);if(!_0x35f624)continue;if(_0x3688d9[_0x532266(0xf1)]>0x1&&_0x35f624['type']!=='merge'){const _0xde4f8c=_0x3688d9[_0x532266(0xbc)](_0x319431=>_0x319431[_0x532266(0xfc)])[_0x532266(0xda)](',\x20');_0x2a00c8[_0x532266(0x12d)](createIssue(_0x532266(0xf2),_0x11eb71+'.steps','CONVERGENCE_WITHOUT_MERGE',_0x532266(0x110)+_0x28feb7+_0x532266(0xbb)+_0xde4f8c+').\x20Use\x20a\x20merge\x20step.',_0x2c4368));}_0x3688d9[_0x532266(0xf1)]===0x1&&_0x35f624['type']===_0x532266(0x90)&&_0x2a00c8[_0x532266(0x12d)](createIssue(_0x532266(0xc0),_0x11eb71+_0x532266(0x94),'SINGLE_INPUT_MERGE',_0x532266(0xcb)+_0x28feb7+'\x27\x20has\x20only\x20one\x20input\x20(from:\x20'+_0x3688d9[0x0]['description']+_0x532266(0xe9),_0x2c4368));}for(const _0x26e898 of _0x1a9c2f){if(_0x26e898[_0x532266(0x87)]==='merge'&&_0x26e898[_0x532266(0x107)]){const _0xc47e51=_0x2d692a[_0x532266(0xb5)](_0x26e898['next']);_0xc47e51?.[_0x532266(0x87)]===_0x532266(0x90)&&_0x2a00c8[_0x532266(0x12d)](createIssue(_0x532266(0xf2),_0x11eb71+'.steps',_0x532266(0x103),'Merge\x20step\x20\x27'+_0x26e898[_0x532266(0x10a)]+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x26e898[_0x532266(0x107)]+_0x532266(0xce),_0x2c4368));}}return _0x2a00c8;}function validateCriteria(_0x312131,_0x3601b6,_0x4df142){const _0x2ffca7=a146_0x3f91,_0x40180f=[];return _0x312131['segment']&&(_0x4df142[_0x2ffca7(0x97)]?.[_0x2ffca7(0x95)](_0x312131[_0x2ffca7(0x8d)]),!_0x312131[_0x2ffca7(0x8d)][_0x2ffca7(0xd5)](_0x2ffca7(0x99))&&(_0x4df142['embeddedSegments']&&!_0x4df142[_0x2ffca7(0x104)][_0x2ffca7(0xb7)](_0x312131[_0x2ffca7(0x8d)])&&_0x40180f[_0x2ffca7(0x12d)](createIssue(_0x2ffca7(0xf2),_0x3601b6+_0x2ffca7(0x96),'MISSING_SEGMENT_REFERENCE','Criteria\x20references\x20undefined\x20segment\x20\x27'+_0x312131['segment']+'\x27',_0x4df142)))),_0x40180f;}function validateEmbeddedSegment(_0x131931,_0x72a9dd,_0x6bbe12){const _0x13e143=a146_0x3f91,_0x2e7c11=[];return _0x131931[_0x13e143(0x121)]&&_0x2e7c11[_0x13e143(0x12d)](...validateRuleDef(_0x131931[_0x13e143(0x121)],_0x72a9dd+_0x13e143(0x9f),_0x6bbe12)),_0x2e7c11;}function validateStage(_0x4fd965,_0x2418a9,_0x4f2812,_0x3a5b46){const _0x29c735=a146_0x3f91,_0x288a52=[],_0x486e7d='stages['+_0x2418a9+']',_0x2c8fd2=new Map(),_0x72cd91=new Map();if(_0x4fd965['steps']){for(let _0x418cea=0x0;_0x418cea<_0x4fd965[_0x29c735(0xc3)][_0x29c735(0xf1)];_0x418cea++){const _0x1a638d=_0x4fd965['steps'][_0x418cea];_0x1a638d[_0x29c735(0x10a)]&&_0x2c8fd2[_0x29c735(0x93)](_0x1a638d[_0x29c735(0x10a)],_0x1a638d);}for(let _0xf0e671=0x0;_0xf0e671<_0x4fd965[_0x29c735(0xc3)][_0x29c735(0xf1)];_0xf0e671++){const _0x40c3e9=_0x4fd965[_0x29c735(0xc3)][_0xf0e671],_0x2246cc=_0x486e7d+'.steps['+_0xf0e671+']';if(_0x40c3e9['name']){if(_0x72cd91[_0x29c735(0xb7)](_0x40c3e9[_0x29c735(0x10a)])){const _0x95b83f=_0x72cd91['get'](_0x40c3e9[_0x29c735(0x10a)]);_0x288a52['push'](createIssue('error',_0x2246cc+_0x29c735(0x9e),'DUPLICATE_STEP_NAME',_0x29c735(0x10c)+_0x40c3e9[_0x29c735(0x10a)]+'\x27\x20(first\x20defined\x20at\x20steps['+_0x95b83f+'])',_0x3a5b46));}else _0x72cd91[_0x29c735(0x93)](_0x40c3e9[_0x29c735(0x10a)],_0xf0e671);}_0x288a52[_0x29c735(0x12d)](...validateStep(_0x40c3e9,_0x2246cc,_0x3a5b46,_0x2c8fd2));}}_0x4fd965[_0x29c735(0xd0)]&&_0x288a52['push'](...validateCriteria(_0x4fd965['entry_criteria'],_0x486e7d+_0x29c735(0x89),_0x3a5b46));if(_0x4fd965['exit_criteria'])for(let _0x410bc5=0x0;_0x410bc5<_0x4fd965[_0x29c735(0xfa)][_0x29c735(0xf1)];_0x410bc5++){_0x288a52[_0x29c735(0x12d)](...validateCriteria(_0x4fd965[_0x29c735(0xfa)][_0x410bc5],_0x486e7d+'.exit_criteria['+_0x410bc5+']',_0x3a5b46));}return _0x4fd965[_0x29c735(0xa5)]&&_0x288a52[_0x29c735(0x12d)](...validateCriteria(_0x4fd965[_0x29c735(0xa5)],_0x486e7d+_0x29c735(0x115),_0x3a5b46)),_0x288a52[_0x29c735(0x12d)](...validateStageStructure(_0x4fd965,_0x2418a9,_0x4f2812,_0x3a5b46)),_0x288a52[_0x29c735(0x12d)](...validateFlowControl(_0x4fd965,_0x2418a9,_0x3a5b46)),_0x288a52;}function validateStagesForVersion(_0x47c498,_0x32b814,_0x2dab5a,_0xacd739,_0x4835f1,_0xc42379,_0x449aff){const _0x297d1b=a146_0x3f91;if(_0x47c498[_0x297d1b(0xf1)]===0x0){_0x4835f1[_0x297d1b(0x12d)]({'level':_0x297d1b(0xf2),'path':_0xacd739+'stages','code':_0x297d1b(0x10d),'message':_0x297d1b(0xf4),'location':getLocationFromPath(_0x2dab5a[_0x297d1b(0x11b)],_0x2dab5a[_0x297d1b(0xbe)],[_0x297d1b(0x8b)])});return;}const _0x108580=new Set();for(const _0x3b2892 of _0x47c498){if(_0x3b2892[_0x297d1b(0xc3)])for(const _0x3863f9 of _0x3b2892['steps']){_0x3863f9[_0x297d1b(0x10a)]&&_0x108580[_0x297d1b(0x95)](_0x3863f9['name']);}}const _0x567cf6={..._0x2dab5a,'stepNames':_0x108580},_0x416f07=validateVersionStructure(_0x47c498,_0x567cf6);for(const _0x269282 of _0x416f07){const _0x502f12=_0xacd739?{..._0x269282,'path':''+_0xacd739+_0x269282['path']}:_0x269282;if(_0x502f12[_0x297d1b(0x8c)]===_0x297d1b(0xf2))_0x4835f1[_0x297d1b(0x12d)](_0x502f12);else _0xc42379[_0x297d1b(0x12d)](_0x502f12);}for(let _0x520299=0x0;_0x520299<_0x47c498['length'];_0x520299++){const _0x2886d7=validateStage(_0x47c498[_0x520299],_0x520299,_0x47c498[_0x297d1b(0xf1)],_0x567cf6);for(const _0x5c389e of _0x2886d7){const _0x1b8abf=_0xacd739?{..._0x5c389e,'path':''+_0xacd739+_0x5c389e[_0x297d1b(0xd7)]}:_0x5c389e;if(_0x1b8abf[_0x297d1b(0x8c)]==='error')_0x4835f1['push'](_0x1b8abf);else _0xc42379['push'](_0x1b8abf);}}if(_0x32b814['goal']){const _0x62f7b9=_0x449aff?.[_0x297d1b(0xec)]?_0x297d1b(0xc8):_0xacd739+_0x297d1b(0xc8),_0x2a3a99=validateCriteria(_0x32b814[_0x297d1b(0xc8)],_0x62f7b9,_0x567cf6);for(const _0x26eb57 of _0x2a3a99){if(_0x26eb57['level']===_0x297d1b(0xf2))_0x4835f1['push'](_0x26eb57);else _0xc42379[_0x297d1b(0x12d)](_0x26eb57);}}}function extractVersionIndex(_0x6e5b19){const _0x3c10ba=_0x6e5b19['match'](/^journeys\[(\d+)\]\./);return _0x3c10ba?_0x3c10ba[0x1]:undefined;}function deduplicateAcrossVersions(_0x4e9276){const _0x553306=a146_0x3f91,_0x201173=new Map();for(let _0x5bef8d=0x0;_0x5bef8d<_0x4e9276[_0x553306(0xf1)];_0x5bef8d++){const _0x1d5383=_0x4e9276[_0x5bef8d][_0x553306(0xef)]+':'+_0x4e9276[_0x5bef8d][_0x553306(0xa0)],_0x41ae3c=extractVersionIndex(_0x4e9276[_0x5bef8d][_0x553306(0xd7)]),_0x4f9e45=_0x201173[_0x553306(0xb5)](_0x1d5383);if(_0x4f9e45){_0x4f9e45[_0x553306(0x127)][_0x553306(0x12d)](_0x5bef8d);if(_0x41ae3c)_0x4f9e45[_0x553306(0x105)][_0x553306(0x95)](_0x41ae3c);}else _0x201173[_0x553306(0x93)](_0x1d5383,{'indices':[_0x5bef8d],'versions':new Set(_0x41ae3c?[_0x41ae3c]:[])});}const _0x313322=new Set();for(const {indices:_0x3f6be0,versions:_0x3af266}of _0x201173[_0x553306(0x11d)]()){if(_0x3af266[_0x553306(0x111)]<=0x1)continue;const _0x33d40c=_0x4e9276[_0x3f6be0[0x0]];_0x33d40c[_0x553306(0xd7)]=_0x33d40c[_0x553306(0xd7)][_0x553306(0xe4)](/^journeys\[\d+\]\./,''),_0x33d40c['message']=_0x33d40c[_0x553306(0xa0)]+_0x553306(0xf5)+_0x3af266[_0x553306(0x111)]+_0x553306(0x10b);for(let _0x1670af=0x1;_0x1670af<_0x3f6be0[_0x553306(0xf1)];_0x1670af++){_0x313322['add'](_0x3f6be0[_0x1670af]);}}const _0x425fa3=[..._0x313322]['sort']((_0x12c87e,_0x5bf05b)=>_0x5bf05b-_0x12c87e);for(const _0x9d873e of _0x425fa3){_0x4e9276[_0x553306(0xa8)](_0x9d873e,0x1);}}export function validateJourneyDef(_0x17f2c1,_0x349f6d={},_0x5d899a={}){const _0x41c2e2=a146_0x3f91;if(_0x5d899a[_0x41c2e2(0x129)])return runJourneySemanticChecks(_0x17f2c1,_0x349f6d);const _0x164cec=JourneyDefSchema[_0x41c2e2(0xae)](_0x17f2c1);if(_0x164cec['success'])return runJourneySemanticChecks(_0x164cec['data'],_0x349f6d);return zodErrorsToJourneyValidationResult(_0x164cec[_0x41c2e2(0xf2)],_0x349f6d);}function zodErrorsToJourneyValidationResult(_0x3930bf,_0x2626e9){const _0x526f8b=a146_0x3f91,_0xd24b93=flattenZodIssues(_0x3930bf['issues']),_0x2d4ff4=_0xd24b93[_0x526f8b(0xbc)](_0xdeac03=>{const _0x34be5f=_0x526f8b,_0x459c80=formatZodPath(_0xdeac03[_0x34be5f(0xd7)]),_0x4266b2=mapJourneyZodIssueToCode(_0xdeac03,_0x459c80),_0x29f840=getLocationFromPath(_0x2626e9['document'],_0x2626e9[_0x34be5f(0xbe)],_0xdeac03[_0x34be5f(0xd7)]['map'](_0x48e966=>typeof _0x48e966===_0x34be5f(0xf9)?String(_0x48e966):_0x48e966));return{'level':_0x34be5f(0xf2),'path':_0x459c80,'code':_0x4266b2,'message':_0xdeac03[_0x34be5f(0xa0)],..._0x29f840&&{'location':_0x29f840}};});return{'valid':![],'errors':_0x2d4ff4,'warnings':[]};}function a146_0x5ca5(){const _0x5ce230=['MISSING_ACTIVATION_DEFINITION','stages','level','segment','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','MISSING_END_STEP','merge','excluded_','branch\x20\x27','set','.steps','add','.segment','referencedSegments','ab_test','ref:','with','.with.activation','keys','.with.target','.name','.rule','message','.with','MISSING_SEGMENT_REFERENCE','1146010OQOkXO','\x20steps\x20(may\x20be\x20too\x20simple)','milestone','condition\x20of\x20\x27','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','splice','.with.condition.next','trim','journeys','JOURNEY_SCHEMA_ERROR','excluded','safeParse','MISSING_ACTIVATION_REF','journeys[','End\x20step\x20\x27','362844iuqlhR','endsWith','MISSING_GOAL','get','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','has','latest','segments.','TOO_MANY_STAGES','\x27\x20(from:\x20','map','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','source','activationKeys','warning','\x20stages\x20but\x20maximum\x20is\x20','.with.condition.timeout','steps','60690mEhCrm','end','journey','\x27\x20has\x20no\x20exit_criteria\x20defined','goal','Decision\x20branch\x20\x27','\x27\x20of\x20\x27','Merge\x20step\x20\x27','END_STEP_HAS_NEXT_OR_WITH','.with.variants','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','launched','entry_criteria','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','target','stages[','MISSING_NAME','startsWith','.next','path','reduce','condition','join','Stage\x20\x27','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','DUPLICATE_LATEST','percentage','journeys,\x20stages,\x20or\x20versions','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','\x27\x20has\x20no\x20steps','.with.condition.timeout.next','replace','1763754cpnbaw','BRANCH_DIRECTLY_TO_MERGE','stage','some',').\x20Merge\x20is\x20unnecessary.','Step\x20references\x20non-existent\x20step\x20\x27','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','goalIsInherited','variant\x20\x27','timeout\x20of\x20\x27','code','INVALID_AB_TEST_PERCENTAGES','length','error','timeout','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','\x20(across\x20','UNUSED_EMBEDDED_SEGMENT','7360080wXUiad','MISSING_ENTRY_CRITERIA','symbol','exit_criteria','wait','description','abs','.type','Embedded\x20segment\x20\x27','MISSING_EXIT_CRITERIA','decision_point','MISSING_CONDITIONS','MERGE_TO_MERGE_CHAIN','embeddedSegments','versions','journey\x20entry','next','INVALID_NEXT_REFERENCE','\x27\x20has\x20only\x20','name','\x20versions)','Duplicate\x20step\x20name\x20\x27','MISSING_STAGES','activations','jump','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','size','MISSING_MILESTONE','.with.branches','Activation\x20step\x20requires\x20an\x20activation\x20reference','.milestone','filter','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','includes','596956gllQfy','.with.variants[','document','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','values','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','.with.condition','Journey\x20can\x20have\x20at\x20most\x20one\x20','rule','\x20with\x20latest:\x20true','.with.condition.segment','INVALID_JUMP_TARGET','variants','state','indices','72212bKAIVA','skipSchema','activation','ACTIVATION_SCHEMA_ERROR','entries','push','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','45qBNqkE','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','segments','FEW_STEPS','INSUFFICIENT_STEPS','versions[','.exit_criteria','Journey\x20has\x20','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','\x27\x20with\x20no\x20action\x20in\x20between','branches','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','type','stepNames','.entry_criteria'];a146_0x5ca5=function(){return _0x5ce230;};return a146_0x5ca5();}function mapJourneyZodIssueToCode(_0x234079,_0x403321){const _0x5359fd=a146_0x3f91;if(_0x403321==='name')return _0x5359fd(0xd4);if(_0x403321[_0x5359fd(0xb3)](_0x5359fd(0xfe))&&_0x403321[_0x5359fd(0x118)](_0x5359fd(0xc3)))return _0x5359fd(0xac);if(_0x403321==='stages'||_0x403321['endsWith']('.stages'))return _0x5359fd(0x10d);if(_0x403321===''&&_0x234079[_0x5359fd(0xa0)][_0x5359fd(0x118)](_0x5359fd(0xdf)))return _0x5359fd(0x10d);if(_0x403321[_0x5359fd(0x118)]('activation'))return _0x5359fd(0x12b);return'JOURNEY_SCHEMA_ERROR';}function runJourneySemanticChecks(_0x584d49,_0x50114a){const _0x3b11a3=a146_0x3f91,_0x382d6d=[],_0x29491e=[];(!_0x584d49[_0x3b11a3(0x10a)]||_0x584d49['name'][_0x3b11a3(0xaa)]()==='')&&_0x382d6d['push']({'level':_0x3b11a3(0xf2),'path':'name','code':'MISSING_NAME','message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x50114a['document'],_0x50114a[_0x3b11a3(0xbe)],[_0x3b11a3(0x10a)])});const _0x18bfe0=new Set();if(_0x584d49[_0x3b11a3(0x131)])for(const _0x3c783d of Object[_0x3b11a3(0x9c)](_0x584d49[_0x3b11a3(0x131)])){_0x18bfe0[_0x3b11a3(0x95)](_0x3c783d);}const _0x566db5=new Set();if(_0x584d49[_0x3b11a3(0x10e)])for(const _0x54a28e of Object['keys'](_0x584d49['activations'])){_0x566db5[_0x3b11a3(0x95)](_0x54a28e);}const _0x539690=new Set(),_0x34f915={..._0x50114a,'embeddedSegments':_0x18bfe0,'referencedSegments':_0x539690,'activationKeys':_0x566db5['size']>0x0?_0x566db5:undefined};if(_0x584d49[_0x3b11a3(0x131)])for(const [_0x4e6e05,_0x463e1c]of Object[_0x3b11a3(0x12c)](_0x584d49[_0x3b11a3(0x131)])){const _0x5cd439=validateEmbeddedSegment(_0x463e1c,_0x3b11a3(0xb9)+_0x4e6e05,_0x34f915);for(const _0x540d26 of _0x5cd439){if(_0x540d26[_0x3b11a3(0x8c)]===_0x3b11a3(0xf2))_0x382d6d[_0x3b11a3(0x12d)](_0x540d26);else _0x29491e[_0x3b11a3(0x12d)](_0x540d26);}}const _0x122258=!!_0x584d49[_0x3b11a3(0xc8)],_0x2c38c9=_0x584d49[_0x3b11a3(0xab)]?.['every'](_0x15feef=>!!_0x15feef[_0x3b11a3(0xc8)])??![];!_0x122258&&!_0x2c38c9&&_0x29491e[_0x3b11a3(0x12d)]({'level':'warning','path':_0x3b11a3(0xc8),'code':_0x3b11a3(0xb4),'message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x50114a['document'],_0x50114a[_0x3b11a3(0xbe)],[_0x3b11a3(0xc8)])});const _0x21d3e0=_0x584d49['journeys']??_0x584d49[_0x3b11a3(0x105)];if(_0x21d3e0&&_0x21d3e0[_0x3b11a3(0x116)](_0x4afe2c=>_0x4afe2c[_0x3b11a3(0xb8)]===!![])[_0x3b11a3(0xf1)]>0x1){const _0x472e99=_0x584d49[_0x3b11a3(0xab)]?_0x3b11a3(0xab):_0x3b11a3(0x105);_0x382d6d[_0x3b11a3(0x12d)]({'level':_0x3b11a3(0xf2),'path':_0x472e99,'code':_0x3b11a3(0xdd),'message':_0x3b11a3(0x120)+(_0x472e99===_0x3b11a3(0xab)?_0x3b11a3(0x106):'version')+_0x3b11a3(0x122),'location':getLocationFromPath(_0x50114a[_0x3b11a3(0x11b)],_0x50114a[_0x3b11a3(0xbe)],[_0x472e99])});}if(_0x584d49[_0x3b11a3(0xab)]&&_0x584d49[_0x3b11a3(0xab)]['length']>0x0)for(let _0xf92d3=0x0;_0xf92d3<_0x584d49[_0x3b11a3(0xab)][_0x3b11a3(0xf1)];_0xf92d3++){const _0x460fab=_0x584d49[_0x3b11a3(0xab)][_0xf92d3];if(_0x584d49[_0x3b11a3(0xab)][_0x3b11a3(0xf1)]>0x1&&_0x460fab[_0x3b11a3(0x126)]===_0x3b11a3(0xcf))continue;const _0x54d62a=_0x460fab[_0x3b11a3(0x8b)]||[],_0x4a4633=_0x3b11a3(0xb0)+_0xf92d3+'].',_0x22906a=!!_0x460fab['goal'],_0x2f9148=_0x22906a?{..._0x584d49,'goal':_0x460fab[_0x3b11a3(0xc8)]}:_0x584d49;validateStagesForVersion(_0x54d62a,_0x2f9148,_0x34f915,_0x4a4633,_0x382d6d,_0x29491e,{'goalIsInherited':!_0x22906a});}else{if(_0x584d49[_0x3b11a3(0x105)]&&_0x584d49[_0x3b11a3(0x105)][_0x3b11a3(0xf1)]>0x0)for(let _0x40d309=0x0;_0x40d309<_0x584d49[_0x3b11a3(0x105)][_0x3b11a3(0xf1)];_0x40d309++){const _0x1ecaa9=_0x584d49[_0x3b11a3(0x105)][_0x40d309];if(_0x584d49[_0x3b11a3(0x105)][_0x3b11a3(0xf1)]>0x1&&_0x1ecaa9['state']===_0x3b11a3(0xcf))continue;const _0x45bb93=_0x1ecaa9[_0x3b11a3(0x8b)]||[],_0x30bfa1=_0x3b11a3(0x80)+_0x40d309+'].';validateStagesForVersion(_0x45bb93,_0x584d49,_0x34f915,_0x30bfa1,_0x382d6d,_0x29491e);}else{const _0x103926=_0x584d49['stages']||[];validateStagesForVersion(_0x103926,_0x584d49,_0x34f915,'',_0x382d6d,_0x29491e);}}_0x584d49[_0x3b11a3(0xab)]&&_0x584d49[_0x3b11a3(0xab)][_0x3b11a3(0xf1)]>0x1&&(deduplicateAcrossVersions(_0x382d6d),deduplicateAcrossVersions(_0x29491e));for(const _0x46600e of _0x18bfe0){!_0x539690['has'](_0x46600e)&&!_0x46600e[_0x3b11a3(0xd5)](_0x3b11a3(0x91))&&_0x29491e[_0x3b11a3(0x12d)]({'level':_0x3b11a3(0xc0),'path':'segments.'+_0x46600e,'code':_0x3b11a3(0xf6),'message':_0x3b11a3(0xff)+_0x46600e+_0x3b11a3(0xdc),'location':getLocationFromPath(_0x50114a[_0x3b11a3(0x11b)],_0x50114a[_0x3b11a3(0xbe)],[_0x3b11a3(0x131),_0x46600e])});}return{'valid':_0x382d6d['length']===0x0,'errors':_0x382d6d,'warnings':_0x29491e};}
|
|
1
|
+
(function(_0x581c95,_0x20ec16){const _0x3a26fb=a146_0x5998,_0x1ff0f6=_0x581c95();while(!![]){try{const _0x3333fe=-parseInt(_0x3a26fb(0xcb))/0x1+-parseInt(_0x3a26fb(0xd5))/0x2+parseInt(_0x3a26fb(0x9b))/0x3*(parseInt(_0x3a26fb(0x12d))/0x4)+parseInt(_0x3a26fb(0xa0))/0x5+parseInt(_0x3a26fb(0xae))/0x6+parseInt(_0x3a26fb(0xe5))/0x7+-parseInt(_0x3a26fb(0xac))/0x8;if(_0x3333fe===_0x20ec16)break;else _0x1ff0f6['push'](_0x1ff0f6['shift']());}catch(_0xa9f0b0){_0x1ff0f6['push'](_0x1ff0f6['shift']());}}}(a146_0x31a6,0x8ef71));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x143319,_0x22d7be,_0x4fed61,_0x152c51,_0x3aba85,_0x3714fd){const _0x5d706e=a146_0x5998;return{'level':_0x143319,'path':_0x22d7be,'code':_0x4fed61,'message':_0x152c51,'location':getLocationFromPath(_0x3aba85[_0x5d706e(0xda)],_0x3aba85[_0x5d706e(0x88)],pathToArray(_0x3714fd??_0x22d7be))};}function validateVersionStructure(_0x4f938e,_0x57d4f6){const _0x9bedb4=a146_0x5998,_0x476863=[];return _0x4f938e[_0x9bedb4(0xff)]>MAX_STAGES&&_0x476863[_0x9bedb4(0x10d)](createIssue(_0x9bedb4(0x132),'stages','TOO_MANY_STAGES',_0x9bedb4(0x124)+_0x4f938e['length']+_0x9bedb4(0xe2)+MAX_STAGES,_0x57d4f6)),_0x476863;}function a146_0x31a6(){const _0x4b0f46=['journeys','step\x20\x27','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.with.variants[','End\x20step\x20\x27','\x27\x20(first\x20defined\x20at\x20steps[','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','length','sort','\x27\x20(from:\x20','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','stage','CONVERGENCE_WITHOUT_MERGE','safeParse','data','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','includes','Activation\x20step\x20requires\x20an\x20activation\x20reference',').\x20Use\x20a\x20merge\x20step.','push','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','size','Jump\x20step\x20requires\x20a\x20target','.rule','MISSING_GOAL','.with','\x20with\x20latest:\x20true','\x20versions)','.entry_criteria','.with.condition.segment','every','.milestone','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','.segment','exit_criteria','level','.type','MISSING_MILESTONE','segment','MISSING_WAIT_PARAMS','splice','.steps','Journey\x20has\x20','stages[','trim','variants','.with.branches','next','indices','UNUSED_EMBEDDED_SEGMENT','referencedSegments','3598956UtdYPy','versions','DUPLICATE_LATEST','Criteria\x20references\x20undefined\x20segment\x20\x27','success','error','timeout\x20of\x20\x27','percentage','condition','MISSING_CONDITIONS','version','segments','type','timeout','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','milestone','reduce','merge','MISSING_NAME','source','journeys,\x20stages,\x20or\x20versions','set','FEW_STEPS','ab_test','warning','with','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','map','Embedded\x20segment\x20\x27','activation','.with.condition.next','MISSING_ACTIVATION_DEFINITION','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','journey\x20entry','MISSING_STAGES','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','JOURNEY_SCHEMA_ERROR','3qDVHpz','MISSING_EXIT_CRITERIA','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','code','DUPLICATE_STEP_NAME','3824305QJoein','add','rule','Merge\x20step\x20\x27','MISSING_END_STEP','\x20steps\x20(may\x20be\x20too\x20simple)','decision_point','excluded_','message','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','Stage\x20\x27','8774984RiJyaE','INVALID_NEXT_REFERENCE','1334214oqKiHK','.with.condition.timeout.next','steps','.steps[','BRANCH_DIRECTLY_TO_MERGE','MERGE_TO_MERGE_CHAIN','\x27\x20has\x20only\x20','.with.variants','.exit_criteria[','Journey\x20has\x20no\x20goal\x20defined','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.name','join','wait','INSUFFICIENT_STEPS','.with.activation','goal','launched','variant\x20\x27','get','segments.','condition\x20of\x20\x27','ACTIVATION_SCHEMA_ERROR','branches','activations','.with.target','Step\x20references\x20non-existent\x20step\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','717880XxSZet','keys',').\x20Merge\x20is\x20unnecessary.','embeddedSegments','.with.condition.timeout','name','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','description','some','end','1249666ufGtgE','END_STEP_HAS_NEXT_OR_WITH','entry_criteria','jump','MISSING_ENTRY_CRITERIA','document','endsWith','stepNames','\x20(across\x20','INVALID_JUMP_TARGET','\x27\x20has\x20no\x20end\x20step','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','\x27\x20with\x20no\x20action\x20in\x20between','\x20stages\x20but\x20maximum\x20is\x20','MISSING_SEGMENT_REFERENCE','Duplicate\x20step\x20name\x20\x27','7967414dchBgw','excluded','startsWith','ref:','.stages','path','Decision\x20branch\x20\x27','filter','.next','\x27\x20has\x20no\x20exit_criteria\x20defined','state','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','versions[','.exit_criteria','has','stages','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','goalIsInherited','\x27\x20of\x20\x27'];a146_0x31a6=function(){return _0x4b0f46;};return a146_0x31a6();}function validateStageStructure(_0x592f46,_0x4d5df0,_0x326fde,_0x51ca44){const _0x639f42=a146_0x5998,_0x49d934=[],_0x21816c=_0x639f42(0x125)+_0x4d5df0+']';_0x4d5df0===0x0&&!_0x592f46[_0x639f42(0xd7)]&&_0x49d934[_0x639f42(0x10d)](createIssue(_0x639f42(0x132),_0x21816c+_0x639f42(0x116),_0x639f42(0xd9),_0x639f42(0xab)+_0x592f46[_0x639f42(0xd0)]+_0x639f42(0xf0),_0x51ca44,_0x21816c));const _0x159c63=_0x4d5df0===_0x326fde-0x1;!_0x159c63&&!_0x592f46[_0x639f42(0x13c)]&&_0x49d934[_0x639f42(0x10d)](createIssue(_0x639f42(0x132),_0x21816c+'.milestone',_0x639f42(0x11f),_0x639f42(0xab)+_0x592f46[_0x639f42(0xd0)]+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0x51ca44,_0x21816c));(!_0x592f46[_0x639f42(0x11c)]||_0x592f46[_0x639f42(0x11c)][_0x639f42(0xff)]===0x0)&&_0x49d934['push'](createIssue('warning',_0x21816c+_0x639f42(0xf2),_0x639f42(0x9c),'Stage\x20\x27'+_0x592f46['name']+_0x639f42(0xee),_0x51ca44,_0x21816c));const _0x5a5588=_0x592f46[_0x639f42(0xb0)]?.[_0x639f42(0xff)]??0x0;if(_0x5a5588===0x0)_0x49d934[_0x639f42(0x10d)](createIssue(_0x639f42(0x132),_0x21816c+'.steps',_0x639f42(0xbd),_0x639f42(0xab)+_0x592f46[_0x639f42(0xd0)]+'\x27\x20has\x20no\x20steps',_0x51ca44,_0x21816c+_0x639f42(0x123)));else{if(_0x5a5588===0x1)_0x49d934[_0x639f42(0x10d)](createIssue(_0x639f42(0x8d),_0x21816c+_0x639f42(0x123),_0x639f42(0xbd),'Stage\x20\x27'+_0x592f46[_0x639f42(0xd0)]+_0x639f42(0x107),_0x51ca44,_0x21816c+_0x639f42(0x123)));else _0x5a5588<=0x3&&_0x49d934[_0x639f42(0x10d)](createIssue('warning',_0x21816c+_0x639f42(0x123),_0x639f42(0x8b),_0x639f42(0xab)+_0x592f46['name']+_0x639f42(0xb4)+_0x5a5588+_0x639f42(0xa5),_0x51ca44,_0x21816c+_0x639f42(0x123)));}return _0x49d934;}function validateStep(_0x20c875,_0xbc061b,_0x4d611f,_0x5d8ffd){const _0x167eb3=a146_0x5998,_0x1c3321=[];if(_0x20c875[_0x167eb3(0x139)]===_0x167eb3(0xd4))return _0x20c875[_0x167eb3(0x129)]&&_0x1c3321[_0x167eb3(0x10d)](createIssue('error',_0xbc061b+'.next',_0x167eb3(0xd6),_0x167eb3(0xfc)+_0x20c875[_0x167eb3(0xd0)]+_0x167eb3(0x109),_0x4d611f)),'with'in _0x20c875&&_0x20c875[_0x167eb3(0x8e)]!==undefined&&_0x1c3321[_0x167eb3(0x10d)](createIssue(_0x167eb3(0x132),_0xbc061b+_0x167eb3(0x113),_0x167eb3(0xd6),_0x167eb3(0xfc)+_0x20c875['name']+_0x167eb3(0xaa),_0x4d611f)),_0x1c3321;_0x20c875[_0x167eb3(0x129)]&&(_0x4d611f['stepNames']&&!_0x4d611f['stepNames']['has'](_0x20c875[_0x167eb3(0x129)])&&_0x1c3321[_0x167eb3(0x10d)](createIssue('error',_0xbc061b+'.next',_0x167eb3(0xad),_0x167eb3(0xc9)+_0x20c875[_0x167eb3(0x129)]+'\x27',_0x4d611f)));switch(_0x20c875[_0x167eb3(0x139)]){case _0x167eb3(0xbc):_0x1c3321[_0x167eb3(0x10d)](...validateWaitStep(_0x20c875,_0xbc061b,_0x4d611f,_0x5d8ffd));break;case _0x167eb3(0x93):_0x1c3321[_0x167eb3(0x10d)](...validateActivationStep(_0x20c875,_0xbc061b,_0x4d611f));break;case _0x167eb3(0xa6):_0x1c3321[_0x167eb3(0x10d)](...validateDecisionPointStep(_0x20c875,_0xbc061b,_0x4d611f,_0x5d8ffd));break;case _0x167eb3(0x8c):_0x1c3321[_0x167eb3(0x10d)](...validateAbTestStep(_0x20c875,_0xbc061b,_0x4d611f,_0x5d8ffd));break;case _0x167eb3(0xd8):_0x1c3321[_0x167eb3(0x10d)](...validateJumpStep(_0x20c875,_0xbc061b,_0x4d611f));break;}return _0x1c3321;}function validateWaitStep(_0x470eba,_0x2cc787,_0x119f1f,_0x43b771){const _0x30b095=a146_0x5998,_0x357c1a=[];if(!_0x470eba[_0x30b095(0x8e)])return _0x357c1a[_0x30b095(0x10d)](createIssue(_0x30b095(0x132),_0x2cc787+_0x30b095(0x113),_0x30b095(0x121),'Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field',_0x119f1f,_0x2cc787)),_0x357c1a;if(_0x470eba['with']['condition']){const _0x5cb893=_0x470eba[_0x30b095(0x8e)]['condition'];if(_0x5cb893[_0x30b095(0x120)]){_0x119f1f[_0x30b095(0x12c)]?.[_0x30b095(0xa1)](_0x5cb893[_0x30b095(0x120)]);!_0x5cb893[_0x30b095(0x120)][_0x30b095(0xe7)]('ref:')&&(_0x119f1f[_0x30b095(0xce)]&&!_0x119f1f[_0x30b095(0xce)][_0x30b095(0xf3)](_0x5cb893[_0x30b095(0x120)])&&_0x357c1a[_0x30b095(0x10d)](createIssue(_0x30b095(0x132),_0x2cc787+_0x30b095(0x117),_0x30b095(0xe3),_0x30b095(0x8f)+_0x5cb893['segment']+_0x30b095(0xca),_0x119f1f)));_0x5cb893[_0x30b095(0x129)]&&_0x119f1f[_0x30b095(0xdc)]&&!_0x119f1f['stepNames']['has'](_0x5cb893['next'])&&_0x357c1a[_0x30b095(0x10d)](createIssue(_0x30b095(0x132),_0x2cc787+_0x30b095(0x94),_0x30b095(0xad),_0x30b095(0xa9)+_0x5cb893[_0x30b095(0x129)]+'\x27',_0x119f1f));_0x5cb893['timeout']?.[_0x30b095(0x129)]&&_0x119f1f[_0x30b095(0xdc)]&&!_0x119f1f[_0x30b095(0xdc)][_0x30b095(0xf3)](_0x5cb893[_0x30b095(0x13a)][_0x30b095(0x129)])&&_0x357c1a[_0x30b095(0x10d)](createIssue(_0x30b095(0x132),_0x2cc787+_0x30b095(0xaf),_0x30b095(0xad),'Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x5cb893[_0x30b095(0x13a)][_0x30b095(0x129)]+'\x27',_0x119f1f));const _0x50a2a7=_0x5cb893[_0x30b095(0x129)]||_0x470eba[_0x30b095(0x129)],_0x1b5f34=_0x5cb893['timeout']?.[_0x30b095(0x129)]||_0x470eba['next'];if(_0x50a2a7){const _0x2c0681=_0x43b771[_0x30b095(0xc2)](_0x50a2a7);_0x2c0681?.[_0x30b095(0x139)]===_0x30b095(0x86)&&_0x357c1a[_0x30b095(0x10d)](createIssue(_0x30b095(0x8d),_0x2cc787+_0x30b095(0x94),_0x30b095(0xb2),_0x30b095(0xb9)+_0x50a2a7+_0x30b095(0x13b),_0x119f1f,_0x2cc787+'.with.condition'));}if(_0x1b5f34){const _0x20020a=_0x43b771[_0x30b095(0xc2)](_0x1b5f34);_0x20020a?.['type']===_0x30b095(0x86)&&_0x357c1a['push'](createIssue(_0x30b095(0x8d),_0x2cc787+'.with.condition.timeout.next','BRANCH_DIRECTLY_TO_MERGE','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x1b5f34+_0x30b095(0x13b),_0x119f1f,_0x2cc787+_0x30b095(0xcf)));}}}return _0x357c1a;}function validateActivationStep(_0x51c42e,_0x5bfe32,_0x2d28db){const _0x5385c3=a146_0x5998,_0x2048ae=[];if(!_0x51c42e[_0x5385c3(0x8e)]?.[_0x5385c3(0x93)])return _0x2048ae[_0x5385c3(0x10d)](createIssue(_0x5385c3(0x132),_0x5bfe32+_0x5385c3(0xbe),'MISSING_ACTIVATION_REF',_0x5385c3(0x10b),_0x2d28db,_0x5bfe32)),_0x2048ae;const _0x27f5f2=_0x51c42e[_0x5385c3(0x8e)][_0x5385c3(0x93)];return _0x2d28db['activationKeys']&&!_0x27f5f2[_0x5385c3(0xe7)](_0x5385c3(0xe8))&&(!_0x2d28db['activationKeys'][_0x5385c3(0xf3)](_0x27f5f2)&&_0x2048ae[_0x5385c3(0x10d)](createIssue(_0x5385c3(0x132),_0x5bfe32+_0x5385c3(0xbe),_0x5385c3(0x95),_0x5385c3(0x99)+_0x27f5f2+_0x5385c3(0x11a),_0x2d28db))),_0x2048ae;}function validateDecisionPointStep(_0x1e342a,_0x48f7a8,_0x1158b7,_0xd52457){const _0x5e0cf3=a146_0x5998,_0x386d00=[];if(!_0x1e342a[_0x5e0cf3(0x8e)]?.[_0x5e0cf3(0xc6)]||_0x1e342a[_0x5e0cf3(0x8e)]['branches'][_0x5e0cf3(0xff)]===0x0)return _0x386d00['push'](createIssue(_0x5e0cf3(0x132),_0x48f7a8+_0x5e0cf3(0x128),_0x5e0cf3(0x136),_0x5e0cf3(0xb8),_0x1158b7,_0x48f7a8)),_0x386d00;for(let _0x226139=0x0;_0x226139<_0x1e342a[_0x5e0cf3(0x8e)][_0x5e0cf3(0xc6)][_0x5e0cf3(0xff)];_0x226139++){const _0x77b618=_0x1e342a[_0x5e0cf3(0x8e)][_0x5e0cf3(0xc6)][_0x226139],_0x128245=_0x48f7a8+'.with.branches['+_0x226139+']';_0x77b618[_0x5e0cf3(0x120)]&&!_0x77b618[_0x5e0cf3(0xe6)]&&(_0x1158b7[_0x5e0cf3(0x12c)]?.[_0x5e0cf3(0xa1)](_0x77b618[_0x5e0cf3(0x120)]),!_0x77b618[_0x5e0cf3(0x120)][_0x5e0cf3(0xe7)]('ref:')&&(_0x1158b7[_0x5e0cf3(0xce)]&&!_0x1158b7['embeddedSegments']['has'](_0x77b618[_0x5e0cf3(0x120)])&&_0x386d00[_0x5e0cf3(0x10d)](createIssue(_0x5e0cf3(0x132),_0x128245+_0x5e0cf3(0x11b),'MISSING_SEGMENT_REFERENCE',_0x5e0cf3(0xf5)+_0x77b618[_0x5e0cf3(0x120)]+'\x27',_0x1158b7))));_0x77b618[_0x5e0cf3(0x129)]&&_0x1158b7['stepNames']&&!_0x1158b7[_0x5e0cf3(0xdc)][_0x5e0cf3(0xf3)](_0x77b618[_0x5e0cf3(0x129)])&&_0x386d00[_0x5e0cf3(0x10d)](createIssue(_0x5e0cf3(0x132),_0x128245+'.next',_0x5e0cf3(0xad),_0x5e0cf3(0x10e)+_0x77b618[_0x5e0cf3(0x129)]+'\x27',_0x1158b7));if(_0x77b618[_0x5e0cf3(0x129)]){const _0x30a5d9=_0xd52457['get'](_0x77b618['next']);_0x30a5d9?.[_0x5e0cf3(0x139)]===_0x5e0cf3(0x86)&&_0x386d00['push'](createIssue(_0x5e0cf3(0x8d),_0x128245+_0x5e0cf3(0xed),_0x5e0cf3(0xb2),_0x5e0cf3(0xeb)+_0x77b618[_0x5e0cf3(0xd0)]+_0x5e0cf3(0xfa)+_0x77b618[_0x5e0cf3(0x129)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x1158b7));}}return _0x386d00;}function validateAbTestStep(_0x3ffb2f,_0x447eb1,_0x5b50cd,_0x17891b){const _0x3ab05e=a146_0x5998,_0x1976f9=[];if(!_0x3ffb2f[_0x3ab05e(0x8e)]?.[_0x3ab05e(0x127)]||_0x3ffb2f[_0x3ab05e(0x8e)][_0x3ab05e(0x127)][_0x3ab05e(0xff)]===0x0)return _0x1976f9[_0x3ab05e(0x10d)](createIssue(_0x3ab05e(0x132),_0x447eb1+'.with.variants',_0x3ab05e(0x136),_0x3ab05e(0x90),_0x5b50cd,_0x447eb1)),_0x1976f9;const _0xed401d=_0x3ffb2f['with']['variants'][_0x3ab05e(0x13d)]((_0x4add6b,_0x45fa0f)=>_0x4add6b+(_0x45fa0f[_0x3ab05e(0x134)]||0x0),0x0);Math['abs'](_0xed401d-0x64)>0.01&&_0x1976f9[_0x3ab05e(0x10d)](createIssue('error',_0x447eb1+_0x3ab05e(0xb5),'INVALID_AB_TEST_PERCENTAGES',_0x3ab05e(0xe0)+_0xed401d+'%)',_0x5b50cd));for(let _0x4d6265=0x0;_0x4d6265<_0x3ffb2f['with'][_0x3ab05e(0x127)][_0x3ab05e(0xff)];_0x4d6265++){const _0x80427e=_0x3ffb2f['with']['variants'][_0x4d6265],_0x225e91=_0x447eb1+_0x3ab05e(0xfb)+_0x4d6265+']';_0x80427e[_0x3ab05e(0x129)]&&_0x5b50cd[_0x3ab05e(0xdc)]&&!_0x5b50cd[_0x3ab05e(0xdc)]['has'](_0x80427e[_0x3ab05e(0x129)])&&_0x1976f9[_0x3ab05e(0x10d)](createIssue(_0x3ab05e(0x132),_0x225e91+_0x3ab05e(0xed),_0x3ab05e(0xad),'A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x80427e[_0x3ab05e(0x129)]+'\x27',_0x5b50cd));if(_0x80427e['next']){const _0x32716f=_0x17891b[_0x3ab05e(0xc2)](_0x80427e['next']);_0x32716f?.[_0x3ab05e(0x139)]===_0x3ab05e(0x86)&&_0x1976f9[_0x3ab05e(0x10d)](createIssue(_0x3ab05e(0x8d),_0x225e91+'.next',_0x3ab05e(0xb2),'A/B\x20test\x20variant\x20\x27'+_0x80427e['name']+_0x3ab05e(0xfa)+_0x80427e[_0x3ab05e(0x129)]+_0x3ab05e(0xe1),_0x5b50cd));}}return _0x1976f9;}function validateJumpStep(_0x18aa2a,_0x5156fd,_0x37bdc4){const _0x2d45eb=a146_0x5998,_0x550fe5=[];if(!_0x18aa2a['with']?.['target'])return _0x550fe5['push'](createIssue(_0x2d45eb(0x132),_0x5156fd+_0x2d45eb(0xc8),_0x2d45eb(0xde),_0x2d45eb(0x110),_0x37bdc4,_0x5156fd)),_0x550fe5;return(!_0x18aa2a['with']['target']['journey']||!_0x18aa2a[_0x2d45eb(0x8e)]['target'][_0x2d45eb(0x103)])&&_0x550fe5[_0x2d45eb(0x10d)](createIssue(_0x2d45eb(0x132),_0x5156fd+'.with.target',_0x2d45eb(0xde),_0x2d45eb(0xfe),_0x37bdc4)),_0x550fe5;}function buildConvergenceMap(_0x58db84){const _0x20e94e=a146_0x5998,_0x5660f0=new Map();function _0x5d9908(_0x265e54,_0xe6b2c3){const _0x18ccc5=a146_0x5998,_0x170aad=_0x5660f0[_0x18ccc5(0xc2)](_0x265e54)||[];_0x170aad[_0x18ccc5(0x10d)](_0xe6b2c3),_0x5660f0[_0x18ccc5(0x8a)](_0x265e54,_0x170aad);}for(const _0x303bdf of _0x58db84){_0x303bdf[_0x20e94e(0x129)]&&_0x5d9908(_0x303bdf[_0x20e94e(0x129)],{'stepName':_0x303bdf[_0x20e94e(0xd0)],'description':_0x20e94e(0xf9)+_0x303bdf[_0x20e94e(0xd0)]+'\x27'});if(_0x303bdf['type']===_0x20e94e(0xa6)&&_0x303bdf['with']?.[_0x20e94e(0xc6)])for(const _0x41141f of _0x303bdf['with'][_0x20e94e(0xc6)]){_0x41141f[_0x20e94e(0x129)]&&_0x5d9908(_0x41141f[_0x20e94e(0x129)],{'stepName':_0x303bdf[_0x20e94e(0xd0)],'description':'branch\x20\x27'+_0x41141f[_0x20e94e(0xd0)]+_0x20e94e(0xf7)+_0x303bdf[_0x20e94e(0xd0)]+'\x27'});}if(_0x303bdf[_0x20e94e(0x139)]===_0x20e94e(0x8c)&&_0x303bdf[_0x20e94e(0x8e)]?.[_0x20e94e(0x127)])for(const _0x55ff95 of _0x303bdf['with'][_0x20e94e(0x127)]){_0x55ff95[_0x20e94e(0x129)]&&_0x5d9908(_0x55ff95['next'],{'stepName':_0x303bdf['name'],'description':_0x20e94e(0xc1)+_0x55ff95[_0x20e94e(0xd0)]+_0x20e94e(0xf7)+_0x303bdf['name']+'\x27'});}_0x303bdf[_0x20e94e(0x139)]===_0x20e94e(0xbc)&&_0x303bdf[_0x20e94e(0x8e)]?.[_0x20e94e(0x135)]&&(_0x303bdf[_0x20e94e(0x8e)][_0x20e94e(0x135)]['next']&&_0x5d9908(_0x303bdf[_0x20e94e(0x8e)]['condition']['next'],{'stepName':_0x303bdf[_0x20e94e(0xd0)],'description':_0x20e94e(0xc4)+_0x303bdf[_0x20e94e(0xd0)]+'\x27'}),_0x303bdf[_0x20e94e(0x8e)][_0x20e94e(0x135)]['timeout']?.[_0x20e94e(0x129)]&&_0x5d9908(_0x303bdf['with'][_0x20e94e(0x135)][_0x20e94e(0x13a)][_0x20e94e(0x129)],{'stepName':_0x303bdf[_0x20e94e(0xd0)],'description':_0x20e94e(0x133)+_0x303bdf[_0x20e94e(0xd0)]+'\x27'}));}return _0x5660f0;}function validateFlowControl(_0x5726da,_0x53f203,_0x4b6c0b){const _0xf5b1b6=a146_0x5998,_0x57a96e=[],_0x14be40=_0xf5b1b6(0x125)+_0x53f203+']',_0x39d3e7=_0x5726da[_0xf5b1b6(0xb0)]||[];if(_0x39d3e7[_0xf5b1b6(0xff)]===0x0)return _0x57a96e;const _0x539ff5=new Map();for(const _0x4e248b of _0x39d3e7){_0x4e248b['name']&&_0x539ff5[_0xf5b1b6(0x8a)](_0x4e248b['name'],_0x4e248b);}const _0x4498a1=buildConvergenceMap(_0x39d3e7),_0x26657b=_0x39d3e7[_0xf5b1b6(0xd3)](_0x29bcdc=>_0x29bcdc['type']===_0xf5b1b6(0xd4));!_0x26657b&&_0x57a96e[_0xf5b1b6(0x10d)](createIssue(_0xf5b1b6(0x132),_0x14be40+_0xf5b1b6(0x123),_0xf5b1b6(0xa4),_0xf5b1b6(0xab)+_0x5726da[_0xf5b1b6(0xd0)]+_0xf5b1b6(0xdf),_0x4b6c0b));for(const [_0x1e374c,_0x1979b9]of _0x4498a1){const _0x2c0902=_0x539ff5[_0xf5b1b6(0xc2)](_0x1e374c);if(!_0x2c0902)continue;if(_0x1979b9[_0xf5b1b6(0xff)]>0x1&&_0x2c0902[_0xf5b1b6(0x139)]!==_0xf5b1b6(0x86)){const _0x10b629=_0x1979b9['map'](_0x49d976=>_0x49d976[_0xf5b1b6(0xd2)])[_0xf5b1b6(0xbb)](',\x20');_0x57a96e[_0xf5b1b6(0x10d)](createIssue('error',_0x14be40+_0xf5b1b6(0x123),_0xf5b1b6(0x104),'Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'+_0x1e374c+_0xf5b1b6(0x101)+_0x10b629+_0xf5b1b6(0x10c),_0x4b6c0b));}_0x1979b9[_0xf5b1b6(0xff)]===0x1&&_0x2c0902[_0xf5b1b6(0x139)]===_0xf5b1b6(0x86)&&_0x57a96e[_0xf5b1b6(0x10d)](createIssue('warning',_0x14be40+_0xf5b1b6(0x123),'SINGLE_INPUT_MERGE',_0xf5b1b6(0xa3)+_0x1e374c+_0xf5b1b6(0xd1)+_0x1979b9[0x0][_0xf5b1b6(0xd2)]+_0xf5b1b6(0xcd),_0x4b6c0b));}for(const _0xc58f71 of _0x39d3e7){if(_0xc58f71[_0xf5b1b6(0x139)]===_0xf5b1b6(0x86)&&_0xc58f71[_0xf5b1b6(0x129)]){const _0x28b074=_0x539ff5[_0xf5b1b6(0xc2)](_0xc58f71[_0xf5b1b6(0x129)]);_0x28b074?.['type']===_0xf5b1b6(0x86)&&_0x57a96e['push'](createIssue('error',_0x14be40+_0xf5b1b6(0x123),_0xf5b1b6(0xb3),_0xf5b1b6(0xa3)+_0xc58f71['name']+_0xf5b1b6(0x96)+_0xc58f71[_0xf5b1b6(0x129)]+_0xf5b1b6(0x9d),_0x4b6c0b));}}return _0x57a96e;}function validateCriteria(_0x12d666,_0x575aa1,_0x2f3665){const _0x4f40d1=a146_0x5998,_0x69ae59=[];return _0x12d666[_0x4f40d1(0x120)]&&(_0x2f3665[_0x4f40d1(0x12c)]?.[_0x4f40d1(0xa1)](_0x12d666[_0x4f40d1(0x120)]),!_0x12d666[_0x4f40d1(0x120)][_0x4f40d1(0xe7)]('ref:')&&(_0x2f3665[_0x4f40d1(0xce)]&&!_0x2f3665[_0x4f40d1(0xce)]['has'](_0x12d666[_0x4f40d1(0x120)])&&_0x69ae59[_0x4f40d1(0x10d)](createIssue(_0x4f40d1(0x132),_0x575aa1+_0x4f40d1(0x11b),'MISSING_SEGMENT_REFERENCE',_0x4f40d1(0x130)+_0x12d666[_0x4f40d1(0x120)]+'\x27',_0x2f3665)))),_0x69ae59;}function validateEmbeddedSegment(_0xe0e72f,_0x253934,_0x372b7b){const _0x313de5=a146_0x5998,_0x63b59f=[];return _0xe0e72f[_0x313de5(0xa2)]&&_0x63b59f['push'](...validateRuleDef(_0xe0e72f['rule'],_0x253934+_0x313de5(0x111),_0x372b7b)),_0x63b59f;}function a146_0x5998(_0x327777,_0x492889){_0x327777=_0x327777-0x86;const _0x31a6ff=a146_0x31a6();let _0x599834=_0x31a6ff[_0x327777];return _0x599834;}function validateStage(_0x3ba1a1,_0x10f0f1,_0x542b9e,_0x14b71b){const _0x5a4b5a=a146_0x5998,_0x581105=[],_0x2a8371=_0x5a4b5a(0x125)+_0x10f0f1+']',_0x4c497e=new Map(),_0x1e36d0=new Map();if(_0x3ba1a1[_0x5a4b5a(0xb0)]){for(let _0x58a946=0x0;_0x58a946<_0x3ba1a1[_0x5a4b5a(0xb0)]['length'];_0x58a946++){const _0x1068bf=_0x3ba1a1[_0x5a4b5a(0xb0)][_0x58a946];_0x1068bf[_0x5a4b5a(0xd0)]&&_0x4c497e[_0x5a4b5a(0x8a)](_0x1068bf[_0x5a4b5a(0xd0)],_0x1068bf);}for(let _0x3c507e=0x0;_0x3c507e<_0x3ba1a1['steps'][_0x5a4b5a(0xff)];_0x3c507e++){const _0x4b64aa=_0x3ba1a1[_0x5a4b5a(0xb0)][_0x3c507e],_0x511269=_0x2a8371+_0x5a4b5a(0xb1)+_0x3c507e+']';if(_0x4b64aa[_0x5a4b5a(0xd0)]){if(_0x1e36d0[_0x5a4b5a(0xf3)](_0x4b64aa['name'])){const _0xc37ca5=_0x1e36d0[_0x5a4b5a(0xc2)](_0x4b64aa[_0x5a4b5a(0xd0)]);_0x581105['push'](createIssue(_0x5a4b5a(0x132),_0x511269+_0x5a4b5a(0xba),_0x5a4b5a(0x9f),_0x5a4b5a(0xe4)+_0x4b64aa[_0x5a4b5a(0xd0)]+_0x5a4b5a(0xfd)+_0xc37ca5+'])',_0x14b71b));}else _0x1e36d0[_0x5a4b5a(0x8a)](_0x4b64aa['name'],_0x3c507e);}_0x581105['push'](...validateStep(_0x4b64aa,_0x511269,_0x14b71b,_0x4c497e));}}_0x3ba1a1['entry_criteria']&&_0x581105[_0x5a4b5a(0x10d)](...validateCriteria(_0x3ba1a1[_0x5a4b5a(0xd7)],_0x2a8371+'.entry_criteria',_0x14b71b));if(_0x3ba1a1[_0x5a4b5a(0x11c)])for(let _0x50368f=0x0;_0x50368f<_0x3ba1a1[_0x5a4b5a(0x11c)][_0x5a4b5a(0xff)];_0x50368f++){_0x581105[_0x5a4b5a(0x10d)](...validateCriteria(_0x3ba1a1[_0x5a4b5a(0x11c)][_0x50368f],_0x2a8371+_0x5a4b5a(0xb6)+_0x50368f+']',_0x14b71b));}return _0x3ba1a1['milestone']&&_0x581105['push'](...validateCriteria(_0x3ba1a1[_0x5a4b5a(0x13c)],_0x2a8371+_0x5a4b5a(0x119),_0x14b71b)),_0x581105['push'](...validateStageStructure(_0x3ba1a1,_0x10f0f1,_0x542b9e,_0x14b71b)),_0x581105[_0x5a4b5a(0x10d)](...validateFlowControl(_0x3ba1a1,_0x10f0f1,_0x14b71b)),_0x581105;}function validateStagesForVersion(_0x24021f,_0x26d97b,_0x200dcb,_0x25d4b0,_0x1fb436,_0x1a8aff,_0x2b02ad){const _0x2fcf35=a146_0x5998;if(_0x24021f[_0x2fcf35(0xff)]===0x0){_0x1fb436['push']({'level':_0x2fcf35(0x132),'path':_0x25d4b0+_0x2fcf35(0xf4),'code':_0x2fcf35(0x98),'message':_0x2fcf35(0x108),'location':getLocationFromPath(_0x200dcb[_0x2fcf35(0xda)],_0x200dcb[_0x2fcf35(0x88)],[_0x2fcf35(0xf4)])});return;}const _0x2d263a=new Set();for(const _0x8a0642 of _0x24021f){if(_0x8a0642[_0x2fcf35(0xb0)])for(const _0x5d94dd of _0x8a0642[_0x2fcf35(0xb0)]){_0x5d94dd['name']&&_0x2d263a['add'](_0x5d94dd['name']);}}const _0x48438e={..._0x200dcb,'stepNames':_0x2d263a},_0x9eb9e1=validateVersionStructure(_0x24021f,_0x48438e);for(const _0xe4c5ad of _0x9eb9e1){const _0x339063=_0x25d4b0?{..._0xe4c5ad,'path':''+_0x25d4b0+_0xe4c5ad[_0x2fcf35(0xea)]}:_0xe4c5ad;if(_0x339063[_0x2fcf35(0x11d)]==='error')_0x1fb436['push'](_0x339063);else _0x1a8aff[_0x2fcf35(0x10d)](_0x339063);}for(let _0x32df63=0x0;_0x32df63<_0x24021f['length'];_0x32df63++){const _0x113ab0=validateStage(_0x24021f[_0x32df63],_0x32df63,_0x24021f['length'],_0x48438e);for(const _0x906feb of _0x113ab0){const _0x1f0efb=_0x25d4b0?{..._0x906feb,'path':''+_0x25d4b0+_0x906feb[_0x2fcf35(0xea)]}:_0x906feb;if(_0x1f0efb['level']===_0x2fcf35(0x132))_0x1fb436[_0x2fcf35(0x10d)](_0x1f0efb);else _0x1a8aff[_0x2fcf35(0x10d)](_0x1f0efb);}}if(_0x26d97b[_0x2fcf35(0xbf)]){const _0x30c454=_0x2b02ad?.[_0x2fcf35(0xf6)]?_0x2fcf35(0xbf):_0x25d4b0+_0x2fcf35(0xbf),_0x1f29e7=validateCriteria(_0x26d97b[_0x2fcf35(0xbf)],_0x30c454,_0x48438e);for(const _0x555b0f of _0x1f29e7){if(_0x555b0f[_0x2fcf35(0x11d)]==='error')_0x1fb436[_0x2fcf35(0x10d)](_0x555b0f);else _0x1a8aff[_0x2fcf35(0x10d)](_0x555b0f);}}}function extractVersionIndex(_0x246a31){const _0x565d02=_0x246a31['match'](/^journeys\[(\d+)\]\./);return _0x565d02?_0x565d02[0x1]:undefined;}function deduplicateAcrossVersions(_0x3adbb2){const _0x4236d1=a146_0x5998,_0x28c5a3=new Map();for(let _0x11de51=0x0;_0x11de51<_0x3adbb2[_0x4236d1(0xff)];_0x11de51++){const _0x3d82c6=_0x3adbb2[_0x11de51][_0x4236d1(0x9e)]+':'+_0x3adbb2[_0x11de51][_0x4236d1(0xa8)],_0x37ee37=extractVersionIndex(_0x3adbb2[_0x11de51]['path']),_0x8eaa43=_0x28c5a3[_0x4236d1(0xc2)](_0x3d82c6);if(_0x8eaa43){_0x8eaa43[_0x4236d1(0x12a)][_0x4236d1(0x10d)](_0x11de51);if(_0x37ee37)_0x8eaa43[_0x4236d1(0x12e)][_0x4236d1(0xa1)](_0x37ee37);}else _0x28c5a3[_0x4236d1(0x8a)](_0x3d82c6,{'indices':[_0x11de51],'versions':new Set(_0x37ee37?[_0x37ee37]:[])});}const _0x105212=new Set();for(const {indices:_0x567e51,versions:_0x9c3cf8}of _0x28c5a3['values']()){if(_0x9c3cf8[_0x4236d1(0x10f)]<=0x1)continue;const _0x27409b=_0x3adbb2[_0x567e51[0x0]];_0x27409b[_0x4236d1(0xea)]=_0x27409b['path']['replace'](/^journeys\[\d+\]\./,''),_0x27409b[_0x4236d1(0xa8)]=_0x27409b[_0x4236d1(0xa8)]+_0x4236d1(0xdd)+_0x9c3cf8[_0x4236d1(0x10f)]+_0x4236d1(0x115);for(let _0x128276=0x1;_0x128276<_0x567e51[_0x4236d1(0xff)];_0x128276++){_0x105212[_0x4236d1(0xa1)](_0x567e51[_0x128276]);}}const _0x516ae8=[..._0x105212][_0x4236d1(0x100)]((_0x1673ed,_0x3558bf)=>_0x3558bf-_0x1673ed);for(const _0x429167 of _0x516ae8){_0x3adbb2[_0x4236d1(0x122)](_0x429167,0x1);}}export function validateJourneyDef(_0x1760ee,_0x110241={},_0x5eedea={}){const _0x133ee5=a146_0x5998;if(_0x5eedea['skipSchema'])return runJourneySemanticChecks(_0x1760ee,_0x110241);const _0x466cbd=JourneyDefSchema[_0x133ee5(0x105)](_0x1760ee);if(_0x466cbd[_0x133ee5(0x131)])return runJourneySemanticChecks(_0x466cbd[_0x133ee5(0x106)],_0x110241);return zodErrorsToJourneyValidationResult(_0x466cbd[_0x133ee5(0x132)],_0x110241);}function zodErrorsToJourneyValidationResult(_0x52575b,_0x18228b){const _0x95b4b9=a146_0x5998,_0x2267c7=flattenZodIssues(_0x52575b['issues']),_0x57462c=_0x2267c7[_0x95b4b9(0x91)](_0x498d1d=>{const _0x155718=_0x95b4b9,_0x491796=formatZodPath(_0x498d1d[_0x155718(0xea)]),_0x551a0b=mapJourneyZodIssueToCode(_0x498d1d,_0x491796),_0xfd99f8=getLocationFromPath(_0x18228b['document'],_0x18228b['source'],_0x498d1d['path'][_0x155718(0x91)](_0x404f6d=>typeof _0x404f6d==='symbol'?String(_0x404f6d):_0x404f6d));return{'level':_0x155718(0x132),'path':_0x491796,'code':_0x551a0b,'message':_0x498d1d['message'],..._0xfd99f8&&{'location':_0xfd99f8}};});return{'valid':![],'errors':_0x57462c,'warnings':[]};}function mapJourneyZodIssueToCode(_0xeb660f,_0x1ec0be){const _0x2e3e08=a146_0x5998;if(_0x1ec0be===_0x2e3e08(0xd0))return _0x2e3e08(0x87);if(_0x1ec0be[_0x2e3e08(0xdb)](_0x2e3e08(0x11e))&&_0x1ec0be[_0x2e3e08(0x10a)](_0x2e3e08(0xb0)))return _0x2e3e08(0x9a);if(_0x1ec0be==='stages'||_0x1ec0be[_0x2e3e08(0xdb)](_0x2e3e08(0xe9)))return _0x2e3e08(0x98);if(_0x1ec0be===''&&_0xeb660f['message'][_0x2e3e08(0x10a)](_0x2e3e08(0x89)))return _0x2e3e08(0x98);if(_0x1ec0be[_0x2e3e08(0x10a)](_0x2e3e08(0x93)))return _0x2e3e08(0xc5);return _0x2e3e08(0x9a);}function runJourneySemanticChecks(_0x4819aa,_0x47a23e){const _0x320e6f=a146_0x5998,_0x5f1701=[],_0x288b82=[];(!_0x4819aa[_0x320e6f(0xd0)]||_0x4819aa[_0x320e6f(0xd0)][_0x320e6f(0x126)]()==='')&&_0x5f1701['push']({'level':'error','path':_0x320e6f(0xd0),'code':'MISSING_NAME','message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x47a23e['document'],_0x47a23e[_0x320e6f(0x88)],[_0x320e6f(0xd0)])});const _0xcb0aec=new Set();if(_0x4819aa['segments'])for(const _0x4e54ff of Object[_0x320e6f(0xcc)](_0x4819aa[_0x320e6f(0x138)])){_0xcb0aec['add'](_0x4e54ff);}const _0x23c6d9=new Set();if(_0x4819aa['activations'])for(const _0x27132e of Object[_0x320e6f(0xcc)](_0x4819aa[_0x320e6f(0xc7)])){_0x23c6d9['add'](_0x27132e);}const _0x5ba41e=new Set(),_0x3c7237={..._0x47a23e,'embeddedSegments':_0xcb0aec,'referencedSegments':_0x5ba41e,'activationKeys':_0x23c6d9['size']>0x0?_0x23c6d9:undefined};if(_0x4819aa['segments'])for(const [_0x115a0e,_0x2cb4dd]of Object['entries'](_0x4819aa['segments'])){const _0x5af3d7=validateEmbeddedSegment(_0x2cb4dd,_0x320e6f(0xc3)+_0x115a0e,_0x3c7237);for(const _0xe92395 of _0x5af3d7){if(_0xe92395[_0x320e6f(0x11d)]===_0x320e6f(0x132))_0x5f1701['push'](_0xe92395);else _0x288b82[_0x320e6f(0x10d)](_0xe92395);}}const _0x3dc93d=!!_0x4819aa[_0x320e6f(0xbf)],_0x27ee2d=_0x4819aa[_0x320e6f(0xf8)]?.[_0x320e6f(0x118)](_0x143c74=>!!_0x143c74[_0x320e6f(0xbf)])??![];!_0x3dc93d&&!_0x27ee2d&&_0x288b82[_0x320e6f(0x10d)]({'level':_0x320e6f(0x8d),'path':_0x320e6f(0xbf),'code':_0x320e6f(0x112),'message':_0x320e6f(0xb7),'location':getLocationFromPath(_0x47a23e[_0x320e6f(0xda)],_0x47a23e[_0x320e6f(0x88)],[_0x320e6f(0xbf)])});const _0x367383=_0x4819aa[_0x320e6f(0xf8)]??_0x4819aa[_0x320e6f(0x12e)];if(_0x367383&&_0x367383[_0x320e6f(0xec)](_0x26b2a4=>_0x26b2a4['latest']===!![])[_0x320e6f(0xff)]>0x1){const _0x89a34e=_0x4819aa[_0x320e6f(0xf8)]?_0x320e6f(0xf8):_0x320e6f(0x12e);_0x5f1701[_0x320e6f(0x10d)]({'level':_0x320e6f(0x132),'path':_0x89a34e,'code':_0x320e6f(0x12f),'message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x89a34e==='journeys'?_0x320e6f(0x97):_0x320e6f(0x137))+_0x320e6f(0x114),'location':getLocationFromPath(_0x47a23e[_0x320e6f(0xda)],_0x47a23e[_0x320e6f(0x88)],[_0x89a34e])});}if(_0x4819aa['journeys']&&_0x4819aa['journeys'][_0x320e6f(0xff)]>0x0)for(let _0x546df0=0x0;_0x546df0<_0x4819aa[_0x320e6f(0xf8)][_0x320e6f(0xff)];_0x546df0++){const _0x325443=_0x4819aa['journeys'][_0x546df0];if(_0x4819aa['journeys'][_0x320e6f(0xff)]>0x1&&_0x325443[_0x320e6f(0xef)]===_0x320e6f(0xc0))continue;const _0x57e22d=_0x325443['stages']||[],_0x516631='journeys['+_0x546df0+'].',_0x3d9e62=!!_0x325443[_0x320e6f(0xbf)],_0x3024c2=_0x3d9e62?{..._0x4819aa,'goal':_0x325443[_0x320e6f(0xbf)]}:_0x4819aa;validateStagesForVersion(_0x57e22d,_0x3024c2,_0x3c7237,_0x516631,_0x5f1701,_0x288b82,{'goalIsInherited':!_0x3d9e62});}else{if(_0x4819aa[_0x320e6f(0x12e)]&&_0x4819aa[_0x320e6f(0x12e)]['length']>0x0)for(let _0x565a0b=0x0;_0x565a0b<_0x4819aa[_0x320e6f(0x12e)]['length'];_0x565a0b++){const _0x2e4907=_0x4819aa[_0x320e6f(0x12e)][_0x565a0b];if(_0x4819aa[_0x320e6f(0x12e)][_0x320e6f(0xff)]>0x1&&_0x2e4907[_0x320e6f(0xef)]===_0x320e6f(0xc0))continue;const _0x45f499=_0x2e4907['stages']||[],_0x2cb3a9=_0x320e6f(0xf1)+_0x565a0b+'].';validateStagesForVersion(_0x45f499,_0x4819aa,_0x3c7237,_0x2cb3a9,_0x5f1701,_0x288b82);}else{const _0x18b186=_0x4819aa[_0x320e6f(0xf4)]||[];validateStagesForVersion(_0x18b186,_0x4819aa,_0x3c7237,'',_0x5f1701,_0x288b82);}}_0x4819aa[_0x320e6f(0xf8)]&&_0x4819aa[_0x320e6f(0xf8)]['length']>0x1&&(deduplicateAcrossVersions(_0x5f1701),deduplicateAcrossVersions(_0x288b82));for(const _0x344444 of _0xcb0aec){!_0x5ba41e[_0x320e6f(0xf3)](_0x344444)&&!_0x344444[_0x320e6f(0xe7)](_0x320e6f(0xa7))&&_0x288b82['push']({'level':_0x320e6f(0x8d),'path':_0x320e6f(0xc3)+_0x344444,'code':_0x320e6f(0x12b),'message':_0x320e6f(0x92)+_0x344444+_0x320e6f(0x102),'location':getLocationFromPath(_0x47a23e[_0x320e6f(0xda)],_0x47a23e[_0x320e6f(0x88)],['segments',_0x344444])});}return{'valid':_0x5f1701[_0x320e6f(0xff)]===0x0,'errors':_0x5f1701,'warnings':_0x288b82};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5f4ae1,_0x2df0f6){const _0x2efec4=a147_0x5e72,_0x5a5245=_0x5f4ae1();while(!![]){try{const _0x1b862b=-parseInt(_0x2efec4(0x128))/0x1*(-parseInt(_0x2efec4(0xc6))/0x2)+-parseInt(_0x2efec4(0x14a))/0x3*(-parseInt(_0x2efec4(0x116))/0x4)+parseInt(_0x2efec4(0xbb))/0x5*(-parseInt(_0x2efec4(0x137))/0x6)+parseInt(_0x2efec4(0xec))/0x7+parseInt(_0x2efec4(0x119))/0x8+-parseInt(_0x2efec4(0x159))/0x9*(parseInt(_0x2efec4(0x131))/0xa)+-parseInt(_0x2efec4(0x12e))/0xb;if(_0x1b862b===_0x2df0f6)break;else _0x5a5245['push'](_0x5a5245['shift']());}catch(_0x109c7b){_0x5a5245['push'](_0x5a5245['shift']());}}}(a147_0x5d7f,0x26f86));import*as a147_0x156059 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(_0x4f4ff1){const _0x1c4961=a147_0x5e72,_0x1d0436=_0x4f4ff1[_0x1c4961(0x168)]();if(_0x1d0436==='days'||_0x1d0436===_0x1c4961(0x135))return _0x1c4961(0x135);if(_0x1d0436==='weeks'||_0x1d0436===_0x1c4961(0x13d))return _0x1c4961(0x13d);return _0x4f4ff1;}export function journeyResponseToDefSync(_0x433b60){const _0x1e142e=a147_0x5e72,_0x28d776=_0x433b60[_0x1e142e(0x12b)],_0x33a470=_0x28d776[_0x1e142e(0xe6)]||_0x28d776['name'],_0x8f807e={'stages':_0x28d776[_0x1e142e(0x151)]['map'](convertApiStageToYaml),'id':_0x433b60['id']};_0x28d776[_0x1e142e(0x13e)]&&(_0x8f807e['goal']=convertApiCriteriaToYaml(_0x28d776['goal']));_0x28d776['name']&&_0x28d776[_0x1e142e(0x13c)]!==_0x33a470&&(_0x8f807e['version']=_0x28d776[_0x1e142e(0x13c)]);_0x28d776[_0x1e142e(0x14b)]!==undefined&&(_0x8f807e[_0x1e142e(0x166)]=_0x28d776[_0x1e142e(0x14b)]);_0x28d776['state']&&(_0x8f807e[_0x1e142e(0xea)]=_0x28d776[_0x1e142e(0xea)]==='launched'?_0x1e142e(0x102):'draft');const _0xe566={'type':_0x1e142e(0x144),'name':_0x33a470,'journeys':[_0x8f807e]};_0x28d776[_0x1e142e(0x106)]&&(_0xe566[_0x1e142e(0x106)]=_0x28d776[_0x1e142e(0x106)]);_0x28d776[_0x1e142e(0x13e)]&&(_0xe566[_0x1e142e(0x13e)]=convertApiCriteriaToYaml(_0x28d776[_0x1e142e(0x13e)]));if(_0x28d776[_0x1e142e(0x179)])_0xe566[_0x1e142e(0xe0)]=_0x28d776[_0x1e142e(0x179)];else _0x28d776[_0x1e142e(0xe4)]!==undefined&&(_0xe566['reentry']=_0x28d776[_0x1e142e(0xe4)]?_0x1e142e(0xfc):_0x1e142e(0xff));return _0x28d776[_0x1e142e(0x15b)]&&(_0xe566[_0x1e142e(0xd7)]=_0x28d776[_0x1e142e(0x15b)]),_0x28d776[_0x1e142e(0xe6)]&&(_0xe566[_0x1e142e(0x13b)]=_0x28d776[_0x1e142e(0xe6)]),_0x433b60['relationships']?.['parentFolder']?.[_0x1e142e(0xda)]?.['id']&&(_0xe566[_0x1e142e(0x127)]=_0x433b60[_0x1e142e(0x14e)][_0x1e142e(0x145)]['data']['id']),_0xe566;}export async function journeyResponseToDef(_0x27fe18,_0x194bc3){const _0x12a02=a147_0x5e72,_0x39691c=journeyResponseToDefSync(_0x27fe18);if(!_0x194bc3)return _0x39691c;const _0x37e6c8=new Set();collectSegmentIdsFromJourney(_0x39691c,_0x37e6c8);const _0x4abf8e=new Set();collectActivationIdsFromJourney(_0x39691c,_0x4abf8e);const _0x193eb6={},_0x285082=new Map();for(const _0x34c99b of Array[_0x12a02(0xf3)](_0x37e6c8)[_0x12a02(0xf9)]()){if(_0x194bc3['resolveSegment']){const _0x1b6989=await _0x194bc3[_0x12a02(0x163)](_0x34c99b);if(_0x1b6989['isJourneyLocal']){_0x285082[_0x12a02(0x142)](_0x34c99b,_0x1b6989[_0x12a02(0x13c)]);if(_0x1b6989[_0x12a02(0xf1)]){const _0x28ed9b={..._0x1b6989[_0x12a02(0xf1)],'rule':deepSortObject(_0x1b6989[_0x12a02(0xf1)][_0x12a02(0x14d)])};_0x193eb6[_0x1b6989[_0x12a02(0x13c)]]=_0x28ed9b;}}else _0x285082[_0x12a02(0x142)](_0x34c99b,makeSegmentRef(_0x1b6989[_0x12a02(0x13c)]));}else{if(_0x194bc3[_0x12a02(0xcd)]){const _0x14b5a0=await _0x194bc3[_0x12a02(0xcd)](_0x34c99b);_0x285082[_0x12a02(0x142)](_0x34c99b,_0x14b5a0);}}}const _0x3fcfe4={},_0x2a7ebc=new Map();for(const _0x598f14 of Array[_0x12a02(0xf3)](_0x4abf8e)[_0x12a02(0xf9)]()){if(_0x194bc3[_0x12a02(0x146)]){const _0x3c2b86=await _0x194bc3[_0x12a02(0x146)](_0x598f14);_0x3c2b86[_0x12a02(0x109)]?(_0x2a7ebc[_0x12a02(0x142)](_0x598f14,_0x3c2b86[_0x12a02(0x13c)]),_0x3c2b86[_0x12a02(0xf1)]&&(_0x3fcfe4[_0x3c2b86['name']]=_0x3c2b86[_0x12a02(0xf1)])):_0x2a7ebc[_0x12a02(0x142)](_0x598f14,makeSegmentRef(_0x3c2b86['name']));}else{if(_0x194bc3['resolveActivationName']){const _0x5d55a0=await _0x194bc3['resolveActivationName'](_0x598f14);_0x2a7ebc['set'](_0x598f14,_0x5d55a0);}}}_0x285082['size']>0x0&&replaceSegmentIdsInJourney(_0x39691c,_0x285082);_0x2a7ebc[_0x12a02(0x15f)]>0x0&&replaceActivationIdsInJourney(_0x39691c,_0x2a7ebc);if(_0x194bc3[_0x12a02(0x11b)]){const _0x4c1a55=[];collectJumpTargetsFromJourney(_0x39691c,_0x4c1a55);if(_0x4c1a55[_0x12a02(0x150)]>0x0){const _0x56d223=new Map();for(const _0x329273 of _0x4c1a55){try{const _0x3c8fd7=await _0x194bc3['resolveJumpTarget'](_0x329273[_0x12a02(0xef)],_0x329273[_0x12a02(0x16d)]);_0x56d223[_0x12a02(0x142)](_0x329273[_0x12a02(0xef)]+':'+_0x329273[_0x12a02(0x16d)],_0x3c8fd7);}catch{}}_0x56d223[_0x12a02(0x15f)]>0x0&&replaceJumpTargetsInJourney(_0x39691c,_0x56d223);}}return Object[_0x12a02(0xe8)](_0x193eb6)[_0x12a02(0x150)]>0x0&&(_0x39691c['segments']=_0x193eb6),Object['keys'](_0x3fcfe4)[_0x12a02(0x150)]>0x0&&(_0x39691c[_0x12a02(0x172)]=_0x3fcfe4),_0x39691c;}function collectSegmentIdsFromJourney(_0x52c1d2,_0x425c3e){const _0x2c3604=a147_0x5e72;_0x52c1d2[_0x2c3604(0x13e)]?.['segment']&&_0x425c3e[_0x2c3604(0x167)](_0x52c1d2[_0x2c3604(0x13e)]['segment']);const _0x331b2b=_0x5bd12f=>{const _0x4ebfa5=_0x2c3604;for(const _0x585ea4 of _0x5bd12f){_0x585ea4[_0x4ebfa5(0xc1)]?.['segment']&&_0x425c3e[_0x4ebfa5(0x167)](_0x585ea4[_0x4ebfa5(0xc1)][_0x4ebfa5(0x104)]);if(_0x585ea4[_0x4ebfa5(0x140)])for(const _0x301c75 of _0x585ea4[_0x4ebfa5(0x140)]){_0x301c75[_0x4ebfa5(0x104)]&&_0x425c3e[_0x4ebfa5(0x167)](_0x301c75[_0x4ebfa5(0x104)]);}_0x585ea4[_0x4ebfa5(0xe2)]?.[_0x4ebfa5(0x104)]&&_0x425c3e['add'](_0x585ea4[_0x4ebfa5(0xe2)][_0x4ebfa5(0x104)]);if(_0x585ea4[_0x4ebfa5(0x174)])for(const _0x2b97ee of _0x585ea4[_0x4ebfa5(0x174)]){if(_0x2b97ee[_0x4ebfa5(0xc2)]===_0x4ebfa5(0xdc)){const _0x2f0037=_0x2b97ee;for(const _0x2abd19 of _0x2f0037[_0x4ebfa5(0x141)][_0x4ebfa5(0xde)]){_0x2abd19[_0x4ebfa5(0x104)]&&_0x425c3e['add'](_0x2abd19['segment']);}}else{if(_0x2b97ee[_0x4ebfa5(0xc2)]===_0x4ebfa5(0x133)){const _0x4f6439=_0x2b97ee;_0x4f6439['with'][_0x4ebfa5(0xce)]?.[_0x4ebfa5(0x104)]&&_0x425c3e[_0x4ebfa5(0x167)](_0x4f6439['with'][_0x4ebfa5(0xce)][_0x4ebfa5(0x104)]);}}}}};if(_0x52c1d2[_0x2c3604(0x130)])for(const _0x4a7e8f of _0x52c1d2[_0x2c3604(0x130)]){_0x4a7e8f[_0x2c3604(0x13e)]?.[_0x2c3604(0x104)]&&_0x425c3e[_0x2c3604(0x167)](_0x4a7e8f[_0x2c3604(0x13e)][_0x2c3604(0x104)]),_0x331b2b(_0x4a7e8f['stages']);}_0x52c1d2[_0x2c3604(0x12f)]&&_0x331b2b(_0x52c1d2[_0x2c3604(0x12f)]);if(_0x52c1d2[_0x2c3604(0x10e)])for(const _0x481e6c of _0x52c1d2['versions']){_0x331b2b(_0x481e6c[_0x2c3604(0x12f)]);}}function replaceSegmentIdsInJourney(_0x5e8e7a,_0x2d0172){const _0x24533e=a147_0x5e72,_0x2b4855=_0x528d51=>_0x2d0172[_0x24533e(0xcf)](_0x528d51)||_0x528d51;_0x5e8e7a[_0x24533e(0x13e)]?.['segment']&&(_0x5e8e7a[_0x24533e(0x13e)][_0x24533e(0x104)]=_0x2b4855(_0x5e8e7a[_0x24533e(0x13e)][_0x24533e(0x104)]));const _0x15c063=_0x133502=>{const _0xb228c5=_0x24533e;for(const _0x2fb7db of _0x133502){_0x2fb7db[_0xb228c5(0xc1)]?.[_0xb228c5(0x104)]&&(_0x2fb7db[_0xb228c5(0xc1)]['segment']=_0x2b4855(_0x2fb7db[_0xb228c5(0xc1)][_0xb228c5(0x104)]));if(_0x2fb7db['exit_criteria'])for(const _0x309167 of _0x2fb7db[_0xb228c5(0x140)]){_0x309167[_0xb228c5(0x104)]&&(_0x309167[_0xb228c5(0x104)]=_0x2b4855(_0x309167[_0xb228c5(0x104)]));}_0x2fb7db[_0xb228c5(0xe2)]?.[_0xb228c5(0x104)]&&(_0x2fb7db[_0xb228c5(0xe2)]['segment']=_0x2b4855(_0x2fb7db[_0xb228c5(0xe2)][_0xb228c5(0x104)]));if(_0x2fb7db['steps'])for(const _0x224980 of _0x2fb7db[_0xb228c5(0x174)]){if(_0x224980['type']===_0xb228c5(0xdc)){const _0x56c6ae=_0x224980;for(const _0x53239d of _0x56c6ae[_0xb228c5(0x141)]['branches']){_0x53239d[_0xb228c5(0x104)]&&(_0x53239d['segment']=_0x2b4855(_0x53239d[_0xb228c5(0x104)]));}}else{if(_0x224980[_0xb228c5(0xc2)]===_0xb228c5(0x133)){const _0x404a2a=_0x224980;_0x404a2a[_0xb228c5(0x141)][_0xb228c5(0xce)]?.[_0xb228c5(0x104)]&&(_0x404a2a[_0xb228c5(0x141)][_0xb228c5(0xce)]['segment']=_0x2b4855(_0x404a2a[_0xb228c5(0x141)][_0xb228c5(0xce)][_0xb228c5(0x104)]));}}}}};if(_0x5e8e7a[_0x24533e(0x130)])for(const _0x458433 of _0x5e8e7a[_0x24533e(0x130)]){_0x458433['goal']?.[_0x24533e(0x104)]&&(_0x458433['goal'][_0x24533e(0x104)]=_0x2b4855(_0x458433[_0x24533e(0x13e)][_0x24533e(0x104)])),_0x15c063(_0x458433[_0x24533e(0x12f)]);}_0x5e8e7a[_0x24533e(0x12f)]&&_0x15c063(_0x5e8e7a[_0x24533e(0x12f)]);if(_0x5e8e7a['versions'])for(const _0x3937cf of _0x5e8e7a[_0x24533e(0x10e)]){_0x15c063(_0x3937cf[_0x24533e(0x12f)]);}}function collectActivationIdsFromJourney(_0x18314a,_0x592f83){const _0x2808f0=a147_0x5e72,_0x2d1d0b=_0x1edf66=>{const _0xbd7a86=a147_0x5e72;for(const _0xcc6e42 of _0x1edf66){if(_0xcc6e42[_0xbd7a86(0x174)])for(const _0x310801 of _0xcc6e42[_0xbd7a86(0x174)]){if(_0x310801[_0xbd7a86(0xc2)]===_0xbd7a86(0x10c)){const _0x527b15=_0x310801;_0x527b15[_0xbd7a86(0x141)][_0xbd7a86(0x10c)]&&/^\d+$/['test'](_0x527b15[_0xbd7a86(0x141)][_0xbd7a86(0x10c)])&&_0x592f83[_0xbd7a86(0x167)](_0x527b15[_0xbd7a86(0x141)][_0xbd7a86(0x10c)]);}}}};if(_0x18314a[_0x2808f0(0x130)])for(const _0x23026d of _0x18314a[_0x2808f0(0x130)]){_0x2d1d0b(_0x23026d[_0x2808f0(0x12f)]);}_0x18314a[_0x2808f0(0x12f)]&&_0x2d1d0b(_0x18314a['stages']);if(_0x18314a[_0x2808f0(0x10e)])for(const _0x497629 of _0x18314a[_0x2808f0(0x10e)]){_0x2d1d0b(_0x497629['stages']);}}function replaceActivationIdsInJourney(_0x23b217,_0x45ceae){const _0x1acc1f=a147_0x5e72,_0x2f0948=_0x564b06=>_0x45ceae[_0x1acc1f(0xcf)](_0x564b06)||_0x564b06,_0xb7d80e=_0x5aaebf=>{const _0x2acf54=_0x1acc1f;for(const _0x434643 of _0x5aaebf){if(_0x434643[_0x2acf54(0x174)])for(const _0x37a9c5 of _0x434643[_0x2acf54(0x174)]){if(_0x37a9c5[_0x2acf54(0xc2)]===_0x2acf54(0x10c)){const _0x1cea4d=_0x37a9c5;_0x1cea4d[_0x2acf54(0x141)][_0x2acf54(0x10c)]&&(_0x1cea4d[_0x2acf54(0x141)][_0x2acf54(0x10c)]=_0x2f0948(_0x1cea4d['with'][_0x2acf54(0x10c)]));}}}};if(_0x23b217['journeys'])for(const _0x3b4781 of _0x23b217[_0x1acc1f(0x130)]){_0xb7d80e(_0x3b4781[_0x1acc1f(0x12f)]);}_0x23b217['stages']&&_0xb7d80e(_0x23b217['stages']);if(_0x23b217[_0x1acc1f(0x10e)])for(const _0x1d06b2 of _0x23b217[_0x1acc1f(0x10e)]){_0xb7d80e(_0x1d06b2['stages']);}}function collectJumpTargetsFromJourney(_0x462687,_0x40bb95){const _0x28f8f1=a147_0x5e72,_0x5be32c=new Set(),_0x4920aa=_0x484fb5=>{const _0x38a736=a147_0x5e72;for(const _0x37952a of _0x484fb5){if(_0x37952a['steps'])for(const _0xfa2025 of _0x37952a['steps']){if(_0xfa2025[_0x38a736(0xc2)]==='jump'){const _0x25b66c=_0xfa2025,_0x3d8b0c=_0x25b66c[_0x38a736(0x141)][_0x38a736(0xc3)];if(_0x3d8b0c[_0x38a736(0x144)]&&_0x3d8b0c['stage']&&/^\d+$/['test'](_0x3d8b0c[_0x38a736(0x144)])&&/^\d+$/[_0x38a736(0x124)](_0x3d8b0c[_0x38a736(0xdd)])){const _0x53a16c=_0x3d8b0c[_0x38a736(0x144)]+':'+_0x3d8b0c[_0x38a736(0xdd)];!_0x5be32c[_0x38a736(0x125)](_0x53a16c)&&(_0x5be32c[_0x38a736(0x167)](_0x53a16c),_0x40bb95[_0x38a736(0x11c)]({'journeyId':_0x3d8b0c[_0x38a736(0x144)],'stageId':_0x3d8b0c[_0x38a736(0xdd)]}));}}}}};if(_0x462687['journeys'])for(const _0x6430b1 of _0x462687[_0x28f8f1(0x130)]){_0x4920aa(_0x6430b1[_0x28f8f1(0x12f)]);}_0x462687[_0x28f8f1(0x12f)]&&_0x4920aa(_0x462687['stages']);if(_0x462687[_0x28f8f1(0x10e)])for(const _0x252131 of _0x462687[_0x28f8f1(0x10e)]){_0x4920aa(_0x252131[_0x28f8f1(0x12f)]);}}function replaceJumpTargetsInJourney(_0x1da40e,_0x14b58b){const _0x31f23c=a147_0x5e72,_0x4ab01b=_0x5149b0=>{const _0x5f20e9=a147_0x5e72;for(const _0x3425e8 of _0x5149b0){if(_0x3425e8[_0x5f20e9(0x174)])for(const _0x24aeba of _0x3425e8[_0x5f20e9(0x174)]){if(_0x24aeba[_0x5f20e9(0xc2)]===_0x5f20e9(0x143)){const _0x3bb6b0=_0x24aeba,_0x445fcd=_0x3bb6b0[_0x5f20e9(0x141)][_0x5f20e9(0xc3)],_0x32763a=_0x445fcd[_0x5f20e9(0x144)]+':'+_0x445fcd['stage'],_0x5b4462=_0x14b58b['get'](_0x32763a);_0x5b4462&&(_0x445fcd[_0x5f20e9(0x144)]=_0x5b4462[_0x5f20e9(0xdf)],_0x445fcd[_0x5f20e9(0xdd)]=_0x5b4462[_0x5f20e9(0x11e)]);}}}};if(_0x1da40e[_0x31f23c(0x130)])for(const _0x285167 of _0x1da40e[_0x31f23c(0x130)]){_0x4ab01b(_0x285167[_0x31f23c(0x12f)]);}_0x1da40e[_0x31f23c(0x12f)]&&_0x4ab01b(_0x1da40e['stages']);if(_0x1da40e[_0x31f23c(0x10e)])for(const _0x1148d6 of _0x1da40e[_0x31f23c(0x10e)]){_0x4ab01b(_0x1148d6[_0x31f23c(0x12f)]);}}function generateReadableStepName(_0x26187f,_0x25a0d2){const _0x1d17b5=a147_0x5e72;if(_0x26187f[_0x1d17b5(0x13c)]&&_0x26187f['name']!==_0x26187f[_0x1d17b5(0xc2)]){const _0x6b63ac=_0x26187f[_0x1d17b5(0x13c)][_0x1d17b5(0xc8)]();if(_0x6b63ac&&/[a-z0-9\p{L}]/iu[_0x1d17b5(0x124)](_0x6b63ac))return _0x6b63ac;}const _0x56e37f=_0x26187f[_0x1d17b5(0xc2)]['toLowerCase']()['replace'](/step$/i,'');return _0x56e37f+'_'+(_0x25a0d2+0x1);}function getStepNextRefs(_0x5199af){const _0x5782b0=a147_0x5e72,_0x533c6e=[];if(_0x5199af['next'])_0x533c6e[_0x5782b0(0x11c)](_0x5199af[_0x5782b0(0x155)]);if(_0x5199af[_0x5782b0(0xde)])for(const _0x255784 of _0x5199af['branches']){if(_0x255784[_0x5782b0(0x155)])_0x533c6e['push'](_0x255784[_0x5782b0(0x155)]);}if(_0x5199af[_0x5782b0(0xf5)])for(const _0x5d5faa of _0x5199af[_0x5782b0(0xf5)]){if(_0x5d5faa[_0x5782b0(0x155)])_0x533c6e[_0x5782b0(0x11c)](_0x5d5faa[_0x5782b0(0x155)]);}if(_0x5199af['conditions'])for(const _0x72ac1 of _0x5199af['conditions']){if(_0x72ac1['next'])_0x533c6e[_0x5782b0(0x11c)](_0x72ac1[_0x5782b0(0x155)]);}return _0x533c6e;}function parseJumpTargetDisplayName(_0xf8ac87){const _0x4fa729=a147_0x5e72,_0x17ee16=_0xf8ac87[_0x4fa729(0xe3)](/^(.+?)\s*\(([^/)]+)/);if(!_0x17ee16)return undefined;const _0x4d80dc=_0x17ee16[0x1][_0x4fa729(0xc8)](),_0x25c6b4=_0x17ee16[0x2]['trim']();if(!_0x4d80dc||!_0x25c6b4)return undefined;return{'stageName':_0x4d80dc,'journeyName':_0x25c6b4};}function orderStepsFromRoot(_0x26e471,_0x295a32){const _0x5411fe=a147_0x5e72,_0x27ed45=Object[_0x5411fe(0x111)](_0x26e471);if(_0x27ed45[_0x5411fe(0x150)]===0x0)return[];const _0xb436cd=new Set(_0x27ed45[_0x5411fe(0xd6)](([_0x46628f])=>_0x46628f)),_0x5519f5=new Set();for(const [,_0x1b9ef7]of _0x27ed45){for(const _0x3ac9db of getStepNextRefs(_0x1b9ef7)){if(_0xb436cd[_0x5411fe(0x125)](_0x3ac9db))_0x5519f5[_0x5411fe(0x167)](_0x3ac9db);}}let _0x3c0173=_0x295a32&&_0xb436cd[_0x5411fe(0x125)](_0x295a32)?_0x295a32:undefined;if(!_0x3c0173){const _0x2231cc=_0x27ed45[_0x5411fe(0x13a)](([_0x5466fe])=>!_0x5519f5[_0x5411fe(0x125)](_0x5466fe));_0x2231cc['length']>0x0?_0x3c0173=_0x2231cc[0x0][0x0]:_0x3c0173=_0x27ed45[0x0][0x0];}const _0x4929ad=[],_0x4da61a=new Set(),_0x17be2c=[_0x3c0173];while(_0x17be2c[_0x5411fe(0x150)]>0x0){const _0x6f2473=_0x17be2c[_0x5411fe(0x10f)]();if(_0x4da61a[_0x5411fe(0x125)](_0x6f2473))continue;_0x4da61a[_0x5411fe(0x167)](_0x6f2473);const _0x4ce4f7=_0x26e471[_0x6f2473];if(!_0x4ce4f7)continue;_0x4929ad[_0x5411fe(0x11c)]({'uuid':_0x6f2473,'step':_0x4ce4f7});for(const _0x338b8c of getStepNextRefs(_0x4ce4f7)){_0xb436cd['has'](_0x338b8c)&&!_0x4da61a[_0x5411fe(0x125)](_0x338b8c)&&_0x17be2c[_0x5411fe(0x11c)](_0x338b8c);}}for(const [_0x51a3e7,_0x14d6e2]of _0x27ed45){!_0x4da61a[_0x5411fe(0x125)](_0x51a3e7)&&_0x4929ad[_0x5411fe(0x11c)]({'uuid':_0x51a3e7,'step':_0x14d6e2});}return _0x4929ad;}function resolveStepReferences(_0x286a92,_0x1af42a,_0x42aaf5,_0x3e2953){const _0xa505d7=a147_0x5e72;if(_0x286a92[_0xa505d7(0xc2)]!=='end'){_0x286a92['next']&&_0x3e2953[_0xa505d7(0x125)](_0x286a92[_0xa505d7(0x155)])&&(_0x286a92[_0xa505d7(0x155)]=_0x3e2953[_0xa505d7(0xcf)](_0x286a92[_0xa505d7(0x155)]));const _0x3c5170=_0x1af42a+0x1;if(_0x3c5170<_0x42aaf5[_0xa505d7(0x150)]){const _0x3021a3=_0x3e2953[_0xa505d7(0xcf)](_0x42aaf5[_0x3c5170]['uuid']);_0x286a92['next']===_0x3021a3&&delete _0x286a92['next'];}}if(_0x286a92[_0xa505d7(0xc2)]==='decision_point')for(const _0x7940e5 of _0x286a92[_0xa505d7(0x141)]['branches']){_0x7940e5['next']&&_0x3e2953[_0xa505d7(0x125)](_0x7940e5[_0xa505d7(0x155)])&&(_0x7940e5[_0xa505d7(0x155)]=_0x3e2953[_0xa505d7(0xcf)](_0x7940e5[_0xa505d7(0x155)]));}if(_0x286a92[_0xa505d7(0xc2)]==='ab_test')for(const _0x20aabc of _0x286a92[_0xa505d7(0x141)][_0xa505d7(0xf5)]){_0x20aabc[_0xa505d7(0x155)]&&_0x3e2953[_0xa505d7(0x125)](_0x20aabc[_0xa505d7(0x155)])&&(_0x20aabc[_0xa505d7(0x155)]=_0x3e2953['get'](_0x20aabc[_0xa505d7(0x155)]));}if(_0x286a92[_0xa505d7(0xc2)]===_0xa505d7(0x133)&&_0x286a92[_0xa505d7(0x141)]['condition']){const _0x5465d6=_0x286a92[_0xa505d7(0x141)][_0xa505d7(0xce)];_0x5465d6[_0xa505d7(0x155)]&&_0x3e2953[_0xa505d7(0x125)](_0x5465d6[_0xa505d7(0x155)])&&(_0x5465d6[_0xa505d7(0x155)]=_0x3e2953[_0xa505d7(0xcf)](_0x5465d6['next'])),_0x5465d6[_0xa505d7(0xe7)]?.[_0xa505d7(0x155)]&&_0x3e2953[_0xa505d7(0x125)](_0x5465d6[_0xa505d7(0xe7)][_0xa505d7(0x155)])&&(_0x5465d6[_0xa505d7(0xe7)]['next']=_0x3e2953[_0xa505d7(0xcf)](_0x5465d6[_0xa505d7(0xe7)][_0xa505d7(0x155)]));}}function convertApiStageToYaml(_0x3ab49f){const _0x4f992e=a147_0x5e72,_0x3d17da={'name':_0x3ab49f[_0x4f992e(0x13c)]};_0x3ab49f['id']&&(_0x3d17da['id']=_0x3ab49f['id']);_0x3ab49f[_0x4f992e(0x106)]&&(_0x3d17da['description']=_0x3ab49f[_0x4f992e(0x106)]);_0x3ab49f[_0x4f992e(0xcb)]&&(_0x3d17da[_0x4f992e(0xc1)]=convertApiCriteriaToYaml(_0x3ab49f[_0x4f992e(0xcb)]));_0x3ab49f[_0x4f992e(0x15c)]&&_0x3ab49f[_0x4f992e(0x15c)][_0x4f992e(0x150)]>0x0&&(_0x3d17da[_0x4f992e(0x140)]=_0x3ab49f[_0x4f992e(0x15c)][_0x4f992e(0xd6)](convertApiCriteriaToYaml));_0x3ab49f[_0x4f992e(0xe2)]&&(_0x3d17da['milestone']=convertApiCriteriaToYaml(_0x3ab49f['milestone']));if(_0x3ab49f['steps']&&Object['keys'](_0x3ab49f[_0x4f992e(0x174)])[_0x4f992e(0x150)]>0x0){const _0xc9e227=orderStepsFromRoot(_0x3ab49f['steps'],_0x3ab49f[_0x4f992e(0x16c)]),_0x117920=new Map(),_0x2360fd=new Set();for(let _0xf927fa=0x0;_0xf927fa<_0xc9e227['length'];_0xf927fa++){const {uuid:_0x297d6a,step:_0x18af59}=_0xc9e227[_0xf927fa];let _0x4195df=generateReadableStepName(_0x18af59,_0xf927fa),_0x725292=_0x4195df,_0x34326c=0x2;while(_0x2360fd[_0x4f992e(0x125)](_0x725292)){_0x725292=_0x4195df+'_'+_0x34326c,_0x34326c++;}_0x2360fd[_0x4f992e(0x167)](_0x725292),_0x117920[_0x4f992e(0x142)](_0x297d6a,_0x725292);}_0x3d17da[_0x4f992e(0x174)]=_0xc9e227['map'](({uuid:_0x4761fb,step:_0x91cb76},_0x39b5f3)=>{const _0x43f5fc=_0x4f992e,_0x244904=convertApiStepToYaml(_0x91cb76,_0x117920[_0x43f5fc(0xcf)](_0x4761fb));return resolveStepReferences(_0x244904,_0x39b5f3,_0xc9e227,_0x117920),_0x244904;});}return _0x3d17da;}function convertApiCriteriaToYaml(_0xedad24){const _0x397203=a147_0x5e72,_0x16a873={'name':_0xedad24['name'],'segment':_0xedad24[_0x397203(0x173)]};_0xedad24['description']&&(_0x16a873['description']=_0xedad24[_0x397203(0x106)]);if(_0xedad24[_0x397203(0xc3)]){let _0xc02a1a=_0xedad24['target'][_0x397203(0xef)],_0x1015bf=_0xedad24[_0x397203(0xc3)]['journeyStageId'];if(_0xedad24[_0x397203(0xc3)][_0x397203(0xdf)]){const _0x2747f4=parseJumpTargetDisplayName(_0xedad24[_0x397203(0xc3)][_0x397203(0xdf)]);_0x2747f4&&(_0x1015bf=_0x2747f4[_0x397203(0x11e)],_0xc02a1a=_0x2747f4[_0x397203(0xdf)]);}_0x16a873[_0x397203(0xc3)]={'journey':_0xc02a1a,'stage':_0x1015bf},_0xedad24[_0x397203(0xc3)][_0x397203(0x15b)]&&(_0x16a873[_0x397203(0xc3)]['bundle_id']=_0xedad24[_0x397203(0xc3)][_0x397203(0x15b)]);}return _0x16a873;}function convertApiStepToYaml(_0xa092db,_0x4c8c29){const _0x1b8f37=a147_0x5e72;switch(_0xa092db[_0x1b8f37(0xc2)]){case _0x1b8f37(0xc0):{const _0x144536={};if(_0xa092db['waitStepType']===_0x1b8f37(0xed)&&_0xa092db[_0x1b8f37(0x112)]!==undefined)_0x144536[_0x1b8f37(0x160)]=_0xa092db[_0x1b8f37(0x112)],_0x144536['unit']=_0xa092db[_0x1b8f37(0x11a)];else{if(_0xa092db['waitStepType']==='Date'&&_0xa092db[_0x1b8f37(0xdb)])_0x144536['wait_until']=_0xa092db[_0x1b8f37(0xdb)];else{if(_0xa092db[_0x1b8f37(0x165)]===_0x1b8f37(0x10a)&&_0xa092db['daysOfWeek'])_0x144536[_0x1b8f37(0x114)]=_0xa092db[_0x1b8f37(0xe5)];else{if(_0xa092db[_0x1b8f37(0x165)]===_0x1b8f37(0x11d)){if(_0xa092db[_0x1b8f37(0x121)]&&_0xa092db[_0x1b8f37(0x121)][_0x1b8f37(0x150)]>0x0){const _0x475562=_0xa092db['conditions'][_0x1b8f37(0xfb)](_0x34d84c=>!_0x34d84c[_0x1b8f37(0xe1)]),_0x25b3b3=_0xa092db['conditions'][_0x1b8f37(0xfb)](_0xa89570=>_0xa89570[_0x1b8f37(0xe1)]);_0x475562?.['segmentId']&&(_0x144536[_0x1b8f37(0xce)]={'segment':_0x475562['segmentId'],..._0x475562[_0x1b8f37(0x155)]?{'next':_0x475562[_0x1b8f37(0x155)]}:{}},_0x25b3b3&&_0x25b3b3[_0x1b8f37(0x107)]!==undefined&&_0x25b3b3[_0x1b8f37(0xf8)]&&(_0x144536[_0x1b8f37(0xce)][_0x1b8f37(0xe7)]={'duration':_0x25b3b3[_0x1b8f37(0x107)],'unit':_0x25b3b3[_0x1b8f37(0xf8)],..._0x25b3b3['next']?{'next':_0x25b3b3[_0x1b8f37(0x155)]}:{}}));}else _0xa092db['conditionSegmentId']&&(_0x144536[_0x1b8f37(0xce)]={'segment':_0xa092db['conditionSegmentId']},_0xa092db['conditionTimeoutDuration']!==undefined&&_0xa092db[_0x1b8f37(0xc7)]&&(_0x144536[_0x1b8f37(0xce)]['timeout']={'duration':_0xa092db['conditionTimeoutDuration'],'unit':_0xa092db[_0x1b8f37(0xc7)]}));}}}}const _0x30d5ce={'type':_0x1b8f37(0x133),'name':_0x4c8c29,..._0xa092db[_0x1b8f37(0x155)]?{'next':_0xa092db[_0x1b8f37(0x155)]}:{},'with':_0x144536};return _0x30d5ce;}case _0x1b8f37(0x16b):{const _0x21a209={'type':_0x1b8f37(0x10c),'name':_0x4c8c29,..._0xa092db['next']?{'next':_0xa092db['next']}:{},'with':{'activation':_0xa092db[_0x1b8f37(0x14c)]||''}};return _0x21a209;}case _0x1b8f37(0xca):{const _0x1db415={'type':_0x1b8f37(0xdc),'name':_0x4c8c29,..._0xa092db['next']?{'next':_0xa092db[_0x1b8f37(0x155)]}:{},'with':{'branches':(_0xa092db[_0x1b8f37(0xde)]||[])[_0x1b8f37(0xd6)](_0x432133=>({'name':_0x432133[_0x1b8f37(0x13c)],'segment':_0x432133[_0x1b8f37(0x173)],'excluded':_0x432133[_0x1b8f37(0x17a)],..._0x432133['next']?{'next':_0x432133['next']}:{}}))}};return _0x1db415;}case _0x1b8f37(0x10d):case _0x1b8f37(0xcc):case _0x1b8f37(0x169):{const _0x16572d=_0xa092db[_0x1b8f37(0xf5)]||(_0xa092db[_0x1b8f37(0xde)]||[])['map'](_0x5008e9=>({'name':_0x5008e9[_0x1b8f37(0x13c)],'percentage':0x0,'next':_0x5008e9[_0x1b8f37(0x155)]})),_0xb44418={'type':_0x1b8f37(0x177),'name':_0x4c8c29,..._0xa092db[_0x1b8f37(0x155)]?{'next':_0xa092db[_0x1b8f37(0x155)]}:{},'with':{'customized_split':_0xa092db[_0x1b8f37(0x12a)],'unique_id':_0xa092db['uniqueId'],'variants':_0x16572d[_0x1b8f37(0xd6)](_0x371f31=>({'name':_0x371f31[_0x1b8f37(0x13c)],'percentage':_0x371f31[_0x1b8f37(0xd3)],..._0x371f31[_0x1b8f37(0x155)]?{'next':_0x371f31[_0x1b8f37(0x155)]}:{}}))}};return _0xb44418;}case _0x1b8f37(0x123):{const _0x4c337b={'type':_0x1b8f37(0x176),'name':_0x4c8c29,..._0xa092db[_0x1b8f37(0x155)]?{'next':_0xa092db['next']}:{}};return _0x4c337b;}case _0x1b8f37(0xfe):{let _0x270ed5='',_0x1b35f9='',_0x387046;if(_0xa092db['target']){_0x270ed5=_0xa092db[_0x1b8f37(0xc3)]['journeyId'],_0x1b35f9=_0xa092db[_0x1b8f37(0xc3)][_0x1b8f37(0x149)],_0x387046=_0xa092db[_0x1b8f37(0xc3)][_0x1b8f37(0x15b)];if(_0xa092db['target']['journeyName']){const _0x52e33d=parseJumpTargetDisplayName(_0xa092db['target'][_0x1b8f37(0xdf)]);_0x52e33d&&(_0x1b35f9=_0x52e33d[_0x1b8f37(0x11e)],_0x270ed5=_0x52e33d[_0x1b8f37(0xdf)]);}}const _0x359813={'type':_0x1b8f37(0x143),'name':_0x4c8c29,..._0xa092db['next']?{'next':_0xa092db['next']}:{},'with':{'target':{'journey':_0x270ed5,'stage':_0x1b35f9,..._0x387046?{'bundle_id':_0x387046}:{}}}};return _0x359813;}case _0x1b8f37(0x120):{const _0x419634={'type':'end','name':_0x4c8c29};return _0x419634;}default:{const _0x5d8ca9={'type':_0x1b8f37(0xb9),'name':_0x4c8c29};return _0x5d8ca9;}}}export async function journeyDefToRequest(_0xc74908,_0x558fbf,_0x387294){const _0x2071a7=a147_0x5e72,_0x1b7358=_0xc74908[_0x2071a7(0x12f)]||getActiveStages(_0xc74908),_0x3d5592=isJourneysArrayMode(_0xc74908)||isMultiVersionMode(_0xc74908)?getLatestJourneyEntry(_0xc74908):undefined,_0x30f5b9=_0x3d5592?.[_0x2071a7(0xfa)]??_0xc74908[_0x2071a7(0x13c)],_0x21b622=_0xc74908['segments']||{},_0x42e227=_0xc74908[_0x2071a7(0x172)]||{},_0x42bd6d={'type':_0x2071a7(0x144),'attributes':{'name':_0x30f5b9,'audienceId':_0x558fbf,'journeyStages':await Promise[_0x2071a7(0xee)](_0x1b7358[_0x2071a7(0xd6)](_0x1b0a8c=>convertYamlStageToApi(_0x1b0a8c,_0x387294,_0x21b622,_0x42e227)))}},_0x57f3ee=_0x3d5592?.['id']??_0xc74908['id'];_0x57f3ee&&(_0x42bd6d['id']=_0x57f3ee);_0xc74908['description']&&(_0x42bd6d[_0x2071a7(0x12b)]['description']=_0xc74908[_0x2071a7(0x106)]);const _0x51710e=getEffectiveGoal(_0xc74908);_0x51710e&&(_0x42bd6d[_0x2071a7(0x12b)][_0x2071a7(0x13e)]=await convertYamlCriteriaToApi(_0x51710e,_0x387294,_0x21b622));const _0xbc0cf5=getEffectiveReentry(_0xc74908);return _0xbc0cf5&&(_0x42bd6d[_0x2071a7(0x12b)][_0x2071a7(0x179)]=_0xbc0cf5,_0x42bd6d[_0x2071a7(0x12b)]['allowReentry']=_0xbc0cf5!==_0x2071a7(0xff)),_0xc74908['folder_id']&&(_0x42bd6d['relationships']={'parentFolder':{'data':{'id':_0xc74908[_0x2071a7(0x127)],'type':'folder'}}}),_0x42bd6d;}async function convertYamlStageToApi(_0x523908,_0x428572,_0x11ecec={},_0x3acd7a={}){const _0x627793=a147_0x5e72,_0x27df50={'name':_0x523908[_0x627793(0x13c)]};_0x523908['id']&&(_0x27df50['id']=_0x523908['id']);_0x523908[_0x627793(0x106)]&&(_0x27df50[_0x627793(0x106)]=_0x523908['description']);_0x523908[_0x627793(0xc1)]&&(_0x27df50[_0x627793(0xcb)]=await convertYamlCriteriaToApi(_0x523908[_0x627793(0xc1)],_0x428572,_0x11ecec));_0x523908['exit_criteria']&&_0x523908[_0x627793(0x140)][_0x627793(0x150)]>0x0&&(_0x27df50[_0x627793(0x15c)]=await Promise[_0x627793(0xee)](_0x523908[_0x627793(0x140)][_0x627793(0xd6)](_0x46b979=>convertYamlCriteriaToApi(_0x46b979,_0x428572,_0x11ecec))));_0x523908[_0x627793(0xe2)]&&(_0x27df50[_0x627793(0xe2)]=await convertYamlCriteriaToApi(_0x523908[_0x627793(0xe2)],_0x428572,_0x11ecec));if(_0x523908['steps']&&_0x523908[_0x627793(0x174)][_0x627793(0x150)]>0x0){const _0x72f63d={},_0x307f8b=_0x523908[_0x627793(0x174)][_0x627793(0xd6)]((_0x32b15d,_0x41a186)=>{const _0x3fef80=_0x627793,_0x327742=_0x32b15d[_0x3fef80(0x110)]||generateUUID(),_0x59ccfe=_0x32b15d['name']||_0x32b15d[_0x3fef80(0xc2)]+'_'+_0x41a186;return _0x72f63d[_0x59ccfe]=_0x327742,{..._0x32b15d,'name':_0x59ccfe};});_0x27df50[_0x627793(0x16c)]=_0x72f63d[_0x307f8b[0x0]['name']],_0x27df50[_0x627793(0x174)]={};for(let _0x59d6ac=0x0;_0x59d6ac<_0x307f8b[_0x627793(0x150)];_0x59d6ac++){const _0x2e2c49=_0x307f8b[_0x59d6ac],_0x198fbc=_0x72f63d[_0x2e2c49[_0x627793(0x13c)]],_0x44769d=!_0x2e2c49[_0x627793(0x155)]&&_0x59d6ac<_0x307f8b[_0x627793(0x150)]-0x1&&_0x2e2c49[_0x627793(0xc2)]!==_0x627793(0xb9)?_0x307f8b[_0x59d6ac+0x1][_0x627793(0x13c)]:_0x2e2c49[_0x627793(0x155)],_0x25885a=_0x44769d!==_0x2e2c49[_0x627793(0x155)]?{..._0x2e2c49,'next':_0x44769d}:_0x2e2c49;_0x27df50['steps'][_0x198fbc]=await convertYamlStepToApi(_0x25885a,_0x428572,_0x11ecec,_0x72f63d,_0x3acd7a);}}else _0x523908[_0x627793(0xbf)]&&(_0x27df50[_0x627793(0x16c)]=_0x523908[_0x627793(0xbf)]);return _0x27df50;}async function convertYamlCriteriaToApi(_0x1618c5,_0x546930,_0x3b77a8={}){const _0xaac7b=a147_0x5e72;let _0x4d6d27=_0x1618c5['segment'];if(_0x4d6d27&&!/^\d+$/[_0xaac7b(0x124)](_0x4d6d27)){const _0x4d4812=parseSegmentRef(_0x4d6d27);if(_0x4d4812[_0xaac7b(0xc2)]===_0xaac7b(0xd0))_0x546930?.[_0xaac7b(0x10b)]&&(_0x4d6d27=await _0x546930[_0xaac7b(0x10b)](_0x4d4812['name']));else{if(_0x4d4812['type']===_0xaac7b(0xd4)&&_0x3b77a8[_0x4d4812[_0xaac7b(0x13c)]])_0x546930?.[_0xaac7b(0x115)]&&(_0x4d6d27=await _0x546930[_0xaac7b(0x115)](_0x4d4812[_0xaac7b(0x13c)],_0x3b77a8[_0x4d4812['name']]));else _0x546930?.[_0xaac7b(0x10b)]&&(_0x4d6d27=await _0x546930[_0xaac7b(0x10b)](_0x4d4812[_0xaac7b(0x13c)]));}}const _0x214e65={'name':_0x1618c5[_0xaac7b(0x13c)],'segmentId':_0x4d6d27};_0x1618c5[_0xaac7b(0x106)]&&(_0x214e65[_0xaac7b(0x106)]=_0x1618c5['description']);if(_0x1618c5[_0xaac7b(0xc3)]){const _0x574465=_0x1618c5[_0xaac7b(0xc3)][_0xaac7b(0x144)],_0x65d19f=_0x1618c5[_0xaac7b(0xc3)][_0xaac7b(0xdd)];let _0x408360=_0x1618c5[_0xaac7b(0xc3)]['journey'];_0x546930?.[_0xaac7b(0xbe)]&&!/^\d+$/[_0xaac7b(0x124)](_0x408360)&&(_0x408360=await _0x546930[_0xaac7b(0xbe)](_0x408360));let _0x677717=_0x1618c5[_0xaac7b(0xc3)][_0xaac7b(0xdd)];_0x546930?.[_0xaac7b(0xb7)]&&!/^\d+$/['test'](_0x677717)&&(_0x677717=await _0x546930[_0xaac7b(0xb7)](_0x408360,_0x677717));const _0x15fb78=!/^\d+$/[_0xaac7b(0x124)](_0x574465)&&!isLocalJourneyRef(_0x574465)?formatApiJourneyName(_0x574465,_0x65d19f):undefined;_0x214e65[_0xaac7b(0xc3)]={'journeyId':_0x408360,'journeyStageId':_0x677717,'journeyName':_0x15fb78,'confirmed':!![]},_0x1618c5[_0xaac7b(0xc3)][_0xaac7b(0xd7)]&&(_0x214e65[_0xaac7b(0xc3)][_0xaac7b(0x15b)]=_0x1618c5[_0xaac7b(0xc3)][_0xaac7b(0xd7)]);}return _0x214e65;}async function convertYamlStepToApi(_0x5e53b3,_0x202547,_0x18303c={},_0x2be6a0={},_0x5b5892={}){const _0x3f3066=a147_0x5e72,_0x16bcb2=async _0x19f2ae=>{const _0x232b2e=a147_0x5e72;if(/^\d+$/[_0x232b2e(0x124)](_0x19f2ae))return _0x19f2ae;const _0x3d20ae=parseSegmentRef(_0x19f2ae);if(_0x3d20ae['type']===_0x232b2e(0xd0)){if(_0x202547?.['resolveSegmentId'])return await _0x202547[_0x232b2e(0x10b)](_0x3d20ae[_0x232b2e(0x13c)]);}else{if(_0x3d20ae[_0x232b2e(0xc2)]==='embedded'&&_0x18303c[_0x3d20ae[_0x232b2e(0x13c)]]){if(_0x202547?.[_0x232b2e(0x115)])return await _0x202547['resolveEmbeddedSegmentId'](_0x3d20ae['name'],_0x18303c[_0x3d20ae[_0x232b2e(0x13c)]]);}else{if(_0x202547?.[_0x232b2e(0x10b)])return await _0x202547['resolveSegmentId'](_0x3d20ae[_0x232b2e(0x13c)]);}}return _0x19f2ae;},_0x289cac=async _0x2463b9=>{const _0x372860=a147_0x5e72;if(/^\d+$/[_0x372860(0x124)](_0x2463b9))return _0x2463b9;const _0x521073=parseSegmentRef(_0x2463b9);if(_0x521073['type']===_0x372860(0xd0)){if(_0x202547?.[_0x372860(0xba)])return await _0x202547['resolveActivationId'](_0x521073[_0x372860(0x13c)]);return _0x521073[_0x372860(0x13c)];}else{if(_0x521073[_0x372860(0xc2)]==='embedded'&&_0x5b5892[_0x521073['name']]){if(_0x202547?.[_0x372860(0x162)])return await _0x202547['resolveEmbeddedActivationId'](_0x521073[_0x372860(0x13c)],_0x5b5892[_0x521073[_0x372860(0x13c)]]);if(_0x202547?.['resolveActivationId'])return await _0x202547[_0x372860(0xba)](_0x521073[_0x372860(0x13c)]);}else{if(_0x202547?.[_0x372860(0xba)])return await _0x202547['resolveActivationId'](_0x521073[_0x372860(0x13c)]);}}return _0x2463b9;},_0x5cd26b=_0x4537f6=>{const _0x2d1d07=a147_0x5e72;if(!_0x4537f6)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x2d1d07(0x124)](_0x4537f6))return _0x4537f6;return _0x2be6a0[_0x4537f6]||_0x4537f6;};switch(_0x5e53b3['type']){case'wait':{const _0x2d76a5=_0x5e53b3,_0x4cf8a4=_0x2d76a5['with'],_0x163451={'type':_0x3f3066(0xc0),'name':_0x2d76a5[_0x3f3066(0x13c)],'next':_0x5cd26b(_0x2d76a5[_0x3f3066(0x155)])};if(_0x4cf8a4[_0x3f3066(0x160)]!==undefined&&_0x4cf8a4[_0x3f3066(0xf8)])_0x163451[_0x3f3066(0x165)]=_0x3f3066(0xed),_0x163451[_0x3f3066(0x112)]=_0x4cf8a4[_0x3f3066(0x160)],_0x163451[_0x3f3066(0x11a)]=normalizeWaitUnit(_0x4cf8a4[_0x3f3066(0xf8)]);else{if(_0x4cf8a4[_0x3f3066(0x158)])_0x163451[_0x3f3066(0x165)]='Date',_0x163451[_0x3f3066(0xdb)]=_0x4cf8a4[_0x3f3066(0x158)];else{if(_0x4cf8a4['days_of_week'])_0x163451['waitStepType']=_0x3f3066(0x10a),_0x163451[_0x3f3066(0xe5)]=_0x4cf8a4[_0x3f3066(0x114)];else{if(_0x4cf8a4[_0x3f3066(0xce)]){_0x163451[_0x3f3066(0x165)]=_0x3f3066(0x11d);const _0x250d01=await _0x16bcb2(_0x4cf8a4[_0x3f3066(0xce)]['segment']),_0x38bbb4=_0x4cf8a4['condition']['timeout']?.[_0x3f3066(0x155)]!==undefined;if(_0x38bbb4){const _0x197040=[];_0x197040[_0x3f3066(0x11c)]({'id':generateUUID(),'segmentId':_0x250d01,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x5cd26b(_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0x155)]??_0x2d76a5['next'])});if(_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0xe7)]){const _0x2b6aed=_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0xe7)][_0x3f3066(0x160)],_0x2dab35=normalizeWaitUnit(_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0xe7)][_0x3f3066(0xf8)]);_0x197040['push']({'id':generateUUID(),'timedOutPath':!![],'name':_0x3f3066(0xc5)+_0x2b6aed+'\x20'+_0x2dab35,'moveAfter':_0x2b6aed,'unit':_0x2dab35,'next':_0x5cd26b(_0x4cf8a4[_0x3f3066(0xce)]['timeout']['next'])});}_0x163451[_0x3f3066(0x121)]=_0x197040,delete _0x163451[_0x3f3066(0x155)];}else _0x163451[_0x3f3066(0x122)]=_0x250d01,_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0xe7)]&&(_0x163451['conditionTimeoutDuration']=_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0xe7)]['duration'],_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0xe7)][_0x3f3066(0xf8)]&&(_0x163451['conditionTimeoutUnit']=normalizeWaitUnit(_0x4cf8a4[_0x3f3066(0xce)][_0x3f3066(0xe7)][_0x3f3066(0xf8)])));}}}}return _0x163451;}case _0x3f3066(0x10c):{const _0x15412f=_0x5e53b3,_0x2061ee=_0x15412f['with']['activation'],_0x369cd5=await _0x289cac(_0x2061ee);return{'type':_0x3f3066(0x16b),'name':_0x15412f[_0x3f3066(0x13c)],'journeyActivationStepId':_0x369cd5,'next':_0x5cd26b(_0x15412f[_0x3f3066(0x155)])};}case _0x3f3066(0xdc):{const _0x4c4d8b=_0x5e53b3,_0x16fbaf=_0x4c4d8b['with'][_0x3f3066(0xde)];return{'type':'DecisionPoint','name':_0x4c4d8b['name'],'branches':await Promise[_0x3f3066(0xee)](_0x16fbaf[_0x3f3066(0xd6)](async _0x7f81df=>{const _0xd449cc=_0x3f3066;let _0x29d385='';if(!_0x7f81df['excluded']){const _0x146e53=_0x7f81df['segment']||_0x7f81df[_0xd449cc(0xf0)]||'';_0x29d385=_0x146e53?await _0x16bcb2(_0x146e53):'';}return{'id':crypto[_0xd449cc(0xf4)](),'name':_0x7f81df[_0xd449cc(0x13c)],'description':null,'segmentId':_0x29d385,'excludedPath':_0x7f81df['excluded']??![],'next':_0x5cd26b(_0x7f81df[_0xd449cc(0x155)])};})),'next':_0x5cd26b(_0x4c4d8b[_0x3f3066(0x155)])};}case _0x3f3066(0x177):{const _0x32bc90=_0x5e53b3,_0x2b1e25=_0x32bc90[_0x3f3066(0x141)];return{'type':_0x3f3066(0x10d),'name':_0x32bc90['name'],'customizedSplit':_0x2b1e25[_0x3f3066(0xbc)],'uniqueId':_0x2b1e25[_0x3f3066(0x129)],'variants':_0x2b1e25[_0x3f3066(0xf5)][_0x3f3066(0xd6)](_0x30d33a=>({'id':_0x30d33a['id']||generateUUID(),'name':_0x30d33a[_0x3f3066(0x13c)],'percentage':_0x30d33a['percentage'],'next':_0x5cd26b(_0x30d33a[_0x3f3066(0x155)])})),'next':_0x5cd26b(_0x32bc90[_0x3f3066(0x155)])};}case _0x3f3066(0x176):return{'type':_0x3f3066(0x123),'name':_0x5e53b3[_0x3f3066(0x13c)],'next':_0x5cd26b(_0x5e53b3[_0x3f3066(0x155)])};case _0x3f3066(0x143):{const _0x29d875=_0x5e53b3,_0x2a184e=_0x29d875[_0x3f3066(0x141)][_0x3f3066(0xc3)],_0x3dd18c=_0x2a184e['journey'],_0x27148e=_0x2a184e[_0x3f3066(0xdd)];let _0x4e86e3=_0x2a184e[_0x3f3066(0x144)];_0x202547?.['resolveJourneyId']&&!/^\d+$/[_0x3f3066(0x124)](_0x4e86e3)&&(_0x4e86e3=await _0x202547[_0x3f3066(0xbe)](_0x4e86e3));let _0x2a658d=_0x2a184e[_0x3f3066(0xdd)];_0x202547?.[_0x3f3066(0xb7)]&&!/^\d+$/[_0x3f3066(0x124)](_0x2a658d)&&(_0x2a658d=await _0x202547[_0x3f3066(0xb7)](_0x4e86e3,_0x2a658d));const _0x76d3dd=!/^\d+$/[_0x3f3066(0x124)](_0x3dd18c)&&!isLocalJourneyRef(_0x3dd18c)?formatApiJourneyName(_0x3dd18c,_0x27148e):undefined;return{'type':_0x3f3066(0xfe),'name':_0x29d875[_0x3f3066(0x13c)],'target':{'journeyId':_0x4e86e3,'journeyStageId':_0x2a658d,'journeyBundleId':_0x2a184e[_0x3f3066(0xd7)],'journeyName':_0x76d3dd,'confirmed':!![]},'next':_0x5cd26b(_0x29d875[_0x3f3066(0x155)])};}case _0x3f3066(0xb9):return{'type':_0x3f3066(0x120),'name':_0x5e53b3[_0x3f3066(0x13c)]};default:{const _0x5cc058=_0x5e53b3;return{'type':'End','name':_0x5cc058[_0x3f3066(0x13c)]};}}}export function toYamlString(_0x4cf403){const _0x46cd8f=a147_0x5e72,_0x499c93=stripInternalFields(_0x4cf403),_0xc68379=a147_0x156059[_0x46cd8f(0x100)](_0x499c93,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x46cd8f(0x12d)}),_0x5c83dc=[_0x46cd8f(0x178),_0x46cd8f(0x156),_0x46cd8f(0x153),_0x46cd8f(0x11f),_0x46cd8f(0xe9),_0x46cd8f(0x113),'versions:'];let _0x30280d=_0xc68379;for(const _0x17a4d8 of _0x5c83dc){_0x30280d=_0x30280d['replace'](new RegExp('^('+_0x17a4d8+')','m'),(_0x1a1aff,_0x1b62c0,_0x4073d4)=>{if(_0x4073d4===0x0||_0x30280d[_0x4073d4-0x1]==='\x0a'&&_0x30280d[_0x4073d4-0x2]==='\x0a')return _0x1b62c0;return'\x0a'+_0x1b62c0;});}return _0x30280d;}function stripInternalFields(_0x2fc2ea){const _0x5219c9=a147_0x5e72,{id:_0x3d7f1d,folder_id:_0x54fa76,bundle_id:_0x4390c9,bundle_name:_0x40928c,version:_0x519979,allow_reentry:_0xdd4a0e,..._0x13ba2b}=_0x2fc2ea;return _0x13ba2b[_0x5219c9(0x130)]&&(_0x13ba2b[_0x5219c9(0x130)]=_0x13ba2b['journeys'][_0x5219c9(0xd6)](_0x5b11ec=>{const _0x42daa0=_0x5219c9,{id:_0x219504,..._0x21c218}=_0x5b11ec;return{..._0x21c218,'stages':_0x21c218['stages']['map'](stripStageInternalFields),..._0x5b11ec['latest']===!![]?{'latest':!![]}:{},..._0x13ba2b[_0x42daa0(0x130)]['length']===0x1&&_0x21c218[_0x42daa0(0xfa)]==='v1'?{'version':undefined}:{}};})),_0x13ba2b[_0x5219c9(0x12f)]&&(_0x13ba2b['stages']=_0x13ba2b[_0x5219c9(0x12f)][_0x5219c9(0xd6)](stripStageInternalFields)),_0x13ba2b['versions']&&(_0x13ba2b[_0x5219c9(0x10e)]=_0x13ba2b['versions'][_0x5219c9(0xd6)](_0x1a6d2a=>{const _0x546060=_0x5219c9,{id:_0x943563,..._0x4dce45}=_0x1a6d2a;return{..._0x4dce45,'stages':_0x4dce45[_0x546060(0x12f)][_0x546060(0xd6)](stripStageInternalFields),..._0x1a6d2a[_0x546060(0x157)]===!![]?{'latest':!![]}:{}};})),_0x13ba2b;}function stripStageInternalFields(_0x1e6f7c){const {id:_0x60afb8,..._0x570249}=_0x1e6f7c;return _0x570249;}export function parseYamlString(_0x4ba1a2){return safeParseYaml(_0x4ba1a2,JourneyDefSchema);}function a147_0x5d7f(){const _0x25604d=['entryCriteria','AbTest','resolveSegmentName','condition','get','ref','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','values','percentage','embedded','Goal\x20Achieved','map','bundle_id','draft','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','data','waitUntilDate','decision_point','stage','branches','journeyName','reentry','timedOutPath','milestone','match','allowReentry','daysOfWeek','journeyBundleName','timeout','keys','journeys:','state','(missing)','1300166BRFwRd','Duration','all','journeyId','segment_id','definition','First\x20stage\x20of\x20the\x20journey','from','randomUUID','variants','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','startsWith','unit','sort','version','find','reentry_always','Wait\x201\x20Day','Jump','no_reentry','stringify','\x20\x20rule:\x0a','launched','your-activation-name','segment','\x20\x20\x20\x20type:\x20And\x0a','description','moveAfter','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','isJourneyLocal','DaysOfTheWeek','resolveSegmentId','activation','ABTest','versions','shift','uuid','entries','waitStep','stages:','days_of_week','resolveEmbeddedSegmentId','617548sKBEUK','\x20\x20\x20\x20type:\x20','schedule','1871528XjDSrW','waitStepUnit','resolveJumpTarget','push','Condition','stageName','reentry:','End','conditions','conditionSegmentId','Merge','test','has','segments','folder_id','466kGaNCl','unique_id','customizedSplit','attributes','And','null','4325321tYhqYz','stages','journeys','30QrQzWv','Unknown\x20segment\x20\x22','wait','Stage\x20Complete','day','goal-segment','552nrGryH','connector_config','Entry\x20Criteria','filter','bundle_name','name','week','goal','waitCondition','exit_criteria','with','set','jump','journey','parentFolder','resolveActivation','isArray','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','journeyStageId','6jpNZME','versionNumber','journeyActivationStepId','rule','relationships','includes','length','journeyStages','\x27.\x0a','goal:','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','next','activations:','latest','wait_until','706860MXfFYh','\x20\x20\x20\x20conditions:\x0a','journeyBundleId','exitCriterias','\x27:\x20','JOURNEY_SYNTAX_ERROR','size','duration','object','resolveEmbeddedActivationId','resolveSegment','connection','waitStepType','version_number','add','toLowerCase','Variant','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','Activation','rootStep','stageId','Stage\x201','behavior','columns','activation_template_id','activations','segmentId','steps','exitCriteria','merge','ab_test','segments:','reentryMode','excludedPath','resolveStageId','excluded','end','resolveActivationId','13505PXpsXd','customized_split','all_columns','resolveJourneyId','root_step','WaitStep','entry_criteria','type','target','notification','*Max\x20wait\x20','1324hbOIIM','conditionTimeoutUnit','trim','Expected\x20format:\x0a','DecisionPoint'];a147_0x5d7f=function(){return _0x25604d;};return a147_0x5d7f();}export function isJourneyDef(_0x2ca487){const _0x56d106=a147_0x5e72;return typeof _0x2ca487==='object'&&_0x2ca487!==null&&_0x56d106(0xc2)in _0x2ca487&&_0x2ca487['type']===_0x56d106(0x144);}export function generateTemplate(_0x463107,_0x4862bb){const _0x413bdf=a147_0x5e72,_0x5bba73={'type':_0x413bdf(0x144),'name':_0x463107,'description':'Journey\x20description','reentry':'no_reentry','goal':{'name':_0x413bdf(0xd5),'segment':_0x413bdf(0x136)},'stages':[{'name':_0x413bdf(0x16e),'description':_0x413bdf(0xf2),'entry_criteria':{'name':_0x413bdf(0x139),'segment':_0x4862bb},'steps':[{'type':_0x413bdf(0x133),'name':_0x413bdf(0xfd),'with':{'duration':0x1,'unit':_0x413bdf(0x135)}},{'type':_0x413bdf(0x10c),'name':'Send\x20Notification','with':{'activation':_0x413bdf(0x103)}},{'type':_0x413bdf(0xb9),'name':_0x413bdf(0x134)}]}]};return toYamlString(_0x5bba73);}function generateUUID(){const _0x5176c9=a147_0x5e72;return crypto[_0x5176c9(0xf4)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x4a2904){const _0xb9e1f8=a147_0x5e72;if(_0x4a2904[_0xb9e1f8(0xf7)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x4a2904['slice'](SEGMENT_REF_PREFIX[_0xb9e1f8(0x150)])};if(/^\d+$/[_0xb9e1f8(0x124)](_0x4a2904))return{'type':'id','name':_0x4a2904};return{'type':'embedded','name':_0x4a2904};}export function makeSegmentRef(_0x12b62e){return''+SEGMENT_REF_PREFIX+_0x12b62e;}export function isExternalSegmentRef(_0x22bffe){const _0x4cd282=a147_0x5e72;return _0x22bffe[_0x4cd282(0xf7)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x2e3efa){const _0x132b79=a147_0x5e72;return!!(_0x2e3efa[_0x132b79(0x130)]&&_0x2e3efa[_0x132b79(0x130)][_0x132b79(0x150)]>0x0);}export function isMultiVersionMode(_0x614f44){const _0x566c84=a147_0x5e72;return!!(_0x614f44[_0x566c84(0x10e)]&&_0x614f44['versions'][_0x566c84(0x150)]>0x0);}export function isSingleVersionMode(_0x22bc4b){const _0x2f1f92=a147_0x5e72;return!!(_0x22bc4b[_0x2f1f92(0x12f)]&&_0x22bc4b[_0x2f1f92(0x12f)][_0x2f1f92(0x150)]>0x0);}export function hasMultipleVersions(_0x16476f){const _0x3a59d9=a147_0x5e72;if(isJourneysArrayMode(_0x16476f))return(_0x16476f[_0x3a59d9(0x130)]?.[_0x3a59d9(0x150)]||0x0)>0x1;if(isMultiVersionMode(_0x16476f))return(_0x16476f[_0x3a59d9(0x10e)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x25c4f8){const _0x10ab35=a147_0x5e72;if(isJourneysArrayMode(_0x25c4f8))return _0x25c4f8;if(isSingleVersionMode(_0x25c4f8)){const {stages:_0x5437cb,id:_0x48c1ed,version:_0x539d1b,version_number:_0x3fd575,..._0xacafb0}=_0x25c4f8;return{..._0xacafb0,'journeys':[{'version':_0x539d1b||'v1','stages':_0x5437cb||[],'id':_0x48c1ed,'version_number':_0x3fd575}]};}if(isMultiVersionMode(_0x25c4f8)){const {versions:_0x3b552b,..._0x4b60d7}=_0x25c4f8;return{..._0x4b60d7,'journeys':(_0x3b552b||[])[_0x10ab35(0xd6)](_0x32038c=>({'version':_0x32038c['name'],'state':_0x32038c[_0x10ab35(0xea)],'latest':_0x32038c[_0x10ab35(0x157)],'stages':_0x32038c[_0x10ab35(0x12f)],'id':_0x32038c['id'],'version_number':_0x32038c[_0x10ab35(0x166)]}))};}return _0x25c4f8;}export function normalizeJourneyDef(_0x5d13f0,_0x308427){const _0xc1e86e=a147_0x5e72,_0x508b5a=normalizeToJourneysFormat(_0x5d13f0),_0x5cfd3d=_0x308427?.[_0xc1e86e(0x126)]?Object[_0xc1e86e(0xe8)](_0x308427[_0xc1e86e(0x126)]):undefined,_0x4cf50d=_0x308427?.[_0xc1e86e(0x172)]?Object[_0xc1e86e(0xe8)](_0x308427[_0xc1e86e(0x172)]):undefined;return{'type':_0xc1e86e(0x144),'name':_0x508b5a[_0xc1e86e(0x13c)],..._0x508b5a[_0xc1e86e(0x106)]!==undefined&&{'description':_0x508b5a[_0xc1e86e(0x106)]},..._0x508b5a[_0xc1e86e(0x13e)]&&{'goal':normalizeJourneyCriteria(_0x508b5a['goal'])},..._0x508b5a[_0xc1e86e(0xe0)]!==undefined&&{'reentry':_0x508b5a[_0xc1e86e(0xe0)]},..._0x508b5a[_0xc1e86e(0x126)]&&{'segments':normalizeEmbeddedSegments(_0x508b5a[_0xc1e86e(0x126)],_0x5cfd3d)},..._0x508b5a['activations']&&{'activations':normalizeEmbeddedActivations(_0x508b5a['activations'],_0x4cf50d)},..._0x508b5a[_0xc1e86e(0x130)]&&{'journeys':_0x508b5a[_0xc1e86e(0x130)][_0xc1e86e(0xd6)](_0x4d413b=>normalizeJourneyEntry(_0x4d413b,_0x508b5a[_0xc1e86e(0x130)]['length']===0x1))}};}function normalizeJourneyEntry(_0x4714c0,_0x35305d){const _0x12fd22=a147_0x5e72;return{...!_0x35305d&&_0x4714c0['version']!==undefined&&{'version':_0x4714c0[_0x12fd22(0xfa)]},..._0x4714c0[_0x12fd22(0xea)]!==undefined&&{'state':_0x4714c0[_0x12fd22(0xea)]},...!_0x35305d&&_0x4714c0[_0x12fd22(0x157)]!==undefined&&{'latest':_0x4714c0['latest']},..._0x4714c0[_0x12fd22(0x166)]!==undefined&&{'version_number':_0x4714c0[_0x12fd22(0x166)]},..._0x4714c0[_0x12fd22(0x13e)]&&{'goal':normalizeJourneyCriteria(_0x4714c0[_0x12fd22(0x13e)])},..._0x4714c0[_0x12fd22(0xe0)]!==undefined&&{'reentry':_0x4714c0[_0x12fd22(0xe0)]},'stages':_0x4714c0[_0x12fd22(0x12f)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x419c39){const _0x248df4=a147_0x5e72;return{'name':_0x419c39['name'],..._0x419c39['description']!==undefined&&{'description':_0x419c39['description']},..._0x419c39[_0x248df4(0xc1)]&&{'entry_criteria':normalizeJourneyCriteria(_0x419c39[_0x248df4(0xc1)])},..._0x419c39[_0x248df4(0x140)]&&{'exit_criteria':_0x419c39[_0x248df4(0x140)][_0x248df4(0xd6)](normalizeJourneyCriteria)},..._0x419c39[_0x248df4(0xe2)]&&{'milestone':normalizeJourneyCriteria(_0x419c39[_0x248df4(0xe2)])},..._0x419c39['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x419c39[_0x248df4(0x174)])}};}function normalizeStepsWithImplicitNext(_0x11472c){const _0x5c9a9a=a147_0x5e72;return _0x11472c[_0x5c9a9a(0xd6)]((_0x11d592,_0xf45bf1)=>{const _0x2ba8a8=_0x5c9a9a,_0x78bb9=_0xf45bf1<_0x11472c[_0x2ba8a8(0x150)]-0x1?_0x11472c[_0xf45bf1+0x1][_0x2ba8a8(0x13c)]:undefined;return normalizeJourneyStep(_0x11d592,_0x78bb9);});}function normalizeJourneyCriteria(_0x5eadbf){const _0x48ab8a=a147_0x5e72;return{'name':_0x5eadbf[_0x48ab8a(0x13c)],..._0x5eadbf[_0x48ab8a(0x106)]!==undefined&&{'description':_0x5eadbf['description']},'segment':_0x5eadbf[_0x48ab8a(0x104)],..._0x5eadbf['target']&&{'target':normalizeJumpTarget(_0x5eadbf['target'])}};}function normalizeJourneyStep(_0x18636d,_0x36c513){const _0x10380b=a147_0x5e72,_0x16ef7a=_0x18636d[_0x10380b(0x155)]!==undefined&&_0x18636d['next']!==_0x36c513,_0x3d1cd2={'type':_0x18636d[_0x10380b(0xc2)],'name':_0x18636d['name'],..._0x16ef7a&&{'next':_0x18636d[_0x10380b(0x155)]}};if('with'in _0x18636d&&_0x18636d[_0x10380b(0x141)])return{..._0x3d1cd2,'with':normalizeStepParams(_0x18636d[_0x10380b(0xc2)],_0x18636d[_0x10380b(0x141)])};return _0x3d1cd2;}function normalizeStepParams(_0x397bf2,_0x566636){const _0x4b4266=a147_0x5e72;switch(_0x397bf2){case _0x4b4266(0x133):{const _0x3d0cd2=_0x566636;let _0x4e5ca6;return _0x3d0cd2[_0x4b4266(0xce)]&&(_0x4e5ca6={'segment':_0x3d0cd2[_0x4b4266(0xce)][_0x4b4266(0x104)],..._0x3d0cd2[_0x4b4266(0xce)][_0x4b4266(0x155)]!==undefined&&{'next':_0x3d0cd2[_0x4b4266(0xce)][_0x4b4266(0x155)]},..._0x3d0cd2['condition'][_0x4b4266(0xe7)]&&{'timeout':{'duration':_0x3d0cd2['condition']['timeout']['duration'],'unit':_0x3d0cd2[_0x4b4266(0xce)][_0x4b4266(0xe7)][_0x4b4266(0xf8)],..._0x3d0cd2[_0x4b4266(0xce)]['timeout'][_0x4b4266(0x155)]!==undefined&&{'next':_0x3d0cd2[_0x4b4266(0xce)][_0x4b4266(0xe7)]['next']}}}}),{..._0x3d0cd2[_0x4b4266(0x160)]!==undefined&&{'duration':_0x3d0cd2['duration']},..._0x3d0cd2['unit']!==undefined&&{'unit':_0x3d0cd2[_0x4b4266(0xf8)]},..._0x3d0cd2['wait_until']!==undefined&&{'wait_until':_0x3d0cd2[_0x4b4266(0x158)]},..._0x3d0cd2[_0x4b4266(0x114)]!==undefined&&{'days_of_week':_0x3d0cd2[_0x4b4266(0x114)]},..._0x4e5ca6&&{'condition':_0x4e5ca6}};}case _0x4b4266(0x10c):{const _0x126ca0=_0x566636;return{'activation':_0x126ca0[_0x4b4266(0x10c)]};}case _0x4b4266(0xdc):{const _0x1a3187=_0x566636;return{'branches':_0x1a3187[_0x4b4266(0xde)][_0x4b4266(0xd6)](normalizeDecisionBranch)};}case _0x4b4266(0x177):{const _0x44ff59=_0x566636;return{..._0x44ff59['customized_split']!==undefined&&{'customized_split':_0x44ff59['customized_split']},..._0x44ff59[_0x4b4266(0x129)]!==undefined&&{'unique_id':_0x44ff59['unique_id']},'variants':_0x44ff59['variants'][_0x4b4266(0xd6)](normalizeAbTestVariant)};}case _0x4b4266(0x143):{const _0x3d0d20=_0x566636;return{'target':normalizeJumpTarget(_0x3d0d20['target'])};}default:return _0x566636;}}function normalizeDecisionBranch(_0x59f26c){const _0x2e27c0=a147_0x5e72;return{'name':_0x59f26c[_0x2e27c0(0x13c)],..._0x59f26c[_0x2e27c0(0x104)]!==undefined&&{'segment':_0x59f26c[_0x2e27c0(0x104)]},..._0x59f26c['excluded']!==undefined&&{'excluded':_0x59f26c[_0x2e27c0(0xb8)]},..._0x59f26c[_0x2e27c0(0x155)]!==undefined&&{'next':_0x59f26c[_0x2e27c0(0x155)]}};}function normalizeAbTestVariant(_0x445738){const _0x3ee64a=a147_0x5e72;return{..._0x445738['id']!==undefined&&{'id':_0x445738['id']},'name':_0x445738['name'],'percentage':_0x445738[_0x3ee64a(0xd3)],..._0x445738[_0x3ee64a(0x155)]!==undefined&&{'next':_0x445738[_0x3ee64a(0x155)]}};}function normalizeJumpTarget(_0x153ba0){const _0x348d31=a147_0x5e72;return{'journey':_0x153ba0[_0x348d31(0x144)],'stage':_0x153ba0[_0x348d31(0xdd)],..._0x153ba0['bundle_id']!==undefined&&{'bundle_id':_0x153ba0[_0x348d31(0xd7)]}};}function normalizeEmbeddedSegments(_0x76b95e,_0x42fa47){const _0x16bf7a=a147_0x5e72,_0x47dd50={},_0xd1e3c=Object[_0x16bf7a(0xe8)](_0x76b95e),_0x330663=_0x42fa47?[..._0x42fa47[_0x16bf7a(0x13a)](_0x3d8c7b=>_0xd1e3c[_0x16bf7a(0x14f)](_0x3d8c7b)),..._0xd1e3c['filter'](_0x30d6b8=>!_0x42fa47[_0x16bf7a(0x14f)](_0x30d6b8))[_0x16bf7a(0xf9)]()]:_0xd1e3c[_0x16bf7a(0xf9)]();for(const _0x1fd998 of _0x330663){const _0x37105b=_0x76b95e[_0x1fd998];if(_0x37105b[_0x16bf7a(0x14d)]){const _0x219408=_0x37105b[_0x16bf7a(0x14d)];if(_0x219408[_0x16bf7a(0xc2)]!==_0x16bf7a(0x12c)&&_0x219408[_0x16bf7a(0xc2)]!=='Or'){const _0x1297d9=_0x219408[_0x16bf7a(0xc2)]??_0x16bf7a(0xeb);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x1fd998+_0x16bf7a(0x15d)+(_0x16bf7a(0x148)+_0x1297d9+_0x16bf7a(0x152))+'Expected\x20format:\x0a'+_0x16bf7a(0x101)+_0x16bf7a(0x105)+_0x16bf7a(0x15a)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x16bf7a(0xd1)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x219408[_0x16bf7a(0x121)]||!Array[_0x16bf7a(0x147)](_0x219408['conditions']))throw new SDKError(ErrorCode[_0x16bf7a(0x15e)],_0x16bf7a(0x16a)+_0x1fd998+_0x16bf7a(0x15d)+_0x16bf7a(0xf6)+_0x16bf7a(0xc9)+_0x16bf7a(0x101)+(_0x16bf7a(0x117)+_0x219408[_0x16bf7a(0xc2)]+'\x0a')+_0x16bf7a(0x15a)+_0x16bf7a(0xd9)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x16bf7a(0x108));}_0x47dd50[_0x1fd998]={..._0x37105b['description']&&_0x37105b['description'][_0x16bf7a(0xc8)]()&&{'description':_0x37105b['description']},..._0x37105b[_0x16bf7a(0x14d)]&&{'rule':deepSortObject(_0x37105b[_0x16bf7a(0x14d)])}};}return _0x47dd50;}function normalizeEmbeddedActivations(_0x4ea5b8,_0x403b5f){const _0x48daa6=a147_0x5e72,_0x2b2004={},_0x29d3f6=Object['keys'](_0x4ea5b8),_0x186697=_0x403b5f?[..._0x403b5f[_0x48daa6(0x13a)](_0x1d7cac=>_0x29d3f6[_0x48daa6(0x14f)](_0x1d7cac)),..._0x29d3f6['filter'](_0x4457b3=>!_0x403b5f[_0x48daa6(0x14f)](_0x4457b3))[_0x48daa6(0xf9)]()]:_0x29d3f6[_0x48daa6(0xf9)]();for(const _0x1c924e of _0x186697){const _0x52c25c=_0x4ea5b8[_0x1c924e];_0x2b2004[_0x1c924e]={'name':_0x52c25c[_0x48daa6(0x13c)],'connection':_0x52c25c[_0x48daa6(0x164)],..._0x52c25c['description']!==undefined&&{'description':_0x52c25c[_0x48daa6(0x106)]},..._0x52c25c['all_columns']!==undefined&&{'all_columns':_0x52c25c[_0x48daa6(0xbd)]},..._0x52c25c[_0x48daa6(0x170)]!==undefined&&{'columns':_0x52c25c[_0x48daa6(0x170)]},..._0x52c25c[_0x48daa6(0x16f)]!==undefined&&{'behavior':_0x52c25c[_0x48daa6(0x16f)]},..._0x52c25c[_0x48daa6(0x118)]!==undefined&&{'schedule':_0x52c25c[_0x48daa6(0x118)]},..._0x52c25c[_0x48daa6(0xc4)]!==undefined&&{'notification':_0x52c25c[_0x48daa6(0xc4)]},..._0x52c25c[_0x48daa6(0x138)]!==undefined&&{'connector_config':_0x52c25c[_0x48daa6(0x138)]},..._0x52c25c[_0x48daa6(0x171)]!==undefined&&{'activation_template_id':_0x52c25c['activation_template_id']}};}return _0x2b2004;}export function getActiveStages(_0x50a5da){const _0x309f37=a147_0x5e72;if(isJourneysArrayMode(_0x50a5da)){const _0x2d2fdf=_0x50a5da[_0x309f37(0x130)]||[],_0xd9ec84=_0x2d2fdf[_0x309f37(0xfb)](_0x1e2d84=>_0x1e2d84[_0x309f37(0x157)]===!![])||_0x2d2fdf[0x0];return _0xd9ec84?.[_0x309f37(0x12f)]||[];}if(isSingleVersionMode(_0x50a5da))return _0x50a5da[_0x309f37(0x12f)]||[];if(isMultiVersionMode(_0x50a5da)){const _0x635766=_0x50a5da[_0x309f37(0x10e)]||[],_0x40402b=_0x635766[_0x309f37(0xfb)](_0x536c21=>_0x536c21['latest']===!![])||_0x635766[0x0];return _0x40402b?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x193240){const _0x3989e=a147_0x5e72;if(isJourneysArrayMode(_0x193240)){const _0x43c187=_0x193240['journeys']||[];return _0x43c187[_0x3989e(0xfb)](_0x242c5a=>_0x242c5a[_0x3989e(0x157)]===!![])||_0x43c187[0x0];}if(isMultiVersionMode(_0x193240)){const _0x4586fc=_0x193240[_0x3989e(0x10e)]||[],_0x151bac=_0x4586fc[_0x3989e(0xfb)](_0x46b87b=>_0x46b87b[_0x3989e(0x157)]===!![])||_0x4586fc[0x0];if(_0x151bac)return{'version':_0x151bac['name'],'state':_0x151bac['state'],'latest':_0x151bac[_0x3989e(0x157)],'stages':_0x151bac[_0x3989e(0x12f)],'id':_0x151bac['id'],'version_number':_0x151bac[_0x3989e(0x166)]};}if(isSingleVersionMode(_0x193240))return{'version':_0x193240[_0x3989e(0xfa)]||'v1','state':_0x3989e(0xd8),'stages':_0x193240[_0x3989e(0x12f)]||[],'id':_0x193240['id'],'version_number':_0x193240['version_number'],'goal':_0x193240['goal'],'reentry':_0x193240[_0x3989e(0xe0)]};return undefined;}function a147_0x5e72(_0xb6ca16,_0xc68b57){_0xb6ca16=_0xb6ca16-0xb7;const _0x5d7f3a=a147_0x5d7f();let _0x5e7226=_0x5d7f3a[_0xb6ca16];return _0x5e7226;}export function getLatestVersion(_0xaef8b0){const _0x5ab2b1=a147_0x5e72;if(!isMultiVersionMode(_0xaef8b0))return undefined;const _0x3dc18c=_0xaef8b0['versions']||[];return _0x3dc18c[_0x5ab2b1(0xfb)](_0x1ec872=>_0x1ec872[_0x5ab2b1(0x157)]===!![])||_0x3dc18c[0x0];}export function getEffectiveGoal(_0x19e909){const _0x38bf5f=a147_0x5e72,_0x5060d4=getLatestJourneyEntry(_0x19e909);return _0x5060d4?.[_0x38bf5f(0x13e)]||_0x19e909[_0x38bf5f(0x13e)];}export function getEffectiveReentry(_0x28de3a){const _0x1b86b5=a147_0x5e72,_0x48601a=getLatestJourneyEntry(_0x28de3a);return _0x48601a?.['reentry']||_0x28de3a[_0x1b86b5(0xe0)];}export function collectSegmentRefs(_0x3a6274){const _0x3ef5f0=a147_0x5e72,_0x77c11b=new Set();_0x3a6274['goal']?.[_0x3ef5f0(0x104)]&&_0x77c11b[_0x3ef5f0(0x167)](_0x3a6274['goal'][_0x3ef5f0(0x104)]);const _0x4b5230=_0x215580=>{const _0xc40b39=_0x3ef5f0;for(const _0x21d981 of _0x215580){_0x21d981[_0xc40b39(0xc1)]?.[_0xc40b39(0x104)]&&_0x77c11b['add'](_0x21d981[_0xc40b39(0xc1)]['segment']);if(_0x21d981['exit_criteria'])for(const _0x1e0891 of _0x21d981[_0xc40b39(0x140)]){_0x1e0891[_0xc40b39(0x104)]&&_0x77c11b[_0xc40b39(0x167)](_0x1e0891[_0xc40b39(0x104)]);}_0x21d981[_0xc40b39(0xe2)]?.['segment']&&_0x77c11b[_0xc40b39(0x167)](_0x21d981[_0xc40b39(0xe2)]['segment']);if(_0x21d981[_0xc40b39(0x174)])for(const _0x410693 of _0x21d981['steps']){if(_0x410693[_0xc40b39(0xc2)]==='decision_point'){const _0x28e358=_0x410693;for(const _0x6ecb2c of _0x28e358['with'][_0xc40b39(0xde)]){_0x6ecb2c['segment']&&_0x77c11b[_0xc40b39(0x167)](_0x6ecb2c[_0xc40b39(0x104)]);}}else{if(_0x410693[_0xc40b39(0xc2)]==='wait'){const _0x23b8ad=_0x410693;_0x23b8ad[_0xc40b39(0x141)]['condition']?.['segment']&&_0x77c11b[_0xc40b39(0x167)](_0x23b8ad[_0xc40b39(0x141)][_0xc40b39(0xce)]['segment']);}}}}};_0x3a6274[_0x3ef5f0(0x12f)]&&_0x4b5230(_0x3a6274[_0x3ef5f0(0x12f)]);if(_0x3a6274[_0x3ef5f0(0x10e)])for(const _0x3768dd of _0x3a6274[_0x3ef5f0(0x10e)]){_0x4b5230(_0x3768dd[_0x3ef5f0(0x12f)]);}return _0x77c11b;}export function validateSegmentRefs(_0x5c93f3){const _0x5166f8=a147_0x5e72,_0x158342=[],_0x3b1c8e=collectSegmentRefs(_0x5c93f3),_0x296b78=new Set(Object['keys'](_0x5c93f3[_0x5166f8(0x126)]||{}));for(const _0x1c951a of _0x3b1c8e){const _0x3a7e24=parseSegmentRef(_0x1c951a);_0x3a7e24[_0x5166f8(0xc2)]===_0x5166f8(0xd4)&&!_0x296b78[_0x5166f8(0x125)](_0x3a7e24[_0x5166f8(0x13c)])&&_0x158342['push'](_0x5166f8(0x132)+_0x3a7e24[_0x5166f8(0x13c)]+_0x5166f8(0x154)+_0x3a7e24[_0x5166f8(0x13c)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x158342;}export function collectSegmentIdsFromJourneyApi(_0x59699d){const _0xad8e4d=a147_0x5e72,_0x4464c6=new Set();_0x59699d[_0xad8e4d(0x12b)][_0xad8e4d(0x13e)]?.[_0xad8e4d(0x173)]&&_0x4464c6['add'](_0x59699d[_0xad8e4d(0x12b)]['goal'][_0xad8e4d(0x173)]);const _0x42aca5=_0x59699d['attributes'][_0xad8e4d(0x151)];if(Array[_0xad8e4d(0x147)](_0x42aca5))for(const _0x34c348 of _0x42aca5){_0x34c348[_0xad8e4d(0xcb)]?.[_0xad8e4d(0x173)]&&_0x4464c6['add'](_0x34c348[_0xad8e4d(0xcb)]['segmentId']);const _0x2a2799=_0x34c348[_0xad8e4d(0x15c)]??_0x34c348[_0xad8e4d(0x175)];if(Array['isArray'](_0x2a2799))for(const _0x568856 of _0x2a2799){_0x568856[_0xad8e4d(0x173)]&&_0x4464c6[_0xad8e4d(0x167)](_0x568856[_0xad8e4d(0x173)]);}_0x34c348[_0xad8e4d(0xe2)]?.[_0xad8e4d(0x173)]&&_0x4464c6[_0xad8e4d(0x167)](_0x34c348[_0xad8e4d(0xe2)][_0xad8e4d(0x173)]);if(_0x34c348[_0xad8e4d(0x174)]&&typeof _0x34c348[_0xad8e4d(0x174)]===_0xad8e4d(0x161)){const _0x21c031=Array[_0xad8e4d(0x147)](_0x34c348['steps'])?_0x34c348[_0xad8e4d(0x174)]:Object[_0xad8e4d(0xd2)](_0x34c348[_0xad8e4d(0x174)]);for(const _0x26d2f4 of _0x21c031){_0x26d2f4['waitCondition']?.[_0xad8e4d(0x173)]&&_0x4464c6[_0xad8e4d(0x167)](_0x26d2f4[_0xad8e4d(0x13f)][_0xad8e4d(0x173)]);const _0x537996=_0x26d2f4;_0x537996[_0xad8e4d(0x122)]&&_0x4464c6[_0xad8e4d(0x167)](_0x537996['conditionSegmentId']);if(Array['isArray'](_0x537996[_0xad8e4d(0x121)]))for(const _0x5e9842 of _0x537996['conditions']){_0x5e9842['segmentId']&&_0x4464c6[_0xad8e4d(0x167)](_0x5e9842['segmentId']);}if(Array[_0xad8e4d(0x147)](_0x26d2f4[_0xad8e4d(0xde)]))for(const _0x4cf84d of _0x26d2f4['branches']){_0x4cf84d['segmentId']&&_0x4464c6[_0xad8e4d(0x167)](_0x4cf84d[_0xad8e4d(0x173)]);}}}}return _0x4464c6;}
|
|
1
|
+
(function(_0x4c75a7,_0x3dad4f){const _0xf3a638=a147_0x4f0d,_0x1631be=_0x4c75a7();while(!![]){try{const _0x1d9b91=parseInt(_0xf3a638(0x287))/0x1*(parseInt(_0xf3a638(0x26b))/0x2)+-parseInt(_0xf3a638(0x216))/0x3+-parseInt(_0xf3a638(0x1ec))/0x4*(-parseInt(_0xf3a638(0x250))/0x5)+-parseInt(_0xf3a638(0x1f8))/0x6*(parseInt(_0xf3a638(0x1ff))/0x7)+-parseInt(_0xf3a638(0x1e7))/0x8+parseInt(_0xf3a638(0x23e))/0x9*(-parseInt(_0xf3a638(0x1e6))/0xa)+-parseInt(_0xf3a638(0x283))/0xb*(-parseInt(_0xf3a638(0x1eb))/0xc);if(_0x1d9b91===_0x3dad4f)break;else _0x1631be['push'](_0x1631be['shift']());}catch(_0x228aad){_0x1631be['push'](_0x1631be['shift']());}}}(a147_0x807e,0x79036));import*as a147_0x4ca752 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(_0x19b6f8){const _0xaf77df=a147_0x4f0d,_0x2bb74c=_0x19b6f8[_0xaf77df(0x24d)]();if(_0x2bb74c==='days'||_0x2bb74c===_0xaf77df(0x21a))return _0xaf77df(0x21a);if(_0x2bb74c===_0xaf77df(0x24c)||_0x2bb74c===_0xaf77df(0x23c))return _0xaf77df(0x23c);return _0x19b6f8;}export function journeyResponseToDefSync(_0x763ec2){const _0x2fcee9=a147_0x4f0d,_0x492f22=_0x763ec2['attributes'],_0x2daf7f=_0x492f22[_0x2fcee9(0x26f)]||_0x492f22[_0x2fcee9(0x28e)],_0x4481fb={'stages':_0x492f22[_0x2fcee9(0x25f)]['map'](convertApiStageToYaml),'id':_0x763ec2['id']};_0x492f22[_0x2fcee9(0x22f)]&&(_0x4481fb['goal']=convertApiCriteriaToYaml(_0x492f22[_0x2fcee9(0x22f)]));_0x492f22[_0x2fcee9(0x28e)]&&_0x492f22[_0x2fcee9(0x28e)]!==_0x2daf7f&&(_0x4481fb[_0x2fcee9(0x1f1)]=_0x492f22[_0x2fcee9(0x28e)]);_0x492f22[_0x2fcee9(0x1cc)]!==undefined&&(_0x4481fb[_0x2fcee9(0x1d2)]=_0x492f22[_0x2fcee9(0x1cc)]);_0x492f22[_0x2fcee9(0x1fe)]&&(_0x4481fb[_0x2fcee9(0x1fe)]=_0x492f22['state']===_0x2fcee9(0x1f3)?_0x2fcee9(0x1f3):'draft');const _0x4521a2={'type':_0x2fcee9(0x23f),'name':_0x2daf7f,'journeys':[_0x4481fb]};_0x492f22[_0x2fcee9(0x24b)]&&(_0x4521a2[_0x2fcee9(0x24b)]=_0x492f22[_0x2fcee9(0x24b)]);_0x492f22[_0x2fcee9(0x22f)]&&(_0x4521a2['goal']=convertApiCriteriaToYaml(_0x492f22[_0x2fcee9(0x22f)]));if(_0x492f22[_0x2fcee9(0x229)])_0x4521a2[_0x2fcee9(0x21e)]=_0x492f22['reentryMode'];else _0x492f22[_0x2fcee9(0x201)]!==undefined&&(_0x4521a2['reentry']=_0x492f22[_0x2fcee9(0x201)]?_0x2fcee9(0x20a):_0x2fcee9(0x26a));return _0x492f22[_0x2fcee9(0x1e5)]&&(_0x4521a2['bundle_id']=_0x492f22[_0x2fcee9(0x1e5)]),_0x492f22['journeyBundleName']&&(_0x4521a2[_0x2fcee9(0x1d3)]=_0x492f22['journeyBundleName']),_0x763ec2[_0x2fcee9(0x1ed)]?.[_0x2fcee9(0x204)]?.[_0x2fcee9(0x226)]?.['id']&&(_0x4521a2[_0x2fcee9(0x225)]=_0x763ec2[_0x2fcee9(0x1ed)][_0x2fcee9(0x204)]['data']['id']),_0x4521a2;}export async function journeyResponseToDef(_0x11d680,_0x476b6a){const _0x3dd291=a147_0x4f0d,_0x120203=journeyResponseToDefSync(_0x11d680);if(!_0x476b6a)return _0x120203;const _0x5382bd=new Set();collectSegmentIdsFromJourney(_0x120203,_0x5382bd);const _0x24cc14=new Set();collectActivationIdsFromJourney(_0x120203,_0x24cc14);const _0x24e050={},_0x42a8f2=new Map();for(const _0x854198 of Array['from'](_0x5382bd)[_0x3dd291(0x1de)]()){if(_0x476b6a[_0x3dd291(0x21f)]){const _0x38e8e3=await _0x476b6a['resolveSegment'](_0x854198);if(_0x38e8e3['isJourneyLocal']){_0x42a8f2[_0x3dd291(0x24e)](_0x854198,_0x38e8e3['name']);if(_0x38e8e3[_0x3dd291(0x234)]){const _0x113a80={..._0x38e8e3[_0x3dd291(0x234)],'rule':deepSortObject(_0x38e8e3[_0x3dd291(0x234)]['rule'])};_0x24e050[_0x38e8e3['name']]=_0x113a80;}}else _0x42a8f2['set'](_0x854198,makeSegmentRef(_0x38e8e3[_0x3dd291(0x28e)]));}else{if(_0x476b6a['resolveSegmentName']){const _0x37de94=await _0x476b6a[_0x3dd291(0x247)](_0x854198);_0x42a8f2[_0x3dd291(0x24e)](_0x854198,_0x37de94);}}}const _0x530402={},_0x2d31ac=new Map();for(const _0x352ae6 of Array[_0x3dd291(0x259)](_0x24cc14)[_0x3dd291(0x1de)]()){if(_0x476b6a[_0x3dd291(0x238)]){const _0x28c975=await _0x476b6a[_0x3dd291(0x238)](_0x352ae6);_0x28c975[_0x3dd291(0x260)]?(_0x2d31ac[_0x3dd291(0x24e)](_0x352ae6,_0x28c975[_0x3dd291(0x28e)]),_0x28c975['definition']&&(_0x530402[_0x28c975['name']]=_0x28c975[_0x3dd291(0x234)])):_0x2d31ac[_0x3dd291(0x24e)](_0x352ae6,makeSegmentRef(_0x28c975[_0x3dd291(0x28e)]));}else{if(_0x476b6a[_0x3dd291(0x1e4)]){const _0x52a758=await _0x476b6a[_0x3dd291(0x1e4)](_0x352ae6);_0x2d31ac['set'](_0x352ae6,_0x52a758);}}}_0x42a8f2[_0x3dd291(0x200)]>0x0&&replaceSegmentIdsInJourney(_0x120203,_0x42a8f2);_0x2d31ac['size']>0x0&&replaceActivationIdsInJourney(_0x120203,_0x2d31ac);if(_0x476b6a[_0x3dd291(0x1d1)]){const _0x4fe1a4=[];collectJumpTargetsFromJourney(_0x120203,_0x4fe1a4);if(_0x4fe1a4[_0x3dd291(0x279)]>0x0){const _0x54284a=new Map();for(const _0x16c9d5 of _0x4fe1a4){try{const _0x5e69c8=await _0x476b6a[_0x3dd291(0x1d1)](_0x16c9d5[_0x3dd291(0x281)],_0x16c9d5[_0x3dd291(0x27a)]);_0x54284a[_0x3dd291(0x24e)](_0x16c9d5[_0x3dd291(0x281)]+':'+_0x16c9d5[_0x3dd291(0x27a)],_0x5e69c8);}catch{}}_0x54284a[_0x3dd291(0x200)]>0x0&&replaceJumpTargetsInJourney(_0x120203,_0x54284a);}}return Object[_0x3dd291(0x22e)](_0x24e050)[_0x3dd291(0x279)]>0x0&&(_0x120203[_0x3dd291(0x242)]=_0x24e050),Object['keys'](_0x530402)[_0x3dd291(0x279)]>0x0&&(_0x120203[_0x3dd291(0x206)]=_0x530402),_0x120203;}function collectSegmentIdsFromJourney(_0x2f9cf1,_0x1f140d){const _0x311045=a147_0x4f0d;_0x2f9cf1['goal']?.[_0x311045(0x282)]&&_0x1f140d[_0x311045(0x241)](_0x2f9cf1[_0x311045(0x22f)][_0x311045(0x282)]);const _0x5ab866=_0x544e9a=>{const _0x1c1acc=_0x311045;for(const _0x26e173 of _0x544e9a){_0x26e173['entry_criteria']?.[_0x1c1acc(0x282)]&&_0x1f140d[_0x1c1acc(0x241)](_0x26e173['entry_criteria'][_0x1c1acc(0x282)]);if(_0x26e173['exit_criteria'])for(const _0x241783 of _0x26e173[_0x1c1acc(0x1cd)]){_0x241783['segment']&&_0x1f140d[_0x1c1acc(0x241)](_0x241783[_0x1c1acc(0x282)]);}_0x26e173[_0x1c1acc(0x212)]?.[_0x1c1acc(0x282)]&&_0x1f140d[_0x1c1acc(0x241)](_0x26e173['milestone'][_0x1c1acc(0x282)]);if(_0x26e173['steps'])for(const _0x175308 of _0x26e173[_0x1c1acc(0x1e2)]){if(_0x175308[_0x1c1acc(0x1dd)]===_0x1c1acc(0x277)){const _0xac4879=_0x175308;for(const _0x3b0b8d of _0xac4879['with'][_0x1c1acc(0x276)]){_0x3b0b8d[_0x1c1acc(0x282)]&&_0x1f140d[_0x1c1acc(0x241)](_0x3b0b8d[_0x1c1acc(0x282)]);}}else{if(_0x175308['type']===_0x1c1acc(0x221)){const _0x35f9b2=_0x175308;_0x35f9b2['with'][_0x1c1acc(0x1df)]?.['segment']&&_0x1f140d[_0x1c1acc(0x241)](_0x35f9b2[_0x1c1acc(0x1ea)][_0x1c1acc(0x1df)][_0x1c1acc(0x282)]);}}}}};if(_0x2f9cf1['journeys'])for(const _0x5d2508 of _0x2f9cf1[_0x311045(0x28d)]){_0x5d2508[_0x311045(0x22f)]?.[_0x311045(0x282)]&&_0x1f140d[_0x311045(0x241)](_0x5d2508[_0x311045(0x22f)]['segment']),_0x5ab866(_0x5d2508[_0x311045(0x23d)]);}_0x2f9cf1['stages']&&_0x5ab866(_0x2f9cf1[_0x311045(0x23d)]);if(_0x2f9cf1[_0x311045(0x222)])for(const _0x1f2eef of _0x2f9cf1[_0x311045(0x222)]){_0x5ab866(_0x1f2eef[_0x311045(0x23d)]);}}function replaceSegmentIdsInJourney(_0x594cff,_0x437c2c){const _0x420684=a147_0x4f0d,_0x41ccc6=_0x28d174=>_0x437c2c[_0x420684(0x20b)](_0x28d174)||_0x28d174;_0x594cff[_0x420684(0x22f)]?.['segment']&&(_0x594cff[_0x420684(0x22f)][_0x420684(0x282)]=_0x41ccc6(_0x594cff[_0x420684(0x22f)][_0x420684(0x282)]));const _0x563d88=_0x45d5ac=>{const _0x3a10cf=_0x420684;for(const _0x516819 of _0x45d5ac){_0x516819[_0x3a10cf(0x1f9)]?.['segment']&&(_0x516819[_0x3a10cf(0x1f9)][_0x3a10cf(0x282)]=_0x41ccc6(_0x516819['entry_criteria'][_0x3a10cf(0x282)]));if(_0x516819['exit_criteria'])for(const _0x29d46b of _0x516819[_0x3a10cf(0x1cd)]){_0x29d46b['segment']&&(_0x29d46b[_0x3a10cf(0x282)]=_0x41ccc6(_0x29d46b[_0x3a10cf(0x282)]));}_0x516819['milestone']?.[_0x3a10cf(0x282)]&&(_0x516819[_0x3a10cf(0x212)][_0x3a10cf(0x282)]=_0x41ccc6(_0x516819[_0x3a10cf(0x212)][_0x3a10cf(0x282)]));if(_0x516819['steps'])for(const _0x7d7351 of _0x516819[_0x3a10cf(0x1e2)]){if(_0x7d7351[_0x3a10cf(0x1dd)]==='decision_point'){const _0x50cbba=_0x7d7351;for(const _0xc9ca5d of _0x50cbba[_0x3a10cf(0x1ea)][_0x3a10cf(0x276)]){_0xc9ca5d[_0x3a10cf(0x282)]&&(_0xc9ca5d['segment']=_0x41ccc6(_0xc9ca5d['segment']));}}else{if(_0x7d7351[_0x3a10cf(0x1dd)]===_0x3a10cf(0x221)){const _0x183bee=_0x7d7351;_0x183bee[_0x3a10cf(0x1ea)]['condition']?.['segment']&&(_0x183bee[_0x3a10cf(0x1ea)][_0x3a10cf(0x1df)]['segment']=_0x41ccc6(_0x183bee[_0x3a10cf(0x1ea)][_0x3a10cf(0x1df)]['segment']));}}}}};if(_0x594cff[_0x420684(0x28d)])for(const _0x1e9eac of _0x594cff[_0x420684(0x28d)]){_0x1e9eac[_0x420684(0x22f)]?.[_0x420684(0x282)]&&(_0x1e9eac[_0x420684(0x22f)][_0x420684(0x282)]=_0x41ccc6(_0x1e9eac['goal'][_0x420684(0x282)])),_0x563d88(_0x1e9eac[_0x420684(0x23d)]);}_0x594cff[_0x420684(0x23d)]&&_0x563d88(_0x594cff[_0x420684(0x23d)]);if(_0x594cff['versions'])for(const _0x3535a8 of _0x594cff[_0x420684(0x222)]){_0x563d88(_0x3535a8['stages']);}}function collectActivationIdsFromJourney(_0xcc7bb1,_0x3055a8){const _0x56ac94=a147_0x4f0d,_0x1338c3=_0x34f5e4=>{const _0xdb1ae7=a147_0x4f0d;for(const _0x3b964e of _0x34f5e4){if(_0x3b964e['steps'])for(const _0x6b8ab5 of _0x3b964e[_0xdb1ae7(0x1e2)]){if(_0x6b8ab5['type']==='activation'){const _0x175c45=_0x6b8ab5;_0x175c45[_0xdb1ae7(0x1ea)]['activation']&&/^\d+$/[_0xdb1ae7(0x220)](_0x175c45['with'][_0xdb1ae7(0x25b)])&&_0x3055a8['add'](_0x175c45[_0xdb1ae7(0x1ea)][_0xdb1ae7(0x25b)]);}}}};if(_0xcc7bb1['journeys'])for(const _0x4db30d of _0xcc7bb1[_0x56ac94(0x28d)]){_0x1338c3(_0x4db30d['stages']);}_0xcc7bb1[_0x56ac94(0x23d)]&&_0x1338c3(_0xcc7bb1[_0x56ac94(0x23d)]);if(_0xcc7bb1['versions'])for(const _0x43fccb of _0xcc7bb1['versions']){_0x1338c3(_0x43fccb[_0x56ac94(0x23d)]);}}function replaceActivationIdsInJourney(_0x3f2508,_0x47ba35){const _0x2b1da5=a147_0x4f0d,_0xe52c44=_0x6ee406=>_0x47ba35[_0x2b1da5(0x20b)](_0x6ee406)||_0x6ee406,_0x51ff55=_0x480432=>{const _0x54fd67=_0x2b1da5;for(const _0x56e00b of _0x480432){if(_0x56e00b[_0x54fd67(0x1e2)])for(const _0x1918d6 of _0x56e00b[_0x54fd67(0x1e2)]){if(_0x1918d6['type']===_0x54fd67(0x25b)){const _0x3897c1=_0x1918d6;_0x3897c1['with'][_0x54fd67(0x25b)]&&(_0x3897c1[_0x54fd67(0x1ea)][_0x54fd67(0x25b)]=_0xe52c44(_0x3897c1[_0x54fd67(0x1ea)][_0x54fd67(0x25b)]));}}}};if(_0x3f2508[_0x2b1da5(0x28d)])for(const _0x1ad4d0 of _0x3f2508[_0x2b1da5(0x28d)]){_0x51ff55(_0x1ad4d0[_0x2b1da5(0x23d)]);}_0x3f2508[_0x2b1da5(0x23d)]&&_0x51ff55(_0x3f2508['stages']);if(_0x3f2508['versions'])for(const _0x3c79a2 of _0x3f2508[_0x2b1da5(0x222)]){_0x51ff55(_0x3c79a2[_0x2b1da5(0x23d)]);}}function collectJumpTargetsFromJourney(_0x428b03,_0x41981a){const _0x425f16=a147_0x4f0d,_0xc5e624=new Set(),_0x43d5ca=_0x3f91be=>{const _0x3957a0=a147_0x4f0d;for(const _0x497573 of _0x3f91be){if(_0x497573[_0x3957a0(0x1e2)])for(const _0x11f1ee of _0x497573[_0x3957a0(0x1e2)]){if(_0x11f1ee[_0x3957a0(0x1dd)]===_0x3957a0(0x1f5)){const _0x548a1e=_0x11f1ee,_0x4371c4=_0x548a1e[_0x3957a0(0x1ea)][_0x3957a0(0x273)];if(_0x4371c4['journey']&&_0x4371c4[_0x3957a0(0x20c)]&&/^\d+$/[_0x3957a0(0x220)](_0x4371c4['journey'])&&/^\d+$/[_0x3957a0(0x220)](_0x4371c4[_0x3957a0(0x20c)])){const _0x5729b6=_0x4371c4[_0x3957a0(0x23f)]+':'+_0x4371c4[_0x3957a0(0x20c)];!_0xc5e624[_0x3957a0(0x245)](_0x5729b6)&&(_0xc5e624[_0x3957a0(0x241)](_0x5729b6),_0x41981a[_0x3957a0(0x236)]({'journeyId':_0x4371c4[_0x3957a0(0x23f)],'stageId':_0x4371c4[_0x3957a0(0x20c)]}));}}}}};if(_0x428b03['journeys'])for(const _0x3a17fc of _0x428b03[_0x425f16(0x28d)]){_0x43d5ca(_0x3a17fc['stages']);}_0x428b03[_0x425f16(0x23d)]&&_0x43d5ca(_0x428b03[_0x425f16(0x23d)]);if(_0x428b03[_0x425f16(0x222)])for(const _0x26a9c1 of _0x428b03[_0x425f16(0x222)]){_0x43d5ca(_0x26a9c1['stages']);}}function replaceJumpTargetsInJourney(_0x3b6f0b,_0x27c80a){const _0x192765=a147_0x4f0d,_0x2817f8=_0x4fbba6=>{const _0x1b6cef=a147_0x4f0d;for(const _0x2be7c0 of _0x4fbba6){if(_0x2be7c0[_0x1b6cef(0x1e2)])for(const _0x57c99d of _0x2be7c0[_0x1b6cef(0x1e2)]){if(_0x57c99d[_0x1b6cef(0x1dd)]==='jump'){const _0x48d99e=_0x57c99d,_0x34ed4d=_0x48d99e[_0x1b6cef(0x1ea)][_0x1b6cef(0x273)],_0x1544b9=_0x34ed4d['journey']+':'+_0x34ed4d[_0x1b6cef(0x20c)],_0x55d4d3=_0x27c80a[_0x1b6cef(0x20b)](_0x1544b9);_0x55d4d3&&(_0x34ed4d['journey']=_0x55d4d3[_0x1b6cef(0x1e3)],_0x34ed4d[_0x1b6cef(0x20c)]=_0x55d4d3[_0x1b6cef(0x1fb)]);}}}};if(_0x3b6f0b[_0x192765(0x28d)])for(const _0x2afe47 of _0x3b6f0b[_0x192765(0x28d)]){_0x2817f8(_0x2afe47[_0x192765(0x23d)]);}_0x3b6f0b[_0x192765(0x23d)]&&_0x2817f8(_0x3b6f0b[_0x192765(0x23d)]);if(_0x3b6f0b['versions'])for(const _0x646527 of _0x3b6f0b[_0x192765(0x222)]){_0x2817f8(_0x646527[_0x192765(0x23d)]);}}function generateReadableStepName(_0x3961d6,_0x5a70f4){const _0x2b4e87=a147_0x4f0d;if(_0x3961d6[_0x2b4e87(0x28e)]&&_0x3961d6[_0x2b4e87(0x28e)]!==_0x3961d6['type']){const _0x18617c=_0x3961d6[_0x2b4e87(0x28e)]['trim']();if(_0x18617c&&/[a-z0-9\p{L}]/iu[_0x2b4e87(0x220)](_0x18617c))return _0x18617c;}const _0x3845af=_0x3961d6['type'][_0x2b4e87(0x24d)]()['replace'](/step$/i,'');return _0x3845af+'_'+(_0x5a70f4+0x1);}function getStepNextRefs(_0x1741e1){const _0x1456cf=a147_0x4f0d,_0x5bc26f=[];if(_0x1741e1[_0x1456cf(0x1d6)])_0x5bc26f['push'](_0x1741e1['next']);if(_0x1741e1[_0x1456cf(0x276)])for(const _0x22839a of _0x1741e1['branches']){if(_0x22839a[_0x1456cf(0x1d6)])_0x5bc26f[_0x1456cf(0x236)](_0x22839a[_0x1456cf(0x1d6)]);}if(_0x1741e1[_0x1456cf(0x1d7)])for(const _0x48d8bc of _0x1741e1[_0x1456cf(0x1d7)]){if(_0x48d8bc['next'])_0x5bc26f[_0x1456cf(0x236)](_0x48d8bc['next']);}if(_0x1741e1[_0x1456cf(0x1db)])for(const _0x30fd39 of _0x1741e1['conditions']){if(_0x30fd39[_0x1456cf(0x1d6)])_0x5bc26f['push'](_0x30fd39[_0x1456cf(0x1d6)]);}return _0x5bc26f;}function parseJumpTargetDisplayName(_0x22bfce){const _0x16bcbc=a147_0x4f0d,_0x496c56=_0x22bfce[_0x16bcbc(0x258)](/^(.+?)\s*\(([^/)]+)/);if(!_0x496c56)return undefined;const _0x1c59fc=_0x496c56[0x1][_0x16bcbc(0x28f)](),_0x5bf5dc=_0x496c56[0x2][_0x16bcbc(0x28f)]();if(!_0x1c59fc||!_0x5bf5dc)return undefined;return{'stageName':_0x1c59fc,'journeyName':_0x5bf5dc};}function orderStepsFromRoot(_0x1e7d58,_0x3bb8b6){const _0x1815cb=a147_0x4f0d,_0x6520a=Object[_0x1815cb(0x26d)](_0x1e7d58);if(_0x6520a['length']===0x0)return[];const _0x5bc92f=new Set(_0x6520a[_0x1815cb(0x1ef)](([_0xef4088])=>_0xef4088)),_0x3abdae=new Set();for(const [,_0x3a66d2]of _0x6520a){for(const _0x2c8446 of getStepNextRefs(_0x3a66d2)){if(_0x5bc92f[_0x1815cb(0x245)](_0x2c8446))_0x3abdae[_0x1815cb(0x241)](_0x2c8446);}}let _0x5b2fe8=_0x3bb8b6&&_0x5bc92f[_0x1815cb(0x245)](_0x3bb8b6)?_0x3bb8b6:undefined;if(!_0x5b2fe8){const _0x10a421=_0x6520a[_0x1815cb(0x213)](([_0x3e6a7b])=>!_0x3abdae[_0x1815cb(0x245)](_0x3e6a7b));_0x10a421[_0x1815cb(0x279)]>0x0?_0x5b2fe8=_0x10a421[0x0][0x0]:_0x5b2fe8=_0x6520a[0x0][0x0];}const _0xd93d79=[],_0x49543e=new Set(),_0x136a92=[_0x5b2fe8];while(_0x136a92['length']>0x0){const _0x10ba21=_0x136a92[_0x1815cb(0x286)]();if(_0x49543e[_0x1815cb(0x245)](_0x10ba21))continue;_0x49543e['add'](_0x10ba21);const _0x311c2e=_0x1e7d58[_0x10ba21];if(!_0x311c2e)continue;_0xd93d79[_0x1815cb(0x236)]({'uuid':_0x10ba21,'step':_0x311c2e});for(const _0x47c79f of getStepNextRefs(_0x311c2e)){_0x5bc92f['has'](_0x47c79f)&&!_0x49543e['has'](_0x47c79f)&&_0x136a92[_0x1815cb(0x236)](_0x47c79f);}}for(const [_0x2e562e,_0x30f13b]of _0x6520a){!_0x49543e[_0x1815cb(0x245)](_0x2e562e)&&_0xd93d79[_0x1815cb(0x236)]({'uuid':_0x2e562e,'step':_0x30f13b});}return _0xd93d79;}function resolveStepReferences(_0x17f0a9,_0x4c7c7d,_0x2512dc,_0x24d0ea){const _0x8a69e7=a147_0x4f0d;if(_0x17f0a9[_0x8a69e7(0x1dd)]!==_0x8a69e7(0x27b)){_0x17f0a9[_0x8a69e7(0x1d6)]&&_0x24d0ea[_0x8a69e7(0x245)](_0x17f0a9[_0x8a69e7(0x1d6)])&&(_0x17f0a9[_0x8a69e7(0x1d6)]=_0x24d0ea[_0x8a69e7(0x20b)](_0x17f0a9['next']));const _0x515df2=_0x4c7c7d+0x1;if(_0x515df2<_0x2512dc[_0x8a69e7(0x279)]){const _0x36bd71=_0x24d0ea['get'](_0x2512dc[_0x515df2][_0x8a69e7(0x24a)]);_0x17f0a9[_0x8a69e7(0x1d6)]===_0x36bd71&&delete _0x17f0a9['next'];}}if(_0x17f0a9['type']===_0x8a69e7(0x277))for(const _0x4562da of _0x17f0a9[_0x8a69e7(0x1ea)][_0x8a69e7(0x276)]){_0x4562da[_0x8a69e7(0x1d6)]&&_0x24d0ea[_0x8a69e7(0x245)](_0x4562da[_0x8a69e7(0x1d6)])&&(_0x4562da[_0x8a69e7(0x1d6)]=_0x24d0ea[_0x8a69e7(0x20b)](_0x4562da['next']));}if(_0x17f0a9['type']===_0x8a69e7(0x285))for(const _0x458c2b of _0x17f0a9['with'][_0x8a69e7(0x1d7)]){_0x458c2b['next']&&_0x24d0ea['has'](_0x458c2b[_0x8a69e7(0x1d6)])&&(_0x458c2b[_0x8a69e7(0x1d6)]=_0x24d0ea[_0x8a69e7(0x20b)](_0x458c2b[_0x8a69e7(0x1d6)]));}if(_0x17f0a9[_0x8a69e7(0x1dd)]===_0x8a69e7(0x221)&&_0x17f0a9['with'][_0x8a69e7(0x1df)]){const _0x2cc048=_0x17f0a9[_0x8a69e7(0x1ea)][_0x8a69e7(0x1df)];_0x2cc048[_0x8a69e7(0x1d6)]&&_0x24d0ea[_0x8a69e7(0x245)](_0x2cc048[_0x8a69e7(0x1d6)])&&(_0x2cc048[_0x8a69e7(0x1d6)]=_0x24d0ea['get'](_0x2cc048[_0x8a69e7(0x1d6)])),_0x2cc048['timeout']?.[_0x8a69e7(0x1d6)]&&_0x24d0ea['has'](_0x2cc048[_0x8a69e7(0x1f6)][_0x8a69e7(0x1d6)])&&(_0x2cc048['timeout'][_0x8a69e7(0x1d6)]=_0x24d0ea['get'](_0x2cc048[_0x8a69e7(0x1f6)][_0x8a69e7(0x1d6)]));}}function convertApiStageToYaml(_0x1d281e){const _0x3380a9=a147_0x4f0d,_0x480a94={'name':_0x1d281e['name']};_0x1d281e['id']&&(_0x480a94['id']=_0x1d281e['id']);_0x1d281e[_0x3380a9(0x24b)]&&(_0x480a94['description']=_0x1d281e['description']);_0x1d281e[_0x3380a9(0x278)]&&(_0x480a94['entry_criteria']=convertApiCriteriaToYaml(_0x1d281e['entryCriteria']));_0x1d281e[_0x3380a9(0x1d8)]&&_0x1d281e['exitCriterias']['length']>0x0&&(_0x480a94['exit_criteria']=_0x1d281e[_0x3380a9(0x1d8)][_0x3380a9(0x1ef)](convertApiCriteriaToYaml));_0x1d281e['milestone']&&(_0x480a94[_0x3380a9(0x212)]=convertApiCriteriaToYaml(_0x1d281e[_0x3380a9(0x212)]));if(_0x1d281e['steps']&&Object[_0x3380a9(0x22e)](_0x1d281e[_0x3380a9(0x1e2)])[_0x3380a9(0x279)]>0x0){const _0x48802c=orderStepsFromRoot(_0x1d281e[_0x3380a9(0x1e2)],_0x1d281e['rootStep']),_0x14e144=new Map(),_0xf3e3d9=new Set();for(let _0x39031d=0x0;_0x39031d<_0x48802c[_0x3380a9(0x279)];_0x39031d++){const {uuid:_0x2678a8,step:_0x4afc9e}=_0x48802c[_0x39031d];let _0x312010=generateReadableStepName(_0x4afc9e,_0x39031d),_0x4b08a2=_0x312010,_0x230606=0x2;while(_0xf3e3d9['has'](_0x4b08a2)){_0x4b08a2=_0x312010+'_'+_0x230606,_0x230606++;}_0xf3e3d9['add'](_0x4b08a2),_0x14e144[_0x3380a9(0x24e)](_0x2678a8,_0x4b08a2);}_0x480a94[_0x3380a9(0x1e2)]=_0x48802c['map'](({uuid:_0x22e2c4,step:_0x3c1581},_0x385391)=>{const _0x1863ad=convertApiStepToYaml(_0x3c1581,_0x14e144['get'](_0x22e2c4));return resolveStepReferences(_0x1863ad,_0x385391,_0x48802c,_0x14e144),_0x1863ad;});}return _0x480a94;}function convertApiCriteriaToYaml(_0x38b311){const _0x647d09=a147_0x4f0d,_0x87cd67={'name':_0x38b311[_0x647d09(0x28e)],'segment':_0x38b311[_0x647d09(0x215)]};_0x38b311[_0x647d09(0x24b)]&&(_0x87cd67[_0x647d09(0x24b)]=_0x38b311[_0x647d09(0x24b)]);if(_0x38b311[_0x647d09(0x273)]){let _0x26b1df=_0x38b311[_0x647d09(0x273)][_0x647d09(0x281)],_0x19e5d9=_0x38b311['target'][_0x647d09(0x25e)];if(_0x38b311[_0x647d09(0x273)][_0x647d09(0x1e3)]){const _0x45ac1e=parseJumpTargetDisplayName(_0x38b311[_0x647d09(0x273)][_0x647d09(0x1e3)]);_0x45ac1e&&(_0x19e5d9=_0x45ac1e['stageName'],_0x26b1df=_0x45ac1e[_0x647d09(0x1e3)]);}_0x87cd67[_0x647d09(0x273)]={'journey':_0x26b1df,'stage':_0x19e5d9},_0x38b311[_0x647d09(0x273)][_0x647d09(0x1e5)]&&(_0x87cd67[_0x647d09(0x273)][_0x647d09(0x248)]=_0x38b311[_0x647d09(0x273)][_0x647d09(0x1e5)]);}return _0x87cd67;}function convertApiStepToYaml(_0x3d0405,_0x92e048){const _0x2108d7=a147_0x4f0d;switch(_0x3d0405[_0x2108d7(0x1dd)]){case _0x2108d7(0x25a):{const _0x4f837c={};if(_0x3d0405[_0x2108d7(0x246)]===_0x2108d7(0x22c)&&_0x3d0405[_0x2108d7(0x202)]!==undefined)_0x4f837c[_0x2108d7(0x1ce)]=_0x3d0405['waitStep'],_0x4f837c[_0x2108d7(0x21b)]=_0x3d0405[_0x2108d7(0x27f)];else{if(_0x3d0405[_0x2108d7(0x246)]===_0x2108d7(0x267)&&_0x3d0405[_0x2108d7(0x207)])_0x4f837c[_0x2108d7(0x1e8)]=_0x3d0405[_0x2108d7(0x207)];else{if(_0x3d0405[_0x2108d7(0x246)]===_0x2108d7(0x22b)&&_0x3d0405[_0x2108d7(0x1d9)])_0x4f837c['days_of_week']=_0x3d0405['daysOfWeek'];else{if(_0x3d0405[_0x2108d7(0x246)]===_0x2108d7(0x231)){if(_0x3d0405[_0x2108d7(0x1db)]&&_0x3d0405[_0x2108d7(0x1db)][_0x2108d7(0x279)]>0x0){const _0x2ea1d5=_0x3d0405[_0x2108d7(0x1db)]['find'](_0x1800a5=>!_0x1800a5[_0x2108d7(0x1f2)]),_0x408601=_0x3d0405['conditions'][_0x2108d7(0x24f)](_0xd27984=>_0xd27984[_0x2108d7(0x1f2)]);_0x2ea1d5?.['segmentId']&&(_0x4f837c[_0x2108d7(0x1df)]={'segment':_0x2ea1d5[_0x2108d7(0x215)],..._0x2ea1d5['next']?{'next':_0x2ea1d5[_0x2108d7(0x1d6)]}:{}},_0x408601&&_0x408601[_0x2108d7(0x22a)]!==undefined&&_0x408601['unit']&&(_0x4f837c['condition'][_0x2108d7(0x1f6)]={'duration':_0x408601[_0x2108d7(0x22a)],'unit':_0x408601[_0x2108d7(0x21b)],..._0x408601[_0x2108d7(0x1d6)]?{'next':_0x408601['next']}:{}}));}else _0x3d0405[_0x2108d7(0x25c)]&&(_0x4f837c[_0x2108d7(0x1df)]={'segment':_0x3d0405[_0x2108d7(0x25c)]},_0x3d0405['conditionTimeoutDuration']!==undefined&&_0x3d0405[_0x2108d7(0x1fd)]&&(_0x4f837c[_0x2108d7(0x1df)][_0x2108d7(0x1f6)]={'duration':_0x3d0405[_0x2108d7(0x256)],'unit':_0x3d0405[_0x2108d7(0x1fd)]}));}}}}const _0x544a06={'type':_0x2108d7(0x221),'name':_0x92e048,..._0x3d0405[_0x2108d7(0x1d6)]?{'next':_0x3d0405[_0x2108d7(0x1d6)]}:{},'with':_0x4f837c};return _0x544a06;}case'Activation':{const _0x3df801={'type':_0x2108d7(0x25b),'name':_0x92e048,..._0x3d0405[_0x2108d7(0x1d6)]?{'next':_0x3d0405[_0x2108d7(0x1d6)]}:{},'with':{'activation':_0x3d0405[_0x2108d7(0x1e1)]||''}};return _0x3df801;}case _0x2108d7(0x214):{const _0x424707={'type':_0x2108d7(0x277),'name':_0x92e048,..._0x3d0405[_0x2108d7(0x1d6)]?{'next':_0x3d0405[_0x2108d7(0x1d6)]}:{},'with':{'branches':(_0x3d0405[_0x2108d7(0x276)]||[])['map'](_0x430b42=>({'name':_0x430b42[_0x2108d7(0x28e)],'segment':_0x430b42['segmentId'],'excluded':_0x430b42['excludedPath'],..._0x430b42['next']?{'next':_0x430b42[_0x2108d7(0x1d6)]}:{}}))}};return _0x424707;}case _0x2108d7(0x264):case _0x2108d7(0x208):case _0x2108d7(0x1fa):{const _0x45f041=_0x3d0405[_0x2108d7(0x1d7)]||(_0x3d0405[_0x2108d7(0x276)]||[])['map'](_0x26e632=>({'name':_0x26e632[_0x2108d7(0x28e)],'percentage':0x0,'next':_0x26e632[_0x2108d7(0x1d6)]})),_0x554c92={'type':_0x2108d7(0x285),'name':_0x92e048,..._0x3d0405['next']?{'next':_0x3d0405[_0x2108d7(0x1d6)]}:{},'with':{'customized_split':_0x3d0405[_0x2108d7(0x254)],'unique_id':_0x3d0405['uniqueId'],'variants':_0x45f041[_0x2108d7(0x1ef)](_0x89c267=>({'name':_0x89c267[_0x2108d7(0x28e)],'percentage':_0x89c267[_0x2108d7(0x20f)],..._0x89c267[_0x2108d7(0x1d6)]?{'next':_0x89c267['next']}:{}}))}};return _0x554c92;}case'Merge':{const _0xe0bae8={'type':_0x2108d7(0x224),'name':_0x92e048,..._0x3d0405[_0x2108d7(0x1d6)]?{'next':_0x3d0405[_0x2108d7(0x1d6)]}:{}};return _0xe0bae8;}case _0x2108d7(0x257):{let _0x425a4b='',_0x572bd7='',_0x110d9a;if(_0x3d0405['target']){_0x425a4b=_0x3d0405[_0x2108d7(0x273)][_0x2108d7(0x281)],_0x572bd7=_0x3d0405['target'][_0x2108d7(0x25e)],_0x110d9a=_0x3d0405[_0x2108d7(0x273)][_0x2108d7(0x1e5)];if(_0x3d0405['target'][_0x2108d7(0x1e3)]){const _0x401a14=parseJumpTargetDisplayName(_0x3d0405[_0x2108d7(0x273)][_0x2108d7(0x1e3)]);_0x401a14&&(_0x572bd7=_0x401a14[_0x2108d7(0x1fb)],_0x425a4b=_0x401a14[_0x2108d7(0x1e3)]);}}const _0x353b3a={'type':_0x2108d7(0x1f5),'name':_0x92e048,..._0x3d0405[_0x2108d7(0x1d6)]?{'next':_0x3d0405[_0x2108d7(0x1d6)]}:{},'with':{'target':{'journey':_0x425a4b,'stage':_0x572bd7,..._0x110d9a?{'bundle_id':_0x110d9a}:{}}}};return _0x353b3a;}case _0x2108d7(0x275):{const _0x521b65={'type':'end','name':_0x92e048};return _0x521b65;}default:{const _0x20db69={'type':_0x2108d7(0x27b),'name':_0x92e048};return _0x20db69;}}}export async function journeyDefToRequest(_0x2c42b6,_0x41713b,_0x2d2479){const _0x2c2426=a147_0x4f0d,_0x52f50d=_0x2c42b6[_0x2c2426(0x23d)]||getActiveStages(_0x2c42b6),_0x578b54=isJourneysArrayMode(_0x2c42b6)||isMultiVersionMode(_0x2c42b6)?getLatestJourneyEntry(_0x2c42b6):undefined,_0x3718bc=_0x578b54?.[_0x2c2426(0x1f1)]??_0x2c42b6['name'],_0x13413e=_0x2c42b6[_0x2c2426(0x242)]||{},_0x263eed=_0x2c42b6[_0x2c2426(0x206)]||{},_0x2a497e={'type':'journey','attributes':{'name':_0x3718bc,'audienceId':_0x41713b,'journeyStages':await Promise[_0x2c2426(0x1d0)](_0x52f50d['map'](_0xa19245=>convertYamlStageToApi(_0xa19245,_0x2d2479,_0x13413e,_0x263eed)))}},_0x2d012a=_0x578b54?.['id']??_0x2c42b6['id'];_0x2d012a&&(_0x2a497e['id']=_0x2d012a);_0x2c42b6[_0x2c2426(0x24b)]&&(_0x2a497e[_0x2c2426(0x1f7)][_0x2c2426(0x24b)]=_0x2c42b6[_0x2c2426(0x24b)]);const _0x1eb045=getEffectiveGoal(_0x2c42b6);_0x1eb045&&(_0x2a497e['attributes'][_0x2c2426(0x22f)]=await convertYamlCriteriaToApi(_0x1eb045,_0x2d2479,_0x13413e));const _0x57be18=getEffectiveReentry(_0x2c42b6);return _0x57be18&&(_0x2a497e[_0x2c2426(0x1f7)][_0x2c2426(0x229)]=_0x57be18,_0x2a497e[_0x2c2426(0x1f7)][_0x2c2426(0x201)]=_0x57be18!=='no_reentry'),_0x2c42b6[_0x2c2426(0x225)]&&(_0x2a497e[_0x2c2426(0x1ed)]={'parentFolder':{'data':{'id':_0x2c42b6[_0x2c2426(0x225)],'type':_0x2c2426(0x1dc)}}}),_0x2a497e;}async function convertYamlStageToApi(_0x4099a2,_0x1be017,_0x173a0d={},_0x3c9394={}){const _0x4f719c=a147_0x4f0d,_0x4393af={'name':_0x4099a2['name']};_0x4099a2['id']&&(_0x4393af['id']=_0x4099a2['id']);_0x4099a2[_0x4f719c(0x24b)]&&(_0x4393af[_0x4f719c(0x24b)]=_0x4099a2[_0x4f719c(0x24b)]);_0x4099a2[_0x4f719c(0x1f9)]&&(_0x4393af[_0x4f719c(0x278)]=await convertYamlCriteriaToApi(_0x4099a2['entry_criteria'],_0x1be017,_0x173a0d));_0x4099a2[_0x4f719c(0x1cd)]&&_0x4099a2[_0x4f719c(0x1cd)][_0x4f719c(0x279)]>0x0&&(_0x4393af[_0x4f719c(0x1d8)]=await Promise[_0x4f719c(0x1d0)](_0x4099a2['exit_criteria'][_0x4f719c(0x1ef)](_0x2b5545=>convertYamlCriteriaToApi(_0x2b5545,_0x1be017,_0x173a0d))));_0x4099a2['milestone']&&(_0x4393af[_0x4f719c(0x212)]=await convertYamlCriteriaToApi(_0x4099a2[_0x4f719c(0x212)],_0x1be017,_0x173a0d));if(_0x4099a2[_0x4f719c(0x1e2)]&&_0x4099a2[_0x4f719c(0x1e2)][_0x4f719c(0x279)]>0x0){const _0x5ee228={},_0x58e253=_0x4099a2['steps'][_0x4f719c(0x1ef)]((_0x36b36b,_0x13ba05)=>{const _0x4ec3cc=_0x4f719c,_0x586d84=_0x36b36b[_0x4ec3cc(0x24a)]||generateUUID(),_0x2ff107=_0x36b36b[_0x4ec3cc(0x28e)]||_0x36b36b['type']+'_'+_0x13ba05;return _0x5ee228[_0x2ff107]=_0x586d84,{..._0x36b36b,'name':_0x2ff107};});_0x4393af[_0x4f719c(0x219)]=_0x5ee228[_0x58e253[0x0]['name']],_0x4393af[_0x4f719c(0x1e2)]={};for(let _0x552f22=0x0;_0x552f22<_0x58e253[_0x4f719c(0x279)];_0x552f22++){const _0xd9c532=_0x58e253[_0x552f22],_0x235e59=_0x5ee228[_0xd9c532[_0x4f719c(0x28e)]],_0x40084c=!_0xd9c532[_0x4f719c(0x1d6)]&&_0x552f22<_0x58e253[_0x4f719c(0x279)]-0x1&&_0xd9c532['type']!==_0x4f719c(0x27b)?_0x58e253[_0x552f22+0x1][_0x4f719c(0x28e)]:_0xd9c532[_0x4f719c(0x1d6)],_0x57c826=_0x40084c!==_0xd9c532[_0x4f719c(0x1d6)]?{..._0xd9c532,'next':_0x40084c}:_0xd9c532;_0x4393af[_0x4f719c(0x1e2)][_0x235e59]=await convertYamlStepToApi(_0x57c826,_0x1be017,_0x173a0d,_0x5ee228,_0x3c9394);}}else _0x4099a2[_0x4f719c(0x27e)]&&(_0x4393af['rootStep']=_0x4099a2[_0x4f719c(0x27e)]);return _0x4393af;}async function convertYamlCriteriaToApi(_0x113ea1,_0x3bf3e3,_0x4e8cca={}){const _0x1bfdbb=a147_0x4f0d;let _0x17e33c=_0x113ea1[_0x1bfdbb(0x282)];if(_0x17e33c&&!/^\d+$/[_0x1bfdbb(0x220)](_0x17e33c)){const _0x5097a2=parseSegmentRef(_0x17e33c);if(_0x5097a2['type']===_0x1bfdbb(0x25d))_0x3bf3e3?.['resolveSegmentId']&&(_0x17e33c=await _0x3bf3e3[_0x1bfdbb(0x20d)](_0x5097a2[_0x1bfdbb(0x28e)]));else{if(_0x5097a2[_0x1bfdbb(0x1dd)]===_0x1bfdbb(0x268)&&_0x4e8cca[_0x5097a2[_0x1bfdbb(0x28e)]])_0x3bf3e3?.[_0x1bfdbb(0x266)]&&(_0x17e33c=await _0x3bf3e3[_0x1bfdbb(0x266)](_0x5097a2['name'],_0x4e8cca[_0x5097a2[_0x1bfdbb(0x28e)]]));else _0x3bf3e3?.[_0x1bfdbb(0x20d)]&&(_0x17e33c=await _0x3bf3e3[_0x1bfdbb(0x20d)](_0x5097a2[_0x1bfdbb(0x28e)]));}}const _0x374b67={'name':_0x113ea1['name'],'segmentId':_0x17e33c};_0x113ea1[_0x1bfdbb(0x24b)]&&(_0x374b67[_0x1bfdbb(0x24b)]=_0x113ea1[_0x1bfdbb(0x24b)]);if(_0x113ea1[_0x1bfdbb(0x273)]){const _0x36677a=_0x113ea1[_0x1bfdbb(0x273)][_0x1bfdbb(0x23f)],_0x413a54=_0x113ea1[_0x1bfdbb(0x273)][_0x1bfdbb(0x20c)];let _0x281162=_0x113ea1['target'][_0x1bfdbb(0x23f)];_0x3bf3e3?.[_0x1bfdbb(0x1da)]&&!/^\d+$/[_0x1bfdbb(0x220)](_0x281162)&&(_0x281162=await _0x3bf3e3['resolveJourneyId'](_0x281162));let _0x50036c=_0x113ea1['target']['stage'];_0x3bf3e3?.['resolveStageId']&&!/^\d+$/['test'](_0x50036c)&&(_0x50036c=await _0x3bf3e3['resolveStageId'](_0x281162,_0x50036c));const _0x107179=!/^\d+$/[_0x1bfdbb(0x220)](_0x36677a)&&!isLocalJourneyRef(_0x36677a)?formatApiJourneyName(_0x36677a,_0x413a54):undefined;_0x374b67['target']={'journeyId':_0x281162,'journeyStageId':_0x50036c,'journeyName':_0x107179,'confirmed':!![]},_0x113ea1[_0x1bfdbb(0x273)][_0x1bfdbb(0x248)]&&(_0x374b67[_0x1bfdbb(0x273)][_0x1bfdbb(0x1e5)]=_0x113ea1['target'][_0x1bfdbb(0x248)]);}return _0x374b67;}async function convertYamlStepToApi(_0x1ff5b5,_0xd7dfb7,_0x253c70={},_0x1cce7e={},_0x3111ce={}){const _0x56b2d2=a147_0x4f0d,_0x49ce79=async _0x1e479a=>{const _0x126b40=a147_0x4f0d;if(/^\d+$/['test'](_0x1e479a))return _0x1e479a;const _0x20cfa1=parseSegmentRef(_0x1e479a);if(_0x20cfa1['type']===_0x126b40(0x25d)){if(_0xd7dfb7?.[_0x126b40(0x20d)])return await _0xd7dfb7[_0x126b40(0x20d)](_0x20cfa1[_0x126b40(0x28e)]);}else{if(_0x20cfa1['type']==='embedded'&&_0x253c70[_0x20cfa1[_0x126b40(0x28e)]]){if(_0xd7dfb7?.[_0x126b40(0x266)])return await _0xd7dfb7[_0x126b40(0x266)](_0x20cfa1['name'],_0x253c70[_0x20cfa1[_0x126b40(0x28e)]]);}else{if(_0xd7dfb7?.[_0x126b40(0x20d)])return await _0xd7dfb7[_0x126b40(0x20d)](_0x20cfa1['name']);}}return _0x1e479a;},_0x39ef74=async _0x5b768d=>{const _0x1b0198=a147_0x4f0d;if(/^\d+$/['test'](_0x5b768d))return _0x5b768d;const _0x2045db=parseSegmentRef(_0x5b768d);if(_0x2045db[_0x1b0198(0x1dd)]===_0x1b0198(0x25d)){if(_0xd7dfb7?.[_0x1b0198(0x23b)])return await _0xd7dfb7[_0x1b0198(0x23b)](_0x2045db[_0x1b0198(0x28e)]);return _0x2045db[_0x1b0198(0x28e)];}else{if(_0x2045db[_0x1b0198(0x1dd)]===_0x1b0198(0x268)&&_0x3111ce[_0x2045db['name']]){if(_0xd7dfb7?.[_0x1b0198(0x274)])return await _0xd7dfb7[_0x1b0198(0x274)](_0x2045db[_0x1b0198(0x28e)],_0x3111ce[_0x2045db[_0x1b0198(0x28e)]]);if(_0xd7dfb7?.[_0x1b0198(0x23b)])return await _0xd7dfb7['resolveActivationId'](_0x2045db[_0x1b0198(0x28e)]);}else{if(_0xd7dfb7?.[_0x1b0198(0x23b)])return await _0xd7dfb7[_0x1b0198(0x23b)](_0x2045db[_0x1b0198(0x28e)]);}}return _0x5b768d;},_0x3aff6b=_0x136390=>{if(!_0x136390)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x136390))return _0x136390;return _0x1cce7e[_0x136390]||_0x136390;};switch(_0x1ff5b5[_0x56b2d2(0x1dd)]){case _0x56b2d2(0x221):{const _0x1f5827=_0x1ff5b5,_0x108b5d=_0x1f5827[_0x56b2d2(0x1ea)],_0x3aa23d={'type':_0x56b2d2(0x25a),'name':_0x1f5827['name'],'next':_0x3aff6b(_0x1f5827[_0x56b2d2(0x1d6)])};if(_0x108b5d[_0x56b2d2(0x1ce)]!==undefined&&_0x108b5d[_0x56b2d2(0x21b)])_0x3aa23d[_0x56b2d2(0x246)]=_0x56b2d2(0x22c),_0x3aa23d[_0x56b2d2(0x202)]=_0x108b5d['duration'],_0x3aa23d[_0x56b2d2(0x27f)]=normalizeWaitUnit(_0x108b5d[_0x56b2d2(0x21b)]);else{if(_0x108b5d[_0x56b2d2(0x1e8)])_0x3aa23d[_0x56b2d2(0x246)]=_0x56b2d2(0x267),_0x3aa23d[_0x56b2d2(0x207)]=_0x108b5d[_0x56b2d2(0x1e8)];else{if(_0x108b5d['days_of_week'])_0x3aa23d['waitStepType']=_0x56b2d2(0x22b),_0x3aa23d['daysOfWeek']=_0x108b5d[_0x56b2d2(0x271)];else{if(_0x108b5d['condition']){_0x3aa23d[_0x56b2d2(0x246)]=_0x56b2d2(0x231);const _0x51b5d9=await _0x49ce79(_0x108b5d['condition'][_0x56b2d2(0x282)]),_0x1ed8c6=_0x108b5d['condition'][_0x56b2d2(0x1f6)]?.[_0x56b2d2(0x1d6)]!==undefined;if(_0x1ed8c6){const _0x1e01d0=[];_0x1e01d0['push']({'id':generateUUID(),'segmentId':_0x51b5d9,'timedOutPath':![],'name':_0x56b2d2(0x288),'next':_0x3aff6b(_0x108b5d[_0x56b2d2(0x1df)][_0x56b2d2(0x1d6)]??_0x1f5827[_0x56b2d2(0x1d6)])});if(_0x108b5d[_0x56b2d2(0x1df)]['timeout']){const _0xeb739d=_0x108b5d['condition'][_0x56b2d2(0x1f6)][_0x56b2d2(0x1ce)],_0x110201=normalizeWaitUnit(_0x108b5d['condition'][_0x56b2d2(0x1f6)][_0x56b2d2(0x21b)]);_0x1e01d0[_0x56b2d2(0x236)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x56b2d2(0x1d4)+_0xeb739d+'\x20'+_0x110201,'moveAfter':_0xeb739d,'unit':_0x110201,'next':_0x3aff6b(_0x108b5d[_0x56b2d2(0x1df)][_0x56b2d2(0x1f6)]['next'])});}_0x3aa23d[_0x56b2d2(0x1db)]=_0x1e01d0,delete _0x3aa23d[_0x56b2d2(0x1d6)];}else _0x3aa23d['conditionSegmentId']=_0x51b5d9,_0x108b5d['condition'][_0x56b2d2(0x1f6)]&&(_0x3aa23d[_0x56b2d2(0x256)]=_0x108b5d[_0x56b2d2(0x1df)]['timeout'][_0x56b2d2(0x1ce)],_0x108b5d[_0x56b2d2(0x1df)][_0x56b2d2(0x1f6)][_0x56b2d2(0x21b)]&&(_0x3aa23d['conditionTimeoutUnit']=normalizeWaitUnit(_0x108b5d[_0x56b2d2(0x1df)][_0x56b2d2(0x1f6)][_0x56b2d2(0x21b)])));}}}}return _0x3aa23d;}case _0x56b2d2(0x25b):{const _0xbe8f4c=_0x1ff5b5,_0x5de2ad=_0xbe8f4c[_0x56b2d2(0x1ea)][_0x56b2d2(0x25b)],_0x381236=await _0x39ef74(_0x5de2ad);return{'type':_0x56b2d2(0x1d5),'name':_0xbe8f4c[_0x56b2d2(0x28e)],'journeyActivationStepId':_0x381236,'next':_0x3aff6b(_0xbe8f4c[_0x56b2d2(0x1d6)])};}case _0x56b2d2(0x277):{const _0x395001=_0x1ff5b5,_0x3b8203=_0x395001['with']['branches'];return{'type':_0x56b2d2(0x214),'name':_0x395001[_0x56b2d2(0x28e)],'branches':await Promise['all'](_0x3b8203[_0x56b2d2(0x1ef)](async _0x5cbfac=>{const _0x483b12=_0x56b2d2;let _0x1bd5c0='';if(!_0x5cbfac['excluded']){const _0x12be30=_0x5cbfac['segment']||_0x5cbfac[_0x483b12(0x223)]||'';_0x1bd5c0=_0x12be30?await _0x49ce79(_0x12be30):'';}return{'id':crypto[_0x483b12(0x240)](),'name':_0x5cbfac[_0x483b12(0x28e)],'description':null,'segmentId':_0x1bd5c0,'excludedPath':_0x5cbfac['excluded']??![],'next':_0x3aff6b(_0x5cbfac['next'])};})),'next':_0x3aff6b(_0x395001[_0x56b2d2(0x1d6)])};}case _0x56b2d2(0x285):{const _0x27c722=_0x1ff5b5,_0x3ad8ef=_0x27c722[_0x56b2d2(0x1ea)];return{'type':_0x56b2d2(0x264),'name':_0x27c722[_0x56b2d2(0x28e)],'customizedSplit':_0x3ad8ef[_0x56b2d2(0x239)],'uniqueId':_0x3ad8ef[_0x56b2d2(0x1fc)],'variants':_0x3ad8ef['variants'][_0x56b2d2(0x1ef)](_0x279750=>({'id':_0x279750['id']||generateUUID(),'name':_0x279750['name'],'percentage':_0x279750['percentage'],'next':_0x3aff6b(_0x279750[_0x56b2d2(0x1d6)])})),'next':_0x3aff6b(_0x27c722['next'])};}case _0x56b2d2(0x224):return{'type':'Merge','name':_0x1ff5b5[_0x56b2d2(0x28e)],'next':_0x3aff6b(_0x1ff5b5[_0x56b2d2(0x1d6)])};case _0x56b2d2(0x1f5):{const _0x4662a8=_0x1ff5b5,_0x3b7133=_0x4662a8['with'][_0x56b2d2(0x273)],_0x1e07a7=_0x3b7133[_0x56b2d2(0x23f)],_0x186c77=_0x3b7133[_0x56b2d2(0x20c)];let _0x28fcda=_0x3b7133[_0x56b2d2(0x23f)];_0xd7dfb7?.[_0x56b2d2(0x1da)]&&!/^\d+$/[_0x56b2d2(0x220)](_0x28fcda)&&(_0x28fcda=await _0xd7dfb7[_0x56b2d2(0x1da)](_0x28fcda));let _0x56d070=_0x3b7133[_0x56b2d2(0x20c)];_0xd7dfb7?.[_0x56b2d2(0x210)]&&!/^\d+$/['test'](_0x56d070)&&(_0x56d070=await _0xd7dfb7[_0x56b2d2(0x210)](_0x28fcda,_0x56d070));const _0x2060ca=!/^\d+$/[_0x56b2d2(0x220)](_0x1e07a7)&&!isLocalJourneyRef(_0x1e07a7)?formatApiJourneyName(_0x1e07a7,_0x186c77):undefined;return{'type':_0x56b2d2(0x257),'name':_0x4662a8[_0x56b2d2(0x28e)],'target':{'journeyId':_0x28fcda,'journeyStageId':_0x56d070,'journeyBundleId':_0x3b7133[_0x56b2d2(0x248)],'journeyName':_0x2060ca,'confirmed':!![]},'next':_0x3aff6b(_0x4662a8[_0x56b2d2(0x1d6)])};}case'end':return{'type':_0x56b2d2(0x275),'name':_0x1ff5b5['name']};default:{const _0x137137=_0x1ff5b5;return{'type':_0x56b2d2(0x275),'name':_0x137137['name']};}}}export function toYamlString(_0x3b1216){const _0xcb1974=a147_0x4f0d,_0x200adf=stripInternalFields(_0x3b1216),_0x449f12=a147_0x4ca752['stringify'](_0x200adf,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xcb1974(0x262)}),_0x37bf5d=[_0xcb1974(0x205),_0xcb1974(0x1e0),_0xcb1974(0x249),_0xcb1974(0x1cf),_0xcb1974(0x1f0),_0xcb1974(0x217),'versions:'];let _0x4ea882=_0x449f12;for(const _0x35da20 of _0x37bf5d){_0x4ea882=_0x4ea882['replace'](new RegExp('^('+_0x35da20+')','m'),(_0x3db6e2,_0x4abb72,_0x1416d3)=>{if(_0x1416d3===0x0||_0x4ea882[_0x1416d3-0x1]==='\x0a'&&_0x4ea882[_0x1416d3-0x2]==='\x0a')return _0x4abb72;return'\x0a'+_0x4abb72;});}return _0x4ea882;}function stripInternalFields(_0x207220){const _0x537da7=a147_0x4f0d,{id:_0x21f89f,folder_id:_0x5b2917,bundle_id:_0x54efc4,bundle_name:_0x30db87,version:_0x29c0d9,allow_reentry:_0x2e2ee0,..._0x26b7f5}=_0x207220;return _0x26b7f5[_0x537da7(0x28d)]&&(_0x26b7f5[_0x537da7(0x28d)]=_0x26b7f5['journeys'][_0x537da7(0x1ef)](_0x458d02=>{const _0x57134d=_0x537da7,{id:_0x563184,..._0x337dde}=_0x458d02;return{..._0x337dde,'stages':_0x337dde[_0x57134d(0x23d)][_0x57134d(0x1ef)](stripStageInternalFields),..._0x458d02[_0x57134d(0x26c)]===!![]?{'latest':!![]}:{},..._0x26b7f5[_0x57134d(0x28d)][_0x57134d(0x279)]===0x1&&_0x337dde['version']==='v1'?{'version':undefined}:{}};})),_0x26b7f5[_0x537da7(0x23d)]&&(_0x26b7f5['stages']=_0x26b7f5[_0x537da7(0x23d)][_0x537da7(0x1ef)](stripStageInternalFields)),_0x26b7f5[_0x537da7(0x222)]&&(_0x26b7f5[_0x537da7(0x222)]=_0x26b7f5[_0x537da7(0x222)]['map'](_0x2ef4a5=>{const _0x2fe6cc=_0x537da7,{id:_0x34677a,..._0xb68d2e}=_0x2ef4a5;return{..._0xb68d2e,'stages':_0xb68d2e['stages']['map'](stripStageInternalFields),..._0x2ef4a5[_0x2fe6cc(0x26c)]===!![]?{'latest':!![]}:{}};})),_0x26b7f5;}function stripStageInternalFields(_0x1409e5){const {id:_0x24e499,..._0x25002f}=_0x1409e5;return _0x25002f;}export function parseYamlString(_0x2dedad){return safeParseYaml(_0x2dedad,JourneyDefSchema);}export function isJourneyDef(_0x40bef7){const _0x5ca3ba=a147_0x4f0d;return typeof _0x40bef7===_0x5ca3ba(0x284)&&_0x40bef7!==null&&_0x5ca3ba(0x1dd)in _0x40bef7&&_0x40bef7[_0x5ca3ba(0x1dd)]===_0x5ca3ba(0x23f);}export function generateTemplate(_0x5a0262,_0x5e7dfb){const _0x486693=a147_0x4f0d,_0x503511={'type':_0x486693(0x23f),'name':_0x5a0262,'description':_0x486693(0x28c),'reentry':_0x486693(0x26a),'goal':{'name':_0x486693(0x280),'segment':_0x486693(0x252)},'stages':[{'name':_0x486693(0x227),'description':_0x486693(0x22d),'entry_criteria':{'name':'Entry\x20Criteria','segment':_0x5e7dfb},'steps':[{'type':'wait','name':_0x486693(0x253),'with':{'duration':0x1,'unit':_0x486693(0x21a)}},{'type':'activation','name':'Send\x20Notification','with':{'activation':_0x486693(0x233)}},{'type':_0x486693(0x27b),'name':_0x486693(0x235)}]}]};return toYamlString(_0x503511);}function generateUUID(){const _0x526ae5=a147_0x4f0d;return crypto[_0x526ae5(0x240)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x305e85){const _0x46a6fd=a147_0x4f0d;if(_0x305e85[_0x46a6fd(0x251)](SEGMENT_REF_PREFIX))return{'type':_0x46a6fd(0x25d),'name':_0x305e85[_0x46a6fd(0x230)](SEGMENT_REF_PREFIX[_0x46a6fd(0x279)])};if(/^\d+$/['test'](_0x305e85))return{'type':'id','name':_0x305e85};return{'type':_0x46a6fd(0x268),'name':_0x305e85};}export function makeSegmentRef(_0x5c7c94){return''+SEGMENT_REF_PREFIX+_0x5c7c94;}export function isExternalSegmentRef(_0x232562){const _0x541596=a147_0x4f0d;return _0x232562[_0x541596(0x251)](SEGMENT_REF_PREFIX);}function a147_0x807e(){const _0x4fb200=['ABTest','(missing)','resolveEmbeddedSegmentId','Date','embedded','behavior','no_reentry','280EmxUCK','latest','entries','exitCriteria','journeyBundleName','notification','days_of_week','\x20\x20\x20\x20conditions:\x0a','target','resolveEmbeddedActivationId','End','branches','decision_point','entryCriteria','length','stageId','end','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','connection','root_step','waitStepUnit','Goal\x20Achieved','journeyId','segment','11XjzARh','object','ab_test','shift','2927joLeqF','Met\x20condition(s)','excluded','values','Expected\x20format:\x0a','Journey\x20description','journeys','name','trim','versionNumber','exit_criteria','duration','reentry:','all','resolveJumpTarget','version_number','bundle_name','*Max\x20wait\x20','Activation','next','variants','exitCriterias','daysOfWeek','resolveJourneyId','conditions','folder','type','sort','condition','activations:','journeyActivationStepId','steps','journeyName','resolveActivationName','journeyBundleId','2505190akZWKZ','2866776JwUWgh','wait_until','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','with','20993592CzrWDu','254776JegOsR','relationships','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','map','journeys:','version','timedOutPath','launched','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','jump','timeout','attributes','1206dFwvgi','entry_criteria','Variant','stageName','unique_id','conditionTimeoutUnit','state','8960PTHdic','size','allowReentry','waitStep','includes','parentFolder','segments:','activations','waitUntilDate','AbTest','waitCondition','reentry_always','get','stage','resolveSegmentId','isArray','percentage','resolveStageId','\x27:\x20','milestone','filter','DecisionPoint','segmentId','2213979yDmQhr','stages:','\x20\x20rule:\x0a','rootStep','day','unit','\x20\x20\x20\x20type:\x20','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','reentry','resolveSegment','test','wait','versions','segment_id','merge','folder_id','data','Stage\x201','activation_template_id','reentryMode','moveAfter','DaysOfTheWeek','Duration','First\x20stage\x20of\x20the\x20journey','keys','goal','slice','Condition','columns','your-activation-name','definition','Stage\x20Complete','push','rule','resolveActivation','customized_split','JOURNEY_SYNTAX_ERROR','resolveActivationId','week','stages','18NBlYhb','journey','randomUUID','add','segments','connector_config','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','has','waitStepType','resolveSegmentName','bundle_id','goal:','uuid','description','weeks','toLowerCase','set','find','15lbrzYf','startsWith','goal-segment','Wait\x201\x20Day','customizedSplit','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','conditionTimeoutDuration','Jump','match','from','WaitStep','activation','conditionSegmentId','ref','journeyStageId','journeyStages','isJourneyLocal','all_columns','null','\x20\x20\x20\x20type:\x20And\x0a'];a147_0x807e=function(){return _0x4fb200;};return a147_0x807e();}export function isJourneysArrayMode(_0x2614b8){const _0x4afb48=a147_0x4f0d;return!!(_0x2614b8['journeys']&&_0x2614b8[_0x4afb48(0x28d)]['length']>0x0);}export function isMultiVersionMode(_0x23c185){const _0x17c812=a147_0x4f0d;return!!(_0x23c185['versions']&&_0x23c185[_0x17c812(0x222)]['length']>0x0);}export function isSingleVersionMode(_0x5aae8d){const _0x30ea6e=a147_0x4f0d;return!!(_0x5aae8d[_0x30ea6e(0x23d)]&&_0x5aae8d[_0x30ea6e(0x23d)][_0x30ea6e(0x279)]>0x0);}export function hasMultipleVersions(_0x1c83fb){const _0x3733e1=a147_0x4f0d;if(isJourneysArrayMode(_0x1c83fb))return(_0x1c83fb[_0x3733e1(0x28d)]?.[_0x3733e1(0x279)]||0x0)>0x1;if(isMultiVersionMode(_0x1c83fb))return(_0x1c83fb[_0x3733e1(0x222)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0xf7fdae){const _0x47ea6c=a147_0x4f0d;if(isJourneysArrayMode(_0xf7fdae))return _0xf7fdae;if(isSingleVersionMode(_0xf7fdae)){const {stages:_0x15ce72,id:_0x101e36,version:_0x182eed,version_number:_0x1498ff,..._0x48915b}=_0xf7fdae;return{..._0x48915b,'journeys':[{'version':_0x182eed||'v1','stages':_0x15ce72||[],'id':_0x101e36,'version_number':_0x1498ff}]};}if(isMultiVersionMode(_0xf7fdae)){const {versions:_0xac5d7a,..._0x115d37}=_0xf7fdae;return{..._0x115d37,'journeys':(_0xac5d7a||[])[_0x47ea6c(0x1ef)](_0x37826c=>({'version':_0x37826c[_0x47ea6c(0x28e)],'state':_0x37826c[_0x47ea6c(0x1fe)],'latest':_0x37826c['latest'],'stages':_0x37826c[_0x47ea6c(0x23d)],'id':_0x37826c['id'],'version_number':_0x37826c[_0x47ea6c(0x1d2)]}))};}return _0xf7fdae;}export function normalizeJourneyDef(_0x3a8fee,_0x4e085d){const _0x144ef4=a147_0x4f0d,_0x505f49=normalizeToJourneysFormat(_0x3a8fee),_0x5b1494=_0x4e085d?.[_0x144ef4(0x242)]?Object[_0x144ef4(0x22e)](_0x4e085d['segments']):undefined,_0x1040f6=_0x4e085d?.[_0x144ef4(0x206)]?Object['keys'](_0x4e085d[_0x144ef4(0x206)]):undefined;return{'type':_0x144ef4(0x23f),'name':_0x505f49[_0x144ef4(0x28e)],..._0x505f49[_0x144ef4(0x24b)]!==undefined&&{'description':_0x505f49[_0x144ef4(0x24b)]},..._0x505f49[_0x144ef4(0x22f)]&&{'goal':normalizeJourneyCriteria(_0x505f49[_0x144ef4(0x22f)])},..._0x505f49['reentry']!==undefined&&{'reentry':_0x505f49['reentry']},..._0x505f49['segments']&&{'segments':normalizeEmbeddedSegments(_0x505f49[_0x144ef4(0x242)],_0x5b1494)},..._0x505f49[_0x144ef4(0x206)]&&{'activations':normalizeEmbeddedActivations(_0x505f49[_0x144ef4(0x206)],_0x1040f6)},..._0x505f49[_0x144ef4(0x28d)]&&{'journeys':_0x505f49[_0x144ef4(0x28d)][_0x144ef4(0x1ef)](_0x5374e4=>normalizeJourneyEntry(_0x5374e4,_0x505f49[_0x144ef4(0x28d)][_0x144ef4(0x279)]===0x1))}};}function normalizeJourneyEntry(_0x56f3b7,_0x51eb41){const _0x3f38a9=a147_0x4f0d;return{...!_0x51eb41&&_0x56f3b7[_0x3f38a9(0x1f1)]!==undefined&&{'version':_0x56f3b7[_0x3f38a9(0x1f1)]},..._0x56f3b7[_0x3f38a9(0x1fe)]!==undefined&&{'state':_0x56f3b7[_0x3f38a9(0x1fe)]},...!_0x51eb41&&_0x56f3b7[_0x3f38a9(0x26c)]!==undefined&&{'latest':_0x56f3b7[_0x3f38a9(0x26c)]},..._0x56f3b7[_0x3f38a9(0x1d2)]!==undefined&&{'version_number':_0x56f3b7['version_number']},..._0x56f3b7[_0x3f38a9(0x22f)]&&{'goal':normalizeJourneyCriteria(_0x56f3b7[_0x3f38a9(0x22f)])},..._0x56f3b7[_0x3f38a9(0x21e)]!==undefined&&{'reentry':_0x56f3b7[_0x3f38a9(0x21e)]},'stages':_0x56f3b7[_0x3f38a9(0x23d)][_0x3f38a9(0x1ef)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x2a95f7){const _0x268041=a147_0x4f0d;return{'name':_0x2a95f7['name'],..._0x2a95f7[_0x268041(0x24b)]!==undefined&&{'description':_0x2a95f7['description']},..._0x2a95f7[_0x268041(0x1f9)]&&{'entry_criteria':normalizeJourneyCriteria(_0x2a95f7[_0x268041(0x1f9)])},..._0x2a95f7[_0x268041(0x1cd)]&&{'exit_criteria':_0x2a95f7[_0x268041(0x1cd)][_0x268041(0x1ef)](normalizeJourneyCriteria)},..._0x2a95f7[_0x268041(0x212)]&&{'milestone':normalizeJourneyCriteria(_0x2a95f7['milestone'])},..._0x2a95f7[_0x268041(0x1e2)]&&{'steps':normalizeStepsWithImplicitNext(_0x2a95f7['steps'])}};}function normalizeStepsWithImplicitNext(_0x200d12){const _0x547a29=a147_0x4f0d;return _0x200d12[_0x547a29(0x1ef)]((_0x38a5c8,_0x49bc8d)=>{const _0x21bba0=_0x547a29,_0x17773f=_0x49bc8d<_0x200d12['length']-0x1?_0x200d12[_0x49bc8d+0x1][_0x21bba0(0x28e)]:undefined;return normalizeJourneyStep(_0x38a5c8,_0x17773f);});}function normalizeJourneyCriteria(_0x4ab3e){const _0x197927=a147_0x4f0d;return{'name':_0x4ab3e[_0x197927(0x28e)],..._0x4ab3e[_0x197927(0x24b)]!==undefined&&{'description':_0x4ab3e['description']},'segment':_0x4ab3e[_0x197927(0x282)],..._0x4ab3e['target']&&{'target':normalizeJumpTarget(_0x4ab3e[_0x197927(0x273)])}};}function normalizeJourneyStep(_0x37cdb7,_0x5d1fca){const _0x3c142e=a147_0x4f0d,_0x523007=_0x37cdb7['next']!==undefined&&_0x37cdb7['next']!==_0x5d1fca,_0x18f43a={'type':_0x37cdb7[_0x3c142e(0x1dd)],'name':_0x37cdb7['name'],..._0x523007&&{'next':_0x37cdb7[_0x3c142e(0x1d6)]}};if(_0x3c142e(0x1ea)in _0x37cdb7&&_0x37cdb7[_0x3c142e(0x1ea)])return{..._0x18f43a,'with':normalizeStepParams(_0x37cdb7[_0x3c142e(0x1dd)],_0x37cdb7[_0x3c142e(0x1ea)])};return _0x18f43a;}function normalizeStepParams(_0x51d763,_0x2c3d32){const _0x3e4418=a147_0x4f0d;switch(_0x51d763){case _0x3e4418(0x221):{const _0x4da11e=_0x2c3d32;let _0x47fd4a;return _0x4da11e[_0x3e4418(0x1df)]&&(_0x47fd4a={'segment':_0x4da11e[_0x3e4418(0x1df)][_0x3e4418(0x282)],..._0x4da11e['condition']['next']!==undefined&&{'next':_0x4da11e[_0x3e4418(0x1df)][_0x3e4418(0x1d6)]},..._0x4da11e[_0x3e4418(0x1df)]['timeout']&&{'timeout':{'duration':_0x4da11e[_0x3e4418(0x1df)][_0x3e4418(0x1f6)]['duration'],'unit':_0x4da11e[_0x3e4418(0x1df)][_0x3e4418(0x1f6)][_0x3e4418(0x21b)],..._0x4da11e[_0x3e4418(0x1df)]['timeout']['next']!==undefined&&{'next':_0x4da11e[_0x3e4418(0x1df)][_0x3e4418(0x1f6)][_0x3e4418(0x1d6)]}}}}),{..._0x4da11e['duration']!==undefined&&{'duration':_0x4da11e[_0x3e4418(0x1ce)]},..._0x4da11e[_0x3e4418(0x21b)]!==undefined&&{'unit':_0x4da11e['unit']},..._0x4da11e['wait_until']!==undefined&&{'wait_until':_0x4da11e[_0x3e4418(0x1e8)]},..._0x4da11e[_0x3e4418(0x271)]!==undefined&&{'days_of_week':_0x4da11e['days_of_week']},..._0x47fd4a&&{'condition':_0x47fd4a}};}case _0x3e4418(0x25b):{const _0x3f35ee=_0x2c3d32;return{'activation':_0x3f35ee['activation']};}case _0x3e4418(0x277):{const _0x222601=_0x2c3d32;return{'branches':_0x222601[_0x3e4418(0x276)]['map'](normalizeDecisionBranch)};}case _0x3e4418(0x285):{const _0x1524cc=_0x2c3d32;return{..._0x1524cc['customized_split']!==undefined&&{'customized_split':_0x1524cc[_0x3e4418(0x239)]},..._0x1524cc[_0x3e4418(0x1fc)]!==undefined&&{'unique_id':_0x1524cc[_0x3e4418(0x1fc)]},'variants':_0x1524cc['variants'][_0x3e4418(0x1ef)](normalizeAbTestVariant)};}case _0x3e4418(0x1f5):{const _0x2bbd29=_0x2c3d32;return{'target':normalizeJumpTarget(_0x2bbd29[_0x3e4418(0x273)])};}default:return _0x2c3d32;}}function normalizeDecisionBranch(_0x80dd9){const _0xdb40f3=a147_0x4f0d;return{'name':_0x80dd9['name'],..._0x80dd9['segment']!==undefined&&{'segment':_0x80dd9[_0xdb40f3(0x282)]},..._0x80dd9['excluded']!==undefined&&{'excluded':_0x80dd9[_0xdb40f3(0x289)]},..._0x80dd9[_0xdb40f3(0x1d6)]!==undefined&&{'next':_0x80dd9[_0xdb40f3(0x1d6)]}};}function normalizeAbTestVariant(_0x2af844){const _0x3e2d03=a147_0x4f0d;return{..._0x2af844['id']!==undefined&&{'id':_0x2af844['id']},'name':_0x2af844['name'],'percentage':_0x2af844[_0x3e2d03(0x20f)],..._0x2af844['next']!==undefined&&{'next':_0x2af844[_0x3e2d03(0x1d6)]}};}function normalizeJumpTarget(_0x574587){const _0x4b5f77=a147_0x4f0d;return{'journey':_0x574587[_0x4b5f77(0x23f)],'stage':_0x574587[_0x4b5f77(0x20c)],..._0x574587['bundle_id']!==undefined&&{'bundle_id':_0x574587[_0x4b5f77(0x248)]}};}function a147_0x4f0d(_0x3867bf,_0x2be0b5){_0x3867bf=_0x3867bf-0x1cc;const _0x807ea6=a147_0x807e();let _0x4f0dc9=_0x807ea6[_0x3867bf];return _0x4f0dc9;}function normalizeEmbeddedSegments(_0x276eb1,_0x539e6b){const _0xe7d924=a147_0x4f0d,_0x5190d9={},_0x5f533b=Object[_0xe7d924(0x22e)](_0x276eb1),_0x46cf21=_0x539e6b?[..._0x539e6b['filter'](_0x54056d=>_0x5f533b[_0xe7d924(0x203)](_0x54056d)),..._0x5f533b['filter'](_0x3498ad=>!_0x539e6b[_0xe7d924(0x203)](_0x3498ad))[_0xe7d924(0x1de)]()]:_0x5f533b['sort']();for(const _0x2c8f8b of _0x46cf21){const _0x4872e5=_0x276eb1[_0x2c8f8b];if(_0x4872e5['rule']){const _0x359c49=_0x4872e5[_0xe7d924(0x237)];if(_0x359c49[_0xe7d924(0x1dd)]!=='And'&&_0x359c49[_0xe7d924(0x1dd)]!=='Or'){const _0x314c13=_0x359c49[_0xe7d924(0x1dd)]??_0xe7d924(0x265);throw new SDKError(ErrorCode[_0xe7d924(0x23a)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x2c8f8b+_0xe7d924(0x211)+(_0xe7d924(0x1f4)+_0x314c13+'\x27.\x0a')+'Expected\x20format:\x0a'+'\x20\x20rule:\x0a'+_0xe7d924(0x263)+'\x20\x20\x20\x20conditions:\x0a'+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0xe7d924(0x1ee)+_0xe7d924(0x244));}if(!_0x359c49[_0xe7d924(0x1db)]||!Array['isArray'](_0x359c49[_0xe7d924(0x1db)]))throw new SDKError(ErrorCode[_0xe7d924(0x23a)],_0xe7d924(0x27c)+_0x2c8f8b+_0xe7d924(0x211)+_0xe7d924(0x255)+_0xe7d924(0x28b)+_0xe7d924(0x218)+(_0xe7d924(0x21c)+_0x359c49[_0xe7d924(0x1dd)]+'\x0a')+_0xe7d924(0x272)+_0xe7d924(0x1e9)+_0xe7d924(0x1ee)+_0xe7d924(0x244));}_0x5190d9[_0x2c8f8b]={..._0x4872e5[_0xe7d924(0x24b)]&&_0x4872e5[_0xe7d924(0x24b)]['trim']()&&{'description':_0x4872e5['description']},..._0x4872e5[_0xe7d924(0x237)]&&{'rule':deepSortObject(_0x4872e5[_0xe7d924(0x237)])}};}return _0x5190d9;}function normalizeEmbeddedActivations(_0x461e80,_0x538af8){const _0x37e02c=a147_0x4f0d,_0xa84bd4={},_0x2a4110=Object[_0x37e02c(0x22e)](_0x461e80),_0x188177=_0x538af8?[..._0x538af8[_0x37e02c(0x213)](_0x1425b9=>_0x2a4110[_0x37e02c(0x203)](_0x1425b9)),..._0x2a4110[_0x37e02c(0x213)](_0x2aa957=>!_0x538af8[_0x37e02c(0x203)](_0x2aa957))[_0x37e02c(0x1de)]()]:_0x2a4110[_0x37e02c(0x1de)]();for(const _0x12f4dc of _0x188177){const _0x2dcada=_0x461e80[_0x12f4dc];_0xa84bd4[_0x12f4dc]={'name':_0x2dcada[_0x37e02c(0x28e)],'connection':_0x2dcada[_0x37e02c(0x27d)],..._0x2dcada[_0x37e02c(0x24b)]!==undefined&&{'description':_0x2dcada[_0x37e02c(0x24b)]},..._0x2dcada['all_columns']!==undefined&&{'all_columns':_0x2dcada[_0x37e02c(0x261)]},..._0x2dcada[_0x37e02c(0x232)]!==undefined&&{'columns':_0x2dcada[_0x37e02c(0x232)]},..._0x2dcada[_0x37e02c(0x269)]!==undefined&&{'behavior':_0x2dcada[_0x37e02c(0x269)]},..._0x2dcada['schedule']!==undefined&&{'schedule':_0x2dcada['schedule']},..._0x2dcada['notification']!==undefined&&{'notification':_0x2dcada[_0x37e02c(0x270)]},..._0x2dcada[_0x37e02c(0x243)]!==undefined&&{'connector_config':_0x2dcada[_0x37e02c(0x243)]},..._0x2dcada['activation_template_id']!==undefined&&{'activation_template_id':_0x2dcada[_0x37e02c(0x228)]}};}return _0xa84bd4;}export function getActiveStages(_0x387959){const _0x3c7c2e=a147_0x4f0d;if(isJourneysArrayMode(_0x387959)){const _0x3a7f87=_0x387959['journeys']||[],_0x575ed0=_0x3a7f87[_0x3c7c2e(0x24f)](_0x57520c=>_0x57520c[_0x3c7c2e(0x26c)]===!![])||_0x3a7f87[0x0];return _0x575ed0?.[_0x3c7c2e(0x23d)]||[];}if(isSingleVersionMode(_0x387959))return _0x387959[_0x3c7c2e(0x23d)]||[];if(isMultiVersionMode(_0x387959)){const _0x1aa6e2=_0x387959['versions']||[],_0xa9fc5e=_0x1aa6e2[_0x3c7c2e(0x24f)](_0x2acad8=>_0x2acad8[_0x3c7c2e(0x26c)]===!![])||_0x1aa6e2[0x0];return _0xa9fc5e?.[_0x3c7c2e(0x23d)]||[];}return[];}export function getLatestJourneyEntry(_0x401f5f){const _0x334683=a147_0x4f0d;if(isJourneysArrayMode(_0x401f5f)){const _0x5e29e7=_0x401f5f[_0x334683(0x28d)]||[];return _0x5e29e7['find'](_0x1dc0b3=>_0x1dc0b3[_0x334683(0x26c)]===!![])||_0x5e29e7[0x0];}if(isMultiVersionMode(_0x401f5f)){const _0x4f2513=_0x401f5f['versions']||[],_0x4d07c8=_0x4f2513[_0x334683(0x24f)](_0x5f1345=>_0x5f1345['latest']===!![])||_0x4f2513[0x0];if(_0x4d07c8)return{'version':_0x4d07c8['name'],'state':_0x4d07c8['state'],'latest':_0x4d07c8[_0x334683(0x26c)],'stages':_0x4d07c8[_0x334683(0x23d)],'id':_0x4d07c8['id'],'version_number':_0x4d07c8[_0x334683(0x1d2)]};}if(isSingleVersionMode(_0x401f5f))return{'version':_0x401f5f[_0x334683(0x1f1)]||'v1','state':'draft','stages':_0x401f5f[_0x334683(0x23d)]||[],'id':_0x401f5f['id'],'version_number':_0x401f5f[_0x334683(0x1d2)],'goal':_0x401f5f['goal'],'reentry':_0x401f5f['reentry']};return undefined;}export function getLatestVersion(_0x45e98c){const _0x1a86ed=a147_0x4f0d;if(!isMultiVersionMode(_0x45e98c))return undefined;const _0x268324=_0x45e98c[_0x1a86ed(0x222)]||[];return _0x268324['find'](_0x902600=>_0x902600[_0x1a86ed(0x26c)]===!![])||_0x268324[0x0];}export function getEffectiveGoal(_0x8bcb3c){const _0x374753=a147_0x4f0d,_0x3abc45=getLatestJourneyEntry(_0x8bcb3c);return _0x3abc45?.[_0x374753(0x22f)]||_0x8bcb3c[_0x374753(0x22f)];}export function getEffectiveReentry(_0x2c479e){const _0x5eaa53=a147_0x4f0d,_0x849174=getLatestJourneyEntry(_0x2c479e);return _0x849174?.[_0x5eaa53(0x21e)]||_0x2c479e[_0x5eaa53(0x21e)];}export function collectSegmentRefs(_0x286380){const _0x35f5d9=a147_0x4f0d,_0x1dd0cb=new Set();_0x286380[_0x35f5d9(0x22f)]?.[_0x35f5d9(0x282)]&&_0x1dd0cb[_0x35f5d9(0x241)](_0x286380[_0x35f5d9(0x22f)]['segment']);const _0x54e57d=_0x3ba811=>{const _0x1d6ffa=_0x35f5d9;for(const _0xc434d5 of _0x3ba811){_0xc434d5[_0x1d6ffa(0x1f9)]?.['segment']&&_0x1dd0cb[_0x1d6ffa(0x241)](_0xc434d5[_0x1d6ffa(0x1f9)][_0x1d6ffa(0x282)]);if(_0xc434d5[_0x1d6ffa(0x1cd)])for(const _0x5b81c2 of _0xc434d5[_0x1d6ffa(0x1cd)]){_0x5b81c2[_0x1d6ffa(0x282)]&&_0x1dd0cb[_0x1d6ffa(0x241)](_0x5b81c2[_0x1d6ffa(0x282)]);}_0xc434d5[_0x1d6ffa(0x212)]?.[_0x1d6ffa(0x282)]&&_0x1dd0cb['add'](_0xc434d5[_0x1d6ffa(0x212)][_0x1d6ffa(0x282)]);if(_0xc434d5[_0x1d6ffa(0x1e2)])for(const _0x2804f5 of _0xc434d5['steps']){if(_0x2804f5['type']==='decision_point'){const _0x4666fc=_0x2804f5;for(const _0x329200 of _0x4666fc[_0x1d6ffa(0x1ea)][_0x1d6ffa(0x276)]){_0x329200[_0x1d6ffa(0x282)]&&_0x1dd0cb[_0x1d6ffa(0x241)](_0x329200[_0x1d6ffa(0x282)]);}}else{if(_0x2804f5[_0x1d6ffa(0x1dd)]===_0x1d6ffa(0x221)){const _0x46e133=_0x2804f5;_0x46e133[_0x1d6ffa(0x1ea)][_0x1d6ffa(0x1df)]?.[_0x1d6ffa(0x282)]&&_0x1dd0cb[_0x1d6ffa(0x241)](_0x46e133[_0x1d6ffa(0x1ea)]['condition']['segment']);}}}}};_0x286380['stages']&&_0x54e57d(_0x286380[_0x35f5d9(0x23d)]);if(_0x286380[_0x35f5d9(0x222)])for(const _0x39891b of _0x286380['versions']){_0x54e57d(_0x39891b['stages']);}return _0x1dd0cb;}export function validateSegmentRefs(_0x24d793){const _0x1759f6=a147_0x4f0d,_0x4bd915=[],_0x2b6b81=collectSegmentRefs(_0x24d793),_0xe57c39=new Set(Object['keys'](_0x24d793[_0x1759f6(0x242)]||{}));for(const _0x366d17 of _0x2b6b81){const _0x9c7171=parseSegmentRef(_0x366d17);_0x9c7171[_0x1759f6(0x1dd)]===_0x1759f6(0x268)&&!_0xe57c39[_0x1759f6(0x245)](_0x9c7171['name'])&&_0x4bd915[_0x1759f6(0x236)]('Unknown\x20segment\x20\x22'+_0x9c7171[_0x1759f6(0x28e)]+_0x1759f6(0x21d)+_0x9c7171['name']+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x4bd915;}export function collectSegmentIdsFromJourneyApi(_0xd6fe7a){const _0x447e01=a147_0x4f0d,_0x34452a=new Set();_0xd6fe7a[_0x447e01(0x1f7)][_0x447e01(0x22f)]?.[_0x447e01(0x215)]&&_0x34452a[_0x447e01(0x241)](_0xd6fe7a[_0x447e01(0x1f7)][_0x447e01(0x22f)][_0x447e01(0x215)]);const _0x452993=_0xd6fe7a[_0x447e01(0x1f7)][_0x447e01(0x25f)];if(Array['isArray'](_0x452993))for(const _0x14a5f8 of _0x452993){_0x14a5f8[_0x447e01(0x278)]?.[_0x447e01(0x215)]&&_0x34452a[_0x447e01(0x241)](_0x14a5f8['entryCriteria'][_0x447e01(0x215)]);const _0x5f47de=_0x14a5f8[_0x447e01(0x1d8)]??_0x14a5f8[_0x447e01(0x26e)];if(Array[_0x447e01(0x20e)](_0x5f47de))for(const _0x3dbfce of _0x5f47de){_0x3dbfce['segmentId']&&_0x34452a['add'](_0x3dbfce[_0x447e01(0x215)]);}_0x14a5f8[_0x447e01(0x212)]?.[_0x447e01(0x215)]&&_0x34452a[_0x447e01(0x241)](_0x14a5f8[_0x447e01(0x212)][_0x447e01(0x215)]);if(_0x14a5f8[_0x447e01(0x1e2)]&&typeof _0x14a5f8['steps']==='object'){const _0x10739f=Array['isArray'](_0x14a5f8[_0x447e01(0x1e2)])?_0x14a5f8[_0x447e01(0x1e2)]:Object[_0x447e01(0x28a)](_0x14a5f8[_0x447e01(0x1e2)]);for(const _0x16c0c9 of _0x10739f){_0x16c0c9[_0x447e01(0x209)]?.[_0x447e01(0x215)]&&_0x34452a['add'](_0x16c0c9[_0x447e01(0x209)][_0x447e01(0x215)]);const _0x286506=_0x16c0c9;_0x286506[_0x447e01(0x25c)]&&_0x34452a[_0x447e01(0x241)](_0x286506[_0x447e01(0x25c)]);if(Array[_0x447e01(0x20e)](_0x286506[_0x447e01(0x1db)]))for(const _0x5f5565 of _0x286506[_0x447e01(0x1db)]){_0x5f5565[_0x447e01(0x215)]&&_0x34452a[_0x447e01(0x241)](_0x5f5565['segmentId']);}if(Array[_0x447e01(0x20e)](_0x16c0c9[_0x447e01(0x276)]))for(const _0x5df501 of _0x16c0c9['branches']){_0x5df501[_0x447e01(0x215)]&&_0x34452a['add'](_0x5df501[_0x447e01(0x215)]);}}}}return _0x34452a;}
|