@treasuredata/tdx 0.25.6 → 0.25.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ee1a5,_0x4cbe96){const _0x447ad0=a106_0xd6f8,_0xc7ff18=_0x3ee1a5();while(!![]){try{const _0x40ad11=parseInt(_0x447ad0(0x1c2))/0x1+parseInt(_0x447ad0(0x1ca))/0x2+-parseInt(_0x447ad0(0x1c8))/0x3*(parseInt(_0x447ad0(0x1ce))/0x4)+parseInt(_0x447ad0(0x1c4))/0x5*(-parseInt(_0x447ad0(0x1c9))/0x6)+parseInt(_0x447ad0(0x1cb))/0x7*(-parseInt(_0x447ad0(0x1c0))/0x8)+parseInt(_0x447ad0(0x1d0))/0x9*(-parseInt(_0x447ad0(0x1c3))/0xa)+parseInt(_0x447ad0(0x1cd))/0xb;if(_0x40ad11===_0x4cbe96)break;else _0xc7ff18['push'](_0xc7ff18['shift']());}catch(_0x2bf828){_0xc7ff18['push'](_0xc7ff18['shift']());}}}(a106_0x3264,0x2ef92));import{readdirSync,statSync}from'fs';import a106_0x5be774 from'path';export function findYamlFiles(_0x47464e){const _0x433edd=[];function _0x15a020(_0x2b8eca){const _0x1f4b74=a106_0xd6f8,_0x5d2c72=readdirSync(_0x2b8eca,{'withFileTypes':!![]});for(const _0x53f7d8 of _0x5d2c72){const _0xe9bc5d=a106_0x5be774[_0x1f4b74(0x1d1)](_0x2b8eca,_0x53f7d8[_0x1f4b74(0x1c7)]);if(_0x53f7d8[_0x1f4b74(0x1c6)]())_0x15a020(_0xe9bc5d);else(_0x53f7d8[_0x1f4b74(0x1c7)]['endsWith'](_0x1f4b74(0x1c1))||_0x53f7d8[_0x1f4b74(0x1c7)][_0x1f4b74(0x1d5)](_0x1f4b74(0x1d4)))&&_0x433edd[_0x1f4b74(0x1c5)](_0xe9bc5d);}}return _0x15a020(_0x47464e),_0x433edd;}export function discoverYamlFiles(_0x57d505){const _0x3e62ee=a106_0xd6f8,_0x254696=findYamlFiles(_0x57d505);return _0x254696[_0x3e62ee(0x1d2)](_0x435fa1=>{const _0x42ba14=_0x3e62ee,_0x36d5ca=a106_0x5be774[_0x42ba14(0x1d3)](_0x57d505,_0x435fa1),_0x1eeb01=a106_0x5be774['dirname'](_0x36d5ca);return{'absolutePath':_0x435fa1,'relativePath':_0x36d5ca,'folderPath':_0x1eeb01==='.'?'':_0x1eeb01};});}function a106_0xd6f8(_0x42bc68,_0x3d4664){_0x42bc68=_0x42bc68-0x1c0;const _0x326410=a106_0x3264();let _0xd6f861=_0x326410[_0x42bc68];return _0xd6f861;}function a106_0x3264(){const _0x15c6c5=['join','map','relative','.yaml','endsWith','8aRJXWq','.yml','97212QarKdd','90KRzxGJ','15vbqOyJ','push','isDirectory','name','700785cwuzcF','76422CKraUq','227330ciVuQB','1634843zsDFjR','isFile','7873745AvGPTX','4KQJETS','extname','228915KjXIWa'];a106_0x3264=function(){return _0x15c6c5;};return a106_0x3264();}export function isYamlFile(_0x220bd8){const _0x26b666=a106_0xd6f8;try{const _0x439915=statSync(_0x220bd8);if(!_0x439915[_0x26b666(0x1cc)]())return![];const _0x11d07b=a106_0x5be774[_0x26b666(0x1cf)](_0x220bd8)['toLowerCase']();return _0x11d07b==='.yml'||_0x11d07b===_0x26b666(0x1d4);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x52c956,_0x4a6681){const _0x58356b=a107_0x262c,_0x861e74=_0x52c956();while(!![]){try{const _0x5099c7=-parseInt(_0x58356b(0x16d))/0x1+-parseInt(_0x58356b(0x16e))/0x2+parseInt(_0x58356b(0x1ad))/0x3*(parseInt(_0x58356b(0x182))/0x4)+-parseInt(_0x58356b(0x17c))/0x5+parseInt(_0x58356b(0x179))/0x6*(-parseInt(_0x58356b(0x1a5))/0x7)+-parseInt(_0x58356b(0x19f))/0x8*(-parseInt(_0x58356b(0x16c))/0x9)+parseInt(_0x58356b(0x197))/0xa;if(_0x5099c7===_0x4a6681)break;else _0x861e74['push'](_0x861e74['shift']());}catch(_0x3cc63a){_0x861e74['push'](_0x861e74['shift']());}}}(a107_0x2231,0x2c910));function a107_0x2231(){const _0x203c0d=['version','object','49RUbkIs','activation_template_id','match','index','keys','name','all_columns','has','3Hosfrd','columns','.yml','entries','stages','find','journeys','segments','condition','replace','branches','map','get','milestone','1509633iVfcWt','102841PNGlEK','446510rAAZZp','schedule','endsWith','with','set','attributes','length','journeyBundleName','merged','description','exclude','83034DvWfLl','versionNumber','toLowerCase','1383995lugRLS','max','isArray','segment','bundle_name','steps','428724rCywsg','conditions','goal','entry_criteria','rule','decision_point','notification','push','stringify','exit_criteria','launched','string','wait','include','startsWith','state','versions','type','join','.yaml','yaml','6073940kXazDj','version_number','sort','reentry','journey','latest','item','slice','8lNnsnb','draft','bundle_id','activation'];a107_0x2231=function(){return _0x203c0d;};return a107_0x2231();}import{serializeRule,deepSortObject}from'./child-segment-yaml.js';function a107_0x262c(_0x5342b2,_0x2051ab){_0x5342b2=_0x5342b2-0x16c;const _0x22311d=a107_0x2231();let _0x262cb4=_0x22311d[_0x5342b2];return _0x262cb4;}export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x589ae0){const _0x34389e=a107_0x262c;return _0x589ae0[_0x34389e(0x17b)]()[_0x34389e(0x1b6)](/\s+/g,'_')['replace'](/[^a-z0-9_]/g,'')[_0x34389e(0x1b6)](/_+/g,'_')[_0x34389e(0x1b6)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x354472){const _0x4acb1d=a107_0x262c,_0x257457=_0x354472[_0x4acb1d(0x1a7)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x257457){const _0x44b409=_0x257457[0x1][_0x4acb1d(0x17b)](),_0x22f42e=_0x257457[0x2],_0x56ff8b=_0x22f42e[_0x4acb1d(0x1b6)](/-/g,'')[_0x4acb1d(0x19e)](0x0,0x4)[_0x4acb1d(0x17b)]();return _0x44b409+'_'+_0x56ff8b;}const _0x21075f=_0x354472[_0x4acb1d(0x1a7)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x21075f){const _0x35be42=_0x21075f[0x1],_0x3d8571=_0x21075f[0x2][_0x4acb1d(0x17b)](),_0x47354a=_0x35be42[_0x4acb1d(0x1b6)](/-/g,'')[_0x4acb1d(0x19e)](0x0,0x4)[_0x4acb1d(0x17b)]();return _0x3d8571+'_'+_0x47354a;}return undefined;}function stableStringify(_0x340ba0){const _0x4e6b39=a107_0x262c;if(Array[_0x4e6b39(0x17e)](_0x340ba0))return'['+_0x340ba0[_0x4e6b39(0x1b8)](_0x575f35=>stableStringify(_0x575f35))[_0x4e6b39(0x194)](',')+']';if(_0x340ba0&&typeof _0x340ba0===_0x4e6b39(0x1a4)){const _0xf8e058=_0x340ba0,_0x4346ab=Object[_0x4e6b39(0x1a9)](_0xf8e058)[_0x4e6b39(0x199)](),_0x249eec=_0x4346ab[_0x4e6b39(0x1b8)](_0x537d04=>'\x22'+_0x537d04+'\x22:'+stableStringify(_0xf8e058[_0x537d04]));return'{'+_0x249eec[_0x4e6b39(0x194)](',')+'}';}const _0xddf51b=JSON[_0x4e6b39(0x18a)](_0x340ba0);return _0xddf51b===undefined?'null':_0xddf51b;}export function consolidateActivationsByContent(_0x455b55){const _0x1b50af=a107_0x262c,_0x5879de={},_0x120d30=new Map(),_0x284c92=new Map();for(const _0x2d4dd9 of _0x455b55){if(!_0x2d4dd9)continue;for(const [_0x34a2cf,_0x1b8fd8]of Object[_0x1b50af(0x1b0)](_0x2d4dd9)){const _0x10edc4={'connection':_0x1b8fd8['connection'],..._0x1b8fd8[_0x1b50af(0x1ab)]!==undefined&&{'all_columns':_0x1b8fd8['all_columns']},..._0x1b8fd8[_0x1b50af(0x1ae)]!==undefined&&{'columns':_0x1b8fd8[_0x1b50af(0x1ae)]},..._0x1b8fd8['behavior']!==undefined&&{'behavior':_0x1b8fd8['behavior']},..._0x1b8fd8[_0x1b50af(0x16f)]!==undefined&&{'schedule':_0x1b8fd8['schedule']},..._0x1b8fd8[_0x1b50af(0x188)]!==undefined&&{'notification':_0x1b8fd8[_0x1b50af(0x188)]},..._0x1b8fd8['connector_config']!==undefined&&{'connector_config':_0x1b8fd8['connector_config']},..._0x1b8fd8['activation_template_id']!==undefined&&{'activation_template_id':_0x1b8fd8[_0x1b50af(0x1a6)]}},_0x4b2216=stableStringify(_0x10edc4),_0x415504=_0x284c92[_0x1b50af(0x1b9)](_0x4b2216);_0x415504?_0x120d30[_0x1b50af(0x172)](_0x34a2cf,_0x415504):(_0x5879de[_0x34a2cf]=_0x1b8fd8,_0x120d30[_0x1b50af(0x172)](_0x34a2cf,_0x34a2cf),_0x284c92['set'](_0x4b2216,_0x34a2cf));}}return{'merged':_0x5879de,'nameMapping':_0x120d30};}export function updateActivationReferences(_0x1b0535,_0x2f9127){const _0x5888ff=a107_0x262c;if(!_0x1b0535)return;for(const _0x35268f of _0x1b0535){if(!_0x35268f['steps'])continue;for(const _0x17e19c of _0x35268f['steps']){if(_0x17e19c[_0x5888ff(0x193)]===_0x5888ff(0x1a2)&&_0x17e19c[_0x5888ff(0x171)]?.[_0x5888ff(0x1a2)]){const _0x2c5b54=_0x2f9127[_0x5888ff(0x1b9)](_0x17e19c[_0x5888ff(0x171)][_0x5888ff(0x1a2)]);_0x2c5b54&&_0x2c5b54!==_0x17e19c[_0x5888ff(0x171)][_0x5888ff(0x1a2)]&&(_0x17e19c['with']['activation']=_0x2c5b54);}}}}export function consolidateSegmentsByContent(_0x15c38e,_0x2dad60){const _0x5569a7=a107_0x262c,_0x48e246={},_0x46a1a9=new Map(),_0x215edf=new Map();for(const _0x3a04ca of _0x15c38e){if(!_0x3a04ca)continue;for(const [_0x322c30,_0x2fe0b3]of Object[_0x5569a7(0x1b0)](_0x3a04ca)){if(!_0x2fe0b3[_0x5569a7(0x186)]){_0x48e246[_0x322c30]=_0x2fe0b3,_0x46a1a9[_0x5569a7(0x172)](_0x322c30,_0x322c30);continue;}const _0x214056=_0x2fe0b3[_0x5569a7(0x177)]&&_0x2fe0b3[_0x5569a7(0x177)]['trim']()?_0x2fe0b3[_0x5569a7(0x177)]:undefined,_0x28de4e=JSON[_0x5569a7(0x18a)]({'description':_0x214056,'rule':deepSortObject(_0x2fe0b3['rule'])}),_0x4e1cb7=_0x215edf['get'](_0x28de4e);if(_0x4e1cb7){const _0x27f547={..._0x2fe0b3['description']!==undefined&&{'description':_0x2fe0b3[_0x5569a7(0x177)]},'rule':_0x2fe0b3[_0x5569a7(0x186)]?deepSortObject(_0x2fe0b3['rule']):_0x2fe0b3[_0x5569a7(0x186)]};if(_0x322c30<_0x4e1cb7){_0x48e246[_0x322c30]=_0x27f547,delete _0x48e246[_0x4e1cb7];for(const [_0x53470d,_0x351c11]of _0x46a1a9[_0x5569a7(0x1b0)]()){_0x351c11===_0x4e1cb7&&_0x46a1a9[_0x5569a7(0x172)](_0x53470d,_0x322c30);}_0x46a1a9['set'](_0x322c30,_0x322c30),_0x215edf[_0x5569a7(0x172)](_0x28de4e,_0x322c30);}else _0x48e246[_0x4e1cb7]=_0x27f547,_0x46a1a9[_0x5569a7(0x172)](_0x322c30,_0x4e1cb7);}else{let _0x3e08dd=_0x322c30;if(_0x2dad60){const _0x38f56c=_0x2dad60[_0x5569a7(0x1b9)](_0x28de4e);_0x38f56c&&_0x38f56c[_0x5569a7(0x174)]>0x0&&(_0x3e08dd=_0x38f56c[_0x5569a7(0x19e)]()['sort']()[0x0]);}const _0x1c9da2={..._0x2fe0b3['description']!==undefined&&{'description':_0x2fe0b3[_0x5569a7(0x177)]},'rule':_0x2fe0b3['rule']?deepSortObject(_0x2fe0b3[_0x5569a7(0x186)]):_0x2fe0b3[_0x5569a7(0x186)]};_0x48e246[_0x3e08dd]=_0x1c9da2,_0x46a1a9[_0x5569a7(0x172)](_0x322c30,_0x3e08dd),_0x215edf[_0x5569a7(0x172)](_0x28de4e,_0x3e08dd);}}}return{'merged':_0x48e246,'nameMapping':_0x46a1a9};}export function updateSegmentReferences(_0x2141bb,_0x50a9ef){const _0x410a11=a107_0x262c;if(!_0x2141bb)return;for(const _0x500928 of _0x2141bb){if(_0x500928['entry_criteria']?.[_0x410a11(0x17f)]){const _0x27d9f6=_0x50a9ef['get'](_0x500928[_0x410a11(0x185)]['segment']);_0x27d9f6&&(_0x500928[_0x410a11(0x185)][_0x410a11(0x17f)]=_0x27d9f6);}if(_0x500928[_0x410a11(0x181)])for(const _0x33913d of _0x500928[_0x410a11(0x181)]){if(_0x33913d[_0x410a11(0x193)]===_0x410a11(0x187)&&_0x33913d['with']?.[_0x410a11(0x1b7)])for(const _0x5caf68 of _0x33913d[_0x410a11(0x171)][_0x410a11(0x1b7)]){if(_0x5caf68[_0x410a11(0x17f)]){const _0x27c75e=_0x50a9ef['get'](_0x5caf68[_0x410a11(0x17f)]);_0x27c75e&&(_0x5caf68['segment']=_0x27c75e);}}}}}export function updateSegmentRefsInSegments(_0x3f67f0,_0x21eca8){const _0x51a4eb=a107_0x262c;for(const _0x292805 of Object['values'](_0x3f67f0)){_0x292805[_0x51a4eb(0x186)]&&updateSegmentRefsInRule(_0x292805[_0x51a4eb(0x186)],_0x21eca8);}}function updateSegmentRefsInRule(_0x27ef1b,_0x116c45){const _0x5e8f86=a107_0x262c;if(_0x27ef1b===null||typeof _0x27ef1b!=='object')return;if(Array[_0x5e8f86(0x17e)](_0x27ef1b)){for(const _0x1ec6e0 of _0x27ef1b){updateSegmentRefsInRule(_0x1ec6e0,_0x116c45);}return;}const _0x39928c=_0x27ef1b;if((_0x39928c[_0x5e8f86(0x193)]===_0x5e8f86(0x18f)||_0x39928c[_0x5e8f86(0x193)]===_0x5e8f86(0x178))&&typeof _0x39928c[_0x5e8f86(0x17f)]===_0x5e8f86(0x18d)){const _0x1ad546=_0x116c45[_0x5e8f86(0x1b9)](_0x39928c[_0x5e8f86(0x17f)]);_0x1ad546&&(_0x39928c[_0x5e8f86(0x17f)]=_0x1ad546);}if(_0x39928c[_0x5e8f86(0x183)]&&Array[_0x5e8f86(0x17e)](_0x39928c[_0x5e8f86(0x183)]))for(const _0x3ae66c of _0x39928c[_0x5e8f86(0x183)]){updateSegmentRefsInRule(_0x3ae66c,_0x116c45);}}export function buildJourneysArray(_0x5c24d7){const _0x19ac29=a107_0x262c,_0xb36330=Math[_0x19ac29(0x17d)](..._0x5c24d7[_0x19ac29(0x1b8)](_0x252386=>_0x252386['item'][_0x19ac29(0x17a)]||0x0));return _0x5c24d7[_0x19ac29(0x1b8)](_0x579bf6=>{const _0x5c83e9=_0x19ac29,_0x57185f=(_0x579bf6['item'][_0x5c83e9(0x17a)]||0x0)===_0xb36330,_0x582e71=_0x579bf6[_0x5c83e9(0x196)][_0x5c83e9(0x1b3)]?.[0x0],_0x29f16e={'version':_0x582e71?.[_0x5c83e9(0x1a3)]||_0x579bf6[_0x5c83e9(0x196)][_0x5c83e9(0x1a3)]||_0x579bf6[_0x5c83e9(0x19d)][_0x5c83e9(0x1aa)],'state':_0x579bf6[_0x5c83e9(0x19d)][_0x5c83e9(0x191)]===_0x5c83e9(0x18c)?_0x5c83e9(0x18c):_0x5c83e9(0x1a0),'stages':_0x582e71?.[_0x5c83e9(0x1b1)]||_0x579bf6[_0x5c83e9(0x196)][_0x5c83e9(0x1b1)]||[],'id':_0x582e71?.['id']||_0x579bf6[_0x5c83e9(0x196)]['id'],'version_number':_0x582e71?.[_0x5c83e9(0x198)]||_0x579bf6[_0x5c83e9(0x196)][_0x5c83e9(0x198)]};return _0x57185f&&(_0x29f16e[_0x5c83e9(0x19c)]=!![]),_0x29f16e;});}export function buildMergedJourneyDef(_0x10fc20,_0x404a4d){const _0x149920=a107_0x262c,_0x1e3b0a=_0x10fc20[0x0]['yaml'],_0x5ec8eb=buildJourneysArray(_0x10fc20),{merged:_0x1bd169,nameMapping:_0xd3043e}=consolidateSegmentsByContent(_0x10fc20[_0x149920(0x1b8)](_0x4caf51=>_0x4caf51[_0x149920(0x196)][_0x149920(0x1b4)]),_0x404a4d);updateSegmentRefsInSegments(_0x1bd169,_0xd3043e);const _0x59fc0b=Array['from'](_0xd3043e['entries']())['some'](([_0x35b58c,_0x45c8a9])=>_0x35b58c!==_0x45c8a9&&_0x35b58c[_0x149920(0x190)]('entry_criteria'));let _0x450b2c=_0x1bd169,_0x45677e=new Map();if(_0x59fc0b){const _0x6c5e0b=consolidateSegmentsByContent([_0x1bd169],_0x404a4d);_0x450b2c=_0x6c5e0b[_0x149920(0x176)],_0x45677e=_0x6c5e0b['nameMapping'];}const _0x199ce0=new Map(_0xd3043e);for(const [_0x2153b1,_0x188e47]of _0x45677e[_0x149920(0x1b0)]()){_0x199ce0[_0x149920(0x172)](_0x2153b1,_0x188e47);}for(const [_0xddbbd4,_0x4d3f3d]of _0x199ce0['entries']()){let _0x1dd61f=_0x4d3f3d,_0x477f68=0x0;while(_0x199ce0[_0x149920(0x1ac)](_0x1dd61f)&&_0x199ce0['get'](_0x1dd61f)!==_0x1dd61f&&_0x477f68<MAX_MAPPING_CHAIN_DEPTH){_0x1dd61f=_0x199ce0[_0x149920(0x1b9)](_0x1dd61f),_0x477f68++;}_0x1dd61f!==_0x4d3f3d&&_0x199ce0[_0x149920(0x172)](_0xddbbd4,_0x1dd61f);}for(const _0x4f40d9 of _0x5ec8eb){updateSegmentReferences(_0x4f40d9[_0x149920(0x1b1)],_0x199ce0);}const {merged:_0x1691dc,nameMapping:_0x4238bd}=consolidateActivationsByContent(_0x10fc20[_0x149920(0x1b8)](_0x37c14e=>_0x37c14e[_0x149920(0x196)]['activations']));for(const _0x5c4f7a of _0x5ec8eb){updateActivationReferences(_0x5c4f7a[_0x149920(0x1b1)],_0x4238bd);}let _0x4d0eca=_0x1e3b0a[_0x149920(0x184)];if(_0x4d0eca?.[_0x149920(0x17f)]){const _0xfcd778=_0x199ce0[_0x149920(0x1b9)](_0x4d0eca[_0x149920(0x17f)]);_0xfcd778&&(_0x4d0eca={..._0x4d0eca,'segment':_0xfcd778});}for(const _0x2fdbcf of _0x5ec8eb){if(_0x2fdbcf[_0x149920(0x184)]?.[_0x149920(0x17f)]){const _0x4a8ac1=_0x199ce0[_0x149920(0x1b9)](_0x2fdbcf[_0x149920(0x184)]['segment']);_0x4a8ac1&&(_0x2fdbcf['goal']={..._0x2fdbcf['goal'],'segment':_0x4a8ac1});}}return{'type':_0x149920(0x19b),'name':_0x1e3b0a[_0x149920(0x1aa)],'description':_0x1e3b0a[_0x149920(0x177)],'goal':_0x4d0eca,'reentry':_0x1e3b0a[_0x149920(0x19a)],'segments':Object[_0x149920(0x1a9)](_0x450b2c)['length']>0x0?_0x450b2c:undefined,'activations':Object[_0x149920(0x1a9)](_0x1691dc)[_0x149920(0x174)]>0x0?_0x1691dc:undefined,'journeys':_0x5ec8eb,'bundle_id':_0x1e3b0a[_0x149920(0x1a1)],'bundle_name':_0x1e3b0a[_0x149920(0x180)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x1bf874,_0x52b68a,_0x49afc1,_0x499a72){const _0x1e5ceb=a107_0x262c,_0x12f7cf=_0x1bf874+':'+_0x52b68a,_0xa1cd7c=_0x49afc1['get'](_0x12f7cf);if(_0xa1cd7c)return _0xa1cd7c;const _0x27d2bf=await _0x499a72(_0x1bf874),_0x451b7c=_0x27d2bf[_0x1e5ceb(0x173)][_0x1e5ceb(0x175)]||_0x27d2bf['attributes'][_0x1e5ceb(0x1aa)],_0x52abce=_0x27d2bf['attributes']['journeyStages'][_0x1e5ceb(0x1b2)](_0xab8750=>String(_0xab8750['id'])===String(_0x52b68a)),_0x359e8f=_0x52abce?.[_0x1e5ceb(0x1aa)]||_0x52b68a,_0x3cc981={'journeyName':_0x451b7c,'stageName':_0x359e8f};return _0x49afc1['set'](_0x12f7cf,_0x3cc981),_0x3cc981;}export function formatApiJourneyName(_0x440db7,_0xea16fa){return _0xea16fa+'\x20('+_0x440db7+')';}export function isLocalJourneyRef(_0x496bbf){const _0x102f25=a107_0x262c;return _0x496bbf[_0x102f25(0x170)](_0x102f25(0x1af))||_0x496bbf[_0x102f25(0x170)](_0x102f25(0x195));}export function buildLocalRuleToNameMapping(_0x317f9c){const _0x522172=a107_0x262c,_0xfa3926=new Map();if(!_0x317f9c)return _0xfa3926;for(const [_0x280c52,_0xd6c104]of Object[_0x522172(0x1b0)](_0x317f9c)){if(_0xd6c104['rule']){const _0x38ecac=serializeRule(_0xd6c104[_0x522172(0x186)]),_0x587045=_0xfa3926[_0x522172(0x1b9)](_0x38ecac)||[];_0x587045[_0x522172(0x189)](_0x280c52),_0xfa3926[_0x522172(0x172)](_0x38ecac,_0x587045);}}return _0xfa3926;}export function buildLocalRuleToNameMappingFromJourney(_0x39e8e9){const _0x5df727=a107_0x262c,_0x7e32bc=_0x39e8e9[_0x5df727(0x1b4)];if(!_0x7e32bc)return new Map();const _0x5b1663=collectSegmentUsageCounts(_0x39e8e9),_0xd177dc=new Map();let _0x4215aa=0x0;for(const [_0x448c53,_0x5032ff]of Object['entries'](_0x7e32bc)){if(!_0x5032ff[_0x5df727(0x186)]){_0x4215aa++;continue;}const _0x4dda61=serializeRule(_0x5032ff['rule']),_0x3585b7=_0xd177dc['get'](_0x4dda61)||[];_0x3585b7[_0x5df727(0x189)]({'name':_0x448c53,'index':_0x4215aa}),_0xd177dc[_0x5df727(0x172)](_0x4dda61,_0x3585b7),_0x4215aa++;}const _0x3b850b=new Map();for(const [_0x3bb059,_0x1576c3]of _0xd177dc){const _0x57ff99=_0x1576c3['slice']()[_0x5df727(0x199)]((_0x407f2e,_0x3719bb)=>{const _0x142c9b=_0x5df727,_0xd607b2=_0x5b1663[_0x142c9b(0x1b9)](_0x407f2e[_0x142c9b(0x1aa)])||0x0,_0x38b892=_0x5b1663['get'](_0x3719bb[_0x142c9b(0x1aa)])||0x0;if(_0xd607b2!==_0x38b892)return _0x38b892-_0xd607b2;return _0x407f2e['index']-_0x3719bb[_0x142c9b(0x1a8)];})['map'](_0x9d52bb=>_0x9d52bb[_0x5df727(0x1aa)]);_0x3b850b[_0x5df727(0x172)](_0x3bb059,_0x57ff99);}return _0x3b850b;}export function collectSegmentUsageCounts(_0x4b4e57){const _0x2c516a=a107_0x262c,_0x38a877=new Map(),_0x371b2d=_0x38473f=>{const _0x14494d=a107_0x262c;if(!_0x38473f)return;_0x38a877[_0x14494d(0x172)](_0x38473f,(_0x38a877[_0x14494d(0x1b9)](_0x38473f)||0x0)+0x1);},_0x3ac88a=_0x4e3480=>{const _0x4c69db=a107_0x262c;for(const _0x49afb7 of _0x4e3480){_0x371b2d(_0x49afb7[_0x4c69db(0x185)]?.['segment']);if(_0x49afb7[_0x4c69db(0x18b)])for(const _0x3e1564 of _0x49afb7[_0x4c69db(0x18b)]){_0x371b2d(_0x3e1564[_0x4c69db(0x17f)]);}_0x371b2d(_0x49afb7[_0x4c69db(0x1ba)]?.[_0x4c69db(0x17f)]);if(_0x49afb7[_0x4c69db(0x181)])for(const _0x34cfdd of _0x49afb7[_0x4c69db(0x181)]){if(_0x34cfdd[_0x4c69db(0x193)]===_0x4c69db(0x187))for(const _0x40bfd1 of _0x34cfdd[_0x4c69db(0x171)]['branches']){_0x371b2d(_0x40bfd1[_0x4c69db(0x17f)]);}else _0x34cfdd['type']===_0x4c69db(0x18e)&&_0x371b2d(_0x34cfdd[_0x4c69db(0x171)][_0x4c69db(0x1b5)]?.[_0x4c69db(0x17f)]);}}};_0x371b2d(_0x4b4e57['goal']?.[_0x2c516a(0x17f)]);if(_0x4b4e57[_0x2c516a(0x1b3)])for(const _0x36a30a of _0x4b4e57[_0x2c516a(0x1b3)]){_0x371b2d(_0x36a30a[_0x2c516a(0x184)]?.[_0x2c516a(0x17f)]),_0x3ac88a(_0x36a30a[_0x2c516a(0x1b1)]);}_0x4b4e57[_0x2c516a(0x1b1)]&&_0x3ac88a(_0x4b4e57[_0x2c516a(0x1b1)]);if(_0x4b4e57['versions'])for(const _0xe536f8 of _0x4b4e57[_0x2c516a(0x192)]){_0x3ac88a(_0xe536f8['stages']);}return _0x38a877;}
|
|
1
|
+
(function(_0x31bb07,_0x2292e7){const _0x4a675b=a107_0x492f,_0x135e28=_0x31bb07();while(!![]){try{const _0x621e89=parseInt(_0x4a675b(0x166))/0x1+parseInt(_0x4a675b(0x161))/0x2*(-parseInt(_0x4a675b(0x16a))/0x3)+parseInt(_0x4a675b(0x15c))/0x4*(-parseInt(_0x4a675b(0x149))/0x5)+parseInt(_0x4a675b(0x165))/0x6+parseInt(_0x4a675b(0x171))/0x7*(-parseInt(_0x4a675b(0x179))/0x8)+parseInt(_0x4a675b(0x157))/0x9+parseInt(_0x4a675b(0x167))/0xa;if(_0x621e89===_0x2292e7)break;else _0x135e28['push'](_0x135e28['shift']());}catch(_0x14aeda){_0x135e28['push'](_0x135e28['shift']());}}}(a107_0x54c5,0x32e76));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';function a107_0x54c5(){const _0x4b91cf=['version_number','1557000eGtpLT','map','isArray','bundle_id','item','62420OMQACJ','startsWith','values','stages','some','18TQwJAr','connector_config','join','decision_point','2139948pEAnxQ','358514TWsNiP','1539840xYEpVt','all_columns','rule','70743SuRWhV','notification','description','entries','activations','activation','conditions','7cjekJy','version','has','journeyStages','replace','from','push','include','2849120nceCFb','milestone','keys','sort','segments','with','segment','index','merged','versions','yaml','steps','launched','schedule','branches','type','exclude','columns','behavior','endsWith','object','state','activation_template_id','name','versionNumber','exit_criteria','reentry','stringify','get','null','.yaml','journey','bundle_name','85aLPWBX','trim','length','journeys','entry_criteria','find','goal','toLowerCase','condition','attributes','wait','slice','set'];a107_0x54c5=function(){return _0x4b91cf;};return a107_0x54c5();}export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x5501f7){const _0x5b9620=a107_0x492f;return _0x5501f7[_0x5b9620(0x150)]()['replace'](/\s+/g,'_')[_0x5b9620(0x175)](/[^a-z0-9_]/g,'')[_0x5b9620(0x175)](/_+/g,'_')[_0x5b9620(0x175)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x158c75){const _0x9a095c=a107_0x492f,_0x339c53=_0x158c75['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x339c53){const _0x37a7f4=_0x339c53[0x1][_0x9a095c(0x150)](),_0x23de7e=_0x339c53[0x2],_0x789e9e=_0x23de7e['replace'](/-/g,'')[_0x9a095c(0x154)](0x0,0x4)[_0x9a095c(0x150)]();return _0x37a7f4+'_'+_0x789e9e;}const _0x5adac4=_0x158c75['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x5adac4){const _0x18f8d2=_0x5adac4[0x1],_0x1d09f4=_0x5adac4[0x2][_0x9a095c(0x150)](),_0x3ca9b4=_0x18f8d2[_0x9a095c(0x175)](/-/g,'')['slice'](0x0,0x4)[_0x9a095c(0x150)]();return _0x1d09f4+'_'+_0x3ca9b4;}return undefined;}function stableStringify(_0xe1bae0){const _0x3629de=a107_0x492f;if(Array[_0x3629de(0x159)](_0xe1bae0))return'['+_0xe1bae0[_0x3629de(0x158)](_0x1d0e0f=>stableStringify(_0x1d0e0f))['join'](',')+']';if(_0xe1bae0&&typeof _0xe1bae0===_0x3629de(0x13c)){const _0x3e371f=_0xe1bae0,_0x453652=Object[_0x3629de(0x17b)](_0x3e371f)[_0x3629de(0x17c)](),_0x3a6311=_0x453652[_0x3629de(0x158)](_0x6f63a1=>'\x22'+_0x6f63a1+'\x22:'+stableStringify(_0x3e371f[_0x6f63a1]));return'{'+_0x3a6311[_0x3629de(0x163)](',')+'}';}const _0x528867=JSON[_0x3629de(0x143)](_0xe1bae0);return _0x528867===undefined?_0x3629de(0x145):_0x528867;}export function consolidateActivationsByContent(_0x4be3e8){const _0x46e790=a107_0x492f,_0x3361d2={},_0x47a5ae=new Map(),_0x5171cb=new Map();for(const _0x1157ac of _0x4be3e8){if(!_0x1157ac)continue;for(const [_0x579b61,_0x269740]of Object[_0x46e790(0x16d)](_0x1157ac)){const _0x228f16={'connection':_0x269740['connection'],..._0x269740[_0x46e790(0x168)]!==undefined&&{'all_columns':_0x269740['all_columns']},..._0x269740['columns']!==undefined&&{'columns':_0x269740[_0x46e790(0x139)]},..._0x269740[_0x46e790(0x13a)]!==undefined&&{'behavior':_0x269740['behavior']},..._0x269740[_0x46e790(0x135)]!==undefined&&{'schedule':_0x269740[_0x46e790(0x135)]},..._0x269740[_0x46e790(0x16b)]!==undefined&&{'notification':_0x269740['notification']},..._0x269740[_0x46e790(0x162)]!==undefined&&{'connector_config':_0x269740['connector_config']},..._0x269740['activation_template_id']!==undefined&&{'activation_template_id':_0x269740[_0x46e790(0x13e)]}},_0x25d8a7=stableStringify(_0x228f16),_0x47d2ec=_0x5171cb[_0x46e790(0x144)](_0x25d8a7);_0x47d2ec?_0x47a5ae[_0x46e790(0x155)](_0x579b61,_0x47d2ec):(_0x3361d2[_0x579b61]=_0x269740,_0x47a5ae['set'](_0x579b61,_0x579b61),_0x5171cb['set'](_0x25d8a7,_0x579b61));}}return{'merged':_0x3361d2,'nameMapping':_0x47a5ae};}export function updateActivationReferences(_0x3e6471,_0x40f26e){const _0xf3b80c=a107_0x492f;if(!_0x3e6471)return;for(const _0x4c0bc0 of _0x3e6471){if(!_0x4c0bc0[_0xf3b80c(0x133)])continue;for(const _0x23d30e of _0x4c0bc0[_0xf3b80c(0x133)]){if(_0x23d30e[_0xf3b80c(0x137)]===_0xf3b80c(0x16f)&&_0x23d30e[_0xf3b80c(0x17e)]?.[_0xf3b80c(0x16f)]){const _0x5df290=_0x40f26e[_0xf3b80c(0x144)](_0x23d30e[_0xf3b80c(0x17e)][_0xf3b80c(0x16f)]);_0x5df290&&_0x5df290!==_0x23d30e[_0xf3b80c(0x17e)][_0xf3b80c(0x16f)]&&(_0x23d30e[_0xf3b80c(0x17e)][_0xf3b80c(0x16f)]=_0x5df290);}}}}export function consolidateSegmentsByContent(_0x18b811,_0x3df576){const _0xdf8e8=a107_0x492f,_0x4ea060={},_0x4513ce=new Map(),_0xb0bf15=new Map();for(const _0xc4b714 of _0x18b811){if(!_0xc4b714)continue;for(const [_0x4e40d8,_0x2348c9]of Object[_0xdf8e8(0x16d)](_0xc4b714)){if(!_0x2348c9[_0xdf8e8(0x169)]){_0x4ea060[_0x4e40d8]=_0x2348c9,_0x4513ce[_0xdf8e8(0x155)](_0x4e40d8,_0x4e40d8);continue;}const _0xd084bd=_0x2348c9['description']&&_0x2348c9[_0xdf8e8(0x16c)][_0xdf8e8(0x14a)]()?_0x2348c9[_0xdf8e8(0x16c)]:undefined,_0x9792dd=JSON[_0xdf8e8(0x143)]({'description':_0xd084bd,'rule':deepSortObject(_0x2348c9['rule'])}),_0x40b81c=_0xb0bf15[_0xdf8e8(0x144)](_0x9792dd);if(_0x40b81c){const _0x3d5522={..._0x2348c9[_0xdf8e8(0x16c)]!==undefined&&{'description':_0x2348c9[_0xdf8e8(0x16c)]},'rule':_0x2348c9[_0xdf8e8(0x169)]?deepSortObject(_0x2348c9[_0xdf8e8(0x169)]):_0x2348c9['rule']};if(_0x4e40d8<_0x40b81c){_0x4ea060[_0x4e40d8]=_0x3d5522,delete _0x4ea060[_0x40b81c];for(const [_0x34c771,_0x56cf6a]of _0x4513ce[_0xdf8e8(0x16d)]()){_0x56cf6a===_0x40b81c&&_0x4513ce[_0xdf8e8(0x155)](_0x34c771,_0x4e40d8);}_0x4513ce['set'](_0x4e40d8,_0x4e40d8),_0xb0bf15[_0xdf8e8(0x155)](_0x9792dd,_0x4e40d8);}else _0x4ea060[_0x40b81c]=_0x3d5522,_0x4513ce[_0xdf8e8(0x155)](_0x4e40d8,_0x40b81c);}else{let _0x2f9d0c=_0x4e40d8;if(_0x3df576){const _0x4df24a=_0x3df576[_0xdf8e8(0x144)](_0x9792dd);_0x4df24a&&_0x4df24a[_0xdf8e8(0x14b)]>0x0&&(_0x2f9d0c=_0x4df24a[_0xdf8e8(0x154)]()[_0xdf8e8(0x17c)]()[0x0]);}const _0x114c35={..._0x2348c9[_0xdf8e8(0x16c)]!==undefined&&{'description':_0x2348c9[_0xdf8e8(0x16c)]},'rule':_0x2348c9[_0xdf8e8(0x169)]?deepSortObject(_0x2348c9[_0xdf8e8(0x169)]):_0x2348c9['rule']};_0x4ea060[_0x2f9d0c]=_0x114c35,_0x4513ce['set'](_0x4e40d8,_0x2f9d0c),_0xb0bf15[_0xdf8e8(0x155)](_0x9792dd,_0x2f9d0c);}}}return{'merged':_0x4ea060,'nameMapping':_0x4513ce};}function a107_0x492f(_0x55e7f2,_0x4202d4){_0x55e7f2=_0x55e7f2-0x12e;const _0x54c570=a107_0x54c5();let _0x492f7d=_0x54c570[_0x55e7f2];return _0x492f7d;}export function updateSegmentReferences(_0x6dc347,_0x5acfa3){const _0x50a773=a107_0x492f;if(!_0x6dc347)return;for(const _0x345151 of _0x6dc347){if(_0x345151[_0x50a773(0x14d)]?.[_0x50a773(0x12e)]){const _0x47b634=_0x5acfa3[_0x50a773(0x144)](_0x345151[_0x50a773(0x14d)][_0x50a773(0x12e)]);_0x47b634&&(_0x345151['entry_criteria'][_0x50a773(0x12e)]=_0x47b634);}if(_0x345151[_0x50a773(0x133)])for(const _0x1b2124 of _0x345151['steps']){if(_0x1b2124[_0x50a773(0x137)]===_0x50a773(0x164)&&_0x1b2124['with']?.[_0x50a773(0x136)])for(const _0x1004cf of _0x1b2124['with'][_0x50a773(0x136)]){if(_0x1004cf[_0x50a773(0x12e)]){const _0x1b7a5d=_0x5acfa3[_0x50a773(0x144)](_0x1004cf[_0x50a773(0x12e)]);_0x1b7a5d&&(_0x1004cf['segment']=_0x1b7a5d);}}}}}export function updateSegmentRefsInSegments(_0x4d3c41,_0x2ef42e){const _0x484d31=a107_0x492f;for(const _0x242353 of Object[_0x484d31(0x15e)](_0x4d3c41)){_0x242353[_0x484d31(0x169)]&&updateSegmentRefsInRule(_0x242353[_0x484d31(0x169)],_0x2ef42e);}}function updateSegmentRefsInRule(_0x27ce5e,_0x13cfc4){const _0x4cccf9=a107_0x492f;if(_0x27ce5e===null||typeof _0x27ce5e!=='object')return;if(Array[_0x4cccf9(0x159)](_0x27ce5e)){for(const _0x180b1f of _0x27ce5e){updateSegmentRefsInRule(_0x180b1f,_0x13cfc4);}return;}const _0x17ed94=_0x27ce5e;if((_0x17ed94['type']===_0x4cccf9(0x178)||_0x17ed94[_0x4cccf9(0x137)]===_0x4cccf9(0x138))&&typeof _0x17ed94['segment']==='string'){const _0x2323c1=_0x13cfc4[_0x4cccf9(0x144)](_0x17ed94[_0x4cccf9(0x12e)]);_0x2323c1&&(_0x17ed94[_0x4cccf9(0x12e)]=_0x2323c1);}if(_0x17ed94[_0x4cccf9(0x170)]&&Array[_0x4cccf9(0x159)](_0x17ed94[_0x4cccf9(0x170)]))for(const _0x59ae79 of _0x17ed94[_0x4cccf9(0x170)]){updateSegmentRefsInRule(_0x59ae79,_0x13cfc4);}}export function buildJourneysArray(_0x3cedfb){const _0x411e59=a107_0x492f,_0x45c112=Math['max'](..._0x3cedfb[_0x411e59(0x158)](_0xe17f4=>_0xe17f4[_0x411e59(0x15b)][_0x411e59(0x140)]||0x0));return _0x3cedfb[_0x411e59(0x158)](_0x35b87a=>{const _0x2191c3=_0x411e59,_0x3b4617=(_0x35b87a[_0x2191c3(0x15b)][_0x2191c3(0x140)]||0x0)===_0x45c112,_0x4090d1=_0x35b87a[_0x2191c3(0x132)][_0x2191c3(0x14c)]?.[0x0],_0x496020={'version':_0x4090d1?.[_0x2191c3(0x172)]||_0x35b87a['yaml']['version']||_0x35b87a[_0x2191c3(0x15b)][_0x2191c3(0x13f)],'state':_0x35b87a[_0x2191c3(0x15b)][_0x2191c3(0x13d)]===_0x2191c3(0x134)?'launched':'draft','stages':_0x4090d1?.[_0x2191c3(0x15f)]||_0x35b87a['yaml'][_0x2191c3(0x15f)]||[],'id':_0x4090d1?.['id']||_0x35b87a[_0x2191c3(0x132)]['id'],'version_number':_0x4090d1?.[_0x2191c3(0x156)]||_0x35b87a[_0x2191c3(0x132)][_0x2191c3(0x156)]};return _0x3b4617&&(_0x496020['latest']=!![]),_0x496020;});}export function buildMergedJourneyDef(_0x484e51,_0x9efe65){const _0x4c14ed=a107_0x492f,_0x3e74c5=_0x484e51[0x0][_0x4c14ed(0x132)],_0x5ee921=buildJourneysArray(_0x484e51),{merged:_0x1149f8,nameMapping:_0x577ca3}=consolidateSegmentsByContent(_0x484e51['map'](_0x2bf2fb=>_0x2bf2fb['yaml'][_0x4c14ed(0x17d)]),_0x9efe65);updateSegmentRefsInSegments(_0x1149f8,_0x577ca3);const _0x51d5f7=Array[_0x4c14ed(0x176)](_0x577ca3[_0x4c14ed(0x16d)]())[_0x4c14ed(0x160)](([_0x2477b1,_0x304e7b])=>_0x2477b1!==_0x304e7b&&_0x2477b1[_0x4c14ed(0x15d)]('entry_criteria'));let _0x4d9fd4=_0x1149f8,_0x279b5c=new Map();if(_0x51d5f7){const _0x3a963e=consolidateSegmentsByContent([_0x1149f8],_0x9efe65);_0x4d9fd4=_0x3a963e[_0x4c14ed(0x130)],_0x279b5c=_0x3a963e['nameMapping'];}const _0x41990c=new Map(_0x577ca3);for(const [_0x42b253,_0x165496]of _0x279b5c['entries']()){_0x41990c['set'](_0x42b253,_0x165496);}for(const [_0x1973ac,_0x34531f]of _0x41990c[_0x4c14ed(0x16d)]()){let _0x2a0d62=_0x34531f,_0x236ba8=0x0;while(_0x41990c[_0x4c14ed(0x173)](_0x2a0d62)&&_0x41990c['get'](_0x2a0d62)!==_0x2a0d62&&_0x236ba8<MAX_MAPPING_CHAIN_DEPTH){_0x2a0d62=_0x41990c[_0x4c14ed(0x144)](_0x2a0d62),_0x236ba8++;}_0x2a0d62!==_0x34531f&&_0x41990c['set'](_0x1973ac,_0x2a0d62);}for(const _0x5d5827 of _0x5ee921){updateSegmentReferences(_0x5d5827[_0x4c14ed(0x15f)],_0x41990c);}const {merged:_0x4ec157,nameMapping:_0x313857}=consolidateActivationsByContent(_0x484e51[_0x4c14ed(0x158)](_0x2dd005=>_0x2dd005[_0x4c14ed(0x132)][_0x4c14ed(0x16e)]));for(const _0x14e8ba of _0x5ee921){updateActivationReferences(_0x14e8ba[_0x4c14ed(0x15f)],_0x313857);}let _0x3873d8=_0x3e74c5[_0x4c14ed(0x14f)];if(_0x3873d8?.[_0x4c14ed(0x12e)]){const _0x4002f8=_0x41990c[_0x4c14ed(0x144)](_0x3873d8[_0x4c14ed(0x12e)]);_0x4002f8&&(_0x3873d8={..._0x3873d8,'segment':_0x4002f8});}for(const _0x4b0355 of _0x5ee921){if(_0x4b0355[_0x4c14ed(0x14f)]?.[_0x4c14ed(0x12e)]){const _0x2c5b03=_0x41990c['get'](_0x4b0355[_0x4c14ed(0x14f)][_0x4c14ed(0x12e)]);_0x2c5b03&&(_0x4b0355[_0x4c14ed(0x14f)]={..._0x4b0355[_0x4c14ed(0x14f)],'segment':_0x2c5b03});}}return{'type':_0x4c14ed(0x147),'name':_0x3e74c5[_0x4c14ed(0x13f)],'description':_0x3e74c5[_0x4c14ed(0x16c)],'goal':_0x3873d8,'reentry':_0x3e74c5[_0x4c14ed(0x142)],'segments':Object[_0x4c14ed(0x17b)](_0x4d9fd4)['length']>0x0?_0x4d9fd4:undefined,'activations':Object['keys'](_0x4ec157)[_0x4c14ed(0x14b)]>0x0?_0x4ec157:undefined,'journeys':_0x5ee921,'bundle_id':_0x3e74c5[_0x4c14ed(0x15a)],'bundle_name':_0x3e74c5[_0x4c14ed(0x148)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x548e5b,_0x3e582a,_0x49aee4,_0x31f2b7){const _0x5ac479=a107_0x492f,_0x381f8b=_0x548e5b+':'+_0x3e582a,_0x2bfe00=_0x49aee4[_0x5ac479(0x144)](_0x381f8b);if(_0x2bfe00)return _0x2bfe00;const _0x41fd27=await _0x31f2b7(_0x548e5b),_0x1f304d=_0x41fd27[_0x5ac479(0x152)]['journeyBundleName']||_0x41fd27[_0x5ac479(0x152)]['name'],_0x420721=_0x41fd27[_0x5ac479(0x152)][_0x5ac479(0x174)][_0x5ac479(0x14e)](_0x2b0b55=>String(_0x2b0b55['id'])===String(_0x3e582a)),_0x1b88dd=_0x420721?.[_0x5ac479(0x13f)]||_0x3e582a,_0xe70c59={'journeyName':_0x1f304d,'stageName':_0x1b88dd};return _0x49aee4[_0x5ac479(0x155)](_0x381f8b,_0xe70c59),_0xe70c59;}export function formatApiJourneyName(_0x4192ad,_0x40e79f){return _0x40e79f+'\x20('+_0x4192ad+')';}export function isLocalJourneyRef(_0x4694d0){const _0x3666b1=a107_0x492f;return _0x4694d0[_0x3666b1(0x13b)]('.yml')||_0x4694d0[_0x3666b1(0x13b)](_0x3666b1(0x146));}export function buildLocalRuleToNameMapping(_0x4db429){const _0x28d92e=a107_0x492f,_0x167159=new Map();if(!_0x4db429)return _0x167159;for(const [_0xee200d,_0x230894]of Object[_0x28d92e(0x16d)](_0x4db429)){if(_0x230894[_0x28d92e(0x169)]){const _0x2f0fa7=serializeRule(_0x230894[_0x28d92e(0x169)]),_0x1273b9=_0x167159[_0x28d92e(0x144)](_0x2f0fa7)||[];_0x1273b9[_0x28d92e(0x177)](_0xee200d),_0x167159[_0x28d92e(0x155)](_0x2f0fa7,_0x1273b9);}}return _0x167159;}export function buildLocalRuleToNameMappingFromJourney(_0x5b901f){const _0x481955=a107_0x492f,_0x586b9a=_0x5b901f['segments'];if(!_0x586b9a)return new Map();const _0x2164bf=collectSegmentUsageCounts(_0x5b901f),_0x4c6e08=new Map();let _0x52fecd=0x0;for(const [_0x46850b,_0xcce849]of Object['entries'](_0x586b9a)){if(!_0xcce849[_0x481955(0x169)]){_0x52fecd++;continue;}const _0x39ed5d=serializeRule(_0xcce849['rule']),_0x10758b=_0x4c6e08[_0x481955(0x144)](_0x39ed5d)||[];_0x10758b[_0x481955(0x177)]({'name':_0x46850b,'index':_0x52fecd}),_0x4c6e08[_0x481955(0x155)](_0x39ed5d,_0x10758b),_0x52fecd++;}const _0x3d1795=new Map();for(const [_0x1b381d,_0x590a92]of _0x4c6e08){const _0xd003cf=_0x590a92[_0x481955(0x154)]()[_0x481955(0x17c)]((_0x432741,_0x1a05ba)=>{const _0xe4867a=_0x481955,_0x40474f=_0x2164bf[_0xe4867a(0x144)](_0x432741[_0xe4867a(0x13f)])||0x0,_0x44c67a=_0x2164bf['get'](_0x1a05ba[_0xe4867a(0x13f)])||0x0;if(_0x40474f!==_0x44c67a)return _0x44c67a-_0x40474f;return _0x432741[_0xe4867a(0x12f)]-_0x1a05ba[_0xe4867a(0x12f)];})[_0x481955(0x158)](_0x2306f3=>_0x2306f3[_0x481955(0x13f)]);_0x3d1795[_0x481955(0x155)](_0x1b381d,_0xd003cf);}return _0x3d1795;}export function collectSegmentUsageCounts(_0x168254){const _0x46cbd4=a107_0x492f,_0x1f5442=new Map(),_0x429e40=_0x279bb8=>{const _0xb44df9=a107_0x492f;if(!_0x279bb8)return;_0x1f5442[_0xb44df9(0x155)](_0x279bb8,(_0x1f5442['get'](_0x279bb8)||0x0)+0x1);},_0x438410=_0x433e7c=>{const _0xe9364a=a107_0x492f;for(const _0x43af39 of _0x433e7c){_0x429e40(_0x43af39['entry_criteria']?.[_0xe9364a(0x12e)]);if(_0x43af39['exit_criteria'])for(const _0x30a9f0 of _0x43af39[_0xe9364a(0x141)]){_0x429e40(_0x30a9f0[_0xe9364a(0x12e)]);}_0x429e40(_0x43af39[_0xe9364a(0x17a)]?.[_0xe9364a(0x12e)]);if(_0x43af39['steps'])for(const _0x1d7174 of _0x43af39['steps']){if(_0x1d7174[_0xe9364a(0x137)]===_0xe9364a(0x164))for(const _0x4e7ee8 of _0x1d7174['with'][_0xe9364a(0x136)]){_0x429e40(_0x4e7ee8['segment']);}else _0x1d7174[_0xe9364a(0x137)]===_0xe9364a(0x153)&&_0x429e40(_0x1d7174[_0xe9364a(0x17e)][_0xe9364a(0x151)]?.[_0xe9364a(0x12e)]);}}};_0x429e40(_0x168254['goal']?.[_0x46cbd4(0x12e)]);if(_0x168254[_0x46cbd4(0x14c)])for(const _0x5c8494 of _0x168254[_0x46cbd4(0x14c)]){_0x429e40(_0x5c8494[_0x46cbd4(0x14f)]?.[_0x46cbd4(0x12e)]),_0x438410(_0x5c8494[_0x46cbd4(0x15f)]);}_0x168254[_0x46cbd4(0x15f)]&&_0x438410(_0x168254[_0x46cbd4(0x15f)]);if(_0x168254[_0x46cbd4(0x131)])for(const _0x7ea4dd of _0x168254[_0x46cbd4(0x131)]){_0x438410(_0x7ea4dd[_0x46cbd4(0x15f)]);}return _0x1f5442;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2d52a5,_0x4ed75d){const _0x33e45e=a108_0x1761,_0x20c0b6=_0x2d52a5();while(!![]){try{const _0x52a7ba=parseInt(_0x33e45e(0x1e5))/0x1*(-parseInt(_0x33e45e(0x287))/0x2)+parseInt(_0x33e45e(0x2a1))/0x3*(-parseInt(_0x33e45e(0x281))/0x4)+-parseInt(_0x33e45e(0x216))/0x5+parseInt(_0x33e45e(0x20a))/0x6+-parseInt(_0x33e45e(0x25f))/0x7*(-parseInt(_0x33e45e(0x1e2))/0x8)+parseInt(_0x33e45e(0x214))/0x9+-parseInt(_0x33e45e(0x274))/0xa;if(_0x52a7ba===_0x4ed75d)break;else _0x20c0b6['push'](_0x20c0b6['shift']());}catch(_0x47a0af){_0x20c0b6['push'](_0x20c0b6['shift']());}}}(a108_0x2744,0xf0b22));import*as a108_0x30dc56 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x1e9716){const _0x2a2d35=a108_0x1761,_0xffc701=_0x1e9716[_0x2a2d35(0x282)]();if(_0xffc701===_0x2a2d35(0x232)||_0xffc701===_0x2a2d35(0x27d))return _0x2a2d35(0x27d);if(_0xffc701==='weeks'||_0xffc701==='week')return _0x2a2d35(0x1fd);return _0x1e9716;}export function journeyResponseToDefSync(_0x394bab){const _0x37e04d=a108_0x1761,_0x2b5fcf=_0x394bab[_0x37e04d(0x1f1)],_0x3d7352=_0x2b5fcf[_0x37e04d(0x264)]||_0x2b5fcf['name'],_0x347bb5={'stages':_0x2b5fcf[_0x37e04d(0x20f)]['map'](convertApiStageToYaml),'id':_0x394bab['id']};_0x2b5fcf[_0x37e04d(0x26f)]&&_0x2b5fcf[_0x37e04d(0x26f)]!==_0x3d7352&&(_0x347bb5[_0x37e04d(0x22c)]=_0x2b5fcf[_0x37e04d(0x26f)]);_0x2b5fcf['versionNumber']!==undefined&&(_0x347bb5['version_number']=_0x2b5fcf['versionNumber']);_0x2b5fcf[_0x37e04d(0x259)]&&(_0x347bb5[_0x37e04d(0x259)]=_0x2b5fcf[_0x37e04d(0x259)]===_0x37e04d(0x1f2)?'launched':'draft');const _0x196911={'type':_0x37e04d(0x244),'name':_0x3d7352,'journeys':[_0x347bb5]};_0x2b5fcf['description']&&(_0x196911[_0x37e04d(0x1e1)]=_0x2b5fcf[_0x37e04d(0x1e1)]);_0x2b5fcf[_0x37e04d(0x290)]&&(_0x196911[_0x37e04d(0x290)]=convertApiCriteriaToYaml(_0x2b5fcf[_0x37e04d(0x290)]));if(_0x2b5fcf['reentryMode'])_0x196911[_0x37e04d(0x24e)]=_0x2b5fcf[_0x37e04d(0x238)];else _0x2b5fcf[_0x37e04d(0x27c)]!==undefined&&(_0x196911[_0x37e04d(0x24e)]=_0x2b5fcf[_0x37e04d(0x27c)]?_0x37e04d(0x1f0):_0x37e04d(0x245));return _0x2b5fcf[_0x37e04d(0x243)]&&(_0x196911[_0x37e04d(0x1ff)]=_0x2b5fcf[_0x37e04d(0x243)]),_0x2b5fcf[_0x37e04d(0x264)]&&(_0x196911['bundle_name']=_0x2b5fcf[_0x37e04d(0x264)]),_0x394bab[_0x37e04d(0x231)]?.[_0x37e04d(0x27a)]?.[_0x37e04d(0x21c)]?.['id']&&(_0x196911[_0x37e04d(0x270)]=_0x394bab[_0x37e04d(0x231)][_0x37e04d(0x27a)][_0x37e04d(0x21c)]['id']),_0x196911;}export async function journeyResponseToDef(_0x5aea20,_0x18f043){const _0x208a00=a108_0x1761,_0x4c3bfe=journeyResponseToDefSync(_0x5aea20);if(!_0x18f043)return _0x4c3bfe;const _0x540480=new Set();collectSegmentIdsFromJourney(_0x4c3bfe,_0x540480);const _0x547ba4=new Set();collectActivationIdsFromJourney(_0x4c3bfe,_0x547ba4);const _0x45eace={},_0x19936f=new Map();for(const _0x458d5d of Array['from'](_0x540480)['sort']()){if(_0x18f043['resolveSegment']){const _0x42664a=await _0x18f043[_0x208a00(0x25b)](_0x458d5d);if(_0x42664a[_0x208a00(0x26b)]){_0x19936f[_0x208a00(0x1f3)](_0x458d5d,_0x42664a[_0x208a00(0x26f)]);if(_0x42664a['definition']){const _0x993a4={..._0x42664a['definition'],'rule':deepSortObject(_0x42664a[_0x208a00(0x1f4)][_0x208a00(0x226)])};_0x45eace[_0x42664a[_0x208a00(0x26f)]]=_0x993a4;}}else _0x19936f['set'](_0x458d5d,makeSegmentRef(_0x42664a['name']));}else{if(_0x18f043[_0x208a00(0x206)]){const _0x2aa70d=await _0x18f043[_0x208a00(0x206)](_0x458d5d);_0x19936f[_0x208a00(0x1f3)](_0x458d5d,_0x2aa70d);}}}const _0x5f2942={},_0x27c252=new Map();for(const _0x171f3f of Array[_0x208a00(0x22d)](_0x547ba4)[_0x208a00(0x29d)]()){if(_0x18f043[_0x208a00(0x28b)]){const _0x327f42=await _0x18f043[_0x208a00(0x28b)](_0x171f3f);_0x327f42['isJourneyLocal']?(_0x27c252[_0x208a00(0x1f3)](_0x171f3f,_0x327f42[_0x208a00(0x26f)]),_0x327f42[_0x208a00(0x1f4)]&&(_0x5f2942[_0x327f42[_0x208a00(0x26f)]]=_0x327f42[_0x208a00(0x1f4)])):_0x27c252[_0x208a00(0x1f3)](_0x171f3f,makeSegmentRef(_0x327f42['name']));}else{if(_0x18f043[_0x208a00(0x202)]){const _0x3dfdb8=await _0x18f043[_0x208a00(0x202)](_0x171f3f);_0x27c252[_0x208a00(0x1f3)](_0x171f3f,_0x3dfdb8);}}}_0x19936f[_0x208a00(0x27e)]>0x0&&replaceSegmentIdsInJourney(_0x4c3bfe,_0x19936f);_0x27c252[_0x208a00(0x27e)]>0x0&&replaceActivationIdsInJourney(_0x4c3bfe,_0x27c252);if(_0x18f043['resolveJumpTarget']){const _0x25f1c0=[];collectJumpTargetsFromJourney(_0x4c3bfe,_0x25f1c0);if(_0x25f1c0[_0x208a00(0x277)]>0x0){const _0x3607a8=new Map();for(const _0x1964eb of _0x25f1c0){try{const _0x1e5ebb=await _0x18f043[_0x208a00(0x1e6)](_0x1964eb[_0x208a00(0x239)],_0x1964eb[_0x208a00(0x278)]);_0x3607a8['set'](_0x1964eb[_0x208a00(0x239)]+':'+_0x1964eb[_0x208a00(0x278)],_0x1e5ebb);}catch{}}_0x3607a8[_0x208a00(0x27e)]>0x0&&replaceJumpTargetsInJourney(_0x4c3bfe,_0x3607a8);}}return Object[_0x208a00(0x26e)](_0x45eace)[_0x208a00(0x277)]>0x0&&(_0x4c3bfe[_0x208a00(0x283)]=_0x45eace),Object['keys'](_0x5f2942)[_0x208a00(0x277)]>0x0&&(_0x4c3bfe[_0x208a00(0x1f6)]=_0x5f2942),_0x4c3bfe;}function collectSegmentIdsFromJourney(_0x418f38,_0x39f245){const _0x384159=a108_0x1761;_0x418f38[_0x384159(0x290)]?.[_0x384159(0x29f)]&&_0x39f245['add'](_0x418f38[_0x384159(0x290)][_0x384159(0x29f)]);const _0x28a1a4=_0x17e1a6=>{const _0x24f17b=_0x384159;for(const _0x350b2a of _0x17e1a6){_0x350b2a[_0x24f17b(0x221)]?.[_0x24f17b(0x29f)]&&_0x39f245['add'](_0x350b2a[_0x24f17b(0x221)][_0x24f17b(0x29f)]);if(_0x350b2a[_0x24f17b(0x29a)])for(const _0x390957 of _0x350b2a[_0x24f17b(0x29a)]){_0x390957[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x390957[_0x24f17b(0x29f)]);}_0x350b2a[_0x24f17b(0x296)]?.[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x350b2a[_0x24f17b(0x296)][_0x24f17b(0x29f)]);if(_0x350b2a[_0x24f17b(0x205)])for(const _0x10ca4f of _0x350b2a[_0x24f17b(0x205)]){if(_0x10ca4f[_0x24f17b(0x213)]===_0x24f17b(0x284)){const _0x5a1a68=_0x10ca4f;for(const _0x507104 of _0x5a1a68[_0x24f17b(0x249)][_0x24f17b(0x1e7)]){_0x507104[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x507104[_0x24f17b(0x29f)]);}}else{if(_0x10ca4f['type']===_0x24f17b(0x269)){const _0x7f85d3=_0x10ca4f;_0x7f85d3[_0x24f17b(0x249)]['condition']?.[_0x24f17b(0x29f)]&&_0x39f245[_0x24f17b(0x28e)](_0x7f85d3[_0x24f17b(0x249)][_0x24f17b(0x236)][_0x24f17b(0x29f)]);}}}}};if(_0x418f38[_0x384159(0x247)])for(const _0x4570c2 of _0x418f38['journeys']){_0x4570c2[_0x384159(0x290)]?.[_0x384159(0x29f)]&&_0x39f245[_0x384159(0x28e)](_0x4570c2[_0x384159(0x290)][_0x384159(0x29f)]),_0x28a1a4(_0x4570c2[_0x384159(0x267)]);}_0x418f38['stages']&&_0x28a1a4(_0x418f38['stages']);if(_0x418f38[_0x384159(0x237)])for(const _0xa215ab of _0x418f38[_0x384159(0x237)]){_0x28a1a4(_0xa215ab[_0x384159(0x267)]);}}function replaceSegmentIdsInJourney(_0x1f012d,_0x4fe2ce){const _0x5b7314=a108_0x1761,_0x639066=_0x2a8771=>_0x4fe2ce['get'](_0x2a8771)||_0x2a8771;_0x1f012d['goal']?.[_0x5b7314(0x29f)]&&(_0x1f012d[_0x5b7314(0x290)][_0x5b7314(0x29f)]=_0x639066(_0x1f012d[_0x5b7314(0x290)][_0x5b7314(0x29f)]));const _0x217ca7=_0x32b95c=>{const _0xe3d4c6=_0x5b7314;for(const _0x294b4e of _0x32b95c){_0x294b4e[_0xe3d4c6(0x221)]?.[_0xe3d4c6(0x29f)]&&(_0x294b4e[_0xe3d4c6(0x221)][_0xe3d4c6(0x29f)]=_0x639066(_0x294b4e[_0xe3d4c6(0x221)][_0xe3d4c6(0x29f)]));if(_0x294b4e[_0xe3d4c6(0x29a)])for(const _0xb2c292 of _0x294b4e[_0xe3d4c6(0x29a)]){_0xb2c292[_0xe3d4c6(0x29f)]&&(_0xb2c292[_0xe3d4c6(0x29f)]=_0x639066(_0xb2c292['segment']));}_0x294b4e[_0xe3d4c6(0x296)]?.['segment']&&(_0x294b4e[_0xe3d4c6(0x296)][_0xe3d4c6(0x29f)]=_0x639066(_0x294b4e[_0xe3d4c6(0x296)][_0xe3d4c6(0x29f)]));if(_0x294b4e[_0xe3d4c6(0x205)])for(const _0x47ab26 of _0x294b4e['steps']){if(_0x47ab26[_0xe3d4c6(0x213)]===_0xe3d4c6(0x284)){const _0x1df0a7=_0x47ab26;for(const _0x2baf2b of _0x1df0a7['with']['branches']){_0x2baf2b['segment']&&(_0x2baf2b[_0xe3d4c6(0x29f)]=_0x639066(_0x2baf2b[_0xe3d4c6(0x29f)]));}}else{if(_0x47ab26[_0xe3d4c6(0x213)]===_0xe3d4c6(0x269)){const _0x47b145=_0x47ab26;_0x47b145[_0xe3d4c6(0x249)][_0xe3d4c6(0x236)]?.[_0xe3d4c6(0x29f)]&&(_0x47b145[_0xe3d4c6(0x249)][_0xe3d4c6(0x236)][_0xe3d4c6(0x29f)]=_0x639066(_0x47b145[_0xe3d4c6(0x249)][_0xe3d4c6(0x236)][_0xe3d4c6(0x29f)]));}}}}};if(_0x1f012d[_0x5b7314(0x247)])for(const _0x50c08e of _0x1f012d[_0x5b7314(0x247)]){_0x50c08e['goal']?.[_0x5b7314(0x29f)]&&(_0x50c08e[_0x5b7314(0x290)][_0x5b7314(0x29f)]=_0x639066(_0x50c08e['goal'][_0x5b7314(0x29f)])),_0x217ca7(_0x50c08e[_0x5b7314(0x267)]);}_0x1f012d[_0x5b7314(0x267)]&&_0x217ca7(_0x1f012d[_0x5b7314(0x267)]);if(_0x1f012d['versions'])for(const _0x263767 of _0x1f012d[_0x5b7314(0x237)]){_0x217ca7(_0x263767['stages']);}}function collectActivationIdsFromJourney(_0x24bd59,_0x1ba2a0){const _0x300586=a108_0x1761,_0x3b2d8a=_0x5c3060=>{const _0x1565b3=a108_0x1761;for(const _0x5b47d2 of _0x5c3060){if(_0x5b47d2['steps'])for(const _0x5a2731 of _0x5b47d2['steps']){if(_0x5a2731[_0x1565b3(0x213)]===_0x1565b3(0x28a)){const _0x25379d=_0x5a2731;_0x25379d[_0x1565b3(0x249)]['activation']&&/^\d+$/[_0x1565b3(0x261)](_0x25379d[_0x1565b3(0x249)][_0x1565b3(0x28a)])&&_0x1ba2a0[_0x1565b3(0x28e)](_0x25379d['with']['activation']);}}}};if(_0x24bd59[_0x300586(0x247)])for(const _0x7ea13e of _0x24bd59[_0x300586(0x247)]){_0x3b2d8a(_0x7ea13e['stages']);}_0x24bd59[_0x300586(0x267)]&&_0x3b2d8a(_0x24bd59[_0x300586(0x267)]);if(_0x24bd59['versions'])for(const _0x2ba989 of _0x24bd59['versions']){_0x3b2d8a(_0x2ba989[_0x300586(0x267)]);}}function replaceActivationIdsInJourney(_0x5dc59e,_0xbdcd98){const _0x310db8=a108_0x1761,_0x46816e=_0x44bbb9=>_0xbdcd98[_0x310db8(0x234)](_0x44bbb9)||_0x44bbb9,_0x1eea55=_0x4ab97f=>{const _0x570b43=_0x310db8;for(const _0x23b9ab of _0x4ab97f){if(_0x23b9ab[_0x570b43(0x205)])for(const _0x119e90 of _0x23b9ab['steps']){if(_0x119e90[_0x570b43(0x213)]==='activation'){const _0x2242a4=_0x119e90;_0x2242a4[_0x570b43(0x249)]['activation']&&(_0x2242a4[_0x570b43(0x249)][_0x570b43(0x28a)]=_0x46816e(_0x2242a4[_0x570b43(0x249)]['activation']));}}}};if(_0x5dc59e['journeys'])for(const _0x557bf7 of _0x5dc59e[_0x310db8(0x247)]){_0x1eea55(_0x557bf7[_0x310db8(0x267)]);}_0x5dc59e[_0x310db8(0x267)]&&_0x1eea55(_0x5dc59e[_0x310db8(0x267)]);if(_0x5dc59e[_0x310db8(0x237)])for(const _0x3a8620 of _0x5dc59e[_0x310db8(0x237)]){_0x1eea55(_0x3a8620['stages']);}}function collectJumpTargetsFromJourney(_0x8fb965,_0x8354c3){const _0x5ecdca=a108_0x1761,_0x4087ee=new Set(),_0x105f22=_0x1d9725=>{const _0x265d69=a108_0x1761;for(const _0x2e05f4 of _0x1d9725){if(_0x2e05f4['steps'])for(const _0x54898c of _0x2e05f4[_0x265d69(0x205)]){if(_0x54898c[_0x265d69(0x213)]===_0x265d69(0x20c)){const _0x184df2=_0x54898c,_0x1a2b73=_0x184df2[_0x265d69(0x249)]['target'];if(_0x1a2b73[_0x265d69(0x244)]&&_0x1a2b73[_0x265d69(0x240)]&&/^\d+$/['test'](_0x1a2b73['journey'])&&/^\d+$/[_0x265d69(0x261)](_0x1a2b73[_0x265d69(0x240)])){const _0x4bc098=_0x1a2b73[_0x265d69(0x244)]+':'+_0x1a2b73[_0x265d69(0x240)];!_0x4087ee[_0x265d69(0x255)](_0x4bc098)&&(_0x4087ee['add'](_0x4bc098),_0x8354c3['push']({'journeyId':_0x1a2b73['journey'],'stageId':_0x1a2b73[_0x265d69(0x240)]}));}}}}};if(_0x8fb965[_0x5ecdca(0x247)])for(const _0xe91b12 of _0x8fb965[_0x5ecdca(0x247)]){_0x105f22(_0xe91b12[_0x5ecdca(0x267)]);}_0x8fb965[_0x5ecdca(0x267)]&&_0x105f22(_0x8fb965[_0x5ecdca(0x267)]);if(_0x8fb965[_0x5ecdca(0x237)])for(const _0x313953 of _0x8fb965[_0x5ecdca(0x237)]){_0x105f22(_0x313953[_0x5ecdca(0x267)]);}}function replaceJumpTargetsInJourney(_0x48d0aa,_0x53ecc5){const _0x497f55=a108_0x1761,_0x47211f=_0x4c9afb=>{const _0x227da0=a108_0x1761;for(const _0x24c62d of _0x4c9afb){if(_0x24c62d[_0x227da0(0x205)])for(const _0x1ec48f of _0x24c62d[_0x227da0(0x205)]){if(_0x1ec48f['type']==='jump'){const _0x5e6268=_0x1ec48f,_0x6e3183=_0x5e6268[_0x227da0(0x249)][_0x227da0(0x1e9)],_0x44c659=_0x6e3183[_0x227da0(0x244)]+':'+_0x6e3183[_0x227da0(0x240)],_0x3f4c4f=_0x53ecc5['get'](_0x44c659);_0x3f4c4f&&(_0x6e3183['journey']=_0x3f4c4f['journeyName'],_0x6e3183[_0x227da0(0x240)]=_0x3f4c4f[_0x227da0(0x208)]);}}}};if(_0x48d0aa[_0x497f55(0x247)])for(const _0x4b6c7a of _0x48d0aa[_0x497f55(0x247)]){_0x47211f(_0x4b6c7a[_0x497f55(0x267)]);}_0x48d0aa[_0x497f55(0x267)]&&_0x47211f(_0x48d0aa[_0x497f55(0x267)]);if(_0x48d0aa[_0x497f55(0x237)])for(const _0x2ae561 of _0x48d0aa[_0x497f55(0x237)]){_0x47211f(_0x2ae561[_0x497f55(0x267)]);}}function generateReadableStepName(_0xe16b43,_0x59dc73){const _0x533f55=a108_0x1761;if(_0xe16b43[_0x533f55(0x26f)]&&_0xe16b43[_0x533f55(0x26f)]!==_0xe16b43['type']){const _0x57ac10=_0xe16b43[_0x533f55(0x26f)][_0x533f55(0x29c)]();if(_0x57ac10&&/[a-z0-9]/i[_0x533f55(0x261)](_0x57ac10))return _0x57ac10;}const _0x1b87e4=_0xe16b43[_0x533f55(0x213)][_0x533f55(0x282)]()[_0x533f55(0x257)](/step$/i,'');return _0x1b87e4+'_'+(_0x59dc73+0x1);}function getStepNextRefs(_0x51a365){const _0x3a8a37=a108_0x1761,_0x40e963=[];if(_0x51a365['next'])_0x40e963[_0x3a8a37(0x211)](_0x51a365['next']);if(_0x51a365[_0x3a8a37(0x1e7)])for(const _0x4f8e98 of _0x51a365['branches']){if(_0x4f8e98[_0x3a8a37(0x2a4)])_0x40e963[_0x3a8a37(0x211)](_0x4f8e98[_0x3a8a37(0x2a4)]);}if(_0x51a365[_0x3a8a37(0x254)])for(const _0x485111 of _0x51a365['variants']){if(_0x485111[_0x3a8a37(0x2a4)])_0x40e963[_0x3a8a37(0x211)](_0x485111[_0x3a8a37(0x2a4)]);}if(_0x51a365[_0x3a8a37(0x2a0)])for(const _0x28f3e6 of _0x51a365[_0x3a8a37(0x2a0)]){if(_0x28f3e6[_0x3a8a37(0x2a4)])_0x40e963['push'](_0x28f3e6['next']);}return _0x40e963;}function parseJumpTargetDisplayName(_0x52ad50){const _0x362f97=a108_0x1761,_0xe55a89=_0x52ad50[_0x362f97(0x298)](/^(.+?)\s*\(([^/)]+)/);if(!_0xe55a89)return undefined;const _0x128aa4=_0xe55a89[0x1][_0x362f97(0x29c)](),_0x6c9b9c=_0xe55a89[0x2][_0x362f97(0x29c)]();if(!_0x128aa4||!_0x6c9b9c)return undefined;return{'stageName':_0x128aa4,'journeyName':_0x6c9b9c};}function orderStepsFromRoot(_0x181748,_0x3e2945){const _0x2f559e=a108_0x1761,_0x41b0a5=Object[_0x2f559e(0x285)](_0x181748);if(_0x41b0a5['length']===0x0)return[];const _0x554496=new Set(_0x41b0a5[_0x2f559e(0x20e)](([_0x83fab3])=>_0x83fab3)),_0xb5ede4=new Set();for(const [,_0x5e3cdd]of _0x41b0a5){for(const _0x8aecfd of getStepNextRefs(_0x5e3cdd)){if(_0x554496['has'](_0x8aecfd))_0xb5ede4[_0x2f559e(0x28e)](_0x8aecfd);}}let _0x5da975=_0x3e2945&&_0x554496[_0x2f559e(0x255)](_0x3e2945)?_0x3e2945:undefined;if(!_0x5da975){const _0x245404=_0x41b0a5[_0x2f559e(0x25e)](([_0x1ff60c])=>!_0xb5ede4[_0x2f559e(0x255)](_0x1ff60c));_0x245404[_0x2f559e(0x277)]>0x0?_0x5da975=_0x245404[0x0][0x0]:_0x5da975=_0x41b0a5[0x0][0x0];}const _0x2c740d=[],_0x4928cc=new Set(),_0x29e9db=[_0x5da975];while(_0x29e9db['length']>0x0){const _0x438674=_0x29e9db[_0x2f559e(0x23d)]();if(_0x4928cc[_0x2f559e(0x255)](_0x438674))continue;_0x4928cc['add'](_0x438674);const _0x4f9a84=_0x181748[_0x438674];if(!_0x4f9a84)continue;_0x2c740d[_0x2f559e(0x211)]({'uuid':_0x438674,'step':_0x4f9a84});for(const _0xe1a044 of getStepNextRefs(_0x4f9a84)){_0x554496[_0x2f559e(0x255)](_0xe1a044)&&!_0x4928cc[_0x2f559e(0x255)](_0xe1a044)&&_0x29e9db[_0x2f559e(0x211)](_0xe1a044);}}for(const [_0x1d09c8,_0x5f004b]of _0x41b0a5){!_0x4928cc[_0x2f559e(0x255)](_0x1d09c8)&&_0x2c740d[_0x2f559e(0x211)]({'uuid':_0x1d09c8,'step':_0x5f004b});}return _0x2c740d;}function resolveStepReferences(_0x148f39,_0x5dd438,_0xf22626,_0x7b7b7f){const _0x567635=a108_0x1761;if(_0x148f39[_0x567635(0x213)]!=='end'){_0x148f39['next']&&_0x7b7b7f[_0x567635(0x255)](_0x148f39[_0x567635(0x2a4)])&&(_0x148f39['next']=_0x7b7b7f[_0x567635(0x234)](_0x148f39[_0x567635(0x2a4)]));const _0x20d6e4=_0x5dd438+0x1;if(_0x20d6e4<_0xf22626[_0x567635(0x277)]){const _0x59b1e7=_0x7b7b7f[_0x567635(0x234)](_0xf22626[_0x20d6e4][_0x567635(0x222)]);_0x148f39[_0x567635(0x2a4)]===_0x59b1e7&&delete _0x148f39[_0x567635(0x2a4)];}}if(_0x148f39[_0x567635(0x213)]===_0x567635(0x284))for(const _0x5bbef9 of _0x148f39[_0x567635(0x249)][_0x567635(0x1e7)]){_0x5bbef9[_0x567635(0x2a4)]&&_0x7b7b7f[_0x567635(0x255)](_0x5bbef9[_0x567635(0x2a4)])&&(_0x5bbef9[_0x567635(0x2a4)]=_0x7b7b7f['get'](_0x5bbef9[_0x567635(0x2a4)]));}if(_0x148f39['type']===_0x567635(0x24c))for(const _0x500892 of _0x148f39[_0x567635(0x249)][_0x567635(0x254)]){_0x500892[_0x567635(0x2a4)]&&_0x7b7b7f['has'](_0x500892[_0x567635(0x2a4)])&&(_0x500892[_0x567635(0x2a4)]=_0x7b7b7f[_0x567635(0x234)](_0x500892[_0x567635(0x2a4)]));}if(_0x148f39['type']==='wait'&&_0x148f39[_0x567635(0x249)][_0x567635(0x236)]){const _0x3b1d9d=_0x148f39[_0x567635(0x249)][_0x567635(0x236)];_0x3b1d9d[_0x567635(0x2a4)]&&_0x7b7b7f[_0x567635(0x255)](_0x3b1d9d['next'])&&(_0x3b1d9d[_0x567635(0x2a4)]=_0x7b7b7f[_0x567635(0x234)](_0x3b1d9d['next'])),_0x3b1d9d[_0x567635(0x25a)]?.['next']&&_0x7b7b7f[_0x567635(0x255)](_0x3b1d9d['timeout'][_0x567635(0x2a4)])&&(_0x3b1d9d[_0x567635(0x25a)][_0x567635(0x2a4)]=_0x7b7b7f[_0x567635(0x234)](_0x3b1d9d['timeout'][_0x567635(0x2a4)]));}}function convertApiStageToYaml(_0x656b02){const _0x453cb2=a108_0x1761,_0x2b5120={'name':_0x656b02['name']};_0x656b02['id']&&(_0x2b5120['id']=_0x656b02['id']);_0x656b02[_0x453cb2(0x1e1)]&&(_0x2b5120[_0x453cb2(0x1e1)]=_0x656b02[_0x453cb2(0x1e1)]);_0x656b02['entryCriteria']&&(_0x2b5120['entry_criteria']=convertApiCriteriaToYaml(_0x656b02[_0x453cb2(0x279)]));_0x656b02[_0x453cb2(0x293)]&&_0x656b02['exitCriterias'][_0x453cb2(0x277)]>0x0&&(_0x2b5120[_0x453cb2(0x29a)]=_0x656b02['exitCriterias'][_0x453cb2(0x20e)](convertApiCriteriaToYaml));_0x656b02[_0x453cb2(0x296)]&&(_0x2b5120[_0x453cb2(0x296)]=convertApiCriteriaToYaml(_0x656b02['milestone']));if(_0x656b02[_0x453cb2(0x205)]&&Object[_0x453cb2(0x26e)](_0x656b02['steps'])[_0x453cb2(0x277)]>0x0){const _0x2b4627=orderStepsFromRoot(_0x656b02[_0x453cb2(0x205)],_0x656b02[_0x453cb2(0x28d)]),_0x4d6acc=new Map(),_0x524e11=new Set();for(let _0x1a7699=0x0;_0x1a7699<_0x2b4627[_0x453cb2(0x277)];_0x1a7699++){const {uuid:_0x30246a,step:_0x442a11}=_0x2b4627[_0x1a7699];let _0x580a48=generateReadableStepName(_0x442a11,_0x1a7699),_0xd67ce0=_0x580a48,_0x31dc53=0x2;while(_0x524e11[_0x453cb2(0x255)](_0xd67ce0)){_0xd67ce0=_0x580a48+'_'+_0x31dc53,_0x31dc53++;}_0x524e11[_0x453cb2(0x28e)](_0xd67ce0),_0x4d6acc['set'](_0x30246a,_0xd67ce0);}_0x2b5120[_0x453cb2(0x205)]=_0x2b4627[_0x453cb2(0x20e)](({uuid:_0xb48b33,step:_0x56b8f9},_0x30dbde)=>{const _0x2cb0df=convertApiStepToYaml(_0x56b8f9,_0x4d6acc['get'](_0xb48b33));return resolveStepReferences(_0x2cb0df,_0x30dbde,_0x2b4627,_0x4d6acc),_0x2cb0df;});}return _0x2b5120;}function convertApiCriteriaToYaml(_0x2cb88c){const _0x2f885d=a108_0x1761,_0xc6e37a={'name':_0x2cb88c['name'],'segment':_0x2cb88c[_0x2f885d(0x224)]};_0x2cb88c[_0x2f885d(0x1e1)]&&(_0xc6e37a['description']=_0x2cb88c[_0x2f885d(0x1e1)]);if(_0x2cb88c['target']){let _0x254013=_0x2cb88c[_0x2f885d(0x1e9)][_0x2f885d(0x239)],_0x4f878f=_0x2cb88c[_0x2f885d(0x1e9)]['journeyStageId'];if(_0x2cb88c[_0x2f885d(0x1e9)][_0x2f885d(0x28c)]){const _0x3e4b8c=parseJumpTargetDisplayName(_0x2cb88c[_0x2f885d(0x1e9)]['journeyName']);_0x3e4b8c&&(_0x4f878f=_0x3e4b8c['stageName'],_0x254013=_0x3e4b8c[_0x2f885d(0x28c)]);}_0xc6e37a[_0x2f885d(0x1e9)]={'journey':_0x254013,'stage':_0x4f878f},_0x2cb88c[_0x2f885d(0x1e9)]['journeyBundleId']&&(_0xc6e37a[_0x2f885d(0x1e9)]['bundle_id']=_0x2cb88c[_0x2f885d(0x1e9)]['journeyBundleId']);}return _0xc6e37a;}function convertApiStepToYaml(_0x2e65cc,_0x4efd4e){const _0x3d055b=a108_0x1761;switch(_0x2e65cc[_0x3d055b(0x213)]){case _0x3d055b(0x1f9):{const _0x309391={};if(_0x2e65cc[_0x3d055b(0x2a7)]==='Duration'&&_0x2e65cc[_0x3d055b(0x29b)]!==undefined)_0x309391[_0x3d055b(0x241)]=_0x2e65cc[_0x3d055b(0x29b)],_0x309391[_0x3d055b(0x1e4)]=_0x2e65cc[_0x3d055b(0x258)];else{if(_0x2e65cc['waitStepType']===_0x3d055b(0x223)&&_0x2e65cc[_0x3d055b(0x204)])_0x309391[_0x3d055b(0x265)]=_0x2e65cc['waitUntilDate'];else{if(_0x2e65cc['waitStepType']==='DaysOfTheWeek'&&_0x2e65cc[_0x3d055b(0x1ed)])_0x309391[_0x3d055b(0x299)]=_0x2e65cc[_0x3d055b(0x1ed)];else{if(_0x2e65cc[_0x3d055b(0x2a7)]===_0x3d055b(0x268)){if(_0x2e65cc[_0x3d055b(0x2a0)]&&_0x2e65cc['conditions']['length']>0x0){const _0x3e31fb=_0x2e65cc['conditions'][_0x3d055b(0x273)](_0x1ca8b3=>!_0x1ca8b3[_0x3d055b(0x209)]),_0xb4cc1c=_0x2e65cc[_0x3d055b(0x2a0)][_0x3d055b(0x273)](_0x255996=>_0x255996[_0x3d055b(0x209)]);_0x3e31fb?.[_0x3d055b(0x224)]&&(_0x309391[_0x3d055b(0x236)]={'segment':_0x3e31fb['segmentId'],..._0x3e31fb[_0x3d055b(0x2a4)]?{'next':_0x3e31fb[_0x3d055b(0x2a4)]}:{}},_0xb4cc1c&&_0xb4cc1c[_0x3d055b(0x24f)]!==undefined&&_0xb4cc1c['unit']&&(_0x309391[_0x3d055b(0x236)]['timeout']={'duration':_0xb4cc1c[_0x3d055b(0x24f)],'unit':_0xb4cc1c[_0x3d055b(0x1e4)],..._0xb4cc1c[_0x3d055b(0x2a4)]?{'next':_0xb4cc1c[_0x3d055b(0x2a4)]}:{}}));}else _0x2e65cc['conditionSegmentId']&&(_0x309391[_0x3d055b(0x236)]={'segment':_0x2e65cc[_0x3d055b(0x1de)]},_0x2e65cc[_0x3d055b(0x1fc)]!==undefined&&_0x2e65cc[_0x3d055b(0x22b)]&&(_0x309391['condition'][_0x3d055b(0x25a)]={'duration':_0x2e65cc['conditionTimeoutDuration'],'unit':_0x2e65cc['conditionTimeoutUnit']}));}}}}const _0x431ade={'type':_0x3d055b(0x269),'name':_0x4efd4e,..._0x2e65cc['next']?{'next':_0x2e65cc['next']}:{},'with':_0x309391};return _0x431ade;}case _0x3d055b(0x23b):{const _0x2d8044={'type':_0x3d055b(0x28a),'name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc[_0x3d055b(0x2a4)]}:{},'with':{'activation':_0x2e65cc[_0x3d055b(0x23a)]||''}};return _0x2d8044;}case _0x3d055b(0x294):{const _0x28128f={'type':'decision_point','name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc['next']}:{},'with':{'branches':(_0x2e65cc[_0x3d055b(0x1e7)]||[])['map'](_0x4e0ee0=>({'name':_0x4e0ee0[_0x3d055b(0x26f)],'segment':_0x4e0ee0[_0x3d055b(0x224)],'excluded':_0x4e0ee0[_0x3d055b(0x266)],..._0x4e0ee0[_0x3d055b(0x2a4)]?{'next':_0x4e0ee0[_0x3d055b(0x2a4)]}:{}}))}};return _0x28128f;}case'ABTest':case _0x3d055b(0x26a):case _0x3d055b(0x22f):{const _0x1510e8=_0x2e65cc[_0x3d055b(0x254)]||(_0x2e65cc[_0x3d055b(0x1e7)]||[])[_0x3d055b(0x20e)](_0x2aa6a0=>({'name':_0x2aa6a0[_0x3d055b(0x26f)],'percentage':0x0,'next':_0x2aa6a0['next']})),_0x248856={'type':'ab_test','name':_0x4efd4e,..._0x2e65cc['next']?{'next':_0x2e65cc[_0x3d055b(0x2a4)]}:{},'with':{'customized_split':_0x2e65cc[_0x3d055b(0x217)],'unique_id':_0x2e65cc['uniqueId'],'variants':_0x1510e8[_0x3d055b(0x20e)](_0x390e1e=>({'name':_0x390e1e[_0x3d055b(0x26f)],'percentage':_0x390e1e[_0x3d055b(0x1fa)],..._0x390e1e[_0x3d055b(0x2a4)]?{'next':_0x390e1e[_0x3d055b(0x2a4)]}:{}}))}};return _0x248856;}case _0x3d055b(0x23e):{const _0x5f4c5c={'type':_0x3d055b(0x207),'name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc[_0x3d055b(0x2a4)]}:{}};return _0x5f4c5c;}case _0x3d055b(0x25d):{if(!_0x2e65cc[_0x3d055b(0x1e9)])throw new SDKError(ErrorCode[_0x3d055b(0x225)],_0x3d055b(0x20d)+(_0x2e65cc[_0x3d055b(0x26f)]||_0x4efd4e)+'\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)');let _0x5195c4=_0x2e65cc[_0x3d055b(0x1e9)][_0x3d055b(0x239)],_0x4bf8ba=_0x2e65cc[_0x3d055b(0x1e9)][_0x3d055b(0x1dd)];if(_0x2e65cc[_0x3d055b(0x1e9)]['journeyName']){const _0x3d4fff=parseJumpTargetDisplayName(_0x2e65cc[_0x3d055b(0x1e9)][_0x3d055b(0x28c)]);_0x3d4fff&&(_0x4bf8ba=_0x3d4fff[_0x3d055b(0x208)],_0x5195c4=_0x3d4fff[_0x3d055b(0x28c)]);}const _0x5856d4={'type':_0x3d055b(0x20c),'name':_0x4efd4e,..._0x2e65cc[_0x3d055b(0x2a4)]?{'next':_0x2e65cc['next']}:{},'with':{'target':{'journey':_0x5195c4,'stage':_0x4bf8ba,'bundle_id':_0x2e65cc[_0x3d055b(0x1e9)]['journeyBundleId']}}};return _0x5856d4;}case'End':{const _0x2a0471={'type':_0x3d055b(0x218),'name':_0x4efd4e};return _0x2a0471;}default:{const _0x1d2f09={'type':_0x3d055b(0x218),'name':_0x4efd4e};return _0x1d2f09;}}}export async function journeyDefToRequest(_0x5ca343,_0x1d42f8,_0x67dc0a){const _0x1ce9b9=a108_0x1761,_0x1d67c7=_0x5ca343[_0x1ce9b9(0x267)]||getActiveStages(_0x5ca343),_0x25f079=_0x5ca343[_0x1ce9b9(0x283)]||{},_0x46a9ea=_0x5ca343['activations']||{},_0x486207={'type':'journey','attributes':{'name':_0x5ca343[_0x1ce9b9(0x26f)],'audienceId':_0x1d42f8,'journeyStages':await Promise[_0x1ce9b9(0x212)](_0x1d67c7[_0x1ce9b9(0x20e)](_0xa51b98=>convertYamlStageToApi(_0xa51b98,_0x67dc0a,_0x25f079,_0x46a9ea)))}};_0x5ca343['id']&&(_0x486207['id']=_0x5ca343['id']);_0x5ca343[_0x1ce9b9(0x1e1)]&&(_0x486207['attributes']['description']=_0x5ca343[_0x1ce9b9(0x1e1)]);const _0x4c34e8=getEffectiveGoal(_0x5ca343);_0x4c34e8&&(_0x486207[_0x1ce9b9(0x1f1)][_0x1ce9b9(0x290)]=await convertYamlCriteriaToApi(_0x4c34e8,_0x67dc0a,_0x25f079));const _0x172a71=getEffectiveReentry(_0x5ca343);return _0x172a71&&(_0x486207[_0x1ce9b9(0x1f1)][_0x1ce9b9(0x238)]=_0x172a71,_0x486207[_0x1ce9b9(0x1f1)]['allowReentry']=_0x172a71!==_0x1ce9b9(0x245)),_0x5ca343[_0x1ce9b9(0x270)]&&(_0x486207['relationships']={'parentFolder':{'data':{'id':_0x5ca343[_0x1ce9b9(0x270)],'type':'folder'}}}),_0x486207;}async function convertYamlStageToApi(_0x16bf1b,_0x156c13,_0xce93d9={},_0x5e1d2c={}){const _0x1af793=a108_0x1761,_0xb0a082={'name':_0x16bf1b[_0x1af793(0x26f)]};_0x16bf1b['id']&&(_0xb0a082['id']=_0x16bf1b['id']);_0x16bf1b[_0x1af793(0x1e1)]&&(_0xb0a082[_0x1af793(0x1e1)]=_0x16bf1b[_0x1af793(0x1e1)]);_0x16bf1b[_0x1af793(0x221)]&&(_0xb0a082[_0x1af793(0x279)]=await convertYamlCriteriaToApi(_0x16bf1b[_0x1af793(0x221)],_0x156c13,_0xce93d9));_0x16bf1b['exit_criteria']&&_0x16bf1b[_0x1af793(0x29a)][_0x1af793(0x277)]>0x0&&(_0xb0a082[_0x1af793(0x293)]=await Promise[_0x1af793(0x212)](_0x16bf1b['exit_criteria'][_0x1af793(0x20e)](_0x4ed53d=>convertYamlCriteriaToApi(_0x4ed53d,_0x156c13,_0xce93d9))));_0x16bf1b[_0x1af793(0x296)]&&(_0xb0a082['milestone']=await convertYamlCriteriaToApi(_0x16bf1b[_0x1af793(0x296)],_0x156c13,_0xce93d9));if(_0x16bf1b[_0x1af793(0x205)]&&_0x16bf1b['steps']['length']>0x0){const _0x280edb={},_0x3d42ee=_0x16bf1b[_0x1af793(0x205)][_0x1af793(0x20e)]((_0x28b29b,_0x1a0188)=>{const _0x490b20=_0x1af793,_0x5cf8ad=_0x28b29b[_0x490b20(0x222)]||generateUUID(),_0x9d9030=_0x28b29b[_0x490b20(0x26f)]||_0x28b29b[_0x490b20(0x213)]+'_'+_0x1a0188;return _0x280edb[_0x9d9030]=_0x5cf8ad,{..._0x28b29b,'name':_0x9d9030};});_0xb0a082[_0x1af793(0x28d)]=_0x280edb[_0x3d42ee[0x0]['name']],_0xb0a082[_0x1af793(0x205)]={};for(let _0x2a5a01=0x0;_0x2a5a01<_0x3d42ee['length'];_0x2a5a01++){const _0x1d6423=_0x3d42ee[_0x2a5a01],_0x4e872a=_0x280edb[_0x1d6423[_0x1af793(0x26f)]],_0x8f6029=!_0x1d6423['next']&&_0x2a5a01<_0x3d42ee[_0x1af793(0x277)]-0x1&&_0x1d6423['type']!=='end'?_0x3d42ee[_0x2a5a01+0x1]['name']:_0x1d6423['next'],_0x33abd3=_0x8f6029!==_0x1d6423[_0x1af793(0x2a4)]?{..._0x1d6423,'next':_0x8f6029}:_0x1d6423;_0xb0a082[_0x1af793(0x205)][_0x4e872a]=await convertYamlStepToApi(_0x33abd3,_0x156c13,_0xce93d9,_0x280edb,_0x5e1d2c);}}else _0x16bf1b[_0x1af793(0x1e8)]&&(_0xb0a082[_0x1af793(0x28d)]=_0x16bf1b[_0x1af793(0x1e8)]);return _0xb0a082;}async function convertYamlCriteriaToApi(_0x2de238,_0x278f62,_0x2d892c={}){const _0x23eac7=a108_0x1761;let _0x3b7222=_0x2de238[_0x23eac7(0x29f)];if(_0x3b7222&&!/^\d+$/[_0x23eac7(0x261)](_0x3b7222)){const _0x204f57=parseSegmentRef(_0x3b7222);if(_0x204f57[_0x23eac7(0x213)]===_0x23eac7(0x24a))_0x278f62?.[_0x23eac7(0x27b)]&&(_0x3b7222=await _0x278f62[_0x23eac7(0x27b)](_0x204f57[_0x23eac7(0x26f)]));else{if(_0x204f57[_0x23eac7(0x213)]===_0x23eac7(0x210)&&_0x2d892c[_0x204f57[_0x23eac7(0x26f)]])_0x278f62?.[_0x23eac7(0x280)]&&(_0x3b7222=await _0x278f62['resolveEmbeddedSegmentId'](_0x204f57[_0x23eac7(0x26f)],_0x2d892c[_0x204f57[_0x23eac7(0x26f)]]));else _0x278f62?.[_0x23eac7(0x27b)]&&(_0x3b7222=await _0x278f62[_0x23eac7(0x27b)](_0x204f57['name']));}}const _0x429d7e={'name':_0x2de238[_0x23eac7(0x26f)],'segmentId':_0x3b7222};_0x2de238[_0x23eac7(0x1e1)]&&(_0x429d7e['description']=_0x2de238[_0x23eac7(0x1e1)]);if(_0x2de238[_0x23eac7(0x1e9)]){const _0xe27e69=_0x2de238[_0x23eac7(0x1e9)][_0x23eac7(0x244)],_0x280393=_0x2de238[_0x23eac7(0x1e9)]['stage'];let _0x5573da=_0x2de238[_0x23eac7(0x1e9)]['journey'];_0x278f62?.[_0x23eac7(0x227)]&&!/^\d+$/['test'](_0x5573da)&&(_0x5573da=await _0x278f62[_0x23eac7(0x227)](_0x5573da));let _0x254d70=_0x2de238[_0x23eac7(0x1e9)][_0x23eac7(0x240)];_0x278f62?.['resolveStageId']&&!/^\d+$/[_0x23eac7(0x261)](_0x254d70)&&(_0x254d70=await _0x278f62[_0x23eac7(0x22e)](_0x5573da,_0x254d70));const _0x2f6e54=!/^\d+$/[_0x23eac7(0x261)](_0xe27e69)&&!isLocalJourneyRef(_0xe27e69)?formatApiJourneyName(_0xe27e69,_0x280393):undefined;_0x429d7e[_0x23eac7(0x1e9)]={'journeyId':_0x5573da,'journeyStageId':_0x254d70,'journeyName':_0x2f6e54,'confirmed':!![]},_0x2de238['target'][_0x23eac7(0x1ff)]&&(_0x429d7e['target'][_0x23eac7(0x243)]=_0x2de238[_0x23eac7(0x1e9)][_0x23eac7(0x1ff)]);}return _0x429d7e;}async function convertYamlStepToApi(_0x2111ad,_0x4b848f,_0x4fe827={},_0x13a55c={},_0x56507e={}){const _0x24fc24=a108_0x1761,_0x5c208b=async _0x34ee5b=>{const _0x2bd58f=a108_0x1761;if(/^\d+$/[_0x2bd58f(0x261)](_0x34ee5b))return _0x34ee5b;const _0xde3852=parseSegmentRef(_0x34ee5b);if(_0xde3852[_0x2bd58f(0x213)]==='ref'){if(_0x4b848f?.['resolveSegmentId'])return await _0x4b848f[_0x2bd58f(0x27b)](_0xde3852['name']);}else{if(_0xde3852[_0x2bd58f(0x213)]==='embedded'&&_0x4fe827[_0xde3852[_0x2bd58f(0x26f)]]){if(_0x4b848f?.['resolveEmbeddedSegmentId'])return await _0x4b848f[_0x2bd58f(0x280)](_0xde3852[_0x2bd58f(0x26f)],_0x4fe827[_0xde3852[_0x2bd58f(0x26f)]]);}else{if(_0x4b848f?.['resolveSegmentId'])return await _0x4b848f[_0x2bd58f(0x27b)](_0xde3852[_0x2bd58f(0x26f)]);}}return _0x34ee5b;},_0x20194b=async _0x153cfb=>{const _0x295536=a108_0x1761;if(/^\d+$/[_0x295536(0x261)](_0x153cfb))return _0x153cfb;const _0x382289=parseSegmentRef(_0x153cfb);if(_0x382289[_0x295536(0x213)]===_0x295536(0x24a)){if(_0x4b848f?.[_0x295536(0x253)])return await _0x4b848f[_0x295536(0x253)](_0x382289[_0x295536(0x26f)]);return _0x382289[_0x295536(0x26f)];}else{if(_0x382289[_0x295536(0x213)]===_0x295536(0x210)&&_0x56507e[_0x382289[_0x295536(0x26f)]]){if(_0x4b848f?.['resolveEmbeddedActivationId'])return await _0x4b848f['resolveEmbeddedActivationId'](_0x382289[_0x295536(0x26f)],_0x56507e[_0x382289[_0x295536(0x26f)]]);if(_0x4b848f?.[_0x295536(0x253)])return await _0x4b848f['resolveActivationId'](_0x382289[_0x295536(0x26f)]);}else{if(_0x4b848f?.[_0x295536(0x253)])return await _0x4b848f[_0x295536(0x253)](_0x382289[_0x295536(0x26f)]);}}return _0x153cfb;},_0x611c98=_0x9a430a=>{const _0x440974=a108_0x1761;if(!_0x9a430a)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x440974(0x261)](_0x9a430a))return _0x9a430a;return _0x13a55c[_0x9a430a]||_0x9a430a;};switch(_0x2111ad[_0x24fc24(0x213)]){case'wait':{const _0x2a8b67=_0x2111ad,_0x5bf72c=_0x2a8b67[_0x24fc24(0x249)],_0x1c1a83={'type':_0x24fc24(0x1f9),'name':_0x2a8b67[_0x24fc24(0x26f)],'next':_0x611c98(_0x2a8b67[_0x24fc24(0x2a4)])};if(_0x5bf72c[_0x24fc24(0x241)]!==undefined&&_0x5bf72c[_0x24fc24(0x1e4)])_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x263),_0x1c1a83[_0x24fc24(0x29b)]=_0x5bf72c[_0x24fc24(0x241)],_0x1c1a83[_0x24fc24(0x258)]=normalizeWaitUnit(_0x5bf72c[_0x24fc24(0x1e4)]);else{if(_0x5bf72c[_0x24fc24(0x265)])_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x223),_0x1c1a83[_0x24fc24(0x204)]=_0x5bf72c[_0x24fc24(0x265)];else{if(_0x5bf72c[_0x24fc24(0x299)])_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x252),_0x1c1a83['daysOfWeek']=_0x5bf72c[_0x24fc24(0x299)];else{if(_0x5bf72c['condition']){_0x1c1a83[_0x24fc24(0x2a7)]=_0x24fc24(0x268);const _0x21af2f=await _0x5c208b(_0x5bf72c[_0x24fc24(0x236)]['segment']),_0x3e3a33=_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]?.[_0x24fc24(0x2a4)]!==undefined;if(_0x3e3a33){const _0x13a9a1=[];_0x13a9a1['push']({'id':generateUUID(),'segmentId':_0x21af2f,'timedOutPath':![],'next':_0x611c98(_0x5bf72c['condition'][_0x24fc24(0x2a4)]??_0x2a8b67[_0x24fc24(0x2a4)])}),_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]&&_0x13a9a1[_0x24fc24(0x211)]({'id':generateUUID(),'timedOutPath':!![],'moveAfter':_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)][_0x24fc24(0x241)],'unit':normalizeWaitUnit(_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)][_0x24fc24(0x1e4)]),'next':_0x611c98(_0x5bf72c['condition'][_0x24fc24(0x25a)]['next'])}),_0x1c1a83[_0x24fc24(0x2a0)]=_0x13a9a1;}else _0x1c1a83['conditionSegmentId']=_0x21af2f,_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]&&(_0x1c1a83['conditionTimeoutDuration']=_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)]['duration'],_0x5bf72c['condition']['timeout']['unit']&&(_0x1c1a83[_0x24fc24(0x22b)]=normalizeWaitUnit(_0x5bf72c[_0x24fc24(0x236)][_0x24fc24(0x25a)][_0x24fc24(0x1e4)])));}}}}return _0x1c1a83;}case'activation':{const _0x5de9f1=_0x2111ad,_0x2cf9d1=_0x5de9f1[_0x24fc24(0x249)][_0x24fc24(0x28a)],_0x149c13=await _0x20194b(_0x2cf9d1);return{'type':_0x24fc24(0x23b),'name':_0x5de9f1['name'],'journeyActivationStepId':_0x149c13,'next':_0x611c98(_0x5de9f1['next'])};}case _0x24fc24(0x284):{const _0x1211e3=_0x2111ad,_0x5165b4=_0x1211e3[_0x24fc24(0x249)][_0x24fc24(0x1e7)];return{'type':'DecisionPoint','name':_0x1211e3[_0x24fc24(0x26f)],'branches':await Promise['all'](_0x5165b4[_0x24fc24(0x20e)](async _0x40d6a7=>{const _0x374f80=_0x24fc24;let _0xef308='';if(!_0x40d6a7[_0x374f80(0x26c)]){const _0x58a411=_0x40d6a7[_0x374f80(0x29f)]||_0x40d6a7[_0x374f80(0x25c)]||'';_0xef308=_0x58a411?await _0x5c208b(_0x58a411):'';}return{'id':crypto[_0x374f80(0x26d)](),'name':_0x40d6a7['name'],'description':null,'segmentId':_0xef308,'excludedPath':_0x40d6a7[_0x374f80(0x26c)]??![],'next':_0x611c98(_0x40d6a7[_0x374f80(0x2a4)])};})),'next':_0x611c98(_0x1211e3[_0x24fc24(0x2a4)])};}case _0x24fc24(0x24c):{const _0x3ba4c5=_0x2111ad,_0x46847b=_0x3ba4c5[_0x24fc24(0x249)];return{'type':_0x24fc24(0x24d),'name':_0x3ba4c5[_0x24fc24(0x26f)],'customizedSplit':_0x46847b[_0x24fc24(0x233)],'uniqueId':_0x46847b[_0x24fc24(0x248)],'variants':_0x46847b['variants'][_0x24fc24(0x20e)](_0x297de6=>({'id':_0x297de6['id']||generateUUID(),'name':_0x297de6[_0x24fc24(0x26f)],'percentage':_0x297de6['percentage'],'next':_0x611c98(_0x297de6['next'])})),'next':_0x611c98(_0x3ba4c5[_0x24fc24(0x2a4)])};}case'merge':return{'type':'Merge','name':_0x2111ad[_0x24fc24(0x26f)],'next':_0x611c98(_0x2111ad[_0x24fc24(0x2a4)])};case _0x24fc24(0x20c):{const _0x12eb26=_0x2111ad,_0xe35cc6=_0x12eb26[_0x24fc24(0x249)][_0x24fc24(0x1e9)],_0x294e3a=_0xe35cc6[_0x24fc24(0x244)],_0x5421ff=_0xe35cc6[_0x24fc24(0x240)];let _0xb4b9cc=_0xe35cc6[_0x24fc24(0x244)];_0x4b848f?.[_0x24fc24(0x227)]&&!/^\d+$/[_0x24fc24(0x261)](_0xb4b9cc)&&(_0xb4b9cc=await _0x4b848f['resolveJourneyId'](_0xb4b9cc));let _0x21799c=_0xe35cc6['stage'];_0x4b848f?.['resolveStageId']&&!/^\d+$/[_0x24fc24(0x261)](_0x21799c)&&(_0x21799c=await _0x4b848f[_0x24fc24(0x22e)](_0xb4b9cc,_0x21799c));const _0x259b77=!/^\d+$/['test'](_0x294e3a)&&!isLocalJourneyRef(_0x294e3a)?formatApiJourneyName(_0x294e3a,_0x5421ff):undefined;return{'type':_0x24fc24(0x25d),'name':_0x12eb26[_0x24fc24(0x26f)],'target':{'journeyId':_0xb4b9cc,'journeyStageId':_0x21799c,'journeyBundleId':_0xe35cc6[_0x24fc24(0x1ff)],'journeyName':_0x259b77,'confirmed':!![]},'next':_0x611c98(_0x12eb26[_0x24fc24(0x2a4)])};}case _0x24fc24(0x218):return{'type':_0x24fc24(0x1db),'name':_0x2111ad[_0x24fc24(0x26f)]};default:{const _0x1ee71c=_0x2111ad;return{'type':_0x24fc24(0x1db),'name':_0x1ee71c[_0x24fc24(0x26f)]};}}}export function toYamlString(_0x178c09){const _0x43aa4e=a108_0x1761,_0x28d172=stripInternalFields(_0x178c09),_0x2ad25a=a108_0x30dc56['stringify'](_0x28d172,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x43aa4e(0x1df)}),_0x31c199=[_0x43aa4e(0x250),_0x43aa4e(0x22a),_0x43aa4e(0x21a),_0x43aa4e(0x28f),_0x43aa4e(0x242),_0x43aa4e(0x235),_0x43aa4e(0x260)];let _0x6dc54f=_0x2ad25a;for(const _0x2ebe0c of _0x31c199){_0x6dc54f=_0x6dc54f[_0x43aa4e(0x257)](new RegExp('^('+_0x2ebe0c+')','m'),(_0x8dc42,_0x206f1c,_0x397ca0)=>{if(_0x397ca0===0x0||_0x6dc54f[_0x397ca0-0x1]==='\x0a'&&_0x6dc54f[_0x397ca0-0x2]==='\x0a')return _0x206f1c;return'\x0a'+_0x206f1c;});}return _0x6dc54f;}function stripInternalFields(_0xf0f084){const _0x43fac1=a108_0x1761,{id:_0x598e92,folder_id:_0x2ef656,bundle_id:_0x188e18,bundle_name:_0x3297e5,version:_0x36cbe4,version_number:_0x366724,allow_reentry:_0x42dd62,..._0x5c636a}=_0xf0f084;return _0x5c636a['journeys']&&(_0x5c636a[_0x43fac1(0x247)]=_0x5c636a[_0x43fac1(0x247)][_0x43fac1(0x20e)](_0x3aa0ee=>{const _0x2b6802=_0x43fac1,{id:_0x30d5bb,version_number:_0x2af31f,..._0x2b47a3}=_0x3aa0ee;return{..._0x2b47a3,'stages':_0x2b47a3[_0x2b6802(0x267)][_0x2b6802(0x20e)](stripStageInternalFields),..._0x3aa0ee[_0x2b6802(0x1fb)]===!![]?{'latest':!![]}:{},..._0x5c636a[_0x2b6802(0x247)][_0x2b6802(0x277)]===0x1&&_0x2b47a3['version']==='v1'?{'version':undefined}:{}};})),_0x5c636a['stages']&&(_0x5c636a['stages']=_0x5c636a[_0x43fac1(0x267)][_0x43fac1(0x20e)](stripStageInternalFields)),_0x5c636a[_0x43fac1(0x237)]&&(_0x5c636a[_0x43fac1(0x237)]=_0x5c636a['versions']['map'](_0x4a7220=>{const _0xc7f05a=_0x43fac1,{id:_0x114d17,version_number:_0xee4ef8,..._0x5d854a}=_0x4a7220;return{..._0x5d854a,'stages':_0x5d854a['stages'][_0xc7f05a(0x20e)](stripStageInternalFields),..._0x4a7220[_0xc7f05a(0x1fb)]===!![]?{'latest':!![]}:{}};})),_0x5c636a;}function stripStageInternalFields(_0x4139f8){const {id:_0x2dc784,..._0x43dd82}=_0x4139f8;return _0x43dd82;}export function parseYamlString(_0x53c353){const _0x34b026=a108_0x1761,_0x21b4d7=a108_0x30dc56[_0x34b026(0x2a2)](_0x53c353);if(_0x21b4d7[_0x34b026(0x213)]!==_0x34b026(0x244))throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x276));if(!_0x21b4d7[_0x34b026(0x26f)])throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20missing\x20required\x20field:\x20name');const _0x37419c=_0x21b4d7[_0x34b026(0x247)]&&Array[_0x34b026(0x289)](_0x21b4d7['journeys'])&&_0x21b4d7[_0x34b026(0x247)][_0x34b026(0x277)]>0x0,_0x1e1993=_0x21b4d7[_0x34b026(0x267)]&&Array['isArray'](_0x21b4d7[_0x34b026(0x267)])&&_0x21b4d7['stages']['length']>0x0,_0x1fa252=_0x21b4d7[_0x34b026(0x237)]&&Array['isArray'](_0x21b4d7[_0x34b026(0x237)])&&_0x21b4d7['versions'][_0x34b026(0x277)]>0x0,_0x508788=[_0x37419c,_0x1e1993,_0x1fa252]['filter'](Boolean)['length'];if(_0x508788>0x1)throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x1e3));if(_0x508788===0x0)throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x286));if(_0x37419c){for(let _0x32ffdb=0x0;_0x32ffdb<_0x21b4d7[_0x34b026(0x247)][_0x34b026(0x277)];_0x32ffdb++){const _0xc785f2=_0x21b4d7[_0x34b026(0x247)][_0x32ffdb];if(!_0xc785f2[_0x34b026(0x267)]||!Array[_0x34b026(0x289)](_0xc785f2['stages'])||_0xc785f2[_0x34b026(0x267)][_0x34b026(0x277)]===0x0)throw new SDKError(ErrorCode[_0x34b026(0x225)],_0x34b026(0x200)+_0x32ffdb+']\x20missing\x20required\x20field:\x20stages');if(_0xc785f2[_0x34b026(0x259)]&&!['draft',_0x34b026(0x1f2)][_0x34b026(0x203)](_0xc785f2[_0x34b026(0x259)]))throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20journeys['+_0x32ffdb+_0x34b026(0x230)+_0xc785f2[_0x34b026(0x259)]+_0x34b026(0x21b));validateStages(_0xc785f2[_0x34b026(0x267)],'journeys['+_0x32ffdb+_0x34b026(0x295));}const _0x540264=_0x21b4d7[_0x34b026(0x247)][_0x34b026(0x25e)](_0x4f821b=>_0x4f821b[_0x34b026(0x1fb)]===!![])[_0x34b026(0x277)];if(_0x540264>0x1)throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true');}_0x1e1993&&validateStages(_0x21b4d7[_0x34b026(0x267)],_0x34b026(0x267));if(_0x1fa252){for(let _0x2aa3a9=0x0;_0x2aa3a9<_0x21b4d7['versions'][_0x34b026(0x277)];_0x2aa3a9++){const _0x72bc0b=_0x21b4d7[_0x34b026(0x237)][_0x2aa3a9];if(!_0x72bc0b[_0x34b026(0x26f)])throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20versions['+_0x2aa3a9+_0x34b026(0x23f));if(!_0x72bc0b[_0x34b026(0x259)]||!['draft',_0x34b026(0x1f2)][_0x34b026(0x203)](_0x72bc0b[_0x34b026(0x259)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x34b026(0x1f5)+_0x2aa3a9+']\x20has\x20invalid\x20state:\x20'+_0x72bc0b[_0x34b026(0x259)]+'.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.');if(!_0x72bc0b['stages']||!Array[_0x34b026(0x289)](_0x72bc0b['stages'])||_0x72bc0b[_0x34b026(0x267)][_0x34b026(0x277)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x34b026(0x1f5)+_0x2aa3a9+_0x34b026(0x1ec));validateStages(_0x72bc0b[_0x34b026(0x267)],_0x34b026(0x1ef)+_0x2aa3a9+_0x34b026(0x295));}const _0x46ae69=_0x21b4d7[_0x34b026(0x237)][_0x34b026(0x25e)](_0x1f93c1=>_0x1f93c1[_0x34b026(0x1fb)]===!![])['length'];if(_0x46ae69>0x1)throw new SDKError(ErrorCode[_0x34b026(0x225)],'Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true');}return _0x21b4d7;}function validateStages(_0x456578,_0x3961f5){const _0x319966=a108_0x1761;if(_0x456578[_0x319966(0x277)]>0x8)throw new SDKError(ErrorCode[_0x319966(0x225)],_0x319966(0x219)+_0x3961f5+_0x319966(0x251));}export function isJourneyDef(_0x172c33){const _0x18e2fc=a108_0x1761;return typeof _0x172c33===_0x18e2fc(0x24b)&&_0x172c33!==null&&_0x18e2fc(0x213)in _0x172c33&&_0x172c33[_0x18e2fc(0x213)]===_0x18e2fc(0x244);}export function generateTemplate(_0x4984ca,_0x6f979b){const _0x2c323c=a108_0x1761,_0xc53464={'type':_0x2c323c(0x244),'name':_0x4984ca,'description':'Journey\x20description','reentry':_0x2c323c(0x245),'goal':{'name':'Goal\x20Achieved','segment':'goal-segment'},'stages':[{'name':_0x2c323c(0x220),'description':_0x2c323c(0x23c),'entry_criteria':{'name':_0x2c323c(0x228),'segment':_0x6f979b},'steps':[{'type':'wait','name':_0x2c323c(0x1ee),'with':{'duration':0x1,'unit':_0x2c323c(0x27d)}},{'type':'activation','name':_0x2c323c(0x1ea),'with':{'activation':_0x2c323c(0x1f8)}},{'type':_0x2c323c(0x218),'name':_0x2c323c(0x229)}]}]};return toYamlString(_0xc53464);}function generateUUID(){const _0x33f8c2=a108_0x1761;return crypto[_0x33f8c2(0x26d)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x3aa2c3){const _0x52b3e7=a108_0x1761;if(_0x3aa2c3[_0x52b3e7(0x292)](SEGMENT_REF_PREFIX))return{'type':_0x52b3e7(0x24a),'name':_0x3aa2c3[_0x52b3e7(0x1dc)](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/[_0x52b3e7(0x261)](_0x3aa2c3))return{'type':'id','name':_0x3aa2c3};return{'type':'embedded','name':_0x3aa2c3};}export function makeSegmentRef(_0x324b1c){return''+SEGMENT_REF_PREFIX+_0x324b1c;}export function isExternalSegmentRef(_0x35b576){const _0x2ea6c9=a108_0x1761;return _0x35b576[_0x2ea6c9(0x292)](SEGMENT_REF_PREFIX);}function a108_0x1761(_0x527f78,_0x46625e){_0x527f78=_0x527f78-0x1db;const _0x2744ac=a108_0x2744();let _0x17618d=_0x2744ac[_0x527f78];return _0x17618d;}export function isJourneysArrayMode(_0x572cef){const _0x12e5e9=a108_0x1761;return!!(_0x572cef[_0x12e5e9(0x247)]&&_0x572cef['journeys'][_0x12e5e9(0x277)]>0x0);}export function isMultiVersionMode(_0x28c2b3){const _0x69b680=a108_0x1761;return!!(_0x28c2b3[_0x69b680(0x237)]&&_0x28c2b3['versions'][_0x69b680(0x277)]>0x0);}export function isSingleVersionMode(_0x522631){const _0x5b12cb=a108_0x1761;return!!(_0x522631[_0x5b12cb(0x267)]&&_0x522631[_0x5b12cb(0x267)][_0x5b12cb(0x277)]>0x0);}export function hasMultipleVersions(_0x3efc99){const _0x6aba24=a108_0x1761;if(isJourneysArrayMode(_0x3efc99))return(_0x3efc99[_0x6aba24(0x247)]?.[_0x6aba24(0x277)]||0x0)>0x1;if(isMultiVersionMode(_0x3efc99))return(_0x3efc99[_0x6aba24(0x237)]?.['length']||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x3846ef){const _0x3bf57e=a108_0x1761;if(isJourneysArrayMode(_0x3846ef))return _0x3846ef;if(isSingleVersionMode(_0x3846ef)){const {stages:_0x2a9356,id:_0x13fc61,version:_0x423543,version_number:_0x15d756,..._0x5e064f}=_0x3846ef;return{..._0x5e064f,'journeys':[{'version':_0x423543||'v1','stages':_0x2a9356||[],'id':_0x13fc61,'version_number':_0x15d756}]};}if(isMultiVersionMode(_0x3846ef)){const {versions:_0x214ff8,..._0x2d0f15}=_0x3846ef;return{..._0x2d0f15,'journeys':(_0x214ff8||[])[_0x3bf57e(0x20e)](_0x52dd75=>({'version':_0x52dd75[_0x3bf57e(0x26f)],'state':_0x52dd75[_0x3bf57e(0x259)],'latest':_0x52dd75['latest'],'stages':_0x52dd75['stages'],'id':_0x52dd75['id'],'version_number':_0x52dd75[_0x3bf57e(0x1fe)]}))};}return _0x3846ef;}export function normalizeJourneyDef(_0x52cfe7,_0x485ee1){const _0x14e77c=a108_0x1761,_0x119611=normalizeToJourneysFormat(_0x52cfe7),_0x17f540=_0x485ee1?.[_0x14e77c(0x283)]?Object[_0x14e77c(0x26e)](_0x485ee1[_0x14e77c(0x283)]):undefined,_0x1907ea=_0x485ee1?.[_0x14e77c(0x1f6)]?Object[_0x14e77c(0x26e)](_0x485ee1[_0x14e77c(0x1f6)]):undefined;return{'type':_0x14e77c(0x244),'name':_0x119611[_0x14e77c(0x26f)],..._0x119611[_0x14e77c(0x1e1)]!==undefined&&{'description':_0x119611['description']},..._0x119611[_0x14e77c(0x290)]&&{'goal':normalizeJourneyCriteria(_0x119611[_0x14e77c(0x290)])},..._0x119611[_0x14e77c(0x24e)]!==undefined&&{'reentry':_0x119611[_0x14e77c(0x24e)]},..._0x119611[_0x14e77c(0x283)]&&{'segments':normalizeEmbeddedSegments(_0x119611['segments'],_0x17f540)},..._0x119611[_0x14e77c(0x1f6)]&&{'activations':normalizeEmbeddedActivations(_0x119611[_0x14e77c(0x1f6)],_0x1907ea)},..._0x119611[_0x14e77c(0x247)]&&{'journeys':_0x119611['journeys']['map'](_0x91fe1f=>normalizeJourneyEntry(_0x91fe1f,_0x119611[_0x14e77c(0x247)][_0x14e77c(0x277)]===0x1))}};}function normalizeJourneyEntry(_0x5131f6,_0x361882){const _0xbcd350=a108_0x1761;return{...!_0x361882&&_0x5131f6['version']!==undefined&&{'version':_0x5131f6[_0xbcd350(0x22c)]},..._0x5131f6[_0xbcd350(0x259)]!==undefined&&{'state':_0x5131f6['state']},...!_0x361882&&_0x5131f6[_0xbcd350(0x1fb)]!==undefined&&{'latest':_0x5131f6['latest']},..._0x5131f6[_0xbcd350(0x290)]&&{'goal':normalizeJourneyCriteria(_0x5131f6[_0xbcd350(0x290)])},..._0x5131f6[_0xbcd350(0x24e)]!==undefined&&{'reentry':_0x5131f6[_0xbcd350(0x24e)]},'stages':_0x5131f6[_0xbcd350(0x267)][_0xbcd350(0x20e)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x534269){const _0xc8b48e=a108_0x1761;return{'name':_0x534269[_0xc8b48e(0x26f)],..._0x534269['description']!==undefined&&{'description':_0x534269['description']},..._0x534269[_0xc8b48e(0x221)]&&{'entry_criteria':normalizeJourneyCriteria(_0x534269[_0xc8b48e(0x221)])},..._0x534269['exit_criteria']&&{'exit_criteria':_0x534269[_0xc8b48e(0x29a)][_0xc8b48e(0x20e)](normalizeJourneyCriteria)},..._0x534269[_0xc8b48e(0x296)]&&{'milestone':normalizeJourneyCriteria(_0x534269[_0xc8b48e(0x296)])},..._0x534269[_0xc8b48e(0x205)]&&{'steps':normalizeStepsWithImplicitNext(_0x534269[_0xc8b48e(0x205)])}};}function normalizeStepsWithImplicitNext(_0x3ea24d){const _0x54a702=a108_0x1761;return _0x3ea24d[_0x54a702(0x20e)]((_0x41eb2f,_0x3a5128)=>{const _0xb0dedd=_0x54a702,_0x3d6eb4=_0x3a5128<_0x3ea24d[_0xb0dedd(0x277)]-0x1?_0x3ea24d[_0x3a5128+0x1][_0xb0dedd(0x26f)]:undefined;return normalizeJourneyStep(_0x41eb2f,_0x3d6eb4);});}function normalizeJourneyCriteria(_0x44b163){const _0x5089cc=a108_0x1761;return{'name':_0x44b163[_0x5089cc(0x26f)],..._0x44b163['description']!==undefined&&{'description':_0x44b163['description']},'segment':_0x44b163['segment'],..._0x44b163['target']&&{'target':normalizeJumpTarget(_0x44b163[_0x5089cc(0x1e9)])}};}function normalizeJourneyStep(_0x47a69b,_0x34958f){const _0x290115=a108_0x1761,_0x1537e3=_0x47a69b['next']!==undefined&&_0x47a69b[_0x290115(0x2a4)]!==_0x34958f,_0xf2de2d={'type':_0x47a69b[_0x290115(0x213)],'name':_0x47a69b[_0x290115(0x26f)],..._0x1537e3&&{'next':_0x47a69b[_0x290115(0x2a4)]}};if(_0x290115(0x249)in _0x47a69b&&_0x47a69b[_0x290115(0x249)])return{..._0xf2de2d,'with':normalizeStepParams(_0x47a69b[_0x290115(0x213)],_0x47a69b[_0x290115(0x249)])};return _0xf2de2d;}function normalizeStepParams(_0x4bfcdf,_0x252f58){const _0xdc6632=a108_0x1761;switch(_0x4bfcdf){case _0xdc6632(0x269):{const _0x5c7084=_0x252f58;let _0x46de38;return _0x5c7084[_0xdc6632(0x236)]&&(_0x46de38={'segment':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x29f)],..._0x5c7084[_0xdc6632(0x236)]['next']!==undefined&&{'next':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x2a4)]},..._0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)]&&{'timeout':{'duration':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)][_0xdc6632(0x241)],'unit':_0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)][_0xdc6632(0x1e4)],..._0x5c7084[_0xdc6632(0x236)][_0xdc6632(0x25a)][_0xdc6632(0x2a4)]!==undefined&&{'next':_0x5c7084['condition']['timeout'][_0xdc6632(0x2a4)]}}}}),{..._0x5c7084['duration']!==undefined&&{'duration':_0x5c7084[_0xdc6632(0x241)]},..._0x5c7084[_0xdc6632(0x1e4)]!==undefined&&{'unit':_0x5c7084[_0xdc6632(0x1e4)]},..._0x5c7084[_0xdc6632(0x265)]!==undefined&&{'wait_until':_0x5c7084[_0xdc6632(0x265)]},..._0x5c7084[_0xdc6632(0x299)]!==undefined&&{'days_of_week':_0x5c7084[_0xdc6632(0x299)]},..._0x46de38&&{'condition':_0x46de38}};}case _0xdc6632(0x28a):{const _0x2813d3=_0x252f58;return{'activation':_0x2813d3[_0xdc6632(0x28a)]};}case _0xdc6632(0x284):{const _0x1f3aa3=_0x252f58;return{'branches':_0x1f3aa3[_0xdc6632(0x1e7)]['map'](normalizeDecisionBranch)};}case _0xdc6632(0x24c):{const _0x5ceb24=_0x252f58;return{..._0x5ceb24['customized_split']!==undefined&&{'customized_split':_0x5ceb24[_0xdc6632(0x233)]},..._0x5ceb24[_0xdc6632(0x248)]!==undefined&&{'unique_id':_0x5ceb24[_0xdc6632(0x248)]},'variants':_0x5ceb24[_0xdc6632(0x254)]['map'](normalizeAbTestVariant)};}case _0xdc6632(0x20c):{const _0x2106c1=_0x252f58;return{'target':normalizeJumpTarget(_0x2106c1['target'])};}default:return _0x252f58;}}function normalizeDecisionBranch(_0x12c5f3){const _0x1936e8=a108_0x1761;return{'name':_0x12c5f3[_0x1936e8(0x26f)],..._0x12c5f3[_0x1936e8(0x29f)]!==undefined&&{'segment':_0x12c5f3[_0x1936e8(0x29f)]},..._0x12c5f3[_0x1936e8(0x26c)]!==undefined&&{'excluded':_0x12c5f3[_0x1936e8(0x26c)]},..._0x12c5f3[_0x1936e8(0x2a4)]!==undefined&&{'next':_0x12c5f3[_0x1936e8(0x2a4)]}};}function normalizeAbTestVariant(_0xc92a1e){const _0x333243=a108_0x1761;return{..._0xc92a1e['id']!==undefined&&{'id':_0xc92a1e['id']},'name':_0xc92a1e[_0x333243(0x26f)],'percentage':_0xc92a1e[_0x333243(0x1fa)],..._0xc92a1e[_0x333243(0x2a4)]!==undefined&&{'next':_0xc92a1e[_0x333243(0x2a4)]}};}function normalizeJumpTarget(_0x224409){const _0x184b0b=a108_0x1761;return{'journey':_0x224409[_0x184b0b(0x244)],'stage':_0x224409['stage'],..._0x224409['bundle_id']!==undefined&&{'bundle_id':_0x224409[_0x184b0b(0x1ff)]}};}function normalizeEmbeddedSegments(_0x52a974,_0xf9186e){const _0x3ffb26=a108_0x1761,_0x4d3dc2={},_0x495d28=Object[_0x3ffb26(0x26e)](_0x52a974),_0x5952cc=_0xf9186e?[..._0xf9186e[_0x3ffb26(0x25e)](_0x1706f4=>_0x495d28['includes'](_0x1706f4)),..._0x495d28[_0x3ffb26(0x25e)](_0x1a7d92=>!_0xf9186e['includes'](_0x1a7d92))['sort']()]:_0x495d28[_0x3ffb26(0x29d)]();for(const _0x3a8395 of _0x5952cc){const _0x592554=_0x52a974[_0x3a8395];if(_0x592554[_0x3ffb26(0x226)]){const _0x34d6c4=_0x592554[_0x3ffb26(0x226)];if(_0x34d6c4[_0x3ffb26(0x213)]!==_0x3ffb26(0x1e0)&&_0x34d6c4[_0x3ffb26(0x213)]!=='Or'){const _0x3c482c=_0x34d6c4[_0x3ffb26(0x213)]??_0x3ffb26(0x215);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x3a8395+'\x27:\x20'+(_0x3ffb26(0x2a3)+_0x3c482c+'\x27.\x0a')+_0x3ffb26(0x288)+_0x3ffb26(0x1eb)+_0x3ffb26(0x291)+'\x20\x20\x20\x20conditions:\x0a'+_0x3ffb26(0x2a5)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x3ffb26(0x297));}if(!_0x34d6c4[_0x3ffb26(0x2a0)]||!Array[_0x3ffb26(0x289)](_0x34d6c4['conditions']))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x3ffb26(0x201)+_0x3a8395+'\x27:\x20'+'rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a'+_0x3ffb26(0x288)+_0x3ffb26(0x1eb)+(_0x3ffb26(0x272)+_0x34d6c4[_0x3ffb26(0x213)]+'\x0a')+_0x3ffb26(0x256)+_0x3ffb26(0x2a5)+_0x3ffb26(0x1f7)+_0x3ffb26(0x297));}_0x4d3dc2[_0x3a8395]={..._0x592554[_0x3ffb26(0x1e1)]&&_0x592554[_0x3ffb26(0x1e1)]['trim']()&&{'description':_0x592554[_0x3ffb26(0x1e1)]},..._0x592554[_0x3ffb26(0x226)]&&{'rule':deepSortObject(_0x592554[_0x3ffb26(0x226)])}};}return _0x4d3dc2;}function normalizeEmbeddedActivations(_0x24214f,_0x20bed0){const _0x59a80f=a108_0x1761,_0xdf7c2b={},_0x1759ca=Object[_0x59a80f(0x26e)](_0x24214f),_0x37bef9=_0x20bed0?[..._0x20bed0[_0x59a80f(0x25e)](_0x5d52df=>_0x1759ca[_0x59a80f(0x203)](_0x5d52df)),..._0x1759ca['filter'](_0x2f00b6=>!_0x20bed0[_0x59a80f(0x203)](_0x2f00b6))[_0x59a80f(0x29d)]()]:_0x1759ca[_0x59a80f(0x29d)]();for(const _0x1f428f of _0x37bef9){const _0x37c491=_0x24214f[_0x1f428f];_0xdf7c2b[_0x1f428f]={'name':_0x37c491[_0x59a80f(0x26f)],'connection':_0x37c491[_0x59a80f(0x271)],..._0x37c491[_0x59a80f(0x1e1)]!==undefined&&{'description':_0x37c491[_0x59a80f(0x1e1)]},..._0x37c491['all_columns']!==undefined&&{'all_columns':_0x37c491['all_columns']},..._0x37c491['columns']!==undefined&&{'columns':_0x37c491['columns']},..._0x37c491[_0x59a80f(0x246)]!==undefined&&{'behavior':_0x37c491[_0x59a80f(0x246)]},..._0x37c491[_0x59a80f(0x20b)]!==undefined&&{'schedule':_0x37c491[_0x59a80f(0x20b)]},..._0x37c491['notification']!==undefined&&{'notification':_0x37c491[_0x59a80f(0x21d)]},..._0x37c491[_0x59a80f(0x21f)]!==undefined&&{'connector_config':_0x37c491[_0x59a80f(0x21f)]},..._0x37c491[_0x59a80f(0x27f)]!==undefined&&{'activation_template_id':_0x37c491[_0x59a80f(0x27f)]}};}return _0xdf7c2b;}export function getActiveStages(_0x52e8bf){const _0xc613be=a108_0x1761;if(isJourneysArrayMode(_0x52e8bf)){const _0x402264=_0x52e8bf[_0xc613be(0x247)]||[],_0x4cc67a=_0x402264[_0xc613be(0x273)](_0x2dfb4e=>_0x2dfb4e[_0xc613be(0x1fb)]===!![])||_0x402264[0x0];return _0x4cc67a?.[_0xc613be(0x267)]||[];}if(isSingleVersionMode(_0x52e8bf))return _0x52e8bf[_0xc613be(0x267)]||[];if(isMultiVersionMode(_0x52e8bf)){const _0x73dc5d=_0x52e8bf[_0xc613be(0x237)]||[],_0x3321fa=_0x73dc5d[_0xc613be(0x273)](_0x1f6b18=>_0x1f6b18[_0xc613be(0x1fb)]===!![])||_0x73dc5d[0x0];return _0x3321fa?.['stages']||[];}return[];}export function getLatestJourneyEntry(_0x232da6){const _0x4ca459=a108_0x1761;if(isJourneysArrayMode(_0x232da6)){const _0x447f97=_0x232da6[_0x4ca459(0x247)]||[];return _0x447f97['find'](_0x40ef1f=>_0x40ef1f[_0x4ca459(0x1fb)]===!![])||_0x447f97[0x0];}if(isMultiVersionMode(_0x232da6)){const _0x1fa72b=_0x232da6[_0x4ca459(0x237)]||[],_0x3b6338=_0x1fa72b['find'](_0x576863=>_0x576863['latest']===!![])||_0x1fa72b[0x0];if(_0x3b6338)return{'version':_0x3b6338['name'],'state':_0x3b6338[_0x4ca459(0x259)],'latest':_0x3b6338[_0x4ca459(0x1fb)],'stages':_0x3b6338['stages'],'id':_0x3b6338['id'],'version_number':_0x3b6338[_0x4ca459(0x1fe)]};}if(isSingleVersionMode(_0x232da6))return{'version':_0x232da6[_0x4ca459(0x22c)]||'v1','state':'draft','stages':_0x232da6[_0x4ca459(0x267)]||[],'id':_0x232da6['id'],'version_number':_0x232da6['version_number'],'goal':_0x232da6[_0x4ca459(0x290)],'reentry':_0x232da6[_0x4ca459(0x24e)]};return undefined;}export function getLatestVersion(_0x2f1350){const _0x41cc41=a108_0x1761;if(!isMultiVersionMode(_0x2f1350))return undefined;const _0x4d6d02=_0x2f1350[_0x41cc41(0x237)]||[];return _0x4d6d02['find'](_0x412836=>_0x412836[_0x41cc41(0x1fb)]===!![])||_0x4d6d02[0x0];}export function getEffectiveGoal(_0x5e5cb9){const _0x406fe0=a108_0x1761,_0x33c6b5=getLatestJourneyEntry(_0x5e5cb9);return _0x33c6b5?.[_0x406fe0(0x290)]||_0x5e5cb9[_0x406fe0(0x290)];}export function getEffectiveReentry(_0x51b6fa){const _0x4a784e=a108_0x1761,_0x419485=getLatestJourneyEntry(_0x51b6fa);return _0x419485?.[_0x4a784e(0x24e)]||_0x51b6fa['reentry'];}export function collectSegmentRefs(_0x6fae26){const _0x31d5d8=a108_0x1761,_0x54eebf=new Set();_0x6fae26[_0x31d5d8(0x290)]?.[_0x31d5d8(0x29f)]&&_0x54eebf[_0x31d5d8(0x28e)](_0x6fae26[_0x31d5d8(0x290)]['segment']);const _0x30a3a4=_0x1503cc=>{const _0xfc0904=_0x31d5d8;for(const _0x6d36a0 of _0x1503cc){_0x6d36a0[_0xfc0904(0x221)]?.[_0xfc0904(0x29f)]&&_0x54eebf['add'](_0x6d36a0[_0xfc0904(0x221)][_0xfc0904(0x29f)]);if(_0x6d36a0[_0xfc0904(0x29a)])for(const _0x2bab83 of _0x6d36a0['exit_criteria']){_0x2bab83[_0xfc0904(0x29f)]&&_0x54eebf['add'](_0x2bab83[_0xfc0904(0x29f)]);}_0x6d36a0['milestone']?.[_0xfc0904(0x29f)]&&_0x54eebf[_0xfc0904(0x28e)](_0x6d36a0[_0xfc0904(0x296)][_0xfc0904(0x29f)]);if(_0x6d36a0['steps'])for(const _0x439557 of _0x6d36a0[_0xfc0904(0x205)]){if(_0x439557[_0xfc0904(0x213)]==='decision_point'){const _0x34c8dd=_0x439557;for(const _0x53f0f4 of _0x34c8dd[_0xfc0904(0x249)][_0xfc0904(0x1e7)]){_0x53f0f4[_0xfc0904(0x29f)]&&_0x54eebf['add'](_0x53f0f4[_0xfc0904(0x29f)]);}}else{if(_0x439557[_0xfc0904(0x213)]===_0xfc0904(0x269)){const _0x597767=_0x439557;_0x597767[_0xfc0904(0x249)][_0xfc0904(0x236)]?.[_0xfc0904(0x29f)]&&_0x54eebf[_0xfc0904(0x28e)](_0x597767[_0xfc0904(0x249)][_0xfc0904(0x236)][_0xfc0904(0x29f)]);}}}}};_0x6fae26['stages']&&_0x30a3a4(_0x6fae26['stages']);if(_0x6fae26[_0x31d5d8(0x237)])for(const _0x2b0b73 of _0x6fae26[_0x31d5d8(0x237)]){_0x30a3a4(_0x2b0b73[_0x31d5d8(0x267)]);}return _0x54eebf;}function a108_0x2744(){const _0x33818c=['reentryMode','journeyId','journeyActivationStepId','Activation','First\x20stage\x20of\x20the\x20journey','shift','Merge',']\x20missing\x20required\x20field:\x20name','stage','duration','journeys:','journeyBundleId','journey','no_reentry','behavior','journeys','unique_id','with','ref','object','ab_test','ABTest','reentry','moveAfter','segments:',':\x20maximum\x208\x20stages\x20allowed','DaysOfTheWeek','resolveActivationId','variants','has','\x20\x20\x20\x20conditions:\x0a','replace','waitStepUnit','state','timeout','resolveSegment','segment_id','Jump','filter','77IJJYXd','versions:','test','exitCriteria','Duration','journeyBundleName','wait_until','excludedPath','stages','Condition','wait','AbTest','isJourneyLocal','excluded','randomUUID','keys','name','folder_id','connection','\x20\x20\x20\x20type:\x20','find','4466440NNeyyI','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','Journey\x20YAML\x20must\x20have\x20type:\x20journey','length','stageId','entryCriteria','parentFolder','resolveSegmentId','allowReentry','day','size','activation_template_id','resolveEmbeddedSegmentId','184PlaPfC','toLowerCase','segments','decision_point','entries','Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)','18888BpmOMH','Expected\x20format:\x0a','isArray','activation','resolveActivation','journeyName','rootStep','add','reentry:','goal','\x20\x20\x20\x20type:\x20And\x0a','startsWith','exitCriterias','DecisionPoint','].stages','milestone','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','match','days_of_week','exit_criteria','waitStep','trim','sort','Unknown\x20segment\x20\x22','segment','conditions','23829GDnHmP','parse','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','next','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','waitStepType','End','slice','journeyStageId','conditionSegmentId','null','And','description','204632yXdbZk','Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.','unit','7qXSClt','resolveJumpTarget','branches','root_step','target','Send\x20Notification','\x20\x20rule:\x0a',']\x20missing\x20required\x20field:\x20stages','daysOfWeek','Wait\x201\x20Day','versions[','reentry_always','attributes','launched','set','definition','Journey\x20YAML\x20versions[','activations','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','your-activation-name','WaitStep','percentage','latest','conditionTimeoutDuration','week','version_number','bundle_id','Journey\x20YAML\x20journeys[','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','resolveActivationName','includes','waitUntilDate','steps','resolveSegmentName','merge','stageName','timedOutPath','6432450TlroWj','schedule','jump','Jump\x20step\x20\x22','map','journeyStages','embedded','push','all','type','17138781iCqxlk','(missing)','6968665zjENzQ','customizedSplit','end','Journey\x20YAML\x20','goal:','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','data','notification','values','connector_config','Stage\x201','entry_criteria','uuid','Date','segmentId','JOURNEY_SYNTAX_ERROR','rule','resolveJourneyId','Entry\x20Criteria','Stage\x20Complete','activations:','conditionTimeoutUnit','version','from','resolveStageId','Variant',']\x20has\x20invalid\x20state:\x20','relationships','days','customized_split','get','stages:','condition','versions'];a108_0x2744=function(){return _0x33818c;};return a108_0x2744();}export function validateSegmentRefs(_0x55338d){const _0x1d7217=a108_0x1761,_0x2ca795=[],_0x20b377=collectSegmentRefs(_0x55338d),_0x49301f=new Set(Object[_0x1d7217(0x26e)](_0x55338d[_0x1d7217(0x283)]||{}));for(const _0x23b02f of _0x20b377){const _0x3ec3c1=parseSegmentRef(_0x23b02f);_0x3ec3c1[_0x1d7217(0x213)]===_0x1d7217(0x210)&&!_0x49301f[_0x1d7217(0x255)](_0x3ec3c1[_0x1d7217(0x26f)])&&_0x2ca795[_0x1d7217(0x211)](_0x1d7217(0x29e)+_0x3ec3c1[_0x1d7217(0x26f)]+_0x1d7217(0x275)+_0x3ec3c1['name']+_0x1d7217(0x2a6));}return _0x2ca795;}export function collectSegmentIdsFromJourneyApi(_0x121ff1){const _0x2cd3c2=a108_0x1761,_0x93bcd8=new Set();_0x121ff1[_0x2cd3c2(0x1f1)][_0x2cd3c2(0x290)]?.[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x121ff1[_0x2cd3c2(0x1f1)][_0x2cd3c2(0x290)]['segmentId']);const _0x24e1a9=_0x121ff1[_0x2cd3c2(0x1f1)][_0x2cd3c2(0x20f)];if(Array[_0x2cd3c2(0x289)](_0x24e1a9))for(const _0x4df8fb of _0x24e1a9){_0x4df8fb[_0x2cd3c2(0x279)]?.[_0x2cd3c2(0x224)]&&_0x93bcd8['add'](_0x4df8fb[_0x2cd3c2(0x279)][_0x2cd3c2(0x224)]);if(Array[_0x2cd3c2(0x289)](_0x4df8fb[_0x2cd3c2(0x262)]))for(const _0x1df196 of _0x4df8fb[_0x2cd3c2(0x262)]){_0x1df196[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x1df196[_0x2cd3c2(0x224)]);}_0x4df8fb[_0x2cd3c2(0x296)]?.[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x4df8fb[_0x2cd3c2(0x296)][_0x2cd3c2(0x224)]);if(_0x4df8fb[_0x2cd3c2(0x205)]&&typeof _0x4df8fb[_0x2cd3c2(0x205)]===_0x2cd3c2(0x24b)){const _0x240b41=Array[_0x2cd3c2(0x289)](_0x4df8fb[_0x2cd3c2(0x205)])?_0x4df8fb[_0x2cd3c2(0x205)]:Object[_0x2cd3c2(0x21e)](_0x4df8fb[_0x2cd3c2(0x205)]);for(const _0x3e193e of _0x240b41){_0x3e193e['waitCondition']?.[_0x2cd3c2(0x224)]&&_0x93bcd8[_0x2cd3c2(0x28e)](_0x3e193e['waitCondition']['segmentId']);if(Array[_0x2cd3c2(0x289)](_0x3e193e[_0x2cd3c2(0x1e7)]))for(const _0x5445e8 of _0x3e193e[_0x2cd3c2(0x1e7)]){_0x5445e8['segmentId']&&_0x93bcd8['add'](_0x5445e8['segmentId']);}}}}return _0x93bcd8;}
|
|
1
|
+
const a108_0x547e7a=a108_0x12c3;(function(_0x549520,_0xb08b28){const _0x293024=a108_0x12c3,_0x498364=_0x549520();while(!![]){try{const _0x25b71a=-parseInt(_0x293024(0xe9))/0x1*(parseInt(_0x293024(0xd4))/0x2)+-parseInt(_0x293024(0x15a))/0x3*(parseInt(_0x293024(0x127))/0x4)+parseInt(_0x293024(0x112))/0x5+-parseInt(_0x293024(0xe6))/0x6+parseInt(_0x293024(0x116))/0x7+-parseInt(_0x293024(0xe8))/0x8+parseInt(_0x293024(0x118))/0x9;if(_0x25b71a===_0xb08b28)break;else _0x498364['push'](_0x498364['shift']());}catch(_0x14b19e){_0x498364['push'](_0x498364['shift']());}}}(a108_0x29fb,0x89f06));import*as a108_0x19135e from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x24dca5){const _0x847c8e=a108_0x12c3,_0x1dc1db=_0x24dca5[_0x847c8e(0x175)]();if(_0x1dc1db==='days'||_0x1dc1db===_0x847c8e(0x13a))return _0x847c8e(0x13a);if(_0x1dc1db===_0x847c8e(0xfd)||_0x1dc1db===_0x847c8e(0x100))return _0x847c8e(0x100);return _0x24dca5;}export function journeyResponseToDefSync(_0x21952e){const _0x228fc3=a108_0x12c3,_0x483854=_0x21952e[_0x228fc3(0x174)],_0x3e6418=_0x483854[_0x228fc3(0x141)]||_0x483854[_0x228fc3(0x10a)],_0x39060b={'stages':_0x483854[_0x228fc3(0x16a)][_0x228fc3(0xd2)](convertApiStageToYaml),'id':_0x21952e['id']};_0x483854[_0x228fc3(0x10a)]&&_0x483854[_0x228fc3(0x10a)]!==_0x3e6418&&(_0x39060b['version']=_0x483854['name']);_0x483854['versionNumber']!==undefined&&(_0x39060b[_0x228fc3(0x11c)]=_0x483854[_0x228fc3(0xf6)]);_0x483854[_0x228fc3(0xd0)]&&(_0x39060b[_0x228fc3(0xd0)]=_0x483854[_0x228fc3(0xd0)]===_0x228fc3(0xd5)?_0x228fc3(0xd5):_0x228fc3(0xd1));const _0x1db720={'type':_0x228fc3(0xe5),'name':_0x3e6418,'journeys':[_0x39060b]};_0x483854['description']&&(_0x1db720[_0x228fc3(0x169)]=_0x483854[_0x228fc3(0x169)]);_0x483854[_0x228fc3(0x12c)]&&(_0x1db720[_0x228fc3(0x12c)]=convertApiCriteriaToYaml(_0x483854[_0x228fc3(0x12c)]));if(_0x483854[_0x228fc3(0x101)])_0x1db720[_0x228fc3(0xee)]=_0x483854[_0x228fc3(0x101)];else _0x483854['allowReentry']!==undefined&&(_0x1db720[_0x228fc3(0xee)]=_0x483854[_0x228fc3(0xfe)]?'reentry_always':_0x228fc3(0x128));return _0x483854['journeyBundleId']&&(_0x1db720[_0x228fc3(0x147)]=_0x483854[_0x228fc3(0xdb)]),_0x483854[_0x228fc3(0x141)]&&(_0x1db720[_0x228fc3(0x120)]=_0x483854[_0x228fc3(0x141)]),_0x21952e[_0x228fc3(0x14e)]?.[_0x228fc3(0xe0)]?.['data']?.['id']&&(_0x1db720[_0x228fc3(0x14a)]=_0x21952e[_0x228fc3(0x14e)][_0x228fc3(0xe0)][_0x228fc3(0x192)]['id']),_0x1db720;}export async function journeyResponseToDef(_0x95cd68,_0x10e3a5){const _0x1e4982=a108_0x12c3,_0x1eee0f=journeyResponseToDefSync(_0x95cd68);if(!_0x10e3a5)return _0x1eee0f;const _0x46f40c=new Set();collectSegmentIdsFromJourney(_0x1eee0f,_0x46f40c);const _0x187a6d=new Set();collectActivationIdsFromJourney(_0x1eee0f,_0x187a6d);const _0x189ea2={},_0x366f8c=new Map();for(const _0x3b4c8c of Array[_0x1e4982(0x13b)](_0x46f40c)[_0x1e4982(0x198)]()){if(_0x10e3a5[_0x1e4982(0x145)]){const _0x27c45d=await _0x10e3a5[_0x1e4982(0x145)](_0x3b4c8c);if(_0x27c45d[_0x1e4982(0x176)]){_0x366f8c[_0x1e4982(0x12a)](_0x3b4c8c,_0x27c45d[_0x1e4982(0x10a)]);if(_0x27c45d[_0x1e4982(0xd3)]){const _0x2c13b6={..._0x27c45d[_0x1e4982(0xd3)],'rule':deepSortObject(_0x27c45d[_0x1e4982(0xd3)][_0x1e4982(0x165)])};_0x189ea2[_0x27c45d[_0x1e4982(0x10a)]]=_0x2c13b6;}}else _0x366f8c[_0x1e4982(0x12a)](_0x3b4c8c,makeSegmentRef(_0x27c45d['name']));}else{if(_0x10e3a5[_0x1e4982(0x104)]){const _0x39ec7f=await _0x10e3a5[_0x1e4982(0x104)](_0x3b4c8c);_0x366f8c[_0x1e4982(0x12a)](_0x3b4c8c,_0x39ec7f);}}}const _0x12eded={},_0x3ea44a=new Map();for(const _0x17a22b of Array[_0x1e4982(0x13b)](_0x187a6d)[_0x1e4982(0x198)]()){if(_0x10e3a5[_0x1e4982(0xf5)]){const _0x104ed5=await _0x10e3a5[_0x1e4982(0xf5)](_0x17a22b);_0x104ed5[_0x1e4982(0x176)]?(_0x3ea44a[_0x1e4982(0x12a)](_0x17a22b,_0x104ed5[_0x1e4982(0x10a)]),_0x104ed5[_0x1e4982(0xd3)]&&(_0x12eded[_0x104ed5['name']]=_0x104ed5[_0x1e4982(0xd3)])):_0x3ea44a[_0x1e4982(0x12a)](_0x17a22b,makeSegmentRef(_0x104ed5['name']));}else{if(_0x10e3a5[_0x1e4982(0x110)]){const _0x4166ce=await _0x10e3a5[_0x1e4982(0x110)](_0x17a22b);_0x3ea44a['set'](_0x17a22b,_0x4166ce);}}}_0x366f8c['size']>0x0&&replaceSegmentIdsInJourney(_0x1eee0f,_0x366f8c);_0x3ea44a[_0x1e4982(0x164)]>0x0&&replaceActivationIdsInJourney(_0x1eee0f,_0x3ea44a);if(_0x10e3a5[_0x1e4982(0x159)]){const _0x400894=[];collectJumpTargetsFromJourney(_0x1eee0f,_0x400894);if(_0x400894['length']>0x0){const _0x24201f=new Map();for(const _0x51441d of _0x400894){try{const _0x56c6f0=await _0x10e3a5[_0x1e4982(0x159)](_0x51441d[_0x1e4982(0x119)],_0x51441d['stageId']);_0x24201f[_0x1e4982(0x12a)](_0x51441d[_0x1e4982(0x119)]+':'+_0x51441d[_0x1e4982(0x197)],_0x56c6f0);}catch{}}_0x24201f[_0x1e4982(0x164)]>0x0&&replaceJumpTargetsInJourney(_0x1eee0f,_0x24201f);}}return Object['keys'](_0x189ea2)[_0x1e4982(0x148)]>0x0&&(_0x1eee0f['segments']=_0x189ea2),Object[_0x1e4982(0xdd)](_0x12eded)[_0x1e4982(0x148)]>0x0&&(_0x1eee0f['activations']=_0x12eded),_0x1eee0f;}function collectSegmentIdsFromJourney(_0x421d20,_0x179005){const _0x295f02=a108_0x12c3;_0x421d20[_0x295f02(0x12c)]?.[_0x295f02(0x130)]&&_0x179005[_0x295f02(0x140)](_0x421d20[_0x295f02(0x12c)][_0x295f02(0x130)]);const _0x57476c=_0x3ff074=>{const _0xf20685=_0x295f02;for(const _0x34d0b2 of _0x3ff074){_0x34d0b2[_0xf20685(0x194)]?.[_0xf20685(0x130)]&&_0x179005[_0xf20685(0x140)](_0x34d0b2[_0xf20685(0x194)][_0xf20685(0x130)]);if(_0x34d0b2[_0xf20685(0xfc)])for(const _0x3cc39e of _0x34d0b2[_0xf20685(0xfc)]){_0x3cc39e[_0xf20685(0x130)]&&_0x179005[_0xf20685(0x140)](_0x3cc39e[_0xf20685(0x130)]);}_0x34d0b2[_0xf20685(0xd6)]?.[_0xf20685(0x130)]&&_0x179005[_0xf20685(0x140)](_0x34d0b2['milestone'][_0xf20685(0x130)]);if(_0x34d0b2['steps'])for(const _0x7491a7 of _0x34d0b2[_0xf20685(0xef)]){if(_0x7491a7[_0xf20685(0x16e)]===_0xf20685(0x18a)){const _0x3a2451=_0x7491a7;for(const _0x405a61 of _0x3a2451[_0xf20685(0x18f)]['branches']){_0x405a61['segment']&&_0x179005['add'](_0x405a61['segment']);}}else{if(_0x7491a7[_0xf20685(0x16e)]===_0xf20685(0x12f)){const _0x3e589a=_0x7491a7;_0x3e589a[_0xf20685(0x18f)][_0xf20685(0x177)]?.['segment']&&_0x179005['add'](_0x3e589a[_0xf20685(0x18f)][_0xf20685(0x177)][_0xf20685(0x130)]);}}}}};if(_0x421d20['journeys'])for(const _0x54184d of _0x421d20[_0x295f02(0x16d)]){_0x54184d['goal']?.[_0x295f02(0x130)]&&_0x179005['add'](_0x54184d[_0x295f02(0x12c)][_0x295f02(0x130)]),_0x57476c(_0x54184d[_0x295f02(0x18c)]);}_0x421d20[_0x295f02(0x18c)]&&_0x57476c(_0x421d20[_0x295f02(0x18c)]);if(_0x421d20['versions'])for(const _0x4687b7 of _0x421d20[_0x295f02(0x168)]){_0x57476c(_0x4687b7[_0x295f02(0x18c)]);}}function replaceSegmentIdsInJourney(_0x3c3893,_0x34eb36){const _0x2fcb38=a108_0x12c3,_0x205b44=_0x2c5d70=>_0x34eb36[_0x2fcb38(0x117)](_0x2c5d70)||_0x2c5d70;_0x3c3893['goal']?.['segment']&&(_0x3c3893['goal']['segment']=_0x205b44(_0x3c3893[_0x2fcb38(0x12c)][_0x2fcb38(0x130)]));const _0x5eb59c=_0x3b4771=>{const _0xfb267d=_0x2fcb38;for(const _0x6537bc of _0x3b4771){_0x6537bc[_0xfb267d(0x194)]?.[_0xfb267d(0x130)]&&(_0x6537bc[_0xfb267d(0x194)][_0xfb267d(0x130)]=_0x205b44(_0x6537bc[_0xfb267d(0x194)][_0xfb267d(0x130)]));if(_0x6537bc[_0xfb267d(0xfc)])for(const _0x2ce15a of _0x6537bc[_0xfb267d(0xfc)]){_0x2ce15a[_0xfb267d(0x130)]&&(_0x2ce15a[_0xfb267d(0x130)]=_0x205b44(_0x2ce15a['segment']));}_0x6537bc['milestone']?.[_0xfb267d(0x130)]&&(_0x6537bc[_0xfb267d(0xd6)][_0xfb267d(0x130)]=_0x205b44(_0x6537bc[_0xfb267d(0xd6)][_0xfb267d(0x130)]));if(_0x6537bc[_0xfb267d(0xef)])for(const _0xc77583 of _0x6537bc[_0xfb267d(0xef)]){if(_0xc77583[_0xfb267d(0x16e)]==='decision_point'){const _0x1eb937=_0xc77583;for(const _0x271bbb of _0x1eb937['with'][_0xfb267d(0x190)]){_0x271bbb[_0xfb267d(0x130)]&&(_0x271bbb[_0xfb267d(0x130)]=_0x205b44(_0x271bbb[_0xfb267d(0x130)]));}}else{if(_0xc77583['type']===_0xfb267d(0x12f)){const _0x3e8d67=_0xc77583;_0x3e8d67[_0xfb267d(0x18f)]['condition']?.[_0xfb267d(0x130)]&&(_0x3e8d67[_0xfb267d(0x18f)]['condition'][_0xfb267d(0x130)]=_0x205b44(_0x3e8d67['with'][_0xfb267d(0x177)][_0xfb267d(0x130)]));}}}}};if(_0x3c3893[_0x2fcb38(0x16d)])for(const _0x1b1c8f of _0x3c3893[_0x2fcb38(0x16d)]){_0x1b1c8f[_0x2fcb38(0x12c)]?.['segment']&&(_0x1b1c8f['goal'][_0x2fcb38(0x130)]=_0x205b44(_0x1b1c8f[_0x2fcb38(0x12c)][_0x2fcb38(0x130)])),_0x5eb59c(_0x1b1c8f[_0x2fcb38(0x18c)]);}_0x3c3893[_0x2fcb38(0x18c)]&&_0x5eb59c(_0x3c3893[_0x2fcb38(0x18c)]);if(_0x3c3893[_0x2fcb38(0x168)])for(const _0x149169 of _0x3c3893[_0x2fcb38(0x168)]){_0x5eb59c(_0x149169[_0x2fcb38(0x18c)]);}}function collectActivationIdsFromJourney(_0x20d085,_0x24ebc6){const _0xed2cc6=a108_0x12c3,_0x28e004=_0x4a1fc5=>{const _0x174592=a108_0x12c3;for(const _0x20c58d of _0x4a1fc5){if(_0x20c58d[_0x174592(0xef)])for(const _0x58f9c5 of _0x20c58d[_0x174592(0xef)]){if(_0x58f9c5[_0x174592(0x16e)]===_0x174592(0xe3)){const _0x208fee=_0x58f9c5;_0x208fee[_0x174592(0x18f)][_0x174592(0xe3)]&&/^\d+$/['test'](_0x208fee['with'][_0x174592(0xe3)])&&_0x24ebc6['add'](_0x208fee[_0x174592(0x18f)][_0x174592(0xe3)]);}}}};if(_0x20d085[_0xed2cc6(0x16d)])for(const _0x5b7083 of _0x20d085[_0xed2cc6(0x16d)]){_0x28e004(_0x5b7083['stages']);}_0x20d085[_0xed2cc6(0x18c)]&&_0x28e004(_0x20d085['stages']);if(_0x20d085[_0xed2cc6(0x168)])for(const _0x4fa553 of _0x20d085[_0xed2cc6(0x168)]){_0x28e004(_0x4fa553[_0xed2cc6(0x18c)]);}}function replaceActivationIdsInJourney(_0x75c784,_0x3a47ec){const _0x1222ee=a108_0x12c3,_0x4eb791=_0x2955f9=>_0x3a47ec[_0x1222ee(0x117)](_0x2955f9)||_0x2955f9,_0x177329=_0x5b2dff=>{const _0x211d3a=_0x1222ee;for(const _0x2e9966 of _0x5b2dff){if(_0x2e9966[_0x211d3a(0xef)])for(const _0x34d424 of _0x2e9966[_0x211d3a(0xef)]){if(_0x34d424[_0x211d3a(0x16e)]===_0x211d3a(0xe3)){const _0x410760=_0x34d424;_0x410760['with'][_0x211d3a(0xe3)]&&(_0x410760[_0x211d3a(0x18f)]['activation']=_0x4eb791(_0x410760[_0x211d3a(0x18f)]['activation']));}}}};if(_0x75c784[_0x1222ee(0x16d)])for(const _0x4616a1 of _0x75c784[_0x1222ee(0x16d)]){_0x177329(_0x4616a1[_0x1222ee(0x18c)]);}_0x75c784[_0x1222ee(0x18c)]&&_0x177329(_0x75c784[_0x1222ee(0x18c)]);if(_0x75c784['versions'])for(const _0xe46ac of _0x75c784[_0x1222ee(0x168)]){_0x177329(_0xe46ac[_0x1222ee(0x18c)]);}}function collectJumpTargetsFromJourney(_0x415937,_0x48f78b){const _0x13b351=a108_0x12c3,_0x42a19e=new Set(),_0xe41f5a=_0x750c40=>{const _0x51eb64=a108_0x12c3;for(const _0x9c979f of _0x750c40){if(_0x9c979f[_0x51eb64(0xef)])for(const _0x58fc21 of _0x9c979f[_0x51eb64(0xef)]){if(_0x58fc21[_0x51eb64(0x16e)]===_0x51eb64(0x14d)){const _0x13d8f8=_0x58fc21,_0x157c71=_0x13d8f8[_0x51eb64(0x18f)][_0x51eb64(0x163)];if(_0x157c71[_0x51eb64(0xe5)]&&_0x157c71[_0x51eb64(0x124)]&&/^\d+$/[_0x51eb64(0x156)](_0x157c71[_0x51eb64(0xe5)])&&/^\d+$/[_0x51eb64(0x156)](_0x157c71[_0x51eb64(0x124)])){const _0x46cfdb=_0x157c71[_0x51eb64(0xe5)]+':'+_0x157c71[_0x51eb64(0x124)];!_0x42a19e[_0x51eb64(0x160)](_0x46cfdb)&&(_0x42a19e['add'](_0x46cfdb),_0x48f78b[_0x51eb64(0xf0)]({'journeyId':_0x157c71[_0x51eb64(0xe5)],'stageId':_0x157c71[_0x51eb64(0x124)]}));}}}}};if(_0x415937[_0x13b351(0x16d)])for(const _0x23491a of _0x415937[_0x13b351(0x16d)]){_0xe41f5a(_0x23491a[_0x13b351(0x18c)]);}_0x415937['stages']&&_0xe41f5a(_0x415937[_0x13b351(0x18c)]);if(_0x415937[_0x13b351(0x168)])for(const _0x57a050 of _0x415937[_0x13b351(0x168)]){_0xe41f5a(_0x57a050[_0x13b351(0x18c)]);}}function replaceJumpTargetsInJourney(_0x198314,_0x27857b){const _0x337efe=a108_0x12c3,_0x45af47=_0x1bbb2c=>{const _0xbcf4a7=a108_0x12c3;for(const _0x2553b5 of _0x1bbb2c){if(_0x2553b5[_0xbcf4a7(0xef)])for(const _0x2e4365 of _0x2553b5[_0xbcf4a7(0xef)]){if(_0x2e4365['type']===_0xbcf4a7(0x14d)){const _0x1282b1=_0x2e4365,_0x565c89=_0x1282b1[_0xbcf4a7(0x18f)][_0xbcf4a7(0x163)],_0x52d36a=_0x565c89[_0xbcf4a7(0xe5)]+':'+_0x565c89[_0xbcf4a7(0x124)],_0x22dd50=_0x27857b[_0xbcf4a7(0x117)](_0x52d36a);_0x22dd50&&(_0x565c89['journey']=_0x22dd50[_0xbcf4a7(0xe4)],_0x565c89[_0xbcf4a7(0x124)]=_0x22dd50['stageName']);}}}};if(_0x198314[_0x337efe(0x16d)])for(const _0x5c7d62 of _0x198314[_0x337efe(0x16d)]){_0x45af47(_0x5c7d62['stages']);}_0x198314['stages']&&_0x45af47(_0x198314[_0x337efe(0x18c)]);if(_0x198314[_0x337efe(0x168)])for(const _0x2435b7 of _0x198314[_0x337efe(0x168)]){_0x45af47(_0x2435b7['stages']);}}function generateReadableStepName(_0x2c3fa9,_0x24b008){const _0x255833=a108_0x12c3;if(_0x2c3fa9[_0x255833(0x10a)]&&_0x2c3fa9[_0x255833(0x10a)]!==_0x2c3fa9[_0x255833(0x16e)]){const _0x2b462f=_0x2c3fa9['name'][_0x255833(0xfa)]();if(_0x2b462f&&/[a-z0-9]/i[_0x255833(0x156)](_0x2b462f))return _0x2b462f;}const _0x279d0c=_0x2c3fa9['type']['toLowerCase']()[_0x255833(0xdf)](/step$/i,'');return _0x279d0c+'_'+(_0x24b008+0x1);}function getStepNextRefs(_0x12a5f9){const _0xac54c5=a108_0x12c3,_0x1bed6b=[];if(_0x12a5f9[_0xac54c5(0xf3)])_0x1bed6b[_0xac54c5(0xf0)](_0x12a5f9[_0xac54c5(0xf3)]);if(_0x12a5f9['branches'])for(const _0x495b1a of _0x12a5f9[_0xac54c5(0x190)]){if(_0x495b1a['next'])_0x1bed6b[_0xac54c5(0xf0)](_0x495b1a[_0xac54c5(0xf3)]);}if(_0x12a5f9['variants'])for(const _0x56a549 of _0x12a5f9[_0xac54c5(0x17e)]){if(_0x56a549[_0xac54c5(0xf3)])_0x1bed6b['push'](_0x56a549[_0xac54c5(0xf3)]);}if(_0x12a5f9[_0xac54c5(0xed)])for(const _0x378f49 of _0x12a5f9['conditions']){if(_0x378f49[_0xac54c5(0xf3)])_0x1bed6b[_0xac54c5(0xf0)](_0x378f49[_0xac54c5(0xf3)]);}return _0x1bed6b;}function parseJumpTargetDisplayName(_0x40845a){const _0x1787f0=a108_0x12c3,_0x385448=_0x40845a['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x385448)return undefined;const _0x53dfad=_0x385448[0x1]['trim'](),_0x3d6188=_0x385448[0x2][_0x1787f0(0xfa)]();if(!_0x53dfad||!_0x3d6188)return undefined;return{'stageName':_0x53dfad,'journeyName':_0x3d6188};}function orderStepsFromRoot(_0x353f31,_0x47f0c9){const _0x4b4818=a108_0x12c3,_0x45de2e=Object['entries'](_0x353f31);if(_0x45de2e[_0x4b4818(0x148)]===0x0)return[];const _0x2c746c=new Set(_0x45de2e[_0x4b4818(0xd2)](([_0x58e7d6])=>_0x58e7d6)),_0x1b91ef=new Set();for(const [,_0x7e83ee]of _0x45de2e){for(const _0x848d1f of getStepNextRefs(_0x7e83ee)){if(_0x2c746c['has'](_0x848d1f))_0x1b91ef[_0x4b4818(0x140)](_0x848d1f);}}let _0x290bdb=_0x47f0c9&&_0x2c746c[_0x4b4818(0x160)](_0x47f0c9)?_0x47f0c9:undefined;if(!_0x290bdb){const _0x52571b=_0x45de2e['filter'](([_0x306306])=>!_0x1b91ef[_0x4b4818(0x160)](_0x306306));_0x52571b['length']>0x0?_0x290bdb=_0x52571b[0x0][0x0]:_0x290bdb=_0x45de2e[0x0][0x0];}const _0x5714c7=[],_0x3b2ecf=new Set(),_0x5871fe=[_0x290bdb];while(_0x5871fe[_0x4b4818(0x148)]>0x0){const _0x4ce1bf=_0x5871fe[_0x4b4818(0x114)]();if(_0x3b2ecf['has'](_0x4ce1bf))continue;_0x3b2ecf[_0x4b4818(0x140)](_0x4ce1bf);const _0x2f008d=_0x353f31[_0x4ce1bf];if(!_0x2f008d)continue;_0x5714c7[_0x4b4818(0xf0)]({'uuid':_0x4ce1bf,'step':_0x2f008d});for(const _0x47bb40 of getStepNextRefs(_0x2f008d)){_0x2c746c[_0x4b4818(0x160)](_0x47bb40)&&!_0x3b2ecf['has'](_0x47bb40)&&_0x5871fe[_0x4b4818(0xf0)](_0x47bb40);}}for(const [_0x30e90e,_0x1d3151]of _0x45de2e){!_0x3b2ecf[_0x4b4818(0x160)](_0x30e90e)&&_0x5714c7[_0x4b4818(0xf0)]({'uuid':_0x30e90e,'step':_0x1d3151});}return _0x5714c7;}function resolveStepReferences(_0x519f3d,_0x34755b,_0x347471,_0x3e0216){const _0x102777=a108_0x12c3;if(_0x519f3d[_0x102777(0x16e)]!==_0x102777(0x158)){_0x519f3d[_0x102777(0xf3)]&&_0x3e0216[_0x102777(0x160)](_0x519f3d['next'])&&(_0x519f3d[_0x102777(0xf3)]=_0x3e0216[_0x102777(0x117)](_0x519f3d['next']));const _0x2cfb59=_0x34755b+0x1;if(_0x2cfb59<_0x347471[_0x102777(0x148)]){const _0x2ecc9c=_0x3e0216[_0x102777(0x117)](_0x347471[_0x2cfb59][_0x102777(0xce)]);_0x519f3d[_0x102777(0xf3)]===_0x2ecc9c&&delete _0x519f3d[_0x102777(0xf3)];}}if(_0x519f3d[_0x102777(0x16e)]===_0x102777(0x18a))for(const _0x13e0d0 of _0x519f3d['with'][_0x102777(0x190)]){_0x13e0d0[_0x102777(0xf3)]&&_0x3e0216[_0x102777(0x160)](_0x13e0d0[_0x102777(0xf3)])&&(_0x13e0d0[_0x102777(0xf3)]=_0x3e0216[_0x102777(0x117)](_0x13e0d0['next']));}if(_0x519f3d['type']===_0x102777(0xeb))for(const _0x49c8c5 of _0x519f3d[_0x102777(0x18f)][_0x102777(0x17e)]){_0x49c8c5[_0x102777(0xf3)]&&_0x3e0216[_0x102777(0x160)](_0x49c8c5[_0x102777(0xf3)])&&(_0x49c8c5[_0x102777(0xf3)]=_0x3e0216[_0x102777(0x117)](_0x49c8c5['next']));}if(_0x519f3d[_0x102777(0x16e)]==='wait'&&_0x519f3d[_0x102777(0x18f)][_0x102777(0x177)]){const _0x440df7=_0x519f3d[_0x102777(0x18f)][_0x102777(0x177)];_0x440df7[_0x102777(0xf3)]&&_0x3e0216['has'](_0x440df7[_0x102777(0xf3)])&&(_0x440df7[_0x102777(0xf3)]=_0x3e0216[_0x102777(0x117)](_0x440df7[_0x102777(0xf3)])),_0x440df7['timeout']?.['next']&&_0x3e0216['has'](_0x440df7[_0x102777(0x142)]['next'])&&(_0x440df7[_0x102777(0x142)]['next']=_0x3e0216['get'](_0x440df7[_0x102777(0x142)][_0x102777(0xf3)]));}}function convertApiStageToYaml(_0x4d9c8c){const _0x42b675=a108_0x12c3,_0x57d287={'name':_0x4d9c8c[_0x42b675(0x10a)]};_0x4d9c8c['id']&&(_0x57d287['id']=_0x4d9c8c['id']);_0x4d9c8c[_0x42b675(0x169)]&&(_0x57d287[_0x42b675(0x169)]=_0x4d9c8c[_0x42b675(0x169)]);_0x4d9c8c[_0x42b675(0x199)]&&(_0x57d287[_0x42b675(0x194)]=convertApiCriteriaToYaml(_0x4d9c8c[_0x42b675(0x199)]));_0x4d9c8c[_0x42b675(0x10f)]&&_0x4d9c8c[_0x42b675(0x10f)][_0x42b675(0x148)]>0x0&&(_0x57d287[_0x42b675(0xfc)]=_0x4d9c8c[_0x42b675(0x10f)][_0x42b675(0xd2)](convertApiCriteriaToYaml));_0x4d9c8c[_0x42b675(0xd6)]&&(_0x57d287[_0x42b675(0xd6)]=convertApiCriteriaToYaml(_0x4d9c8c[_0x42b675(0xd6)]));if(_0x4d9c8c[_0x42b675(0xef)]&&Object['keys'](_0x4d9c8c[_0x42b675(0xef)])[_0x42b675(0x148)]>0x0){const _0x15a18a=orderStepsFromRoot(_0x4d9c8c[_0x42b675(0xef)],_0x4d9c8c['rootStep']),_0x1f81dd=new Map(),_0xf96672=new Set();for(let _0x24c8ba=0x0;_0x24c8ba<_0x15a18a[_0x42b675(0x148)];_0x24c8ba++){const {uuid:_0x34207f,step:_0x5e1290}=_0x15a18a[_0x24c8ba];let _0x37c1a5=generateReadableStepName(_0x5e1290,_0x24c8ba),_0xd1f22b=_0x37c1a5,_0x24acae=0x2;while(_0xf96672[_0x42b675(0x160)](_0xd1f22b)){_0xd1f22b=_0x37c1a5+'_'+_0x24acae,_0x24acae++;}_0xf96672[_0x42b675(0x140)](_0xd1f22b),_0x1f81dd[_0x42b675(0x12a)](_0x34207f,_0xd1f22b);}_0x57d287[_0x42b675(0xef)]=_0x15a18a['map'](({uuid:_0x9955d,step:_0x4ba5d8},_0x3b15da)=>{const _0x5c288d=_0x42b675,_0x19d5e6=convertApiStepToYaml(_0x4ba5d8,_0x1f81dd[_0x5c288d(0x117)](_0x9955d));return resolveStepReferences(_0x19d5e6,_0x3b15da,_0x15a18a,_0x1f81dd),_0x19d5e6;});}return _0x57d287;}function convertApiCriteriaToYaml(_0x24ecbb){const _0xf599f1=a108_0x12c3,_0x4c9428={'name':_0x24ecbb['name'],'segment':_0x24ecbb[_0xf599f1(0x12b)]};_0x24ecbb[_0xf599f1(0x169)]&&(_0x4c9428[_0xf599f1(0x169)]=_0x24ecbb[_0xf599f1(0x169)]);if(_0x24ecbb[_0xf599f1(0x163)]){let _0x5c1b98=_0x24ecbb[_0xf599f1(0x163)][_0xf599f1(0x119)],_0xa2ef9a=_0x24ecbb[_0xf599f1(0x163)][_0xf599f1(0x178)];if(_0x24ecbb['target'][_0xf599f1(0xe4)]){const _0x44284b=parseJumpTargetDisplayName(_0x24ecbb[_0xf599f1(0x163)][_0xf599f1(0xe4)]);_0x44284b&&(_0xa2ef9a=_0x44284b[_0xf599f1(0x15b)],_0x5c1b98=_0x44284b[_0xf599f1(0xe4)]);}_0x4c9428['target']={'journey':_0x5c1b98,'stage':_0xa2ef9a},_0x24ecbb[_0xf599f1(0x163)][_0xf599f1(0xdb)]&&(_0x4c9428[_0xf599f1(0x163)][_0xf599f1(0x147)]=_0x24ecbb['target']['journeyBundleId']);}return _0x4c9428;}function convertApiStepToYaml(_0x2357ab,_0x18afd0){const _0x4dd19f=a108_0x12c3;switch(_0x2357ab[_0x4dd19f(0x16e)]){case _0x4dd19f(0x133):{const _0x3152d7={};if(_0x2357ab[_0x4dd19f(0xd7)]===_0x4dd19f(0x188)&&_0x2357ab[_0x4dd19f(0x143)]!==undefined)_0x3152d7[_0x4dd19f(0x139)]=_0x2357ab[_0x4dd19f(0x143)],_0x3152d7[_0x4dd19f(0x10b)]=_0x2357ab[_0x4dd19f(0x16c)];else{if(_0x2357ab[_0x4dd19f(0xd7)]===_0x4dd19f(0xf8)&&_0x2357ab[_0x4dd19f(0x185)])_0x3152d7[_0x4dd19f(0x11e)]=_0x2357ab['waitUntilDate'];else{if(_0x2357ab[_0x4dd19f(0xd7)]===_0x4dd19f(0x149)&&_0x2357ab['daysOfWeek'])_0x3152d7[_0x4dd19f(0x108)]=_0x2357ab[_0x4dd19f(0x195)];else{if(_0x2357ab['waitStepType']==='Condition'){if(_0x2357ab[_0x4dd19f(0xed)]&&_0x2357ab['conditions'][_0x4dd19f(0x148)]>0x0){const _0x3acbc4=_0x2357ab[_0x4dd19f(0xed)][_0x4dd19f(0x125)](_0x7f10ca=>!_0x7f10ca[_0x4dd19f(0x10d)]),_0x37f5bd=_0x2357ab[_0x4dd19f(0xed)][_0x4dd19f(0x125)](_0x6ff606=>_0x6ff606['timedOutPath']);_0x3acbc4?.[_0x4dd19f(0x12b)]&&(_0x3152d7[_0x4dd19f(0x177)]={'segment':_0x3acbc4['segmentId'],..._0x3acbc4[_0x4dd19f(0xf3)]?{'next':_0x3acbc4['next']}:{}},_0x37f5bd&&_0x37f5bd['moveAfter']!==undefined&&_0x37f5bd[_0x4dd19f(0x10b)]&&(_0x3152d7['condition']['timeout']={'duration':_0x37f5bd['moveAfter'],'unit':_0x37f5bd[_0x4dd19f(0x10b)],..._0x37f5bd[_0x4dd19f(0xf3)]?{'next':_0x37f5bd['next']}:{}}));}else _0x2357ab[_0x4dd19f(0x17b)]&&(_0x3152d7['condition']={'segment':_0x2357ab[_0x4dd19f(0x17b)]},_0x2357ab[_0x4dd19f(0x134)]!==undefined&&_0x2357ab[_0x4dd19f(0xf1)]&&(_0x3152d7['condition'][_0x4dd19f(0x142)]={'duration':_0x2357ab[_0x4dd19f(0x134)],'unit':_0x2357ab[_0x4dd19f(0xf1)]}));}}}}const _0x810278={'type':'wait','name':_0x18afd0,..._0x2357ab['next']?{'next':_0x2357ab[_0x4dd19f(0xf3)]}:{},'with':_0x3152d7};return _0x810278;}case _0x4dd19f(0x12d):{const _0x37bbfc={'type':'activation','name':_0x18afd0,..._0x2357ab[_0x4dd19f(0xf3)]?{'next':_0x2357ab['next']}:{},'with':{'activation':_0x2357ab[_0x4dd19f(0x189)]||''}};return _0x37bbfc;}case _0x4dd19f(0x138):{const _0x514562={'type':_0x4dd19f(0x18a),'name':_0x18afd0,..._0x2357ab['next']?{'next':_0x2357ab['next']}:{},'with':{'branches':(_0x2357ab['branches']||[])[_0x4dd19f(0xd2)](_0x591c88=>({'name':_0x591c88[_0x4dd19f(0x10a)],'segment':_0x591c88['segmentId'],'excluded':_0x591c88['excludedPath'],..._0x591c88[_0x4dd19f(0xf3)]?{'next':_0x591c88[_0x4dd19f(0xf3)]}:{}}))}};return _0x514562;}case _0x4dd19f(0x179):case _0x4dd19f(0x166):case _0x4dd19f(0x10c):{const _0x375952=_0x2357ab[_0x4dd19f(0x17e)]||(_0x2357ab[_0x4dd19f(0x190)]||[])[_0x4dd19f(0xd2)](_0x2e6ca3=>({'name':_0x2e6ca3[_0x4dd19f(0x10a)],'percentage':0x0,'next':_0x2e6ca3[_0x4dd19f(0xf3)]})),_0x1626a2={'type':_0x4dd19f(0xeb),'name':_0x18afd0,..._0x2357ab[_0x4dd19f(0xf3)]?{'next':_0x2357ab['next']}:{},'with':{'customized_split':_0x2357ab[_0x4dd19f(0x15e)],'unique_id':_0x2357ab['uniqueId'],'variants':_0x375952['map'](_0x209edd=>({'name':_0x209edd['name'],'percentage':_0x209edd[_0x4dd19f(0x11d)],..._0x209edd[_0x4dd19f(0xf3)]?{'next':_0x209edd['next']}:{}}))}};return _0x1626a2;}case _0x4dd19f(0x144):{const _0x152222={'type':'merge','name':_0x18afd0,..._0x2357ab['next']?{'next':_0x2357ab['next']}:{}};return _0x152222;}case'Jump':{if(!_0x2357ab[_0x4dd19f(0x163)])throw new SDKError(ErrorCode[_0x4dd19f(0x107)],_0x4dd19f(0x115)+(_0x2357ab['name']||_0x18afd0)+_0x4dd19f(0x18b));let _0x1322cb=_0x2357ab[_0x4dd19f(0x163)][_0x4dd19f(0x119)],_0x2f26d1=_0x2357ab[_0x4dd19f(0x163)][_0x4dd19f(0x178)];if(_0x2357ab[_0x4dd19f(0x163)][_0x4dd19f(0xe4)]){const _0x2bacd3=parseJumpTargetDisplayName(_0x2357ab[_0x4dd19f(0x163)][_0x4dd19f(0xe4)]);_0x2bacd3&&(_0x2f26d1=_0x2bacd3[_0x4dd19f(0x15b)],_0x1322cb=_0x2bacd3['journeyName']);}const _0x59365a={'type':_0x4dd19f(0x14d),'name':_0x18afd0,..._0x2357ab[_0x4dd19f(0xf3)]?{'next':_0x2357ab[_0x4dd19f(0xf3)]}:{},'with':{'target':{'journey':_0x1322cb,'stage':_0x2f26d1,'bundle_id':_0x2357ab[_0x4dd19f(0x163)][_0x4dd19f(0xdb)]}}};return _0x59365a;}case _0x4dd19f(0x182):{const _0x148400={'type':'end','name':_0x18afd0};return _0x148400;}default:{const _0x463e5e={'type':_0x4dd19f(0x158),'name':_0x18afd0};return _0x463e5e;}}}export async function journeyDefToRequest(_0x54e1c5,_0x4a413c,_0xbe7e26){const _0xb56faf=a108_0x12c3,_0x1bb76a=_0x54e1c5[_0xb56faf(0x18c)]||getActiveStages(_0x54e1c5),_0x5bd8f0=_0x54e1c5[_0xb56faf(0xe1)]||{},_0x167ac4=_0x54e1c5[_0xb56faf(0xea)]||{},_0x1b30c0={'type':_0xb56faf(0xe5),'attributes':{'name':_0x54e1c5['name'],'audienceId':_0x4a413c,'journeyStages':await Promise[_0xb56faf(0x154)](_0x1bb76a[_0xb56faf(0xd2)](_0x46d646=>convertYamlStageToApi(_0x46d646,_0xbe7e26,_0x5bd8f0,_0x167ac4)))}};_0x54e1c5['id']&&(_0x1b30c0['id']=_0x54e1c5['id']);_0x54e1c5[_0xb56faf(0x169)]&&(_0x1b30c0[_0xb56faf(0x174)][_0xb56faf(0x169)]=_0x54e1c5['description']);const _0x435517=getEffectiveGoal(_0x54e1c5);_0x435517&&(_0x1b30c0['attributes']['goal']=await convertYamlCriteriaToApi(_0x435517,_0xbe7e26,_0x5bd8f0));const _0x3f87a1=getEffectiveReentry(_0x54e1c5);return _0x3f87a1&&(_0x1b30c0[_0xb56faf(0x174)][_0xb56faf(0x101)]=_0x3f87a1,_0x1b30c0[_0xb56faf(0x174)][_0xb56faf(0xfe)]=_0x3f87a1!==_0xb56faf(0x128)),_0x54e1c5[_0xb56faf(0x14a)]&&(_0x1b30c0[_0xb56faf(0x14e)]={'parentFolder':{'data':{'id':_0x54e1c5[_0xb56faf(0x14a)],'type':_0xb56faf(0xf9)}}}),_0x1b30c0;}async function convertYamlStageToApi(_0x264a2e,_0x12b223,_0x10f83c={},_0x2cfeed={}){const _0x54d714=a108_0x12c3,_0x5ceb88={'name':_0x264a2e[_0x54d714(0x10a)]};_0x264a2e['id']&&(_0x5ceb88['id']=_0x264a2e['id']);_0x264a2e['description']&&(_0x5ceb88[_0x54d714(0x169)]=_0x264a2e['description']);_0x264a2e[_0x54d714(0x194)]&&(_0x5ceb88[_0x54d714(0x199)]=await convertYamlCriteriaToApi(_0x264a2e['entry_criteria'],_0x12b223,_0x10f83c));_0x264a2e[_0x54d714(0xfc)]&&_0x264a2e[_0x54d714(0xfc)][_0x54d714(0x148)]>0x0&&(_0x5ceb88[_0x54d714(0x10f)]=await Promise[_0x54d714(0x154)](_0x264a2e[_0x54d714(0xfc)]['map'](_0x3a8bae=>convertYamlCriteriaToApi(_0x3a8bae,_0x12b223,_0x10f83c))));_0x264a2e['milestone']&&(_0x5ceb88['milestone']=await convertYamlCriteriaToApi(_0x264a2e['milestone'],_0x12b223,_0x10f83c));if(_0x264a2e[_0x54d714(0xef)]&&_0x264a2e[_0x54d714(0xef)][_0x54d714(0x148)]>0x0){const _0x145630={},_0x3aea01=_0x264a2e[_0x54d714(0xef)][_0x54d714(0xd2)]((_0x224fdb,_0xe413d4)=>{const _0x3c8dde=_0x54d714,_0xad95a5=_0x224fdb[_0x3c8dde(0xce)]||generateUUID(),_0x4003d3=_0x224fdb[_0x3c8dde(0x10a)]||_0x224fdb[_0x3c8dde(0x16e)]+'_'+_0xe413d4;return _0x145630[_0x4003d3]=_0xad95a5,{..._0x224fdb,'name':_0x4003d3};});_0x5ceb88[_0x54d714(0xd8)]=_0x145630[_0x3aea01[0x0]['name']],_0x5ceb88['steps']={};for(let _0x1f06fa=0x0;_0x1f06fa<_0x3aea01[_0x54d714(0x148)];_0x1f06fa++){const _0x55131c=_0x3aea01[_0x1f06fa],_0x56bc13=_0x145630[_0x55131c[_0x54d714(0x10a)]],_0x511130=!_0x55131c[_0x54d714(0xf3)]&&_0x1f06fa<_0x3aea01[_0x54d714(0x148)]-0x1&&_0x55131c[_0x54d714(0x16e)]!==_0x54d714(0x158)?_0x3aea01[_0x1f06fa+0x1][_0x54d714(0x10a)]:_0x55131c[_0x54d714(0xf3)],_0x1008a7=_0x511130!==_0x55131c[_0x54d714(0xf3)]?{..._0x55131c,'next':_0x511130}:_0x55131c;_0x5ceb88[_0x54d714(0xef)][_0x56bc13]=await convertYamlStepToApi(_0x1008a7,_0x12b223,_0x10f83c,_0x145630,_0x2cfeed);}}else _0x264a2e['root_step']&&(_0x5ceb88[_0x54d714(0xd8)]=_0x264a2e[_0x54d714(0xcd)]);return _0x5ceb88;}async function convertYamlCriteriaToApi(_0x37fdf4,_0x4473de,_0x48a47d={}){const _0x17c9bf=a108_0x12c3;let _0x1322a6=_0x37fdf4[_0x17c9bf(0x130)];if(_0x1322a6&&!/^\d+$/[_0x17c9bf(0x156)](_0x1322a6)){const _0x52c890=parseSegmentRef(_0x1322a6);if(_0x52c890[_0x17c9bf(0x16e)]==='ref')_0x4473de?.['resolveSegmentId']&&(_0x1322a6=await _0x4473de[_0x17c9bf(0x162)](_0x52c890[_0x17c9bf(0x10a)]));else{if(_0x52c890[_0x17c9bf(0x16e)]===_0x17c9bf(0xf2)&&_0x48a47d[_0x52c890['name']])_0x4473de?.['resolveEmbeddedSegmentId']&&(_0x1322a6=await _0x4473de[_0x17c9bf(0x196)](_0x52c890[_0x17c9bf(0x10a)],_0x48a47d[_0x52c890[_0x17c9bf(0x10a)]]));else _0x4473de?.[_0x17c9bf(0x162)]&&(_0x1322a6=await _0x4473de[_0x17c9bf(0x162)](_0x52c890[_0x17c9bf(0x10a)]));}}const _0x25140d={'name':_0x37fdf4[_0x17c9bf(0x10a)],'segmentId':_0x1322a6};_0x37fdf4[_0x17c9bf(0x169)]&&(_0x25140d[_0x17c9bf(0x169)]=_0x37fdf4['description']);if(_0x37fdf4[_0x17c9bf(0x163)]){const _0x30853d=_0x37fdf4[_0x17c9bf(0x163)][_0x17c9bf(0xe5)],_0x47e4b7=_0x37fdf4[_0x17c9bf(0x163)][_0x17c9bf(0x124)];let _0x225404=_0x37fdf4[_0x17c9bf(0x163)]['journey'];_0x4473de?.[_0x17c9bf(0x186)]&&!/^\d+$/[_0x17c9bf(0x156)](_0x225404)&&(_0x225404=await _0x4473de[_0x17c9bf(0x186)](_0x225404));let _0x2f4242=_0x37fdf4[_0x17c9bf(0x163)][_0x17c9bf(0x124)];_0x4473de?.['resolveStageId']&&!/^\d+$/[_0x17c9bf(0x156)](_0x2f4242)&&(_0x2f4242=await _0x4473de[_0x17c9bf(0x11b)](_0x225404,_0x2f4242));const _0x3a795f=!/^\d+$/[_0x17c9bf(0x156)](_0x30853d)&&!isLocalJourneyRef(_0x30853d)?formatApiJourneyName(_0x30853d,_0x47e4b7):undefined;_0x25140d[_0x17c9bf(0x163)]={'journeyId':_0x225404,'journeyStageId':_0x2f4242,'journeyName':_0x3a795f,'confirmed':!![]},_0x37fdf4[_0x17c9bf(0x163)][_0x17c9bf(0x147)]&&(_0x25140d[_0x17c9bf(0x163)][_0x17c9bf(0xdb)]=_0x37fdf4[_0x17c9bf(0x163)][_0x17c9bf(0x147)]);}return _0x25140d;}async function convertYamlStepToApi(_0x45e65d,_0x329984,_0x110c80={},_0x1d04be={},_0x3fc663={}){const _0x280ab2=a108_0x12c3,_0x390a58=async _0x4663cf=>{const _0x6ac955=a108_0x12c3;if(/^\d+$/['test'](_0x4663cf))return _0x4663cf;const _0x1ec7cc=parseSegmentRef(_0x4663cf);if(_0x1ec7cc[_0x6ac955(0x16e)]===_0x6ac955(0x121)){if(_0x329984?.['resolveSegmentId'])return await _0x329984['resolveSegmentId'](_0x1ec7cc['name']);}else{if(_0x1ec7cc['type']==='embedded'&&_0x110c80[_0x1ec7cc[_0x6ac955(0x10a)]]){if(_0x329984?.['resolveEmbeddedSegmentId'])return await _0x329984[_0x6ac955(0x196)](_0x1ec7cc['name'],_0x110c80[_0x1ec7cc[_0x6ac955(0x10a)]]);}else{if(_0x329984?.[_0x6ac955(0x162)])return await _0x329984[_0x6ac955(0x162)](_0x1ec7cc['name']);}}return _0x4663cf;},_0x37f549=async _0x3a54c3=>{const _0x558cf8=a108_0x12c3;if(/^\d+$/[_0x558cf8(0x156)](_0x3a54c3))return _0x3a54c3;const _0x5bac0a=parseSegmentRef(_0x3a54c3);if(_0x5bac0a[_0x558cf8(0x16e)]===_0x558cf8(0x121)){if(_0x329984?.[_0x558cf8(0xf7)])return await _0x329984[_0x558cf8(0xf7)](_0x5bac0a[_0x558cf8(0x10a)]);return _0x5bac0a[_0x558cf8(0x10a)];}else{if(_0x5bac0a['type']===_0x558cf8(0xf2)&&_0x3fc663[_0x5bac0a[_0x558cf8(0x10a)]]){if(_0x329984?.[_0x558cf8(0xd9)])return await _0x329984['resolveEmbeddedActivationId'](_0x5bac0a['name'],_0x3fc663[_0x5bac0a[_0x558cf8(0x10a)]]);if(_0x329984?.[_0x558cf8(0xf7)])return await _0x329984[_0x558cf8(0xf7)](_0x5bac0a[_0x558cf8(0x10a)]);}else{if(_0x329984?.[_0x558cf8(0xf7)])return await _0x329984['resolveActivationId'](_0x5bac0a[_0x558cf8(0x10a)]);}}return _0x3a54c3;},_0x139b68=_0x31f90d=>{if(!_0x31f90d)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'](_0x31f90d))return _0x31f90d;return _0x1d04be[_0x31f90d]||_0x31f90d;};switch(_0x45e65d[_0x280ab2(0x16e)]){case _0x280ab2(0x12f):{const _0x440662=_0x45e65d,_0x1b9d0d=_0x440662[_0x280ab2(0x18f)],_0x908262={'type':_0x280ab2(0x133),'name':_0x440662['name'],'next':_0x139b68(_0x440662[_0x280ab2(0xf3)])};if(_0x1b9d0d['duration']!==undefined&&_0x1b9d0d[_0x280ab2(0x10b)])_0x908262[_0x280ab2(0xd7)]=_0x280ab2(0x188),_0x908262[_0x280ab2(0x143)]=_0x1b9d0d[_0x280ab2(0x139)],_0x908262[_0x280ab2(0x16c)]=normalizeWaitUnit(_0x1b9d0d[_0x280ab2(0x10b)]);else{if(_0x1b9d0d[_0x280ab2(0x11e)])_0x908262[_0x280ab2(0xd7)]='Date',_0x908262['waitUntilDate']=_0x1b9d0d[_0x280ab2(0x11e)];else{if(_0x1b9d0d[_0x280ab2(0x108)])_0x908262[_0x280ab2(0xd7)]='DaysOfTheWeek',_0x908262[_0x280ab2(0x195)]=_0x1b9d0d[_0x280ab2(0x108)];else{if(_0x1b9d0d[_0x280ab2(0x177)]){_0x908262['waitStepType']=_0x280ab2(0xec);const _0x5a92e2=await _0x390a58(_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0x130)]),_0xf03054=_0x1b9d0d['condition'][_0x280ab2(0x142)]?.[_0x280ab2(0xf3)]!==undefined;if(_0xf03054){const _0x565f41=[];_0x565f41[_0x280ab2(0xf0)]({'id':generateUUID(),'segmentId':_0x5a92e2,'timedOutPath':![],'next':_0x139b68(_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0xf3)]??_0x440662[_0x280ab2(0xf3)])}),_0x1b9d0d[_0x280ab2(0x177)]['timeout']&&_0x565f41[_0x280ab2(0xf0)]({'id':generateUUID(),'timedOutPath':!![],'moveAfter':_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0x142)][_0x280ab2(0x139)],'unit':normalizeWaitUnit(_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0x142)][_0x280ab2(0x10b)]),'next':_0x139b68(_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0x142)][_0x280ab2(0xf3)])}),_0x908262[_0x280ab2(0xed)]=_0x565f41;}else _0x908262[_0x280ab2(0x17b)]=_0x5a92e2,_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0x142)]&&(_0x908262['conditionTimeoutDuration']=_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0x142)]['duration'],_0x1b9d0d['condition'][_0x280ab2(0x142)]['unit']&&(_0x908262[_0x280ab2(0xf1)]=normalizeWaitUnit(_0x1b9d0d[_0x280ab2(0x177)][_0x280ab2(0x142)][_0x280ab2(0x10b)])));}}}}return _0x908262;}case'activation':{const _0x37852c=_0x45e65d,_0x35f941=_0x37852c[_0x280ab2(0x18f)][_0x280ab2(0xe3)],_0x38180e=await _0x37f549(_0x35f941);return{'type':_0x280ab2(0x12d),'name':_0x37852c['name'],'journeyActivationStepId':_0x38180e,'next':_0x139b68(_0x37852c['next'])};}case _0x280ab2(0x18a):{const _0x383cf7=_0x45e65d,_0x34c5ba=_0x383cf7['with'][_0x280ab2(0x190)];return{'type':_0x280ab2(0x138),'name':_0x383cf7[_0x280ab2(0x10a)],'branches':await Promise[_0x280ab2(0x154)](_0x34c5ba[_0x280ab2(0xd2)](async _0x2e8c19=>{const _0x2e35ce=_0x280ab2;let _0x36b436='';if(!_0x2e8c19[_0x2e35ce(0x181)]){const _0x4769e3=_0x2e8c19[_0x2e35ce(0x130)]||_0x2e8c19[_0x2e35ce(0x161)]||'';_0x36b436=_0x4769e3?await _0x390a58(_0x4769e3):'';}return{'id':crypto['randomUUID'](),'name':_0x2e8c19['name'],'description':null,'segmentId':_0x36b436,'excludedPath':_0x2e8c19[_0x2e35ce(0x181)]??![],'next':_0x139b68(_0x2e8c19['next'])};})),'next':_0x139b68(_0x383cf7[_0x280ab2(0xf3)])};}case _0x280ab2(0xeb):{const _0x534a0d=_0x45e65d,_0x2db581=_0x534a0d['with'];return{'type':'ABTest','name':_0x534a0d[_0x280ab2(0x10a)],'customizedSplit':_0x2db581[_0x280ab2(0x15f)],'uniqueId':_0x2db581[_0x280ab2(0x11a)],'variants':_0x2db581[_0x280ab2(0x17e)][_0x280ab2(0xd2)](_0x258997=>({'id':_0x258997['id']||generateUUID(),'name':_0x258997['name'],'percentage':_0x258997[_0x280ab2(0x11d)],'next':_0x139b68(_0x258997[_0x280ab2(0xf3)])})),'next':_0x139b68(_0x534a0d['next'])};}case _0x280ab2(0x150):return{'type':_0x280ab2(0x144),'name':_0x45e65d['name'],'next':_0x139b68(_0x45e65d[_0x280ab2(0xf3)])};case _0x280ab2(0x14d):{const _0x461048=_0x45e65d,_0x37016c=_0x461048[_0x280ab2(0x18f)][_0x280ab2(0x163)],_0x189637=_0x37016c[_0x280ab2(0xe5)],_0x53ce1a=_0x37016c[_0x280ab2(0x124)];let _0x367947=_0x37016c[_0x280ab2(0xe5)];_0x329984?.['resolveJourneyId']&&!/^\d+$/[_0x280ab2(0x156)](_0x367947)&&(_0x367947=await _0x329984[_0x280ab2(0x186)](_0x367947));let _0x244401=_0x37016c['stage'];_0x329984?.['resolveStageId']&&!/^\d+$/[_0x280ab2(0x156)](_0x244401)&&(_0x244401=await _0x329984[_0x280ab2(0x11b)](_0x367947,_0x244401));const _0x436fb3=!/^\d+$/[_0x280ab2(0x156)](_0x189637)&&!isLocalJourneyRef(_0x189637)?formatApiJourneyName(_0x189637,_0x53ce1a):undefined;return{'type':'Jump','name':_0x461048[_0x280ab2(0x10a)],'target':{'journeyId':_0x367947,'journeyStageId':_0x244401,'journeyBundleId':_0x37016c[_0x280ab2(0x147)],'journeyName':_0x436fb3,'confirmed':!![]},'next':_0x139b68(_0x461048[_0x280ab2(0xf3)])};}case'end':return{'type':_0x280ab2(0x182),'name':_0x45e65d[_0x280ab2(0x10a)]};default:{const _0x12722d=_0x45e65d;return{'type':_0x280ab2(0x182),'name':_0x12722d[_0x280ab2(0x10a)]};}}}export function toYamlString(_0x5ebd12){const _0x17993f=a108_0x12c3,_0x7292eb=stripInternalFields(_0x5ebd12),_0x44fe44=a108_0x19135e[_0x17993f(0x106)](_0x7292eb,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x3a8718=['segments:',_0x17993f(0xff),'goal:',_0x17993f(0x173),_0x17993f(0x157),'stages:','versions:'];let _0x3f5066=_0x44fe44;for(const _0x5e4a71 of _0x3a8718){_0x3f5066=_0x3f5066['replace'](new RegExp('^('+_0x5e4a71+')','m'),(_0x3d2008,_0x19b4f8,_0x221434)=>{if(_0x221434===0x0||_0x3f5066[_0x221434-0x1]==='\x0a'&&_0x3f5066[_0x221434-0x2]==='\x0a')return _0x19b4f8;return'\x0a'+_0x19b4f8;});}return _0x3f5066;}function stripInternalFields(_0x2d245b){const _0x35b119=a108_0x12c3,{id:_0x3f5e90,folder_id:_0x423211,bundle_id:_0x24accc,bundle_name:_0x4f8558,version:_0x3de436,version_number:_0x5acc74,allow_reentry:_0x113900,..._0x1b2126}=_0x2d245b;return _0x1b2126['journeys']&&(_0x1b2126['journeys']=_0x1b2126['journeys'][_0x35b119(0xd2)](_0x15bd35=>{const _0x1d5088=_0x35b119,{id:_0x461803,version_number:_0x61c6ef,..._0x3f9609}=_0x15bd35;return{..._0x3f9609,'stages':_0x3f9609[_0x1d5088(0x18c)]['map'](stripStageInternalFields),..._0x15bd35[_0x1d5088(0xdc)]===!![]?{'latest':!![]}:{},..._0x1b2126['journeys'][_0x1d5088(0x148)]===0x1&&_0x3f9609[_0x1d5088(0x18e)]==='v1'?{'version':undefined}:{}};})),_0x1b2126[_0x35b119(0x18c)]&&(_0x1b2126['stages']=_0x1b2126[_0x35b119(0x18c)][_0x35b119(0xd2)](stripStageInternalFields)),_0x1b2126[_0x35b119(0x168)]&&(_0x1b2126['versions']=_0x1b2126[_0x35b119(0x168)][_0x35b119(0xd2)](_0x2a1b8c=>{const _0x2d6f19=_0x35b119,{id:_0x5c0770,version_number:_0x1c6bf0,..._0x315b32}=_0x2a1b8c;return{..._0x315b32,'stages':_0x315b32[_0x2d6f19(0x18c)][_0x2d6f19(0xd2)](stripStageInternalFields),..._0x2a1b8c['latest']===!![]?{'latest':!![]}:{}};})),_0x1b2126;}function stripStageInternalFields(_0x23016b){const {id:_0x6aedd3,..._0x3cf8e8}=_0x23016b;return _0x3cf8e8;}export function parseYamlString(_0x671d9f){const _0x54bd88=a108_0x12c3,_0x174ad1=a108_0x19135e[_0x54bd88(0x191)](_0x671d9f);if(_0x174ad1[_0x54bd88(0x16e)]!==_0x54bd88(0xe5))throw new SDKError(ErrorCode[_0x54bd88(0x107)],'Journey\x20YAML\x20must\x20have\x20type:\x20journey');if(!_0x174ad1[_0x54bd88(0x10a)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20missing\x20required\x20field:\x20name');const _0x511b54=_0x174ad1[_0x54bd88(0x16d)]&&Array[_0x54bd88(0x172)](_0x174ad1[_0x54bd88(0x16d)])&&_0x174ad1[_0x54bd88(0x16d)][_0x54bd88(0x148)]>0x0,_0x19a73a=_0x174ad1[_0x54bd88(0x18c)]&&Array[_0x54bd88(0x172)](_0x174ad1[_0x54bd88(0x18c)])&&_0x174ad1[_0x54bd88(0x18c)]['length']>0x0,_0x138a46=_0x174ad1[_0x54bd88(0x168)]&&Array[_0x54bd88(0x172)](_0x174ad1[_0x54bd88(0x168)])&&_0x174ad1['versions'][_0x54bd88(0x148)]>0x0,_0x9c4033=[_0x511b54,_0x19a73a,_0x138a46][_0x54bd88(0x13d)](Boolean)['length'];if(_0x9c4033>0x1)throw new SDKError(ErrorCode[_0x54bd88(0x107)],_0x54bd88(0xcf));if(_0x9c4033===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Journey\x20YAML\x20must\x20have\x20journeys\x20array\x20(recommended),\x20stages\x20(legacy),\x20or\x20versions\x20(legacy)');if(_0x511b54){for(let _0x340a55=0x0;_0x340a55<_0x174ad1['journeys'][_0x54bd88(0x148)];_0x340a55++){const _0x6b88a=_0x174ad1[_0x54bd88(0x16d)][_0x340a55];if(!_0x6b88a[_0x54bd88(0x18c)]||!Array[_0x54bd88(0x172)](_0x6b88a[_0x54bd88(0x18c)])||_0x6b88a[_0x54bd88(0x18c)][_0x54bd88(0x148)]===0x0)throw new SDKError(ErrorCode[_0x54bd88(0x107)],'Journey\x20YAML\x20journeys['+_0x340a55+_0x54bd88(0x171));if(_0x6b88a[_0x54bd88(0xd0)]&&![_0x54bd88(0xd1),_0x54bd88(0xd5)][_0x54bd88(0xf4)](_0x6b88a[_0x54bd88(0xd0)]))throw new SDKError(ErrorCode[_0x54bd88(0x107)],_0x54bd88(0x16f)+_0x340a55+_0x54bd88(0x183)+_0x6b88a[_0x54bd88(0xd0)]+_0x54bd88(0x13e));validateStages(_0x6b88a[_0x54bd88(0x18c)],_0x54bd88(0x131)+_0x340a55+_0x54bd88(0x17a));}const _0x31c5c8=_0x174ad1[_0x54bd88(0x16d)][_0x54bd88(0x13d)](_0x1f721b=>_0x1f721b[_0x54bd88(0xdc)]===!![])[_0x54bd88(0x148)];if(_0x31c5c8>0x1)throw new SDKError(ErrorCode[_0x54bd88(0x107)],_0x54bd88(0x167));}_0x19a73a&&validateStages(_0x174ad1['stages'],'stages');if(_0x138a46){for(let _0x2e9a61=0x0;_0x2e9a61<_0x174ad1[_0x54bd88(0x168)]['length'];_0x2e9a61++){const _0x1ed0da=_0x174ad1[_0x54bd88(0x168)][_0x2e9a61];if(!_0x1ed0da[_0x54bd88(0x10a)])throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x54bd88(0x15c)+_0x2e9a61+_0x54bd88(0xe7));if(!_0x1ed0da['state']||![_0x54bd88(0xd1),_0x54bd88(0xd5)][_0x54bd88(0xf4)](_0x1ed0da[_0x54bd88(0xd0)]))throw new SDKError(ErrorCode[_0x54bd88(0x107)],'Journey\x20YAML\x20versions['+_0x2e9a61+_0x54bd88(0x183)+_0x1ed0da[_0x54bd88(0xd0)]+_0x54bd88(0x13e));if(!_0x1ed0da['stages']||!Array[_0x54bd88(0x172)](_0x1ed0da['stages'])||_0x1ed0da[_0x54bd88(0x18c)][_0x54bd88(0x148)]===0x0)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x54bd88(0x15c)+_0x2e9a61+_0x54bd88(0x171));validateStages(_0x1ed0da[_0x54bd88(0x18c)],'versions['+_0x2e9a61+'].stages');}const _0x4e797e=_0x174ad1['versions'][_0x54bd88(0x13d)](_0x24f498=>_0x24f498['latest']===!![])[_0x54bd88(0x148)];if(_0x4e797e>0x1)throw new SDKError(ErrorCode[_0x54bd88(0x107)],_0x54bd88(0x14f));}return _0x174ad1;}function validateStages(_0x443fa2,_0x3a6ca3){const _0x5f23f2=a108_0x12c3;if(_0x443fa2[_0x5f23f2(0x148)]>0x8)throw new SDKError(ErrorCode[_0x5f23f2(0x107)],_0x5f23f2(0xe2)+_0x3a6ca3+':\x20maximum\x208\x20stages\x20allowed');}export function isJourneyDef(_0x18f21a){const _0x1a444c=a108_0x12c3;return typeof _0x18f21a==='object'&&_0x18f21a!==null&&_0x1a444c(0x16e)in _0x18f21a&&_0x18f21a[_0x1a444c(0x16e)]==='journey';}function a108_0x29fb(){const _0x5d7ced=['reentry:','attributes','toLowerCase','isJourneyLocal','condition','journeyStageId','ABTest','].stages','conditionSegmentId','ref:','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','variants','\x20\x20\x20\x20type:\x20','\x27:\x20','excluded','End',']\x20has\x20invalid\x20state:\x20','exitCriteria','waitUntilDate','resolveJourneyId','activation_template_id','Duration','journeyActivationStepId','decision_point','\x22\x20is\x20missing\x20required\x20target\x20(journey\x20and\x20stage)','stages','Stage\x201','version','with','branches','parse','data','\x27.\x0a','entry_criteria','daysOfWeek','resolveEmbeddedSegmentId','stageId','sort','entryCriteria','root_step','uuid','Journey\x20YAML\x20cannot\x20have\x20multiple\x20format\x20fields\x20(journeys,\x20stages,\x20versions).\x20Use\x20only\x20one\x20format.','state','draft','map','definition','14hgSmrF','launched','milestone','waitStepType','rootStep','resolveEmbeddedActivationId','\x20\x20\x20\x20type:\x20And\x0a','journeyBundleId','latest','keys','startsWith','replace','parentFolder','segments','Journey\x20YAML\x20','activation','journeyName','journey','3931422tWFBie',']\x20missing\x20required\x20field:\x20name','5607864agsrJv','116096ZutZKU','activations','ab_test','Condition','conditions','reentry','steps','push','conditionTimeoutUnit','embedded','next','includes','resolveActivation','versionNumber','resolveActivationId','Date','folder','trim','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','exit_criteria','weeks','allowReentry','activations:','week','reentryMode','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','Expected\x20format:\x0a','resolveSegmentName','waitCondition','stringify','JOURNEY_SYNTAX_ERROR','days_of_week','Unknown\x20segment\x20\x22','name','unit','Variant','timedOutPath','\x20\x20\x20\x20conditions:\x0a','exitCriterias','resolveActivationName','connection','354185JbBIVj','connector_config','shift','Jump\x20step\x20\x22','2558647HVwBRK','get','20777481pJGNqc','journeyId','unique_id','resolveStageId','version_number','percentage','wait_until','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','bundle_name','ref','all_columns','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','stage','find','Wait\x201\x20Day','44308IQGtVs','no_reentry','Send\x20Notification','set','segmentId','goal','Activation','(missing)','wait','segment','journeys[','columns','WaitStep','conditionTimeoutDuration','object','your-activation-name','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','DecisionPoint','duration','day','from','And','filter','.\x20Must\x20be\x20\x27draft\x27\x20or\x20\x27launched\x27.','goal-segment','add','journeyBundleName','timeout','waitStep','Merge','resolveSegment','values','bundle_id','length','DaysOfTheWeek','folder_id','Journey\x20description','\x20\x20rule:\x0a','jump','relationships','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20version\x20with\x20latest:\x20true','merge','notification','behavior','schedule','all','Goal\x20Achieved','test','journeys:','end','resolveJumpTarget','3GzPhwR','stageName','Journey\x20YAML\x20versions[','randomUUID','customizedSplit','customized_split','has','segment_id','resolveSegmentId','target','size','rule','AbTest','Journey\x20YAML\x20can\x20have\x20at\x20most\x20one\x20journey\x20entry\x20with\x20latest:\x20true','versions','description','journeyStages','slice','waitStepUnit','journeys','type','Journey\x20YAML\x20journeys[','Entry\x20Criteria',']\x20missing\x20required\x20field:\x20stages','isArray'];a108_0x29fb=function(){return _0x5d7ced;};return a108_0x29fb();}export function generateTemplate(_0x267736,_0x152c2a){const _0xa8b7f0=a108_0x12c3,_0x5d0653={'type':_0xa8b7f0(0xe5),'name':_0x267736,'description':_0xa8b7f0(0x14b),'reentry':_0xa8b7f0(0x128),'goal':{'name':_0xa8b7f0(0x155),'segment':_0xa8b7f0(0x13f)},'stages':[{'name':_0xa8b7f0(0x18d),'description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':_0xa8b7f0(0x170),'segment':_0x152c2a},'steps':[{'type':'wait','name':_0xa8b7f0(0x126),'with':{'duration':0x1,'unit':'day'}},{'type':_0xa8b7f0(0xe3),'name':_0xa8b7f0(0x129),'with':{'activation':_0xa8b7f0(0x136)}},{'type':'end','name':'Stage\x20Complete'}]}]};return toYamlString(_0x5d0653);}function generateUUID(){const _0x1338be=a108_0x12c3;return crypto[_0x1338be(0x15d)]();}export const SEGMENT_REF_PREFIX=a108_0x547e7a(0x17c);export function parseSegmentRef(_0x4ce151){const _0x1b4661=a108_0x547e7a;if(_0x4ce151[_0x1b4661(0xde)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x4ce151[_0x1b4661(0x16b)](SEGMENT_REF_PREFIX[_0x1b4661(0x148)])};if(/^\d+$/[_0x1b4661(0x156)](_0x4ce151))return{'type':'id','name':_0x4ce151};return{'type':_0x1b4661(0xf2),'name':_0x4ce151};}export function makeSegmentRef(_0x47a05e){return''+SEGMENT_REF_PREFIX+_0x47a05e;}export function isExternalSegmentRef(_0x30660a){const _0x1715ee=a108_0x547e7a;return _0x30660a[_0x1715ee(0xde)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x4b1788){const _0x510ba5=a108_0x547e7a;return!!(_0x4b1788[_0x510ba5(0x16d)]&&_0x4b1788['journeys']['length']>0x0);}export function isMultiVersionMode(_0x4436e3){const _0x271a62=a108_0x547e7a;return!!(_0x4436e3[_0x271a62(0x168)]&&_0x4436e3[_0x271a62(0x168)][_0x271a62(0x148)]>0x0);}export function isSingleVersionMode(_0x40b571){const _0x589713=a108_0x547e7a;return!!(_0x40b571[_0x589713(0x18c)]&&_0x40b571[_0x589713(0x18c)]['length']>0x0);}export function hasMultipleVersions(_0x57d5a1){const _0x207dad=a108_0x547e7a;if(isJourneysArrayMode(_0x57d5a1))return(_0x57d5a1[_0x207dad(0x16d)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x57d5a1))return(_0x57d5a1[_0x207dad(0x168)]?.[_0x207dad(0x148)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x21b847){const _0x245c45=a108_0x547e7a;if(isJourneysArrayMode(_0x21b847))return _0x21b847;if(isSingleVersionMode(_0x21b847)){const {stages:_0x24944d,id:_0x74cd49,version:_0x285148,version_number:_0x353320,..._0x44729b}=_0x21b847;return{..._0x44729b,'journeys':[{'version':_0x285148||'v1','stages':_0x24944d||[],'id':_0x74cd49,'version_number':_0x353320}]};}if(isMultiVersionMode(_0x21b847)){const {versions:_0xaa2440,..._0x24b7e7}=_0x21b847;return{..._0x24b7e7,'journeys':(_0xaa2440||[])[_0x245c45(0xd2)](_0x16b4f1=>({'version':_0x16b4f1[_0x245c45(0x10a)],'state':_0x16b4f1[_0x245c45(0xd0)],'latest':_0x16b4f1[_0x245c45(0xdc)],'stages':_0x16b4f1[_0x245c45(0x18c)],'id':_0x16b4f1['id'],'version_number':_0x16b4f1['version_number']}))};}return _0x21b847;}export function normalizeJourneyDef(_0x4e27cf,_0x41961c){const _0x18bfdf=a108_0x547e7a,_0x94478a=normalizeToJourneysFormat(_0x4e27cf),_0x55da21=_0x41961c?.[_0x18bfdf(0xe1)]?Object[_0x18bfdf(0xdd)](_0x41961c[_0x18bfdf(0xe1)]):undefined,_0x14d99d=_0x41961c?.[_0x18bfdf(0xea)]?Object['keys'](_0x41961c[_0x18bfdf(0xea)]):undefined;return{'type':_0x18bfdf(0xe5),'name':_0x94478a[_0x18bfdf(0x10a)],..._0x94478a[_0x18bfdf(0x169)]!==undefined&&{'description':_0x94478a['description']},..._0x94478a['goal']&&{'goal':normalizeJourneyCriteria(_0x94478a['goal'])},..._0x94478a[_0x18bfdf(0xee)]!==undefined&&{'reentry':_0x94478a[_0x18bfdf(0xee)]},..._0x94478a[_0x18bfdf(0xe1)]&&{'segments':normalizeEmbeddedSegments(_0x94478a[_0x18bfdf(0xe1)],_0x55da21)},..._0x94478a[_0x18bfdf(0xea)]&&{'activations':normalizeEmbeddedActivations(_0x94478a[_0x18bfdf(0xea)],_0x14d99d)},..._0x94478a[_0x18bfdf(0x16d)]&&{'journeys':_0x94478a[_0x18bfdf(0x16d)][_0x18bfdf(0xd2)](_0x2b510f=>normalizeJourneyEntry(_0x2b510f,_0x94478a['journeys'][_0x18bfdf(0x148)]===0x1))}};}function normalizeJourneyEntry(_0x49c45c,_0x1ad73b){const _0x166d9e=a108_0x547e7a;return{...!_0x1ad73b&&_0x49c45c[_0x166d9e(0x18e)]!==undefined&&{'version':_0x49c45c[_0x166d9e(0x18e)]},..._0x49c45c[_0x166d9e(0xd0)]!==undefined&&{'state':_0x49c45c['state']},...!_0x1ad73b&&_0x49c45c[_0x166d9e(0xdc)]!==undefined&&{'latest':_0x49c45c['latest']},..._0x49c45c[_0x166d9e(0x12c)]&&{'goal':normalizeJourneyCriteria(_0x49c45c[_0x166d9e(0x12c)])},..._0x49c45c['reentry']!==undefined&&{'reentry':_0x49c45c[_0x166d9e(0xee)]},'stages':_0x49c45c[_0x166d9e(0x18c)][_0x166d9e(0xd2)](normalizeJourneyStage)};}function a108_0x12c3(_0x1a9d5a,_0xbc8aff){_0x1a9d5a=_0x1a9d5a-0xcd;const _0x29fb90=a108_0x29fb();let _0x12c3cf=_0x29fb90[_0x1a9d5a];return _0x12c3cf;}function normalizeJourneyStage(_0x85b79f){const _0x3a74f1=a108_0x547e7a;return{'name':_0x85b79f['name'],..._0x85b79f['description']!==undefined&&{'description':_0x85b79f[_0x3a74f1(0x169)]},..._0x85b79f[_0x3a74f1(0x194)]&&{'entry_criteria':normalizeJourneyCriteria(_0x85b79f[_0x3a74f1(0x194)])},..._0x85b79f[_0x3a74f1(0xfc)]&&{'exit_criteria':_0x85b79f[_0x3a74f1(0xfc)][_0x3a74f1(0xd2)](normalizeJourneyCriteria)},..._0x85b79f[_0x3a74f1(0xd6)]&&{'milestone':normalizeJourneyCriteria(_0x85b79f['milestone'])},..._0x85b79f[_0x3a74f1(0xef)]&&{'steps':normalizeStepsWithImplicitNext(_0x85b79f['steps'])}};}function normalizeStepsWithImplicitNext(_0x1a9539){const _0x176296=a108_0x547e7a;return _0x1a9539[_0x176296(0xd2)]((_0x550e20,_0xddc5eb)=>{const _0x14c4a3=_0x176296,_0x38fca8=_0xddc5eb<_0x1a9539[_0x14c4a3(0x148)]-0x1?_0x1a9539[_0xddc5eb+0x1]['name']:undefined;return normalizeJourneyStep(_0x550e20,_0x38fca8);});}function normalizeJourneyCriteria(_0x42af65){const _0x160999=a108_0x547e7a;return{'name':_0x42af65[_0x160999(0x10a)],..._0x42af65['description']!==undefined&&{'description':_0x42af65['description']},'segment':_0x42af65[_0x160999(0x130)],..._0x42af65[_0x160999(0x163)]&&{'target':normalizeJumpTarget(_0x42af65[_0x160999(0x163)])}};}function normalizeJourneyStep(_0x5b3504,_0x3399a2){const _0x1b61e0=a108_0x547e7a,_0x43d3bf=_0x5b3504[_0x1b61e0(0xf3)]!==undefined&&_0x5b3504['next']!==_0x3399a2,_0x1a052b={'type':_0x5b3504['type'],'name':_0x5b3504[_0x1b61e0(0x10a)],..._0x43d3bf&&{'next':_0x5b3504['next']}};if(_0x1b61e0(0x18f)in _0x5b3504&&_0x5b3504[_0x1b61e0(0x18f)])return{..._0x1a052b,'with':normalizeStepParams(_0x5b3504[_0x1b61e0(0x16e)],_0x5b3504[_0x1b61e0(0x18f)])};return _0x1a052b;}function normalizeStepParams(_0x45570e,_0x84ebbd){const _0x372f03=a108_0x547e7a;switch(_0x45570e){case _0x372f03(0x12f):{const _0x5338fc=_0x84ebbd;let _0x9d0aed;return _0x5338fc['condition']&&(_0x9d0aed={'segment':_0x5338fc[_0x372f03(0x177)]['segment'],..._0x5338fc[_0x372f03(0x177)][_0x372f03(0xf3)]!==undefined&&{'next':_0x5338fc['condition'][_0x372f03(0xf3)]},..._0x5338fc['condition'][_0x372f03(0x142)]&&{'timeout':{'duration':_0x5338fc[_0x372f03(0x177)][_0x372f03(0x142)]['duration'],'unit':_0x5338fc['condition'][_0x372f03(0x142)][_0x372f03(0x10b)],..._0x5338fc[_0x372f03(0x177)][_0x372f03(0x142)][_0x372f03(0xf3)]!==undefined&&{'next':_0x5338fc['condition']['timeout'][_0x372f03(0xf3)]}}}}),{..._0x5338fc[_0x372f03(0x139)]!==undefined&&{'duration':_0x5338fc[_0x372f03(0x139)]},..._0x5338fc['unit']!==undefined&&{'unit':_0x5338fc[_0x372f03(0x10b)]},..._0x5338fc['wait_until']!==undefined&&{'wait_until':_0x5338fc[_0x372f03(0x11e)]},..._0x5338fc['days_of_week']!==undefined&&{'days_of_week':_0x5338fc[_0x372f03(0x108)]},..._0x9d0aed&&{'condition':_0x9d0aed}};}case _0x372f03(0xe3):{const _0x69dde3=_0x84ebbd;return{'activation':_0x69dde3[_0x372f03(0xe3)]};}case _0x372f03(0x18a):{const _0x31ff80=_0x84ebbd;return{'branches':_0x31ff80[_0x372f03(0x190)][_0x372f03(0xd2)](normalizeDecisionBranch)};}case _0x372f03(0xeb):{const _0x396ed5=_0x84ebbd;return{..._0x396ed5[_0x372f03(0x15f)]!==undefined&&{'customized_split':_0x396ed5[_0x372f03(0x15f)]},..._0x396ed5['unique_id']!==undefined&&{'unique_id':_0x396ed5[_0x372f03(0x11a)]},'variants':_0x396ed5['variants']['map'](normalizeAbTestVariant)};}case _0x372f03(0x14d):{const _0xcc2b88=_0x84ebbd;return{'target':normalizeJumpTarget(_0xcc2b88[_0x372f03(0x163)])};}default:return _0x84ebbd;}}function normalizeDecisionBranch(_0xec24cb){const _0x40dda7=a108_0x547e7a;return{'name':_0xec24cb['name'],..._0xec24cb[_0x40dda7(0x130)]!==undefined&&{'segment':_0xec24cb[_0x40dda7(0x130)]},..._0xec24cb[_0x40dda7(0x181)]!==undefined&&{'excluded':_0xec24cb[_0x40dda7(0x181)]},..._0xec24cb[_0x40dda7(0xf3)]!==undefined&&{'next':_0xec24cb[_0x40dda7(0xf3)]}};}function normalizeAbTestVariant(_0x8d9988){const _0x5def7d=a108_0x547e7a;return{..._0x8d9988['id']!==undefined&&{'id':_0x8d9988['id']},'name':_0x8d9988[_0x5def7d(0x10a)],'percentage':_0x8d9988[_0x5def7d(0x11d)],..._0x8d9988[_0x5def7d(0xf3)]!==undefined&&{'next':_0x8d9988[_0x5def7d(0xf3)]}};}function normalizeJumpTarget(_0x246d02){const _0x3de6ee=a108_0x547e7a;return{'journey':_0x246d02[_0x3de6ee(0xe5)],'stage':_0x246d02[_0x3de6ee(0x124)],..._0x246d02[_0x3de6ee(0x147)]!==undefined&&{'bundle_id':_0x246d02[_0x3de6ee(0x147)]}};}function normalizeEmbeddedSegments(_0x3d447e,_0x466cb5){const _0x1c56fd=a108_0x547e7a,_0xed8ba5={},_0x26d0ee=Object[_0x1c56fd(0xdd)](_0x3d447e),_0x171b76=_0x466cb5?[..._0x466cb5[_0x1c56fd(0x13d)](_0x24652f=>_0x26d0ee[_0x1c56fd(0xf4)](_0x24652f)),..._0x26d0ee[_0x1c56fd(0x13d)](_0x35ecfb=>!_0x466cb5[_0x1c56fd(0xf4)](_0x35ecfb))[_0x1c56fd(0x198)]()]:_0x26d0ee[_0x1c56fd(0x198)]();for(const _0x38c845 of _0x171b76){const _0x242415=_0x3d447e[_0x38c845];if(_0x242415[_0x1c56fd(0x165)]){const _0x226fea=_0x242415[_0x1c56fd(0x165)];if(_0x226fea[_0x1c56fd(0x16e)]!==_0x1c56fd(0x13c)&&_0x226fea[_0x1c56fd(0x16e)]!=='Or'){const _0x3e4d82=_0x226fea['type']??_0x1c56fd(0x12e);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x38c845+_0x1c56fd(0x180)+(_0x1c56fd(0x137)+_0x3e4d82+_0x1c56fd(0x193))+_0x1c56fd(0x103)+_0x1c56fd(0x14c)+_0x1c56fd(0xda)+'\x20\x20\x20\x20conditions:\x0a'+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x1c56fd(0x102)+_0x1c56fd(0x17d));}if(!_0x226fea[_0x1c56fd(0xed)]||!Array[_0x1c56fd(0x172)](_0x226fea[_0x1c56fd(0xed)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x38c845+_0x1c56fd(0x180)+_0x1c56fd(0x11f)+_0x1c56fd(0x103)+_0x1c56fd(0x14c)+(_0x1c56fd(0x17f)+_0x226fea[_0x1c56fd(0x16e)]+'\x0a')+_0x1c56fd(0x10e)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x1c56fd(0x17d));}_0xed8ba5[_0x38c845]={..._0x242415[_0x1c56fd(0x169)]&&_0x242415['description'][_0x1c56fd(0xfa)]()&&{'description':_0x242415[_0x1c56fd(0x169)]},..._0x242415['rule']&&{'rule':deepSortObject(_0x242415[_0x1c56fd(0x165)])}};}return _0xed8ba5;}function normalizeEmbeddedActivations(_0x2f7262,_0x2e3ecd){const _0x3862f5=a108_0x547e7a,_0x28d333={},_0x2ec0f3=Object[_0x3862f5(0xdd)](_0x2f7262),_0x355764=_0x2e3ecd?[..._0x2e3ecd[_0x3862f5(0x13d)](_0x46dc02=>_0x2ec0f3[_0x3862f5(0xf4)](_0x46dc02)),..._0x2ec0f3[_0x3862f5(0x13d)](_0x2e5541=>!_0x2e3ecd[_0x3862f5(0xf4)](_0x2e5541))[_0x3862f5(0x198)]()]:_0x2ec0f3[_0x3862f5(0x198)]();for(const _0x5ab732 of _0x355764){const _0x781d2d=_0x2f7262[_0x5ab732];_0x28d333[_0x5ab732]={'name':_0x781d2d[_0x3862f5(0x10a)],'connection':_0x781d2d[_0x3862f5(0x111)],..._0x781d2d['description']!==undefined&&{'description':_0x781d2d[_0x3862f5(0x169)]},..._0x781d2d[_0x3862f5(0x122)]!==undefined&&{'all_columns':_0x781d2d['all_columns']},..._0x781d2d[_0x3862f5(0x132)]!==undefined&&{'columns':_0x781d2d['columns']},..._0x781d2d['behavior']!==undefined&&{'behavior':_0x781d2d[_0x3862f5(0x152)]},..._0x781d2d[_0x3862f5(0x153)]!==undefined&&{'schedule':_0x781d2d[_0x3862f5(0x153)]},..._0x781d2d[_0x3862f5(0x151)]!==undefined&&{'notification':_0x781d2d[_0x3862f5(0x151)]},..._0x781d2d[_0x3862f5(0x113)]!==undefined&&{'connector_config':_0x781d2d['connector_config']},..._0x781d2d[_0x3862f5(0x187)]!==undefined&&{'activation_template_id':_0x781d2d[_0x3862f5(0x187)]}};}return _0x28d333;}export function getActiveStages(_0x5103f2){const _0x3cbd17=a108_0x547e7a;if(isJourneysArrayMode(_0x5103f2)){const _0x5ab769=_0x5103f2[_0x3cbd17(0x16d)]||[],_0x1f6d94=_0x5ab769[_0x3cbd17(0x125)](_0x140c73=>_0x140c73[_0x3cbd17(0xdc)]===!![])||_0x5ab769[0x0];return _0x1f6d94?.['stages']||[];}if(isSingleVersionMode(_0x5103f2))return _0x5103f2['stages']||[];if(isMultiVersionMode(_0x5103f2)){const _0x441985=_0x5103f2[_0x3cbd17(0x168)]||[],_0x446b4a=_0x441985['find'](_0x1615bc=>_0x1615bc[_0x3cbd17(0xdc)]===!![])||_0x441985[0x0];return _0x446b4a?.[_0x3cbd17(0x18c)]||[];}return[];}export function getLatestJourneyEntry(_0x5926fc){const _0x214d1a=a108_0x547e7a;if(isJourneysArrayMode(_0x5926fc)){const _0x37275f=_0x5926fc[_0x214d1a(0x16d)]||[];return _0x37275f[_0x214d1a(0x125)](_0x214d4f=>_0x214d4f[_0x214d1a(0xdc)]===!![])||_0x37275f[0x0];}if(isMultiVersionMode(_0x5926fc)){const _0x15778b=_0x5926fc[_0x214d1a(0x168)]||[],_0x49afeb=_0x15778b[_0x214d1a(0x125)](_0x38ce29=>_0x38ce29[_0x214d1a(0xdc)]===!![])||_0x15778b[0x0];if(_0x49afeb)return{'version':_0x49afeb[_0x214d1a(0x10a)],'state':_0x49afeb['state'],'latest':_0x49afeb['latest'],'stages':_0x49afeb['stages'],'id':_0x49afeb['id'],'version_number':_0x49afeb[_0x214d1a(0x11c)]};}if(isSingleVersionMode(_0x5926fc))return{'version':_0x5926fc['version']||'v1','state':_0x214d1a(0xd1),'stages':_0x5926fc['stages']||[],'id':_0x5926fc['id'],'version_number':_0x5926fc[_0x214d1a(0x11c)],'goal':_0x5926fc[_0x214d1a(0x12c)],'reentry':_0x5926fc[_0x214d1a(0xee)]};return undefined;}export function getLatestVersion(_0x122a7d){const _0x2dc8f5=a108_0x547e7a;if(!isMultiVersionMode(_0x122a7d))return undefined;const _0x78dbdb=_0x122a7d[_0x2dc8f5(0x168)]||[];return _0x78dbdb[_0x2dc8f5(0x125)](_0x28da42=>_0x28da42[_0x2dc8f5(0xdc)]===!![])||_0x78dbdb[0x0];}export function getEffectiveGoal(_0x2a8228){const _0x295dce=getLatestJourneyEntry(_0x2a8228);return _0x295dce?.['goal']||_0x2a8228['goal'];}export function getEffectiveReentry(_0x4bddda){const _0x27ad23=a108_0x547e7a,_0xa5e330=getLatestJourneyEntry(_0x4bddda);return _0xa5e330?.[_0x27ad23(0xee)]||_0x4bddda[_0x27ad23(0xee)];}export function collectSegmentRefs(_0x5acdc2){const _0x3fe84f=a108_0x547e7a,_0x594bb6=new Set();_0x5acdc2[_0x3fe84f(0x12c)]?.[_0x3fe84f(0x130)]&&_0x594bb6['add'](_0x5acdc2[_0x3fe84f(0x12c)][_0x3fe84f(0x130)]);const _0x138372=_0x276c2d=>{const _0x4dec81=_0x3fe84f;for(const _0xfe4ae of _0x276c2d){_0xfe4ae[_0x4dec81(0x194)]?.[_0x4dec81(0x130)]&&_0x594bb6[_0x4dec81(0x140)](_0xfe4ae[_0x4dec81(0x194)][_0x4dec81(0x130)]);if(_0xfe4ae[_0x4dec81(0xfc)])for(const _0x257e83 of _0xfe4ae[_0x4dec81(0xfc)]){_0x257e83[_0x4dec81(0x130)]&&_0x594bb6[_0x4dec81(0x140)](_0x257e83[_0x4dec81(0x130)]);}_0xfe4ae[_0x4dec81(0xd6)]?.[_0x4dec81(0x130)]&&_0x594bb6['add'](_0xfe4ae[_0x4dec81(0xd6)][_0x4dec81(0x130)]);if(_0xfe4ae['steps'])for(const _0x4c0c12 of _0xfe4ae[_0x4dec81(0xef)]){if(_0x4c0c12[_0x4dec81(0x16e)]===_0x4dec81(0x18a)){const _0x3e7440=_0x4c0c12;for(const _0x32bbd7 of _0x3e7440[_0x4dec81(0x18f)]['branches']){_0x32bbd7[_0x4dec81(0x130)]&&_0x594bb6[_0x4dec81(0x140)](_0x32bbd7[_0x4dec81(0x130)]);}}else{if(_0x4c0c12[_0x4dec81(0x16e)]===_0x4dec81(0x12f)){const _0x5e98c4=_0x4c0c12;_0x5e98c4['with'][_0x4dec81(0x177)]?.[_0x4dec81(0x130)]&&_0x594bb6[_0x4dec81(0x140)](_0x5e98c4['with'][_0x4dec81(0x177)][_0x4dec81(0x130)]);}}}}};_0x5acdc2[_0x3fe84f(0x18c)]&&_0x138372(_0x5acdc2['stages']);if(_0x5acdc2['versions'])for(const _0x57e7bc of _0x5acdc2[_0x3fe84f(0x168)]){_0x138372(_0x57e7bc['stages']);}return _0x594bb6;}export function validateSegmentRefs(_0x40f50a){const _0x4bb6d3=a108_0x547e7a,_0x1fb3aa=[],_0x38b7af=collectSegmentRefs(_0x40f50a),_0x543d1b=new Set(Object['keys'](_0x40f50a[_0x4bb6d3(0xe1)]||{}));for(const _0x40a98a of _0x38b7af){const _0x2bb046=parseSegmentRef(_0x40a98a);_0x2bb046[_0x4bb6d3(0x16e)]==='embedded'&&!_0x543d1b[_0x4bb6d3(0x160)](_0x2bb046[_0x4bb6d3(0x10a)])&&_0x1fb3aa['push'](_0x4bb6d3(0x109)+_0x2bb046['name']+_0x4bb6d3(0x123)+_0x2bb046[_0x4bb6d3(0x10a)]+_0x4bb6d3(0xfb));}return _0x1fb3aa;}export function collectSegmentIdsFromJourneyApi(_0x16f8ba){const _0x4c0e7c=a108_0x547e7a,_0x2ee4b5=new Set();_0x16f8ba[_0x4c0e7c(0x174)][_0x4c0e7c(0x12c)]?.['segmentId']&&_0x2ee4b5['add'](_0x16f8ba[_0x4c0e7c(0x174)][_0x4c0e7c(0x12c)]['segmentId']);const _0x3c53cf=_0x16f8ba[_0x4c0e7c(0x174)][_0x4c0e7c(0x16a)];if(Array[_0x4c0e7c(0x172)](_0x3c53cf))for(const _0x4ebe8f of _0x3c53cf){_0x4ebe8f[_0x4c0e7c(0x199)]?.[_0x4c0e7c(0x12b)]&&_0x2ee4b5[_0x4c0e7c(0x140)](_0x4ebe8f[_0x4c0e7c(0x199)][_0x4c0e7c(0x12b)]);if(Array[_0x4c0e7c(0x172)](_0x4ebe8f[_0x4c0e7c(0x184)]))for(const _0x23c19c of _0x4ebe8f['exitCriteria']){_0x23c19c[_0x4c0e7c(0x12b)]&&_0x2ee4b5[_0x4c0e7c(0x140)](_0x23c19c[_0x4c0e7c(0x12b)]);}_0x4ebe8f[_0x4c0e7c(0xd6)]?.[_0x4c0e7c(0x12b)]&&_0x2ee4b5[_0x4c0e7c(0x140)](_0x4ebe8f[_0x4c0e7c(0xd6)][_0x4c0e7c(0x12b)]);if(_0x4ebe8f['steps']&&typeof _0x4ebe8f[_0x4c0e7c(0xef)]===_0x4c0e7c(0x135)){const _0x4bae7f=Array['isArray'](_0x4ebe8f[_0x4c0e7c(0xef)])?_0x4ebe8f[_0x4c0e7c(0xef)]:Object[_0x4c0e7c(0x146)](_0x4ebe8f[_0x4c0e7c(0xef)]);for(const _0x1be532 of _0x4bae7f){_0x1be532[_0x4c0e7c(0x105)]?.[_0x4c0e7c(0x12b)]&&_0x2ee4b5[_0x4c0e7c(0x140)](_0x1be532[_0x4c0e7c(0x105)][_0x4c0e7c(0x12b)]);if(Array[_0x4c0e7c(0x172)](_0x1be532[_0x4c0e7c(0x190)]))for(const _0x6374d7 of _0x1be532[_0x4c0e7c(0x190)]){_0x6374d7[_0x4c0e7c(0x12b)]&&_0x2ee4b5[_0x4c0e7c(0x140)](_0x6374d7[_0x4c0e7c(0x12b)]);}}}}return _0x2ee4b5;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a109_0x2ff94a=a109_0x106f;(function(_0x319bcd,_0x102a07){const _0xca534f=a109_0x106f,_0x4155ff=_0x319bcd();while(!![]){try{const _0x9c8096=-parseInt(_0xca534f(0x150))/0x1*(parseInt(_0xca534f(0x156))/0x2)+parseInt(_0xca534f(0x133))/0x3*(parseInt(_0xca534f(0x152))/0x4)+parseInt(_0xca534f(0x14e))/0x5*(-parseInt(_0xca534f(0x124))/0x6)+-parseInt(_0xca534f(0x123))/0x7*(-parseInt(_0xca534f(0x148))/0x8)+parseInt(_0xca534f(0x13c))/0x9+parseInt(_0xca534f(0x153))/0xa*(-parseInt(_0xca534f(0x126))/0xb)+parseInt(_0xca534f(0x14a))/0xc;if(_0x9c8096===_0x102a07)break;else _0x4155ff['push'](_0x4155ff['shift']());}catch(_0x576c44){_0x4155ff['push'](_0x4155ff['shift']());}}}(a109_0x3153,0xbc84e));export const DEFAULT_TIME_RANGE=a109_0x2ff94a(0x143);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x5b2071,_0x5d58ec,_0x562dfe){const _0x5ca66f=a109_0x2ff94a,_0x30e262=_0x562dfe&&_0x562dfe['length']>0x0?_0x562dfe['join'](',\x20'):'*';return _0x5ca66f(0x154)+_0x30e262+_0x5ca66f(0x12c)+_0x5b2071+'.'+_0x5d58ec+_0x5ca66f(0x127);}export function generateMasterCountSQL(_0xb041a9){const _0x3c8900=a109_0x2ff94a,{database:_0xdbd03b,table:_0x2b5a2c}=_0xb041a9[_0x3c8900(0x12f)];return _0x3c8900(0x146)+_0xdbd03b+'.'+_0x2b5a2c;}export function generateMasterSampleSQL(_0x3ff246,_0x15fef0=0x5){const _0x1eb2ed=a109_0x2ff94a,{database:_0x3e5d54,table:_0x2ae8bb}=_0x3ff246[_0x1eb2ed(0x12f)];return'SELECT\x20*\x20FROM\x20'+_0x3e5d54+'.'+_0x2ae8bb+_0x1eb2ed(0x13f)+_0x15fef0;}function a109_0x3153(){const _0x1d93e2=['test','21076464yfAnrS','label','SELECT\x20*\x20FROM\x20','\x0aLIMIT\x200\x0a','14665oEvhAW','\x20AS\x20','653tPqyds','m.*','8sFHPZE','10130buOpDq','SELECT\x20','child_key','2792MbhgwH','\x0aSELECT\x20m.','\x20a\x0a\x20\x20ON\x20m.','database','length','columns','(all\x20columns)','source','column','371EVHCLn','2922eAoNjq','join','8217bkfROx','\x20LIMIT\x200','all_columns','\x20=\x20a.','toLowerCase',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','\x20FROM\x20','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','\x20m\x0aLEFT\x20JOIN\x20','master','\x20m\x0a','map','\x20b\x0a\x20\x20ON\x20m.','1053537TYsfnt','trim','\x20m\x0aJOIN\x20','parent_key','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','\x27)\x0aLIMIT\x20','\x0aFROM\x20','name','4529556sZlbDP','b.*','forEach','\x20LIMIT\x20','table','\x20=\x20','\x20=\x20b.','-1d','\x0aWHERE\x20a.','behaviors','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','\x0aLIMIT\x20','136880JYlPJV'];a109_0x3153=function(){return _0x1d93e2;};return a109_0x3153();}export function generateAttributeCoverageSQL(_0x36a5ee,_0x5df755){const _0xd790a1=a109_0x2ff94a,_0x59bebc=_0x36a5ee[_0xd790a1(0x12f)];return(_0xd790a1(0x137)+_0x59bebc[_0xd790a1(0x11d)]+'.'+_0x59bebc[_0xd790a1(0x140)]+_0xd790a1(0x12e)+_0x5df755[_0xd790a1(0x121)][_0xd790a1(0x11d)]+'.'+_0x5df755[_0xd790a1(0x121)][_0xd790a1(0x140)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x5df755[_0xd790a1(0x125)][_0xd790a1(0x136)]+_0xd790a1(0x129)+_0x5df755[_0xd790a1(0x125)][_0xd790a1(0x155)]+_0xd790a1(0x144)+_0x5df755['join'][_0xd790a1(0x155)]+'\x20IS\x20NOT\x20NULL\x0a')[_0xd790a1(0x134)]();}export function generateBehaviorStatsSQL(_0x56f3eb,_0x5ba4b0,_0x4febec=DEFAULT_TIME_RANGE){const _0x371828=a109_0x2ff94a,_0x175e1a=_0x56f3eb[_0x371828(0x12f)];return(_0x371828(0x12d)+_0x5ba4b0['join'][_0x371828(0x136)]+_0x371828(0x12b)+_0x175e1a[_0x371828(0x11d)]+'.'+_0x175e1a[_0x371828(0x140)]+_0x371828(0x135)+_0x5ba4b0[_0x371828(0x121)][_0x371828(0x11d)]+'.'+_0x5ba4b0[_0x371828(0x121)][_0x371828(0x140)]+_0x371828(0x132)+_0x5ba4b0[_0x371828(0x125)][_0x371828(0x136)]+_0x371828(0x142)+_0x5ba4b0['join'][_0x371828(0x155)]+_0x371828(0x138)+_0x4febec+'\x27)\x0a')[_0x371828(0x134)]();}function a109_0x106f(_0x347ab5,_0x326719){_0x347ab5=_0x347ab5-0x11c;const _0x315375=a109_0x3153();let _0x106fd5=_0x315375[_0x347ab5];return _0x106fd5;}export function generateAttributeSampleSQL(_0x1b897f,_0x3af2e1,_0x115855=0x5){const _0x2a829c=a109_0x2ff94a,_0x16290f=_0x1b897f[_0x2a829c(0x12f)],_0x2dc99a=_0x3af2e1[_0x2a829c(0x125)]['parent_key'],_0x58d73f=_0x3af2e1[_0x2a829c(0x11f)][_0x2a829c(0x131)](_0x487e83=>'a.'+_0x487e83[_0x2a829c(0x122)])[_0x2a829c(0x125)](',\x20');return(_0x2a829c(0x157)+_0x2dc99a+',\x20'+_0x58d73f+_0x2a829c(0x13a)+_0x16290f['database']+'.'+_0x16290f[_0x2a829c(0x140)]+_0x2a829c(0x135)+_0x3af2e1[_0x2a829c(0x121)][_0x2a829c(0x11d)]+'.'+_0x3af2e1[_0x2a829c(0x121)][_0x2a829c(0x140)]+_0x2a829c(0x11c)+_0x3af2e1[_0x2a829c(0x125)][_0x2a829c(0x136)]+_0x2a829c(0x129)+_0x3af2e1[_0x2a829c(0x125)]['child_key']+'\x0aLIMIT\x20'+_0x115855+'\x0a')['trim']();}export function generateBehaviorSampleSQL(_0x2e5d19,_0x55c08b,_0x2f7e81=0x5,_0x10dbd1=DEFAULT_TIME_RANGE){const _0x176df0=a109_0x2ff94a,_0x103a60=_0x2e5d19[_0x176df0(0x12f)],_0x5d9bac=_0x55c08b[_0x176df0(0x125)][_0x176df0(0x136)];let _0x545c54;if(_0x55c08b['all_columns'])_0x545c54='b.*';else _0x55c08b[_0x176df0(0x11f)]&&_0x55c08b[_0x176df0(0x11f)][_0x176df0(0x11e)]>0x0?_0x545c54=_0x55c08b[_0x176df0(0x11f)][_0x176df0(0x131)](_0x276b9a=>'b.'+_0x276b9a[_0x176df0(0x122)])['join'](',\x20'):_0x545c54='b.*';return(_0x176df0(0x157)+_0x5d9bac+',\x20'+_0x545c54+'\x0aFROM\x20'+_0x103a60[_0x176df0(0x11d)]+'.'+_0x103a60[_0x176df0(0x140)]+_0x176df0(0x135)+_0x55c08b[_0x176df0(0x121)][_0x176df0(0x11d)]+'.'+_0x55c08b[_0x176df0(0x121)]['table']+_0x176df0(0x132)+_0x55c08b[_0x176df0(0x125)][_0x176df0(0x136)]+_0x176df0(0x142)+_0x55c08b[_0x176df0(0x125)]['child_key']+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x10dbd1+_0x176df0(0x139)+_0x2f7e81+'\x0a')[_0x176df0(0x134)]();}function quoteIdentifier(_0x8c33d7){const _0x78c62c=a109_0x2ff94a;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x78c62c(0x149)](_0x8c33d7))return'\x22'+_0x8c33d7['replace'](/"/g,'\x22\x22')+'\x22';return _0x8c33d7;}export function generateEnrichedSQL(_0x3900d9,_0x3b8710=0x5){const _0x2d0dfd=a109_0x2ff94a,_0x5ad273=_0x3900d9['master'],_0x1459a6=_0x3900d9['attributes']||[];if(_0x1459a6[_0x2d0dfd(0x11e)]===0x0)return _0x2d0dfd(0x14c)+_0x5ad273['database']+'.'+_0x5ad273[_0x2d0dfd(0x140)]+_0x2d0dfd(0x13f)+_0x3b8710;const _0x545518=[_0x2d0dfd(0x151)],_0x3da257=[];return _0x1459a6[_0x2d0dfd(0x13e)]((_0x2644e4,_0x2c6174)=>{const _0x343cb4=_0x2d0dfd,_0x160a8d='a'+_0x2c6174;_0x2644e4['columns']['forEach'](_0x2ece00=>{const _0x4f22b3=a109_0x106f,_0x2170f9=quoteIdentifier(_0x2ece00[_0x4f22b3(0x14b)]||_0x2ece00[_0x4f22b3(0x122)]);_0x545518['push'](_0x160a8d+'.'+_0x2ece00[_0x4f22b3(0x122)]+_0x4f22b3(0x14f)+_0x2170f9);}),_0x3da257['push']('LEFT\x20JOIN\x20'+_0x2644e4[_0x343cb4(0x121)]['database']+'.'+_0x2644e4[_0x343cb4(0x121)][_0x343cb4(0x140)]+'\x20'+_0x160a8d+'\x0a\x20\x20ON\x20m.'+_0x2644e4['join'][_0x343cb4(0x136)]+_0x343cb4(0x141)+_0x160a8d+'.'+_0x2644e4[_0x343cb4(0x125)]['child_key']);}),('\x0aSELECT\x20'+_0x545518[_0x2d0dfd(0x125)](',\x20')+_0x2d0dfd(0x13a)+_0x5ad273[_0x2d0dfd(0x11d)]+'.'+_0x5ad273[_0x2d0dfd(0x140)]+_0x2d0dfd(0x130)+_0x3da257[_0x2d0dfd(0x125)]('\x0a')+_0x2d0dfd(0x147)+_0x3b8710+'\x0a')[_0x2d0dfd(0x134)]();}export function generateAttributeSchemaSQL(_0x4d661d,_0x584443){const _0x22ac43=a109_0x2ff94a,_0x42d689=_0x4d661d['master'],_0x4c9f09=_0x584443[_0x22ac43(0x125)][_0x22ac43(0x136)],_0x11b8c0=_0x584443[_0x22ac43(0x11f)][_0x22ac43(0x131)](_0x5b48a7=>'a.'+_0x5b48a7[_0x22ac43(0x122)])[_0x22ac43(0x125)](',\x20');return(_0x22ac43(0x157)+_0x4c9f09+',\x20'+_0x11b8c0+_0x22ac43(0x13a)+_0x42d689[_0x22ac43(0x11d)]+'.'+_0x42d689[_0x22ac43(0x140)]+_0x22ac43(0x135)+_0x584443['source']['database']+'.'+_0x584443[_0x22ac43(0x121)]['table']+_0x22ac43(0x11c)+_0x584443[_0x22ac43(0x125)][_0x22ac43(0x136)]+'\x20=\x20a.'+_0x584443[_0x22ac43(0x125)][_0x22ac43(0x155)]+_0x22ac43(0x14d))[_0x22ac43(0x134)]();}export function generateBehaviorSchemaSQL(_0x30c334,_0x20378b){const _0x21ce0f=a109_0x2ff94a,_0x4e4f10=_0x30c334[_0x21ce0f(0x12f)],_0x9800af=_0x20378b[_0x21ce0f(0x125)]['parent_key'];let _0x58cb4f;if(_0x20378b['all_columns'])_0x58cb4f=_0x21ce0f(0x13d);else _0x20378b[_0x21ce0f(0x11f)]&&_0x20378b[_0x21ce0f(0x11f)][_0x21ce0f(0x11e)]>0x0?_0x58cb4f=_0x20378b[_0x21ce0f(0x11f)][_0x21ce0f(0x131)](_0x4629a4=>'b.'+_0x4629a4[_0x21ce0f(0x122)])[_0x21ce0f(0x125)](',\x20'):_0x58cb4f='b.*';return(_0x21ce0f(0x157)+_0x9800af+',\x20'+_0x58cb4f+_0x21ce0f(0x13a)+_0x4e4f10[_0x21ce0f(0x11d)]+'.'+_0x4e4f10[_0x21ce0f(0x140)]+_0x21ce0f(0x135)+_0x20378b[_0x21ce0f(0x121)]['database']+'.'+_0x20378b[_0x21ce0f(0x121)][_0x21ce0f(0x140)]+_0x21ce0f(0x132)+_0x20378b[_0x21ce0f(0x125)][_0x21ce0f(0x136)]+_0x21ce0f(0x142)+_0x20378b[_0x21ce0f(0x125)][_0x21ce0f(0x155)]+_0x21ce0f(0x14d))['trim']();}export function getAttributeColumns(_0x3a0ed5){const _0x31079e=a109_0x2ff94a;return _0x3a0ed5[_0x31079e(0x11f)][_0x31079e(0x131)](_0x4881f9=>({'label':_0x4881f9[_0x31079e(0x14b)]||_0x4881f9[_0x31079e(0x122)],'column':_0x4881f9[_0x31079e(0x122)]}));}export function getBehaviorColumns(_0x270c1f){const _0x1f7826=a109_0x2ff94a;if(_0x270c1f[_0x1f7826(0x128)])return[{'label':'(all\x20columns)','column':'*'}];if(_0x270c1f[_0x1f7826(0x11f)]&&_0x270c1f[_0x1f7826(0x11f)]['length']>0x0)return _0x270c1f[_0x1f7826(0x11f)][_0x1f7826(0x131)](_0x434937=>({'label':_0x434937[_0x1f7826(0x14b)]||_0x434937[_0x1f7826(0x122)],'column':_0x434937[_0x1f7826(0x122)]}));return[{'label':_0x1f7826(0x120),'column':'*'}];}export function findAttributeByName(_0x5068da,_0x5dad64){const _0x2ea668=a109_0x2ff94a;return _0x5068da['attributes']?.['find'](_0x99d106=>_0x99d106[_0x2ea668(0x13b)]['toLowerCase']()===_0x5dad64[_0x2ea668(0x12a)]());}export function findBehaviorByName(_0x1e4410,_0x4037eb){const _0xaf7d40=a109_0x2ff94a;return _0x1e4410[_0xaf7d40(0x145)]?.['find'](_0x215edc=>_0x215edc[_0xaf7d40(0x13b)][_0xaf7d40(0x12a)]()===_0x4037eb[_0xaf7d40(0x12a)]());}
|