@treasuredata/tdx 2026.4.7 → 2026.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a152_0x279d28=a152_0x2e8d;(function(_0x3052b8,_0x39fc2f){const _0x138978=a152_0x2e8d,_0x237bd7=_0x3052b8();while(!![]){try{const _0x518d73=parseInt(_0x138978(0x147))/0x1*(-parseInt(_0x138978(0x213))/0x2)+-parseInt(_0x138978(0x150))/0x3+parseInt(_0x138978(0x1f4))/0x4+parseInt(_0x138978(0x144))/0x5+parseInt(_0x138978(0x15e))/0x6*(-parseInt(_0x138978(0x18b))/0x7)+parseInt(_0x138978(0x1c0))/0x8*(parseInt(_0x138978(0x13e))/0x9)+-parseInt(_0x138978(0x148))/0xa*(parseInt(_0x138978(0x1d6))/0xb);if(_0x518d73===_0x39fc2f)break;else _0x237bd7['push'](_0x237bd7['shift']());}catch(_0x4828fd){_0x237bd7['push'](_0x237bd7['shift']());}}}(a152_0x1e22,0x31cd5));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0x279d28(0x1f2);export const PENDING_ACTIVATION_PREFIX=a152_0x279d28(0x181);export function createPendingSegmentId(_0x3435f8){return''+PENDING_SEGMENT_PREFIX+_0x3435f8+'__';}export function isPendingSegmentId(_0x1a81ce){const _0xa59c86=a152_0x279d28;return _0x1a81ce[_0xa59c86(0x131)](PENDING_SEGMENT_PREFIX)&&!_0x1a81ce[_0xa59c86(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x29775f){const _0x2ef5f3=a152_0x279d28;return _0x29775f[_0x2ef5f3(0x1c9)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5c7d07){return''+PENDING_ACTIVATION_PREFIX+_0x5c7d07+'__';}export function isPendingActivationId(_0x494083){const _0x552e03=a152_0x279d28;return _0x494083[_0x552e03(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3d57d8){const _0x3e3c33=a152_0x279d28;return _0x3d57d8[_0x3e3c33(0x1c9)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x35a7a0,_0x2fc6b8){const _0x11a38f=a152_0x279d28,_0x55a37f=_0x35a7a0+'::'+(_0x2fc6b8[_0x11a38f(0x13f)]()||_0x11a38f(0x13a)),_0x5ce8b5=createHash(_0x11a38f(0x1d9))[_0x11a38f(0x1b4)](_0x55a37f)[_0x11a38f(0x17c)](_0x11a38f(0x176))[_0x11a38f(0x20a)](0x0,0xc);return _0x11a38f(0x1b1)+_0x5ce8b5;}export function ensureJourneyDefaults(_0x4b3ecf){const _0x1f2b9e=a152_0x279d28;!_0x4b3ecf[_0x1f2b9e(0x1e6)]&&(_0x4b3ecf[_0x1f2b9e(0x1e6)]=''),!_0x4b3ecf['state']&&(_0x4b3ecf[_0x1f2b9e(0x1b9)]=_0x1f2b9e(0x216));}export function injectExistingStageIds(_0x2aecb2,_0x49a841){const _0xc79230=a152_0x279d28,_0x1feefc=new Map(_0x49a841['map'](_0x185742=>[_0x185742[_0xc79230(0x1d4)],_0x185742['id']]));for(const _0x14cc43 of _0x2aecb2){if(!_0x14cc43['id']){const _0x918a7b=_0x1feefc[_0xc79230(0x19e)](_0x14cc43[_0xc79230(0x1d4)]);_0x918a7b&&(_0x14cc43['id']=_0x918a7b);}}}export function resolveTDFolderPath(_0x307106,_0x397e58,_0x213a0e){if(!_0x397e58)return _0x307106;if(_0x307106===_0x213a0e||_0x307106['startsWith'](_0x213a0e+'/'))return _0x307106;return _0x307106?_0x213a0e+'/'+_0x307106:_0x213a0e;}export function addFoldersToCreate(_0x247c9f,_0x442419,_0x27949e){const _0x1d64d5=a152_0x279d28;if(!_0x247c9f)return;if(_0x442419['has'](_0x247c9f))return;const _0x211f48=_0x247c9f[_0x1d64d5(0x121)]('/');let _0x209ff8='';for(const _0x1f7efe of _0x211f48){_0x209ff8=_0x209ff8?_0x209ff8+'/'+_0x1f7efe:_0x1f7efe,!_0x442419[_0x1d64d5(0x125)](_0x209ff8)&&_0x27949e[_0x1d64d5(0x124)](_0x209ff8);}}export function sortFoldersByDepth(_0x87bc53){const _0x2baddf=a152_0x279d28;return[..._0x87bc53][_0x2baddf(0x196)]((_0x301b81,_0x546567)=>{const _0x3e046d=_0x2baddf,_0x115bd2=(_0x301b81[_0x3e046d(0x1ea)](/\//g)||[])[_0x3e046d(0x20b)],_0x4eb0e3=(_0x546567[_0x3e046d(0x1ea)](/\//g)||[])['length'];return _0x115bd2-_0x4eb0e3;});}function a152_0x2e8d(_0x5776f7,_0x44f6ee){_0x5776f7=_0x5776f7-0x117;const _0x1e22f6=a152_0x1e22();let _0x2e8d2c=_0x1e22f6[_0x5776f7];return _0x2e8d2c;}import*as a152_0x5568a4 from'yaml';import{readFileSync}from'fs';import a152_0x4e5c51 from'path';import{isJourneyDef,parseYamlString as a152_0x5edd25,toYamlString as a152_0x139232,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x3beaea){const _0x54a38a=a152_0x279d28;if(Array[_0x54a38a(0x126)](_0x3beaea))return'['+_0x3beaea[_0x54a38a(0x191)](_0xbfe354=>stableStringify(_0xbfe354))[_0x54a38a(0x1c1)](',')+']';if(_0x3beaea&&typeof _0x3beaea==='object'){const _0x4c8ade=_0x3beaea,_0x1a0e3e=Object[_0x54a38a(0x1dd)](_0x4c8ade)[_0x54a38a(0x196)](),_0x92f11b=_0x1a0e3e[_0x54a38a(0x191)](_0x3cde1f=>'\x22'+_0x3cde1f+'\x22:'+stableStringify(_0x4c8ade[_0x3cde1f]));return'{'+_0x92f11b[_0x54a38a(0x1c1)](',')+'}';}const _0x569eba=JSON[_0x54a38a(0x165)](_0x3beaea);return _0x569eba===undefined?_0x54a38a(0x174):_0x569eba;}function activationSignature(_0x1a6f08){const _0x1f4c12=a152_0x279d28,_0x534db8={'connection':_0x1a6f08[_0x1f4c12(0x166)],..._0x1a6f08[_0x1f4c12(0x129)]!==undefined&&{'all_columns':_0x1a6f08[_0x1f4c12(0x129)]},..._0x1a6f08[_0x1f4c12(0x1bc)]!==undefined&&{'columns':_0x1a6f08[_0x1f4c12(0x1bc)]},..._0x1a6f08[_0x1f4c12(0x1b7)]!==undefined&&{'behavior':_0x1a6f08['behavior']},..._0x1a6f08[_0x1f4c12(0x14c)]!==undefined&&{'schedule':_0x1a6f08[_0x1f4c12(0x14c)]},..._0x1a6f08[_0x1f4c12(0x14a)]!==undefined&&{'notification':_0x1a6f08[_0x1f4c12(0x14a)]},..._0x1a6f08[_0x1f4c12(0x1f7)]!==undefined&&{'connector_config':_0x1a6f08[_0x1f4c12(0x1f7)]},..._0x1a6f08[_0x1f4c12(0x15c)]!==undefined&&{'activation_template_id':_0x1a6f08[_0x1f4c12(0x15c)]}};return stableStringify(_0x534db8);}async function fetchSegment(_0x4ed556,_0xfe9fc2,_0x307bea,_0x382e7c){const _0x26d137=a152_0x279d28,_0x58ea25=_0x382e7c?.[_0x26d137(0x1e1)](_0x504c01=>_0x504c01['id']===_0x307bea);if(_0x58ea25)return _0x58ea25;try{return await _0x4ed556['segment']['getSegment'](_0xfe9fc2,_0x307bea);}catch(_0x3d8dd8){logger[_0x26d137(0x156)](_0x26d137(0x14f)+_0x307bea+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x3d8dd8);try{return await _0x4ed556[_0x26d137(0x13a)]['getSegmentEntity'](_0x307bea);}catch(_0x3c8adb){return logger[_0x26d137(0x156)](_0x26d137(0x135)+_0x307bea+':\x20'+_0x3c8adb),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3ad050,_0x4eba93,_0x5380cd){const _0xbaeceb=a152_0x279d28,_0x15e2ca=readPushRecovery(_0x3ad050[_0xbaeceb(0x1c8)]);if(_0x15e2ca?.[_0xbaeceb(0x1cb)]===_0x3ad050[_0xbaeceb(0x183)][_0xbaeceb(0x1d4)])for(const [_0x3215d2,_0x317a35]of Object['entries'](_0x15e2ca['segments'])){const _0xb8e61c=generateDeterministicJourneySegmentName(_0x3ad050[_0xbaeceb(0x183)][_0xbaeceb(0x1d4)],_0x3215d2);_0x317a35[_0xbaeceb(0x185)]===_0xb8e61c&&(_0x4eba93[_0xbaeceb(0x209)](_0x3215d2,_0x317a35['segmentId']),_0x5380cd[_0xbaeceb(0x209)](_0x3215d2,_0x317a35['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x2ab531,_0x37d6d9,_0x203b4e,_0x42e93e){const _0x331da3=a152_0x279d28;let _0x1e9876;try{_0x1e9876=await _0x2ab531[_0x331da3(0x13a)][_0x331da3(0x154)]({'name':_0x203b4e['uniqueSegmentName'],'description':_0x203b4e['description'],'journeyId':_0x203b4e[_0x331da3(0x163)],'rule':_0x42e93e(_0x203b4e[_0x331da3(0x19d)],!![]),'countPopulation':!![],'parentFolderId':_0x203b4e[_0x331da3(0x161)],'audienceId':_0x203b4e[_0x331da3(0x184)]});}catch(_0x3f37ad){const _0x3f025e=_0x3f37ad instanceof Error&&_0x3f37ad[_0x331da3(0x1ec)][_0x331da3(0x1a0)](_0x331da3(0x175));if(_0x3f025e){const _0x1ca99e=readPushRecovery(_0x37d6d9[_0x331da3(0x1c8)]),_0x5858f7=_0x1ca99e?.[_0x331da3(0x1cb)]===_0x37d6d9[_0x331da3(0x183)][_0x331da3(0x1d4)]?_0x1ca99e[_0x331da3(0x1fd)][_0x203b4e[_0x331da3(0x190)]]:undefined;if(_0x5858f7?.[_0x331da3(0x185)]===_0x203b4e[_0x331da3(0x1e2)])await _0x2ab531[_0x331da3(0x13a)][_0x331da3(0x1e9)](_0x203b4e[_0x331da3(0x184)],_0x5858f7['segmentId'],{'description':_0x203b4e[_0x331da3(0x1e6)],'rule':_0x42e93e(_0x203b4e[_0x331da3(0x19d)],!![]),'countPopulation':!![]}),_0x1e9876=_0x5858f7[_0x331da3(0x219)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x331da3(0x164)+_0x203b4e[_0x331da3(0x190)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x331da3(0x18c)+_0x37d6d9[_0x331da3(0x1c8)][_0x331da3(0x1c9)](/([^/]+)$/,_0x331da3(0x201))+')\x20')+_0x331da3(0x1b3),_0x3f37ad);}else throw _0x3f37ad;}return saveSegmentToPushRecovery(_0x37d6d9['absolutePath'],_0x37d6d9[_0x331da3(0x183)][_0x331da3(0x1d4)],_0x203b4e['localName'],{'segmentId':_0x1e9876,'uniqueServerName':_0x203b4e['uniqueSegmentName'],'createdAt':new Date()[_0x331da3(0x11e)]()}),_0x1e9876;}export async function prepareSegmentFiles(_0x5c253b,_0x451769,_0x5892d4,_0x68f59a,_0x14b37d){const _0x5d1cda=a152_0x279d28,{activationDefToCreateRequest:_0xfbb8d2}=await import('./child-segment-yaml.js'),_0xfe720c=[],_0x6fb947=new Set();for(const {yamlConfig:_0x31bcd1,folderPath:_0x4c521f,sourcePath:_0x2b25a5}of _0x5c253b){const _0x55a2a5=resolveTDFolderPath(_0x4c521f,_0x68f59a,_0x14b37d),_0x2b2cb3=_0x55a2a5+':'+_0x31bcd1['name'],_0x20ebd4=_0x451769['segmentByFolderAndName']['get'](_0x2b2cb3),_0x4621f8=_0x20ebd4?_0x451769['activationsBySegmentId'][_0x5d1cda(0x19e)](_0x20ebd4['id'])||[]:[];addFoldersToCreate(_0x55a2a5,_0x451769[_0x5d1cda(0x15d)],_0x6fb947);const _0x24ae41=calculateActivationActions(_0x31bcd1[_0x5d1cda(0x203)]||[],_0x4621f8,_0x451769[_0x5d1cda(0x153)],_0x451769['connectionIdToNameMap']);for(const _0xf8efea of _0x24ae41){(_0xf8efea[_0x5d1cda(0x186)]===_0x5d1cda(0x1c4)||_0xf8efea[_0x5d1cda(0x186)]===_0x5d1cda(0x1b4))&&_0xf8efea[_0x5d1cda(0x1fe)]&&(_0xf8efea[_0x5d1cda(0x192)]=await _0xfbb8d2(_0xf8efea[_0x5d1cda(0x1fe)],_0x5892d4));}const _0xfc8ae5=calculateSegmentDiff(_0x31bcd1,_0x20ebd4,_0x4621f8,_0x451769[_0x5d1cda(0x153)],_0x451769[_0x5d1cda(0x11a)]);_0xfe720c[_0x5d1cda(0x1ff)]({'relativePath':_0x31bcd1[_0x5d1cda(0x1d4)],'absolutePath':_0x2b25a5,'yamlConfig':_0x31bcd1,'folderPath':_0x55a2a5,'existingSegment':_0x20ebd4,'existingActivations':_0x4621f8,'isNew':_0xfc8ae5[_0x5d1cda(0x208)],'hasChanges':_0xfc8ae5[_0x5d1cda(0x1ed)],'diff':_0xfc8ae5[_0x5d1cda(0x1f1)],'activationActions':_0x24ae41});}return{'segmentFiles':_0xfe720c,'foldersToCreate':_0x6fb947};}export async function prepareJourneyFiles(_0x2ac00a,_0x12e5d9,_0x25d884,_0x40a74a){const _0x4bfc01=a152_0x279d28,_0x354977=[],_0x350c21=new Set();for(const {yamlConfig:_0x3cac0f,folderPath:_0x2c29b2,sourcePath:_0x331210}of _0x2ac00a){const _0x2e34ff=resolveTDFolderPath(_0x2c29b2,_0x25d884,_0x40a74a),_0x373fd3=_0x2e34ff+':'+_0x3cac0f['name'],_0x12ed62=_0x12e5d9['journeyBundlesByFolderAndName'][_0x4bfc01(0x19e)](_0x373fd3);let _0x5dba1,_0x1a8f20;if(_0x12ed62&&_0x12ed62['length']>0x0){const _0x576890=buildLocalExpandedRuleMappings(_0x3cac0f),{createYamlContext:_0x349601,prefetchJourneySegments:_0x4d732d}=createPushYamlContextForBundle(_0x12e5d9[_0x4bfc01(0x1a5)],_0x12e5d9[_0x4bfc01(0x184)],_0x12e5d9['existingSegments'],_0x576890,_0x12e5d9['idToEmailMap'],_0x12e5d9[_0x4bfc01(0x11a)],_0x12e5d9[_0x4bfc01(0x21b)],_0x12e5d9[_0x4bfc01(0x18f)]);await _0x4d732d(_0x12ed62[_0x4bfc01(0x191)](_0x2873b5=>_0x2873b5['id']));const _0x47174c=await _0x12e5d9['deps'][_0x4bfc01(0x1b0)][_0x4bfc01(0x20e)](_0x12ed62[0x0]['journeyBundleId']),_0x2e4984=hasMultipleVersions(_0x3cac0f),_0x49dae5=async _0x32a9d0=>{const _0x29b625=_0x4bfc01,_0xa00a07=_0x12e5d9['journeyById']?.[_0x29b625(0x19e)](_0x32a9d0);if(_0xa00a07)return _0xa00a07;return _0x12e5d9[_0x29b625(0x141)]({'journeyId':_0x32a9d0,'journeyName':_0x3cac0f['name'],'isMultiVersion':_0x12ed62['length']>0x1});};if(_0x2e4984&&_0x12ed62['length']>0x1){const _0x531692=[];for(const _0x473288 of _0x12ed62){const _0x5401a3=_0x473288[_0x4bfc01(0x16a)]||0x1;_0x12e5d9['progress']?.[_0x4bfc01(0x1b4)]('Fetching\x20'+_0x3cac0f[_0x4bfc01(0x1d4)]+'\x20v'+_0x5401a3);const _0x1ccc00=await _0x49dae5(_0x473288['id']),_0x2a4d68=_0x349601(_0x473288['id']),_0x13bb4a=await journeyResponseToDef(_0x1ccc00,_0x2a4d68);_0x531692[_0x4bfc01(0x1ff)]({'item':_0x473288,'yaml':_0x13bb4a});}const _0x1f5c30=buildLocalRuleToNameMappingFromJourney(_0x3cac0f);_0x1a8f20=buildMergedJourneyDef(_0x531692,_0x1f5c30,_0x47174c);const _0x252251=Math['max'](..._0x531692[_0x4bfc01(0x191)](_0x45c69e=>_0x45c69e[_0x4bfc01(0x1ce)][_0x4bfc01(0x16a)]||0x0)),_0xae3998=_0x12ed62[_0x4bfc01(0x1e1)](_0x27d652=>(_0x27d652[_0x4bfc01(0x16a)]||0x0)===_0x252251);_0xae3998&&(_0x12e5d9['progress']?.[_0x4bfc01(0x1b4)](_0x4bfc01(0x1da)+_0x3cac0f['name']+'\x20v'+_0x252251),_0x5dba1=await _0x49dae5(_0xae3998['id']));}else{const _0x3fc8fd=_0x12ed62[_0x12ed62[_0x4bfc01(0x20b)]-0x1];_0x12e5d9[_0x4bfc01(0x1d0)]?.['update'](_0x4bfc01(0x1da)+_0x3cac0f[_0x4bfc01(0x1d4)]),_0x5dba1=await _0x49dae5(_0x3fc8fd['id']);const _0x5a24df=_0x349601(_0x3fc8fd['id']),_0x56cb27=await journeyResponseToDef(_0x5dba1,_0x5a24df),_0x2cc559=buildLocalRuleToNameMappingFromJourney(_0x3cac0f);_0x1a8f20=buildMergedJourneyDef([{'item':_0x3fc8fd,'yaml':_0x56cb27}],_0x2cc559,_0x47174c);}}addFoldersToCreate(_0x2e34ff,_0x12e5d9['folderPathToId'],_0x350c21);const _0x3a584f=calculateJourneyDiff(_0x3cac0f,_0x1a8f20);_0x354977[_0x4bfc01(0x1ff)]({'relativePath':_0x3cac0f[_0x4bfc01(0x1d4)],'absolutePath':_0x331210,'yamlConfig':_0x3cac0f,'folderPath':_0x2e34ff,'existingJourney':_0x5dba1,'isNew':_0x3a584f[_0x4bfc01(0x208)],'hasChanges':_0x3a584f[_0x4bfc01(0x1ed)],'diff':_0x3a584f[_0x4bfc01(0x1f1)]});}return{'journeyFiles':_0x354977,'foldersToCreate':_0x350c21};}export function calculateActivationActions(_0x54808a,_0xb2c598,_0x16327b,_0x7a9419){const _0x5a0281=a152_0x279d28,_0x4bb054=[],_0x41eb20=new Map();for(const _0x49266d of _0xb2c598){_0x41eb20[_0x5a0281(0x209)](_0x49266d['name'],_0x49266d);}const _0x341da4=new Map();for(const _0xf0b130 of _0x54808a){_0x341da4[_0x5a0281(0x209)](_0xf0b130[_0x5a0281(0x1d4)],_0xf0b130);}for(const _0x5ed505 of _0x54808a){const _0x42b446=_0x41eb20[_0x5a0281(0x19e)](_0x5ed505[_0x5a0281(0x1d4)]);if(!_0x42b446)_0x4bb054['push']({'type':_0x5a0281(0x1c4),'name':_0x5ed505[_0x5a0281(0x1d4)],'yamlActivation':_0x5ed505});else{const _0x3af0b7=activationResponseToDef(_0x42b446,_0x16327b,_0x7a9419),_0x2e9ef1=a152_0x5568a4[_0x5a0281(0x165)](_0x3af0b7),_0x245cbd=a152_0x5568a4['stringify'](_0x5ed505);_0x2e9ef1!==_0x245cbd&&_0x4bb054[_0x5a0281(0x1ff)]({'type':_0x5a0281(0x1b4),'name':_0x5ed505[_0x5a0281(0x1d4)],'yamlActivation':_0x5ed505,'existingActivation':_0x42b446});}}for(const _0xf3b1b5 of _0xb2c598){!_0x341da4[_0x5a0281(0x125)](_0xf3b1b5['name'])&&_0x4bb054[_0x5a0281(0x1ff)]({'type':_0x5a0281(0x197),'name':_0xf3b1b5[_0x5a0281(0x1d4)],'existingActivation':_0xf3b1b5});}return _0x4bb054;}function calculateYamlDiff(_0x17ece1,_0x51443c){if(_0x51443c){const _0x5b7527=generateDiff(_0x51443c,_0x17ece1),_0x424bad=hasChanges(_0x5b7527);return{'isNew':![],'hasChanges':_0x424bad,'diff':_0x424bad?formatDiffWithColors(_0x5b7527):undefined};}const _0x1c9a2a=generateDiff('',_0x17ece1);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1c9a2a)};}export function calculateSegmentDiff(_0x724024,_0x13e2df,_0x4cadec,_0x87011d,_0x2c8fb4){const _0x1e9861=segmentToYamlString(_0x724024),_0x5222f4=_0x13e2df?segmentToYamlString(segmentWithActivationsToYaml(_0x13e2df,_0x4cadec,undefined,_0x87011d,_0x2c8fb4)):undefined;return calculateYamlDiff(_0x1e9861,_0x5222f4);}export function calculateJourneyDiff(_0x48c021,_0x543c1a){const _0x3dddf7=normalizeJourneyDef(_0x48c021,_0x48c021),_0x49799b=a152_0x139232(_0x3dddf7),_0x3b0ce5=_0x543c1a?a152_0x139232(normalizeJourneyDef(_0x543c1a,_0x48c021)):undefined;return calculateYamlDiff(_0x49799b,_0x3b0ce5);}export function findSegmentsToDelete(_0x7be1e3,_0x2345c8,_0x5efcde,_0x1861a0,_0x16639c){const _0x587025=a152_0x279d28,_0x4c5408=new Set();for(const {yamlConfig:_0x447cc9,folderPath:_0x2ac86f}of _0x2345c8){_0x4c5408[_0x587025(0x124)](_0x2ac86f+':'+_0x447cc9['name']);}return _0x7be1e3[_0x587025(0x1ae)](_0x2eeb4d=>{const _0xc48613=_0x587025,_0x12fd79=_0x2eeb4d[_0xc48613(0x14e)]?_0x5efcde['get'](_0x2eeb4d['segmentFolderId'][_0xc48613(0x218)]())||'':'',_0x3e1b0b=_0x12fd79+':'+_0x2eeb4d[_0xc48613(0x1d4)];if(_0x4c5408[_0xc48613(0x125)](_0x3e1b0b))return![];if(_0x16639c)return _0x12fd79===_0x1861a0||_0x12fd79[_0xc48613(0x131)](_0x1861a0+'/');return!![];});}export function findJourneysToDelete(_0x4cfb07,_0x384b94,_0x3dfc8d,_0x5527b2,_0x45706d){const _0x3da7c0=a152_0x279d28,_0x514227=new Set();for(const {yamlConfig:_0x298951,folderPath:_0x55bfc9}of _0x384b94){_0x514227[_0x3da7c0(0x124)](_0x55bfc9+':'+_0x298951[_0x3da7c0(0x1d4)]);}return _0x4cfb07[_0x3da7c0(0x1ae)](_0x5bde7f=>{const _0x10c29b=_0x3da7c0,_0x447096=_0x5bde7f['folderId']?_0x3dfc8d[_0x10c29b(0x19e)](_0x5bde7f[_0x10c29b(0x161)])||'':'',_0x215e2b=_0x447096+':'+_0x5bde7f[_0x10c29b(0x1c5)];if(_0x514227[_0x10c29b(0x125)](_0x215e2b))return![];if(_0x45706d)return _0x447096===_0x5527b2||_0x447096[_0x10c29b(0x131)](_0x5527b2+'/');return!![];});}export function buildSegmentLookupMap(_0x21838b,_0x62c0f1){const _0x42180f=a152_0x279d28,_0x578ebf=new Map();for(const _0x2d11cf of _0x21838b){const _0x4267cb=_0x2d11cf[_0x42180f(0x14e)]?_0x62c0f1[_0x42180f(0x19e)](_0x2d11cf[_0x42180f(0x14e)][_0x42180f(0x218)]())||'':'',_0x2c68e6=_0x4267cb+':'+_0x2d11cf['name'];_0x578ebf['set'](_0x2c68e6,_0x2d11cf);}return _0x578ebf;}export function buildSegmentNameToIdMap(_0x1ffad8){const _0x1b69d8=a152_0x279d28,_0x1370d8=new Map();for(const _0x4d044b of _0x1ffad8){_0x1370d8[_0x1b69d8(0x209)](_0x4d044b[_0x1b69d8(0x1d4)],_0x4d044b['id']);}return _0x1370d8;}export function buildJourneyBundleLookupMap(_0x4fc9df,_0x2c1982){const _0x536c62=a152_0x279d28,_0x200754=new Map();for(const _0xbd1915 of _0x4fc9df){const _0x27ab20=_0xbd1915[_0x536c62(0x161)]?_0x2c1982[_0x536c62(0x19e)](_0xbd1915['folderId'])||'':'',_0x1a9e08=_0x27ab20+':'+_0xbd1915['journeyBundleName'];!_0x200754[_0x536c62(0x125)](_0x1a9e08)&&_0x200754['set'](_0x1a9e08,[]),_0x200754['get'](_0x1a9e08)[_0x536c62(0x1ff)](_0xbd1915);}for(const _0x23fc83 of _0x200754['values']()){_0x23fc83[_0x536c62(0x196)]((_0x47f0b8,_0x543a44)=>(_0x47f0b8[_0x536c62(0x16a)]||0x0)-(_0x543a44[_0x536c62(0x16a)]||0x0));}return _0x200754;}export function collectFoldersToCreate(_0x25e4f1,_0xfdd126){const _0x349277=a152_0x279d28,_0x345273=new Set();for(const _0x571f45 of _0x25e4f1){if(!_0x571f45)continue;if(_0xfdd126[_0x349277(0x125)](_0x571f45))continue;const _0x48a3c7=_0x571f45[_0x349277(0x121)]('/');let _0x426276='';for(const _0xe94d17 of _0x48a3c7){_0x426276=_0x426276?_0x426276+'/'+_0xe94d17:_0xe94d17,!_0xfdd126[_0x349277(0x125)](_0x426276)&&_0x345273[_0x349277(0x124)](_0x426276);}}return _0x345273;}export function parseAndClassifyYamlFiles(_0xb52463,_0x2655a3,_0x518daf){const _0x121331=a152_0x279d28,_0x4baeee=[],_0x4bd096=[];for(const _0x325edb of _0xb52463){const _0x17da07=a152_0x4e5c51[_0x121331(0x136)](_0x2655a3,a152_0x4e5c51[_0x121331(0x1fa)](_0x325edb)),_0x5a8879=_0x17da07==='.'?'':_0x17da07['replace'](/\\/g,'/'),_0x1b69cd=readFileSync(_0x325edb,'utf-8'),_0x187348=a152_0x5568a4[_0x121331(0x1bf)](_0x1b69cd);if(isJourneyDef(_0x187348)){const _0x154ac6=a152_0x5edd25(_0x1b69cd);_0x4bd096['push']({'yamlConfig':_0x154ac6,'folderPath':_0x5a8879,'sourcePath':_0x325edb});}else{if(!_0x518daf?.[_0x121331(0x1cf)]){const _0x25f12f=parseSegmentYamlFile(_0x1b69cd),_0x1c0946=normalizeChildSegmentYaml(_0x25f12f);_0x4baeee['push']({'yamlConfig':_0x1c0946,'folderPath':_0x5a8879,'sourcePath':_0x325edb});}}}return{'segments':_0x4baeee,'journeys':_0x4bd096};}export function validateParsedFiles(_0x299d09,_0x401719){const _0x5c8019=a152_0x279d28,_0x33c696=[];for(const {yamlConfig:_0x561d98,sourcePath:_0x4ca27a}of _0x299d09['segments']){const _0x578c69=readFileSync(_0x4ca27a,'utf-8'),_0x401061=a152_0x5568a4[_0x5c8019(0x1ef)](_0x578c69),_0x264aef=validateSegmentDef(_0x561d98,{'source':_0x578c69,'document':_0x401061},{'skipSchema':!![]});if(!_0x264aef[_0x5c8019(0x1a6)]){const _0x58aa62=a152_0x4e5c51[_0x5c8019(0x136)](_0x401719,_0x4ca27a);_0x33c696[_0x5c8019(0x1ff)]({'filePath':_0x58aa62,'source':_0x578c69,'result':_0x264aef,'isJourney':![]});}}for(const {yamlConfig:_0x90582b,sourcePath:_0x1844f7}of _0x299d09['journeys']){const _0x3e6646=readFileSync(_0x1844f7,_0x5c8019(0x11c)),_0x73f3d1=a152_0x5568a4['parseDocument'](_0x3e6646),_0x7a7a3f=validateJourneyDef(_0x90582b,{'source':_0x3e6646,'document':_0x73f3d1},{'skipSchema':!![]});if(!_0x7a7a3f[_0x5c8019(0x1a6)]){const _0x5d4e12=a152_0x4e5c51['relative'](_0x401719,_0x1844f7);_0x33c696[_0x5c8019(0x1ff)]({'filePath':_0x5d4e12,'source':_0x3e6646,'result':_0x7a7a3f,'isJourney':!![]});}}return _0x33c696;}export function formatValidationErrors(_0x56e6e5){const _0x38e4ad=a152_0x279d28,_0x57149f=[];for(const {filePath:_0xe5086c,source:_0x30eabf,result:_0x34edc6,isJourney:_0x318770}of _0x56e6e5){const _0x61f12d=_0x318770?'journey':'segment';_0x57149f[_0x38e4ad(0x1ff)]('\x0a'+_0xe5086c+'\x20('+_0x61f12d+'):\x20'+_0x34edc6['errors']['length']+_0x38e4ad(0x17d)),_0x57149f[_0x38e4ad(0x1ff)](formatValidationResult(_0x34edc6,_0x30eabf,_0xe5086c));}return _0x57149f[_0x38e4ad(0x1c1)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x155f4d){const _0x6f81d9=a152_0x279d28,_0x46d73a=new Set(),_0x359c60=new Map(),_0x3da090=collectSegmentUsageCounts(_0x155f4d);if(_0x155f4d['segments'])for(const [_0x3bf01c,_0x32243e]of Object[_0x6f81d9(0x1e0)](_0x155f4d[_0x6f81d9(0x1fd)])){_0x46d73a[_0x6f81d9(0x124)](_0x3bf01c);if(_0x32243e[_0x6f81d9(0x16f)]){const _0x1eab1c=yamlRuleToApi(_0x32243e['rule']),_0x160811=apiRuleToYaml(_0x1eab1c);_0x359c60['set'](_0x3bf01c,_0x160811);}}const _0xb6fc85=new Map();let _0x44dc31=0x0;for(const [_0x2f45f2,_0x5b4281]of _0x359c60){const _0x24d34d=serializeExpandedRule(_0x5b4281,_0x359c60),_0x5553b4=_0xb6fc85[_0x6f81d9(0x19e)](_0x24d34d)||[];_0x5553b4['push']({'name':_0x2f45f2,'index':_0x44dc31}),_0xb6fc85[_0x6f81d9(0x209)](_0x24d34d,_0x5553b4),_0x44dc31++;}const _0x1a8d3a=new Map();for(const [_0x2f7244,_0x3a3bf6]of _0xb6fc85){const _0x237388=_0x3a3bf6[_0x6f81d9(0x20a)]()['sort']((_0x18d019,_0x19b872)=>{const _0xda2109=_0x6f81d9,_0x38cb21=_0x3da090['get'](_0x18d019['name'])||0x0,_0x97d9ee=_0x3da090['get'](_0x19b872[_0xda2109(0x1d4)])||0x0;if(_0x38cb21!==_0x97d9ee)return _0x97d9ee-_0x38cb21;return _0x18d019['index']-_0x19b872[_0xda2109(0x1e7)];})['map'](_0xb2d19a=>_0xb2d19a['name']),_0x110c01=[];for(const _0x2ec5e5 of _0x237388){const _0x269cf8=_0x3da090['get'](_0x2ec5e5)||0x0,_0x16dcc3=Math[_0x6f81d9(0x142)](_0x269cf8,0x1);for(let _0x1666b1=0x0;_0x1666b1<_0x16dcc3;_0x1666b1++){_0x110c01['push'](_0x2ec5e5);}}_0x1a8d3a[_0x6f81d9(0x209)](_0x2f7244,_0x110c01);}return{'existingLocalSegmentNames':_0x46d73a,'localSegmentRules':_0x359c60,'localExpandedRuleToNames':_0x1a8d3a};}export function createSegmentIdResolver(_0x2507fd,_0x29f699){return async _0x341a0e=>{const _0x853ace=a152_0x2e8d,_0x4b4e59=_0x2507fd[_0x853ace(0x19e)](_0x341a0e);if(!_0x4b4e59)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x853ace(0x12f)+_0x341a0e+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x29f699+'\x27)');return _0x4b4e59;};}export function extractRootFolderId(_0x113ba5){const _0x177157=a152_0x279d28;return _0x113ba5[_0x177157(0x1be)]?.[_0x177157(0x198)]?.[_0x177157(0x11b)]?.['id']||_0x113ba5[_0x177157(0x1be)]?.['parentFolder']?.[_0x177157(0x11b)]?.['id'];}export function buildConnectionMaps(_0x126233){const _0x4edc24=a152_0x279d28,_0x46c3e7=new Map(),_0x34637a=new Map(),_0x46ca22=new Map();for(const _0x207193 of _0x126233){_0x46c3e7[_0x4edc24(0x209)](_0x207193[_0x4edc24(0x1d4)],parseInt(_0x207193['id'],0xa)),_0x34637a[_0x4edc24(0x209)](_0x207193['id'],_0x207193[_0x4edc24(0x1d4)]),_0x46ca22[_0x4edc24(0x209)](_0x207193[_0x4edc24(0x1d4)],_0x207193[_0x4edc24(0x186)]);}return{'nameToId':_0x46c3e7,'idToName':_0x34637a,'nameToType':_0x46ca22};}export function calculatePushStats(_0x3c6f90,_0x27b4d3,_0x591ecd,_0x575aa2,_0x5174cd,_0x58b267,_0x1e297c){const _0x239686=a152_0x279d28,_0x86666c=_0x3c6f90[_0x239686(0x1ae)](_0x35a0e3=>_0x35a0e3['isNew']),_0x187c7a=_0x3c6f90['filter'](_0x36fab4=>!_0x36fab4[_0x239686(0x208)]&&_0x36fab4[_0x239686(0x1ed)]),_0x1941ac=_0x3c6f90[_0x239686(0x1ae)](_0x4dfc0c=>!_0x4dfc0c[_0x239686(0x208)]&&!_0x4dfc0c['hasChanges']),_0x3f3821=_0x58b267?_0x575aa2:[],_0x2b86c8=_0x27b4d3[_0x239686(0x1ae)](_0x6ffb00=>_0x6ffb00[_0x239686(0x208)]),_0x23dd80=_0x27b4d3[_0x239686(0x1ae)](_0x4410c8=>!_0x4410c8[_0x239686(0x208)]&&_0x4410c8[_0x239686(0x1ed)]),_0x52bec9=_0x27b4d3[_0x239686(0x1ae)](_0x2420cd=>!_0x2420cd[_0x239686(0x208)]&&!_0x2420cd['hasChanges']),_0x5e0498=_0x58b267?_0x5174cd:[],_0x452755=_0x3c6f90[_0x239686(0x128)](_0x17fb32=>_0x17fb32[_0x239686(0x167)]),_0x5621a9=_0x452755[_0x239686(0x1ae)](_0x9a6395=>_0x9a6395[_0x239686(0x186)]==='create'),_0x4ed791=_0x452755[_0x239686(0x1ae)](_0x20a52a=>_0x20a52a[_0x239686(0x186)]===_0x239686(0x1b4)),_0x521a0a=_0x452755[_0x239686(0x1ae)](_0x450b62=>_0x450b62[_0x239686(0x186)]==='delete'),_0x19d7e0=Array[_0x239686(0x1f3)](_0x591ecd)['sort'](),_0x5dafb6=_0x1e297c?![]:_0x86666c[_0x239686(0x20b)]>0x0||_0x187c7a[_0x239686(0x20b)]>0x0||_0x3f3821['length']>0x0,_0x30addd=_0x2b86c8['length']>0x0||_0x23dd80[_0x239686(0x20b)]>0x0||_0x5e0498[_0x239686(0x20b)]>0x0,_0x553979=_0x1e297c?![]:_0x452755[_0x239686(0x20b)]>0x0,_0x1f21de=_0x19d7e0[_0x239686(0x20b)]>0x0;return{'segments':{'new':_0x86666c,'changed':_0x187c7a,'unchanged':_0x1941ac,'toDelete':_0x3f3821},'journeys':{'new':_0x2b86c8,'changed':_0x23dd80,'unchanged':_0x52bec9,'toDelete':_0x5e0498},'activations':{'all':_0x452755,'toCreate':_0x5621a9,'toUpdate':_0x4ed791,'toDelete':_0x521a0a},'folders':{'toCreate':_0x19d7e0},'counts':{'segments':{'new':_0x86666c[_0x239686(0x20b)],'changed':_0x187c7a[_0x239686(0x20b)],'unchanged':_0x1941ac['length'],'toDelete':_0x3f3821['length']},'journeys':{'new':_0x2b86c8[_0x239686(0x20b)],'changed':_0x23dd80[_0x239686(0x20b)],'unchanged':_0x52bec9[_0x239686(0x20b)],'toDelete':_0x5e0498[_0x239686(0x20b)]},'activations':{'create':_0x5621a9[_0x239686(0x20b)],'update':_0x4ed791[_0x239686(0x20b)],'delete':_0x521a0a[_0x239686(0x20b)]},'folders':_0x19d7e0[_0x239686(0x20b)]},'hasChanges':_0x5dafb6||_0x30addd||_0x553979||_0x1f21de};}export async function buildPushExecutionContext(_0x1915fa,_0x499661,_0x48ea26,_0x336421,_0x4be565,_0x18e6e4){const _0x2d22b5=a152_0x279d28,_0x486416=extractRootFolderId(_0x48ea26),{pathToId:_0x11fecb,idToPath:_0x2ab9d9}=buildFolderMaps(_0x4be565),_0x11a313=buildSegmentNameToIdMap(_0x336421),_0x29c190=new Map(),{batchAsync:_0x3ba885}=await import(_0x2d22b5(0x13d)),[_0x38c71d,_0x3fce6b]=await Promise[_0x2d22b5(0x1d1)]([_0x1915fa[_0x2d22b5(0x1af)][_0x2d22b5(0x155)](),_0x1915fa[_0x2d22b5(0x166)][_0x2d22b5(0x20d)](),((async()=>{const _0x25f0e0=_0x2d22b5;!_0x18e6e4&&_0x336421[_0x25f0e0(0x20b)]>0x0&&await _0x3ba885(_0x336421,async _0x190f6b=>{const _0x47df40=_0x25f0e0,_0x6600=await _0x1915fa['segment']['listActivations'](_0x499661,_0x190f6b['id']);_0x29c190[_0x47df40(0x209)](_0x190f6b['id'],_0x6600);});})())]),{emailToId:_0x21d246,idToEmail:_0x2e845b}=_0x38c71d,_0x7e3c9f=buildConnectionMaps(_0x3fce6b);return{'rootFolderId':_0x486416,'folderPathToId':_0x11fecb,'folderIdToPath':_0x2ab9d9,'segmentNameToId':_0x11a313,'activationsBySegmentId':_0x29c190,'emailToIdMap':_0x21d246,'idToEmailMap':_0x2e845b,'connectionNameToIdMap':_0x7e3c9f[_0x2d22b5(0x12c)],'connectionIdToNameMap':_0x7e3c9f[_0x2d22b5(0x210)],'connectionNameToTypeMap':_0x7e3c9f[_0x2d22b5(0x217)]};}function a152_0x1e22(){const _0x39e78f=['embedded_activation_created','description','index','logDeleted','updateSegmentById','match','\x27\x20entry\x20criteria','message','hasChanges','Journey\x20\x27','parseDocument','branches','diff','__pending_','from','452256JtGciL','entry','existingActivation','connector_config','./child-segment-yaml.js','\x0a\x20\x20','dirname','kind','rootFolderId','segments','yamlActivation','push','stage\x20\x27','.$1.push-recovery.json','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','activations','ACTIVATION_UPDATE_ERROR','embeddedSegmentNameToId','steps','createSegment','isNew','set','slice','length','updated','list','getLatestJourneyId','exitCriterias','idToName','conditionSegmentId','embedded_activation_creating','20642Vqsdat','existingSegment','createFolder','draft','nameToType','toString','segmentId','Deleted\x20segment\x20\x27','activationStepsById','toLowerCase','segment_updating','segmentNameToId','connectionIdToNameMap','data','utf-8','segment_updated','toISOString','Activation','run_after_journey_refresh','split','logSuccess','\x27\x20to\x20local\x20\x27','add','has','isArray','Created\x20activation\x20\x27','flatMap','all_columns','INTERNAL','activation_updating','nameToId','activationContext','deleted','Segment\x20not\x20found:\x20','activation_created','startsWith','waitStep','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Condition','getSegmentEntity\x20also\x20failed\x20for\x20','relative','waitStepType','activation_deleting','SEGMENT_SYNTAX_ERROR','segment','journeys','Deleting\x20activation\x20\x27','../../utils/async.js','809775fahlXp','trim','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','fetchJourney','max','Creating\x20activation\x20\x27','1770165akOlft','resolveSegment','Duration','5kMDogc','10aIrxnI','segment_deleted','notification','folderPath','schedule','folder_creating','segmentFolderId','getSegment\x20failed\x20for\x20','432012rSerbB','\x20(referenced\x20in\x20journey\x20','Stage\x20\x27','idToEmailMap','createJourneySegment','buildUserMaps','debug','Creating\x20segment\x20\x27',').\x20','segment_deleting','activation_updated','with','activation_template_id','folderPathToId','33636PoKAeM','journeyStages','createdSegmentId','folderId','JOURNEY_SYNTAX_ERROR','journeyId','Embedded\x20segment\x20\x27','stringify','connection','activationActions','withProgress','createdSegmentIds','versionNumber','journeyActivationStepId','embedded_segment_created','\x20journey\x20from\x20file:\x20','conditionTimeoutUnit','rule','deleteSegment','DecisionPoint','Deleted\x20activation\x20\x27','activationParams','null','Name\x20has\x20already\x20been\x20taken','hex','Creating\x20folder\x20\x27','./journey-yaml.js','resolveJourneyId','waitStepUnit','Failed\x20to\x20resolve\x20activation\x20','digest','\x20error(s)','embedded_segment_creating','Updated\x20segment\x20\x27','Segment\x20not\x20found','__pending_act_','segment_creating','yamlConfig','parentId','uniqueServerName','type','Activation\x20not\x20found:\x20','verbose','ACTIVATION_SYNTAX_ERROR','activation_creating','217zRkeiX','Delete\x20the\x20push\x20recovery\x20file\x20(','onProgress','conditionTimeoutDuration','journeyById','localName','map','validatedRequest','Created\x20segment\x20\x27','\x27\x20by\x20rule\x20content','updateActivation','sort','delete','parentSegmentFolder','\x27\x20wait\x20condition','\x20activation\x20\x27','entry_criteria','milestone','resolvedRule','get','\x27\x20from\x20file:\x20','includes','\x27\x20exit\x20criteria','SEGMENT_UPDATE_ERROR','listActivations','getJourney','deps','valid','Entry\x20criteria:\x20','activation_deleted','goal','action','WaitStep','deleteActivation','entryCriteria','filter','user','journey','journey_entry_criteria_','attributes','and\x20the\x20server\x20segment,\x20then\x20retry.','update','results','\x27...','behavior','Failed\x20to\x20resolve\x20segment\x20','state','existingJourney','reduce','columns','goal\x20criteria','relationships','parse','32VijMqy','join','day','journey_updating','create','journeyBundleName','conditions','logWarning','absolutePath','replace','created','journeyName','Created\x20journey\x20\x27','size','item','skipSegments','progress','all','\x20segment\x20from\x20file:\x20','JOURNEY_UPDATE_ERROR','name','Updating\x20activation\x20\x27','2789743xoWvgI','some','NOT_FOUND','sha1','Fetching\x20','folder_created','effectiveFolderId','keys','createActivation','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','entries','find','uniqueSegmentName','\x27\x20not\x20found\x20in\x20journey\x20\x27','journey_updated'];a152_0x1e22=function(){return _0x39e78f;};return a152_0x1e22();}export function createPushYamlContextForBundle(_0x5b3555,_0x49342a,_0x544287,_0x379c7f,_0x5723ed,_0x27a9b3,_0x1d71f7,_0x45cd74){const {existingLocalSegmentNames:_0x558279,localExpandedRuleToNames:_0x532b00}=_0x379c7f,_0x14b788=new Set(),_0x3b37d2=new Map(),_0x1625bb=new Map(),_0x2741fc=new Map(),_0xdb7b29=createJumpTargetCache(),_0x20dda4=new Map(),_0x29ab43=new Map(),_0x4ea167=new Set();let _0x36aeac;const _0x312913=_0x464a83=>{const _0x278aca={'resolveSegment':async _0x2a84e9=>{const _0x5b78b0=a152_0x2e8d,_0x34dd3d=_0x2741fc[_0x5b78b0(0x19e)](_0x2a84e9);if(_0x34dd3d!==undefined)return{'name':_0x34dd3d,'isJourneyLocal':!![]};try{const _0x152903=await fetchSegment(_0x5b3555,_0x49342a,_0x2a84e9,_0x544287);if(!_0x152903)throw new Error(_0x5b78b0(0x180));const _0x124ce1=generateJourneyLocalName(_0x152903[_0x5b78b0(0x1d4)]),_0x46c581=_0x152903[_0x5b78b0(0x1fb)]===SEGMENT_KIND_JOURNEY&&_0x124ce1!==undefined;let _0x4e197d=_0x152903[_0x5b78b0(0x1d4)],_0x379274;if(_0x46c581&&_0x152903[_0x5b78b0(0x16f)]){const _0x223a05=apiRuleToYaml(_0x152903[_0x5b78b0(0x16f)]);_0x29ab43['set'](_0x2a84e9,_0x223a05);const _0x1cd6ca=async _0xb3bf32=>{const _0x4d4833=_0x5b78b0,_0x4c6fc5=collectSegmentRefsFromRule(_0xb3bf32);for(const _0x12d7a6 of _0x4c6fc5){if(!_0x29ab43[_0x4d4833(0x125)](_0x12d7a6))try{const _0x1eca02=await fetchSegment(_0x5b3555,_0x49342a,_0x12d7a6,_0x544287);if(_0x1eca02?.[_0x4d4833(0x16f)]){const _0x53116b=apiRuleToYaml(_0x1eca02[_0x4d4833(0x16f)]);_0x29ab43[_0x4d4833(0x209)](_0x12d7a6,_0x53116b),await _0x1cd6ca(_0x53116b);}}catch(_0x4140aa){logger[_0x4d4833(0x156)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x12d7a6+':\x20'+_0x4140aa);}}};await _0x1cd6ca(_0x223a05);const _0xfe8061=serializeExpandedRule(_0x223a05,_0x29ab43),_0x1a0a67=_0x532b00[_0x5b78b0(0x19e)](_0xfe8061);if(_0x1a0a67&&_0x1a0a67[_0x5b78b0(0x20b)]>0x0){const _0x17c7ea=_0x3b37d2[_0x5b78b0(0x19e)](_0xfe8061)||0x0,_0x25f7ca=_0x1a0a67[_0x17c7ea]||_0x1a0a67[_0x1a0a67[_0x5b78b0(0x20b)]-0x1];_0x3b37d2[_0x5b78b0(0x209)](_0xfe8061,_0x17c7ea+0x1),_0x4e197d=_0x25f7ca,_0x14b788[_0x5b78b0(0x124)](_0x4e197d),_0x2741fc[_0x5b78b0(0x209)](_0x2a84e9,_0x4e197d);const _0x58e3ee=await resolveRuleSegmentRefs(_0x223a05,async _0xd99ee0=>{const _0x569c7f=_0x5b78b0,_0x3552cf=_0x2741fc[_0x569c7f(0x19e)](_0xd99ee0);if(_0x3552cf)return _0x3552cf;const _0x3d3208=await _0x36aeac['resolveSegment'](_0xd99ee0);return _0x3d3208[_0x569c7f(0x1d4)];});_0x379274={'description':_0x152903['description'],'rule':_0x58e3ee};}else{const _0x41c02c=_0x20dda4[_0x5b78b0(0x19e)](_0xfe8061);if(_0x41c02c)_0x4e197d=_0x41c02c,_0x2741fc[_0x5b78b0(0x209)](_0x2a84e9,_0x4e197d);else{if(_0x124ce1){let _0x3c5777=_0x124ce1,_0x128eca=0x2;while(_0x14b788[_0x5b78b0(0x125)](_0x3c5777)||_0x558279[_0x5b78b0(0x125)](_0x3c5777)){_0x3c5777=_0x124ce1+'_'+_0x128eca,_0x128eca++;}_0x14b788[_0x5b78b0(0x124)](_0x3c5777),_0x4e197d=_0x3c5777;}_0x2741fc['set'](_0x2a84e9,_0x4e197d),_0x20dda4[_0x5b78b0(0x209)](_0xfe8061,_0x4e197d);const _0x394799=await resolveRuleSegmentRefs(_0x223a05,async _0x440792=>{const _0x212dd=_0x5b78b0,_0x33c7c8=_0x2741fc[_0x212dd(0x19e)](_0x440792);if(_0x33c7c8)return _0x33c7c8;const _0x2ac78e=await _0x36aeac[_0x212dd(0x145)](_0x440792);return _0x2ac78e['name'];});_0x379274={'description':_0x152903['description'],'rule':_0x394799};}}}return{'name':_0x4e197d,'isJourneyLocal':_0x46c581,'definition':_0x379274};}catch(_0x230e0a){return logger[_0x5b78b0(0x156)](_0x5b78b0(0x1b8)+_0x2a84e9+':\x20'+_0x230e0a),{'name':_0x2a84e9,'isJourneyLocal':![]};}},'resolveActivation':async _0x5dde77=>{const _0x4d544f=a152_0x2e8d,_0x1efcf3=_0x1625bb[_0x4d544f(0x19e)](_0x5dde77);if(_0x1efcf3!==undefined)return{'name':_0x1efcf3,'isJourneyLocal':!![]};try{let _0x5a05f3=_0x1d71f7?.[_0x4d544f(0x19e)](_0x5dde77);!_0x5a05f3&&(_0x5a05f3=await _0x5b3555[_0x4d544f(0x1b0)]['getActivation'](_0x464a83,_0x5dde77));const _0x2d23ab=_0x5a05f3[_0x4d544f(0x1b2)][_0x4d544f(0x173)]['name']||_0x5dde77,_0x3ced00=sanitizeYamlKey(_0x2d23ab)||'activation_'+_0x5dde77,_0x5d177e=_0x3ced00;_0x1625bb[_0x4d544f(0x209)](_0x5dde77,_0x5d177e);const _0x25aa22=journeyActivationStepToYaml(_0x5a05f3,_0x5723ed,_0x27a9b3);return{'name':_0x5d177e,'isJourneyLocal':!![],'definition':_0x25aa22};}catch(_0x52bb13){return logger[_0x4d544f(0x156)](_0x4d544f(0x17b)+_0x5dde77+':\x20'+_0x52bb13),{'name':_0x5dde77,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5be62c,_0x1aa749)=>resolveJumpTarget(_0x5be62c,_0x1aa749,_0xdb7b29,async _0x4b836f=>{const _0x329559=a152_0x2e8d,_0x4897fc=_0x45cd74?.[_0x329559(0x19e)](_0x4b836f);if(_0x4897fc)return _0x4897fc;return _0x5b3555[_0x329559(0x1b0)]['getJourney'](_0x4b836f);})};return _0x36aeac=_0x278aca,_0x278aca;},_0x41bbec=async _0x1aee03=>{const _0x13a61d=a152_0x2e8d,{collectSegmentIdsFromJourneyApi:_0x4b5841}=await import(_0x13a61d(0x178)),{batchAsync:_0xbea94b}=await import(_0x13a61d(0x13d)),_0x28f79d=new Set();for(const _0x103ffb of _0x1aee03){let _0x43d8e8=_0x45cd74?.['get'](_0x103ffb);!_0x43d8e8&&(_0x43d8e8=await _0x5b3555['journey'][_0x13a61d(0x1a4)](_0x103ffb));const _0x12444b=_0x4b5841(_0x43d8e8);for(const _0x8080b1 of _0x12444b){_0x28f79d[_0x13a61d(0x124)](_0x8080b1);}}let _0x1b0b7e=Array[_0x13a61d(0x1f3)](_0x28f79d);while(_0x1b0b7e[_0x13a61d(0x20b)]>0x0){const _0x1900ae=_0x1b0b7e['filter'](_0x3ececd=>!_0x4ea167['has'](_0x3ececd));if(_0x1900ae['length']===0x0)break;const _0x3828c8=await _0xbea94b(_0x1900ae,async _0x471ca3=>{const _0x46d08a=_0x13a61d;_0x4ea167[_0x46d08a(0x124)](_0x471ca3);const _0x287198=await fetchSegment(_0x5b3555,_0x49342a,_0x471ca3,_0x544287);if(!_0x287198)return null;return{'segmentId':_0x471ca3,'segment':_0x287198};},0xa),_0x11a100=new Set();for(const _0x45469d of _0x3828c8){if(!_0x45469d?.[_0x13a61d(0x13a)]?.[_0x13a61d(0x16f)])continue;const _0x28b501=apiRuleToYaml(_0x45469d['segment'][_0x13a61d(0x16f)]);_0x29ab43['set'](_0x45469d['segmentId'],_0x28b501);const _0x527e10=collectSegmentRefsFromRule(_0x28b501);for(const _0x4d9e98 of _0x527e10){!_0x4ea167['has'](_0x4d9e98)&&_0x11a100[_0x13a61d(0x124)](_0x4d9e98);}}_0x1b0b7e=Array[_0x13a61d(0x1f3)](_0x11a100);}};return{'createYamlContext':_0x312913,'prefetchJourneySegments':_0x41bbec};}export async function executePushSegments(_0x4f8936,_0x3f5073,_0x5cb37a,_0x4dd702,_0x1a56e0){const _0x3525b0=a152_0x279d28,{segmentDefToCreateRequest:_0x446b6a,segmentDefToUpdateRequest:_0x33a493}=await import(_0x3525b0(0x1f8)),_0x1aeb75=_0x5cb37a[_0x3525b0(0x15d)],_0xea9d0d=0x5,_0x1dcdfe=async _0x596405=>{const _0x356e70=_0x3525b0,_0x34a082=_0x596405[_0x356e70(0x14b)]?_0x1aeb75['get'](_0x596405[_0x356e70(0x14b)]):undefined;let _0x4c50cf;const _0x24f008={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x20eeec=_0x596405[_0x356e70(0x183)];if(_0x596405[_0x356e70(0x183)][_0x356e70(0x16f)]){const _0x26d6dc=createSegmentIdResolver(_0x5cb37a[_0x356e70(0x119)],_0x596405[_0x356e70(0x183)][_0x356e70(0x1d4)]),_0x418db4=await resolveRuleSegmentIds(_0x596405['yamlConfig'][_0x356e70(0x16f)],_0x26d6dc);_0x20eeec={..._0x596405[_0x356e70(0x183)],'rule':_0x418db4};}try{if(_0x596405[_0x356e70(0x208)]){_0x1a56e0[_0x356e70(0x18d)]?.({'type':_0x356e70(0x182),'name':_0x596405[_0x356e70(0x183)]['name']});const _0x481f1c=_0x446b6a(_0x20eeec,_0x34a082),_0x3f5e86=await _0x1a56e0[_0x356e70(0x168)](_0x356e70(0x157)+_0x596405[_0x356e70(0x183)]['name']+_0x356e70(0x1b6),()=>_0x4f8936['segment'][_0x356e70(0x207)](_0x4dd702['parentId'],_0x481f1c));_0x4c50cf=_0x3f5e86[_0x356e70(0x11b)]['id'],_0x5cb37a[_0x356e70(0x119)][_0x356e70(0x209)](_0x596405['yamlConfig']['name'],_0x4c50cf),_0x24f008[_0x356e70(0x160)]={'name':_0x596405[_0x356e70(0x183)]['name'],'id':_0x4c50cf},_0x1a56e0['onProgress']?.({'type':'segment_created','name':_0x596405[_0x356e70(0x183)][_0x356e70(0x1d4)],'segmentId':_0x4c50cf}),_0x1a56e0['logSuccess']?.(_0x356e70(0x193)+_0x596405[_0x356e70(0x183)][_0x356e70(0x1d4)]+'\x27'),_0x24f008[_0x356e70(0x1ca)]=0x1;}else{if(_0x596405['hasChanges']){_0x1a56e0['onProgress']?.({'type':_0x356e70(0x118),'name':_0x596405[_0x356e70(0x183)][_0x356e70(0x1d4)]});const _0xff86a7=_0x33a493(_0x20eeec);_0x34a082!==_0x596405[_0x356e70(0x214)]?.[_0x356e70(0x14e)]&&(_0xff86a7[_0x356e70(0x14e)]=_0x34a082?parseInt(_0x34a082,0xa):undefined),await _0x1a56e0[_0x356e70(0x168)]('Updating\x20segment\x20\x27'+_0x596405['yamlConfig']['name']+_0x356e70(0x1b6),()=>_0x4f8936[_0x356e70(0x13a)][_0x356e70(0x1e9)](_0x4dd702[_0x356e70(0x184)],_0x596405[_0x356e70(0x214)]['id'],_0xff86a7)),_0x4c50cf=_0x596405[_0x356e70(0x214)]['id'],_0x1a56e0[_0x356e70(0x18d)]?.({'type':_0x356e70(0x11d),'name':_0x596405[_0x356e70(0x183)][_0x356e70(0x1d4)]}),_0x1a56e0[_0x356e70(0x122)]?.(_0x356e70(0x17f)+_0x596405[_0x356e70(0x183)][_0x356e70(0x1d4)]+'\x27'),_0x24f008[_0x356e70(0x20c)]=0x1;}else _0x4c50cf=_0x596405[_0x356e70(0x214)]['id'];}}catch(_0x4b9291){const _0xd1ff80=isHttp400Error(_0x4b9291),_0x4a4807=_0xd1ff80?ErrorCode[_0x356e70(0x139)]:ErrorCode[_0x356e70(0x1a2)],_0x3428f6=getErrorMessage(_0x4b9291);throw new SDKError(_0x4a4807,'Failed\x20to\x20'+(_0x596405['isNew']?_0x356e70(0x1c4):_0x356e70(0x1b4))+_0x356e70(0x1d2)+_0x596405[_0x356e70(0x1c8)]+_0x356e70(0x1f9)+_0x3428f6,_0x4b9291);}try{const _0x45f0d9=await syncActivationsForSegment(_0x4f8936,_0x4dd702[_0x356e70(0x184)],_0x4c50cf,_0x596405['yamlConfig'][_0x356e70(0x1d4)],_0x596405[_0x356e70(0x167)],_0x1a56e0,_0x596405[_0x356e70(0x1c8)]);_0x24f008[_0x356e70(0x203)]=_0x45f0d9;}catch(_0x192422){if(_0x192422 instanceof SDKError)throw _0x192422;throw new SDKError(ErrorCode[_0x356e70(0x204)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x596405['yamlConfig'][_0x356e70(0x1d4)]+_0x356e70(0x19f)+_0x596405['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x192422),_0x192422);}return _0x24f008;},_0x40041b=await batchAsync(_0x3f5073,_0x1dcdfe,_0xea9d0d),_0x318c09={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x258e73 of _0x40041b){_0x318c09['created']+=_0x258e73['created'],_0x318c09[_0x3525b0(0x20c)]+=_0x258e73[_0x3525b0(0x20c)],_0x258e73[_0x3525b0(0x160)]&&_0x318c09[_0x3525b0(0x169)][_0x3525b0(0x209)](_0x258e73[_0x3525b0(0x160)][_0x3525b0(0x1d4)],_0x258e73[_0x3525b0(0x160)]['id']),_0x318c09[_0x3525b0(0x203)][_0x3525b0(0x1ca)]+=_0x258e73[_0x3525b0(0x203)][_0x3525b0(0x1ca)],_0x318c09['activations'][_0x3525b0(0x20c)]+=_0x258e73[_0x3525b0(0x203)][_0x3525b0(0x20c)],_0x318c09[_0x3525b0(0x203)][_0x3525b0(0x12e)]+=_0x258e73[_0x3525b0(0x203)][_0x3525b0(0x12e)];}return _0x318c09;}async function syncActivationsForSegment(_0xbe12f6,_0x42fe60,_0x1385f6,_0x270e8f,_0x5e5105,_0x44d85c,_0x335ce3){const _0x1d4601=a152_0x279d28,_0x4ef201={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x454b45 of _0x5e5105){try{if(_0x454b45['type']==='create'&&_0x454b45[_0x1d4601(0x192)])_0x44d85c['onProgress']?.({'type':_0x1d4601(0x18a),'segmentName':_0x270e8f,'activationName':_0x454b45['name']}),await _0x44d85c[_0x1d4601(0x168)](_0x1d4601(0x143)+_0x454b45[_0x1d4601(0x1d4)]+_0x1d4601(0x1b6),()=>_0xbe12f6[_0x1d4601(0x13a)][_0x1d4601(0x1de)](_0x42fe60,_0x1385f6,_0x454b45['validatedRequest'])),_0x44d85c[_0x1d4601(0x18d)]?.({'type':_0x1d4601(0x130),'segmentName':_0x270e8f,'activationName':_0x454b45['name']}),_0x44d85c['logSuccess']?.(_0x1d4601(0x127)+_0x454b45['name']+'\x27'),_0x4ef201[_0x1d4601(0x1ca)]++;else{if(_0x454b45[_0x1d4601(0x186)]===_0x1d4601(0x1b4)&&_0x454b45['validatedRequest']&&_0x454b45['existingActivation'])_0x44d85c[_0x1d4601(0x18d)]?.({'type':_0x1d4601(0x12b),'segmentName':_0x270e8f,'activationName':_0x454b45[_0x1d4601(0x1d4)]}),await _0x44d85c[_0x1d4601(0x168)](_0x1d4601(0x1d5)+_0x454b45[_0x1d4601(0x1d4)]+_0x1d4601(0x1b6),()=>_0xbe12f6[_0x1d4601(0x13a)][_0x1d4601(0x195)](_0x42fe60,_0x1385f6,_0x454b45[_0x1d4601(0x1f6)]['id'],_0x454b45['validatedRequest'])),_0x44d85c[_0x1d4601(0x18d)]?.({'type':_0x1d4601(0x15a),'segmentName':_0x270e8f,'activationName':_0x454b45[_0x1d4601(0x1d4)]}),_0x44d85c[_0x1d4601(0x122)]?.('Updated\x20activation\x20\x27'+_0x454b45['name']+'\x27'),_0x4ef201['updated']++;else _0x454b45[_0x1d4601(0x186)]===_0x1d4601(0x197)&&_0x454b45[_0x1d4601(0x1f6)]&&(_0x44d85c[_0x1d4601(0x18d)]?.({'type':_0x1d4601(0x138),'segmentName':_0x270e8f,'activationName':_0x454b45['name']}),await _0x44d85c[_0x1d4601(0x168)](_0x1d4601(0x13c)+_0x454b45[_0x1d4601(0x1d4)]+'\x27...',()=>_0xbe12f6[_0x1d4601(0x13a)][_0x1d4601(0x1ac)](_0x42fe60,_0x1385f6,_0x454b45['existingActivation']['id'])),_0x44d85c[_0x1d4601(0x18d)]?.({'type':_0x1d4601(0x1a8),'segmentName':_0x270e8f,'activationName':_0x454b45[_0x1d4601(0x1d4)]}),_0x44d85c[_0x1d4601(0x1e8)]?.(_0x1d4601(0x172)+_0x454b45[_0x1d4601(0x1d4)]+'\x27'),_0x4ef201[_0x1d4601(0x12e)]++);}}catch(_0x59ec69){const _0xb592e7=isHttp400Error(_0x59ec69),_0x5cf0dd=_0xb592e7?ErrorCode[_0x1d4601(0x189)]:ErrorCode[_0x1d4601(0x204)],_0x36efcf=getErrorMessage(_0x59ec69);throw new SDKError(_0x5cf0dd,'Failed\x20to\x20'+_0x454b45[_0x1d4601(0x186)]+_0x1d4601(0x19a)+_0x454b45[_0x1d4601(0x1d4)]+_0x1d4601(0x19f)+_0x335ce3+_0x1d4601(0x1f9)+_0x36efcf,_0x59ec69);}}return _0x4ef201;}export async function executePushFolders(_0x1d5fb0,_0x4833ed,_0x2db330,_0x190bbc,_0x20b509){const _0x2e69ae=a152_0x279d28,_0x1e61b4=new Map(_0x2db330),_0x1a8ae3=sortFoldersByDepth(_0x4833ed);for(const _0x1b4bff of _0x1a8ae3){const _0x5c470b=_0x1b4bff[_0x2e69ae(0x121)]('/'),_0x45493e=_0x5c470b[_0x5c470b[_0x2e69ae(0x20b)]-0x1],_0x5032d3=_0x5c470b[_0x2e69ae(0x20a)](0x0,-0x1)[_0x2e69ae(0x1c1)]('/'),_0x30e979=_0x1e61b4[_0x2e69ae(0x19e)](_0x5032d3);_0x20b509[_0x2e69ae(0x18d)]?.({'type':_0x2e69ae(0x14d),'folder':_0x1b4bff});const _0x1e52f5={'name':_0x45493e,'parentFolderId':_0x30e979},_0x4b9471=await _0x20b509['withProgress'](_0x2e69ae(0x177)+_0x1b4bff+_0x2e69ae(0x1b6),()=>_0x1d5fb0[_0x2e69ae(0x13a)][_0x2e69ae(0x215)](_0x190bbc['parentId'],_0x1e52f5));_0x1e61b4[_0x2e69ae(0x209)](_0x1b4bff,_0x4b9471[_0x2e69ae(0x11b)]['id']),_0x20b509[_0x2e69ae(0x18d)]?.({'type':_0x2e69ae(0x1db),'folder':_0x1b4bff,'folderId':_0x4b9471['data']['id']}),_0x20b509['logInfo']?.('Created\x20folder\x20\x27'+_0x1b4bff+'\x27');}return _0x1e61b4;}export async function executePushSegmentDeletions(_0x245397,_0x56a21a,_0x2120c9){const _0x395dc7=a152_0x279d28;if(_0x56a21a['length']===0x0)return 0x0;const {batchAsync:_0x224fdf}=await import(_0x395dc7(0x13d)),_0x2217e1=0x5,_0x3ae598=await _0x224fdf(_0x56a21a,async _0x15c6c7=>{const _0x33b4f6=_0x395dc7;return _0x2120c9[_0x33b4f6(0x18d)]?.({'type':_0x33b4f6(0x159),'name':_0x15c6c7[_0x33b4f6(0x1d4)]}),await _0x245397[_0x33b4f6(0x13a)][_0x33b4f6(0x170)](_0x15c6c7['id']),_0x2120c9[_0x33b4f6(0x18d)]?.({'type':_0x33b4f6(0x149),'name':_0x15c6c7[_0x33b4f6(0x1d4)]}),_0x2120c9[_0x33b4f6(0x1e8)]?.(_0x33b4f6(0x21a)+_0x15c6c7[_0x33b4f6(0x1d4)]+'\x27'),0x1;},_0x2217e1);return _0x3ae598[_0x395dc7(0x1bb)]((_0x53e28f,_0x36e130)=>_0x53e28f+_0x36e130,0x0);}export async function executePushJourneys(_0x28b74e,_0xab16c2,_0x377e4,_0x87675e,_0x30ad18){const _0xc4944c=a152_0x279d28,{journeyDefToRequest:_0x2966fc}=await import(_0xc4944c(0x178)),{activationDefToCreateRequest:_0x3ca10e,yamlRuleToApi:_0xb2c72,validateSegmentRule:_0x1b61aa}=await import('./child-segment-yaml.js'),_0x38966f={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4bffee=new Map(_0x377e4[_0xc4944c(0x119)]),_0x49a817=0x5;for(let _0x2c797d=0x0;_0x2c797d<_0xab16c2[_0xc4944c(0x20b)];_0x2c797d+=_0x49a817){const _0x3d80d7=_0xab16c2['slice'](_0x2c797d,_0x2c797d+_0x49a817),_0x3b84ee=await Promise['all'](_0x3d80d7[_0xc4944c(0x191)](async _0x372bb2=>{const _0xb71ae=_0xc4944c;if(!_0x372bb2[_0xb71ae(0x208)]&&!_0x372bb2['hasChanges'])return{'action':'unchanged','name':_0x372bb2[_0xb71ae(0x183)][_0xb71ae(0x1d4)],'journeyId':_0x372bb2[_0xb71ae(0x1ba)]?.['id']};const _0x43295f=_0x372bb2[_0xb71ae(0x14b)]?_0x377e4[_0xb71ae(0x15d)][_0xb71ae(0x19e)](_0x372bb2[_0xb71ae(0x14b)]):undefined;_0x30ad18[_0xb71ae(0x18d)]?.({'type':_0x372bb2[_0xb71ae(0x208)]?'journey_creating':_0xb71ae(0x1c3),'name':_0x372bb2[_0xb71ae(0x183)]['name']});try{const _0x175202=await executeSingleJourneyPush(_0x28b74e,_0x372bb2,{..._0x377e4,'segmentNameToId':_0x4bffee},{'parentId':_0x87675e[_0xb71ae(0x184)],'rootFolderId':_0x87675e[_0xb71ae(0x1fc)],'folderId':_0x43295f,'verbose':_0x87675e[_0xb71ae(0x188)]},_0x30ad18,{'journeyDefToRequest':_0x2966fc,'activationDefToCreateRequest':_0x3ca10e,'yamlRuleToApi':_0xb2c72,'validateSegmentRule':_0x1b61aa});for(const [_0x2f83a3,_0x56f4c1]of _0x175202[_0xb71ae(0x205)]){_0x4bffee['set'](_0x2f83a3,_0x56f4c1),_0x38966f[_0xb71ae(0x205)][_0xb71ae(0x209)](_0x2f83a3,_0x56f4c1);}if(_0x175202['action']===_0xb71ae(0x1ca))_0x30ad18['onProgress']?.({'type':'journey_created','name':_0x372bb2['yamlConfig'][_0xb71ae(0x1d4)],'journeyId':_0x175202[_0xb71ae(0x163)]}),_0x30ad18['logSuccess']?.(_0xb71ae(0x1cc)+_0x372bb2[_0xb71ae(0x183)][_0xb71ae(0x1d4)]+'\x27'),_0x38966f[_0xb71ae(0x1ca)]++;else _0x175202[_0xb71ae(0x1aa)]===_0xb71ae(0x20c)&&(_0x30ad18[_0xb71ae(0x18d)]?.({'type':_0xb71ae(0x1e4),'name':_0x372bb2[_0xb71ae(0x183)][_0xb71ae(0x1d4)]}),_0x30ad18[_0xb71ae(0x122)]?.('Updated\x20journey\x20\x27'+_0x372bb2[_0xb71ae(0x183)][_0xb71ae(0x1d4)]+'\x27'),_0x38966f[_0xb71ae(0x20c)]++);return{'action':_0x175202[_0xb71ae(0x1aa)],'name':_0x372bb2['yamlConfig'][_0xb71ae(0x1d4)],'journeyId':_0x175202['journeyId']};}catch(_0x3a8729){const _0x308ec5=isHttp400Error(_0x3a8729),_0x6bff76=_0x308ec5?ErrorCode[_0xb71ae(0x162)]:ErrorCode[_0xb71ae(0x1d3)],_0x524ff6=getErrorMessage(_0x3a8729);throw new SDKError(_0x6bff76,'Failed\x20to\x20'+(_0x372bb2[_0xb71ae(0x208)]?_0xb71ae(0x1c4):_0xb71ae(0x1b4))+_0xb71ae(0x16d)+_0x372bb2[_0xb71ae(0x1c8)]+_0xb71ae(0x1f9)+_0x524ff6,_0x3a8729);}}));_0x38966f[_0xc4944c(0x1b5)][_0xc4944c(0x1ff)](..._0x3b84ee);}return _0x38966f;}async function matchExistingJourneySegments(_0x28d5e9,_0x277fff,_0x57c851,_0x14c963,_0x36d926){const _0x4fad3d=a152_0x279d28;if(!_0x277fff[_0x4fad3d(0x1ba)]||!_0x277fff[_0x4fad3d(0x183)][_0x4fad3d(0x1fd)])return;const _0x36fdde=new Map(),_0x2fc0ff=new Set();for(const _0x268690 of Object[_0x4fad3d(0x1dd)](_0x277fff[_0x4fad3d(0x183)][_0x4fad3d(0x1fd)])){const _0x4f2b33=generateDeterministicJourneySegmentName(_0x277fff[_0x4fad3d(0x183)][_0x4fad3d(0x1d4)],_0x268690);_0x36fdde[_0x4fad3d(0x209)](_0x4f2b33,_0x268690),_0x2fc0ff[_0x4fad3d(0x124)](_0x268690);}const _0x3bd98c=[],_0x1d6519=collectSegmentIdsFromJourneyApi(_0x277fff[_0x4fad3d(0x1ba)]);for(const _0x5be44c of _0x1d6519){const _0x36bc3c=await fetchSegment(_0x28d5e9,_0x57c851,_0x5be44c,_0x14c963);if(!_0x36bc3c?.[_0x4fad3d(0x1d4)])continue;const _0x2a3505=_0x36fdde[_0x4fad3d(0x19e)](_0x36bc3c[_0x4fad3d(0x1d4)]);_0x2a3505?(_0x36d926[_0x4fad3d(0x209)](_0x2a3505,_0x5be44c),_0x2fc0ff['delete'](_0x2a3505)):_0x3bd98c['push']({'id':_0x5be44c,'seg':_0x36bc3c});}if(_0x2fc0ff[_0x4fad3d(0x1cd)]>0x0&&_0x3bd98c['length']>0x0){const {localExpandedRuleToNames:_0x1d2144}=buildLocalExpandedRuleMappings(_0x277fff[_0x4fad3d(0x183)]),_0x47cb51=new Map();for(const {id:_0x1f3165,seg:_0x597c69}of _0x3bd98c){if(_0x597c69[_0x4fad3d(0x16f)]){const _0x21e0e8=apiRuleToYaml(_0x597c69['rule']);_0x47cb51[_0x4fad3d(0x209)](_0x1f3165,_0x21e0e8);}}for(const {id:_0x4c6649,seg:_0x5c7726}of _0x3bd98c){if(!_0x5c7726[_0x4fad3d(0x16f)])continue;const _0x408791=_0x47cb51[_0x4fad3d(0x19e)](_0x4c6649);if(!_0x408791)continue;const _0x9ce83e=serializeExpandedRule(_0x408791,_0x47cb51),_0x4935d4=_0x1d2144[_0x4fad3d(0x19e)](_0x9ce83e);if(_0x4935d4){const _0x36b9af=_0x4935d4[_0x4fad3d(0x1e1)](_0xa765cc=>_0x2fc0ff[_0x4fad3d(0x125)](_0xa765cc));_0x36b9af&&(_0x36d926[_0x4fad3d(0x209)](_0x36b9af,_0x4c6649),_0x2fc0ff[_0x4fad3d(0x197)](_0x36b9af),logger[_0x4fad3d(0x156)]('Matched\x20server\x20segment\x20\x27'+_0x5c7726[_0x4fad3d(0x1d4)]+_0x4fad3d(0x123)+_0x36b9af+_0x4fad3d(0x194)));}}}}async function executeSingleJourneyPush(_0x317d89,_0x2dc079,_0x3faf25,_0x4b1e4f,_0x569941,_0x1fc5b9){const _0x431f4c=a152_0x279d28,{journeyDefToRequest:_0x1cac98,activationDefToCreateRequest:_0x1f0af7,yamlRuleToApi:_0xbf1cda,validateSegmentRule:_0x195587}=_0x1fc5b9,_0x2ff304=new Map(),_0xe1d711=new Map();recoverSegmentIdsFromPushRecovery(_0x2dc079,_0x2ff304,_0x3faf25[_0x431f4c(0x119)]);const _0x44f329=new Map(),_0x55d36f=new Map(),_0x218c72=new Map();let _0x1214c5;const _0x1b5ba2=async()=>{const _0x485767=_0x431f4c;if(_0x1214c5)return;_0x1214c5=new Map();if(!_0x2dc079['existingJourney'])return;const _0x4eadc6=await _0x317d89[_0x485767(0x1b0)][_0x485767(0x1a3)](_0x2dc079[_0x485767(0x1ba)]['id']);for(const _0x35f6f8 of _0x4eadc6){const _0x649259=journeyActivationStepToYaml(_0x35f6f8,_0x3faf25[_0x485767(0x153)],_0x3faf25[_0x485767(0x11a)]),_0x1e326c=activationSignature(_0x649259);!_0x1214c5['has'](_0x1e326c)&&_0x1214c5[_0x485767(0x209)](_0x1e326c,_0x35f6f8['id']),_0x649259[_0x485767(0x1d4)]&&_0xe1d711[_0x485767(0x209)](_0x649259['name'],_0x35f6f8['id']);}};await matchExistingJourneySegments(_0x317d89,_0x2dc079,_0x4b1e4f['parentId'],_0x3faf25['existingSegments'],_0x3faf25['segmentNameToId']);const _0x33be1f={'resolveSegmentId':async _0x461c4d=>{const _0x453ea0=_0x431f4c,_0x3e638f=_0x3faf25[_0x453ea0(0x119)]['get'](_0x461c4d);if(!_0x3e638f)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x453ea0(0x12f)+_0x461c4d+_0x453ea0(0x151)+_0x2dc079[_0x453ea0(0x183)][_0x453ea0(0x1d4)]+')');return _0x3e638f;},'resolveEmbeddedSegmentId':async(_0x71d014,_0x232944)=>{const _0x84ee77=_0x431f4c,_0x1d2ee9=_0x3faf25[_0x84ee77(0x119)][_0x84ee77(0x19e)](_0x71d014);if(_0x1d2ee9)return _0x1d2ee9;const _0x207b40=_0x3faf25['existingSegments'][_0x84ee77(0x1e1)](_0x477723=>_0x477723[_0x84ee77(0x1d4)]===_0x71d014);if(_0x207b40)return _0x3faf25[_0x84ee77(0x119)][_0x84ee77(0x209)](_0x71d014,_0x207b40['id']),_0x207b40['id'];if(_0x2dc079['isNew']){const {stageName:_0x3f553c,criteriaName:_0x45ea2b}=findSegmentCriteriaLocation(_0x2dc079[_0x84ee77(0x183)],_0x71d014);return _0x195587(_0x71d014,_0x232944[_0x84ee77(0x16f)]),_0x55d36f['set'](_0x71d014,{'definition':_0x232944,'stageName':_0x3f553c,'criteriaName':_0x45ea2b}),createPendingSegmentId(_0x71d014);}const _0x3f6769=_0x2dc079[_0x84ee77(0x1ba)]?.['id'];if(!_0x3f6769)throw new SDKError(ErrorCode[_0x84ee77(0x12a)],_0x84ee77(0x1df));const _0x22bc15=_0x44f329[_0x84ee77(0x19e)](_0x71d014);if(_0x22bc15)return _0x22bc15;const _0x1bfe42=((async()=>{const _0x33fcf8=_0x84ee77;_0x195587(_0x71d014,_0x232944[_0x33fcf8(0x16f)]);const _0x1f0038=generateDeterministicJourneySegmentName(_0x2dc079[_0x33fcf8(0x183)]['name'],_0x71d014),_0x5a4f30=_0x3faf25['existingSegments'][_0x33fcf8(0x1e1)](_0xd561a9=>_0xd561a9[_0x33fcf8(0x1d4)]===_0x1f0038),_0x20fab4=createSegmentIdResolver(_0x3faf25[_0x33fcf8(0x119)],_0x71d014),_0x47188b=await resolveRuleSegmentIds(_0x232944['rule'],_0x20fab4);let _0xd70a7c;return _0x5a4f30?(await _0x317d89[_0x33fcf8(0x13a)]['updateSegmentById'](_0x4b1e4f[_0x33fcf8(0x184)],_0x5a4f30['id'],{'description':_0x232944['description']||_0x33fcf8(0x1a7)+_0x71d014,'rule':_0xbf1cda(_0x47188b),'countPopulation':!![]}),_0xd70a7c=_0x5a4f30['id'],saveSegmentToPushRecovery(_0x2dc079[_0x33fcf8(0x1c8)],_0x2dc079[_0x33fcf8(0x183)][_0x33fcf8(0x1d4)],_0x71d014,{'segmentId':_0xd70a7c,'uniqueServerName':_0x1f0038,'createdAt':new Date()[_0x33fcf8(0x11e)]()})):_0xd70a7c=await createOrRecoverEmbeddedSegment(_0x317d89,_0x2dc079,{'localName':_0x71d014,'uniqueSegmentName':_0x1f0038,'description':_0x232944[_0x33fcf8(0x1e6)]||_0x33fcf8(0x1a7)+_0x71d014,'journeyId':_0x3f6769,'resolvedRule':_0x47188b,'parentId':_0x4b1e4f[_0x33fcf8(0x184)],'folderId':_0x4b1e4f[_0x33fcf8(0x1fc)]||''},_0xbf1cda),_0x3faf25[_0x33fcf8(0x119)]['set'](_0x71d014,_0xd70a7c),_0x2ff304[_0x33fcf8(0x209)](_0x71d014,_0xd70a7c),_0xd70a7c;})());_0x44f329['set'](_0x71d014,_0x1bfe42);try{return await _0x1bfe42;}finally{_0x44f329[_0x84ee77(0x197)](_0x71d014);}},'resolveActivationId':async _0x5d0da6=>{const _0x1c35c0=_0x431f4c,_0x34f86a=_0xe1d711[_0x1c35c0(0x19e)](_0x5d0da6);if(_0x34f86a)return _0x34f86a;if(_0x2dc079[_0x1c35c0(0x1ba)]){await _0x1b5ba2();const _0x32421a=_0xe1d711['get'](_0x5d0da6);if(_0x32421a)return _0x32421a;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x1c35c0(0x187)+_0x5d0da6+'\x20(referenced\x20in\x20journey\x20'+_0x2dc079['yamlConfig'][_0x1c35c0(0x1d4)]+_0x1c35c0(0x158)+_0x1c35c0(0x133));},'resolveEmbeddedActivationId':async(_0x5055d4,_0x33efa2)=>{const _0x4be9d1=_0x431f4c,_0x189ffd=_0xe1d711[_0x4be9d1(0x19e)](_0x5055d4);if(_0x189ffd)return _0x189ffd;if(_0x2dc079[_0x4be9d1(0x208)])return _0x218c72[_0x4be9d1(0x209)](_0x5055d4,_0x33efa2),createPendingActivationId(_0x5055d4);if(_0x2dc079[_0x4be9d1(0x1ba)]){await _0x1b5ba2();const _0x56c892=_0xe1d711[_0x4be9d1(0x19e)](_0x33efa2[_0x4be9d1(0x1d4)]);if(_0x56c892)return _0xe1d711[_0x4be9d1(0x209)](_0x5055d4,_0x56c892),_0x56c892;const _0x50829d=activationSignature(_0x33efa2),_0x323b50=_0x1214c5?.[_0x4be9d1(0x19e)](_0x50829d);if(_0x323b50)return _0xe1d711[_0x4be9d1(0x209)](_0x5055d4,_0x323b50),_0x323b50;const _0x515bb3=await _0x1f0af7(_0x33efa2,_0x3faf25[_0x4be9d1(0x12d)]),_0x421b74={..._0x515bb3,..._0x33efa2['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x33efa2[_0x4be9d1(0x120)]}},_0x35e166=await _0x317d89[_0x4be9d1(0x1b0)]['createActivation'](_0x2dc079[_0x4be9d1(0x1ba)]['id'],_0x421b74);return _0xe1d711[_0x4be9d1(0x209)](_0x5055d4,_0x35e166['id']),_0x35e166['id'];}throw new SDKError(ErrorCode[_0x4be9d1(0x12a)],_0x4be9d1(0x140));},'resolveJourneyId':async _0x10a4f2=>{const _0x2b2088=_0x431f4c;try{return await _0x317d89[_0x2b2088(0x1b0)][_0x2b2088(0x179)](_0x4b1e4f[_0x2b2088(0x184)],_0x10a4f2);}catch(_0x326334){throw new SDKError(ErrorCode[_0x2b2088(0x1d8)],_0x2b2088(0x1ee)+_0x10a4f2+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2dc079[_0x2b2088(0x183)][_0x2b2088(0x1d4)]+'\x27)',_0x326334);}},'resolveStageId':async(_0x47ee5e,_0x5825ec)=>{const _0x561c99=_0x431f4c,_0xc148e6=await _0x317d89[_0x561c99(0x1b0)]['getJourney'](_0x47ee5e),_0x1e9ccb=_0xc148e6[_0x561c99(0x1b2)][_0x561c99(0x15f)][_0x561c99(0x1e1)](_0x4f10bf=>_0x4f10bf[_0x561c99(0x1d4)][_0x561c99(0x117)]()===_0x5825ec[_0x561c99(0x117)]());if(!_0x1e9ccb?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x561c99(0x152)+_0x5825ec+_0x561c99(0x1e3)+(_0xc148e6[_0x561c99(0x1b2)][_0x561c99(0x1c5)]||_0xc148e6[_0x561c99(0x1b2)][_0x561c99(0x1d4)])+'\x27');return _0x1e9ccb['id'];}},_0x5bd135=await _0x1cac98(_0x2dc079[_0x431f4c(0x183)],_0x4b1e4f['parentId'],_0x33be1f),_0x1d1eae=_0x4b1e4f[_0x431f4c(0x161)]||_0x4b1e4f[_0x431f4c(0x1fc)];_0x1d1eae&&(_0x5bd135['relationships']={'parentFolder':{'data':{'id':_0x1d1eae,'type':'folder'}}});if(_0x2dc079[_0x431f4c(0x208)]){if(_0x55d36f[_0x431f4c(0x1cd)]>0x0||_0x218c72[_0x431f4c(0x1cd)]>0x0)return await executeThreeStepJourneyCreate(_0x317d89,_0x2dc079,_0x5bd135,{'pendingEmbeddedSegments':_0x55d36f,'pendingEmbeddedActivations':_0x218c72,'embeddedSegmentNameToId':_0x2ff304,'journeyActivationNameToId':_0xe1d711},{..._0x4b1e4f,'effectiveFolderId':_0x1d1eae},_0x3faf25,_0x569941,_0x1fc5b9);else{ensureJourneyDefaults(_0x5bd135[_0x431f4c(0x1b2)]);const _0x333c86=await _0x317d89[_0x431f4c(0x1b0)]['create'](_0x5bd135);return deletePushRecovery(_0x2dc079['absolutePath']),{'action':_0x431f4c(0x1ca),'journeyId':_0x333c86['id'],'embeddedSegmentNameToId':_0x2ff304};}}else{if(_0x2dc079[_0x431f4c(0x1ed)]&&_0x2dc079[_0x431f4c(0x1ba)]){_0x5bd135['id']=_0x2dc079['existingJourney']['id'];const _0x2a7360=_0x5bd135['attributes'];_0x2dc079['existingJourney']['attributes']?.[_0x431f4c(0x1c5)]&&(_0x2a7360[_0x431f4c(0x1c5)]=_0x2dc079[_0x431f4c(0x1ba)]['attributes']['journeyBundleName']);const _0x3c1863=_0x2dc079['existingJourney'][_0x431f4c(0x1b2)]?.[_0x431f4c(0x15f)];return _0x3c1863&&_0x5bd135[_0x431f4c(0x1b2)][_0x431f4c(0x15f)]&&injectExistingStageIds(_0x5bd135[_0x431f4c(0x1b2)][_0x431f4c(0x15f)],_0x3c1863),ensureJourneyDefaults(_0x2a7360),await _0x317d89['journey'][_0x431f4c(0x1b4)](_0x2dc079['existingJourney']['id'],_0x5bd135),deletePushRecovery(_0x2dc079[_0x431f4c(0x1c8)]),{'action':_0x431f4c(0x20c),'journeyId':_0x2dc079['existingJourney']['id'],'embeddedSegmentNameToId':_0x2ff304};}}return deletePushRecovery(_0x2dc079[_0x431f4c(0x1c8)]),{'action':'unchanged','journeyId':_0x2dc079[_0x431f4c(0x1ba)]?.['id'],'embeddedSegmentNameToId':_0x2ff304};}function findSegmentCriteriaLocation(_0x5316f1,_0x298d51){const _0x1e30c2=a152_0x279d28,_0x5e9a83=_0x5316f1['stages']||_0x5316f1[_0x1e30c2(0x13b)]?.[0x0]?.['stages']||[];let _0x3ca2de=_0x1e30c2(0x1f5),_0x4c4d25=_0x298d51;const _0x19dbf2=_0x5316f1['goal']||_0x5316f1[_0x1e30c2(0x13b)]?.[0x0]?.[_0x1e30c2(0x1a9)];if(_0x19dbf2?.[_0x1e30c2(0x13a)]===_0x298d51)return{'stageName':_0x1e30c2(0x1a9),'criteriaName':_0x19dbf2[_0x1e30c2(0x1d4)]||_0x298d51};_0x4bebc4:for(const _0x1dd049 of _0x5e9a83){if(_0x1dd049[_0x1e30c2(0x19b)]?.[_0x1e30c2(0x13a)]===_0x298d51){_0x3ca2de=_0x1dd049[_0x1e30c2(0x1d4)],_0x4c4d25=_0x1dd049[_0x1e30c2(0x19b)][_0x1e30c2(0x1d4)]||_0x298d51;break;}if(_0x1dd049[_0x1e30c2(0x206)])for(const _0x508263 of _0x1dd049[_0x1e30c2(0x206)]){if(_0x508263[_0x1e30c2(0x186)]==='decision_point'&&_0x508263[_0x1e30c2(0x15b)]?.['branches'])for(const _0xca4557 of _0x508263[_0x1e30c2(0x15b)][_0x1e30c2(0x1f0)]){if(_0xca4557[_0x1e30c2(0x13a)]===_0x298d51){_0x3ca2de=_0x1dd049[_0x1e30c2(0x1d4)],_0x4c4d25=_0xca4557['name']||_0x298d51;break _0x4bebc4;}}}}return{'stageName':_0x3ca2de,'criteriaName':_0x4c4d25};}async function executeThreeStepJourneyCreate(_0x48a03c,_0x580fb4,_0x3c0820,_0x4092ae,_0x25fe2c,_0x33953a,_0x5d431d,_0x504195){const _0x4edd2a=a152_0x279d28,{activationDefToCreateRequest:_0x5421d4,yamlRuleToApi:_0x33093d}=_0x504195,{pendingEmbeddedSegments:_0x5c98e1,pendingEmbeddedActivations:_0x439bb3,embeddedSegmentNameToId:_0x440cb1}=_0x4092ae,_0x1d2a30=JSON['parse'](JSON[_0x4edd2a(0x165)](_0x3c0820));ensureJourneyDefaults(_0x1d2a30[_0x4edd2a(0x1b2)]),stripPendingIds(_0x1d2a30);const _0x548491=await _0x48a03c['journey']['create'](_0x1d2a30),_0x2a6455=_0x548491['id'],_0x333a85=new Map();for(const _0x5d4711 of _0x548491[_0x4edd2a(0x1b2)][_0x4edd2a(0x15f)]){_0x333a85[_0x4edd2a(0x209)](_0x5d4711[_0x4edd2a(0x1d4)][_0x4edd2a(0x117)](),_0x5d4711['id']);}recoverSegmentIdsFromPushRecovery(_0x580fb4,_0x440cb1,_0x33953a[_0x4edd2a(0x119)]);for(const [_0x3c25bb,{definition:_0x2b8a90}]of _0x5c98e1){if(_0x440cb1[_0x4edd2a(0x125)](_0x3c25bb)){_0x5d431d[_0x4edd2a(0x18d)]?.({'type':'embedded_segment_created','journeyName':_0x580fb4[_0x4edd2a(0x183)][_0x4edd2a(0x1d4)],'segmentName':_0x3c25bb});continue;}const _0x1913c7=generateDeterministicJourneySegmentName(_0x580fb4[_0x4edd2a(0x183)][_0x4edd2a(0x1d4)],_0x3c25bb);_0x5d431d[_0x4edd2a(0x18d)]?.({'type':_0x4edd2a(0x17e),'journeyName':_0x580fb4[_0x4edd2a(0x183)]['name'],'segmentName':_0x3c25bb});const _0x181775=createSegmentIdResolver(_0x33953a[_0x4edd2a(0x119)],_0x3c25bb),_0x4bb360=await resolveRuleSegmentIds(_0x2b8a90[_0x4edd2a(0x16f)],_0x181775),_0x242e18=await createOrRecoverEmbeddedSegment(_0x48a03c,_0x580fb4,{'localName':_0x3c25bb,'uniqueSegmentName':_0x1913c7,'description':_0x2b8a90[_0x4edd2a(0x1e6)]||_0x4edd2a(0x1a7)+_0x3c25bb,'journeyId':_0x2a6455,'resolvedRule':_0x4bb360,'parentId':_0x25fe2c[_0x4edd2a(0x184)],'folderId':_0x25fe2c[_0x4edd2a(0x1dc)]||''},_0x33093d);_0x440cb1[_0x4edd2a(0x209)](_0x3c25bb,_0x242e18),_0x33953a[_0x4edd2a(0x119)][_0x4edd2a(0x209)](_0x3c25bb,_0x242e18),_0x5d431d[_0x4edd2a(0x18d)]?.({'type':_0x4edd2a(0x16c),'journeyName':_0x580fb4[_0x4edd2a(0x183)][_0x4edd2a(0x1d4)],'segmentName':_0x3c25bb});}const _0x2aadda=new Map();for(const [_0x392141,_0xcf53ba]of _0x439bb3){_0x5d431d[_0x4edd2a(0x18d)]?.({'type':_0x4edd2a(0x212),'journeyName':_0x580fb4[_0x4edd2a(0x183)][_0x4edd2a(0x1d4)],'activationName':_0x392141});const _0x6846d4=await _0x5421d4(_0xcf53ba,_0x33953a[_0x4edd2a(0x12d)]),_0x24b553={..._0x6846d4,..._0xcf53ba['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0xcf53ba[_0x4edd2a(0x120)]}},_0x33af05=await _0x48a03c[_0x4edd2a(0x1b0)]['createActivation'](_0x2a6455,_0x24b553);_0x2aadda[_0x4edd2a(0x209)](_0x392141,_0x33af05['id']),_0x4092ae['journeyActivationNameToId'][_0x4edd2a(0x209)](_0x392141,_0x33af05['id']),_0x5d431d[_0x4edd2a(0x18d)]?.({'type':_0x4edd2a(0x1e5),'journeyName':_0x580fb4[_0x4edd2a(0x183)][_0x4edd2a(0x1d4)],'activationName':_0x392141});}const _0x1f7903=JSON[_0x4edd2a(0x1bf)](JSON[_0x4edd2a(0x165)](_0x3c0820));return _0x1f7903['id']=_0x2a6455,ensureJourneyDefaults(_0x1f7903[_0x4edd2a(0x1b2)]),resolvePendingIdsInRequest(_0x1f7903,_0x3c0820,_0x333a85,_0x440cb1,_0x2aadda,_0x5d431d),await _0x48a03c[_0x4edd2a(0x1b0)][_0x4edd2a(0x1b4)](_0x2a6455,_0x1f7903),deletePushRecovery(_0x580fb4[_0x4edd2a(0x1c8)]),{'action':'created','journeyId':_0x2a6455,'embeddedSegmentNameToId':_0x440cb1};}export function stripWaitStepPendingIds(_0xe99753){const _0x23cf97=a152_0x279d28,_0x22c613=_0xe99753['conditionSegmentId']&&isPendingSegmentId(_0xe99753[_0x23cf97(0x211)]),_0x5e3ba1=_0xe99753[_0x23cf97(0x1c6)]?.[_0x23cf97(0x1d7)](_0x2c18ac=>_0x2c18ac[_0x23cf97(0x219)]&&isPendingSegmentId(_0x2c18ac['segmentId']));(_0x22c613||_0x5e3ba1)&&(_0xe99753[_0x23cf97(0x137)]=_0x23cf97(0x146),_0xe99753['waitStep']=0x1,_0xe99753[_0x23cf97(0x17a)]=_0x23cf97(0x1c2),delete _0xe99753[_0x23cf97(0x211)],delete _0xe99753[_0x23cf97(0x18e)],delete _0xe99753[_0x23cf97(0x16e)],delete _0xe99753[_0x23cf97(0x1c6)]);}export function resolveWaitStepPendingIds(_0x337676,_0x19c648,_0x1570a6,_0xb0ea11){const _0x151928=a152_0x279d28;if(_0x19c648['conditionSegmentId']&&isPendingSegmentId(_0x19c648[_0x151928(0x211)])){const _0x1a2a0a=_0x1570a6(_0x19c648[_0x151928(0x211)],_0x151928(0x200)+_0xb0ea11+_0x151928(0x199));_0x1a2a0a&&(_0x337676[_0x151928(0x137)]=_0x151928(0x134),_0x337676[_0x151928(0x211)]=_0x1a2a0a,delete _0x337676[_0x151928(0x132)],delete _0x337676['waitStepUnit'],_0x19c648[_0x151928(0x18e)]!==undefined&&(_0x337676['conditionTimeoutDuration']=_0x19c648[_0x151928(0x18e)]),_0x19c648[_0x151928(0x16e)]&&(_0x337676[_0x151928(0x16e)]=_0x19c648[_0x151928(0x16e)]));}if(_0x19c648[_0x151928(0x1c6)]){const _0x41a40f=_0x19c648[_0x151928(0x1c6)][_0x151928(0x1d7)](_0x389fbb=>_0x389fbb[_0x151928(0x219)]&&isPendingSegmentId(_0x389fbb[_0x151928(0x219)]));if(_0x41a40f){const _0x1a87ad=_0x19c648[_0x151928(0x1c6)][_0x151928(0x191)](_0x28684e=>{const _0x1628d2=_0x151928;if(_0x28684e[_0x1628d2(0x219)]&&isPendingSegmentId(_0x28684e[_0x1628d2(0x219)])){const _0x4aebe4=_0x1570a6(_0x28684e[_0x1628d2(0x219)],_0x1628d2(0x200)+_0xb0ea11+_0x1628d2(0x199));return{..._0x28684e,'segmentId':_0x4aebe4||_0x28684e[_0x1628d2(0x219)]};}return{..._0x28684e};});_0x337676[_0x151928(0x137)]=_0x151928(0x134),_0x337676['conditions']=_0x1a87ad,delete _0x337676[_0x151928(0x132)],delete _0x337676[_0x151928(0x17a)],delete _0x337676[_0x151928(0x211)],delete _0x337676[_0x151928(0x18e)],delete _0x337676[_0x151928(0x16e)];}}}function stripPendingIds(_0x237048){const _0x147a51=a152_0x279d28;_0x237048[_0x147a51(0x1b2)]['goal']?.['segmentId']&&isPendingSegmentId(_0x237048[_0x147a51(0x1b2)]['goal'][_0x147a51(0x219)])&&delete _0x237048[_0x147a51(0x1b2)][_0x147a51(0x1a9)];for(const _0x13ede9 of _0x237048[_0x147a51(0x1b2)][_0x147a51(0x15f)]||[]){_0x13ede9['entryCriteria']?.[_0x147a51(0x219)]&&isPendingSegmentId(_0x13ede9['entryCriteria'][_0x147a51(0x219)])&&delete _0x13ede9[_0x147a51(0x1ad)];_0x13ede9['milestone']?.[_0x147a51(0x219)]&&isPendingSegmentId(_0x13ede9['milestone'][_0x147a51(0x219)])&&delete _0x13ede9['milestone'];_0x13ede9[_0x147a51(0x20f)]&&(_0x13ede9['exitCriterias']=_0x13ede9['exitCriterias'][_0x147a51(0x1ae)](_0x2e0827=>!_0x2e0827[_0x147a51(0x219)]||!isPendingSegmentId(_0x2e0827[_0x147a51(0x219)])));if(_0x13ede9[_0x147a51(0x206)])for(const _0x5d9c85 of Object[_0x147a51(0x1dd)](_0x13ede9[_0x147a51(0x206)])){const _0x4df8ce=_0x13ede9[_0x147a51(0x206)][_0x5d9c85];_0x4df8ce[_0x147a51(0x186)]===_0x147a51(0x11f)&&_0x4df8ce[_0x147a51(0x16b)]&&isPendingActivationId(_0x4df8ce[_0x147a51(0x16b)])&&(_0x4df8ce[_0x147a51(0x16b)]='');if(_0x4df8ce['type']===_0x147a51(0x171)&&_0x4df8ce[_0x147a51(0x1f0)])for(const _0x182a3e of _0x4df8ce['branches']){_0x182a3e[_0x147a51(0x219)]&&isPendingSegmentId(_0x182a3e[_0x147a51(0x219)])&&(_0x182a3e[_0x147a51(0x219)]='');}_0x4df8ce[_0x147a51(0x186)]===_0x147a51(0x1ab)&&stripWaitStepPendingIds(_0x4df8ce);}}}function resolvePendingIdsInRequest(_0x1a755a,_0x490c0b,_0x1dc51d,_0x2930a7,_0x22f179,_0x3676bc){const _0x5005dd=a152_0x279d28,_0x27e939=(_0x4220d3,_0x1be87c)=>{const _0x4917f0=a152_0x2e8d;if(!isPendingSegmentId(_0x4220d3))return _0x4220d3;const _0x282fa6=extractPendingSegmentName(_0x4220d3),_0x5da811=_0x2930a7[_0x4917f0(0x19e)](_0x282fa6);return!_0x5da811&&_0x3676bc[_0x4917f0(0x1c7)]?.(_0x4917f0(0x202)+_0x282fa6+'\x27\x20for\x20'+_0x1be87c),_0x5da811;};if(_0x1a755a[_0x5005dd(0x1b2)][_0x5005dd(0x1a9)]?.['segmentId']&&isPendingSegmentId(_0x1a755a[_0x5005dd(0x1b2)][_0x5005dd(0x1a9)]['segmentId'])){const _0x4e88c2=_0x27e939(_0x1a755a['attributes'][_0x5005dd(0x1a9)][_0x5005dd(0x219)],_0x5005dd(0x1bd));_0x4e88c2&&(_0x1a755a[_0x5005dd(0x1b2)][_0x5005dd(0x1a9)][_0x5005dd(0x219)]=_0x4e88c2);}for(const _0x448012 of _0x1a755a[_0x5005dd(0x1b2)][_0x5005dd(0x15f)]||[]){const _0x1a735f=_0x1dc51d[_0x5005dd(0x19e)](_0x448012[_0x5005dd(0x1d4)][_0x5005dd(0x117)]());_0x1a735f&&(_0x448012['id']=_0x1a735f);if(_0x448012['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x448012[_0x5005dd(0x1ad)]['segmentId'])){const _0x50fe46=_0x27e939(_0x448012[_0x5005dd(0x1ad)][_0x5005dd(0x219)],_0x5005dd(0x200)+_0x448012[_0x5005dd(0x1d4)]+_0x5005dd(0x1eb));_0x50fe46&&(_0x448012[_0x5005dd(0x1ad)][_0x5005dd(0x219)]=_0x50fe46);}if(_0x448012[_0x5005dd(0x20f)])for(const _0x1c97da of _0x448012[_0x5005dd(0x20f)]){if(_0x1c97da[_0x5005dd(0x219)]&&isPendingSegmentId(_0x1c97da['segmentId'])){const _0x159aef=_0x27e939(_0x1c97da[_0x5005dd(0x219)],'stage\x20\x27'+_0x448012[_0x5005dd(0x1d4)]+_0x5005dd(0x1a1));_0x159aef&&(_0x1c97da[_0x5005dd(0x219)]=_0x159aef);}}if(_0x448012[_0x5005dd(0x19c)]?.[_0x5005dd(0x219)]&&isPendingSegmentId(_0x448012[_0x5005dd(0x19c)][_0x5005dd(0x219)])){const _0x15db2d=_0x27e939(_0x448012['milestone']['segmentId'],_0x5005dd(0x200)+_0x448012[_0x5005dd(0x1d4)]+'\x27\x20milestone');_0x15db2d&&(_0x448012[_0x5005dd(0x19c)][_0x5005dd(0x219)]=_0x15db2d);}if(_0x448012[_0x5005dd(0x206)]){const _0x364b52=_0xa31ac4=>_0x490c0b[_0x5005dd(0x1b2)][_0x5005dd(0x15f)]?.[_0x5005dd(0x1e1)](_0x25b489=>_0x25b489[_0x5005dd(0x1d4)]['toLowerCase']()===_0x448012[_0x5005dd(0x1d4)][_0x5005dd(0x117)]())?.[_0x5005dd(0x206)]?.[_0xa31ac4];for(const _0x4cf6cc of Object[_0x5005dd(0x1dd)](_0x448012[_0x5005dd(0x206)])){const _0x2a046f=_0x448012[_0x5005dd(0x206)][_0x4cf6cc],_0x4e3cb8=_0x364b52(_0x4cf6cc);if(_0x2a046f[_0x5005dd(0x186)]===_0x5005dd(0x11f)&&_0x2a046f[_0x5005dd(0x16b)]&&(isPendingActivationId(_0x2a046f[_0x5005dd(0x16b)])||_0x2a046f[_0x5005dd(0x16b)]==='')){if(_0x4e3cb8?.[_0x5005dd(0x16b)]&&isPendingActivationId(_0x4e3cb8['journeyActivationStepId'])){const _0x309e43=extractPendingActivationName(_0x4e3cb8[_0x5005dd(0x16b)]),_0x265831=_0x22f179['get'](_0x309e43);_0x265831&&(_0x2a046f[_0x5005dd(0x16b)]=_0x265831);}}if(_0x2a046f[_0x5005dd(0x186)]===_0x5005dd(0x171)&&_0x2a046f[_0x5005dd(0x1f0)]&&_0x4e3cb8?.[_0x5005dd(0x1f0)])for(let _0x7332fd=0x0;_0x7332fd<_0x2a046f[_0x5005dd(0x1f0)][_0x5005dd(0x20b)];_0x7332fd++){const _0x5a76e5=_0x2a046f[_0x5005dd(0x1f0)][_0x7332fd],_0x38baf6=_0x4e3cb8[_0x5005dd(0x1f0)][_0x7332fd];if(_0x38baf6?.[_0x5005dd(0x219)]&&isPendingSegmentId(_0x38baf6['segmentId'])){const _0xb6032c=_0x27e939(_0x38baf6[_0x5005dd(0x219)],_0x5005dd(0x200)+_0x448012[_0x5005dd(0x1d4)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x5a76e5['name']||_0x7332fd)+'\x27');_0xb6032c&&(_0x5a76e5['segmentId']=_0xb6032c);}}_0x2a046f[_0x5005dd(0x186)]==='WaitStep'&&_0x4e3cb8?.[_0x5005dd(0x186)]==='WaitStep'&&resolveWaitStepPendingIds(_0x2a046f,_0x4e3cb8,_0x27e939,_0x448012[_0x5005dd(0x1d4)]);}}}}
|
|
1
|
+
const a152_0x25b4a3=a152_0x3f4b;(function(_0x3d1f4e,_0x4187fb){const _0x5cf14=a152_0x3f4b,_0x311839=_0x3d1f4e();while(!![]){try{const _0x298b23=parseInt(_0x5cf14(0x135))/0x1+-parseInt(_0x5cf14(0x165))/0x2+parseInt(_0x5cf14(0x141))/0x3+parseInt(_0x5cf14(0x172))/0x4+parseInt(_0x5cf14(0x1a8))/0x5+-parseInt(_0x5cf14(0x1e9))/0x6*(parseInt(_0x5cf14(0x18a))/0x7)+-parseInt(_0x5cf14(0x1f4))/0x8*(parseInt(_0x5cf14(0x155))/0x9);if(_0x298b23===_0x4187fb)break;else _0x311839['push'](_0x311839['shift']());}catch(_0x4bcd86){_0x311839['push'](_0x311839['shift']());}}}(a152_0x4463,0xe0363));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0x25b4a3(0x19c);export const PENDING_ACTIVATION_PREFIX=a152_0x25b4a3(0x14c);export function createPendingSegmentId(_0x25912a){return''+PENDING_SEGMENT_PREFIX+_0x25912a+'__';}export function isPendingSegmentId(_0x3bdd2b){return _0x3bdd2b['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x3bdd2b['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x57fb8a){const _0xc13ea1=a152_0x25b4a3;return _0x57fb8a[_0xc13ea1(0x113)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x178bfb){return''+PENDING_ACTIVATION_PREFIX+_0x178bfb+'__';}export function isPendingActivationId(_0x78482d){const _0x19d03e=a152_0x25b4a3;return _0x78482d[_0x19d03e(0x1fc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x117d2a){const _0x1d34b5=a152_0x25b4a3;return _0x117d2a[_0x1d34b5(0x113)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xafaf94,_0x31c000){const _0x2af374=a152_0x25b4a3,_0x790ea6=_0xafaf94+'::'+(_0x31c000[_0x2af374(0x149)]()||'segment'),_0x8796d2=createHash('sha1')[_0x2af374(0x181)](_0x790ea6)[_0x2af374(0x1ea)](_0x2af374(0x1ed))[_0x2af374(0x197)](0x0,0xc);return'journey_entry_criteria_'+_0x8796d2;}export function ensureJourneyDefaults(_0x2c4af5){const _0x4aedde=a152_0x25b4a3;!_0x2c4af5['description']&&(_0x2c4af5[_0x4aedde(0x1b9)]=''),!_0x2c4af5['state']&&(_0x2c4af5['state']='draft');}export function injectExistingStageIds(_0x54e500,_0x445e21){const _0x454fe5=a152_0x25b4a3,_0x1d3dbe=new Map(_0x445e21[_0x454fe5(0x1e1)](_0x177da0=>[_0x177da0['name'],_0x177da0['id']]));for(const _0x5ccf92 of _0x54e500){if(!_0x5ccf92['id']){const _0x4cfacb=_0x1d3dbe[_0x454fe5(0x151)](_0x5ccf92['name']);_0x4cfacb&&(_0x5ccf92['id']=_0x4cfacb);}}}export function resolveTDFolderPath(_0x5bffc3,_0x4e1569,_0x38bea7){const _0x4b7654=a152_0x25b4a3;if(!_0x4e1569)return _0x5bffc3;if(_0x5bffc3===_0x38bea7||_0x5bffc3[_0x4b7654(0x1fc)](_0x38bea7+'/'))return _0x5bffc3;return _0x5bffc3?_0x38bea7+'/'+_0x5bffc3:_0x38bea7;}export function addFoldersToCreate(_0x3e0f92,_0x3f84be,_0x5b233c){const _0x543b1a=a152_0x25b4a3;if(!_0x3e0f92)return;if(_0x3f84be[_0x543b1a(0x12f)](_0x3e0f92))return;const _0x563903=_0x3e0f92[_0x543b1a(0x14d)]('/');let _0xe8b027='';for(const _0xaf4d5d of _0x563903){_0xe8b027=_0xe8b027?_0xe8b027+'/'+_0xaf4d5d:_0xaf4d5d,!_0x3f84be[_0x543b1a(0x12f)](_0xe8b027)&&_0x5b233c[_0x543b1a(0x1c5)](_0xe8b027);}}export function sortFoldersByDepth(_0x18e605){const _0x3f5ed8=a152_0x25b4a3;return[..._0x18e605][_0x3f5ed8(0x100)]((_0x31354f,_0x1c2ae0)=>{const _0x7dea2f=_0x3f5ed8,_0x25750f=(_0x31354f['match'](/\//g)||[])[_0x7dea2f(0x1d0)],_0x482eef=(_0x1c2ae0[_0x7dea2f(0x187)](/\//g)||[])[_0x7dea2f(0x1d0)];return _0x25750f-_0x482eef;});}import*as a152_0x19c01e from'yaml';import{readFileSync}from'fs';import a152_0x5c5da7 from'path';import{isJourneyDef,parseYamlString as a152_0x3b46a5,toYamlString as a152_0x9fc482,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';function a152_0x4463(){const _0x3d193d=['343DVqaaj','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','stringify','Creating\x20activation\x20\x27','item','getActivation','\x0a\x20\x20','Activation','folder','Creating\x20folder\x20\x27','resolveJourneyId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','toLowerCase','slice','ACTIVATION_SYNTAX_ERROR','yamlConfig','kind','journeyBundleName','__pending_','conditionTimeoutDuration',').\x20','DecisionPoint','folderPathToId','user','utf-8','existingSegment','Fetching\x20','with','parse','action','6165835bEqewm','Embedded\x20segment\x20\x27','onProgress','some','\x27\x20from\x20file:\x20','existingActivation','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','name','rootFolderId','buildUserMaps','max','.$1.push-recovery.json','branches','idToEmailMap','resolveSegment','columns','description','NOT_FOUND','):\x20','parentFolder','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','parseDocument','activations','withProgress','Created\x20segment\x20\x27','activation_deleted','activation_template_id','segment','add','updateActivation','\x27\x20by\x20rule\x20content','size','Updated\x20segment\x20\x27','object','unchanged','debug','SEGMENT_UPDATE_ERROR','keys','milestone','length','notification','deps','errors','updated','relative','journey_created','journey_updated','steps','null','toString','activation_','parentSegmentFolder','activationContext','decision_point','createdSegmentId','Failed\x20to\x20fetch\x20referenced\x20segment\x20','map','logSuccess','getJourney','segments','journeyById','all','\x20activation\x20\x27','Updating\x20segment\x20\x27','690AkHEIM','digest','waitStepUnit','\x20(referenced\x20in\x20journey\x20','hex','Segment\x20not\x20found:\x20','updateSegmentById','activation_updated','folder_created','find','diff','11596496KPqAWk','entry','Failed\x20to\x20','resolvedRule','from','hasChanges','includes','\x27\x20for\x20','startsWith','segment_deleted','conditionTimeoutUnit','createdSegmentIds','existingSegments','journeyActivationStepId','\x27\x20entry\x20criteria','sort','stage\x20\x27','reduce','filter','nameToId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','localName','deleteActivation','createSegment','deleteSegment','values','isArray','entries','logWarning','entryCriteria','uniqueSegmentName','waitStepType','../../utils/async.js','conditions','replace','type','exitCriterias','journeyName','SEGMENT_NOT_FOUND','yamlActivation','\x27\x20exit\x20criteria','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','attributes','index','validatedRequest','Failed\x20to\x20resolve\x20segment\x20','activation_updating','Duration','SEGMENT_SYNTAX_ERROR','goal','connection','activation_creating','activation_deleting','\x27\x20to\x20local\x20\x27','Condition','flatMap','embedded_activation_created','\x27...','segmentFolderId','versionNumber','delete','journeyActivationNameToId','has','list','getLatestJourneyId','Created\x20activation\x20\x27','journeyBundleId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','774447IvxiLi','WaitStep','journeyStages','join','deleted','Entry\x20criteria:\x20','./child-segment-yaml.js','segment_creating','createFolder','JOURNEY_UPDATE_ERROR','idToName','Updating\x20activation\x20\x27','203406HPCmlK','Updated\x20activation\x20\x27','conditionSegmentId','\x20segment\x20from\x20file:\x20','parentId','create','journeys','skipSegments','trim','Deleted\x20segment\x20\x27','segmentNameToId','__pending_act_','split','./journey-yaml.js','message','uniqueServerName','get','stages','segmentId','results','9IHEVsw','activationStepsById','getSegmentEntity\x20also\x20failed\x20for\x20','behavior','INTERNAL','logDeleted','journey_updating','absolutePath','Updated\x20journey\x20\x27','Matched\x20server\x20segment\x20\x27','Created\x20folder\x20\x27','folderPath','journeyId','rule','dirname','folderId','1199358vhOFAg','segment_deleting','created','set','ACTIVATION_UPDATE_ERROR','embedded_segment_created','day','Deleting\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','goal\x20criteria','existingJourney','embeddedSegmentNameToId','listActivations','3591324WQrJhq','toISOString','journey','waitStep','run_after_journey_refresh','Activation\x20not\x20found:\x20','data','all_columns','\x27\x20not\x20found\x20in\x20journey\x20\x27','relationships','activation_created','push','Name\x20has\x20already\x20been\x20taken','\x20journey\x20from\x20file:\x20','valid','update','\x27\x20decision\x20point\x20branch\x20\x27','progress','getSegment\x20failed\x20for\x20','isNew','connectionIdToNameMap','match','schedule','createActivation'];a152_0x4463=function(){return _0x3d193d;};return a152_0x4463();}import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x4aff42){const _0x187143=a152_0x25b4a3;if(Array[_0x187143(0x10b)](_0x4aff42))return'['+_0x4aff42[_0x187143(0x1e1)](_0x54581b=>stableStringify(_0x54581b))[_0x187143(0x138)](',')+']';if(_0x4aff42&&typeof _0x4aff42===_0x187143(0x1ca)){const _0x28b957=_0x4aff42,_0x3b1899=Object[_0x187143(0x1ce)](_0x28b957)[_0x187143(0x100)](),_0x34b4c8=_0x3b1899[_0x187143(0x1e1)](_0x206b6a=>'\x22'+_0x206b6a+'\x22:'+stableStringify(_0x28b957[_0x206b6a]));return'{'+_0x34b4c8[_0x187143(0x138)](',')+'}';}const _0x2d2733=JSON[_0x187143(0x18c)](_0x4aff42);return _0x2d2733===undefined?_0x187143(0x1d9):_0x2d2733;}function activationSignature(_0x575304){const _0x474242=a152_0x25b4a3,_0x33c4b7={'connection':_0x575304[_0x474242(0x123)],..._0x575304[_0x474242(0x179)]!==undefined&&{'all_columns':_0x575304['all_columns']},..._0x575304[_0x474242(0x1b8)]!==undefined&&{'columns':_0x575304[_0x474242(0x1b8)]},..._0x575304[_0x474242(0x158)]!==undefined&&{'behavior':_0x575304[_0x474242(0x158)]},..._0x575304[_0x474242(0x188)]!==undefined&&{'schedule':_0x575304['schedule']},..._0x575304[_0x474242(0x1d1)]!==undefined&&{'notification':_0x575304[_0x474242(0x1d1)]},..._0x575304['connector_config']!==undefined&&{'connector_config':_0x575304['connector_config']},..._0x575304['activation_template_id']!==undefined&&{'activation_template_id':_0x575304[_0x474242(0x1c3)]}};return stableStringify(_0x33c4b7);}async function fetchSegment(_0x2ecc1f,_0x77c94e,_0x2abe3a,_0x2e41c6){const _0x375b29=a152_0x25b4a3,_0x54eb5e=_0x2e41c6?.[_0x375b29(0x1f2)](_0x23d90b=>_0x23d90b['id']===_0x2abe3a);if(_0x54eb5e)return _0x54eb5e;try{return await _0x2ecc1f[_0x375b29(0x1c4)]['getSegment'](_0x77c94e,_0x2abe3a);}catch(_0x5469e5){logger['debug'](_0x375b29(0x184)+_0x2abe3a+_0x375b29(0x1af)+_0x5469e5);try{return await _0x2ecc1f['segment']['getSegmentEntity'](_0x2abe3a);}catch(_0x24ff89){return logger[_0x375b29(0x1cc)](_0x375b29(0x157)+_0x2abe3a+':\x20'+_0x24ff89),null;}}}function recoverSegmentIdsFromPushRecovery(_0x22107b,_0x415b82,_0x8f41f8){const _0x1a11e7=a152_0x25b4a3,_0x434c71=readPushRecovery(_0x22107b['absolutePath']);if(_0x434c71?.['journeyName']===_0x22107b['yamlConfig'][_0x1a11e7(0x1b0)])for(const [_0x451bed,_0x4addb1]of Object['entries'](_0x434c71[_0x1a11e7(0x1e4)])){const _0x4be6c8=generateDeterministicJourneySegmentName(_0x22107b[_0x1a11e7(0x199)][_0x1a11e7(0x1b0)],_0x451bed);_0x4addb1[_0x1a11e7(0x150)]===_0x4be6c8&&(_0x415b82[_0x1a11e7(0x168)](_0x451bed,_0x4addb1['segmentId']),_0x8f41f8[_0x1a11e7(0x168)](_0x451bed,_0x4addb1[_0x1a11e7(0x153)]));}}async function createOrRecoverEmbeddedSegment(_0x5aee3d,_0x363b62,_0x4c9deb,_0x4a02ab){const _0x31ff63=a152_0x25b4a3;let _0x5d2384;try{_0x5d2384=await _0x5aee3d[_0x31ff63(0x1c4)]['createJourneySegment']({'name':_0x4c9deb['uniqueSegmentName'],'description':_0x4c9deb['description'],'journeyId':_0x4c9deb[_0x31ff63(0x161)],'rule':_0x4a02ab(_0x4c9deb[_0x31ff63(0x1f7)],!![]),'countPopulation':!![],'parentFolderId':_0x4c9deb[_0x31ff63(0x164)],'audienceId':_0x4c9deb[_0x31ff63(0x145)]});}catch(_0x192617){const _0x4bad63=_0x192617 instanceof Error&&_0x192617[_0x31ff63(0x14f)][_0x31ff63(0x1fa)](_0x31ff63(0x17e));if(_0x4bad63){const _0x326415=readPushRecovery(_0x363b62[_0x31ff63(0x15c)]),_0xc623cf=_0x326415?.[_0x31ff63(0x116)]===_0x363b62[_0x31ff63(0x199)]['name']?_0x326415['segments'][_0x4c9deb[_0x31ff63(0x106)]]:undefined;if(_0xc623cf?.[_0x31ff63(0x150)]===_0x4c9deb[_0x31ff63(0x10f)])await _0x5aee3d[_0x31ff63(0x1c4)][_0x31ff63(0x1ef)](_0x4c9deb[_0x31ff63(0x145)],_0xc623cf[_0x31ff63(0x153)],{'description':_0x4c9deb[_0x31ff63(0x1b9)],'rule':_0x4a02ab(_0x4c9deb[_0x31ff63(0x1f7)],!![]),'countPopulation':!![]}),_0x5d2384=_0xc623cf[_0x31ff63(0x153)];else throw new SDKError(ErrorCode[_0x31ff63(0x1cd)],_0x31ff63(0x1a9)+_0x4c9deb[_0x31ff63(0x106)]+_0x31ff63(0x105)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x363b62[_0x31ff63(0x15c)]['replace'](/([^/]+)$/,_0x31ff63(0x1b4))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x192617);}else throw _0x192617;}return saveSegmentToPushRecovery(_0x363b62['absolutePath'],_0x363b62[_0x31ff63(0x199)]['name'],_0x4c9deb[_0x31ff63(0x106)],{'segmentId':_0x5d2384,'uniqueServerName':_0x4c9deb[_0x31ff63(0x10f)],'createdAt':new Date()[_0x31ff63(0x173)]()}),_0x5d2384;}export async function prepareSegmentFiles(_0x5ea516,_0x43de64,_0x1a70d4,_0x358c5f,_0x11ac84){const _0x4307e4=a152_0x25b4a3,{activationDefToCreateRequest:_0x5535a9}=await import('./child-segment-yaml.js'),_0x108e4f=[],_0x2a2e62=new Set();for(const {yamlConfig:_0x4a77a8,folderPath:_0x458902,sourcePath:_0x52d4f9}of _0x5ea516){const _0x1defa8=resolveTDFolderPath(_0x458902,_0x358c5f,_0x11ac84),_0x10d3bf=_0x1defa8+':'+_0x4a77a8[_0x4307e4(0x1b0)],_0x4f8a65=_0x43de64['segmentByFolderAndName']['get'](_0x10d3bf),_0x5c73eb=_0x4f8a65?_0x43de64['activationsBySegmentId'][_0x4307e4(0x151)](_0x4f8a65['id'])||[]:[];addFoldersToCreate(_0x1defa8,_0x43de64[_0x4307e4(0x1a0)],_0x2a2e62);const _0x261bb1=calculateActivationActions(_0x4a77a8[_0x4307e4(0x1bf)]||[],_0x5c73eb,_0x43de64[_0x4307e4(0x1b6)],_0x43de64[_0x4307e4(0x186)]);for(const _0x117a25 of _0x261bb1){(_0x117a25['type']===_0x4307e4(0x146)||_0x117a25[_0x4307e4(0x114)]===_0x4307e4(0x181))&&_0x117a25[_0x4307e4(0x118)]&&(_0x117a25[_0x4307e4(0x11d)]=await _0x5535a9(_0x117a25['yamlActivation'],_0x1a70d4));}const _0xe31b25=calculateSegmentDiff(_0x4a77a8,_0x4f8a65,_0x5c73eb,_0x43de64[_0x4307e4(0x1b6)],_0x43de64['connectionIdToNameMap']);_0x108e4f[_0x4307e4(0x17d)]({'relativePath':_0x4a77a8['name'],'absolutePath':_0x52d4f9,'yamlConfig':_0x4a77a8,'folderPath':_0x1defa8,'existingSegment':_0x4f8a65,'existingActivations':_0x5c73eb,'isNew':_0xe31b25[_0x4307e4(0x185)],'hasChanges':_0xe31b25[_0x4307e4(0x1f9)],'diff':_0xe31b25[_0x4307e4(0x1f3)],'activationActions':_0x261bb1});}return{'segmentFiles':_0x108e4f,'foldersToCreate':_0x2a2e62};}export async function prepareJourneyFiles(_0x442215,_0x1cbcec,_0x419c2e,_0x5481f2){const _0x56176a=a152_0x25b4a3,_0x22a535=[],_0xdc16dc=new Set();for(const {yamlConfig:_0x2f1da2,folderPath:_0x3e9c08,sourcePath:_0x11ce71}of _0x442215){const _0x14dc5f=resolveTDFolderPath(_0x3e9c08,_0x419c2e,_0x5481f2),_0x1b7740=_0x14dc5f+':'+_0x2f1da2['name'],_0x3fa0cc=_0x1cbcec['journeyBundlesByFolderAndName'][_0x56176a(0x151)](_0x1b7740);let _0x2c318e,_0x117e58;if(_0x3fa0cc&&_0x3fa0cc[_0x56176a(0x1d0)]>0x0){const _0x33eca2=buildLocalExpandedRuleMappings(_0x2f1da2),{createYamlContext:_0x234c91,prefetchJourneySegments:_0x126ae3}=createPushYamlContextForBundle(_0x1cbcec[_0x56176a(0x1d2)],_0x1cbcec[_0x56176a(0x145)],_0x1cbcec[_0x56176a(0x200)],_0x33eca2,_0x1cbcec[_0x56176a(0x1b6)],_0x1cbcec['connectionIdToNameMap'],_0x1cbcec[_0x56176a(0x156)],_0x1cbcec['journeyById']);await _0x126ae3(_0x3fa0cc[_0x56176a(0x1e1)](_0x2fc6a7=>_0x2fc6a7['id']));const _0x1994e6=await _0x1cbcec[_0x56176a(0x1d2)][_0x56176a(0x174)][_0x56176a(0x131)](_0x3fa0cc[0x0][_0x56176a(0x133)]),_0x5f2093=hasMultipleVersions(_0x2f1da2),_0x166533=async _0x2cb234=>{const _0x17ffff=_0x56176a,_0x52f9de=_0x1cbcec[_0x17ffff(0x1e5)]?.[_0x17ffff(0x151)](_0x2cb234);if(_0x52f9de)return _0x52f9de;return _0x1cbcec['fetchJourney']({'journeyId':_0x2cb234,'journeyName':_0x2f1da2[_0x17ffff(0x1b0)],'isMultiVersion':_0x3fa0cc[_0x17ffff(0x1d0)]>0x1});};if(_0x5f2093&&_0x3fa0cc[_0x56176a(0x1d0)]>0x1){const _0x4fdb56=[];for(const _0x3568c4 of _0x3fa0cc){const _0x3ef090=_0x3568c4[_0x56176a(0x12c)]||0x1;_0x1cbcec[_0x56176a(0x183)]?.[_0x56176a(0x181)]('Fetching\x20'+_0x2f1da2[_0x56176a(0x1b0)]+'\x20v'+_0x3ef090);const _0x4d2403=await _0x166533(_0x3568c4['id']),_0x90150f=_0x234c91(_0x3568c4['id']),_0x4d6373=await journeyResponseToDef(_0x4d2403,_0x90150f);_0x4fdb56['push']({'item':_0x3568c4,'yaml':_0x4d6373});}const _0x4c0812=buildLocalRuleToNameMappingFromJourney(_0x2f1da2);_0x117e58=buildMergedJourneyDef(_0x4fdb56,_0x4c0812,_0x1994e6);const _0x10683f=Math['max'](..._0x4fdb56['map'](_0x4943c3=>_0x4943c3[_0x56176a(0x18e)]['versionNumber']||0x0)),_0xe56e57=_0x3fa0cc[_0x56176a(0x1f2)](_0x4a768c=>(_0x4a768c[_0x56176a(0x12c)]||0x0)===_0x10683f);_0xe56e57&&(_0x1cbcec[_0x56176a(0x183)]?.['update'](_0x56176a(0x1a4)+_0x2f1da2[_0x56176a(0x1b0)]+'\x20v'+_0x10683f),_0x2c318e=await _0x166533(_0xe56e57['id']));}else{const _0x11318e=_0x3fa0cc[_0x3fa0cc[_0x56176a(0x1d0)]-0x1];_0x1cbcec[_0x56176a(0x183)]?.['update'](_0x56176a(0x1a4)+_0x2f1da2[_0x56176a(0x1b0)]),_0x2c318e=await _0x166533(_0x11318e['id']);const _0x295f73=_0x234c91(_0x11318e['id']),_0x42a2b1=await journeyResponseToDef(_0x2c318e,_0x295f73),_0x235dcd=buildLocalRuleToNameMappingFromJourney(_0x2f1da2);_0x117e58=buildMergedJourneyDef([{'item':_0x11318e,'yaml':_0x42a2b1}],_0x235dcd,_0x1994e6);}}addFoldersToCreate(_0x14dc5f,_0x1cbcec[_0x56176a(0x1a0)],_0xdc16dc);const _0x2a59e6=calculateJourneyDiff(_0x2f1da2,_0x117e58);_0x22a535[_0x56176a(0x17d)]({'relativePath':_0x2f1da2[_0x56176a(0x1b0)],'absolutePath':_0x11ce71,'yamlConfig':_0x2f1da2,'folderPath':_0x14dc5f,'existingJourney':_0x2c318e,'isNew':_0x2a59e6[_0x56176a(0x185)],'hasChanges':_0x2a59e6[_0x56176a(0x1f9)],'diff':_0x2a59e6['diff']});}return{'journeyFiles':_0x22a535,'foldersToCreate':_0xdc16dc};}export function calculateActivationActions(_0x1a903d,_0xa2e208,_0x230bb3,_0x101b1e){const _0x3eb76d=a152_0x25b4a3,_0x3a7df3=[],_0x20203c=new Map();for(const _0x2bb2f8 of _0xa2e208){_0x20203c[_0x3eb76d(0x168)](_0x2bb2f8['name'],_0x2bb2f8);}const _0x3e70af=new Map();for(const _0xaeeb74 of _0x1a903d){_0x3e70af[_0x3eb76d(0x168)](_0xaeeb74[_0x3eb76d(0x1b0)],_0xaeeb74);}for(const _0x1ac972 of _0x1a903d){const _0x57f410=_0x20203c['get'](_0x1ac972['name']);if(!_0x57f410)_0x3a7df3[_0x3eb76d(0x17d)]({'type':_0x3eb76d(0x146),'name':_0x1ac972[_0x3eb76d(0x1b0)],'yamlActivation':_0x1ac972});else{const _0x4210de=activationResponseToDef(_0x57f410,_0x230bb3,_0x101b1e),_0x359984=a152_0x19c01e['stringify'](_0x4210de),_0x5df32a=a152_0x19c01e[_0x3eb76d(0x18c)](_0x1ac972);_0x359984!==_0x5df32a&&_0x3a7df3[_0x3eb76d(0x17d)]({'type':_0x3eb76d(0x181),'name':_0x1ac972[_0x3eb76d(0x1b0)],'yamlActivation':_0x1ac972,'existingActivation':_0x57f410});}}for(const _0x5a9bd7 of _0xa2e208){!_0x3e70af[_0x3eb76d(0x12f)](_0x5a9bd7[_0x3eb76d(0x1b0)])&&_0x3a7df3[_0x3eb76d(0x17d)]({'type':_0x3eb76d(0x12d),'name':_0x5a9bd7[_0x3eb76d(0x1b0)],'existingActivation':_0x5a9bd7});}return _0x3a7df3;}function calculateYamlDiff(_0xdea87,_0x5c8aab){if(_0x5c8aab){const _0x4ee6b9=generateDiff(_0x5c8aab,_0xdea87),_0x24e8f6=hasChanges(_0x4ee6b9);return{'isNew':![],'hasChanges':_0x24e8f6,'diff':_0x24e8f6?formatDiffWithColors(_0x4ee6b9):undefined};}const _0x2554c9=generateDiff('',_0xdea87);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2554c9)};}function a152_0x3f4b(_0x7b46a5,_0x859462){_0x7b46a5=_0x7b46a5-0xff;const _0x446374=a152_0x4463();let _0x3f4be2=_0x446374[_0x7b46a5];return _0x3f4be2;}export function calculateSegmentDiff(_0x3b7113,_0x5ad451,_0x161090,_0x4e8792,_0x2d4f74){const _0x3ee320=segmentToYamlString(_0x3b7113),_0x478b80=_0x5ad451?segmentToYamlString(segmentWithActivationsToYaml(_0x5ad451,_0x161090,undefined,_0x4e8792,_0x2d4f74)):undefined;return calculateYamlDiff(_0x3ee320,_0x478b80);}export function calculateJourneyDiff(_0x50db96,_0x302b53){const _0x353320=normalizeJourneyDef(_0x50db96,_0x50db96),_0x42c0ea=a152_0x9fc482(_0x353320),_0x3e2ff7=_0x302b53?a152_0x9fc482(normalizeJourneyDef(_0x302b53,_0x50db96)):undefined;return calculateYamlDiff(_0x42c0ea,_0x3e2ff7);}export function findSegmentsToDelete(_0x3dcb69,_0x289635,_0x544ac2,_0x5c59dc,_0x5b1688){const _0x5847ab=a152_0x25b4a3,_0x4f2025=new Set();for(const {yamlConfig:_0x2439a9,folderPath:_0x15c6b2}of _0x289635){_0x4f2025[_0x5847ab(0x1c5)](_0x15c6b2+':'+_0x2439a9[_0x5847ab(0x1b0)]);}return _0x3dcb69[_0x5847ab(0x103)](_0x33d51c=>{const _0x526621=_0x5847ab,_0x2e2aca=_0x33d51c[_0x526621(0x12b)]?_0x544ac2[_0x526621(0x151)](_0x33d51c[_0x526621(0x12b)][_0x526621(0x1da)]())||'':'',_0x440a8d=_0x2e2aca+':'+_0x33d51c[_0x526621(0x1b0)];if(_0x4f2025[_0x526621(0x12f)](_0x440a8d))return![];if(_0x5b1688)return _0x2e2aca===_0x5c59dc||_0x2e2aca[_0x526621(0x1fc)](_0x5c59dc+'/');return!![];});}export function findJourneysToDelete(_0x4cf26e,_0x2749e3,_0x32b442,_0x9cc7c0,_0xc9aaf2){const _0x20650e=a152_0x25b4a3,_0x1868e2=new Set();for(const {yamlConfig:_0x327b01,folderPath:_0x1ea087}of _0x2749e3){_0x1868e2[_0x20650e(0x1c5)](_0x1ea087+':'+_0x327b01['name']);}return _0x4cf26e[_0x20650e(0x103)](_0x1fa307=>{const _0x3d313b=_0x20650e,_0x34feba=_0x1fa307['folderId']?_0x32b442['get'](_0x1fa307[_0x3d313b(0x164)])||'':'',_0x2c157b=_0x34feba+':'+_0x1fa307[_0x3d313b(0x19b)];if(_0x1868e2[_0x3d313b(0x12f)](_0x2c157b))return![];if(_0xc9aaf2)return _0x34feba===_0x9cc7c0||_0x34feba['startsWith'](_0x9cc7c0+'/');return!![];});}export function buildSegmentLookupMap(_0xaa0d9d,_0x16600a){const _0x470e02=a152_0x25b4a3,_0x9e69c1=new Map();for(const _0x503141 of _0xaa0d9d){const _0x916ff=_0x503141['segmentFolderId']?_0x16600a[_0x470e02(0x151)](_0x503141[_0x470e02(0x12b)]['toString']())||'':'',_0x49eb80=_0x916ff+':'+_0x503141[_0x470e02(0x1b0)];_0x9e69c1[_0x470e02(0x168)](_0x49eb80,_0x503141);}return _0x9e69c1;}export function buildSegmentNameToIdMap(_0x2e7903){const _0x151500=a152_0x25b4a3,_0x3d3fb2=new Map();for(const _0x189007 of _0x2e7903){_0x3d3fb2[_0x151500(0x168)](_0x189007[_0x151500(0x1b0)],_0x189007['id']);}return _0x3d3fb2;}export function buildJourneyBundleLookupMap(_0x1887ea,_0x1d7310){const _0xcb2970=a152_0x25b4a3,_0x19a6d9=new Map();for(const _0x2833a8 of _0x1887ea){const _0x484404=_0x2833a8[_0xcb2970(0x164)]?_0x1d7310[_0xcb2970(0x151)](_0x2833a8['folderId'])||'':'',_0x208a96=_0x484404+':'+_0x2833a8[_0xcb2970(0x19b)];!_0x19a6d9[_0xcb2970(0x12f)](_0x208a96)&&_0x19a6d9[_0xcb2970(0x168)](_0x208a96,[]),_0x19a6d9[_0xcb2970(0x151)](_0x208a96)[_0xcb2970(0x17d)](_0x2833a8);}for(const _0x5d3cbd of _0x19a6d9[_0xcb2970(0x10a)]()){_0x5d3cbd['sort']((_0x5e1f6d,_0x3bd3bb)=>(_0x5e1f6d['versionNumber']||0x0)-(_0x3bd3bb[_0xcb2970(0x12c)]||0x0));}return _0x19a6d9;}export function collectFoldersToCreate(_0xd5ad37,_0x15b853){const _0x101cbd=a152_0x25b4a3,_0x3d1b90=new Set();for(const _0x11258c of _0xd5ad37){if(!_0x11258c)continue;if(_0x15b853['has'](_0x11258c))continue;const _0x273038=_0x11258c['split']('/');let _0x5b1a28='';for(const _0x46a902 of _0x273038){_0x5b1a28=_0x5b1a28?_0x5b1a28+'/'+_0x46a902:_0x46a902,!_0x15b853[_0x101cbd(0x12f)](_0x5b1a28)&&_0x3d1b90[_0x101cbd(0x1c5)](_0x5b1a28);}}return _0x3d1b90;}export function parseAndClassifyYamlFiles(_0x45f68b,_0x3982b1,_0x15cebe){const _0xb7423d=a152_0x25b4a3,_0x51c84f=[],_0x28865c=[];for(const _0x5a812c of _0x45f68b){const _0x4c8f8a=a152_0x5c5da7[_0xb7423d(0x1d5)](_0x3982b1,a152_0x5c5da7[_0xb7423d(0x163)](_0x5a812c)),_0x31a776=_0x4c8f8a==='.'?'':_0x4c8f8a[_0xb7423d(0x113)](/\\/g,'/'),_0x5d0132=readFileSync(_0x5a812c,_0xb7423d(0x1a2)),_0x317009=a152_0x19c01e[_0xb7423d(0x1a6)](_0x5d0132);if(isJourneyDef(_0x317009)){const _0xdc84e3=a152_0x3b46a5(_0x5d0132);_0x28865c[_0xb7423d(0x17d)]({'yamlConfig':_0xdc84e3,'folderPath':_0x31a776,'sourcePath':_0x5a812c});}else{if(!_0x15cebe?.[_0xb7423d(0x148)]){const _0x3dc6e4=parseSegmentYamlFile(_0x5d0132),_0x200fc4=normalizeChildSegmentYaml(_0x3dc6e4);_0x51c84f[_0xb7423d(0x17d)]({'yamlConfig':_0x200fc4,'folderPath':_0x31a776,'sourcePath':_0x5a812c});}}}return{'segments':_0x51c84f,'journeys':_0x28865c};}export function validateParsedFiles(_0xcb9e3a,_0x4d575d){const _0x5d5bfb=a152_0x25b4a3,_0x2644d3=[];for(const {yamlConfig:_0x3d3df7,sourcePath:_0x2cb0dd}of _0xcb9e3a[_0x5d5bfb(0x1e4)]){const _0x5445b7=readFileSync(_0x2cb0dd,'utf-8'),_0x479ec8=a152_0x19c01e['parseDocument'](_0x5445b7),_0x425642=validateSegmentDef(_0x3d3df7,{'source':_0x5445b7,'document':_0x479ec8},{'skipSchema':!![]});if(!_0x425642[_0x5d5bfb(0x180)]){const _0x3e3bed=a152_0x5c5da7[_0x5d5bfb(0x1d5)](_0x4d575d,_0x2cb0dd);_0x2644d3[_0x5d5bfb(0x17d)]({'filePath':_0x3e3bed,'source':_0x5445b7,'result':_0x425642,'isJourney':![]});}}for(const {yamlConfig:_0x549eb3,sourcePath:_0x4e6cbe}of _0xcb9e3a[_0x5d5bfb(0x147)]){const _0x154c4b=readFileSync(_0x4e6cbe,_0x5d5bfb(0x1a2)),_0x470f28=a152_0x19c01e[_0x5d5bfb(0x1be)](_0x154c4b),_0x9d45aa=validateJourneyDef(_0x549eb3,{'source':_0x154c4b,'document':_0x470f28},{'skipSchema':!![]});if(!_0x9d45aa[_0x5d5bfb(0x180)]){const _0x39f2e3=a152_0x5c5da7[_0x5d5bfb(0x1d5)](_0x4d575d,_0x4e6cbe);_0x2644d3['push']({'filePath':_0x39f2e3,'source':_0x154c4b,'result':_0x9d45aa,'isJourney':!![]});}}return _0x2644d3;}export function formatValidationErrors(_0x46138e){const _0x327259=a152_0x25b4a3,_0x51e383=[];for(const {filePath:_0x582040,source:_0x3dff4b,result:_0xcb42ba,isJourney:_0x46b37a}of _0x46138e){const _0x40616b=_0x46b37a?'journey':_0x327259(0x1c4);_0x51e383['push']('\x0a'+_0x582040+'\x20('+_0x40616b+_0x327259(0x1bb)+_0xcb42ba[_0x327259(0x1d3)][_0x327259(0x1d0)]+'\x20error(s)'),_0x51e383['push'](formatValidationResult(_0xcb42ba,_0x3dff4b,_0x582040));}return _0x51e383[_0x327259(0x138)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x455533){const _0x1c0265=a152_0x25b4a3,_0x505446=new Set(),_0x51ef14=new Map(),_0x4fff7f=collectSegmentUsageCounts(_0x455533);if(_0x455533[_0x1c0265(0x1e4)])for(const [_0x1329d4,_0x4ec525]of Object[_0x1c0265(0x10c)](_0x455533[_0x1c0265(0x1e4)])){_0x505446['add'](_0x1329d4);if(_0x4ec525[_0x1c0265(0x162)]){const _0x8b5b51=yamlRuleToApi(_0x4ec525[_0x1c0265(0x162)]),_0x333e01=apiRuleToYaml(_0x8b5b51);_0x51ef14[_0x1c0265(0x168)](_0x1329d4,_0x333e01);}}const _0x3a51ee=new Map();let _0x152966=0x0;for(const [_0x26b35e,_0x2a356a]of _0x51ef14){const _0xc82131=serializeExpandedRule(_0x2a356a,_0x51ef14),_0x292291=_0x3a51ee['get'](_0xc82131)||[];_0x292291[_0x1c0265(0x17d)]({'name':_0x26b35e,'index':_0x152966}),_0x3a51ee['set'](_0xc82131,_0x292291),_0x152966++;}const _0x55eb2c=new Map();for(const [_0x3c6e41,_0x25e055]of _0x3a51ee){const _0x305fbf=_0x25e055[_0x1c0265(0x197)]()[_0x1c0265(0x100)]((_0x564610,_0x998dbd)=>{const _0x300509=_0x1c0265,_0xf00862=_0x4fff7f[_0x300509(0x151)](_0x564610['name'])||0x0,_0x268a0e=_0x4fff7f[_0x300509(0x151)](_0x998dbd[_0x300509(0x1b0)])||0x0;if(_0xf00862!==_0x268a0e)return _0x268a0e-_0xf00862;return _0x564610[_0x300509(0x11c)]-_0x998dbd['index'];})['map'](_0xf86a0b=>_0xf86a0b[_0x1c0265(0x1b0)]),_0x39490f=[];for(const _0x2eed6b of _0x305fbf){const _0x335c42=_0x4fff7f[_0x1c0265(0x151)](_0x2eed6b)||0x0,_0x205ff3=Math[_0x1c0265(0x1b3)](_0x335c42,0x1);for(let _0x4f1da4=0x0;_0x4f1da4<_0x205ff3;_0x4f1da4++){_0x39490f[_0x1c0265(0x17d)](_0x2eed6b);}}_0x55eb2c[_0x1c0265(0x168)](_0x3c6e41,_0x39490f);}return{'existingLocalSegmentNames':_0x505446,'localSegmentRules':_0x51ef14,'localExpandedRuleToNames':_0x55eb2c};}export function createSegmentIdResolver(_0x1745ab,_0x416635){return async _0x352f97=>{const _0x1fe629=a152_0x3f4b,_0x1450ed=_0x1745ab[_0x1fe629(0x151)](_0x352f97);if(!_0x1450ed)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1fe629(0x1ee)+_0x352f97+_0x1fe629(0x18b)+_0x416635+'\x27)');return _0x1450ed;};}export function extractRootFolderId(_0xa5a856){const _0x83377f=a152_0x25b4a3;return _0xa5a856[_0x83377f(0x17b)]?.[_0x83377f(0x1dc)]?.[_0x83377f(0x178)]?.['id']||_0xa5a856[_0x83377f(0x17b)]?.[_0x83377f(0x1bc)]?.[_0x83377f(0x178)]?.['id'];}export function buildConnectionMaps(_0x46e27f){const _0x303de4=a152_0x25b4a3,_0x3c3dd5=new Map(),_0x223e10=new Map(),_0xca83b8=new Map();for(const _0x55ddde of _0x46e27f){_0x3c3dd5[_0x303de4(0x168)](_0x55ddde[_0x303de4(0x1b0)],parseInt(_0x55ddde['id'],0xa)),_0x223e10['set'](_0x55ddde['id'],_0x55ddde['name']),_0xca83b8[_0x303de4(0x168)](_0x55ddde[_0x303de4(0x1b0)],_0x55ddde[_0x303de4(0x114)]);}return{'nameToId':_0x3c3dd5,'idToName':_0x223e10,'nameToType':_0xca83b8};}export function calculatePushStats(_0xfe69c9,_0x2e6a0f,_0x39286b,_0x2e9a54,_0x4545b6,_0x1a921b,_0xb358d6){const _0x194222=a152_0x25b4a3,_0x34faab=_0xfe69c9[_0x194222(0x103)](_0x370979=>_0x370979[_0x194222(0x185)]),_0x5bcb27=_0xfe69c9['filter'](_0xdf0a9e=>!_0xdf0a9e[_0x194222(0x185)]&&_0xdf0a9e['hasChanges']),_0x213a97=_0xfe69c9[_0x194222(0x103)](_0x544583=>!_0x544583[_0x194222(0x185)]&&!_0x544583[_0x194222(0x1f9)]),_0x2339c0=_0x1a921b?_0x2e9a54:[],_0x3770a5=_0x2e6a0f[_0x194222(0x103)](_0x4435da=>_0x4435da[_0x194222(0x185)]),_0x3cd9b9=_0x2e6a0f['filter'](_0x557dad=>!_0x557dad[_0x194222(0x185)]&&_0x557dad[_0x194222(0x1f9)]),_0xa1eaf5=_0x2e6a0f[_0x194222(0x103)](_0x29123c=>!_0x29123c[_0x194222(0x185)]&&!_0x29123c['hasChanges']),_0x103206=_0x1a921b?_0x4545b6:[],_0x4eb9f0=_0xfe69c9[_0x194222(0x128)](_0x223cf7=>_0x223cf7['activationActions']),_0xbf8c0e=_0x4eb9f0[_0x194222(0x103)](_0x4ae39a=>_0x4ae39a[_0x194222(0x114)]===_0x194222(0x146)),_0x5be745=_0x4eb9f0['filter'](_0x555fde=>_0x555fde[_0x194222(0x114)]===_0x194222(0x181)),_0x5368c2=_0x4eb9f0[_0x194222(0x103)](_0x172a37=>_0x172a37[_0x194222(0x114)]===_0x194222(0x12d)),_0xcf1b81=Array[_0x194222(0x1f8)](_0x39286b)[_0x194222(0x100)](),_0x219bf5=_0xb358d6?![]:_0x34faab[_0x194222(0x1d0)]>0x0||_0x5bcb27[_0x194222(0x1d0)]>0x0||_0x2339c0[_0x194222(0x1d0)]>0x0,_0x5917f3=_0x3770a5['length']>0x0||_0x3cd9b9['length']>0x0||_0x103206[_0x194222(0x1d0)]>0x0,_0x15faca=_0xb358d6?![]:_0x4eb9f0[_0x194222(0x1d0)]>0x0,_0x24e329=_0xcf1b81['length']>0x0;return{'segments':{'new':_0x34faab,'changed':_0x5bcb27,'unchanged':_0x213a97,'toDelete':_0x2339c0},'journeys':{'new':_0x3770a5,'changed':_0x3cd9b9,'unchanged':_0xa1eaf5,'toDelete':_0x103206},'activations':{'all':_0x4eb9f0,'toCreate':_0xbf8c0e,'toUpdate':_0x5be745,'toDelete':_0x5368c2},'folders':{'toCreate':_0xcf1b81},'counts':{'segments':{'new':_0x34faab[_0x194222(0x1d0)],'changed':_0x5bcb27[_0x194222(0x1d0)],'unchanged':_0x213a97[_0x194222(0x1d0)],'toDelete':_0x2339c0[_0x194222(0x1d0)]},'journeys':{'new':_0x3770a5[_0x194222(0x1d0)],'changed':_0x3cd9b9[_0x194222(0x1d0)],'unchanged':_0xa1eaf5[_0x194222(0x1d0)],'toDelete':_0x103206[_0x194222(0x1d0)]},'activations':{'create':_0xbf8c0e[_0x194222(0x1d0)],'update':_0x5be745[_0x194222(0x1d0)],'delete':_0x5368c2[_0x194222(0x1d0)]},'folders':_0xcf1b81['length']},'hasChanges':_0x219bf5||_0x5917f3||_0x15faca||_0x24e329};}export async function buildPushExecutionContext(_0x44ea62,_0x711871,_0x2a42d4,_0x59dcac,_0x4f73f0,_0x509fad){const _0x1efda6=a152_0x25b4a3,_0x38347b=extractRootFolderId(_0x2a42d4),{pathToId:_0x1551c6,idToPath:_0x456b8e}=buildFolderMaps(_0x4f73f0),_0x3adc85=buildSegmentNameToIdMap(_0x59dcac),_0x406dd9=new Map(),{batchAsync:_0x3a6b4f}=await import('../../utils/async.js'),[_0x55e09e,_0x1bca7a]=await Promise[_0x1efda6(0x1e6)]([_0x44ea62[_0x1efda6(0x1a1)][_0x1efda6(0x1b2)](),_0x44ea62[_0x1efda6(0x123)][_0x1efda6(0x130)](),((async()=>{const _0x42018e=_0x1efda6;!_0x509fad&&_0x59dcac[_0x42018e(0x1d0)]>0x0&&await _0x3a6b4f(_0x59dcac,async _0x44dd0c=>{const _0x462d67=_0x42018e,_0x234e58=await _0x44ea62[_0x462d67(0x1c4)][_0x462d67(0x171)](_0x711871,_0x44dd0c['id']);_0x406dd9['set'](_0x44dd0c['id'],_0x234e58);});})())]),{emailToId:_0x2cf07a,idToEmail:_0x404385}=_0x55e09e,_0x2fe65f=buildConnectionMaps(_0x1bca7a);return{'rootFolderId':_0x38347b,'folderPathToId':_0x1551c6,'folderIdToPath':_0x456b8e,'segmentNameToId':_0x3adc85,'activationsBySegmentId':_0x406dd9,'emailToIdMap':_0x2cf07a,'idToEmailMap':_0x404385,'connectionNameToIdMap':_0x2fe65f[_0x1efda6(0x104)],'connectionIdToNameMap':_0x2fe65f[_0x1efda6(0x13f)],'connectionNameToTypeMap':_0x2fe65f['nameToType']};}export function createPushYamlContextForBundle(_0x508ccc,_0x220ff9,_0x3a695e,_0x86ac39,_0x36b2dd,_0x3c11e5,_0x428862,_0x4ab224){const {existingLocalSegmentNames:_0x1684b6,localExpandedRuleToNames:_0x1f4158}=_0x86ac39,_0xdc8eca=new Set(),_0x307e07=new Map(),_0x43899a=new Map(),_0x15c545=new Map(),_0x1b6141=createJumpTargetCache(),_0x4bcd4b=new Map(),_0x290e9b=new Map(),_0x260e83=new Set();let _0x57464f;const _0x15cc12=_0x2f9b7b=>{const _0x3b0580={'resolveSegment':async _0x4bff81=>{const _0x4ef71d=a152_0x3f4b,_0x15eced=_0x15c545['get'](_0x4bff81);if(_0x15eced!==undefined)return{'name':_0x15eced,'isJourneyLocal':!![]};try{const _0x4d2097=await fetchSegment(_0x508ccc,_0x220ff9,_0x4bff81,_0x3a695e);if(!_0x4d2097)throw new Error('Segment\x20not\x20found');const _0x3ed8e2=generateJourneyLocalName(_0x4d2097[_0x4ef71d(0x1b0)]),_0xb50200=_0x4d2097[_0x4ef71d(0x19a)]===SEGMENT_KIND_JOURNEY&&_0x3ed8e2!==undefined;let _0x4bc983=_0x4d2097['name'],_0x68e0d9;if(_0xb50200&&_0x4d2097['rule']){const _0x3fb695=apiRuleToYaml(_0x4d2097[_0x4ef71d(0x162)]);_0x290e9b[_0x4ef71d(0x168)](_0x4bff81,_0x3fb695);const _0x3118bd=async _0x343ea9=>{const _0x141569=_0x4ef71d,_0x1fa837=collectSegmentRefsFromRule(_0x343ea9);for(const _0x5db000 of _0x1fa837){if(!_0x290e9b[_0x141569(0x12f)](_0x5db000))try{const _0x520e59=await fetchSegment(_0x508ccc,_0x220ff9,_0x5db000,_0x3a695e);if(_0x520e59?.[_0x141569(0x162)]){const _0x8959e1=apiRuleToYaml(_0x520e59[_0x141569(0x162)]);_0x290e9b[_0x141569(0x168)](_0x5db000,_0x8959e1),await _0x3118bd(_0x8959e1);}}catch(_0x1958d8){logger['debug'](_0x141569(0x1e0)+_0x5db000+':\x20'+_0x1958d8);}}};await _0x3118bd(_0x3fb695);const _0x4eea98=serializeExpandedRule(_0x3fb695,_0x290e9b),_0x4f3b96=_0x1f4158[_0x4ef71d(0x151)](_0x4eea98);if(_0x4f3b96&&_0x4f3b96['length']>0x0){const _0x556e15=_0x307e07[_0x4ef71d(0x151)](_0x4eea98)||0x0,_0x21e16f=_0x4f3b96[_0x556e15]||_0x4f3b96[_0x4f3b96[_0x4ef71d(0x1d0)]-0x1];_0x307e07[_0x4ef71d(0x168)](_0x4eea98,_0x556e15+0x1),_0x4bc983=_0x21e16f,_0xdc8eca['add'](_0x4bc983),_0x15c545[_0x4ef71d(0x168)](_0x4bff81,_0x4bc983);const _0x5b8626=await resolveRuleSegmentRefs(_0x3fb695,async _0x257242=>{const _0x452c7d=_0x4ef71d,_0x12d310=_0x15c545[_0x452c7d(0x151)](_0x257242);if(_0x12d310)return _0x12d310;const _0x491a1e=await _0x57464f[_0x452c7d(0x1b7)](_0x257242);return _0x491a1e[_0x452c7d(0x1b0)];});_0x68e0d9={'description':_0x4d2097['description'],'rule':_0x5b8626};}else{const _0x183a80=_0x4bcd4b[_0x4ef71d(0x151)](_0x4eea98);if(_0x183a80)_0x4bc983=_0x183a80,_0x15c545[_0x4ef71d(0x168)](_0x4bff81,_0x4bc983);else{if(_0x3ed8e2){let _0x574d1b=_0x3ed8e2,_0x70ea83=0x2;while(_0xdc8eca[_0x4ef71d(0x12f)](_0x574d1b)||_0x1684b6['has'](_0x574d1b)){_0x574d1b=_0x3ed8e2+'_'+_0x70ea83,_0x70ea83++;}_0xdc8eca[_0x4ef71d(0x1c5)](_0x574d1b),_0x4bc983=_0x574d1b;}_0x15c545[_0x4ef71d(0x168)](_0x4bff81,_0x4bc983),_0x4bcd4b[_0x4ef71d(0x168)](_0x4eea98,_0x4bc983);const _0x1a3744=await resolveRuleSegmentRefs(_0x3fb695,async _0x5ef1f9=>{const _0x479564=_0x4ef71d,_0x1defdb=_0x15c545[_0x479564(0x151)](_0x5ef1f9);if(_0x1defdb)return _0x1defdb;const _0x4858f3=await _0x57464f[_0x479564(0x1b7)](_0x5ef1f9);return _0x4858f3[_0x479564(0x1b0)];});_0x68e0d9={'description':_0x4d2097[_0x4ef71d(0x1b9)],'rule':_0x1a3744};}}}return{'name':_0x4bc983,'isJourneyLocal':_0xb50200,'definition':_0x68e0d9};}catch(_0x22491d){return logger[_0x4ef71d(0x1cc)](_0x4ef71d(0x11e)+_0x4bff81+':\x20'+_0x22491d),{'name':_0x4bff81,'isJourneyLocal':![]};}},'resolveActivation':async _0x2617a6=>{const _0x66a7e5=a152_0x3f4b,_0x18f5a0=_0x43899a[_0x66a7e5(0x151)](_0x2617a6);if(_0x18f5a0!==undefined)return{'name':_0x18f5a0,'isJourneyLocal':!![]};try{let _0x273b53=_0x428862?.[_0x66a7e5(0x151)](_0x2617a6);!_0x273b53&&(_0x273b53=await _0x508ccc[_0x66a7e5(0x174)][_0x66a7e5(0x18f)](_0x2f9b7b,_0x2617a6));const _0x20866e=_0x273b53['attributes']['activationParams'][_0x66a7e5(0x1b0)]||_0x2617a6,_0x2badbf=sanitizeYamlKey(_0x20866e)||_0x66a7e5(0x1db)+_0x2617a6,_0x570d31=_0x2badbf;_0x43899a['set'](_0x2617a6,_0x570d31);const _0x78e362=journeyActivationStepToYaml(_0x273b53,_0x36b2dd,_0x3c11e5);return{'name':_0x570d31,'isJourneyLocal':!![],'definition':_0x78e362};}catch(_0x4deef7){return logger[_0x66a7e5(0x1cc)]('Failed\x20to\x20resolve\x20activation\x20'+_0x2617a6+':\x20'+_0x4deef7),{'name':_0x2617a6,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2da6d6,_0x16f55a)=>resolveJumpTarget(_0x2da6d6,_0x16f55a,_0x1b6141,async _0x3b00f6=>{const _0x3794ab=a152_0x3f4b,_0x172ddf=_0x4ab224?.[_0x3794ab(0x151)](_0x3b00f6);if(_0x172ddf)return _0x172ddf;return _0x508ccc[_0x3794ab(0x174)]['getJourney'](_0x3b00f6);})};return _0x57464f=_0x3b0580,_0x3b0580;},_0x49fee9=async _0x4974d9=>{const _0x1d3e29=a152_0x3f4b,{collectSegmentIdsFromJourneyApi:_0x4f90e0}=await import(_0x1d3e29(0x14e)),{batchAsync:_0x4c3da7}=await import(_0x1d3e29(0x111)),_0x37bf94=new Set();for(const _0x279586 of _0x4974d9){let _0x160bd8=_0x4ab224?.['get'](_0x279586);!_0x160bd8&&(_0x160bd8=await _0x508ccc[_0x1d3e29(0x174)][_0x1d3e29(0x1e3)](_0x279586));const _0x2a8310=_0x4f90e0(_0x160bd8);for(const _0x4b4511 of _0x2a8310){_0x37bf94[_0x1d3e29(0x1c5)](_0x4b4511);}}let _0x17ce1a=Array[_0x1d3e29(0x1f8)](_0x37bf94);while(_0x17ce1a[_0x1d3e29(0x1d0)]>0x0){const _0x54a3c6=_0x17ce1a[_0x1d3e29(0x103)](_0x418071=>!_0x260e83[_0x1d3e29(0x12f)](_0x418071));if(_0x54a3c6[_0x1d3e29(0x1d0)]===0x0)break;const _0x50fb4c=await _0x4c3da7(_0x54a3c6,async _0x22aeb9=>{_0x260e83['add'](_0x22aeb9);const _0x2c9fcf=await fetchSegment(_0x508ccc,_0x220ff9,_0x22aeb9,_0x3a695e);if(!_0x2c9fcf)return null;return{'segmentId':_0x22aeb9,'segment':_0x2c9fcf};},0xa),_0x305024=new Set();for(const _0x5ef99f of _0x50fb4c){if(!_0x5ef99f?.[_0x1d3e29(0x1c4)]?.[_0x1d3e29(0x162)])continue;const _0xb86270=apiRuleToYaml(_0x5ef99f[_0x1d3e29(0x1c4)][_0x1d3e29(0x162)]);_0x290e9b[_0x1d3e29(0x168)](_0x5ef99f[_0x1d3e29(0x153)],_0xb86270);const _0x1751e7=collectSegmentRefsFromRule(_0xb86270);for(const _0x2af9c4 of _0x1751e7){!_0x260e83[_0x1d3e29(0x12f)](_0x2af9c4)&&_0x305024['add'](_0x2af9c4);}}_0x17ce1a=Array['from'](_0x305024);}};return{'createYamlContext':_0x15cc12,'prefetchJourneySegments':_0x49fee9};}export async function executePushSegments(_0x472db3,_0x55e794,_0x422f8c,_0x2e560f,_0xf25fd3){const _0x1af19a=a152_0x25b4a3,{segmentDefToCreateRequest:_0x412e2d,segmentDefToUpdateRequest:_0x43ca78}=await import(_0x1af19a(0x13b)),_0x5baa7b=_0x422f8c['folderPathToId'],_0x5abf4a=0x5,_0x3e2f4f=async _0xfebeb=>{const _0x5f0b0f=_0x1af19a,_0x1c2a34=_0xfebeb['folderPath']?_0x5baa7b[_0x5f0b0f(0x151)](_0xfebeb[_0x5f0b0f(0x160)]):undefined;let _0x12f536;const _0x130e5a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x33ca93=_0xfebeb[_0x5f0b0f(0x199)];if(_0xfebeb['yamlConfig']['rule']){const _0x471874=createSegmentIdResolver(_0x422f8c[_0x5f0b0f(0x14b)],_0xfebeb['yamlConfig'][_0x5f0b0f(0x1b0)]),_0x22a0ac=await resolveRuleSegmentIds(_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x162)],_0x471874);_0x33ca93={..._0xfebeb['yamlConfig'],'rule':_0x22a0ac};}try{if(_0xfebeb['isNew']){_0xf25fd3['onProgress']?.({'type':_0x5f0b0f(0x13c),'name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]});const _0x2672ed=_0x412e2d(_0x33ca93,_0x1c2a34),_0x26c9cf=await _0xf25fd3[_0x5f0b0f(0x1c0)]('Creating\x20segment\x20\x27'+_0xfebeb[_0x5f0b0f(0x199)]['name']+_0x5f0b0f(0x12a),()=>_0x472db3['segment'][_0x5f0b0f(0x108)](_0x2e560f[_0x5f0b0f(0x145)],_0x2672ed));_0x12f536=_0x26c9cf['data']['id'],_0x422f8c[_0x5f0b0f(0x14b)][_0x5f0b0f(0x168)](_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)],_0x12f536),_0x130e5a[_0x5f0b0f(0x1df)]={'name':_0xfebeb['yamlConfig']['name'],'id':_0x12f536},_0xf25fd3[_0x5f0b0f(0x1aa)]?.({'type':'segment_created','name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)],'segmentId':_0x12f536}),_0xf25fd3[_0x5f0b0f(0x1e2)]?.(_0x5f0b0f(0x1c1)+_0xfebeb['yamlConfig'][_0x5f0b0f(0x1b0)]+'\x27'),_0x130e5a[_0x5f0b0f(0x167)]=0x1;}else{if(_0xfebeb[_0x5f0b0f(0x1f9)]){_0xf25fd3[_0x5f0b0f(0x1aa)]?.({'type':'segment_updating','name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]});const _0x395b10=_0x43ca78(_0x33ca93);_0x1c2a34!==_0xfebeb[_0x5f0b0f(0x1a3)]?.[_0x5f0b0f(0x12b)]&&(_0x395b10['segmentFolderId']=_0x1c2a34?parseInt(_0x1c2a34,0xa):undefined),await _0xf25fd3[_0x5f0b0f(0x1c0)](_0x5f0b0f(0x1e8)+_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]+_0x5f0b0f(0x12a),()=>_0x472db3[_0x5f0b0f(0x1c4)][_0x5f0b0f(0x1ef)](_0x2e560f[_0x5f0b0f(0x145)],_0xfebeb[_0x5f0b0f(0x1a3)]['id'],_0x395b10)),_0x12f536=_0xfebeb[_0x5f0b0f(0x1a3)]['id'],_0xf25fd3['onProgress']?.({'type':'segment_updated','name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]}),_0xf25fd3['logSuccess']?.(_0x5f0b0f(0x1c9)+_0xfebeb[_0x5f0b0f(0x199)]['name']+'\x27'),_0x130e5a[_0x5f0b0f(0x1d4)]=0x1;}else _0x12f536=_0xfebeb['existingSegment']['id'];}}catch(_0x28698b){const _0x291457=isHttp400Error(_0x28698b),_0x3484d2=_0x291457?ErrorCode[_0x5f0b0f(0x121)]:ErrorCode[_0x5f0b0f(0x1cd)],_0x42db44=getErrorMessage(_0x28698b);throw new SDKError(_0x3484d2,_0x5f0b0f(0x1f6)+(_0xfebeb[_0x5f0b0f(0x185)]?'create':_0x5f0b0f(0x181))+_0x5f0b0f(0x144)+_0xfebeb[_0x5f0b0f(0x15c)]+_0x5f0b0f(0x190)+_0x42db44,_0x28698b);}try{const _0x48b93=await syncActivationsForSegment(_0x472db3,_0x2e560f[_0x5f0b0f(0x145)],_0x12f536,_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)],_0xfebeb['activationActions'],_0xf25fd3,_0xfebeb['absolutePath']);_0x130e5a[_0x5f0b0f(0x1bf)]=_0x48b93;}catch(_0x505fd4){if(_0x505fd4 instanceof SDKError)throw _0x505fd4;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]+'\x27\x20from\x20file:\x20'+_0xfebeb[_0x5f0b0f(0x15c)]+'\x0a\x20\x20'+getErrorMessage(_0x505fd4),_0x505fd4);}return _0x130e5a;},_0x52d5d2=await batchAsync(_0x55e794,_0x3e2f4f,_0x5abf4a),_0xd34c6e={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x49a27b of _0x52d5d2){_0xd34c6e['created']+=_0x49a27b[_0x1af19a(0x167)],_0xd34c6e[_0x1af19a(0x1d4)]+=_0x49a27b[_0x1af19a(0x1d4)],_0x49a27b[_0x1af19a(0x1df)]&&_0xd34c6e[_0x1af19a(0x1ff)][_0x1af19a(0x168)](_0x49a27b[_0x1af19a(0x1df)][_0x1af19a(0x1b0)],_0x49a27b[_0x1af19a(0x1df)]['id']),_0xd34c6e[_0x1af19a(0x1bf)][_0x1af19a(0x167)]+=_0x49a27b['activations'][_0x1af19a(0x167)],_0xd34c6e['activations']['updated']+=_0x49a27b[_0x1af19a(0x1bf)][_0x1af19a(0x1d4)],_0xd34c6e[_0x1af19a(0x1bf)][_0x1af19a(0x139)]+=_0x49a27b[_0x1af19a(0x1bf)][_0x1af19a(0x139)];}return _0xd34c6e;}async function syncActivationsForSegment(_0x395e79,_0x49b752,_0x165758,_0x1715c0,_0x696048,_0x131750,_0x3337a3){const _0x3c012b=a152_0x25b4a3,_0x4e0fbc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2251d3 of _0x696048){try{if(_0x2251d3[_0x3c012b(0x114)]===_0x3c012b(0x146)&&_0x2251d3[_0x3c012b(0x11d)])_0x131750[_0x3c012b(0x1aa)]?.({'type':_0x3c012b(0x124),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),await _0x131750[_0x3c012b(0x1c0)](_0x3c012b(0x18d)+_0x2251d3['name']+_0x3c012b(0x12a),()=>_0x395e79[_0x3c012b(0x1c4)][_0x3c012b(0x189)](_0x49b752,_0x165758,_0x2251d3[_0x3c012b(0x11d)])),_0x131750[_0x3c012b(0x1aa)]?.({'type':_0x3c012b(0x17c),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),_0x131750['logSuccess']?.(_0x3c012b(0x132)+_0x2251d3['name']+'\x27'),_0x4e0fbc[_0x3c012b(0x167)]++;else{if(_0x2251d3[_0x3c012b(0x114)]===_0x3c012b(0x181)&&_0x2251d3[_0x3c012b(0x11d)]&&_0x2251d3['existingActivation'])_0x131750[_0x3c012b(0x1aa)]?.({'type':_0x3c012b(0x11f),'segmentName':_0x1715c0,'activationName':_0x2251d3['name']}),await _0x131750['withProgress'](_0x3c012b(0x140)+_0x2251d3['name']+_0x3c012b(0x12a),()=>_0x395e79[_0x3c012b(0x1c4)][_0x3c012b(0x1c6)](_0x49b752,_0x165758,_0x2251d3['existingActivation']['id'],_0x2251d3[_0x3c012b(0x11d)])),_0x131750['onProgress']?.({'type':_0x3c012b(0x1f0),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),_0x131750['logSuccess']?.(_0x3c012b(0x142)+_0x2251d3[_0x3c012b(0x1b0)]+'\x27'),_0x4e0fbc[_0x3c012b(0x1d4)]++;else _0x2251d3[_0x3c012b(0x114)]===_0x3c012b(0x12d)&&_0x2251d3[_0x3c012b(0x1ad)]&&(_0x131750['onProgress']?.({'type':_0x3c012b(0x125),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),await _0x131750[_0x3c012b(0x1c0)](_0x3c012b(0x16c)+_0x2251d3[_0x3c012b(0x1b0)]+_0x3c012b(0x12a),()=>_0x395e79[_0x3c012b(0x1c4)][_0x3c012b(0x107)](_0x49b752,_0x165758,_0x2251d3['existingActivation']['id'])),_0x131750['onProgress']?.({'type':_0x3c012b(0x1c2),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),_0x131750[_0x3c012b(0x15a)]?.('Deleted\x20activation\x20\x27'+_0x2251d3[_0x3c012b(0x1b0)]+'\x27'),_0x4e0fbc[_0x3c012b(0x139)]++);}}catch(_0xa6830e){const _0x2b1e12=isHttp400Error(_0xa6830e),_0x57c578=_0x2b1e12?ErrorCode[_0x3c012b(0x198)]:ErrorCode[_0x3c012b(0x169)],_0x159040=getErrorMessage(_0xa6830e);throw new SDKError(_0x57c578,_0x3c012b(0x1f6)+_0x2251d3[_0x3c012b(0x114)]+_0x3c012b(0x1e7)+_0x2251d3[_0x3c012b(0x1b0)]+_0x3c012b(0x1ac)+_0x3337a3+_0x3c012b(0x190)+_0x159040,_0xa6830e);}}return _0x4e0fbc;}export async function executePushFolders(_0x57f89b,_0x150ef1,_0x432a41,_0x463f5d,_0x4705a1){const _0x2443ae=a152_0x25b4a3,_0x3a0719=new Map(_0x432a41),_0x495a1f=sortFoldersByDepth(_0x150ef1);for(const _0x24107f of _0x495a1f){const _0x482da4=_0x24107f['split']('/'),_0x49b09a=_0x482da4[_0x482da4[_0x2443ae(0x1d0)]-0x1],_0x5c6aac=_0x482da4['slice'](0x0,-0x1)[_0x2443ae(0x138)]('/'),_0x133887=_0x3a0719[_0x2443ae(0x151)](_0x5c6aac);_0x4705a1[_0x2443ae(0x1aa)]?.({'type':'folder_creating','folder':_0x24107f});const _0x4b4bdf={'name':_0x49b09a,'parentFolderId':_0x133887},_0x54195c=await _0x4705a1[_0x2443ae(0x1c0)](_0x2443ae(0x193)+_0x24107f+_0x2443ae(0x12a),()=>_0x57f89b[_0x2443ae(0x1c4)][_0x2443ae(0x13d)](_0x463f5d['parentId'],_0x4b4bdf));_0x3a0719[_0x2443ae(0x168)](_0x24107f,_0x54195c[_0x2443ae(0x178)]['id']),_0x4705a1['onProgress']?.({'type':_0x2443ae(0x1f1),'folder':_0x24107f,'folderId':_0x54195c[_0x2443ae(0x178)]['id']}),_0x4705a1['logInfo']?.(_0x2443ae(0x15f)+_0x24107f+'\x27');}return _0x3a0719;}export async function executePushSegmentDeletions(_0x11de7d,_0x384cd3,_0x14172){const _0x5dc686=a152_0x25b4a3;if(_0x384cd3[_0x5dc686(0x1d0)]===0x0)return 0x0;const {batchAsync:_0x4eb526}=await import(_0x5dc686(0x111)),_0x43c125=0x5,_0x23a40c=await _0x4eb526(_0x384cd3,async _0x64648d=>{const _0x75184f=_0x5dc686;return _0x14172[_0x75184f(0x1aa)]?.({'type':_0x75184f(0x166),'name':_0x64648d[_0x75184f(0x1b0)]}),await _0x11de7d[_0x75184f(0x1c4)][_0x75184f(0x109)](_0x64648d['id']),_0x14172[_0x75184f(0x1aa)]?.({'type':_0x75184f(0x1fd),'name':_0x64648d[_0x75184f(0x1b0)]}),_0x14172[_0x75184f(0x15a)]?.(_0x75184f(0x14a)+_0x64648d[_0x75184f(0x1b0)]+'\x27'),0x1;},_0x43c125);return _0x23a40c[_0x5dc686(0x102)]((_0x3e453c,_0x478869)=>_0x3e453c+_0x478869,0x0);}export async function executePushJourneys(_0x8a7412,_0x102a17,_0x375072,_0x594d87,_0x4493ae){const _0x508822=a152_0x25b4a3,{journeyDefToRequest:_0x5273ab}=await import(_0x508822(0x14e)),{activationDefToCreateRequest:_0x468079,yamlRuleToApi:_0x79ee72,validateSegmentRule:_0x201f91}=await import(_0x508822(0x13b)),_0x214de9={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x56f928=new Map(_0x375072[_0x508822(0x14b)]),_0x5b7cbf=0x5;for(let _0x2c06a1=0x0;_0x2c06a1<_0x102a17['length'];_0x2c06a1+=_0x5b7cbf){const _0x4aa195=_0x102a17[_0x508822(0x197)](_0x2c06a1,_0x2c06a1+_0x5b7cbf),_0x14d143=await Promise['all'](_0x4aa195[_0x508822(0x1e1)](async _0x7cfc26=>{const _0xd3aa6b=_0x508822;if(!_0x7cfc26[_0xd3aa6b(0x185)]&&!_0x7cfc26['hasChanges'])return{'action':_0xd3aa6b(0x1cb),'name':_0x7cfc26['yamlConfig']['name'],'journeyId':_0x7cfc26['existingJourney']?.['id']};const _0x1c5ba3=_0x7cfc26[_0xd3aa6b(0x160)]?_0x375072[_0xd3aa6b(0x1a0)][_0xd3aa6b(0x151)](_0x7cfc26[_0xd3aa6b(0x160)]):undefined;_0x4493ae[_0xd3aa6b(0x1aa)]?.({'type':_0x7cfc26['isNew']?'journey_creating':_0xd3aa6b(0x15b),'name':_0x7cfc26['yamlConfig']['name']});try{const _0x3bbd14=await executeSingleJourneyPush(_0x8a7412,_0x7cfc26,{..._0x375072,'segmentNameToId':_0x56f928},{'parentId':_0x594d87[_0xd3aa6b(0x145)],'rootFolderId':_0x594d87[_0xd3aa6b(0x1b1)],'folderId':_0x1c5ba3,'verbose':_0x594d87['verbose']},_0x4493ae,{'journeyDefToRequest':_0x5273ab,'activationDefToCreateRequest':_0x468079,'yamlRuleToApi':_0x79ee72,'validateSegmentRule':_0x201f91});for(const [_0x2d6fb6,_0x4f5eb1]of _0x3bbd14['embeddedSegmentNameToId']){_0x56f928[_0xd3aa6b(0x168)](_0x2d6fb6,_0x4f5eb1),_0x214de9[_0xd3aa6b(0x170)][_0xd3aa6b(0x168)](_0x2d6fb6,_0x4f5eb1);}if(_0x3bbd14[_0xd3aa6b(0x1a7)]===_0xd3aa6b(0x167))_0x4493ae[_0xd3aa6b(0x1aa)]?.({'type':_0xd3aa6b(0x1d6),'name':_0x7cfc26[_0xd3aa6b(0x199)][_0xd3aa6b(0x1b0)],'journeyId':_0x3bbd14['journeyId']}),_0x4493ae[_0xd3aa6b(0x1e2)]?.('Created\x20journey\x20\x27'+_0x7cfc26['yamlConfig'][_0xd3aa6b(0x1b0)]+'\x27'),_0x214de9[_0xd3aa6b(0x167)]++;else _0x3bbd14['action']===_0xd3aa6b(0x1d4)&&(_0x4493ae[_0xd3aa6b(0x1aa)]?.({'type':_0xd3aa6b(0x1d7),'name':_0x7cfc26[_0xd3aa6b(0x199)][_0xd3aa6b(0x1b0)]}),_0x4493ae[_0xd3aa6b(0x1e2)]?.(_0xd3aa6b(0x15d)+_0x7cfc26[_0xd3aa6b(0x199)]['name']+'\x27'),_0x214de9[_0xd3aa6b(0x1d4)]++);return{'action':_0x3bbd14['action'],'name':_0x7cfc26['yamlConfig'][_0xd3aa6b(0x1b0)],'journeyId':_0x3bbd14[_0xd3aa6b(0x161)]};}catch(_0x3ed8f5){const _0x1814b6=isHttp400Error(_0x3ed8f5),_0xa545b=_0x1814b6?ErrorCode[_0xd3aa6b(0x16d)]:ErrorCode[_0xd3aa6b(0x13e)],_0x6777c7=getErrorMessage(_0x3ed8f5);throw new SDKError(_0xa545b,_0xd3aa6b(0x1f6)+(_0x7cfc26[_0xd3aa6b(0x185)]?_0xd3aa6b(0x146):_0xd3aa6b(0x181))+_0xd3aa6b(0x17f)+_0x7cfc26['absolutePath']+_0xd3aa6b(0x190)+_0x6777c7,_0x3ed8f5);}}));_0x214de9[_0x508822(0x154)][_0x508822(0x17d)](..._0x14d143);}return _0x214de9;}async function matchExistingJourneySegments(_0x22f461,_0x34c071,_0x44f985,_0x19481c,_0x42ad69){const _0x26ef74=a152_0x25b4a3;if(!_0x34c071[_0x26ef74(0x16f)]||!_0x34c071['yamlConfig'][_0x26ef74(0x1e4)])return;const _0x29ef8c=new Map(),_0x464682=new Set();for(const _0x2287b7 of Object['keys'](_0x34c071[_0x26ef74(0x199)][_0x26ef74(0x1e4)])){const _0x25cec7=generateDeterministicJourneySegmentName(_0x34c071[_0x26ef74(0x199)][_0x26ef74(0x1b0)],_0x2287b7);_0x29ef8c[_0x26ef74(0x168)](_0x25cec7,_0x2287b7),_0x464682[_0x26ef74(0x1c5)](_0x2287b7);}const _0x5a2cb2=[],_0xab44d5=collectSegmentIdsFromJourneyApi(_0x34c071[_0x26ef74(0x16f)]);for(const _0x3e03fd of _0xab44d5){const _0x88b976=await fetchSegment(_0x22f461,_0x44f985,_0x3e03fd,_0x19481c);if(!_0x88b976?.[_0x26ef74(0x1b0)])continue;const _0x531369=_0x29ef8c[_0x26ef74(0x151)](_0x88b976['name']);_0x531369?(_0x42ad69[_0x26ef74(0x168)](_0x531369,_0x3e03fd),_0x464682['delete'](_0x531369)):_0x5a2cb2[_0x26ef74(0x17d)]({'id':_0x3e03fd,'seg':_0x88b976});}if(_0x464682['size']>0x0&&_0x5a2cb2[_0x26ef74(0x1d0)]>0x0){const {localExpandedRuleToNames:_0x3e8070}=buildLocalExpandedRuleMappings(_0x34c071[_0x26ef74(0x199)]),_0xd5ad3b=new Map();for(const {id:_0x309217,seg:_0x10d973}of _0x5a2cb2){if(_0x10d973[_0x26ef74(0x162)]){const _0x1b81b2=apiRuleToYaml(_0x10d973[_0x26ef74(0x162)]);_0xd5ad3b[_0x26ef74(0x168)](_0x309217,_0x1b81b2);}}for(const {id:_0x4fd53e,seg:_0xa4285}of _0x5a2cb2){if(!_0xa4285[_0x26ef74(0x162)])continue;const _0x33c1e4=_0xd5ad3b[_0x26ef74(0x151)](_0x4fd53e);if(!_0x33c1e4)continue;const _0x1e29cd=serializeExpandedRule(_0x33c1e4,_0xd5ad3b),_0x3515e3=_0x3e8070['get'](_0x1e29cd);if(_0x3515e3){const _0x28e6b8=_0x3515e3[_0x26ef74(0x1f2)](_0x61d7c6=>_0x464682[_0x26ef74(0x12f)](_0x61d7c6));_0x28e6b8&&(_0x42ad69[_0x26ef74(0x168)](_0x28e6b8,_0x4fd53e),_0x464682[_0x26ef74(0x12d)](_0x28e6b8),logger[_0x26ef74(0x1cc)](_0x26ef74(0x15e)+_0xa4285[_0x26ef74(0x1b0)]+_0x26ef74(0x126)+_0x28e6b8+_0x26ef74(0x1c7)));}}}}async function executeSingleJourneyPush(_0x2e54dd,_0x2d1040,_0x1ddf13,_0x231e3d,_0x2daaf3,_0x380f7e){const _0x1951b2=a152_0x25b4a3,{journeyDefToRequest:_0x1aa36d,activationDefToCreateRequest:_0x22549b,yamlRuleToApi:_0x34dbde,validateSegmentRule:_0x3c9b86}=_0x380f7e,_0x11c96e=new Map(),_0x2b386c=new Map();recoverSegmentIdsFromPushRecovery(_0x2d1040,_0x11c96e,_0x1ddf13['segmentNameToId']);const _0x2a879b=new Map(),_0x25e77d=new Map(),_0x23d12c=new Map();let _0x29e602;const _0x22aa48=async()=>{const _0x1ce5db=a152_0x3f4b;if(_0x29e602)return;_0x29e602=new Map();if(!_0x2d1040['existingJourney'])return;const _0x2fe54c=await _0x2e54dd[_0x1ce5db(0x174)][_0x1ce5db(0x171)](_0x2d1040[_0x1ce5db(0x16f)]['id']);for(const _0xc5c18e of _0x2fe54c){const _0x2a15b2=journeyActivationStepToYaml(_0xc5c18e,_0x1ddf13[_0x1ce5db(0x1b6)],_0x1ddf13[_0x1ce5db(0x186)]),_0xdcf943=activationSignature(_0x2a15b2);!_0x29e602[_0x1ce5db(0x12f)](_0xdcf943)&&_0x29e602['set'](_0xdcf943,_0xc5c18e['id']),_0x2a15b2[_0x1ce5db(0x1b0)]&&_0x2b386c[_0x1ce5db(0x168)](_0x2a15b2['name'],_0xc5c18e['id']);}};await matchExistingJourneySegments(_0x2e54dd,_0x2d1040,_0x231e3d['parentId'],_0x1ddf13[_0x1951b2(0x200)],_0x1ddf13[_0x1951b2(0x14b)]);const _0x1139f3={'resolveSegmentId':async _0x1937c6=>{const _0x1be4e2=_0x1951b2,_0x75e896=_0x1ddf13[_0x1be4e2(0x14b)]['get'](_0x1937c6);if(!_0x75e896)throw new SDKError(ErrorCode[_0x1be4e2(0x117)],_0x1be4e2(0x1ee)+_0x1937c6+_0x1be4e2(0x1ec)+_0x2d1040['yamlConfig']['name']+')');return _0x75e896;},'resolveEmbeddedSegmentId':async(_0x1d618a,_0xc9ee75)=>{const _0x53c9cb=_0x1951b2,_0x4e5a96=_0x1ddf13[_0x53c9cb(0x14b)][_0x53c9cb(0x151)](_0x1d618a);if(_0x4e5a96)return _0x4e5a96;const _0x5472e1=_0x1ddf13[_0x53c9cb(0x200)][_0x53c9cb(0x1f2)](_0x352fb1=>_0x352fb1[_0x53c9cb(0x1b0)]===_0x1d618a);if(_0x5472e1)return _0x1ddf13['segmentNameToId'][_0x53c9cb(0x168)](_0x1d618a,_0x5472e1['id']),_0x5472e1['id'];if(_0x2d1040[_0x53c9cb(0x185)]){const {stageName:_0x440e06,criteriaName:_0xe53756}=findSegmentCriteriaLocation(_0x2d1040[_0x53c9cb(0x199)],_0x1d618a);return _0x3c9b86(_0x1d618a,_0xc9ee75[_0x53c9cb(0x162)]),_0x25e77d[_0x53c9cb(0x168)](_0x1d618a,{'definition':_0xc9ee75,'stageName':_0x440e06,'criteriaName':_0xe53756}),createPendingSegmentId(_0x1d618a);}const _0x4d2ac7=_0x2d1040[_0x53c9cb(0x16f)]?.['id'];if(!_0x4d2ac7)throw new SDKError(ErrorCode['INTERNAL'],_0x53c9cb(0x11a));const _0x25f007=_0x2a879b[_0x53c9cb(0x151)](_0x1d618a);if(_0x25f007)return _0x25f007;const _0x3b5a27=((async()=>{const _0x1f85b6=_0x53c9cb;_0x3c9b86(_0x1d618a,_0xc9ee75['rule']);const _0x3c6d56=generateDeterministicJourneySegmentName(_0x2d1040['yamlConfig']['name'],_0x1d618a),_0x4e20a3=_0x1ddf13[_0x1f85b6(0x200)][_0x1f85b6(0x1f2)](_0x43a3a9=>_0x43a3a9[_0x1f85b6(0x1b0)]===_0x3c6d56),_0x2e0d50=createSegmentIdResolver(_0x1ddf13[_0x1f85b6(0x14b)],_0x1d618a),_0x10e695=await resolveRuleSegmentIds(_0xc9ee75[_0x1f85b6(0x162)],_0x2e0d50);let _0x25d0e8;return _0x4e20a3?(await _0x2e54dd[_0x1f85b6(0x1c4)][_0x1f85b6(0x1ef)](_0x231e3d[_0x1f85b6(0x145)],_0x4e20a3['id'],{'description':_0xc9ee75[_0x1f85b6(0x1b9)]||'Entry\x20criteria:\x20'+_0x1d618a,'rule':_0x34dbde(_0x10e695),'countPopulation':!![]}),_0x25d0e8=_0x4e20a3['id'],saveSegmentToPushRecovery(_0x2d1040[_0x1f85b6(0x15c)],_0x2d1040[_0x1f85b6(0x199)]['name'],_0x1d618a,{'segmentId':_0x25d0e8,'uniqueServerName':_0x3c6d56,'createdAt':new Date()[_0x1f85b6(0x173)]()})):_0x25d0e8=await createOrRecoverEmbeddedSegment(_0x2e54dd,_0x2d1040,{'localName':_0x1d618a,'uniqueSegmentName':_0x3c6d56,'description':_0xc9ee75[_0x1f85b6(0x1b9)]||_0x1f85b6(0x13a)+_0x1d618a,'journeyId':_0x4d2ac7,'resolvedRule':_0x10e695,'parentId':_0x231e3d['parentId'],'folderId':_0x231e3d[_0x1f85b6(0x1b1)]||''},_0x34dbde),_0x1ddf13[_0x1f85b6(0x14b)][_0x1f85b6(0x168)](_0x1d618a,_0x25d0e8),_0x11c96e['set'](_0x1d618a,_0x25d0e8),_0x25d0e8;})());_0x2a879b[_0x53c9cb(0x168)](_0x1d618a,_0x3b5a27);try{return await _0x3b5a27;}finally{_0x2a879b[_0x53c9cb(0x12d)](_0x1d618a);}},'resolveActivationId':async _0x4b27a6=>{const _0x279bb1=_0x1951b2,_0x5f491e=_0x2b386c[_0x279bb1(0x151)](_0x4b27a6);if(_0x5f491e)return _0x5f491e;if(_0x2d1040['existingJourney']){await _0x22aa48();const _0x10e727=_0x2b386c[_0x279bb1(0x151)](_0x4b27a6);if(_0x10e727)return _0x10e727;}throw new SDKError(ErrorCode[_0x279bb1(0x1ba)],_0x279bb1(0x177)+_0x4b27a6+_0x279bb1(0x1ec)+_0x2d1040[_0x279bb1(0x199)][_0x279bb1(0x1b0)]+_0x279bb1(0x19e)+_0x279bb1(0x134));},'resolveEmbeddedActivationId':async(_0x428735,_0x10c073)=>{const _0x3589ce=_0x1951b2,_0x366c78=_0x2b386c[_0x3589ce(0x151)](_0x428735);if(_0x366c78)return _0x366c78;if(_0x2d1040['isNew'])return _0x23d12c[_0x3589ce(0x168)](_0x428735,_0x10c073),createPendingActivationId(_0x428735);if(_0x2d1040['existingJourney']){await _0x22aa48();const _0x562135=_0x2b386c[_0x3589ce(0x151)](_0x10c073['name']);if(_0x562135)return _0x2b386c[_0x3589ce(0x168)](_0x428735,_0x562135),_0x562135;const _0x789906=activationSignature(_0x10c073),_0x39a590=_0x29e602?.[_0x3589ce(0x151)](_0x789906);if(_0x39a590)return _0x2b386c[_0x3589ce(0x168)](_0x428735,_0x39a590),_0x39a590;const _0x485fae=await _0x22549b(_0x10c073,_0x1ddf13[_0x3589ce(0x1dd)]),_0x16b9a3={..._0x485fae,..._0x10c073['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x10c073['run_after_journey_refresh']}},_0x3b70c8=await _0x2e54dd[_0x3589ce(0x174)][_0x3589ce(0x189)](_0x2d1040[_0x3589ce(0x16f)]['id'],_0x16b9a3);return _0x2b386c[_0x3589ce(0x168)](_0x428735,_0x3b70c8['id']),_0x3b70c8['id'];}throw new SDKError(ErrorCode[_0x3589ce(0x159)],_0x3589ce(0x1bd));},'resolveJourneyId':async _0x57c502=>{const _0x549945=_0x1951b2;try{return await _0x2e54dd[_0x549945(0x174)][_0x549945(0x194)](_0x231e3d['parentId'],_0x57c502);}catch(_0x4bcebe){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x57c502+_0x549945(0x1ae)+_0x2d1040[_0x549945(0x199)]['name']+'\x27)',_0x4bcebe);}},'resolveStageId':async(_0x4078cc,_0x5f23a6)=>{const _0x5189d7=_0x1951b2,_0x30083a=await _0x2e54dd[_0x5189d7(0x174)][_0x5189d7(0x1e3)](_0x4078cc),_0x2a7266=_0x30083a[_0x5189d7(0x11b)][_0x5189d7(0x137)]['find'](_0x799f7f=>_0x799f7f['name'][_0x5189d7(0x196)]()===_0x5f23a6[_0x5189d7(0x196)]());if(!_0x2a7266?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x5f23a6+_0x5189d7(0x17a)+(_0x30083a[_0x5189d7(0x11b)][_0x5189d7(0x19b)]||_0x30083a[_0x5189d7(0x11b)]['name'])+'\x27');return _0x2a7266['id'];}},_0x34e933=await _0x1aa36d(_0x2d1040[_0x1951b2(0x199)],_0x231e3d[_0x1951b2(0x145)],_0x1139f3),_0x467c20=_0x231e3d[_0x1951b2(0x164)]||_0x231e3d[_0x1951b2(0x1b1)];_0x467c20&&(_0x34e933[_0x1951b2(0x17b)]={'parentFolder':{'data':{'id':_0x467c20,'type':_0x1951b2(0x192)}}});if(_0x2d1040[_0x1951b2(0x185)]){if(_0x25e77d['size']>0x0||_0x23d12c[_0x1951b2(0x1c8)]>0x0)return await executeThreeStepJourneyCreate(_0x2e54dd,_0x2d1040,_0x34e933,{'pendingEmbeddedSegments':_0x25e77d,'pendingEmbeddedActivations':_0x23d12c,'embeddedSegmentNameToId':_0x11c96e,'journeyActivationNameToId':_0x2b386c},{..._0x231e3d,'effectiveFolderId':_0x467c20},_0x1ddf13,_0x2daaf3,_0x380f7e);else{ensureJourneyDefaults(_0x34e933[_0x1951b2(0x11b)]);const _0x1603fa=await _0x2e54dd[_0x1951b2(0x174)][_0x1951b2(0x146)](_0x34e933);return deletePushRecovery(_0x2d1040[_0x1951b2(0x15c)]),{'action':_0x1951b2(0x167),'journeyId':_0x1603fa['id'],'embeddedSegmentNameToId':_0x11c96e};}}else{if(_0x2d1040[_0x1951b2(0x1f9)]&&_0x2d1040[_0x1951b2(0x16f)]){_0x34e933['id']=_0x2d1040[_0x1951b2(0x16f)]['id'];const _0x4c5e54=_0x34e933[_0x1951b2(0x11b)];_0x2d1040[_0x1951b2(0x16f)][_0x1951b2(0x11b)]?.[_0x1951b2(0x19b)]&&(_0x4c5e54[_0x1951b2(0x19b)]=_0x2d1040['existingJourney'][_0x1951b2(0x11b)][_0x1951b2(0x19b)]);const _0x3c090c=_0x2d1040[_0x1951b2(0x16f)][_0x1951b2(0x11b)]?.['journeyStages'];return _0x3c090c&&_0x34e933[_0x1951b2(0x11b)][_0x1951b2(0x137)]&&injectExistingStageIds(_0x34e933['attributes'][_0x1951b2(0x137)],_0x3c090c),ensureJourneyDefaults(_0x4c5e54),await _0x2e54dd[_0x1951b2(0x174)]['update'](_0x2d1040[_0x1951b2(0x16f)]['id'],_0x34e933),deletePushRecovery(_0x2d1040[_0x1951b2(0x15c)]),{'action':'updated','journeyId':_0x2d1040[_0x1951b2(0x16f)]['id'],'embeddedSegmentNameToId':_0x11c96e};}}return deletePushRecovery(_0x2d1040[_0x1951b2(0x15c)]),{'action':_0x1951b2(0x1cb),'journeyId':_0x2d1040[_0x1951b2(0x16f)]?.['id'],'embeddedSegmentNameToId':_0x11c96e};}function findSegmentCriteriaLocation(_0x2549ac,_0x18bb8f){const _0x387ebe=a152_0x25b4a3,_0x3e5278=_0x2549ac[_0x387ebe(0x152)]||_0x2549ac[_0x387ebe(0x147)]?.[0x0]?.[_0x387ebe(0x152)]||[];let _0x3dac91=_0x387ebe(0x1f5),_0x1d51d2=_0x18bb8f;const _0x4c3125=_0x2549ac[_0x387ebe(0x122)]||_0x2549ac['journeys']?.[0x0]?.[_0x387ebe(0x122)];if(_0x4c3125?.['segment']===_0x18bb8f)return{'stageName':_0x387ebe(0x122),'criteriaName':_0x4c3125[_0x387ebe(0x1b0)]||_0x18bb8f};_0x153a32:for(const _0x310309 of _0x3e5278){if(_0x310309['entry_criteria']?.[_0x387ebe(0x1c4)]===_0x18bb8f){_0x3dac91=_0x310309['name'],_0x1d51d2=_0x310309['entry_criteria'][_0x387ebe(0x1b0)]||_0x18bb8f;break;}if(_0x310309[_0x387ebe(0x1d8)])for(const _0x5c3204 of _0x310309[_0x387ebe(0x1d8)]){if(_0x5c3204[_0x387ebe(0x114)]===_0x387ebe(0x1de)&&_0x5c3204[_0x387ebe(0x1a5)]?.[_0x387ebe(0x1b5)])for(const _0x174ea0 of _0x5c3204[_0x387ebe(0x1a5)]['branches']){if(_0x174ea0[_0x387ebe(0x1c4)]===_0x18bb8f){_0x3dac91=_0x310309[_0x387ebe(0x1b0)],_0x1d51d2=_0x174ea0['name']||_0x18bb8f;break _0x153a32;}}}}return{'stageName':_0x3dac91,'criteriaName':_0x1d51d2};}async function executeThreeStepJourneyCreate(_0x1b4084,_0x59e436,_0x697ce8,_0x345754,_0xce91c8,_0x2c3657,_0x2771ed,_0x1605f4){const _0x3f6be2=a152_0x25b4a3,{activationDefToCreateRequest:_0x311097,yamlRuleToApi:_0x8396f0}=_0x1605f4,{pendingEmbeddedSegments:_0xaccfa2,pendingEmbeddedActivations:_0x31f53f,embeddedSegmentNameToId:_0x1ac95f}=_0x345754,_0x8f56f1=JSON[_0x3f6be2(0x1a6)](JSON['stringify'](_0x697ce8));ensureJourneyDefaults(_0x8f56f1['attributes']),stripPendingIds(_0x8f56f1);const _0x45be82=await _0x1b4084[_0x3f6be2(0x174)][_0x3f6be2(0x146)](_0x8f56f1),_0x3c4af5=_0x45be82['id'],_0x53342a=new Map();for(const _0xc0d8f4 of _0x45be82[_0x3f6be2(0x11b)][_0x3f6be2(0x137)]){_0x53342a[_0x3f6be2(0x168)](_0xc0d8f4[_0x3f6be2(0x1b0)][_0x3f6be2(0x196)](),_0xc0d8f4['id']);}recoverSegmentIdsFromPushRecovery(_0x59e436,_0x1ac95f,_0x2c3657[_0x3f6be2(0x14b)]);for(const [_0x3d0184,{definition:_0x4ff48a}]of _0xaccfa2){if(_0x1ac95f[_0x3f6be2(0x12f)](_0x3d0184)){_0x2771ed['onProgress']?.({'type':_0x3f6be2(0x16a),'journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'segmentName':_0x3d0184});continue;}const _0x102df0=generateDeterministicJourneySegmentName(_0x59e436['yamlConfig']['name'],_0x3d0184);_0x2771ed[_0x3f6be2(0x1aa)]?.({'type':'embedded_segment_creating','journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'segmentName':_0x3d0184});const _0x30a41b=createSegmentIdResolver(_0x2c3657[_0x3f6be2(0x14b)],_0x3d0184),_0x1a0380=await resolveRuleSegmentIds(_0x4ff48a[_0x3f6be2(0x162)],_0x30a41b),_0x3cf726=await createOrRecoverEmbeddedSegment(_0x1b4084,_0x59e436,{'localName':_0x3d0184,'uniqueSegmentName':_0x102df0,'description':_0x4ff48a[_0x3f6be2(0x1b9)]||_0x3f6be2(0x13a)+_0x3d0184,'journeyId':_0x3c4af5,'resolvedRule':_0x1a0380,'parentId':_0xce91c8[_0x3f6be2(0x145)],'folderId':_0xce91c8['effectiveFolderId']||''},_0x8396f0);_0x1ac95f[_0x3f6be2(0x168)](_0x3d0184,_0x3cf726),_0x2c3657[_0x3f6be2(0x14b)][_0x3f6be2(0x168)](_0x3d0184,_0x3cf726),_0x2771ed[_0x3f6be2(0x1aa)]?.({'type':_0x3f6be2(0x16a),'journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'segmentName':_0x3d0184});}const _0x55e37c=new Map();for(const [_0x3cc059,_0x5831cd]of _0x31f53f){_0x2771ed['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'activationName':_0x3cc059});const _0xf02cb5=await _0x311097(_0x5831cd,_0x2c3657[_0x3f6be2(0x1dd)]),_0x51dd9c={..._0xf02cb5,..._0x5831cd[_0x3f6be2(0x176)]!==undefined&&{'runAfterJourneyRefresh':_0x5831cd[_0x3f6be2(0x176)]}},_0x12ea42=await _0x1b4084['journey'][_0x3f6be2(0x189)](_0x3c4af5,_0x51dd9c);_0x55e37c[_0x3f6be2(0x168)](_0x3cc059,_0x12ea42['id']),_0x345754[_0x3f6be2(0x12e)][_0x3f6be2(0x168)](_0x3cc059,_0x12ea42['id']),_0x2771ed[_0x3f6be2(0x1aa)]?.({'type':_0x3f6be2(0x129),'journeyName':_0x59e436['yamlConfig'][_0x3f6be2(0x1b0)],'activationName':_0x3cc059});}const _0x17827f=JSON[_0x3f6be2(0x1a6)](JSON[_0x3f6be2(0x18c)](_0x697ce8));return _0x17827f['id']=_0x3c4af5,ensureJourneyDefaults(_0x17827f[_0x3f6be2(0x11b)]),resolvePendingIdsInRequest(_0x17827f,_0x697ce8,_0x53342a,_0x1ac95f,_0x55e37c,_0x2771ed),await _0x1b4084[_0x3f6be2(0x174)]['update'](_0x3c4af5,_0x17827f),deletePushRecovery(_0x59e436[_0x3f6be2(0x15c)]),{'action':'created','journeyId':_0x3c4af5,'embeddedSegmentNameToId':_0x1ac95f};}export function stripWaitStepPendingIds(_0xd1c05b){const _0x33b79e=a152_0x25b4a3,_0x11e38e=_0xd1c05b[_0x33b79e(0x143)]&&isPendingSegmentId(_0xd1c05b[_0x33b79e(0x143)]),_0x37b077=_0xd1c05b[_0x33b79e(0x112)]?.[_0x33b79e(0x1ab)](_0x4fba87=>_0x4fba87[_0x33b79e(0x153)]&&isPendingSegmentId(_0x4fba87[_0x33b79e(0x153)]));(_0x11e38e||_0x37b077)&&(_0xd1c05b['waitStepType']=_0x33b79e(0x120),_0xd1c05b[_0x33b79e(0x175)]=0x1,_0xd1c05b[_0x33b79e(0x1eb)]=_0x33b79e(0x16b),delete _0xd1c05b['conditionSegmentId'],delete _0xd1c05b[_0x33b79e(0x19d)],delete _0xd1c05b[_0x33b79e(0x1fe)],delete _0xd1c05b[_0x33b79e(0x112)]);}export function resolveWaitStepPendingIds(_0x3c0bb9,_0x4dc0f7,_0x308ccd,_0x2243d5){const _0x5e4cc5=a152_0x25b4a3;if(_0x4dc0f7[_0x5e4cc5(0x143)]&&isPendingSegmentId(_0x4dc0f7[_0x5e4cc5(0x143)])){const _0x3e9fca=_0x308ccd(_0x4dc0f7[_0x5e4cc5(0x143)],_0x5e4cc5(0x101)+_0x2243d5+'\x27\x20wait\x20condition');_0x3e9fca&&(_0x3c0bb9[_0x5e4cc5(0x110)]=_0x5e4cc5(0x127),_0x3c0bb9[_0x5e4cc5(0x143)]=_0x3e9fca,delete _0x3c0bb9['waitStep'],delete _0x3c0bb9[_0x5e4cc5(0x1eb)],_0x4dc0f7[_0x5e4cc5(0x19d)]!==undefined&&(_0x3c0bb9['conditionTimeoutDuration']=_0x4dc0f7[_0x5e4cc5(0x19d)]),_0x4dc0f7[_0x5e4cc5(0x1fe)]&&(_0x3c0bb9[_0x5e4cc5(0x1fe)]=_0x4dc0f7[_0x5e4cc5(0x1fe)]));}if(_0x4dc0f7[_0x5e4cc5(0x112)]){const _0x3acf4e=_0x4dc0f7[_0x5e4cc5(0x112)][_0x5e4cc5(0x1ab)](_0x4de8b7=>_0x4de8b7['segmentId']&&isPendingSegmentId(_0x4de8b7[_0x5e4cc5(0x153)]));if(_0x3acf4e){const _0xc287d6=_0x4dc0f7['conditions'][_0x5e4cc5(0x1e1)](_0x35ec12=>{const _0xd7f0b6=_0x5e4cc5;if(_0x35ec12[_0xd7f0b6(0x153)]&&isPendingSegmentId(_0x35ec12[_0xd7f0b6(0x153)])){const _0x27d320=_0x308ccd(_0x35ec12[_0xd7f0b6(0x153)],'stage\x20\x27'+_0x2243d5+'\x27\x20wait\x20condition');return{..._0x35ec12,'segmentId':_0x27d320||_0x35ec12['segmentId']};}return{..._0x35ec12};});_0x3c0bb9[_0x5e4cc5(0x110)]=_0x5e4cc5(0x127),_0x3c0bb9[_0x5e4cc5(0x112)]=_0xc287d6,delete _0x3c0bb9[_0x5e4cc5(0x175)],delete _0x3c0bb9['waitStepUnit'],delete _0x3c0bb9[_0x5e4cc5(0x143)],delete _0x3c0bb9['conditionTimeoutDuration'],delete _0x3c0bb9[_0x5e4cc5(0x1fe)];}}}function stripPendingIds(_0x5bc852){const _0x53d822=a152_0x25b4a3;_0x5bc852[_0x53d822(0x11b)][_0x53d822(0x122)]?.['segmentId']&&isPendingSegmentId(_0x5bc852['attributes'][_0x53d822(0x122)][_0x53d822(0x153)])&&delete _0x5bc852[_0x53d822(0x11b)][_0x53d822(0x122)];for(const _0xf436d4 of _0x5bc852[_0x53d822(0x11b)]['journeyStages']||[]){_0xf436d4[_0x53d822(0x10e)]?.['segmentId']&&isPendingSegmentId(_0xf436d4[_0x53d822(0x10e)]['segmentId'])&&delete _0xf436d4[_0x53d822(0x10e)];_0xf436d4[_0x53d822(0x1cf)]?.[_0x53d822(0x153)]&&isPendingSegmentId(_0xf436d4[_0x53d822(0x1cf)][_0x53d822(0x153)])&&delete _0xf436d4[_0x53d822(0x1cf)];_0xf436d4[_0x53d822(0x115)]&&(_0xf436d4[_0x53d822(0x115)]=_0xf436d4[_0x53d822(0x115)][_0x53d822(0x103)](_0x10547c=>!_0x10547c[_0x53d822(0x153)]||!isPendingSegmentId(_0x10547c['segmentId'])));if(_0xf436d4[_0x53d822(0x1d8)])for(const _0x30940d of Object['keys'](_0xf436d4['steps'])){const _0x539127=_0xf436d4['steps'][_0x30940d];_0x539127['type']===_0x53d822(0x191)&&_0x539127[_0x53d822(0x201)]&&isPendingActivationId(_0x539127[_0x53d822(0x201)])&&(_0x539127[_0x53d822(0x201)]='');if(_0x539127[_0x53d822(0x114)]==='DecisionPoint'&&_0x539127[_0x53d822(0x1b5)])for(const _0x5bd0f2 of _0x539127['branches']){_0x5bd0f2[_0x53d822(0x153)]&&isPendingSegmentId(_0x5bd0f2[_0x53d822(0x153)])&&(_0x5bd0f2[_0x53d822(0x153)]='');}_0x539127['type']==='WaitStep'&&stripWaitStepPendingIds(_0x539127);}}}function resolvePendingIdsInRequest(_0x41ce9c,_0x2a8d15,_0x2fbbc7,_0x77f9a6,_0x4432f3,_0x4a4735){const _0x3bd6c4=a152_0x25b4a3,_0x9fc26c=(_0x3d1cc8,_0x4a451d)=>{const _0x38d0d5=a152_0x3f4b;if(!isPendingSegmentId(_0x3d1cc8))return _0x3d1cc8;const _0x2d3eb6=extractPendingSegmentName(_0x3d1cc8),_0xc5db49=_0x77f9a6[_0x38d0d5(0x151)](_0x2d3eb6);return!_0xc5db49&&_0x4a4735[_0x38d0d5(0x10d)]?.(_0x38d0d5(0x195)+_0x2d3eb6+_0x38d0d5(0x1fb)+_0x4a451d),_0xc5db49;};if(_0x41ce9c[_0x3bd6c4(0x11b)][_0x3bd6c4(0x122)]?.[_0x3bd6c4(0x153)]&&isPendingSegmentId(_0x41ce9c[_0x3bd6c4(0x11b)][_0x3bd6c4(0x122)][_0x3bd6c4(0x153)])){const _0x26f5da=_0x9fc26c(_0x41ce9c['attributes'][_0x3bd6c4(0x122)][_0x3bd6c4(0x153)],_0x3bd6c4(0x16e));_0x26f5da&&(_0x41ce9c['attributes'][_0x3bd6c4(0x122)][_0x3bd6c4(0x153)]=_0x26f5da);}for(const _0x2d6f18 of _0x41ce9c[_0x3bd6c4(0x11b)][_0x3bd6c4(0x137)]||[]){const _0x5e558e=_0x2fbbc7[_0x3bd6c4(0x151)](_0x2d6f18[_0x3bd6c4(0x1b0)][_0x3bd6c4(0x196)]());_0x5e558e&&(_0x2d6f18['id']=_0x5e558e);if(_0x2d6f18[_0x3bd6c4(0x10e)]?.['segmentId']&&isPendingSegmentId(_0x2d6f18[_0x3bd6c4(0x10e)][_0x3bd6c4(0x153)])){const _0x439656=_0x9fc26c(_0x2d6f18[_0x3bd6c4(0x10e)][_0x3bd6c4(0x153)],_0x3bd6c4(0x101)+_0x2d6f18['name']+_0x3bd6c4(0xff));_0x439656&&(_0x2d6f18[_0x3bd6c4(0x10e)][_0x3bd6c4(0x153)]=_0x439656);}if(_0x2d6f18[_0x3bd6c4(0x115)])for(const _0x19c1f3 of _0x2d6f18['exitCriterias']){if(_0x19c1f3[_0x3bd6c4(0x153)]&&isPendingSegmentId(_0x19c1f3[_0x3bd6c4(0x153)])){const _0x331d7d=_0x9fc26c(_0x19c1f3[_0x3bd6c4(0x153)],'stage\x20\x27'+_0x2d6f18[_0x3bd6c4(0x1b0)]+_0x3bd6c4(0x119));_0x331d7d&&(_0x19c1f3[_0x3bd6c4(0x153)]=_0x331d7d);}}if(_0x2d6f18[_0x3bd6c4(0x1cf)]?.[_0x3bd6c4(0x153)]&&isPendingSegmentId(_0x2d6f18['milestone'][_0x3bd6c4(0x153)])){const _0x238160=_0x9fc26c(_0x2d6f18['milestone'][_0x3bd6c4(0x153)],_0x3bd6c4(0x101)+_0x2d6f18['name']+'\x27\x20milestone');_0x238160&&(_0x2d6f18[_0x3bd6c4(0x1cf)]['segmentId']=_0x238160);}if(_0x2d6f18[_0x3bd6c4(0x1d8)]){const _0x17ab4d=_0x480bee=>_0x2a8d15[_0x3bd6c4(0x11b)]['journeyStages']?.[_0x3bd6c4(0x1f2)](_0x355802=>_0x355802[_0x3bd6c4(0x1b0)][_0x3bd6c4(0x196)]()===_0x2d6f18[_0x3bd6c4(0x1b0)][_0x3bd6c4(0x196)]())?.[_0x3bd6c4(0x1d8)]?.[_0x480bee];for(const _0x5a0771 of Object['keys'](_0x2d6f18[_0x3bd6c4(0x1d8)])){const _0x1641de=_0x2d6f18[_0x3bd6c4(0x1d8)][_0x5a0771],_0x59dec6=_0x17ab4d(_0x5a0771);if(_0x1641de[_0x3bd6c4(0x114)]===_0x3bd6c4(0x191)&&_0x1641de[_0x3bd6c4(0x201)]&&(isPendingActivationId(_0x1641de[_0x3bd6c4(0x201)])||_0x1641de[_0x3bd6c4(0x201)]==='')){if(_0x59dec6?.[_0x3bd6c4(0x201)]&&isPendingActivationId(_0x59dec6[_0x3bd6c4(0x201)])){const _0x7ddf67=extractPendingActivationName(_0x59dec6[_0x3bd6c4(0x201)]),_0x7c538e=_0x4432f3[_0x3bd6c4(0x151)](_0x7ddf67);_0x7c538e&&(_0x1641de[_0x3bd6c4(0x201)]=_0x7c538e);}}if(_0x1641de['type']===_0x3bd6c4(0x19f)&&_0x1641de[_0x3bd6c4(0x1b5)]&&_0x59dec6?.['branches'])for(let _0x4518b3=0x0;_0x4518b3<_0x1641de[_0x3bd6c4(0x1b5)]['length'];_0x4518b3++){const _0x344851=_0x1641de[_0x3bd6c4(0x1b5)][_0x4518b3],_0x100e85=_0x59dec6['branches'][_0x4518b3];if(_0x100e85?.['segmentId']&&isPendingSegmentId(_0x100e85['segmentId'])){const _0x10d266=_0x9fc26c(_0x100e85[_0x3bd6c4(0x153)],_0x3bd6c4(0x101)+_0x2d6f18['name']+_0x3bd6c4(0x182)+(_0x344851[_0x3bd6c4(0x1b0)]||_0x4518b3)+'\x27');_0x10d266&&(_0x344851[_0x3bd6c4(0x153)]=_0x10d266);}}_0x1641de[_0x3bd6c4(0x114)]===_0x3bd6c4(0x136)&&_0x59dec6?.[_0x3bd6c4(0x114)]===_0x3bd6c4(0x136)&&resolveWaitStepPendingIds(_0x1641de,_0x59dec6,_0x9fc26c,_0x2d6f18[_0x3bd6c4(0x1b0)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1272da,_0x23331b){const _0x4a37fc=a153_0x5191,_0x37b281=_0x1272da();while(!![]){try{const _0x5ce36d=-parseInt(_0x4a37fc(0x110))/0x1+parseInt(_0x4a37fc(0x108))/0x2+-parseInt(_0x4a37fc(0x10e))/0x3+parseInt(_0x4a37fc(0x10d))/0x4*(-parseInt(_0x4a37fc(0x112))/0x5)+parseInt(_0x4a37fc(0x10f))/0x6*(-parseInt(_0x4a37fc(0x109))/0x7)+parseInt(_0x4a37fc(0x111))/0x8+parseInt(_0x4a37fc(0x106))/0x9;if(_0x5ce36d===_0x23331b)break;else _0x37b281['push'](_0x37b281['shift']());}catch(_0x152a49){_0x37b281['push'](_0x37b281['shift']());}}}(a153_0x9cc9,0x25aef));export function buildFolderIdToPathMap(_0x358ae7){const _0x3f29f0=a153_0x5191,_0x52d320=new Map(),_0x17cb27=new Map();for(const _0x582d45 of _0x358ae7){_0x17cb27[_0x3f29f0(0x105)](_0x582d45['id'],_0x582d45);}const _0x2ee9f8=new Set();for(const _0x51ba9e of _0x358ae7){!_0x51ba9e[_0x3f29f0(0x10c)]&&_0x2ee9f8[_0x3f29f0(0x10a)](_0x51ba9e['id']);}function _0x1eb136(_0x5b477a){const _0x561041=_0x3f29f0;if(_0x52d320[_0x561041(0x10b)](_0x5b477a['id']))return _0x52d320[_0x561041(0x107)](_0x5b477a['id']);if(_0x2ee9f8[_0x561041(0x10b)](_0x5b477a['id']))return _0x52d320[_0x561041(0x105)](_0x5b477a['id'],''),'';if(_0x5b477a['parentFolderId']){const _0x37ac4b=_0x17cb27[_0x561041(0x107)](_0x5b477a[_0x561041(0x10c)]);if(_0x37ac4b){const _0x5586e3=_0x1eb136(_0x37ac4b),_0x249eac=_0x5586e3?_0x5586e3+'/'+_0x5b477a['name']:_0x5b477a[_0x561041(0x104)];return _0x52d320[_0x561041(0x105)](_0x5b477a['id'],_0x249eac),_0x249eac;}}const _0x17615b=_0x5b477a[_0x561041(0x104)];return _0x52d320[_0x561041(0x105)](_0x5b477a['id'],_0x17615b),_0x17615b;}for(const _0x4a1707 of _0x358ae7){_0x1eb136(_0x4a1707);}return _0x52d320;}function a153_0x9cc9(){const _0x38e5bf=['1994704hPmfHx','10aEWLRi','name','set','5321628oApzZz','get','8282QmsOyz','7NBslNm','add','has','parentFolderId','284360YdeunF','924921kYEBMT','560706kusKEI','146482EnMBqx'];a153_0x9cc9=function(){return _0x38e5bf;};return a153_0x9cc9();}function a153_0x5191(_0x18b614,_0x8501f6){_0x18b614=_0x18b614-0x104;const _0x9cc97b=a153_0x9cc9();let _0x519101=_0x9cc97b[_0x18b614];return _0x519101;}export function buildFolderPathToIdMap(_0x2a31f8){const _0x5cf6b2=a153_0x5191,_0x4ed761=new Map(),_0x348e82=new Map();for(const _0x2ed17f of _0x2a31f8){_0x348e82[_0x5cf6b2(0x105)](_0x2ed17f['id'],_0x2ed17f);}const _0x153b96=new Set();for(const _0x5663b9 of _0x2a31f8){!_0x5663b9[_0x5cf6b2(0x10c)]&&_0x153b96[_0x5cf6b2(0x10a)](_0x5663b9['id']);}function _0x479b9f(_0x1893a9){const _0x4c6914=_0x5cf6b2;if(_0x153b96[_0x4c6914(0x10b)](_0x1893a9['id']))return'';if(_0x1893a9[_0x4c6914(0x10c)]){const _0x584703=_0x348e82[_0x4c6914(0x107)](_0x1893a9[_0x4c6914(0x10c)]);if(_0x584703){const _0x31d653=_0x479b9f(_0x584703);return _0x31d653?_0x31d653+'/'+_0x1893a9['name']:_0x1893a9[_0x4c6914(0x104)];}}return _0x1893a9[_0x4c6914(0x104)];}for(const _0x3fc7ef of _0x2a31f8){const _0x5d55ff=_0x479b9f(_0x3fc7ef);_0x4ed761['set'](_0x5d55ff,_0x3fc7ef['id']);}return _0x4ed761;}export function buildFolderMaps(_0x5245e6){const _0x319a5a=a153_0x5191,_0x52192d=buildFolderIdToPathMap(_0x5245e6),_0x2dbc4f=new Map();for(const [_0x3c54bf,_0x2c8fcd]of _0x52192d){_0x2dbc4f[_0x319a5a(0x105)](_0x2c8fcd,_0x3c54bf);}return{'idToPath':_0x52192d,'pathToId':_0x2dbc4f};}export function getFolderPath(_0x43d6a8,_0x41eacf){const _0x1618dc=a153_0x5191;if(!_0x43d6a8)return'';return _0x41eacf[_0x1618dc(0x107)](_0x43d6a8)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a6c1f,_0x34bf65){const _0xa320e7=a154_0x46ce,_0x54157b=_0x3a6c1f();while(!![]){try{const _0x204da6=-parseInt(_0xa320e7(0xef))/0x1*(parseInt(_0xa320e7(0xf1))/0x2)+parseInt(_0xa320e7(0x111))/0x3*(-parseInt(_0xa320e7(0x110))/0x4)+parseInt(_0xa320e7(0x113))/0x5+parseInt(_0xa320e7(0xf4))/0x6+parseInt(_0xa320e7(0xfa))/0x7+parseInt(_0xa320e7(0xec))/0x8*(parseInt(_0xa320e7(0x10c))/0x9)+parseInt(_0xa320e7(0xf8))/0xa;if(_0x204da6===_0x34bf65)break;else _0x54157b['push'](_0x54157b['shift']());}catch(_0x55ce75){_0x54157b['push'](_0x54157b['shift']());}}}(a154_0x2508,0xeb3a4));import a154_0x500879 from'path';import{parse as a154_0x3e1851}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x184980){const _0x5eef2a=a154_0x46ce;if(!_0x184980||_0x184980[_0x5eef2a(0x10b)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x5669cc=_0x184980[_0x5eef2a(0x10b)]();if(_0x5669cc==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x184980};const _0x54b7f3=_0x5669cc['startsWith']('/')?_0x5669cc[_0x5eef2a(0xed)](0x1):_0x5669cc,_0x348982=_0x54b7f3['split']('/')['filter'](_0xa17180=>_0xa17180!=='');if(_0x348982[_0x5eef2a(0x10d)]===0x0)throw new Error(_0x5eef2a(0x107));const _0x5d85a1=_0x5669cc[_0x5eef2a(0xe8)]('/')||!isRelativePathSegment(_0x348982[0x0]);for(const _0x547a04 of _0x348982){validatePathSegment(_0x547a04);}return{'segments':_0x348982,'isAbsolute':_0x5d85a1,'raw':_0x184980};}function isRelativePathSegment(_0x8db583){return _0x8db583==='.'||_0x8db583==='..';}function validatePathSegment(_0x3e8c7c){const _0x3e0644=a154_0x46ce;if(_0x3e8c7c==='')throw new Error(_0x3e0644(0xfe));if(_0x3e8c7c==='.'||_0x3e8c7c==='..')return;if(/[\x00-\x1F\x7F]/[_0x3e0644(0xe9)](_0x3e8c7c))throw new Error(_0x3e0644(0x10e)+_0x3e8c7c);if(_0x3e8c7c!==_0x3e8c7c[_0x3e0644(0x10b)]()){}}export function validatePath(_0x235b47){const _0x2f4068=a154_0x46ce;if(_0x235b47[_0x2f4068(0x100)][_0x2f4068(0x10d)]===0x0&&!_0x235b47[_0x2f4068(0x106)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x235b47[_0x2f4068(0x106)]){if(_0x235b47[_0x2f4068(0x100)][0x0]==='..')throw new Error(_0x2f4068(0xfc));let _0x54913f=0x0;for(const _0x23f762 of _0x235b47[_0x2f4068(0x100)]){if(_0x23f762==='..'){if(_0x54913f===0x0)throw new Error(_0x2f4068(0x101));_0x54913f--;}else _0x23f762!=='.'&&_0x54913f++;}}}export function joinPaths(_0x2175ec,_0x4b7578){const _0x48ed3f=a154_0x46ce;if(!_0x2175ec||_0x2175ec==='/')return _0x4b7578;if(!_0x4b7578||_0x4b7578==='.')return _0x2175ec;if(_0x4b7578['startsWith']('/'))return _0x4b7578;const _0xeb7efe=parsePath(_0x2175ec),_0x294366=parsePath(_0x4b7578),_0x3524d0=[..._0xeb7efe[_0x48ed3f(0x100)]];for(const _0x518378 of _0x294366[_0x48ed3f(0x100)]){if(_0x518378==='.')continue;else{if(_0x518378==='..'){if(_0x3524d0[_0x48ed3f(0x10d)]===0x0)throw new Error(_0x48ed3f(0xf7));_0x3524d0[_0x48ed3f(0x108)]();}else _0x3524d0[_0x48ed3f(0xf0)](_0x518378);}}const _0x3fdc27=_0x3524d0[_0x48ed3f(0x109)]('/');return _0xeb7efe[_0x48ed3f(0x10a)][_0x48ed3f(0xe8)]('/')?'/'+_0x3fdc27:_0x3fdc27;}function a154_0x2508(){const _0x23030a=['Cannot\x20navigate\x20above\x20root','2015650klTpqS','parse','3788652uopRuk','name','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','resolve','Path\x20segment\x20cannot\x20be\x20empty','No\x20tdx.json\x20found\x20for\x20file:\x20','segments','Path\x20attempts\x20to\x20navigate\x20above\x20root','replace','segment','readFile','.yml','isAbsolute','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','pop','join','raw','trim','2551509SeYyAF','length','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','journey','1602848JZmRDr','6PCMXzT','endsWith','3510795weHMsy','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','exists','startsWith','test','parent_segment','dirname','16xAYukc','substring','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','9EPyJTj','push','197160IPczkf','relative','slice','3841044izfwWF','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','.yaml'];a154_0x2508=function(){return _0x23030a;};return a154_0x2508();}export function normalizePath(_0x209381){const _0x27e8cc=a154_0x46ce,_0x1cc703=parsePath(_0x209381),_0x46bfeb=[];for(const _0x5ec697 of _0x1cc703['segments']){if(_0x5ec697==='.')continue;else{if(_0x5ec697==='..'){if(_0x46bfeb[_0x27e8cc(0x10d)]===0x0){if(_0x1cc703[_0x27e8cc(0x106)])throw new Error(_0x27e8cc(0xf7));_0x46bfeb[_0x27e8cc(0xf0)]('..');}else _0x46bfeb[_0x46bfeb[_0x27e8cc(0x10d)]-0x1]==='..'?_0x46bfeb[_0x27e8cc(0xf0)]('..'):_0x46bfeb['pop']();}else _0x46bfeb['push'](_0x5ec697);}}if(_0x46bfeb[_0x27e8cc(0x10d)]===0x0)return _0x1cc703[_0x27e8cc(0x106)]?'/':'.';const _0xa8746a=_0x46bfeb[_0x27e8cc(0x109)]('/');return _0x1cc703['raw'][_0x27e8cc(0xe8)]('/')?'/'+_0xa8746a:_0xa8746a;}export function getParentPath(_0x160b27){const _0x6fa857=a154_0x46ce,_0x50b9cd=parsePath(_0x160b27);if(_0x50b9cd[_0x6fa857(0x100)]['length']<=0x1)return'/';const _0xb9f96e=_0x50b9cd['segments'][_0x6fa857(0xf3)](0x0,-0x1)[_0x6fa857(0x109)]('/');return _0x50b9cd[_0x6fa857(0x10a)][_0x6fa857(0xe8)]('/')?'/'+_0xb9f96e:_0xb9f96e;}export function getBaseName(_0x190c11){const _0x10b403=a154_0x46ce,_0x3a15cf=parsePath(_0x190c11);return _0x3a15cf[_0x10b403(0x100)][_0x3a15cf[_0x10b403(0x100)]['length']-0x1]||'';}export function isChildPath(_0x450d48,_0x314a6e){const _0x419fa7=a154_0x46ce,_0x18b472=parsePath(_0x450d48),_0x26b743=parsePath(_0x314a6e);if(_0x18b472[_0x419fa7(0x100)]['length']<=_0x26b743['segments'][_0x419fa7(0x10d)])return![];for(let _0x8de940=0x0;_0x8de940<_0x26b743['segments'][_0x419fa7(0x10d)];_0x8de940++){if(_0x18b472[_0x419fa7(0x100)][_0x8de940]!==_0x26b743[_0x419fa7(0x100)][_0x8de940])return![];}return!![];}export function splitPath(_0x23fcc2){const _0x422bda=a154_0x46ce,_0x74e06=parsePath(_0x23fcc2);if(_0x74e06[_0x422bda(0x100)][_0x422bda(0x10d)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x74e06[_0x422bda(0x100)][_0x422bda(0x10d)]===0x1)return{'parent':_0x74e06[_0x422bda(0x100)][0x0]};return{'parent':_0x74e06[_0x422bda(0x100)][0x0],'child':_0x74e06[_0x422bda(0x100)]['slice'](0x1)['join']('/')};}function a154_0x46ce(_0x4ce159,_0x20e52d){_0x4ce159=_0x4ce159-0xe6;const _0x250827=a154_0x2508();let _0x46ce30=_0x250827[_0x4ce159];return _0x46ce30;}export function isYamlFilePath(_0x5af392){const _0x49d80e=a154_0x46ce;return _0x5af392[_0x49d80e(0x112)](_0x49d80e(0x105))||_0x5af392['endsWith'](_0x49d80e(0xf6));}export async function resolveYamlFilePath(_0x3351de,_0x911783=nodeFileSystem){const _0xda5cee=a154_0x46ce,_0x325fe0=a154_0x500879[_0xda5cee(0xfd)](_0x3351de);if(!await _0x911783['exists'](_0x325fe0))throw new Error('File\x20not\x20found:\x20'+_0x3351de);let _0x3ec984=a154_0x500879[_0xda5cee(0xeb)](_0x325fe0),_0x23c78e=null,_0x4b272c=null;const _0x1935f4=a154_0x500879['parse'](_0x3ec984)['root'];while(_0x3ec984!==_0x1935f4){const _0x15c5d1=a154_0x500879['join'](_0x3ec984,'tdx.json');if(await _0x911783[_0xda5cee(0xe7)](_0x15c5d1)){_0x23c78e=_0x15c5d1,_0x4b272c=_0x3ec984;break;}_0x3ec984=a154_0x500879['dirname'](_0x3ec984);}if(!_0x23c78e||!_0x4b272c)throw new Error(_0xda5cee(0xff)+_0x3351de+'\x0a'+_0xda5cee(0xe6));const _0x109299=await _0x911783['readFile'](_0x23c78e),_0xdc78b5=JSON[_0xda5cee(0xf9)](_0x109299),_0x1bb12a=_0xdc78b5[_0xda5cee(0xea)];if(!_0x1bb12a)throw new Error(_0xda5cee(0xee));const _0x13bb56=await _0x911783[_0xda5cee(0x104)](_0x325fe0),_0x44e1c7=a154_0x3e1851(_0x13bb56),_0x48e641=_0x44e1c7[_0xda5cee(0xfb)];if(!_0x48e641)throw new Error(_0xda5cee(0xf5)+_0x3351de);const _0x4bb9f8=_0x44e1c7['type']===_0xda5cee(0x10f)?_0xda5cee(0x10f):_0xda5cee(0x103),_0x59e6eb=a154_0x500879[_0xda5cee(0xf2)](_0x4b272c,_0x325fe0),_0x2f0718=a154_0x500879[_0xda5cee(0xeb)](_0x59e6eb),_0x314041=_0x2f0718==='.'?'':_0x2f0718[_0xda5cee(0x102)](/\\/g,'/'),_0x23e063=_0x314041?_0x1bb12a+'/'+_0x314041+'/'+_0x48e641:_0x1bb12a+'/'+_0x48e641;return{'parentSegment':_0x1bb12a,'segmentName':_0x48e641,'folderPath':_0x314041,'fullPath':_0x23e063,'resourceType':_0x4bb9f8,'content':_0x13bb56};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a155_0x418a(){const _0x25b82f=['450231cABXIg','Invalid\x20segment\x20reference\x20format:\x20','130670eyFiZP','25RtZFJI','369MBwUbt','120072oukxHQ','.\x20Parent\x20name\x20cannot\x20be\x20empty','indexOf','6Yggxcx','3560FEFKJe','851315KMrUXK','49796roljPZ','substring','16JRIhiS','5188084FUgacf','1603RRCpNl'];a155_0x418a=function(){return _0x25b82f;};return a155_0x418a();}(function(_0x13a67e,_0xff2411){const _0x5b6ea7=a155_0x58a8,_0x5af4fe=_0x13a67e();while(!![]){try{const _0x5c1014=parseInt(_0x5b6ea7(0x1cc))/0x1*(parseInt(_0x5b6ea7(0x1d4))/0x2)+-parseInt(_0x5b6ea7(0x1c9))/0x3*(parseInt(_0x5b6ea7(0x1c6))/0x4)+-parseInt(_0x5b6ea7(0x1d3))/0x5*(-parseInt(_0x5b6ea7(0x1d1))/0x6)+parseInt(_0x5b6ea7(0x1c8))/0x7*(parseInt(_0x5b6ea7(0x1d2))/0x8)+parseInt(_0x5b6ea7(0x1cd))/0x9*(parseInt(_0x5b6ea7(0x1cb))/0xa)+-parseInt(_0x5b6ea7(0x1c7))/0xb+-parseInt(_0x5b6ea7(0x1ce))/0xc;if(_0x5c1014===_0xff2411)break;else _0x5af4fe['push'](_0x5af4fe['shift']());}catch(_0x420790){_0x5af4fe['push'](_0x5af4fe['shift']());}}}(a155_0x418a,0x550f7));function a155_0x58a8(_0xcac66e,_0x36e1cd){_0xcac66e=_0xcac66e-0x1c6;const _0x418ac8=a155_0x418a();let _0x58a861=_0x418ac8[_0xcac66e];return _0x58a861;}export function parseSegmentRef(_0x40319c){const _0x2c8400=a155_0x58a8,_0x404efb=_0x40319c[_0x2c8400(0x1d0)]('/');if(_0x404efb===-0x1)return{'parentId':_0x40319c};if(_0x404efb===0x0)throw new Error(_0x2c8400(0x1ca)+_0x40319c+_0x2c8400(0x1cf));const _0x49188f=_0x40319c[_0x2c8400(0x1d5)](0x0,_0x404efb),_0x4fe721=_0x40319c[_0x2c8400(0x1d5)](_0x404efb+0x1);if(_0x4fe721==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x40319c+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x49188f,'childId':_0x4fe721};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x664428,_0x2879e9){const _0x23c1ee=a156_0x1b29,_0x1bb979=_0x664428();while(!![]){try{const _0x7aec3=-parseInt(_0x23c1ee(0x1d3))/0x1*(-parseInt(_0x23c1ee(0x1ce))/0x2)+-parseInt(_0x23c1ee(0x1c4))/0x3+-parseInt(_0x23c1ee(0x1bd))/0x4+parseInt(_0x23c1ee(0x1d8))/0x5+parseInt(_0x23c1ee(0x1b7))/0x6*(parseInt(_0x23c1ee(0x1b0))/0x7)+-parseInt(_0x23c1ee(0x1be))/0x8+-parseInt(_0x23c1ee(0x1e5))/0x9*(-parseInt(_0x23c1ee(0x1b2))/0xa);if(_0x7aec3===_0x2879e9)break;else _0x1bb979['push'](_0x1bb979['shift']());}catch(_0x1267f2){_0x1bb979['push'](_0x1bb979['shift']());}}}(a156_0x158d,0xe3981));function a156_0x1b29(_0x1fc7fd,_0x5df897){_0x1fc7fd=_0x1fc7fd-0x1a6;const _0x158d2e=a156_0x158d();let _0x1b29a9=_0x158d2e[_0x1fc7fd];return _0x1b29a9;}import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x12d0cb,_0x2a98fd={},_0x2dc232={}){const _0x314557=a156_0x1b29;if(_0x2dc232['skipSchema'])return runSemanticChecks(_0x12d0cb,_0x2a98fd);const _0x2f22f5=SegmentDefSchema[_0x314557(0x1d4)](_0x12d0cb);if(_0x2f22f5[_0x314557(0x1d0)])return runSemanticChecks(_0x2f22f5[_0x314557(0x1aa)],_0x2a98fd);return zodErrorsToValidationResult(_0x2f22f5[_0x314557(0x1ab)],_0x2a98fd);}function a156_0x158d(){const _0x1f0a67=['2210OuXoLh','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','custom','length','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','6UcPsMp','type','BEHAVIOR_SOURCE_MISSING_FILTER','And','push','\x27\x20with\x20attribute\x20\x27','4247180WcvvtK','9061624bSdRMO','document','arrayMatching','symbol','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','level','3253491FEVSen','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','filter','path','Behavior\x20source\x20\x27','EMPTY_CONDITIONS','aggregation','INVALID_ARRAY_MATCHING','.operator.type','name','2FTlago','.conditions','success','description','.attribute','115841FVXiYN','safeParse','endsWith','MISSING_TIME_UNIT','includes','7971690Wcahmo','.source','params','code','map','INVALID_RULE_TYPE','MISSING_SEGMENT_REFERENCE','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','match','source','NESTED_CONDITION_GROUP','MISSING_NAME','.operator.value','83970GAAcRj','.segment','MISSING_CONDITIONS','attribute','SEGMENT_SCHEMA_ERROR','Attribute\x20\x27','data','error','conditions','warning','message','rule','3073777TeoiIp','.type'];a156_0x158d=function(){return _0x1f0a67;};return a156_0x158d();}export function validateRuleDef(_0x2cfd04,_0x4b6dd3,_0x449836){const _0x141ff9=a156_0x1b29;if(!_0x2cfd04)return[];const _0x550f99=RuleDefSchema['safeParse'](_0x2cfd04);if(_0x550f99[_0x141ff9(0x1d0)])return checkRule(_0x550f99[_0x141ff9(0x1aa)],_0x4b6dd3,_0x449836);const _0x11c862=flattenZodIssues(_0x550f99[_0x141ff9(0x1ab)]['issues']);return _0x11c862[_0x141ff9(0x1dc)](_0x29cbc0=>{const _0x4fc3b8=_0x141ff9,_0xec3787=formatZodPath(_0x29cbc0['path']),_0x5b1ad6=_0xec3787?_0x4b6dd3+'.'+_0xec3787:_0x4b6dd3,_0x3ca38f=mapZodIssueToCode(_0x29cbc0,_0xec3787),_0x4dcb6e=getLocationFromPath(_0x449836[_0x4fc3b8(0x1bf)],_0x449836['source'],pathToArray(_0x5b1ad6));return{'level':_0x4fc3b8(0x1ab),'path':_0x5b1ad6,'code':_0x3ca38f,'message':_0x29cbc0[_0x4fc3b8(0x1ae)],..._0x4dcb6e&&{'location':_0x4dcb6e}};});}function zodErrorsToValidationResult(_0x4aae47,_0x4cc44d){const _0xaaec1=a156_0x1b29,_0x4d949d=flattenZodIssues(_0x4aae47['issues']),_0x2211c0=_0x4d949d[_0xaaec1(0x1dc)](_0x441636=>{const _0x53e15e=_0xaaec1,_0x902f52=formatZodPath(_0x441636[_0x53e15e(0x1c7)]),_0x22c7f7=mapZodIssueToCode(_0x441636,_0x902f52),_0x143199=getLocationFromPath(_0x4cc44d[_0x53e15e(0x1bf)],_0x4cc44d[_0x53e15e(0x1e1)],_0x441636[_0x53e15e(0x1c7)]['map'](_0x247791=>typeof _0x247791===_0x53e15e(0x1c1)?String(_0x247791):_0x247791));return{'level':_0x53e15e(0x1ab),'path':_0x902f52,'code':_0x22c7f7,'message':_0x441636['message'],..._0x143199&&{'location':_0x143199}};});return{'valid':![],'errors':_0x2211c0,'warnings':[]};}function mapZodIssueToCode(_0x5bcdb1,_0x3c0e8f){const _0x215411=a156_0x1b29,_0x5230a9=_0x5bcdb1[_0x215411(0x1db)]===_0x215411(0x1b4)?_0x5bcdb1[_0x215411(0x1da)]:undefined;if(_0x3c0e8f===_0x215411(0x1cd))return _0x215411(0x1e3);if(_0x3c0e8f==='rule.type'||_0x3c0e8f[_0x215411(0x1d5)](_0x215411(0x1b1))){if(_0x5bcdb1[_0x215411(0x1db)]==='invalid_value'){if(_0x3c0e8f==='rule.type'||_0x3c0e8f[_0x215411(0x1e0)](/\.conditions\[\d+\]\.type$/))return _0x215411(0x1dd);}}if(_0x3c0e8f[_0x215411(0x1d5)](_0x215411(0x1cc)))return'INVALID_OPERATOR_TYPE';if(_0x3c0e8f[_0x215411(0x1d5)](_0x215411(0x1e4)))return'MISSING_OPERATOR_VALUE';if(_0x5230a9?.['validationCode']==='MISSING_BETWEEN_BOUNDS')return'MISSING_BETWEEN_BOUNDS';if(_0x5230a9?.['validationCode']===_0x215411(0x1d6))return _0x215411(0x1d6);if(_0x3c0e8f[_0x215411(0x1d5)](_0x215411(0x1cf))||_0x3c0e8f==='conditions')return _0x215411(0x1a6);if(_0x3c0e8f[_0x215411(0x1d7)](_0x215411(0x1c0)))return _0x215411(0x1cb);if(_0x3c0e8f['endsWith'](_0x215411(0x1e6)))return _0x215411(0x1de);return _0x215411(0x1a8);}function runSemanticChecks(_0x48fce0,_0x4b3aec){const _0x66b729=a156_0x1b29,_0x3cb194=[];_0x48fce0['rule']&&_0x3cb194[_0x66b729(0x1bb)](...checkRule(_0x48fce0['rule'],_0x66b729(0x1af),_0x4b3aec));const _0x15d936=_0x3cb194['filter'](_0x5160d9=>_0x5160d9[_0x66b729(0x1c3)]===_0x66b729(0x1ab)),_0x922f32=_0x3cb194[_0x66b729(0x1c6)](_0x1f64e0=>_0x1f64e0['level']===_0x66b729(0x1ad));return{'valid':_0x15d936[_0x66b729(0x1b5)]===0x0,'errors':_0x15d936,'warnings':_0x922f32};}function checkRule(_0x5f09ec,_0x1fcfec,_0x3b5ff6){const _0x58bd5e=a156_0x1b29,_0x1af26f=[];if(_0x5f09ec['conditions'][_0x58bd5e(0x1b5)]===0x0)return _0x1af26f['push']({'level':_0x58bd5e(0x1ab),'path':_0x1fcfec+_0x58bd5e(0x1cf),'code':'EMPTY_CONDITIONS','message':'Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','location':getLocationFromPath(_0x3b5ff6[_0x58bd5e(0x1bf)],_0x3b5ff6['source'],pathToArray(_0x1fcfec+'.conditions'))}),_0x1af26f;return _0x1af26f['push'](...checkConditions(_0x5f09ec[_0x58bd5e(0x1ac)],_0x1fcfec,_0x3b5ff6)),_0x1af26f;}function checkConditions(_0x29a6a6,_0xd2c6ef,_0x54c23b){const _0x3c873d=[];for(let _0xab29fa=0x0;_0xab29fa<_0x29a6a6['length'];_0xab29fa++){const _0x18a613=_0x29a6a6[_0xab29fa],_0x1e65fa=_0xd2c6ef+'.conditions['+_0xab29fa+']';_0x3c873d['push'](...checkCondition(_0x18a613,_0x1e65fa,_0x54c23b));}return _0x3c873d;}function checkCondition(_0x5c1fa8,_0x15e5d9,_0x553a55){const _0x950a15=a156_0x1b29,_0x382ec8=[];if(_0x5c1fa8[_0x950a15(0x1b8)]===_0x950a15(0x1ba)||_0x5c1fa8[_0x950a15(0x1b8)]==='Or'){if(_0x5c1fa8[_0x950a15(0x1ac)]['length']===0x0)_0x382ec8['push']({'level':_0x950a15(0x1ab),'path':_0x15e5d9+_0x950a15(0x1cf),'code':_0x950a15(0x1c9),'message':_0x5c1fa8[_0x950a15(0x1b8)]+'\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','location':getLocationFromPath(_0x553a55[_0x950a15(0x1bf)],_0x553a55[_0x950a15(0x1e1)],pathToArray(_0x15e5d9+_0x950a15(0x1cf)))});else{const _0x13ee73=_0x5c1fa8[_0x950a15(0x1d1)]!==undefined;!_0x13ee73&&_0x382ec8[_0x950a15(0x1bb)]({'level':_0x950a15(0x1ad),'path':_0x15e5d9,'code':_0x950a15(0x1e2),'message':_0x5c1fa8[_0x950a15(0x1b8)]+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+_0x950a15(0x1c2)+_0x950a15(0x1b3),'location':getLocationFromPath(_0x553a55[_0x950a15(0x1bf)],_0x553a55[_0x950a15(0x1e1)],pathToArray(_0x15e5d9))}),_0x382ec8['push'](...checkConditions(_0x5c1fa8[_0x950a15(0x1ac)],_0x15e5d9,_0x553a55));}return _0x382ec8;}if(_0x5c1fa8[_0x950a15(0x1b8)]==='Value'||_0x5c1fa8['type']==='Behavior'){const _0x7e1695=_0x5c1fa8,_0x563e74=_0x7e1695[_0x950a15(0x1e1)],_0x15d668=_0x7e1695[_0x950a15(0x1ca)],_0x344af5=_0x563e74||_0x15d668;(!_0x7e1695[_0x950a15(0x1a7)]||_0x7e1695[_0x950a15(0x1a7)]==='')&&(!_0x344af5&&_0x382ec8['push']({'level':_0x950a15(0x1ab),'path':_0x15e5d9+_0x950a15(0x1d2),'code':'EMPTY_ATTRIBUTE','message':'Attribute\x20name\x20cannot\x20be\x20empty','location':getLocationFromPath(_0x553a55[_0x950a15(0x1bf)],_0x553a55['source'],pathToArray(_0x15e5d9+_0x950a15(0x1d2)))}));_0x7e1695['filter']&&_0x382ec8[_0x950a15(0x1bb)](...checkRule(_0x7e1695[_0x950a15(0x1c6)],_0x15e5d9+'.filter',_0x553a55));if(_0x7e1695[_0x950a15(0x1e1)]){const _0xb885e5=_0x7e1695[_0x950a15(0x1a7)]&&_0x7e1695[_0x950a15(0x1a7)]!=='';_0xb885e5&&!_0x7e1695[_0x950a15(0x1c6)]&&_0x382ec8['push']({'level':_0x950a15(0x1ab),'path':_0x15e5d9+_0x950a15(0x1d9),'code':_0x950a15(0x1b9),'message':_0x950a15(0x1c8)+_0x7e1695[_0x950a15(0x1e1)]+_0x950a15(0x1bc)+_0x7e1695[_0x950a15(0x1a7)]+'\x27\x20'+_0x950a15(0x1b6)+'the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20'+_0x950a15(0x1c5),'location':getLocationFromPath(_0x553a55[_0x950a15(0x1bf)],_0x553a55[_0x950a15(0x1e1)],pathToArray(_0x15e5d9+_0x950a15(0x1d9)))}),_0xb885e5&&_0x7e1695[_0x950a15(0x1c6)]&&_0x382ec8[_0x950a15(0x1bb)]({'level':'warning','path':_0x15e5d9+_0x950a15(0x1d2),'code':_0x950a15(0x1df),'message':_0x950a15(0x1a9)+_0x7e1695['attribute']+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x553a55[_0x950a15(0x1bf)],_0x553a55[_0x950a15(0x1e1)],pathToArray(_0x15e5d9+_0x950a15(0x1d2)))});}}return _0x382ec8;}
|