@treasuredata/tdx 0.25.6 → 0.25.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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/describe.js +1 -1
- package/dist/commands/engage-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/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/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +7 -0
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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/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/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/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.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.d.ts +19 -0
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -0
- package/dist/sdk/segment/journey-validator.js +1 -0
- package/dist/sdk/segment/journey-validator.js.map +1 -0
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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.d.ts +42 -0
- package/dist/sdk/segment/push-recovery.d.ts.map +1 -0
- package/dist/sdk/segment/push-recovery.js +1 -0
- package/dist/sdk/segment/push-recovery.js.map +1 -0
- package/dist/sdk/segment/push-workflow.d.ts +18 -12
- package/dist/sdk/segment/push-workflow.d.ts.map +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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +2 -0
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +7 -7
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.d.ts +5 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/cdp.d.ts +117 -0
- 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/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/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/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/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/port.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(_0x2d52a5,_0x4ed75d){const _0x33e45e=a108_0x1761,_0x20c0b6=_0x2d52a5();while(!![]){try{const _0x52a7ba=parseInt(_0x33e45e(0x1e5))/0x1*(-parseInt(_0x33e45e(0x287))/0x2)+parseInt(_0x33e45e(0x2a1))/0x3*(-parseInt(_0x33e45e(0x281))/0x4)+-parseInt(_0x33e45e(0x216))/0x5+parseInt(_0x33e45e(0x20a))/0x6+-parseInt(_0x33e45e(0x25f))/0x7*(-parseInt(_0x33e45e(0x1e2))/0x8)+parseInt(_0x33e45e(0x214))/0x9+-parseInt(_0x33e45e(0x274))/0xa;if(_0x52a7ba===_0x4ed75d)break;else _0x20c0b6['push'](_0x20c0b6['shift']());}catch(_0x47a0af){_0x20c0b6['push'](_0x20c0b6['shift']());}}}(a108_0x2744,0xf0b22));import*as a108_0x30dc56 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x1e9716){const _0x2a2d35=a108_0x1761,_0xffc701=_0x1e9716[_0x2a2d35(0x282)]();if(_0xffc701===_0x2a2d35(0x232)||_0xffc701===_0x2a2d35(0x27d))return _0x2a2d35(0x27d);if(_0xffc701==='weeks'||_0xffc701==='week')return _0x2a2d35(0x1fd);return _0x1e9716;}export function journeyResponseToDefSync(_0x394bab){const _0x37e04d=a108_0x1761,_0x2b5fcf=_0x394bab[_0x37e04d(0x1f1)],_0x3d7352=_0x2b5fcf[_0x37e04d(0x264)]||_0x2b5fcf['name'],_0x347bb5={'stages':_0x2b5fcf[_0x37e04d(0x20f)]['map'](convertApiStageToYaml),'id':_0x394bab['id']};_0x2b5fcf[_0x37e04d(0x26f)]&&_0x2b5fcf[_0x37e04d(0x26f)]!==_0x3d7352&&(_0x347bb5[_0x37e04d(0x22c)]=_0x2b5fcf[_0x37e04d(0x26f)]);_0x2b5fcf['versionNumber']!==undefined&&(_0x347bb5['version_number']=_0x2b5fcf['versionNumber']);_0x2b5fcf[_0x37e04d(0x259)]&&(_0x347bb5[_0x37e04d(0x259)]=_0x2b5fcf[_0x37e04d(0x259)]===_0x37e04d(0x1f2)?'launched':'draft');const _0x196911={'type':_0x37e04d(0x244),'name':_0x3d7352,'journeys':[_0x347bb5]};_0x2b5fcf['description']&&(_0x196911[_0x37e04d(0x1e1)]=_0x2b5fcf[_0x37e04d(0x1e1)]);_0x2b5fcf[_0x37e04d(0x290)]&&(_0x196911[_0x37e04d(0x290)]=convertApiCriteriaToYaml(_0x2b5fcf[_0x37e04d(0x290)]));if(_0x2b5fcf['reentryMode'])_0x196911[_0x37e04d(0x24e)]=_0x2b5fcf[_0x37e04d(0x238)];else _0x2b5fcf[_0x37e04d(0x27c)]!==undefined&&(_0x196911[_0x37e04d(0x24e)]=_0x2b5fcf[_0x37e04d(0x27c)]?_0x37e04d(0x1f0):_0x37e04d(0x245));return _0x2b5fcf[_0x37e04d(0x243)]&&(_0x196911[_0x37e04d(0x1ff)]=_0x2b5fcf[_0x37e04d(0x243)]),_0x2b5fcf[_0x37e04d(0x264)]&&(_0x196911['bundle_name']=_0x2b5fcf[_0x37e04d(0x264)]),_0x394bab[_0x37e04d(0x231)]?.[_0x37e04d(0x27a)]?.[_0x37e04d(0x21c)]?.['id']&&(_0x196911[_0x37e04d(0x270)]=_0x394bab[_0x37e04d(0x231)][_0x37e04d(0x27a)][_0x37e04d(0x21c)]['id']),_0x196911;}export async function journeyResponseToDef(_0x5aea20,_0x18f043){const _0x208a00=a108_0x1761,_0x4c3bfe=journeyResponseToDefSync(_0x5aea20);if(!_0x18f043)return _0x4c3bfe;const _0x540480=new Set();collectSegmentIdsFromJourney(_0x4c3bfe,_0x540480);const _0x547ba4=new Set();collectActivationIdsFromJourney(_0x4c3bfe,_0x547ba4);const _0x45eace={},_0x19936f=new Map();for(const _0x458d5d of Array['from'](_0x540480)['sort']()){if(_0x18f043['resolveSegment']){const _0x42664a=await _0x18f043[_0x208a00(0x25b)](_0x458d5d);if(_0x42664a[_0x208a00(0x26b)]){_0x19936f[_0x208a00(0x1f3)](_0x458d5d,_0x42664a[_0x208a00(0x26f)]);if(_0x42664a['definition']){const _0x993a4={..._0x42664a['definition'],'rule':deepSortObject(_0x42664a[_0x208a00(0x1f4)][_0x208a00(0x226)])};_0x45eace[_0x42664a[_0x208a00(0x26f)]]=_0x993a4;}}else _0x19936f['set'](_0x458d5d,makeSegmentRef(_0x42664a['name']));}else{if(_0x18f043[_0x208a00(0x206)]){const _0x2aa70d=await _0x18f043[_0x208a00(0x206)](_0x458d5d);_0x19936f[_0x208a00(0x1f3)](_0x458d5d,_0x2aa70d);}}}const _0x5f2942={},_0x27c252=new Map();for(const _0x171f3f of Array[_0x208a00(0x22d)](_0x547ba4)[_0x208a00(0x29d)]()){if(_0x18f043[_0x208a00(0x28b)]){const _0x327f42=await _0x18f043[_0x208a00(0x28b)](_0x171f3f);_0x327f42['isJourneyLocal']?(_0x27c252[_0x208a00(0x1f3)](_0x171f3f,_0x327f42[_0x208a00(0x26f)]),_0x327f42[_0x208a00(0x1f4)]&&(_0x5f2942[_0x327f42[_0x208a00(0x26f)]]=_0x327f42[_0x208a00(0x1f4)])):_0x27c252[_0x208a00(0x1f3)](_0x171f3f,makeSegmentRef(_0x327f42['name']));}else{if(_0x18f043[_0x208a00(0x202)]){const _0x3dfdb8=await _0x18f043[_0x208a00(0x202)](_0x171f3f);_0x27c252[_0x208a00(0x1f3)](_0x171f3f,_0x3dfdb8);}}}_0x19936f[_0x208a00(0x27e)]>0x0&&replaceSegmentIdsInJourney(_0x4c3bfe,_0x19936f);_0x27c252[_0x208a00(0x27e)]>0x0&&replaceActivationIdsInJourney(_0x4c3bfe,_0x27c252);if(_0x18f043['resolveJumpTarget']){const _0x25f1c0=[];collectJumpTargetsFromJourney(_0x4c3bfe,_0x25f1c0);if(_0x25f1c0[_0x208a00(0x277)]>0x0){const _0x3607a8=new Map();for(const _0x1964eb of _0x25f1c0){try{const _0x1e5ebb=await _0x18f043[_0x208a00(0x1e6)](_0x1964eb[_0x208a00(0x239)],_0x1964eb[_0x208a00(0x278)]);_0x3607a8['set'](_0x1964eb[_0x208a00(0x239)]+':'+_0x1964eb[_0x208a00(0x278)],_0x1e5ebb);}catch{}}_0x3607a8[_0x208a00(0x27e)]>0x0&&replaceJumpTargetsInJourney(_0x4c3bfe,_0x3607a8);}}return Object[_0x208a00(0x26e)](_0x45eace)[_0x208a00(0x277)]>0x0&&(_0x4c3bfe[_0x208a00(0x283)]=_0x45eace),Object['keys'](_0x5f2942)[_0x208a00(0x277)]>0x0&&(_0x4c3bfe[_0x208a00(0x1f6)]=_0x5f2942),_0x4c3bfe;}function collectSegmentIdsFromJourney(_0x418f38,_0x39f245){const _0x384159=a108_0x1761;_0x418f38[_0x384159(0x290)]?.[_0x384159(0x29f)]&&_0x39f245['add'](_0x418f38[_0x384159(0x290)][_0x384159(0x29f)]);const _0x28a1a4=_0x17e1a6=>{const _0x24f17b=_0x384159;for(const _0x350b2a of _0x17e1a6){_0x350b2a[_0x24f17b(0x221)]?.[_0x24f17b(0x29f)]&&_0x39f245['add'](_0x350b2a[_0x24f17b(0x221)][_0x24f17b(0x29f)]);if(_0x350b2a[_0x24f17b(0x29a)])for(const _0x390957 of _0x350b2a[_0x24f17b(0x29a)]){_0x390957[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x390957[_0x24f17b(0x29f)]);}_0x350b2a[_0x24f17b(0x296)]?.[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x350b2a[_0x24f17b(0x296)][_0x24f17b(0x29f)]);if(_0x350b2a[_0x24f17b(0x205)])for(const _0x10ca4f of _0x350b2a[_0x24f17b(0x205)]){if(_0x10ca4f[_0x24f17b(0x213)]===_0x24f17b(0x284)){const _0x5a1a68=_0x10ca4f;for(const _0x507104 of _0x5a1a68[_0x24f17b(0x249)][_0x24f17b(0x1e7)]){_0x507104[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x507104[_0x24f17b(0x29f)]);}}else{if(_0x10ca4f['type']===_0x24f17b(0x269)){const _0x7f85d3=_0x10ca4f;_0x7f85d3[_0x24f17b(0x249)]['condition']?.[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x7f85d3[_0x24f17b(0x249)][_0x24f17b(0x236)][_0x24f17b(0x29f)]);}}}}};if(_0x418f38[_0x384159(0x247)])for(const _0x4570c2 of _0x418f38['journeys']){_0x4570c2[_0x384159(0x290)]?.[_0x384159(0x29f)]&&_0x39f245[_0x384159(0x28e)](_0x4570c2[_0x384159(0x290)][_0x384159(0x29f)]),_0x28a1a4(_0x4570c2[_0x384159(0x267)]);}_0x418f38['stages']&&_0x28a1a4(_0x418f38['stages']);if(_0x418f38[_0x384159(0x237)])for(const _0xa215ab of _0x418f38[_0x384159(0x237)]){_0x28a1a4(_0xa215ab[_0x384159(0x267)]);}}function replaceSegmentIdsInJourney(_0x1f012d,_0x4fe2ce){const _0x5b7314=a108_0x1761,_0x639066=_0x2a8771=>_0x4fe2ce['get'](_0x2a8771)||_0x2a8771;_0x1f012d['goal']?.[_0x5b7314(0x29f)]&&(_0x1f012d[_0x5b7314(0x290)][_0x5b7314(0x29f)]=_0x639066(_0x1f012d[_0x5b7314(0x290)][_0x5b7314(0x29f)]));const _0x217ca7=_0x32b95c=>{const _0xe3d4c6=_0x5b7314;for(const _0x294b4e of _0x32b95c){_0x294b4e[_0xe3d4c6(0x221)]?.[_0xe3d4c6(0x29f)]&&(_0x294b4e[_0xe3d4c6(0x221)][_0xe3d4c6(0x29f)]=_0x639066(_0x294b4e[_0xe3d4c6(0x221)][_0xe3d4c6(0x29f)]));if(_0x294b4e[_0xe3d4c6(0x29a)])for(const _0xb2c292 of _0x294b4e[_0xe3d4c6(0x29a)]){_0xb2c292[_0xe3d4c6(0x29f)]&&(_0xb2c292[_0xe3d4c6(0x29f)]=_0x639066(_0xb2c292['segment']));}_0x294b4e[_0xe3d4c6(0x296)]?.['segment']&&(_0x294b4e[_0xe3d4c6(0x296)][_0xe3d4c6(0x29f)]=_0x639066(_0x294b4e[_0xe3d4c6(0x296)][_0xe3d4c6(0x29f)]));if(_0x294b4e[_0xe3d4c6(0x205)])for(const _0x47ab26 of _0x294b4e['steps']){if(_0x47ab26[_0xe3d4c6(0x213)]===_0xe3d4c6(0x284)){const _0x1df0a7=_0x47ab26;for(const _0x2baf2b of _0x1df0a7['with']['branches']){_0x2baf2b['segment']&&(_0x2baf2b[_0xe3d4c6(0x29f)]=_0x639066(_0x2baf2b[_0xe3d4c6(0x29f)]));}}else{if(_0x47ab26[_0xe3d4c6(0x213)]===_0xe3d4c6(0x269)){const _0x47b145=_0x47ab26;_0x47b145[_0xe3d4c6(0x249)][_0xe3d4c6(0x236)]?.[_0xe3d4c6(0x29f)]&&(_0x47b145[_0xe3d4c6(0x249)][_0xe3d4c6(0x236)][_0xe3d4c6(0x29f)]=_0x639066(_0x47b145[_0xe3d4c6(0x249)][_0xe3d4c6(0x236)][_0xe3d4c6(0x29f)]));}}}}};if(_0x1f012d[_0x5b7314(0x247)])for(const _0x50c08e of _0x1f012d[_0x5b7314(0x247)]){_0x50c08e['goal']?.[_0x5b7314(0x29f)]&&(_0x50c08e[_0x5b7314(0x290)][_0x5b7314(0x29f)]=_0x639066(_0x50c08e['goal'][_0x5b7314(0x29f)])),_0x217ca7(_0x50c08e[_0x5b7314(0x267)]);}_0x1f012d[_0x5b7314(0x267)]&&_0x217ca7(_0x1f012d[_0x5b7314(0x267)]);if(_0x1f012d['versions'])for(const _0x263767 of _0x1f012d[_0x5b7314(0x237)]){_0x217ca7(_0x263767['stages']);}}function collectActivationIdsFromJourney(_0x24bd59,_0x1ba2a0){const _0x300586=a108_0x1761,_0x3b2d8a=_0x5c3060=>{const _0x1565b3=a108_0x1761;for(const _0x5b47d2 of _0x5c3060){if(_0x5b47d2['steps'])for(const _0x5a2731 of _0x5b47d2['steps']){if(_0x5a2731[_0x1565b3(0x213)]===_0x1565b3(0x28a)){const _0x25379d=_0x5a2731;_0x25379d[_0x1565b3(0x249)]['activation']&&/^\d+$/[_0x1565b3(0x261)](_0x25379d[_0x1565b3(0x249)][_0x1565b3(0x28a)])&&_0x1ba2a0[_0x1565b3(0x28e)](_0x25379d['with']['activation']);}}}};if(_0x24bd59[_0x300586(0x247)])for(const _0x7ea13e of _0x24bd59[_0x300586(0x247)]){_0x3b2d8a(_0x7ea13e['stages']);}_0x24bd59[_0x300586(0x267)]&&_0x3b2d8a(_0x24bd59[_0x300586(0x267)]);if(_0x24bd59['versions'])for(const _0x2ba989 of _0x24bd59['versions']){_0x3b2d8a(_0x2ba989[_0x300586(0x267)]);}}function replaceActivationIdsInJourney(_0x5dc59e,_0xbdcd98){const _0x310db8=a108_0x1761,_0x46816e=_0x44bbb9=>_0xbdcd98[_0x310db8(0x234)](_0x44bbb9)||_0x44bbb9,_0x1eea55=_0x4ab97f=>{const _0x570b43=_0x310db8;for(const _0x23b9ab of _0x4ab97f){if(_0x23b9ab[_0x570b43(0x205)])for(const _0x119e90 of _0x23b9ab['steps']){if(_0x119e90[_0x570b43(0x213)]==='activation'){const _0x2242a4=_0x119e90;_0x2242a4[_0x570b43(0x249)]['activation']&&(_0x2242a4[_0x570b43(0x249)][_0x570b43(0x28a)]=_0x46816e(_0x2242a4[_0x570b43(0x249)]['activation']));}}}};if(_0x5dc59e['journeys'])for(const _0x557bf7 of _0x5dc59e[_0x310db8(0x247)]){_0x1eea55(_0x557bf7[_0x310db8(0x267)]);}_0x5dc59e[_0x310db8(0x267)]&&_0x1eea55(_0x5dc59e[_0x310db8(0x267)]);if(_0x5dc59e[_0x310db8(0x237)])for(const _0x3a8620 of _0x5dc59e[_0x310db8(0x237)]){_0x1eea55(_0x3a8620['stages']);}}function collectJumpTargetsFromJourney(_0x8fb965,_0x8354c3){const _0x5ecdca=a108_0x1761,_0x4087ee=new Set(),_0x105f22=_0x1d9725=>{const _0x265d69=a108_0x1761;for(const _0x2e05f4 of _0x1d9725){if(_0x2e05f4['steps'])for(const _0x54898c of _0x2e05f4[_0x265d69(0x205)]){if(_0x54898c[_0x265d69(0x213)]===_0x265d69(0x20c)){const _0x184df2=_0x54898c,_0x1a2b73=_0x184df2[_0x265d69(0x249)]['target'];if(_0x1a2b73[_0x265d69(0x244)]&&_0x1a2b73[_0x265d69(0x240)]&&/^\d+$/['test'](_0x1a2b73['journey'])&&/^\d+$/[_0x265d69(0x261)](_0x1a2b73[_0x265d69(0x240)])){const _0x4bc098=_0x1a2b73[_0x265d69(0x244)]+':'+_0x1a2b73[_0x265d69(0x240)];!_0x4087ee[_0x265d69(0x255)](_0x4bc098)&&(_0x4087ee['add'](_0x4bc098),_0x8354c3['push']({'journeyId':_0x1a2b73['journey'],'stageId':_0x1a2b73[_0x265d69(0x240)]}));}}}}};if(_0x8fb965[_0x5ecdca(0x247)])for(const _0xe91b12 of _0x8fb965[_0x5ecdca(0x247)]){_0x105f22(_0xe91b12[_0x5ecdca(0x267)]);}_0x8fb965[_0x5ecdca(0x267)]&&_0x105f22(_0x8fb965[_0x5ecdca(0x267)]);if(_0x8fb965[_0x5ecdca(0x237)])for(const _0x313953 of _0x8fb965[_0x5ecdca(0x237)]){_0x105f22(_0x313953[_0x5ecdca(0x267)]);}}function replaceJumpTargetsInJourney(_0x48d0aa,_0x53ecc5){const _0x497f55=a108_0x1761,_0x47211f=_0x4c9afb=>{const _0x227da0=a108_0x1761;for(const _0x24c62d of _0x4c9afb){if(_0x24c62d[_0x227da0(0x205)])for(const _0x1ec48f of _0x24c62d[_0x227da0(0x205)]){if(_0x1ec48f['type']==='jump'){const _0x5e6268=_0x1ec48f,_0x6e3183=_0x5e6268[_0x227da0(0x249)][_0x227da0(0x1e9)],_0x44c659=_0x6e3183[_0x227da0(0x244)]+':'+_0x6e3183[_0x227da0(0x240)],_0x3f4c4f=_0x53ecc5['get'](_0x44c659);_0x3f4c4f&&(_0x6e3183['journey']=_0x3f4c4f['journeyName'],_0x6e3183[_0x227da0(0x240)]=_0x3f4c4f[_0x227da0(0x208)]);}}}};if(_0x48d0aa[_0x497f55(0x247)])for(const _0x4b6c7a of _0x48d0aa[_0x497f55(0x247)]){_0x47211f(_0x4b6c7a[_0x497f55(0x267)]);}_0x48d0aa[_0x497f55(0x267)]&&_0x47211f(_0x48d0aa[_0x497f55(0x267)]);if(_0x48d0aa[_0x497f55(0x237)])for(const _0x2ae561 of _0x48d0aa[_0x497f55(0x237)]){_0x47211f(_0x2ae561[_0x497f55(0x267)]);}}function generateReadableStepName(_0xe16b43,_0x59dc73){const _0x533f55=a108_0x1761;if(_0xe16b43[_0x533f55(0x26f)]&&_0xe16b43[_0x533f55(0x26f)]!==_0xe16b43['type']){const _0x57ac10=_0xe16b43[_0x533f55(0x26f)][_0x533f55(0x29c)]();if(_0x57ac10&&/[a-z0-9]/i[_0x533f55(0x261)](_0x57ac10))return _0x57ac10;}const _0x1b87e4=_0xe16b43[_0x533f55(0x213)][_0x533f55(0x282)]()[_0x533f55(0x257)](/step$/i,'');return _0x1b87e4+'_'+(_0x59dc73+0x1);}function getStepNextRefs(_0x51a365){const _0x3a8a37=a108_0x1761,_0x40e963=[];if(_0x51a365['next'])_0x40e963[_0x3a8a37(0x211)](_0x51a365['next']);if(_0x51a365[_0x3a8a37(0x1e7)])for(const _0x4f8e98 of _0x51a365['branches']){if(_0x4f8e98[_0x3a8a37(0x2a4)])_0x40e963[_0x3a8a37(0x211)](_0x4f8e98[_0x3a8a37(0x2a4)]);}if(_0x51a365[_0x3a8a37(0x254)])for(const _0x485111 of _0x51a365['variants']){if(_0x485111[_0x3a8a37(0x2a4)])_0x40e963[_0x3a8a37(0x211)](_0x485111[_0x3a8a37(0x2a4)]);}if(_0x51a365[_0x3a8a37(0x2a0)])for(const _0x28f3e6 of _0x51a365[_0x3a8a37(0x2a0)]){if(_0x28f3e6[_0x3a8a37(0x2a4)])_0x40e963['push'](_0x28f3e6['next']);}return _0x40e963;}function parseJumpTargetDisplayName(_0x52ad50){const _0x362f97=a108_0x1761,_0xe55a89=_0x52ad50[_0x362f97(0x298)](/^(.+?)\s*\(([^/)]+)/);if(!_0xe55a89)return undefined;const _0x128aa4=_0xe55a89[0x1][_0x362f97(0x29c)](),_0x6c9b9c=_0xe55a89[0x2][_0x362f97(0x29c)]();if(!_0x128aa4||!_0x6c9b9c)return undefined;return{'stageName':_0x128aa4,'journeyName':_0x6c9b9c};}function orderStepsFromRoot(_0x181748,_0x3e2945){const _0x2f559e=a108_0x1761,_0x41b0a5=Object[_0x2f559e(0x285)](_0x181748);if(_0x41b0a5['length']===0x0)return[];const _0x554496=new Set(_0x41b0a5[_0x2f559e(0x20e)](([_0x83fab3])=>_0x83fab3)),_0xb5ede4=new Set();for(const [,_0x5e3cdd]of _0x41b0a5){for(const _0x8aecfd of getStepNextRefs(_0x5e3cdd)){if(_0x554496['has'](_0x8aecfd))_0xb5ede4[_0x2f559e(0x28e)](_0x8aecfd);}}let _0x5da975=_0x3e2945&&_0x554496[_0x2f559e(0x255)](_0x3e2945)?_0x3e2945:undefined;if(!_0x5da975){const _0x245404=_0x41b0a5[_0x2f559e(0x25e)](([_0x1ff60c])=>!_0xb5ede4[_0x2f559e(0x255)](_0x1ff60c));_0x245404[_0x2f559e(0x277)]>0x0?_0x5da975=_0x245404[0x0][0x0]:_0x5da975=_0x41b0a5[0x0][0x0];}const _0x2c740d=[],_0x4928cc=new Set(),_0x29e9db=[_0x5da975];while(_0x29e9db['length']>0x0){const _0x438674=_0x29e9db[_0x2f559e(0x23d)]();if(_0x4928cc[_0x2f559e(0x255)](_0x438674))continue;_0x4928cc['add'](_0x438674);const _0x4f9a84=_0x181748[_0x438674];if(!_0x4f9a84)continue;_0x2c740d[_0x2f559e(0x211)]({'uuid':_0x438674,'step':_0x4f9a84});for(const _0xe1a044 of getStepNextRefs(_0x4f9a84)){_0x554496[_0x2f559e(0x255)](_0xe1a044)&&!_0x4928cc[_0x2f559e(0x255)](_0xe1a044)&&_0x29e9db[_0x2f559e(0x211)](_0xe1a044);}}for(const [_0x1d09c8,_0x5f004b]of _0x41b0a5){!_0x4928cc[_0x2f559e(0x255)](_0x1d09c8)&&_0x2c740d[_0x2f559e(0x211)]({'uuid':_0x1d09c8,'step':_0x5f004b});}return _0x2c740d;}function resolveStepReferences(_0x148f39,_0x5dd438,_0xf22626,_0x7b7b7f){const _0x567635=a108_0x1761;if(_0x148f39[_0x567635(0x213)]!=='end'){_0x148f39['next']&&_0x7b7b7f[_0x567635(0x255)](_0x148f39[_0x567635(0x2a4)])&&(_0x148f39['next']=_0x7b7b7f[_0x567635(0x234)](_0x148f39[_0x567635(0x2a4)]));const _0x20d6e4=_0x5dd438+0x1;if(_0x20d6e4<_0xf22626[_0x567635(0x277)]){const _0x59b1e7=_0x7b7b7f[_0x567635(0x234)](_0xf22626[_0x20d6e4][_0x567635(0x222)]);_0x148f39[_0x567635(0x2a4)]===_0x59b1e7&&delete _0x148f39[_0x567635(0x2a4)];}}if(_0x148f39[_0x567635(0x213)]===_0x567635(0x284))for(const _0x5bbef9 of _0x148f39[_0x567635(0x249)][_0x567635(0x1e7)]){_0x5bbef9[_0x567635(0x2a4)]&&_0x7b7b7f[_0x567635(0x255)](_0x5bbef9[_0x567635(0x2a4)])&&(_0x5bbef9[_0x567635(0x2a4)]=_0x7b7b7f['get'](_0x5bbef9[_0x567635(0x2a4)]));}if(_0x148f39['type']===_0x567635(0x24c))for(const _0x500892 of _0x148f39[_0x567635(0x249)][_0x567635(0x254)]){_0x500892[_0x567635(0x2a4)]&&_0x7b7b7f['has'](_0x500892[_0x567635(0x2a4)])&&(_0x500892[_0x567635(0x2a4)]=_0x7b7b7f[_0x567635(0x234)](_0x500892[_0x567635(0x2a4)]));}if(_0x148f39['type']==='wait'&&_0x148f39[_0x567635(0x249)][_0x567635(0x236)]){const _0x3b1d9d=_0x148f39[_0x567635(0x249)][_0x567635(0x236)];_0x3b1d9d[_0x567635(0x2a4)]&&_0x7b7b7f[_0x567635(0x255)](_0x3b1d9d['next'])&&(_0x3b1d9d[_0x567635(0x2a4)]=_0x7b7b7f[_0x567635(0x234)](_0x3b1d9d['next'])),_0x3b1d9d[_0x567635(0x25a)]?.['next']&&_0x7b7b7f[_0x567635(0x255)](_0x3b1d9d['timeout'][_0x567635(0x2a4)])&&(_0x3b1d9d[_0x567635(0x25a)][_0x567635(0x2a4)]=_0x7b7b7f[_0x567635(0x234)](_0x3b1d9d['timeout'][_0x567635(0x2a4)]));}}function convertApiStageToYaml(_0x656b02){const _0x453cb2=a108_0x1761,_0x2b5120={'name':_0x656b02['name']};_0x656b02['id']&&(_0x2b5120['id']=_0x656b02['id']);_0x656b02[_0x453cb2(0x1e1)]&&(_0x2b5120[_0x453cb2(0x1e1)]=_0x656b02[_0x453cb2(0x1e1)]);_0x656b02['entryCriteria']&&(_0x2b5120['entry_criteria']=convertApiCriteriaToYaml(_0x656b02[_0x453cb2(0x279)]));_0x656b02[_0x453cb2(0x293)]&&_0x656b02['exitCriterias'][_0x453cb2(0x277)]>0x0&&(_0x2b5120[_0x453cb2(0x29a)]=_0x656b02['exitCriterias'][_0x453cb2(0x20e)](convertApiCriteriaToYaml));_0x656b02[_0x453cb2(0x296)]&&(_0x2b5120[_0x453cb2(0x296)]=convertApiCriteriaToYaml(_0x656b02['milestone']));if(_0x656b02[_0x453cb2(0x205)]&&Object[_0x453cb2(0x26e)](_0x656b02['steps'])[_0x453cb2(0x277)]>0x0){const _0x2b4627=orderStepsFromRoot(_0x656b02[_0x453cb2(0x205)],_0x656b02[_0x453cb2(0x28d)]),_0x4d6acc=new Map(),_0x524e11=new Set();for(let _0x1a7699=0x0;_0x1a7699<_0x2b4627[_0x453cb2(0x277)];_0x1a7699++){const {uuid:_0x30246a,step:_0x442a11}=_0x2b4627[_0x1a7699];let _0x580a48=generateReadableStepName(_0x442a11,_0x1a7699),_0xd67ce0=_0x580a48,_0x31dc53=0x2;while(_0x524e11[_0x453cb2(0x255)](_0xd67ce0)){_0xd67ce0=_0x580a48+'_'+_0x31dc53,_0x31dc53++;}_0x524e11[_0x453cb2(0x28e)](_0xd67ce0),_0x4d6acc['set'](_0x30246a,_0xd67ce0);}_0x2b5120[_0x453cb2(0x205)]=_0x2b4627[_0x453cb2(0x20e)](({uuid:_0xb48b33,step:_0x56b8f9},_0x30dbde)=>{const _0x2cb0df=convertApiStepToYaml(_0x56b8f9,_0x4d6acc['get'](_0xb48b33));return resolveStepReferences(_0x2cb0df,_0x30dbde,_0x2b4627,_0x4d6acc),_0x2cb0df;});}return _0x2b5120;}function convertApiCriteriaToYaml(_0x2cb88c){const _0x2f885d=a108_0x1761,_0xc6e37a={'name':_0x2cb88c['name'],'segment':_0x2cb88c[_0x2f885d(0x224)]};_0x2cb88c[_0x2f885d(0x1e1)]&&(_0xc6e37a['description']=_0x2cb88c[_0x2f885d(0x1e1)]);if(_0x2cb88c['target']){let _0x254013=_0x2cb88c[_0x2f885d(0x1e9)][_0x2f885d(0x239)],_0x4f878f=_0x2cb88c[_0x2f885d(0x1e9)]['journeyStageId'];if(_0x2cb88c[_0x2f885d(0x1e9)][_0x2f885d(0x28c)]){const _0x3e4b8c=parseJumpTargetDisplayName(_0x2cb88c[_0x2f885d(0x1e9)]['journeyName']);_0x3e4b8c&&(_0x4f878f=_0x3e4b8c['stageName'],_0x254013=_0x3e4b8c[_0x2f885d(0x28c)]);}_0xc6e37a[_0x2f885d(0x1e9)]={'journey':_0x254013,'stage':_0x4f878f},_0x2cb88c[_0x2f885d(0x1e9)]['journeyBundleId']&&(_0xc6e37a[_0x2f885d(0x1e9)]['bundle_id']=_0x2cb88c[_0x2f885d(0x1e9)]['journeyBundleId']);}return _0xc6e37a;}function convertApiStepToYaml(_0x2e65cc,_0x4efd4e){const _0x3d055b=a108_0x1761;switch(_0x2e65cc[_0x3d055b(0x213)]){case _0x3d055b(0x1f9):{const _0x309391={};if(_0x2e65cc[_0x3d055b(0x2a7)]==='Duration'&&_0x2e65cc[_0x3d055b(0x29b)]!==undefined)_0x309391[_0x3d055b(0x241)]=_0x2e65cc[_0x3d055b(0x29b)],_0x309391[_0x3d055b(0x1e4)]=_0x2e65cc[_0x3d055b(0x258)];else{if(_0x2e65cc['waitStepType']===_0x3d055b(0x223)&&_0x2e65cc[_0x3d055b(0x204)])_0x309391[_0x3d055b(0x265)]=_0x2e65cc['waitUntilDate'];else{if(_0x2e65cc['waitStepType']==='DaysOfTheWeek'&&_0x2e65cc[_0x3d055b(0x1ed)])_0x309391[_0x3d055b(0x299)]=_0x2e65cc[_0x3d055b(0x1ed)];else{if(_0x2e65cc[_0x3d055b(0x2a7)]===_0x3d055b(0x268)){if(_0x2e65cc[_0x3d055b(0x2a0)]&&_0x2e65cc['conditions']['length']>0x0){const _0x3e31fb=_0x2e65cc['conditions'][_0x3d055b(0x273)](_0x1ca8b3=>!_0x1ca8b3[_0x3d055b(0x209)]),_0xb4cc1c=_0x2e65cc[_0x3d055b(0x2a0)][_0x3d055b(0x273)](_0x255996=>_0x255996[_0x3d055b(0x209)]);_0x3e31fb?.[_0x3d055b(0x224)]&&(_0x309391[_0x3d055b(0x236)]={'segment':_0x3e31fb['segmentId'],..._0x3e31fb[_0x3d055b(0x2a4)]?{'next':_0x3e31fb[_0x3d055b(0x2a4)]}:{}},_0xb4cc1c&&_0xb4cc1c[_0x3d055b(0x24f)]!==undefined&&_0xb4cc1c['unit']&&(_0x309391[_0x3d055b(0x236)]['timeout']={'duration':_0xb4cc1c[_0x3d055b(0x24f)],'unit':_0xb4cc1c[_0x3d055b(0x1e4)],..._0xb4cc1c[_0x3d055b(0x2a4)]?{'next':_0xb4cc1c[_0x3d055b(0x2a4)]}:{}}));}else _0x2e65cc['conditionSegmentId']&&(_0x309391[_0x3d055b(0x236)]={'segment':_0x2e65cc[_0x3d055b(0x1de)]},_0x2e65cc[_0x3d055b(0x1fc)]!==undefined&&_0x2e65cc[_0x3d055b(0x22b)]&&(_0x309391['condition'][_0x3d055b(0x25a)]={'duration':_0x2e65cc['conditionTimeoutDuration'],'unit':_0x2e65cc['conditionTimeoutUnit']}));}}}}const _0x431ade={'type':_0x3d055b(0x269),'name':_0x4efd4e,..._0x2e65cc['next']?{'next':_0x2e65cc['next']}:{},'with':_0x309391};return _0x431ade;}case _0x3d055b(0x23b):{const _0x2d8044={'type':_0x3d055b(0x28a),'name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc[_0x3d055b(0x2a4)]}:{},'with':{'activation':_0x2e65cc[_0x3d055b(0x23a)]||''}};return _0x2d8044;}case _0x3d055b(0x294):{const _0x28128f={'type':'decision_point','name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc['next']}:{},'with':{'branches':(_0x2e65cc[_0x3d055b(0x1e7)]||[])['map'](_0x4e0ee0=>({'name':_0x4e0ee0[_0x3d055b(0x26f)],'segment':_0x4e0ee0[_0x3d055b(0x224)],'excluded':_0x4e0ee0[_0x3d055b(0x266)],..._0x4e0ee0[_0x3d055b(0x2a4)]?{'next':_0x4e0ee0[_0x3d055b(0x2a4)]}:{}}))}};return _0x28128f;}case'ABTest':case _0x3d055b(0x26a):case _0x3d055b(0x22f):{const _0x1510e8=_0x2e65cc[_0x3d055b(0x254)]||(_0x2e65cc[_0x3d055b(0x1e7)]||[])[_0x3d055b(0x20e)](_0x2aa6a0=>({'name':_0x2aa6a0[_0x3d055b(0x26f)],'percentage':0x0,'next':_0x2aa6a0['next']})),_0x248856={'type':'ab_test','name':_0x4efd4e,..._0x2e65cc['next']?{'next':_0x2e65cc[_0x3d055b(0x2a4)]}:{},'with':{'customized_split':_0x2e65cc[_0x3d055b(0x217)],'unique_id':_0x2e65cc['uniqueId'],'variants':_0x1510e8[_0x3d055b(0x20e)](_0x390e1e=>({'name':_0x390e1e[_0x3d055b(0x26f)],'percentage':_0x390e1e[_0x3d055b(0x1fa)],..._0x390e1e[_0x3d055b(0x2a4)]?{'next':_0x390e1e[_0x3d055b(0x2a4)]}:{}}))}};return _0x248856;}case _0x3d055b(0x23e):{const _0x5f4c5c={'type':_0x3d055b(0x207),'name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc[_0x3d055b(0x2a4)]}:{}};return _0x5f4c5c;}case _0x3d055b(0x25d):{if(!_0x2e65cc[_0x3d055b(0x1e9)])throw new SDKError(ErrorCode[_0x3d055b(0x225)],_0x3d055b(0x20d)+(_0x2e65cc[_0x3d055b(0x26f)]||_0x4efd4e)+'\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)');let _0x5195c4=_0x2e65cc[_0x3d055b(0x1e9)][_0x3d055b(0x239)],_0x4bf8ba=_0x2e65cc[_0x3d055b(0x1e9)][_0x3d055b(0x1dd)];if(_0x2e65cc[_0x3d055b(0x1e9)]['journeyName']){const _0x3d4fff=parseJumpTargetDisplayName(_0x2e65cc[_0x3d055b(0x1e9)][_0x3d055b(0x28c)]);_0x3d4fff&&(_0x4bf8ba=_0x3d4fff[_0x3d055b(0x208)],_0x5195c4=_0x3d4fff[_0x3d055b(0x28c)]);}const _0x5856d4={'type':_0x3d055b(0x20c),'name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc['next']}:{},'with':{'target':{'journey':_0x5195c4,'stage':_0x4bf8ba,'bundle_id':_0x2e65cc[_0x3d055b(0x1e9)]['journeyBundleId']}}};return _0x5856d4;}case'End':{const _0x2a0471={'type':_0x3d055b(0x218),'name':_0x4efd4e};return _0x2a0471;}default:{const _0x1d2f09={'type':_0x3d055b(0x218),'name':_0x4efd4e};return _0x1d2f09;}}}export async function journeyDefToRequest(_0x5ca343,_0x1d42f8,_0x67dc0a){const _0x1ce9b9=a108_0x1761,_0x1d67c7=_0x5ca343[_0x1ce9b9(0x267)]||getActiveStages(_0x5ca343),_0x25f079=_0x5ca343[_0x1ce9b9(0x283)]||{},_0x46a9ea=_0x5ca343['activations']||{},_0x486207={'type':'journey','attributes':{'name':_0x5ca343[_0x1ce9b9(0x26f)],'audienceId':_0x1d42f8,'journeyStages':await Promise[_0x1ce9b9(0x212)](_0x1d67c7[_0x1ce9b9(0x20e)](_0xa51b98=>convertYamlStageToApi(_0xa51b98,_0x67dc0a,_0x25f079,_0x46a9ea)))}};_0x5ca343['id']&&(_0x486207['id']=_0x5ca343['id']);_0x5ca343[_0x1ce9b9(0x1e1)]&&(_0x486207['attributes']['description']=_0x5ca343[_0x1ce9b9(0x1e1)]);const _0x4c34e8=getEffectiveGoal(_0x5ca343);_0x4c34e8&&(_0x486207[_0x1ce9b9(0x1f1)][_0x1ce9b9(0x290)]=await convertYamlCriteriaToApi(_0x4c34e8,_0x67dc0a,_0x25f079));const _0x172a71=getEffectiveReentry(_0x5ca343);return _0x172a71&&(_0x486207[_0x1ce9b9(0x1f1)][_0x1ce9b9(0x238)]=_0x172a71,_0x486207[_0x1ce9b9(0x1f1)]['allowReentry']=_0x172a71!==_0x1ce9b9(0x245)),_0x5ca343[_0x1ce9b9(0x270)]&&(_0x486207['relationships']={'parentFolder':{'data':{'id':_0x5ca343[_0x1ce9b9(0x270)],'type':'folder'}}}),_0x486207;}async function convertYamlStageToApi(_0x16bf1b,_0x156c13,_0xce93d9={},_0x5e1d2c={}){const _0x1af793=a108_0x1761,_0xb0a082={'name':_0x16bf1b[_0x1af793(0x26f)]};_0x16bf1b['id']&&(_0xb0a082['id']=_0x16bf1b['id']);_0x16bf1b[_0x1af793(0x1e1)]&&(_0xb0a082[_0x1af793(0x1e1)]=_0x16bf1b[_0x1af793(0x1e1)]);_0x16bf1b[_0x1af793(0x221)]&&(_0xb0a082[_0x1af793(0x279)]=await convertYamlCriteriaToApi(_0x16bf1b[_0x1af793(0x221)],_0x156c13,_0xce93d9));_0x16bf1b['exit_criteria']&&_0x16bf1b[_0x1af793(0x29a)][_0x1af793(0x277)]>0x0&&(_0xb0a082[_0x1af793(0x293)]=await Promise[_0x1af793(0x212)](_0x16bf1b['exit_criteria'][_0x1af793(0x20e)](_0x4ed53d=>convertYamlCriteriaToApi(_0x4ed53d,_0x156c13,_0xce93d9))));_0x16bf1b[_0x1af793(0x296)]&&(_0xb0a082['milestone']=await convertYamlCriteriaToApi(_0x16bf1b[_0x1af793(0x296)],_0x156c13,_0xce93d9));if(_0x16bf1b[_0x1af793(0x205)]&&_0x16bf1b['steps']['length']>0x0){const _0x280edb={},_0x3d42ee=_0x16bf1b[_0x1af793(0x205)][_0x1af793(0x20e)]((_0x28b29b,_0x1a0188)=>{const _0x490b20=_0x1af793,_0x5cf8ad=_0x28b29b[_0x490b20(0x222)]||generateUUID(),_0x9d9030=_0x28b29b[_0x490b20(0x26f)]||_0x28b29b[_0x490b20(0x213)]+'_'+_0x1a0188;return _0x280edb[_0x9d9030]=_0x5cf8ad,{..._0x28b29b,'name':_0x9d9030};});_0xb0a082[_0x1af793(0x28d)]=_0x280edb[_0x3d42ee[0x0]['name']],_0xb0a082[_0x1af793(0x205)]={};for(let _0x2a5a01=0x0;_0x2a5a01<_0x3d42ee['length'];_0x2a5a01++){const _0x1d6423=_0x3d42ee[_0x2a5a01],_0x4e872a=_0x280edb[_0x1d6423[_0x1af793(0x26f)]],_0x8f6029=!_0x1d6423['next']&&_0x2a5a01<_0x3d42ee[_0x1af793(0x277)]-0x1&&_0x1d6423['type']!=='end'?_0x3d42ee[_0x2a5a01+0x1]['name']:_0x1d6423['next'],_0x33abd3=_0x8f6029!==_0x1d6423[_0x1af793(0x2a4)]?{..._0x1d6423,'next':_0x8f6029}:_0x1d6423;_0xb0a082[_0x1af793(0x205)][_0x4e872a]=await convertYamlStepToApi(_0x33abd3,_0x156c13,_0xce93d9,_0x280edb,_0x5e1d2c);}}else _0x16bf1b[_0x1af793(0x1e8)]&&(_0xb0a082[_0x1af793(0x28d)]=_0x16bf1b[_0x1af793(0x1e8)]);return _0xb0a082;}async function convertYamlCriteriaToApi(_0x2de238,_0x278f62,_0x2d892c={}){const _0x23eac7=a108_0x1761;let _0x3b7222=_0x2de238[_0x23eac7(0x29f)];if(_0x3b7222&&!/^\d+$/[_0x23eac7(0x261)](_0x3b7222)){const _0x204f57=parseSegmentRef(_0x3b7222);if(_0x204f57[_0x23eac7(0x213)]===_0x23eac7(0x24a))_0x278f62?.[_0x23eac7(0x27b)]&&(_0x3b7222=await _0x278f62[_0x23eac7(0x27b)](_0x204f57[_0x23eac7(0x26f)]));else{if(_0x204f57[_0x23eac7(0x213)]===_0x23eac7(0x210)&&_0x2d892c[_0x204f57[_0x23eac7(0x26f)]])_0x278f62?.[_0x23eac7(0x280)]&&(_0x3b7222=await _0x278f62['resolveEmbeddedSegmentId'](_0x204f57[_0x23eac7(0x26f)],_0x2d892c[_0x204f57[_0x23eac7(0x26f)]]));else _0x278f62?.[_0x23eac7(0x27b)]&&(_0x3b7222=await _0x278f62[_0x23eac7(0x27b)](_0x204f57['name']));}}const _0x429d7e={'name':_0x2de238[_0x23eac7(0x26f)],'segmentId':_0x3b7222};_0x2de238[_0x23eac7(0x1e1)]&&(_0x429d7e['description']=_0x2de238[_0x23eac7(0x1e1)]);if(_0x2de238[_0x23eac7(0x1e9)]){const _0xe27e69=_0x2de238[_0x23eac7(0x1e9)][_0x23eac7(0x244)],_0x280393=_0x2de238[_0x23eac7(0x1e9)]['stage'];let _0x5573da=_0x2de238[_0x23eac7(0x1e9)]['journey'];_0x278f62?.[_0x23eac7(0x227)]&&!/^\d+$/['test'](_0x5573da)&&(_0x5573da=await _0x278f62[_0x23eac7(0x227)](_0x5573da));let _0x254d70=_0x2de238[_0x23eac7(0x1e9)][_0x23eac7(0x240)];_0x278f62?.['resolveStageId']&&!/^\d+$/[_0x23eac7(0x261)](_0x254d70)&&(_0x254d70=await _0x278f62[_0x23eac7(0x22e)](_0x5573da,_0x254d70));const _0x2f6e54=!/^\d+$/[_0x23eac7(0x261)](_0xe27e69)&&!isLocalJourneyRef(_0xe27e69)?formatApiJourneyName(_0xe27e69,_0x280393):undefined;_0x429d7e[_0x23eac7(0x1e9)]={'journeyId':_0x5573da,'journeyStageId':_0x254d70,'journeyName':_0x2f6e54,'confirmed':!![]},_0x2de238['target'][_0x23eac7(0x1ff)]&&(_0x429d7e['target'][_0x23eac7(0x243)]=_0x2de238[_0x23eac7(0x1e9)][_0x23eac7(0x1ff)]);}return _0x429d7e;}async function convertYamlStepToApi(_0x2111ad,_0x4b848f,_0x4fe827={},_0x13a55c={},_0x56507e={}){const _0x24fc24=a108_0x1761,_0x5c208b=async _0x34ee5b=>{const _0x2bd58f=a108_0x1761;if(/^\d+$/[_0x2bd58f(0x261)](_0x34ee5b))return _0x34ee5b;const _0xde3852=parseSegmentRef(_0x34ee5b);if(_0xde3852[_0x2bd58f(0x213)]==='ref'){if(_0x4b848f?.['resolveSegmentId'])return await _0x4b848f[_0x2bd58f(0x27b)](_0xde3852['name']);}else{if(_0xde3852[_0x2bd58f(0x213)]==='embedded'&&_0x4fe827[_0xde3852[_0x2bd58f(0x26f)]]){if(_0x4b848f?.['resolveEmbeddedSegmentId'])return await _0x4b848f[_0x2bd58f(0x280)](_0xde3852[_0x2bd58f(0x26f)],_0x4fe827[_0xde3852[_0x2bd58f(0x26f)]]);}else{if(_0x4b848f?.['resolveSegmentId'])return await _0x4b848f[_0x2bd58f(0x27b)](_0xde3852[_0x2bd58f(0x26f)]);}}return _0x34ee5b;},_0x20194b=async _0x153cfb=>{const _0x295536=a108_0x1761;if(/^\d+$/[_0x295536(0x261)](_0x153cfb))return _0x153cfb;const _0x382289=parseSegmentRef(_0x153cfb);if(_0x382289[_0x295536(0x213)]===_0x295536(0x24a)){if(_0x4b848f?.[_0x295536(0x253)])return await _0x4b848f[_0x295536(0x253)](_0x382289[_0x295536(0x26f)]);return _0x382289[_0x295536(0x26f)];}else{if(_0x382289[_0x295536(0x213)]===_0x295536(0x210)&&_0x56507e[_0x382289[_0x295536(0x26f)]]){if(_0x4b848f?.['resolveEmbeddedActivationId'])return await _0x4b848f['resolveEmbeddedActivationId'](_0x382289[_0x295536(0x26f)],_0x56507e[_0x382289[_0x295536(0x26f)]]);if(_0x4b848f?.[_0x295536(0x253)])return await _0x4b848f['resolveActivationId'](_0x382289[_0x295536(0x26f)]);}else{if(_0x4b848f?.[_0x295536(0x253)])return await _0x4b848f[_0x295536(0x253)](_0x382289[_0x295536(0x26f)]);}}return _0x153cfb;},_0x611c98=_0x9a430a=>{const _0x440974=a108_0x1761;if(!_0x9a430a)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x440974(0x261)](_0x9a430a))return _0x9a430a;return _0x13a55c[_0x9a430a]||_0x9a430a;};switch(_0x2111ad[_0x24fc24(0x213)]){case'wait':{const _0x2a8b67=_0x2111ad,_0x5bf72c=_0x2a8b67[_0x24fc24(0x249)],_0x1c1a83={'type':_0x24fc24(0x1f9),'name':_0x2a8b67[_0x24fc24(0x26f)],'next':_0x611c98(_0x2a8b67[_0x24fc24(0x2a4)])};if(_0x5bf72c[_0x24fc24(0x241)]!==undefined&&_0x5bf72c[_0x24fc24(0x1e4)])_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x263),_0x1c1a83[_0x24fc24(0x29b)]=_0x5bf72c[_0x24fc24(0x241)],_0x1c1a83[_0x24fc24(0x258)]=normalizeWaitUnit(_0x5bf72c[_0x24fc24(0x1e4)]);else{if(_0x5bf72c[_0x24fc24(0x265)])_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x223),_0x1c1a83[_0x24fc24(0x204)]=_0x5bf72c[_0x24fc24(0x265)];else{if(_0x5bf72c[_0x24fc24(0x299)])_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x252),_0x1c1a83['daysOfWeek']=_0x5bf72c[_0x24fc24(0x299)];else{if(_0x5bf72c['condition']){_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x268);const _0x21af2f=await _0x5c208b(_0x5bf72c[_0x24fc24(0x236)]['segment']),_0x3e3a33=_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]?.[_0x24fc24(0x2a4)]!==undefined;if(_0x3e3a33){const _0x13a9a1=[];_0x13a9a1['push']({'id':generateUUID(),'segmentId':_0x21af2f,'timedOutPath':![],'next':_0x611c98(_0x5bf72c['condition'][_0x24fc24(0x2a4)]??_0x2a8b67[_0x24fc24(0x2a4)])}),_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]&&_0x13a9a1[_0x24fc24(0x211)]({'id':generateUUID(),'timedOutPath':!![],'moveAfter':_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)][_0x24fc24(0x241)],'unit':normalizeWaitUnit(_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)][_0x24fc24(0x1e4)]),'next':_0x611c98(_0x5bf72c['condition'][_0x24fc24(0x25a)]['next'])}),_0x1c1a83[_0x24fc24(0x2a0)]=_0x13a9a1;}else _0x1c1a83['conditionSegmentId']=_0x21af2f,_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]&&(_0x1c1a83['conditionTimeoutDuration']=_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]['duration'],_0x5bf72c['condition']['timeout']['unit']&&(_0x1c1a83[_0x24fc24(0x22b)]=normalizeWaitUnit(_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)][_0x24fc24(0x1e4)])));}}}}return _0x1c1a83;}case'activation':{const _0x5de9f1=_0x2111ad,_0x2cf9d1=_0x5de9f1[_0x24fc24(0x249)][_0x24fc24(0x28a)],_0x149c13=await _0x20194b(_0x2cf9d1);return{'type':_0x24fc24(0x23b),'name':_0x5de9f1['name'],'journeyActivationStepId':_0x149c13,'next':_0x611c98(_0x5de9f1['next'])};}case _0x24fc24(0x284):{const _0x1211e3=_0x2111ad,_0x5165b4=_0x1211e3[_0x24fc24(0x249)][_0x24fc24(0x1e7)];return{'type':'DecisionPoint','name':_0x1211e3[_0x24fc24(0x26f)],'branches':await Promise['all'](_0x5165b4[_0x24fc24(0x20e)](async _0x40d6a7=>{const _0x374f80=_0x24fc24;let _0xef308='';if(!_0x40d6a7[_0x374f80(0x26c)]){const _0x58a411=_0x40d6a7[_0x374f80(0x29f)]||_0x40d6a7[_0x374f80(0x25c)]||'';_0xef308=_0x58a411?await _0x5c208b(_0x58a411):'';}return{'id':crypto[_0x374f80(0x26d)](),'name':_0x40d6a7['name'],'description':null,'segmentId':_0xef308,'excludedPath':_0x40d6a7[_0x374f80(0x26c)]??![],'next':_0x611c98(_0x40d6a7[_0x374f80(0x2a4)])};})),'next':_0x611c98(_0x1211e3[_0x24fc24(0x2a4)])};}case _0x24fc24(0x24c):{const _0x3ba4c5=_0x2111ad,_0x46847b=_0x3ba4c5[_0x24fc24(0x249)];return{'type':_0x24fc24(0x24d),'name':_0x3ba4c5[_0x24fc24(0x26f)],'customizedSplit':_0x46847b[_0x24fc24(0x233)],'uniqueId':_0x46847b[_0x24fc24(0x248)],'variants':_0x46847b['variants'][_0x24fc24(0x20e)](_0x297de6=>({'id':_0x297de6['id']||generateUUID(),'name':_0x297de6[_0x24fc24(0x26f)],'percentage':_0x297de6['percentage'],'next':_0x611c98(_0x297de6['next'])})),'next':_0x611c98(_0x3ba4c5[_0x24fc24(0x2a4)])};}case'merge':return{'type':'Merge','name':_0x2111ad[_0x24fc24(0x26f)],'next':_0x611c98(_0x2111ad[_0x24fc24(0x2a4)])};case _0x24fc24(0x20c):{const _0x12eb26=_0x2111ad,_0xe35cc6=_0x12eb26[_0x24fc24(0x249)][_0x24fc24(0x1e9)],_0x294e3a=_0xe35cc6[_0x24fc24(0x244)],_0x5421ff=_0xe35cc6[_0x24fc24(0x240)];let _0xb4b9cc=_0xe35cc6[_0x24fc24(0x244)];_0x4b848f?.[_0x24fc24(0x227)]&&!/^\d+$/[_0x24fc24(0x261)](_0xb4b9cc)&&(_0xb4b9cc=await _0x4b848f['resolveJourneyId'](_0xb4b9cc));let _0x21799c=_0xe35cc6['stage'];_0x4b848f?.['resolveStageId']&&!/^\d+$/[_0x24fc24(0x261)](_0x21799c)&&(_0x21799c=await _0x4b848f[_0x24fc24(0x22e)](_0xb4b9cc,_0x21799c));const _0x259b77=!/^\d+$/['test'](_0x294e3a)&&!isLocalJourneyRef(_0x294e3a)?formatApiJourneyName(_0x294e3a,_0x5421ff):undefined;return{'type':_0x24fc24(0x25d),'name':_0x12eb26[_0x24fc24(0x26f)],'target':{'journeyId':_0xb4b9cc,'journeyStageId':_0x21799c,'journeyBundleId':_0xe35cc6[_0x24fc24(0x1ff)],'journeyName':_0x259b77,'confirmed':!![]},'next':_0x611c98(_0x12eb26[_0x24fc24(0x2a4)])};}case _0x24fc24(0x218):return{'type':_0x24fc24(0x1db),'name':_0x2111ad[_0x24fc24(0x26f)]};default:{const _0x1ee71c=_0x2111ad;return{'type':_0x24fc24(0x1db),'name':_0x1ee71c[_0x24fc24(0x26f)]};}}}export function toYamlString(_0x178c09){const _0x43aa4e=a108_0x1761,_0x28d172=stripInternalFields(_0x178c09),_0x2ad25a=a108_0x30dc56['stringify'](_0x28d172,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x43aa4e(0x1df)}),_0x31c199=[_0x43aa4e(0x250),_0x43aa4e(0x22a),_0x43aa4e(0x21a),_0x43aa4e(0x28f),_0x43aa4e(0x242),_0x43aa4e(0x235),_0x43aa4e(0x260)];let _0x6dc54f=_0x2ad25a;for(const _0x2ebe0c of _0x31c199){_0x6dc54f=_0x6dc54f[_0x43aa4e(0x257)](new RegExp('^('+_0x2ebe0c+')','m'),(_0x8dc42,_0x206f1c,_0x397ca0)=>{if(_0x397ca0===0x0||_0x6dc54f[_0x397ca0-0x1]==='\x0a'&&_0x6dc54f[_0x397ca0-0x2]==='\x0a')return _0x206f1c;return'\x0a'+_0x206f1c;});}return _0x6dc54f;}function stripInternalFields(_0xf0f084){const _0x43fac1=a108_0x1761,{id:_0x598e92,folder_id:_0x2ef656,bundle_id:_0x188e18,bundle_name:_0x3297e5,version:_0x36cbe4,version_number:_0x366724,allow_reentry:_0x42dd62,..._0x5c636a}=_0xf0f084;return _0x5c636a['journeys']&&(_0x5c636a[_0x43fac1(0x247)]=_0x5c636a[_0x43fac1(0x247)][_0x43fac1(0x20e)](_0x3aa0ee=>{const _0x2b6802=_0x43fac1,{id:_0x30d5bb,version_number:_0x2af31f,..._0x2b47a3}=_0x3aa0ee;return{..._0x2b47a3,'stages':_0x2b47a3[_0x2b6802(0x267)][_0x2b6802(0x20e)](stripStageInternalFields),..._0x3aa0ee[_0x2b6802(0x1fb)]===!![]?{'latest':!![]}:{},..._0x5c636a[_0x2b6802(0x247)][_0x2b6802(0x277)]===0x1&&_0x2b47a3['version']==='v1'?{'version':undefined}:{}};})),_0x5c636a['stages']&&(_0x5c636a['stages']=_0x5c636a[_0x43fac1(0x267)][_0x43fac1(0x20e)](stripStageInternalFields)),_0x5c636a[_0x43fac1(0x237)]&&(_0x5c636a[_0x43fac1(0x237)]=_0x5c636a['versions']['map'](_0x4a7220=>{const _0xc7f05a=_0x43fac1,{id:_0x114d17,version_number:_0xee4ef8,..._0x5d854a}=_0x4a7220;return{..._0x5d854a,'stages':_0x5d854a['stages'][_0xc7f05a(0x20e)](stripStageInternalFields),..._0x4a7220[_0xc7f05a(0x1fb)]===!![]?{'latest':!![]}:{}};})),_0x5c636a;}function stripStageInternalFields(_0x4139f8){const {id:_0x2dc784,..._0x43dd82}=_0x4139f8;return _0x43dd82;}export function parseYamlString(_0x53c353){const _0x34b026=a108_0x1761,_0x21b4d7=a108_0x30dc56[_0x34b026(0x2a2)](_0x53c353);if(_0x21b4d7[_0x34b026(0x213)]!==_0x34b026(0x244))throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x276));if(!_0x21b4d7[_0x34b026(0x26f)])throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20missing\x20required\x20field:\x20name');const _0x37419c=_0x21b4d7[_0x34b026(0x247)]&&Array[_0x34b026(0x289)](_0x21b4d7['journeys'])&&_0x21b4d7[_0x34b026(0x247)][_0x34b026(0x277)]>0x0,_0x1e1993=_0x21b4d7[_0x34b026(0x267)]&&Array['isArray'](_0x21b4d7[_0x34b026(0x267)])&&_0x21b4d7['stages']['length']>0x0,_0x1fa252=_0x21b4d7[_0x34b026(0x237)]&&Array['isArray'](_0x21b4d7[_0x34b026(0x237)])&&_0x21b4d7['versions'][_0x34b026(0x277)]>0x0,_0x508788=[_0x37419c,_0x1e1993,_0x1fa252]['filter'](Boolean)['length'];if(_0x508788>0x1)throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x1e3));if(_0x508788===0x0)throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x286));if(_0x37419c){for(let _0x32ffdb=0x0;_0x32ffdb<_0x21b4d7[_0x34b026(0x247)][_0x34b026(0x277)];_0x32ffdb++){const _0xc785f2=_0x21b4d7[_0x34b026(0x247)][_0x32ffdb];if(!_0xc785f2[_0x34b026(0x267)]||!Array[_0x34b026(0x289)](_0xc785f2['stages'])||_0xc785f2[_0x34b026(0x267)][_0x34b026(0x277)]===0x0)throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x200)+_0x32ffdb+']\x20missing\x20required\x20field:\x20stages');if(_0xc785f2[_0x34b026(0x259)]&&!['draft',_0x34b026(0x1f2)][_0x34b026(0x203)](_0xc785f2[_0x34b026(0x259)]))throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20journeys['+_0x32ffdb+_0x34b026(0x230)+_0xc785f2[_0x34b026(0x259)]+_0x34b026(0x21b));validateStages(_0xc785f2[_0x34b026(0x267)],'journeys['+_0x32ffdb+_0x34b026(0x295));}const _0x540264=_0x21b4d7[_0x34b026(0x247)][_0x34b026(0x25e)](_0x4f821b=>_0x4f821b[_0x34b026(0x1fb)]===!![])[_0x34b026(0x277)];if(_0x540264>0x1)throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true');}_0x1e1993&&validateStages(_0x21b4d7[_0x34b026(0x267)],_0x34b026(0x267));if(_0x1fa252){for(let _0x2aa3a9=0x0;_0x2aa3a9<_0x21b4d7['versions'][_0x34b026(0x277)];_0x2aa3a9++){const _0x72bc0b=_0x21b4d7[_0x34b026(0x237)][_0x2aa3a9];if(!_0x72bc0b[_0x34b026(0x26f)])throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20versions['+_0x2aa3a9+_0x34b026(0x23f));if(!_0x72bc0b[_0x34b026(0x259)]||!['draft',_0x34b026(0x1f2)][_0x34b026(0x203)](_0x72bc0b[_0x34b026(0x259)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x34b026(0x1f5)+_0x2aa3a9+']\x20has\x20invalid\x20state:\x20'+_0x72bc0b[_0x34b026(0x259)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');if(!_0x72bc0b['stages']||!Array[_0x34b026(0x289)](_0x72bc0b['stages'])||_0x72bc0b[_0x34b026(0x267)][_0x34b026(0x277)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x34b026(0x1f5)+_0x2aa3a9+_0x34b026(0x1ec));validateStages(_0x72bc0b[_0x34b026(0x267)],_0x34b026(0x1ef)+_0x2aa3a9+_0x34b026(0x295));}const _0x46ae69=_0x21b4d7[_0x34b026(0x237)][_0x34b026(0x25e)](_0x1f93c1=>_0x1f93c1[_0x34b026(0x1fb)]===!![])['length'];if(_0x46ae69>0x1)throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true');}return _0x21b4d7;}function validateStages(_0x456578,_0x3961f5){const _0x319966=a108_0x1761;if(_0x456578[_0x319966(0x277)]>0x8)throw new SDKError(ErrorCode[_0x319966(0x225)],_0x319966(0x219)+_0x3961f5+_0x319966(0x251));}export function isJourneyDef(_0x172c33){const _0x18e2fc=a108_0x1761;return typeof _0x172c33===_0x18e2fc(0x24b)&&_0x172c33!==null&&_0x18e2fc(0x213)in _0x172c33&&_0x172c33[_0x18e2fc(0x213)]===_0x18e2fc(0x244);}export function generateTemplate(_0x4984ca,_0x6f979b){const _0x2c323c=a108_0x1761,_0xc53464={'type':_0x2c323c(0x244),'name':_0x4984ca,'description':'Journey\x20description','reentry':_0x2c323c(0x245),'goal':{'name':'Goal\x20Achieved','segment':'goal-segment'},'stages':[{'name':_0x2c323c(0x220),'description':_0x2c323c(0x23c),'entry_criteria':{'name':_0x2c323c(0x228),'segment':_0x6f979b},'steps':[{'type':'wait','name':_0x2c323c(0x1ee),'with':{'duration':0x1,'unit':_0x2c323c(0x27d)}},{'type':'activation','name':_0x2c323c(0x1ea),'with':{'activation':_0x2c323c(0x1f8)}},{'type':_0x2c323c(0x218),'name':_0x2c323c(0x229)}]}]};return toYamlString(_0xc53464);}function generateUUID(){const _0x33f8c2=a108_0x1761;return crypto[_0x33f8c2(0x26d)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x3aa2c3){const _0x52b3e7=a108_0x1761;if(_0x3aa2c3[_0x52b3e7(0x292)](SEGMENT_REF_PREFIX))return{'type':_0x52b3e7(0x24a),'name':_0x3aa2c3[_0x52b3e7(0x1dc)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x52b3e7(0x261)](_0x3aa2c3))return{'type':'id','name':_0x3aa2c3};return{'type':'embedded','name':_0x3aa2c3};}export function makeSegmentRef(_0x324b1c){return''+SEGMENT_REF_PREFIX+_0x324b1c;}export function isExternalSegmentRef(_0x35b576){const _0x2ea6c9=a108_0x1761;return _0x35b576[_0x2ea6c9(0x292)](SEGMENT_REF_PREFIX);}function a108_0x1761(_0x527f78,_0x46625e){_0x527f78=_0x527f78-0x1db;const _0x2744ac=a108_0x2744();let _0x17618d=_0x2744ac[_0x527f78];return _0x17618d;}export function isJourneysArrayMode(_0x572cef){const _0x12e5e9=a108_0x1761;return!!(_0x572cef[_0x12e5e9(0x247)]&&_0x572cef['journeys'][_0x12e5e9(0x277)]>0x0);}export function isMultiVersionMode(_0x28c2b3){const _0x69b680=a108_0x1761;return!!(_0x28c2b3[_0x69b680(0x237)]&&_0x28c2b3['versions'][_0x69b680(0x277)]>0x0);}export function isSingleVersionMode(_0x522631){const _0x5b12cb=a108_0x1761;return!!(_0x522631[_0x5b12cb(0x267)]&&_0x522631[_0x5b12cb(0x267)][_0x5b12cb(0x277)]>0x0);}export function hasMultipleVersions(_0x3efc99){const _0x6aba24=a108_0x1761;if(isJourneysArrayMode(_0x3efc99))return(_0x3efc99[_0x6aba24(0x247)]?.[_0x6aba24(0x277)]||0x0)>0x1;if(isMultiVersionMode(_0x3efc99))return(_0x3efc99[_0x6aba24(0x237)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x3846ef){const _0x3bf57e=a108_0x1761;if(isJourneysArrayMode(_0x3846ef))return _0x3846ef;if(isSingleVersionMode(_0x3846ef)){const {stages:_0x2a9356,id:_0x13fc61,version:_0x423543,version_number:_0x15d756,..._0x5e064f}=_0x3846ef;return{..._0x5e064f,'journeys':[{'version':_0x423543||'v1','stages':_0x2a9356||[],'id':_0x13fc61,'version_number':_0x15d756}]};}if(isMultiVersionMode(_0x3846ef)){const {versions:_0x214ff8,..._0x2d0f15}=_0x3846ef;return{..._0x2d0f15,'journeys':(_0x214ff8||[])[_0x3bf57e(0x20e)](_0x52dd75=>({'version':_0x52dd75[_0x3bf57e(0x26f)],'state':_0x52dd75[_0x3bf57e(0x259)],'latest':_0x52dd75['latest'],'stages':_0x52dd75['stages'],'id':_0x52dd75['id'],'version_number':_0x52dd75[_0x3bf57e(0x1fe)]}))};}return _0x3846ef;}export function normalizeJourneyDef(_0x52cfe7,_0x485ee1){const _0x14e77c=a108_0x1761,_0x119611=normalizeToJourneysFormat(_0x52cfe7),_0x17f540=_0x485ee1?.[_0x14e77c(0x283)]?Object[_0x14e77c(0x26e)](_0x485ee1[_0x14e77c(0x283)]):undefined,_0x1907ea=_0x485ee1?.[_0x14e77c(0x1f6)]?Object[_0x14e77c(0x26e)](_0x485ee1[_0x14e77c(0x1f6)]):undefined;return{'type':_0x14e77c(0x244),'name':_0x119611[_0x14e77c(0x26f)],..._0x119611[_0x14e77c(0x1e1)]!==undefined&&{'description':_0x119611['description']},..._0x119611[_0x14e77c(0x290)]&&{'goal':normalizeJourneyCriteria(_0x119611[_0x14e77c(0x290)])},..._0x119611[_0x14e77c(0x24e)]!==undefined&&{'reentry':_0x119611[_0x14e77c(0x24e)]},..._0x119611[_0x14e77c(0x283)]&&{'segments':normalizeEmbeddedSegments(_0x119611['segments'],_0x17f540)},..._0x119611[_0x14e77c(0x1f6)]&&{'activations':normalizeEmbeddedActivations(_0x119611[_0x14e77c(0x1f6)],_0x1907ea)},..._0x119611[_0x14e77c(0x247)]&&{'journeys':_0x119611['journeys']['map'](_0x91fe1f=>normalizeJourneyEntry(_0x91fe1f,_0x119611[_0x14e77c(0x247)][_0x14e77c(0x277)]===0x1))}};}function normalizeJourneyEntry(_0x5131f6,_0x361882){const _0xbcd350=a108_0x1761;return{...!_0x361882&&_0x5131f6['version']!==undefined&&{'version':_0x5131f6[_0xbcd350(0x22c)]},..._0x5131f6[_0xbcd350(0x259)]!==undefined&&{'state':_0x5131f6['state']},...!_0x361882&&_0x5131f6[_0xbcd350(0x1fb)]!==undefined&&{'latest':_0x5131f6['latest']},..._0x5131f6[_0xbcd350(0x290)]&&{'goal':normalizeJourneyCriteria(_0x5131f6[_0xbcd350(0x290)])},..._0x5131f6[_0xbcd350(0x24e)]!==undefined&&{'reentry':_0x5131f6[_0xbcd350(0x24e)]},'stages':_0x5131f6[_0xbcd350(0x267)][_0xbcd350(0x20e)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x534269){const _0xc8b48e=a108_0x1761;return{'name':_0x534269[_0xc8b48e(0x26f)],..._0x534269['description']!==undefined&&{'description':_0x534269['description']},..._0x534269[_0xc8b48e(0x221)]&&{'entry_criteria':normalizeJourneyCriteria(_0x534269[_0xc8b48e(0x221)])},..._0x534269['exit_criteria']&&{'exit_criteria':_0x534269[_0xc8b48e(0x29a)][_0xc8b48e(0x20e)](normalizeJourneyCriteria)},..._0x534269[_0xc8b48e(0x296)]&&{'milestone':normalizeJourneyCriteria(_0x534269[_0xc8b48e(0x296)])},..._0x534269[_0xc8b48e(0x205)]&&{'steps':normalizeStepsWithImplicitNext(_0x534269[_0xc8b48e(0x205)])}};}function normalizeStepsWithImplicitNext(_0x3ea24d){const _0x54a702=a108_0x1761;return _0x3ea24d[_0x54a702(0x20e)]((_0x41eb2f,_0x3a5128)=>{const _0xb0dedd=_0x54a702,_0x3d6eb4=_0x3a5128<_0x3ea24d[_0xb0dedd(0x277)]-0x1?_0x3ea24d[_0x3a5128+0x1][_0xb0dedd(0x26f)]:undefined;return normalizeJourneyStep(_0x41eb2f,_0x3d6eb4);});}function normalizeJourneyCriteria(_0x44b163){const _0x5089cc=a108_0x1761;return{'name':_0x44b163[_0x5089cc(0x26f)],..._0x44b163['description']!==undefined&&{'description':_0x44b163['description']},'segment':_0x44b163['segment'],..._0x44b163['target']&&{'target':normalizeJumpTarget(_0x44b163[_0x5089cc(0x1e9)])}};}function normalizeJourneyStep(_0x47a69b,_0x34958f){const _0x290115=a108_0x1761,_0x1537e3=_0x47a69b['next']!==undefined&&_0x47a69b[_0x290115(0x2a4)]!==_0x34958f,_0xf2de2d={'type':_0x47a69b[_0x290115(0x213)],'name':_0x47a69b[_0x290115(0x26f)],..._0x1537e3&&{'next':_0x47a69b[_0x290115(0x2a4)]}};if(_0x290115(0x249)in _0x47a69b&&_0x47a69b[_0x290115(0x249)])return{..._0xf2de2d,'with':normalizeStepParams(_0x47a69b[_0x290115(0x213)],_0x47a69b[_0x290115(0x249)])};return _0xf2de2d;}function normalizeStepParams(_0x4bfcdf,_0x252f58){const _0xdc6632=a108_0x1761;switch(_0x4bfcdf){case _0xdc6632(0x269):{const _0x5c7084=_0x252f58;let _0x46de38;return _0x5c7084[_0xdc6632(0x236)]&&(_0x46de38={'segment':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x29f)],..._0x5c7084[_0xdc6632(0x236)]['next']!==undefined&&{'next':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x2a4)]},..._0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)]&&{'timeout':{'duration':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)][_0xdc6632(0x241)],'unit':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)][_0xdc6632(0x1e4)],..._0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)][_0xdc6632(0x2a4)]!==undefined&&{'next':_0x5c7084['condition']['timeout'][_0xdc6632(0x2a4)]}}}}),{..._0x5c7084['duration']!==undefined&&{'duration':_0x5c7084[_0xdc6632(0x241)]},..._0x5c7084[_0xdc6632(0x1e4)]!==undefined&&{'unit':_0x5c7084[_0xdc6632(0x1e4)]},..._0x5c7084[_0xdc6632(0x265)]!==undefined&&{'wait_until':_0x5c7084[_0xdc6632(0x265)]},..._0x5c7084[_0xdc6632(0x299)]!==undefined&&{'days_of_week':_0x5c7084[_0xdc6632(0x299)]},..._0x46de38&&{'condition':_0x46de38}};}case _0xdc6632(0x28a):{const _0x2813d3=_0x252f58;return{'activation':_0x2813d3[_0xdc6632(0x28a)]};}case _0xdc6632(0x284):{const _0x1f3aa3=_0x252f58;return{'branches':_0x1f3aa3[_0xdc6632(0x1e7)]['map'](normalizeDecisionBranch)};}case _0xdc6632(0x24c):{const _0x5ceb24=_0x252f58;return{..._0x5ceb24['customized_split']!==undefined&&{'customized_split':_0x5ceb24[_0xdc6632(0x233)]},..._0x5ceb24[_0xdc6632(0x248)]!==undefined&&{'unique_id':_0x5ceb24[_0xdc6632(0x248)]},'variants':_0x5ceb24[_0xdc6632(0x254)]['map'](normalizeAbTestVariant)};}case _0xdc6632(0x20c):{const _0x2106c1=_0x252f58;return{'target':normalizeJumpTarget(_0x2106c1['target'])};}default:return _0x252f58;}}function normalizeDecisionBranch(_0x12c5f3){const _0x1936e8=a108_0x1761;return{'name':_0x12c5f3[_0x1936e8(0x26f)],..._0x12c5f3[_0x1936e8(0x29f)]!==undefined&&{'segment':_0x12c5f3[_0x1936e8(0x29f)]},..._0x12c5f3[_0x1936e8(0x26c)]!==undefined&&{'excluded':_0x12c5f3[_0x1936e8(0x26c)]},..._0x12c5f3[_0x1936e8(0x2a4)]!==undefined&&{'next':_0x12c5f3[_0x1936e8(0x2a4)]}};}function normalizeAbTestVariant(_0xc92a1e){const _0x333243=a108_0x1761;return{..._0xc92a1e['id']!==undefined&&{'id':_0xc92a1e['id']},'name':_0xc92a1e[_0x333243(0x26f)],'percentage':_0xc92a1e[_0x333243(0x1fa)],..._0xc92a1e[_0x333243(0x2a4)]!==undefined&&{'next':_0xc92a1e[_0x333243(0x2a4)]}};}function normalizeJumpTarget(_0x224409){const _0x184b0b=a108_0x1761;return{'journey':_0x224409[_0x184b0b(0x244)],'stage':_0x224409['stage'],..._0x224409['bundle_id']!==undefined&&{'bundle_id':_0x224409[_0x184b0b(0x1ff)]}};}function normalizeEmbeddedSegments(_0x52a974,_0xf9186e){const _0x3ffb26=a108_0x1761,_0x4d3dc2={},_0x495d28=Object[_0x3ffb26(0x26e)](_0x52a974),_0x5952cc=_0xf9186e?[..._0xf9186e[_0x3ffb26(0x25e)](_0x1706f4=>_0x495d28['includes'](_0x1706f4)),..._0x495d28[_0x3ffb26(0x25e)](_0x1a7d92=>!_0xf9186e['includes'](_0x1a7d92))['sort']()]:_0x495d28[_0x3ffb26(0x29d)]();for(const _0x3a8395 of _0x5952cc){const _0x592554=_0x52a974[_0x3a8395];if(_0x592554[_0x3ffb26(0x226)]){const _0x34d6c4=_0x592554[_0x3ffb26(0x226)];if(_0x34d6c4[_0x3ffb26(0x213)]!==_0x3ffb26(0x1e0)&&_0x34d6c4[_0x3ffb26(0x213)]!=='Or'){const _0x3c482c=_0x34d6c4[_0x3ffb26(0x213)]??_0x3ffb26(0x215);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x3a8395+'\x27:\x20'+(_0x3ffb26(0x2a3)+_0x3c482c+'\x27.\x0a')+_0x3ffb26(0x288)+_0x3ffb26(0x1eb)+_0x3ffb26(0x291)+'\x20\x20\x20\x20conditions:\x0a'+_0x3ffb26(0x2a5)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x3ffb26(0x297));}if(!_0x34d6c4[_0x3ffb26(0x2a0)]||!Array[_0x3ffb26(0x289)](_0x34d6c4['conditions']))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x3ffb26(0x201)+_0x3a8395+'\x27:\x20'+'rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a'+_0x3ffb26(0x288)+_0x3ffb26(0x1eb)+(_0x3ffb26(0x272)+_0x34d6c4[_0x3ffb26(0x213)]+'\x0a')+_0x3ffb26(0x256)+_0x3ffb26(0x2a5)+_0x3ffb26(0x1f7)+_0x3ffb26(0x297));}_0x4d3dc2[_0x3a8395]={..._0x592554[_0x3ffb26(0x1e1)]&&_0x592554[_0x3ffb26(0x1e1)]['trim']()&&{'description':_0x592554[_0x3ffb26(0x1e1)]},..._0x592554[_0x3ffb26(0x226)]&&{'rule':deepSortObject(_0x592554[_0x3ffb26(0x226)])}};}return _0x4d3dc2;}function normalizeEmbeddedActivations(_0x24214f,_0x20bed0){const _0x59a80f=a108_0x1761,_0xdf7c2b={},_0x1759ca=Object[_0x59a80f(0x26e)](_0x24214f),_0x37bef9=_0x20bed0?[..._0x20bed0[_0x59a80f(0x25e)](_0x5d52df=>_0x1759ca[_0x59a80f(0x203)](_0x5d52df)),..._0x1759ca['filter'](_0x2f00b6=>!_0x20bed0[_0x59a80f(0x203)](_0x2f00b6))[_0x59a80f(0x29d)]()]:_0x1759ca[_0x59a80f(0x29d)]();for(const _0x1f428f of _0x37bef9){const _0x37c491=_0x24214f[_0x1f428f];_0xdf7c2b[_0x1f428f]={'name':_0x37c491[_0x59a80f(0x26f)],'connection':_0x37c491[_0x59a80f(0x271)],..._0x37c491[_0x59a80f(0x1e1)]!==undefined&&{'description':_0x37c491[_0x59a80f(0x1e1)]},..._0x37c491['all_columns']!==undefined&&{'all_columns':_0x37c491['all_columns']},..._0x37c491['columns']!==undefined&&{'columns':_0x37c491['columns']},..._0x37c491[_0x59a80f(0x246)]!==undefined&&{'behavior':_0x37c491[_0x59a80f(0x246)]},..._0x37c491[_0x59a80f(0x20b)]!==undefined&&{'schedule':_0x37c491[_0x59a80f(0x20b)]},..._0x37c491['notification']!==undefined&&{'notification':_0x37c491[_0x59a80f(0x21d)]},..._0x37c491[_0x59a80f(0x21f)]!==undefined&&{'connector_config':_0x37c491[_0x59a80f(0x21f)]},..._0x37c491[_0x59a80f(0x27f)]!==undefined&&{'activation_template_id':_0x37c491[_0x59a80f(0x27f)]}};}return _0xdf7c2b;}export function getActiveStages(_0x52e8bf){const _0xc613be=a108_0x1761;if(isJourneysArrayMode(_0x52e8bf)){const _0x402264=_0x52e8bf[_0xc613be(0x247)]||[],_0x4cc67a=_0x402264[_0xc613be(0x273)](_0x2dfb4e=>_0x2dfb4e[_0xc613be(0x1fb)]===!![])||_0x402264[0x0];return _0x4cc67a?.[_0xc613be(0x267)]||[];}if(isSingleVersionMode(_0x52e8bf))return _0x52e8bf[_0xc613be(0x267)]||[];if(isMultiVersionMode(_0x52e8bf)){const _0x73dc5d=_0x52e8bf[_0xc613be(0x237)]||[],_0x3321fa=_0x73dc5d[_0xc613be(0x273)](_0x1f6b18=>_0x1f6b18[_0xc613be(0x1fb)]===!![])||_0x73dc5d[0x0];return _0x3321fa?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x232da6){const _0x4ca459=a108_0x1761;if(isJourneysArrayMode(_0x232da6)){const _0x447f97=_0x232da6[_0x4ca459(0x247)]||[];return _0x447f97['find'](_0x40ef1f=>_0x40ef1f[_0x4ca459(0x1fb)]===!![])||_0x447f97[0x0];}if(isMultiVersionMode(_0x232da6)){const _0x1fa72b=_0x232da6[_0x4ca459(0x237)]||[],_0x3b6338=_0x1fa72b['find'](_0x576863=>_0x576863['latest']===!![])||_0x1fa72b[0x0];if(_0x3b6338)return{'version':_0x3b6338['name'],'state':_0x3b6338[_0x4ca459(0x259)],'latest':_0x3b6338[_0x4ca459(0x1fb)],'stages':_0x3b6338['stages'],'id':_0x3b6338['id'],'version_number':_0x3b6338[_0x4ca459(0x1fe)]};}if(isSingleVersionMode(_0x232da6))return{'version':_0x232da6[_0x4ca459(0x22c)]||'v1','state':'draft','stages':_0x232da6[_0x4ca459(0x267)]||[],'id':_0x232da6['id'],'version_number':_0x232da6['version_number'],'goal':_0x232da6[_0x4ca459(0x290)],'reentry':_0x232da6[_0x4ca459(0x24e)]};return undefined;}export function getLatestVersion(_0x2f1350){const _0x41cc41=a108_0x1761;if(!isMultiVersionMode(_0x2f1350))return undefined;const _0x4d6d02=_0x2f1350[_0x41cc41(0x237)]||[];return _0x4d6d02['find'](_0x412836=>_0x412836[_0x41cc41(0x1fb)]===!![])||_0x4d6d02[0x0];}export function getEffectiveGoal(_0x5e5cb9){const _0x406fe0=a108_0x1761,_0x33c6b5=getLatestJourneyEntry(_0x5e5cb9);return _0x33c6b5?.[_0x406fe0(0x290)]||_0x5e5cb9[_0x406fe0(0x290)];}export function getEffectiveReentry(_0x51b6fa){const _0x4a784e=a108_0x1761,_0x419485=getLatestJourneyEntry(_0x51b6fa);return _0x419485?.[_0x4a784e(0x24e)]||_0x51b6fa['reentry'];}export function collectSegmentRefs(_0x6fae26){const _0x31d5d8=a108_0x1761,_0x54eebf=new Set();_0x6fae26[_0x31d5d8(0x290)]?.[_0x31d5d8(0x29f)]&&_0x54eebf[_0x31d5d8(0x28e)](_0x6fae26[_0x31d5d8(0x290)]['segment']);const _0x30a3a4=_0x1503cc=>{const _0xfc0904=_0x31d5d8;for(const _0x6d36a0 of _0x1503cc){_0x6d36a0[_0xfc0904(0x221)]?.[_0xfc0904(0x29f)]&&_0x54eebf['add'](_0x6d36a0[_0xfc0904(0x221)][_0xfc0904(0x29f)]);if(_0x6d36a0[_0xfc0904(0x29a)])for(const _0x2bab83 of _0x6d36a0['exit_criteria']){_0x2bab83[_0xfc0904(0x29f)]&&_0x54eebf['add'](_0x2bab83[_0xfc0904(0x29f)]);}_0x6d36a0['milestone']?.[_0xfc0904(0x29f)]&&_0x54eebf[_0xfc0904(0x28e)](_0x6d36a0[_0xfc0904(0x296)][_0xfc0904(0x29f)]);if(_0x6d36a0['steps'])for(const _0x439557 of _0x6d36a0[_0xfc0904(0x205)]){if(_0x439557[_0xfc0904(0x213)]==='decision_point'){const _0x34c8dd=_0x439557;for(const _0x53f0f4 of _0x34c8dd[_0xfc0904(0x249)][_0xfc0904(0x1e7)]){_0x53f0f4[_0xfc0904(0x29f)]&&_0x54eebf['add'](_0x53f0f4[_0xfc0904(0x29f)]);}}else{if(_0x439557[_0xfc0904(0x213)]===_0xfc0904(0x269)){const _0x597767=_0x439557;_0x597767[_0xfc0904(0x249)][_0xfc0904(0x236)]?.[_0xfc0904(0x29f)]&&_0x54eebf[_0xfc0904(0x28e)](_0x597767[_0xfc0904(0x249)][_0xfc0904(0x236)][_0xfc0904(0x29f)]);}}}}};_0x6fae26['stages']&&_0x30a3a4(_0x6fae26['stages']);if(_0x6fae26[_0x31d5d8(0x237)])for(const _0x2b0b73 of _0x6fae26[_0x31d5d8(0x237)]){_0x30a3a4(_0x2b0b73[_0x31d5d8(0x267)]);}return _0x54eebf;}function a108_0x2744(){const _0x33818c=['reentryMode','journeyId','journeyActivationStepId','Activation','First\x20stage\x20of\x20the\x20journey','shift','Merge',']\x20missing\x20required\x20field:\x20name','stage','duration','journeys:','journeyBundleId','journey','no_reentry','behavior','journeys','unique_id','with','ref','object','ab_test','ABTest','reentry','moveAfter','segments:',':\x20maximum\x208\x20stages\x20allowed','DaysOfTheWeek','resolveActivationId','variants','has','\x20\x20\x20\x20conditions:\x0a','replace','waitStepUnit','state','timeout','resolveSegment','segment_id','Jump','filter','77IJJYXd','versions:','test','exitCriteria','Duration','journeyBundleName','wait_until','excludedPath','stages','Condition','wait','AbTest','isJourneyLocal','excluded','randomUUID','keys','name','folder_id','connection','\x20\x20\x20\x20type:\x20','find','4466440NNeyyI','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','Journey\x20YAML\x20must\x20have\x20type:\x20journey','length','stageId','entryCriteria','parentFolder','resolveSegmentId','allowReentry','day','size','activation_template_id','resolveEmbeddedSegmentId','184PlaPfC','toLowerCase','segments','decision_point','entries','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','18888BpmOMH','Expected\x20format:\x0a','isArray','activation','resolveActivation','journeyName','rootStep','add','reentry:','goal','\x20\x20\x20\x20type:\x20And\x0a','startsWith','exitCriterias','DecisionPoint','].stages','milestone','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','match','days_of_week','exit_criteria','waitStep','trim','sort','Unknown\x20segment\x20\x22','segment','conditions','23829GDnHmP','parse','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','next','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','waitStepType','End','slice','journeyStageId','conditionSegmentId','null','And','description','204632yXdbZk','Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.','unit','7qXSClt','resolveJumpTarget','branches','root_step','target','Send\x20Notification','\x20\x20rule:\x0a',']\x20missing\x20required\x20field:\x20stages','daysOfWeek','Wait\x201\x20Day','versions[','reentry_always','attributes','launched','set','definition','Journey\x20YAML\x20versions[','activations','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','your-activation-name','WaitStep','percentage','latest','conditionTimeoutDuration','week','version_number','bundle_id','Journey\x20YAML\x20journeys[','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','resolveActivationName','includes','waitUntilDate','steps','resolveSegmentName','merge','stageName','timedOutPath','6432450TlroWj','schedule','jump','Jump\x20step\x20\x22','map','journeyStages','embedded','push','all','type','17138781iCqxlk','(missing)','6968665zjENzQ','customizedSplit','end','Journey\x20YAML\x20','goal:','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','data','notification','values','connector_config','Stage\x201','entry_criteria','uuid','Date','segmentId','JOURNEY_SYNTAX_ERROR','rule','resolveJourneyId','Entry\x20Criteria','Stage\x20Complete','activations:','conditionTimeoutUnit','version','from','resolveStageId','Variant',']\x20has\x20invalid\x20state:\x20','relationships','days','customized_split','get','stages:','condition','versions'];a108_0x2744=function(){return _0x33818c;};return a108_0x2744();}export function validateSegmentRefs(_0x55338d){const _0x1d7217=a108_0x1761,_0x2ca795=[],_0x20b377=collectSegmentRefs(_0x55338d),_0x49301f=new Set(Object[_0x1d7217(0x26e)](_0x55338d[_0x1d7217(0x283)]||{}));for(const _0x23b02f of _0x20b377){const _0x3ec3c1=parseSegmentRef(_0x23b02f);_0x3ec3c1[_0x1d7217(0x213)]===_0x1d7217(0x210)&&!_0x49301f[_0x1d7217(0x255)](_0x3ec3c1[_0x1d7217(0x26f)])&&_0x2ca795[_0x1d7217(0x211)](_0x1d7217(0x29e)+_0x3ec3c1[_0x1d7217(0x26f)]+_0x1d7217(0x275)+_0x3ec3c1['name']+_0x1d7217(0x2a6));}return _0x2ca795;}export function collectSegmentIdsFromJourneyApi(_0x121ff1){const _0x2cd3c2=a108_0x1761,_0x93bcd8=new Set();_0x121ff1[_0x2cd3c2(0x1f1)][_0x2cd3c2(0x290)]?.[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x121ff1[_0x2cd3c2(0x1f1)][_0x2cd3c2(0x290)]['segmentId']);const _0x24e1a9=_0x121ff1[_0x2cd3c2(0x1f1)][_0x2cd3c2(0x20f)];if(Array[_0x2cd3c2(0x289)](_0x24e1a9))for(const _0x4df8fb of _0x24e1a9){_0x4df8fb[_0x2cd3c2(0x279)]?.[_0x2cd3c2(0x224)]&&_0x93bcd8['add'](_0x4df8fb[_0x2cd3c2(0x279)][_0x2cd3c2(0x224)]);if(Array[_0x2cd3c2(0x289)](_0x4df8fb[_0x2cd3c2(0x262)]))for(const _0x1df196 of _0x4df8fb[_0x2cd3c2(0x262)]){_0x1df196[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x1df196[_0x2cd3c2(0x224)]);}_0x4df8fb[_0x2cd3c2(0x296)]?.[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x4df8fb[_0x2cd3c2(0x296)][_0x2cd3c2(0x224)]);if(_0x4df8fb[_0x2cd3c2(0x205)]&&typeof _0x4df8fb[_0x2cd3c2(0x205)]===_0x2cd3c2(0x24b)){const _0x240b41=Array[_0x2cd3c2(0x289)](_0x4df8fb[_0x2cd3c2(0x205)])?_0x4df8fb[_0x2cd3c2(0x205)]:Object[_0x2cd3c2(0x21e)](_0x4df8fb[_0x2cd3c2(0x205)]);for(const _0x3e193e of _0x240b41){_0x3e193e['waitCondition']?.[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x3e193e['waitCondition']['segmentId']);if(Array[_0x2cd3c2(0x289)](_0x3e193e[_0x2cd3c2(0x1e7)]))for(const _0x5445e8 of _0x3e193e[_0x2cd3c2(0x1e7)]){_0x5445e8['segmentId']&&_0x93bcd8['add'](_0x5445e8['segmentId']);}}}}return _0x93bcd8;}
|
|
1
|
+
(function(_0x25ee0b,_0x35a212){const _0x36783b=a109_0x34fc,_0x25ddce=_0x25ee0b();while(!![]){try{const _0x392a4b=-parseInt(_0x36783b(0x197))/0x1*(-parseInt(_0x36783b(0xdb))/0x2)+parseInt(_0x36783b(0x146))/0x3*(parseInt(_0x36783b(0x190))/0x4)+-parseInt(_0x36783b(0x131))/0x5*(-parseInt(_0x36783b(0x16d))/0x6)+-parseInt(_0x36783b(0x15a))/0x7+-parseInt(_0x36783b(0x12c))/0x8*(-parseInt(_0x36783b(0xf7))/0x9)+-parseInt(_0x36783b(0xd2))/0xa*(-parseInt(_0x36783b(0x199))/0xb)+-parseInt(_0x36783b(0x139))/0xc;if(_0x392a4b===_0x35a212)break;else _0x25ddce['push'](_0x25ddce['shift']());}catch(_0x379b5c){_0x25ddce['push'](_0x25ddce['shift']());}}}(a109_0x4430,0xa7f62));import*as a109_0x5b586d from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x45bbf9){const _0x570e80=a109_0x34fc,_0x541162=_0x45bbf9[_0x570e80(0x18e)]();if(_0x541162==='days'||_0x541162===_0x570e80(0x186))return _0x570e80(0x186);if(_0x541162===_0x570e80(0x122)||_0x541162===_0x570e80(0x13f))return _0x570e80(0x13f);return _0x45bbf9;}export function journeyResponseToDefSync(_0x5a30df){const _0xf36dd3=a109_0x34fc,_0xbd84fa=_0x5a30df[_0xf36dd3(0x101)],_0xb15b31=_0xbd84fa[_0xf36dd3(0x12e)]||_0xbd84fa[_0xf36dd3(0x12a)],_0x2e3967={'stages':_0xbd84fa[_0xf36dd3(0xff)][_0xf36dd3(0xd0)](convertApiStageToYaml),'id':_0x5a30df['id']};_0xbd84fa[_0xf36dd3(0x12a)]&&_0xbd84fa[_0xf36dd3(0x12a)]!==_0xb15b31&&(_0x2e3967[_0xf36dd3(0x188)]=_0xbd84fa[_0xf36dd3(0x12a)]);_0xbd84fa[_0xf36dd3(0x112)]!==undefined&&(_0x2e3967[_0xf36dd3(0xd7)]=_0xbd84fa[_0xf36dd3(0x112)]);_0xbd84fa[_0xf36dd3(0x19a)]&&(_0x2e3967[_0xf36dd3(0x19a)]=_0xbd84fa['state']===_0xf36dd3(0xf2)?_0xf36dd3(0xf2):_0xf36dd3(0x106));const _0x868bb6={'type':_0xf36dd3(0xc9),'name':_0xb15b31,'journeys':[_0x2e3967]};_0xbd84fa[_0xf36dd3(0xdf)]&&(_0x868bb6['description']=_0xbd84fa[_0xf36dd3(0xdf)]);_0xbd84fa[_0xf36dd3(0x175)]&&(_0x868bb6[_0xf36dd3(0x175)]=convertApiCriteriaToYaml(_0xbd84fa[_0xf36dd3(0x175)]));if(_0xbd84fa[_0xf36dd3(0x163)])_0x868bb6[_0xf36dd3(0x10b)]=_0xbd84fa['reentryMode'];else _0xbd84fa[_0xf36dd3(0x124)]!==undefined&&(_0x868bb6[_0xf36dd3(0x10b)]=_0xbd84fa['allowReentry']?_0xf36dd3(0x153):_0xf36dd3(0xfd));return _0xbd84fa[_0xf36dd3(0x128)]&&(_0x868bb6[_0xf36dd3(0xd1)]=_0xbd84fa[_0xf36dd3(0x128)]),_0xbd84fa[_0xf36dd3(0x12e)]&&(_0x868bb6[_0xf36dd3(0x173)]=_0xbd84fa['journeyBundleName']),_0x5a30df['relationships']?.[_0xf36dd3(0xde)]?.['data']?.['id']&&(_0x868bb6[_0xf36dd3(0x160)]=_0x5a30df[_0xf36dd3(0xf8)][_0xf36dd3(0xde)]['data']['id']),_0x868bb6;}export async function journeyResponseToDef(_0x403ae6,_0x5b55d5){const _0x511d98=a109_0x34fc,_0x11b084=journeyResponseToDefSync(_0x403ae6);if(!_0x5b55d5)return _0x11b084;const _0x42c51e=new Set();collectSegmentIdsFromJourney(_0x11b084,_0x42c51e);const _0x5c714c=new Set();collectActivationIdsFromJourney(_0x11b084,_0x5c714c);const _0x568afc={},_0x553f77=new Map();for(const _0x4bbd7c of Array[_0x511d98(0x17c)](_0x42c51e)[_0x511d98(0x102)]()){if(_0x5b55d5[_0x511d98(0x100)]){const _0x2eda3d=await _0x5b55d5['resolveSegment'](_0x4bbd7c);if(_0x2eda3d[_0x511d98(0x150)]){_0x553f77[_0x511d98(0x18f)](_0x4bbd7c,_0x2eda3d[_0x511d98(0x12a)]);if(_0x2eda3d[_0x511d98(0x15e)]){const _0x24fb5a={..._0x2eda3d[_0x511d98(0x15e)],'rule':deepSortObject(_0x2eda3d[_0x511d98(0x15e)]['rule'])};_0x568afc[_0x2eda3d[_0x511d98(0x12a)]]=_0x24fb5a;}}else _0x553f77[_0x511d98(0x18f)](_0x4bbd7c,makeSegmentRef(_0x2eda3d['name']));}else{if(_0x5b55d5['resolveSegmentName']){const _0x407f83=await _0x5b55d5[_0x511d98(0x136)](_0x4bbd7c);_0x553f77['set'](_0x4bbd7c,_0x407f83);}}}const _0x1a85a6={},_0x4d8028=new Map();for(const _0x699ee0 of Array[_0x511d98(0x17c)](_0x5c714c)[_0x511d98(0x102)]()){if(_0x5b55d5[_0x511d98(0x141)]){const _0x17c095=await _0x5b55d5[_0x511d98(0x141)](_0x699ee0);_0x17c095[_0x511d98(0x150)]?(_0x4d8028['set'](_0x699ee0,_0x17c095[_0x511d98(0x12a)]),_0x17c095['definition']&&(_0x1a85a6[_0x17c095[_0x511d98(0x12a)]]=_0x17c095[_0x511d98(0x15e)])):_0x4d8028[_0x511d98(0x18f)](_0x699ee0,makeSegmentRef(_0x17c095[_0x511d98(0x12a)]));}else{if(_0x5b55d5['resolveActivationName']){const _0x5964c8=await _0x5b55d5[_0x511d98(0x198)](_0x699ee0);_0x4d8028[_0x511d98(0x18f)](_0x699ee0,_0x5964c8);}}}_0x553f77[_0x511d98(0xfe)]>0x0&&replaceSegmentIdsInJourney(_0x11b084,_0x553f77);_0x4d8028[_0x511d98(0xfe)]>0x0&&replaceActivationIdsInJourney(_0x11b084,_0x4d8028);if(_0x5b55d5[_0x511d98(0x154)]){const _0x593025=[];collectJumpTargetsFromJourney(_0x11b084,_0x593025);if(_0x593025[_0x511d98(0x15d)]>0x0){const _0x42819d=new Map();for(const _0x37c962 of _0x593025){try{const _0x4c1f7b=await _0x5b55d5[_0x511d98(0x154)](_0x37c962[_0x511d98(0x1a2)],_0x37c962['stageId']);_0x42819d['set'](_0x37c962[_0x511d98(0x1a2)]+':'+_0x37c962['stageId'],_0x4c1f7b);}catch{}}_0x42819d[_0x511d98(0xfe)]>0x0&&replaceJumpTargetsInJourney(_0x11b084,_0x42819d);}}return Object[_0x511d98(0x162)](_0x568afc)[_0x511d98(0x15d)]>0x0&&(_0x11b084[_0x511d98(0x18b)]=_0x568afc),Object['keys'](_0x1a85a6)[_0x511d98(0x15d)]>0x0&&(_0x11b084[_0x511d98(0x174)]=_0x1a85a6),_0x11b084;}function collectSegmentIdsFromJourney(_0x37c52c,_0x1c73e1){const _0x2a76db=a109_0x34fc;_0x37c52c[_0x2a76db(0x175)]?.[_0x2a76db(0x16b)]&&_0x1c73e1['add'](_0x37c52c[_0x2a76db(0x175)]['segment']);const _0x25521d=_0x2c4007=>{const _0x16e8eb=_0x2a76db;for(const _0x1b4678 of _0x2c4007){_0x1b4678[_0x16e8eb(0xcc)]?.['segment']&&_0x1c73e1[_0x16e8eb(0x119)](_0x1b4678[_0x16e8eb(0xcc)]['segment']);if(_0x1b4678[_0x16e8eb(0x12b)])for(const _0x16cc94 of _0x1b4678[_0x16e8eb(0x12b)]){_0x16cc94['segment']&&_0x1c73e1[_0x16e8eb(0x119)](_0x16cc94['segment']);}_0x1b4678[_0x16e8eb(0x10f)]?.[_0x16e8eb(0x16b)]&&_0x1c73e1[_0x16e8eb(0x119)](_0x1b4678[_0x16e8eb(0x10f)][_0x16e8eb(0x16b)]);if(_0x1b4678[_0x16e8eb(0x123)])for(const _0x5287e6 of _0x1b4678[_0x16e8eb(0x123)]){if(_0x5287e6['type']==='decision_point'){const _0x1c0004=_0x5287e6;for(const _0x49c473 of _0x1c0004['with'][_0x16e8eb(0x1a0)]){_0x49c473['segment']&&_0x1c73e1[_0x16e8eb(0x119)](_0x49c473[_0x16e8eb(0x16b)]);}}else{if(_0x5287e6['type']===_0x16e8eb(0x16c)){const _0x54f0db=_0x5287e6;_0x54f0db[_0x16e8eb(0x127)][_0x16e8eb(0x195)]?.[_0x16e8eb(0x16b)]&&_0x1c73e1['add'](_0x54f0db[_0x16e8eb(0x127)][_0x16e8eb(0x195)]['segment']);}}}}};if(_0x37c52c['journeys'])for(const _0x209e6e of _0x37c52c[_0x2a76db(0xf0)]){_0x209e6e[_0x2a76db(0x175)]?.[_0x2a76db(0x16b)]&&_0x1c73e1['add'](_0x209e6e[_0x2a76db(0x175)][_0x2a76db(0x16b)]),_0x25521d(_0x209e6e[_0x2a76db(0x13b)]);}_0x37c52c['stages']&&_0x25521d(_0x37c52c[_0x2a76db(0x13b)]);if(_0x37c52c[_0x2a76db(0x148)])for(const _0x2f0355 of _0x37c52c[_0x2a76db(0x148)]){_0x25521d(_0x2f0355['stages']);}}function replaceSegmentIdsInJourney(_0x1d5f4c,_0xa7d887){const _0x221d35=a109_0x34fc,_0x309a33=_0x3f748f=>_0xa7d887[_0x221d35(0x187)](_0x3f748f)||_0x3f748f;_0x1d5f4c['goal']?.[_0x221d35(0x16b)]&&(_0x1d5f4c['goal'][_0x221d35(0x16b)]=_0x309a33(_0x1d5f4c[_0x221d35(0x175)][_0x221d35(0x16b)]));const _0x3dff0b=_0x355b3b=>{const _0x5993ee=_0x221d35;for(const _0x433fa5 of _0x355b3b){_0x433fa5['entry_criteria']?.[_0x5993ee(0x16b)]&&(_0x433fa5[_0x5993ee(0xcc)][_0x5993ee(0x16b)]=_0x309a33(_0x433fa5[_0x5993ee(0xcc)][_0x5993ee(0x16b)]));if(_0x433fa5[_0x5993ee(0x12b)])for(const _0x127200 of _0x433fa5[_0x5993ee(0x12b)]){_0x127200[_0x5993ee(0x16b)]&&(_0x127200[_0x5993ee(0x16b)]=_0x309a33(_0x127200[_0x5993ee(0x16b)]));}_0x433fa5[_0x5993ee(0x10f)]?.[_0x5993ee(0x16b)]&&(_0x433fa5[_0x5993ee(0x10f)][_0x5993ee(0x16b)]=_0x309a33(_0x433fa5[_0x5993ee(0x10f)][_0x5993ee(0x16b)]));if(_0x433fa5[_0x5993ee(0x123)])for(const _0x470b94 of _0x433fa5[_0x5993ee(0x123)]){if(_0x470b94[_0x5993ee(0x15c)]===_0x5993ee(0x10d)){const _0x9ad937=_0x470b94;for(const _0x233e12 of _0x9ad937[_0x5993ee(0x127)][_0x5993ee(0x1a0)]){_0x233e12[_0x5993ee(0x16b)]&&(_0x233e12['segment']=_0x309a33(_0x233e12['segment']));}}else{if(_0x470b94[_0x5993ee(0x15c)]===_0x5993ee(0x16c)){const _0x5e6e50=_0x470b94;_0x5e6e50['with'][_0x5993ee(0x195)]?.[_0x5993ee(0x16b)]&&(_0x5e6e50[_0x5993ee(0x127)][_0x5993ee(0x195)][_0x5993ee(0x16b)]=_0x309a33(_0x5e6e50[_0x5993ee(0x127)]['condition'][_0x5993ee(0x16b)]));}}}}};if(_0x1d5f4c[_0x221d35(0xf0)])for(const _0x27ac02 of _0x1d5f4c[_0x221d35(0xf0)]){_0x27ac02[_0x221d35(0x175)]?.['segment']&&(_0x27ac02['goal'][_0x221d35(0x16b)]=_0x309a33(_0x27ac02[_0x221d35(0x175)]['segment'])),_0x3dff0b(_0x27ac02[_0x221d35(0x13b)]);}_0x1d5f4c['stages']&&_0x3dff0b(_0x1d5f4c[_0x221d35(0x13b)]);if(_0x1d5f4c[_0x221d35(0x148)])for(const _0x3da206 of _0x1d5f4c[_0x221d35(0x148)]){_0x3dff0b(_0x3da206[_0x221d35(0x13b)]);}}function collectActivationIdsFromJourney(_0x30da88,_0x54064e){const _0x438fac=a109_0x34fc,_0x2a06d8=_0x3aff32=>{const _0x492103=a109_0x34fc;for(const _0x1beb84 of _0x3aff32){if(_0x1beb84[_0x492103(0x123)])for(const _0x8fe49a of _0x1beb84['steps']){if(_0x8fe49a[_0x492103(0x15c)]==='activation'){const _0x177526=_0x8fe49a;_0x177526[_0x492103(0x127)][_0x492103(0x19d)]&&/^\d+$/[_0x492103(0x176)](_0x177526['with'][_0x492103(0x19d)])&&_0x54064e[_0x492103(0x119)](_0x177526['with']['activation']);}}}};if(_0x30da88['journeys'])for(const _0x32c121 of _0x30da88[_0x438fac(0xf0)]){_0x2a06d8(_0x32c121[_0x438fac(0x13b)]);}_0x30da88[_0x438fac(0x13b)]&&_0x2a06d8(_0x30da88[_0x438fac(0x13b)]);if(_0x30da88[_0x438fac(0x148)])for(const _0x31123f of _0x30da88[_0x438fac(0x148)]){_0x2a06d8(_0x31123f[_0x438fac(0x13b)]);}}function replaceActivationIdsInJourney(_0x178016,_0x5184d9){const _0x14319f=a109_0x34fc,_0x469331=_0x44054f=>_0x5184d9[_0x14319f(0x187)](_0x44054f)||_0x44054f,_0x30d5fb=_0x4fdf6c=>{const _0x34325c=_0x14319f;for(const _0x52d60f of _0x4fdf6c){if(_0x52d60f['steps'])for(const _0x159bc1 of _0x52d60f[_0x34325c(0x123)]){if(_0x159bc1[_0x34325c(0x15c)]===_0x34325c(0x19d)){const _0x4967d6=_0x159bc1;_0x4967d6[_0x34325c(0x127)][_0x34325c(0x19d)]&&(_0x4967d6[_0x34325c(0x127)]['activation']=_0x469331(_0x4967d6[_0x34325c(0x127)]['activation']));}}}};if(_0x178016['journeys'])for(const _0x4d6f19 of _0x178016[_0x14319f(0xf0)]){_0x30d5fb(_0x4d6f19[_0x14319f(0x13b)]);}_0x178016[_0x14319f(0x13b)]&&_0x30d5fb(_0x178016['stages']);if(_0x178016['versions'])for(const _0x3c33c7 of _0x178016['versions']){_0x30d5fb(_0x3c33c7[_0x14319f(0x13b)]);}}function a109_0x34fc(_0x1c2f9c,_0x32c632){_0x1c2f9c=_0x1c2f9c-0xc9;const _0x443065=a109_0x4430();let _0x34fc2a=_0x443065[_0x1c2f9c];return _0x34fc2a;}function collectJumpTargetsFromJourney(_0x372d2b,_0x4be18f){const _0x564e72=a109_0x34fc,_0x2406a5=new Set(),_0x55ffa5=_0x1f2023=>{const _0x1ec210=a109_0x34fc;for(const _0x51aee5 of _0x1f2023){if(_0x51aee5['steps'])for(const _0x37cf2f of _0x51aee5[_0x1ec210(0x123)]){if(_0x37cf2f[_0x1ec210(0x15c)]===_0x1ec210(0xf4)){const _0x44a98f=_0x37cf2f,_0x319b30=_0x44a98f['with'][_0x1ec210(0xe6)];if(_0x319b30[_0x1ec210(0xc9)]&&_0x319b30[_0x1ec210(0x105)]&&/^\d+$/[_0x1ec210(0x176)](_0x319b30[_0x1ec210(0xc9)])&&/^\d+$/[_0x1ec210(0x176)](_0x319b30[_0x1ec210(0x105)])){const _0x4d5267=_0x319b30[_0x1ec210(0xc9)]+':'+_0x319b30[_0x1ec210(0x105)];!_0x2406a5[_0x1ec210(0x10c)](_0x4d5267)&&(_0x2406a5[_0x1ec210(0x119)](_0x4d5267),_0x4be18f[_0x1ec210(0x134)]({'journeyId':_0x319b30['journey'],'stageId':_0x319b30[_0x1ec210(0x105)]}));}}}}};if(_0x372d2b[_0x564e72(0xf0)])for(const _0x38486e of _0x372d2b[_0x564e72(0xf0)]){_0x55ffa5(_0x38486e[_0x564e72(0x13b)]);}_0x372d2b['stages']&&_0x55ffa5(_0x372d2b[_0x564e72(0x13b)]);if(_0x372d2b[_0x564e72(0x148)])for(const _0x280b86 of _0x372d2b['versions']){_0x55ffa5(_0x280b86[_0x564e72(0x13b)]);}}function replaceJumpTargetsInJourney(_0x2aba66,_0x1052cc){const _0x1c5984=a109_0x34fc,_0x244499=_0x3daf23=>{const _0x303d16=a109_0x34fc;for(const _0x5a318c of _0x3daf23){if(_0x5a318c[_0x303d16(0x123)])for(const _0x275ff5 of _0x5a318c[_0x303d16(0x123)]){if(_0x275ff5[_0x303d16(0x15c)]===_0x303d16(0xf4)){const _0x1013ba=_0x275ff5,_0x5b1f53=_0x1013ba['with']['target'],_0x53232d=_0x5b1f53[_0x303d16(0xc9)]+':'+_0x5b1f53[_0x303d16(0x105)],_0x47c850=_0x1052cc['get'](_0x53232d);_0x47c850&&(_0x5b1f53[_0x303d16(0xc9)]=_0x47c850['journeyName'],_0x5b1f53[_0x303d16(0x105)]=_0x47c850[_0x303d16(0xf9)]);}}}};if(_0x2aba66[_0x1c5984(0xf0)])for(const _0x1a0d19 of _0x2aba66[_0x1c5984(0xf0)]){_0x244499(_0x1a0d19[_0x1c5984(0x13b)]);}_0x2aba66['stages']&&_0x244499(_0x2aba66[_0x1c5984(0x13b)]);if(_0x2aba66[_0x1c5984(0x148)])for(const _0x31727b of _0x2aba66[_0x1c5984(0x148)]){_0x244499(_0x31727b['stages']);}}function generateReadableStepName(_0x3c3698,_0x39358e){const _0x212fb9=a109_0x34fc;if(_0x3c3698[_0x212fb9(0x12a)]&&_0x3c3698['name']!==_0x3c3698[_0x212fb9(0x15c)]){const _0x474927=_0x3c3698[_0x212fb9(0x12a)][_0x212fb9(0xe3)]();if(_0x474927&&/[a-z0-9]/i['test'](_0x474927))return _0x474927;}const _0x41cddb=_0x3c3698[_0x212fb9(0x15c)][_0x212fb9(0x18e)]()[_0x212fb9(0x11f)](/step$/i,'');return _0x41cddb+'_'+(_0x39358e+0x1);}function getStepNextRefs(_0x530101){const _0x1c3156=a109_0x34fc,_0x5b34a1=[];if(_0x530101[_0x1c3156(0x11c)])_0x5b34a1[_0x1c3156(0x134)](_0x530101[_0x1c3156(0x11c)]);if(_0x530101[_0x1c3156(0x1a0)])for(const _0x92518f of _0x530101[_0x1c3156(0x1a0)]){if(_0x92518f['next'])_0x5b34a1['push'](_0x92518f[_0x1c3156(0x11c)]);}if(_0x530101[_0x1c3156(0xd9)])for(const _0x3ae17b of _0x530101['variants']){if(_0x3ae17b['next'])_0x5b34a1[_0x1c3156(0x134)](_0x3ae17b[_0x1c3156(0x11c)]);}if(_0x530101['conditions'])for(const _0x49fee6 of _0x530101[_0x1c3156(0x133)]){if(_0x49fee6[_0x1c3156(0x11c)])_0x5b34a1[_0x1c3156(0x134)](_0x49fee6[_0x1c3156(0x11c)]);}return _0x5b34a1;}function parseJumpTargetDisplayName(_0x2c9af0){const _0xbe7466=a109_0x34fc,_0x26c722=_0x2c9af0[_0xbe7466(0x181)](/^(.+?)\s*\(([^/)]+)/);if(!_0x26c722)return undefined;const _0x2e2be5=_0x26c722[0x1][_0xbe7466(0xe3)](),_0x193fdc=_0x26c722[0x2][_0xbe7466(0xe3)]();if(!_0x2e2be5||!_0x193fdc)return undefined;return{'stageName':_0x2e2be5,'journeyName':_0x193fdc};}function orderStepsFromRoot(_0x54fedc,_0x4e799f){const _0x488f0f=a109_0x34fc,_0x282e20=Object[_0x488f0f(0x114)](_0x54fedc);if(_0x282e20[_0x488f0f(0x15d)]===0x0)return[];const _0x284ac0=new Set(_0x282e20[_0x488f0f(0xd0)](([_0x4410a7])=>_0x4410a7)),_0x33fa06=new Set();for(const [,_0xb0743f]of _0x282e20){for(const _0x417149 of getStepNextRefs(_0xb0743f)){if(_0x284ac0['has'](_0x417149))_0x33fa06['add'](_0x417149);}}let _0x19e0ad=_0x4e799f&&_0x284ac0[_0x488f0f(0x10c)](_0x4e799f)?_0x4e799f:undefined;if(!_0x19e0ad){const _0x57948b=_0x282e20[_0x488f0f(0x15f)](([_0x532d8c])=>!_0x33fa06[_0x488f0f(0x10c)](_0x532d8c));_0x57948b[_0x488f0f(0x15d)]>0x0?_0x19e0ad=_0x57948b[0x0][0x0]:_0x19e0ad=_0x282e20[0x0][0x0];}const _0x324fec=[],_0x2f7b3f=new Set(),_0x10b810=[_0x19e0ad];while(_0x10b810['length']>0x0){const _0x463b12=_0x10b810['shift']();if(_0x2f7b3f[_0x488f0f(0x10c)](_0x463b12))continue;_0x2f7b3f[_0x488f0f(0x119)](_0x463b12);const _0x44f07a=_0x54fedc[_0x463b12];if(!_0x44f07a)continue;_0x324fec[_0x488f0f(0x134)]({'uuid':_0x463b12,'step':_0x44f07a});for(const _0x73d6e0 of getStepNextRefs(_0x44f07a)){_0x284ac0[_0x488f0f(0x10c)](_0x73d6e0)&&!_0x2f7b3f[_0x488f0f(0x10c)](_0x73d6e0)&&_0x10b810[_0x488f0f(0x134)](_0x73d6e0);}}for(const [_0x12505a,_0x4bcf96]of _0x282e20){!_0x2f7b3f['has'](_0x12505a)&&_0x324fec[_0x488f0f(0x134)]({'uuid':_0x12505a,'step':_0x4bcf96});}return _0x324fec;}function resolveStepReferences(_0x5b1e4d,_0x1e8d74,_0x2239d8,_0x47e6cb){const _0x3497ec=a109_0x34fc;if(_0x5b1e4d[_0x3497ec(0x15c)]!==_0x3497ec(0xd6)){_0x5b1e4d['next']&&_0x47e6cb['has'](_0x5b1e4d[_0x3497ec(0x11c)])&&(_0x5b1e4d[_0x3497ec(0x11c)]=_0x47e6cb[_0x3497ec(0x187)](_0x5b1e4d[_0x3497ec(0x11c)]));const _0x5a7987=_0x1e8d74+0x1;if(_0x5a7987<_0x2239d8[_0x3497ec(0x15d)]){const _0x538039=_0x47e6cb[_0x3497ec(0x187)](_0x2239d8[_0x5a7987][_0x3497ec(0xe1)]);_0x5b1e4d[_0x3497ec(0x11c)]===_0x538039&&delete _0x5b1e4d[_0x3497ec(0x11c)];}}if(_0x5b1e4d['type']==='decision_point')for(const _0x56af41 of _0x5b1e4d['with']['branches']){_0x56af41[_0x3497ec(0x11c)]&&_0x47e6cb[_0x3497ec(0x10c)](_0x56af41[_0x3497ec(0x11c)])&&(_0x56af41[_0x3497ec(0x11c)]=_0x47e6cb[_0x3497ec(0x187)](_0x56af41['next']));}if(_0x5b1e4d[_0x3497ec(0x15c)]===_0x3497ec(0xed))for(const _0x632bd4 of _0x5b1e4d[_0x3497ec(0x127)][_0x3497ec(0xd9)]){_0x632bd4[_0x3497ec(0x11c)]&&_0x47e6cb[_0x3497ec(0x10c)](_0x632bd4[_0x3497ec(0x11c)])&&(_0x632bd4['next']=_0x47e6cb['get'](_0x632bd4[_0x3497ec(0x11c)]));}if(_0x5b1e4d[_0x3497ec(0x15c)]==='wait'&&_0x5b1e4d[_0x3497ec(0x127)][_0x3497ec(0x195)]){const _0x2edfc8=_0x5b1e4d[_0x3497ec(0x127)]['condition'];_0x2edfc8[_0x3497ec(0x11c)]&&_0x47e6cb['has'](_0x2edfc8[_0x3497ec(0x11c)])&&(_0x2edfc8['next']=_0x47e6cb[_0x3497ec(0x187)](_0x2edfc8['next'])),_0x2edfc8[_0x3497ec(0x15b)]?.['next']&&_0x47e6cb[_0x3497ec(0x10c)](_0x2edfc8[_0x3497ec(0x15b)][_0x3497ec(0x11c)])&&(_0x2edfc8['timeout']['next']=_0x47e6cb[_0x3497ec(0x187)](_0x2edfc8[_0x3497ec(0x15b)][_0x3497ec(0x11c)]));}}function convertApiStageToYaml(_0x141617){const _0x2843ca=a109_0x34fc,_0x2dab68={'name':_0x141617[_0x2843ca(0x12a)]};_0x141617['id']&&(_0x2dab68['id']=_0x141617['id']);_0x141617['description']&&(_0x2dab68[_0x2843ca(0xdf)]=_0x141617[_0x2843ca(0xdf)]);_0x141617[_0x2843ca(0x168)]&&(_0x2dab68[_0x2843ca(0xcc)]=convertApiCriteriaToYaml(_0x141617[_0x2843ca(0x168)]));_0x141617[_0x2843ca(0xf5)]&&_0x141617[_0x2843ca(0xf5)]['length']>0x0&&(_0x2dab68[_0x2843ca(0x12b)]=_0x141617[_0x2843ca(0xf5)][_0x2843ca(0xd0)](convertApiCriteriaToYaml));_0x141617[_0x2843ca(0x10f)]&&(_0x2dab68[_0x2843ca(0x10f)]=convertApiCriteriaToYaml(_0x141617[_0x2843ca(0x10f)]));if(_0x141617['steps']&&Object[_0x2843ca(0x162)](_0x141617[_0x2843ca(0x123)])['length']>0x0){const _0x371b8b=orderStepsFromRoot(_0x141617['steps'],_0x141617[_0x2843ca(0xdc)]),_0x53b669=new Map(),_0x2bc6dc=new Set();for(let _0x156f4c=0x0;_0x156f4c<_0x371b8b[_0x2843ca(0x15d)];_0x156f4c++){const {uuid:_0xbe38ac,step:_0x46a1dc}=_0x371b8b[_0x156f4c];let _0x5d7d6b=generateReadableStepName(_0x46a1dc,_0x156f4c),_0x35dba3=_0x5d7d6b,_0x52ef44=0x2;while(_0x2bc6dc[_0x2843ca(0x10c)](_0x35dba3)){_0x35dba3=_0x5d7d6b+'_'+_0x52ef44,_0x52ef44++;}_0x2bc6dc[_0x2843ca(0x119)](_0x35dba3),_0x53b669[_0x2843ca(0x18f)](_0xbe38ac,_0x35dba3);}_0x2dab68[_0x2843ca(0x123)]=_0x371b8b['map'](({uuid:_0x4d3968,step:_0x5ba01b},_0x73502)=>{const _0x5bdaf9=_0x2843ca,_0xe5cbe7=convertApiStepToYaml(_0x5ba01b,_0x53b669[_0x5bdaf9(0x187)](_0x4d3968));return resolveStepReferences(_0xe5cbe7,_0x73502,_0x371b8b,_0x53b669),_0xe5cbe7;});}return _0x2dab68;}function convertApiCriteriaToYaml(_0x2fe3b6){const _0x8ac32a=a109_0x34fc,_0x1afe2a={'name':_0x2fe3b6[_0x8ac32a(0x12a)],'segment':_0x2fe3b6['segmentId']};_0x2fe3b6['description']&&(_0x1afe2a[_0x8ac32a(0xdf)]=_0x2fe3b6[_0x8ac32a(0xdf)]);if(_0x2fe3b6[_0x8ac32a(0xe6)]){let _0x3b45b2=_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x1a2)],_0x508122=_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x196)];if(_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x167)]){const _0x50cce4=parseJumpTargetDisplayName(_0x2fe3b6[_0x8ac32a(0xe6)][_0x8ac32a(0x167)]);_0x50cce4&&(_0x508122=_0x50cce4[_0x8ac32a(0xf9)],_0x3b45b2=_0x50cce4[_0x8ac32a(0x167)]);}_0x1afe2a[_0x8ac32a(0xe6)]={'journey':_0x3b45b2,'stage':_0x508122},_0x2fe3b6['target'][_0x8ac32a(0x128)]&&(_0x1afe2a[_0x8ac32a(0xe6)]['bundle_id']=_0x2fe3b6['target'][_0x8ac32a(0x128)]);}return _0x1afe2a;}function convertApiStepToYaml(_0x2160ec,_0x367f10){const _0x34030c=a109_0x34fc;switch(_0x2160ec[_0x34030c(0x15c)]){case _0x34030c(0x166):{const _0x360aa8={};if(_0x2160ec[_0x34030c(0x193)]==='Duration'&&_0x2160ec[_0x34030c(0x12f)]!==undefined)_0x360aa8[_0x34030c(0xf1)]=_0x2160ec[_0x34030c(0x12f)],_0x360aa8[_0x34030c(0x18c)]=_0x2160ec[_0x34030c(0x147)];else{if(_0x2160ec[_0x34030c(0x193)]===_0x34030c(0x121)&&_0x2160ec[_0x34030c(0x170)])_0x360aa8[_0x34030c(0xd3)]=_0x2160ec[_0x34030c(0x170)];else{if(_0x2160ec[_0x34030c(0x193)]===_0x34030c(0x14e)&&_0x2160ec['daysOfWeek'])_0x360aa8[_0x34030c(0xf3)]=_0x2160ec[_0x34030c(0xef)];else{if(_0x2160ec[_0x34030c(0x193)]===_0x34030c(0x115)){if(_0x2160ec[_0x34030c(0x133)]&&_0x2160ec[_0x34030c(0x133)][_0x34030c(0x15d)]>0x0){const _0x1ca204=_0x2160ec[_0x34030c(0x133)]['find'](_0x417232=>!_0x417232[_0x34030c(0x18a)]),_0xfdb1e1=_0x2160ec['conditions'][_0x34030c(0x16a)](_0x4b4fb4=>_0x4b4fb4[_0x34030c(0x18a)]);_0x1ca204?.['segmentId']&&(_0x360aa8[_0x34030c(0x195)]={'segment':_0x1ca204[_0x34030c(0x19c)],..._0x1ca204[_0x34030c(0x11c)]?{'next':_0x1ca204[_0x34030c(0x11c)]}:{}},_0xfdb1e1&&_0xfdb1e1[_0x34030c(0xfc)]!==undefined&&_0xfdb1e1['unit']&&(_0x360aa8[_0x34030c(0x195)][_0x34030c(0x15b)]={'duration':_0xfdb1e1[_0x34030c(0xfc)],'unit':_0xfdb1e1['unit'],..._0xfdb1e1['next']?{'next':_0xfdb1e1[_0x34030c(0x11c)]}:{}}));}else _0x2160ec[_0x34030c(0x16f)]&&(_0x360aa8[_0x34030c(0x195)]={'segment':_0x2160ec['conditionSegmentId']},_0x2160ec[_0x34030c(0x14f)]!==undefined&&_0x2160ec[_0x34030c(0xe0)]&&(_0x360aa8[_0x34030c(0x195)]['timeout']={'duration':_0x2160ec[_0x34030c(0x14f)],'unit':_0x2160ec['conditionTimeoutUnit']}));}}}}const _0x8eb312={'type':'wait','name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec['next']}:{},'with':_0x360aa8};return _0x8eb312;}case _0x34030c(0xf6):{const _0x2e9b55={'type':_0x34030c(0x19d),'name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec[_0x34030c(0x11c)]}:{},'with':{'activation':_0x2160ec[_0x34030c(0x13e)]||''}};return _0x2e9b55;}case _0x34030c(0x17a):{const _0x57ca90={'type':'decision_point','name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec['next']}:{},'with':{'branches':(_0x2160ec[_0x34030c(0x1a0)]||[])[_0x34030c(0xd0)](_0x1fca46=>({'name':_0x1fca46[_0x34030c(0x12a)],'segment':_0x1fca46[_0x34030c(0x19c)],'excluded':_0x1fca46[_0x34030c(0x129)],..._0x1fca46[_0x34030c(0x11c)]?{'next':_0x1fca46['next']}:{}}))}};return _0x57ca90;}case _0x34030c(0xda):case _0x34030c(0x169):case _0x34030c(0xfb):{const _0x23bce0=_0x2160ec[_0x34030c(0xd9)]||(_0x2160ec[_0x34030c(0x1a0)]||[])[_0x34030c(0xd0)](_0x46915d=>({'name':_0x46915d[_0x34030c(0x12a)],'percentage':0x0,'next':_0x46915d[_0x34030c(0x11c)]})),_0x45dc65={'type':'ab_test','name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec[_0x34030c(0x11c)]}:{},'with':{'customized_split':_0x2160ec['customizedSplit'],'unique_id':_0x2160ec[_0x34030c(0x17b)],'variants':_0x23bce0['map'](_0x3073d7=>({'name':_0x3073d7[_0x34030c(0x12a)],'percentage':_0x3073d7[_0x34030c(0x151)],..._0x3073d7[_0x34030c(0x11c)]?{'next':_0x3073d7[_0x34030c(0x11c)]}:{}}))}};return _0x45dc65;}case _0x34030c(0x165):{const _0x1b3f59={'type':_0x34030c(0xe2),'name':_0x367f10,..._0x2160ec[_0x34030c(0x11c)]?{'next':_0x2160ec['next']}:{}};return _0x1b3f59;}case _0x34030c(0x194):{if(!_0x2160ec[_0x34030c(0xe6)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Jump\x20step\x20\x22'+(_0x2160ec[_0x34030c(0x12a)]||_0x367f10)+_0x34030c(0x117));let _0x280af0=_0x2160ec[_0x34030c(0xe6)][_0x34030c(0x1a2)],_0x1aa04e=_0x2160ec['target']['journeyStageId'];if(_0x2160ec['target'][_0x34030c(0x167)]){const _0x1a5c8f=parseJumpTargetDisplayName(_0x2160ec[_0x34030c(0xe6)]['journeyName']);_0x1a5c8f&&(_0x1aa04e=_0x1a5c8f['stageName'],_0x280af0=_0x1a5c8f['journeyName']);}const _0xb02ee0={'type':_0x34030c(0xf4),'name':_0x367f10,..._0x2160ec['next']?{'next':_0x2160ec[_0x34030c(0x11c)]}:{},'with':{'target':{'journey':_0x280af0,'stage':_0x1aa04e,'bundle_id':_0x2160ec['target'][_0x34030c(0x128)]}}};return _0xb02ee0;}case _0x34030c(0x185):{const _0x174243={'type':'end','name':_0x367f10};return _0x174243;}default:{const _0x116b3e={'type':_0x34030c(0xd6),'name':_0x367f10};return _0x116b3e;}}}export async function journeyDefToRequest(_0x365454,_0x41d393,_0x46d26d){const _0x261de5=a109_0x34fc,_0x38c332=_0x365454[_0x261de5(0x13b)]||getActiveStages(_0x365454),_0x56160c=_0x365454[_0x261de5(0x18b)]||{},_0xc80217=_0x365454[_0x261de5(0x174)]||{},_0x66bcb4={'type':_0x261de5(0xc9),'attributes':{'name':_0x365454[_0x261de5(0x12a)],'audienceId':_0x41d393,'journeyStages':await Promise[_0x261de5(0xcb)](_0x38c332[_0x261de5(0xd0)](_0x54f95f=>convertYamlStageToApi(_0x54f95f,_0x46d26d,_0x56160c,_0xc80217)))}};_0x365454['id']&&(_0x66bcb4['id']=_0x365454['id']);_0x365454[_0x261de5(0xdf)]&&(_0x66bcb4[_0x261de5(0x101)][_0x261de5(0xdf)]=_0x365454[_0x261de5(0xdf)]);const _0x51e0cf=getEffectiveGoal(_0x365454);_0x51e0cf&&(_0x66bcb4[_0x261de5(0x101)]['goal']=await convertYamlCriteriaToApi(_0x51e0cf,_0x46d26d,_0x56160c));const _0x266b50=getEffectiveReentry(_0x365454);return _0x266b50&&(_0x66bcb4['attributes'][_0x261de5(0x163)]=_0x266b50,_0x66bcb4['attributes'][_0x261de5(0x124)]=_0x266b50!==_0x261de5(0xfd)),_0x365454['folder_id']&&(_0x66bcb4[_0x261de5(0xf8)]={'parentFolder':{'data':{'id':_0x365454[_0x261de5(0x160)],'type':_0x261de5(0x108)}}}),_0x66bcb4;}async function convertYamlStageToApi(_0x176f03,_0x34f263,_0x233af9={},_0x5c20fe={}){const _0x4ad8d1=a109_0x34fc,_0x5e8d0b={'name':_0x176f03[_0x4ad8d1(0x12a)]};_0x176f03['id']&&(_0x5e8d0b['id']=_0x176f03['id']);_0x176f03['description']&&(_0x5e8d0b[_0x4ad8d1(0xdf)]=_0x176f03[_0x4ad8d1(0xdf)]);_0x176f03[_0x4ad8d1(0xcc)]&&(_0x5e8d0b['entryCriteria']=await convertYamlCriteriaToApi(_0x176f03['entry_criteria'],_0x34f263,_0x233af9));_0x176f03[_0x4ad8d1(0x12b)]&&_0x176f03['exit_criteria'][_0x4ad8d1(0x15d)]>0x0&&(_0x5e8d0b['exitCriterias']=await Promise[_0x4ad8d1(0xcb)](_0x176f03['exit_criteria'][_0x4ad8d1(0xd0)](_0x8211d3=>convertYamlCriteriaToApi(_0x8211d3,_0x34f263,_0x233af9))));_0x176f03[_0x4ad8d1(0x10f)]&&(_0x5e8d0b[_0x4ad8d1(0x10f)]=await convertYamlCriteriaToApi(_0x176f03['milestone'],_0x34f263,_0x233af9));if(_0x176f03[_0x4ad8d1(0x123)]&&_0x176f03[_0x4ad8d1(0x123)]['length']>0x0){const _0x43e021={},_0x46e4a6=_0x176f03[_0x4ad8d1(0x123)][_0x4ad8d1(0xd0)]((_0x2fa94e,_0x19266b)=>{const _0x3e8c40=_0x4ad8d1,_0x3036f6=_0x2fa94e[_0x3e8c40(0xe1)]||generateUUID(),_0x102944=_0x2fa94e[_0x3e8c40(0x12a)]||_0x2fa94e[_0x3e8c40(0x15c)]+'_'+_0x19266b;return _0x43e021[_0x102944]=_0x3036f6,{..._0x2fa94e,'name':_0x102944};});_0x5e8d0b['rootStep']=_0x43e021[_0x46e4a6[0x0][_0x4ad8d1(0x12a)]],_0x5e8d0b[_0x4ad8d1(0x123)]={};for(let _0x50cf43=0x0;_0x50cf43<_0x46e4a6[_0x4ad8d1(0x15d)];_0x50cf43++){const _0x1ed38a=_0x46e4a6[_0x50cf43],_0xe04a06=_0x43e021[_0x1ed38a[_0x4ad8d1(0x12a)]],_0x3be6c1=!_0x1ed38a['next']&&_0x50cf43<_0x46e4a6[_0x4ad8d1(0x15d)]-0x1&&_0x1ed38a[_0x4ad8d1(0x15c)]!==_0x4ad8d1(0xd6)?_0x46e4a6[_0x50cf43+0x1][_0x4ad8d1(0x12a)]:_0x1ed38a[_0x4ad8d1(0x11c)],_0x20ce2d=_0x3be6c1!==_0x1ed38a[_0x4ad8d1(0x11c)]?{..._0x1ed38a,'next':_0x3be6c1}:_0x1ed38a;_0x5e8d0b[_0x4ad8d1(0x123)][_0xe04a06]=await convertYamlStepToApi(_0x20ce2d,_0x34f263,_0x233af9,_0x43e021,_0x5c20fe);}}else _0x176f03['root_step']&&(_0x5e8d0b[_0x4ad8d1(0xdc)]=_0x176f03[_0x4ad8d1(0x125)]);return _0x5e8d0b;}async function convertYamlCriteriaToApi(_0x56b2d5,_0x107ffa,_0x4f8c0e={}){const _0x3ce7be=a109_0x34fc;let _0x192fef=_0x56b2d5[_0x3ce7be(0x16b)];if(_0x192fef&&!/^\d+$/[_0x3ce7be(0x176)](_0x192fef)){const _0x268fb8=parseSegmentRef(_0x192fef);if(_0x268fb8[_0x3ce7be(0x15c)]===_0x3ce7be(0x180))_0x107ffa?.[_0x3ce7be(0x192)]&&(_0x192fef=await _0x107ffa[_0x3ce7be(0x192)](_0x268fb8[_0x3ce7be(0x12a)]));else{if(_0x268fb8[_0x3ce7be(0x15c)]===_0x3ce7be(0x157)&&_0x4f8c0e[_0x268fb8[_0x3ce7be(0x12a)]])_0x107ffa?.[_0x3ce7be(0x11a)]&&(_0x192fef=await _0x107ffa[_0x3ce7be(0x11a)](_0x268fb8[_0x3ce7be(0x12a)],_0x4f8c0e[_0x268fb8[_0x3ce7be(0x12a)]]));else _0x107ffa?.[_0x3ce7be(0x192)]&&(_0x192fef=await _0x107ffa['resolveSegmentId'](_0x268fb8[_0x3ce7be(0x12a)]));}}const _0x1c789f={'name':_0x56b2d5[_0x3ce7be(0x12a)],'segmentId':_0x192fef};_0x56b2d5[_0x3ce7be(0xdf)]&&(_0x1c789f[_0x3ce7be(0xdf)]=_0x56b2d5[_0x3ce7be(0xdf)]);if(_0x56b2d5[_0x3ce7be(0xe6)]){const _0x5bd914=_0x56b2d5[_0x3ce7be(0xe6)][_0x3ce7be(0xc9)],_0x3fd123=_0x56b2d5['target'][_0x3ce7be(0x105)];let _0x5a8445=_0x56b2d5[_0x3ce7be(0xe6)][_0x3ce7be(0xc9)];_0x107ffa?.[_0x3ce7be(0x111)]&&!/^\d+$/[_0x3ce7be(0x176)](_0x5a8445)&&(_0x5a8445=await _0x107ffa['resolveJourneyId'](_0x5a8445));let _0x5cdb9f=_0x56b2d5[_0x3ce7be(0xe6)]['stage'];_0x107ffa?.[_0x3ce7be(0x171)]&&!/^\d+$/[_0x3ce7be(0x176)](_0x5cdb9f)&&(_0x5cdb9f=await _0x107ffa['resolveStageId'](_0x5a8445,_0x5cdb9f));const _0xdff02b=!/^\d+$/[_0x3ce7be(0x176)](_0x5bd914)&&!isLocalJourneyRef(_0x5bd914)?formatApiJourneyName(_0x5bd914,_0x3fd123):undefined;_0x1c789f['target']={'journeyId':_0x5a8445,'journeyStageId':_0x5cdb9f,'journeyName':_0xdff02b,'confirmed':!![]},_0x56b2d5[_0x3ce7be(0xe6)]['bundle_id']&&(_0x1c789f[_0x3ce7be(0xe6)][_0x3ce7be(0x128)]=_0x56b2d5[_0x3ce7be(0xe6)][_0x3ce7be(0xd1)]);}return _0x1c789f;}async function convertYamlStepToApi(_0x3af478,_0x48e1fe,_0x34cf21={},_0x2d32b7={},_0x12b1a0={}){const _0x5a34d6=a109_0x34fc,_0x4b9ed6=async _0x155969=>{const _0x249b34=a109_0x34fc;if(/^\d+$/[_0x249b34(0x176)](_0x155969))return _0x155969;const _0x476208=parseSegmentRef(_0x155969);if(_0x476208[_0x249b34(0x15c)]==='ref'){if(_0x48e1fe?.[_0x249b34(0x192)])return await _0x48e1fe[_0x249b34(0x192)](_0x476208['name']);}else{if(_0x476208[_0x249b34(0x15c)]==='embedded'&&_0x34cf21[_0x476208[_0x249b34(0x12a)]]){if(_0x48e1fe?.[_0x249b34(0x11a)])return await _0x48e1fe[_0x249b34(0x11a)](_0x476208[_0x249b34(0x12a)],_0x34cf21[_0x476208[_0x249b34(0x12a)]]);}else{if(_0x48e1fe?.['resolveSegmentId'])return await _0x48e1fe['resolveSegmentId'](_0x476208[_0x249b34(0x12a)]);}}return _0x155969;},_0x43d896=async _0x2fec8e=>{const _0x4f641c=a109_0x34fc;if(/^\d+$/[_0x4f641c(0x176)](_0x2fec8e))return _0x2fec8e;const _0x421781=parseSegmentRef(_0x2fec8e);if(_0x421781[_0x4f641c(0x15c)]===_0x4f641c(0x180)){if(_0x48e1fe?.[_0x4f641c(0x132)])return await _0x48e1fe[_0x4f641c(0x132)](_0x421781[_0x4f641c(0x12a)]);return _0x421781[_0x4f641c(0x12a)];}else{if(_0x421781[_0x4f641c(0x15c)]===_0x4f641c(0x157)&&_0x12b1a0[_0x421781['name']]){if(_0x48e1fe?.[_0x4f641c(0xee)])return await _0x48e1fe[_0x4f641c(0xee)](_0x421781[_0x4f641c(0x12a)],_0x12b1a0[_0x421781[_0x4f641c(0x12a)]]);if(_0x48e1fe?.[_0x4f641c(0x132)])return await _0x48e1fe[_0x4f641c(0x132)](_0x421781[_0x4f641c(0x12a)]);}else{if(_0x48e1fe?.['resolveActivationId'])return await _0x48e1fe[_0x4f641c(0x132)](_0x421781[_0x4f641c(0x12a)]);}}return _0x2fec8e;},_0x4a2d84=_0x7bdba9=>{const _0x4f45fe=a109_0x34fc;if(!_0x7bdba9)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x4f45fe(0x176)](_0x7bdba9))return _0x7bdba9;return _0x2d32b7[_0x7bdba9]||_0x7bdba9;};switch(_0x3af478['type']){case _0x5a34d6(0x16c):{const _0x39710c=_0x3af478,_0x1cf8e1=_0x39710c['with'],_0x58b6f9={'type':_0x5a34d6(0x166),'name':_0x39710c[_0x5a34d6(0x12a)],'next':_0x4a2d84(_0x39710c['next'])};if(_0x1cf8e1[_0x5a34d6(0xf1)]!==undefined&&_0x1cf8e1[_0x5a34d6(0x18c)])_0x58b6f9[_0x5a34d6(0x193)]=_0x5a34d6(0x11d),_0x58b6f9[_0x5a34d6(0x12f)]=_0x1cf8e1[_0x5a34d6(0xf1)],_0x58b6f9[_0x5a34d6(0x147)]=normalizeWaitUnit(_0x1cf8e1[_0x5a34d6(0x18c)]);else{if(_0x1cf8e1[_0x5a34d6(0xd3)])_0x58b6f9[_0x5a34d6(0x193)]=_0x5a34d6(0x121),_0x58b6f9[_0x5a34d6(0x170)]=_0x1cf8e1[_0x5a34d6(0xd3)];else{if(_0x1cf8e1[_0x5a34d6(0xf3)])_0x58b6f9['waitStepType']='DaysOfTheWeek',_0x58b6f9[_0x5a34d6(0xef)]=_0x1cf8e1[_0x5a34d6(0xf3)];else{if(_0x1cf8e1[_0x5a34d6(0x195)]){_0x58b6f9[_0x5a34d6(0x193)]='Condition';const _0xfaff75=await _0x4b9ed6(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x16b)]),_0x7c46a9=_0x1cf8e1[_0x5a34d6(0x195)]['timeout']?.[_0x5a34d6(0x11c)]!==undefined;if(_0x7c46a9){const _0x57289e=[];_0x57289e[_0x5a34d6(0x134)]({'id':generateUUID(),'segmentId':_0xfaff75,'timedOutPath':![],'name':_0x5a34d6(0x107),'next':_0x4a2d84(_0x1cf8e1['condition'][_0x5a34d6(0x11c)]??_0x39710c['next'])});if(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)]){const _0x5d22d0=_0x1cf8e1['condition'][_0x5a34d6(0x15b)][_0x5a34d6(0xf1)],_0x4730dc=normalizeWaitUnit(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0x18c)]);_0x57289e[_0x5a34d6(0x134)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x5a34d6(0x113)+_0x5d22d0+'\x20'+_0x4730dc,'moveAfter':_0x5d22d0,'unit':_0x4730dc,'next':_0x4a2d84(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0x11c)])});}_0x58b6f9[_0x5a34d6(0x133)]=_0x57289e,delete _0x58b6f9[_0x5a34d6(0x11c)];}else _0x58b6f9[_0x5a34d6(0x16f)]=_0xfaff75,_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)]&&(_0x58b6f9[_0x5a34d6(0x14f)]=_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0xf1)],_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)]['unit']&&(_0x58b6f9[_0x5a34d6(0xe0)]=normalizeWaitUnit(_0x1cf8e1[_0x5a34d6(0x195)][_0x5a34d6(0x15b)][_0x5a34d6(0x18c)])));}}}}return _0x58b6f9;}case'activation':{const _0x388abe=_0x3af478,_0x3dd6ad=_0x388abe[_0x5a34d6(0x127)]['activation'],_0x41f0d2=await _0x43d896(_0x3dd6ad);return{'type':_0x5a34d6(0xf6),'name':_0x388abe['name'],'journeyActivationStepId':_0x41f0d2,'next':_0x4a2d84(_0x388abe[_0x5a34d6(0x11c)])};}case _0x5a34d6(0x10d):{const _0x528b20=_0x3af478,_0xa98a27=_0x528b20[_0x5a34d6(0x127)][_0x5a34d6(0x1a0)];return{'type':'DecisionPoint','name':_0x528b20[_0x5a34d6(0x12a)],'branches':await Promise['all'](_0xa98a27['map'](async _0x3df127=>{const _0x3db844=_0x5a34d6;let _0x58b5a6='';if(!_0x3df127[_0x3db844(0x11b)]){const _0x5ed6f5=_0x3df127[_0x3db844(0x16b)]||_0x3df127[_0x3db844(0x118)]||'';_0x58b5a6=_0x5ed6f5?await _0x4b9ed6(_0x5ed6f5):'';}return{'id':crypto[_0x3db844(0x189)](),'name':_0x3df127[_0x3db844(0x12a)],'description':null,'segmentId':_0x58b5a6,'excludedPath':_0x3df127[_0x3db844(0x11b)]??![],'next':_0x4a2d84(_0x3df127[_0x3db844(0x11c)])};})),'next':_0x4a2d84(_0x528b20[_0x5a34d6(0x11c)])};}case'ab_test':{const _0x71d8dc=_0x3af478,_0x478d28=_0x71d8dc[_0x5a34d6(0x127)];return{'type':'ABTest','name':_0x71d8dc[_0x5a34d6(0x12a)],'customizedSplit':_0x478d28['customized_split'],'uniqueId':_0x478d28[_0x5a34d6(0xce)],'variants':_0x478d28[_0x5a34d6(0xd9)]['map'](_0x4e8cbd=>({'id':_0x4e8cbd['id']||generateUUID(),'name':_0x4e8cbd[_0x5a34d6(0x12a)],'percentage':_0x4e8cbd['percentage'],'next':_0x4a2d84(_0x4e8cbd['next'])})),'next':_0x4a2d84(_0x71d8dc[_0x5a34d6(0x11c)])};}case'merge':return{'type':_0x5a34d6(0x165),'name':_0x3af478[_0x5a34d6(0x12a)],'next':_0x4a2d84(_0x3af478[_0x5a34d6(0x11c)])};case'jump':{const _0x4101f9=_0x3af478,_0x4a229a=_0x4101f9[_0x5a34d6(0x127)][_0x5a34d6(0xe6)],_0x3d51c5=_0x4a229a['journey'],_0x3ffc53=_0x4a229a['stage'];let _0x3c688b=_0x4a229a[_0x5a34d6(0xc9)];_0x48e1fe?.[_0x5a34d6(0x111)]&&!/^\d+$/['test'](_0x3c688b)&&(_0x3c688b=await _0x48e1fe[_0x5a34d6(0x111)](_0x3c688b));let _0x54bea5=_0x4a229a[_0x5a34d6(0x105)];_0x48e1fe?.[_0x5a34d6(0x171)]&&!/^\d+$/[_0x5a34d6(0x176)](_0x54bea5)&&(_0x54bea5=await _0x48e1fe[_0x5a34d6(0x171)](_0x3c688b,_0x54bea5));const _0x5e0256=!/^\d+$/['test'](_0x3d51c5)&&!isLocalJourneyRef(_0x3d51c5)?formatApiJourneyName(_0x3d51c5,_0x3ffc53):undefined;return{'type':_0x5a34d6(0x194),'name':_0x4101f9[_0x5a34d6(0x12a)],'target':{'journeyId':_0x3c688b,'journeyStageId':_0x54bea5,'journeyBundleId':_0x4a229a[_0x5a34d6(0xd1)],'journeyName':_0x5e0256,'confirmed':!![]},'next':_0x4a2d84(_0x4101f9[_0x5a34d6(0x11c)])};}case _0x5a34d6(0xd6):return{'type':_0x5a34d6(0x185),'name':_0x3af478[_0x5a34d6(0x12a)]};default:{const _0x30e4a3=_0x3af478;return{'type':_0x5a34d6(0x185),'name':_0x30e4a3['name']};}}}export function toYamlString(_0x623897){const _0x3db933=a109_0x34fc,_0x181803=stripInternalFields(_0x623897),_0x1c3c8d=a109_0x5b586d[_0x3db933(0x149)](_0x181803,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3db933(0x143)}),_0x47f0cb=[_0x3db933(0x12d),'activations:',_0x3db933(0x14a),_0x3db933(0x138),_0x3db933(0x103),_0x3db933(0x110),_0x3db933(0xe7)];let _0x21ef5a=_0x1c3c8d;for(const _0x40eb7b of _0x47f0cb){_0x21ef5a=_0x21ef5a[_0x3db933(0x11f)](new RegExp('^('+_0x40eb7b+')','m'),(_0x226fbc,_0x548d3b,_0x2ed19b)=>{if(_0x2ed19b===0x0||_0x21ef5a[_0x2ed19b-0x1]==='\x0a'&&_0x21ef5a[_0x2ed19b-0x2]==='\x0a')return _0x548d3b;return'\x0a'+_0x548d3b;});}return _0x21ef5a;}function stripInternalFields(_0x578366){const _0x3465d6=a109_0x34fc,{id:_0x5c0de3,folder_id:_0x10ada2,bundle_id:_0x428320,bundle_name:_0xd9817a,version:_0x1dd580,version_number:_0x5085d5,allow_reentry:_0x3d3b23,..._0x125475}=_0x578366;return _0x125475[_0x3465d6(0xf0)]&&(_0x125475['journeys']=_0x125475['journeys'][_0x3465d6(0xd0)](_0x3ddbe6=>{const _0x42d7a4=_0x3465d6,{id:_0x24376b,version_number:_0x532330,..._0xcab163}=_0x3ddbe6;return{..._0xcab163,'stages':_0xcab163[_0x42d7a4(0x13b)][_0x42d7a4(0xd0)](stripStageInternalFields),..._0x3ddbe6[_0x42d7a4(0x109)]===!![]?{'latest':!![]}:{},..._0x125475[_0x42d7a4(0xf0)][_0x42d7a4(0x15d)]===0x1&&_0xcab163[_0x42d7a4(0x188)]==='v1'?{'version':undefined}:{}};})),_0x125475[_0x3465d6(0x13b)]&&(_0x125475[_0x3465d6(0x13b)]=_0x125475['stages'][_0x3465d6(0xd0)](stripStageInternalFields)),_0x125475['versions']&&(_0x125475[_0x3465d6(0x148)]=_0x125475[_0x3465d6(0x148)][_0x3465d6(0xd0)](_0x568662=>{const _0x9e4b97=_0x3465d6,{id:_0x3b780a,version_number:_0x1abdb8,..._0x5ed4a6}=_0x568662;return{..._0x5ed4a6,'stages':_0x5ed4a6[_0x9e4b97(0x13b)][_0x9e4b97(0xd0)](stripStageInternalFields),..._0x568662[_0x9e4b97(0x109)]===!![]?{'latest':!![]}:{}};})),_0x125475;}function stripStageInternalFields(_0x5985c0){const {id:_0x313bb8,..._0x298ad3}=_0x5985c0;return _0x298ad3;}export function parseYamlString(_0x49fc6e){const _0x13e53d=a109_0x34fc,_0x46960f=a109_0x5b586d['parse'](_0x49fc6e);if(_0x46960f['type']!==_0x13e53d(0xc9))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x13e53d(0xdd));if(!_0x46960f[_0x13e53d(0x12a)])throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0xe8));const _0x17906c=_0x46960f[_0x13e53d(0xf0)]&&Array['isArray'](_0x46960f[_0x13e53d(0xf0)])&&_0x46960f['journeys'][_0x13e53d(0x15d)]>0x0,_0x473dc0=_0x46960f[_0x13e53d(0x13b)]&&Array[_0x13e53d(0x19b)](_0x46960f['stages'])&&_0x46960f[_0x13e53d(0x13b)]['length']>0x0,_0x33d144=_0x46960f[_0x13e53d(0x148)]&&Array[_0x13e53d(0x19b)](_0x46960f['versions'])&&_0x46960f[_0x13e53d(0x148)]['length']>0x0,_0x4d5398=[_0x17906c,_0x473dc0,_0x33d144][_0x13e53d(0x15f)](Boolean)[_0x13e53d(0x15d)];if(_0x4d5398>0x1)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x158));if(_0x4d5398===0x0)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x13d));if(_0x17906c){for(let _0x5d7339=0x0;_0x5d7339<_0x46960f[_0x13e53d(0xf0)][_0x13e53d(0x15d)];_0x5d7339++){const _0x534196=_0x46960f['journeys'][_0x5d7339];if(!_0x534196[_0x13e53d(0x13b)]||!Array['isArray'](_0x534196['stages'])||_0x534196[_0x13e53d(0x13b)][_0x13e53d(0x15d)]===0x0)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x1a1)+_0x5d7339+']\x20missing\x20required\x20field:\x20stages');if(_0x534196[_0x13e53d(0x19a)]&&!['draft',_0x13e53d(0xf2)][_0x13e53d(0x164)](_0x534196['state']))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x13e53d(0x1a1)+_0x5d7339+_0x13e53d(0x135)+_0x534196['state']+_0x13e53d(0xec));validateStages(_0x534196[_0x13e53d(0x13b)],_0x13e53d(0x177)+_0x5d7339+_0x13e53d(0x14b));}const _0x1a5404=_0x46960f[_0x13e53d(0xf0)][_0x13e53d(0x15f)](_0x326c7e=>_0x326c7e[_0x13e53d(0x109)]===!![])[_0x13e53d(0x15d)];if(_0x1a5404>0x1)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x156));}_0x473dc0&&validateStages(_0x46960f[_0x13e53d(0x13b)],_0x13e53d(0x13b));if(_0x33d144){for(let _0x53070d=0x0;_0x53070d<_0x46960f[_0x13e53d(0x148)]['length'];_0x53070d++){const _0x12a5ee=_0x46960f[_0x13e53d(0x148)][_0x53070d];if(!_0x12a5ee['name'])throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x19f)+_0x53070d+_0x13e53d(0x183));if(!_0x12a5ee[_0x13e53d(0x19a)]||![_0x13e53d(0x106),_0x13e53d(0xf2)][_0x13e53d(0x164)](_0x12a5ee[_0x13e53d(0x19a)]))throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x19f)+_0x53070d+_0x13e53d(0x135)+_0x12a5ee[_0x13e53d(0x19a)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');if(!_0x12a5ee['stages']||!Array['isArray'](_0x12a5ee[_0x13e53d(0x13b)])||_0x12a5ee['stages'][_0x13e53d(0x15d)]===0x0)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x19f)+_0x53070d+_0x13e53d(0xfa));validateStages(_0x12a5ee[_0x13e53d(0x13b)],_0x13e53d(0xeb)+_0x53070d+_0x13e53d(0x14b));}const _0x49c21b=_0x46960f['versions'][_0x13e53d(0x15f)](_0x25120b=>_0x25120b[_0x13e53d(0x109)]===!![])['length'];if(_0x49c21b>0x1)throw new SDKError(ErrorCode[_0x13e53d(0xd8)],_0x13e53d(0x152));}return _0x46960f;}function validateStages(_0x3c4c22,_0x4c662b){const _0x1dc7c7=a109_0x34fc;if(_0x3c4c22[_0x1dc7c7(0x15d)]>0x8)throw new SDKError(ErrorCode[_0x1dc7c7(0xd8)],_0x1dc7c7(0x184)+_0x4c662b+_0x1dc7c7(0x17d));}export function isJourneyDef(_0x1146a1){const _0x5c0b23=a109_0x34fc;return typeof _0x1146a1===_0x5c0b23(0x104)&&_0x1146a1!==null&&_0x5c0b23(0x15c)in _0x1146a1&&_0x1146a1[_0x5c0b23(0x15c)]===_0x5c0b23(0xc9);}export function generateTemplate(_0x48dd1c,_0x27a01b){const _0x4d77d1=a109_0x34fc,_0x2ade6c={'type':_0x4d77d1(0xc9),'name':_0x48dd1c,'description':_0x4d77d1(0x178),'reentry':_0x4d77d1(0xfd),'goal':{'name':_0x4d77d1(0x140),'segment':_0x4d77d1(0x10e)},'stages':[{'name':'Stage\x201','description':_0x4d77d1(0xe5),'entry_criteria':{'name':_0x4d77d1(0xea),'segment':_0x27a01b},'steps':[{'type':_0x4d77d1(0x16c),'name':'Wait\x201\x20Day','with':{'duration':0x1,'unit':'day'}},{'type':'activation','name':_0x4d77d1(0x18d),'with':{'activation':'your-activation-name'}},{'type':_0x4d77d1(0xd6),'name':_0x4d77d1(0x172)}]}]};return toYamlString(_0x2ade6c);}function generateUUID(){const _0xcac295=a109_0x34fc;return crypto[_0xcac295(0x189)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x22b120){const _0x67f3ed=a109_0x34fc;if(_0x22b120[_0x67f3ed(0x144)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x22b120[_0x67f3ed(0x126)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x67f3ed(0x176)](_0x22b120))return{'type':'id','name':_0x22b120};return{'type':'embedded','name':_0x22b120};}export function makeSegmentRef(_0x501a2d){return''+SEGMENT_REF_PREFIX+_0x501a2d;}export function isExternalSegmentRef(_0x417c16){const _0xd1d5c5=a109_0x34fc;return _0x417c16[_0xd1d5c5(0x144)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x1ab6bc){const _0x103ebb=a109_0x34fc;return!!(_0x1ab6bc['journeys']&&_0x1ab6bc[_0x103ebb(0xf0)][_0x103ebb(0x15d)]>0x0);}export function isMultiVersionMode(_0x254216){const _0x11bca3=a109_0x34fc;return!!(_0x254216['versions']&&_0x254216[_0x11bca3(0x148)][_0x11bca3(0x15d)]>0x0);}export function isSingleVersionMode(_0x504c6b){const _0x19c020=a109_0x34fc;return!!(_0x504c6b[_0x19c020(0x13b)]&&_0x504c6b[_0x19c020(0x13b)][_0x19c020(0x15d)]>0x0);}export function hasMultipleVersions(_0x370784){const _0x339e8b=a109_0x34fc;if(isJourneysArrayMode(_0x370784))return(_0x370784['journeys']?.[_0x339e8b(0x15d)]||0x0)>0x1;if(isMultiVersionMode(_0x370784))return(_0x370784[_0x339e8b(0x148)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x58212b){const _0x40b887=a109_0x34fc;if(isJourneysArrayMode(_0x58212b))return _0x58212b;if(isSingleVersionMode(_0x58212b)){const {stages:_0x1cb648,id:_0x5becde,version:_0x1b105f,version_number:_0xc29a19,..._0x3bce86}=_0x58212b;return{..._0x3bce86,'journeys':[{'version':_0x1b105f||'v1','stages':_0x1cb648||[],'id':_0x5becde,'version_number':_0xc29a19}]};}if(isMultiVersionMode(_0x58212b)){const {versions:_0x1402d9,..._0x4fefa7}=_0x58212b;return{..._0x4fefa7,'journeys':(_0x1402d9||[])['map'](_0x30e175=>({'version':_0x30e175['name'],'state':_0x30e175[_0x40b887(0x19a)],'latest':_0x30e175[_0x40b887(0x109)],'stages':_0x30e175[_0x40b887(0x13b)],'id':_0x30e175['id'],'version_number':_0x30e175['version_number']}))};}return _0x58212b;}export function normalizeJourneyDef(_0x543c00,_0x29ecae){const _0x2c5924=a109_0x34fc,_0x1fde5c=normalizeToJourneysFormat(_0x543c00),_0x22ac71=_0x29ecae?.['segments']?Object[_0x2c5924(0x162)](_0x29ecae[_0x2c5924(0x18b)]):undefined,_0x410169=_0x29ecae?.['activations']?Object[_0x2c5924(0x162)](_0x29ecae[_0x2c5924(0x174)]):undefined;return{'type':_0x2c5924(0xc9),'name':_0x1fde5c[_0x2c5924(0x12a)],..._0x1fde5c[_0x2c5924(0xdf)]!==undefined&&{'description':_0x1fde5c[_0x2c5924(0xdf)]},..._0x1fde5c[_0x2c5924(0x175)]&&{'goal':normalizeJourneyCriteria(_0x1fde5c['goal'])},..._0x1fde5c[_0x2c5924(0x10b)]!==undefined&&{'reentry':_0x1fde5c[_0x2c5924(0x10b)]},..._0x1fde5c['segments']&&{'segments':normalizeEmbeddedSegments(_0x1fde5c['segments'],_0x22ac71)},..._0x1fde5c[_0x2c5924(0x174)]&&{'activations':normalizeEmbeddedActivations(_0x1fde5c['activations'],_0x410169)},..._0x1fde5c[_0x2c5924(0xf0)]&&{'journeys':_0x1fde5c[_0x2c5924(0xf0)]['map'](_0x27262d=>normalizeJourneyEntry(_0x27262d,_0x1fde5c[_0x2c5924(0xf0)][_0x2c5924(0x15d)]===0x1))}};}function normalizeJourneyEntry(_0x540d27,_0x2b4ff9){const _0xe529de=a109_0x34fc;return{...!_0x2b4ff9&&_0x540d27['version']!==undefined&&{'version':_0x540d27[_0xe529de(0x188)]},..._0x540d27[_0xe529de(0x19a)]!==undefined&&{'state':_0x540d27[_0xe529de(0x19a)]},...!_0x2b4ff9&&_0x540d27[_0xe529de(0x109)]!==undefined&&{'latest':_0x540d27[_0xe529de(0x109)]},..._0x540d27['goal']&&{'goal':normalizeJourneyCriteria(_0x540d27['goal'])},..._0x540d27[_0xe529de(0x10b)]!==undefined&&{'reentry':_0x540d27[_0xe529de(0x10b)]},'stages':_0x540d27[_0xe529de(0x13b)][_0xe529de(0xd0)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x28ee0f){const _0x44d75e=a109_0x34fc;return{'name':_0x28ee0f['name'],..._0x28ee0f['description']!==undefined&&{'description':_0x28ee0f[_0x44d75e(0xdf)]},..._0x28ee0f[_0x44d75e(0xcc)]&&{'entry_criteria':normalizeJourneyCriteria(_0x28ee0f[_0x44d75e(0xcc)])},..._0x28ee0f[_0x44d75e(0x12b)]&&{'exit_criteria':_0x28ee0f['exit_criteria'][_0x44d75e(0xd0)](normalizeJourneyCriteria)},..._0x28ee0f[_0x44d75e(0x10f)]&&{'milestone':normalizeJourneyCriteria(_0x28ee0f[_0x44d75e(0x10f)])},..._0x28ee0f[_0x44d75e(0x123)]&&{'steps':normalizeStepsWithImplicitNext(_0x28ee0f[_0x44d75e(0x123)])}};}function normalizeStepsWithImplicitNext(_0x4e9f86){const _0x235e8c=a109_0x34fc;return _0x4e9f86[_0x235e8c(0xd0)]((_0x3dac10,_0x45256e)=>{const _0x552a6e=_0x235e8c,_0x1abb3a=_0x45256e<_0x4e9f86[_0x552a6e(0x15d)]-0x1?_0x4e9f86[_0x45256e+0x1][_0x552a6e(0x12a)]:undefined;return normalizeJourneyStep(_0x3dac10,_0x1abb3a);});}function normalizeJourneyCriteria(_0x37fa46){const _0x586d17=a109_0x34fc;return{'name':_0x37fa46[_0x586d17(0x12a)],..._0x37fa46[_0x586d17(0xdf)]!==undefined&&{'description':_0x37fa46[_0x586d17(0xdf)]},'segment':_0x37fa46[_0x586d17(0x16b)],..._0x37fa46[_0x586d17(0xe6)]&&{'target':normalizeJumpTarget(_0x37fa46['target'])}};}function normalizeJourneyStep(_0x13f2c8,_0xf666a8){const _0x5ac90b=a109_0x34fc,_0x53743d=_0x13f2c8['next']!==undefined&&_0x13f2c8[_0x5ac90b(0x11c)]!==_0xf666a8,_0x436689={'type':_0x13f2c8['type'],'name':_0x13f2c8[_0x5ac90b(0x12a)],..._0x53743d&&{'next':_0x13f2c8[_0x5ac90b(0x11c)]}};if(_0x5ac90b(0x127)in _0x13f2c8&&_0x13f2c8[_0x5ac90b(0x127)])return{..._0x436689,'with':normalizeStepParams(_0x13f2c8[_0x5ac90b(0x15c)],_0x13f2c8[_0x5ac90b(0x127)])};return _0x436689;}function normalizeStepParams(_0x276629,_0x93e592){const _0x5b4c1a=a109_0x34fc;switch(_0x276629){case _0x5b4c1a(0x16c):{const _0x426310=_0x93e592;let _0x21d484;return _0x426310[_0x5b4c1a(0x195)]&&(_0x21d484={'segment':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x16b)],..._0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x11c)]!==undefined&&{'next':_0x426310['condition'][_0x5b4c1a(0x11c)]},..._0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]&&{'timeout':{'duration':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]['duration'],'unit':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)][_0x5b4c1a(0x18c)],..._0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]['next']!==undefined&&{'next':_0x426310[_0x5b4c1a(0x195)][_0x5b4c1a(0x15b)]['next']}}}}),{..._0x426310[_0x5b4c1a(0xf1)]!==undefined&&{'duration':_0x426310[_0x5b4c1a(0xf1)]},..._0x426310['unit']!==undefined&&{'unit':_0x426310['unit']},..._0x426310[_0x5b4c1a(0xd3)]!==undefined&&{'wait_until':_0x426310[_0x5b4c1a(0xd3)]},..._0x426310[_0x5b4c1a(0xf3)]!==undefined&&{'days_of_week':_0x426310[_0x5b4c1a(0xf3)]},..._0x21d484&&{'condition':_0x21d484}};}case _0x5b4c1a(0x19d):{const _0x32e771=_0x93e592;return{'activation':_0x32e771[_0x5b4c1a(0x19d)]};}case'decision_point':{const _0x20b591=_0x93e592;return{'branches':_0x20b591['branches'][_0x5b4c1a(0xd0)](normalizeDecisionBranch)};}case _0x5b4c1a(0xed):{const _0x297197=_0x93e592;return{..._0x297197[_0x5b4c1a(0xe4)]!==undefined&&{'customized_split':_0x297197[_0x5b4c1a(0xe4)]},..._0x297197[_0x5b4c1a(0xce)]!==undefined&&{'unique_id':_0x297197[_0x5b4c1a(0xce)]},'variants':_0x297197['variants']['map'](normalizeAbTestVariant)};}case _0x5b4c1a(0xf4):{const _0x487381=_0x93e592;return{'target':normalizeJumpTarget(_0x487381[_0x5b4c1a(0xe6)])};}default:return _0x93e592;}}function normalizeDecisionBranch(_0x567df2){const _0x45914b=a109_0x34fc;return{'name':_0x567df2['name'],..._0x567df2[_0x45914b(0x16b)]!==undefined&&{'segment':_0x567df2['segment']},..._0x567df2[_0x45914b(0x11b)]!==undefined&&{'excluded':_0x567df2['excluded']},..._0x567df2['next']!==undefined&&{'next':_0x567df2[_0x45914b(0x11c)]}};}function normalizeAbTestVariant(_0x144aa0){const _0x21a1c8=a109_0x34fc;return{..._0x144aa0['id']!==undefined&&{'id':_0x144aa0['id']},'name':_0x144aa0[_0x21a1c8(0x12a)],'percentage':_0x144aa0['percentage'],..._0x144aa0[_0x21a1c8(0x11c)]!==undefined&&{'next':_0x144aa0[_0x21a1c8(0x11c)]}};}function normalizeJumpTarget(_0xb1f7b0){const _0xea02fa=a109_0x34fc;return{'journey':_0xb1f7b0['journey'],'stage':_0xb1f7b0['stage'],..._0xb1f7b0[_0xea02fa(0xd1)]!==undefined&&{'bundle_id':_0xb1f7b0[_0xea02fa(0xd1)]}};}function normalizeEmbeddedSegments(_0x573818,_0x394630){const _0x55a857=a109_0x34fc,_0x31154b={},_0x431c4e=Object[_0x55a857(0x162)](_0x573818),_0x233e77=_0x394630?[..._0x394630[_0x55a857(0x15f)](_0x278ed3=>_0x431c4e[_0x55a857(0x164)](_0x278ed3)),..._0x431c4e[_0x55a857(0x15f)](_0x5389eb=>!_0x394630['includes'](_0x5389eb))[_0x55a857(0x102)]()]:_0x431c4e[_0x55a857(0x102)]();for(const _0x4f3777 of _0x233e77){const _0x4aab49=_0x573818[_0x4f3777];if(_0x4aab49[_0x55a857(0x155)]){const _0x352567=_0x4aab49['rule'];if(_0x352567[_0x55a857(0x15c)]!==_0x55a857(0x13a)&&_0x352567['type']!=='Or'){const _0x1e23a9=_0x352567[_0x55a857(0x15c)]??_0x55a857(0x179);throw new SDKError(ErrorCode[_0x55a857(0xd8)],_0x55a857(0x10a)+_0x4f3777+'\x27:\x20'+(_0x55a857(0x120)+_0x1e23a9+_0x55a857(0xcf))+'Expected\x20format:\x0a'+_0x55a857(0x142)+_0x55a857(0x159)+'\x20\x20\x20\x20conditions:\x0a'+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x55a857(0x14d)+_0x55a857(0x14c));}if(!_0x352567[_0x55a857(0x133)]||!Array[_0x55a857(0x19b)](_0x352567[_0x55a857(0x133)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x55a857(0x10a)+_0x4f3777+_0x55a857(0x161)+_0x55a857(0xd4)+_0x55a857(0xcd)+_0x55a857(0x142)+(_0x55a857(0x16e)+_0x352567[_0x55a857(0x15c)]+'\x0a')+_0x55a857(0x17f)+_0x55a857(0x191)+_0x55a857(0x14d)+_0x55a857(0x14c));}_0x31154b[_0x4f3777]={..._0x4aab49[_0x55a857(0xdf)]&&_0x4aab49['description'][_0x55a857(0xe3)]()&&{'description':_0x4aab49[_0x55a857(0xdf)]},..._0x4aab49[_0x55a857(0x155)]&&{'rule':deepSortObject(_0x4aab49[_0x55a857(0x155)])}};}return _0x31154b;}function normalizeEmbeddedActivations(_0x10beff,_0x4ee300){const _0x32e114=a109_0x34fc,_0x3c5d9b={},_0x3fc9c6=Object[_0x32e114(0x162)](_0x10beff),_0x40c914=_0x4ee300?[..._0x4ee300[_0x32e114(0x15f)](_0x5b6942=>_0x3fc9c6[_0x32e114(0x164)](_0x5b6942)),..._0x3fc9c6[_0x32e114(0x15f)](_0x2b3838=>!_0x4ee300[_0x32e114(0x164)](_0x2b3838))[_0x32e114(0x102)]()]:_0x3fc9c6[_0x32e114(0x102)]();for(const _0x512009 of _0x40c914){const _0x311627=_0x10beff[_0x512009];_0x3c5d9b[_0x512009]={'name':_0x311627['name'],'connection':_0x311627[_0x32e114(0x11e)],..._0x311627[_0x32e114(0xdf)]!==undefined&&{'description':_0x311627[_0x32e114(0xdf)]},..._0x311627[_0x32e114(0x145)]!==undefined&&{'all_columns':_0x311627['all_columns']},..._0x311627[_0x32e114(0x137)]!==undefined&&{'columns':_0x311627[_0x32e114(0x137)]},..._0x311627[_0x32e114(0x116)]!==undefined&&{'behavior':_0x311627[_0x32e114(0x116)]},..._0x311627[_0x32e114(0xca)]!==undefined&&{'schedule':_0x311627[_0x32e114(0xca)]},..._0x311627['notification']!==undefined&&{'notification':_0x311627['notification']},..._0x311627['connector_config']!==undefined&&{'connector_config':_0x311627[_0x32e114(0x17e)]},..._0x311627[_0x32e114(0xd5)]!==undefined&&{'activation_template_id':_0x311627[_0x32e114(0xd5)]}};}return _0x3c5d9b;}export function getActiveStages(_0x3198b7){const _0x27814e=a109_0x34fc;if(isJourneysArrayMode(_0x3198b7)){const _0x3deebb=_0x3198b7[_0x27814e(0xf0)]||[],_0x59361c=_0x3deebb[_0x27814e(0x16a)](_0x22f25b=>_0x22f25b[_0x27814e(0x109)]===!![])||_0x3deebb[0x0];return _0x59361c?.[_0x27814e(0x13b)]||[];}if(isSingleVersionMode(_0x3198b7))return _0x3198b7[_0x27814e(0x13b)]||[];if(isMultiVersionMode(_0x3198b7)){const _0x42b91f=_0x3198b7[_0x27814e(0x148)]||[],_0x25ecea=_0x42b91f[_0x27814e(0x16a)](_0x6ff564=>_0x6ff564['latest']===!![])||_0x42b91f[0x0];return _0x25ecea?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x11232b){const _0x4506e9=a109_0x34fc;if(isJourneysArrayMode(_0x11232b)){const _0x40d5c9=_0x11232b['journeys']||[];return _0x40d5c9[_0x4506e9(0x16a)](_0x136769=>_0x136769['latest']===!![])||_0x40d5c9[0x0];}if(isMultiVersionMode(_0x11232b)){const _0xf9b921=_0x11232b[_0x4506e9(0x148)]||[],_0x52107c=_0xf9b921['find'](_0x1bc02f=>_0x1bc02f[_0x4506e9(0x109)]===!![])||_0xf9b921[0x0];if(_0x52107c)return{'version':_0x52107c[_0x4506e9(0x12a)],'state':_0x52107c[_0x4506e9(0x19a)],'latest':_0x52107c[_0x4506e9(0x109)],'stages':_0x52107c[_0x4506e9(0x13b)],'id':_0x52107c['id'],'version_number':_0x52107c[_0x4506e9(0xd7)]};}if(isSingleVersionMode(_0x11232b))return{'version':_0x11232b[_0x4506e9(0x188)]||'v1','state':'draft','stages':_0x11232b['stages']||[],'id':_0x11232b['id'],'version_number':_0x11232b['version_number'],'goal':_0x11232b[_0x4506e9(0x175)],'reentry':_0x11232b['reentry']};return undefined;}export function getLatestVersion(_0x6a53f4){const _0xbc31ab=a109_0x34fc;if(!isMultiVersionMode(_0x6a53f4))return undefined;const _0x38a413=_0x6a53f4[_0xbc31ab(0x148)]||[];return _0x38a413[_0xbc31ab(0x16a)](_0x5456e1=>_0x5456e1['latest']===!![])||_0x38a413[0x0];}export function getEffectiveGoal(_0x1315a4){const _0x521686=a109_0x34fc,_0x3da0bc=getLatestJourneyEntry(_0x1315a4);return _0x3da0bc?.[_0x521686(0x175)]||_0x1315a4['goal'];}function a109_0x4430(){const _0x106602=['\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)','segment_id','add','resolveEmbeddedSegmentId','excluded','next','Duration','connection','replace','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','Date','weeks','steps','allowReentry','root_step','slice','with','journeyBundleId','excludedPath','name','exit_criteria','32CbomIl','segments:','journeyBundleName','waitStep','waitCondition','1676710yctJnH','resolveActivationId','conditions','push',']\x20has\x20invalid\x20state:\x20','resolveSegmentName','columns','reentry:','21261096svbRKp','And','stages','exitCriteria','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','journeyActivationStepId','week','Goal\x20Achieved','resolveActivation','\x20\x20rule:\x0a','null','startsWith','all_columns','39gnNKyK','waitStepUnit','versions','stringify','goal:','].stages','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','DaysOfTheWeek','conditionTimeoutDuration','isJourneyLocal','percentage','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','reentry_always','resolveJumpTarget','rule','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','embedded','Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.','\x20\x20\x20\x20type:\x20And\x0a','7003325KvjgGK','timeout','type','length','definition','filter','folder_id','\x27:\x20','keys','reentryMode','includes','Merge','WaitStep','journeyName','entryCriteria','AbTest','find','segment','wait','18OLuvMD','\x20\x20\x20\x20type:\x20','conditionSegmentId','waitUntilDate','resolveStageId','Stage\x20Complete','bundle_name','activations','goal','test','journeys[','Journey\x20description','(missing)','DecisionPoint','uniqueId','from',':\x20maximum\x208\x20stages\x20allowed','connector_config','\x20\x20\x20\x20conditions:\x0a','ref','match','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.',']\x20missing\x20required\x20field:\x20name','Journey\x20YAML\x20','End','day','get','version','randomUUID','timedOutPath','segments','unit','Send\x20Notification','toLowerCase','set','63952UBVnlG','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','resolveSegmentId','waitStepType','Jump','condition','journeyStageId','11239Onzmeh','resolveActivationName','11RPUrpk','state','isArray','segmentId','activation','values','Journey\x20YAML\x20versions[','branches','Journey\x20YAML\x20journeys[','journeyId','journey','schedule','all','entry_criteria','Expected\x20format:\x0a','unique_id','\x27.\x0a','map','bundle_id','11764580eegJyI','wait_until','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','activation_template_id','end','version_number','JOURNEY_SYNTAX_ERROR','variants','ABTest','114OfKqRP','rootStep','Journey\x20YAML\x20must\x20have\x20type:\x20journey','parentFolder','description','conditionTimeoutUnit','uuid','merge','trim','customized_split','First\x20stage\x20of\x20the\x20journey','target','versions:','Journey\x20YAML\x20missing\x20required\x20field:\x20name','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','Entry\x20Criteria','versions[','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','ab_test','resolveEmbeddedActivationId','daysOfWeek','journeys','duration','launched','days_of_week','jump','exitCriterias','Activation','965817KjQAJJ','relationships','stageName',']\x20missing\x20required\x20field:\x20stages','Variant','moveAfter','no_reentry','size','journeyStages','resolveSegment','attributes','sort','journeys:','object','stage','draft','Met\x20condition(s)','folder','latest','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','reentry','has','decision_point','goal-segment','milestone','stages:','resolveJourneyId','versionNumber','*Max\x20wait\x20','entries','Condition','behavior'];a109_0x4430=function(){return _0x106602;};return a109_0x4430();}export function getEffectiveReentry(_0x3b0986){const _0x4e024c=a109_0x34fc,_0x208110=getLatestJourneyEntry(_0x3b0986);return _0x208110?.[_0x4e024c(0x10b)]||_0x3b0986['reentry'];}export function collectSegmentRefs(_0x3fcce4){const _0xef68a4=a109_0x34fc,_0x481c8a=new Set();_0x3fcce4[_0xef68a4(0x175)]?.['segment']&&_0x481c8a[_0xef68a4(0x119)](_0x3fcce4[_0xef68a4(0x175)][_0xef68a4(0x16b)]);const _0x267b01=_0x1d9ae0=>{const _0x3a335b=_0xef68a4;for(const _0x5b3c3b of _0x1d9ae0){_0x5b3c3b['entry_criteria']?.['segment']&&_0x481c8a['add'](_0x5b3c3b[_0x3a335b(0xcc)][_0x3a335b(0x16b)]);if(_0x5b3c3b['exit_criteria'])for(const _0x12cb1f of _0x5b3c3b[_0x3a335b(0x12b)]){_0x12cb1f['segment']&&_0x481c8a['add'](_0x12cb1f[_0x3a335b(0x16b)]);}_0x5b3c3b['milestone']?.[_0x3a335b(0x16b)]&&_0x481c8a[_0x3a335b(0x119)](_0x5b3c3b[_0x3a335b(0x10f)][_0x3a335b(0x16b)]);if(_0x5b3c3b['steps'])for(const _0x5911e0 of _0x5b3c3b[_0x3a335b(0x123)]){if(_0x5911e0['type']===_0x3a335b(0x10d)){const _0x4f3207=_0x5911e0;for(const _0xb9e64b of _0x4f3207['with'][_0x3a335b(0x1a0)]){_0xb9e64b['segment']&&_0x481c8a[_0x3a335b(0x119)](_0xb9e64b[_0x3a335b(0x16b)]);}}else{if(_0x5911e0[_0x3a335b(0x15c)]===_0x3a335b(0x16c)){const _0x56bdb7=_0x5911e0;_0x56bdb7[_0x3a335b(0x127)][_0x3a335b(0x195)]?.[_0x3a335b(0x16b)]&&_0x481c8a[_0x3a335b(0x119)](_0x56bdb7[_0x3a335b(0x127)][_0x3a335b(0x195)][_0x3a335b(0x16b)]);}}}}};_0x3fcce4[_0xef68a4(0x13b)]&&_0x267b01(_0x3fcce4[_0xef68a4(0x13b)]);if(_0x3fcce4[_0xef68a4(0x148)])for(const _0x2eff38 of _0x3fcce4[_0xef68a4(0x148)]){_0x267b01(_0x2eff38[_0xef68a4(0x13b)]);}return _0x481c8a;}export function validateSegmentRefs(_0x32f9ff){const _0x330057=a109_0x34fc,_0x4d6481=[],_0x58e9ea=collectSegmentRefs(_0x32f9ff),_0x3b7917=new Set(Object[_0x330057(0x162)](_0x32f9ff[_0x330057(0x18b)]||{}));for(const _0x3dd697 of _0x58e9ea){const _0x366eb9=parseSegmentRef(_0x3dd697);_0x366eb9['type']===_0x330057(0x157)&&!_0x3b7917[_0x330057(0x10c)](_0x366eb9[_0x330057(0x12a)])&&_0x4d6481['push']('Unknown\x20segment\x20\x22'+_0x366eb9[_0x330057(0x12a)]+_0x330057(0xe9)+_0x366eb9[_0x330057(0x12a)]+_0x330057(0x182));}return _0x4d6481;}export function collectSegmentIdsFromJourneyApi(_0x262240){const _0x5065f9=a109_0x34fc,_0x46dcb7=new Set();_0x262240['attributes'][_0x5065f9(0x175)]?.[_0x5065f9(0x19c)]&&_0x46dcb7['add'](_0x262240['attributes'][_0x5065f9(0x175)][_0x5065f9(0x19c)]);const _0x3ae875=_0x262240[_0x5065f9(0x101)][_0x5065f9(0xff)];if(Array[_0x5065f9(0x19b)](_0x3ae875))for(const _0x4986a2 of _0x3ae875){_0x4986a2['entryCriteria']?.[_0x5065f9(0x19c)]&&_0x46dcb7[_0x5065f9(0x119)](_0x4986a2[_0x5065f9(0x168)][_0x5065f9(0x19c)]);const _0x461642=_0x4986a2[_0x5065f9(0xf5)]??_0x4986a2[_0x5065f9(0x13c)];if(Array[_0x5065f9(0x19b)](_0x461642))for(const _0x1cf239 of _0x461642){_0x1cf239[_0x5065f9(0x19c)]&&_0x46dcb7[_0x5065f9(0x119)](_0x1cf239[_0x5065f9(0x19c)]);}_0x4986a2[_0x5065f9(0x10f)]?.[_0x5065f9(0x19c)]&&_0x46dcb7['add'](_0x4986a2[_0x5065f9(0x10f)][_0x5065f9(0x19c)]);if(_0x4986a2['steps']&&typeof _0x4986a2[_0x5065f9(0x123)]===_0x5065f9(0x104)){const _0x554c36=Array['isArray'](_0x4986a2[_0x5065f9(0x123)])?_0x4986a2[_0x5065f9(0x123)]:Object[_0x5065f9(0x19e)](_0x4986a2[_0x5065f9(0x123)]);for(const _0x52fa1b of _0x554c36){_0x52fa1b[_0x5065f9(0x130)]?.['segmentId']&&_0x46dcb7[_0x5065f9(0x119)](_0x52fa1b[_0x5065f9(0x130)][_0x5065f9(0x19c)]);const _0x477231=_0x52fa1b;_0x477231['conditionSegmentId']&&_0x46dcb7['add'](_0x477231[_0x5065f9(0x16f)]);if(Array[_0x5065f9(0x19b)](_0x477231[_0x5065f9(0x133)]))for(const _0x25c38b of _0x477231[_0x5065f9(0x133)]){_0x25c38b[_0x5065f9(0x19c)]&&_0x46dcb7[_0x5065f9(0x119)](_0x25c38b[_0x5065f9(0x19c)]);}if(Array['isArray'](_0x52fa1b[_0x5065f9(0x1a0)]))for(const _0x37c12b of _0x52fa1b[_0x5065f9(0x1a0)]){_0x37c12b['segmentId']&&_0x46dcb7[_0x5065f9(0x119)](_0x37c12b['segmentId']);}}}}return _0x46dcb7;}
|