@treasuredata/tdx 0.9.6 → 0.9.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 +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-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/context-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/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.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/config.js +1 -1
- package/dist/core/connection-cache.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/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.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/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +53 -18
- 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.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-config.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.d.ts +30 -0
- package/dist/utils/journey-utils.d.ts.map +1 -1
- package/dist/utils/journey-utils.js +1 -1
- package/dist/utils/journey-utils.js.map +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.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/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a74_0x3b9b8a=a74_0x1f68;(function(_0x2da925,_0x291eb5){const _0x2341ec=a74_0x1f68,_0x4890a3=_0x2da925();while(!![]){try{const _0x367073=-parseInt(_0x2341ec(0x1ae))/0x1*(parseInt(_0x2341ec(0x1b6))/0x2)+parseInt(_0x2341ec(0x167))/0x3*(parseInt(_0x2341ec(0x1c6))/0x4)+parseInt(_0x2341ec(0x18b))/0x5+parseInt(_0x2341ec(0x14e))/0x6*(parseInt(_0x2341ec(0x19f))/0x7)+parseInt(_0x2341ec(0x1c3))/0x8+-parseInt(_0x2341ec(0x1e0))/0x9+-parseInt(_0x2341ec(0x146))/0xa*(-parseInt(_0x2341ec(0x1b5))/0xb);if(_0x367073===_0x291eb5)break;else _0x4890a3['push'](_0x4890a3['shift']());}catch(_0x38f3a9){_0x4890a3['push'](_0x4890a3['shift']());}}}(a74_0x3cc9,0xe5ad9));import*as a74_0x51391a from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{normalizeRule}from'./child-segment-yaml.js';export function normalizeWaitUnit(_0x522e1d){const _0x4cdfbc=a74_0x1f68,_0x309872=_0x522e1d['toLowerCase']();if(_0x309872===_0x4cdfbc(0x174)||_0x309872===_0x4cdfbc(0x163))return _0x4cdfbc(0x163);if(_0x309872===_0x4cdfbc(0x190)||_0x309872===_0x4cdfbc(0x133))return _0x4cdfbc(0x133);return _0x522e1d;}export function apiToYaml(_0x3ebd49){const _0x1009c4=a74_0x1f68,_0x3f5acf=_0x3ebd49[_0x1009c4(0x14f)],_0x4affa9=_0x3f5acf['journeyBundleName']||_0x3f5acf[_0x1009c4(0x169)],_0x42e1e2={'stages':_0x3f5acf['journeyStages'][_0x1009c4(0x1ac)](convertApiStageToYaml),'id':_0x3ebd49['id']};_0x3f5acf[_0x1009c4(0x169)]&&_0x3f5acf[_0x1009c4(0x169)]!==_0x4affa9&&(_0x42e1e2[_0x1009c4(0x1dc)]=_0x3f5acf[_0x1009c4(0x169)]);_0x3f5acf[_0x1009c4(0x142)]!==undefined&&(_0x42e1e2[_0x1009c4(0x137)]=_0x3f5acf[_0x1009c4(0x142)]);_0x3f5acf[_0x1009c4(0x1a1)]&&(_0x42e1e2[_0x1009c4(0x1a1)]=_0x3f5acf[_0x1009c4(0x1a1)]===_0x1009c4(0x192)?_0x1009c4(0x192):_0x1009c4(0x195));const _0x25a69b={'type':'journey','name':_0x4affa9,'journeys':[_0x42e1e2]};_0x3f5acf[_0x1009c4(0x158)]&&(_0x25a69b[_0x1009c4(0x158)]=_0x3f5acf[_0x1009c4(0x158)]);_0x3f5acf[_0x1009c4(0x198)]&&(_0x25a69b['goal']=convertApiCriteriaToYaml(_0x3f5acf[_0x1009c4(0x198)]));if(_0x3f5acf['reentryMode'])_0x25a69b['reentry']=_0x3f5acf[_0x1009c4(0x13f)];else _0x3f5acf[_0x1009c4(0x16e)]!==undefined&&(_0x25a69b[_0x1009c4(0x18d)]=_0x3f5acf['allowReentry']?'reentry_always':_0x1009c4(0x173));return _0x3f5acf['journeyBundleId']&&(_0x25a69b['bundle_id']=_0x3f5acf[_0x1009c4(0x1f0)]),_0x3f5acf[_0x1009c4(0x1b2)]&&(_0x25a69b['bundle_name']=_0x3f5acf[_0x1009c4(0x1b2)]),_0x3ebd49[_0x1009c4(0x19d)]?.[_0x1009c4(0x1a6)]?.[_0x1009c4(0x1ce)]?.['id']&&(_0x25a69b[_0x1009c4(0x1d3)]=_0x3ebd49['relationships'][_0x1009c4(0x1a6)]['data']['id']),_0x25a69b;}export async function apiToYamlAsync(_0x332141,_0x2f6515){const _0x1dd917=a74_0x1f68,_0x2b2c94=apiToYaml(_0x332141);if(!_0x2f6515)return _0x2b2c94;const _0x33977=new Set();collectSegmentIdsFromJourney(_0x2b2c94,_0x33977);const _0x401f15=new Set();collectActivationIdsFromJourney(_0x2b2c94,_0x401f15);const _0x8266b2={},_0x119aeb=new Map();for(const _0x3ee18e of _0x33977){if(_0x2f6515[_0x1dd917(0x13b)]){const _0x2035b2=await _0x2f6515[_0x1dd917(0x13b)](_0x3ee18e);_0x2035b2[_0x1dd917(0x177)]?(_0x119aeb[_0x1dd917(0x1dd)](_0x3ee18e,_0x2035b2[_0x1dd917(0x169)]),_0x2035b2[_0x1dd917(0x1e4)]&&(_0x8266b2[_0x2035b2['name']]=_0x2035b2['definition'])):_0x119aeb[_0x1dd917(0x1dd)](_0x3ee18e,makeSegmentRef(_0x2035b2[_0x1dd917(0x169)]));}else{if(_0x2f6515[_0x1dd917(0x1e9)]){const _0x1bb5b1=await _0x2f6515[_0x1dd917(0x1e9)](_0x3ee18e);_0x119aeb[_0x1dd917(0x1dd)](_0x3ee18e,_0x1bb5b1);}}}const _0x4fff48={},_0x4b57fd=new Map();for(const _0x5cc264 of _0x401f15){if(_0x2f6515[_0x1dd917(0x1be)]){const _0x1731e1=await _0x2f6515[_0x1dd917(0x1be)](_0x5cc264);_0x1731e1[_0x1dd917(0x177)]?(_0x4b57fd[_0x1dd917(0x1dd)](_0x5cc264,_0x1731e1[_0x1dd917(0x169)]),_0x1731e1[_0x1dd917(0x1e4)]&&(_0x4fff48[_0x1731e1[_0x1dd917(0x169)]]=_0x1731e1['definition'])):_0x4b57fd[_0x1dd917(0x1dd)](_0x5cc264,makeSegmentRef(_0x1731e1[_0x1dd917(0x169)]));}else{if(_0x2f6515['resolveActivationName']){const _0x569e11=await _0x2f6515[_0x1dd917(0x14b)](_0x5cc264);_0x4b57fd['set'](_0x5cc264,_0x569e11);}}}_0x119aeb['size']>0x0&&replaceSegmentIdsInJourney(_0x2b2c94,_0x119aeb);_0x4b57fd[_0x1dd917(0x160)]>0x0&&replaceActivationIdsInJourney(_0x2b2c94,_0x4b57fd);if(_0x2f6515[_0x1dd917(0x175)]){const _0xea916b=[];collectJumpTargetsFromJourney(_0x2b2c94,_0xea916b);if(_0xea916b[_0x1dd917(0x1e1)]>0x0){const _0x2080eb=new Map();for(const _0x14c4d7 of _0xea916b){try{const _0x143bca=await _0x2f6515['resolveJumpTarget'](_0x14c4d7[_0x1dd917(0x185)],_0x14c4d7['stageId']);_0x2080eb['set'](_0x14c4d7['journeyId']+':'+_0x14c4d7[_0x1dd917(0x1bd)],_0x143bca);}catch{}}_0x2080eb[_0x1dd917(0x160)]>0x0&&replaceJumpTargetsInJourney(_0x2b2c94,_0x2080eb);}}return Object[_0x1dd917(0x1df)](_0x8266b2)['length']>0x0&&(_0x2b2c94[_0x1dd917(0x16b)]=_0x8266b2),Object[_0x1dd917(0x1df)](_0x4fff48)[_0x1dd917(0x1e1)]>0x0&&(_0x2b2c94['activations']=_0x4fff48),_0x2b2c94;}function collectSegmentIdsFromJourney(_0x450492,_0x5cbef9){const _0x3e9d51=a74_0x1f68;_0x450492[_0x3e9d51(0x198)]?.[_0x3e9d51(0x19a)]&&_0x5cbef9['add'](_0x450492[_0x3e9d51(0x198)][_0x3e9d51(0x19a)]);const _0x172a99=_0x2a7307=>{const _0x985fa1=_0x3e9d51;for(const _0x1a5d2a of _0x2a7307){_0x1a5d2a['entry_criteria']?.[_0x985fa1(0x19a)]&&_0x5cbef9[_0x985fa1(0x1b4)](_0x1a5d2a[_0x985fa1(0x181)][_0x985fa1(0x19a)]);if(_0x1a5d2a['exit_criteria'])for(const _0x4b6d08 of _0x1a5d2a['exit_criteria']){_0x4b6d08['segment']&&_0x5cbef9[_0x985fa1(0x1b4)](_0x4b6d08[_0x985fa1(0x19a)]);}_0x1a5d2a['milestone']?.[_0x985fa1(0x19a)]&&_0x5cbef9['add'](_0x1a5d2a[_0x985fa1(0x1a3)]['segment']);if(_0x1a5d2a[_0x985fa1(0x16a)])for(const _0x21cdbd of _0x1a5d2a[_0x985fa1(0x16a)]){if(_0x21cdbd[_0x985fa1(0x14d)]===_0x985fa1(0x1db)){const _0x460190=_0x21cdbd;for(const _0x11fa2d of _0x460190['with'][_0x985fa1(0x1e6)]){_0x11fa2d[_0x985fa1(0x19a)]&&_0x5cbef9['add'](_0x11fa2d[_0x985fa1(0x19a)]);}}else{if(_0x21cdbd[_0x985fa1(0x14d)]===_0x985fa1(0x1d8)){const _0x5f3549=_0x21cdbd;_0x5f3549['with'][_0x985fa1(0x155)]?.[_0x985fa1(0x19a)]&&_0x5cbef9['add'](_0x5f3549[_0x985fa1(0x193)][_0x985fa1(0x155)]['segment']);}}}}};if(_0x450492[_0x3e9d51(0x1c5)])for(const _0x18b68a of _0x450492[_0x3e9d51(0x1c5)]){_0x18b68a[_0x3e9d51(0x198)]?.[_0x3e9d51(0x19a)]&&_0x5cbef9['add'](_0x18b68a['goal'][_0x3e9d51(0x19a)]),_0x172a99(_0x18b68a['stages']);}_0x450492[_0x3e9d51(0x170)]&&_0x172a99(_0x450492[_0x3e9d51(0x170)]);if(_0x450492[_0x3e9d51(0x19b)])for(const _0x46b351 of _0x450492[_0x3e9d51(0x19b)]){_0x172a99(_0x46b351[_0x3e9d51(0x170)]);}}function replaceSegmentIdsInJourney(_0x2d6300,_0xdb85c9){const _0x2ca415=a74_0x1f68,_0x2632f1=_0x405693=>_0xdb85c9['get'](_0x405693)||_0x405693;_0x2d6300['goal']?.[_0x2ca415(0x19a)]&&(_0x2d6300[_0x2ca415(0x198)][_0x2ca415(0x19a)]=_0x2632f1(_0x2d6300[_0x2ca415(0x198)][_0x2ca415(0x19a)]));const _0xb25dd3=_0x128a72=>{const _0x342419=_0x2ca415;for(const _0xe3259e of _0x128a72){_0xe3259e['entry_criteria']?.[_0x342419(0x19a)]&&(_0xe3259e[_0x342419(0x181)][_0x342419(0x19a)]=_0x2632f1(_0xe3259e['entry_criteria'][_0x342419(0x19a)]));if(_0xe3259e[_0x342419(0x1de)])for(const _0x3703fa of _0xe3259e[_0x342419(0x1de)]){_0x3703fa[_0x342419(0x19a)]&&(_0x3703fa[_0x342419(0x19a)]=_0x2632f1(_0x3703fa['segment']));}_0xe3259e[_0x342419(0x1a3)]?.[_0x342419(0x19a)]&&(_0xe3259e['milestone'][_0x342419(0x19a)]=_0x2632f1(_0xe3259e[_0x342419(0x1a3)][_0x342419(0x19a)]));if(_0xe3259e[_0x342419(0x16a)])for(const _0x49bbf3 of _0xe3259e[_0x342419(0x16a)]){if(_0x49bbf3[_0x342419(0x14d)]==='decision_point'){const _0x1d9966=_0x49bbf3;for(const _0x5b5d59 of _0x1d9966[_0x342419(0x193)]['branches']){_0x5b5d59[_0x342419(0x19a)]&&(_0x5b5d59[_0x342419(0x19a)]=_0x2632f1(_0x5b5d59['segment']));}}else{if(_0x49bbf3[_0x342419(0x14d)]===_0x342419(0x1d8)){const _0x29ddb4=_0x49bbf3;_0x29ddb4[_0x342419(0x193)]['condition']?.[_0x342419(0x19a)]&&(_0x29ddb4[_0x342419(0x193)][_0x342419(0x155)]['segment']=_0x2632f1(_0x29ddb4[_0x342419(0x193)][_0x342419(0x155)]['segment']));}}}}};if(_0x2d6300[_0x2ca415(0x1c5)])for(const _0x241063 of _0x2d6300['journeys']){_0x241063['goal']?.[_0x2ca415(0x19a)]&&(_0x241063[_0x2ca415(0x198)]['segment']=_0x2632f1(_0x241063['goal'][_0x2ca415(0x19a)])),_0xb25dd3(_0x241063['stages']);}_0x2d6300[_0x2ca415(0x170)]&&_0xb25dd3(_0x2d6300['stages']);if(_0x2d6300[_0x2ca415(0x19b)])for(const _0x125db7 of _0x2d6300[_0x2ca415(0x19b)]){_0xb25dd3(_0x125db7['stages']);}}function collectActivationIdsFromJourney(_0x1c49cb,_0x125fb2){const _0x2645d4=a74_0x1f68,_0xcc68ab=_0x32a4e4=>{const _0x346e85=a74_0x1f68;for(const _0x39d8eb of _0x32a4e4){if(_0x39d8eb[_0x346e85(0x16a)])for(const _0x8075c0 of _0x39d8eb[_0x346e85(0x16a)]){if(_0x8075c0[_0x346e85(0x14d)]===_0x346e85(0x14c)){const _0x1f555c=_0x8075c0;_0x1f555c[_0x346e85(0x193)]['activation']&&/^\d+$/[_0x346e85(0x179)](_0x1f555c[_0x346e85(0x193)][_0x346e85(0x14c)])&&_0x125fb2[_0x346e85(0x1b4)](_0x1f555c[_0x346e85(0x193)]['activation']);}}}};if(_0x1c49cb['journeys'])for(const _0xcee5d of _0x1c49cb['journeys']){_0xcc68ab(_0xcee5d['stages']);}_0x1c49cb[_0x2645d4(0x170)]&&_0xcc68ab(_0x1c49cb[_0x2645d4(0x170)]);if(_0x1c49cb[_0x2645d4(0x19b)])for(const _0x5aa9d1 of _0x1c49cb[_0x2645d4(0x19b)]){_0xcc68ab(_0x5aa9d1[_0x2645d4(0x170)]);}}function replaceActivationIdsInJourney(_0x307a01,_0x7c6259){const _0x5260ca=a74_0x1f68,_0xd4179=_0x4d829a=>_0x7c6259[_0x5260ca(0x1d5)](_0x4d829a)||_0x4d829a,_0x576771=_0x5258be=>{const _0x558001=_0x5260ca;for(const _0x15dbf1 of _0x5258be){if(_0x15dbf1[_0x558001(0x16a)])for(const _0x5860a4 of _0x15dbf1[_0x558001(0x16a)]){if(_0x5860a4[_0x558001(0x14d)]==='activation'){const _0x476f85=_0x5860a4;_0x476f85[_0x558001(0x193)][_0x558001(0x14c)]&&(_0x476f85['with']['activation']=_0xd4179(_0x476f85['with']['activation']));}}}};if(_0x307a01['journeys'])for(const _0x392916 of _0x307a01['journeys']){_0x576771(_0x392916[_0x5260ca(0x170)]);}_0x307a01[_0x5260ca(0x170)]&&_0x576771(_0x307a01[_0x5260ca(0x170)]);if(_0x307a01[_0x5260ca(0x19b)])for(const _0x2ad18f of _0x307a01[_0x5260ca(0x19b)]){_0x576771(_0x2ad18f['stages']);}}function collectJumpTargetsFromJourney(_0x28b5cd,_0x5e0ea1){const _0xdb41d=a74_0x1f68,_0x3e57da=new Set(),_0x56de0a=_0xbbf24f=>{const _0x239f5c=a74_0x1f68;for(const _0x279901 of _0xbbf24f){if(_0x279901[_0x239f5c(0x16a)])for(const _0x39450a of _0x279901['steps']){if(_0x39450a[_0x239f5c(0x14d)]===_0x239f5c(0x1f3)){const _0x2bada8=_0x39450a,_0x52e23b=_0x2bada8[_0x239f5c(0x193)]['target'];if(_0x52e23b['journey']&&_0x52e23b[_0x239f5c(0x1c2)]&&/^\d+$/['test'](_0x52e23b[_0x239f5c(0x1b9)])&&/^\d+$/[_0x239f5c(0x179)](_0x52e23b[_0x239f5c(0x1c2)])){const _0x1ecf40=_0x52e23b[_0x239f5c(0x1b9)]+':'+_0x52e23b[_0x239f5c(0x1c2)];!_0x3e57da[_0x239f5c(0x194)](_0x1ecf40)&&(_0x3e57da[_0x239f5c(0x1b4)](_0x1ecf40),_0x5e0ea1['push']({'journeyId':_0x52e23b[_0x239f5c(0x1b9)],'stageId':_0x52e23b[_0x239f5c(0x1c2)]}));}}}}};if(_0x28b5cd[_0xdb41d(0x1c5)])for(const _0x2123bd of _0x28b5cd[_0xdb41d(0x1c5)]){_0x56de0a(_0x2123bd[_0xdb41d(0x170)]);}_0x28b5cd['stages']&&_0x56de0a(_0x28b5cd[_0xdb41d(0x170)]);if(_0x28b5cd['versions'])for(const _0x51c0e2 of _0x28b5cd[_0xdb41d(0x19b)]){_0x56de0a(_0x51c0e2['stages']);}}function replaceJumpTargetsInJourney(_0x9f20cc,_0x198a51){const _0x573966=a74_0x1f68,_0x1979ce=_0x3e7a8d=>{const _0x2618b0=a74_0x1f68;for(const _0x423c92 of _0x3e7a8d){if(_0x423c92[_0x2618b0(0x16a)])for(const _0x278cf7 of _0x423c92['steps']){if(_0x278cf7[_0x2618b0(0x14d)]===_0x2618b0(0x1f3)){const _0x3d6be0=_0x278cf7,_0x17c5a5=_0x3d6be0[_0x2618b0(0x193)]['target'],_0x3fec65=_0x17c5a5[_0x2618b0(0x1b9)]+':'+_0x17c5a5[_0x2618b0(0x1c2)],_0x39d679=_0x198a51[_0x2618b0(0x1d5)](_0x3fec65);_0x39d679&&(_0x17c5a5[_0x2618b0(0x1b9)]=_0x39d679[_0x2618b0(0x1ea)],_0x17c5a5['stage']=_0x39d679[_0x2618b0(0x1e2)]);}}}};if(_0x9f20cc['journeys'])for(const _0x25adf6 of _0x9f20cc['journeys']){_0x1979ce(_0x25adf6[_0x573966(0x170)]);}_0x9f20cc[_0x573966(0x170)]&&_0x1979ce(_0x9f20cc[_0x573966(0x170)]);if(_0x9f20cc[_0x573966(0x19b)])for(const _0x3b36b8 of _0x9f20cc[_0x573966(0x19b)]){_0x1979ce(_0x3b36b8[_0x573966(0x170)]);}}function generateReadableStepName(_0x34504d,_0x57482c){const _0x338171=a74_0x1f68;if(_0x34504d[_0x338171(0x169)]&&_0x34504d['name']!==_0x34504d[_0x338171(0x14d)]){const _0x1d085e=_0x34504d['name'][_0x338171(0x18e)]()[_0x338171(0x15a)](/\s+/g,'_')[_0x338171(0x15a)](/[^a-z0-9_]/g,'');if(_0x1d085e)return _0x1d085e;}const _0x35f040=_0x34504d[_0x338171(0x14d)][_0x338171(0x18e)]()[_0x338171(0x15a)](/step$/i,'');return _0x35f040+'_'+(_0x57482c+0x1);}function orderStepsFromRoot(_0x1cfade,_0x41826c){const _0x38fb4b=a74_0x1f68,_0x110133=Object['entries'](_0x1cfade);if(_0x110133[_0x38fb4b(0x1e1)]===0x0)return[];const _0x20371a=new Set(_0x110133[_0x38fb4b(0x1ac)](([_0x362162])=>_0x362162)),_0x13d9a6=new Set();for(const [,_0xb55366]of _0x110133){_0xb55366['next']&&_0x20371a['has'](_0xb55366['next'])&&_0x13d9a6[_0x38fb4b(0x1b4)](_0xb55366[_0x38fb4b(0x187)]);if(_0xb55366['branches'])for(const _0x52f972 of _0xb55366[_0x38fb4b(0x1e6)]){_0x52f972[_0x38fb4b(0x187)]&&_0x20371a['has'](_0x52f972['next'])&&_0x13d9a6[_0x38fb4b(0x1b4)](_0x52f972[_0x38fb4b(0x187)]);}if(_0xb55366[_0x38fb4b(0x186)])for(const _0x39eeb9 of _0xb55366[_0x38fb4b(0x186)]){_0x39eeb9['next']&&_0x20371a['has'](_0x39eeb9[_0x38fb4b(0x187)])&&_0x13d9a6['add'](_0x39eeb9[_0x38fb4b(0x187)]);}}let _0x2f3ca6=_0x41826c&&_0x20371a[_0x38fb4b(0x194)](_0x41826c)?_0x41826c:undefined;if(!_0x2f3ca6){const _0x4edea7=_0x110133[_0x38fb4b(0x161)](([_0x1c4ca9])=>!_0x13d9a6[_0x38fb4b(0x194)](_0x1c4ca9));_0x4edea7[_0x38fb4b(0x1e1)]>0x0?_0x2f3ca6=_0x4edea7[0x0][0x0]:_0x2f3ca6=_0x110133[0x0][0x0];}const _0x1390f6=[],_0x4ee35f=new Set(),_0x16d990=[_0x2f3ca6];while(_0x16d990[_0x38fb4b(0x1e1)]>0x0){const _0x3e12f4=_0x16d990[_0x38fb4b(0x1d1)]();if(_0x4ee35f[_0x38fb4b(0x194)](_0x3e12f4))continue;_0x4ee35f[_0x38fb4b(0x1b4)](_0x3e12f4);const _0x391933=_0x1cfade[_0x3e12f4];if(!_0x391933)continue;_0x1390f6[_0x38fb4b(0x171)]({'uuid':_0x3e12f4,'step':_0x391933});_0x391933[_0x38fb4b(0x187)]&&_0x20371a[_0x38fb4b(0x194)](_0x391933[_0x38fb4b(0x187)])&&!_0x4ee35f[_0x38fb4b(0x194)](_0x391933[_0x38fb4b(0x187)])&&_0x16d990[_0x38fb4b(0x171)](_0x391933[_0x38fb4b(0x187)]);if(_0x391933[_0x38fb4b(0x1e6)])for(const _0x2dcd72 of _0x391933[_0x38fb4b(0x1e6)]){_0x2dcd72[_0x38fb4b(0x187)]&&_0x20371a[_0x38fb4b(0x194)](_0x2dcd72[_0x38fb4b(0x187)])&&!_0x4ee35f['has'](_0x2dcd72['next'])&&_0x16d990[_0x38fb4b(0x171)](_0x2dcd72['next']);}if(_0x391933[_0x38fb4b(0x186)])for(const _0x1ab224 of _0x391933['variants']){_0x1ab224[_0x38fb4b(0x187)]&&_0x20371a[_0x38fb4b(0x194)](_0x1ab224[_0x38fb4b(0x187)])&&!_0x4ee35f[_0x38fb4b(0x194)](_0x1ab224[_0x38fb4b(0x187)])&&_0x16d990[_0x38fb4b(0x171)](_0x1ab224['next']);}}for(const [_0x82ac08,_0xfa7a69]of _0x110133){!_0x4ee35f[_0x38fb4b(0x194)](_0x82ac08)&&_0x1390f6[_0x38fb4b(0x171)]({'uuid':_0x82ac08,'step':_0xfa7a69});}return _0x1390f6;}function resolveStepReferences(_0x14a03d,_0x452665,_0x2252d0,_0x5091cd){const _0x48b1dc=a74_0x1f68;if(_0x14a03d[_0x48b1dc(0x14d)]!=='end'){_0x14a03d['next']&&_0x5091cd[_0x48b1dc(0x194)](_0x14a03d[_0x48b1dc(0x187)])&&(_0x14a03d[_0x48b1dc(0x187)]=_0x5091cd[_0x48b1dc(0x1d5)](_0x14a03d[_0x48b1dc(0x187)]));const _0x39f83a=_0x452665+0x1;if(_0x39f83a<_0x2252d0[_0x48b1dc(0x1e1)]){const _0x47dc58=_0x5091cd[_0x48b1dc(0x1d5)](_0x2252d0[_0x39f83a][_0x48b1dc(0x1b1)]);_0x14a03d[_0x48b1dc(0x187)]===_0x47dc58&&delete _0x14a03d['next'];}}if(_0x14a03d[_0x48b1dc(0x14d)]===_0x48b1dc(0x1db))for(const _0x407a87 of _0x14a03d[_0x48b1dc(0x193)][_0x48b1dc(0x1e6)]){_0x407a87['next']&&_0x5091cd[_0x48b1dc(0x194)](_0x407a87[_0x48b1dc(0x187)])&&(_0x407a87[_0x48b1dc(0x187)]=_0x5091cd[_0x48b1dc(0x1d5)](_0x407a87[_0x48b1dc(0x187)]));}if(_0x14a03d['type']===_0x48b1dc(0x1ba))for(const _0x4069cf of _0x14a03d[_0x48b1dc(0x193)][_0x48b1dc(0x186)]){_0x4069cf[_0x48b1dc(0x187)]&&_0x5091cd[_0x48b1dc(0x194)](_0x4069cf[_0x48b1dc(0x187)])&&(_0x4069cf[_0x48b1dc(0x187)]=_0x5091cd[_0x48b1dc(0x1d5)](_0x4069cf[_0x48b1dc(0x187)]));}}function convertApiStageToYaml(_0x3556ae){const _0x560088=a74_0x1f68,_0x4831ff={'name':_0x3556ae[_0x560088(0x169)]};_0x3556ae['id']&&(_0x4831ff['id']=_0x3556ae['id']);_0x3556ae[_0x560088(0x158)]&&(_0x4831ff[_0x560088(0x158)]=_0x3556ae[_0x560088(0x158)]);_0x3556ae[_0x560088(0x165)]&&(_0x4831ff[_0x560088(0x181)]=convertApiCriteriaToYaml(_0x3556ae[_0x560088(0x165)]));_0x3556ae[_0x560088(0x1d7)]&&_0x3556ae['exitCriterias'][_0x560088(0x1e1)]>0x0&&(_0x4831ff[_0x560088(0x1de)]=_0x3556ae[_0x560088(0x1d7)][_0x560088(0x1ac)](convertApiCriteriaToYaml));_0x3556ae[_0x560088(0x1a3)]&&(_0x4831ff[_0x560088(0x1a3)]=convertApiCriteriaToYaml(_0x3556ae[_0x560088(0x1a3)]));if(_0x3556ae[_0x560088(0x16a)]&&Object[_0x560088(0x1df)](_0x3556ae[_0x560088(0x16a)])[_0x560088(0x1e1)]>0x0){const _0x522703=orderStepsFromRoot(_0x3556ae['steps'],_0x3556ae['rootStep']),_0x352ce6=new Map(),_0x2503a2=new Set();for(let _0x35d3e3=0x0;_0x35d3e3<_0x522703[_0x560088(0x1e1)];_0x35d3e3++){const {uuid:_0x18593f,step:_0x139c05}=_0x522703[_0x35d3e3];let _0x1c0d87=generateReadableStepName(_0x139c05,_0x35d3e3),_0x31cfaa=_0x1c0d87,_0x5772c3=0x2;while(_0x2503a2[_0x560088(0x194)](_0x31cfaa)){_0x31cfaa=_0x1c0d87+'_'+_0x5772c3,_0x5772c3++;}_0x2503a2[_0x560088(0x1b4)](_0x31cfaa),_0x352ce6[_0x560088(0x1dd)](_0x18593f,_0x31cfaa);}_0x4831ff[_0x560088(0x16a)]=_0x522703['map'](({uuid:_0x37cd35,step:_0x410365},_0x3b76db)=>{const _0x4e524f=_0x560088,_0x574eb2=convertApiStepToYaml(_0x410365,_0x352ce6[_0x4e524f(0x1d5)](_0x37cd35));return resolveStepReferences(_0x574eb2,_0x3b76db,_0x522703,_0x352ce6),_0x574eb2;});}return _0x4831ff;}function convertApiCriteriaToYaml(_0x5eab6d){const _0x1a30e3=a74_0x1f68,_0x5d7c43={'name':_0x5eab6d['name'],'segment':_0x5eab6d['segmentId']};return _0x5eab6d[_0x1a30e3(0x158)]&&(_0x5d7c43[_0x1a30e3(0x158)]=_0x5eab6d[_0x1a30e3(0x158)]),_0x5eab6d[_0x1a30e3(0x13d)]&&(_0x5d7c43[_0x1a30e3(0x13d)]={'journey':_0x5eab6d[_0x1a30e3(0x13d)][_0x1a30e3(0x185)],'stage':_0x5eab6d[_0x1a30e3(0x13d)][_0x1a30e3(0x19c)]},_0x5eab6d[_0x1a30e3(0x13d)]['journeyBundleId']&&(_0x5d7c43[_0x1a30e3(0x13d)][_0x1a30e3(0x180)]=_0x5eab6d[_0x1a30e3(0x13d)][_0x1a30e3(0x1f0)])),_0x5d7c43;}function convertApiStepToYaml(_0xf3e39f,_0x3ef5ea){const _0x24cc57=a74_0x1f68;switch(_0xf3e39f[_0x24cc57(0x14d)]){case _0x24cc57(0x1a9):{const _0x38d0eb={};if(_0xf3e39f[_0x24cc57(0x135)]==='Duration'&&_0xf3e39f[_0x24cc57(0x1c4)]!==undefined)_0x38d0eb[_0x24cc57(0x1cb)]=_0xf3e39f['waitStep'],_0x38d0eb[_0x24cc57(0x1bc)]=_0xf3e39f[_0x24cc57(0x17c)];else{if(_0xf3e39f[_0x24cc57(0x135)]==='Date'&&_0xf3e39f['waitUntilDate'])_0x38d0eb[_0x24cc57(0x189)]=_0xf3e39f['waitUntilDate'];else{if(_0xf3e39f[_0x24cc57(0x135)]===_0x24cc57(0x1d0)&&_0xf3e39f[_0x24cc57(0x191)])_0x38d0eb[_0x24cc57(0x132)]=_0xf3e39f[_0x24cc57(0x191)];else _0xf3e39f['waitStepType']==='Condition'&&_0xf3e39f[_0x24cc57(0x1a2)]&&(_0x38d0eb['condition']={'segment':_0xf3e39f['conditionSegmentId']},_0xf3e39f[_0x24cc57(0x1a0)]!==undefined&&_0xf3e39f['conditionTimeoutUnit']&&(_0x38d0eb['condition'][_0x24cc57(0x1f7)]={'duration':_0xf3e39f[_0x24cc57(0x1a0)],'unit':_0xf3e39f[_0x24cc57(0x199)]}));}}const _0x24a24e={'type':_0x24cc57(0x1d8),'name':_0x3ef5ea,..._0xf3e39f[_0x24cc57(0x187)]?{'next':_0xf3e39f[_0x24cc57(0x187)]}:{},'with':_0x38d0eb};return _0x24a24e;}case'Activation':{const _0x382764={'type':_0x24cc57(0x14c),'name':_0x3ef5ea,..._0xf3e39f[_0x24cc57(0x187)]?{'next':_0xf3e39f[_0x24cc57(0x187)]}:{},'with':{'activation':_0xf3e39f['journeyActivationStepId']||''}};return _0x382764;}case _0x24cc57(0x138):{const _0x4a82fd={'type':_0x24cc57(0x1db),'name':_0x3ef5ea,..._0xf3e39f[_0x24cc57(0x187)]?{'next':_0xf3e39f[_0x24cc57(0x187)]}:{},'with':{'branches':(_0xf3e39f[_0x24cc57(0x1e6)]||[])[_0x24cc57(0x1ac)](_0x23592f=>({'name':_0x23592f[_0x24cc57(0x169)],'segment':_0x23592f[_0x24cc57(0x176)],'excluded':_0x23592f[_0x24cc57(0x164)],..._0x23592f[_0x24cc57(0x187)]?{'next':_0x23592f[_0x24cc57(0x187)]}:{}}))}};return _0x4a82fd;}case _0x24cc57(0x150):case'AbTest':case _0x24cc57(0x154):{const _0x4f0cb3=_0xf3e39f['variants']||(_0xf3e39f[_0x24cc57(0x1e6)]||[])[_0x24cc57(0x1ac)](_0x1d4270=>({'name':_0x1d4270[_0x24cc57(0x169)],'percentage':0x0,'next':_0x1d4270[_0x24cc57(0x187)]})),_0x57a4af={'type':_0x24cc57(0x1ba),'name':_0x3ef5ea,..._0xf3e39f[_0x24cc57(0x187)]?{'next':_0xf3e39f[_0x24cc57(0x187)]}:{},'with':{'customized_split':_0xf3e39f[_0x24cc57(0x184)],'unique_id':_0xf3e39f[_0x24cc57(0x17a)],'variants':_0x4f0cb3[_0x24cc57(0x1ac)](_0x309ec3=>({'name':_0x309ec3[_0x24cc57(0x169)],'percentage':_0x309ec3[_0x24cc57(0x1d9)],..._0x309ec3[_0x24cc57(0x187)]?{'next':_0x309ec3[_0x24cc57(0x187)]}:{}}))}};return _0x57a4af;}case _0x24cc57(0x1e5):{const _0x11ad26={'type':'merge','name':_0x3ef5ea,..._0xf3e39f[_0x24cc57(0x187)]?{'next':_0xf3e39f[_0x24cc57(0x187)]}:{}};return _0x11ad26;}case'Jump':{if(!_0xf3e39f[_0x24cc57(0x13d)])throw new SDKError(ErrorCode[_0x24cc57(0x1af)],_0x24cc57(0x1da)+(_0xf3e39f[_0x24cc57(0x169)]||_0x3ef5ea)+'\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)');const _0xf27956={'type':'jump','name':_0x3ef5ea,..._0xf3e39f[_0x24cc57(0x187)]?{'next':_0xf3e39f['next']}:{},'with':{'target':{'journey':_0xf3e39f[_0x24cc57(0x13d)]['journeyId'],'stage':_0xf3e39f['target']['journeyStageId'],'bundle_id':_0xf3e39f[_0x24cc57(0x13d)][_0x24cc57(0x1f0)]}}};return _0xf27956;}case _0x24cc57(0x144):{const _0x108d80={'type':'end','name':_0x3ef5ea};return _0x108d80;}default:{const _0x8f25fe={'type':_0x24cc57(0x156),'name':_0x3ef5ea};return _0x8f25fe;}}}export async function yamlToApi(_0xe82b56,_0x2d3d9b,_0x77432){const _0x43352c=a74_0x1f68,_0x2f05df=_0xe82b56[_0x43352c(0x170)]||getActiveStages(_0xe82b56),_0x2e128c=_0xe82b56[_0x43352c(0x16b)]||{},_0x45c10e=_0xe82b56[_0x43352c(0x19e)]||{},_0x346086={'type':_0x43352c(0x1b9),'attributes':{'name':_0xe82b56[_0x43352c(0x169)],'audienceId':_0x2d3d9b,'journeyStages':await Promise[_0x43352c(0x13e)](_0x2f05df[_0x43352c(0x1ac)](_0x33b68a=>convertYamlStageToApi(_0x33b68a,_0x77432,_0x2e128c,_0x45c10e)))}};_0xe82b56['id']&&(_0x346086['id']=_0xe82b56['id']);_0xe82b56[_0x43352c(0x158)]&&(_0x346086[_0x43352c(0x14f)][_0x43352c(0x158)]=_0xe82b56[_0x43352c(0x158)]);const _0x3b2f6a=getEffectiveGoal(_0xe82b56);_0x3b2f6a&&(_0x346086['attributes'][_0x43352c(0x198)]=await convertYamlCriteriaToApi(_0x3b2f6a,_0x77432,_0x2e128c));const _0xb8e6cf=getEffectiveReentry(_0xe82b56);return _0xb8e6cf&&(_0x346086['attributes'][_0x43352c(0x13f)]=_0xb8e6cf,_0x346086[_0x43352c(0x14f)]['allowReentry']=_0xb8e6cf!==_0x43352c(0x173)),_0xe82b56[_0x43352c(0x1d3)]&&(_0x346086[_0x43352c(0x19d)]={'parentFolder':{'data':{'id':_0xe82b56[_0x43352c(0x1d3)],'type':'folder'}}}),_0x346086;}async function convertYamlStageToApi(_0x4f1eb0,_0x509e33,_0x318d44={},_0x20be94={}){const _0x201d22=a74_0x1f68,_0x3b0270={'name':_0x4f1eb0[_0x201d22(0x169)]};_0x4f1eb0['id']&&(_0x3b0270['id']=_0x4f1eb0['id']);_0x4f1eb0[_0x201d22(0x158)]&&(_0x3b0270['description']=_0x4f1eb0['description']);_0x4f1eb0['entry_criteria']&&(_0x3b0270[_0x201d22(0x165)]=await convertYamlCriteriaToApi(_0x4f1eb0[_0x201d22(0x181)],_0x509e33,_0x318d44));_0x4f1eb0['exit_criteria']&&_0x4f1eb0['exit_criteria'][_0x201d22(0x1e1)]>0x0&&(_0x3b0270[_0x201d22(0x1d7)]=await Promise[_0x201d22(0x13e)](_0x4f1eb0[_0x201d22(0x1de)]['map'](_0x34b175=>convertYamlCriteriaToApi(_0x34b175,_0x509e33,_0x318d44))));_0x4f1eb0[_0x201d22(0x1a3)]&&(_0x3b0270['milestone']=await convertYamlCriteriaToApi(_0x4f1eb0[_0x201d22(0x1a3)],_0x509e33,_0x318d44));if(_0x4f1eb0['steps']&&_0x4f1eb0[_0x201d22(0x16a)][_0x201d22(0x1e1)]>0x0){const _0x3f79f3={},_0x46c535=_0x4f1eb0[_0x201d22(0x16a)]['map']((_0x100fb8,_0x2f3683)=>{const _0x1ecb87=_0x201d22,_0x3cd242=_0x100fb8[_0x1ecb87(0x1b1)]||generateUUID(),_0x46d083=_0x100fb8[_0x1ecb87(0x169)]||_0x100fb8['type']+'_'+_0x2f3683;return _0x3f79f3[_0x46d083]=_0x3cd242,{..._0x100fb8,'name':_0x46d083};});_0x3b0270['rootStep']=_0x3f79f3[_0x46c535[0x0][_0x201d22(0x169)]],_0x3b0270[_0x201d22(0x16a)]={};for(let _0x4f7c6c=0x0;_0x4f7c6c<_0x46c535[_0x201d22(0x1e1)];_0x4f7c6c++){const _0x3e1ee0=_0x46c535[_0x4f7c6c],_0x412cb6=_0x3f79f3[_0x3e1ee0[_0x201d22(0x169)]],_0x31ec91=!_0x3e1ee0['next']&&_0x4f7c6c<_0x46c535[_0x201d22(0x1e1)]-0x1&&_0x3e1ee0[_0x201d22(0x14d)]!==_0x201d22(0x156)?_0x46c535[_0x4f7c6c+0x1]['name']:_0x3e1ee0[_0x201d22(0x187)],_0x432a78=_0x31ec91!==_0x3e1ee0[_0x201d22(0x187)]?{..._0x3e1ee0,'next':_0x31ec91}:_0x3e1ee0;_0x3b0270[_0x201d22(0x16a)][_0x412cb6]=await convertYamlStepToApi(_0x432a78,_0x509e33,_0x318d44,_0x3f79f3,_0x20be94);}}else _0x4f1eb0['root_step']&&(_0x3b0270[_0x201d22(0x1e3)]=_0x4f1eb0[_0x201d22(0x182)]);return _0x3b0270;}async function convertYamlCriteriaToApi(_0xa7a8c5,_0x561e76,_0x17734a={}){const _0x295e2e=a74_0x1f68;let _0x4ac8c3=_0xa7a8c5[_0x295e2e(0x19a)];if(_0x4ac8c3&&!/^\d+$/['test'](_0x4ac8c3)){const _0x2f164a=parseSegmentRef(_0x4ac8c3);if(_0x2f164a[_0x295e2e(0x14d)]==='ref')_0x561e76?.[_0x295e2e(0x1a8)]&&(_0x4ac8c3=await _0x561e76[_0x295e2e(0x1a8)](_0x2f164a[_0x295e2e(0x169)]));else{if(_0x2f164a[_0x295e2e(0x14d)]==='embedded'&&_0x17734a[_0x2f164a[_0x295e2e(0x169)]])_0x561e76?.[_0x295e2e(0x17d)]&&(_0x4ac8c3=await _0x561e76[_0x295e2e(0x17d)](_0x2f164a[_0x295e2e(0x169)],_0x17734a[_0x2f164a[_0x295e2e(0x169)]]));else _0x561e76?.[_0x295e2e(0x1a8)]&&(_0x4ac8c3=await _0x561e76[_0x295e2e(0x1a8)](_0x2f164a[_0x295e2e(0x169)]));}}const _0x34039e={'name':_0xa7a8c5[_0x295e2e(0x169)],'segmentId':_0x4ac8c3};_0xa7a8c5[_0x295e2e(0x158)]&&(_0x34039e['description']=_0xa7a8c5[_0x295e2e(0x158)]);if(_0xa7a8c5[_0x295e2e(0x13d)]){let _0x378654=_0xa7a8c5['target'][_0x295e2e(0x1b9)];_0x561e76?.[_0x295e2e(0x178)]&&!/^\d+$/['test'](_0x378654)&&(_0x378654=await _0x561e76[_0x295e2e(0x178)](_0x378654)),_0x34039e[_0x295e2e(0x13d)]={'journeyId':_0x378654,'journeyStageId':_0xa7a8c5[_0x295e2e(0x13d)][_0x295e2e(0x1c2)]},_0xa7a8c5[_0x295e2e(0x13d)][_0x295e2e(0x180)]&&(_0x34039e[_0x295e2e(0x13d)][_0x295e2e(0x1f0)]=_0xa7a8c5['target'][_0x295e2e(0x180)]);}return _0x34039e;}async function convertYamlStepToApi(_0x4874e4,_0x5e4565,_0x3d8b3c={},_0x569a76={},_0x26d7b9={}){const _0x2df8e1=a74_0x1f68,_0x482897=async _0xb4694=>{const _0x48a3d6=a74_0x1f68;if(/^\d+$/[_0x48a3d6(0x179)](_0xb4694))return _0xb4694;const _0x29bea9=parseSegmentRef(_0xb4694);if(_0x29bea9[_0x48a3d6(0x14d)]===_0x48a3d6(0x1e8)){if(_0x5e4565?.[_0x48a3d6(0x1a8)])return await _0x5e4565[_0x48a3d6(0x1a8)](_0x29bea9[_0x48a3d6(0x169)]);}else{if(_0x29bea9[_0x48a3d6(0x14d)]===_0x48a3d6(0x1f5)&&_0x3d8b3c[_0x29bea9[_0x48a3d6(0x169)]]){if(_0x5e4565?.[_0x48a3d6(0x17d)])return await _0x5e4565[_0x48a3d6(0x17d)](_0x29bea9[_0x48a3d6(0x169)],_0x3d8b3c[_0x29bea9['name']]);}else{if(_0x5e4565?.[_0x48a3d6(0x1a8)])return await _0x5e4565['resolveSegmentId'](_0x29bea9[_0x48a3d6(0x169)]);}}return _0xb4694;},_0x5080f7=async _0xf792ca=>{const _0x52f132=a74_0x1f68;if(/^\d+$/['test'](_0xf792ca))return _0xf792ca;const _0x1efe6d=parseSegmentRef(_0xf792ca);if(_0x1efe6d[_0x52f132(0x14d)]==='ref'){if(_0x5e4565?.[_0x52f132(0x17e)])return await _0x5e4565[_0x52f132(0x17e)](_0x1efe6d[_0x52f132(0x169)]);return _0x1efe6d[_0x52f132(0x169)];}else{if(_0x1efe6d['type']===_0x52f132(0x1f5)&&_0x26d7b9[_0x1efe6d['name']]){if(_0x5e4565?.[_0x52f132(0x148)])return await _0x5e4565[_0x52f132(0x148)](_0x1efe6d[_0x52f132(0x169)],_0x26d7b9[_0x1efe6d[_0x52f132(0x169)]]);if(_0x5e4565?.[_0x52f132(0x17e)])return await _0x5e4565[_0x52f132(0x17e)](_0x1efe6d[_0x52f132(0x169)]);}else{if(_0x5e4565?.[_0x52f132(0x17e)])return await _0x5e4565[_0x52f132(0x17e)](_0x1efe6d[_0x52f132(0x169)]);}}return _0xf792ca;},_0x2f99af=_0x540757=>{if(!_0x540757)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x540757))return _0x540757;return _0x569a76[_0x540757]||_0x540757;};switch(_0x4874e4[_0x2df8e1(0x14d)]){case _0x2df8e1(0x1d8):{const _0x4e222e=_0x4874e4,_0x61ce50=_0x4e222e[_0x2df8e1(0x193)],_0x463a18={'type':_0x2df8e1(0x1a9),'name':_0x4e222e['name'],'next':_0x2f99af(_0x4e222e[_0x2df8e1(0x187)])};if(_0x61ce50[_0x2df8e1(0x1cb)]!==undefined&&_0x61ce50[_0x2df8e1(0x1bc)])_0x463a18[_0x2df8e1(0x135)]=_0x2df8e1(0x152),_0x463a18[_0x2df8e1(0x1c4)]=_0x61ce50[_0x2df8e1(0x1cb)],_0x463a18[_0x2df8e1(0x17c)]=normalizeWaitUnit(_0x61ce50[_0x2df8e1(0x1bc)]);else{if(_0x61ce50[_0x2df8e1(0x189)])_0x463a18[_0x2df8e1(0x135)]=_0x2df8e1(0x1aa),_0x463a18[_0x2df8e1(0x166)]=_0x61ce50[_0x2df8e1(0x189)];else{if(_0x61ce50[_0x2df8e1(0x132)])_0x463a18[_0x2df8e1(0x135)]=_0x2df8e1(0x1d0),_0x463a18[_0x2df8e1(0x191)]=_0x61ce50[_0x2df8e1(0x132)];else _0x61ce50[_0x2df8e1(0x155)]&&(_0x463a18[_0x2df8e1(0x135)]='Condition',_0x463a18[_0x2df8e1(0x1a2)]=await _0x482897(_0x61ce50['condition'][_0x2df8e1(0x19a)]),_0x61ce50[_0x2df8e1(0x155)][_0x2df8e1(0x1f7)]&&(_0x463a18['conditionTimeoutDuration']=_0x61ce50[_0x2df8e1(0x155)][_0x2df8e1(0x1f7)][_0x2df8e1(0x1cb)],_0x61ce50[_0x2df8e1(0x155)][_0x2df8e1(0x1f7)][_0x2df8e1(0x1bc)]&&(_0x463a18['conditionTimeoutUnit']=normalizeWaitUnit(_0x61ce50[_0x2df8e1(0x155)][_0x2df8e1(0x1f7)][_0x2df8e1(0x1bc)]))));}}return _0x463a18;}case'activation':{const _0x8280e1=_0x4874e4,_0x5e287b=_0x8280e1[_0x2df8e1(0x193)]['activation'],_0x16b245=await _0x5080f7(_0x5e287b);return{'type':_0x2df8e1(0x18c),'name':_0x8280e1['name'],'journeyActivationStepId':_0x16b245,'next':_0x2f99af(_0x8280e1[_0x2df8e1(0x187)])};}case'decision_point':{const _0x2c3e74=_0x4874e4,_0xcb0065=_0x2c3e74['with']['branches'];return{'type':'DecisionPoint','name':_0x2c3e74[_0x2df8e1(0x169)],'branches':await Promise[_0x2df8e1(0x13e)](_0xcb0065['map'](async _0x1274dd=>{const _0x2ffd93=_0x2df8e1;let _0x67f8d7='';if(!_0x1274dd[_0x2ffd93(0x1ca)]){const _0x37a52a=_0x1274dd[_0x2ffd93(0x19a)]||_0x1274dd[_0x2ffd93(0x1ef)]||'';_0x67f8d7=_0x37a52a?await _0x482897(_0x37a52a):'';}return{'id':crypto[_0x2ffd93(0x159)](),'name':_0x1274dd[_0x2ffd93(0x169)],'description':null,'segmentId':_0x67f8d7,'excludedPath':_0x1274dd['excluded']??![],'next':_0x2f99af(_0x1274dd['next'])};})),'next':_0x2f99af(_0x2c3e74[_0x2df8e1(0x187)])};}case'ab_test':{const _0x1fdadf=_0x4874e4,_0x2258d4=_0x1fdadf[_0x2df8e1(0x193)];return{'type':_0x2df8e1(0x150),'name':_0x1fdadf[_0x2df8e1(0x169)],'customizedSplit':_0x2258d4[_0x2df8e1(0x1a7)],'uniqueId':_0x2258d4[_0x2df8e1(0x1a4)],'variants':_0x2258d4[_0x2df8e1(0x186)][_0x2df8e1(0x1ac)](_0x2a51f4=>({'id':_0x2a51f4['id']||generateUUID(),'name':_0x2a51f4[_0x2df8e1(0x169)],'percentage':_0x2a51f4['percentage'],'next':_0x2f99af(_0x2a51f4[_0x2df8e1(0x187)])})),'next':_0x2f99af(_0x1fdadf['next'])};}case _0x2df8e1(0x15d):return{'type':_0x2df8e1(0x1e5),'name':_0x4874e4[_0x2df8e1(0x169)],'next':_0x2f99af(_0x4874e4[_0x2df8e1(0x187)])};case _0x2df8e1(0x1f3):{const _0x1b91c1=_0x4874e4,_0x35bf03=_0x1b91c1[_0x2df8e1(0x193)][_0x2df8e1(0x13d)];let _0x481c1c=_0x35bf03[_0x2df8e1(0x1b9)];_0x5e4565?.[_0x2df8e1(0x178)]&&!/^\d+$/[_0x2df8e1(0x179)](_0x481c1c)&&(_0x481c1c=await _0x5e4565['resolveJourneyId'](_0x481c1c));let _0x492d2a=_0x35bf03[_0x2df8e1(0x1c2)];return _0x5e4565?.[_0x2df8e1(0x17b)]&&!/^\d+$/[_0x2df8e1(0x179)](_0x492d2a)&&(_0x492d2a=await _0x5e4565['resolveStageId'](_0x481c1c,_0x492d2a)),{'type':_0x2df8e1(0x136),'name':_0x1b91c1[_0x2df8e1(0x169)],'target':{'journeyId':_0x481c1c,'journeyStageId':_0x492d2a,'journeyBundleId':_0x35bf03[_0x2df8e1(0x180)]},'next':_0x2f99af(_0x1b91c1[_0x2df8e1(0x187)])};}case _0x2df8e1(0x156):return{'type':_0x2df8e1(0x144),'name':_0x4874e4[_0x2df8e1(0x169)]};default:{const _0x4cede1=_0x4874e4;return{'type':_0x2df8e1(0x144),'name':_0x4cede1[_0x2df8e1(0x169)]};}}}export function toYamlString(_0x355d9c){const _0x53459f=a74_0x1f68,_0x29b42f=stripInternalFields(_0x355d9c),_0x1aff7f=a74_0x51391a['stringify'](_0x29b42f,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x45db07=[_0x53459f(0x16c),'activations:','goal:',_0x53459f(0x1cc),_0x53459f(0x162),_0x53459f(0x153),_0x53459f(0x1b0)];let _0x2a74b6=_0x1aff7f;for(const _0x594246 of _0x45db07){_0x2a74b6=_0x2a74b6[_0x53459f(0x15a)](new RegExp('^('+_0x594246+')','m'),(_0x5b918a,_0x148826,_0x497d84)=>{if(_0x497d84===0x0||_0x2a74b6[_0x497d84-0x1]==='\x0a'&&_0x2a74b6[_0x497d84-0x2]==='\x0a')return _0x148826;return'\x0a'+_0x148826;});}return _0x2a74b6;}function stripInternalFields(_0x242b92){const _0x127f35=a74_0x1f68,{id:_0x58d648,folder_id:_0x5dec25,bundle_id:_0x4abbc8,bundle_name:_0x3945ca,version:_0x2ac350,version_number:_0x397c20,allow_reentry:_0x48082e,..._0x4bb7cc}=_0x242b92;return _0x4bb7cc[_0x127f35(0x1c5)]&&(_0x4bb7cc[_0x127f35(0x1c5)]=_0x4bb7cc['journeys']['map'](_0x254a1c=>{const _0x22df62=_0x127f35,{id:_0x42badf,version_number:_0x52d810,..._0x1c3d67}=_0x254a1c;return{..._0x1c3d67,'stages':_0x1c3d67[_0x22df62(0x170)][_0x22df62(0x1ac)](stripStageInternalFields),..._0x254a1c[_0x22df62(0x1b7)]===!![]?{'latest':!![]}:{},..._0x4bb7cc[_0x22df62(0x1c5)][_0x22df62(0x1e1)]===0x1&&_0x1c3d67['version']==='v1'?{'version':undefined}:{}};})),_0x4bb7cc[_0x127f35(0x170)]&&(_0x4bb7cc[_0x127f35(0x170)]=_0x4bb7cc[_0x127f35(0x170)][_0x127f35(0x1ac)](stripStageInternalFields)),_0x4bb7cc['versions']&&(_0x4bb7cc[_0x127f35(0x19b)]=_0x4bb7cc[_0x127f35(0x19b)]['map'](_0x53e725=>{const _0x7780=_0x127f35,{id:_0x4a3c1d,version_number:_0x299891,..._0x3bec0a}=_0x53e725;return{..._0x3bec0a,'stages':_0x3bec0a[_0x7780(0x170)]['map'](stripStageInternalFields),..._0x53e725[_0x7780(0x1b7)]===!![]?{'latest':!![]}:{}};})),_0x4bb7cc;}function stripStageInternalFields(_0xab791f){const {id:_0x51a020,..._0x1ed43e}=_0xab791f;return _0x1ed43e;}export function parseYamlString(_0x15b602){const _0x25e1bb=a74_0x1f68,_0x4d6b7d=a74_0x51391a[_0x25e1bb(0x139)](_0x15b602);if(_0x4d6b7d[_0x25e1bb(0x14d)]!=='journey')throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x134));if(!_0x4d6b7d[_0x25e1bb(0x169)])throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x197));const _0x4a5edf=_0x4d6b7d[_0x25e1bb(0x1c5)]&&Array[_0x25e1bb(0x1cf)](_0x4d6b7d[_0x25e1bb(0x1c5)])&&_0x4d6b7d[_0x25e1bb(0x1c5)]['length']>0x0,_0x3eb533=_0x4d6b7d[_0x25e1bb(0x170)]&&Array['isArray'](_0x4d6b7d[_0x25e1bb(0x170)])&&_0x4d6b7d['stages'][_0x25e1bb(0x1e1)]>0x0,_0x3f4765=_0x4d6b7d[_0x25e1bb(0x19b)]&&Array[_0x25e1bb(0x1cf)](_0x4d6b7d[_0x25e1bb(0x19b)])&&_0x4d6b7d[_0x25e1bb(0x19b)][_0x25e1bb(0x1e1)]>0x0,_0x35ff5e=[_0x4a5edf,_0x3eb533,_0x3f4765][_0x25e1bb(0x161)](Boolean)[_0x25e1bb(0x1e1)];if(_0x35ff5e>0x1)throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],'Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.');if(_0x35ff5e===0x0)throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x16f));if(_0x4a5edf){for(let _0x39d3b7=0x0;_0x39d3b7<_0x4d6b7d['journeys'][_0x25e1bb(0x1e1)];_0x39d3b7++){const _0x514c25=_0x4d6b7d[_0x25e1bb(0x1c5)][_0x39d3b7];if(!_0x514c25[_0x25e1bb(0x170)]||!Array[_0x25e1bb(0x1cf)](_0x514c25[_0x25e1bb(0x170)])||_0x514c25[_0x25e1bb(0x170)][_0x25e1bb(0x1e1)]===0x0)throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x1ed)+_0x39d3b7+_0x25e1bb(0x1cd));if(_0x514c25['state']&&![_0x25e1bb(0x195),_0x25e1bb(0x192)][_0x25e1bb(0x17f)](_0x514c25[_0x25e1bb(0x1a1)]))throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x1ed)+_0x39d3b7+']\x20has\x20invalid\x20state:\x20'+_0x514c25[_0x25e1bb(0x1a1)]+_0x25e1bb(0x145));validateStages(_0x514c25[_0x25e1bb(0x170)],_0x25e1bb(0x1c7)+_0x39d3b7+_0x25e1bb(0x1f6));}const _0x3c3b1e=_0x4d6b7d['journeys']['filter'](_0x573116=>_0x573116[_0x25e1bb(0x1b7)]===!![])[_0x25e1bb(0x1e1)];if(_0x3c3b1e>0x1)throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x1ad));}_0x3eb533&&validateStages(_0x4d6b7d[_0x25e1bb(0x170)],_0x25e1bb(0x170));if(_0x3f4765){for(let _0x5a8ba4=0x0;_0x5a8ba4<_0x4d6b7d[_0x25e1bb(0x19b)][_0x25e1bb(0x1e1)];_0x5a8ba4++){const _0x2c402d=_0x4d6b7d[_0x25e1bb(0x19b)][_0x5a8ba4];if(!_0x2c402d[_0x25e1bb(0x169)])throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x183)+_0x5a8ba4+_0x25e1bb(0x15c));if(!_0x2c402d[_0x25e1bb(0x1a1)]||![_0x25e1bb(0x195),_0x25e1bb(0x192)][_0x25e1bb(0x17f)](_0x2c402d[_0x25e1bb(0x1a1)]))throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x183)+_0x5a8ba4+_0x25e1bb(0x1ab)+_0x2c402d[_0x25e1bb(0x1a1)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');if(!_0x2c402d['stages']||!Array[_0x25e1bb(0x1cf)](_0x2c402d['stages'])||_0x2c402d[_0x25e1bb(0x170)]['length']===0x0)throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x183)+_0x5a8ba4+_0x25e1bb(0x1cd));validateStages(_0x2c402d[_0x25e1bb(0x170)],_0x25e1bb(0x157)+_0x5a8ba4+_0x25e1bb(0x1f6));}const _0x478522=_0x4d6b7d[_0x25e1bb(0x19b)][_0x25e1bb(0x161)](_0x2f77b0=>_0x2f77b0[_0x25e1bb(0x1b7)]===!![])[_0x25e1bb(0x1e1)];if(_0x478522>0x1)throw new SDKError(ErrorCode[_0x25e1bb(0x1af)],_0x25e1bb(0x149));}return _0x4d6b7d;}function a74_0x3cc9(){const _0x219ae6=['Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','segment_id','journeyBundleId','conditions','ref:','jump',':\x20maximum\x208\x20stages\x20allowed','embedded','].stages','timeout','days_of_week','week','Journey\x20YAML\x20must\x20have\x20type:\x20journey','waitStepType','Jump','version_number','DecisionPoint','parse','your-activation-name','resolveSegment','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','target','all','reentryMode','\x20\x20\x20\x20conditions:\x0a','Journey\x20description','versionNumber','\x20\x20rule:\x0a','End','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','39670roehlG','Stage\x201','resolveEmbeddedActivationId','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','all_columns','resolveActivationName','activation','type','6DjWguo','attributes','ABTest','\x20\x20\x20\x20type:\x20And\x0a','Duration','stages:','Variant','condition','end','versions[','description','randomUUID','replace','startsWith',']\x20missing\x20required\x20field:\x20name','merge','Wait\x201\x20Day','find','size','filter','journeys:','day','excludedPath','entryCriteria','waitUntilDate','679473luhDJm','schedule','name','steps','segments','segments:','connector_config','allowReentry','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','stages','push','goal-segment','no_reentry','days','resolveJumpTarget','segmentId','isJourneyLocal','resolveJourneyId','test','uniqueId','resolveStageId','waitStepUnit','resolveEmbeddedSegmentId','resolveActivationId','includes','bundle_id','entry_criteria','root_step','Journey\x20YAML\x20versions[','customizedSplit','journeyId','variants','next','slice','wait_until','Expected\x20format:\x0a','151240rKDuXl','Activation','reentry','toLowerCase','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','weeks','daysOfWeek','launched','with','has','draft','sort','Journey\x20YAML\x20missing\x20required\x20field:\x20name','goal','conditionTimeoutUnit','segment','versions','journeyStageId','relationships','activations','12385142DrqZWb','conditionTimeoutDuration','state','conditionSegmentId','milestone','unique_id','activation_template_id','parentFolder','customized_split','resolveSegmentId','WaitStep','Date',']\x20has\x20invalid\x20state:\x20','map','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','121gURVIf','JOURNEY_SYNTAX_ERROR','versions:','uuid','journeyBundleName','Journey\x20YAML\x20','add','2794KWezLD','20806QpVala','latest','\x20\x20\x20\x20type:\x20','journey','ab_test','\x27.\x0a','unit','stageId','resolveActivation','notification','\x27:\x20','Entry\x20Criteria','stage','1717960MAFFsB','waitStep','journeys','4RzjQen','journeys[','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','excluded','duration','reentry:',']\x20missing\x20required\x20field:\x20stages','data','isArray','DaysOfTheWeek','shift','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','folder_id','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','get','(missing)','exitCriterias','wait','percentage','Jump\x20step\x20\x22','decision_point','version','set','exit_criteria','keys','9439956bnemJb','length','stageName','rootStep','definition','Merge','branches','rule','ref','resolveSegmentName','journeyName','behavior','First\x20stage\x20of\x20the\x20journey','Journey\x20YAML\x20journeys['];a74_0x3cc9=function(){return _0x219ae6;};return a74_0x3cc9();}function validateStages(_0x4a75d8,_0x1f20c4){const _0x4aa647=a74_0x1f68;if(_0x4a75d8['length']>0x8)throw new SDKError(ErrorCode[_0x4aa647(0x1af)],_0x4aa647(0x1b3)+_0x1f20c4+_0x4aa647(0x1f4));}export function isJourneyYaml(_0x531c7a){const _0x7b477d=a74_0x1f68;return typeof _0x531c7a==='object'&&_0x531c7a!==null&&_0x7b477d(0x14d)in _0x531c7a&&_0x531c7a['type']===_0x7b477d(0x1b9);}export function generateTemplate(_0x219392,_0x5094b9){const _0x3f7108=a74_0x1f68,_0x343d16={'type':_0x3f7108(0x1b9),'name':_0x219392,'description':_0x3f7108(0x141),'reentry':_0x3f7108(0x173),'goal':{'name':'Goal\x20Achieved','segment':_0x3f7108(0x172)},'stages':[{'name':_0x3f7108(0x147),'description':_0x3f7108(0x1ec),'entry_criteria':{'name':_0x3f7108(0x1c1),'segment':_0x5094b9},'steps':[{'type':_0x3f7108(0x1d8),'name':_0x3f7108(0x15e),'with':{'duration':0x1,'unit':_0x3f7108(0x163)}},{'type':_0x3f7108(0x14c),'name':'Send\x20Notification','with':{'activation':_0x3f7108(0x13a)}},{'type':_0x3f7108(0x156),'name':'Stage\x20Complete'}]}]};return toYamlString(_0x343d16);}function generateUUID(){const _0x5592a2=a74_0x1f68;return crypto[_0x5592a2(0x159)]();}export const SEGMENT_REF_PREFIX=a74_0x3b9b8a(0x1f2);export function parseSegmentRef(_0x59c5fc){const _0x36da36=a74_0x3b9b8a;if(_0x59c5fc[_0x36da36(0x15b)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x59c5fc[_0x36da36(0x188)](SEGMENT_REF_PREFIX[_0x36da36(0x1e1)])};if(/^\d+$/[_0x36da36(0x179)](_0x59c5fc))return{'type':'id','name':_0x59c5fc};return{'type':_0x36da36(0x1f5),'name':_0x59c5fc};}export function makeSegmentRef(_0x217e7d){return''+SEGMENT_REF_PREFIX+_0x217e7d;}export function isExternalSegmentRef(_0x19a27f){const _0x41aab2=a74_0x3b9b8a;return _0x19a27f[_0x41aab2(0x15b)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x4d0d26){const _0x78a41e=a74_0x3b9b8a;return!!(_0x4d0d26['journeys']&&_0x4d0d26[_0x78a41e(0x1c5)][_0x78a41e(0x1e1)]>0x0);}export function isMultiVersionMode(_0x2567b5){const _0x4032be=a74_0x3b9b8a;return!!(_0x2567b5['versions']&&_0x2567b5[_0x4032be(0x19b)][_0x4032be(0x1e1)]>0x0);}export function isSingleVersionMode(_0x57f313){const _0x4fb65d=a74_0x3b9b8a;return!!(_0x57f313[_0x4fb65d(0x170)]&&_0x57f313['stages'][_0x4fb65d(0x1e1)]>0x0);}export function hasMultipleVersions(_0x42efb4){const _0x41d5c0=a74_0x3b9b8a;if(isJourneysArrayMode(_0x42efb4))return(_0x42efb4[_0x41d5c0(0x1c5)]?.[_0x41d5c0(0x1e1)]||0x0)>0x1;if(isMultiVersionMode(_0x42efb4))return(_0x42efb4[_0x41d5c0(0x19b)]?.[_0x41d5c0(0x1e1)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x14b46d){const _0x38760c=a74_0x3b9b8a;if(isJourneysArrayMode(_0x14b46d))return _0x14b46d;if(isSingleVersionMode(_0x14b46d)){const {stages:_0x20650c,id:_0x486af0,version:_0xe33795,version_number:_0xa62eac,..._0x202f83}=_0x14b46d;return{..._0x202f83,'journeys':[{'version':_0xe33795||'v1','stages':_0x20650c||[],'id':_0x486af0,'version_number':_0xa62eac}]};}if(isMultiVersionMode(_0x14b46d)){const {versions:_0x5a3a77,..._0x6f521f}=_0x14b46d;return{..._0x6f521f,'journeys':(_0x5a3a77||[])['map'](_0x32764e=>({'version':_0x32764e[_0x38760c(0x169)],'state':_0x32764e['state'],'latest':_0x32764e[_0x38760c(0x1b7)],'stages':_0x32764e[_0x38760c(0x170)],'id':_0x32764e['id'],'version_number':_0x32764e[_0x38760c(0x137)]}))};}return _0x14b46d;}export function normalizeJourneyYaml(_0x38ab60,_0x5a02a0){const _0x377a2d=a74_0x3b9b8a,_0x2fc2a0=normalizeToJourneysFormat(_0x38ab60),_0x5a7a98=_0x5a02a0?.[_0x377a2d(0x16b)]?Object['keys'](_0x5a02a0['segments']):undefined,_0x9c24bd=_0x5a02a0?.[_0x377a2d(0x19e)]?Object[_0x377a2d(0x1df)](_0x5a02a0[_0x377a2d(0x19e)]):undefined;return{'type':_0x377a2d(0x1b9),'name':_0x2fc2a0[_0x377a2d(0x169)],..._0x2fc2a0[_0x377a2d(0x158)]!==undefined&&{'description':_0x2fc2a0[_0x377a2d(0x158)]},..._0x2fc2a0['goal']&&{'goal':normalizeJourneyCriteria(_0x2fc2a0[_0x377a2d(0x198)])},..._0x2fc2a0[_0x377a2d(0x18d)]!==undefined&&{'reentry':_0x2fc2a0[_0x377a2d(0x18d)]},..._0x2fc2a0['segments']&&{'segments':normalizeEmbeddedSegments(_0x2fc2a0['segments'],_0x5a7a98)},..._0x2fc2a0[_0x377a2d(0x19e)]&&{'activations':normalizeEmbeddedActivations(_0x2fc2a0[_0x377a2d(0x19e)],_0x9c24bd)},..._0x2fc2a0['journeys']&&{'journeys':_0x2fc2a0[_0x377a2d(0x1c5)][_0x377a2d(0x1ac)](_0x4ba2e5=>normalizeJourneyEntry(_0x4ba2e5,_0x2fc2a0[_0x377a2d(0x1c5)][_0x377a2d(0x1e1)]===0x1))}};}function normalizeJourneyEntry(_0x2d329b,_0x8e10b6){const _0x92c626=a74_0x3b9b8a;return{...!_0x8e10b6&&_0x2d329b[_0x92c626(0x1dc)]!==undefined&&{'version':_0x2d329b[_0x92c626(0x1dc)]},..._0x2d329b[_0x92c626(0x1a1)]!==undefined&&{'state':_0x2d329b[_0x92c626(0x1a1)]},...!_0x8e10b6&&_0x2d329b[_0x92c626(0x1b7)]!==undefined&&{'latest':_0x2d329b['latest']},..._0x2d329b['goal']&&{'goal':normalizeJourneyCriteria(_0x2d329b['goal'])},..._0x2d329b[_0x92c626(0x18d)]!==undefined&&{'reentry':_0x2d329b[_0x92c626(0x18d)]},'stages':_0x2d329b[_0x92c626(0x170)][_0x92c626(0x1ac)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x4c8d6f){const _0x41be2e=a74_0x3b9b8a;return{'name':_0x4c8d6f[_0x41be2e(0x169)],..._0x4c8d6f[_0x41be2e(0x158)]!==undefined&&{'description':_0x4c8d6f[_0x41be2e(0x158)]},..._0x4c8d6f[_0x41be2e(0x181)]&&{'entry_criteria':normalizeJourneyCriteria(_0x4c8d6f[_0x41be2e(0x181)])},..._0x4c8d6f[_0x41be2e(0x1de)]&&{'exit_criteria':_0x4c8d6f['exit_criteria'][_0x41be2e(0x1ac)](normalizeJourneyCriteria)},..._0x4c8d6f[_0x41be2e(0x1a3)]&&{'milestone':normalizeJourneyCriteria(_0x4c8d6f['milestone'])},..._0x4c8d6f[_0x41be2e(0x16a)]&&{'steps':normalizeStepsWithImplicitNext(_0x4c8d6f['steps'])}};}function normalizeStepsWithImplicitNext(_0x47a881){return _0x47a881['map']((_0x1aa283,_0x1e12be)=>{const _0x565a37=a74_0x1f68,_0x3a9632=_0x1e12be<_0x47a881[_0x565a37(0x1e1)]-0x1?_0x47a881[_0x1e12be+0x1][_0x565a37(0x169)]:undefined;return normalizeJourneyStep(_0x1aa283,_0x3a9632);});}function normalizeJourneyCriteria(_0x2f2c14){const _0x2a271c=a74_0x3b9b8a;return{'name':_0x2f2c14['name'],..._0x2f2c14[_0x2a271c(0x158)]!==undefined&&{'description':_0x2f2c14[_0x2a271c(0x158)]},'segment':_0x2f2c14[_0x2a271c(0x19a)],..._0x2f2c14[_0x2a271c(0x13d)]&&{'target':normalizeJumpTarget(_0x2f2c14[_0x2a271c(0x13d)])}};}function normalizeJourneyStep(_0x381756,_0x49007a){const _0x2f95f6=a74_0x3b9b8a,_0x55923b=_0x381756['next']!==undefined&&_0x381756[_0x2f95f6(0x187)]!==_0x49007a,_0x3906cc={'type':_0x381756[_0x2f95f6(0x14d)],'name':_0x381756['name'],..._0x55923b&&{'next':_0x381756['next']}};if(_0x2f95f6(0x193)in _0x381756&&_0x381756[_0x2f95f6(0x193)])return{..._0x3906cc,'with':normalizeStepParams(_0x381756[_0x2f95f6(0x14d)],_0x381756[_0x2f95f6(0x193)])};return _0x3906cc;}function normalizeStepParams(_0x1335ba,_0x1043f8){const _0x229330=a74_0x3b9b8a;switch(_0x1335ba){case _0x229330(0x1d8):{const _0x423c7f=_0x1043f8;return{..._0x423c7f[_0x229330(0x1cb)]!==undefined&&{'duration':_0x423c7f[_0x229330(0x1cb)]},..._0x423c7f[_0x229330(0x1bc)]!==undefined&&{'unit':_0x423c7f[_0x229330(0x1bc)]},..._0x423c7f['wait_until']!==undefined&&{'wait_until':_0x423c7f['wait_until']},..._0x423c7f[_0x229330(0x132)]!==undefined&&{'days_of_week':_0x423c7f[_0x229330(0x132)]},..._0x423c7f[_0x229330(0x155)]&&{'condition':_0x423c7f['condition']}};}case _0x229330(0x14c):{const _0x575e8e=_0x1043f8;return{'activation':_0x575e8e[_0x229330(0x14c)]};}case'decision_point':{const _0x43dc56=_0x1043f8;return{'branches':_0x43dc56[_0x229330(0x1e6)]['map'](normalizeDecisionBranch)};}case _0x229330(0x1ba):{const _0x520abb=_0x1043f8;return{..._0x520abb['customized_split']!==undefined&&{'customized_split':_0x520abb[_0x229330(0x1a7)]},..._0x520abb[_0x229330(0x1a4)]!==undefined&&{'unique_id':_0x520abb['unique_id']},'variants':_0x520abb['variants'][_0x229330(0x1ac)](normalizeAbTestVariant)};}case'jump':{const _0x13064f=_0x1043f8;return{'target':normalizeJumpTarget(_0x13064f['target'])};}default:return _0x1043f8;}}function normalizeDecisionBranch(_0x51b2f7){const _0x5c5c05=a74_0x3b9b8a;return{'name':_0x51b2f7[_0x5c5c05(0x169)],..._0x51b2f7['segment']!==undefined&&{'segment':_0x51b2f7['segment']},..._0x51b2f7['excluded']!==undefined&&{'excluded':_0x51b2f7[_0x5c5c05(0x1ca)]},..._0x51b2f7[_0x5c5c05(0x187)]!==undefined&&{'next':_0x51b2f7[_0x5c5c05(0x187)]}};}function a74_0x1f68(_0x2b1ae5,_0x52b3e7){_0x2b1ae5=_0x2b1ae5-0x132;const _0x3cc939=a74_0x3cc9();let _0x1f6892=_0x3cc939[_0x2b1ae5];return _0x1f6892;}function normalizeAbTestVariant(_0x2e5cee){const _0x1f587f=a74_0x3b9b8a;return{..._0x2e5cee['id']!==undefined&&{'id':_0x2e5cee['id']},'name':_0x2e5cee[_0x1f587f(0x169)],'percentage':_0x2e5cee['percentage'],..._0x2e5cee['next']!==undefined&&{'next':_0x2e5cee[_0x1f587f(0x187)]}};}function normalizeJumpTarget(_0xa32da8){const _0x64dcd8=a74_0x3b9b8a;return{'journey':_0xa32da8[_0x64dcd8(0x1b9)],'stage':_0xa32da8[_0x64dcd8(0x1c2)],..._0xa32da8[_0x64dcd8(0x180)]!==undefined&&{'bundle_id':_0xa32da8[_0x64dcd8(0x180)]}};}function normalizeEmbeddedSegments(_0x290ffc,_0xf5b667){const _0x13ef95=a74_0x3b9b8a,_0x48e5a3={},_0x18820b=Object[_0x13ef95(0x1df)](_0x290ffc),_0x58ed4b=_0xf5b667?[..._0xf5b667[_0x13ef95(0x161)](_0x3c1a61=>_0x18820b[_0x13ef95(0x17f)](_0x3c1a61)),..._0x18820b[_0x13ef95(0x161)](_0x582c3c=>!_0xf5b667[_0x13ef95(0x17f)](_0x582c3c))[_0x13ef95(0x196)]()]:_0x18820b[_0x13ef95(0x196)]();for(const _0x15d025 of _0x58ed4b){const _0x17788c=_0x290ffc[_0x15d025];if(_0x17788c[_0x13ef95(0x1e7)]){const _0xd3087d=_0x17788c['rule'];if(_0xd3087d[_0x13ef95(0x14d)]!=='And'&&_0xd3087d['type']!=='Or'){const _0x4df5bb=_0xd3087d[_0x13ef95(0x14d)]??_0x13ef95(0x1d6);throw new SDKError(ErrorCode[_0x13ef95(0x1af)],_0x13ef95(0x1ee)+_0x15d025+_0x13ef95(0x1c0)+('rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27'+_0x4df5bb+_0x13ef95(0x1bb))+_0x13ef95(0x18a)+_0x13ef95(0x143)+_0x13ef95(0x151)+_0x13ef95(0x140)+_0x13ef95(0x1c8)+_0x13ef95(0x18f)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0xd3087d[_0x13ef95(0x1f1)]||!Array[_0x13ef95(0x1cf)](_0xd3087d[_0x13ef95(0x1f1)]))throw new SDKError(ErrorCode[_0x13ef95(0x1af)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x15d025+_0x13ef95(0x1c0)+_0x13ef95(0x13c)+_0x13ef95(0x18a)+_0x13ef95(0x143)+(_0x13ef95(0x1b8)+_0xd3087d[_0x13ef95(0x14d)]+'\x0a')+_0x13ef95(0x140)+_0x13ef95(0x1c8)+_0x13ef95(0x18f)+_0x13ef95(0x1c9));}_0x48e5a3[_0x15d025]={..._0x17788c[_0x13ef95(0x158)]!==undefined&&{'description':_0x17788c['description']},..._0x17788c[_0x13ef95(0x1e7)]&&{'rule':normalizeRule(_0x17788c[_0x13ef95(0x1e7)])}};}return _0x48e5a3;}function normalizeEmbeddedActivations(_0x17c780,_0x3e8e9c){const _0x2b37f1=a74_0x3b9b8a,_0x2aaa5c={},_0x1b2693=Object[_0x2b37f1(0x1df)](_0x17c780),_0x3ede0d=_0x3e8e9c?[..._0x3e8e9c[_0x2b37f1(0x161)](_0x3de85a=>_0x1b2693[_0x2b37f1(0x17f)](_0x3de85a)),..._0x1b2693['filter'](_0x3894be=>!_0x3e8e9c[_0x2b37f1(0x17f)](_0x3894be))['sort']()]:_0x1b2693['sort']();for(const _0x4f3783 of _0x3ede0d){const _0x131098=_0x17c780[_0x4f3783];_0x2aaa5c[_0x4f3783]={'name':_0x131098[_0x2b37f1(0x169)],'connection':_0x131098['connection'],..._0x131098[_0x2b37f1(0x158)]!==undefined&&{'description':_0x131098['description']},..._0x131098[_0x2b37f1(0x14a)]!==undefined&&{'all_columns':_0x131098[_0x2b37f1(0x14a)]},..._0x131098['columns']!==undefined&&{'columns':_0x131098['columns']},..._0x131098[_0x2b37f1(0x1eb)]!==undefined&&{'behavior':_0x131098['behavior']},..._0x131098[_0x2b37f1(0x168)]!==undefined&&{'schedule':_0x131098[_0x2b37f1(0x168)]},..._0x131098[_0x2b37f1(0x1bf)]!==undefined&&{'notification':_0x131098['notification']},..._0x131098[_0x2b37f1(0x16d)]!==undefined&&{'connector_config':_0x131098[_0x2b37f1(0x16d)]},..._0x131098[_0x2b37f1(0x1a5)]!==undefined&&{'activation_template_id':_0x131098[_0x2b37f1(0x1a5)]}};}return _0x2aaa5c;}export function getActiveStages(_0x4b54c8){const _0x377d14=a74_0x3b9b8a;if(isJourneysArrayMode(_0x4b54c8)){const _0x2afbbf=_0x4b54c8[_0x377d14(0x1c5)]||[],_0x51483c=_0x2afbbf[_0x377d14(0x15f)](_0x42b9ad=>_0x42b9ad['latest']===!![])||_0x2afbbf[0x0];return _0x51483c?.['stages']||[];}if(isSingleVersionMode(_0x4b54c8))return _0x4b54c8['stages']||[];if(isMultiVersionMode(_0x4b54c8)){const _0xcd095f=_0x4b54c8[_0x377d14(0x19b)]||[],_0x44b63f=_0xcd095f[_0x377d14(0x15f)](_0x44785c=>_0x44785c[_0x377d14(0x1b7)]===!![])||_0xcd095f[0x0];return _0x44b63f?.[_0x377d14(0x170)]||[];}return[];}export function getLatestJourneyEntry(_0x18aa05){const _0x153195=a74_0x3b9b8a;if(isJourneysArrayMode(_0x18aa05)){const _0x503ee6=_0x18aa05[_0x153195(0x1c5)]||[];return _0x503ee6[_0x153195(0x15f)](_0x5cb835=>_0x5cb835[_0x153195(0x1b7)]===!![])||_0x503ee6[0x0];}if(isMultiVersionMode(_0x18aa05)){const _0x3931f6=_0x18aa05[_0x153195(0x19b)]||[],_0xe77ff6=_0x3931f6['find'](_0x3d0cb4=>_0x3d0cb4[_0x153195(0x1b7)]===!![])||_0x3931f6[0x0];if(_0xe77ff6)return{'version':_0xe77ff6['name'],'state':_0xe77ff6[_0x153195(0x1a1)],'latest':_0xe77ff6[_0x153195(0x1b7)],'stages':_0xe77ff6[_0x153195(0x170)],'id':_0xe77ff6['id'],'version_number':_0xe77ff6[_0x153195(0x137)]};}if(isSingleVersionMode(_0x18aa05))return{'version':_0x18aa05['version']||'v1','state':_0x153195(0x195),'stages':_0x18aa05[_0x153195(0x170)]||[],'id':_0x18aa05['id'],'version_number':_0x18aa05['version_number'],'goal':_0x18aa05[_0x153195(0x198)],'reentry':_0x18aa05[_0x153195(0x18d)]};return undefined;}export function getLatestVersion(_0x5b2c0c){const _0x2b16ce=a74_0x3b9b8a;if(!isMultiVersionMode(_0x5b2c0c))return undefined;const _0x40dde9=_0x5b2c0c[_0x2b16ce(0x19b)]||[];return _0x40dde9[_0x2b16ce(0x15f)](_0x3592cb=>_0x3592cb['latest']===!![])||_0x40dde9[0x0];}export function getEffectiveGoal(_0x29d7c5){const _0x1ecaa8=a74_0x3b9b8a,_0xe9a0c2=getLatestJourneyEntry(_0x29d7c5);return _0xe9a0c2?.[_0x1ecaa8(0x198)]||_0x29d7c5[_0x1ecaa8(0x198)];}export function getEffectiveReentry(_0x4d2733){const _0x199dff=a74_0x3b9b8a,_0x2e1d07=getLatestJourneyEntry(_0x4d2733);return _0x2e1d07?.[_0x199dff(0x18d)]||_0x4d2733[_0x199dff(0x18d)];}export function collectSegmentRefs(_0x3836af){const _0x364ecb=a74_0x3b9b8a,_0x3bb02a=new Set();_0x3836af['goal']?.[_0x364ecb(0x19a)]&&_0x3bb02a[_0x364ecb(0x1b4)](_0x3836af['goal'][_0x364ecb(0x19a)]);const _0x2de4e5=_0x4cfd55=>{const _0x422dbd=_0x364ecb;for(const _0x117fbf of _0x4cfd55){_0x117fbf[_0x422dbd(0x181)]?.[_0x422dbd(0x19a)]&&_0x3bb02a[_0x422dbd(0x1b4)](_0x117fbf[_0x422dbd(0x181)][_0x422dbd(0x19a)]);if(_0x117fbf['exit_criteria'])for(const _0x554ef7 of _0x117fbf[_0x422dbd(0x1de)]){_0x554ef7['segment']&&_0x3bb02a[_0x422dbd(0x1b4)](_0x554ef7[_0x422dbd(0x19a)]);}_0x117fbf['milestone']?.['segment']&&_0x3bb02a['add'](_0x117fbf[_0x422dbd(0x1a3)][_0x422dbd(0x19a)]);if(_0x117fbf[_0x422dbd(0x16a)])for(const _0x46b51c of _0x117fbf[_0x422dbd(0x16a)]){if(_0x46b51c[_0x422dbd(0x14d)]==='decision_point'){const _0x3c6117=_0x46b51c;for(const _0x108b0f of _0x3c6117['with']['branches']){_0x108b0f['segment']&&_0x3bb02a['add'](_0x108b0f[_0x422dbd(0x19a)]);}}else{if(_0x46b51c[_0x422dbd(0x14d)]===_0x422dbd(0x1d8)){const _0x4c7a7f=_0x46b51c;_0x4c7a7f[_0x422dbd(0x193)][_0x422dbd(0x155)]?.['segment']&&_0x3bb02a['add'](_0x4c7a7f[_0x422dbd(0x193)][_0x422dbd(0x155)][_0x422dbd(0x19a)]);}}}}};_0x3836af[_0x364ecb(0x170)]&&_0x2de4e5(_0x3836af[_0x364ecb(0x170)]);if(_0x3836af[_0x364ecb(0x19b)])for(const _0x57b68a of _0x3836af[_0x364ecb(0x19b)]){_0x2de4e5(_0x57b68a[_0x364ecb(0x170)]);}return _0x3bb02a;}export function validateSegmentRefs(_0x3eab0d){const _0xcd479b=a74_0x3b9b8a,_0x7b0c7c=[],_0x553897=collectSegmentRefs(_0x3eab0d),_0x480c41=new Set(Object[_0xcd479b(0x1df)](_0x3eab0d['segments']||{}));for(const _0x465fe1 of _0x553897){const _0x16d8a2=parseSegmentRef(_0x465fe1);_0x16d8a2[_0xcd479b(0x14d)]===_0xcd479b(0x1f5)&&!_0x480c41[_0xcd479b(0x194)](_0x16d8a2[_0xcd479b(0x169)])&&_0x7b0c7c[_0xcd479b(0x171)]('Unknown\x20segment\x20\x22'+_0x16d8a2[_0xcd479b(0x169)]+_0xcd479b(0x1d2)+_0x16d8a2[_0xcd479b(0x169)]+_0xcd479b(0x1d4));}return _0x7b0c7c;}
|
|
1
|
+
const a74_0x232ce5=a74_0x5956;(function(_0x46d248,_0x13e049){const _0xaea96d=a74_0x5956,_0x2130c6=_0x46d248();while(!![]){try{const _0xf56b00=-parseInt(_0xaea96d(0x29a))/0x1*(parseInt(_0xaea96d(0x250))/0x2)+parseInt(_0xaea96d(0x1d7))/0x3*(parseInt(_0xaea96d(0x202))/0x4)+parseInt(_0xaea96d(0x208))/0x5*(parseInt(_0xaea96d(0x1d4))/0x6)+-parseInt(_0xaea96d(0x276))/0x7+parseInt(_0xaea96d(0x1e7))/0x8*(-parseInt(_0xaea96d(0x1e9))/0x9)+-parseInt(_0xaea96d(0x215))/0xa*(-parseInt(_0xaea96d(0x240))/0xb)+parseInt(_0xaea96d(0x1e6))/0xc;if(_0xf56b00===_0x13e049)break;else _0x2130c6['push'](_0x2130c6['shift']());}catch(_0x208ca6){_0x2130c6['push'](_0x2130c6['shift']());}}}(a74_0x36a5,0x4d3de));import*as a74_0x2e4d12 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{normalizeRule}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'../../utils/journey-utils.js';export function normalizeWaitUnit(_0x2f8c9f){const _0x28a316=a74_0x5956,_0x96b01=_0x2f8c9f[_0x28a316(0x289)]();if(_0x96b01==='days'||_0x96b01===_0x28a316(0x265))return _0x28a316(0x265);if(_0x96b01==='weeks'||_0x96b01===_0x28a316(0x1e8))return'week';return _0x2f8c9f;}export function apiToYaml(_0x55c069){const _0x1a755d=a74_0x5956,_0x35ea66=_0x55c069[_0x1a755d(0x201)],_0x44092f=_0x35ea66[_0x1a755d(0x1cd)]||_0x35ea66['name'],_0x46a28c={'stages':_0x35ea66['journeyStages']['map'](convertApiStageToYaml),'id':_0x55c069['id']};_0x35ea66[_0x1a755d(0x22b)]&&_0x35ea66[_0x1a755d(0x22b)]!==_0x44092f&&(_0x46a28c['version']=_0x35ea66[_0x1a755d(0x22b)]);_0x35ea66['versionNumber']!==undefined&&(_0x46a28c[_0x1a755d(0x225)]=_0x35ea66[_0x1a755d(0x284)]);_0x35ea66[_0x1a755d(0x26b)]&&(_0x46a28c[_0x1a755d(0x26b)]=_0x35ea66[_0x1a755d(0x26b)]===_0x1a755d(0x213)?_0x1a755d(0x213):_0x1a755d(0x262));const _0x683b4b={'type':_0x1a755d(0x1e0),'name':_0x44092f,'journeys':[_0x46a28c]};_0x35ea66['description']&&(_0x683b4b['description']=_0x35ea66['description']);_0x35ea66[_0x1a755d(0x1f8)]&&(_0x683b4b['goal']=convertApiCriteriaToYaml(_0x35ea66[_0x1a755d(0x1f8)]));if(_0x35ea66[_0x1a755d(0x1f0)])_0x683b4b[_0x1a755d(0x267)]=_0x35ea66[_0x1a755d(0x1f0)];else _0x35ea66['allowReentry']!==undefined&&(_0x683b4b['reentry']=_0x35ea66[_0x1a755d(0x1d5)]?_0x1a755d(0x203):_0x1a755d(0x22a));return _0x35ea66['journeyBundleId']&&(_0x683b4b['bundle_id']=_0x35ea66[_0x1a755d(0x24d)]),_0x35ea66['journeyBundleName']&&(_0x683b4b[_0x1a755d(0x25e)]=_0x35ea66[_0x1a755d(0x1cd)]),_0x55c069['relationships']?.[_0x1a755d(0x24c)]?.['data']?.['id']&&(_0x683b4b[_0x1a755d(0x1fa)]=_0x55c069['relationships'][_0x1a755d(0x24c)][_0x1a755d(0x298)]['id']),_0x683b4b;}export async function apiToYamlAsync(_0x19eb39,_0x559c9f){const _0x3445fb=a74_0x5956,_0x1d6dad=apiToYaml(_0x19eb39);if(!_0x559c9f)return _0x1d6dad;const _0x195254=new Set();collectSegmentIdsFromJourney(_0x1d6dad,_0x195254);const _0x5ce0f0=new Set();collectActivationIdsFromJourney(_0x1d6dad,_0x5ce0f0);const _0x5ea2f4={},_0xfb6cf1=new Map();for(const _0x3876fa of _0x195254){if(_0x559c9f[_0x3445fb(0x1db)]){const _0x3ad137=await _0x559c9f[_0x3445fb(0x1db)](_0x3876fa);_0x3ad137[_0x3445fb(0x23b)]?(_0xfb6cf1['set'](_0x3876fa,_0x3ad137[_0x3445fb(0x22b)]),_0x3ad137['definition']&&(_0x5ea2f4[_0x3ad137[_0x3445fb(0x22b)]]=_0x3ad137[_0x3445fb(0x1d9)])):_0xfb6cf1[_0x3445fb(0x27e)](_0x3876fa,makeSegmentRef(_0x3ad137[_0x3445fb(0x22b)]));}else{if(_0x559c9f[_0x3445fb(0x248)]){const _0x1901b4=await _0x559c9f['resolveSegmentName'](_0x3876fa);_0xfb6cf1[_0x3445fb(0x27e)](_0x3876fa,_0x1901b4);}}}const _0xe4f840={},_0x3a600b=new Map();for(const _0x5c6b48 of _0x5ce0f0){if(_0x559c9f[_0x3445fb(0x237)]){const _0x14f928=await _0x559c9f[_0x3445fb(0x237)](_0x5c6b48);_0x14f928[_0x3445fb(0x23b)]?(_0x3a600b[_0x3445fb(0x27e)](_0x5c6b48,_0x14f928[_0x3445fb(0x22b)]),_0x14f928[_0x3445fb(0x1d9)]&&(_0xe4f840[_0x14f928['name']]=_0x14f928['definition'])):_0x3a600b[_0x3445fb(0x27e)](_0x5c6b48,makeSegmentRef(_0x14f928[_0x3445fb(0x22b)]));}else{if(_0x559c9f['resolveActivationName']){const _0x2c7485=await _0x559c9f[_0x3445fb(0x244)](_0x5c6b48);_0x3a600b[_0x3445fb(0x27e)](_0x5c6b48,_0x2c7485);}}}_0xfb6cf1['size']>0x0&&replaceSegmentIdsInJourney(_0x1d6dad,_0xfb6cf1);_0x3a600b[_0x3445fb(0x1eb)]>0x0&&replaceActivationIdsInJourney(_0x1d6dad,_0x3a600b);if(_0x559c9f[_0x3445fb(0x231)]){const _0x5e8923=[];collectJumpTargetsFromJourney(_0x1d6dad,_0x5e8923);if(_0x5e8923[_0x3445fb(0x1f7)]>0x0){const _0x55c5d5=new Map();for(const _0x13417e of _0x5e8923){try{const _0x3b7da0=await _0x559c9f['resolveJumpTarget'](_0x13417e['journeyId'],_0x13417e[_0x3445fb(0x22c)]);_0x55c5d5[_0x3445fb(0x27e)](_0x13417e[_0x3445fb(0x1d0)]+':'+_0x13417e[_0x3445fb(0x22c)],_0x3b7da0);}catch{}}_0x55c5d5[_0x3445fb(0x1eb)]>0x0&&replaceJumpTargetsInJourney(_0x1d6dad,_0x55c5d5);}}return Object[_0x3445fb(0x27c)](_0x5ea2f4)[_0x3445fb(0x1f7)]>0x0&&(_0x1d6dad[_0x3445fb(0x228)]=_0x5ea2f4),Object[_0x3445fb(0x27c)](_0xe4f840)[_0x3445fb(0x1f7)]>0x0&&(_0x1d6dad[_0x3445fb(0x296)]=_0xe4f840),_0x1d6dad;}function collectSegmentIdsFromJourney(_0x2475d4,_0x599973){const _0x4a36a7=a74_0x5956;_0x2475d4[_0x4a36a7(0x1f8)]?.[_0x4a36a7(0x295)]&&_0x599973['add'](_0x2475d4[_0x4a36a7(0x1f8)][_0x4a36a7(0x295)]);const _0x22a650=_0x5ef534=>{const _0x153c55=_0x4a36a7;for(const _0x125cd6 of _0x5ef534){_0x125cd6[_0x153c55(0x1fe)]?.[_0x153c55(0x295)]&&_0x599973['add'](_0x125cd6['entry_criteria'][_0x153c55(0x295)]);if(_0x125cd6[_0x153c55(0x1ee)])for(const _0x2b79c8 of _0x125cd6['exit_criteria']){_0x2b79c8['segment']&&_0x599973[_0x153c55(0x245)](_0x2b79c8['segment']);}_0x125cd6[_0x153c55(0x1e5)]?.['segment']&&_0x599973[_0x153c55(0x245)](_0x125cd6['milestone']['segment']);if(_0x125cd6[_0x153c55(0x20f)])for(const _0x5e7dc5 of _0x125cd6[_0x153c55(0x20f)]){if(_0x5e7dc5[_0x153c55(0x1e3)]===_0x153c55(0x28f)){const _0x55ade1=_0x5e7dc5;for(const _0x502a4e of _0x55ade1[_0x153c55(0x23c)]['branches']){_0x502a4e[_0x153c55(0x295)]&&_0x599973[_0x153c55(0x245)](_0x502a4e[_0x153c55(0x295)]);}}else{if(_0x5e7dc5[_0x153c55(0x1e3)]===_0x153c55(0x269)){const _0xb045e2=_0x5e7dc5;_0xb045e2[_0x153c55(0x23c)][_0x153c55(0x27f)]?.[_0x153c55(0x295)]&&_0x599973[_0x153c55(0x245)](_0xb045e2[_0x153c55(0x23c)]['condition'][_0x153c55(0x295)]);}}}}};if(_0x2475d4['journeys'])for(const _0x589d26 of _0x2475d4[_0x4a36a7(0x1df)]){_0x589d26[_0x4a36a7(0x1f8)]?.[_0x4a36a7(0x295)]&&_0x599973[_0x4a36a7(0x245)](_0x589d26[_0x4a36a7(0x1f8)][_0x4a36a7(0x295)]),_0x22a650(_0x589d26['stages']);}_0x2475d4[_0x4a36a7(0x222)]&&_0x22a650(_0x2475d4[_0x4a36a7(0x222)]);if(_0x2475d4['versions'])for(const _0x179b29 of _0x2475d4['versions']){_0x22a650(_0x179b29['stages']);}}function replaceSegmentIdsInJourney(_0xaefdcf,_0x1781ac){const _0x45f8b3=a74_0x5956,_0xad7c28=_0x36bd62=>_0x1781ac[_0x45f8b3(0x1fd)](_0x36bd62)||_0x36bd62;_0xaefdcf[_0x45f8b3(0x1f8)]?.['segment']&&(_0xaefdcf[_0x45f8b3(0x1f8)][_0x45f8b3(0x295)]=_0xad7c28(_0xaefdcf[_0x45f8b3(0x1f8)][_0x45f8b3(0x295)]));const _0x47fff6=_0x376d15=>{const _0x1ce782=_0x45f8b3;for(const _0x19f27e of _0x376d15){_0x19f27e['entry_criteria']?.[_0x1ce782(0x295)]&&(_0x19f27e[_0x1ce782(0x1fe)][_0x1ce782(0x295)]=_0xad7c28(_0x19f27e['entry_criteria']['segment']));if(_0x19f27e[_0x1ce782(0x1ee)])for(const _0x3b9013 of _0x19f27e['exit_criteria']){_0x3b9013[_0x1ce782(0x295)]&&(_0x3b9013[_0x1ce782(0x295)]=_0xad7c28(_0x3b9013[_0x1ce782(0x295)]));}_0x19f27e[_0x1ce782(0x1e5)]?.[_0x1ce782(0x295)]&&(_0x19f27e[_0x1ce782(0x1e5)]['segment']=_0xad7c28(_0x19f27e[_0x1ce782(0x1e5)]['segment']));if(_0x19f27e[_0x1ce782(0x20f)])for(const _0x102c2c of _0x19f27e['steps']){if(_0x102c2c[_0x1ce782(0x1e3)]==='decision_point'){const _0x48889b=_0x102c2c;for(const _0x103885 of _0x48889b[_0x1ce782(0x23c)][_0x1ce782(0x1ea)]){_0x103885[_0x1ce782(0x295)]&&(_0x103885[_0x1ce782(0x295)]=_0xad7c28(_0x103885[_0x1ce782(0x295)]));}}else{if(_0x102c2c[_0x1ce782(0x1e3)]===_0x1ce782(0x269)){const _0x17e1f3=_0x102c2c;_0x17e1f3['with']['condition']?.[_0x1ce782(0x295)]&&(_0x17e1f3['with'][_0x1ce782(0x27f)][_0x1ce782(0x295)]=_0xad7c28(_0x17e1f3[_0x1ce782(0x23c)]['condition']['segment']));}}}}};if(_0xaefdcf['journeys'])for(const _0x57fba6 of _0xaefdcf[_0x45f8b3(0x1df)]){_0x57fba6['goal']?.[_0x45f8b3(0x295)]&&(_0x57fba6[_0x45f8b3(0x1f8)][_0x45f8b3(0x295)]=_0xad7c28(_0x57fba6[_0x45f8b3(0x1f8)][_0x45f8b3(0x295)])),_0x47fff6(_0x57fba6[_0x45f8b3(0x222)]);}_0xaefdcf['stages']&&_0x47fff6(_0xaefdcf[_0x45f8b3(0x222)]);if(_0xaefdcf[_0x45f8b3(0x280)])for(const _0x51e9f9 of _0xaefdcf[_0x45f8b3(0x280)]){_0x47fff6(_0x51e9f9[_0x45f8b3(0x222)]);}}function collectActivationIdsFromJourney(_0x581a49,_0x490337){const _0x2f72a8=a74_0x5956,_0x4a3b5c=_0x147c13=>{const _0x340d1b=a74_0x5956;for(const _0x1c6f69 of _0x147c13){if(_0x1c6f69[_0x340d1b(0x20f)])for(const _0x3aa5ac of _0x1c6f69['steps']){if(_0x3aa5ac['type']===_0x340d1b(0x275)){const _0x26ee99=_0x3aa5ac;_0x26ee99[_0x340d1b(0x23c)]['activation']&&/^\d+$/[_0x340d1b(0x27d)](_0x26ee99[_0x340d1b(0x23c)][_0x340d1b(0x275)])&&_0x490337[_0x340d1b(0x245)](_0x26ee99[_0x340d1b(0x23c)][_0x340d1b(0x275)]);}}}};if(_0x581a49[_0x2f72a8(0x1df)])for(const _0x2b3ddf of _0x581a49[_0x2f72a8(0x1df)]){_0x4a3b5c(_0x2b3ddf[_0x2f72a8(0x222)]);}_0x581a49['stages']&&_0x4a3b5c(_0x581a49[_0x2f72a8(0x222)]);if(_0x581a49[_0x2f72a8(0x280)])for(const _0x509669 of _0x581a49['versions']){_0x4a3b5c(_0x509669[_0x2f72a8(0x222)]);}}function replaceActivationIdsInJourney(_0x2afc39,_0x4ddb56){const _0x2c34b7=a74_0x5956,_0x4088e7=_0x566ee0=>_0x4ddb56[_0x2c34b7(0x1fd)](_0x566ee0)||_0x566ee0,_0x1f7b69=_0x29886c=>{const _0x231b72=_0x2c34b7;for(const _0x371b3a of _0x29886c){if(_0x371b3a[_0x231b72(0x20f)])for(const _0x4e55af of _0x371b3a[_0x231b72(0x20f)]){if(_0x4e55af[_0x231b72(0x1e3)]===_0x231b72(0x275)){const _0x79f2a3=_0x4e55af;_0x79f2a3[_0x231b72(0x23c)][_0x231b72(0x275)]&&(_0x79f2a3['with'][_0x231b72(0x275)]=_0x4088e7(_0x79f2a3[_0x231b72(0x23c)][_0x231b72(0x275)]));}}}};if(_0x2afc39[_0x2c34b7(0x1df)])for(const _0x59306a of _0x2afc39[_0x2c34b7(0x1df)]){_0x1f7b69(_0x59306a[_0x2c34b7(0x222)]);}_0x2afc39[_0x2c34b7(0x222)]&&_0x1f7b69(_0x2afc39[_0x2c34b7(0x222)]);if(_0x2afc39[_0x2c34b7(0x280)])for(const _0x38aee7 of _0x2afc39['versions']){_0x1f7b69(_0x38aee7[_0x2c34b7(0x222)]);}}function collectJumpTargetsFromJourney(_0x5ffaf2,_0x1e7b0f){const _0x3a8c28=a74_0x5956,_0x521e20=new Set(),_0x110e30=_0x4567a3=>{const _0x56d7b9=a74_0x5956;for(const _0x494c2e of _0x4567a3){if(_0x494c2e['steps'])for(const _0x1ee867 of _0x494c2e[_0x56d7b9(0x20f)]){if(_0x1ee867[_0x56d7b9(0x1e3)]===_0x56d7b9(0x238)){const _0x2e3f88=_0x1ee867,_0x165c17=_0x2e3f88[_0x56d7b9(0x23c)]['target'];if(_0x165c17['journey']&&_0x165c17[_0x56d7b9(0x22d)]&&/^\d+$/['test'](_0x165c17['journey'])&&/^\d+$/['test'](_0x165c17['stage'])){const _0x50df47=_0x165c17[_0x56d7b9(0x1e0)]+':'+_0x165c17[_0x56d7b9(0x22d)];!_0x521e20[_0x56d7b9(0x21f)](_0x50df47)&&(_0x521e20[_0x56d7b9(0x245)](_0x50df47),_0x1e7b0f[_0x56d7b9(0x291)]({'journeyId':_0x165c17[_0x56d7b9(0x1e0)],'stageId':_0x165c17[_0x56d7b9(0x22d)]}));}}}}};if(_0x5ffaf2[_0x3a8c28(0x1df)])for(const _0x2bda89 of _0x5ffaf2[_0x3a8c28(0x1df)]){_0x110e30(_0x2bda89[_0x3a8c28(0x222)]);}_0x5ffaf2[_0x3a8c28(0x222)]&&_0x110e30(_0x5ffaf2[_0x3a8c28(0x222)]);if(_0x5ffaf2[_0x3a8c28(0x280)])for(const _0x4fcbe4 of _0x5ffaf2[_0x3a8c28(0x280)]){_0x110e30(_0x4fcbe4['stages']);}}function replaceJumpTargetsInJourney(_0x3acffc,_0x463eb8){const _0x356c26=a74_0x5956,_0x5353f2=_0x9bd10d=>{const _0x20bb22=a74_0x5956;for(const _0x4e29dc of _0x9bd10d){if(_0x4e29dc[_0x20bb22(0x20f)])for(const _0x2d9e35 of _0x4e29dc['steps']){if(_0x2d9e35[_0x20bb22(0x1e3)]==='jump'){const _0xbff427=_0x2d9e35,_0x2d98c8=_0xbff427[_0x20bb22(0x23c)][_0x20bb22(0x243)],_0x50072e=_0x2d98c8['journey']+':'+_0x2d98c8[_0x20bb22(0x22d)],_0x1b0df6=_0x463eb8[_0x20bb22(0x1fd)](_0x50072e);_0x1b0df6&&(_0x2d98c8['journey']=_0x1b0df6[_0x20bb22(0x1e1)],_0x2d98c8[_0x20bb22(0x22d)]=_0x1b0df6[_0x20bb22(0x204)]);}}}};if(_0x3acffc[_0x356c26(0x1df)])for(const _0x17795f of _0x3acffc[_0x356c26(0x1df)]){_0x5353f2(_0x17795f[_0x356c26(0x222)]);}_0x3acffc[_0x356c26(0x222)]&&_0x5353f2(_0x3acffc['stages']);if(_0x3acffc[_0x356c26(0x280)])for(const _0x3cd203 of _0x3acffc[_0x356c26(0x280)]){_0x5353f2(_0x3cd203[_0x356c26(0x222)]);}}function a74_0x5956(_0x465918,_0x19bb86){_0x465918=_0x465918-0x1cc;const _0x36a58e=a74_0x36a5();let _0x59562e=_0x36a58e[_0x465918];return _0x59562e;}function generateReadableStepName(_0x40f302,_0x2fc69d){const _0x2fc3f8=a74_0x5956;if(_0x40f302[_0x2fc3f8(0x22b)]&&_0x40f302[_0x2fc3f8(0x22b)]!==_0x40f302[_0x2fc3f8(0x1e3)]){const _0x31d634=_0x40f302[_0x2fc3f8(0x22b)][_0x2fc3f8(0x289)]()['replace'](/\s+/g,'_')[_0x2fc3f8(0x283)](/[^a-z0-9_]/g,'');if(_0x31d634)return _0x31d634;}const _0x1a9a80=_0x40f302['type'][_0x2fc3f8(0x289)]()[_0x2fc3f8(0x283)](/step$/i,'');return _0x1a9a80+'_'+(_0x2fc69d+0x1);}function getStepNextRefs(_0x46ecdd){const _0x2708a6=a74_0x5956,_0x194fae=[];if(_0x46ecdd[_0x2708a6(0x266)])_0x194fae[_0x2708a6(0x291)](_0x46ecdd[_0x2708a6(0x266)]);if(_0x46ecdd[_0x2708a6(0x1ea)])for(const _0x35eccd of _0x46ecdd['branches']){if(_0x35eccd[_0x2708a6(0x266)])_0x194fae['push'](_0x35eccd[_0x2708a6(0x266)]);}if(_0x46ecdd[_0x2708a6(0x21c)])for(const _0x36a705 of _0x46ecdd[_0x2708a6(0x21c)]){if(_0x36a705[_0x2708a6(0x266)])_0x194fae['push'](_0x36a705[_0x2708a6(0x266)]);}if(_0x46ecdd[_0x2708a6(0x286)])for(const _0x4ba813 of _0x46ecdd[_0x2708a6(0x286)]){if(_0x4ba813['next'])_0x194fae[_0x2708a6(0x291)](_0x4ba813[_0x2708a6(0x266)]);}return _0x194fae;}function orderStepsFromRoot(_0xbdcccd,_0x5aab3c){const _0xb782b9=a74_0x5956,_0x51dc7c=Object[_0xb782b9(0x21b)](_0xbdcccd);if(_0x51dc7c[_0xb782b9(0x1f7)]===0x0)return[];const _0x2ca066=new Set(_0x51dc7c[_0xb782b9(0x24b)](([_0x2fb89a])=>_0x2fb89a)),_0x1f9608=new Set();for(const [,_0x372d1a]of _0x51dc7c){for(const _0x4b50bb of getStepNextRefs(_0x372d1a)){if(_0x2ca066['has'](_0x4b50bb))_0x1f9608[_0xb782b9(0x245)](_0x4b50bb);}}let _0x3efd14=_0x5aab3c&&_0x2ca066[_0xb782b9(0x21f)](_0x5aab3c)?_0x5aab3c:undefined;if(!_0x3efd14){const _0x1c9efd=_0x51dc7c[_0xb782b9(0x1d3)](([_0x21a05a])=>!_0x1f9608['has'](_0x21a05a));_0x1c9efd['length']>0x0?_0x3efd14=_0x1c9efd[0x0][0x0]:_0x3efd14=_0x51dc7c[0x0][0x0];}const _0x108cb2=[],_0x45a816=new Set(),_0x52bb45=[_0x3efd14];while(_0x52bb45[_0xb782b9(0x1f7)]>0x0){const _0x3b2116=_0x52bb45[_0xb782b9(0x277)]();if(_0x45a816[_0xb782b9(0x21f)](_0x3b2116))continue;_0x45a816[_0xb782b9(0x245)](_0x3b2116);const _0x2021e4=_0xbdcccd[_0x3b2116];if(!_0x2021e4)continue;_0x108cb2[_0xb782b9(0x291)]({'uuid':_0x3b2116,'step':_0x2021e4});for(const _0x4c73ef of getStepNextRefs(_0x2021e4)){_0x2ca066['has'](_0x4c73ef)&&!_0x45a816[_0xb782b9(0x21f)](_0x4c73ef)&&_0x52bb45[_0xb782b9(0x291)](_0x4c73ef);}}for(const [_0x3af7af,_0x5a552c]of _0x51dc7c){!_0x45a816['has'](_0x3af7af)&&_0x108cb2['push']({'uuid':_0x3af7af,'step':_0x5a552c});}return _0x108cb2;}function resolveStepReferences(_0x43436c,_0x5b87d7,_0x5e8bf8,_0x1e0629){const _0x4240e6=a74_0x5956;if(_0x43436c[_0x4240e6(0x1e3)]!==_0x4240e6(0x26a)){_0x43436c[_0x4240e6(0x266)]&&_0x1e0629['has'](_0x43436c[_0x4240e6(0x266)])&&(_0x43436c[_0x4240e6(0x266)]=_0x1e0629[_0x4240e6(0x1fd)](_0x43436c[_0x4240e6(0x266)]));const _0x353e63=_0x5b87d7+0x1;if(_0x353e63<_0x5e8bf8[_0x4240e6(0x1f7)]){const _0xca94d=_0x1e0629[_0x4240e6(0x1fd)](_0x5e8bf8[_0x353e63][_0x4240e6(0x282)]);_0x43436c[_0x4240e6(0x266)]===_0xca94d&&delete _0x43436c[_0x4240e6(0x266)];}}if(_0x43436c['type']===_0x4240e6(0x28f))for(const _0x283590 of _0x43436c[_0x4240e6(0x23c)]['branches']){_0x283590[_0x4240e6(0x266)]&&_0x1e0629[_0x4240e6(0x21f)](_0x283590['next'])&&(_0x283590['next']=_0x1e0629[_0x4240e6(0x1fd)](_0x283590[_0x4240e6(0x266)]));}if(_0x43436c[_0x4240e6(0x1e3)]===_0x4240e6(0x28e))for(const _0xef1569 of _0x43436c[_0x4240e6(0x23c)][_0x4240e6(0x21c)]){_0xef1569[_0x4240e6(0x266)]&&_0x1e0629['has'](_0xef1569['next'])&&(_0xef1569[_0x4240e6(0x266)]=_0x1e0629[_0x4240e6(0x1fd)](_0xef1569['next']));}if(_0x43436c[_0x4240e6(0x1e3)]===_0x4240e6(0x269)&&_0x43436c['with']['condition']){const _0x4b5082=_0x43436c[_0x4240e6(0x23c)][_0x4240e6(0x27f)];_0x4b5082[_0x4240e6(0x266)]&&_0x1e0629[_0x4240e6(0x21f)](_0x4b5082[_0x4240e6(0x266)])&&(_0x4b5082[_0x4240e6(0x266)]=_0x1e0629[_0x4240e6(0x1fd)](_0x4b5082[_0x4240e6(0x266)])),_0x4b5082[_0x4240e6(0x23d)]?.[_0x4240e6(0x266)]&&_0x1e0629[_0x4240e6(0x21f)](_0x4b5082['timeout'][_0x4240e6(0x266)])&&(_0x4b5082[_0x4240e6(0x23d)][_0x4240e6(0x266)]=_0x1e0629[_0x4240e6(0x1fd)](_0x4b5082['timeout'][_0x4240e6(0x266)]));}}function convertApiStageToYaml(_0x33d9c9){const _0xab2775=a74_0x5956,_0x5f1fee={'name':_0x33d9c9[_0xab2775(0x22b)]};_0x33d9c9['id']&&(_0x5f1fee['id']=_0x33d9c9['id']);_0x33d9c9[_0xab2775(0x227)]&&(_0x5f1fee['description']=_0x33d9c9['description']);_0x33d9c9['entryCriteria']&&(_0x5f1fee[_0xab2775(0x1fe)]=convertApiCriteriaToYaml(_0x33d9c9[_0xab2775(0x212)]));_0x33d9c9['exitCriterias']&&_0x33d9c9[_0xab2775(0x226)][_0xab2775(0x1f7)]>0x0&&(_0x5f1fee[_0xab2775(0x1ee)]=_0x33d9c9[_0xab2775(0x226)]['map'](convertApiCriteriaToYaml));_0x33d9c9[_0xab2775(0x1e5)]&&(_0x5f1fee[_0xab2775(0x1e5)]=convertApiCriteriaToYaml(_0x33d9c9[_0xab2775(0x1e5)]));if(_0x33d9c9[_0xab2775(0x20f)]&&Object['keys'](_0x33d9c9[_0xab2775(0x20f)])[_0xab2775(0x1f7)]>0x0){const _0x17200f=orderStepsFromRoot(_0x33d9c9[_0xab2775(0x20f)],_0x33d9c9[_0xab2775(0x268)]),_0x33acdd=new Map(),_0x3bd8d2=new Set();for(let _0x4c718d=0x0;_0x4c718d<_0x17200f[_0xab2775(0x1f7)];_0x4c718d++){const {uuid:_0x415e3d,step:_0x273b54}=_0x17200f[_0x4c718d];let _0x564276=generateReadableStepName(_0x273b54,_0x4c718d),_0x1ae75e=_0x564276,_0x1ca5d7=0x2;while(_0x3bd8d2[_0xab2775(0x21f)](_0x1ae75e)){_0x1ae75e=_0x564276+'_'+_0x1ca5d7,_0x1ca5d7++;}_0x3bd8d2[_0xab2775(0x245)](_0x1ae75e),_0x33acdd['set'](_0x415e3d,_0x1ae75e);}_0x5f1fee[_0xab2775(0x20f)]=_0x17200f['map'](({uuid:_0x22ba09,step:_0x9ed764},_0x20fbf1)=>{const _0x2a4e6c=convertApiStepToYaml(_0x9ed764,_0x33acdd['get'](_0x22ba09));return resolveStepReferences(_0x2a4e6c,_0x20fbf1,_0x17200f,_0x33acdd),_0x2a4e6c;});}return _0x5f1fee;}function convertApiCriteriaToYaml(_0x4cb54e){const _0xed81e9=a74_0x5956,_0x31dec1={'name':_0x4cb54e['name'],'segment':_0x4cb54e[_0xed81e9(0x258)]};return _0x4cb54e[_0xed81e9(0x227)]&&(_0x31dec1[_0xed81e9(0x227)]=_0x4cb54e[_0xed81e9(0x227)]),_0x4cb54e['target']&&(_0x31dec1[_0xed81e9(0x243)]={'journey':_0x4cb54e[_0xed81e9(0x243)][_0xed81e9(0x1d0)],'stage':_0x4cb54e['target'][_0xed81e9(0x25f)]},_0x4cb54e[_0xed81e9(0x243)][_0xed81e9(0x24d)]&&(_0x31dec1[_0xed81e9(0x243)]['bundle_id']=_0x4cb54e[_0xed81e9(0x243)][_0xed81e9(0x24d)])),_0x31dec1;}function convertApiStepToYaml(_0x1a6fd0,_0x465728){const _0x245ac7=a74_0x5956;switch(_0x1a6fd0[_0x245ac7(0x1e3)]){case'WaitStep':{const _0x2a4957={};if(_0x1a6fd0[_0x245ac7(0x28c)]===_0x245ac7(0x200)&&_0x1a6fd0[_0x245ac7(0x20a)]!==undefined)_0x2a4957[_0x245ac7(0x1fc)]=_0x1a6fd0[_0x245ac7(0x20a)],_0x2a4957[_0x245ac7(0x1cf)]=_0x1a6fd0[_0x245ac7(0x1f9)];else{if(_0x1a6fd0['waitStepType']===_0x245ac7(0x264)&&_0x1a6fd0['waitUntilDate'])_0x2a4957[_0x245ac7(0x218)]=_0x1a6fd0[_0x245ac7(0x23e)];else{if(_0x1a6fd0[_0x245ac7(0x28c)]===_0x245ac7(0x271)&&_0x1a6fd0[_0x245ac7(0x20c)])_0x2a4957[_0x245ac7(0x1de)]=_0x1a6fd0[_0x245ac7(0x20c)];else{if(_0x1a6fd0[_0x245ac7(0x28c)]===_0x245ac7(0x299)){if(_0x1a6fd0[_0x245ac7(0x286)]&&_0x1a6fd0[_0x245ac7(0x286)][_0x245ac7(0x1f7)]>0x0){const _0x33d6f6=_0x1a6fd0[_0x245ac7(0x286)][_0x245ac7(0x1f5)](_0x499538=>!_0x499538['timedOutPath']),_0x1b3201=_0x1a6fd0[_0x245ac7(0x286)]['find'](_0x25e097=>_0x25e097['timedOutPath']);_0x33d6f6?.[_0x245ac7(0x258)]&&(_0x2a4957['condition']={'segment':_0x33d6f6[_0x245ac7(0x258)],..._0x33d6f6['next']?{'next':_0x33d6f6[_0x245ac7(0x266)]}:{}},_0x1b3201&&_0x1b3201[_0x245ac7(0x206)]!==undefined&&_0x1b3201[_0x245ac7(0x1cf)]&&(_0x2a4957[_0x245ac7(0x27f)]['timeout']={'duration':_0x1b3201[_0x245ac7(0x206)],'unit':_0x1b3201[_0x245ac7(0x1cf)],..._0x1b3201['next']?{'next':_0x1b3201['next']}:{}}));}else _0x1a6fd0['conditionSegmentId']&&(_0x2a4957[_0x245ac7(0x27f)]={'segment':_0x1a6fd0[_0x245ac7(0x252)]},_0x1a6fd0[_0x245ac7(0x253)]!==undefined&&_0x1a6fd0[_0x245ac7(0x1dc)]&&(_0x2a4957['condition'][_0x245ac7(0x23d)]={'duration':_0x1a6fd0[_0x245ac7(0x253)],'unit':_0x1a6fd0[_0x245ac7(0x1dc)]}));}}}}const _0x1a6ece={'type':'wait','name':_0x465728,..._0x1a6fd0['next']?{'next':_0x1a6fd0['next']}:{},'with':_0x2a4957};return _0x1a6ece;}case'Activation':{const _0x4341ef={'type':_0x245ac7(0x275),'name':_0x465728,..._0x1a6fd0[_0x245ac7(0x266)]?{'next':_0x1a6fd0['next']}:{},'with':{'activation':_0x1a6fd0[_0x245ac7(0x279)]||''}};return _0x4341ef;}case'DecisionPoint':{const _0x5ea834={'type':_0x245ac7(0x28f),'name':_0x465728,..._0x1a6fd0[_0x245ac7(0x266)]?{'next':_0x1a6fd0[_0x245ac7(0x266)]}:{},'with':{'branches':(_0x1a6fd0[_0x245ac7(0x1ea)]||[])[_0x245ac7(0x24b)](_0x3432a7=>({'name':_0x3432a7[_0x245ac7(0x22b)],'segment':_0x3432a7[_0x245ac7(0x258)],'excluded':_0x3432a7[_0x245ac7(0x285)],..._0x3432a7[_0x245ac7(0x266)]?{'next':_0x3432a7['next']}:{}}))}};return _0x5ea834;}case _0x245ac7(0x232):case'AbTest':case _0x245ac7(0x251):{const _0x46a809=_0x1a6fd0[_0x245ac7(0x21c)]||(_0x1a6fd0['branches']||[])[_0x245ac7(0x24b)](_0x247893=>({'name':_0x247893['name'],'percentage':0x0,'next':_0x247893[_0x245ac7(0x266)]})),_0x41db39={'type':_0x245ac7(0x28e),'name':_0x465728,..._0x1a6fd0['next']?{'next':_0x1a6fd0[_0x245ac7(0x266)]}:{},'with':{'customized_split':_0x1a6fd0[_0x245ac7(0x287)],'unique_id':_0x1a6fd0[_0x245ac7(0x24f)],'variants':_0x46a809['map'](_0x56d533=>({'name':_0x56d533[_0x245ac7(0x22b)],'percentage':_0x56d533[_0x245ac7(0x292)],..._0x56d533[_0x245ac7(0x266)]?{'next':_0x56d533[_0x245ac7(0x266)]}:{}}))}};return _0x41db39;}case _0x245ac7(0x1ec):{const _0xc2edb4={'type':_0x245ac7(0x214),'name':_0x465728,..._0x1a6fd0['next']?{'next':_0x1a6fd0[_0x245ac7(0x266)]}:{}};return _0xc2edb4;}case _0x245ac7(0x1ef):{if(!_0x1a6fd0[_0x245ac7(0x243)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x245ac7(0x25d)+(_0x1a6fd0['name']||_0x465728)+_0x245ac7(0x26c));const _0x1effb7={'type':_0x245ac7(0x238),'name':_0x465728,..._0x1a6fd0[_0x245ac7(0x266)]?{'next':_0x1a6fd0[_0x245ac7(0x266)]}:{},'with':{'target':{'journey':_0x1a6fd0['target'][_0x245ac7(0x1d0)],'stage':_0x1a6fd0[_0x245ac7(0x243)][_0x245ac7(0x25f)],'bundle_id':_0x1a6fd0[_0x245ac7(0x243)]['journeyBundleId']}}};return _0x1effb7;}case _0x245ac7(0x1ff):{const _0x44390d={'type':_0x245ac7(0x26a),'name':_0x465728};return _0x44390d;}default:{const _0x2ea521={'type':_0x245ac7(0x26a),'name':_0x465728};return _0x2ea521;}}}export async function yamlToApi(_0xfdb491,_0x4491bc,_0x985348){const _0x42276a=a74_0x5956,_0x15a5a5=_0xfdb491['stages']||getActiveStages(_0xfdb491),_0x291214=_0xfdb491[_0x42276a(0x228)]||{},_0x55380e=_0xfdb491[_0x42276a(0x296)]||{},_0x48f30b={'type':'journey','attributes':{'name':_0xfdb491[_0x42276a(0x22b)],'audienceId':_0x4491bc,'journeyStages':await Promise[_0x42276a(0x1cc)](_0x15a5a5[_0x42276a(0x24b)](_0x3ea1a7=>convertYamlStageToApi(_0x3ea1a7,_0x985348,_0x291214,_0x55380e)))}};_0xfdb491['id']&&(_0x48f30b['id']=_0xfdb491['id']);_0xfdb491['description']&&(_0x48f30b[_0x42276a(0x201)][_0x42276a(0x227)]=_0xfdb491[_0x42276a(0x227)]);const _0x48bf3d=getEffectiveGoal(_0xfdb491);_0x48bf3d&&(_0x48f30b[_0x42276a(0x201)][_0x42276a(0x1f8)]=await convertYamlCriteriaToApi(_0x48bf3d,_0x985348,_0x291214));const _0x466c14=getEffectiveReentry(_0xfdb491);return _0x466c14&&(_0x48f30b['attributes'][_0x42276a(0x1f0)]=_0x466c14,_0x48f30b[_0x42276a(0x201)]['allowReentry']=_0x466c14!=='no_reentry'),_0xfdb491[_0x42276a(0x1fa)]&&(_0x48f30b[_0x42276a(0x219)]={'parentFolder':{'data':{'id':_0xfdb491[_0x42276a(0x1fa)],'type':_0x42276a(0x239)}}}),_0x48f30b;}async function convertYamlStageToApi(_0x9be4f,_0xd5ee11,_0x2fd3dc={},_0x5a7319={}){const _0x17f95b=a74_0x5956,_0x2bb83e={'name':_0x9be4f[_0x17f95b(0x22b)]};_0x9be4f['id']&&(_0x2bb83e['id']=_0x9be4f['id']);_0x9be4f[_0x17f95b(0x227)]&&(_0x2bb83e['description']=_0x9be4f[_0x17f95b(0x227)]);_0x9be4f['entry_criteria']&&(_0x2bb83e[_0x17f95b(0x212)]=await convertYamlCriteriaToApi(_0x9be4f[_0x17f95b(0x1fe)],_0xd5ee11,_0x2fd3dc));_0x9be4f[_0x17f95b(0x1ee)]&&_0x9be4f[_0x17f95b(0x1ee)]['length']>0x0&&(_0x2bb83e['exitCriterias']=await Promise['all'](_0x9be4f[_0x17f95b(0x1ee)][_0x17f95b(0x24b)](_0x2b9f56=>convertYamlCriteriaToApi(_0x2b9f56,_0xd5ee11,_0x2fd3dc))));_0x9be4f['milestone']&&(_0x2bb83e[_0x17f95b(0x1e5)]=await convertYamlCriteriaToApi(_0x9be4f[_0x17f95b(0x1e5)],_0xd5ee11,_0x2fd3dc));if(_0x9be4f[_0x17f95b(0x20f)]&&_0x9be4f[_0x17f95b(0x20f)][_0x17f95b(0x1f7)]>0x0){const _0x523403={},_0x5642bd=_0x9be4f[_0x17f95b(0x20f)][_0x17f95b(0x24b)]((_0x34736a,_0x3588b1)=>{const _0x13cb1f=_0x17f95b,_0x294e21=_0x34736a[_0x13cb1f(0x282)]||generateUUID(),_0x23ad67=_0x34736a['name']||_0x34736a[_0x13cb1f(0x1e3)]+'_'+_0x3588b1;return _0x523403[_0x23ad67]=_0x294e21,{..._0x34736a,'name':_0x23ad67};});_0x2bb83e[_0x17f95b(0x268)]=_0x523403[_0x5642bd[0x0]['name']],_0x2bb83e[_0x17f95b(0x20f)]={};for(let _0x59dac6=0x0;_0x59dac6<_0x5642bd['length'];_0x59dac6++){const _0x4825a6=_0x5642bd[_0x59dac6],_0x3aa96f=_0x523403[_0x4825a6['name']],_0x3725cc=!_0x4825a6['next']&&_0x59dac6<_0x5642bd[_0x17f95b(0x1f7)]-0x1&&_0x4825a6[_0x17f95b(0x1e3)]!=='end'?_0x5642bd[_0x59dac6+0x1]['name']:_0x4825a6[_0x17f95b(0x266)],_0xed4916=_0x3725cc!==_0x4825a6['next']?{..._0x4825a6,'next':_0x3725cc}:_0x4825a6;_0x2bb83e['steps'][_0x3aa96f]=await convertYamlStepToApi(_0xed4916,_0xd5ee11,_0x2fd3dc,_0x523403,_0x5a7319);}}else _0x9be4f[_0x17f95b(0x272)]&&(_0x2bb83e['rootStep']=_0x9be4f['root_step']);return _0x2bb83e;}async function convertYamlCriteriaToApi(_0x5c405e,_0x173aa6,_0x38bc2c={}){const _0x5922b0=a74_0x5956;let _0x1f646b=_0x5c405e['segment'];if(_0x1f646b&&!/^\d+$/[_0x5922b0(0x27d)](_0x1f646b)){const _0x32d6ff=parseSegmentRef(_0x1f646b);if(_0x32d6ff[_0x5922b0(0x1e3)]==='ref')_0x173aa6?.['resolveSegmentId']&&(_0x1f646b=await _0x173aa6['resolveSegmentId'](_0x32d6ff[_0x5922b0(0x22b)]));else{if(_0x32d6ff[_0x5922b0(0x1e3)]===_0x5922b0(0x281)&&_0x38bc2c[_0x32d6ff[_0x5922b0(0x22b)]])_0x173aa6?.[_0x5922b0(0x234)]&&(_0x1f646b=await _0x173aa6[_0x5922b0(0x234)](_0x32d6ff[_0x5922b0(0x22b)],_0x38bc2c[_0x32d6ff[_0x5922b0(0x22b)]]));else _0x173aa6?.[_0x5922b0(0x221)]&&(_0x1f646b=await _0x173aa6[_0x5922b0(0x221)](_0x32d6ff['name']));}}const _0x12f699={'name':_0x5c405e['name'],'segmentId':_0x1f646b};_0x5c405e[_0x5922b0(0x227)]&&(_0x12f699[_0x5922b0(0x227)]=_0x5c405e['description']);if(_0x5c405e[_0x5922b0(0x243)]){const _0x420b59=_0x5c405e[_0x5922b0(0x243)]['journey'],_0x2b635e=_0x5c405e['target'][_0x5922b0(0x22d)];let _0x13a9f1=_0x5c405e['target'][_0x5922b0(0x1e0)];_0x173aa6?.['resolveJourneyId']&&!/^\d+$/[_0x5922b0(0x27d)](_0x13a9f1)&&(_0x13a9f1=await _0x173aa6[_0x5922b0(0x273)](_0x13a9f1));let _0xb7fab=_0x5c405e[_0x5922b0(0x243)]['stage'];_0x173aa6?.['resolveStageId']&&!/^\d+$/['test'](_0xb7fab)&&(_0xb7fab=await _0x173aa6[_0x5922b0(0x22e)](_0x13a9f1,_0xb7fab));const _0x45dde2=!/^\d+$/['test'](_0x420b59)&&!isLocalJourneyRef(_0x420b59)?formatApiJourneyName(_0x420b59,_0x2b635e):undefined;_0x12f699['target']={'journeyId':_0x13a9f1,'journeyStageId':_0xb7fab,'journeyName':_0x45dde2,'confirmed':!![]},_0x5c405e['target'][_0x5922b0(0x274)]&&(_0x12f699['target']['journeyBundleId']=_0x5c405e['target'][_0x5922b0(0x274)]);}return _0x12f699;}async function convertYamlStepToApi(_0x2e2cb3,_0x2bb868,_0x1ef67e={},_0x27affe={},_0x3d112c={}){const _0x2d2865=a74_0x5956,_0xd56e3c=async _0x43bdc4=>{const _0x72ea6b=a74_0x5956;if(/^\d+$/[_0x72ea6b(0x27d)](_0x43bdc4))return _0x43bdc4;const _0x48f2c7=parseSegmentRef(_0x43bdc4);if(_0x48f2c7[_0x72ea6b(0x1e3)]===_0x72ea6b(0x1f1)){if(_0x2bb868?.[_0x72ea6b(0x221)])return await _0x2bb868[_0x72ea6b(0x221)](_0x48f2c7[_0x72ea6b(0x22b)]);}else{if(_0x48f2c7[_0x72ea6b(0x1e3)]==='embedded'&&_0x1ef67e[_0x48f2c7[_0x72ea6b(0x22b)]]){if(_0x2bb868?.[_0x72ea6b(0x234)])return await _0x2bb868[_0x72ea6b(0x234)](_0x48f2c7['name'],_0x1ef67e[_0x48f2c7[_0x72ea6b(0x22b)]]);}else{if(_0x2bb868?.['resolveSegmentId'])return await _0x2bb868[_0x72ea6b(0x221)](_0x48f2c7['name']);}}return _0x43bdc4;},_0x51849d=async _0x8aafe5=>{const _0x25db93=a74_0x5956;if(/^\d+$/['test'](_0x8aafe5))return _0x8aafe5;const _0x5e13af=parseSegmentRef(_0x8aafe5);if(_0x5e13af[_0x25db93(0x1e3)]==='ref'){if(_0x2bb868?.['resolveActivationId'])return await _0x2bb868['resolveActivationId'](_0x5e13af[_0x25db93(0x22b)]);return _0x5e13af[_0x25db93(0x22b)];}else{if(_0x5e13af[_0x25db93(0x1e3)]===_0x25db93(0x281)&&_0x3d112c[_0x5e13af[_0x25db93(0x22b)]]){if(_0x2bb868?.[_0x25db93(0x1e4)])return await _0x2bb868[_0x25db93(0x1e4)](_0x5e13af['name'],_0x3d112c[_0x5e13af['name']]);if(_0x2bb868?.[_0x25db93(0x294)])return await _0x2bb868[_0x25db93(0x294)](_0x5e13af[_0x25db93(0x22b)]);}else{if(_0x2bb868?.['resolveActivationId'])return await _0x2bb868[_0x25db93(0x294)](_0x5e13af[_0x25db93(0x22b)]);}}return _0x8aafe5;},_0x45665d=_0xc370f9=>{if(!_0xc370f9)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0xc370f9))return _0xc370f9;return _0x27affe[_0xc370f9]||_0xc370f9;};switch(_0x2e2cb3[_0x2d2865(0x1e3)]){case _0x2d2865(0x269):{const _0x5079b4=_0x2e2cb3,_0x2e3353=_0x5079b4['with'],_0x481c4d={'type':'WaitStep','name':_0x5079b4[_0x2d2865(0x22b)],'next':_0x45665d(_0x5079b4[_0x2d2865(0x266)])};if(_0x2e3353[_0x2d2865(0x1fc)]!==undefined&&_0x2e3353['unit'])_0x481c4d[_0x2d2865(0x28c)]=_0x2d2865(0x200),_0x481c4d['waitStep']=_0x2e3353[_0x2d2865(0x1fc)],_0x481c4d[_0x2d2865(0x1f9)]=normalizeWaitUnit(_0x2e3353[_0x2d2865(0x1cf)]);else{if(_0x2e3353[_0x2d2865(0x218)])_0x481c4d[_0x2d2865(0x28c)]=_0x2d2865(0x264),_0x481c4d[_0x2d2865(0x23e)]=_0x2e3353[_0x2d2865(0x218)];else{if(_0x2e3353[_0x2d2865(0x1de)])_0x481c4d[_0x2d2865(0x28c)]=_0x2d2865(0x271),_0x481c4d[_0x2d2865(0x20c)]=_0x2e3353[_0x2d2865(0x1de)];else{if(_0x2e3353[_0x2d2865(0x27f)]){_0x481c4d['waitStepType']=_0x2d2865(0x299);const _0xde6316=await _0xd56e3c(_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x295)]),_0x111222=_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x23d)]?.[_0x2d2865(0x266)]!==undefined;if(_0x111222){const _0x21e526=[];_0x21e526['push']({'id':generateUUID(),'segmentId':_0xde6316,'timedOutPath':![],'next':_0x45665d(_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x266)]??_0x5079b4['next'])}),_0x2e3353[_0x2d2865(0x27f)]['timeout']&&_0x21e526['push']({'id':generateUUID(),'timedOutPath':!![],'moveAfter':_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x23d)][_0x2d2865(0x1fc)],'unit':normalizeWaitUnit(_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x23d)][_0x2d2865(0x1cf)]),'next':_0x45665d(_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x23d)][_0x2d2865(0x266)])}),_0x481c4d['conditions']=_0x21e526;}else _0x481c4d['conditionSegmentId']=_0xde6316,_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x23d)]&&(_0x481c4d[_0x2d2865(0x253)]=_0x2e3353[_0x2d2865(0x27f)]['timeout'][_0x2d2865(0x1fc)],_0x2e3353['condition'][_0x2d2865(0x23d)][_0x2d2865(0x1cf)]&&(_0x481c4d[_0x2d2865(0x1dc)]=normalizeWaitUnit(_0x2e3353[_0x2d2865(0x27f)][_0x2d2865(0x23d)][_0x2d2865(0x1cf)])));}}}}return _0x481c4d;}case'activation':{const _0x2f632a=_0x2e2cb3,_0x3b2793=_0x2f632a[_0x2d2865(0x23c)]['activation'],_0x2e7729=await _0x51849d(_0x3b2793);return{'type':_0x2d2865(0x278),'name':_0x2f632a['name'],'journeyActivationStepId':_0x2e7729,'next':_0x45665d(_0x2f632a[_0x2d2865(0x266)])};}case _0x2d2865(0x28f):{const _0x709d42=_0x2e2cb3,_0x162a37=_0x709d42['with'][_0x2d2865(0x1ea)];return{'type':'DecisionPoint','name':_0x709d42[_0x2d2865(0x22b)],'branches':await Promise[_0x2d2865(0x1cc)](_0x162a37['map'](async _0x454409=>{const _0x14523c=_0x2d2865;let _0x574d54='';if(!_0x454409[_0x14523c(0x249)]){const _0x3513cf=_0x454409[_0x14523c(0x295)]||_0x454409['segment_id']||'';_0x574d54=_0x3513cf?await _0xd56e3c(_0x3513cf):'';}return{'id':crypto[_0x14523c(0x261)](),'name':_0x454409[_0x14523c(0x22b)],'description':null,'segmentId':_0x574d54,'excludedPath':_0x454409[_0x14523c(0x249)]??![],'next':_0x45665d(_0x454409['next'])};})),'next':_0x45665d(_0x709d42[_0x2d2865(0x266)])};}case _0x2d2865(0x28e):{const _0x58fc90=_0x2e2cb3,_0x236897=_0x58fc90[_0x2d2865(0x23c)];return{'type':_0x2d2865(0x232),'name':_0x58fc90[_0x2d2865(0x22b)],'customizedSplit':_0x236897[_0x2d2865(0x25c)],'uniqueId':_0x236897[_0x2d2865(0x210)],'variants':_0x236897[_0x2d2865(0x21c)][_0x2d2865(0x24b)](_0x5c9a49=>({'id':_0x5c9a49['id']||generateUUID(),'name':_0x5c9a49[_0x2d2865(0x22b)],'percentage':_0x5c9a49[_0x2d2865(0x292)],'next':_0x45665d(_0x5c9a49[_0x2d2865(0x266)])})),'next':_0x45665d(_0x58fc90[_0x2d2865(0x266)])};}case _0x2d2865(0x214):return{'type':'Merge','name':_0x2e2cb3['name'],'next':_0x45665d(_0x2e2cb3['next'])};case'jump':{const _0x55d0e4=_0x2e2cb3,_0x352ab1=_0x55d0e4[_0x2d2865(0x23c)]['target'],_0x971570=_0x352ab1[_0x2d2865(0x1e0)],_0x3157e=_0x352ab1['stage'];let _0x549139=_0x352ab1[_0x2d2865(0x1e0)];_0x2bb868?.[_0x2d2865(0x273)]&&!/^\d+$/[_0x2d2865(0x27d)](_0x549139)&&(_0x549139=await _0x2bb868[_0x2d2865(0x273)](_0x549139));let _0x425492=_0x352ab1[_0x2d2865(0x22d)];_0x2bb868?.['resolveStageId']&&!/^\d+$/['test'](_0x425492)&&(_0x425492=await _0x2bb868[_0x2d2865(0x22e)](_0x549139,_0x425492));const _0x400f38=!/^\d+$/['test'](_0x971570)&&!isLocalJourneyRef(_0x971570)?formatApiJourneyName(_0x971570,_0x3157e):undefined;return{'type':_0x2d2865(0x1ef),'name':_0x55d0e4[_0x2d2865(0x22b)],'target':{'journeyId':_0x549139,'journeyStageId':_0x425492,'journeyBundleId':_0x352ab1[_0x2d2865(0x274)],'journeyName':_0x400f38,'confirmed':!![]},'next':_0x45665d(_0x55d0e4[_0x2d2865(0x266)])};}case'end':return{'type':_0x2d2865(0x1ff),'name':_0x2e2cb3['name']};default:{const _0x2f6e0a=_0x2e2cb3;return{'type':_0x2d2865(0x1ff),'name':_0x2f6e0a[_0x2d2865(0x22b)]};}}}export function toYamlString(_0x1fdccb){const _0x108c6a=a74_0x5956,_0x8f4ccd=stripInternalFields(_0x1fdccb),_0x4503f6=a74_0x2e4d12[_0x108c6a(0x1da)](_0x8f4ccd,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x108c6a(0x23f)}),_0x518325=[_0x108c6a(0x1e2),'activations:',_0x108c6a(0x297),_0x108c6a(0x28a),'journeys:',_0x108c6a(0x25b),_0x108c6a(0x254)];let _0x32348f=_0x4503f6;for(const _0x41c843 of _0x518325){_0x32348f=_0x32348f[_0x108c6a(0x283)](new RegExp('^('+_0x41c843+')','m'),(_0x2e9dbe,_0x280118,_0x2d857d)=>{if(_0x2d857d===0x0||_0x32348f[_0x2d857d-0x1]==='\x0a'&&_0x32348f[_0x2d857d-0x2]==='\x0a')return _0x280118;return'\x0a'+_0x280118;});}return _0x32348f;}function stripInternalFields(_0x22ab6e){const _0x736a24=a74_0x5956,{id:_0x40f9e,folder_id:_0x3b6c84,bundle_id:_0x5ac395,bundle_name:_0x9275d0,version:_0x3a6701,version_number:_0x176037,allow_reentry:_0x30c233,..._0x11216e}=_0x22ab6e;return _0x11216e[_0x736a24(0x1df)]&&(_0x11216e['journeys']=_0x11216e[_0x736a24(0x1df)][_0x736a24(0x24b)](_0x298a06=>{const _0x7ebfa3=_0x736a24,{id:_0x35a879,version_number:_0x6e067d,..._0x1c9cdd}=_0x298a06;return{..._0x1c9cdd,'stages':_0x1c9cdd[_0x7ebfa3(0x222)][_0x7ebfa3(0x24b)](stripStageInternalFields),..._0x298a06[_0x7ebfa3(0x1f6)]===!![]?{'latest':!![]}:{},..._0x11216e[_0x7ebfa3(0x1df)][_0x7ebfa3(0x1f7)]===0x1&&_0x1c9cdd[_0x7ebfa3(0x263)]==='v1'?{'version':undefined}:{}};})),_0x11216e[_0x736a24(0x222)]&&(_0x11216e[_0x736a24(0x222)]=_0x11216e[_0x736a24(0x222)][_0x736a24(0x24b)](stripStageInternalFields)),_0x11216e[_0x736a24(0x280)]&&(_0x11216e[_0x736a24(0x280)]=_0x11216e[_0x736a24(0x280)][_0x736a24(0x24b)](_0x5b2bb5=>{const {id:_0x48a6e0,version_number:_0x20ea10,..._0x5a3637}=_0x5b2bb5;return{..._0x5a3637,'stages':_0x5a3637['stages']['map'](stripStageInternalFields),..._0x5b2bb5['latest']===!![]?{'latest':!![]}:{}};})),_0x11216e;}function stripStageInternalFields(_0x3078c2){const {id:_0x5bb74f,..._0x3e4dc9}=_0x3078c2;return _0x3e4dc9;}export function parseYamlString(_0x5ddafd){const _0x742fa4=a74_0x5956,_0x2ee1b2=a74_0x2e4d12[_0x742fa4(0x255)](_0x5ddafd);if(_0x2ee1b2[_0x742fa4(0x1e3)]!==_0x742fa4(0x1e0))throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x1f3));if(!_0x2ee1b2[_0x742fa4(0x22b)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x742fa4(0x236));const _0x43baa4=_0x2ee1b2['journeys']&&Array['isArray'](_0x2ee1b2[_0x742fa4(0x1df)])&&_0x2ee1b2['journeys'][_0x742fa4(0x1f7)]>0x0,_0x45483e=_0x2ee1b2[_0x742fa4(0x222)]&&Array[_0x742fa4(0x288)](_0x2ee1b2[_0x742fa4(0x222)])&&_0x2ee1b2[_0x742fa4(0x222)]['length']>0x0,_0x13b22b=_0x2ee1b2[_0x742fa4(0x280)]&&Array[_0x742fa4(0x288)](_0x2ee1b2[_0x742fa4(0x280)])&&_0x2ee1b2[_0x742fa4(0x280)][_0x742fa4(0x1f7)]>0x0,_0x40d995=[_0x43baa4,_0x45483e,_0x13b22b][_0x742fa4(0x1d3)](Boolean)[_0x742fa4(0x1f7)];if(_0x40d995>0x1)throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x1d1));if(_0x40d995===0x0)throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x270));if(_0x43baa4){for(let _0x150777=0x0;_0x150777<_0x2ee1b2[_0x742fa4(0x1df)][_0x742fa4(0x1f7)];_0x150777++){const _0x478869=_0x2ee1b2[_0x742fa4(0x1df)][_0x150777];if(!_0x478869[_0x742fa4(0x222)]||!Array['isArray'](_0x478869[_0x742fa4(0x222)])||_0x478869[_0x742fa4(0x222)][_0x742fa4(0x1f7)]===0x0)throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x242)+_0x150777+_0x742fa4(0x229));if(_0x478869[_0x742fa4(0x26b)]&&![_0x742fa4(0x262),_0x742fa4(0x213)][_0x742fa4(0x290)](_0x478869[_0x742fa4(0x26b)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x742fa4(0x242)+_0x150777+_0x742fa4(0x233)+_0x478869[_0x742fa4(0x26b)]+_0x742fa4(0x216));validateStages(_0x478869[_0x742fa4(0x222)],_0x742fa4(0x257)+_0x150777+_0x742fa4(0x235));}const _0x342677=_0x2ee1b2[_0x742fa4(0x1df)][_0x742fa4(0x1d3)](_0x567fca=>_0x567fca[_0x742fa4(0x1f6)]===!![])[_0x742fa4(0x1f7)];if(_0x342677>0x1)throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x28d));}_0x45483e&&validateStages(_0x2ee1b2['stages'],'stages');if(_0x13b22b){for(let _0x650eef=0x0;_0x650eef<_0x2ee1b2[_0x742fa4(0x280)]['length'];_0x650eef++){const _0x460063=_0x2ee1b2[_0x742fa4(0x280)][_0x650eef];if(!_0x460063[_0x742fa4(0x22b)])throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x21e)+_0x650eef+_0x742fa4(0x220));if(!_0x460063['state']||![_0x742fa4(0x262),_0x742fa4(0x213)][_0x742fa4(0x290)](_0x460063[_0x742fa4(0x26b)]))throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x21e)+_0x650eef+_0x742fa4(0x233)+_0x460063[_0x742fa4(0x26b)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');if(!_0x460063[_0x742fa4(0x222)]||!Array[_0x742fa4(0x288)](_0x460063[_0x742fa4(0x222)])||_0x460063['stages']['length']===0x0)throw new SDKError(ErrorCode[_0x742fa4(0x293)],'Journey\x20YAML\x20versions['+_0x650eef+_0x742fa4(0x229));validateStages(_0x460063[_0x742fa4(0x222)],_0x742fa4(0x1ce)+_0x650eef+_0x742fa4(0x235));}const _0x563ce3=_0x2ee1b2[_0x742fa4(0x280)][_0x742fa4(0x1d3)](_0x46fc87=>_0x46fc87[_0x742fa4(0x1f6)]===!![])[_0x742fa4(0x1f7)];if(_0x563ce3>0x1)throw new SDKError(ErrorCode[_0x742fa4(0x293)],_0x742fa4(0x1d6));}return _0x2ee1b2;}function validateStages(_0x46b124,_0x520745){const _0x121f27=a74_0x5956;if(_0x46b124[_0x121f27(0x1f7)]>0x8)throw new SDKError(ErrorCode[_0x121f27(0x293)],_0x121f27(0x27b)+_0x520745+_0x121f27(0x260));}export function isJourneyYaml(_0x1841c3){const _0x565547=a74_0x5956;return typeof _0x1841c3===_0x565547(0x205)&&_0x1841c3!==null&&_0x565547(0x1e3)in _0x1841c3&&_0x1841c3['type']==='journey';}export function generateTemplate(_0x32d366,_0x441360){const _0x450945=a74_0x5956,_0x285c1c={'type':_0x450945(0x1e0),'name':_0x32d366,'description':_0x450945(0x26f),'reentry':'no_reentry','goal':{'name':_0x450945(0x24a),'segment':_0x450945(0x20e)},'stages':[{'name':_0x450945(0x1dd),'description':_0x450945(0x28b),'entry_criteria':{'name':_0x450945(0x1d2),'segment':_0x441360},'steps':[{'type':'wait','name':_0x450945(0x1f4),'with':{'duration':0x1,'unit':_0x450945(0x265)}},{'type':_0x450945(0x275),'name':'Send\x20Notification','with':{'activation':'your-activation-name'}},{'type':_0x450945(0x26a),'name':'Stage\x20Complete'}]}]};return toYamlString(_0x285c1c);}function generateUUID(){const _0x9d789a=a74_0x5956;return crypto[_0x9d789a(0x261)]();}export const SEGMENT_REF_PREFIX=a74_0x232ce5(0x1d8);export function parseSegmentRef(_0x9673fe){const _0x218677=a74_0x232ce5;if(_0x9673fe[_0x218677(0x1ed)](SEGMENT_REF_PREFIX))return{'type':_0x218677(0x1f1),'name':_0x9673fe['slice'](SEGMENT_REF_PREFIX[_0x218677(0x1f7)])};if(/^\d+$/[_0x218677(0x27d)](_0x9673fe))return{'type':'id','name':_0x9673fe};return{'type':_0x218677(0x281),'name':_0x9673fe};}export function makeSegmentRef(_0x290bff){return''+SEGMENT_REF_PREFIX+_0x290bff;}export function isExternalSegmentRef(_0x15d16f){return _0x15d16f['startsWith'](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x299683){const _0x4f2df4=a74_0x232ce5;return!!(_0x299683['journeys']&&_0x299683['journeys'][_0x4f2df4(0x1f7)]>0x0);}export function isMultiVersionMode(_0x5a7491){const _0xf06a7=a74_0x232ce5;return!!(_0x5a7491[_0xf06a7(0x280)]&&_0x5a7491[_0xf06a7(0x280)]['length']>0x0);}export function isSingleVersionMode(_0x44d074){const _0x156bdc=a74_0x232ce5;return!!(_0x44d074[_0x156bdc(0x222)]&&_0x44d074['stages']['length']>0x0);}export function hasMultipleVersions(_0x2b885c){const _0x1159a9=a74_0x232ce5;if(isJourneysArrayMode(_0x2b885c))return(_0x2b885c[_0x1159a9(0x1df)]?.[_0x1159a9(0x1f7)]||0x0)>0x1;if(isMultiVersionMode(_0x2b885c))return(_0x2b885c[_0x1159a9(0x280)]?.[_0x1159a9(0x1f7)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x16a37f){const _0x15fab9=a74_0x232ce5;if(isJourneysArrayMode(_0x16a37f))return _0x16a37f;if(isSingleVersionMode(_0x16a37f)){const {stages:_0x1c371f,id:_0x541dad,version:_0x15f950,version_number:_0x4a2aec,..._0xffc897}=_0x16a37f;return{..._0xffc897,'journeys':[{'version':_0x15f950||'v1','stages':_0x1c371f||[],'id':_0x541dad,'version_number':_0x4a2aec}]};}if(isMultiVersionMode(_0x16a37f)){const {versions:_0x83ebec,..._0x383447}=_0x16a37f;return{..._0x383447,'journeys':(_0x83ebec||[])[_0x15fab9(0x24b)](_0x5598f7=>({'version':_0x5598f7[_0x15fab9(0x22b)],'state':_0x5598f7[_0x15fab9(0x26b)],'latest':_0x5598f7[_0x15fab9(0x1f6)],'stages':_0x5598f7['stages'],'id':_0x5598f7['id'],'version_number':_0x5598f7['version_number']}))};}return _0x16a37f;}export function normalizeJourneyYaml(_0x4ce575,_0x2473f1){const _0xe6a7ac=a74_0x232ce5,_0x112bc4=normalizeToJourneysFormat(_0x4ce575),_0x4fe688=_0x2473f1?.[_0xe6a7ac(0x228)]?Object[_0xe6a7ac(0x27c)](_0x2473f1[_0xe6a7ac(0x228)]):undefined,_0x49bd06=_0x2473f1?.['activations']?Object[_0xe6a7ac(0x27c)](_0x2473f1['activations']):undefined;return{'type':'journey','name':_0x112bc4[_0xe6a7ac(0x22b)],..._0x112bc4[_0xe6a7ac(0x227)]!==undefined&&{'description':_0x112bc4[_0xe6a7ac(0x227)]},..._0x112bc4[_0xe6a7ac(0x1f8)]&&{'goal':normalizeJourneyCriteria(_0x112bc4[_0xe6a7ac(0x1f8)])},..._0x112bc4['reentry']!==undefined&&{'reentry':_0x112bc4[_0xe6a7ac(0x267)]},..._0x112bc4[_0xe6a7ac(0x228)]&&{'segments':normalizeEmbeddedSegments(_0x112bc4[_0xe6a7ac(0x228)],_0x4fe688)},..._0x112bc4[_0xe6a7ac(0x296)]&&{'activations':normalizeEmbeddedActivations(_0x112bc4['activations'],_0x49bd06)},..._0x112bc4[_0xe6a7ac(0x1df)]&&{'journeys':_0x112bc4['journeys'][_0xe6a7ac(0x24b)](_0x43801c=>normalizeJourneyEntry(_0x43801c,_0x112bc4[_0xe6a7ac(0x1df)][_0xe6a7ac(0x1f7)]===0x1))}};}function normalizeJourneyEntry(_0x51df9f,_0xc5246b){const _0x28591f=a74_0x232ce5;return{...!_0xc5246b&&_0x51df9f[_0x28591f(0x263)]!==undefined&&{'version':_0x51df9f[_0x28591f(0x263)]},..._0x51df9f[_0x28591f(0x26b)]!==undefined&&{'state':_0x51df9f[_0x28591f(0x26b)]},...!_0xc5246b&&_0x51df9f[_0x28591f(0x1f6)]!==undefined&&{'latest':_0x51df9f[_0x28591f(0x1f6)]},..._0x51df9f[_0x28591f(0x1f8)]&&{'goal':normalizeJourneyCriteria(_0x51df9f[_0x28591f(0x1f8)])},..._0x51df9f[_0x28591f(0x267)]!==undefined&&{'reentry':_0x51df9f[_0x28591f(0x267)]},'stages':_0x51df9f[_0x28591f(0x222)][_0x28591f(0x24b)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x11a0e9){const _0x353201=a74_0x232ce5;return{'name':_0x11a0e9['name'],..._0x11a0e9['description']!==undefined&&{'description':_0x11a0e9['description']},..._0x11a0e9[_0x353201(0x1fe)]&&{'entry_criteria':normalizeJourneyCriteria(_0x11a0e9[_0x353201(0x1fe)])},..._0x11a0e9[_0x353201(0x1ee)]&&{'exit_criteria':_0x11a0e9[_0x353201(0x1ee)][_0x353201(0x24b)](normalizeJourneyCriteria)},..._0x11a0e9[_0x353201(0x1e5)]&&{'milestone':normalizeJourneyCriteria(_0x11a0e9[_0x353201(0x1e5)])},..._0x11a0e9[_0x353201(0x20f)]&&{'steps':normalizeStepsWithImplicitNext(_0x11a0e9[_0x353201(0x20f)])}};}function normalizeStepsWithImplicitNext(_0x5d6020){const _0x54afc8=a74_0x232ce5;return _0x5d6020[_0x54afc8(0x24b)]((_0x4cfef4,_0x1d888a)=>{const _0x55feae=_0x54afc8,_0x45c333=_0x1d888a<_0x5d6020[_0x55feae(0x1f7)]-0x1?_0x5d6020[_0x1d888a+0x1][_0x55feae(0x22b)]:undefined;return normalizeJourneyStep(_0x4cfef4,_0x45c333);});}function normalizeJourneyCriteria(_0x5f50f5){const _0x4a6d05=a74_0x232ce5;return{'name':_0x5f50f5[_0x4a6d05(0x22b)],..._0x5f50f5[_0x4a6d05(0x227)]!==undefined&&{'description':_0x5f50f5[_0x4a6d05(0x227)]},'segment':_0x5f50f5[_0x4a6d05(0x295)],..._0x5f50f5['target']&&{'target':normalizeJumpTarget(_0x5f50f5['target'])}};}function normalizeJourneyStep(_0x51b679,_0x666486){const _0x16fb09=a74_0x232ce5,_0x1103bf=_0x51b679[_0x16fb09(0x266)]!==undefined&&_0x51b679['next']!==_0x666486,_0xad5a28={'type':_0x51b679['type'],'name':_0x51b679['name'],..._0x1103bf&&{'next':_0x51b679[_0x16fb09(0x266)]}};if(_0x16fb09(0x23c)in _0x51b679&&_0x51b679['with'])return{..._0xad5a28,'with':normalizeStepParams(_0x51b679[_0x16fb09(0x1e3)],_0x51b679[_0x16fb09(0x23c)])};return _0xad5a28;}function normalizeStepParams(_0x98fda0,_0x400f19){const _0x5f08c7=a74_0x232ce5;switch(_0x98fda0){case _0x5f08c7(0x269):{const _0x36b049=_0x400f19;let _0x3bb7a7;return _0x36b049[_0x5f08c7(0x27f)]&&(_0x3bb7a7={'segment':_0x36b049[_0x5f08c7(0x27f)][_0x5f08c7(0x295)],..._0x36b049[_0x5f08c7(0x27f)][_0x5f08c7(0x266)]!==undefined&&{'next':_0x36b049['condition'][_0x5f08c7(0x266)]},..._0x36b049[_0x5f08c7(0x27f)][_0x5f08c7(0x23d)]&&{'timeout':{'duration':_0x36b049[_0x5f08c7(0x27f)][_0x5f08c7(0x23d)][_0x5f08c7(0x1fc)],'unit':_0x36b049[_0x5f08c7(0x27f)][_0x5f08c7(0x23d)]['unit'],..._0x36b049['condition'][_0x5f08c7(0x23d)][_0x5f08c7(0x266)]!==undefined&&{'next':_0x36b049[_0x5f08c7(0x27f)]['timeout']['next']}}}}),{..._0x36b049[_0x5f08c7(0x1fc)]!==undefined&&{'duration':_0x36b049[_0x5f08c7(0x1fc)]},..._0x36b049['unit']!==undefined&&{'unit':_0x36b049[_0x5f08c7(0x1cf)]},..._0x36b049[_0x5f08c7(0x218)]!==undefined&&{'wait_until':_0x36b049[_0x5f08c7(0x218)]},..._0x36b049[_0x5f08c7(0x1de)]!==undefined&&{'days_of_week':_0x36b049[_0x5f08c7(0x1de)]},..._0x3bb7a7&&{'condition':_0x3bb7a7}};}case _0x5f08c7(0x275):{const _0x5315e7=_0x400f19;return{'activation':_0x5315e7[_0x5f08c7(0x275)]};}case _0x5f08c7(0x28f):{const _0x4c626a=_0x400f19;return{'branches':_0x4c626a['branches'][_0x5f08c7(0x24b)](normalizeDecisionBranch)};}case _0x5f08c7(0x28e):{const _0x4f6380=_0x400f19;return{..._0x4f6380[_0x5f08c7(0x25c)]!==undefined&&{'customized_split':_0x4f6380[_0x5f08c7(0x25c)]},..._0x4f6380[_0x5f08c7(0x210)]!==undefined&&{'unique_id':_0x4f6380['unique_id']},'variants':_0x4f6380[_0x5f08c7(0x21c)][_0x5f08c7(0x24b)](normalizeAbTestVariant)};}case _0x5f08c7(0x238):{const _0x155ca2=_0x400f19;return{'target':normalizeJumpTarget(_0x155ca2[_0x5f08c7(0x243)])};}default:return _0x400f19;}}function normalizeDecisionBranch(_0x1c27e3){const _0x1d926f=a74_0x232ce5;return{'name':_0x1c27e3[_0x1d926f(0x22b)],..._0x1c27e3[_0x1d926f(0x295)]!==undefined&&{'segment':_0x1c27e3[_0x1d926f(0x295)]},..._0x1c27e3['excluded']!==undefined&&{'excluded':_0x1c27e3[_0x1d926f(0x249)]},..._0x1c27e3['next']!==undefined&&{'next':_0x1c27e3[_0x1d926f(0x266)]}};}function normalizeAbTestVariant(_0x1a6655){const _0x5371d9=a74_0x232ce5;return{..._0x1a6655['id']!==undefined&&{'id':_0x1a6655['id']},'name':_0x1a6655['name'],'percentage':_0x1a6655[_0x5371d9(0x292)],..._0x1a6655[_0x5371d9(0x266)]!==undefined&&{'next':_0x1a6655[_0x5371d9(0x266)]}};}function normalizeJumpTarget(_0x285c12){const _0x52b0f7=a74_0x232ce5;return{'journey':_0x285c12[_0x52b0f7(0x1e0)],'stage':_0x285c12[_0x52b0f7(0x22d)],..._0x285c12[_0x52b0f7(0x274)]!==undefined&&{'bundle_id':_0x285c12[_0x52b0f7(0x274)]}};}function normalizeEmbeddedSegments(_0x3d1544,_0x386147){const _0x116c7f=a74_0x232ce5,_0x2bf87b={},_0x3dd4ef=Object[_0x116c7f(0x27c)](_0x3d1544),_0x5c69c5=_0x386147?[..._0x386147[_0x116c7f(0x1d3)](_0x2ee187=>_0x3dd4ef[_0x116c7f(0x290)](_0x2ee187)),..._0x3dd4ef[_0x116c7f(0x1d3)](_0x45a31e=>!_0x386147[_0x116c7f(0x290)](_0x45a31e))[_0x116c7f(0x23a)]()]:_0x3dd4ef['sort']();for(const _0x5efd0c of _0x5c69c5){const _0x338924=_0x3d1544[_0x5efd0c];if(_0x338924['rule']){const _0x5a708c=_0x338924[_0x116c7f(0x256)];if(_0x5a708c['type']!==_0x116c7f(0x21a)&&_0x5a708c[_0x116c7f(0x1e3)]!=='Or'){const _0x17623e=_0x5a708c[_0x116c7f(0x1e3)]??_0x116c7f(0x246);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x116c7f(0x24e)+_0x5efd0c+_0x116c7f(0x26d)+(_0x116c7f(0x25a)+_0x17623e+'\x27.\x0a')+_0x116c7f(0x241)+_0x116c7f(0x211)+_0x116c7f(0x209)+_0x116c7f(0x207)+_0x116c7f(0x1fb)+_0x116c7f(0x217)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x5a708c[_0x116c7f(0x286)]||!Array[_0x116c7f(0x288)](_0x5a708c[_0x116c7f(0x286)]))throw new SDKError(ErrorCode[_0x116c7f(0x293)],_0x116c7f(0x24e)+_0x5efd0c+_0x116c7f(0x26d)+_0x116c7f(0x223)+'Expected\x20format:\x0a'+'\x20\x20rule:\x0a'+(_0x116c7f(0x21d)+_0x5a708c[_0x116c7f(0x1e3)]+'\x0a')+'\x20\x20\x20\x20conditions:\x0a'+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x116c7f(0x217)+_0x116c7f(0x29b));}_0x2bf87b[_0x5efd0c]={..._0x338924[_0x116c7f(0x227)]!==undefined&&{'description':_0x338924['description']},..._0x338924['rule']&&{'rule':normalizeRule(_0x338924[_0x116c7f(0x256)])}};}return _0x2bf87b;}function a74_0x36a5(){const _0x4524d5=['waitStep','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','daysOfWeek','Unknown\x20segment\x20\x22','goal-segment','steps','unique_id','\x20\x20rule:\x0a','entryCriteria','launched','merge','5511970XNsIUx','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','wait_until','relationships','And','entries','variants','\x20\x20\x20\x20type:\x20','Journey\x20YAML\x20versions[','has',']\x20missing\x20required\x20field:\x20name','resolveSegmentId','stages','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','behavior','version_number','exitCriterias','description','segments',']\x20missing\x20required\x20field:\x20stages','no_reentry','name','stageId','stage','resolveStageId','activation_template_id','schedule','resolveJumpTarget','ABTest',']\x20has\x20invalid\x20state:\x20','resolveEmbeddedSegmentId','].stages','Journey\x20YAML\x20missing\x20required\x20field:\x20name','resolveActivation','jump','folder','sort','isJourneyLocal','with','timeout','waitUntilDate','null','11BmVDTe','Expected\x20format:\x0a','Journey\x20YAML\x20journeys[','target','resolveActivationName','add','(missing)','connector_config','resolveSegmentName','excluded','Goal\x20Achieved','map','parentFolder','journeyBundleId','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','uniqueId','2eHedjt','Variant','conditionSegmentId','conditionTimeoutDuration','versions:','parse','rule','journeys[','segmentId','connection','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','stages:','customized_split','Jump\x20step\x20\x22','bundle_name','journeyStageId',':\x20maximum\x208\x20stages\x20allowed','randomUUID','draft','version','Date','day','next','reentry','rootStep','wait','end','state','\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)','\x27:\x20','all_columns','Journey\x20description','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','DaysOfTheWeek','root_step','resolveJourneyId','bundle_id','activation','1231475OXEhgC','shift','Activation','journeyActivationStepId','columns','Journey\x20YAML\x20','keys','test','set','condition','versions','embedded','uuid','replace','versionNumber','excludedPath','conditions','customizedSplit','isArray','toLowerCase','reentry:','First\x20stage\x20of\x20the\x20journey','waitStepType','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','ab_test','decision_point','includes','push','percentage','JOURNEY_SYNTAX_ERROR','resolveActivationId','segment','activations','goal:','data','Condition','589674JfDcTr','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','all','journeyBundleName','versions[','unit','journeyId','Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.','Entry\x20Criteria','filter','1576338gvgubw','allowReentry','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','3BVgbKc','ref:','definition','stringify','resolveSegment','conditionTimeoutUnit','Stage\x201','days_of_week','journeys','journey','journeyName','segments:','type','resolveEmbeddedActivationId','milestone','583704bXfZtc','75352qVCfpY','week','513YjUSSQ','branches','size','Merge','startsWith','exit_criteria','Jump','reentryMode','ref','notification','Journey\x20YAML\x20must\x20have\x20type:\x20journey','Wait\x201\x20Day','find','latest','length','goal','waitStepUnit','folder_id','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','duration','get','entry_criteria','End','Duration','attributes','1974316RqdMMG','reentry_always','stageName','object','moveAfter','\x20\x20\x20\x20conditions:\x0a','10IcIfNZ','\x20\x20\x20\x20type:\x20And\x0a'];a74_0x36a5=function(){return _0x4524d5;};return a74_0x36a5();}function normalizeEmbeddedActivations(_0x14431d,_0x39e21b){const _0x36356f=a74_0x232ce5,_0x516fab={},_0x8c5064=Object['keys'](_0x14431d),_0x21dae7=_0x39e21b?[..._0x39e21b[_0x36356f(0x1d3)](_0x37748b=>_0x8c5064[_0x36356f(0x290)](_0x37748b)),..._0x8c5064[_0x36356f(0x1d3)](_0x1d00ce=>!_0x39e21b['includes'](_0x1d00ce))[_0x36356f(0x23a)]()]:_0x8c5064[_0x36356f(0x23a)]();for(const _0x569e91 of _0x21dae7){const _0x13acfd=_0x14431d[_0x569e91];_0x516fab[_0x569e91]={'name':_0x13acfd[_0x36356f(0x22b)],'connection':_0x13acfd[_0x36356f(0x259)],..._0x13acfd[_0x36356f(0x227)]!==undefined&&{'description':_0x13acfd[_0x36356f(0x227)]},..._0x13acfd[_0x36356f(0x26e)]!==undefined&&{'all_columns':_0x13acfd[_0x36356f(0x26e)]},..._0x13acfd[_0x36356f(0x27a)]!==undefined&&{'columns':_0x13acfd['columns']},..._0x13acfd['behavior']!==undefined&&{'behavior':_0x13acfd[_0x36356f(0x224)]},..._0x13acfd[_0x36356f(0x230)]!==undefined&&{'schedule':_0x13acfd[_0x36356f(0x230)]},..._0x13acfd[_0x36356f(0x1f2)]!==undefined&&{'notification':_0x13acfd[_0x36356f(0x1f2)]},..._0x13acfd[_0x36356f(0x247)]!==undefined&&{'connector_config':_0x13acfd[_0x36356f(0x247)]},..._0x13acfd[_0x36356f(0x22f)]!==undefined&&{'activation_template_id':_0x13acfd[_0x36356f(0x22f)]}};}return _0x516fab;}export function getActiveStages(_0x58313a){const _0x375be1=a74_0x232ce5;if(isJourneysArrayMode(_0x58313a)){const _0x3f0834=_0x58313a[_0x375be1(0x1df)]||[],_0x323d0f=_0x3f0834[_0x375be1(0x1f5)](_0x25d18a=>_0x25d18a['latest']===!![])||_0x3f0834[0x0];return _0x323d0f?.[_0x375be1(0x222)]||[];}if(isSingleVersionMode(_0x58313a))return _0x58313a[_0x375be1(0x222)]||[];if(isMultiVersionMode(_0x58313a)){const _0x215d19=_0x58313a[_0x375be1(0x280)]||[],_0x188e4d=_0x215d19['find'](_0x4c8753=>_0x4c8753[_0x375be1(0x1f6)]===!![])||_0x215d19[0x0];return _0x188e4d?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x53e8dd){const _0xb57e4c=a74_0x232ce5;if(isJourneysArrayMode(_0x53e8dd)){const _0x73d034=_0x53e8dd[_0xb57e4c(0x1df)]||[];return _0x73d034[_0xb57e4c(0x1f5)](_0x4f7f0d=>_0x4f7f0d[_0xb57e4c(0x1f6)]===!![])||_0x73d034[0x0];}if(isMultiVersionMode(_0x53e8dd)){const _0x4cc610=_0x53e8dd['versions']||[],_0x1b432d=_0x4cc610['find'](_0x561968=>_0x561968[_0xb57e4c(0x1f6)]===!![])||_0x4cc610[0x0];if(_0x1b432d)return{'version':_0x1b432d[_0xb57e4c(0x22b)],'state':_0x1b432d[_0xb57e4c(0x26b)],'latest':_0x1b432d[_0xb57e4c(0x1f6)],'stages':_0x1b432d[_0xb57e4c(0x222)],'id':_0x1b432d['id'],'version_number':_0x1b432d[_0xb57e4c(0x225)]};}if(isSingleVersionMode(_0x53e8dd))return{'version':_0x53e8dd[_0xb57e4c(0x263)]||'v1','state':_0xb57e4c(0x262),'stages':_0x53e8dd[_0xb57e4c(0x222)]||[],'id':_0x53e8dd['id'],'version_number':_0x53e8dd[_0xb57e4c(0x225)],'goal':_0x53e8dd['goal'],'reentry':_0x53e8dd['reentry']};return undefined;}export function getLatestVersion(_0x57329c){const _0x5095f1=a74_0x232ce5;if(!isMultiVersionMode(_0x57329c))return undefined;const _0x3113c9=_0x57329c[_0x5095f1(0x280)]||[];return _0x3113c9[_0x5095f1(0x1f5)](_0x19ced8=>_0x19ced8['latest']===!![])||_0x3113c9[0x0];}export function getEffectiveGoal(_0x396261){const _0x1fc6d6=a74_0x232ce5,_0x1b3a86=getLatestJourneyEntry(_0x396261);return _0x1b3a86?.[_0x1fc6d6(0x1f8)]||_0x396261[_0x1fc6d6(0x1f8)];}export function getEffectiveReentry(_0xc9bb0a){const _0x1f0a2a=a74_0x232ce5,_0x172482=getLatestJourneyEntry(_0xc9bb0a);return _0x172482?.[_0x1f0a2a(0x267)]||_0xc9bb0a[_0x1f0a2a(0x267)];}export function collectSegmentRefs(_0x448507){const _0x190bf4=a74_0x232ce5,_0x1a69c1=new Set();_0x448507[_0x190bf4(0x1f8)]?.[_0x190bf4(0x295)]&&_0x1a69c1[_0x190bf4(0x245)](_0x448507['goal'][_0x190bf4(0x295)]);const _0x477578=_0x3ff832=>{const _0x48f1dd=_0x190bf4;for(const _0x3acb67 of _0x3ff832){_0x3acb67[_0x48f1dd(0x1fe)]?.[_0x48f1dd(0x295)]&&_0x1a69c1[_0x48f1dd(0x245)](_0x3acb67[_0x48f1dd(0x1fe)][_0x48f1dd(0x295)]);if(_0x3acb67[_0x48f1dd(0x1ee)])for(const _0x3150e8 of _0x3acb67[_0x48f1dd(0x1ee)]){_0x3150e8[_0x48f1dd(0x295)]&&_0x1a69c1[_0x48f1dd(0x245)](_0x3150e8[_0x48f1dd(0x295)]);}_0x3acb67[_0x48f1dd(0x1e5)]?.[_0x48f1dd(0x295)]&&_0x1a69c1[_0x48f1dd(0x245)](_0x3acb67[_0x48f1dd(0x1e5)][_0x48f1dd(0x295)]);if(_0x3acb67[_0x48f1dd(0x20f)])for(const _0x173b04 of _0x3acb67[_0x48f1dd(0x20f)]){if(_0x173b04[_0x48f1dd(0x1e3)]===_0x48f1dd(0x28f)){const _0x31588a=_0x173b04;for(const _0xd6e1e0 of _0x31588a[_0x48f1dd(0x23c)][_0x48f1dd(0x1ea)]){_0xd6e1e0[_0x48f1dd(0x295)]&&_0x1a69c1[_0x48f1dd(0x245)](_0xd6e1e0['segment']);}}else{if(_0x173b04[_0x48f1dd(0x1e3)]===_0x48f1dd(0x269)){const _0x2e4010=_0x173b04;_0x2e4010[_0x48f1dd(0x23c)][_0x48f1dd(0x27f)]?.[_0x48f1dd(0x295)]&&_0x1a69c1[_0x48f1dd(0x245)](_0x2e4010[_0x48f1dd(0x23c)][_0x48f1dd(0x27f)][_0x48f1dd(0x295)]);}}}}};_0x448507['stages']&&_0x477578(_0x448507[_0x190bf4(0x222)]);if(_0x448507[_0x190bf4(0x280)])for(const _0x5d7b5b of _0x448507[_0x190bf4(0x280)]){_0x477578(_0x5d7b5b[_0x190bf4(0x222)]);}return _0x1a69c1;}export function validateSegmentRefs(_0x36f624){const _0x55a3b6=a74_0x232ce5,_0x3889d4=[],_0x435768=collectSegmentRefs(_0x36f624),_0x31e1ac=new Set(Object[_0x55a3b6(0x27c)](_0x36f624[_0x55a3b6(0x228)]||{}));for(const _0x31dce6 of _0x435768){const _0x4ef2ba=parseSegmentRef(_0x31dce6);_0x4ef2ba['type']===_0x55a3b6(0x281)&&!_0x31e1ac[_0x55a3b6(0x21f)](_0x4ef2ba[_0x55a3b6(0x22b)])&&_0x3889d4[_0x55a3b6(0x291)](_0x55a3b6(0x20d)+_0x4ef2ba['name']+_0x55a3b6(0x20b)+_0x4ef2ba[_0x55a3b6(0x22b)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x3889d4;}
|