@treasuredata/tdx 2026.4.16 → 2026.4.18
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.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/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x24cc65=a142_0x2990;(function(_0x3fbc0d,_0x36fbbd){const _0x1c4c9f=a142_0x2990,_0x14c9b1=_0x3fbc0d();while(!![]){try{const _0x21252d=parseInt(_0x1c4c9f(0x104))/0x1*(-parseInt(_0x1c4c9f(0xec))/0x2)+parseInt(_0x1c4c9f(0x11d))/0x3*(-parseInt(_0x1c4c9f(0xd5))/0x4)+parseInt(_0x1c4c9f(0x183))/0x5*(-parseInt(_0x1c4c9f(0x16f))/0x6)+-parseInt(_0x1c4c9f(0x15e))/0x7*(-parseInt(_0x1c4c9f(0xcf))/0x8)+-parseInt(_0x1c4c9f(0xd1))/0x9*(parseInt(_0x1c4c9f(0xe2))/0xa)+parseInt(_0x1c4c9f(0x11e))/0xb+parseInt(_0x1c4c9f(0x11f))/0xc;if(_0x21252d===_0x36fbbd)break;else _0x14c9b1['push'](_0x14c9b1['shift']());}catch(_0x2f1922){_0x14c9b1['push'](_0x14c9b1['shift']());}}}(a142_0x36ba,0x85c8c));import*as a142_0x53a596 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a142_0x24cc65(0xd2),'hourly':a142_0x24cc65(0xf9),'weekly':a142_0x24cc65(0x178),'monthly':a142_0x24cc65(0xdd),'minutes_interval':a142_0x24cc65(0xff)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x24cc65(0x131),'hour':a142_0x24cc65(0x173),'week':a142_0x24cc65(0x156),'month':'monthly','minute':a142_0x24cc65(0x174)};function filterRuleAsRuleDef(_0x141394){return _0x141394;}function ruleDefAsFilterRule(_0x309d51){return _0x309d51;}export function segmentResponseToDefSync(_0x1097bb,_0x32d850){const _0x24980b=a142_0x24cc65,_0x107d29=_0x1097bb[_0x24980b(0xe9)]&&_0x24980b(0xd9)in _0x1097bb[_0x24980b(0xe9)]&&_0x1097bb['rule'][_0x24980b(0xd9)];return{'type':'segment','name':_0x1097bb[_0x24980b(0x179)],..._0x1097bb[_0x24980b(0x175)]&&{'description':_0x1097bb[_0x24980b(0x175)]},..._0x32d850&&{'folder':_0x32d850},..._0x107d29&&{'rule':apiRuleToYaml(_0x1097bb[_0x24980b(0xe9)])},..._0x1097bb[_0x24980b(0xd4)]!==undefined&&{'kind':_0x1097bb[_0x24980b(0xd4)]===0x0?_0x24980b(0x166):_0x1097bb[_0x24980b(0xd4)]===0x1?_0x24980b(0x17a):_0x24980b(0x112)},..._0x1097bb['isVisible']!==undefined&&{'visible':_0x1097bb['isVisible']}};}export async function segmentResponseToDef(_0x21266f,_0x27398b,_0x4f00d3){const _0x5d1808=a142_0x24cc65,_0x10e12b=segmentResponseToDefSync(_0x21266f,_0x4f00d3);if(!_0x27398b||!_0x27398b[_0x5d1808(0x115)])return _0x10e12b;return _0x10e12b[_0x5d1808(0xe9)]&&(_0x10e12b[_0x5d1808(0xe9)]=await resolveRuleSegmentRefs(_0x10e12b['rule'],_0x27398b[_0x5d1808(0x115)])),_0x10e12b;}export function apiRuleToYaml(_0x4ed7bc){const _0xad1376=a142_0x24cc65,_0x27921e=(_0x4ed7bc[_0xad1376(0x154)]||[])[_0xad1376(0xdb)](_0x10429b=>{const _0x5d71dd=_0xad1376,_0x80f0a3=apiConditionToYaml(_0x10429b);if(isCompositeType(_0x80f0a3)&&_0x80f0a3[_0x5d71dd(0x175)]!==undefined){const _0x1bc836=_0x80f0a3;if(_0x1bc836[_0x5d71dd(0x154)][_0x5d71dd(0x138)]===0x1)return _0x1bc836[_0x5d71dd(0x154)];return[{'type':_0x1bc836[_0x5d71dd(0xd9)],'conditions':_0x1bc836[_0x5d71dd(0x154)]}];}return[_0x80f0a3];});if(_0x27921e['length']===0x1&&!_0x4ed7bc[_0xad1376(0x175)]&&isCompositeType(_0x27921e[0x0])){const _0x184ddb=_0x27921e[0x0];if(_0x184ddb[_0xad1376(0xd9)]===_0x4ed7bc[_0xad1376(0xd9)]&&_0x184ddb[_0xad1376(0x154)]&&_0x184ddb[_0xad1376(0x175)]===undefined)return{'type':_0x4ed7bc[_0xad1376(0xd9)],'conditions':_0x184ddb['conditions']};}return{'type':_0x4ed7bc[_0xad1376(0xd9)],'conditions':_0x27921e};}export async function resolveRuleSegmentRefs(_0x407e8a,_0x4485b0){const _0x3fc871=a142_0x24cc65;return transformRuleSegmentRefs(_0x407e8a,_0x4485b0,_0x241b18=>/^\d+$/[_0x3fc871(0x101)](_0x241b18));}async function transformConditionSegmentRefs(_0x3950d1,_0x98d687,_0x26952f,_0x36e7bc){const _0x42a4fd=a142_0x24cc65;if('segment'in _0x3950d1&&(_0x3950d1['type']===_0x42a4fd(0x159)||_0x3950d1['type']===_0x42a4fd(0x12e))){const _0x3c1d2a=_0x3950d1;if(_0x26952f(_0x3c1d2a[_0x42a4fd(0x130)]))return{..._0x3c1d2a,'segment':await _0x98d687(_0x3c1d2a[_0x42a4fd(0x130)])};return _0x3950d1;}if('conditions'in _0x3950d1&&_0x3950d1[_0x42a4fd(0x154)]){const _0x1086ac=_0x3950d1,_0x52687b=await Promise[_0x42a4fd(0x118)](_0x1086ac['conditions'][_0x42a4fd(0x152)](_0x8f78d4=>transformConditionSegmentRefs(_0x8f78d4,_0x98d687,_0x26952f,_0x36e7bc)));return{..._0x1086ac,'conditions':_0x52687b};}if('filter'in _0x3950d1&&_0x3950d1['filter']){const _0x2d6649=_0x3950d1,_0xbdd447=await _0x36e7bc(filterRuleAsRuleDef(_0x2d6649[_0x42a4fd(0x111)]),_0x98d687);return{..._0x2d6649,'filter':ruleDefAsFilterRule(_0xbdd447)};}return _0x3950d1;}async function transformRuleSegmentRefs(_0x148b95,_0x263f48,_0x1d7024){const _0x55936a=a142_0x24cc65,_0x33d883=(_0x531929,_0x35a5fe)=>transformRuleSegmentRefs(_0x531929,_0x35a5fe,_0x1d7024),_0x560b60=await Promise['all'](_0x148b95[_0x55936a(0x154)][_0x55936a(0x152)](_0x4b9624=>transformConditionSegmentRefs(_0x4b9624,_0x263f48,_0x1d7024,_0x33d883)));return{..._0x148b95,'conditions':_0x560b60};}function a142_0x2990(_0x51b6cd,_0x332d30){_0x51b6cd=_0x51b6cd-0xcc;const _0x36bafe=a142_0x36ba();let _0x299077=_0x36bafe[_0x51b6cd];return _0x299077;}export async function resolveRuleSegmentIds(_0x3fe1a1,_0x3a5c34){const _0xbd8ef1=a142_0x24cc65;return transformRuleSegmentRefs(_0x3fe1a1,_0x3a5c34,_0xe03ec3=>!/^\d+$/[_0xbd8ef1(0x101)](_0xe03ec3));}function isCompositeType(_0x3873f9){const _0x3e2980=a142_0x24cc65;return _0x3873f9[_0x3e2980(0xd9)]==='And'||_0x3873f9[_0x3e2980(0xd9)]==='Or';}function isBehaviorApiCondition(_0xde5932){const _0x16faff=a142_0x24cc65;if(!_0xde5932[_0x16faff(0xe8)]?.[_0x16faff(0xe5)]?.[_0x16faff(0x179)])return![];return!![];}function apiConditionToYaml(_0x365b7f){const _0x2af777=a142_0x24cc65;if(_0x365b7f[_0x2af777(0xd9)]===_0x2af777(0x11c)||_0x365b7f[_0x2af777(0xd9)]==='Or'){if(_0x365b7f[_0x2af777(0x154)]){const _0x323d00=_0x365b7f[_0x2af777(0x154)]['map'](apiConditionToYaml),_0x2c52b9=_0x365b7f[_0x2af777(0x175)]!==undefined;if(_0x323d00[_0x2af777(0x138)]===0x1&&!_0x2c52b9)return _0x323d00[0x0];return{'type':_0x365b7f['type'],'conditions':_0x323d00,..._0x365b7f['description']!==undefined&&{'description':_0x365b7f[_0x2af777(0x175)]}};}}if(_0x365b7f[_0x2af777(0xd9)]===_0x2af777(0x109)&&_0x365b7f['leftValue']&&_0x365b7f[_0x2af777(0x10e)]){const _0x212def=_0x365b7f[_0x2af777(0xe8)][_0x2af777(0x158)]?buildAggregationDefFromApi(_0x365b7f[_0x2af777(0xe8)][_0x2af777(0x158)]):undefined;if(isBehaviorApiCondition(_0x365b7f)){const _0xf92816=_0x365b7f['leftValue'][_0x2af777(0xe5)][_0x2af777(0x179)];return{'type':_0x2af777(0x107),'attribute':'','operator':apiOperatorToYaml(_0x365b7f[_0x2af777(0x10e)]),..._0x365b7f[_0x2af777(0x11a)]&&_0x365b7f[_0x2af777(0x11a)]!==_0x2af777(0xee)?{'arrayMatching':_0x365b7f[_0x2af777(0x11a)]}:{},..._0x365b7f[_0x2af777(0x12e)]?{'exclude':_0x365b7f[_0x2af777(0x12e)]}:{},..._0x212def?{'aggregation':_0x212def}:{},'source':_0xf92816,..._0x365b7f['leftValue'][_0x2af777(0x111)]?{'filter':apiRuleToYaml(_0x365b7f[_0x2af777(0xe8)]['filter'])}:{},..._0x365b7f[_0x2af777(0x128)]!==undefined&&_0x365b7f[_0x2af777(0x128)]!==null?{'limit':_0x365b7f[_0x2af777(0x128)]}:{}};}return{'type':'Value','attribute':_0x365b7f['leftValue'][_0x2af777(0x179)]||'','operator':apiOperatorToYaml(_0x365b7f[_0x2af777(0x10e)]),..._0x365b7f[_0x2af777(0x11a)]&&_0x365b7f[_0x2af777(0x11a)]!==_0x2af777(0xee)?{'arrayMatching':_0x365b7f[_0x2af777(0x11a)]}:{},..._0x365b7f['exclude']?{'exclude':_0x365b7f[_0x2af777(0x12e)]}:{},..._0x212def?{'aggregation':_0x212def}:{},..._0x365b7f[_0x2af777(0xe8)][_0x2af777(0x111)]?{'filter':apiRuleToYaml(_0x365b7f['leftValue'][_0x2af777(0x111)])}:{},..._0x365b7f[_0x2af777(0x128)]!==undefined&&_0x365b7f[_0x2af777(0x128)]!==null?{'limit':_0x365b7f['limit']}:{}};}if(_0x365b7f[_0x2af777(0xd9)]===_0x2af777(0xd0)&&_0x365b7f[_0x2af777(0x103)]&&_0x365b7f['operator'])return{'type':_0x2af777(0xd0),'column':_0x365b7f[_0x2af777(0x103)],'operator':apiOperatorToYaml(_0x365b7f['operator'])};if(_0x365b7f['type']===_0x2af777(0x100)&&_0x365b7f['id'])return{'type':_0x365b7f[_0x2af777(0x12e)]?_0x2af777(0x12e):_0x2af777(0x159),'segment':_0x365b7f['id']};return{'type':_0x2af777(0x11c),'conditions':[]};}function isTemporalOperator(_0x1bf9cc){return _0x1bf9cc==='TimeWithinPast'||_0x1bf9cc==='TimeWithinNext';}function isBetweenOperator(_0x43e918){return _0x43e918==='Between';}function getEffectiveValue(_0x1c5aa3){const _0x544b1a=a142_0x24cc65,_0x430995=_0x1c5aa3[_0x544b1a(0x163)];return _0x1c5aa3[_0x544b1a(0x122)]??_0x430995;}function parseNumericValue(_0x2d05f8){const _0x5428fa=a142_0x24cc65;if(typeof _0x2d05f8===_0x5428fa(0x10d)&&_0x2d05f8!==null)return _0x2d05f8;if(_0x2d05f8==='')return _0x2d05f8;const _0x4f209f=Number(_0x2d05f8);return Number[_0x5428fa(0x143)](_0x4f209f)?_0x4f209f:_0x2d05f8;}function apiOperatorToYaml(_0x3e4b29){const _0x33c09c=a142_0x24cc65;if(isBetweenOperator(_0x3e4b29['type']))return{'type':mapApiOperatorType(_0x3e4b29[_0x33c09c(0xd9)]),..._0x3e4b29['not']!==undefined&&{'not':_0x3e4b29[_0x33c09c(0x125)]},..._0x3e4b29[_0x33c09c(0xed)]!==undefined&&{'min':parseNumericValue(_0x3e4b29['minValue'])},..._0x3e4b29[_0x33c09c(0x15c)]!==undefined&&{'max':parseNumericValue(_0x3e4b29[_0x33c09c(0x15c)])}};if(_0x3e4b29[_0x33c09c(0xd9)]===_0x33c09c(0x119))return{'type':_0x33c09c(0x119),..._0x3e4b29[_0x33c09c(0x125)]!==undefined&&{'not':_0x3e4b29[_0x33c09c(0x125)]},..._0x3e4b29['duration']!==undefined&&{'duration':_0x3e4b29[_0x33c09c(0x14b)]},..._0x3e4b29[_0x33c09c(0x136)]!==undefined&&{'from':_0x3e4b29[_0x33c09c(0x136)]},..._0x3e4b29['reverse']!==undefined&&{'reverse':_0x3e4b29[_0x33c09c(0x14a)]}};let _0x154800;if(_0x3e4b29[_0x33c09c(0x12a)]&&_0x3e4b29[_0x33c09c(0x12a)][_0x33c09c(0x138)]>0x0)_0x154800=_0x3e4b29[_0x33c09c(0x12a)];else{if(_0x3e4b29[_0x33c09c(0x155)]!==undefined)_0x154800=_0x3e4b29[_0x33c09c(0x155)];else isTemporalOperator(_0x3e4b29['type'])&&_0x3e4b29[_0x33c09c(0x122)]!==undefined&&(_0x154800=_0x3e4b29[_0x33c09c(0x122)]);}return{'type':mapApiOperatorType(_0x3e4b29[_0x33c09c(0xd9)]),..._0x3e4b29[_0x33c09c(0x125)]!==undefined&&{'not':_0x3e4b29[_0x33c09c(0x125)]},..._0x154800!==undefined&&{'value':_0x154800},..._0x3e4b29['unit']!==undefined&&{'unit':_0x3e4b29['unit']}};}function mapApiOperatorType(_0x484cc6){return _0x484cc6;}export function segmentDefToCreateRequest(_0x5f4cb8,_0x5c3995){const _0x1953eb=a142_0x24cc65,_0xba00fc={'name':_0x5f4cb8[_0x1953eb(0x179)]};return _0x5f4cb8[_0x1953eb(0x175)]&&(_0xba00fc['description']=_0x5f4cb8[_0x1953eb(0x175)]),_0x5f4cb8['rule']&&(_0xba00fc[_0x1953eb(0xe9)]=yamlRuleToApi(_0x5f4cb8['rule'])),_0x5f4cb8[_0x1953eb(0xd4)]&&(_0xba00fc[_0x1953eb(0xd4)]=_0x5f4cb8[_0x1953eb(0xd4)]===_0x1953eb(0x166)?0x0:_0x5f4cb8[_0x1953eb(0xd4)]===_0x1953eb(0x17a)?0x1:0x2),_0x5f4cb8[_0x1953eb(0xf6)]!==undefined&&(_0xba00fc[_0x1953eb(0x127)]=_0x5f4cb8[_0x1953eb(0xf6)]),_0x5c3995&&(_0xba00fc[_0x1953eb(0xf3)]=_0x5c3995),_0xba00fc;}export function segmentDefToUpdateRequest(_0x1df61b){const _0x5b17e5=a142_0x24cc65,_0x390e0c={'name':_0x1df61b['name']};return _0x1df61b[_0x5b17e5(0x175)]!==undefined&&(_0x390e0c[_0x5b17e5(0x175)]=_0x1df61b['description']),_0x1df61b[_0x5b17e5(0xe9)]&&(_0x390e0c['rule']=yamlRuleToApi(_0x1df61b[_0x5b17e5(0xe9)])),_0x1df61b[_0x5b17e5(0xd4)]&&(_0x390e0c[_0x5b17e5(0xd4)]=_0x1df61b[_0x5b17e5(0xd4)]===_0x5b17e5(0x166)?0x0:_0x1df61b[_0x5b17e5(0xd4)]==='realtime'?0x1:0x2),_0x390e0c;}export function yamlRuleToApi(_0x164ca0){const _0x1aebb1=a142_0x24cc65,_0x39076a=_0x164ca0[_0x1aebb1(0x154)][_0x1aebb1(0x152)](yamlConditionToApi),_0x5b5e94=_0x39076a[_0x1aebb1(0x14e)](_0x15bf05=>isCompositeType(_0x15bf05)&&_0x15bf05[_0x1aebb1(0x175)]!==undefined);if(!_0x5b5e94&&_0x39076a[_0x1aebb1(0x138)]>0x0){const _0x93f45a=[];for(const _0x72ba96 of _0x39076a){isCompositeType(_0x72ba96)&&_0x72ba96[_0x1aebb1(0x175)]===undefined&&_0x72ba96[_0x1aebb1(0x154)]&&_0x72ba96[_0x1aebb1(0x154)][_0x1aebb1(0x14e)](_0x3e2d1b=>!isCompositeType(_0x3e2d1b))?_0x93f45a[_0x1aebb1(0x157)]({'type':_0x72ba96[_0x1aebb1(0xd9)],'description':'','conditions':_0x72ba96[_0x1aebb1(0x154)]}):_0x93f45a[_0x1aebb1(0x157)]({'type':'And','description':_0x164ca0[_0x1aebb1(0x175)]||'','conditions':[_0x72ba96]});}return{'type':_0x164ca0[_0x1aebb1(0xd9)],'conditions':_0x93f45a};}return{'type':_0x164ca0[_0x1aebb1(0xd9)],'conditions':_0x39076a,..._0x164ca0[_0x1aebb1(0x175)]&&{'description':_0x164ca0[_0x1aebb1(0x175)]}};}function yamlFilterRuleToApi(_0x269183){const _0x464405=a142_0x24cc65,_0x43c3a7=_0x269183[_0x464405(0x154)]['map'](yamlConditionToApi);return{'type':_0x269183[_0x464405(0xd9)],'conditions':_0x43c3a7};}function yamlConditionToApi(_0x3def3f){const _0x3f7772=a142_0x24cc65;if(_0x3f7772(0x130)in _0x3def3f&&(_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0x159)||_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0x12e))){const _0x39db1a=_0x3def3f;return{'type':_0x3f7772(0x100),'id':_0x39db1a[_0x3f7772(0x130)],'exclude':_0x39db1a[_0x3f7772(0xd9)]===_0x3f7772(0x12e)};}if(_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0x11c)||_0x3def3f['type']==='Or'){const _0x2aa1b5=_0x3def3f;return{'type':_0x2aa1b5[_0x3f7772(0xd9)],'conditions':_0x2aa1b5[_0x3f7772(0x154)][_0x3f7772(0x152)](yamlConditionToApi),..._0x2aa1b5[_0x3f7772(0x175)]&&{'description':_0x2aa1b5['description']}};}if(_0x3f7772(0x103)in _0x3def3f&&_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0xd0)){const _0x2c5b89=_0x3def3f;return{'type':_0x3f7772(0xd0),'column':_0x2c5b89[_0x3f7772(0x103)],'operator':yamlOperatorToApi(_0x2c5b89[_0x3f7772(0x10e)])};}const _0x665c90=_0x3def3f,_0x192ab1={'type':_0x3f7772(0x109),'leftValue':buildLeftValue(_0x665c90),'operator':yamlOperatorToApi(_0x665c90['operator']),'exclude':_0x665c90['exclude']??![],'arrayMatching':_0x665c90[_0x3f7772(0x11a)]??_0x3f7772(0xee)};return _0x665c90[_0x3f7772(0x128)]!==undefined&&(_0x192ab1[_0x3f7772(0x128)]=_0x665c90[_0x3f7772(0x128)]),_0x192ab1;}function buildAggregationDefFromApi(_0x19fa79){const _0x5b16e9=a142_0x24cc65,_0x4d2f90=_0x19fa79[_0x5b16e9(0xd9)];if(_0x4d2f90==='CountDistinct')return{'type':_0x4d2f90,'columns':_0x19fa79[_0x5b16e9(0xe1)]??[]};if(_0x4d2f90===_0x5b16e9(0xfb)||_0x4d2f90===_0x5b16e9(0xfd))return{'type':_0x4d2f90,'column':_0x19fa79[_0x5b16e9(0x103)]??'','orderColumn':_0x19fa79[_0x5b16e9(0x150)]??'',..._0x19fa79[_0x5b16e9(0x12f)]&&{'groupingColumns':_0x19fa79[_0x5b16e9(0x12f)]}};if(_0x4d2f90==='Count')return{'type':_0x4d2f90,..._0x19fa79[_0x5b16e9(0x12f)]&&{'groupingColumns':_0x19fa79[_0x5b16e9(0x12f)]}};return{'type':_0x4d2f90,'column':_0x19fa79['column']??'',..._0x19fa79[_0x5b16e9(0x12f)]&&{'groupingColumns':_0x19fa79['groupingColumns']}};}function buildLeftValue(_0x1412e2){const _0x423bc7=a142_0x24cc65,_0x390cf6={};_0x1412e2[_0x423bc7(0x114)]&&_0x1412e2[_0x423bc7(0xd9)]!==_0x423bc7(0x107)&&(_0x390cf6['name']=_0x1412e2[_0x423bc7(0x114)]);if(_0x1412e2['aggregation']){const _0x45a462=_0x1412e2['aggregation'];if(_0x45a462[_0x423bc7(0xd9)]==='CountDistinct')_0x390cf6[_0x423bc7(0x158)]={'type':'CountDistinct','columns':_0x45a462[_0x423bc7(0xe1)]};else{if(_0x45a462['type']===_0x423bc7(0xfb)||_0x45a462[_0x423bc7(0xd9)]===_0x423bc7(0xfd))_0x390cf6[_0x423bc7(0x158)]={'type':_0x45a462['type'],'column':_0x45a462[_0x423bc7(0x103)],'orderColumn':_0x45a462[_0x423bc7(0x150)],..._0x45a462[_0x423bc7(0x12f)]&&{'groupingColumns':_0x45a462[_0x423bc7(0x12f)]}};else _0x45a462[_0x423bc7(0xd9)]===_0x423bc7(0x13d)?_0x390cf6['aggregation']={'type':_0x423bc7(0x13d),..._0x45a462['groupingColumns']&&{'groupingColumns':_0x45a462[_0x423bc7(0x12f)]}}:_0x390cf6[_0x423bc7(0x158)]={'type':_0x45a462[_0x423bc7(0xd9)],'column':_0x45a462['column'],..._0x45a462['groupingColumns']&&{'groupingColumns':_0x45a462[_0x423bc7(0x12f)]}};}}return _0x1412e2['source']&&(_0x390cf6[_0x423bc7(0xe5)]={'name':_0x1412e2['source']}),_0x1412e2['filter']&&(_0x390cf6[_0x423bc7(0x111)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x1412e2['filter']))),_0x390cf6;}function yamlOperatorToApi(_0x1ddb6c){const _0x56be35=a142_0x24cc65,_0x993153={'type':mapYamlOperatorType(_0x1ddb6c[_0x56be35(0xd9)]),'not':_0x1ddb6c[_0x56be35(0x125)]??![]};if(isBetweenOperator(_0x1ddb6c['type']))return _0x1ddb6c[_0x56be35(0x161)]!==undefined&&(_0x993153[_0x56be35(0xed)]=typeof _0x1ddb6c[_0x56be35(0x161)]==='object'?_0x1ddb6c[_0x56be35(0x161)]:String(_0x1ddb6c[_0x56be35(0x161)])),_0x1ddb6c['max']!==undefined&&(_0x993153[_0x56be35(0x15c)]=typeof _0x1ddb6c[_0x56be35(0xeb)]===_0x56be35(0x10d)?_0x1ddb6c[_0x56be35(0xeb)]:String(_0x1ddb6c[_0x56be35(0xeb)])),_0x993153;if(_0x1ddb6c[_0x56be35(0xd9)]===_0x56be35(0x119))return _0x1ddb6c[_0x56be35(0x14b)]&&(_0x993153[_0x56be35(0x14b)]=_0x1ddb6c[_0x56be35(0x14b)]),_0x1ddb6c[_0x56be35(0x136)]&&(_0x993153[_0x56be35(0x136)]=_0x1ddb6c[_0x56be35(0x136)]),_0x1ddb6c[_0x56be35(0x14a)]!==undefined&&(_0x993153[_0x56be35(0x14a)]=_0x1ddb6c['reverse']),_0x993153;const _0x2ebebc=getEffectiveValue(_0x1ddb6c);if(_0x2ebebc!==undefined){if(Array[_0x56be35(0x168)](_0x2ebebc))_0x993153[_0x56be35(0x12a)]=_0x2ebebc;else isTemporalOperator(_0x1ddb6c[_0x56be35(0xd9)])?_0x993153[_0x56be35(0x122)]=_0x2ebebc:_0x993153[_0x56be35(0x155)]=_0x2ebebc;}return _0x1ddb6c[_0x56be35(0x121)]&&(_0x993153[_0x56be35(0x121)]=_0x1ddb6c['unit']),_0x993153;}function mapYamlOperatorType(_0x4f0c83){return _0x4f0c83;}export function toYamlString(_0x4c4c1b){const _0x512e57=a142_0x24cc65,_0x47b372=JSON[_0x512e57(0xf7)](JSON['stringify'](_0x4c4c1b)),_0x7686a4=a142_0x53a596['stringify'](_0x47b372,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x512e57(0x129)}),_0x3453c1=['rule:'];let _0x34d113=_0x7686a4;for(const _0x4242db of _0x3453c1){_0x34d113=_0x34d113['replace'](new RegExp('^('+_0x4242db+')','m'),(_0x3a7a10,_0x5465e7,_0x512e32)=>{if(_0x512e32===0x0||_0x34d113[_0x512e32-0x1]==='\x0a'&&_0x34d113[_0x512e32-0x2]==='\x0a')return _0x5465e7;return'\x0a'+_0x5465e7;});}return _0x34d113;}export function parseYamlString(_0x40690e){return parseSegmentYamlFile(_0x40690e);}export function isSegmentYaml(_0x562236){const _0x3472fb=a142_0x24cc65;if(typeof _0x562236!==_0x3472fb(0x10d)||_0x562236===null)return![];const _0x12b9c0=_0x562236;return _0x12b9c0['type']===_0x3472fb(0x130)||_0x12b9c0[_0x3472fb(0xd9)]===undefined;}function a142_0x36ba(){const _0x31a3a9=['aggregation','include','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','].attribute\x20cannot\x20be\x20empty.\x0a','maxValue','email_recipients','96838OHTLEQ','emailRecipients','valid','min','timezone','values','Warning:\x20activation\x20\x22','connector_config\x20for\x20activation\x20\x22','batch','Please\x20specify\x20a\x20valid\x20attribute\x20name.','isArray','connectionNameToTypeMap','formatting','activation_template_id','run_after_journey_refresh','behavior','attributes','6OgCdzz','join_row','warn','start_at','hourly','minutes_interval','description','Invalid\x20connector_config\x20for\x20activation\x20\x22','join_strategy','week','name','realtime','\x22:\x0a','allColumns','INVALID_ARGUMENT','cron','orderBy','order_by','schedule','entries','5379995kVxojc','add','folder','CONNECTOR_INVALID_CONFIG','456rcWxQI','Column','801xZtJVy','day','connection','kind','7692zqEIyq','emailToIdMap','match','activationParams','type','behavior_table','flatMap','warnings','month','code','notifyOn','sort','columns','92760hlguOs','ruleHashToName','repeat_unit','source','Unknown\x20connection:\x20','repeat_sub_frequency','leftValue','rule','joinRow','max','481766jOAZxQ','minValue','any','scheduleType','notification','connectorConfig','string','segmentFolderId','all_columns','stringify','visible','parse','All','hour','shape','First','runAfterJourneyRefresh','Last','\x20\x20-\x20\x22','minute','Reference','test','joinStrategy','column','3lpkNjp','visibility','\x27:\x20','Behavior','syndicationBehavior','Value','localRuleToName','has','repeatFrequency','object','operator','end_on','behaviorTableName','filter','funnel_stage','get','attribute','resolveSegmentName','startAt','nested_workflow_name','all','TimeRange','arrayMatching','attribute_name','And','513oKVzQM','1080640hcibup','31370964RoSLXe','nested_workflow_project_name','unit','value','endOn','repeatSubFrequency','not','activationTemplateId','isVisible','limit','null','rightValues','set','CONNECTOR_SCHEMA_NOT_FOUND','connectionId','exclude','groupingColumns','segment','daily','conditions[','lockEnabled','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a','Equal','from','nestedWorkflowName','length','__SEGMENT_REF__','join','connector_config','activations','Count','getSchema','JOURNEY_SYNTAX_ERROR','repeatUnit','New\x20Segment','usedNames','isFinite','connectionNameToIdMap','activations:','none','Connector:\x20','repeat_frequency','lock_enabled','reverse','duration','keys','toLowerCase','every','nestedWorkflowProjectName','orderColumn','replace','map','timeWindow','conditions','rightValue','weekly','push'];a142_0x36ba=function(){return _0x31a3a9;};return a142_0x36ba();}export function generateTemplate(_0x1c6a43=a142_0x24cc65(0x141)){const _0x1bf8f9=a142_0x24cc65,_0x837c1c={'type':_0x1bf8f9(0x130),'name':_0x1c6a43,'description':'Segment\x20description','rule':{'type':_0x1bf8f9(0x11c),'conditions':[{'type':_0x1bf8f9(0x109),'attribute':_0x1bf8f9(0x11b),'operator':{'type':_0x1bf8f9(0x135),'value':'value'}}]}};return toYamlString(_0x837c1c);}export function segmentToYamlString(_0xe9f119){const _0x7fea18=a142_0x24cc65,_0xabaeab=JSON[_0x7fea18(0xf7)](JSON['stringify'](_0xe9f119)),_0x1af7cd=a142_0x53a596[_0x7fea18(0xf5)](_0xabaeab,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x7fea18(0x129)}),_0x41e7c6=['rule:',_0x7fea18(0x145)];let _0x225daa=_0x1af7cd;for(const _0x54f726 of _0x41e7c6){_0x225daa=_0x225daa[_0x7fea18(0x151)](new RegExp('^('+_0x54f726+')','m'),(_0x1c6ca5,_0x759d60,_0x20b00e)=>{if(_0x20b00e===0x0||_0x225daa[_0x20b00e-0x1]==='\x0a'&&_0x225daa[_0x20b00e-0x2]==='\x0a')return _0x759d60;return'\x0a'+_0x759d60;});}return _0x225daa;}export function parseSegmentYamlFile(_0x9221d7){return safeParseYaml(_0x9221d7,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x2ca7f5){const _0x4cde11=a142_0x24cc65;return{'type':_0x4cde11(0x130),'name':_0x2ca7f5[_0x4cde11(0x179)],..._0x2ca7f5['description']!==undefined&&{'description':_0x2ca7f5[_0x4cde11(0x175)]},..._0x2ca7f5[_0x4cde11(0xcd)]!==undefined&&{'folder':_0x2ca7f5[_0x4cde11(0xcd)]},..._0x2ca7f5[_0x4cde11(0xe9)]&&{'rule':normalizeRule(_0x2ca7f5[_0x4cde11(0xe9)])},..._0x2ca7f5[_0x4cde11(0xd4)]!==undefined&&{'kind':_0x2ca7f5[_0x4cde11(0xd4)]},..._0x2ca7f5['visible']!==undefined&&{'visible':_0x2ca7f5[_0x4cde11(0xf6)]},..._0x2ca7f5[_0x4cde11(0x13c)]&&{'activations':_0x2ca7f5[_0x4cde11(0x13c)][_0x4cde11(0x152)](normalizeActivation)}};}export function normalizeRule(_0x39a711){const _0x3e7418=a142_0x24cc65;return{'type':_0x39a711[_0x3e7418(0xd9)],'conditions':_0x39a711[_0x3e7418(0x154)][_0x3e7418(0x152)](normalizeCondition),..._0x39a711[_0x3e7418(0x175)]!==undefined&&{'description':_0x39a711[_0x3e7418(0x175)]}};}function normalizeCondition(_0x3c369d){const _0x34d963=a142_0x24cc65;if('segment'in _0x3c369d&&(_0x3c369d['type']===_0x34d963(0x159)||_0x3c369d[_0x34d963(0xd9)]===_0x34d963(0x12e))){const _0x1a1364=_0x3c369d;return{'type':_0x1a1364[_0x34d963(0xd9)],'segment':_0x1a1364[_0x34d963(0x130)]};}if(_0x3c369d[_0x34d963(0xd9)]===_0x34d963(0x11c)||_0x3c369d[_0x34d963(0xd9)]==='Or'){const _0x55f2c1=_0x3c369d;return{'type':_0x55f2c1[_0x34d963(0xd9)],'conditions':_0x55f2c1[_0x34d963(0x154)][_0x34d963(0x152)](normalizeCondition),..._0x55f2c1['description']!==undefined&&{'description':_0x55f2c1[_0x34d963(0x175)]}};}if(_0x34d963(0x103)in _0x3c369d&&_0x3c369d['type']===_0x34d963(0xd0)){const _0x15a8b1=_0x3c369d;return{'type':'Column','column':_0x15a8b1[_0x34d963(0x103)],'operator':normalizeOperator(_0x15a8b1['operator'])};}if(_0x3c369d[_0x34d963(0xd9)]==='Behavior'){const _0xae1e63=_0x3c369d;return{'type':'Behavior','attribute':_0xae1e63[_0x34d963(0x114)],'operator':normalizeOperator(_0xae1e63['operator']),..._0xae1e63[_0x34d963(0x11a)]!==undefined&&{'arrayMatching':_0xae1e63[_0x34d963(0x11a)]},..._0xae1e63[_0x34d963(0x12e)]!==undefined&&{'exclude':_0xae1e63[_0x34d963(0x12e)]},..._0xae1e63[_0x34d963(0x158)]!==undefined&&{'aggregation':_0xae1e63['aggregation']},..._0xae1e63[_0x34d963(0xe5)]!==undefined&&{'source':_0xae1e63[_0x34d963(0xe5)]},..._0xae1e63[_0x34d963(0x111)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0xae1e63[_0x34d963(0x111)])))},..._0xae1e63['timeWindow']!==undefined&&{'timeWindow':_0xae1e63[_0x34d963(0x153)]},..._0xae1e63['limit']!==undefined&&{'limit':_0xae1e63[_0x34d963(0x128)]}};}const _0x4b9095=_0x3c369d;return{'type':'Value','attribute':_0x4b9095[_0x34d963(0x114)],'operator':normalizeOperator(_0x4b9095[_0x34d963(0x10e)]),..._0x4b9095[_0x34d963(0x11a)]!==undefined&&{'arrayMatching':_0x4b9095[_0x34d963(0x11a)]},..._0x4b9095[_0x34d963(0x12e)]!==undefined&&{'exclude':_0x4b9095[_0x34d963(0x12e)]},..._0x4b9095[_0x34d963(0x158)]!==undefined&&{'aggregation':_0x4b9095[_0x34d963(0x158)]},..._0x4b9095[_0x34d963(0xe5)]!==undefined&&{'source':_0x4b9095[_0x34d963(0xe5)]},..._0x4b9095[_0x34d963(0x111)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x4b9095[_0x34d963(0x111)])))},..._0x4b9095['limit']!==undefined&&{'limit':_0x4b9095[_0x34d963(0x128)]}};}function normalizeOperator(_0x56dc2e){const _0x58fa8a=a142_0x24cc65;if(isBetweenOperator(_0x56dc2e['type']))return{'type':_0x56dc2e[_0x58fa8a(0xd9)],..._0x56dc2e['not']!==undefined&&{'not':_0x56dc2e[_0x58fa8a(0x125)]},..._0x56dc2e[_0x58fa8a(0x161)]!==undefined&&{'min':_0x56dc2e[_0x58fa8a(0x161)]},..._0x56dc2e[_0x58fa8a(0xeb)]!==undefined&&{'max':_0x56dc2e['max']}};const _0x124ae1=getEffectiveValue(_0x56dc2e);return{'type':_0x56dc2e[_0x58fa8a(0xd9)],..._0x56dc2e['not']!==undefined&&{'not':_0x56dc2e[_0x58fa8a(0x125)]},..._0x124ae1!==undefined&&{'value':_0x124ae1},..._0x56dc2e[_0x58fa8a(0x121)]!==undefined&&{'unit':_0x56dc2e[_0x58fa8a(0x121)]},..._0x56dc2e[_0x58fa8a(0x14b)]!==undefined&&{'duration':_0x56dc2e[_0x58fa8a(0x14b)]},..._0x56dc2e[_0x58fa8a(0x136)]!==undefined&&{'from':_0x56dc2e[_0x58fa8a(0x136)]},..._0x56dc2e[_0x58fa8a(0x14a)]!==undefined&&{'reverse':_0x56dc2e[_0x58fa8a(0x14a)]}};}function normalizeActivation(_0x1c94c0){const _0x36f9c3=a142_0x24cc65;return{'name':_0x1c94c0[_0x36f9c3(0x179)],'connection':_0x1c94c0['connection'],..._0x1c94c0[_0x36f9c3(0x175)]!==undefined&&{'description':_0x1c94c0['description']},..._0x1c94c0[_0x36f9c3(0xf4)]!==undefined&&{'all_columns':_0x1c94c0['all_columns']},..._0x1c94c0[_0x36f9c3(0xe1)]!==undefined&&{'columns':_0x1c94c0[_0x36f9c3(0xe1)]},..._0x1c94c0[_0x36f9c3(0x16d)]!==undefined&&{'behavior':_0x1c94c0[_0x36f9c3(0x16d)]},..._0x1c94c0['schedule']!==undefined&&{'schedule':_0x1c94c0[_0x36f9c3(0x181)]},..._0x1c94c0[_0x36f9c3(0xf0)]!==undefined&&{'notification':_0x1c94c0[_0x36f9c3(0xf0)]},..._0x1c94c0[_0x36f9c3(0x13b)]!==undefined&&{'connector_config':_0x1c94c0[_0x36f9c3(0x13b)]},..._0x1c94c0[_0x36f9c3(0x16b)]!==undefined&&{'activation_template_id':_0x1c94c0[_0x36f9c3(0x16b)]},..._0x1c94c0[_0x36f9c3(0x120)]!==undefined&&{'nested_workflow_project_name':_0x1c94c0[_0x36f9c3(0x120)]},..._0x1c94c0['nested_workflow_name']!==undefined&&{'nested_workflow_name':_0x1c94c0[_0x36f9c3(0x117)]},..._0x1c94c0[_0x36f9c3(0x149)]!==undefined&&{'lock_enabled':_0x1c94c0[_0x36f9c3(0x149)]}};}function getColumnName(_0x86f8c1){const _0x1eadc7=a142_0x24cc65;return _0x86f8c1[_0x1eadc7(0x103)]||_0x86f8c1['name'];}export function activationResponseToDef(_0x5d3f25,_0x1bfddf,_0x2d087d){const _0x3360e6=a142_0x24cc65,_0x26e56b=_0x5d3f25[_0x3360e6(0x12d)]||'',_0x267107=_0x2d087d?.[_0x3360e6(0x113)](_0x26e56b)??_0x26e56b,_0x15dfb4={'name':_0x5d3f25[_0x3360e6(0x179)],'connection':_0x267107};_0x5d3f25['description']&&(_0x15dfb4[_0x3360e6(0x175)]=_0x5d3f25[_0x3360e6(0x175)]);let _0x2d2c89=[];_0x5d3f25[_0x3360e6(0xe1)]&&_0x5d3f25['columns'][_0x3360e6(0x138)]>0x0&&(_0x2d2c89=_0x5d3f25[_0x3360e6(0xe1)]['filter'](_0x58d88e=>_0x58d88e&&getColumnName(_0x58d88e))[_0x3360e6(0x152)](_0x137ba0=>{const _0x1522ed=_0x3360e6,_0x3b35d5=getColumnName(_0x137ba0);if(_0x137ba0['type']||_0x137ba0['visibility'])return{'name':_0x3b35d5,..._0x137ba0[_0x1522ed(0xd9)]&&{'type':_0x137ba0[_0x1522ed(0xd9)]},..._0x137ba0['visibility']&&{'visibility':_0x137ba0['visibility']}};return _0x3b35d5;}));_0x2d2c89['length']>0x0&&(_0x15dfb4[_0x3360e6(0xe1)]=_0x2d2c89);_0x5d3f25['allColumns']!==undefined&&(_0x5d3f25[_0x3360e6(0x17c)]===![]&&_0x2d2c89[_0x3360e6(0x138)]===0x0?_0x15dfb4[_0x3360e6(0xf4)]=!![]:_0x15dfb4[_0x3360e6(0xf4)]=_0x5d3f25[_0x3360e6(0x17c)]);const _0x293527={};let _0x2cd548=![];_0x5d3f25['scheduleType']&&(_0x293527['type']=_0x5d3f25[_0x3360e6(0xef)],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x140)]&&(_0x293527['repeat_unit']=_0x5d3f25[_0x3360e6(0x140)],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x10c)]!==undefined&&_0x5d3f25[_0x3360e6(0x10c)]!==null&&(_0x293527['repeat_frequency']=_0x5d3f25['repeatFrequency'],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x124)]&&_0x5d3f25[_0x3360e6(0x124)][_0x3360e6(0x138)]>0x0&&(_0x293527['repeat_sub_frequency']=_0x5d3f25['repeatSubFrequency'],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x116)]!==undefined&&(_0x293527[_0x3360e6(0x172)]=_0x5d3f25[_0x3360e6(0x116)],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x123)]!==undefined&&(_0x293527[_0x3360e6(0x10f)]=_0x5d3f25['endOn'],_0x2cd548=!![]);_0x5d3f25['timezone']&&(_0x293527[_0x3360e6(0x162)]=_0x5d3f25[_0x3360e6(0x162)],_0x2cd548=!![]);_0x2cd548&&(_0x15dfb4[_0x3360e6(0x181)]=_0x293527);(_0x5d3f25[_0x3360e6(0xdf)]&&_0x5d3f25['notifyOn'][_0x3360e6(0x138)]>0x0||_0x5d3f25[_0x3360e6(0x15f)]&&_0x5d3f25[_0x3360e6(0x15f)][_0x3360e6(0x138)]>0x0)&&(_0x15dfb4['notification']={},_0x5d3f25[_0x3360e6(0xdf)]&&_0x5d3f25['notifyOn'][_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0xf0)]['notify_on']=_0x5d3f25[_0x3360e6(0xdf)]),_0x5d3f25[_0x3360e6(0x15f)]&&_0x5d3f25[_0x3360e6(0x15f)][_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0xf0)][_0x3360e6(0x15d)]=_0x5d3f25['emailRecipients'][_0x3360e6(0x152)](_0xaa39d5=>{const _0x26b1ad=_0x3360e6,_0x113400=_0x1bfddf?.[_0x26b1ad(0x113)](_0xaa39d5);return _0x113400??String(_0xaa39d5);})));_0x5d3f25['connectorConfig']&&Object[_0x3360e6(0x14c)](_0x5d3f25['connectorConfig'])[_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0x13b)]=normalizeConnectorConfigForYaml(_0x5d3f25['connectorConfig']));_0x5d3f25[_0x3360e6(0x126)]&&(_0x15dfb4['activation_template_id']=_0x5d3f25[_0x3360e6(0x126)]);if(_0x5d3f25[_0x3360e6(0x108)]){const _0x4e63b5={},_0x522644=_0x5d3f25['syndicationBehavior'];_0x522644[_0x3360e6(0xe1)]&&_0x522644[_0x3360e6(0xe1)][_0x3360e6(0x138)]>0x0&&(_0x4e63b5[_0x3360e6(0xe1)]=_0x522644[_0x3360e6(0xe1)]['filter'](_0x130acb=>_0x130acb&&getColumnName(_0x130acb))[_0x3360e6(0x152)](_0xf3fde3=>({'name':getColumnName(_0xf3fde3),..._0xf3fde3['type']&&{'type':_0xf3fde3[_0x3360e6(0xd9)]},..._0xf3fde3[_0x3360e6(0x105)]&&{'visibility':_0xf3fde3['visibility']}}))),_0x522644[_0x3360e6(0x110)]&&(_0x4e63b5[_0x3360e6(0xda)]=_0x522644[_0x3360e6(0x110)]),_0x522644[_0x3360e6(0xea)]!==undefined&&(_0x4e63b5[_0x3360e6(0x170)]=_0x522644[_0x3360e6(0xea)]),_0x522644[_0x3360e6(0x102)]&&(_0x4e63b5[_0x3360e6(0x177)]=_0x522644[_0x3360e6(0x102)]),_0x522644[_0x3360e6(0x16a)]&&(_0x4e63b5[_0x3360e6(0x16a)]=_0x522644['formatting']),_0x522644[_0x3360e6(0x17f)]&&_0x522644[_0x3360e6(0x17f)][_0x3360e6(0x138)]>0x0&&(_0x4e63b5[_0x3360e6(0x180)]=_0x522644[_0x3360e6(0x17f)]),Object[_0x3360e6(0x14c)](_0x4e63b5)[_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0x16d)]=_0x4e63b5);}return _0x5d3f25['nestedWorkflowProjectName']&&(_0x15dfb4[_0x3360e6(0x120)]=_0x5d3f25[_0x3360e6(0x14f)]),_0x5d3f25[_0x3360e6(0x137)]&&(_0x15dfb4[_0x3360e6(0x117)]=_0x5d3f25[_0x3360e6(0x137)]),_0x5d3f25[_0x3360e6(0x133)]!==undefined&&(_0x15dfb4[_0x3360e6(0x149)]=_0x5d3f25['lockEnabled']),_0x15dfb4;}export function journeyActivationStepToYaml(_0x4a126b,_0x96c2d8,_0x55311d){const _0x1ab91d=a142_0x24cc65,_0x487b07=_0x4a126b[_0x1ab91d(0x16e)][_0x1ab91d(0xd8)],_0x5b53cb=_0x487b07[_0x1ab91d(0x12d)]||'',_0x159d71=_0x55311d?.[_0x1ab91d(0x113)](_0x5b53cb)??_0x5b53cb,_0x1af0b0={'name':_0x487b07['name']||'','connection':_0x159d71};_0x4a126b[_0x1ab91d(0x16e)][_0x1ab91d(0xfc)]&&(_0x1af0b0[_0x1ab91d(0x16c)]=!![]);_0x487b07[_0x1ab91d(0x175)]&&(_0x1af0b0['description']=_0x487b07[_0x1ab91d(0x175)]);let _0x185483=[];_0x487b07[_0x1ab91d(0xe1)]&&_0x487b07[_0x1ab91d(0xe1)][_0x1ab91d(0x138)]>0x0&&(_0x185483=_0x487b07[_0x1ab91d(0xe1)]['filter'](_0x62e7c1=>_0x62e7c1&&getColumnName(_0x62e7c1))[_0x1ab91d(0x152)](_0x1a4843=>{const _0x10f3cf=_0x1ab91d,_0x49d35f=getColumnName(_0x1a4843);if(_0x1a4843[_0x10f3cf(0xd9)]||_0x1a4843[_0x10f3cf(0x105)])return{'name':_0x49d35f,..._0x1a4843[_0x10f3cf(0xd9)]&&{'type':_0x1a4843[_0x10f3cf(0xd9)]},..._0x1a4843['visibility']&&{'visibility':_0x1a4843[_0x10f3cf(0x105)]}};return _0x49d35f;}));_0x185483[_0x1ab91d(0x138)]>0x0&&(_0x1af0b0[_0x1ab91d(0xe1)]=_0x185483);_0x487b07[_0x1ab91d(0x17c)]!==undefined&&(_0x487b07[_0x1ab91d(0x17c)]===![]&&_0x185483[_0x1ab91d(0x138)]===0x0?_0x1af0b0[_0x1ab91d(0xf4)]=!![]:_0x1af0b0[_0x1ab91d(0xf4)]=_0x487b07[_0x1ab91d(0x17c)]);const _0x44c05b={};let _0x3d9d6b=![];_0x487b07['scheduleType']&&(_0x44c05b['type']=_0x487b07[_0x1ab91d(0xef)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x140)]&&(_0x44c05b['repeat_unit']=_0x487b07[_0x1ab91d(0x140)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x10c)]!==undefined&&_0x487b07[_0x1ab91d(0x10c)]!==null&&(_0x44c05b['repeat_frequency']=_0x487b07['repeatFrequency'],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x116)]!==undefined&&(_0x44c05b[_0x1ab91d(0x172)]=_0x487b07[_0x1ab91d(0x116)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x123)]!==undefined&&(_0x44c05b['end_on']=_0x487b07[_0x1ab91d(0x123)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x162)]&&(_0x44c05b[_0x1ab91d(0x162)]=_0x487b07[_0x1ab91d(0x162)],_0x3d9d6b=!![]);_0x3d9d6b&&(_0x1af0b0[_0x1ab91d(0x181)]=_0x44c05b);(_0x487b07[_0x1ab91d(0xdf)]&&_0x487b07['notifyOn'][_0x1ab91d(0x138)]>0x0||_0x487b07[_0x1ab91d(0x15f)]&&_0x487b07[_0x1ab91d(0x15f)][_0x1ab91d(0x138)]>0x0)&&(_0x1af0b0[_0x1ab91d(0xf0)]={},_0x487b07[_0x1ab91d(0xdf)]&&_0x487b07['notifyOn']['length']>0x0&&(_0x1af0b0['notification']['notify_on']=_0x487b07[_0x1ab91d(0xdf)]),_0x487b07[_0x1ab91d(0x15f)]&&_0x487b07[_0x1ab91d(0x15f)][_0x1ab91d(0x138)]>0x0&&(_0x1af0b0[_0x1ab91d(0xf0)][_0x1ab91d(0x15d)]=_0x487b07[_0x1ab91d(0x15f)][_0x1ab91d(0x152)](_0x52778a=>{const _0x185ba3=_0x1ab91d,_0x11d77a=_0x96c2d8?.[_0x185ba3(0x113)](_0x52778a);return _0x11d77a??String(_0x52778a);})));_0x487b07[_0x1ab91d(0xf1)]&&Object[_0x1ab91d(0x14c)](_0x487b07[_0x1ab91d(0xf1)])[_0x1ab91d(0x138)]>0x0&&(_0x1af0b0['connector_config']=normalizeConnectorConfigForYaml(_0x487b07['connectorConfig']));_0x487b07[_0x1ab91d(0x126)]&&(_0x1af0b0[_0x1ab91d(0x16b)]=_0x487b07['activationTemplateId']);if(_0x487b07['syndicationBehavior']){const _0xa5de99={},_0x649678=_0x487b07['syndicationBehavior'];_0x649678[_0x1ab91d(0xe1)]&&_0x649678[_0x1ab91d(0xe1)]['length']>0x0&&(_0xa5de99[_0x1ab91d(0xe1)]=_0x649678['columns'][_0x1ab91d(0x111)](_0x33a88d=>_0x33a88d&&getColumnName(_0x33a88d))[_0x1ab91d(0x152)](_0x2ad63c=>({'name':getColumnName(_0x2ad63c),..._0x2ad63c[_0x1ab91d(0xd9)]&&{'type':_0x2ad63c[_0x1ab91d(0xd9)]},..._0x2ad63c[_0x1ab91d(0x105)]&&{'visibility':_0x2ad63c[_0x1ab91d(0x105)]}}))),_0x649678['behaviorTableName']&&(_0xa5de99[_0x1ab91d(0xda)]=_0x649678['behaviorTableName']),_0x649678['joinRow']!==undefined&&(_0xa5de99[_0x1ab91d(0x170)]=_0x649678[_0x1ab91d(0xea)]),_0x649678[_0x1ab91d(0x102)]&&(_0xa5de99[_0x1ab91d(0x177)]=_0x649678[_0x1ab91d(0x102)]),_0x649678['formatting']&&(_0xa5de99[_0x1ab91d(0x16a)]=_0x649678[_0x1ab91d(0x16a)]),_0x649678[_0x1ab91d(0x17f)]&&_0x649678[_0x1ab91d(0x17f)]['length']>0x0&&(_0xa5de99[_0x1ab91d(0x180)]=_0x649678[_0x1ab91d(0x17f)]),Object[_0x1ab91d(0x14c)](_0xa5de99)[_0x1ab91d(0x138)]>0x0&&(_0x1af0b0['behavior']=_0xa5de99);}return _0x1af0b0;}export function segmentWithActivationsToYaml(_0x2976a4,_0x20559a,_0xc03e83,_0x36ced7,_0x1aa8c4){const _0x2284d7=a142_0x24cc65,_0x1f3f10=segmentResponseToDefSync(_0x2976a4,_0xc03e83);return _0x20559a['length']>0x0&&(_0x1f3f10[_0x2284d7(0x13c)]=_0x20559a[_0x2284d7(0x152)](_0x4cccb8=>activationResponseToDef(_0x4cccb8,_0x36ced7,_0x1aa8c4))),_0x1f3f10;}function normalizeColumn(_0xce03ce){const _0x4f0d41=a142_0x24cc65;if(typeof _0xce03ce===_0x4f0d41(0xf2))return{'column':_0xce03ce,'source':{'column':_0xce03ce}};return{'column':_0xce03ce[_0x4f0d41(0x179)],'source':{'column':_0xce03ce[_0x4f0d41(0x179)]},..._0xce03ce[_0x4f0d41(0xd9)]&&{'type':_0xce03ce[_0x4f0d41(0xd9)]},..._0xce03ce[_0x4f0d41(0x105)]&&{'visibility':_0xce03ce[_0x4f0d41(0x105)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a142_0x24cc65(0x14c)](ActivationDefSchema[a142_0x24cc65(0xfa)]));export function warnUnrecognizedActivationFields(_0x47f266,_0x11c23c){const _0x84dd22=a142_0x24cc65,_0x3180ac=Object['keys'](_0x47f266)[_0x84dd22(0x111)](_0x14d13d=>!KNOWN_ACTIVATION_FIELDS[_0x84dd22(0x10b)](_0x14d13d));if(_0x3180ac[_0x84dd22(0x138)]>0x0){const _0x56d11a=_0x3180ac[_0x84dd22(0x152)](_0x5c440a=>_0x84dd22(0xfe)+_0x5c440a+'\x22')[_0x84dd22(0x13a)]('\x0a');console[_0x84dd22(0x171)](_0x84dd22(0x164)+_0x11c23c+_0x84dd22(0x134)+_0x56d11a);}}export async function activationDefToCreateRequest(_0x41d76d,_0x4ce43d){const _0x496fbe=a142_0x24cc65;warnUnrecognizedActivationFields(_0x41d76d,_0x41d76d['name']);const _0x117572=_0x4ce43d?.[_0x496fbe(0xd6)],_0x319a16=_0x4ce43d?.[_0x496fbe(0x144)],_0x27fccc=_0x41d76d[_0x496fbe(0xd3)];let _0x59f57c;const _0x1c9e18=parseInt(_0x27fccc,0xa);if(!isNaN(_0x1c9e18)&&String(_0x1c9e18)===_0x27fccc)_0x59f57c=_0x1c9e18;else{const _0x156759=_0x319a16?.[_0x496fbe(0x113)](_0x27fccc);if(_0x156759===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x496fbe(0xe6)+_0x27fccc,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x59f57c=_0x156759;}const _0x10300b={'name':_0x41d76d[_0x496fbe(0x179)],'connectionId':_0x59f57c};_0x41d76d[_0x496fbe(0x175)]&&(_0x10300b[_0x496fbe(0x175)]=_0x41d76d[_0x496fbe(0x175)]);let _0x5a006d=[];_0x41d76d[_0x496fbe(0xe1)]&&_0x41d76d[_0x496fbe(0xe1)][_0x496fbe(0x138)]>0x0&&(_0x5a006d=_0x41d76d[_0x496fbe(0xe1)][_0x496fbe(0x111)](_0x2f42f7=>_0x2f42f7!=null)['map'](normalizeColumn));_0x5a006d['length']>0x0&&(_0x10300b[_0x496fbe(0xe1)]=_0x5a006d);_0x41d76d[_0x496fbe(0xf4)]!==undefined&&(_0x41d76d[_0x496fbe(0xf4)]===![]&&_0x5a006d[_0x496fbe(0x138)]===0x0?_0x10300b[_0x496fbe(0x17c)]=!![]:_0x10300b[_0x496fbe(0x17c)]=_0x41d76d[_0x496fbe(0xf4)]);if(_0x41d76d['schedule']){const _0x3bfb4a=_0x41d76d[_0x496fbe(0x181)],_0x4e4516=_0x3bfb4a[_0x496fbe(0xd9)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x3bfb4a[_0x496fbe(0xe4)]];_0x4e4516&&(_0x10300b[_0x496fbe(0xef)]=_0x4e4516);const _0x176c2f=_0x3bfb4a['repeat_unit']??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x3bfb4a[_0x496fbe(0xd9)]];_0x176c2f&&(_0x10300b[_0x496fbe(0x140)]=_0x176c2f);_0x3bfb4a[_0x496fbe(0x148)]!==undefined&&(_0x10300b['repeatFrequency']=_0x3bfb4a['repeat_frequency']);_0x3bfb4a[_0x496fbe(0xe7)]&&(_0x10300b[_0x496fbe(0x124)]=_0x3bfb4a[_0x496fbe(0xe7)]);_0x3bfb4a['start_at']!==undefined&&(_0x10300b[_0x496fbe(0x116)]=_0x3bfb4a[_0x496fbe(0x172)]);_0x3bfb4a[_0x496fbe(0x10f)]!==undefined&&(_0x10300b[_0x496fbe(0x123)]=_0x3bfb4a[_0x496fbe(0x10f)]);_0x3bfb4a['timezone']&&(_0x10300b[_0x496fbe(0x162)]=_0x3bfb4a[_0x496fbe(0x162)]);if(_0x4e4516&&_0x4e4516!==_0x496fbe(0x146)&&_0x4e4516!==_0x496fbe(0x17e)&&_0x3bfb4a['start_at']){const _0x3be5db=_0x3bfb4a['start_at'][_0x496fbe(0xd7)](/T(\d{2}:\d{2})/);_0x3be5db&&(_0x10300b['scheduleOption']=_0x3be5db[0x1]);}}_0x41d76d[_0x496fbe(0xf0)]&&(_0x41d76d[_0x496fbe(0xf0)]['notify_on']&&(_0x10300b['notifyOn']=_0x41d76d[_0x496fbe(0xf0)]['notify_on']),_0x41d76d[_0x496fbe(0xf0)]['email_recipients']&&(_0x10300b[_0x496fbe(0x15f)]=_0x41d76d[_0x496fbe(0xf0)][_0x496fbe(0x15d)][_0x496fbe(0x152)](_0x47d7b1=>{const _0x14aa58=_0x496fbe,_0x1bfa6a=Number(_0x47d7b1);if(!isNaN(_0x1bfa6a)&&String(_0x1bfa6a)===_0x47d7b1)return _0x1bfa6a;const _0x52f787=_0x117572?.['get'](_0x47d7b1[_0x14aa58(0x14d)]());if(_0x52f787===undefined)throw new SDKError(ErrorCode[_0x14aa58(0x17d)],'Unknown\x20email\x20recipient:\x20'+_0x47d7b1+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x52f787;})));if(_0x41d76d[_0x496fbe(0x13b)]){const _0x2aed2f=_0x4ce43d?.[_0x496fbe(0x169)]?.[_0x496fbe(0x113)](_0x27fccc);if(_0x2aed2f&&_0x4ce43d?.[_0x496fbe(0x13e)])try{const _0x313b74=await _0x4ce43d[_0x496fbe(0x13e)](_0x2aed2f),_0x61a3fb=validateConnectorConfig(_0x41d76d[_0x496fbe(0x13b)],_0x313b74);if(!_0x61a3fb[_0x496fbe(0x160)])throw new SDKError(ErrorCode[_0x496fbe(0xce)],_0x496fbe(0x176)+_0x41d76d[_0x496fbe(0x179)]+'\x22:\x0a'+formatValidationErrors(_0x61a3fb['errors']),undefined,{'helpText':_0x496fbe(0x147)+_0x2aed2f+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x313b74)});if(_0x61a3fb['warnings'][_0x496fbe(0x138)]>0x0){const _0x55ae1=formatValidationWarnings(_0x61a3fb[_0x496fbe(0xdc)]);console[_0x496fbe(0x171)](_0x496fbe(0x165)+_0x41d76d[_0x496fbe(0x179)]+_0x496fbe(0x17b)+_0x55ae1);}_0x10300b[_0x496fbe(0xf1)]=transformConfigToLegacy(_0x41d76d['connector_config'],_0x313b74);}catch(_0x537983){if(_0x537983 instanceof SDKError&&_0x537983[_0x496fbe(0xde)]===ErrorCode[_0x496fbe(0x12c)])_0x10300b[_0x496fbe(0xf1)]=_0x41d76d[_0x496fbe(0x13b)];else throw _0x537983;}else _0x10300b[_0x496fbe(0xf1)]=_0x41d76d[_0x496fbe(0x13b)];}_0x41d76d[_0x496fbe(0x16b)]!==undefined&&(_0x10300b[_0x496fbe(0x126)]=_0x41d76d['activation_template_id']);if(_0x41d76d[_0x496fbe(0x16d)]){const _0xdfca75=_0x41d76d[_0x496fbe(0x16d)],_0x13bf28={};if(_0xdfca75[_0x496fbe(0xe1)]&&_0xdfca75[_0x496fbe(0xe1)]['length']>0x0){const _0x213ee3=_0xdfca75[_0x496fbe(0xe1)][_0x496fbe(0x111)](_0x3849fc=>_0x3849fc&&_0x3849fc[_0x496fbe(0x179)])['map'](normalizeColumn);_0x213ee3[_0x496fbe(0x138)]>0x0&&(_0x13bf28['columns']=_0x213ee3);}_0xdfca75[_0x496fbe(0xda)]&&(_0x13bf28[_0x496fbe(0x110)]=_0xdfca75[_0x496fbe(0xda)]);_0xdfca75[_0x496fbe(0x177)]&&(_0x13bf28[_0x496fbe(0x102)]=_0xdfca75[_0x496fbe(0x177)]);if(_0xdfca75[_0x496fbe(0x170)]!==undefined)_0x13bf28['joinRow']=_0xdfca75['join_row'];else{if(_0xdfca75[_0x496fbe(0x177)]===_0x496fbe(0xfd)||_0xdfca75['join_strategy']===_0x496fbe(0xfb))_0x13bf28[_0x496fbe(0xea)]=0x1;else _0xdfca75['join_strategy']===_0x496fbe(0xf8)&&(_0x13bf28[_0x496fbe(0xea)]=null);}_0xdfca75[_0x496fbe(0x16a)]&&(_0x13bf28[_0x496fbe(0x16a)]=_0xdfca75[_0x496fbe(0x16a)]),_0xdfca75[_0x496fbe(0x180)]&&(_0x13bf28['orderBy']=_0xdfca75[_0x496fbe(0x180)]),_0x10300b[_0x496fbe(0x108)]=_0x13bf28;}return _0x41d76d[_0x496fbe(0x120)]&&(_0x10300b['nestedWorkflowProjectName']=_0x41d76d[_0x496fbe(0x120)]),_0x41d76d[_0x496fbe(0x117)]&&(_0x10300b['nestedWorkflowName']=_0x41d76d[_0x496fbe(0x117)]),_0x41d76d[_0x496fbe(0x149)]!==undefined&&(_0x10300b[_0x496fbe(0x133)]=_0x41d76d[_0x496fbe(0x149)]),_0x10300b;}export async function activationDefToUpdateRequest(_0x4c9887,_0xb41354){return activationDefToCreateRequest(_0x4c9887,_0xb41354);}export function deepSortObject(_0x3cb4bc){const _0x514df8=a142_0x24cc65;if(_0x3cb4bc===null||typeof _0x3cb4bc!=='object')return _0x3cb4bc;if(Array[_0x514df8(0x168)](_0x3cb4bc))return _0x3cb4bc[_0x514df8(0x152)](deepSortObject)[_0x514df8(0xe0)]((_0x3771bc,_0x565610)=>JSON['stringify'](_0x3771bc)['localeCompare'](JSON['stringify'](_0x565610)));const _0x5c1126={};for(const _0x58f61f of Object[_0x514df8(0x14c)](_0x3cb4bc)[_0x514df8(0xe0)]()){_0x5c1126[_0x58f61f]=deepSortObject(_0x3cb4bc[_0x58f61f]);}return _0x5c1126;}export function serializeRule(_0x4234a1){const _0x4af443=a142_0x24cc65;return JSON[_0x4af443(0xf5)](deepSortObject(_0x4234a1));}export function normalizeRuleForMatching(_0x424d7a){return normalizeConditionsForMatching(_0x424d7a);}function normalizeConditionsForMatching(_0xab0a68){const _0x3d159c=a142_0x24cc65;if(_0xab0a68===null||typeof _0xab0a68!==_0x3d159c(0x10d))return _0xab0a68;if(Array['isArray'](_0xab0a68))return _0xab0a68[_0x3d159c(0x152)](normalizeConditionsForMatching);const _0x36a158=_0xab0a68;if((_0x36a158[_0x3d159c(0xd9)]===_0x3d159c(0x159)||_0x36a158[_0x3d159c(0xd9)]==='exclude')&&typeof _0x36a158['segment']==='string')return{..._0x36a158,'segment':_0x3d159c(0x139)};const _0x1df16b={};for(const _0x47cdab of Object[_0x3d159c(0x14c)](_0x36a158)){_0x1df16b[_0x47cdab]=normalizeConditionsForMatching(_0x36a158[_0x47cdab]);}return _0x1df16b;}export function serializeRuleForMatching(_0x4a283f){const _0x494d06=a142_0x24cc65;return JSON[_0x494d06(0xf5)](deepSortObject(normalizeRuleForMatching(_0x4a283f)));}export function expandSegmentReferences(_0x2ebd2e,_0x46a4f4,_0xb8b80a=new Set()){return expandConditions(_0x2ebd2e,_0x46a4f4,_0xb8b80a);}function expandConditions(_0x2c9a57,_0x5c3bc3,_0x4558f2){const _0x314ff9=a142_0x24cc65;if(_0x2c9a57===null||typeof _0x2c9a57!=='object')return _0x2c9a57;if(Array[_0x314ff9(0x168)](_0x2c9a57))return _0x2c9a57[_0x314ff9(0x152)](_0x5c7253=>expandConditions(_0x5c7253,_0x5c3bc3,_0x4558f2));const _0x4f626f=_0x2c9a57;if((_0x4f626f[_0x314ff9(0xd9)]===_0x314ff9(0x159)||_0x4f626f['type']==='exclude')&&typeof _0x4f626f[_0x314ff9(0x130)]===_0x314ff9(0xf2)){const _0x431a75=_0x4f626f[_0x314ff9(0x130)],_0x5e18d8=_0x5c3bc3[_0x314ff9(0x113)](_0x431a75);if(_0x5e18d8&&!_0x4558f2[_0x314ff9(0x10b)](_0x431a75)){const _0x72b40b=new Set(_0x4558f2);_0x72b40b[_0x314ff9(0xcc)](_0x431a75);const _0x434358=expandConditions(_0x5e18d8,_0x5c3bc3,_0x72b40b);return{'type':_0x4f626f[_0x314ff9(0xd9)],'expanded_rule':_0x434358};}return{'type':_0x4f626f['type'],'expanded_rule':'__UNRESOLVED__'};}const _0x57d462={};for(const _0x1b6c53 of Object[_0x314ff9(0x14c)](_0x4f626f)){_0x57d462[_0x1b6c53]=expandConditions(_0x4f626f[_0x1b6c53],_0x5c3bc3,_0x4558f2);}return _0x57d462;}export function serializeExpandedRule(_0x300cee,_0x2beee7){const _0xf92201=a142_0x24cc65,_0x50eb70=expandSegmentReferences(_0x300cee,_0x2beee7);return JSON[_0xf92201(0xf5)](deepSortObject(_0x50eb70));}export function createSegmentNameContext(_0x33353f){const _0x5ba8c9=a142_0x24cc65,_0x12172b=new Set(),_0x2bb15c=new Map(),_0x99abfb=new Map();if(_0x33353f)for(const [_0x5f0960,_0x466a73]of Object[_0x5ba8c9(0x182)](_0x33353f)){if(_0x466a73[_0x5ba8c9(0xe9)]){const _0x3156ed=serializeRule(_0x466a73['rule']);_0x99abfb[_0x5ba8c9(0x12b)](_0x3156ed,_0x5f0960),_0x12172b[_0x5ba8c9(0xcc)](_0x5f0960);}}return{'usedNames':_0x12172b,'ruleHashToName':_0x2bb15c,'localRuleToName':_0x33353f?_0x99abfb:undefined};}export function resolveSegmentName(_0x276f82,_0x2f0911,_0x340552,_0x13470c){const _0xd6cf4a=a142_0x24cc65,_0x5bb532=serializeRule(_0x2f0911);if(_0x340552[_0xd6cf4a(0x10a)]){const _0x1b18ec=_0x340552[_0xd6cf4a(0x10a)]['get'](_0x5bb532);if(_0x1b18ec)return{'name':_0x1b18ec,'isDuplicate':![],'isLocalMatch':!![]};}const _0x18f23b=_0x340552[_0xd6cf4a(0xe3)]['get'](_0x5bb532);if(_0x18f23b)return{'name':_0x18f23b,'isDuplicate':!![],'isLocalMatch':![]};const _0x1e9520=_0x13470c(_0x276f82);let _0x5d948c=_0x1e9520||_0x276f82,_0x2ce86a=_0x5d948c,_0x207916=0x2;while(_0x340552[_0xd6cf4a(0x142)]['has'](_0x2ce86a)){_0x2ce86a=_0x5d948c+'_'+_0x207916,_0x207916++;}return _0x340552['usedNames']['add'](_0x2ce86a),_0x340552[_0xd6cf4a(0xe3)][_0xd6cf4a(0x12b)](_0x5bb532,_0x2ce86a),{'name':_0x2ce86a,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x1716a4){const _0x25a789=[],_0x332a41=_0x6d566e=>{const _0x324508=a142_0x2990;if(!_0x6d566e||typeof _0x6d566e!==_0x324508(0x10d))return;if(Array[_0x324508(0x168)](_0x6d566e)){_0x6d566e['forEach'](_0x332a41);return;}const _0x39fecf=_0x6d566e;(_0x39fecf[_0x324508(0xd9)]===_0x324508(0x159)||_0x39fecf[_0x324508(0xd9)]===_0x324508(0x12e))&&typeof _0x39fecf[_0x324508(0x130)]==='string'&&_0x25a789['push'](_0x39fecf['segment']);for(const _0x4bcde3 of Object[_0x324508(0x163)](_0x39fecf)){_0x332a41(_0x4bcde3);}};return _0x332a41(_0x1716a4),_0x25a789;}export function validateSegmentRule(_0x861275,_0x20abda){const _0x395408=a142_0x24cc65;if(!_0x20abda||!_0x20abda[_0x395408(0x154)])return;for(let _0x3c4853=0x0;_0x3c4853<_0x20abda['conditions']['length'];_0x3c4853++){const _0xdf6b99=_0x20abda[_0x395408(0x154)][_0x3c4853];if(_0x395408(0xd9)in _0xdf6b99&&_0xdf6b99['type']===_0x395408(0x109)){const _0x37b187=_0xdf6b99,_0x2bce3e=_0x37b187[_0x395408(0xe5)]||_0x37b187[_0x395408(0x158)];if((!_0x37b187[_0x395408(0x114)]||_0x37b187[_0x395408(0x114)]==='')&&!_0x2bce3e)throw new SDKError(ErrorCode[_0x395408(0x13f)],_0x395408(0x15a)+_0x861275+_0x395408(0x106)+(_0x395408(0x132)+_0x3c4853+_0x395408(0x15b))+_0x395408(0x167));}}}
|
|
1
|
+
const a142_0x3d3a62=a142_0x2823;(function(_0x34e4eb,_0x3d6c9b){const _0x52a693=a142_0x2823,_0x1198c0=_0x34e4eb();while(!![]){try{const _0x4fe84f=-parseInt(_0x52a693(0x259))/0x1+parseInt(_0x52a693(0x1e1))/0x2+-parseInt(_0x52a693(0x1f1))/0x3+-parseInt(_0x52a693(0x27b))/0x4*(parseInt(_0x52a693(0x1f7))/0x5)+-parseInt(_0x52a693(0x257))/0x6*(parseInt(_0x52a693(0x284))/0x7)+-parseInt(_0x52a693(0x27a))/0x8*(parseInt(_0x52a693(0x281))/0x9)+-parseInt(_0x52a693(0x25b))/0xa*(-parseInt(_0x52a693(0x276))/0xb);if(_0x4fe84f===_0x3d6c9b)break;else _0x1198c0['push'](_0x1198c0['shift']());}catch(_0x39e902){_0x1198c0['push'](_0x1198c0['shift']());}}}(a142_0x31f3,0xc2bc8));import*as a142_0x580f9c from'yaml';import{safeParseYaml}from'./yaml-validator.js';function a142_0x2823(_0x380d78,_0x34f930){_0x380d78=_0x380d78-0x1dd;const _0x31f302=a142_0x31f3();let _0x282363=_0x31f302[_0x380d78];return _0x282363;}import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a142_0x3d3a62(0x23e),'hourly':a142_0x3d3a62(0x23f),'weekly':'week','monthly':a142_0x3d3a62(0x1f0),'minutes_interval':a142_0x3d3a62(0x22a)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x3d3a62(0x23a),'hour':a142_0x3d3a62(0x215),'week':a142_0x3d3a62(0x203),'month':a142_0x3d3a62(0x248),'minute':a142_0x3d3a62(0x258)};function filterRuleAsRuleDef(_0x1efd0c){return _0x1efd0c;}function ruleDefAsFilterRule(_0x4ec5fc){return _0x4ec5fc;}export function segmentResponseToDefSync(_0x2a6ae7,_0x32293c){const _0x146dfa=a142_0x3d3a62,_0x9a7ad1=_0x2a6ae7[_0x146dfa(0x231)]&&_0x146dfa(0x22b)in _0x2a6ae7[_0x146dfa(0x231)]&&_0x2a6ae7['rule'][_0x146dfa(0x22b)];return{'type':'segment','name':_0x2a6ae7['name'],..._0x2a6ae7[_0x146dfa(0x274)]&&{'description':_0x2a6ae7['description']},..._0x32293c&&{'folder':_0x32293c},..._0x9a7ad1&&{'rule':apiRuleToYaml(_0x2a6ae7[_0x146dfa(0x231)])},..._0x2a6ae7[_0x146dfa(0x1ed)]!==undefined&&{'kind':_0x2a6ae7[_0x146dfa(0x1ed)]===0x0?_0x146dfa(0x25c):_0x2a6ae7[_0x146dfa(0x1ed)]===0x1?_0x146dfa(0x1e9):_0x146dfa(0x267)},..._0x2a6ae7['isVisible']!==undefined&&{'visible':_0x2a6ae7[_0x146dfa(0x24b)]}};}export async function segmentResponseToDef(_0x90cc55,_0x49c046,_0x12cd94){const _0x452e06=a142_0x3d3a62,_0xc99899=segmentResponseToDefSync(_0x90cc55,_0x12cd94);if(!_0x49c046||!_0x49c046['resolveSegmentName'])return _0xc99899;return _0xc99899[_0x452e06(0x231)]&&(_0xc99899[_0x452e06(0x231)]=await resolveRuleSegmentRefs(_0xc99899[_0x452e06(0x231)],_0x49c046[_0x452e06(0x22f)])),_0xc99899;}export function apiRuleToYaml(_0x2c9db8){const _0x26e19d=a142_0x3d3a62,_0x5b2713=(_0x2c9db8[_0x26e19d(0x26b)]||[])[_0x26e19d(0x20c)](_0x53901f=>{const _0x57ec2b=_0x26e19d,_0x3944a7=apiConditionToYaml(_0x53901f);if(isCompositeType(_0x3944a7)&&_0x3944a7[_0x57ec2b(0x274)]!==undefined){const _0x5558c=_0x3944a7;if(_0x5558c[_0x57ec2b(0x26b)][_0x57ec2b(0x21f)]===0x1)return _0x5558c[_0x57ec2b(0x26b)];return[{'type':_0x5558c[_0x57ec2b(0x22b)],'conditions':_0x5558c[_0x57ec2b(0x26b)]}];}return[_0x3944a7];});if(_0x5b2713[_0x26e19d(0x21f)]===0x1&&!_0x2c9db8[_0x26e19d(0x274)]&&isCompositeType(_0x5b2713[0x0])){const _0x285e3f=_0x5b2713[0x0];if(_0x285e3f[_0x26e19d(0x22b)]===_0x2c9db8[_0x26e19d(0x22b)]&&_0x285e3f[_0x26e19d(0x26b)]&&_0x285e3f[_0x26e19d(0x274)]===undefined)return{'type':_0x2c9db8[_0x26e19d(0x22b)],'conditions':_0x285e3f[_0x26e19d(0x26b)]};}return{'type':_0x2c9db8['type'],'conditions':_0x5b2713};}export async function resolveRuleSegmentRefs(_0x5bb396,_0x1cc428){return transformRuleSegmentRefs(_0x5bb396,_0x1cc428,_0x3ce0e4=>/^\d+$/['test'](_0x3ce0e4));}async function transformConditionSegmentRefs(_0x35a4de,_0x3e2e0a,_0x4e2641,_0x35f67d){const _0x4a1616=a142_0x3d3a62;if('segment'in _0x35a4de&&(_0x35a4de['type']===_0x4a1616(0x217)||_0x35a4de['type']===_0x4a1616(0x216))){const _0x2fd79a=_0x35a4de;if(_0x4e2641(_0x2fd79a[_0x4a1616(0x21e)]))return{..._0x2fd79a,'segment':await _0x3e2e0a(_0x2fd79a[_0x4a1616(0x21e)])};return _0x35a4de;}if(_0x4a1616(0x26b)in _0x35a4de&&_0x35a4de[_0x4a1616(0x26b)]){const _0xd47661=_0x35a4de,_0x3e9f4b=await Promise[_0x4a1616(0x222)](_0xd47661[_0x4a1616(0x26b)][_0x4a1616(0x288)](_0x3f3d28=>transformConditionSegmentRefs(_0x3f3d28,_0x3e2e0a,_0x4e2641,_0x35f67d)));return{..._0xd47661,'conditions':_0x3e9f4b};}if(_0x4a1616(0x232)in _0x35a4de&&_0x35a4de[_0x4a1616(0x232)]){const _0x3ec960=_0x35a4de,_0x311fdd=await _0x35f67d(filterRuleAsRuleDef(_0x3ec960[_0x4a1616(0x232)]),_0x3e2e0a);return{..._0x3ec960,'filter':ruleDefAsFilterRule(_0x311fdd)};}return _0x35a4de;}async function transformRuleSegmentRefs(_0x3c8084,_0x4408a7,_0x4094a0){const _0x455f5d=a142_0x3d3a62,_0x56d564=(_0x2a0d61,_0xacfa57)=>transformRuleSegmentRefs(_0x2a0d61,_0xacfa57,_0x4094a0),_0xf2d8d3=await Promise[_0x455f5d(0x222)](_0x3c8084['conditions'][_0x455f5d(0x288)](_0x4aa29e=>transformConditionSegmentRefs(_0x4aa29e,_0x4408a7,_0x4094a0,_0x56d564)));return{..._0x3c8084,'conditions':_0xf2d8d3};}export async function resolveRuleSegmentIds(_0x3f0b24,_0x43f206){const _0x21f47c=a142_0x3d3a62;return transformRuleSegmentRefs(_0x3f0b24,_0x43f206,_0x38f9cf=>!/^\d+$/[_0x21f47c(0x208)](_0x38f9cf));}function isCompositeType(_0x3b0ff7){const _0x3a9a14=a142_0x3d3a62;return _0x3b0ff7['type']===_0x3a9a14(0x251)||_0x3b0ff7[_0x3a9a14(0x22b)]==='Or';}function isBehaviorApiCondition(_0x2cc2ca){const _0x56fe63=a142_0x3d3a62;if(!_0x2cc2ca['leftValue']?.[_0x56fe63(0x210)]?.[_0x56fe63(0x285)])return![];return!![];}function apiConditionToYaml(_0x12f119){const _0x3ca3d5=a142_0x3d3a62;if(_0x12f119[_0x3ca3d5(0x22b)]===_0x3ca3d5(0x251)||_0x12f119[_0x3ca3d5(0x22b)]==='Or'){if(_0x12f119[_0x3ca3d5(0x26b)]){const _0x10b2bb=_0x12f119[_0x3ca3d5(0x26b)][_0x3ca3d5(0x288)](apiConditionToYaml),_0x5dfd2b=_0x12f119['description']!==undefined;if(_0x10b2bb[_0x3ca3d5(0x21f)]===0x1&&!_0x5dfd2b)return _0x10b2bb[0x0];return{'type':_0x12f119[_0x3ca3d5(0x22b)],'conditions':_0x10b2bb,..._0x12f119[_0x3ca3d5(0x274)]!==undefined&&{'description':_0x12f119[_0x3ca3d5(0x274)]}};}}if(_0x12f119[_0x3ca3d5(0x22b)]===_0x3ca3d5(0x238)&&_0x12f119[_0x3ca3d5(0x1f5)]&&_0x12f119[_0x3ca3d5(0x21b)]){const _0x44bc7d=_0x12f119['leftValue'][_0x3ca3d5(0x28e)]?buildAggregationDefFromApi(_0x12f119[_0x3ca3d5(0x1f5)][_0x3ca3d5(0x28e)]):undefined;if(isBehaviorApiCondition(_0x12f119)){const _0x23b38a=_0x12f119[_0x3ca3d5(0x1f5)][_0x3ca3d5(0x210)][_0x3ca3d5(0x285)];return{'type':_0x3ca3d5(0x227),'attribute':'','operator':apiOperatorToYaml(_0x12f119[_0x3ca3d5(0x21b)]),..._0x12f119[_0x3ca3d5(0x1ff)]&&_0x12f119[_0x3ca3d5(0x1ff)]!==_0x3ca3d5(0x25d)?{'arrayMatching':_0x12f119['arrayMatching']}:{},..._0x12f119['exclude']?{'exclude':_0x12f119[_0x3ca3d5(0x216)]}:{},..._0x44bc7d?{'aggregation':_0x44bc7d}:{},'source':_0x23b38a,..._0x12f119[_0x3ca3d5(0x1f5)][_0x3ca3d5(0x232)]?{'filter':apiRuleToYaml(_0x12f119[_0x3ca3d5(0x1f5)][_0x3ca3d5(0x232)])}:{},..._0x12f119[_0x3ca3d5(0x241)]!==undefined&&_0x12f119[_0x3ca3d5(0x241)]!==null?{'limit':_0x12f119[_0x3ca3d5(0x241)]}:{}};}return{'type':'Value','attribute':_0x12f119['leftValue'][_0x3ca3d5(0x285)]||'','operator':apiOperatorToYaml(_0x12f119[_0x3ca3d5(0x21b)]),..._0x12f119[_0x3ca3d5(0x1ff)]&&_0x12f119[_0x3ca3d5(0x1ff)]!=='any'?{'arrayMatching':_0x12f119[_0x3ca3d5(0x1ff)]}:{},..._0x12f119[_0x3ca3d5(0x216)]?{'exclude':_0x12f119['exclude']}:{},..._0x44bc7d?{'aggregation':_0x44bc7d}:{},..._0x12f119['leftValue']['filter']?{'filter':apiRuleToYaml(_0x12f119[_0x3ca3d5(0x1f5)][_0x3ca3d5(0x232)])}:{},..._0x12f119[_0x3ca3d5(0x241)]!==undefined&&_0x12f119[_0x3ca3d5(0x241)]!==null?{'limit':_0x12f119[_0x3ca3d5(0x241)]}:{}};}if(_0x12f119['type']===_0x3ca3d5(0x266)&&_0x12f119['column']&&_0x12f119['operator'])return{'type':'Column','column':_0x12f119[_0x3ca3d5(0x27f)],'operator':apiOperatorToYaml(_0x12f119[_0x3ca3d5(0x21b)])};if(_0x12f119['type']==='Reference'&&_0x12f119['id'])return{'type':_0x12f119['exclude']?'exclude':_0x3ca3d5(0x217),'segment':_0x12f119['id']};return{'type':_0x3ca3d5(0x251),'conditions':[]};}function isTemporalOperator(_0x38a6a9){const _0x233205=a142_0x3d3a62;return _0x38a6a9===_0x233205(0x26a)||_0x38a6a9==='TimeWithinNext';}function isBetweenOperator(_0x4b6972){return _0x4b6972==='Between';}function getEffectiveValue(_0x59a45a){const _0x254a8b=a142_0x3d3a62,_0x1cbe8c=_0x59a45a['values'];return _0x59a45a[_0x254a8b(0x1de)]??_0x1cbe8c;}function parseNumericValue(_0x30d151){const _0x17084c=a142_0x3d3a62;if(typeof _0x30d151==='object'&&_0x30d151!==null)return _0x30d151;if(_0x30d151==='')return _0x30d151;const _0x58e1b3=Number(_0x30d151);return Number[_0x17084c(0x283)](_0x58e1b3)?_0x58e1b3:_0x30d151;}function a142_0x31f3(){const _0x31cf98=['Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','run_after_journey_refresh','\x20\x20-\x20\x22','repeat_sub_frequency','6LouCOX','minutes_interval','540322vjqEcR','connectionNameToTypeMap','52500150RkTClb','batch','any','repeatUnit','email_recipients','activations:','parse','get','timeWindow','push','unit','Column','funnel_stage','\x22:\x0a','emailToIdMap','TimeWithinPast','conditions','schedule','getSchema','timezone','behavior','repeatSubFrequency','cron','string','code','description','emailRecipients','11ceQaUQ','Equal','isArray','First','8wXrxfW','197484warEcB','object','repeat_frequency','end_on','column','INVALID_ARGUMENT','10434636HFwsrM','attributes','isFinite','10820887NBVOAc','name','joinStrategy','groupingColumns','map','CONNECTOR_INVALID_CONFIG','activation_template_id','Warning:\x20activation\x20\x22','has','minValue','aggregation','warn','lockEnabled','\x27:\x20','valid','every','order_by','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','value','activationParams','connectionNameToIdMap','200268TmiISN','orderBy','rightValue','max','repeatFrequency','localRuleToName','shape','nestedWorkflowName','realtime','Unknown\x20email\x20recipient:\x20','all_columns','nested_workflow_project_name','kind','attribute_name','connector_config','month','3624600VMPYXd','connection','sort','Invalid\x20connector_config\x20for\x20activation\x20\x22','leftValue','nested_workflow_name','10oQJLPT','stringify','values','join_strategy','none','CONNECTION_NOT_FOUND','min','endOn','arrayMatching','localeCompare','toLowerCase','Count','weekly','lock_enabled','activations','JOURNEY_SYNTAX_ERROR','rule:','test','notify_on','maxValue','keys','flatMap','not','orderColumn','Segment\x20description','source','activationTemplateId','TimeRange','Last','allColumns','hourly','exclude','include','Connector:\x20','connectionId','ruleHashToName','operator','conditions[','runAfterJourneyRefresh','segment','length','behaviorTableName','notification','all','visible','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','entries','All','Behavior','nestedWorkflowProjectName','reverse','minute','type','null','usedNames','attribute','resolveSegmentName','repeat_unit','rule','filter','from','behavior_table','join_row','match','rightValues','Value','__UNRESOLVED__','daily','folder','Reference','formatting','day','hour','columns','limit','visibility','duration','add','scheduleType','set','connectorConfig','monthly','\x0a\x0aAvailable\x20fields:\x0a','joinRow','isVisible','start_at','syndicationBehavior','startAt','notifyOn','connector_config\x20for\x20activation\x20\x22','And','CountDistinct'];a142_0x31f3=function(){return _0x31cf98;};return a142_0x31f3();}function apiOperatorToYaml(_0x808b00){const _0x49c9b9=a142_0x3d3a62;if(isBetweenOperator(_0x808b00[_0x49c9b9(0x22b)]))return{'type':mapApiOperatorType(_0x808b00[_0x49c9b9(0x22b)]),..._0x808b00[_0x49c9b9(0x20d)]!==undefined&&{'not':_0x808b00['not']},..._0x808b00[_0x49c9b9(0x28d)]!==undefined&&{'min':parseNumericValue(_0x808b00['minValue'])},..._0x808b00['maxValue']!==undefined&&{'max':parseNumericValue(_0x808b00['maxValue'])}};if(_0x808b00[_0x49c9b9(0x22b)]===_0x49c9b9(0x212))return{'type':'TimeRange',..._0x808b00[_0x49c9b9(0x20d)]!==undefined&&{'not':_0x808b00['not']},..._0x808b00[_0x49c9b9(0x243)]!==undefined&&{'duration':_0x808b00[_0x49c9b9(0x243)]},..._0x808b00[_0x49c9b9(0x233)]!==undefined&&{'from':_0x808b00['from']},..._0x808b00['reverse']!==undefined&&{'reverse':_0x808b00['reverse']}};let _0x48d3c5;if(_0x808b00[_0x49c9b9(0x237)]&&_0x808b00[_0x49c9b9(0x237)]['length']>0x0)_0x48d3c5=_0x808b00['rightValues'];else{if(_0x808b00[_0x49c9b9(0x1e3)]!==undefined)_0x48d3c5=_0x808b00[_0x49c9b9(0x1e3)];else isTemporalOperator(_0x808b00[_0x49c9b9(0x22b)])&&_0x808b00[_0x49c9b9(0x1de)]!==undefined&&(_0x48d3c5=_0x808b00[_0x49c9b9(0x1de)]);}return{'type':mapApiOperatorType(_0x808b00['type']),..._0x808b00['not']!==undefined&&{'not':_0x808b00['not']},..._0x48d3c5!==undefined&&{'value':_0x48d3c5},..._0x808b00[_0x49c9b9(0x265)]!==undefined&&{'unit':_0x808b00[_0x49c9b9(0x265)]}};}function mapApiOperatorType(_0xbd3878){return _0xbd3878;}export function segmentDefToCreateRequest(_0x353883,_0x44cd74){const _0x87e4fb=a142_0x3d3a62,_0x36f0a2={'name':_0x353883[_0x87e4fb(0x285)]};return _0x353883[_0x87e4fb(0x274)]&&(_0x36f0a2[_0x87e4fb(0x274)]=_0x353883[_0x87e4fb(0x274)]),_0x353883['rule']&&(_0x36f0a2[_0x87e4fb(0x231)]=yamlRuleToApi(_0x353883[_0x87e4fb(0x231)])),_0x353883['kind']&&(_0x36f0a2['kind']=_0x353883[_0x87e4fb(0x1ed)]===_0x87e4fb(0x25c)?0x0:_0x353883[_0x87e4fb(0x1ed)]===_0x87e4fb(0x1e9)?0x1:0x2),_0x353883['visible']!==undefined&&(_0x36f0a2[_0x87e4fb(0x24b)]=_0x353883[_0x87e4fb(0x223)]),_0x44cd74&&(_0x36f0a2['segmentFolderId']=_0x44cd74),_0x36f0a2;}export function segmentDefToUpdateRequest(_0x50090e){const _0x5de377=a142_0x3d3a62,_0xf31d8f={'name':_0x50090e[_0x5de377(0x285)]};return _0x50090e[_0x5de377(0x274)]!==undefined&&(_0xf31d8f['description']=_0x50090e['description']),_0x50090e['rule']&&(_0xf31d8f['rule']=yamlRuleToApi(_0x50090e['rule'])),_0x50090e[_0x5de377(0x1ed)]&&(_0xf31d8f['kind']=_0x50090e[_0x5de377(0x1ed)]===_0x5de377(0x25c)?0x0:_0x50090e[_0x5de377(0x1ed)]==='realtime'?0x1:0x2),_0xf31d8f;}export function yamlRuleToApi(_0x405e4c){const _0x1bf9fc=a142_0x3d3a62,_0x34876a=_0x405e4c[_0x1bf9fc(0x26b)][_0x1bf9fc(0x288)](yamlConditionToApi),_0x390029=_0x34876a[_0x1bf9fc(0x293)](_0x47a1ff=>isCompositeType(_0x47a1ff)&&_0x47a1ff[_0x1bf9fc(0x274)]!==undefined);if(!_0x390029&&_0x34876a[_0x1bf9fc(0x21f)]>0x0){const _0x177cf4=[];for(const _0x215901 of _0x34876a){isCompositeType(_0x215901)&&_0x215901[_0x1bf9fc(0x274)]===undefined&&_0x215901[_0x1bf9fc(0x26b)]&&_0x215901[_0x1bf9fc(0x26b)][_0x1bf9fc(0x293)](_0xca2334=>!isCompositeType(_0xca2334))?_0x177cf4[_0x1bf9fc(0x264)]({'type':_0x215901[_0x1bf9fc(0x22b)],'description':'','conditions':_0x215901['conditions']}):_0x177cf4[_0x1bf9fc(0x264)]({'type':'And','description':_0x405e4c['description']||'','conditions':[_0x215901]});}return{'type':_0x405e4c[_0x1bf9fc(0x22b)],'conditions':_0x177cf4};}return{'type':_0x405e4c[_0x1bf9fc(0x22b)],'conditions':_0x34876a,..._0x405e4c[_0x1bf9fc(0x274)]&&{'description':_0x405e4c[_0x1bf9fc(0x274)]}};}function yamlFilterRuleToApi(_0x2e3ceb){const _0x325f9b=a142_0x3d3a62,_0x225362=_0x2e3ceb[_0x325f9b(0x26b)][_0x325f9b(0x288)](yamlConditionToApi);return{'type':_0x2e3ceb['type'],'conditions':_0x225362};}function yamlConditionToApi(_0x707283){const _0x3149de=a142_0x3d3a62;if('segment'in _0x707283&&(_0x707283[_0x3149de(0x22b)]===_0x3149de(0x217)||_0x707283['type']===_0x3149de(0x216))){const _0x5983d1=_0x707283;return{'type':_0x3149de(0x23c),'id':_0x5983d1['segment'],'exclude':_0x5983d1[_0x3149de(0x22b)]===_0x3149de(0x216)};}if(_0x707283[_0x3149de(0x22b)]===_0x3149de(0x251)||_0x707283[_0x3149de(0x22b)]==='Or'){const _0x2acda7=_0x707283;return{'type':_0x2acda7['type'],'conditions':_0x2acda7[_0x3149de(0x26b)][_0x3149de(0x288)](yamlConditionToApi),..._0x2acda7['description']&&{'description':_0x2acda7[_0x3149de(0x274)]}};}if(_0x3149de(0x27f)in _0x707283&&_0x707283[_0x3149de(0x22b)]===_0x3149de(0x266)){const _0x128a4d=_0x707283;return{'type':_0x3149de(0x266),'column':_0x128a4d[_0x3149de(0x27f)],'operator':yamlOperatorToApi(_0x128a4d[_0x3149de(0x21b)])};}const _0x4619ae=_0x707283,_0x3d65f9={'type':_0x3149de(0x238),'leftValue':buildLeftValue(_0x4619ae),'operator':yamlOperatorToApi(_0x4619ae[_0x3149de(0x21b)]),'exclude':_0x4619ae[_0x3149de(0x216)]??![],'arrayMatching':_0x4619ae[_0x3149de(0x1ff)]??_0x3149de(0x25d)};return _0x4619ae[_0x3149de(0x241)]!==undefined&&(_0x3d65f9['limit']=_0x4619ae[_0x3149de(0x241)]),_0x3d65f9;}function buildAggregationDefFromApi(_0x14a40e){const _0x2b8606=a142_0x3d3a62,_0x53ad16=_0x14a40e[_0x2b8606(0x22b)];if(_0x53ad16==='CountDistinct')return{'type':_0x53ad16,'columns':_0x14a40e[_0x2b8606(0x240)]??[]};if(_0x53ad16===_0x2b8606(0x279)||_0x53ad16===_0x2b8606(0x213))return{'type':_0x53ad16,'column':_0x14a40e[_0x2b8606(0x27f)]??'','orderColumn':_0x14a40e[_0x2b8606(0x20e)]??'',..._0x14a40e[_0x2b8606(0x287)]&&{'groupingColumns':_0x14a40e[_0x2b8606(0x287)]}};if(_0x53ad16===_0x2b8606(0x202))return{'type':_0x53ad16,..._0x14a40e[_0x2b8606(0x287)]&&{'groupingColumns':_0x14a40e[_0x2b8606(0x287)]}};return{'type':_0x53ad16,'column':_0x14a40e[_0x2b8606(0x27f)]??'',..._0x14a40e['groupingColumns']&&{'groupingColumns':_0x14a40e[_0x2b8606(0x287)]}};}function buildLeftValue(_0xd3e24c){const _0x2d3f65=a142_0x3d3a62,_0x31c1db={};_0xd3e24c['attribute']&&_0xd3e24c[_0x2d3f65(0x22b)]!==_0x2d3f65(0x227)&&(_0x31c1db[_0x2d3f65(0x285)]=_0xd3e24c['attribute']);if(_0xd3e24c[_0x2d3f65(0x28e)]){const _0x780650=_0xd3e24c[_0x2d3f65(0x28e)];if(_0x780650[_0x2d3f65(0x22b)]===_0x2d3f65(0x252))_0x31c1db[_0x2d3f65(0x28e)]={'type':_0x2d3f65(0x252),'columns':_0x780650[_0x2d3f65(0x240)]};else{if(_0x780650[_0x2d3f65(0x22b)]===_0x2d3f65(0x279)||_0x780650[_0x2d3f65(0x22b)]==='Last')_0x31c1db[_0x2d3f65(0x28e)]={'type':_0x780650[_0x2d3f65(0x22b)],'column':_0x780650[_0x2d3f65(0x27f)],'orderColumn':_0x780650[_0x2d3f65(0x20e)],..._0x780650[_0x2d3f65(0x287)]&&{'groupingColumns':_0x780650[_0x2d3f65(0x287)]}};else _0x780650[_0x2d3f65(0x22b)]===_0x2d3f65(0x202)?_0x31c1db[_0x2d3f65(0x28e)]={'type':_0x2d3f65(0x202),..._0x780650[_0x2d3f65(0x287)]&&{'groupingColumns':_0x780650[_0x2d3f65(0x287)]}}:_0x31c1db[_0x2d3f65(0x28e)]={'type':_0x780650[_0x2d3f65(0x22b)],'column':_0x780650[_0x2d3f65(0x27f)],..._0x780650[_0x2d3f65(0x287)]&&{'groupingColumns':_0x780650[_0x2d3f65(0x287)]}};}}return _0xd3e24c[_0x2d3f65(0x210)]&&(_0x31c1db['source']={'name':_0xd3e24c[_0x2d3f65(0x210)]}),_0xd3e24c[_0x2d3f65(0x232)]&&(_0x31c1db[_0x2d3f65(0x232)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0xd3e24c[_0x2d3f65(0x232)]))),_0x31c1db;}function yamlOperatorToApi(_0x18a8c6){const _0x2e90bf=a142_0x3d3a62,_0x10b1e2={'type':mapYamlOperatorType(_0x18a8c6[_0x2e90bf(0x22b)]),'not':_0x18a8c6[_0x2e90bf(0x20d)]??![]};if(isBetweenOperator(_0x18a8c6[_0x2e90bf(0x22b)]))return _0x18a8c6[_0x2e90bf(0x1fd)]!==undefined&&(_0x10b1e2['minValue']=typeof _0x18a8c6[_0x2e90bf(0x1fd)]===_0x2e90bf(0x27c)?_0x18a8c6['min']:String(_0x18a8c6[_0x2e90bf(0x1fd)])),_0x18a8c6['max']!==undefined&&(_0x10b1e2[_0x2e90bf(0x20a)]=typeof _0x18a8c6[_0x2e90bf(0x1e4)]===_0x2e90bf(0x27c)?_0x18a8c6['max']:String(_0x18a8c6[_0x2e90bf(0x1e4)])),_0x10b1e2;if(_0x18a8c6[_0x2e90bf(0x22b)]===_0x2e90bf(0x212))return _0x18a8c6['duration']&&(_0x10b1e2[_0x2e90bf(0x243)]=_0x18a8c6[_0x2e90bf(0x243)]),_0x18a8c6[_0x2e90bf(0x233)]&&(_0x10b1e2[_0x2e90bf(0x233)]=_0x18a8c6[_0x2e90bf(0x233)]),_0x18a8c6['reverse']!==undefined&&(_0x10b1e2[_0x2e90bf(0x229)]=_0x18a8c6[_0x2e90bf(0x229)]),_0x10b1e2;const _0x794aa2=getEffectiveValue(_0x18a8c6);if(_0x794aa2!==undefined){if(Array['isArray'](_0x794aa2))_0x10b1e2[_0x2e90bf(0x237)]=_0x794aa2;else isTemporalOperator(_0x18a8c6['type'])?_0x10b1e2[_0x2e90bf(0x1de)]=_0x794aa2:_0x10b1e2[_0x2e90bf(0x1e3)]=_0x794aa2;}return _0x18a8c6[_0x2e90bf(0x265)]&&(_0x10b1e2[_0x2e90bf(0x265)]=_0x18a8c6[_0x2e90bf(0x265)]),_0x10b1e2;}function mapYamlOperatorType(_0x11c7e7){return _0x11c7e7;}export function toYamlString(_0x5bc4c1){const _0x4e9b31=a142_0x3d3a62,_0x7ec49a=JSON[_0x4e9b31(0x261)](JSON[_0x4e9b31(0x1f8)](_0x5bc4c1)),_0x1e8e19=a142_0x580f9c[_0x4e9b31(0x1f8)](_0x7ec49a,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4e9b31(0x22c)}),_0x302f4f=['rule:'];let _0x4dbe61=_0x1e8e19;for(const _0x444b98 of _0x302f4f){_0x4dbe61=_0x4dbe61['replace'](new RegExp('^('+_0x444b98+')','m'),(_0x52dfb7,_0x5d506f,_0x11bfad)=>{if(_0x11bfad===0x0||_0x4dbe61[_0x11bfad-0x1]==='\x0a'&&_0x4dbe61[_0x11bfad-0x2]==='\x0a')return _0x5d506f;return'\x0a'+_0x5d506f;});}return _0x4dbe61;}export function parseYamlString(_0x30855f){return parseSegmentYamlFile(_0x30855f);}export function isSegmentYaml(_0xc45fdf){const _0x155a93=a142_0x3d3a62;if(typeof _0xc45fdf!=='object'||_0xc45fdf===null)return![];const _0x51a132=_0xc45fdf;return _0x51a132[_0x155a93(0x22b)]===_0x155a93(0x21e)||_0x51a132[_0x155a93(0x22b)]===undefined;}export function generateTemplate(_0x5a5f3b='New\x20Segment'){const _0x408663=a142_0x3d3a62,_0x36a5f3={'type':'segment','name':_0x5a5f3b,'description':_0x408663(0x20f),'rule':{'type':_0x408663(0x251),'conditions':[{'type':'Value','attribute':_0x408663(0x1ee),'operator':{'type':_0x408663(0x277),'value':_0x408663(0x1de)}}]}};return toYamlString(_0x36a5f3);}export function segmentToYamlString(_0x596af9){const _0xb846c0=a142_0x3d3a62,_0x420e60=JSON['parse'](JSON[_0xb846c0(0x1f8)](_0x596af9)),_0xdf51dd=a142_0x580f9c['stringify'](_0x420e60,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xb846c0(0x22c)}),_0x33067c=[_0xb846c0(0x207),_0xb846c0(0x260)];let _0x44cdab=_0xdf51dd;for(const _0x11214b of _0x33067c){_0x44cdab=_0x44cdab['replace'](new RegExp('^('+_0x11214b+')','m'),(_0xf1206,_0x5614be,_0x489ddd)=>{if(_0x489ddd===0x0||_0x44cdab[_0x489ddd-0x1]==='\x0a'&&_0x44cdab[_0x489ddd-0x2]==='\x0a')return _0x5614be;return'\x0a'+_0x5614be;});}return _0x44cdab;}export function parseSegmentYamlFile(_0x4ad007){return safeParseYaml(_0x4ad007,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x41cdd3){const _0x4e3b9b=a142_0x3d3a62;return{'type':_0x4e3b9b(0x21e),'name':_0x41cdd3[_0x4e3b9b(0x285)],..._0x41cdd3[_0x4e3b9b(0x274)]!==undefined&&{'description':_0x41cdd3[_0x4e3b9b(0x274)]},..._0x41cdd3[_0x4e3b9b(0x23b)]!==undefined&&{'folder':_0x41cdd3[_0x4e3b9b(0x23b)]},..._0x41cdd3[_0x4e3b9b(0x231)]&&{'rule':normalizeRule(_0x41cdd3['rule'])},..._0x41cdd3[_0x4e3b9b(0x1ed)]!==undefined&&{'kind':_0x41cdd3[_0x4e3b9b(0x1ed)]},..._0x41cdd3['visible']!==undefined&&{'visible':_0x41cdd3[_0x4e3b9b(0x223)]},..._0x41cdd3[_0x4e3b9b(0x205)]&&{'activations':_0x41cdd3[_0x4e3b9b(0x205)][_0x4e3b9b(0x288)](normalizeActivation)}};}export function normalizeRule(_0xb22880){const _0x317b7f=a142_0x3d3a62;return{'type':_0xb22880['type'],'conditions':_0xb22880[_0x317b7f(0x26b)][_0x317b7f(0x288)](normalizeCondition),..._0xb22880['description']!==undefined&&{'description':_0xb22880[_0x317b7f(0x274)]}};}function normalizeCondition(_0x539747){const _0x1641e1=a142_0x3d3a62;if('segment'in _0x539747&&(_0x539747[_0x1641e1(0x22b)]===_0x1641e1(0x217)||_0x539747[_0x1641e1(0x22b)]===_0x1641e1(0x216))){const _0x123a56=_0x539747;return{'type':_0x123a56[_0x1641e1(0x22b)],'segment':_0x123a56['segment']};}if(_0x539747['type']==='And'||_0x539747[_0x1641e1(0x22b)]==='Or'){const _0x41fcb6=_0x539747;return{'type':_0x41fcb6['type'],'conditions':_0x41fcb6['conditions']['map'](normalizeCondition),..._0x41fcb6[_0x1641e1(0x274)]!==undefined&&{'description':_0x41fcb6[_0x1641e1(0x274)]}};}if(_0x1641e1(0x27f)in _0x539747&&_0x539747[_0x1641e1(0x22b)]===_0x1641e1(0x266)){const _0x34f14c=_0x539747;return{'type':_0x1641e1(0x266),'column':_0x34f14c[_0x1641e1(0x27f)],'operator':normalizeOperator(_0x34f14c['operator'])};}if(_0x539747[_0x1641e1(0x22b)]===_0x1641e1(0x227)){const _0x4f0704=_0x539747;return{'type':_0x1641e1(0x227),'attribute':_0x4f0704[_0x1641e1(0x22e)],'operator':normalizeOperator(_0x4f0704['operator']),..._0x4f0704[_0x1641e1(0x1ff)]!==undefined&&{'arrayMatching':_0x4f0704[_0x1641e1(0x1ff)]},..._0x4f0704['exclude']!==undefined&&{'exclude':_0x4f0704['exclude']},..._0x4f0704['aggregation']!==undefined&&{'aggregation':_0x4f0704['aggregation']},..._0x4f0704[_0x1641e1(0x210)]!==undefined&&{'source':_0x4f0704[_0x1641e1(0x210)]},..._0x4f0704[_0x1641e1(0x232)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x4f0704[_0x1641e1(0x232)])))},..._0x4f0704[_0x1641e1(0x263)]!==undefined&&{'timeWindow':_0x4f0704[_0x1641e1(0x263)]},..._0x4f0704[_0x1641e1(0x241)]!==undefined&&{'limit':_0x4f0704[_0x1641e1(0x241)]}};}const _0x282835=_0x539747;return{'type':_0x1641e1(0x238),'attribute':_0x282835[_0x1641e1(0x22e)],'operator':normalizeOperator(_0x282835['operator']),..._0x282835[_0x1641e1(0x1ff)]!==undefined&&{'arrayMatching':_0x282835[_0x1641e1(0x1ff)]},..._0x282835[_0x1641e1(0x216)]!==undefined&&{'exclude':_0x282835['exclude']},..._0x282835[_0x1641e1(0x28e)]!==undefined&&{'aggregation':_0x282835[_0x1641e1(0x28e)]},..._0x282835['source']!==undefined&&{'source':_0x282835['source']},..._0x282835[_0x1641e1(0x232)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x282835[_0x1641e1(0x232)])))},..._0x282835[_0x1641e1(0x241)]!==undefined&&{'limit':_0x282835[_0x1641e1(0x241)]}};}function normalizeOperator(_0x3d5b41){const _0x80a4c8=a142_0x3d3a62;if(isBetweenOperator(_0x3d5b41[_0x80a4c8(0x22b)]))return{'type':_0x3d5b41[_0x80a4c8(0x22b)],..._0x3d5b41[_0x80a4c8(0x20d)]!==undefined&&{'not':_0x3d5b41[_0x80a4c8(0x20d)]},..._0x3d5b41['min']!==undefined&&{'min':_0x3d5b41['min']},..._0x3d5b41[_0x80a4c8(0x1e4)]!==undefined&&{'max':_0x3d5b41[_0x80a4c8(0x1e4)]}};const _0x44eb5a=getEffectiveValue(_0x3d5b41);return{'type':_0x3d5b41['type'],..._0x3d5b41[_0x80a4c8(0x20d)]!==undefined&&{'not':_0x3d5b41[_0x80a4c8(0x20d)]},..._0x44eb5a!==undefined&&{'value':_0x44eb5a},..._0x3d5b41[_0x80a4c8(0x265)]!==undefined&&{'unit':_0x3d5b41[_0x80a4c8(0x265)]},..._0x3d5b41[_0x80a4c8(0x243)]!==undefined&&{'duration':_0x3d5b41[_0x80a4c8(0x243)]},..._0x3d5b41['from']!==undefined&&{'from':_0x3d5b41[_0x80a4c8(0x233)]},..._0x3d5b41[_0x80a4c8(0x229)]!==undefined&&{'reverse':_0x3d5b41[_0x80a4c8(0x229)]}};}function normalizeActivation(_0x26f51f){const _0x4bf0b3=a142_0x3d3a62;return{'name':_0x26f51f[_0x4bf0b3(0x285)],'connection':_0x26f51f[_0x4bf0b3(0x1f2)],..._0x26f51f['description']!==undefined&&{'description':_0x26f51f[_0x4bf0b3(0x274)]},..._0x26f51f[_0x4bf0b3(0x1eb)]!==undefined&&{'all_columns':_0x26f51f['all_columns']},..._0x26f51f['columns']!==undefined&&{'columns':_0x26f51f[_0x4bf0b3(0x240)]},..._0x26f51f[_0x4bf0b3(0x26f)]!==undefined&&{'behavior':_0x26f51f[_0x4bf0b3(0x26f)]},..._0x26f51f[_0x4bf0b3(0x26c)]!==undefined&&{'schedule':_0x26f51f[_0x4bf0b3(0x26c)]},..._0x26f51f[_0x4bf0b3(0x221)]!==undefined&&{'notification':_0x26f51f[_0x4bf0b3(0x221)]},..._0x26f51f[_0x4bf0b3(0x1ef)]!==undefined&&{'connector_config':_0x26f51f['connector_config']},..._0x26f51f[_0x4bf0b3(0x28a)]!==undefined&&{'activation_template_id':_0x26f51f[_0x4bf0b3(0x28a)]},..._0x26f51f['nested_workflow_project_name']!==undefined&&{'nested_workflow_project_name':_0x26f51f[_0x4bf0b3(0x1ec)]},..._0x26f51f['nested_workflow_name']!==undefined&&{'nested_workflow_name':_0x26f51f[_0x4bf0b3(0x1f6)]},..._0x26f51f[_0x4bf0b3(0x204)]!==undefined&&{'lock_enabled':_0x26f51f[_0x4bf0b3(0x204)]}};}function getColumnName(_0x4ed056){const _0x2fe2bf=a142_0x3d3a62;return _0x4ed056[_0x2fe2bf(0x27f)]||_0x4ed056['name'];}export function activationResponseToDef(_0x37a19d,_0xa0d849,_0x1b2eb7){const _0x15d0a8=a142_0x3d3a62,_0x126038=_0x37a19d[_0x15d0a8(0x219)]||'',_0x2f614c=_0x1b2eb7?.[_0x15d0a8(0x262)](_0x126038)??_0x126038,_0x56a0d0={'name':_0x37a19d[_0x15d0a8(0x285)],'connection':_0x2f614c};_0x37a19d[_0x15d0a8(0x274)]&&(_0x56a0d0['description']=_0x37a19d['description']);let _0xcdee5b=[];_0x37a19d[_0x15d0a8(0x240)]&&_0x37a19d[_0x15d0a8(0x240)][_0x15d0a8(0x21f)]>0x0&&(_0xcdee5b=_0x37a19d[_0x15d0a8(0x240)][_0x15d0a8(0x232)](_0x518f7d=>_0x518f7d&&getColumnName(_0x518f7d))[_0x15d0a8(0x288)](_0x187c02=>{const _0x263a2c=_0x15d0a8,_0x109cae=getColumnName(_0x187c02);if(_0x187c02['type']||_0x187c02[_0x263a2c(0x242)])return{'name':_0x109cae,..._0x187c02[_0x263a2c(0x22b)]&&{'type':_0x187c02['type']},..._0x187c02['visibility']&&{'visibility':_0x187c02[_0x263a2c(0x242)]}};return _0x109cae;}));_0xcdee5b[_0x15d0a8(0x21f)]>0x0&&(_0x56a0d0[_0x15d0a8(0x240)]=_0xcdee5b);_0x37a19d[_0x15d0a8(0x214)]!==undefined&&(_0x37a19d[_0x15d0a8(0x214)]===![]&&_0xcdee5b['length']===0x0?_0x56a0d0['all_columns']=!![]:_0x56a0d0[_0x15d0a8(0x1eb)]=_0x37a19d[_0x15d0a8(0x214)]);const _0xb321d4={};let _0x2c0cd7=![];_0x37a19d['scheduleType']&&(_0xb321d4['type']=_0x37a19d['scheduleType'],_0x2c0cd7=!![]);_0x37a19d[_0x15d0a8(0x25e)]&&(_0xb321d4[_0x15d0a8(0x230)]=_0x37a19d[_0x15d0a8(0x25e)],_0x2c0cd7=!![]);_0x37a19d[_0x15d0a8(0x1e5)]!==undefined&&_0x37a19d['repeatFrequency']!==null&&(_0xb321d4['repeat_frequency']=_0x37a19d[_0x15d0a8(0x1e5)],_0x2c0cd7=!![]);_0x37a19d[_0x15d0a8(0x270)]&&_0x37a19d['repeatSubFrequency']['length']>0x0&&(_0xb321d4[_0x15d0a8(0x256)]=_0x37a19d[_0x15d0a8(0x270)],_0x2c0cd7=!![]);_0x37a19d[_0x15d0a8(0x24e)]!==undefined&&(_0xb321d4[_0x15d0a8(0x24c)]=_0x37a19d[_0x15d0a8(0x24e)],_0x2c0cd7=!![]);_0x37a19d[_0x15d0a8(0x1fe)]!==undefined&&(_0xb321d4['end_on']=_0x37a19d['endOn'],_0x2c0cd7=!![]);_0x37a19d['timezone']&&(_0xb321d4[_0x15d0a8(0x26e)]=_0x37a19d[_0x15d0a8(0x26e)],_0x2c0cd7=!![]);_0x2c0cd7&&(_0x56a0d0['schedule']=_0xb321d4);(_0x37a19d['notifyOn']&&_0x37a19d['notifyOn'][_0x15d0a8(0x21f)]>0x0||_0x37a19d[_0x15d0a8(0x275)]&&_0x37a19d['emailRecipients'][_0x15d0a8(0x21f)]>0x0)&&(_0x56a0d0['notification']={},_0x37a19d[_0x15d0a8(0x24f)]&&_0x37a19d['notifyOn'][_0x15d0a8(0x21f)]>0x0&&(_0x56a0d0[_0x15d0a8(0x221)][_0x15d0a8(0x209)]=_0x37a19d[_0x15d0a8(0x24f)]),_0x37a19d[_0x15d0a8(0x275)]&&_0x37a19d[_0x15d0a8(0x275)]['length']>0x0&&(_0x56a0d0[_0x15d0a8(0x221)][_0x15d0a8(0x25f)]=_0x37a19d[_0x15d0a8(0x275)][_0x15d0a8(0x288)](_0x22cacc=>{const _0xd50b79=_0x15d0a8,_0x50aeb0=_0xa0d849?.[_0xd50b79(0x262)](_0x22cacc);return _0x50aeb0??String(_0x22cacc);})));_0x37a19d[_0x15d0a8(0x247)]&&Object[_0x15d0a8(0x20b)](_0x37a19d[_0x15d0a8(0x247)])[_0x15d0a8(0x21f)]>0x0&&(_0x56a0d0[_0x15d0a8(0x1ef)]=normalizeConnectorConfigForYaml(_0x37a19d['connectorConfig']));_0x37a19d[_0x15d0a8(0x211)]&&(_0x56a0d0[_0x15d0a8(0x28a)]=_0x37a19d[_0x15d0a8(0x211)]);if(_0x37a19d[_0x15d0a8(0x24d)]){const _0x43b4cb={},_0x5e144a=_0x37a19d['syndicationBehavior'];_0x5e144a['columns']&&_0x5e144a[_0x15d0a8(0x240)][_0x15d0a8(0x21f)]>0x0&&(_0x43b4cb[_0x15d0a8(0x240)]=_0x5e144a[_0x15d0a8(0x240)][_0x15d0a8(0x232)](_0x534f99=>_0x534f99&&getColumnName(_0x534f99))[_0x15d0a8(0x288)](_0x2c74fe=>({'name':getColumnName(_0x2c74fe),..._0x2c74fe[_0x15d0a8(0x22b)]&&{'type':_0x2c74fe[_0x15d0a8(0x22b)]},..._0x2c74fe[_0x15d0a8(0x242)]&&{'visibility':_0x2c74fe[_0x15d0a8(0x242)]}}))),_0x5e144a[_0x15d0a8(0x220)]&&(_0x43b4cb[_0x15d0a8(0x234)]=_0x5e144a[_0x15d0a8(0x220)]),_0x5e144a[_0x15d0a8(0x24a)]!==undefined&&(_0x43b4cb[_0x15d0a8(0x235)]=_0x5e144a[_0x15d0a8(0x24a)]),_0x5e144a[_0x15d0a8(0x286)]&&(_0x43b4cb['join_strategy']=_0x5e144a['joinStrategy']),_0x5e144a['formatting']&&(_0x43b4cb[_0x15d0a8(0x23d)]=_0x5e144a[_0x15d0a8(0x23d)]),_0x5e144a[_0x15d0a8(0x1e2)]&&_0x5e144a[_0x15d0a8(0x1e2)][_0x15d0a8(0x21f)]>0x0&&(_0x43b4cb[_0x15d0a8(0x294)]=_0x5e144a[_0x15d0a8(0x1e2)]),Object[_0x15d0a8(0x20b)](_0x43b4cb)[_0x15d0a8(0x21f)]>0x0&&(_0x56a0d0[_0x15d0a8(0x26f)]=_0x43b4cb);}return _0x37a19d[_0x15d0a8(0x228)]&&(_0x56a0d0[_0x15d0a8(0x1ec)]=_0x37a19d['nestedWorkflowProjectName']),_0x37a19d[_0x15d0a8(0x1e8)]&&(_0x56a0d0['nested_workflow_name']=_0x37a19d['nestedWorkflowName']),_0x37a19d[_0x15d0a8(0x290)]!==undefined&&(_0x56a0d0[_0x15d0a8(0x204)]=_0x37a19d[_0x15d0a8(0x290)]),_0x56a0d0;}export function journeyActivationStepToYaml(_0x22926c,_0x298182,_0x2afc04){const _0x2bf599=a142_0x3d3a62,_0x2d394a=_0x22926c['attributes'][_0x2bf599(0x1df)],_0x4a86af=_0x2d394a['connectionId']||'',_0x34d5e8=_0x2afc04?.[_0x2bf599(0x262)](_0x4a86af)??_0x4a86af,_0xc0f57f={'name':_0x2d394a['name']||'','connection':_0x34d5e8};_0x22926c[_0x2bf599(0x282)][_0x2bf599(0x21d)]&&(_0xc0f57f[_0x2bf599(0x254)]=!![]);_0x2d394a[_0x2bf599(0x274)]&&(_0xc0f57f[_0x2bf599(0x274)]=_0x2d394a[_0x2bf599(0x274)]);let _0xb37e74=[];_0x2d394a[_0x2bf599(0x240)]&&_0x2d394a[_0x2bf599(0x240)]['length']>0x0&&(_0xb37e74=_0x2d394a[_0x2bf599(0x240)][_0x2bf599(0x232)](_0x55d35f=>_0x55d35f&&getColumnName(_0x55d35f))['map'](_0x91b48f=>{const _0x3fd244=_0x2bf599,_0xc0e8a8=getColumnName(_0x91b48f);if(_0x91b48f[_0x3fd244(0x22b)]||_0x91b48f[_0x3fd244(0x242)])return{'name':_0xc0e8a8,..._0x91b48f[_0x3fd244(0x22b)]&&{'type':_0x91b48f['type']},..._0x91b48f[_0x3fd244(0x242)]&&{'visibility':_0x91b48f[_0x3fd244(0x242)]}};return _0xc0e8a8;}));_0xb37e74['length']>0x0&&(_0xc0f57f[_0x2bf599(0x240)]=_0xb37e74);_0x2d394a[_0x2bf599(0x214)]!==undefined&&(_0x2d394a[_0x2bf599(0x214)]===![]&&_0xb37e74[_0x2bf599(0x21f)]===0x0?_0xc0f57f['all_columns']=!![]:_0xc0f57f['all_columns']=_0x2d394a[_0x2bf599(0x214)]);const _0x2d49ac={};let _0x2f8b81=![];_0x2d394a['scheduleType']&&(_0x2d49ac[_0x2bf599(0x22b)]=_0x2d394a['scheduleType'],_0x2f8b81=!![]);_0x2d394a[_0x2bf599(0x25e)]&&(_0x2d49ac[_0x2bf599(0x230)]=_0x2d394a[_0x2bf599(0x25e)],_0x2f8b81=!![]);_0x2d394a[_0x2bf599(0x1e5)]!==undefined&&_0x2d394a[_0x2bf599(0x1e5)]!==null&&(_0x2d49ac['repeat_frequency']=_0x2d394a[_0x2bf599(0x1e5)],_0x2f8b81=!![]);_0x2d394a[_0x2bf599(0x24e)]!==undefined&&(_0x2d49ac[_0x2bf599(0x24c)]=_0x2d394a[_0x2bf599(0x24e)],_0x2f8b81=!![]);_0x2d394a['endOn']!==undefined&&(_0x2d49ac['end_on']=_0x2d394a['endOn'],_0x2f8b81=!![]);_0x2d394a[_0x2bf599(0x26e)]&&(_0x2d49ac[_0x2bf599(0x26e)]=_0x2d394a[_0x2bf599(0x26e)],_0x2f8b81=!![]);_0x2f8b81&&(_0xc0f57f['schedule']=_0x2d49ac);(_0x2d394a['notifyOn']&&_0x2d394a[_0x2bf599(0x24f)]['length']>0x0||_0x2d394a[_0x2bf599(0x275)]&&_0x2d394a[_0x2bf599(0x275)][_0x2bf599(0x21f)]>0x0)&&(_0xc0f57f['notification']={},_0x2d394a[_0x2bf599(0x24f)]&&_0x2d394a[_0x2bf599(0x24f)][_0x2bf599(0x21f)]>0x0&&(_0xc0f57f['notification'][_0x2bf599(0x209)]=_0x2d394a[_0x2bf599(0x24f)]),_0x2d394a['emailRecipients']&&_0x2d394a[_0x2bf599(0x275)][_0x2bf599(0x21f)]>0x0&&(_0xc0f57f['notification'][_0x2bf599(0x25f)]=_0x2d394a[_0x2bf599(0x275)]['map'](_0xb8948d=>{const _0x14fffa=_0x2bf599,_0x20f2db=_0x298182?.[_0x14fffa(0x262)](_0xb8948d);return _0x20f2db??String(_0xb8948d);})));_0x2d394a[_0x2bf599(0x247)]&&Object['keys'](_0x2d394a[_0x2bf599(0x247)])[_0x2bf599(0x21f)]>0x0&&(_0xc0f57f[_0x2bf599(0x1ef)]=normalizeConnectorConfigForYaml(_0x2d394a[_0x2bf599(0x247)]));_0x2d394a[_0x2bf599(0x211)]&&(_0xc0f57f[_0x2bf599(0x28a)]=_0x2d394a[_0x2bf599(0x211)]);if(_0x2d394a[_0x2bf599(0x24d)]){const _0x57da20={},_0x1429c5=_0x2d394a['syndicationBehavior'];_0x1429c5[_0x2bf599(0x240)]&&_0x1429c5[_0x2bf599(0x240)][_0x2bf599(0x21f)]>0x0&&(_0x57da20[_0x2bf599(0x240)]=_0x1429c5['columns'][_0x2bf599(0x232)](_0x4ac60b=>_0x4ac60b&&getColumnName(_0x4ac60b))[_0x2bf599(0x288)](_0x3dbaba=>({'name':getColumnName(_0x3dbaba),..._0x3dbaba['type']&&{'type':_0x3dbaba[_0x2bf599(0x22b)]},..._0x3dbaba[_0x2bf599(0x242)]&&{'visibility':_0x3dbaba['visibility']}}))),_0x1429c5[_0x2bf599(0x220)]&&(_0x57da20['behavior_table']=_0x1429c5[_0x2bf599(0x220)]),_0x1429c5[_0x2bf599(0x24a)]!==undefined&&(_0x57da20['join_row']=_0x1429c5[_0x2bf599(0x24a)]),_0x1429c5[_0x2bf599(0x286)]&&(_0x57da20[_0x2bf599(0x1fa)]=_0x1429c5[_0x2bf599(0x286)]),_0x1429c5[_0x2bf599(0x23d)]&&(_0x57da20['formatting']=_0x1429c5[_0x2bf599(0x23d)]),_0x1429c5[_0x2bf599(0x1e2)]&&_0x1429c5[_0x2bf599(0x1e2)][_0x2bf599(0x21f)]>0x0&&(_0x57da20['order_by']=_0x1429c5[_0x2bf599(0x1e2)]),Object[_0x2bf599(0x20b)](_0x57da20)[_0x2bf599(0x21f)]>0x0&&(_0xc0f57f[_0x2bf599(0x26f)]=_0x57da20);}return _0xc0f57f;}export function segmentWithActivationsToYaml(_0x1d2d76,_0x11e215,_0x7fe801,_0x3d32f4,_0x54852c){const _0x3fbec8=a142_0x3d3a62,_0x15e850=segmentResponseToDefSync(_0x1d2d76,_0x7fe801);return _0x11e215['length']>0x0&&(_0x15e850[_0x3fbec8(0x205)]=_0x11e215['map'](_0x45b8ae=>activationResponseToDef(_0x45b8ae,_0x3d32f4,_0x54852c))),_0x15e850;}function normalizeColumn(_0x1042a2){const _0x3988fe=a142_0x3d3a62;if(typeof _0x1042a2===_0x3988fe(0x272))return{'column':_0x1042a2,'source':{'column':_0x1042a2}};return{'column':_0x1042a2[_0x3988fe(0x285)],'source':{'column':_0x1042a2[_0x3988fe(0x285)]},..._0x1042a2['type']&&{'type':_0x1042a2[_0x3988fe(0x22b)]},..._0x1042a2['visibility']&&{'visibility':_0x1042a2[_0x3988fe(0x242)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a142_0x3d3a62(0x20b)](ActivationDefSchema[a142_0x3d3a62(0x1e7)]));export function warnUnrecognizedActivationFields(_0x16842d,_0x23c0d2){const _0x53e180=a142_0x3d3a62,_0xd77f3b=Object[_0x53e180(0x20b)](_0x16842d)[_0x53e180(0x232)](_0xed1920=>!KNOWN_ACTIVATION_FIELDS[_0x53e180(0x28c)](_0xed1920));if(_0xd77f3b[_0x53e180(0x21f)]>0x0){const _0x2ad6e0=_0xd77f3b[_0x53e180(0x288)](_0x3d3f1e=>_0x53e180(0x255)+_0x3d3f1e+'\x22')['join']('\x0a');console['warn'](_0x53e180(0x28b)+_0x23c0d2+'\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a'+_0x2ad6e0);}}export async function activationDefToCreateRequest(_0xdd92cd,_0x26cebd){const _0x5bbf75=a142_0x3d3a62;warnUnrecognizedActivationFields(_0xdd92cd,_0xdd92cd[_0x5bbf75(0x285)]);const _0x881caa=_0x26cebd?.[_0x5bbf75(0x269)],_0x43777d=_0x26cebd?.[_0x5bbf75(0x1e0)],_0x53d75c=_0xdd92cd[_0x5bbf75(0x1f2)];let _0x281068;const _0x4d0519=parseInt(_0x53d75c,0xa);if(!isNaN(_0x4d0519)&&String(_0x4d0519)===_0x53d75c)_0x281068=_0x4d0519;else{const _0x4567f0=_0x43777d?.[_0x5bbf75(0x262)](_0x53d75c);if(_0x4567f0===undefined)throw new SDKError(ErrorCode[_0x5bbf75(0x1fc)],'Unknown\x20connection:\x20'+_0x53d75c,undefined,{'helpText':_0x5bbf75(0x253)});_0x281068=_0x4567f0;}const _0x5097c6={'name':_0xdd92cd[_0x5bbf75(0x285)],'connectionId':_0x281068};_0xdd92cd[_0x5bbf75(0x274)]&&(_0x5097c6[_0x5bbf75(0x274)]=_0xdd92cd[_0x5bbf75(0x274)]);let _0x588f82=[];_0xdd92cd[_0x5bbf75(0x240)]&&_0xdd92cd[_0x5bbf75(0x240)][_0x5bbf75(0x21f)]>0x0&&(_0x588f82=_0xdd92cd[_0x5bbf75(0x240)][_0x5bbf75(0x232)](_0x4a4358=>_0x4a4358!=null)[_0x5bbf75(0x288)](normalizeColumn));_0x588f82[_0x5bbf75(0x21f)]>0x0&&(_0x5097c6[_0x5bbf75(0x240)]=_0x588f82);_0xdd92cd['all_columns']!==undefined&&(_0xdd92cd[_0x5bbf75(0x1eb)]===![]&&_0x588f82[_0x5bbf75(0x21f)]===0x0?_0x5097c6[_0x5bbf75(0x214)]=!![]:_0x5097c6[_0x5bbf75(0x214)]=_0xdd92cd['all_columns']);if(_0xdd92cd['schedule']){const _0x57b378=_0xdd92cd['schedule'],_0x49f29c=_0x57b378[_0x5bbf75(0x22b)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x57b378[_0x5bbf75(0x230)]];_0x49f29c&&(_0x5097c6[_0x5bbf75(0x245)]=_0x49f29c);const _0x3bd7d9=_0x57b378['repeat_unit']??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x57b378[_0x5bbf75(0x22b)]];_0x3bd7d9&&(_0x5097c6[_0x5bbf75(0x25e)]=_0x3bd7d9);_0x57b378['repeat_frequency']!==undefined&&(_0x5097c6[_0x5bbf75(0x1e5)]=_0x57b378[_0x5bbf75(0x27d)]);_0x57b378[_0x5bbf75(0x256)]&&(_0x5097c6[_0x5bbf75(0x270)]=_0x57b378[_0x5bbf75(0x256)]);_0x57b378[_0x5bbf75(0x24c)]!==undefined&&(_0x5097c6[_0x5bbf75(0x24e)]=_0x57b378[_0x5bbf75(0x24c)]);_0x57b378[_0x5bbf75(0x27e)]!==undefined&&(_0x5097c6['endOn']=_0x57b378[_0x5bbf75(0x27e)]);_0x57b378[_0x5bbf75(0x26e)]&&(_0x5097c6[_0x5bbf75(0x26e)]=_0x57b378['timezone']);if(_0x49f29c&&_0x49f29c!==_0x5bbf75(0x1fb)&&_0x49f29c!==_0x5bbf75(0x271)&&_0x57b378[_0x5bbf75(0x24c)]){const _0x2f3a10=_0x57b378[_0x5bbf75(0x24c)][_0x5bbf75(0x236)](/T(\d{2}:\d{2})/);_0x2f3a10&&(_0x5097c6['scheduleOption']=_0x2f3a10[0x1]);}}_0xdd92cd[_0x5bbf75(0x221)]&&(_0xdd92cd['notification'][_0x5bbf75(0x209)]&&(_0x5097c6[_0x5bbf75(0x24f)]=_0xdd92cd['notification'][_0x5bbf75(0x209)]),_0xdd92cd[_0x5bbf75(0x221)][_0x5bbf75(0x25f)]&&(_0x5097c6[_0x5bbf75(0x275)]=_0xdd92cd[_0x5bbf75(0x221)]['email_recipients'][_0x5bbf75(0x288)](_0xab1d4e=>{const _0x3bd4ef=_0x5bbf75,_0x754019=Number(_0xab1d4e);if(!isNaN(_0x754019)&&String(_0x754019)===_0xab1d4e)return _0x754019;const _0x331c0d=_0x881caa?.[_0x3bd4ef(0x262)](_0xab1d4e[_0x3bd4ef(0x201)]());if(_0x331c0d===undefined)throw new SDKError(ErrorCode[_0x3bd4ef(0x280)],_0x3bd4ef(0x1ea)+_0xab1d4e+_0x3bd4ef(0x224));return _0x331c0d;})));if(_0xdd92cd['connector_config']){const _0x72e6a3=_0x26cebd?.[_0x5bbf75(0x25a)]?.[_0x5bbf75(0x262)](_0x53d75c);if(_0x72e6a3&&_0x26cebd?.[_0x5bbf75(0x26d)])try{const _0x945c84=await _0x26cebd[_0x5bbf75(0x26d)](_0x72e6a3),_0x2164d3=validateConnectorConfig(_0xdd92cd[_0x5bbf75(0x1ef)],_0x945c84);if(!_0x2164d3[_0x5bbf75(0x292)])throw new SDKError(ErrorCode[_0x5bbf75(0x289)],_0x5bbf75(0x1f4)+_0xdd92cd[_0x5bbf75(0x285)]+_0x5bbf75(0x268)+formatValidationErrors(_0x2164d3['errors']),undefined,{'helpText':_0x5bbf75(0x218)+_0x72e6a3+_0x5bbf75(0x249)+formatSchemaAsHelp(_0x945c84)});if(_0x2164d3['warnings'][_0x5bbf75(0x21f)]>0x0){const _0x45b6c2=formatValidationWarnings(_0x2164d3['warnings']);console[_0x5bbf75(0x28f)](_0x5bbf75(0x250)+_0xdd92cd[_0x5bbf75(0x285)]+_0x5bbf75(0x268)+_0x45b6c2);}_0x5097c6[_0x5bbf75(0x247)]=transformConfigToLegacy(_0xdd92cd[_0x5bbf75(0x1ef)],_0x945c84);}catch(_0x20327b){if(_0x20327b instanceof SDKError&&_0x20327b[_0x5bbf75(0x273)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x5097c6[_0x5bbf75(0x247)]=_0xdd92cd[_0x5bbf75(0x1ef)];else throw _0x20327b;}else _0x5097c6[_0x5bbf75(0x247)]=_0xdd92cd['connector_config'];}_0xdd92cd[_0x5bbf75(0x28a)]!==undefined&&(_0x5097c6['activationTemplateId']=_0xdd92cd[_0x5bbf75(0x28a)]);if(_0xdd92cd[_0x5bbf75(0x26f)]){const _0x374558=_0xdd92cd[_0x5bbf75(0x26f)],_0x267be4={};if(_0x374558[_0x5bbf75(0x240)]&&_0x374558[_0x5bbf75(0x240)]['length']>0x0){const _0x5dac73=_0x374558[_0x5bbf75(0x240)][_0x5bbf75(0x232)](_0x586717=>_0x586717&&_0x586717[_0x5bbf75(0x285)])[_0x5bbf75(0x288)](normalizeColumn);_0x5dac73[_0x5bbf75(0x21f)]>0x0&&(_0x267be4['columns']=_0x5dac73);}_0x374558[_0x5bbf75(0x234)]&&(_0x267be4[_0x5bbf75(0x220)]=_0x374558[_0x5bbf75(0x234)]);_0x374558['join_strategy']&&(_0x267be4['joinStrategy']=_0x374558[_0x5bbf75(0x1fa)]);if(_0x374558['join_row']!==undefined)_0x267be4[_0x5bbf75(0x24a)]=_0x374558['join_row'];else{if(_0x374558[_0x5bbf75(0x1fa)]===_0x5bbf75(0x213)||_0x374558[_0x5bbf75(0x1fa)]===_0x5bbf75(0x279))_0x267be4[_0x5bbf75(0x24a)]=0x1;else _0x374558[_0x5bbf75(0x1fa)]===_0x5bbf75(0x226)&&(_0x267be4[_0x5bbf75(0x24a)]=null);}_0x374558[_0x5bbf75(0x23d)]&&(_0x267be4[_0x5bbf75(0x23d)]=_0x374558[_0x5bbf75(0x23d)]),_0x374558[_0x5bbf75(0x294)]&&(_0x267be4['orderBy']=_0x374558[_0x5bbf75(0x294)]),_0x5097c6[_0x5bbf75(0x24d)]=_0x267be4;}return _0xdd92cd[_0x5bbf75(0x1ec)]&&(_0x5097c6[_0x5bbf75(0x228)]=_0xdd92cd['nested_workflow_project_name']),_0xdd92cd[_0x5bbf75(0x1f6)]&&(_0x5097c6[_0x5bbf75(0x1e8)]=_0xdd92cd[_0x5bbf75(0x1f6)]),_0xdd92cd['lock_enabled']!==undefined&&(_0x5097c6['lockEnabled']=_0xdd92cd[_0x5bbf75(0x204)]),_0x5097c6;}export async function activationDefToUpdateRequest(_0x335acc,_0xc5449c){return activationDefToCreateRequest(_0x335acc,_0xc5449c);}export function deepSortObject(_0x438970){const _0x598b4c=a142_0x3d3a62;if(_0x438970===null||typeof _0x438970!==_0x598b4c(0x27c))return _0x438970;if(Array['isArray'](_0x438970))return _0x438970['map'](deepSortObject)[_0x598b4c(0x1f3)]((_0x39cb0d,_0x873606)=>JSON[_0x598b4c(0x1f8)](_0x39cb0d)[_0x598b4c(0x200)](JSON[_0x598b4c(0x1f8)](_0x873606)));const _0x2c0d63={};for(const _0xa0faa7 of Object['keys'](_0x438970)[_0x598b4c(0x1f3)]()){_0x2c0d63[_0xa0faa7]=deepSortObject(_0x438970[_0xa0faa7]);}return _0x2c0d63;}export function serializeRule(_0x16c8c1){return JSON['stringify'](deepSortObject(_0x16c8c1));}export function normalizeRuleForMatching(_0x2c74b8){return normalizeConditionsForMatching(_0x2c74b8);}function normalizeConditionsForMatching(_0x36824d){const _0x523bbc=a142_0x3d3a62;if(_0x36824d===null||typeof _0x36824d!==_0x523bbc(0x27c))return _0x36824d;if(Array[_0x523bbc(0x278)](_0x36824d))return _0x36824d[_0x523bbc(0x288)](normalizeConditionsForMatching);const _0x57cee9=_0x36824d;if((_0x57cee9[_0x523bbc(0x22b)]===_0x523bbc(0x217)||_0x57cee9['type']===_0x523bbc(0x216))&&typeof _0x57cee9[_0x523bbc(0x21e)]===_0x523bbc(0x272))return{..._0x57cee9,'segment':'__SEGMENT_REF__'};const _0x39644b={};for(const _0x35b671 of Object[_0x523bbc(0x20b)](_0x57cee9)){_0x39644b[_0x35b671]=normalizeConditionsForMatching(_0x57cee9[_0x35b671]);}return _0x39644b;}export function serializeRuleForMatching(_0x2f9fab){const _0x15720f=a142_0x3d3a62;return JSON[_0x15720f(0x1f8)](deepSortObject(normalizeRuleForMatching(_0x2f9fab)));}export function expandSegmentReferences(_0x388254,_0x4402f4,_0x25284b=new Set()){return expandConditions(_0x388254,_0x4402f4,_0x25284b);}function expandConditions(_0x4f2223,_0x192efb,_0x5d1960){const _0x1a3cfd=a142_0x3d3a62;if(_0x4f2223===null||typeof _0x4f2223!==_0x1a3cfd(0x27c))return _0x4f2223;if(Array[_0x1a3cfd(0x278)](_0x4f2223))return _0x4f2223['map'](_0x563d46=>expandConditions(_0x563d46,_0x192efb,_0x5d1960));const _0x2f8e01=_0x4f2223;if((_0x2f8e01[_0x1a3cfd(0x22b)]===_0x1a3cfd(0x217)||_0x2f8e01[_0x1a3cfd(0x22b)]==='exclude')&&typeof _0x2f8e01['segment']===_0x1a3cfd(0x272)){const _0x4cd59b=_0x2f8e01['segment'],_0x120877=_0x192efb['get'](_0x4cd59b);if(_0x120877&&!_0x5d1960[_0x1a3cfd(0x28c)](_0x4cd59b)){const _0x447bd4=new Set(_0x5d1960);_0x447bd4[_0x1a3cfd(0x244)](_0x4cd59b);const _0x1b6759=expandConditions(_0x120877,_0x192efb,_0x447bd4);return{'type':_0x2f8e01['type'],'expanded_rule':_0x1b6759};}return{'type':_0x2f8e01[_0x1a3cfd(0x22b)],'expanded_rule':_0x1a3cfd(0x239)};}const _0x11dda2={};for(const _0x11b67f of Object[_0x1a3cfd(0x20b)](_0x2f8e01)){_0x11dda2[_0x11b67f]=expandConditions(_0x2f8e01[_0x11b67f],_0x192efb,_0x5d1960);}return _0x11dda2;}export function serializeExpandedRule(_0x3f43c9,_0x3fa1c3){const _0x22424d=a142_0x3d3a62,_0x504035=expandSegmentReferences(_0x3f43c9,_0x3fa1c3);return JSON[_0x22424d(0x1f8)](deepSortObject(_0x504035));}export function createSegmentNameContext(_0x1e9cad){const _0x73f0b1=a142_0x3d3a62,_0x4db7c5=new Set(),_0x585499=new Map(),_0x2c452a=new Map();if(_0x1e9cad)for(const [_0x194938,_0x129e68]of Object[_0x73f0b1(0x225)](_0x1e9cad)){if(_0x129e68[_0x73f0b1(0x231)]){const _0x32b485=serializeRule(_0x129e68['rule']);_0x2c452a[_0x73f0b1(0x246)](_0x32b485,_0x194938),_0x4db7c5[_0x73f0b1(0x244)](_0x194938);}}return{'usedNames':_0x4db7c5,'ruleHashToName':_0x585499,'localRuleToName':_0x1e9cad?_0x2c452a:undefined};}export function resolveSegmentName(_0x2a2299,_0x282d97,_0x2c5050,_0x293127){const _0x468db1=a142_0x3d3a62,_0x4cfd86=serializeRule(_0x282d97);if(_0x2c5050[_0x468db1(0x1e6)]){const _0x3f7a08=_0x2c5050['localRuleToName'][_0x468db1(0x262)](_0x4cfd86);if(_0x3f7a08)return{'name':_0x3f7a08,'isDuplicate':![],'isLocalMatch':!![]};}const _0x8dfbc6=_0x2c5050[_0x468db1(0x21a)][_0x468db1(0x262)](_0x4cfd86);if(_0x8dfbc6)return{'name':_0x8dfbc6,'isDuplicate':!![],'isLocalMatch':![]};const _0x2ef100=_0x293127(_0x2a2299);let _0x5558f8=_0x2ef100||_0x2a2299,_0x4529cd=_0x5558f8,_0x19c590=0x2;while(_0x2c5050[_0x468db1(0x22d)]['has'](_0x4529cd)){_0x4529cd=_0x5558f8+'_'+_0x19c590,_0x19c590++;}return _0x2c5050[_0x468db1(0x22d)]['add'](_0x4529cd),_0x2c5050[_0x468db1(0x21a)][_0x468db1(0x246)](_0x4cfd86,_0x4529cd),{'name':_0x4529cd,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x5b392f){const _0x52147d=[],_0x1282d3=_0x3ef3ba=>{const _0x47f7ed=a142_0x2823;if(!_0x3ef3ba||typeof _0x3ef3ba!=='object')return;if(Array[_0x47f7ed(0x278)](_0x3ef3ba)){_0x3ef3ba['forEach'](_0x1282d3);return;}const _0xb1f538=_0x3ef3ba;(_0xb1f538[_0x47f7ed(0x22b)]===_0x47f7ed(0x217)||_0xb1f538[_0x47f7ed(0x22b)]===_0x47f7ed(0x216))&&typeof _0xb1f538['segment']==='string'&&_0x52147d[_0x47f7ed(0x264)](_0xb1f538[_0x47f7ed(0x21e)]);for(const _0x13841a of Object[_0x47f7ed(0x1f9)](_0xb1f538)){_0x1282d3(_0x13841a);}};return _0x1282d3(_0x5b392f),_0x52147d;}export function validateSegmentRule(_0x58621d,_0x3ed381){const _0x19dec6=a142_0x3d3a62;if(!_0x3ed381||!_0x3ed381[_0x19dec6(0x26b)])return;for(let _0x408221=0x0;_0x408221<_0x3ed381[_0x19dec6(0x26b)]['length'];_0x408221++){const _0xbb209e=_0x3ed381[_0x19dec6(0x26b)][_0x408221];if(_0x19dec6(0x22b)in _0xbb209e&&_0xbb209e[_0x19dec6(0x22b)]===_0x19dec6(0x238)){const _0x431a4a=_0xbb209e,_0x25ece8=_0x431a4a[_0x19dec6(0x210)]||_0x431a4a[_0x19dec6(0x28e)];if((!_0x431a4a[_0x19dec6(0x22e)]||_0x431a4a['attribute']==='')&&!_0x25ece8)throw new SDKError(ErrorCode[_0x19dec6(0x206)],_0x19dec6(0x1dd)+_0x58621d+_0x19dec6(0x291)+(_0x19dec6(0x21c)+_0x408221+'].attribute\x20cannot\x20be\x20empty.\x0a')+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a143_0x3255(){const _0x4b6015=['28228LhbBUy','YES','columns','column_name','bold','push','Behaviors','map','some','Attributes','Schema\x20query:\x0a','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','displayName','matrixColumnName','execute','information_schema','3857259Nimxdk','localeCompare','6536224MOomqM','filter','column_type','default','key','slice','7468860UAUUVG','matrixTableName','parentTableName','behaviorName','entries','Fetching\x20schema...','behavior','38yCRnVl','parentColumn','attribute','set','cyan','query','tableName','\x20\x20\x20\x20','sort','get','startsWith','21100545BABshi','name','error','3832626BIHZrz','type','619503IAiShl','groupingName','20ONbfIZ','verbose','varchar','fields','SELECT\x20*\x20FROM\x20(\x0a','dim','size'];a143_0x3255=function(){return _0x4b6015;};return a143_0x3255();}(function(_0x403a21,_0x59fe75){const _0x4900f2=a143_0x760b,_0x381161=_0x403a21();while(!![]){try{const _0x1bdd86=parseInt(_0x4900f2(0xa2))/0x1*(-parseInt(_0x4900f2(0x89))/0x2)+-parseInt(_0x4900f2(0x99))/0x3*(-parseInt(_0x4900f2(0x9b))/0x4)+-parseInt(_0x4900f2(0xba))/0x5+-parseInt(_0x4900f2(0x97))/0x6+-parseInt(_0x4900f2(0xb2))/0x7+parseInt(_0x4900f2(0xb4))/0x8+parseInt(_0x4900f2(0x94))/0x9;if(_0x1bdd86===_0x59fe75)break;else _0x381161['push'](_0x381161['shift']());}catch(_0x17a16a){_0x381161['push'](_0x381161['shift']());}}}(a143_0x3255,0xedd2e));import a143_0x2087cc from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x479cde){const _0x2188ff=a143_0x760b,_0x4d75a2=_0x479cde[_0x2188ff(0xa4)][_0x2188ff(0xa9)](_0x2ec0b7=>({'column_name':_0x2ec0b7[_0x2188ff(0x95)],'column_type':_0x2ec0b7[_0x2188ff(0x98)],'null':_0x2188ff(0xa3),'key':null,'default':null,'extra':null}));return{..._0x479cde,'columns':[{'name':_0x2188ff(0xa5),'type':_0x2188ff(0x9d)},{'name':_0x2188ff(0xb6),'type':_0x2188ff(0x9d)},{'name':'null','type':_0x2188ff(0x9d)},{'name':_0x2188ff(0xb8),'type':_0x2188ff(0x9d)},{'name':_0x2188ff(0xb7),'type':_0x2188ff(0x9d)},{'name':'extra','type':_0x2188ff(0x9d)}],'data':_0x4d75a2};}function a143_0x760b(_0x5b6c27,_0x3ab047){_0x5b6c27=_0x5b6c27-0x86;const _0x32551f=a143_0x3255();let _0x760b24=_0x32551f[_0x5b6c27];return _0x760b24;}export async function executeSchemaQuery(_0x54c390,_0x53c3f0,_0x5490a8){const _0x14b592=a143_0x760b,_0x491c39=_0x54c390['trim']()['replace'](/;+$/,''),_0x312ee4=_0x14b592(0x9f)+_0x491c39+'\x0a)\x20AS\x20segment_query\x20LIMIT\x200';_0x5490a8['verbose']&&console[_0x14b592(0x96)](_0x14b592(0xac)+_0x312ee4);const _0x49054d=await withProgressSpinner(_0x14b592(0x87),async _0x4f5ba4=>{const _0x45e035=_0x14b592,_0x45ea6a=await _0x53c3f0[_0x45e035(0x8e)][_0x45e035(0xb0)](_0x312ee4,{'catalog':'td','schema':_0x45e035(0xb1),'onJobId':_0x42dab4=>{_0x4f5ba4['setJobId'](_0x42dab4);}});return _0x45ea6a;},{'verbose':_0x5490a8[_0x14b592(0x9c)]});return buildSchemaResult(_0x49054d['data']);}function columnName(_0x40607b){const _0x3bf557=a143_0x760b;return _0x40607b[_0x3bf557(0xaf)]||_0x40607b[_0x3bf557(0x8a)]||_0x40607b[_0x3bf557(0x95)];}function formatFieldLine(_0x51d544,_0x1c60d1,_0x5d581b){const _0x326821=a143_0x760b,_0x210987=_0x51d544!==_0x1c60d1?'\x20'+a143_0x2087cc[_0x326821(0xa0)]('('+_0x1c60d1+')'):'';return _0x326821(0x90)+_0x51d544+_0x210987+':\x20'+a143_0x2087cc[_0x326821(0x8d)](_0x5d581b);}function sortByColumnName(_0x5db474){const _0x9caae3=a143_0x760b;return[..._0x5db474]['sort']((_0x25af2c,_0x4455af)=>columnName(_0x25af2c)[_0x9caae3(0xb3)](columnName(_0x4455af)));}export function displayFieldsHumanReadable(_0x17f7a1,_0x36bf5f){const _0x32bec5=a143_0x760b,_0x9629b7=_0x17f7a1[_0x32bec5(0xb5)](_0x4f3b1e=>_0x4f3b1e['source']===_0x32bec5(0x8b)),_0x805bf5=_0x17f7a1[_0x32bec5(0xb5)](_0x29b16f=>_0x29b16f['source']===_0x32bec5(0x88)),_0x401615=new Map();for(const _0x136d55 of _0x9629b7){const _0x1e64ad=_0x136d55[_0x32bec5(0x9a)]||_0x136d55[_0x32bec5(0xbc)]||'Unknown',_0xe479e9=_0x401615[_0x32bec5(0x92)](_0x1e64ad);_0xe479e9?_0xe479e9[_0x32bec5(0x9e)][_0x32bec5(0xa7)](_0x136d55):_0x401615[_0x32bec5(0x8c)](_0x1e64ad,{'displayName':_0x1e64ad,'tableName':_0x136d55[_0x32bec5(0xbc)],'fields':[_0x136d55]});}const _0x5e1c6a=new Map();for(const _0x15f927 of _0x805bf5){const _0x5b3488=_0x15f927[_0x32bec5(0xbd)]||'Unknown',_0x40d04d=_0x5e1c6a['get'](_0x5b3488)||[];_0x40d04d[_0x32bec5(0xa7)](_0x15f927),_0x5e1c6a[_0x32bec5(0x8c)](_0x5b3488,_0x40d04d);}console[_0x32bec5(0x96)]('\x0a'+a143_0x2087cc[_0x32bec5(0xa6)](_0x36bf5f));if(_0x401615['size']>0x0){console[_0x32bec5(0x96)]('\x0a'+a143_0x2087cc[_0x32bec5(0xa0)](_0x32bec5(0xab)));const _0x5c156c=[..._0x401615[_0x32bec5(0x86)]()][_0x32bec5(0x91)]((_0x3b3617,_0x56a828)=>_0x3b3617[0x0]['localeCompare'](_0x56a828[0x0]));for(const [,_0x5a4931]of _0x5c156c){const _0x48a924=_0x5a4931[_0x32bec5(0x8f)]&&_0x5a4931[_0x32bec5(0x8f)]!==_0x5a4931['displayName']?'\x20'+a143_0x2087cc[_0x32bec5(0xa0)]('('+_0x5a4931['tableName']+')'):'';console[_0x32bec5(0x96)]('\x20\x20'+a143_0x2087cc['bold'](_0x5a4931[_0x32bec5(0xae)])+_0x48a924);for(const _0x5225cf of sortByColumnName(_0x5a4931['fields'])){console[_0x32bec5(0x96)](formatFieldLine(columnName(_0x5225cf),_0x5225cf['name'],_0x5225cf[_0x32bec5(0x98)]));}}}if(_0x5e1c6a[_0x32bec5(0xa1)]>0x0){console['error']('\x0a'+a143_0x2087cc[_0x32bec5(0xa0)](_0x32bec5(0xa8)));const _0x4de370=[..._0x5e1c6a[_0x32bec5(0x86)]()][_0x32bec5(0x91)]((_0x48095f,_0x33bb93)=>_0x48095f[0x0][_0x32bec5(0xb3)](_0x33bb93[0x0]));for(const [_0x3a5f7c,_0x1638c8]of _0x4de370){const _0xe186f4=_0x1638c8[0x0],_0x3c4b6b=_0xe186f4?.[_0x32bec5(0xbb)];if(_0x3c4b6b){const _0x1c07d6=_0x3c4b6b!==_0x3a5f7c?'\x20'+a143_0x2087cc[_0x32bec5(0xa0)]('('+_0x3a5f7c+')'):'';console['error']('\x20\x20'+a143_0x2087cc[_0x32bec5(0xa6)](_0x3c4b6b)+_0x1c07d6);}else{const _0x4ece45=_0xe186f4?.['parentTableName']||'';console[_0x32bec5(0x96)]('\x20\x20'+a143_0x2087cc[_0x32bec5(0xa6)](_0x3a5f7c)+(_0x4ece45?'\x20'+a143_0x2087cc['dim']('('+_0x4ece45+')'):''));}for(const _0x55c3ee of sortByColumnName(_0x1638c8)){const _0x321995=_0x55c3ee[_0x32bec5(0x95)][_0x32bec5(0x93)](_0x3a5f7c+'.')?_0x55c3ee[_0x32bec5(0x95)][_0x32bec5(0xb9)](_0x3a5f7c['length']+0x1):_0x55c3ee[_0x32bec5(0x95)];console[_0x32bec5(0x96)](formatFieldLine(columnName(_0x55c3ee),_0x321995,_0x55c3ee[_0x32bec5(0x98)]));}}}const _0x35cd61=_0x17f7a1[_0x32bec5(0xaa)](_0x2c10e6=>_0x2c10e6[_0x32bec5(0xaf)]||_0x2c10e6['matrixTableName']);_0x35cd61&&(console['error']('\x0a'+a143_0x2087cc[_0x32bec5(0xa0)](_0x32bec5(0xad))),console[_0x32bec5(0x96)](a143_0x2087cc[_0x32bec5(0xa0)]('\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.'))),console[_0x32bec5(0x96)]('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a144_0x5ea5(_0x25483d,_0x42cdab){_0x25483d=_0x25483d-0x82;const _0x1cf5ba=a144_0x1cf5();let _0x1cf506=_0x1cf5ba[_0x25483d];return _0x1cf506;}(function(_0x3cdaf3,_0x4e6c25){const _0x176d01=a144_0x5ea5,_0x9401ad=_0x3cdaf3();while(!![]){try{const _0x5e6a1b=parseInt(_0x176d01(0x91))/0x1*(parseInt(_0x176d01(0x96))/0x2)+parseInt(_0x176d01(0x92))/0x3*(-parseInt(_0x176d01(0x8c))/0x4)+parseInt(_0x176d01(0x8d))/0x5+parseInt(_0x176d01(0x8e))/0x6*(-parseInt(_0x176d01(0x84))/0x7)+-parseInt(_0x176d01(0x86))/0x8+-parseInt(_0x176d01(0x88))/0x9+parseInt(_0x176d01(0x89))/0xa*(parseInt(_0x176d01(0x94))/0xb);if(_0x5e6a1b===_0x4e6c25)break;else _0x9401ad['push'](_0x9401ad['shift']());}catch(_0x1dda06){_0x9401ad['push'](_0x9401ad['shift']());}}}(a144_0x1cf5,0x96b01));import{readdirSync,statSync}from'fs';import a144_0x202852 from'path';function a144_0x1cf5(){const _0x403688=['extname','497161brNFxs','toLowerCase','3959872DgzgZe','name','7351218Fdrzwb','380KeOGMq','isFile','relative','4zQONXC','336890EBxVWP','6nYYJGH','.yaml','endsWith','604673YJzcvl','2218587cqTaOL','join','598488TIQfoN','replace','2TVJpjr','map','.yml'];a144_0x1cf5=function(){return _0x403688;};return a144_0x1cf5();}export function findYamlFiles(_0x10c7c7){const _0x1c46cb=[];function _0xf737d6(_0x1af462){const _0x23bd36=a144_0x5ea5,_0x2d6a2a=readdirSync(_0x1af462,{'withFileTypes':!![]});for(const _0x5ba0a8 of _0x2d6a2a){const _0x4c2731=a144_0x202852[_0x23bd36(0x93)](_0x1af462,_0x5ba0a8[_0x23bd36(0x87)]);if(_0x5ba0a8['isDirectory']())_0xf737d6(_0x4c2731);else(_0x5ba0a8[_0x23bd36(0x87)][_0x23bd36(0x90)](_0x23bd36(0x82))||_0x5ba0a8[_0x23bd36(0x87)][_0x23bd36(0x90)](_0x23bd36(0x8f)))&&_0x1c46cb['push'](_0x4c2731);}}return _0xf737d6(_0x10c7c7),_0x1c46cb;}export function discoverYamlFiles(_0xc7704a){const _0x4f60e8=a144_0x5ea5,_0xe0361=findYamlFiles(_0xc7704a);return _0xe0361[_0x4f60e8(0x97)](_0x323a19=>{const _0x4f178e=_0x4f60e8,_0x16afcf=a144_0x202852[_0x4f178e(0x8b)](_0xc7704a,_0x323a19),_0x402eb4=a144_0x202852['dirname'](_0x16afcf);return{'absolutePath':_0x323a19,'relativePath':_0x16afcf,'folderPath':_0x402eb4==='.'?'':_0x402eb4[_0x4f178e(0x95)](/\\/g,'/')};});}export function isYamlFile(_0x1f7cae){const _0x3a356d=a144_0x5ea5;try{const _0x54d719=statSync(_0x1f7cae);if(!_0x54d719[_0x3a356d(0x8a)]())return![];const _0x1042b6=a144_0x202852[_0x3a356d(0x83)](_0x1f7cae)[_0x3a356d(0x85)]();return _0x1042b6===_0x3a356d(0x82)||_0x1042b6===_0x3a356d(0x8f);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x579c33,_0x5b5428){const _0x4860d0=a145_0x4b53,_0xe1d0a5=_0x579c33();while(!![]){try{const _0x5bbeec=-parseInt(_0x4860d0(0x15d))/0x1+-parseInt(_0x4860d0(0x18b))/0x2+parseInt(_0x4860d0(0x159))/0x3*(parseInt(_0x4860d0(0x153))/0x4)+parseInt(_0x4860d0(0x17d))/0x5*(parseInt(_0x4860d0(0x179))/0x6)+parseInt(_0x4860d0(0x154))/0x7*(parseInt(_0x4860d0(0x196))/0x8)+-parseInt(_0x4860d0(0x176))/0x9*(parseInt(_0x4860d0(0x14a))/0xa)+parseInt(_0x4860d0(0x178))/0xb*(parseInt(_0x4860d0(0x193))/0xc);if(_0x5bbeec===_0x5b5428)break;else _0xe1d0a5['push'](_0xe1d0a5['shift']());}catch(_0x5c237e){_0xe1d0a5['push'](_0xe1d0a5['shift']());}}}(a145_0x8cca,0x3b0be));function a145_0x4b53(_0x3a7ef7,_0x4d386d){_0x3a7ef7=_0x3a7ef7-0x143;const _0x8cca4c=a145_0x8cca();let _0x4b538d=_0x8cca4c[_0x3a7ef7];return _0x4b538d;}import{serializeRule,deepSortObject}from'./child-segment-yaml.js';function a145_0x8cca(){const _0x422140=['wait','segments','merged','stages','description','version_number','schedule','map','has','.yaml','some','join','push','exclude','milestone','draft','match','activations','length','1797732VzlXWp','name','224653IhmVRe','6cOJaBB','launched','steps','behavior','1177555UBIKce','values','include','version','yaml','string','rule','branches','nameMapping','goal','replace','type','bundle_id','find','837752bxautq','.yml','latest','all_columns','versions','null','startsWith','slice','276bOQnkw','toLowerCase','conditions','8ZvtfQS','journeys','connector_config','index','decision_point','journey','get','set','entries','exit_criteria','20hCqyym','condition','trim','columns','sort','activation','from','object','entry_criteria','4ITKkiD','1021461zmOdnz','state','attributes','segment','activation_template_id','1114977TpLRIr','notification','isArray','keys','162596vccKTI','bundle_name','reentry','item','endsWith','with'];a145_0x8cca=function(){return _0x422140;};return a145_0x8cca();}export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0xfc6339){const _0x1c54c1=a145_0x4b53;return _0xfc6339[_0x1c54c1(0x194)]()[_0x1c54c1(0x187)](/\s+/g,'_')[_0x1c54c1(0x187)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x1c54c1(0x187)](/_+/g,'_')[_0x1c54c1(0x187)](/^_|_$/g,'');}export function generateJourneyLocalName(_0xdc2b84){const _0x4bedb6=a145_0x4b53,_0x4266a1=_0xdc2b84[_0x4bedb6(0x173)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x4266a1){const _0x29cd30=_0x4266a1[0x1][_0x4bedb6(0x194)](),_0x4f1eb6=_0x4266a1[0x2],_0x549810=_0x4f1eb6[_0x4bedb6(0x187)](/-/g,'')['slice'](0x0,0x4)[_0x4bedb6(0x194)]();return _0x29cd30+'_'+_0x549810;}const _0x46ae2b=_0xdc2b84[_0x4bedb6(0x173)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x46ae2b){const _0x5cc5d4=_0x46ae2b[0x1],_0x16bb3e=_0x46ae2b[0x2][_0x4bedb6(0x194)](),_0x54d000=_0x5cc5d4[_0x4bedb6(0x187)](/-/g,'')[_0x4bedb6(0x192)](0x0,0x4)[_0x4bedb6(0x194)]();return _0x16bb3e+'_'+_0x54d000;}return undefined;}function stableStringify(_0x3b0571){const _0x1a6dd3=a145_0x4b53;if(Array[_0x1a6dd3(0x15b)](_0x3b0571))return'['+_0x3b0571['map'](_0x272fe1=>stableStringify(_0x272fe1))[_0x1a6dd3(0x16e)](',')+']';if(_0x3b0571&&typeof _0x3b0571===_0x1a6dd3(0x151)){const _0x820a2d=_0x3b0571,_0x14d46f=Object[_0x1a6dd3(0x15c)](_0x820a2d)['sort'](),_0x434e41=_0x14d46f[_0x1a6dd3(0x16a)](_0x1c4b18=>'\x22'+_0x1c4b18+'\x22:'+stableStringify(_0x820a2d[_0x1c4b18]));return'{'+_0x434e41['join'](',')+'}';}const _0x45385d=JSON['stringify'](_0x3b0571);return _0x45385d===undefined?_0x1a6dd3(0x190):_0x45385d;}export function consolidateActivationsByContent(_0x26bcf5){const _0x5d4df7=a145_0x4b53,_0x5427b2={},_0x32d9eb=new Map(),_0x50693f=new Map();for(const _0x338964 of _0x26bcf5){if(!_0x338964)continue;for(const [_0x4aa811,_0x59570d]of Object[_0x5d4df7(0x148)](_0x338964)){const _0x124298={'name':_0x59570d['name'],'connection':_0x59570d['connection'],..._0x59570d[_0x5d4df7(0x18e)]!==undefined&&{'all_columns':_0x59570d['all_columns']},..._0x59570d[_0x5d4df7(0x14d)]!==undefined&&{'columns':_0x59570d[_0x5d4df7(0x14d)]},..._0x59570d[_0x5d4df7(0x17c)]!==undefined&&{'behavior':_0x59570d[_0x5d4df7(0x17c)]},..._0x59570d['schedule']!==undefined&&{'schedule':_0x59570d[_0x5d4df7(0x169)]},..._0x59570d[_0x5d4df7(0x15a)]!==undefined&&{'notification':_0x59570d[_0x5d4df7(0x15a)]},..._0x59570d['connector_config']!==undefined&&{'connector_config':_0x59570d[_0x5d4df7(0x198)]},..._0x59570d['activation_template_id']!==undefined&&{'activation_template_id':_0x59570d[_0x5d4df7(0x158)]}},_0x176631=stableStringify(_0x124298),_0x1caee7=_0x50693f[_0x5d4df7(0x146)](_0x176631);_0x1caee7?_0x32d9eb['set'](_0x4aa811,_0x1caee7):(_0x5427b2[_0x4aa811]=_0x59570d,_0x32d9eb[_0x5d4df7(0x147)](_0x4aa811,_0x4aa811),_0x50693f[_0x5d4df7(0x147)](_0x176631,_0x4aa811));}}return{'merged':_0x5427b2,'nameMapping':_0x32d9eb};}export function updateActivationReferences(_0x18e957,_0x4fc144){const _0x24ca50=a145_0x4b53;if(!_0x18e957)return;for(const _0x573160 of _0x18e957){if(!_0x573160[_0x24ca50(0x17b)])continue;for(const _0x36489d of _0x573160[_0x24ca50(0x17b)]){if(_0x36489d[_0x24ca50(0x188)]===_0x24ca50(0x14f)&&_0x36489d['with']?.['activation']){const _0x267965=_0x4fc144['get'](_0x36489d[_0x24ca50(0x162)]['activation']);_0x267965&&_0x267965!==_0x36489d[_0x24ca50(0x162)][_0x24ca50(0x14f)]&&(_0x36489d[_0x24ca50(0x162)]['activation']=_0x267965);}}}}export function consolidateSegmentsByContent(_0x543d1b,_0x543d95){const _0x560069=a145_0x4b53,_0x75e80f={},_0x4de82f=new Map(),_0x552f45=new Map();for(const _0x5e13d3 of _0x543d1b){if(!_0x5e13d3)continue;for(const [_0x32a596,_0xfdf93]of Object[_0x560069(0x148)](_0x5e13d3)){if(!_0xfdf93[_0x560069(0x183)]){_0x75e80f[_0x32a596]=_0xfdf93,_0x4de82f[_0x560069(0x147)](_0x32a596,_0x32a596);continue;}const _0x1d7b52=_0xfdf93[_0x560069(0x167)]&&_0xfdf93[_0x560069(0x167)][_0x560069(0x14c)]()?_0xfdf93[_0x560069(0x167)]:undefined,_0x5efdc6=JSON['stringify']({'description':_0x1d7b52,'rule':deepSortObject(_0xfdf93[_0x560069(0x183)])}),_0x4c8781=_0x552f45['get'](_0x5efdc6);if(_0x4c8781){const _0x50132c={..._0xfdf93[_0x560069(0x167)]!==undefined&&{'description':_0xfdf93['description']},'rule':_0xfdf93['rule']?deepSortObject(_0xfdf93[_0x560069(0x183)]):_0xfdf93[_0x560069(0x183)]};if(_0x32a596<_0x4c8781){_0x75e80f[_0x32a596]=_0x50132c,delete _0x75e80f[_0x4c8781];for(const [_0x264b30,_0x4b968c]of _0x4de82f['entries']()){_0x4b968c===_0x4c8781&&_0x4de82f['set'](_0x264b30,_0x32a596);}_0x4de82f['set'](_0x32a596,_0x32a596),_0x552f45[_0x560069(0x147)](_0x5efdc6,_0x32a596);}else _0x75e80f[_0x4c8781]=_0x50132c,_0x4de82f['set'](_0x32a596,_0x4c8781);}else{let _0x2e3bf9=_0x32a596;if(_0x543d95){const _0x36ce52=_0x543d95[_0x560069(0x146)](_0x5efdc6);_0x36ce52&&_0x36ce52[_0x560069(0x175)]>0x0&&(_0x2e3bf9=_0x36ce52[_0x560069(0x192)]()[_0x560069(0x14e)]()[0x0]);}const _0x33d1ef={..._0xfdf93[_0x560069(0x167)]!==undefined&&{'description':_0xfdf93[_0x560069(0x167)]},'rule':_0xfdf93['rule']?deepSortObject(_0xfdf93[_0x560069(0x183)]):_0xfdf93[_0x560069(0x183)]};_0x75e80f[_0x2e3bf9]=_0x33d1ef,_0x4de82f[_0x560069(0x147)](_0x32a596,_0x2e3bf9),_0x552f45[_0x560069(0x147)](_0x5efdc6,_0x2e3bf9);}}}return{'merged':_0x75e80f,'nameMapping':_0x4de82f};}export function updateSegmentReferences(_0x26e452,_0x2fbc73){const _0x134187=a145_0x4b53;if(!_0x26e452)return;for(const _0x9486f5 of _0x26e452){if(_0x9486f5['entry_criteria']?.[_0x134187(0x157)]){const _0x5ca1c7=_0x2fbc73[_0x134187(0x146)](_0x9486f5[_0x134187(0x152)]['segment']);_0x5ca1c7&&(_0x9486f5[_0x134187(0x152)][_0x134187(0x157)]=_0x5ca1c7);}if(_0x9486f5[_0x134187(0x149)])for(const _0x3584ed of _0x9486f5[_0x134187(0x149)]){if(_0x3584ed[_0x134187(0x157)]){const _0x3b0dc8=_0x2fbc73[_0x134187(0x146)](_0x3584ed[_0x134187(0x157)]);_0x3b0dc8&&(_0x3584ed[_0x134187(0x157)]=_0x3b0dc8);}}if(_0x9486f5[_0x134187(0x171)]?.[_0x134187(0x157)]){const _0x121f3b=_0x2fbc73[_0x134187(0x146)](_0x9486f5[_0x134187(0x171)][_0x134187(0x157)]);_0x121f3b&&(_0x9486f5[_0x134187(0x171)]['segment']=_0x121f3b);}if(_0x9486f5[_0x134187(0x17b)])for(const _0x25a0a0 of _0x9486f5[_0x134187(0x17b)]){if(_0x25a0a0[_0x134187(0x188)]===_0x134187(0x144)&&_0x25a0a0['with']?.[_0x134187(0x184)])for(const _0x10735c of _0x25a0a0[_0x134187(0x162)][_0x134187(0x184)]){if(_0x10735c['segment']){const _0x58bd9f=_0x2fbc73[_0x134187(0x146)](_0x10735c[_0x134187(0x157)]);_0x58bd9f&&(_0x10735c['segment']=_0x58bd9f);}}if(_0x25a0a0['type']===_0x134187(0x163)&&_0x25a0a0['with']?.[_0x134187(0x14b)]?.[_0x134187(0x157)]){const _0x123e65=_0x2fbc73['get'](_0x25a0a0[_0x134187(0x162)][_0x134187(0x14b)][_0x134187(0x157)]);_0x123e65&&(_0x25a0a0['with'][_0x134187(0x14b)][_0x134187(0x157)]=_0x123e65);}}}}export function updateSegmentRefsInSegments(_0x248d43,_0x1e243b){const _0x54274b=a145_0x4b53;for(const _0xa6abd0 of Object[_0x54274b(0x17e)](_0x248d43)){_0xa6abd0[_0x54274b(0x183)]&&updateSegmentRefsInRule(_0xa6abd0['rule'],_0x1e243b);}}function updateSegmentRefsInRule(_0x51ed7a,_0x1ff24e){const _0x59e602=a145_0x4b53;if(_0x51ed7a===null||typeof _0x51ed7a!==_0x59e602(0x151))return;if(Array[_0x59e602(0x15b)](_0x51ed7a)){for(const _0x1dd304 of _0x51ed7a){updateSegmentRefsInRule(_0x1dd304,_0x1ff24e);}return;}const _0x5c0022=_0x51ed7a;if((_0x5c0022[_0x59e602(0x188)]===_0x59e602(0x17f)||_0x5c0022['type']===_0x59e602(0x170))&&typeof _0x5c0022['segment']===_0x59e602(0x182)){const _0x132a00=_0x1ff24e[_0x59e602(0x146)](_0x5c0022['segment']);_0x132a00&&(_0x5c0022[_0x59e602(0x157)]=_0x132a00);}if(_0x5c0022[_0x59e602(0x195)]&&Array['isArray'](_0x5c0022[_0x59e602(0x195)]))for(const _0xc32175 of _0x5c0022[_0x59e602(0x195)]){updateSegmentRefsInRule(_0xc32175,_0x1ff24e);}}export function buildJourneysArray(_0x48fe2a,_0x4c4f4c){const _0x534bc3=a145_0x4b53;return _0x48fe2a[_0x534bc3(0x16a)](_0xf65fc6=>{const _0x328069=_0x534bc3,_0x4d86d1=_0x4c4f4c?_0xf65fc6[_0x328069(0x160)]['id']===_0x4c4f4c:_0x48fe2a['length']===0x1,_0x157591=_0xf65fc6[_0x328069(0x181)][_0x328069(0x197)]?.[0x0],_0x52d7db=_0x157591?.[_0x328069(0x186)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x186)],_0x1f1fe2={'version':_0x157591?.[_0x328069(0x180)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x180)]||_0xf65fc6[_0x328069(0x160)]['name'],'state':_0xf65fc6['item'][_0x328069(0x155)]===_0x328069(0x17a)?_0x328069(0x17a):_0x328069(0x172),'stages':_0x157591?.[_0x328069(0x166)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x166)]||[],'id':_0x157591?.['id']||_0xf65fc6[_0x328069(0x181)]['id'],'version_number':_0x157591?.[_0x328069(0x168)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x168)]};return _0x52d7db&&(_0x1f1fe2[_0x328069(0x186)]=_0x52d7db),_0x4d86d1&&(_0x1f1fe2[_0x328069(0x18d)]=!![]),_0x1f1fe2;});}export function buildMergedJourneyDef(_0xdb52d2,_0xb02824,_0x49ea6d){const _0x19de85=a145_0x4b53,_0x4a3402=_0xdb52d2[0x0]['yaml'],_0x50dc9f=buildJourneysArray(_0xdb52d2,_0x49ea6d),{merged:_0x21c56a,nameMapping:_0x234531}=consolidateSegmentsByContent(_0xdb52d2[_0x19de85(0x16a)](_0x348533=>_0x348533[_0x19de85(0x181)]['segments']),_0xb02824);updateSegmentRefsInSegments(_0x21c56a,_0x234531);const _0x5d4cf7=Array[_0x19de85(0x150)](_0x234531[_0x19de85(0x148)]())[_0x19de85(0x16d)](([_0x3899e3,_0x54df7c])=>_0x3899e3!==_0x54df7c&&_0x3899e3[_0x19de85(0x191)](_0x19de85(0x152)));let _0x66acd9=_0x21c56a,_0x484b1e=new Map();if(_0x5d4cf7){const _0x2ec269=consolidateSegmentsByContent([_0x21c56a],_0xb02824);_0x66acd9=_0x2ec269[_0x19de85(0x165)],_0x484b1e=_0x2ec269[_0x19de85(0x185)];}const _0xc40306=new Map(_0x234531);for(const [_0x11727f,_0x2e92f9]of _0x484b1e[_0x19de85(0x148)]()){_0xc40306[_0x19de85(0x147)](_0x11727f,_0x2e92f9);}for(const [_0x5432b2,_0x11d981]of _0xc40306[_0x19de85(0x148)]()){let _0x12e5e7=_0x11d981,_0x4f3fd1=0x0;while(_0xc40306[_0x19de85(0x16b)](_0x12e5e7)&&_0xc40306[_0x19de85(0x146)](_0x12e5e7)!==_0x12e5e7&&_0x4f3fd1<MAX_MAPPING_CHAIN_DEPTH){_0x12e5e7=_0xc40306[_0x19de85(0x146)](_0x12e5e7),_0x4f3fd1++;}_0x12e5e7!==_0x11d981&&_0xc40306[_0x19de85(0x147)](_0x5432b2,_0x12e5e7);}for(const _0x5127bb of _0x50dc9f){updateSegmentReferences(_0x5127bb[_0x19de85(0x166)],_0xc40306);}const {merged:_0x1234fb,nameMapping:_0x21de16}=consolidateActivationsByContent(_0xdb52d2['map'](_0x591e6c=>_0x591e6c[_0x19de85(0x181)][_0x19de85(0x174)]));for(const _0x49788d of _0x50dc9f){updateActivationReferences(_0x49788d[_0x19de85(0x166)],_0x21de16);}let _0x5e5628=_0x4a3402[_0x19de85(0x186)];if(_0x5e5628?.[_0x19de85(0x157)]){const _0x21aabf=_0xc40306['get'](_0x5e5628[_0x19de85(0x157)]);_0x21aabf&&(_0x5e5628={..._0x5e5628,'segment':_0x21aabf});}for(const _0x40820a of _0x50dc9f){if(_0x40820a['goal']?.['segment']){const _0x432707=_0xc40306[_0x19de85(0x146)](_0x40820a[_0x19de85(0x186)][_0x19de85(0x157)]);_0x432707&&(_0x40820a[_0x19de85(0x186)]={..._0x40820a[_0x19de85(0x186)],'segment':_0x432707});}}return _0x50dc9f['some'](_0x1055e2=>_0x1055e2['goal'])&&(_0x5e5628=undefined),{'type':_0x19de85(0x145),'name':_0x4a3402[_0x19de85(0x177)],'description':_0x4a3402[_0x19de85(0x167)],'goal':_0x5e5628,'reentry':_0x4a3402[_0x19de85(0x15f)],'segments':Object[_0x19de85(0x15c)](_0x66acd9)[_0x19de85(0x175)]>0x0?_0x66acd9:undefined,'activations':Object[_0x19de85(0x15c)](_0x1234fb)[_0x19de85(0x175)]>0x0?_0x1234fb:undefined,'journeys':_0x50dc9f,'bundle_id':_0x4a3402[_0x19de85(0x189)],'bundle_name':_0x4a3402[_0x19de85(0x15e)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x38c47a,_0xde26ce,_0x34d395,_0x54ba17){const _0x533b36=a145_0x4b53,_0x59500b=_0x38c47a+':'+_0xde26ce,_0xc8e139=_0x34d395['get'](_0x59500b);if(_0xc8e139)return _0xc8e139;const _0x34ab57=await _0x54ba17(_0x38c47a),_0x580eb5=_0x34ab57['attributes']['journeyBundleName']||_0x34ab57[_0x533b36(0x156)][_0x533b36(0x177)],_0x1bbe45=_0x34ab57[_0x533b36(0x156)]['journeyStages'][_0x533b36(0x18a)](_0x7daa6a=>String(_0x7daa6a['id'])===String(_0xde26ce)),_0x2eda6d=_0x1bbe45?.[_0x533b36(0x177)]||_0xde26ce,_0x3ed097={'journeyName':_0x580eb5,'stageName':_0x2eda6d};return _0x34d395[_0x533b36(0x147)](_0x59500b,_0x3ed097),_0x3ed097;}export function formatApiJourneyName(_0x4c08bd,_0x334894){return _0x334894+'\x20('+_0x4c08bd+')';}export function isLocalJourneyRef(_0x26cbac){const _0x3355d7=a145_0x4b53;return _0x26cbac[_0x3355d7(0x161)](_0x3355d7(0x18c))||_0x26cbac['endsWith'](_0x3355d7(0x16c));}export function buildLocalRuleToNameMapping(_0x4570b4){const _0x2b1bc9=a145_0x4b53,_0xd035b9=new Map();if(!_0x4570b4)return _0xd035b9;for(const [_0x1051ee,_0x22dda4]of Object['entries'](_0x4570b4)){if(_0x22dda4[_0x2b1bc9(0x183)]){const _0x220473=serializeRule(_0x22dda4[_0x2b1bc9(0x183)]),_0x1a4205=_0xd035b9[_0x2b1bc9(0x146)](_0x220473)||[];_0x1a4205[_0x2b1bc9(0x16f)](_0x1051ee),_0xd035b9[_0x2b1bc9(0x147)](_0x220473,_0x1a4205);}}return _0xd035b9;}export function buildLocalRuleToNameMappingFromJourney(_0x376a76){const _0x549e30=a145_0x4b53,_0x4fdac9=_0x376a76[_0x549e30(0x164)];if(!_0x4fdac9)return new Map();const _0x1aa5e3=collectSegmentUsageCounts(_0x376a76),_0x5c0c81=new Map();let _0x81e173=0x0;for(const [_0xfc438c,_0x54e1d5]of Object['entries'](_0x4fdac9)){if(!_0x54e1d5[_0x549e30(0x183)]){_0x81e173++;continue;}const _0xef0c3f=serializeRule(_0x54e1d5[_0x549e30(0x183)]),_0x36e0af=_0x5c0c81[_0x549e30(0x146)](_0xef0c3f)||[];_0x36e0af[_0x549e30(0x16f)]({'name':_0xfc438c,'index':_0x81e173}),_0x5c0c81[_0x549e30(0x147)](_0xef0c3f,_0x36e0af),_0x81e173++;}const _0x561e36=new Map();for(const [_0x410fbf,_0x19dc34]of _0x5c0c81){const _0x53574b=_0x19dc34[_0x549e30(0x192)]()[_0x549e30(0x14e)]((_0x115e6b,_0x411f15)=>{const _0x587e1d=_0x549e30,_0x3b3122=_0x1aa5e3[_0x587e1d(0x146)](_0x115e6b[_0x587e1d(0x177)])||0x0,_0x8b573=_0x1aa5e3[_0x587e1d(0x146)](_0x411f15[_0x587e1d(0x177)])||0x0;if(_0x3b3122!==_0x8b573)return _0x8b573-_0x3b3122;return _0x115e6b['index']-_0x411f15[_0x587e1d(0x143)];})[_0x549e30(0x16a)](_0x1c1e4d=>_0x1c1e4d[_0x549e30(0x177)]);_0x561e36['set'](_0x410fbf,_0x53574b);}return _0x561e36;}export function collectSegmentUsageCounts(_0x2f9803){const _0x1c4649=a145_0x4b53,_0x4fd647=new Map(),_0x21993d=_0x34d8f9=>{const _0x218ebe=a145_0x4b53;if(!_0x34d8f9)return;_0x4fd647[_0x218ebe(0x147)](_0x34d8f9,(_0x4fd647['get'](_0x34d8f9)||0x0)+0x1);},_0x20a685=_0x379300=>{const _0x5a75af=a145_0x4b53;for(const _0x47326f of _0x379300){_0x21993d(_0x47326f[_0x5a75af(0x152)]?.[_0x5a75af(0x157)]);if(_0x47326f[_0x5a75af(0x149)])for(const _0x32eee6 of _0x47326f[_0x5a75af(0x149)]){_0x21993d(_0x32eee6['segment']);}_0x21993d(_0x47326f['milestone']?.[_0x5a75af(0x157)]);if(_0x47326f[_0x5a75af(0x17b)])for(const _0x428961 of _0x47326f[_0x5a75af(0x17b)]){if(_0x428961['type']===_0x5a75af(0x144))for(const _0x510de2 of _0x428961[_0x5a75af(0x162)][_0x5a75af(0x184)]){_0x21993d(_0x510de2[_0x5a75af(0x157)]);}else _0x428961[_0x5a75af(0x188)]===_0x5a75af(0x163)&&_0x21993d(_0x428961[_0x5a75af(0x162)]['condition']?.[_0x5a75af(0x157)]);}}};_0x21993d(_0x2f9803[_0x1c4649(0x186)]?.['segment']);if(_0x2f9803[_0x1c4649(0x197)])for(const _0x855f8d of _0x2f9803['journeys']){_0x21993d(_0x855f8d[_0x1c4649(0x186)]?.[_0x1c4649(0x157)]),_0x20a685(_0x855f8d['stages']);}_0x2f9803[_0x1c4649(0x166)]&&_0x20a685(_0x2f9803[_0x1c4649(0x166)]);if(_0x2f9803[_0x1c4649(0x18f)])for(const _0x385aee of _0x2f9803[_0x1c4649(0x18f)]){_0x20a685(_0x385aee[_0x1c4649(0x166)]);}return _0x4fd647;}
|
|
1
|
+
function a145_0x367a(_0x273ab5,_0x472173){_0x273ab5=_0x273ab5-0xcb;const _0x2349ed=a145_0x2349();let _0x367a9f=_0x2349ed[_0x273ab5];return _0x367a9f;}(function(_0x4b05ce,_0x39af6e){const _0x20d01b=a145_0x367a,_0x255d0d=_0x4b05ce();while(!![]){try{const _0x4aec47=parseInt(_0x20d01b(0xe0))/0x1*(parseInt(_0x20d01b(0xe9))/0x2)+parseInt(_0x20d01b(0xdf))/0x3*(parseInt(_0x20d01b(0x101))/0x4)+parseInt(_0x20d01b(0xf8))/0x5*(-parseInt(_0x20d01b(0xda))/0x6)+-parseInt(_0x20d01b(0xe4))/0x7+-parseInt(_0x20d01b(0xfd))/0x8*(parseInt(_0x20d01b(0xdd))/0x9)+parseInt(_0x20d01b(0xfa))/0xa+parseInt(_0x20d01b(0x11c))/0xb*(-parseInt(_0x20d01b(0xfb))/0xc);if(_0x4aec47===_0x39af6e)break;else _0x255d0d['push'](_0x255d0d['shift']());}catch(_0x6d2527){_0x255d0d['push'](_0x255d0d['shift']());}}}(a145_0x2349,0x94d5f));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x573273){const _0x2dfc2e=a145_0x367a;return _0x573273[_0x2dfc2e(0xf5)]()['replace'](/\s+/g,'_')['replace'](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')[_0x2dfc2e(0xee)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x440a2e){const _0xf640e5=a145_0x367a,_0x3de164=_0x440a2e['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x3de164){const _0x47f846=_0x3de164[0x1]['toLowerCase'](),_0x5cb5c1=_0x3de164[0x2],_0x1d451a=_0x5cb5c1['replace'](/-/g,'')['slice'](0x0,0x4)[_0xf640e5(0xf5)]();return _0x47f846+'_'+_0x1d451a;}const _0x2e3cb4=_0x440a2e['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x2e3cb4){const _0x24bbfd=_0x2e3cb4[0x1],_0x5af413=_0x2e3cb4[0x2][_0xf640e5(0xf5)](),_0x93288a=_0x24bbfd[_0xf640e5(0xee)](/-/g,'')[_0xf640e5(0xf0)](0x0,0x4)[_0xf640e5(0xf5)]();return _0x5af413+'_'+_0x93288a;}return undefined;}function stableStringify(_0x32d764){const _0x4dc1fc=a145_0x367a;if(Array['isArray'](_0x32d764))return'['+_0x32d764[_0x4dc1fc(0x10c)](_0x18b776=>stableStringify(_0x18b776))['join'](',')+']';if(_0x32d764&&typeof _0x32d764===_0x4dc1fc(0xe2)){const _0x1ee2a5=_0x32d764,_0x2871b5=Object[_0x4dc1fc(0x102)](_0x1ee2a5)[_0x4dc1fc(0xf7)](),_0xbb0767=_0x2871b5[_0x4dc1fc(0x10c)](_0xfb6212=>'\x22'+_0xfb6212+'\x22:'+stableStringify(_0x1ee2a5[_0xfb6212]));return'{'+_0xbb0767[_0x4dc1fc(0x10f)](',')+'}';}const _0x132138=JSON['stringify'](_0x32d764);return _0x132138===undefined?_0x4dc1fc(0x119):_0x132138;}export function consolidateActivationsByContent(_0x2ee5a3){const _0x5048dc=a145_0x367a,_0x98e6aa={},_0x2c02a3=new Map(),_0x558a91=new Map();for(const _0x585d80 of _0x2ee5a3){if(!_0x585d80)continue;for(const [_0x565e93,_0x6388e3]of Object['entries'](_0x585d80)){const _0x1097c4={'name':_0x6388e3['name'],'connection':_0x6388e3[_0x5048dc(0x11b)],..._0x6388e3[_0x5048dc(0xf2)]!==undefined&&{'all_columns':_0x6388e3[_0x5048dc(0xf2)]},..._0x6388e3[_0x5048dc(0x11d)]!==undefined&&{'columns':_0x6388e3[_0x5048dc(0x11d)]},..._0x6388e3[_0x5048dc(0xf9)]!==undefined&&{'behavior':_0x6388e3[_0x5048dc(0xf9)]},..._0x6388e3[_0x5048dc(0x110)]!==undefined&&{'schedule':_0x6388e3[_0x5048dc(0x110)]},..._0x6388e3[_0x5048dc(0xed)]!==undefined&&{'notification':_0x6388e3[_0x5048dc(0xed)]},..._0x6388e3[_0x5048dc(0x115)]!==undefined&&{'connector_config':_0x6388e3['connector_config']},..._0x6388e3[_0x5048dc(0x109)]!==undefined&&{'activation_template_id':_0x6388e3[_0x5048dc(0x109)]}},_0x59cfd8=stableStringify(_0x1097c4),_0x4fb084=_0x558a91[_0x5048dc(0x118)](_0x59cfd8);_0x4fb084?_0x2c02a3[_0x5048dc(0xcb)](_0x565e93,_0x4fb084):(_0x98e6aa[_0x565e93]=_0x6388e3,_0x2c02a3[_0x5048dc(0xcb)](_0x565e93,_0x565e93),_0x558a91['set'](_0x59cfd8,_0x565e93));}}return{'merged':_0x98e6aa,'nameMapping':_0x2c02a3};}export function updateActivationReferences(_0x3d822a,_0x55305a){const _0x7630c2=a145_0x367a;if(!_0x3d822a)return;for(const _0x40c049 of _0x3d822a){if(!_0x40c049[_0x7630c2(0xeb)])continue;for(const _0x56f8e9 of _0x40c049[_0x7630c2(0xeb)]){if(_0x56f8e9[_0x7630c2(0x103)]===_0x7630c2(0x117)&&_0x56f8e9['with']?.[_0x7630c2(0x117)]){const _0x421d3c=_0x55305a[_0x7630c2(0x118)](_0x56f8e9['with'][_0x7630c2(0x117)]);_0x421d3c&&_0x421d3c!==_0x56f8e9[_0x7630c2(0xd9)]['activation']&&(_0x56f8e9['with'][_0x7630c2(0x117)]=_0x421d3c);}}}}export function consolidateSegmentsByContent(_0x123ecd,_0x11347b){const _0x27968c=a145_0x367a,_0x286b3a={},_0x3024cc=new Map(),_0x5001eb=new Map();for(const _0x458d46 of _0x123ecd){if(!_0x458d46)continue;for(const [_0x39899d,_0x564959]of Object['entries'](_0x458d46)){if(!_0x564959[_0x27968c(0x105)]){_0x286b3a[_0x39899d]=_0x564959,_0x3024cc[_0x27968c(0xcb)](_0x39899d,_0x39899d);continue;}const _0x1143ff=_0x564959['description']&&_0x564959[_0x27968c(0xe7)][_0x27968c(0xcc)]()?_0x564959[_0x27968c(0xe7)]:undefined,_0x4ea06b=JSON[_0x27968c(0xe8)]({'description':_0x1143ff,'rule':deepSortObject(_0x564959['rule'])}),_0x4ec626=_0x5001eb['get'](_0x4ea06b);if(_0x4ec626){const _0x1c7311={..._0x564959['description']!==undefined&&{'description':_0x564959[_0x27968c(0xe7)]},'rule':_0x564959[_0x27968c(0x105)]?deepSortObject(_0x564959['rule']):_0x564959['rule']};if(_0x39899d<_0x4ec626){_0x286b3a[_0x39899d]=_0x1c7311,delete _0x286b3a[_0x4ec626];for(const [_0x34a916,_0x197018]of _0x3024cc['entries']()){_0x197018===_0x4ec626&&_0x3024cc[_0x27968c(0xcb)](_0x34a916,_0x39899d);}_0x3024cc[_0x27968c(0xcb)](_0x39899d,_0x39899d),_0x5001eb[_0x27968c(0xcb)](_0x4ea06b,_0x39899d);}else _0x286b3a[_0x4ec626]=_0x1c7311,_0x3024cc['set'](_0x39899d,_0x4ec626);}else{let _0x49049c=_0x39899d;if(_0x11347b){const _0x4b88bf=_0x11347b[_0x27968c(0x118)](_0x4ea06b);_0x4b88bf&&_0x4b88bf[_0x27968c(0x104)]>0x0&&(_0x49049c=_0x4b88bf[_0x27968c(0xf0)]()['sort']()[0x0]);}const _0x5791ca={..._0x564959['description']!==undefined&&{'description':_0x564959['description']},'rule':_0x564959['rule']?deepSortObject(_0x564959[_0x27968c(0x105)]):_0x564959[_0x27968c(0x105)]};_0x286b3a[_0x49049c]=_0x5791ca,_0x3024cc[_0x27968c(0xcb)](_0x39899d,_0x49049c),_0x5001eb[_0x27968c(0xcb)](_0x4ea06b,_0x49049c);}}}return{'merged':_0x286b3a,'nameMapping':_0x3024cc};}export function updateSegmentReferences(_0x585d63,_0x55a065){const _0x20db71=a145_0x367a;if(!_0x585d63)return;for(const _0xd7f7a3 of _0x585d63){if(_0xd7f7a3[_0x20db71(0xd5)]?.['segment']){const _0x160d27=_0x55a065['get'](_0xd7f7a3[_0x20db71(0xd5)][_0x20db71(0xf1)]);_0x160d27&&(_0xd7f7a3[_0x20db71(0xd5)][_0x20db71(0xf1)]=_0x160d27);}if(_0xd7f7a3[_0x20db71(0xe5)])for(const _0x537409 of _0xd7f7a3['exit_criteria']){if(_0x537409[_0x20db71(0xf1)]){const _0x1404db=_0x55a065['get'](_0x537409[_0x20db71(0xf1)]);_0x1404db&&(_0x537409[_0x20db71(0xf1)]=_0x1404db);}}if(_0xd7f7a3[_0x20db71(0xde)]?.['segment']){const _0x520d7c=_0x55a065['get'](_0xd7f7a3['milestone'][_0x20db71(0xf1)]);_0x520d7c&&(_0xd7f7a3[_0x20db71(0xde)][_0x20db71(0xf1)]=_0x520d7c);}if(_0xd7f7a3[_0x20db71(0xeb)])for(const _0x2db951 of _0xd7f7a3[_0x20db71(0xeb)]){if(_0x2db951['type']===_0x20db71(0xd7)&&_0x2db951['with']?.[_0x20db71(0x10b)])for(const _0xa5bcf of _0x2db951[_0x20db71(0xd9)]['branches']){if(_0xa5bcf[_0x20db71(0xf1)]){const _0x3d4319=_0x55a065['get'](_0xa5bcf[_0x20db71(0xf1)]);_0x3d4319&&(_0xa5bcf[_0x20db71(0xf1)]=_0x3d4319);}}if(_0x2db951[_0x20db71(0x103)]===_0x20db71(0xdc)&&_0x2db951['with']?.[_0x20db71(0xd6)]?.[_0x20db71(0xf1)]){const _0x55f02c=_0x55a065['get'](_0x2db951['with'][_0x20db71(0xd6)]['segment']);_0x55f02c&&(_0x2db951[_0x20db71(0xd9)][_0x20db71(0xd6)][_0x20db71(0xf1)]=_0x55f02c);}}}}function a145_0x2349(){const _0x20a789=['replace','endsWith','slice','segment','all_columns','state','name','toLowerCase','string','sort','206455buzvVP','behavior','11356110locTie','12oNpgzy','.yaml','176vfRibV','journeyBundleName','reentry','attributes','4139216JyPJFI','keys','type','length','rule','version_number','bundle_id','push','activation_template_id','yaml','branches','map','include','bundle_name','join','schedule','launched','values','activations','conditions','connector_config','has','activation','get','null','exclude','connection','17764681qgODDZ','columns','set','trim','merged','journey','index','segments','item','journeyStages','isArray','journeys','entry_criteria','condition','decision_point','find','with','12MKFdnh','versions','wait','182907IYvArO','milestone','3fzjRBO','19597kycLjA','entries','object','goal','1400035nqnikQ','exit_criteria','.yml','description','stringify','80ZMiVgr','some','steps','stages','notification'];a145_0x2349=function(){return _0x20a789;};return a145_0x2349();}export function updateSegmentRefsInSegments(_0x2fc30d,_0x55b7c1){const _0x41ac0c=a145_0x367a;for(const _0x2eda9f of Object[_0x41ac0c(0x112)](_0x2fc30d)){_0x2eda9f[_0x41ac0c(0x105)]&&updateSegmentRefsInRule(_0x2eda9f['rule'],_0x55b7c1);}}function updateSegmentRefsInRule(_0x1527b1,_0x82bda2){const _0x297b11=a145_0x367a;if(_0x1527b1===null||typeof _0x1527b1!==_0x297b11(0xe2))return;if(Array['isArray'](_0x1527b1)){for(const _0x31ded3 of _0x1527b1){updateSegmentRefsInRule(_0x31ded3,_0x82bda2);}return;}const _0x1d574e=_0x1527b1;if((_0x1d574e[_0x297b11(0x103)]===_0x297b11(0x10d)||_0x1d574e[_0x297b11(0x103)]===_0x297b11(0x11a))&&typeof _0x1d574e[_0x297b11(0xf1)]===_0x297b11(0xf6)){const _0x2b3bd0=_0x82bda2['get'](_0x1d574e[_0x297b11(0xf1)]);_0x2b3bd0&&(_0x1d574e[_0x297b11(0xf1)]=_0x2b3bd0);}if(_0x1d574e[_0x297b11(0x114)]&&Array[_0x297b11(0xd3)](_0x1d574e[_0x297b11(0x114)]))for(const _0x2f7caa of _0x1d574e[_0x297b11(0x114)]){updateSegmentRefsInRule(_0x2f7caa,_0x82bda2);}}export function buildJourneysArray(_0x3d86db,_0x4fbfec){const _0xfbe27d=a145_0x367a;return _0x3d86db[_0xfbe27d(0x10c)](_0x455fbc=>{const _0x9ffdb0=_0xfbe27d,_0x24f270=_0x4fbfec?_0x455fbc[_0x9ffdb0(0xd1)]['id']===_0x4fbfec:_0x3d86db[_0x9ffdb0(0x104)]===0x1,_0x35b682=_0x455fbc[_0x9ffdb0(0x10a)][_0x9ffdb0(0xd4)]?.[0x0],_0x5c3f06=_0x35b682?.[_0x9ffdb0(0xe3)]||_0x455fbc[_0x9ffdb0(0x10a)][_0x9ffdb0(0xe3)],_0x591cbc={'version':_0x35b682?.['version']||_0x455fbc['yaml']['version']||_0x455fbc[_0x9ffdb0(0xd1)]['name'],'state':_0x455fbc['item'][_0x9ffdb0(0xf3)]===_0x9ffdb0(0x111)?'launched':'draft','stages':_0x35b682?.['stages']||_0x455fbc[_0x9ffdb0(0x10a)]['stages']||[],'id':_0x35b682?.['id']||_0x455fbc[_0x9ffdb0(0x10a)]['id'],'version_number':_0x35b682?.[_0x9ffdb0(0x106)]||_0x455fbc[_0x9ffdb0(0x10a)][_0x9ffdb0(0x106)]};return _0x5c3f06&&(_0x591cbc['goal']=_0x5c3f06),_0x24f270&&(_0x591cbc['latest']=!![]),_0x591cbc;});}export function buildMergedJourneyDef(_0xf1d7ea,_0x19f78d,_0x10eba7){const _0x4f2191=a145_0x367a,_0x457872=_0xf1d7ea[0x0][_0x4f2191(0x10a)],_0x334e04=buildJourneysArray(_0xf1d7ea,_0x10eba7),{merged:_0x2c8b1a,nameMapping:_0x4d00f5}=consolidateSegmentsByContent(_0xf1d7ea[_0x4f2191(0x10c)](_0xddc93f=>_0xddc93f[_0x4f2191(0x10a)][_0x4f2191(0xd0)]),_0x19f78d);updateSegmentRefsInSegments(_0x2c8b1a,_0x4d00f5);const _0x382ace=Array['from'](_0x4d00f5[_0x4f2191(0xe1)]())[_0x4f2191(0xea)](([_0x38371d,_0x5cb444])=>_0x38371d!==_0x5cb444&&_0x38371d['startsWith'](_0x4f2191(0xd5)));let _0x3ab337=_0x2c8b1a,_0x245f13=new Map();if(_0x382ace){const _0x364281=consolidateSegmentsByContent([_0x2c8b1a],_0x19f78d);_0x3ab337=_0x364281[_0x4f2191(0xcd)],_0x245f13=_0x364281['nameMapping'];}const _0xbda1b8=new Map(_0x4d00f5);for(const [_0x3893cf,_0x56c354]of _0x245f13[_0x4f2191(0xe1)]()){_0xbda1b8['set'](_0x3893cf,_0x56c354);}for(const [_0x171dc0,_0x3422ca]of _0xbda1b8[_0x4f2191(0xe1)]()){let _0x53a625=_0x3422ca,_0x371735=0x0;while(_0xbda1b8[_0x4f2191(0x116)](_0x53a625)&&_0xbda1b8['get'](_0x53a625)!==_0x53a625&&_0x371735<MAX_MAPPING_CHAIN_DEPTH){_0x53a625=_0xbda1b8[_0x4f2191(0x118)](_0x53a625),_0x371735++;}_0x53a625!==_0x3422ca&&_0xbda1b8['set'](_0x171dc0,_0x53a625);}for(const _0x5bc02a of _0x334e04){updateSegmentReferences(_0x5bc02a[_0x4f2191(0xec)],_0xbda1b8);}const {merged:_0x2a0d0d,nameMapping:_0x4533cb}=consolidateActivationsByContent(_0xf1d7ea[_0x4f2191(0x10c)](_0x2d086b=>_0x2d086b[_0x4f2191(0x10a)][_0x4f2191(0x113)]));for(const _0x369a25 of _0x334e04){updateActivationReferences(_0x369a25[_0x4f2191(0xec)],_0x4533cb);}let _0x4568c7=_0x457872[_0x4f2191(0xe3)];if(_0x4568c7?.[_0x4f2191(0xf1)]){const _0x2c1514=_0xbda1b8['get'](_0x4568c7['segment']);_0x2c1514&&(_0x4568c7={..._0x4568c7,'segment':_0x2c1514});}for(const _0x1105c7 of _0x334e04){if(_0x1105c7[_0x4f2191(0xe3)]?.[_0x4f2191(0xf1)]){const _0x247ac4=_0xbda1b8[_0x4f2191(0x118)](_0x1105c7['goal'][_0x4f2191(0xf1)]);_0x247ac4&&(_0x1105c7[_0x4f2191(0xe3)]={..._0x1105c7['goal'],'segment':_0x247ac4});}}return _0x334e04['some'](_0x53c77a=>_0x53c77a[_0x4f2191(0xe3)])&&(_0x4568c7=undefined),{'type':_0x4f2191(0xce),'name':_0x457872[_0x4f2191(0xf4)],'description':_0x457872['description'],'goal':_0x4568c7,'reentry':_0x457872[_0x4f2191(0xff)],'segments':Object[_0x4f2191(0x102)](_0x3ab337)[_0x4f2191(0x104)]>0x0?_0x3ab337:undefined,'activations':Object['keys'](_0x2a0d0d)['length']>0x0?_0x2a0d0d:undefined,'journeys':_0x334e04,'bundle_id':_0x457872[_0x4f2191(0x107)],'bundle_name':_0x457872[_0x4f2191(0x10e)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x4e5bc6,_0x392a81,_0x1dd85b,_0x2bf1d8){const _0x4b4a90=a145_0x367a,_0x3eef72=_0x4e5bc6+':'+_0x392a81,_0x380023=_0x1dd85b['get'](_0x3eef72);if(_0x380023)return _0x380023;const _0x54a56f=await _0x2bf1d8(_0x4e5bc6),_0x517bba=_0x54a56f['attributes'][_0x4b4a90(0xfe)]||_0x54a56f[_0x4b4a90(0x100)]['name'],_0x22b5af=_0x54a56f[_0x4b4a90(0x100)][_0x4b4a90(0xd2)][_0x4b4a90(0xd8)](_0xeab77f=>String(_0xeab77f['id'])===String(_0x392a81)),_0x1202dc=_0x22b5af?.['name']||_0x392a81,_0x54683c={'journeyName':_0x517bba,'stageName':_0x1202dc};return _0x1dd85b[_0x4b4a90(0xcb)](_0x3eef72,_0x54683c),_0x54683c;}export function formatApiJourneyName(_0x122f01,_0x7e2256){return _0x7e2256+'\x20('+_0x122f01+')';}export function isLocalJourneyRef(_0x17584d){const _0x11b13a=a145_0x367a;return _0x17584d[_0x11b13a(0xef)](_0x11b13a(0xe6))||_0x17584d[_0x11b13a(0xef)](_0x11b13a(0xfc));}export function buildLocalRuleToNameMapping(_0x2640b7){const _0x53b76f=a145_0x367a,_0x32b320=new Map();if(!_0x2640b7)return _0x32b320;for(const [_0x2d7c1c,_0x3ea80c]of Object[_0x53b76f(0xe1)](_0x2640b7)){if(_0x3ea80c['rule']){const _0x53dc68=serializeRule(_0x3ea80c[_0x53b76f(0x105)]),_0x1b4e8f=_0x32b320[_0x53b76f(0x118)](_0x53dc68)||[];_0x1b4e8f['push'](_0x2d7c1c),_0x32b320[_0x53b76f(0xcb)](_0x53dc68,_0x1b4e8f);}}return _0x32b320;}export function buildLocalRuleToNameMappingFromJourney(_0x1d6d37){const _0x466f2c=a145_0x367a,_0x3a1721=_0x1d6d37['segments'];if(!_0x3a1721)return new Map();const _0x29c076=collectSegmentUsageCounts(_0x1d6d37),_0x1a4a57=new Map();let _0x1dca63=0x0;for(const [_0x215a4e,_0x16efc8]of Object[_0x466f2c(0xe1)](_0x3a1721)){if(!_0x16efc8[_0x466f2c(0x105)]){_0x1dca63++;continue;}const _0x3d50cc=serializeRule(_0x16efc8[_0x466f2c(0x105)]),_0x604fb=_0x1a4a57[_0x466f2c(0x118)](_0x3d50cc)||[];_0x604fb[_0x466f2c(0x108)]({'name':_0x215a4e,'index':_0x1dca63}),_0x1a4a57[_0x466f2c(0xcb)](_0x3d50cc,_0x604fb),_0x1dca63++;}const _0x44a142=new Map();for(const [_0x325d85,_0x3859ed]of _0x1a4a57){const _0x10897b=_0x3859ed[_0x466f2c(0xf0)]()[_0x466f2c(0xf7)]((_0x425f83,_0x282e12)=>{const _0x5de744=_0x466f2c,_0x2940f2=_0x29c076[_0x5de744(0x118)](_0x425f83['name'])||0x0,_0x366e6a=_0x29c076[_0x5de744(0x118)](_0x282e12[_0x5de744(0xf4)])||0x0;if(_0x2940f2!==_0x366e6a)return _0x366e6a-_0x2940f2;return _0x425f83[_0x5de744(0xcf)]-_0x282e12[_0x5de744(0xcf)];})[_0x466f2c(0x10c)](_0x581a5c=>_0x581a5c[_0x466f2c(0xf4)]);_0x44a142[_0x466f2c(0xcb)](_0x325d85,_0x10897b);}return _0x44a142;}export function collectSegmentUsageCounts(_0x2cefe7){const _0x295470=a145_0x367a,_0x1a4039=new Map(),_0x15968d=_0xeec86c=>{const _0x2b075c=a145_0x367a;if(!_0xeec86c)return;_0x1a4039[_0x2b075c(0xcb)](_0xeec86c,(_0x1a4039['get'](_0xeec86c)||0x0)+0x1);},_0xd1f277=_0x277493=>{const _0x57a529=a145_0x367a;for(const _0x515aab of _0x277493){_0x15968d(_0x515aab[_0x57a529(0xd5)]?.[_0x57a529(0xf1)]);if(_0x515aab[_0x57a529(0xe5)])for(const _0xa9ce1 of _0x515aab[_0x57a529(0xe5)]){_0x15968d(_0xa9ce1[_0x57a529(0xf1)]);}_0x15968d(_0x515aab['milestone']?.['segment']);if(_0x515aab[_0x57a529(0xeb)])for(const _0x48bf38 of _0x515aab[_0x57a529(0xeb)]){if(_0x48bf38[_0x57a529(0x103)]==='decision_point')for(const _0x407259 of _0x48bf38['with'][_0x57a529(0x10b)]){_0x15968d(_0x407259['segment']);}else _0x48bf38[_0x57a529(0x103)]==='wait'&&_0x15968d(_0x48bf38[_0x57a529(0xd9)]['condition']?.['segment']);}}};_0x15968d(_0x2cefe7['goal']?.[_0x295470(0xf1)]);if(_0x2cefe7[_0x295470(0xd4)])for(const _0x4fb1bc of _0x2cefe7['journeys']){_0x15968d(_0x4fb1bc[_0x295470(0xe3)]?.[_0x295470(0xf1)]),_0xd1f277(_0x4fb1bc['stages']);}_0x2cefe7[_0x295470(0xec)]&&_0xd1f277(_0x2cefe7[_0x295470(0xec)]);if(_0x2cefe7[_0x295470(0xdb)])for(const _0xda3e9 of _0x2cefe7[_0x295470(0xdb)]){_0xd1f277(_0xda3e9[_0x295470(0xec)]);}return _0x1a4039;}
|