@treasuredata/tdx 2026.3.19 → 2026.3.21
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/auth-login-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.d.ts +33 -0
- package/dist/commands/policy-command.d.ts.map +1 -0
- package/dist/commands/policy-command.js +1 -0
- package/dist/commands/policy-command.js.map +1 -0
- 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/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/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/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.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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.d.ts +41 -0
- package/dist/sdk/policy.d.ts.map +1 -0
- package/dist/sdk/policy.js +1 -0
- package/dist/sdk/policy.js.map +1 -0
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.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/segment-validator.js.map +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.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/policy.d.ts +58 -0
- package/dist/sdk/types/policy.d.ts.map +1 -0
- package/dist/sdk/types/policy.js +1 -0
- package/dist/sdk/types/policy.js.map +1 -0
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/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/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 a140_0x1bbbd8=a140_0xf1db;(function(_0x1906e6,_0x4d155a){const _0x5574f7=a140_0xf1db,_0x16f9ad=_0x1906e6();while(!![]){try{const _0x394ce4=-parseInt(_0x5574f7(0x287))/0x1*(parseInt(_0x5574f7(0x2bd))/0x2)+parseInt(_0x5574f7(0x1d6))/0x3*(-parseInt(_0x5574f7(0x2be))/0x4)+-parseInt(_0x5574f7(0x285))/0x5*(-parseInt(_0x5574f7(0x2b1))/0x6)+-parseInt(_0x5574f7(0x260))/0x7*(-parseInt(_0x5574f7(0x1d5))/0x8)+parseInt(_0x5574f7(0x24d))/0x9*(parseInt(_0x5574f7(0x224))/0xa)+parseInt(_0x5574f7(0x20a))/0xb+parseInt(_0x5574f7(0x1d3))/0xc*(-parseInt(_0x5574f7(0x223))/0xd);if(_0x394ce4===_0x4d155a)break;else _0x16f9ad['push'](_0x16f9ad['shift']());}catch(_0xaa43d){_0x16f9ad['push'](_0x16f9ad['shift']());}}}(a140_0x168c,0xd04d3));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x1bbbd8(0x24a));export const PENDING_SEGMENT_PREFIX=a140_0x1bbbd8(0x22e);export const PENDING_ACTIVATION_PREFIX=a140_0x1bbbd8(0x261);export function createPendingSegmentId(_0x48a980){return''+PENDING_SEGMENT_PREFIX+_0x48a980+'__';}export function isPendingSegmentId(_0x2ff5be){const _0x4a6ef8=a140_0x1bbbd8;return _0x2ff5be[_0x4a6ef8(0x259)](PENDING_SEGMENT_PREFIX)&&!_0x2ff5be['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x49767c){const _0x76b2e6=a140_0x1bbbd8;return _0x49767c[_0x76b2e6(0x21a)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5ebe24){return''+PENDING_ACTIVATION_PREFIX+_0x5ebe24+'__';}export function isPendingActivationId(_0x3c43f5){return _0x3c43f5['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x584fb9){const _0x49fafb=a140_0x1bbbd8;return _0x584fb9[_0x49fafb(0x21a)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4b679a,_0x69f542){const _0x5924c2=a140_0x1bbbd8,_0x505232=_0x4b679a+'::'+(_0x69f542['trim']()||_0x5924c2(0x2b6)),_0x142fb1=createHash(_0x5924c2(0x2ac))[_0x5924c2(0x1f5)](_0x505232)[_0x5924c2(0x2b5)](_0x5924c2(0x1ee))[_0x5924c2(0x29e)](0x0,0xc);return _0x5924c2(0x1d0)+_0x142fb1;}export function ensureJourneyDefaults(_0x170b1c){const _0x3f1327=a140_0x1bbbd8;!_0x170b1c['description']&&(_0x170b1c['description']=''),!_0x170b1c[_0x3f1327(0x29b)]&&(_0x170b1c['state']=_0x3f1327(0x1cf));}export function injectExistingStageIds(_0x25f619,_0x46eb07){const _0x51b9e6=a140_0x1bbbd8,_0x188e82=new Map(_0x46eb07['map'](_0x20d920=>[_0x20d920[_0x51b9e6(0x25d)],_0x20d920['id']]));for(const _0x3743d6 of _0x25f619){if(!_0x3743d6['id']){const _0x573172=_0x188e82[_0x51b9e6(0x22f)](_0x3743d6[_0x51b9e6(0x25d)]);_0x573172&&(_0x3743d6['id']=_0x573172);}}}export function resolveTDFolderPath(_0x55b708,_0x16a85a,_0x41f813){const _0x1f2959=a140_0x1bbbd8;if(!_0x16a85a)return _0x55b708;if(_0x55b708===_0x41f813||_0x55b708[_0x1f2959(0x259)](_0x41f813+'/'))return _0x55b708;return _0x55b708?_0x41f813+'/'+_0x55b708:_0x41f813;}export function addFoldersToCreate(_0x2622d5,_0x220d0e,_0x1090ea){const _0x4872f9=a140_0x1bbbd8;if(!_0x2622d5)return;if(_0x220d0e[_0x4872f9(0x240)](_0x2622d5))return;const _0x53f10d=_0x2622d5[_0x4872f9(0x29f)]('/');let _0x34957d='';for(const _0x562018 of _0x53f10d){_0x34957d=_0x34957d?_0x34957d+'/'+_0x562018:_0x562018,!_0x220d0e[_0x4872f9(0x240)](_0x34957d)&&_0x1090ea['add'](_0x34957d);}}export function sortFoldersByDepth(_0x3722c2){const _0x40ddad=a140_0x1bbbd8;return[..._0x3722c2][_0x40ddad(0x2ce)]((_0xad35bb,_0x2861ed)=>{const _0x1af6e6=_0x40ddad,_0x3f5d54=(_0xad35bb[_0x1af6e6(0x1d2)](/\//g)||[])[_0x1af6e6(0x2ab)],_0x29da17=(_0x2861ed['match'](/\//g)||[])[_0x1af6e6(0x2ab)];return _0x3f5d54-_0x29da17;});}import*as a140_0x45ca55 from'yaml';import{readFileSync}from'fs';import a140_0x3cbe56 from'path';import{isJourneyDef,parseYamlString as a140_0xcad34d,toYamlString as a140_0x44fad2,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(_0x3885c3){const _0x2f0b4e=a140_0x1bbbd8;if(Array[_0x2f0b4e(0x2ca)](_0x3885c3))return'['+_0x3885c3['map'](_0x3b5b3e=>stableStringify(_0x3b5b3e))[_0x2f0b4e(0x295)](',')+']';if(_0x3885c3&&typeof _0x3885c3===_0x2f0b4e(0x1f6)){const _0x8ca77c=_0x3885c3,_0xad86e1=Object['keys'](_0x8ca77c)[_0x2f0b4e(0x2ce)](),_0x25b427=_0xad86e1[_0x2f0b4e(0x2bc)](_0x1c2346=>'\x22'+_0x1c2346+'\x22:'+stableStringify(_0x8ca77c[_0x1c2346]));return'{'+_0x25b427['join'](',')+'}';}const _0x497a53=JSON['stringify'](_0x3885c3);return _0x497a53===undefined?_0x2f0b4e(0x1e2):_0x497a53;}function activationSignature(_0xbf5c7d){const _0x4091ab=a140_0x1bbbd8,_0x282650={'connection':_0xbf5c7d[_0x4091ab(0x2a9)],..._0xbf5c7d[_0x4091ab(0x250)]!==undefined&&{'all_columns':_0xbf5c7d[_0x4091ab(0x250)]},..._0xbf5c7d[_0x4091ab(0x2bb)]!==undefined&&{'columns':_0xbf5c7d['columns']},..._0xbf5c7d[_0x4091ab(0x280)]!==undefined&&{'behavior':_0xbf5c7d[_0x4091ab(0x280)]},..._0xbf5c7d[_0x4091ab(0x288)]!==undefined&&{'schedule':_0xbf5c7d[_0x4091ab(0x288)]},..._0xbf5c7d[_0x4091ab(0x28e)]!==undefined&&{'notification':_0xbf5c7d[_0x4091ab(0x28e)]},..._0xbf5c7d['connector_config']!==undefined&&{'connector_config':_0xbf5c7d[_0x4091ab(0x2af)]},..._0xbf5c7d[_0x4091ab(0x257)]!==undefined&&{'activation_template_id':_0xbf5c7d['activation_template_id']}};return stableStringify(_0x282650);}async function fetchSegment(_0x2bf968,_0x2f4f9d,_0x14ad5a,_0x1a3b51){const _0x3c2bdc=a140_0x1bbbd8,_0x272dac=_0x1a3b51?.['find'](_0x4cf62b=>_0x4cf62b['id']===_0x14ad5a);if(_0x272dac)return _0x272dac;try{return await _0x2bf968['segment'][_0x3c2bdc(0x1fe)](_0x2f4f9d,_0x14ad5a);}catch(_0x20fde0){logger['debug'](_0x3c2bdc(0x22b)+_0x14ad5a+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x20fde0);try{return await _0x2bf968['segment']['getSegmentEntity'](_0x14ad5a);}catch(_0x1f20a8){return logger[_0x3c2bdc(0x2a0)](_0x3c2bdc(0x299)+_0x14ad5a+':\x20'+_0x1f20a8),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2e2424,_0x3288f5,_0x1ff0d8){const _0x20c7ca=a140_0x1bbbd8,_0xf1ec8d=readPushRecovery(_0x2e2424[_0x20c7ca(0x28a)]);if(_0xf1ec8d?.['journeyName']===_0x2e2424['yamlConfig'][_0x20c7ca(0x25d)])for(const [_0x448998,_0x1906ef]of Object['entries'](_0xf1ec8d[_0x20c7ca(0x1df)])){const _0x43b8e4=generateDeterministicJourneySegmentName(_0x2e2424[_0x20c7ca(0x244)][_0x20c7ca(0x25d)],_0x448998);_0x1906ef[_0x20c7ca(0x209)]===_0x43b8e4&&(_0x3288f5[_0x20c7ca(0x1ff)](_0x448998,_0x1906ef[_0x20c7ca(0x1f2)]),_0x1ff0d8['set'](_0x448998,_0x1906ef[_0x20c7ca(0x1f2)]));}}async function createOrRecoverEmbeddedSegment(_0x2912ee,_0x5f5504,_0x37596b,_0x16f395){const _0x4fbfe0=a140_0x1bbbd8;let _0x446f4b;try{_0x446f4b=await _0x2912ee['segment'][_0x4fbfe0(0x1d4)]({'name':_0x37596b[_0x4fbfe0(0x296)],'description':_0x37596b[_0x4fbfe0(0x251)],'journeyId':_0x37596b[_0x4fbfe0(0x1f8)],'rule':_0x16f395(_0x37596b[_0x4fbfe0(0x1e5)],!![]),'countPopulation':!![],'parentFolderId':_0x37596b[_0x4fbfe0(0x1e1)],'audienceId':_0x37596b['parentId']});}catch(_0x3d5d4b){const _0x1d2f83=_0x3d5d4b instanceof Error&&_0x3d5d4b[_0x4fbfe0(0x1e3)][_0x4fbfe0(0x1f4)]('Name\x20has\x20already\x20been\x20taken');if(_0x1d2f83){const _0x24d0c3=readPushRecovery(_0x5f5504[_0x4fbfe0(0x28a)]),_0x25c108=_0x24d0c3?.['journeyName']===_0x5f5504[_0x4fbfe0(0x244)][_0x4fbfe0(0x25d)]?_0x24d0c3['segments'][_0x37596b['localName']]:undefined;if(_0x25c108?.[_0x4fbfe0(0x209)]===_0x37596b[_0x4fbfe0(0x296)])await _0x2912ee[_0x4fbfe0(0x2b6)][_0x4fbfe0(0x1ef)](_0x37596b['parentId'],_0x25c108['segmentId'],{'description':_0x37596b[_0x4fbfe0(0x251)],'rule':_0x16f395(_0x37596b[_0x4fbfe0(0x1e5)],!![]),'countPopulation':!![]}),_0x446f4b=_0x25c108['segmentId'];else throw new SDKError(ErrorCode[_0x4fbfe0(0x214)],_0x4fbfe0(0x270)+_0x37596b[_0x4fbfe0(0x21c)]+_0x4fbfe0(0x2a4)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x5f5504[_0x4fbfe0(0x28a)][_0x4fbfe0(0x21a)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x4fbfe0(0x2a8),_0x3d5d4b);}else throw _0x3d5d4b;}return saveSegmentToPushRecovery(_0x5f5504[_0x4fbfe0(0x28a)],_0x5f5504['yamlConfig'][_0x4fbfe0(0x25d)],_0x37596b[_0x4fbfe0(0x21c)],{'segmentId':_0x446f4b,'uniqueServerName':_0x37596b[_0x4fbfe0(0x296)],'createdAt':new Date()[_0x4fbfe0(0x246)]()}),_0x446f4b;}export async function prepareSegmentFiles(_0x581750,_0x40edbd,_0x24b55e,_0x5e94fb,_0x3a1a49){const _0x55f0ec=a140_0x1bbbd8,{activationDefToCreateRequest:_0x4a9429}=await import(_0x55f0ec(0x297)),_0x20a2c5=[],_0x4a6063=new Set();for(const {yamlConfig:_0x3493fb,folderPath:_0x14f27f,sourcePath:_0x507917}of _0x581750){const _0x361b32=resolveTDFolderPath(_0x14f27f,_0x5e94fb,_0x3a1a49),_0xb82410=_0x361b32+':'+_0x3493fb[_0x55f0ec(0x25d)],_0x3e1958=_0x40edbd[_0x55f0ec(0x2a2)][_0x55f0ec(0x22f)](_0xb82410),_0x2b1090=_0x3e1958?_0x40edbd['activationsBySegmentId'][_0x55f0ec(0x22f)](_0x3e1958['id'])||[]:[];addFoldersToCreate(_0x361b32,_0x40edbd[_0x55f0ec(0x2b3)],_0x4a6063);const _0x1d5bfd=calculateActivationActions(_0x3493fb[_0x55f0ec(0x2c9)]||[],_0x2b1090,_0x40edbd[_0x55f0ec(0x29d)],_0x40edbd['connectionIdToNameMap']);for(const _0x1d3d7d of _0x1d5bfd){(_0x1d3d7d[_0x55f0ec(0x29a)]===_0x55f0ec(0x218)||_0x1d3d7d[_0x55f0ec(0x29a)]==='update')&&_0x1d3d7d[_0x55f0ec(0x212)]&&(_0x1d3d7d[_0x55f0ec(0x2c5)]=await _0x4a9429(_0x1d3d7d[_0x55f0ec(0x212)],_0x24b55e));}const _0x37055c=calculateSegmentDiff(_0x3493fb,_0x3e1958,_0x2b1090,_0x40edbd[_0x55f0ec(0x29d)],_0x40edbd['connectionIdToNameMap']);_0x20a2c5[_0x55f0ec(0x2d0)]({'relativePath':_0x3493fb[_0x55f0ec(0x25d)],'absolutePath':_0x507917,'yamlConfig':_0x3493fb,'folderPath':_0x361b32,'existingSegment':_0x3e1958,'existingActivations':_0x2b1090,'isNew':_0x37055c[_0x55f0ec(0x237)],'hasChanges':_0x37055c[_0x55f0ec(0x2cc)],'diff':_0x37055c[_0x55f0ec(0x26f)],'activationActions':_0x1d5bfd});}return{'segmentFiles':_0x20a2c5,'foldersToCreate':_0x4a6063};}export async function prepareJourneyFiles(_0x46a45c,_0x54f5a0,_0x3e73d7,_0x2199ee){const _0x4dc5a6=a140_0x1bbbd8,_0x1eed8d=[],_0x4b2307=new Set();for(const {yamlConfig:_0x13a0ed,folderPath:_0x31dc83,sourcePath:_0x10a1e1}of _0x46a45c){const _0x1bd1d4=resolveTDFolderPath(_0x31dc83,_0x3e73d7,_0x2199ee),_0x30d6f7=_0x1bd1d4+':'+_0x13a0ed[_0x4dc5a6(0x25d)],_0x12a353=_0x54f5a0[_0x4dc5a6(0x245)]['get'](_0x30d6f7);let _0x3c8174,_0x35d0f2;if(_0x12a353&&_0x12a353[_0x4dc5a6(0x2ab)]>0x0){const _0x473d79=buildLocalExpandedRuleMappings(_0x13a0ed),{createYamlContext:_0x16cb6e,prefetchJourneySegments:_0x13a7dd}=createPushYamlContextForBundle(_0x54f5a0[_0x4dc5a6(0x2c4)],_0x54f5a0['parentId'],_0x54f5a0['existingSegments'],_0x473d79,_0x54f5a0[_0x4dc5a6(0x29d)],_0x54f5a0[_0x4dc5a6(0x282)],_0x54f5a0[_0x4dc5a6(0x20d)],_0x54f5a0['journeyById']);await _0x13a7dd(_0x12a353['map'](_0x206a92=>_0x206a92['id']));const _0xcb9613=await _0x54f5a0[_0x4dc5a6(0x2c4)][_0x4dc5a6(0x226)][_0x4dc5a6(0x216)](_0x12a353[0x0][_0x4dc5a6(0x23e)]),_0xacc485=hasMultipleVersions(_0x13a0ed),_0x1c767f=async _0xa100be=>{const _0x232ed9=_0x4dc5a6,_0x389b8d=_0x54f5a0['journeyById']?.[_0x232ed9(0x22f)](_0xa100be);if(_0x389b8d)return _0x389b8d;return _0x54f5a0[_0x232ed9(0x2c1)]({'journeyId':_0xa100be,'journeyName':_0x13a0ed[_0x232ed9(0x25d)],'isMultiVersion':_0x12a353[_0x232ed9(0x2ab)]>0x1});};if(_0xacc485&&_0x12a353['length']>0x1){const _0x2a7600=[];for(const _0x407931 of _0x12a353){const _0x45819f=_0x407931[_0x4dc5a6(0x264)]||0x1;_0x54f5a0[_0x4dc5a6(0x25f)]?.[_0x4dc5a6(0x1f5)](_0x4dc5a6(0x291)+_0x13a0ed[_0x4dc5a6(0x25d)]+'\x20v'+_0x45819f);const _0x2da5a0=await _0x1c767f(_0x407931['id']),_0x286fd0=_0x16cb6e(_0x407931['id']),_0x12f7b9=await journeyResponseToDef(_0x2da5a0,_0x286fd0);_0x2a7600[_0x4dc5a6(0x2d0)]({'item':_0x407931,'yaml':_0x12f7b9});}const _0x3207cf=buildLocalRuleToNameMappingFromJourney(_0x13a0ed);_0x35d0f2=buildMergedJourneyDef(_0x2a7600,_0x3207cf,_0xcb9613);const _0x2b4f3a=Math[_0x4dc5a6(0x1f9)](..._0x2a7600[_0x4dc5a6(0x2bc)](_0xa60ec9=>_0xa60ec9[_0x4dc5a6(0x265)]['versionNumber']||0x0)),_0x215986=_0x12a353['find'](_0x5a5165=>(_0x5a5165['versionNumber']||0x0)===_0x2b4f3a);_0x215986&&(_0x54f5a0['progress']?.['update']('Fetching\x20'+_0x13a0ed[_0x4dc5a6(0x25d)]+'\x20v'+_0x2b4f3a),_0x3c8174=await _0x1c767f(_0x215986['id']));}else{const _0x2d098e=_0x12a353[_0x12a353[_0x4dc5a6(0x2ab)]-0x1];_0x54f5a0[_0x4dc5a6(0x25f)]?.[_0x4dc5a6(0x1f5)](_0x4dc5a6(0x291)+_0x13a0ed[_0x4dc5a6(0x25d)]),_0x3c8174=await _0x1c767f(_0x2d098e['id']);const _0x4bab59=_0x16cb6e(_0x2d098e['id']),_0x28172d=await journeyResponseToDef(_0x3c8174,_0x4bab59),_0x54dca1=buildLocalRuleToNameMappingFromJourney(_0x13a0ed);_0x35d0f2=buildMergedJourneyDef([{'item':_0x2d098e,'yaml':_0x28172d}],_0x54dca1,_0xcb9613);}}addFoldersToCreate(_0x1bd1d4,_0x54f5a0[_0x4dc5a6(0x2b3)],_0x4b2307);const _0x4a41dd=calculateJourneyDiff(_0x13a0ed,_0x35d0f2);_0x1eed8d[_0x4dc5a6(0x2d0)]({'relativePath':_0x13a0ed[_0x4dc5a6(0x25d)],'absolutePath':_0x10a1e1,'yamlConfig':_0x13a0ed,'folderPath':_0x1bd1d4,'existingJourney':_0x3c8174,'isNew':_0x4a41dd['isNew'],'hasChanges':_0x4a41dd[_0x4dc5a6(0x2cc)],'diff':_0x4a41dd[_0x4dc5a6(0x26f)]});}return{'journeyFiles':_0x1eed8d,'foldersToCreate':_0x4b2307};}export function calculateActivationActions(_0x118780,_0x3fc171,_0x5e4d37,_0x132d1d){const _0x5f4d17=a140_0x1bbbd8,_0x2d9e51=[],_0x4729f0=new Map();for(const _0x3e8251 of _0x3fc171){_0x4729f0[_0x5f4d17(0x1ff)](_0x3e8251[_0x5f4d17(0x25d)],_0x3e8251);}const _0x2ccd5d=new Map();for(const _0x39218b of _0x118780){_0x2ccd5d['set'](_0x39218b[_0x5f4d17(0x25d)],_0x39218b);}for(const _0x28d133 of _0x118780){const _0x1d388a=_0x4729f0['get'](_0x28d133['name']);if(!_0x1d388a)_0x2d9e51[_0x5f4d17(0x2d0)]({'type':_0x5f4d17(0x218),'name':_0x28d133['name'],'yamlActivation':_0x28d133});else{const _0x30184b=activationResponseToDef(_0x1d388a,_0x5e4d37,_0x132d1d),_0xdcdbbe=a140_0x45ca55[_0x5f4d17(0x202)](_0x30184b),_0x1471ca=a140_0x45ca55['stringify'](_0x28d133);_0xdcdbbe!==_0x1471ca&&_0x2d9e51[_0x5f4d17(0x2d0)]({'type':_0x5f4d17(0x1f5),'name':_0x28d133[_0x5f4d17(0x25d)],'yamlActivation':_0x28d133,'existingActivation':_0x1d388a});}}for(const _0x4c70e5 of _0x3fc171){!_0x2ccd5d[_0x5f4d17(0x240)](_0x4c70e5[_0x5f4d17(0x25d)])&&_0x2d9e51[_0x5f4d17(0x2d0)]({'type':'delete','name':_0x4c70e5[_0x5f4d17(0x25d)],'existingActivation':_0x4c70e5});}return _0x2d9e51;}function calculateYamlDiff(_0x182251,_0x51e8e1){if(_0x51e8e1){const _0x348e05=generateDiff(_0x51e8e1,_0x182251),_0x26aeca=hasChanges(_0x348e05);return{'isNew':![],'hasChanges':_0x26aeca,'diff':_0x26aeca?formatDiffWithColors(_0x348e05):undefined};}const _0x53ebd3=generateDiff('',_0x182251);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x53ebd3)};}export function calculateSegmentDiff(_0x167ce5,_0x3e55bd,_0x64194a,_0x41140d,_0x1ff87d){const _0xfb397a=segmentToYamlString(_0x167ce5),_0x461f5c=_0x3e55bd?segmentToYamlString(segmentWithActivationsToYaml(_0x3e55bd,_0x64194a,undefined,_0x41140d,_0x1ff87d)):undefined;return calculateYamlDiff(_0xfb397a,_0x461f5c);}export function calculateJourneyDiff(_0x38cada,_0xad0814){const _0x4c1323=normalizeJourneyDef(_0x38cada,_0x38cada),_0x32c1e5=a140_0x44fad2(_0x4c1323),_0x5ecbbd=_0xad0814?a140_0x44fad2(normalizeJourneyDef(_0xad0814,_0x38cada)):undefined;return calculateYamlDiff(_0x32c1e5,_0x5ecbbd);}export function findSegmentsToDelete(_0x521340,_0x20092b,_0x2f5bef,_0x270b99,_0x4cd929){const _0x57ded6=a140_0x1bbbd8,_0x32aea7=new Set();for(const {yamlConfig:_0x37489c,folderPath:_0x3e643c}of _0x20092b){_0x32aea7[_0x57ded6(0x241)](_0x3e643c+':'+_0x37489c['name']);}return _0x521340[_0x57ded6(0x1d7)](_0x99ab53=>{const _0x3d9705=_0x57ded6,_0x4aad89=_0x99ab53[_0x3d9705(0x210)]?_0x2f5bef[_0x3d9705(0x22f)](_0x99ab53['segmentFolderId'][_0x3d9705(0x1eb)]())||'':'',_0x49868f=_0x4aad89+':'+_0x99ab53[_0x3d9705(0x25d)];if(_0x32aea7[_0x3d9705(0x240)](_0x49868f))return![];if(_0x4cd929)return _0x4aad89===_0x270b99||_0x4aad89[_0x3d9705(0x259)](_0x270b99+'/');return!![];});}export function findJourneysToDelete(_0x3f2673,_0x59af3e,_0x3f1765,_0x6e5f1f,_0x9976ff){const _0x36fa92=new Set();for(const {yamlConfig:_0x41b182,folderPath:_0x231228}of _0x59af3e){_0x36fa92['add'](_0x231228+':'+_0x41b182['name']);}return _0x3f2673['filter'](_0x18a516=>{const _0x4c132e=a140_0xf1db,_0x3f81a3=_0x18a516[_0x4c132e(0x1e1)]?_0x3f1765[_0x4c132e(0x22f)](_0x18a516['folderId'])||'':'',_0x1d6084=_0x3f81a3+':'+_0x18a516[_0x4c132e(0x2a1)];if(_0x36fa92[_0x4c132e(0x240)](_0x1d6084))return![];if(_0x9976ff)return _0x3f81a3===_0x6e5f1f||_0x3f81a3[_0x4c132e(0x259)](_0x6e5f1f+'/');return!![];});}export function buildSegmentLookupMap(_0x391f14,_0x26e5e7){const _0x4b0171=a140_0x1bbbd8,_0x5152ac=new Map();for(const _0x8831dd of _0x391f14){const _0x5005ad=_0x8831dd[_0x4b0171(0x210)]?_0x26e5e7[_0x4b0171(0x22f)](_0x8831dd[_0x4b0171(0x210)][_0x4b0171(0x1eb)]())||'':'',_0x2a3610=_0x5005ad+':'+_0x8831dd[_0x4b0171(0x25d)];_0x5152ac[_0x4b0171(0x1ff)](_0x2a3610,_0x8831dd);}return _0x5152ac;}function a140_0x168c(){const _0x1ead97=['activation_updating','\x20segment\x20from\x20file:\x20','ACTIVATION_UPDATE_ERROR','\x27\x20not\x20found\x20in\x20journey\x20\x27','utf-8','exitCriterias','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','isNew','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','logDeleted','conditionTimeoutDuration','segment_creating','segment_deleted','Creating\x20segment\x20\x27','journeyBundleId','SEGMENT_NOT_FOUND','has','add','segment_deleting','results','yamlConfig','journeyBundlesByFolderAndName','toISOString','Segment\x20not\x20found:\x20','activationContext','WaitStep','tdx.sdk.push-workflow','deleteActivation','Updated\x20activation\x20\x27','153OospHa','stages','parseDocument','all_columns','description','segmentNameToId','JOURNEY_SYNTAX_ERROR','existingJourney','stage\x20\x27','withProgress','activation_template_id','conditionTimeoutUnit','startsWith','journey_created','relationships','Failed\x20to\x20','name','embedded_activation_creating','progress','1857359JJWfKe','__pending_act_','toLowerCase','journey_updating','versionNumber','item','\x20(referenced\x20in\x20journey\x20','dirname','folder_creating','activationParams','reduce','parentId','\x0a\x20\x20','\x20error(s)','getJourney','diff','Embedded\x20segment\x20\x27','\x27\x20by\x20rule\x20content','steps','NOT_FOUND','find','entryCriteria','entry_criteria','activation_deleted','embeddedSegmentNameToId','Duration','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','delete','created','activation_updated','logSuccess','all','behavior','decision_point','connectionIdToNameMap','listActivations','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','424685LuUAkb','Failed\x20to\x20resolve\x20activation\x20','193vAOWMG','schedule','waitStepType','absolutePath','folderPath','./journey-yaml.js','Created\x20activation\x20\x27','notification','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','Fetching\x20','DecisionPoint','entry','folder','join','uniqueSegmentName','./child-segment-yaml.js','Deleting\x20activation\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','type','state','getActivation','idToEmailMap','slice','split','debug','journeyBundleName','segmentByFolderAndName','createdSegmentId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','goal','Updated\x20segment\x20\x27','Deleted\x20segment\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','connection','run_after_journey_refresh','length','sha1','existingActivation','Condition','connector_config','buildUserMaps','72eLMDOw','waitStepUnit','folderPathToId','embedded_segment_creating','digest','segment','updated','journeys','onProgress','day','columns','map','14218iqUwJv','540wBlanD','journeyActivationStepId','\x27\x20wait\x20condition','fetchJourney','goal\x20criteria','logInfo','deps','validatedRequest','from','\x20activation\x20\x27','milestone','activations','isArray','action','hasChanges','journeyStages','sort','Created\x20folder\x20\x27','push','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x20journey\x20from\x20file:\x20','\x27...','rootFolderId','some','draft','journey_entry_criteria_','valid','match','48Xsgjdz','createJourneySegment','16FEBgHK','10509UuSGDB','filter','existingSegment','user','Creating\x20folder\x20\x27','branches','Stage\x20\x27','data','segment_updated','segments','Updating\x20segment\x20\x27','folderId','null','message','deleteSegment','resolvedRule','resolveSegment','waitStep','createActivation','segment_updating','with','toString','\x27\x20milestone','Created\x20journey\x20\x27','hex','updateSegmentById','\x27\x20entry\x20criteria','index','segmentId','relative','includes','update','object','nameToId','journeyId','max','../../utils/async.js','\x27\x20for\x20','createdSegmentIds','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','getSegment','set','idToName','unchanged','stringify','flatMap','updateActivation','size','conditions','\x27\x20to\x20local\x20\x27','embedded_segment_created','uniqueServerName','16596833gMJJrK','activation_deleting','journeyActivationNameToId','activationStepsById','\x27\x20from\x20file:\x20','parse','segmentFolderId','attributes','yamlActivation','Failed\x20to\x20resolve\x20segment\x20','SEGMENT_UPDATE_ERROR','segment_created','getLatestJourneyId','rule','create','Activation','replace','kind','localName','createFolder','deleted','INTERNAL','Creating\x20activation\x20\x27','Journey\x20\x27','existingSegments','2585388UnrkOZ','255840bsoXvl','conditionSegmentId','journey','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Updated\x20journey\x20\x27','entries','Updating\x20activation\x20\x27','getSegment\x20failed\x20for\x20','activation_created','nameToType','__pending_','get'];a140_0x168c=function(){return _0x1ead97;};return a140_0x168c();}export function buildSegmentNameToIdMap(_0x44208a){const _0x452395=a140_0x1bbbd8,_0x6af492=new Map();for(const _0xa076d1 of _0x44208a){_0x6af492[_0x452395(0x1ff)](_0xa076d1['name'],_0xa076d1['id']);}return _0x6af492;}export function buildJourneyBundleLookupMap(_0x337836,_0x1437f8){const _0x479293=a140_0x1bbbd8,_0x3d9fb9=new Map();for(const _0x3344fb of _0x337836){const _0x44ec66=_0x3344fb[_0x479293(0x1e1)]?_0x1437f8['get'](_0x3344fb[_0x479293(0x1e1)])||'':'',_0x3abdb6=_0x44ec66+':'+_0x3344fb[_0x479293(0x2a1)];!_0x3d9fb9[_0x479293(0x240)](_0x3abdb6)&&_0x3d9fb9[_0x479293(0x1ff)](_0x3abdb6,[]),_0x3d9fb9[_0x479293(0x22f)](_0x3abdb6)[_0x479293(0x2d0)](_0x3344fb);}for(const _0x4fc046 of _0x3d9fb9['values']()){_0x4fc046['sort']((_0x27bf65,_0x91aa96)=>(_0x27bf65[_0x479293(0x264)]||0x0)-(_0x91aa96['versionNumber']||0x0));}return _0x3d9fb9;}export function collectFoldersToCreate(_0x93390e,_0xd2b50a){const _0x1a035f=a140_0x1bbbd8,_0xb6a569=new Set();for(const _0x2295d3 of _0x93390e){if(!_0x2295d3)continue;if(_0xd2b50a['has'](_0x2295d3))continue;const _0x2365f0=_0x2295d3[_0x1a035f(0x29f)]('/');let _0x7f9ba7='';for(const _0x2ecda8 of _0x2365f0){_0x7f9ba7=_0x7f9ba7?_0x7f9ba7+'/'+_0x2ecda8:_0x2ecda8,!_0xd2b50a[_0x1a035f(0x240)](_0x7f9ba7)&&_0xb6a569[_0x1a035f(0x241)](_0x7f9ba7);}}return _0xb6a569;}export function parseAndClassifyYamlFiles(_0x15a8be,_0x4f5b5a,_0x4b5111){const _0xeed0f2=a140_0x1bbbd8,_0x68d9ec=[],_0x619bfd=[];for(const _0x182d6f of _0x15a8be){const _0x36f8ce=a140_0x3cbe56[_0xeed0f2(0x1f3)](_0x4f5b5a,a140_0x3cbe56[_0xeed0f2(0x267)](_0x182d6f)),_0x3e3620=_0x36f8ce==='.'?'':_0x36f8ce,_0x4d100c=readFileSync(_0x182d6f,'utf-8'),_0x39ed4a=a140_0x45ca55[_0xeed0f2(0x20f)](_0x4d100c);if(isJourneyDef(_0x39ed4a)){const _0x256440=a140_0xcad34d(_0x4d100c);_0x619bfd['push']({'yamlConfig':_0x256440,'folderPath':_0x3e3620,'sourcePath':_0x182d6f});}else{if(!_0x4b5111?.['skipSegments']){const _0x3e4971=parseSegmentYamlFile(_0x4d100c),_0x256da7=normalizeChildSegmentYaml(_0x3e4971);_0x68d9ec['push']({'yamlConfig':_0x256da7,'folderPath':_0x3e3620,'sourcePath':_0x182d6f});}}}return{'segments':_0x68d9ec,'journeys':_0x619bfd};}export function validateParsedFiles(_0x459d08,_0x17e63b){const _0x4832ea=a140_0x1bbbd8,_0x162171=[];for(const {yamlConfig:_0x4e68dd,sourcePath:_0x2773b0}of _0x459d08[_0x4832ea(0x1df)]){const _0x3151c2=readFileSync(_0x2773b0,'utf-8'),_0x237fee=a140_0x45ca55['parseDocument'](_0x3151c2),_0x43afaf=validateSegmentDef(_0x4e68dd,{'source':_0x3151c2,'document':_0x237fee},{'skipSchema':!![]});if(!_0x43afaf[_0x4832ea(0x1d1)]){const _0x2d9496=a140_0x3cbe56[_0x4832ea(0x1f3)](_0x17e63b,_0x2773b0);_0x162171[_0x4832ea(0x2d0)]({'filePath':_0x2d9496,'source':_0x3151c2,'result':_0x43afaf,'isJourney':![]});}}for(const {yamlConfig:_0x4e8488,sourcePath:_0x444e2f}of _0x459d08[_0x4832ea(0x2b8)]){const _0x57004b=readFileSync(_0x444e2f,_0x4832ea(0x234)),_0x3585ba=a140_0x45ca55[_0x4832ea(0x24f)](_0x57004b),_0x5635ee=validateJourneyDef(_0x4e8488,{'source':_0x57004b,'document':_0x3585ba},{'skipSchema':!![]});if(!_0x5635ee['valid']){const _0x24d35e=a140_0x3cbe56['relative'](_0x17e63b,_0x444e2f);_0x162171[_0x4832ea(0x2d0)]({'filePath':_0x24d35e,'source':_0x57004b,'result':_0x5635ee,'isJourney':!![]});}}return _0x162171;}export function formatValidationErrors(_0x120a9b){const _0x1838d7=a140_0x1bbbd8,_0x42b130=[];for(const {filePath:_0x18d961,source:_0x1ec987,result:_0x40c6bc,isJourney:_0x1df3f9}of _0x120a9b){const _0xec5ef5=_0x1df3f9?_0x1838d7(0x226):'segment';_0x42b130[_0x1838d7(0x2d0)]('\x0a'+_0x18d961+'\x20('+_0xec5ef5+'):\x20'+_0x40c6bc['errors'][_0x1838d7(0x2ab)]+_0x1838d7(0x26d)),_0x42b130[_0x1838d7(0x2d0)](formatValidationResult(_0x40c6bc,_0x1ec987,_0x18d961));}return _0x42b130[_0x1838d7(0x295)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x36a635){const _0x36ea00=a140_0x1bbbd8,_0x795039=new Set(),_0x3de310=new Map(),_0x400f56=collectSegmentUsageCounts(_0x36a635);if(_0x36a635[_0x36ea00(0x1df)])for(const [_0x348321,_0x42ced9]of Object[_0x36ea00(0x229)](_0x36a635[_0x36ea00(0x1df)])){_0x795039[_0x36ea00(0x241)](_0x348321);if(_0x42ced9[_0x36ea00(0x217)]){const _0x2d429b=yamlRuleToApi(_0x42ced9[_0x36ea00(0x217)]),_0x59ec91=apiRuleToYaml(_0x2d429b);_0x3de310[_0x36ea00(0x1ff)](_0x348321,_0x59ec91);}}const _0x2ebfe1=new Map();let _0xc20a23=0x0;for(const [_0x50ca45,_0x3d5f47]of _0x3de310){const _0x42fc59=serializeExpandedRule(_0x3d5f47,_0x3de310),_0x4334a7=_0x2ebfe1['get'](_0x42fc59)||[];_0x4334a7[_0x36ea00(0x2d0)]({'name':_0x50ca45,'index':_0xc20a23}),_0x2ebfe1['set'](_0x42fc59,_0x4334a7),_0xc20a23++;}const _0x467cd8=new Map();for(const [_0x2c2161,_0x183492]of _0x2ebfe1){const _0x4a3983=_0x183492[_0x36ea00(0x29e)]()[_0x36ea00(0x2ce)]((_0x15601a,_0x5bac55)=>{const _0x1c2b51=_0x36ea00,_0xb7b418=_0x400f56[_0x1c2b51(0x22f)](_0x15601a['name'])||0x0,_0x1bba9f=_0x400f56['get'](_0x5bac55[_0x1c2b51(0x25d)])||0x0;if(_0xb7b418!==_0x1bba9f)return _0x1bba9f-_0xb7b418;return _0x15601a[_0x1c2b51(0x1f1)]-_0x5bac55[_0x1c2b51(0x1f1)];})[_0x36ea00(0x2bc)](_0x23daa6=>_0x23daa6[_0x36ea00(0x25d)]),_0x5316d1=[];for(const _0x1c8540 of _0x4a3983){const _0x2963d4=_0x400f56[_0x36ea00(0x22f)](_0x1c8540)||0x0,_0x15fd52=Math[_0x36ea00(0x1f9)](_0x2963d4,0x1);for(let _0xb57f5=0x0;_0xb57f5<_0x15fd52;_0xb57f5++){_0x5316d1['push'](_0x1c8540);}}_0x467cd8[_0x36ea00(0x1ff)](_0x2c2161,_0x5316d1);}return{'existingLocalSegmentNames':_0x795039,'localSegmentRules':_0x3de310,'localExpandedRuleToNames':_0x467cd8};}export function createSegmentIdResolver(_0x1cc8a0,_0x3e75ab){return async _0x2af139=>{const _0x163a54=a140_0xf1db,_0x3a9f26=_0x1cc8a0[_0x163a54(0x22f)](_0x2af139);if(!_0x3a9f26)throw new SDKError(ErrorCode[_0x163a54(0x23f)],_0x163a54(0x247)+_0x2af139+_0x163a54(0x284)+_0x3e75ab+'\x27)');return _0x3a9f26;};}export function extractRootFolderId(_0x17e059){const _0x1a2a52=a140_0x1bbbd8;return _0x17e059['relationships']?.['parentSegmentFolder']?.[_0x1a2a52(0x1dd)]?.['id']||_0x17e059['relationships']?.['parentFolder']?.[_0x1a2a52(0x1dd)]?.['id'];}export function buildConnectionMaps(_0x5ae523){const _0x1eb3fa=a140_0x1bbbd8,_0x53e3d8=new Map(),_0x2307da=new Map(),_0x425d40=new Map();for(const _0x48229b of _0x5ae523){_0x53e3d8[_0x1eb3fa(0x1ff)](_0x48229b[_0x1eb3fa(0x25d)],parseInt(_0x48229b['id'],0xa)),_0x2307da[_0x1eb3fa(0x1ff)](_0x48229b['id'],_0x48229b[_0x1eb3fa(0x25d)]),_0x425d40[_0x1eb3fa(0x1ff)](_0x48229b[_0x1eb3fa(0x25d)],_0x48229b[_0x1eb3fa(0x29a)]);}return{'nameToId':_0x53e3d8,'idToName':_0x2307da,'nameToType':_0x425d40};}export function calculatePushStats(_0x2fcc7d,_0x2c8569,_0x35d047,_0x42e169,_0x2b1ec1,_0x329087,_0x24764a){const _0x3af1ce=a140_0x1bbbd8,_0x16a6a9=_0x2fcc7d['filter'](_0xd1d7f4=>_0xd1d7f4[_0x3af1ce(0x237)]),_0x1a0bcc=_0x2fcc7d[_0x3af1ce(0x1d7)](_0x3b060e=>!_0x3b060e[_0x3af1ce(0x237)]&&_0x3b060e[_0x3af1ce(0x2cc)]),_0x223d0d=_0x2fcc7d[_0x3af1ce(0x1d7)](_0x2c04e6=>!_0x2c04e6[_0x3af1ce(0x237)]&&!_0x2c04e6['hasChanges']),_0x38b3fe=_0x329087?_0x42e169:[],_0x2ed5d3=_0x2c8569['filter'](_0x4e41bb=>_0x4e41bb[_0x3af1ce(0x237)]),_0xd888cc=_0x2c8569[_0x3af1ce(0x1d7)](_0x3d4ee7=>!_0x3d4ee7[_0x3af1ce(0x237)]&&_0x3d4ee7['hasChanges']),_0x47d74f=_0x2c8569[_0x3af1ce(0x1d7)](_0x327103=>!_0x327103['isNew']&&!_0x327103[_0x3af1ce(0x2cc)]),_0x49433a=_0x329087?_0x2b1ec1:[],_0x3b8779=_0x2fcc7d[_0x3af1ce(0x203)](_0x25aade=>_0x25aade['activationActions']),_0xe5831b=_0x3b8779['filter'](_0x3a0fe9=>_0x3a0fe9[_0x3af1ce(0x29a)]===_0x3af1ce(0x218)),_0x3da134=_0x3b8779[_0x3af1ce(0x1d7)](_0x17b745=>_0x17b745[_0x3af1ce(0x29a)]===_0x3af1ce(0x1f5)),_0x35d052=_0x3b8779[_0x3af1ce(0x1d7)](_0x1bef3e=>_0x1bef3e[_0x3af1ce(0x29a)]===_0x3af1ce(0x27b)),_0x3085d1=Array['from'](_0x35d047)[_0x3af1ce(0x2ce)](),_0x1af4f5=_0x24764a?![]:_0x16a6a9['length']>0x0||_0x1a0bcc[_0x3af1ce(0x2ab)]>0x0||_0x38b3fe[_0x3af1ce(0x2ab)]>0x0,_0x370fdf=_0x2ed5d3[_0x3af1ce(0x2ab)]>0x0||_0xd888cc[_0x3af1ce(0x2ab)]>0x0||_0x49433a[_0x3af1ce(0x2ab)]>0x0,_0x3d4af6=_0x24764a?![]:_0x3b8779[_0x3af1ce(0x2ab)]>0x0,_0x2fa621=_0x3085d1[_0x3af1ce(0x2ab)]>0x0;return{'segments':{'new':_0x16a6a9,'changed':_0x1a0bcc,'unchanged':_0x223d0d,'toDelete':_0x38b3fe},'journeys':{'new':_0x2ed5d3,'changed':_0xd888cc,'unchanged':_0x47d74f,'toDelete':_0x49433a},'activations':{'all':_0x3b8779,'toCreate':_0xe5831b,'toUpdate':_0x3da134,'toDelete':_0x35d052},'folders':{'toCreate':_0x3085d1},'counts':{'segments':{'new':_0x16a6a9[_0x3af1ce(0x2ab)],'changed':_0x1a0bcc[_0x3af1ce(0x2ab)],'unchanged':_0x223d0d['length'],'toDelete':_0x38b3fe['length']},'journeys':{'new':_0x2ed5d3[_0x3af1ce(0x2ab)],'changed':_0xd888cc[_0x3af1ce(0x2ab)],'unchanged':_0x47d74f['length'],'toDelete':_0x49433a[_0x3af1ce(0x2ab)]},'activations':{'create':_0xe5831b[_0x3af1ce(0x2ab)],'update':_0x3da134[_0x3af1ce(0x2ab)],'delete':_0x35d052[_0x3af1ce(0x2ab)]},'folders':_0x3085d1[_0x3af1ce(0x2ab)]},'hasChanges':_0x1af4f5||_0x370fdf||_0x3d4af6||_0x2fa621};}export async function buildPushExecutionContext(_0x359330,_0x239105,_0x364d3f,_0xb1311c,_0x2b1cd9,_0x25d27b){const _0x541397=a140_0x1bbbd8,_0x275d3e=extractRootFolderId(_0x364d3f),{pathToId:_0x1b3992,idToPath:_0x214bb6}=buildFolderMaps(_0x2b1cd9),_0x241565=buildSegmentNameToIdMap(_0xb1311c),_0x13827f=new Map(),{batchAsync:_0x3fddbc}=await import(_0x541397(0x1fa)),[_0x4ec6b0,_0x4de603]=await Promise[_0x541397(0x27f)]([_0x359330[_0x541397(0x1d9)][_0x541397(0x2b0)](),_0x359330[_0x541397(0x2a9)]['list'](),((async()=>{const _0x5a3e1a=_0x541397;!_0x25d27b&&_0xb1311c[_0x5a3e1a(0x2ab)]>0x0&&await _0x3fddbc(_0xb1311c,async _0x8690e1=>{const _0x76e636=await _0x359330['segment']['listActivations'](_0x239105,_0x8690e1['id']);_0x13827f['set'](_0x8690e1['id'],_0x76e636);});})())]),{emailToId:_0x2f0b41,idToEmail:_0x247e48}=_0x4ec6b0,_0x36a4ab=buildConnectionMaps(_0x4de603);return{'rootFolderId':_0x275d3e,'folderPathToId':_0x1b3992,'folderIdToPath':_0x214bb6,'segmentNameToId':_0x241565,'activationsBySegmentId':_0x13827f,'emailToIdMap':_0x2f0b41,'idToEmailMap':_0x247e48,'connectionNameToIdMap':_0x36a4ab[_0x541397(0x1f7)],'connectionIdToNameMap':_0x36a4ab[_0x541397(0x200)],'connectionNameToTypeMap':_0x36a4ab[_0x541397(0x22d)]};}export function createPushYamlContextForBundle(_0x2dd83b,_0x225dc,_0x292a49,_0x5e6cd9,_0x2e8799,_0x1bd3b3,_0x45ccd5,_0x30a335){const {existingLocalSegmentNames:_0x28567f,localExpandedRuleToNames:_0x4dc2f4}=_0x5e6cd9,_0x27d2bd=new Set(),_0x535842=new Map(),_0x4f8d78=new Map(),_0x1356ce=new Map(),_0x46d5e3=createJumpTargetCache(),_0x14ad6b=new Map(),_0xbfaf03=new Map(),_0x555ed2=new Set();let _0x4be5bc;const _0x36b0b5=_0x5bf07f=>{const _0x153c16={'resolveSegment':async _0x3936ed=>{const _0x4e01ea=a140_0xf1db,_0xef0396=_0x1356ce['get'](_0x3936ed);if(_0xef0396!==undefined)return{'name':_0xef0396,'isJourneyLocal':!![]};try{const _0x3a8a78=await fetchSegment(_0x2dd83b,_0x225dc,_0x3936ed,_0x292a49);if(!_0x3a8a78)throw new Error('Segment\x20not\x20found');const _0x1c6622=generateJourneyLocalName(_0x3a8a78[_0x4e01ea(0x25d)]),_0x369c12=_0x3a8a78[_0x4e01ea(0x21b)]===SEGMENT_KIND_JOURNEY&&_0x1c6622!==undefined;let _0x3b193b=_0x3a8a78['name'],_0x285774;if(_0x369c12&&_0x3a8a78[_0x4e01ea(0x217)]){const _0x3470d9=apiRuleToYaml(_0x3a8a78[_0x4e01ea(0x217)]);_0xbfaf03['set'](_0x3936ed,_0x3470d9);const _0x69b57d=async _0x8d3064=>{const _0x2736b7=_0x4e01ea,_0x878158=collectSegmentRefsFromRule(_0x8d3064);for(const _0x3fced1 of _0x878158){if(!_0xbfaf03['has'](_0x3fced1))try{const _0x1d9656=await fetchSegment(_0x2dd83b,_0x225dc,_0x3fced1,_0x292a49);if(_0x1d9656?.['rule']){const _0x48eeb1=apiRuleToYaml(_0x1d9656[_0x2736b7(0x217)]);_0xbfaf03[_0x2736b7(0x1ff)](_0x3fced1,_0x48eeb1),await _0x69b57d(_0x48eeb1);}}catch(_0x38064b){logger[_0x2736b7(0x2a0)](_0x2736b7(0x2d1)+_0x3fced1+':\x20'+_0x38064b);}}};await _0x69b57d(_0x3470d9);const _0x526d50=serializeExpandedRule(_0x3470d9,_0xbfaf03),_0x352a3b=_0x4dc2f4[_0x4e01ea(0x22f)](_0x526d50);if(_0x352a3b&&_0x352a3b['length']>0x0){const _0x4cb5a0=_0x535842['get'](_0x526d50)||0x0,_0x116769=_0x352a3b[_0x4cb5a0]||_0x352a3b[_0x352a3b[_0x4e01ea(0x2ab)]-0x1];_0x535842[_0x4e01ea(0x1ff)](_0x526d50,_0x4cb5a0+0x1),_0x3b193b=_0x116769,_0x27d2bd[_0x4e01ea(0x241)](_0x3b193b),_0x1356ce[_0x4e01ea(0x1ff)](_0x3936ed,_0x3b193b);const _0x15f7a5=await resolveRuleSegmentRefs(_0x3470d9,async _0x4c3b5e=>{const _0x244dae=_0x4e01ea,_0x4de1f8=_0x1356ce['get'](_0x4c3b5e);if(_0x4de1f8)return _0x4de1f8;const _0x2153b9=await _0x4be5bc[_0x244dae(0x1e6)](_0x4c3b5e);return _0x2153b9[_0x244dae(0x25d)];});_0x285774={'description':_0x3a8a78[_0x4e01ea(0x251)],'rule':_0x15f7a5};}else{const _0xc05d10=_0x14ad6b[_0x4e01ea(0x22f)](_0x526d50);if(_0xc05d10)_0x3b193b=_0xc05d10,_0x1356ce[_0x4e01ea(0x1ff)](_0x3936ed,_0x3b193b);else{if(_0x1c6622){let _0x6c2ed3=_0x1c6622,_0x374e35=0x2;while(_0x27d2bd[_0x4e01ea(0x240)](_0x6c2ed3)||_0x28567f[_0x4e01ea(0x240)](_0x6c2ed3)){_0x6c2ed3=_0x1c6622+'_'+_0x374e35,_0x374e35++;}_0x27d2bd[_0x4e01ea(0x241)](_0x6c2ed3),_0x3b193b=_0x6c2ed3;}_0x1356ce[_0x4e01ea(0x1ff)](_0x3936ed,_0x3b193b),_0x14ad6b[_0x4e01ea(0x1ff)](_0x526d50,_0x3b193b);const _0x4dffff=await resolveRuleSegmentRefs(_0x3470d9,async _0xac445e=>{const _0x42fb1e=_0x4e01ea,_0x4f8b97=_0x1356ce[_0x42fb1e(0x22f)](_0xac445e);if(_0x4f8b97)return _0x4f8b97;const _0x40f0d1=await _0x4be5bc[_0x42fb1e(0x1e6)](_0xac445e);return _0x40f0d1[_0x42fb1e(0x25d)];});_0x285774={'description':_0x3a8a78[_0x4e01ea(0x251)],'rule':_0x4dffff};}}}return{'name':_0x3b193b,'isJourneyLocal':_0x369c12,'definition':_0x285774};}catch(_0xe56cbc){return logger[_0x4e01ea(0x2a0)](_0x4e01ea(0x213)+_0x3936ed+':\x20'+_0xe56cbc),{'name':_0x3936ed,'isJourneyLocal':![]};}},'resolveActivation':async _0x594514=>{const _0x3d73cb=a140_0xf1db,_0x1b43f8=_0x4f8d78[_0x3d73cb(0x22f)](_0x594514);if(_0x1b43f8!==undefined)return{'name':_0x1b43f8,'isJourneyLocal':!![]};try{let _0x36ae1c=_0x45ccd5?.[_0x3d73cb(0x22f)](_0x594514);!_0x36ae1c&&(_0x36ae1c=await _0x2dd83b[_0x3d73cb(0x226)][_0x3d73cb(0x29c)](_0x5bf07f,_0x594514));const _0x51b391=_0x36ae1c['attributes'][_0x3d73cb(0x269)]['name']||_0x594514,_0x52716b=sanitizeYamlKey(_0x51b391)||'activation_'+_0x594514,_0x296111=_0x52716b;_0x4f8d78[_0x3d73cb(0x1ff)](_0x594514,_0x296111);const _0x20565f=journeyActivationStepToYaml(_0x36ae1c,_0x2e8799,_0x1bd3b3);return{'name':_0x296111,'isJourneyLocal':!![],'definition':_0x20565f};}catch(_0x255e86){return logger[_0x3d73cb(0x2a0)](_0x3d73cb(0x286)+_0x594514+':\x20'+_0x255e86),{'name':_0x594514,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5a227c,_0x402a0a)=>resolveJumpTarget(_0x5a227c,_0x402a0a,_0x46d5e3,async _0x1fa066=>{const _0x469c00=a140_0xf1db,_0x2a9b10=_0x30a335?.[_0x469c00(0x22f)](_0x1fa066);if(_0x2a9b10)return _0x2a9b10;return _0x2dd83b[_0x469c00(0x226)][_0x469c00(0x26e)](_0x1fa066);})};return _0x4be5bc=_0x153c16,_0x153c16;},_0x5ca0dc=async _0x2474e2=>{const _0x198c58=a140_0xf1db,{collectSegmentIdsFromJourneyApi:_0x517638}=await import(_0x198c58(0x28c)),{batchAsync:_0x40fa20}=await import(_0x198c58(0x1fa)),_0x369ce9=new Set();for(const _0x5e29a3 of _0x2474e2){let _0x32a058=_0x30a335?.[_0x198c58(0x22f)](_0x5e29a3);!_0x32a058&&(_0x32a058=await _0x2dd83b['journey'][_0x198c58(0x26e)](_0x5e29a3));const _0x2b973f=_0x517638(_0x32a058);for(const _0x57e1e6 of _0x2b973f){_0x369ce9[_0x198c58(0x241)](_0x57e1e6);}}let _0x51218e=Array[_0x198c58(0x2c6)](_0x369ce9);while(_0x51218e[_0x198c58(0x2ab)]>0x0){const _0x4af95e=_0x51218e[_0x198c58(0x1d7)](_0x465f97=>!_0x555ed2['has'](_0x465f97));if(_0x4af95e[_0x198c58(0x2ab)]===0x0)break;const _0x7821dd=await _0x40fa20(_0x4af95e,async _0x1e5611=>{const _0x1e9383=_0x198c58;_0x555ed2[_0x1e9383(0x241)](_0x1e5611);const _0xf1db5e=await fetchSegment(_0x2dd83b,_0x225dc,_0x1e5611,_0x292a49);if(!_0xf1db5e)return null;return{'segmentId':_0x1e5611,'segment':_0xf1db5e};},0xa),_0x2c0b57=new Set();for(const _0x5e61a7 of _0x7821dd){if(!_0x5e61a7?.[_0x198c58(0x2b6)]?.[_0x198c58(0x217)])continue;const _0x5a3ce3=apiRuleToYaml(_0x5e61a7['segment'][_0x198c58(0x217)]);_0xbfaf03[_0x198c58(0x1ff)](_0x5e61a7[_0x198c58(0x1f2)],_0x5a3ce3);const _0x2dd99f=collectSegmentRefsFromRule(_0x5a3ce3);for(const _0x35f7a4 of _0x2dd99f){!_0x555ed2[_0x198c58(0x240)](_0x35f7a4)&&_0x2c0b57['add'](_0x35f7a4);}}_0x51218e=Array['from'](_0x2c0b57);}};return{'createYamlContext':_0x36b0b5,'prefetchJourneySegments':_0x5ca0dc};}export async function executePushSegments(_0x27e822,_0x184948,_0x49ed02,_0x1ef4ab,_0x37394c){const _0x4be7cb=a140_0x1bbbd8,{segmentDefToCreateRequest:_0x5be997,segmentDefToUpdateRequest:_0x38b8e6}=await import(_0x4be7cb(0x297)),_0x9aa2fb=_0x49ed02['folderPathToId'],_0xbb628d=0x5,_0x333e02=async _0x2cfe01=>{const _0x2cf34e=_0x4be7cb,_0x4dfc32=_0x2cfe01['folderPath']?_0x9aa2fb[_0x2cf34e(0x22f)](_0x2cfe01[_0x2cf34e(0x28b)]):undefined;let _0x2ee60c;const _0x3dca96={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x151f62=_0x2cfe01[_0x2cf34e(0x244)];if(_0x2cfe01[_0x2cf34e(0x244)]['rule']){const _0x545c7a=createSegmentIdResolver(_0x49ed02[_0x2cf34e(0x252)],_0x2cfe01[_0x2cf34e(0x244)]['name']),_0xba4238=await resolveRuleSegmentIds(_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x217)],_0x545c7a);_0x151f62={..._0x2cfe01[_0x2cf34e(0x244)],'rule':_0xba4238};}try{if(_0x2cfe01[_0x2cf34e(0x237)]){_0x37394c[_0x2cf34e(0x2b9)]?.({'type':_0x2cf34e(0x23b),'name':_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]});const _0x385cb1=_0x5be997(_0x151f62,_0x4dfc32),_0x5d1137=await _0x37394c[_0x2cf34e(0x256)](_0x2cf34e(0x23d)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+_0x2cf34e(0x2d3),()=>_0x27e822['segment']['createSegment'](_0x1ef4ab['parentId'],_0x385cb1));_0x2ee60c=_0x5d1137['data']['id'],_0x49ed02['segmentNameToId'][_0x2cf34e(0x1ff)](_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)],_0x2ee60c),_0x3dca96[_0x2cf34e(0x2a3)]={'name':_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)],'id':_0x2ee60c},_0x37394c[_0x2cf34e(0x2b9)]?.({'type':_0x2cf34e(0x215),'name':_0x2cfe01['yamlConfig'][_0x2cf34e(0x25d)],'segmentId':_0x2ee60c}),_0x37394c[_0x2cf34e(0x27e)]?.('Created\x20segment\x20\x27'+_0x2cfe01['yamlConfig']['name']+'\x27'),_0x3dca96[_0x2cf34e(0x27c)]=0x1;}else{if(_0x2cfe01['hasChanges']){_0x37394c[_0x2cf34e(0x2b9)]?.({'type':_0x2cf34e(0x1e9),'name':_0x2cfe01['yamlConfig']['name']});const _0x4ab524=_0x38b8e6(_0x151f62);_0x4dfc32!==_0x2cfe01[_0x2cf34e(0x1d8)]?.[_0x2cf34e(0x210)]&&(_0x4ab524[_0x2cf34e(0x210)]=_0x4dfc32?parseInt(_0x4dfc32,0xa):undefined),await _0x37394c[_0x2cf34e(0x256)](_0x2cf34e(0x1e0)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+'\x27...',()=>_0x27e822[_0x2cf34e(0x2b6)]['updateSegmentById'](_0x1ef4ab[_0x2cf34e(0x26b)],_0x2cfe01[_0x2cf34e(0x1d8)]['id'],_0x4ab524)),_0x2ee60c=_0x2cfe01[_0x2cf34e(0x1d8)]['id'],_0x37394c['onProgress']?.({'type':_0x2cf34e(0x1de),'name':_0x2cfe01[_0x2cf34e(0x244)]['name']}),_0x37394c[_0x2cf34e(0x27e)]?.(_0x2cf34e(0x2a6)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+'\x27'),_0x3dca96[_0x2cf34e(0x2b7)]=0x1;}else _0x2ee60c=_0x2cfe01['existingSegment']['id'];}}catch(_0x11742e){const _0x3908ef=isHttp400Error(_0x11742e),_0x35d6e6=_0x3908ef?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x39bc3d=getErrorMessage(_0x11742e);throw new SDKError(_0x35d6e6,_0x2cf34e(0x25c)+(_0x2cfe01[_0x2cf34e(0x237)]?'create':_0x2cf34e(0x1f5))+_0x2cf34e(0x231)+_0x2cfe01[_0x2cf34e(0x28a)]+_0x2cf34e(0x26c)+_0x39bc3d,_0x11742e);}try{const _0x668e48=await syncActivationsForSegment(_0x27e822,_0x1ef4ab[_0x2cf34e(0x26b)],_0x2ee60c,_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)],_0x2cfe01['activationActions'],_0x37394c,_0x2cfe01[_0x2cf34e(0x28a)]);_0x3dca96[_0x2cf34e(0x2c9)]=_0x668e48;}catch(_0x38f779){if(_0x38f779 instanceof SDKError)throw _0x38f779;throw new SDKError(ErrorCode[_0x2cf34e(0x232)],_0x2cf34e(0x28f)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+'\x27\x20from\x20file:\x20'+_0x2cfe01['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x38f779),_0x38f779);}return _0x3dca96;},_0x1e81cb=await batchAsync(_0x184948,_0x333e02,_0xbb628d),_0x22c1e2={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2efd15 of _0x1e81cb){_0x22c1e2['created']+=_0x2efd15['created'],_0x22c1e2['updated']+=_0x2efd15[_0x4be7cb(0x2b7)],_0x2efd15['createdSegmentId']&&_0x22c1e2[_0x4be7cb(0x1fc)][_0x4be7cb(0x1ff)](_0x2efd15[_0x4be7cb(0x2a3)]['name'],_0x2efd15[_0x4be7cb(0x2a3)]['id']),_0x22c1e2[_0x4be7cb(0x2c9)][_0x4be7cb(0x27c)]+=_0x2efd15[_0x4be7cb(0x2c9)]['created'],_0x22c1e2[_0x4be7cb(0x2c9)][_0x4be7cb(0x2b7)]+=_0x2efd15[_0x4be7cb(0x2c9)][_0x4be7cb(0x2b7)],_0x22c1e2[_0x4be7cb(0x2c9)][_0x4be7cb(0x21e)]+=_0x2efd15[_0x4be7cb(0x2c9)][_0x4be7cb(0x21e)];}return _0x22c1e2;}async function syncActivationsForSegment(_0x22fe7f,_0x2ab97e,_0x1fd993,_0x342b09,_0x2613e7,_0x50655b,_0x21827e){const _0x275c87=a140_0x1bbbd8,_0x14ec5a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x53d66d of _0x2613e7){try{if(_0x53d66d[_0x275c87(0x29a)]===_0x275c87(0x218)&&_0x53d66d[_0x275c87(0x2c5)])_0x50655b[_0x275c87(0x2b9)]?.({'type':'activation_creating','segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),await _0x50655b[_0x275c87(0x256)](_0x275c87(0x220)+_0x53d66d['name']+_0x275c87(0x2d3),()=>_0x22fe7f[_0x275c87(0x2b6)]['createActivation'](_0x2ab97e,_0x1fd993,_0x53d66d[_0x275c87(0x2c5)])),_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x22c),'segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),_0x50655b[_0x275c87(0x27e)]?.(_0x275c87(0x28d)+_0x53d66d['name']+'\x27'),_0x14ec5a[_0x275c87(0x27c)]++;else{if(_0x53d66d['type']===_0x275c87(0x1f5)&&_0x53d66d[_0x275c87(0x2c5)]&&_0x53d66d[_0x275c87(0x2ad)])_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x230),'segmentName':_0x342b09,'activationName':_0x53d66d['name']}),await _0x50655b['withProgress'](_0x275c87(0x22a)+_0x53d66d[_0x275c87(0x25d)]+_0x275c87(0x2d3),()=>_0x22fe7f[_0x275c87(0x2b6)][_0x275c87(0x204)](_0x2ab97e,_0x1fd993,_0x53d66d[_0x275c87(0x2ad)]['id'],_0x53d66d[_0x275c87(0x2c5)])),_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x27d),'segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),_0x50655b[_0x275c87(0x27e)]?.(_0x275c87(0x24c)+_0x53d66d[_0x275c87(0x25d)]+'\x27'),_0x14ec5a['updated']++;else _0x53d66d[_0x275c87(0x29a)]===_0x275c87(0x27b)&&_0x53d66d['existingActivation']&&(_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x20b),'segmentName':_0x342b09,'activationName':_0x53d66d['name']}),await _0x50655b[_0x275c87(0x256)](_0x275c87(0x298)+_0x53d66d['name']+_0x275c87(0x2d3),()=>_0x22fe7f[_0x275c87(0x2b6)][_0x275c87(0x24b)](_0x2ab97e,_0x1fd993,_0x53d66d[_0x275c87(0x2ad)]['id'])),_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x277),'segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),_0x50655b[_0x275c87(0x239)]?.('Deleted\x20activation\x20\x27'+_0x53d66d['name']+'\x27'),_0x14ec5a[_0x275c87(0x21e)]++);}}catch(_0x28b855){const _0x39ddf8=isHttp400Error(_0x28b855),_0x30a498=_0x39ddf8?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x275c87(0x232)],_0x1ba433=getErrorMessage(_0x28b855);throw new SDKError(_0x30a498,_0x275c87(0x25c)+_0x53d66d[_0x275c87(0x29a)]+_0x275c87(0x2c7)+_0x53d66d['name']+_0x275c87(0x20e)+_0x21827e+_0x275c87(0x26c)+_0x1ba433,_0x28b855);}}return _0x14ec5a;}export async function executePushFolders(_0x30b714,_0x5d8a4e,_0x328d7b,_0x376f18,_0x329691){const _0x4dce3b=a140_0x1bbbd8,_0x495e80=new Map(_0x328d7b),_0x3dbb2e=sortFoldersByDepth(_0x5d8a4e);for(const _0x249e58 of _0x3dbb2e){const _0x172e87=_0x249e58['split']('/'),_0x58bb02=_0x172e87[_0x172e87[_0x4dce3b(0x2ab)]-0x1],_0x2fd338=_0x172e87[_0x4dce3b(0x29e)](0x0,-0x1)['join']('/'),_0x411243=_0x495e80[_0x4dce3b(0x22f)](_0x2fd338);_0x329691[_0x4dce3b(0x2b9)]?.({'type':_0x4dce3b(0x268),'folder':_0x249e58});const _0x3c8ef5={'name':_0x58bb02,'parentFolderId':_0x411243},_0x50d546=await _0x329691['withProgress'](_0x4dce3b(0x1da)+_0x249e58+'\x27...',()=>_0x30b714['segment'][_0x4dce3b(0x21d)](_0x376f18[_0x4dce3b(0x26b)],_0x3c8ef5));_0x495e80[_0x4dce3b(0x1ff)](_0x249e58,_0x50d546[_0x4dce3b(0x1dd)]['id']),_0x329691['onProgress']?.({'type':'folder_created','folder':_0x249e58,'folderId':_0x50d546[_0x4dce3b(0x1dd)]['id']}),_0x329691[_0x4dce3b(0x2c3)]?.(_0x4dce3b(0x2cf)+_0x249e58+'\x27');}return _0x495e80;}function a140_0xf1db(_0x5c3c91,_0x45ef78){_0x5c3c91=_0x5c3c91-0x1cf;const _0x168c33=a140_0x168c();let _0xf1db88=_0x168c33[_0x5c3c91];return _0xf1db88;}export async function executePushSegmentDeletions(_0x2a394f,_0x251349,_0x230f7a){const _0x1deafd=a140_0x1bbbd8;if(_0x251349['length']===0x0)return 0x0;const {batchAsync:_0x27ac2b}=await import(_0x1deafd(0x1fa)),_0x465c73=0x5,_0x54ca83=await _0x27ac2b(_0x251349,async _0x252a42=>{const _0x4f3096=_0x1deafd;return _0x230f7a[_0x4f3096(0x2b9)]?.({'type':_0x4f3096(0x242),'name':_0x252a42[_0x4f3096(0x25d)]}),await _0x2a394f[_0x4f3096(0x2b6)][_0x4f3096(0x1e4)](_0x252a42['id']),_0x230f7a['onProgress']?.({'type':_0x4f3096(0x23c),'name':_0x252a42[_0x4f3096(0x25d)]}),_0x230f7a[_0x4f3096(0x239)]?.(_0x4f3096(0x2a7)+_0x252a42[_0x4f3096(0x25d)]+'\x27'),0x1;},_0x465c73);return _0x54ca83[_0x1deafd(0x26a)]((_0x36d3a1,_0x4f14b7)=>_0x36d3a1+_0x4f14b7,0x0);}export async function executePushJourneys(_0x404b0c,_0x39a6c5,_0x265670,_0x52aa3b,_0x5985cb){const _0x1afead=a140_0x1bbbd8,{journeyDefToRequest:_0x173c4e}=await import(_0x1afead(0x28c)),{activationDefToCreateRequest:_0x3ae558,yamlRuleToApi:_0x1debc5,validateSegmentRule:_0xc406b}=await import(_0x1afead(0x297)),_0x5c1336={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x8b0ac5=new Map(_0x265670[_0x1afead(0x252)]),_0x464237=0x5;for(let _0x2bbf61=0x0;_0x2bbf61<_0x39a6c5[_0x1afead(0x2ab)];_0x2bbf61+=_0x464237){const _0x58be47=_0x39a6c5[_0x1afead(0x29e)](_0x2bbf61,_0x2bbf61+_0x464237),_0x48f040=await Promise[_0x1afead(0x27f)](_0x58be47[_0x1afead(0x2bc)](async _0x3bb235=>{const _0x462a3a=_0x1afead;if(!_0x3bb235[_0x462a3a(0x237)]&&!_0x3bb235[_0x462a3a(0x2cc)])return{'action':'unchanged','name':_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)],'journeyId':_0x3bb235[_0x462a3a(0x254)]?.['id']};const _0x458aae=_0x3bb235[_0x462a3a(0x28b)]?_0x265670[_0x462a3a(0x2b3)]['get'](_0x3bb235[_0x462a3a(0x28b)]):undefined;_0x5985cb[_0x462a3a(0x2b9)]?.({'type':_0x3bb235[_0x462a3a(0x237)]?'journey_creating':_0x462a3a(0x263),'name':_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]});try{const _0x2cc0a1=await executeSingleJourneyPush(_0x404b0c,_0x3bb235,{..._0x265670,'segmentNameToId':_0x8b0ac5},{'parentId':_0x52aa3b['parentId'],'rootFolderId':_0x52aa3b[_0x462a3a(0x2d4)],'folderId':_0x458aae,'verbose':_0x52aa3b['verbose']},_0x5985cb,{'journeyDefToRequest':_0x173c4e,'activationDefToCreateRequest':_0x3ae558,'yamlRuleToApi':_0x1debc5,'validateSegmentRule':_0xc406b});for(const [_0x1841f8,_0x269010]of _0x2cc0a1[_0x462a3a(0x278)]){_0x8b0ac5[_0x462a3a(0x1ff)](_0x1841f8,_0x269010),_0x5c1336['embeddedSegmentNameToId']['set'](_0x1841f8,_0x269010);}if(_0x2cc0a1['action']===_0x462a3a(0x27c))_0x5985cb[_0x462a3a(0x2b9)]?.({'type':_0x462a3a(0x25a),'name':_0x3bb235['yamlConfig'][_0x462a3a(0x25d)],'journeyId':_0x2cc0a1[_0x462a3a(0x1f8)]}),_0x5985cb[_0x462a3a(0x27e)]?.(_0x462a3a(0x1ed)+_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]+'\x27'),_0x5c1336[_0x462a3a(0x27c)]++;else _0x2cc0a1[_0x462a3a(0x2cb)]===_0x462a3a(0x2b7)&&(_0x5985cb[_0x462a3a(0x2b9)]?.({'type':'journey_updated','name':_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]}),_0x5985cb[_0x462a3a(0x27e)]?.(_0x462a3a(0x228)+_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]+'\x27'),_0x5c1336[_0x462a3a(0x2b7)]++);return{'action':_0x2cc0a1[_0x462a3a(0x2cb)],'name':_0x3bb235[_0x462a3a(0x244)]['name'],'journeyId':_0x2cc0a1[_0x462a3a(0x1f8)]};}catch(_0x228e44){const _0x2e212b=isHttp400Error(_0x228e44),_0x2cc750=_0x2e212b?ErrorCode[_0x462a3a(0x253)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x1da824=getErrorMessage(_0x228e44);throw new SDKError(_0x2cc750,_0x462a3a(0x25c)+(_0x3bb235[_0x462a3a(0x237)]?_0x462a3a(0x218):_0x462a3a(0x1f5))+_0x462a3a(0x2d2)+_0x3bb235[_0x462a3a(0x28a)]+_0x462a3a(0x26c)+_0x1da824,_0x228e44);}}));_0x5c1336[_0x1afead(0x243)][_0x1afead(0x2d0)](..._0x48f040);}return _0x5c1336;}async function matchExistingJourneySegments(_0x15a79b,_0x182509,_0x3634f7,_0x38d96d,_0x4b5d1f){const _0x5943ce=a140_0x1bbbd8;if(!_0x182509['existingJourney']||!_0x182509[_0x5943ce(0x244)][_0x5943ce(0x1df)])return;const _0x117ad3=new Map(),_0x2f0acc=new Set();for(const _0x548743 of Object['keys'](_0x182509[_0x5943ce(0x244)]['segments'])){const _0x1085a3=generateDeterministicJourneySegmentName(_0x182509['yamlConfig'][_0x5943ce(0x25d)],_0x548743);_0x117ad3[_0x5943ce(0x1ff)](_0x1085a3,_0x548743),_0x2f0acc[_0x5943ce(0x241)](_0x548743);}const _0x5bda4e=[],_0x2d0122=collectSegmentIdsFromJourneyApi(_0x182509[_0x5943ce(0x254)]);for(const _0xd613ab of _0x2d0122){const _0x22c05a=await fetchSegment(_0x15a79b,_0x3634f7,_0xd613ab,_0x38d96d);if(!_0x22c05a?.['name'])continue;const _0x4837ac=_0x117ad3['get'](_0x22c05a[_0x5943ce(0x25d)]);_0x4837ac?(_0x4b5d1f[_0x5943ce(0x1ff)](_0x4837ac,_0xd613ab),_0x2f0acc[_0x5943ce(0x27b)](_0x4837ac)):_0x5bda4e[_0x5943ce(0x2d0)]({'id':_0xd613ab,'seg':_0x22c05a});}if(_0x2f0acc['size']>0x0&&_0x5bda4e[_0x5943ce(0x2ab)]>0x0){const {localExpandedRuleToNames:_0x3c1d64}=buildLocalExpandedRuleMappings(_0x182509['yamlConfig']),_0x2de985=new Map();for(const {id:_0x4441c5,seg:_0x19b970}of _0x5bda4e){if(_0x19b970[_0x5943ce(0x217)]){const _0x46ab54=apiRuleToYaml(_0x19b970[_0x5943ce(0x217)]);_0x2de985['set'](_0x4441c5,_0x46ab54);}}for(const {id:_0x4c4e46,seg:_0x2a7d16}of _0x5bda4e){if(!_0x2a7d16[_0x5943ce(0x217)])continue;const _0x437423=_0x2de985[_0x5943ce(0x22f)](_0x4c4e46);if(!_0x437423)continue;const _0x37ef10=serializeExpandedRule(_0x437423,_0x2de985),_0x1f6618=_0x3c1d64[_0x5943ce(0x22f)](_0x37ef10);if(_0x1f6618){const _0x2ad0c1=_0x1f6618['find'](_0x21f9f6=>_0x2f0acc[_0x5943ce(0x240)](_0x21f9f6));_0x2ad0c1&&(_0x4b5d1f['set'](_0x2ad0c1,_0x4c4e46),_0x2f0acc['delete'](_0x2ad0c1),logger[_0x5943ce(0x2a0)]('Matched\x20server\x20segment\x20\x27'+_0x2a7d16[_0x5943ce(0x25d)]+_0x5943ce(0x207)+_0x2ad0c1+_0x5943ce(0x271)));}}}}async function executeSingleJourneyPush(_0x429f84,_0x36cdcf,_0x279613,_0x3bfa88,_0x2dcbf4,_0x55a916){const _0x4b0ebc=a140_0x1bbbd8,{journeyDefToRequest:_0x32e268,activationDefToCreateRequest:_0x29d677,yamlRuleToApi:_0x41502d,validateSegmentRule:_0x552214}=_0x55a916,_0x3fe16d=new Map(),_0x2a61ba=new Map();recoverSegmentIdsFromPushRecovery(_0x36cdcf,_0x3fe16d,_0x279613[_0x4b0ebc(0x252)]);const _0x575052=new Map(),_0x575268=new Map(),_0x45b158=new Map();let _0x91b795;const _0x1332d6=async()=>{const _0x15dcbb=_0x4b0ebc;if(_0x91b795)return;_0x91b795=new Map();if(!_0x36cdcf['existingJourney'])return;const _0x1400c5=await _0x429f84[_0x15dcbb(0x226)][_0x15dcbb(0x283)](_0x36cdcf['existingJourney']['id']);for(const _0x2052d0 of _0x1400c5){const _0x275d90=journeyActivationStepToYaml(_0x2052d0,_0x279613[_0x15dcbb(0x29d)],_0x279613[_0x15dcbb(0x282)]),_0x191d76=activationSignature(_0x275d90);!_0x91b795[_0x15dcbb(0x240)](_0x191d76)&&_0x91b795[_0x15dcbb(0x1ff)](_0x191d76,_0x2052d0['id']),_0x275d90['name']&&_0x2a61ba[_0x15dcbb(0x1ff)](_0x275d90[_0x15dcbb(0x25d)],_0x2052d0['id']);}};await matchExistingJourneySegments(_0x429f84,_0x36cdcf,_0x3bfa88['parentId'],_0x279613[_0x4b0ebc(0x222)],_0x279613['segmentNameToId']);const _0x403240={'resolveSegmentId':async _0x4d37d1=>{const _0x5dc30b=_0x4b0ebc,_0x572367=_0x279613['segmentNameToId'][_0x5dc30b(0x22f)](_0x4d37d1);if(!_0x572367)throw new SDKError(ErrorCode[_0x5dc30b(0x23f)],'Segment\x20not\x20found:\x20'+_0x4d37d1+_0x5dc30b(0x266)+_0x36cdcf[_0x5dc30b(0x244)][_0x5dc30b(0x25d)]+')');return _0x572367;},'resolveEmbeddedSegmentId':async(_0x58f32f,_0x553854)=>{const _0x1010a0=_0x4b0ebc,_0x47e9b4=_0x279613[_0x1010a0(0x252)]['get'](_0x58f32f);if(_0x47e9b4)return _0x47e9b4;const _0xb6c6b6=_0x279613['existingSegments'][_0x1010a0(0x274)](_0x497b72=>_0x497b72[_0x1010a0(0x25d)]===_0x58f32f);if(_0xb6c6b6)return _0x279613['segmentNameToId']['set'](_0x58f32f,_0xb6c6b6['id']),_0xb6c6b6['id'];if(_0x36cdcf[_0x1010a0(0x237)]){const {stageName:_0x51e389,criteriaName:_0x3f1c9e}=findSegmentCriteriaLocation(_0x36cdcf[_0x1010a0(0x244)],_0x58f32f);return _0x552214(_0x58f32f,_0x553854[_0x1010a0(0x217)]),_0x575268[_0x1010a0(0x1ff)](_0x58f32f,{'definition':_0x553854,'stageName':_0x51e389,'criteriaName':_0x3f1c9e}),createPendingSegmentId(_0x58f32f);}const _0x2d0cf1=_0x36cdcf[_0x1010a0(0x254)]?.['id'];if(!_0x2d0cf1)throw new SDKError(ErrorCode[_0x1010a0(0x21f)],_0x1010a0(0x238));const _0x46e3ff=_0x575052[_0x1010a0(0x22f)](_0x58f32f);if(_0x46e3ff)return _0x46e3ff;const _0x382d79=((async()=>{const _0x1a0478=_0x1010a0;_0x552214(_0x58f32f,_0x553854[_0x1a0478(0x217)]);const _0x2c31b3=generateDeterministicJourneySegmentName(_0x36cdcf['yamlConfig'][_0x1a0478(0x25d)],_0x58f32f),_0x5d5c3a=_0x279613[_0x1a0478(0x222)]['find'](_0x3cab40=>_0x3cab40['name']===_0x2c31b3),_0x89891f=createSegmentIdResolver(_0x279613[_0x1a0478(0x252)],_0x58f32f),_0x208736=await resolveRuleSegmentIds(_0x553854['rule'],_0x89891f);let _0x1dbcc0;return _0x5d5c3a?(await _0x429f84['segment'][_0x1a0478(0x1ef)](_0x3bfa88['parentId'],_0x5d5c3a['id'],{'description':_0x553854[_0x1a0478(0x251)]||'Entry\x20criteria:\x20'+_0x58f32f,'rule':_0x41502d(_0x208736,!![]),'countPopulation':!![]}),_0x1dbcc0=_0x5d5c3a['id'],saveSegmentToPushRecovery(_0x36cdcf[_0x1a0478(0x28a)],_0x36cdcf[_0x1a0478(0x244)][_0x1a0478(0x25d)],_0x58f32f,{'segmentId':_0x1dbcc0,'uniqueServerName':_0x2c31b3,'createdAt':new Date()['toISOString']()})):_0x1dbcc0=await createOrRecoverEmbeddedSegment(_0x429f84,_0x36cdcf,{'localName':_0x58f32f,'uniqueSegmentName':_0x2c31b3,'description':_0x553854[_0x1a0478(0x251)]||'Entry\x20criteria:\x20'+_0x58f32f,'journeyId':_0x2d0cf1,'resolvedRule':_0x208736,'parentId':_0x3bfa88[_0x1a0478(0x26b)],'folderId':_0x3bfa88[_0x1a0478(0x2d4)]||''},_0x41502d),_0x279613['segmentNameToId']['set'](_0x58f32f,_0x1dbcc0),_0x3fe16d[_0x1a0478(0x1ff)](_0x58f32f,_0x1dbcc0),_0x1dbcc0;})());_0x575052[_0x1010a0(0x1ff)](_0x58f32f,_0x382d79);try{return await _0x382d79;}finally{_0x575052[_0x1010a0(0x27b)](_0x58f32f);}},'resolveActivationId':async _0x482632=>{const _0x3d0918=_0x4b0ebc,_0x4b9d98=_0x2a61ba[_0x3d0918(0x22f)](_0x482632);if(_0x4b9d98)return _0x4b9d98;if(_0x36cdcf[_0x3d0918(0x254)]){await _0x1332d6();const _0x1bc59b=_0x2a61ba[_0x3d0918(0x22f)](_0x482632);if(_0x1bc59b)return _0x1bc59b;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x482632+_0x3d0918(0x266)+_0x36cdcf[_0x3d0918(0x244)]['name']+').\x20'+_0x3d0918(0x1fd));},'resolveEmbeddedActivationId':async(_0x15be4a,_0x1e9d78)=>{const _0x3d38eb=_0x4b0ebc,_0x1af22b=_0x2a61ba[_0x3d38eb(0x22f)](_0x15be4a);if(_0x1af22b)return _0x1af22b;if(_0x36cdcf[_0x3d38eb(0x237)])return _0x45b158[_0x3d38eb(0x1ff)](_0x15be4a,_0x1e9d78),createPendingActivationId(_0x15be4a);if(_0x36cdcf['existingJourney']){await _0x1332d6();const _0x255fbb=_0x2a61ba[_0x3d38eb(0x22f)](_0x1e9d78[_0x3d38eb(0x25d)]);if(_0x255fbb)return _0x2a61ba['set'](_0x15be4a,_0x255fbb),_0x255fbb;const _0x3a3a72=activationSignature(_0x1e9d78),_0xaa4a33=_0x91b795?.[_0x3d38eb(0x22f)](_0x3a3a72);if(_0xaa4a33)return _0x2a61ba[_0x3d38eb(0x1ff)](_0x15be4a,_0xaa4a33),_0xaa4a33;const _0x4ce1d3=await _0x29d677(_0x1e9d78,_0x279613[_0x3d38eb(0x248)]),_0x1e0b7d={..._0x4ce1d3,..._0x1e9d78['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1e9d78[_0x3d38eb(0x2aa)]}},_0x3aa251=await _0x429f84[_0x3d38eb(0x226)][_0x3d38eb(0x1e8)](_0x36cdcf[_0x3d38eb(0x254)]['id'],_0x1e0b7d);return _0x2a61ba[_0x3d38eb(0x1ff)](_0x15be4a,_0x3aa251['id']),_0x3aa251['id'];}throw new SDKError(ErrorCode[_0x3d38eb(0x21f)],_0x3d38eb(0x27a));},'resolveJourneyId':async _0x398666=>{const _0xc3f9bc=_0x4b0ebc;try{return await _0x429f84[_0xc3f9bc(0x226)]['resolveJourneyId'](_0x3bfa88[_0xc3f9bc(0x26b)],_0x398666);}catch(_0x23e4a7){throw new SDKError(ErrorCode[_0xc3f9bc(0x273)],_0xc3f9bc(0x221)+_0x398666+_0xc3f9bc(0x227)+_0x36cdcf[_0xc3f9bc(0x244)][_0xc3f9bc(0x25d)]+'\x27)',_0x23e4a7);}},'resolveStageId':async(_0x2fe658,_0x304490)=>{const _0x4b4818=_0x4b0ebc,_0x37a026=await _0x429f84[_0x4b4818(0x226)][_0x4b4818(0x26e)](_0x2fe658),_0xab04aa=_0x37a026['attributes']['journeyStages'][_0x4b4818(0x274)](_0x5f28ea=>_0x5f28ea['name'][_0x4b4818(0x262)]()===_0x304490[_0x4b4818(0x262)]());if(!_0xab04aa?.['id'])throw new SDKError(ErrorCode[_0x4b4818(0x273)],_0x4b4818(0x1dc)+_0x304490+_0x4b4818(0x233)+(_0x37a026[_0x4b4818(0x211)][_0x4b4818(0x2a1)]||_0x37a026[_0x4b4818(0x211)][_0x4b4818(0x25d)])+'\x27');return _0xab04aa['id'];}},_0x29d4ac=await _0x32e268(_0x36cdcf[_0x4b0ebc(0x244)],_0x3bfa88[_0x4b0ebc(0x26b)],_0x403240),_0x2e80e2=_0x3bfa88[_0x4b0ebc(0x1e1)]||_0x3bfa88['rootFolderId'];_0x2e80e2&&(_0x29d4ac[_0x4b0ebc(0x25b)]={'parentFolder':{'data':{'id':_0x2e80e2,'type':_0x4b0ebc(0x294)}}});if(_0x36cdcf[_0x4b0ebc(0x237)]){if(_0x575268['size']>0x0||_0x45b158[_0x4b0ebc(0x205)]>0x0)return await executeThreeStepJourneyCreate(_0x429f84,_0x36cdcf,_0x29d4ac,{'pendingEmbeddedSegments':_0x575268,'pendingEmbeddedActivations':_0x45b158,'embeddedSegmentNameToId':_0x3fe16d,'journeyActivationNameToId':_0x2a61ba},{..._0x3bfa88,'effectiveFolderId':_0x2e80e2},_0x279613,_0x2dcbf4,_0x55a916);else{ensureJourneyDefaults(_0x29d4ac['attributes']);const _0xcb7fbb=await _0x429f84[_0x4b0ebc(0x226)]['create'](_0x29d4ac);return deletePushRecovery(_0x36cdcf[_0x4b0ebc(0x28a)]),{'action':'created','journeyId':_0xcb7fbb['id'],'embeddedSegmentNameToId':_0x3fe16d};}}else{if(_0x36cdcf[_0x4b0ebc(0x2cc)]&&_0x36cdcf['existingJourney']){_0x29d4ac['id']=_0x36cdcf[_0x4b0ebc(0x254)]['id'];const _0x2ddb71=_0x29d4ac[_0x4b0ebc(0x211)];_0x36cdcf['existingJourney'][_0x4b0ebc(0x211)]?.[_0x4b0ebc(0x2a1)]&&(_0x2ddb71['journeyBundleName']=_0x36cdcf['existingJourney']['attributes'][_0x4b0ebc(0x2a1)]);const _0x51d99b=_0x36cdcf[_0x4b0ebc(0x254)]['attributes']?.['journeyStages'];return _0x51d99b&&_0x29d4ac[_0x4b0ebc(0x211)][_0x4b0ebc(0x2cd)]&&injectExistingStageIds(_0x29d4ac['attributes']['journeyStages'],_0x51d99b),ensureJourneyDefaults(_0x2ddb71),await _0x429f84[_0x4b0ebc(0x226)][_0x4b0ebc(0x1f5)](_0x36cdcf[_0x4b0ebc(0x254)]['id'],_0x29d4ac),deletePushRecovery(_0x36cdcf[_0x4b0ebc(0x28a)]),{'action':_0x4b0ebc(0x2b7),'journeyId':_0x36cdcf[_0x4b0ebc(0x254)]['id'],'embeddedSegmentNameToId':_0x3fe16d};}}return deletePushRecovery(_0x36cdcf[_0x4b0ebc(0x28a)]),{'action':_0x4b0ebc(0x201),'journeyId':_0x36cdcf[_0x4b0ebc(0x254)]?.['id'],'embeddedSegmentNameToId':_0x3fe16d};}function findSegmentCriteriaLocation(_0x21d5aa,_0xd5efb){const _0x49b5a9=a140_0x1bbbd8,_0x18da29=_0x21d5aa[_0x49b5a9(0x24e)]||_0x21d5aa[_0x49b5a9(0x2b8)]?.[0x0]?.['stages']||[];let _0x23223f=_0x49b5a9(0x293),_0x4c3e48=_0xd5efb;const _0x5f3d5f=_0x21d5aa[_0x49b5a9(0x2a5)]||_0x21d5aa[_0x49b5a9(0x2b8)]?.[0x0]?.['goal'];if(_0x5f3d5f?.[_0x49b5a9(0x2b6)]===_0xd5efb)return{'stageName':'goal','criteriaName':_0x5f3d5f[_0x49b5a9(0x25d)]||_0xd5efb};_0x596a45:for(const _0x222e5f of _0x18da29){if(_0x222e5f[_0x49b5a9(0x276)]?.[_0x49b5a9(0x2b6)]===_0xd5efb){_0x23223f=_0x222e5f[_0x49b5a9(0x25d)],_0x4c3e48=_0x222e5f[_0x49b5a9(0x276)][_0x49b5a9(0x25d)]||_0xd5efb;break;}if(_0x222e5f['steps'])for(const _0x115ede of _0x222e5f['steps']){if(_0x115ede[_0x49b5a9(0x29a)]===_0x49b5a9(0x281)&&_0x115ede[_0x49b5a9(0x1ea)]?.[_0x49b5a9(0x1db)])for(const _0x2d42e4 of _0x115ede[_0x49b5a9(0x1ea)][_0x49b5a9(0x1db)]){if(_0x2d42e4['segment']===_0xd5efb){_0x23223f=_0x222e5f[_0x49b5a9(0x25d)],_0x4c3e48=_0x2d42e4[_0x49b5a9(0x25d)]||_0xd5efb;break _0x596a45;}}}}return{'stageName':_0x23223f,'criteriaName':_0x4c3e48};}async function executeThreeStepJourneyCreate(_0x4249ea,_0x5a8dbb,_0x37af12,_0x595d59,_0x57ef3d,_0x571351,_0x3c305d,_0x13fdea){const _0x3c424e=a140_0x1bbbd8,{activationDefToCreateRequest:_0x525ebc,yamlRuleToApi:_0x27a7e5}=_0x13fdea,{pendingEmbeddedSegments:_0x53421d,pendingEmbeddedActivations:_0x2b8177,embeddedSegmentNameToId:_0x326307}=_0x595d59,_0x47080e=JSON['parse'](JSON[_0x3c424e(0x202)](_0x37af12));ensureJourneyDefaults(_0x47080e['attributes']),stripPendingIds(_0x47080e);const _0x5e46bb=await _0x4249ea[_0x3c424e(0x226)][_0x3c424e(0x218)](_0x47080e),_0x1dc6f5=_0x5e46bb['id'],_0x8a3a20=new Map();for(const _0x4a5e35 of _0x5e46bb['attributes'][_0x3c424e(0x2cd)]){_0x8a3a20['set'](_0x4a5e35[_0x3c424e(0x25d)][_0x3c424e(0x262)](),_0x4a5e35['id']);}recoverSegmentIdsFromPushRecovery(_0x5a8dbb,_0x326307,_0x571351[_0x3c424e(0x252)]);for(const [_0x35301a,{definition:_0x46a797}]of _0x53421d){if(_0x326307['has'](_0x35301a)){_0x3c305d[_0x3c424e(0x2b9)]?.({'type':_0x3c424e(0x208),'journeyName':_0x5a8dbb['yamlConfig']['name'],'segmentName':_0x35301a});continue;}const _0x1ee71c=generateDeterministicJourneySegmentName(_0x5a8dbb['yamlConfig'][_0x3c424e(0x25d)],_0x35301a);_0x3c305d['onProgress']?.({'type':_0x3c424e(0x2b4),'journeyName':_0x5a8dbb[_0x3c424e(0x244)]['name'],'segmentName':_0x35301a});const _0x3d6125=createSegmentIdResolver(_0x571351['segmentNameToId'],_0x35301a),_0x4db46e=await resolveRuleSegmentIds(_0x46a797['rule'],_0x3d6125),_0x203c21=await createOrRecoverEmbeddedSegment(_0x4249ea,_0x5a8dbb,{'localName':_0x35301a,'uniqueSegmentName':_0x1ee71c,'description':_0x46a797[_0x3c424e(0x251)]||'Entry\x20criteria:\x20'+_0x35301a,'journeyId':_0x1dc6f5,'resolvedRule':_0x4db46e,'parentId':_0x57ef3d['parentId'],'folderId':_0x57ef3d['effectiveFolderId']||''},_0x27a7e5);_0x326307[_0x3c424e(0x1ff)](_0x35301a,_0x203c21),_0x571351[_0x3c424e(0x252)][_0x3c424e(0x1ff)](_0x35301a,_0x203c21),_0x3c305d[_0x3c424e(0x2b9)]?.({'type':'embedded_segment_created','journeyName':_0x5a8dbb[_0x3c424e(0x244)][_0x3c424e(0x25d)],'segmentName':_0x35301a});}const _0x53964a=new Map();for(const [_0x191956,_0x26312f]of _0x2b8177){_0x3c305d['onProgress']?.({'type':_0x3c424e(0x25e),'journeyName':_0x5a8dbb[_0x3c424e(0x244)][_0x3c424e(0x25d)],'activationName':_0x191956});const _0x542863=await _0x525ebc(_0x26312f,_0x571351['activationContext']),_0x3ff372={..._0x542863,..._0x26312f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x26312f[_0x3c424e(0x2aa)]}},_0x476e94=await _0x4249ea[_0x3c424e(0x226)][_0x3c424e(0x1e8)](_0x1dc6f5,_0x3ff372);_0x53964a[_0x3c424e(0x1ff)](_0x191956,_0x476e94['id']),_0x595d59[_0x3c424e(0x20c)][_0x3c424e(0x1ff)](_0x191956,_0x476e94['id']),_0x3c305d['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x5a8dbb[_0x3c424e(0x244)][_0x3c424e(0x25d)],'activationName':_0x191956});}const _0x1fd057=JSON[_0x3c424e(0x20f)](JSON[_0x3c424e(0x202)](_0x37af12));return _0x1fd057['id']=_0x1dc6f5,ensureJourneyDefaults(_0x1fd057[_0x3c424e(0x211)]),resolvePendingIdsInRequest(_0x1fd057,_0x37af12,_0x8a3a20,_0x326307,_0x53964a,_0x3c305d),await _0x4249ea['journey'][_0x3c424e(0x1f5)](_0x1dc6f5,_0x1fd057),deletePushRecovery(_0x5a8dbb[_0x3c424e(0x28a)]),{'action':_0x3c424e(0x27c),'journeyId':_0x1dc6f5,'embeddedSegmentNameToId':_0x326307};}export function stripWaitStepPendingIds(_0x22d9f8){const _0x2dbe8e=a140_0x1bbbd8,_0xf1e333=_0x22d9f8[_0x2dbe8e(0x225)]&&isPendingSegmentId(_0x22d9f8[_0x2dbe8e(0x225)]),_0x48089d=_0x22d9f8[_0x2dbe8e(0x206)]?.[_0x2dbe8e(0x2d5)](_0x5c6b35=>_0x5c6b35[_0x2dbe8e(0x1f2)]&&isPendingSegmentId(_0x5c6b35[_0x2dbe8e(0x1f2)]));(_0xf1e333||_0x48089d)&&(_0x22d9f8[_0x2dbe8e(0x289)]=_0x2dbe8e(0x279),_0x22d9f8['waitStep']=0x1,_0x22d9f8['waitStepUnit']=_0x2dbe8e(0x2ba),delete _0x22d9f8['conditionSegmentId'],delete _0x22d9f8[_0x2dbe8e(0x23a)],delete _0x22d9f8['conditionTimeoutUnit'],delete _0x22d9f8['conditions']);}export function resolveWaitStepPendingIds(_0x55cfa8,_0x53a927,_0x407030,_0x41dc13){const _0x5b725b=a140_0x1bbbd8;if(_0x53a927[_0x5b725b(0x225)]&&isPendingSegmentId(_0x53a927['conditionSegmentId'])){const _0x43ccf5=_0x407030(_0x53a927[_0x5b725b(0x225)],_0x5b725b(0x255)+_0x41dc13+'\x27\x20wait\x20condition');_0x43ccf5&&(_0x55cfa8[_0x5b725b(0x289)]='Condition',_0x55cfa8[_0x5b725b(0x225)]=_0x43ccf5,delete _0x55cfa8[_0x5b725b(0x1e7)],delete _0x55cfa8[_0x5b725b(0x2b2)],_0x53a927[_0x5b725b(0x23a)]!==undefined&&(_0x55cfa8['conditionTimeoutDuration']=_0x53a927[_0x5b725b(0x23a)]),_0x53a927[_0x5b725b(0x258)]&&(_0x55cfa8['conditionTimeoutUnit']=_0x53a927[_0x5b725b(0x258)]));}if(_0x53a927[_0x5b725b(0x206)]){const _0x2caede=_0x53a927['conditions'][_0x5b725b(0x2d5)](_0x4f77ee=>_0x4f77ee[_0x5b725b(0x1f2)]&&isPendingSegmentId(_0x4f77ee[_0x5b725b(0x1f2)]));if(_0x2caede){const _0x1af247=_0x53a927[_0x5b725b(0x206)]['map'](_0x27fa9f=>{const _0x43eba4=_0x5b725b;if(_0x27fa9f[_0x43eba4(0x1f2)]&&isPendingSegmentId(_0x27fa9f[_0x43eba4(0x1f2)])){const _0x383dec=_0x407030(_0x27fa9f[_0x43eba4(0x1f2)],_0x43eba4(0x255)+_0x41dc13+_0x43eba4(0x2c0));return{..._0x27fa9f,'segmentId':_0x383dec||_0x27fa9f['segmentId']};}return{..._0x27fa9f};});_0x55cfa8[_0x5b725b(0x289)]=_0x5b725b(0x2ae),_0x55cfa8[_0x5b725b(0x206)]=_0x1af247,delete _0x55cfa8['waitStep'],delete _0x55cfa8[_0x5b725b(0x2b2)],delete _0x55cfa8['conditionSegmentId'],delete _0x55cfa8[_0x5b725b(0x23a)],delete _0x55cfa8['conditionTimeoutUnit'];}}}function stripPendingIds(_0x320ab3){const _0xc44e31=a140_0x1bbbd8;_0x320ab3[_0xc44e31(0x211)][_0xc44e31(0x2a5)]?.[_0xc44e31(0x1f2)]&&isPendingSegmentId(_0x320ab3[_0xc44e31(0x211)][_0xc44e31(0x2a5)]['segmentId'])&&delete _0x320ab3['attributes']['goal'];for(const _0x980eff of _0x320ab3['attributes']['journeyStages']||[]){_0x980eff[_0xc44e31(0x275)]?.[_0xc44e31(0x1f2)]&&isPendingSegmentId(_0x980eff[_0xc44e31(0x275)][_0xc44e31(0x1f2)])&&delete _0x980eff[_0xc44e31(0x275)];_0x980eff['milestone']?.[_0xc44e31(0x1f2)]&&isPendingSegmentId(_0x980eff[_0xc44e31(0x2c8)][_0xc44e31(0x1f2)])&&delete _0x980eff[_0xc44e31(0x2c8)];_0x980eff['exitCriterias']&&(_0x980eff[_0xc44e31(0x235)]=_0x980eff[_0xc44e31(0x235)]['filter'](_0x2b4baf=>!_0x2b4baf['segmentId']||!isPendingSegmentId(_0x2b4baf[_0xc44e31(0x1f2)])));if(_0x980eff[_0xc44e31(0x272)])for(const _0x565ed6 of Object['keys'](_0x980eff[_0xc44e31(0x272)])){const _0x376440=_0x980eff[_0xc44e31(0x272)][_0x565ed6];_0x376440[_0xc44e31(0x29a)]===_0xc44e31(0x219)&&_0x376440[_0xc44e31(0x2bf)]&&isPendingActivationId(_0x376440['journeyActivationStepId'])&&(_0x376440[_0xc44e31(0x2bf)]='');if(_0x376440[_0xc44e31(0x29a)]===_0xc44e31(0x292)&&_0x376440[_0xc44e31(0x1db)])for(const _0x175345 of _0x376440[_0xc44e31(0x1db)]){_0x175345['segmentId']&&isPendingSegmentId(_0x175345[_0xc44e31(0x1f2)])&&(_0x175345[_0xc44e31(0x1f2)]='');}_0x376440['type']==='WaitStep'&&stripWaitStepPendingIds(_0x376440);}}}function resolvePendingIdsInRequest(_0x1e786a,_0x43f6d9,_0x57997b,_0x526f9f,_0x3a8887,_0x48e421){const _0x273087=a140_0x1bbbd8,_0x43603d=(_0x3ad2ef,_0x2a10d7)=>{const _0x2ee5f6=a140_0xf1db;if(!isPendingSegmentId(_0x3ad2ef))return _0x3ad2ef;const _0x4469d0=extractPendingSegmentName(_0x3ad2ef),_0x250343=_0x526f9f[_0x2ee5f6(0x22f)](_0x4469d0);return!_0x250343&&_0x48e421['logWarning']?.(_0x2ee5f6(0x236)+_0x4469d0+_0x2ee5f6(0x1fb)+_0x2a10d7),_0x250343;};if(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)]?.[_0x273087(0x1f2)]&&isPendingSegmentId(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)][_0x273087(0x1f2)])){const _0x5cf8f1=_0x43603d(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)][_0x273087(0x1f2)],_0x273087(0x2c2));_0x5cf8f1&&(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)][_0x273087(0x1f2)]=_0x5cf8f1);}for(const _0x2288bb of _0x1e786a['attributes'][_0x273087(0x2cd)]||[]){const _0x56756b=_0x57997b['get'](_0x2288bb[_0x273087(0x25d)][_0x273087(0x262)]());_0x56756b&&(_0x2288bb['id']=_0x56756b);if(_0x2288bb[_0x273087(0x275)]?.['segmentId']&&isPendingSegmentId(_0x2288bb[_0x273087(0x275)][_0x273087(0x1f2)])){const _0x334862=_0x43603d(_0x2288bb[_0x273087(0x275)][_0x273087(0x1f2)],_0x273087(0x255)+_0x2288bb['name']+_0x273087(0x1f0));_0x334862&&(_0x2288bb[_0x273087(0x275)][_0x273087(0x1f2)]=_0x334862);}if(_0x2288bb[_0x273087(0x235)])for(const _0x399b29 of _0x2288bb[_0x273087(0x235)]){if(_0x399b29['segmentId']&&isPendingSegmentId(_0x399b29[_0x273087(0x1f2)])){const _0x4b5b82=_0x43603d(_0x399b29[_0x273087(0x1f2)],_0x273087(0x255)+_0x2288bb[_0x273087(0x25d)]+'\x27\x20exit\x20criteria');_0x4b5b82&&(_0x399b29[_0x273087(0x1f2)]=_0x4b5b82);}}if(_0x2288bb[_0x273087(0x2c8)]?.[_0x273087(0x1f2)]&&isPendingSegmentId(_0x2288bb['milestone']['segmentId'])){const _0x53e47e=_0x43603d(_0x2288bb[_0x273087(0x2c8)][_0x273087(0x1f2)],'stage\x20\x27'+_0x2288bb[_0x273087(0x25d)]+_0x273087(0x1ec));_0x53e47e&&(_0x2288bb[_0x273087(0x2c8)][_0x273087(0x1f2)]=_0x53e47e);}if(_0x2288bb[_0x273087(0x272)]){const _0x3558ff=_0x27be1c=>_0x43f6d9[_0x273087(0x211)]['journeyStages']?.[_0x273087(0x274)](_0x171e2f=>_0x171e2f['name'][_0x273087(0x262)]()===_0x2288bb[_0x273087(0x25d)]['toLowerCase']())?.[_0x273087(0x272)]?.[_0x27be1c];for(const _0x3cf9cd of Object['keys'](_0x2288bb[_0x273087(0x272)])){const _0x2a5304=_0x2288bb[_0x273087(0x272)][_0x3cf9cd],_0x5b354a=_0x3558ff(_0x3cf9cd);if(_0x2a5304[_0x273087(0x29a)]===_0x273087(0x219)&&_0x2a5304[_0x273087(0x2bf)]&&(isPendingActivationId(_0x2a5304[_0x273087(0x2bf)])||_0x2a5304[_0x273087(0x2bf)]==='')){if(_0x5b354a?.[_0x273087(0x2bf)]&&isPendingActivationId(_0x5b354a[_0x273087(0x2bf)])){const _0x4b2e42=extractPendingActivationName(_0x5b354a['journeyActivationStepId']),_0x2afd1f=_0x3a8887[_0x273087(0x22f)](_0x4b2e42);_0x2afd1f&&(_0x2a5304[_0x273087(0x2bf)]=_0x2afd1f);}}if(_0x2a5304[_0x273087(0x29a)]===_0x273087(0x292)&&_0x2a5304[_0x273087(0x1db)]&&_0x5b354a?.[_0x273087(0x1db)])for(let _0x376c75=0x0;_0x376c75<_0x2a5304[_0x273087(0x1db)]['length'];_0x376c75++){const _0x5bc990=_0x2a5304[_0x273087(0x1db)][_0x376c75],_0x2a58f0=_0x5b354a[_0x273087(0x1db)][_0x376c75];if(_0x2a58f0?.[_0x273087(0x1f2)]&&isPendingSegmentId(_0x2a58f0[_0x273087(0x1f2)])){const _0x3164fc=_0x43603d(_0x2a58f0[_0x273087(0x1f2)],_0x273087(0x255)+_0x2288bb['name']+_0x273087(0x290)+(_0x5bc990['name']||_0x376c75)+'\x27');_0x3164fc&&(_0x5bc990[_0x273087(0x1f2)]=_0x3164fc);}}_0x2a5304[_0x273087(0x29a)]===_0x273087(0x249)&&_0x5b354a?.[_0x273087(0x29a)]===_0x273087(0x249)&&resolveWaitStepPendingIds(_0x2a5304,_0x5b354a,_0x43603d,_0x2288bb[_0x273087(0x25d)]);}}}}
|
|
1
|
+
const a142_0x5a51=a142_0x42c6;(function(_0x4f7c7d,_0x492334){const _0xda4d1d=a142_0x42c6,_0x541bb6=_0x4f7c7d();while(!![]){try{const _0x522e54=parseInt(_0xda4d1d(0x181))/0x1*(parseInt(_0xda4d1d(0xff))/0x2)+-parseInt(_0xda4d1d(0x14f))/0x3*(parseInt(_0xda4d1d(0x14c))/0x4)+parseInt(_0xda4d1d(0x92))/0x5*(parseInt(_0xda4d1d(0x132))/0x6)+-parseInt(_0xda4d1d(0x13e))/0x7+-parseInt(_0xda4d1d(0xb9))/0x8+-parseInt(_0xda4d1d(0x9e))/0x9*(parseInt(_0xda4d1d(0xbd))/0xa)+-parseInt(_0xda4d1d(0x10d))/0xb*(-parseInt(_0xda4d1d(0xa0))/0xc);if(_0x522e54===_0x492334)break;else _0x541bb6['push'](_0x541bb6['shift']());}catch(_0x2faf8b){_0x541bb6['push'](_0x541bb6['shift']());}}}(a142_0x2daf,0x63b1e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a142_0x5a51(0x119);export const PENDING_ACTIVATION_PREFIX=a142_0x5a51(0x109);export function createPendingSegmentId(_0x571aae){return''+PENDING_SEGMENT_PREFIX+_0x571aae+'__';}export function isPendingSegmentId(_0xe3897f){const _0x2dde29=a142_0x5a51;return _0xe3897f[_0x2dde29(0x129)](PENDING_SEGMENT_PREFIX)&&!_0xe3897f['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x5e6e5a){const _0x10e9f1=a142_0x5a51;return _0x5e6e5a[_0x10e9f1(0xb8)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5cf379){return''+PENDING_ACTIVATION_PREFIX+_0x5cf379+'__';}export function isPendingActivationId(_0x407f34){const _0x2fb25c=a142_0x5a51;return _0x407f34[_0x2fb25c(0x129)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2ac047){const _0x18bef9=a142_0x5a51;return _0x2ac047[_0x18bef9(0xb8)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5eb90a,_0x5c7cb3){const _0x1c635e=a142_0x5a51,_0x1e53fc=_0x5eb90a+'::'+(_0x5c7cb3[_0x1c635e(0xc7)]()||_0x1c635e(0xf2)),_0x47ddcf=createHash(_0x1c635e(0x147))[_0x1c635e(0x17b)](_0x1e53fc)[_0x1c635e(0x12c)](_0x1c635e(0xca))['slice'](0x0,0xc);return _0x1c635e(0x174)+_0x47ddcf;}export function ensureJourneyDefaults(_0xacaa0d){const _0x1d8834=a142_0x5a51;!_0xacaa0d[_0x1d8834(0x167)]&&(_0xacaa0d['description']=''),!_0xacaa0d[_0x1d8834(0xb3)]&&(_0xacaa0d[_0x1d8834(0xb3)]=_0x1d8834(0x162));}export function injectExistingStageIds(_0x2a7484,_0x3873ca){const _0x34f5a9=a142_0x5a51,_0x14a6d2=new Map(_0x3873ca[_0x34f5a9(0xc1)](_0xf2cce8=>[_0xf2cce8[_0x34f5a9(0x8c)],_0xf2cce8['id']]));for(const _0x1f613e of _0x2a7484){if(!_0x1f613e['id']){const _0x217cc6=_0x14a6d2[_0x34f5a9(0x185)](_0x1f613e[_0x34f5a9(0x8c)]);_0x217cc6&&(_0x1f613e['id']=_0x217cc6);}}}export function resolveTDFolderPath(_0x106fba,_0x5cd35a,_0x253cdb){const _0x29695f=a142_0x5a51;if(!_0x5cd35a)return _0x106fba;if(_0x106fba===_0x253cdb||_0x106fba[_0x29695f(0x129)](_0x253cdb+'/'))return _0x106fba;return _0x106fba?_0x253cdb+'/'+_0x106fba:_0x253cdb;}export function addFoldersToCreate(_0x446c09,_0x51664b,_0x956fa2){const _0x415031=a142_0x5a51;if(!_0x446c09)return;if(_0x51664b[_0x415031(0xd3)](_0x446c09))return;const _0x65c4ee=_0x446c09[_0x415031(0x8d)]('/');let _0xc241ac='';for(const _0x24e110 of _0x65c4ee){_0xc241ac=_0xc241ac?_0xc241ac+'/'+_0x24e110:_0x24e110,!_0x51664b[_0x415031(0xd3)](_0xc241ac)&&_0x956fa2['add'](_0xc241ac);}}export function sortFoldersByDepth(_0x10ed1c){return[..._0x10ed1c]['sort']((_0x6cbd6e,_0x28a7eb)=>{const _0x445b88=a142_0x42c6,_0x2697ef=(_0x6cbd6e[_0x445b88(0x16d)](/\//g)||[])['length'],_0x58c146=(_0x28a7eb[_0x445b88(0x16d)](/\//g)||[])['length'];return _0x2697ef-_0x58c146;});}import*as a142_0x5a9249 from'yaml';import{readFileSync}from'fs';import a142_0x5c3462 from'path';import{isJourneyDef,parseYamlString as a142_0x2514e4,toYamlString as a142_0x2aac63,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(_0x4dd403){const _0x1a36b7=a142_0x5a51;if(Array[_0x1a36b7(0x15e)](_0x4dd403))return'['+_0x4dd403[_0x1a36b7(0xc1)](_0x431089=>stableStringify(_0x431089))['join'](',')+']';if(_0x4dd403&&typeof _0x4dd403===_0x1a36b7(0xd0)){const _0x35dba4=_0x4dd403,_0x3ee925=Object[_0x1a36b7(0x10b)](_0x35dba4)[_0x1a36b7(0xfd)](),_0x8280f5=_0x3ee925[_0x1a36b7(0xc1)](_0x3d65b4=>'\x22'+_0x3d65b4+'\x22:'+stableStringify(_0x35dba4[_0x3d65b4]));return'{'+_0x8280f5['join'](',')+'}';}const _0x1032a3=JSON[_0x1a36b7(0x183)](_0x4dd403);return _0x1032a3===undefined?_0x1a36b7(0x111):_0x1032a3;}function a142_0x2daf(){const _0x22b846=['entryCriteria','size','waitStepUnit','logDeleted','delete','Creating\x20segment\x20\x27','folderPath','conditions','__pending_act_','DecisionPoint','keys','updateSegmentById','8708271EXvhWK','\x20error(s)','and\x20the\x20server\x20segment,\x20then\x20retry.','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','null','rootFolderId','Embedded\x20segment\x20\x27','./journey-yaml.js','withProgress','folderPathToId','\x27\x20decision\x20point\x20branch\x20\x27','activation_deleting','__pending_','journeyActivationStepId','activationActions','getLatestJourneyId','logSuccess','localName','logInfo','absolutePath','results','Deleted\x20segment\x20\x27','waitStepType','yamlConfig','stages','all','Entry\x20criteria:\x20','versionNumber','startsWith','./child-segment-yaml.js','includes','digest','list','Created\x20folder\x20\x27','journeyName','user','parentFolder','2231004yWDoOU','Created\x20activation\x20\x27','connection','connectionIdToNameMap','createActivation','toISOString','conditionSegmentId','existingJourney','parentSegmentFolder','Condition','utf-8','entry_criteria','4219999DhvmHz','Created\x20segment\x20\x27','Fetching\x20','schedule','activation_','create','goal\x20criteria','\x20journey\x20from\x20file:\x20','ACTIVATION_UPDATE_ERROR','sha1','WaitStep','data','journeys','journey_creating','2414176vZNzud','SEGMENT_UPDATE_ERROR','fetchJourney','3CWzNbb','Created\x20journey\x20\x27','segmentNameToId','\x27\x20from\x20file:\x20','verbose','add','filter','set','getJourney','connector_config','Journey\x20\x27','entries','stage\x20\x27','Updated\x20activation\x20\x27','parseDocument','isArray','journeyStages',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','getSegment\x20failed\x20for\x20','draft','relationships','journey','getSegment','journeyBundlesByFolderAndName','description','exitCriterias','segmentByFolderAndName','embedded_segment_creating','\x20segment\x20from\x20file:\x20','find','match','toLowerCase','segment_creating','activationParams','conditionTimeoutUnit','\x20(referenced\x20in\x20journey\x20','push','journey_entry_criteria_','with','rule','waitStep','Activation','yamlActivation','idToEmailMap','update','uniqueServerName','activations','diff','existingSegments','Updating\x20activation\x20\x27','86iLMDwO','Updating\x20segment\x20\x27','stringify','decision_point','get','debug','branches','listActivations','relative','createdSegmentId','activation_template_id','folder_creating','../../utils/async.js','activationContext','uniqueSegmentName','effectiveFolderId','isNew','JOURNEY_UPDATE_ERROR','all_columns','name','split','NOT_FOUND','segmentFolderId',').\x20','activation_updating','5HXzHcV','kind','validatedRequest','segmentId','folder','from','Segment\x20not\x20found','embedded_activation_created','Delete\x20the\x20push\x20recovery\x20file\x20(','INTERNAL','goal','columns','382131UEGkeJ','idToName','24xZpFZK','message','type','existingSegment','max','deleteSegment','run_after_journey_refresh','embedded_segment_created','created','Creating\x20activation\x20\x27','journeyId','\x27\x20by\x20rule\x20content','journey_created','onProgress','action','embeddedSegmentNameToId','entry','createSegment','nameToType','state','\x27\x20exit\x20criteria','existingActivation','resolvedRule','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','replace','51008cyzuMV','steps','\x27...','logWarning','170eMwCam','reduce','SEGMENT_SYNTAX_ERROR','\x27\x20to\x20local\x20\x27','map','some','parse','\x0a\x20\x20','createJourneySegment','attributes','trim','Creating\x20folder\x20\x27','\x27\x20entry\x20criteria','hex','folderId','toString','join','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','notification','object','journeyBundleName','\x27\x20for\x20','has','segments','Deleting\x20activation\x20\x27','deleteActivation','updateActivation','createdSegmentIds','\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','behavior','folder_created','resolveSegment','updated','errors','Matched\x20server\x20segment\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','segment_deleting','hasChanges','activation_updated','createFolder','SEGMENT_NOT_FOUND','\x27\x20wait\x20condition','unchanged','Deleted\x20activation\x20\x27','journeyById','milestone','length','Failed\x20to\x20','parentId','deleted','conditionTimeoutDuration','progress','segment','index','activationsBySegmentId','Segment\x20not\x20found:\x20','slice','day','activationStepsById','segment_updated','Activation\x20not\x20found:\x20','journeyBundleId','resolveJourneyId','sort','deps','9018ftAwMo','Name\x20has\x20already\x20been\x20taken'];a142_0x2daf=function(){return _0x22b846;};return a142_0x2daf();}function activationSignature(_0x9d2209){const _0x3bdefc=a142_0x5a51,_0xde05c9={'connection':_0x9d2209[_0x3bdefc(0x134)],..._0x9d2209[_0x3bdefc(0x8b)]!==undefined&&{'all_columns':_0x9d2209[_0x3bdefc(0x8b)]},..._0x9d2209[_0x3bdefc(0x9d)]!==undefined&&{'columns':_0x9d2209[_0x3bdefc(0x9d)]},..._0x9d2209[_0x3bdefc(0xdb)]!==undefined&&{'behavior':_0x9d2209[_0x3bdefc(0xdb)]},..._0x9d2209[_0x3bdefc(0x141)]!==undefined&&{'schedule':_0x9d2209[_0x3bdefc(0x141)]},..._0x9d2209[_0x3bdefc(0xcf)]!==undefined&&{'notification':_0x9d2209['notification']},..._0x9d2209[_0x3bdefc(0x158)]!==undefined&&{'connector_config':_0x9d2209['connector_config']},..._0x9d2209['activation_template_id']!==undefined&&{'activation_template_id':_0x9d2209[_0x3bdefc(0x83)]}};return stableStringify(_0xde05c9);}async function fetchSegment(_0x1a7eeb,_0x3098e9,_0x2a4565,_0x116a4b){const _0xb4bc97=a142_0x5a51,_0x84db7b=_0x116a4b?.[_0xb4bc97(0x16c)](_0x36c889=>_0x36c889['id']===_0x2a4565);if(_0x84db7b)return _0x84db7b;try{return await _0x1a7eeb['segment'][_0xb4bc97(0x165)](_0x3098e9,_0x2a4565);}catch(_0x5bc1cd){logger[_0xb4bc97(0x186)](_0xb4bc97(0x161)+_0x2a4565+_0xb4bc97(0x160)+_0x5bc1cd);try{return await _0x1a7eeb['segment']['getSegmentEntity'](_0x2a4565);}catch(_0x59b8c8){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2a4565+':\x20'+_0x59b8c8),null;}}}function recoverSegmentIdsFromPushRecovery(_0x6cf4cb,_0x175c77,_0x538fed){const _0x42d519=a142_0x5a51,_0x136ec0=readPushRecovery(_0x6cf4cb[_0x42d519(0x120)]);if(_0x136ec0?.[_0x42d519(0x12f)]===_0x6cf4cb['yamlConfig']['name'])for(const [_0x485e3c,_0x236717]of Object[_0x42d519(0x15a)](_0x136ec0[_0x42d519(0xd4)])){const _0xaf0685=generateDeterministicJourneySegmentName(_0x6cf4cb['yamlConfig'][_0x42d519(0x8c)],_0x485e3c);_0x236717[_0x42d519(0x17c)]===_0xaf0685&&(_0x175c77[_0x42d519(0x156)](_0x485e3c,_0x236717[_0x42d519(0x95)]),_0x538fed[_0x42d519(0x156)](_0x485e3c,_0x236717[_0x42d519(0x95)]));}}async function createOrRecoverEmbeddedSegment(_0x419d,_0x1accc7,_0x490373,_0x526675){const _0x3127f1=a142_0x5a51;let _0x12cb44;try{_0x12cb44=await _0x419d['segment'][_0x3127f1(0xc5)]({'name':_0x490373[_0x3127f1(0x87)],'description':_0x490373[_0x3127f1(0x167)],'journeyId':_0x490373[_0x3127f1(0xaa)],'rule':_0x526675(_0x490373[_0x3127f1(0xb6)],!![]),'countPopulation':!![],'parentFolderId':_0x490373['folderId'],'audienceId':_0x490373['parentId']});}catch(_0x27d38b){const _0x159602=_0x27d38b instanceof Error&&_0x27d38b[_0x3127f1(0xa1)][_0x3127f1(0x12b)](_0x3127f1(0x100));if(_0x159602){const _0x2ed4d7=readPushRecovery(_0x1accc7[_0x3127f1(0x120)]),_0x400b64=_0x2ed4d7?.['journeyName']===_0x1accc7[_0x3127f1(0x124)]['name']?_0x2ed4d7[_0x3127f1(0xd4)][_0x490373[_0x3127f1(0x11e)]]:undefined;if(_0x400b64?.[_0x3127f1(0x17c)]===_0x490373[_0x3127f1(0x87)])await _0x419d[_0x3127f1(0xf2)]['updateSegmentById'](_0x490373[_0x3127f1(0xee)],_0x400b64['segmentId'],{'description':_0x490373[_0x3127f1(0x167)],'rule':_0x526675(_0x490373[_0x3127f1(0xb6)],!![]),'countPopulation':!![]}),_0x12cb44=_0x400b64['segmentId'];else throw new SDKError(ErrorCode[_0x3127f1(0x14d)],_0x3127f1(0x113)+_0x490373[_0x3127f1(0x11e)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x3127f1(0x9a)+_0x1accc7[_0x3127f1(0x120)][_0x3127f1(0xb8)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x3127f1(0x10f),_0x27d38b);}else throw _0x27d38b;}return saveSegmentToPushRecovery(_0x1accc7[_0x3127f1(0x120)],_0x1accc7[_0x3127f1(0x124)][_0x3127f1(0x8c)],_0x490373['localName'],{'segmentId':_0x12cb44,'uniqueServerName':_0x490373[_0x3127f1(0x87)],'createdAt':new Date()[_0x3127f1(0x137)]()}),_0x12cb44;}export async function prepareSegmentFiles(_0x248ccb,_0x3210ec,_0x8f86db,_0x5aa599,_0xbceed9){const _0x98d691=a142_0x5a51,{activationDefToCreateRequest:_0x2dd52a}=await import('./child-segment-yaml.js'),_0x141c02=[],_0xa367d2=new Set();for(const {yamlConfig:_0x3b76be,folderPath:_0x21c546,sourcePath:_0xbd6f2c}of _0x248ccb){const _0x32c3ba=resolveTDFolderPath(_0x21c546,_0x5aa599,_0xbceed9),_0x58c44e=_0x32c3ba+':'+_0x3b76be['name'],_0x5519db=_0x3210ec[_0x98d691(0x169)]['get'](_0x58c44e),_0x32cbc3=_0x5519db?_0x3210ec[_0x98d691(0xf4)][_0x98d691(0x185)](_0x5519db['id'])||[]:[];addFoldersToCreate(_0x32c3ba,_0x3210ec[_0x98d691(0x116)],_0xa367d2);const _0x582e2b=calculateActivationActions(_0x3b76be['activations']||[],_0x32cbc3,_0x3210ec['idToEmailMap'],_0x3210ec[_0x98d691(0x135)]);for(const _0x49da54 of _0x582e2b){(_0x49da54[_0x98d691(0xa2)]==='create'||_0x49da54[_0x98d691(0xa2)]===_0x98d691(0x17b))&&_0x49da54[_0x98d691(0x179)]&&(_0x49da54[_0x98d691(0x94)]=await _0x2dd52a(_0x49da54[_0x98d691(0x179)],_0x8f86db));}const _0x538900=calculateSegmentDiff(_0x3b76be,_0x5519db,_0x32cbc3,_0x3210ec[_0x98d691(0x17a)],_0x3210ec[_0x98d691(0x135)]);_0x141c02[_0x98d691(0x173)]({'relativePath':_0x3b76be['name'],'absolutePath':_0xbd6f2c,'yamlConfig':_0x3b76be,'folderPath':_0x32c3ba,'existingSegment':_0x5519db,'existingActivations':_0x32cbc3,'isNew':_0x538900['isNew'],'hasChanges':_0x538900[_0x98d691(0xe3)],'diff':_0x538900[_0x98d691(0x17e)],'activationActions':_0x582e2b});}return{'segmentFiles':_0x141c02,'foldersToCreate':_0xa367d2};}export async function prepareJourneyFiles(_0xdcc3ad,_0x24774c,_0x1d0534,_0x36fd06){const _0x49665d=a142_0x5a51,_0x247da6=[],_0x6a6ae0=new Set();for(const {yamlConfig:_0x7ecf54,folderPath:_0xff617a,sourcePath:_0x3f3864}of _0xdcc3ad){const _0x1ebe11=resolveTDFolderPath(_0xff617a,_0x1d0534,_0x36fd06),_0x1fe15c=_0x1ebe11+':'+_0x7ecf54[_0x49665d(0x8c)],_0x132e30=_0x24774c[_0x49665d(0x166)][_0x49665d(0x185)](_0x1fe15c);let _0x1b8802,_0x5ada81;if(_0x132e30&&_0x132e30['length']>0x0){const _0x4c4a9b=buildLocalExpandedRuleMappings(_0x7ecf54),{createYamlContext:_0xd33cfa,prefetchJourneySegments:_0x299850}=createPushYamlContextForBundle(_0x24774c[_0x49665d(0xfe)],_0x24774c[_0x49665d(0xee)],_0x24774c[_0x49665d(0x17f)],_0x4c4a9b,_0x24774c[_0x49665d(0x17a)],_0x24774c[_0x49665d(0x135)],_0x24774c[_0x49665d(0xf8)],_0x24774c[_0x49665d(0xea)]);await _0x299850(_0x132e30[_0x49665d(0xc1)](_0x2422d6=>_0x2422d6['id']));const _0x4fa8d8=await _0x24774c['deps'][_0x49665d(0x164)][_0x49665d(0x11c)](_0x132e30[0x0][_0x49665d(0xfb)]),_0x904231=hasMultipleVersions(_0x7ecf54),_0x10166d=async _0x5b1c6b=>{const _0x5bdad8=_0x49665d,_0x238b39=_0x24774c['journeyById']?.[_0x5bdad8(0x185)](_0x5b1c6b);if(_0x238b39)return _0x238b39;return _0x24774c[_0x5bdad8(0x14e)]({'journeyId':_0x5b1c6b,'journeyName':_0x7ecf54['name'],'isMultiVersion':_0x132e30['length']>0x1});};if(_0x904231&&_0x132e30[_0x49665d(0xec)]>0x1){const _0x38180b=[];for(const _0x54d2cb of _0x132e30){const _0x5b7290=_0x54d2cb[_0x49665d(0x128)]||0x1;_0x24774c[_0x49665d(0xf1)]?.['update'](_0x49665d(0x140)+_0x7ecf54['name']+'\x20v'+_0x5b7290);const _0x3e9c88=await _0x10166d(_0x54d2cb['id']),_0x40b70e=_0xd33cfa(_0x54d2cb['id']),_0x3a2faf=await journeyResponseToDef(_0x3e9c88,_0x40b70e);_0x38180b[_0x49665d(0x173)]({'item':_0x54d2cb,'yaml':_0x3a2faf});}const _0x150bb0=buildLocalRuleToNameMappingFromJourney(_0x7ecf54);_0x5ada81=buildMergedJourneyDef(_0x38180b,_0x150bb0,_0x4fa8d8);const _0x985fdf=Math[_0x49665d(0xa4)](..._0x38180b[_0x49665d(0xc1)](_0x3f2cd6=>_0x3f2cd6['item']['versionNumber']||0x0)),_0x30ce47=_0x132e30[_0x49665d(0x16c)](_0x5ce3fc=>(_0x5ce3fc[_0x49665d(0x128)]||0x0)===_0x985fdf);_0x30ce47&&(_0x24774c[_0x49665d(0xf1)]?.[_0x49665d(0x17b)](_0x49665d(0x140)+_0x7ecf54[_0x49665d(0x8c)]+'\x20v'+_0x985fdf),_0x1b8802=await _0x10166d(_0x30ce47['id']));}else{const _0x4a6e26=_0x132e30[_0x132e30[_0x49665d(0xec)]-0x1];_0x24774c['progress']?.['update'](_0x49665d(0x140)+_0x7ecf54[_0x49665d(0x8c)]),_0x1b8802=await _0x10166d(_0x4a6e26['id']);const _0x297004=_0xd33cfa(_0x4a6e26['id']),_0x2324ec=await journeyResponseToDef(_0x1b8802,_0x297004),_0x2ad8b2=buildLocalRuleToNameMappingFromJourney(_0x7ecf54);_0x5ada81=buildMergedJourneyDef([{'item':_0x4a6e26,'yaml':_0x2324ec}],_0x2ad8b2,_0x4fa8d8);}}addFoldersToCreate(_0x1ebe11,_0x24774c[_0x49665d(0x116)],_0x6a6ae0);const _0x8d7cba=calculateJourneyDiff(_0x7ecf54,_0x5ada81);_0x247da6[_0x49665d(0x173)]({'relativePath':_0x7ecf54[_0x49665d(0x8c)],'absolutePath':_0x3f3864,'yamlConfig':_0x7ecf54,'folderPath':_0x1ebe11,'existingJourney':_0x1b8802,'isNew':_0x8d7cba[_0x49665d(0x89)],'hasChanges':_0x8d7cba[_0x49665d(0xe3)],'diff':_0x8d7cba[_0x49665d(0x17e)]});}return{'journeyFiles':_0x247da6,'foldersToCreate':_0x6a6ae0};}export function calculateActivationActions(_0x58f71e,_0x304efd,_0x5e2ba1,_0xce5716){const _0x5315b4=a142_0x5a51,_0x9ce64e=[],_0xb9684f=new Map();for(const _0x752462 of _0x304efd){_0xb9684f['set'](_0x752462['name'],_0x752462);}const _0x1be4d6=new Map();for(const _0x1f5083 of _0x58f71e){_0x1be4d6[_0x5315b4(0x156)](_0x1f5083[_0x5315b4(0x8c)],_0x1f5083);}for(const _0xb8f9cb of _0x58f71e){const _0x42f0c1=_0xb9684f[_0x5315b4(0x185)](_0xb8f9cb[_0x5315b4(0x8c)]);if(!_0x42f0c1)_0x9ce64e[_0x5315b4(0x173)]({'type':_0x5315b4(0x143),'name':_0xb8f9cb[_0x5315b4(0x8c)],'yamlActivation':_0xb8f9cb});else{const _0x4804c4=activationResponseToDef(_0x42f0c1,_0x5e2ba1,_0xce5716),_0x13b3ef=a142_0x5a9249[_0x5315b4(0x183)](_0x4804c4),_0x3c9cc7=a142_0x5a9249['stringify'](_0xb8f9cb);_0x13b3ef!==_0x3c9cc7&&_0x9ce64e['push']({'type':_0x5315b4(0x17b),'name':_0xb8f9cb['name'],'yamlActivation':_0xb8f9cb,'existingActivation':_0x42f0c1});}}for(const _0x1a33c0 of _0x304efd){!_0x1be4d6[_0x5315b4(0xd3)](_0x1a33c0[_0x5315b4(0x8c)])&&_0x9ce64e[_0x5315b4(0x173)]({'type':_0x5315b4(0x105),'name':_0x1a33c0['name'],'existingActivation':_0x1a33c0});}return _0x9ce64e;}function calculateYamlDiff(_0x990951,_0x32152b){if(_0x32152b){const _0x5390c9=generateDiff(_0x32152b,_0x990951),_0x42f6eb=hasChanges(_0x5390c9);return{'isNew':![],'hasChanges':_0x42f6eb,'diff':_0x42f6eb?formatDiffWithColors(_0x5390c9):undefined};}const _0x11ccf4=generateDiff('',_0x990951);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x11ccf4)};}export function calculateSegmentDiff(_0x82deb1,_0x2cc9d9,_0x14033a,_0x193315,_0x5b9939){const _0x166968=segmentToYamlString(_0x82deb1),_0x3959b8=_0x2cc9d9?segmentToYamlString(segmentWithActivationsToYaml(_0x2cc9d9,_0x14033a,undefined,_0x193315,_0x5b9939)):undefined;return calculateYamlDiff(_0x166968,_0x3959b8);}export function calculateJourneyDiff(_0x3493d3,_0xf77c54){const _0x505d4d=normalizeJourneyDef(_0x3493d3,_0x3493d3),_0x5e2317=a142_0x2aac63(_0x505d4d),_0x339e11=_0xf77c54?a142_0x2aac63(normalizeJourneyDef(_0xf77c54,_0x3493d3)):undefined;return calculateYamlDiff(_0x5e2317,_0x339e11);}export function findSegmentsToDelete(_0xdff48f,_0x394a0c,_0x1ace6f,_0x39cf7c,_0x5afa30){const _0x139aa8=a142_0x5a51,_0x40e83f=new Set();for(const {yamlConfig:_0x4797aa,folderPath:_0x3e8821}of _0x394a0c){_0x40e83f[_0x139aa8(0x154)](_0x3e8821+':'+_0x4797aa[_0x139aa8(0x8c)]);}return _0xdff48f[_0x139aa8(0x155)](_0x58d4ca=>{const _0x525887=_0x139aa8,_0x1a2875=_0x58d4ca['segmentFolderId']?_0x1ace6f['get'](_0x58d4ca[_0x525887(0x8f)][_0x525887(0xcc)]())||'':'',_0x31595a=_0x1a2875+':'+_0x58d4ca[_0x525887(0x8c)];if(_0x40e83f[_0x525887(0xd3)](_0x31595a))return![];if(_0x5afa30)return _0x1a2875===_0x39cf7c||_0x1a2875['startsWith'](_0x39cf7c+'/');return!![];});}export function findJourneysToDelete(_0x5cf46d,_0x2fdc54,_0x391d8f,_0x3cfb42,_0x3ec681){const _0x34aa71=a142_0x5a51,_0x32bd82=new Set();for(const {yamlConfig:_0x6ad753,folderPath:_0x312f17}of _0x2fdc54){_0x32bd82['add'](_0x312f17+':'+_0x6ad753[_0x34aa71(0x8c)]);}return _0x5cf46d[_0x34aa71(0x155)](_0x2842a0=>{const _0x2a6800=_0x34aa71,_0x4b1a91=_0x2842a0[_0x2a6800(0xcb)]?_0x391d8f[_0x2a6800(0x185)](_0x2842a0[_0x2a6800(0xcb)])||'':'',_0xa0abe3=_0x4b1a91+':'+_0x2842a0[_0x2a6800(0xd1)];if(_0x32bd82['has'](_0xa0abe3))return![];if(_0x3ec681)return _0x4b1a91===_0x3cfb42||_0x4b1a91[_0x2a6800(0x129)](_0x3cfb42+'/');return!![];});}export function buildSegmentLookupMap(_0xf46b00,_0x4676a0){const _0x298632=a142_0x5a51,_0x4b4585=new Map();for(const _0x85f7de of _0xf46b00){const _0xdb7018=_0x85f7de[_0x298632(0x8f)]?_0x4676a0[_0x298632(0x185)](_0x85f7de[_0x298632(0x8f)][_0x298632(0xcc)]())||'':'',_0x5c8cd8=_0xdb7018+':'+_0x85f7de[_0x298632(0x8c)];_0x4b4585['set'](_0x5c8cd8,_0x85f7de);}return _0x4b4585;}export function buildSegmentNameToIdMap(_0x9dd6d4){const _0x5e9b44=a142_0x5a51,_0x36f095=new Map();for(const _0x27bfda of _0x9dd6d4){_0x36f095[_0x5e9b44(0x156)](_0x27bfda['name'],_0x27bfda['id']);}return _0x36f095;}export function buildJourneyBundleLookupMap(_0x3d4565,_0x99f2d3){const _0x2499c7=a142_0x5a51,_0x4b2076=new Map();for(const _0x1d7805 of _0x3d4565){const _0x4ad5b8=_0x1d7805[_0x2499c7(0xcb)]?_0x99f2d3[_0x2499c7(0x185)](_0x1d7805[_0x2499c7(0xcb)])||'':'',_0x324052=_0x4ad5b8+':'+_0x1d7805[_0x2499c7(0xd1)];!_0x4b2076['has'](_0x324052)&&_0x4b2076[_0x2499c7(0x156)](_0x324052,[]),_0x4b2076[_0x2499c7(0x185)](_0x324052)[_0x2499c7(0x173)](_0x1d7805);}for(const _0x52d521 of _0x4b2076['values']()){_0x52d521[_0x2499c7(0xfd)]((_0x2d8a81,_0x38a98c)=>(_0x2d8a81[_0x2499c7(0x128)]||0x0)-(_0x38a98c[_0x2499c7(0x128)]||0x0));}return _0x4b2076;}function a142_0x42c6(_0x3718ef,_0x5ef35c){_0x3718ef=_0x3718ef-0x80;const _0x2daf34=a142_0x2daf();let _0x42c6d8=_0x2daf34[_0x3718ef];return _0x42c6d8;}export function collectFoldersToCreate(_0x3dcd06,_0x52fcb5){const _0x1496fd=a142_0x5a51,_0x5959bf=new Set();for(const _0x3d1409 of _0x3dcd06){if(!_0x3d1409)continue;if(_0x52fcb5[_0x1496fd(0xd3)](_0x3d1409))continue;const _0x53a0f3=_0x3d1409[_0x1496fd(0x8d)]('/');let _0x44c4e6='';for(const _0xbcceab of _0x53a0f3){_0x44c4e6=_0x44c4e6?_0x44c4e6+'/'+_0xbcceab:_0xbcceab,!_0x52fcb5[_0x1496fd(0xd3)](_0x44c4e6)&&_0x5959bf[_0x1496fd(0x154)](_0x44c4e6);}}return _0x5959bf;}export function parseAndClassifyYamlFiles(_0x4a0a44,_0xeafc1a,_0x3a8f93){const _0x19affd=a142_0x5a51,_0x160204=[],_0x3b4ac4=[];for(const _0x3199b4 of _0x4a0a44){const _0x532b40=a142_0x5c3462[_0x19affd(0x81)](_0xeafc1a,a142_0x5c3462['dirname'](_0x3199b4)),_0x36b571=_0x532b40==='.'?'':_0x532b40,_0x13d4c9=readFileSync(_0x3199b4,'utf-8'),_0x1f43f8=a142_0x5a9249['parse'](_0x13d4c9);if(isJourneyDef(_0x1f43f8)){const _0x4f2aa8=a142_0x2514e4(_0x13d4c9);_0x3b4ac4['push']({'yamlConfig':_0x4f2aa8,'folderPath':_0x36b571,'sourcePath':_0x3199b4});}else{if(!_0x3a8f93?.['skipSegments']){const _0x4876ee=parseSegmentYamlFile(_0x13d4c9),_0x12eaee=normalizeChildSegmentYaml(_0x4876ee);_0x160204[_0x19affd(0x173)]({'yamlConfig':_0x12eaee,'folderPath':_0x36b571,'sourcePath':_0x3199b4});}}}return{'segments':_0x160204,'journeys':_0x3b4ac4};}export function validateParsedFiles(_0x2dc82b,_0x567b52){const _0x1ec5a8=a142_0x5a51,_0x15250d=[];for(const {yamlConfig:_0x1b0625,sourcePath:_0x45830a}of _0x2dc82b[_0x1ec5a8(0xd4)]){const _0x528174=readFileSync(_0x45830a,'utf-8'),_0x2f9432=a142_0x5a9249['parseDocument'](_0x528174),_0x1be537=validateSegmentDef(_0x1b0625,{'source':_0x528174,'document':_0x2f9432},{'skipSchema':!![]});if(!_0x1be537['valid']){const _0x4a5db4=a142_0x5c3462[_0x1ec5a8(0x81)](_0x567b52,_0x45830a);_0x15250d[_0x1ec5a8(0x173)]({'filePath':_0x4a5db4,'source':_0x528174,'result':_0x1be537,'isJourney':![]});}}for(const {yamlConfig:_0x22e545,sourcePath:_0x3c9e38}of _0x2dc82b[_0x1ec5a8(0x14a)]){const _0x5a3aba=readFileSync(_0x3c9e38,_0x1ec5a8(0x13c)),_0x15de33=a142_0x5a9249[_0x1ec5a8(0x15d)](_0x5a3aba),_0x797505=validateJourneyDef(_0x22e545,{'source':_0x5a3aba,'document':_0x15de33},{'skipSchema':!![]});if(!_0x797505['valid']){const _0xa49e5c=a142_0x5c3462[_0x1ec5a8(0x81)](_0x567b52,_0x3c9e38);_0x15250d[_0x1ec5a8(0x173)]({'filePath':_0xa49e5c,'source':_0x5a3aba,'result':_0x797505,'isJourney':!![]});}}return _0x15250d;}export function formatValidationErrors(_0x49ff49){const _0x533700=a142_0x5a51,_0x46a41c=[];for(const {filePath:_0x56ff60,source:_0x1f778a,result:_0x3022ea,isJourney:_0x377ba0}of _0x49ff49){const _0x254ff5=_0x377ba0?'journey':_0x533700(0xf2);_0x46a41c[_0x533700(0x173)]('\x0a'+_0x56ff60+'\x20('+_0x254ff5+'):\x20'+_0x3022ea[_0x533700(0xdf)][_0x533700(0xec)]+_0x533700(0x10e)),_0x46a41c[_0x533700(0x173)](formatValidationResult(_0x3022ea,_0x1f778a,_0x56ff60));}return _0x46a41c[_0x533700(0xcd)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x55279f){const _0x5ccada=a142_0x5a51,_0x5e2fe5=new Set(),_0x2a8d08=new Map(),_0x14574e=collectSegmentUsageCounts(_0x55279f);if(_0x55279f[_0x5ccada(0xd4)])for(const [_0x5df350,_0x170d22]of Object[_0x5ccada(0x15a)](_0x55279f['segments'])){_0x5e2fe5[_0x5ccada(0x154)](_0x5df350);if(_0x170d22[_0x5ccada(0x176)]){const _0x4790b9=yamlRuleToApi(_0x170d22[_0x5ccada(0x176)]),_0x2417d3=apiRuleToYaml(_0x4790b9);_0x2a8d08[_0x5ccada(0x156)](_0x5df350,_0x2417d3);}}const _0x8832e4=new Map();let _0x32f362=0x0;for(const [_0x43fc6a,_0x6b5071]of _0x2a8d08){const _0x39528c=serializeExpandedRule(_0x6b5071,_0x2a8d08),_0x1571fc=_0x8832e4[_0x5ccada(0x185)](_0x39528c)||[];_0x1571fc['push']({'name':_0x43fc6a,'index':_0x32f362}),_0x8832e4['set'](_0x39528c,_0x1571fc),_0x32f362++;}const _0x32e82c=new Map();for(const [_0x10e110,_0x5198a4]of _0x8832e4){const _0x281aa9=_0x5198a4[_0x5ccada(0xf6)]()[_0x5ccada(0xfd)]((_0x4e8b7e,_0x11deb0)=>{const _0xc88da=_0x5ccada,_0x11ef97=_0x14574e[_0xc88da(0x185)](_0x4e8b7e[_0xc88da(0x8c)])||0x0,_0x11b573=_0x14574e['get'](_0x11deb0[_0xc88da(0x8c)])||0x0;if(_0x11ef97!==_0x11b573)return _0x11b573-_0x11ef97;return _0x4e8b7e[_0xc88da(0xf3)]-_0x11deb0[_0xc88da(0xf3)];})[_0x5ccada(0xc1)](_0x2d1b39=>_0x2d1b39[_0x5ccada(0x8c)]),_0x5d17ba=[];for(const _0x674426 of _0x281aa9){const _0x51870e=_0x14574e['get'](_0x674426)||0x0,_0x46e904=Math[_0x5ccada(0xa4)](_0x51870e,0x1);for(let _0x1dcc3a=0x0;_0x1dcc3a<_0x46e904;_0x1dcc3a++){_0x5d17ba['push'](_0x674426);}}_0x32e82c[_0x5ccada(0x156)](_0x10e110,_0x5d17ba);}return{'existingLocalSegmentNames':_0x5e2fe5,'localSegmentRules':_0x2a8d08,'localExpandedRuleToNames':_0x32e82c};}export function createSegmentIdResolver(_0x2afbe2,_0x3d941b){return async _0x2efdb0=>{const _0x488fa5=a142_0x42c6,_0x2eb103=_0x2afbe2[_0x488fa5(0x185)](_0x2efdb0);if(!_0x2eb103)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x2efdb0+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x3d941b+'\x27)');return _0x2eb103;};}export function extractRootFolderId(_0x2cf952){const _0x577f9d=a142_0x5a51;return _0x2cf952[_0x577f9d(0x163)]?.[_0x577f9d(0x13a)]?.[_0x577f9d(0x149)]?.['id']||_0x2cf952['relationships']?.[_0x577f9d(0x131)]?.['data']?.['id'];}export function buildConnectionMaps(_0x59a6e9){const _0x5e0186=a142_0x5a51,_0x27ad77=new Map(),_0x3496bc=new Map(),_0x43660a=new Map();for(const _0x404ac8 of _0x59a6e9){_0x27ad77[_0x5e0186(0x156)](_0x404ac8[_0x5e0186(0x8c)],parseInt(_0x404ac8['id'],0xa)),_0x3496bc['set'](_0x404ac8['id'],_0x404ac8['name']),_0x43660a['set'](_0x404ac8[_0x5e0186(0x8c)],_0x404ac8[_0x5e0186(0xa2)]);}return{'nameToId':_0x27ad77,'idToName':_0x3496bc,'nameToType':_0x43660a};}export function calculatePushStats(_0x36fa0e,_0x1cf009,_0x3716b6,_0x5f07ff,_0x5aa2ba,_0x57dce2,_0x31ae22){const _0xc734ad=a142_0x5a51,_0x344315=_0x36fa0e[_0xc734ad(0x155)](_0x4d8738=>_0x4d8738[_0xc734ad(0x89)]),_0x21a547=_0x36fa0e['filter'](_0x14d41d=>!_0x14d41d['isNew']&&_0x14d41d[_0xc734ad(0xe3)]),_0x5b9f5d=_0x36fa0e[_0xc734ad(0x155)](_0x2846b5=>!_0x2846b5['isNew']&&!_0x2846b5[_0xc734ad(0xe3)]),_0x1f050d=_0x57dce2?_0x5f07ff:[],_0x1f5d08=_0x1cf009['filter'](_0x507457=>_0x507457['isNew']),_0x5dd6b5=_0x1cf009[_0xc734ad(0x155)](_0x22dce7=>!_0x22dce7[_0xc734ad(0x89)]&&_0x22dce7[_0xc734ad(0xe3)]),_0x129a97=_0x1cf009['filter'](_0x4e09e2=>!_0x4e09e2[_0xc734ad(0x89)]&&!_0x4e09e2[_0xc734ad(0xe3)]),_0x2b7728=_0x57dce2?_0x5aa2ba:[],_0x46db84=_0x36fa0e['flatMap'](_0x4ece71=>_0x4ece71[_0xc734ad(0x11b)]),_0x34ca16=_0x46db84[_0xc734ad(0x155)](_0x74c39f=>_0x74c39f[_0xc734ad(0xa2)]===_0xc734ad(0x143)),_0xb07d8b=_0x46db84[_0xc734ad(0x155)](_0x2c34da=>_0x2c34da[_0xc734ad(0xa2)]===_0xc734ad(0x17b)),_0xded13c=_0x46db84[_0xc734ad(0x155)](_0x46b166=>_0x46b166['type']===_0xc734ad(0x105)),_0x2e1d7a=Array[_0xc734ad(0x97)](_0x3716b6)[_0xc734ad(0xfd)](),_0x4c51a3=_0x31ae22?![]:_0x344315[_0xc734ad(0xec)]>0x0||_0x21a547[_0xc734ad(0xec)]>0x0||_0x1f050d[_0xc734ad(0xec)]>0x0,_0x4142a2=_0x1f5d08['length']>0x0||_0x5dd6b5['length']>0x0||_0x2b7728[_0xc734ad(0xec)]>0x0,_0x3339c2=_0x31ae22?![]:_0x46db84['length']>0x0,_0x3b91a2=_0x2e1d7a[_0xc734ad(0xec)]>0x0;return{'segments':{'new':_0x344315,'changed':_0x21a547,'unchanged':_0x5b9f5d,'toDelete':_0x1f050d},'journeys':{'new':_0x1f5d08,'changed':_0x5dd6b5,'unchanged':_0x129a97,'toDelete':_0x2b7728},'activations':{'all':_0x46db84,'toCreate':_0x34ca16,'toUpdate':_0xb07d8b,'toDelete':_0xded13c},'folders':{'toCreate':_0x2e1d7a},'counts':{'segments':{'new':_0x344315[_0xc734ad(0xec)],'changed':_0x21a547[_0xc734ad(0xec)],'unchanged':_0x5b9f5d[_0xc734ad(0xec)],'toDelete':_0x1f050d[_0xc734ad(0xec)]},'journeys':{'new':_0x1f5d08[_0xc734ad(0xec)],'changed':_0x5dd6b5[_0xc734ad(0xec)],'unchanged':_0x129a97[_0xc734ad(0xec)],'toDelete':_0x2b7728[_0xc734ad(0xec)]},'activations':{'create':_0x34ca16['length'],'update':_0xb07d8b[_0xc734ad(0xec)],'delete':_0xded13c[_0xc734ad(0xec)]},'folders':_0x2e1d7a[_0xc734ad(0xec)]},'hasChanges':_0x4c51a3||_0x4142a2||_0x3339c2||_0x3b91a2};}export async function buildPushExecutionContext(_0x385612,_0x4572b2,_0x1b6a6b,_0x1d9447,_0x53d2c1,_0xfffcf0){const _0x1f1d5a=a142_0x5a51,_0x2e3502=extractRootFolderId(_0x1b6a6b),{pathToId:_0x30fbb8,idToPath:_0x2bd96b}=buildFolderMaps(_0x53d2c1),_0xadb840=buildSegmentNameToIdMap(_0x1d9447),_0x47d13a=new Map(),{batchAsync:_0x13697a}=await import('../../utils/async.js'),[_0x987490,_0x59d42a]=await Promise[_0x1f1d5a(0x126)]([_0x385612[_0x1f1d5a(0x130)]['buildUserMaps'](),_0x385612[_0x1f1d5a(0x134)][_0x1f1d5a(0x12d)](),((async()=>{!_0xfffcf0&&_0x1d9447['length']>0x0&&await _0x13697a(_0x1d9447,async _0x34d55f=>{const _0x2acb87=a142_0x42c6,_0x1c68a2=await _0x385612[_0x2acb87(0xf2)][_0x2acb87(0x80)](_0x4572b2,_0x34d55f['id']);_0x47d13a[_0x2acb87(0x156)](_0x34d55f['id'],_0x1c68a2);});})())]),{emailToId:_0x4875cd,idToEmail:_0x5e2417}=_0x987490,_0x268670=buildConnectionMaps(_0x59d42a);return{'rootFolderId':_0x2e3502,'folderPathToId':_0x30fbb8,'folderIdToPath':_0x2bd96b,'segmentNameToId':_0xadb840,'activationsBySegmentId':_0x47d13a,'emailToIdMap':_0x4875cd,'idToEmailMap':_0x5e2417,'connectionNameToIdMap':_0x268670['nameToId'],'connectionIdToNameMap':_0x268670[_0x1f1d5a(0x9f)],'connectionNameToTypeMap':_0x268670[_0x1f1d5a(0xb2)]};}export function createPushYamlContextForBundle(_0x36588d,_0x3b5738,_0x5162c8,_0x2252d3,_0x381aa9,_0x1a9b32,_0x5e6ca5,_0x3e9e49){const {existingLocalSegmentNames:_0x1eef09,localExpandedRuleToNames:_0x38a6a0}=_0x2252d3,_0x8cddf3=new Set(),_0x46031c=new Map(),_0x4658c5=new Map(),_0x546225=new Map(),_0x1412aa=createJumpTargetCache(),_0x5d6d86=new Map(),_0x392ec7=new Map(),_0x5c828b=new Set();let _0x440a88;const _0x584009=_0x357ac1=>{const _0x5d11f1={'resolveSegment':async _0xf5d455=>{const _0x4c0262=a142_0x42c6,_0x4bcb06=_0x546225[_0x4c0262(0x185)](_0xf5d455);if(_0x4bcb06!==undefined)return{'name':_0x4bcb06,'isJourneyLocal':!![]};try{const _0x2317c0=await fetchSegment(_0x36588d,_0x3b5738,_0xf5d455,_0x5162c8);if(!_0x2317c0)throw new Error(_0x4c0262(0x98));const _0x3b1db4=generateJourneyLocalName(_0x2317c0[_0x4c0262(0x8c)]),_0x4f7d38=_0x2317c0[_0x4c0262(0x93)]===SEGMENT_KIND_JOURNEY&&_0x3b1db4!==undefined;let _0x384e29=_0x2317c0[_0x4c0262(0x8c)],_0x5dd9ce;if(_0x4f7d38&&_0x2317c0[_0x4c0262(0x176)]){const _0x595519=apiRuleToYaml(_0x2317c0['rule']);_0x392ec7[_0x4c0262(0x156)](_0xf5d455,_0x595519);const _0x43c197=async _0x257567=>{const _0x2692e6=_0x4c0262,_0x181091=collectSegmentRefsFromRule(_0x257567);for(const _0x174a3f of _0x181091){if(!_0x392ec7[_0x2692e6(0xd3)](_0x174a3f))try{const _0x47a782=await fetchSegment(_0x36588d,_0x3b5738,_0x174a3f,_0x5162c8);if(_0x47a782?.[_0x2692e6(0x176)]){const _0x2ebc7c=apiRuleToYaml(_0x47a782[_0x2692e6(0x176)]);_0x392ec7[_0x2692e6(0x156)](_0x174a3f,_0x2ebc7c),await _0x43c197(_0x2ebc7c);}}catch(_0x39ebab){logger[_0x2692e6(0x186)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x174a3f+':\x20'+_0x39ebab);}}};await _0x43c197(_0x595519);const _0x236beb=serializeExpandedRule(_0x595519,_0x392ec7),_0x490afb=_0x38a6a0[_0x4c0262(0x185)](_0x236beb);if(_0x490afb&&_0x490afb[_0x4c0262(0xec)]>0x0){const _0x5d47ec=_0x46031c[_0x4c0262(0x185)](_0x236beb)||0x0,_0x55e79e=_0x490afb[_0x5d47ec]||_0x490afb[_0x490afb[_0x4c0262(0xec)]-0x1];_0x46031c[_0x4c0262(0x156)](_0x236beb,_0x5d47ec+0x1),_0x384e29=_0x55e79e,_0x8cddf3[_0x4c0262(0x154)](_0x384e29),_0x546225[_0x4c0262(0x156)](_0xf5d455,_0x384e29);const _0x8b25db=await resolveRuleSegmentRefs(_0x595519,async _0x431a0c=>{const _0x3c543c=_0x4c0262,_0x39183f=_0x546225['get'](_0x431a0c);if(_0x39183f)return _0x39183f;const _0x4c4bc6=await _0x440a88[_0x3c543c(0xdd)](_0x431a0c);return _0x4c4bc6[_0x3c543c(0x8c)];});_0x5dd9ce={'description':_0x2317c0['description'],'rule':_0x8b25db};}else{const _0x394af1=_0x5d6d86[_0x4c0262(0x185)](_0x236beb);if(_0x394af1)_0x384e29=_0x394af1,_0x546225[_0x4c0262(0x156)](_0xf5d455,_0x384e29);else{if(_0x3b1db4){let _0x2a04e3=_0x3b1db4,_0x2c8dcb=0x2;while(_0x8cddf3['has'](_0x2a04e3)||_0x1eef09[_0x4c0262(0xd3)](_0x2a04e3)){_0x2a04e3=_0x3b1db4+'_'+_0x2c8dcb,_0x2c8dcb++;}_0x8cddf3[_0x4c0262(0x154)](_0x2a04e3),_0x384e29=_0x2a04e3;}_0x546225['set'](_0xf5d455,_0x384e29),_0x5d6d86[_0x4c0262(0x156)](_0x236beb,_0x384e29);const _0x263997=await resolveRuleSegmentRefs(_0x595519,async _0x7970c6=>{const _0x16330f=_0x4c0262,_0x2fdfe2=_0x546225[_0x16330f(0x185)](_0x7970c6);if(_0x2fdfe2)return _0x2fdfe2;const _0x3ecc7a=await _0x440a88['resolveSegment'](_0x7970c6);return _0x3ecc7a['name'];});_0x5dd9ce={'description':_0x2317c0[_0x4c0262(0x167)],'rule':_0x263997};}}}return{'name':_0x384e29,'isJourneyLocal':_0x4f7d38,'definition':_0x5dd9ce};}catch(_0x46af5a){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0xf5d455+':\x20'+_0x46af5a),{'name':_0xf5d455,'isJourneyLocal':![]};}},'resolveActivation':async _0x5a98b4=>{const _0x3ea871=a142_0x42c6,_0x9408b7=_0x4658c5['get'](_0x5a98b4);if(_0x9408b7!==undefined)return{'name':_0x9408b7,'isJourneyLocal':!![]};try{let _0x5066de=_0x5e6ca5?.[_0x3ea871(0x185)](_0x5a98b4);!_0x5066de&&(_0x5066de=await _0x36588d[_0x3ea871(0x164)]['getActivation'](_0x357ac1,_0x5a98b4));const _0x1c58cc=_0x5066de[_0x3ea871(0xc6)][_0x3ea871(0x170)][_0x3ea871(0x8c)]||_0x5a98b4,_0x5a51e8=sanitizeYamlKey(_0x1c58cc)||_0x3ea871(0x142)+_0x5a98b4,_0x20f108=_0x5a51e8;_0x4658c5['set'](_0x5a98b4,_0x20f108);const _0x53540b=journeyActivationStepToYaml(_0x5066de,_0x381aa9,_0x1a9b32);return{'name':_0x20f108,'isJourneyLocal':!![],'definition':_0x53540b};}catch(_0x10f54f){return logger[_0x3ea871(0x186)]('Failed\x20to\x20resolve\x20activation\x20'+_0x5a98b4+':\x20'+_0x10f54f),{'name':_0x5a98b4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1338a3,_0x455314)=>resolveJumpTarget(_0x1338a3,_0x455314,_0x1412aa,async _0x467ff4=>{const _0x668283=a142_0x42c6,_0x1a3be4=_0x3e9e49?.[_0x668283(0x185)](_0x467ff4);if(_0x1a3be4)return _0x1a3be4;return _0x36588d['journey'][_0x668283(0x157)](_0x467ff4);})};return _0x440a88=_0x5d11f1,_0x5d11f1;},_0x75893e=async _0xe932e5=>{const _0x265242=a142_0x42c6,{collectSegmentIdsFromJourneyApi:_0x39dadd}=await import(_0x265242(0x114)),{batchAsync:_0x508690}=await import(_0x265242(0x85)),_0x24ef11=new Set();for(const _0x29bead of _0xe932e5){let _0x509d27=_0x3e9e49?.[_0x265242(0x185)](_0x29bead);!_0x509d27&&(_0x509d27=await _0x36588d['journey'][_0x265242(0x157)](_0x29bead));const _0x8c0c10=_0x39dadd(_0x509d27);for(const _0x2cbd0f of _0x8c0c10){_0x24ef11['add'](_0x2cbd0f);}}let _0x4598d0=Array['from'](_0x24ef11);while(_0x4598d0['length']>0x0){const _0x122a09=_0x4598d0[_0x265242(0x155)](_0x4efba4=>!_0x5c828b[_0x265242(0xd3)](_0x4efba4));if(_0x122a09[_0x265242(0xec)]===0x0)break;const _0x47a4f7=await _0x508690(_0x122a09,async _0x44e8ba=>{const _0x1deb81=_0x265242;_0x5c828b[_0x1deb81(0x154)](_0x44e8ba);const _0x3a50e0=await fetchSegment(_0x36588d,_0x3b5738,_0x44e8ba,_0x5162c8);if(!_0x3a50e0)return null;return{'segmentId':_0x44e8ba,'segment':_0x3a50e0};},0xa),_0x5b47b2=new Set();for(const _0x44f1f0 of _0x47a4f7){if(!_0x44f1f0?.[_0x265242(0xf2)]?.['rule'])continue;const _0x9037cd=apiRuleToYaml(_0x44f1f0[_0x265242(0xf2)][_0x265242(0x176)]);_0x392ec7['set'](_0x44f1f0['segmentId'],_0x9037cd);const _0x5988b8=collectSegmentRefsFromRule(_0x9037cd);for(const _0x2ac34b of _0x5988b8){!_0x5c828b['has'](_0x2ac34b)&&_0x5b47b2[_0x265242(0x154)](_0x2ac34b);}}_0x4598d0=Array[_0x265242(0x97)](_0x5b47b2);}};return{'createYamlContext':_0x584009,'prefetchJourneySegments':_0x75893e};}export async function executePushSegments(_0x588e96,_0x10462c,_0x285050,_0x54f431,_0x2d1614){const _0x40cf85=a142_0x5a51,{segmentDefToCreateRequest:_0x440784,segmentDefToUpdateRequest:_0x46f965}=await import(_0x40cf85(0x12a)),_0x3c93bb=_0x285050[_0x40cf85(0x116)],_0x49e9af=0x5,_0x3795cb=async _0x4e2bf3=>{const _0x236c2e=_0x40cf85,_0x31789e=_0x4e2bf3[_0x236c2e(0x107)]?_0x3c93bb['get'](_0x4e2bf3[_0x236c2e(0x107)]):undefined;let _0x230d8a;const _0x3b22cd={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x2c5e7b=_0x4e2bf3[_0x236c2e(0x124)];if(_0x4e2bf3['yamlConfig'][_0x236c2e(0x176)]){const _0x2d5a03=createSegmentIdResolver(_0x285050[_0x236c2e(0x151)],_0x4e2bf3[_0x236c2e(0x124)]['name']),_0x5d31ff=await resolveRuleSegmentIds(_0x4e2bf3['yamlConfig']['rule'],_0x2d5a03);_0x2c5e7b={..._0x4e2bf3['yamlConfig'],'rule':_0x5d31ff};}try{if(_0x4e2bf3['isNew']){_0x2d1614[_0x236c2e(0xad)]?.({'type':_0x236c2e(0x16f),'name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]});const _0x4d71cf=_0x440784(_0x2c5e7b,_0x31789e),_0x56b9cc=await _0x2d1614[_0x236c2e(0x115)](_0x236c2e(0x106)+_0x4e2bf3[_0x236c2e(0x124)]['name']+'\x27...',()=>_0x588e96['segment'][_0x236c2e(0xb1)](_0x54f431[_0x236c2e(0xee)],_0x4d71cf));_0x230d8a=_0x56b9cc[_0x236c2e(0x149)]['id'],_0x285050[_0x236c2e(0x151)][_0x236c2e(0x156)](_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)],_0x230d8a),_0x3b22cd[_0x236c2e(0x82)]={'name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)],'id':_0x230d8a},_0x2d1614[_0x236c2e(0xad)]?.({'type':'segment_created','name':_0x4e2bf3[_0x236c2e(0x124)]['name'],'segmentId':_0x230d8a}),_0x2d1614['logSuccess']?.(_0x236c2e(0x13f)+_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]+'\x27'),_0x3b22cd[_0x236c2e(0xa8)]=0x1;}else{if(_0x4e2bf3[_0x236c2e(0xe3)]){_0x2d1614['onProgress']?.({'type':'segment_updating','name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]});const _0x431c9c=_0x46f965(_0x2c5e7b);_0x31789e!==_0x4e2bf3['existingSegment']?.['segmentFolderId']&&(_0x431c9c[_0x236c2e(0x8f)]=_0x31789e?parseInt(_0x31789e,0xa):undefined),await _0x2d1614[_0x236c2e(0x115)](_0x236c2e(0x182)+_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]+'\x27...',()=>_0x588e96[_0x236c2e(0xf2)][_0x236c2e(0x10c)](_0x54f431[_0x236c2e(0xee)],_0x4e2bf3[_0x236c2e(0xa3)]['id'],_0x431c9c)),_0x230d8a=_0x4e2bf3[_0x236c2e(0xa3)]['id'],_0x2d1614['onProgress']?.({'type':_0x236c2e(0xf9),'name':_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)]}),_0x2d1614[_0x236c2e(0x11d)]?.('Updated\x20segment\x20\x27'+_0x4e2bf3[_0x236c2e(0x124)]['name']+'\x27'),_0x3b22cd['updated']=0x1;}else _0x230d8a=_0x4e2bf3[_0x236c2e(0xa3)]['id'];}}catch(_0x261057){const _0x25d892=isHttp400Error(_0x261057),_0xd860a8=_0x25d892?ErrorCode[_0x236c2e(0xbf)]:ErrorCode[_0x236c2e(0x14d)],_0x5d1024=getErrorMessage(_0x261057);throw new SDKError(_0xd860a8,_0x236c2e(0xed)+(_0x4e2bf3['isNew']?_0x236c2e(0x143):_0x236c2e(0x17b))+_0x236c2e(0x16b)+_0x4e2bf3['absolutePath']+_0x236c2e(0xc4)+_0x5d1024,_0x261057);}try{const _0x89f99d=await syncActivationsForSegment(_0x588e96,_0x54f431[_0x236c2e(0xee)],_0x230d8a,_0x4e2bf3[_0x236c2e(0x124)][_0x236c2e(0x8c)],_0x4e2bf3[_0x236c2e(0x11b)],_0x2d1614,_0x4e2bf3['absolutePath']);_0x3b22cd[_0x236c2e(0x17d)]=_0x89f99d;}catch(_0x309042){if(_0x309042 instanceof SDKError)throw _0x309042;throw new SDKError(ErrorCode[_0x236c2e(0x146)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x4e2bf3['yamlConfig']['name']+_0x236c2e(0x152)+_0x4e2bf3['absolutePath']+_0x236c2e(0xc4)+getErrorMessage(_0x309042),_0x309042);}return _0x3b22cd;},_0x2761ca=await batchAsync(_0x10462c,_0x3795cb,_0x49e9af),_0x4b69e6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xeec735 of _0x2761ca){_0x4b69e6[_0x40cf85(0xa8)]+=_0xeec735[_0x40cf85(0xa8)],_0x4b69e6['updated']+=_0xeec735[_0x40cf85(0xde)],_0xeec735['createdSegmentId']&&_0x4b69e6[_0x40cf85(0xd8)][_0x40cf85(0x156)](_0xeec735[_0x40cf85(0x82)][_0x40cf85(0x8c)],_0xeec735[_0x40cf85(0x82)]['id']),_0x4b69e6[_0x40cf85(0x17d)][_0x40cf85(0xa8)]+=_0xeec735[_0x40cf85(0x17d)][_0x40cf85(0xa8)],_0x4b69e6[_0x40cf85(0x17d)][_0x40cf85(0xde)]+=_0xeec735[_0x40cf85(0x17d)][_0x40cf85(0xde)],_0x4b69e6['activations']['deleted']+=_0xeec735['activations'][_0x40cf85(0xef)];}return _0x4b69e6;}async function syncActivationsForSegment(_0x49c204,_0x587189,_0x1bffb5,_0x3e3488,_0x567926,_0x2216e9,_0x3fcda2){const _0x136a46=a142_0x5a51,_0x574bd6={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2175e1 of _0x567926){try{if(_0x2175e1[_0x136a46(0xa2)]==='create'&&_0x2175e1['validatedRequest'])_0x2216e9[_0x136a46(0xad)]?.({'type':'activation_creating','segmentName':_0x3e3488,'activationName':_0x2175e1['name']}),await _0x2216e9[_0x136a46(0x115)](_0x136a46(0xa9)+_0x2175e1[_0x136a46(0x8c)]+'\x27...',()=>_0x49c204[_0x136a46(0xf2)]['createActivation'](_0x587189,_0x1bffb5,_0x2175e1[_0x136a46(0x94)])),_0x2216e9[_0x136a46(0xad)]?.({'type':'activation_created','segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),_0x2216e9['logSuccess']?.(_0x136a46(0x133)+_0x2175e1[_0x136a46(0x8c)]+'\x27'),_0x574bd6[_0x136a46(0xa8)]++;else{if(_0x2175e1['type']===_0x136a46(0x17b)&&_0x2175e1[_0x136a46(0x94)]&&_0x2175e1[_0x136a46(0xb5)])_0x2216e9['onProgress']?.({'type':_0x136a46(0x91),'segmentName':_0x3e3488,'activationName':_0x2175e1['name']}),await _0x2216e9[_0x136a46(0x115)](_0x136a46(0x180)+_0x2175e1['name']+'\x27...',()=>_0x49c204['segment'][_0x136a46(0xd7)](_0x587189,_0x1bffb5,_0x2175e1[_0x136a46(0xb5)]['id'],_0x2175e1[_0x136a46(0x94)])),_0x2216e9[_0x136a46(0xad)]?.({'type':_0x136a46(0xe4),'segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),_0x2216e9[_0x136a46(0x11d)]?.(_0x136a46(0x15c)+_0x2175e1[_0x136a46(0x8c)]+'\x27'),_0x574bd6[_0x136a46(0xde)]++;else _0x2175e1[_0x136a46(0xa2)]===_0x136a46(0x105)&&_0x2175e1['existingActivation']&&(_0x2216e9[_0x136a46(0xad)]?.({'type':_0x136a46(0x118),'segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),await _0x2216e9[_0x136a46(0x115)](_0x136a46(0xd5)+_0x2175e1[_0x136a46(0x8c)]+_0x136a46(0xbb),()=>_0x49c204[_0x136a46(0xf2)][_0x136a46(0xd6)](_0x587189,_0x1bffb5,_0x2175e1[_0x136a46(0xb5)]['id'])),_0x2216e9[_0x136a46(0xad)]?.({'type':'activation_deleted','segmentName':_0x3e3488,'activationName':_0x2175e1[_0x136a46(0x8c)]}),_0x2216e9[_0x136a46(0x104)]?.(_0x136a46(0xe9)+_0x2175e1[_0x136a46(0x8c)]+'\x27'),_0x574bd6[_0x136a46(0xef)]++);}}catch(_0x5a2680){const _0x437538=isHttp400Error(_0x5a2680),_0x1bbc54=_0x437538?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x136a46(0x146)],_0x352847=getErrorMessage(_0x5a2680);throw new SDKError(_0x1bbc54,_0x136a46(0xed)+_0x2175e1['type']+_0x136a46(0xd9)+_0x2175e1[_0x136a46(0x8c)]+_0x136a46(0x152)+_0x3fcda2+_0x136a46(0xc4)+_0x352847,_0x5a2680);}}return _0x574bd6;}export async function executePushFolders(_0x5823ad,_0x5868f2,_0x9b5398,_0xbb0ce8,_0xe30116){const _0x22abca=a142_0x5a51,_0x3a6d6d=new Map(_0x9b5398),_0x29f9f9=sortFoldersByDepth(_0x5868f2);for(const _0x4a78ea of _0x29f9f9){const _0xa3ad2=_0x4a78ea[_0x22abca(0x8d)]('/'),_0x175874=_0xa3ad2[_0xa3ad2[_0x22abca(0xec)]-0x1],_0x498a2f=_0xa3ad2['slice'](0x0,-0x1)['join']('/'),_0x3b1475=_0x3a6d6d[_0x22abca(0x185)](_0x498a2f);_0xe30116[_0x22abca(0xad)]?.({'type':_0x22abca(0x84),'folder':_0x4a78ea});const _0x2379cb={'name':_0x175874,'parentFolderId':_0x3b1475},_0x5a60cc=await _0xe30116['withProgress'](_0x22abca(0xc8)+_0x4a78ea+_0x22abca(0xbb),()=>_0x5823ad[_0x22abca(0xf2)][_0x22abca(0xe5)](_0xbb0ce8[_0x22abca(0xee)],_0x2379cb));_0x3a6d6d[_0x22abca(0x156)](_0x4a78ea,_0x5a60cc[_0x22abca(0x149)]['id']),_0xe30116['onProgress']?.({'type':_0x22abca(0xdc),'folder':_0x4a78ea,'folderId':_0x5a60cc[_0x22abca(0x149)]['id']}),_0xe30116[_0x22abca(0x11f)]?.(_0x22abca(0x12e)+_0x4a78ea+'\x27');}return _0x3a6d6d;}export async function executePushSegmentDeletions(_0x4a58ba,_0x3ddc1f,_0x93602e){const _0x905e62=a142_0x5a51;if(_0x3ddc1f[_0x905e62(0xec)]===0x0)return 0x0;const {batchAsync:_0x50cf31}=await import(_0x905e62(0x85)),_0x2202f6=0x5,_0x222128=await _0x50cf31(_0x3ddc1f,async _0x2b4f76=>{const _0x546eed=_0x905e62;return _0x93602e['onProgress']?.({'type':_0x546eed(0xe2),'name':_0x2b4f76[_0x546eed(0x8c)]}),await _0x4a58ba[_0x546eed(0xf2)][_0x546eed(0xa5)](_0x2b4f76['id']),_0x93602e[_0x546eed(0xad)]?.({'type':'segment_deleted','name':_0x2b4f76[_0x546eed(0x8c)]}),_0x93602e[_0x546eed(0x104)]?.(_0x546eed(0x122)+_0x2b4f76['name']+'\x27'),0x1;},_0x2202f6);return _0x222128[_0x905e62(0xbe)]((_0x1d13bc,_0x23ebfd)=>_0x1d13bc+_0x23ebfd,0x0);}export async function executePushJourneys(_0x374b39,_0x4c99fd,_0xe769aa,_0x3716d5,_0x59369c){const _0x1dcab4=a142_0x5a51,{journeyDefToRequest:_0xacad6d}=await import(_0x1dcab4(0x114)),{activationDefToCreateRequest:_0x226d0c,yamlRuleToApi:_0x4493b3,validateSegmentRule:_0x1db275}=await import('./child-segment-yaml.js'),_0x57c0a6={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4275a0=new Map(_0xe769aa['segmentNameToId']),_0x104a3e=0x5;for(let _0x8c8d38=0x0;_0x8c8d38<_0x4c99fd['length'];_0x8c8d38+=_0x104a3e){const _0x4b85ac=_0x4c99fd[_0x1dcab4(0xf6)](_0x8c8d38,_0x8c8d38+_0x104a3e),_0x3e9efa=await Promise[_0x1dcab4(0x126)](_0x4b85ac[_0x1dcab4(0xc1)](async _0x401e0e=>{const _0x1fc850=_0x1dcab4;if(!_0x401e0e[_0x1fc850(0x89)]&&!_0x401e0e[_0x1fc850(0xe3)])return{'action':_0x1fc850(0xe8),'name':_0x401e0e[_0x1fc850(0x124)]['name'],'journeyId':_0x401e0e[_0x1fc850(0x139)]?.['id']};const _0x209361=_0x401e0e[_0x1fc850(0x107)]?_0xe769aa[_0x1fc850(0x116)]['get'](_0x401e0e[_0x1fc850(0x107)]):undefined;_0x59369c[_0x1fc850(0xad)]?.({'type':_0x401e0e[_0x1fc850(0x89)]?_0x1fc850(0x14b):'journey_updating','name':_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]});try{const _0x77a589=await executeSingleJourneyPush(_0x374b39,_0x401e0e,{..._0xe769aa,'segmentNameToId':_0x4275a0},{'parentId':_0x3716d5[_0x1fc850(0xee)],'rootFolderId':_0x3716d5['rootFolderId'],'folderId':_0x209361,'verbose':_0x3716d5[_0x1fc850(0x153)]},_0x59369c,{'journeyDefToRequest':_0xacad6d,'activationDefToCreateRequest':_0x226d0c,'yamlRuleToApi':_0x4493b3,'validateSegmentRule':_0x1db275});for(const [_0x3c16ba,_0x356448]of _0x77a589['embeddedSegmentNameToId']){_0x4275a0['set'](_0x3c16ba,_0x356448),_0x57c0a6[_0x1fc850(0xaf)][_0x1fc850(0x156)](_0x3c16ba,_0x356448);}if(_0x77a589[_0x1fc850(0xae)]==='created')_0x59369c[_0x1fc850(0xad)]?.({'type':_0x1fc850(0xac),'name':_0x401e0e['yamlConfig'][_0x1fc850(0x8c)],'journeyId':_0x77a589[_0x1fc850(0xaa)]}),_0x59369c['logSuccess']?.(_0x1fc850(0x150)+_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]+'\x27'),_0x57c0a6[_0x1fc850(0xa8)]++;else _0x77a589[_0x1fc850(0xae)]===_0x1fc850(0xde)&&(_0x59369c[_0x1fc850(0xad)]?.({'type':'journey_updated','name':_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]}),_0x59369c[_0x1fc850(0x11d)]?.('Updated\x20journey\x20\x27'+_0x401e0e['yamlConfig'][_0x1fc850(0x8c)]+'\x27'),_0x57c0a6[_0x1fc850(0xde)]++);return{'action':_0x77a589[_0x1fc850(0xae)],'name':_0x401e0e[_0x1fc850(0x124)][_0x1fc850(0x8c)],'journeyId':_0x77a589['journeyId']};}catch(_0x5a0f12){const _0x5233e1=isHttp400Error(_0x5a0f12),_0x20ed45=_0x5233e1?ErrorCode[_0x1fc850(0xda)]:ErrorCode[_0x1fc850(0x8a)],_0x445cd9=getErrorMessage(_0x5a0f12);throw new SDKError(_0x20ed45,_0x1fc850(0xed)+(_0x401e0e['isNew']?_0x1fc850(0x143):_0x1fc850(0x17b))+_0x1fc850(0x145)+_0x401e0e[_0x1fc850(0x120)]+_0x1fc850(0xc4)+_0x445cd9,_0x5a0f12);}}));_0x57c0a6[_0x1dcab4(0x121)][_0x1dcab4(0x173)](..._0x3e9efa);}return _0x57c0a6;}async function matchExistingJourneySegments(_0x74815d,_0x5db306,_0x5b055e,_0x42805d,_0x403a3b){const _0x27df41=a142_0x5a51;if(!_0x5db306['existingJourney']||!_0x5db306[_0x27df41(0x124)][_0x27df41(0xd4)])return;const _0x1a4b8c=new Map(),_0x2d54c1=new Set();for(const _0x3dda6a of Object['keys'](_0x5db306['yamlConfig'][_0x27df41(0xd4)])){const _0x48e40a=generateDeterministicJourneySegmentName(_0x5db306[_0x27df41(0x124)][_0x27df41(0x8c)],_0x3dda6a);_0x1a4b8c['set'](_0x48e40a,_0x3dda6a),_0x2d54c1[_0x27df41(0x154)](_0x3dda6a);}const _0x3675bd=[],_0x228460=collectSegmentIdsFromJourneyApi(_0x5db306[_0x27df41(0x139)]);for(const _0x5922b7 of _0x228460){const _0x218706=await fetchSegment(_0x74815d,_0x5b055e,_0x5922b7,_0x42805d);if(!_0x218706?.['name'])continue;const _0x8fa2a7=_0x1a4b8c[_0x27df41(0x185)](_0x218706[_0x27df41(0x8c)]);_0x8fa2a7?(_0x403a3b[_0x27df41(0x156)](_0x8fa2a7,_0x5922b7),_0x2d54c1[_0x27df41(0x105)](_0x8fa2a7)):_0x3675bd[_0x27df41(0x173)]({'id':_0x5922b7,'seg':_0x218706});}if(_0x2d54c1[_0x27df41(0x102)]>0x0&&_0x3675bd[_0x27df41(0xec)]>0x0){const {localExpandedRuleToNames:_0x4d77bf}=buildLocalExpandedRuleMappings(_0x5db306[_0x27df41(0x124)]),_0x1c9afa=new Map();for(const {id:_0x22b212,seg:_0x2bea31}of _0x3675bd){if(_0x2bea31['rule']){const _0x4be6c4=apiRuleToYaml(_0x2bea31[_0x27df41(0x176)]);_0x1c9afa[_0x27df41(0x156)](_0x22b212,_0x4be6c4);}}for(const {id:_0x3c27e8,seg:_0x30cd7a}of _0x3675bd){if(!_0x30cd7a['rule'])continue;const _0x9d1d0=_0x1c9afa[_0x27df41(0x185)](_0x3c27e8);if(!_0x9d1d0)continue;const _0x1df3dd=serializeExpandedRule(_0x9d1d0,_0x1c9afa),_0x7bcc41=_0x4d77bf[_0x27df41(0x185)](_0x1df3dd);if(_0x7bcc41){const _0x290145=_0x7bcc41[_0x27df41(0x16c)](_0x1c1f0c=>_0x2d54c1['has'](_0x1c1f0c));_0x290145&&(_0x403a3b[_0x27df41(0x156)](_0x290145,_0x3c27e8),_0x2d54c1[_0x27df41(0x105)](_0x290145),logger[_0x27df41(0x186)](_0x27df41(0xe0)+_0x30cd7a[_0x27df41(0x8c)]+_0x27df41(0xc0)+_0x290145+_0x27df41(0xab)));}}}}async function executeSingleJourneyPush(_0x11b996,_0x588fcf,_0x4c0641,_0x4a44b2,_0x36f362,_0x43fd61){const _0x26112f=a142_0x5a51,{journeyDefToRequest:_0x4a88a3,activationDefToCreateRequest:_0x3383bb,yamlRuleToApi:_0x24972a,validateSegmentRule:_0x2249b8}=_0x43fd61,_0x4ba5bb=new Map(),_0x478422=new Map();recoverSegmentIdsFromPushRecovery(_0x588fcf,_0x4ba5bb,_0x4c0641[_0x26112f(0x151)]);const _0x50b447=new Map(),_0xcc2a49=new Map(),_0x49b72c=new Map();let _0x437b68;const _0x5b206b=async()=>{const _0x15eec0=_0x26112f;if(_0x437b68)return;_0x437b68=new Map();if(!_0x588fcf[_0x15eec0(0x139)])return;const _0x466a97=await _0x11b996[_0x15eec0(0x164)]['listActivations'](_0x588fcf[_0x15eec0(0x139)]['id']);for(const _0x2f062f of _0x466a97){const _0x5689a5=journeyActivationStepToYaml(_0x2f062f,_0x4c0641[_0x15eec0(0x17a)],_0x4c0641[_0x15eec0(0x135)]),_0x8e79c3=activationSignature(_0x5689a5);!_0x437b68[_0x15eec0(0xd3)](_0x8e79c3)&&_0x437b68[_0x15eec0(0x156)](_0x8e79c3,_0x2f062f['id']),_0x5689a5[_0x15eec0(0x8c)]&&_0x478422[_0x15eec0(0x156)](_0x5689a5[_0x15eec0(0x8c)],_0x2f062f['id']);}};await matchExistingJourneySegments(_0x11b996,_0x588fcf,_0x4a44b2['parentId'],_0x4c0641[_0x26112f(0x17f)],_0x4c0641[_0x26112f(0x151)]);const _0x47ca1c={'resolveSegmentId':async _0x433f99=>{const _0x5e02ee=_0x26112f,_0x2550ca=_0x4c0641[_0x5e02ee(0x151)][_0x5e02ee(0x185)](_0x433f99);if(!_0x2550ca)throw new SDKError(ErrorCode[_0x5e02ee(0xe6)],_0x5e02ee(0xf5)+_0x433f99+_0x5e02ee(0x172)+_0x588fcf['yamlConfig'][_0x5e02ee(0x8c)]+')');return _0x2550ca;},'resolveEmbeddedSegmentId':async(_0x474dbb,_0x11956b)=>{const _0x580e65=_0x26112f,_0x201941=_0x4c0641['segmentNameToId'][_0x580e65(0x185)](_0x474dbb);if(_0x201941)return _0x201941;const _0x143213=_0x4c0641[_0x580e65(0x17f)][_0x580e65(0x16c)](_0x3215f0=>_0x3215f0[_0x580e65(0x8c)]===_0x474dbb);if(_0x143213)return _0x4c0641['segmentNameToId'][_0x580e65(0x156)](_0x474dbb,_0x143213['id']),_0x143213['id'];if(_0x588fcf[_0x580e65(0x89)]){const {stageName:_0x3174f8,criteriaName:_0x511c89}=findSegmentCriteriaLocation(_0x588fcf[_0x580e65(0x124)],_0x474dbb);return _0x2249b8(_0x474dbb,_0x11956b['rule']),_0xcc2a49['set'](_0x474dbb,{'definition':_0x11956b,'stageName':_0x3174f8,'criteriaName':_0x511c89}),createPendingSegmentId(_0x474dbb);}const _0x5df5bd=_0x588fcf['existingJourney']?.['id'];if(!_0x5df5bd)throw new SDKError(ErrorCode[_0x580e65(0x9b)],_0x580e65(0x110));const _0x2fe73e=_0x50b447[_0x580e65(0x185)](_0x474dbb);if(_0x2fe73e)return _0x2fe73e;const _0xaf086d=((async()=>{const _0x2dcfa6=_0x580e65;_0x2249b8(_0x474dbb,_0x11956b[_0x2dcfa6(0x176)]);const _0x59e090=generateDeterministicJourneySegmentName(_0x588fcf[_0x2dcfa6(0x124)][_0x2dcfa6(0x8c)],_0x474dbb),_0x371c53=_0x4c0641[_0x2dcfa6(0x17f)]['find'](_0x2d7ec0=>_0x2d7ec0[_0x2dcfa6(0x8c)]===_0x59e090),_0x26515b=createSegmentIdResolver(_0x4c0641['segmentNameToId'],_0x474dbb),_0x347543=await resolveRuleSegmentIds(_0x11956b[_0x2dcfa6(0x176)],_0x26515b);let _0x53f471;return _0x371c53?(await _0x11b996[_0x2dcfa6(0xf2)][_0x2dcfa6(0x10c)](_0x4a44b2['parentId'],_0x371c53['id'],{'description':_0x11956b[_0x2dcfa6(0x167)]||_0x2dcfa6(0x127)+_0x474dbb,'rule':_0x24972a(_0x347543,!![]),'countPopulation':!![]}),_0x53f471=_0x371c53['id'],saveSegmentToPushRecovery(_0x588fcf[_0x2dcfa6(0x120)],_0x588fcf['yamlConfig']['name'],_0x474dbb,{'segmentId':_0x53f471,'uniqueServerName':_0x59e090,'createdAt':new Date()[_0x2dcfa6(0x137)]()})):_0x53f471=await createOrRecoverEmbeddedSegment(_0x11b996,_0x588fcf,{'localName':_0x474dbb,'uniqueSegmentName':_0x59e090,'description':_0x11956b[_0x2dcfa6(0x167)]||_0x2dcfa6(0x127)+_0x474dbb,'journeyId':_0x5df5bd,'resolvedRule':_0x347543,'parentId':_0x4a44b2[_0x2dcfa6(0xee)],'folderId':_0x4a44b2[_0x2dcfa6(0x112)]||''},_0x24972a),_0x4c0641[_0x2dcfa6(0x151)][_0x2dcfa6(0x156)](_0x474dbb,_0x53f471),_0x4ba5bb[_0x2dcfa6(0x156)](_0x474dbb,_0x53f471),_0x53f471;})());_0x50b447[_0x580e65(0x156)](_0x474dbb,_0xaf086d);try{return await _0xaf086d;}finally{_0x50b447[_0x580e65(0x105)](_0x474dbb);}},'resolveActivationId':async _0x729138=>{const _0x160275=_0x26112f,_0x32456b=_0x478422[_0x160275(0x185)](_0x729138);if(_0x32456b)return _0x32456b;if(_0x588fcf['existingJourney']){await _0x5b206b();const _0x10301a=_0x478422[_0x160275(0x185)](_0x729138);if(_0x10301a)return _0x10301a;}throw new SDKError(ErrorCode[_0x160275(0x8e)],_0x160275(0xfa)+_0x729138+_0x160275(0x172)+_0x588fcf[_0x160275(0x124)][_0x160275(0x8c)]+_0x160275(0x90)+_0x160275(0xce));},'resolveEmbeddedActivationId':async(_0x268af6,_0x1317d1)=>{const _0x5646b7=_0x26112f,_0x279821=_0x478422[_0x5646b7(0x185)](_0x268af6);if(_0x279821)return _0x279821;if(_0x588fcf[_0x5646b7(0x89)])return _0x49b72c[_0x5646b7(0x156)](_0x268af6,_0x1317d1),createPendingActivationId(_0x268af6);if(_0x588fcf[_0x5646b7(0x139)]){await _0x5b206b();const _0x3c5596=_0x478422[_0x5646b7(0x185)](_0x1317d1[_0x5646b7(0x8c)]);if(_0x3c5596)return _0x478422[_0x5646b7(0x156)](_0x268af6,_0x3c5596),_0x3c5596;const _0x374413=activationSignature(_0x1317d1),_0x308c8d=_0x437b68?.[_0x5646b7(0x185)](_0x374413);if(_0x308c8d)return _0x478422[_0x5646b7(0x156)](_0x268af6,_0x308c8d),_0x308c8d;const _0x1b6cf0=await _0x3383bb(_0x1317d1,_0x4c0641[_0x5646b7(0x86)]),_0x1f1913={..._0x1b6cf0,..._0x1317d1['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1317d1[_0x5646b7(0xa6)]}},_0x530e28=await _0x11b996[_0x5646b7(0x164)]['createActivation'](_0x588fcf[_0x5646b7(0x139)]['id'],_0x1f1913);return _0x478422['set'](_0x268af6,_0x530e28['id']),_0x530e28['id'];}throw new SDKError(ErrorCode[_0x5646b7(0x9b)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x41dcc5=>{const _0x1c1e5e=_0x26112f;try{return await _0x11b996['journey'][_0x1c1e5e(0xfc)](_0x4a44b2[_0x1c1e5e(0xee)],_0x41dcc5);}catch(_0x5c1648){throw new SDKError(ErrorCode['NOT_FOUND'],_0x1c1e5e(0x159)+_0x41dcc5+_0x1c1e5e(0xb7)+_0x588fcf[_0x1c1e5e(0x124)][_0x1c1e5e(0x8c)]+'\x27)',_0x5c1648);}},'resolveStageId':async(_0xedeb39,_0x27be53)=>{const _0x42ce19=_0x26112f,_0x66d144=await _0x11b996[_0x42ce19(0x164)]['getJourney'](_0xedeb39),_0x2b1fb9=_0x66d144[_0x42ce19(0xc6)]['journeyStages'][_0x42ce19(0x16c)](_0x4af592=>_0x4af592[_0x42ce19(0x8c)][_0x42ce19(0x16e)]()===_0x27be53['toLowerCase']());if(!_0x2b1fb9?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x27be53+_0x42ce19(0xe1)+(_0x66d144[_0x42ce19(0xc6)][_0x42ce19(0xd1)]||_0x66d144[_0x42ce19(0xc6)][_0x42ce19(0x8c)])+'\x27');return _0x2b1fb9['id'];}},_0x56ca37=await _0x4a88a3(_0x588fcf[_0x26112f(0x124)],_0x4a44b2['parentId'],_0x47ca1c),_0xb8a67=_0x4a44b2['folderId']||_0x4a44b2[_0x26112f(0x112)];_0xb8a67&&(_0x56ca37[_0x26112f(0x163)]={'parentFolder':{'data':{'id':_0xb8a67,'type':_0x26112f(0x96)}}});if(_0x588fcf[_0x26112f(0x89)]){if(_0xcc2a49['size']>0x0||_0x49b72c[_0x26112f(0x102)]>0x0)return await executeThreeStepJourneyCreate(_0x11b996,_0x588fcf,_0x56ca37,{'pendingEmbeddedSegments':_0xcc2a49,'pendingEmbeddedActivations':_0x49b72c,'embeddedSegmentNameToId':_0x4ba5bb,'journeyActivationNameToId':_0x478422},{..._0x4a44b2,'effectiveFolderId':_0xb8a67},_0x4c0641,_0x36f362,_0x43fd61);else{ensureJourneyDefaults(_0x56ca37[_0x26112f(0xc6)]);const _0x4a7bec=await _0x11b996['journey'][_0x26112f(0x143)](_0x56ca37);return deletePushRecovery(_0x588fcf['absolutePath']),{'action':_0x26112f(0xa8),'journeyId':_0x4a7bec['id'],'embeddedSegmentNameToId':_0x4ba5bb};}}else{if(_0x588fcf[_0x26112f(0xe3)]&&_0x588fcf[_0x26112f(0x139)]){_0x56ca37['id']=_0x588fcf[_0x26112f(0x139)]['id'];const _0x3ecd98=_0x56ca37[_0x26112f(0xc6)];_0x588fcf[_0x26112f(0x139)]['attributes']?.[_0x26112f(0xd1)]&&(_0x3ecd98['journeyBundleName']=_0x588fcf[_0x26112f(0x139)][_0x26112f(0xc6)]['journeyBundleName']);const _0xf829d3=_0x588fcf[_0x26112f(0x139)][_0x26112f(0xc6)]?.[_0x26112f(0x15f)];return _0xf829d3&&_0x56ca37[_0x26112f(0xc6)][_0x26112f(0x15f)]&&injectExistingStageIds(_0x56ca37[_0x26112f(0xc6)][_0x26112f(0x15f)],_0xf829d3),ensureJourneyDefaults(_0x3ecd98),await _0x11b996[_0x26112f(0x164)]['update'](_0x588fcf[_0x26112f(0x139)]['id'],_0x56ca37),deletePushRecovery(_0x588fcf[_0x26112f(0x120)]),{'action':_0x26112f(0xde),'journeyId':_0x588fcf['existingJourney']['id'],'embeddedSegmentNameToId':_0x4ba5bb};}}return deletePushRecovery(_0x588fcf[_0x26112f(0x120)]),{'action':_0x26112f(0xe8),'journeyId':_0x588fcf[_0x26112f(0x139)]?.['id'],'embeddedSegmentNameToId':_0x4ba5bb};}function findSegmentCriteriaLocation(_0xa05284,_0x4d80b6){const _0x467053=a142_0x5a51,_0x10a0b5=_0xa05284[_0x467053(0x125)]||_0xa05284['journeys']?.[0x0]?.['stages']||[];let _0x278943=_0x467053(0xb0),_0x5f4b66=_0x4d80b6;const _0x2687f0=_0xa05284[_0x467053(0x9c)]||_0xa05284[_0x467053(0x14a)]?.[0x0]?.[_0x467053(0x9c)];if(_0x2687f0?.[_0x467053(0xf2)]===_0x4d80b6)return{'stageName':'goal','criteriaName':_0x2687f0[_0x467053(0x8c)]||_0x4d80b6};_0x3aa711:for(const _0x2906f9 of _0x10a0b5){if(_0x2906f9[_0x467053(0x13d)]?.['segment']===_0x4d80b6){_0x278943=_0x2906f9[_0x467053(0x8c)],_0x5f4b66=_0x2906f9['entry_criteria'][_0x467053(0x8c)]||_0x4d80b6;break;}if(_0x2906f9[_0x467053(0xba)])for(const _0x18cb51 of _0x2906f9[_0x467053(0xba)]){if(_0x18cb51[_0x467053(0xa2)]===_0x467053(0x184)&&_0x18cb51[_0x467053(0x175)]?.[_0x467053(0x187)])for(const _0x475ee1 of _0x18cb51['with'][_0x467053(0x187)]){if(_0x475ee1['segment']===_0x4d80b6){_0x278943=_0x2906f9[_0x467053(0x8c)],_0x5f4b66=_0x475ee1[_0x467053(0x8c)]||_0x4d80b6;break _0x3aa711;}}}}return{'stageName':_0x278943,'criteriaName':_0x5f4b66};}async function executeThreeStepJourneyCreate(_0x45f174,_0x44a949,_0x36f202,_0x21a199,_0x5c2421,_0x339f34,_0x263009,_0x44fffa){const _0x1d3fda=a142_0x5a51,{activationDefToCreateRequest:_0x446727,yamlRuleToApi:_0x47037d}=_0x44fffa,{pendingEmbeddedSegments:_0x4f7dba,pendingEmbeddedActivations:_0xcb41,embeddedSegmentNameToId:_0x3c12c7}=_0x21a199,_0x34f306=JSON[_0x1d3fda(0xc3)](JSON[_0x1d3fda(0x183)](_0x36f202));ensureJourneyDefaults(_0x34f306['attributes']),stripPendingIds(_0x34f306);const _0x2049b9=await _0x45f174[_0x1d3fda(0x164)][_0x1d3fda(0x143)](_0x34f306),_0x5394bd=_0x2049b9['id'],_0x3b179d=new Map();for(const _0x2a3cd7 of _0x2049b9[_0x1d3fda(0xc6)]['journeyStages']){_0x3b179d[_0x1d3fda(0x156)](_0x2a3cd7[_0x1d3fda(0x8c)][_0x1d3fda(0x16e)](),_0x2a3cd7['id']);}recoverSegmentIdsFromPushRecovery(_0x44a949,_0x3c12c7,_0x339f34[_0x1d3fda(0x151)]);for(const [_0x117703,{definition:_0x2ccd49}]of _0x4f7dba){if(_0x3c12c7[_0x1d3fda(0xd3)](_0x117703)){_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0xa7),'journeyName':_0x44a949[_0x1d3fda(0x124)]['name'],'segmentName':_0x117703});continue;}const _0x355150=generateDeterministicJourneySegmentName(_0x44a949['yamlConfig']['name'],_0x117703);_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0x16a),'journeyName':_0x44a949[_0x1d3fda(0x124)][_0x1d3fda(0x8c)],'segmentName':_0x117703});const _0x31089=createSegmentIdResolver(_0x339f34[_0x1d3fda(0x151)],_0x117703),_0x2fd1f1=await resolveRuleSegmentIds(_0x2ccd49['rule'],_0x31089),_0x1cbe96=await createOrRecoverEmbeddedSegment(_0x45f174,_0x44a949,{'localName':_0x117703,'uniqueSegmentName':_0x355150,'description':_0x2ccd49[_0x1d3fda(0x167)]||_0x1d3fda(0x127)+_0x117703,'journeyId':_0x5394bd,'resolvedRule':_0x2fd1f1,'parentId':_0x5c2421[_0x1d3fda(0xee)],'folderId':_0x5c2421[_0x1d3fda(0x88)]||''},_0x47037d);_0x3c12c7[_0x1d3fda(0x156)](_0x117703,_0x1cbe96),_0x339f34[_0x1d3fda(0x151)]['set'](_0x117703,_0x1cbe96),_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0xa7),'journeyName':_0x44a949[_0x1d3fda(0x124)]['name'],'segmentName':_0x117703});}const _0x1a2738=new Map();for(const [_0x12839a,_0x1f9b9e]of _0xcb41){_0x263009['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x44a949[_0x1d3fda(0x124)]['name'],'activationName':_0x12839a});const _0x2afd9e=await _0x446727(_0x1f9b9e,_0x339f34[_0x1d3fda(0x86)]),_0x29481a={..._0x2afd9e,..._0x1f9b9e[_0x1d3fda(0xa6)]!==undefined&&{'runAfterJourneyRefresh':_0x1f9b9e[_0x1d3fda(0xa6)]}},_0x5c26fa=await _0x45f174['journey'][_0x1d3fda(0x136)](_0x5394bd,_0x29481a);_0x1a2738['set'](_0x12839a,_0x5c26fa['id']),_0x21a199['journeyActivationNameToId'][_0x1d3fda(0x156)](_0x12839a,_0x5c26fa['id']),_0x263009[_0x1d3fda(0xad)]?.({'type':_0x1d3fda(0x99),'journeyName':_0x44a949[_0x1d3fda(0x124)][_0x1d3fda(0x8c)],'activationName':_0x12839a});}const _0x52d4d7=JSON[_0x1d3fda(0xc3)](JSON['stringify'](_0x36f202));return _0x52d4d7['id']=_0x5394bd,ensureJourneyDefaults(_0x52d4d7[_0x1d3fda(0xc6)]),resolvePendingIdsInRequest(_0x52d4d7,_0x36f202,_0x3b179d,_0x3c12c7,_0x1a2738,_0x263009),await _0x45f174[_0x1d3fda(0x164)]['update'](_0x5394bd,_0x52d4d7),deletePushRecovery(_0x44a949[_0x1d3fda(0x120)]),{'action':_0x1d3fda(0xa8),'journeyId':_0x5394bd,'embeddedSegmentNameToId':_0x3c12c7};}export function stripWaitStepPendingIds(_0xde265b){const _0x3daa0b=a142_0x5a51,_0x3a4a4d=_0xde265b[_0x3daa0b(0x138)]&&isPendingSegmentId(_0xde265b[_0x3daa0b(0x138)]),_0x5df801=_0xde265b['conditions']?.[_0x3daa0b(0xc2)](_0x2936b0=>_0x2936b0[_0x3daa0b(0x95)]&&isPendingSegmentId(_0x2936b0[_0x3daa0b(0x95)]));(_0x3a4a4d||_0x5df801)&&(_0xde265b[_0x3daa0b(0x123)]='Duration',_0xde265b[_0x3daa0b(0x177)]=0x1,_0xde265b['waitStepUnit']=_0x3daa0b(0xf7),delete _0xde265b[_0x3daa0b(0x138)],delete _0xde265b['conditionTimeoutDuration'],delete _0xde265b['conditionTimeoutUnit'],delete _0xde265b[_0x3daa0b(0x108)]);}export function resolveWaitStepPendingIds(_0x1fcf0a,_0x562c46,_0xd9db44,_0x1056fa){const _0x528945=a142_0x5a51;if(_0x562c46[_0x528945(0x138)]&&isPendingSegmentId(_0x562c46['conditionSegmentId'])){const _0x4c2d90=_0xd9db44(_0x562c46[_0x528945(0x138)],_0x528945(0x15b)+_0x1056fa+_0x528945(0xe7));_0x4c2d90&&(_0x1fcf0a['waitStepType']='Condition',_0x1fcf0a[_0x528945(0x138)]=_0x4c2d90,delete _0x1fcf0a[_0x528945(0x177)],delete _0x1fcf0a[_0x528945(0x103)],_0x562c46[_0x528945(0xf0)]!==undefined&&(_0x1fcf0a[_0x528945(0xf0)]=_0x562c46['conditionTimeoutDuration']),_0x562c46[_0x528945(0x171)]&&(_0x1fcf0a[_0x528945(0x171)]=_0x562c46[_0x528945(0x171)]));}if(_0x562c46[_0x528945(0x108)]){const _0x136e33=_0x562c46[_0x528945(0x108)][_0x528945(0xc2)](_0x1c2b2a=>_0x1c2b2a[_0x528945(0x95)]&&isPendingSegmentId(_0x1c2b2a[_0x528945(0x95)]));if(_0x136e33){const _0x5aaab7=_0x562c46[_0x528945(0x108)]['map'](_0x22bb31=>{const _0x25764d=_0x528945;if(_0x22bb31[_0x25764d(0x95)]&&isPendingSegmentId(_0x22bb31['segmentId'])){const _0x7301b7=_0xd9db44(_0x22bb31[_0x25764d(0x95)],'stage\x20\x27'+_0x1056fa+'\x27\x20wait\x20condition');return{..._0x22bb31,'segmentId':_0x7301b7||_0x22bb31[_0x25764d(0x95)]};}return{..._0x22bb31};});_0x1fcf0a[_0x528945(0x123)]=_0x528945(0x13b),_0x1fcf0a[_0x528945(0x108)]=_0x5aaab7,delete _0x1fcf0a['waitStep'],delete _0x1fcf0a[_0x528945(0x103)],delete _0x1fcf0a['conditionSegmentId'],delete _0x1fcf0a[_0x528945(0xf0)],delete _0x1fcf0a['conditionTimeoutUnit'];}}}function stripPendingIds(_0x1ef132){const _0x2a9a68=a142_0x5a51;_0x1ef132[_0x2a9a68(0xc6)][_0x2a9a68(0x9c)]?.[_0x2a9a68(0x95)]&&isPendingSegmentId(_0x1ef132['attributes']['goal'][_0x2a9a68(0x95)])&&delete _0x1ef132[_0x2a9a68(0xc6)]['goal'];for(const _0x509508 of _0x1ef132['attributes']['journeyStages']||[]){_0x509508[_0x2a9a68(0x101)]?.['segmentId']&&isPendingSegmentId(_0x509508[_0x2a9a68(0x101)][_0x2a9a68(0x95)])&&delete _0x509508[_0x2a9a68(0x101)];_0x509508[_0x2a9a68(0xeb)]?.['segmentId']&&isPendingSegmentId(_0x509508[_0x2a9a68(0xeb)][_0x2a9a68(0x95)])&&delete _0x509508[_0x2a9a68(0xeb)];_0x509508[_0x2a9a68(0x168)]&&(_0x509508[_0x2a9a68(0x168)]=_0x509508[_0x2a9a68(0x168)]['filter'](_0x4bde94=>!_0x4bde94[_0x2a9a68(0x95)]||!isPendingSegmentId(_0x4bde94[_0x2a9a68(0x95)])));if(_0x509508[_0x2a9a68(0xba)])for(const _0x97d2e6 of Object[_0x2a9a68(0x10b)](_0x509508[_0x2a9a68(0xba)])){const _0x38c671=_0x509508[_0x2a9a68(0xba)][_0x97d2e6];_0x38c671[_0x2a9a68(0xa2)]===_0x2a9a68(0x178)&&_0x38c671[_0x2a9a68(0x11a)]&&isPendingActivationId(_0x38c671[_0x2a9a68(0x11a)])&&(_0x38c671['journeyActivationStepId']='');if(_0x38c671['type']===_0x2a9a68(0x10a)&&_0x38c671[_0x2a9a68(0x187)])for(const _0x597c66 of _0x38c671['branches']){_0x597c66[_0x2a9a68(0x95)]&&isPendingSegmentId(_0x597c66[_0x2a9a68(0x95)])&&(_0x597c66[_0x2a9a68(0x95)]='');}_0x38c671[_0x2a9a68(0xa2)]===_0x2a9a68(0x148)&&stripWaitStepPendingIds(_0x38c671);}}}function resolvePendingIdsInRequest(_0x410094,_0x5045bb,_0xc301b,_0xba1dd9,_0x3685a5,_0x30c072){const _0x27f3fb=a142_0x5a51,_0x9f1589=(_0x16815f,_0x5d9b8c)=>{const _0x519601=a142_0x42c6;if(!isPendingSegmentId(_0x16815f))return _0x16815f;const _0x572cb9=extractPendingSegmentName(_0x16815f),_0x52d497=_0xba1dd9[_0x519601(0x185)](_0x572cb9);return!_0x52d497&&_0x30c072[_0x519601(0xbc)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x572cb9+_0x519601(0xd2)+_0x5d9b8c),_0x52d497;};if(_0x410094['attributes']['goal']?.[_0x27f3fb(0x95)]&&isPendingSegmentId(_0x410094[_0x27f3fb(0xc6)]['goal'][_0x27f3fb(0x95)])){const _0x131035=_0x9f1589(_0x410094[_0x27f3fb(0xc6)]['goal'][_0x27f3fb(0x95)],_0x27f3fb(0x144));_0x131035&&(_0x410094[_0x27f3fb(0xc6)]['goal'][_0x27f3fb(0x95)]=_0x131035);}for(const _0x1593f1 of _0x410094[_0x27f3fb(0xc6)][_0x27f3fb(0x15f)]||[]){const _0x3448c0=_0xc301b[_0x27f3fb(0x185)](_0x1593f1[_0x27f3fb(0x8c)][_0x27f3fb(0x16e)]());_0x3448c0&&(_0x1593f1['id']=_0x3448c0);if(_0x1593f1[_0x27f3fb(0x101)]?.[_0x27f3fb(0x95)]&&isPendingSegmentId(_0x1593f1[_0x27f3fb(0x101)]['segmentId'])){const _0x4ffae4=_0x9f1589(_0x1593f1['entryCriteria'][_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1[_0x27f3fb(0x8c)]+_0x27f3fb(0xc9));_0x4ffae4&&(_0x1593f1[_0x27f3fb(0x101)][_0x27f3fb(0x95)]=_0x4ffae4);}if(_0x1593f1[_0x27f3fb(0x168)])for(const _0x424150 of _0x1593f1[_0x27f3fb(0x168)]){if(_0x424150['segmentId']&&isPendingSegmentId(_0x424150['segmentId'])){const _0x569de2=_0x9f1589(_0x424150[_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1['name']+_0x27f3fb(0xb4));_0x569de2&&(_0x424150['segmentId']=_0x569de2);}}if(_0x1593f1['milestone']?.['segmentId']&&isPendingSegmentId(_0x1593f1[_0x27f3fb(0xeb)]['segmentId'])){const _0xe8358b=_0x9f1589(_0x1593f1[_0x27f3fb(0xeb)][_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1[_0x27f3fb(0x8c)]+'\x27\x20milestone');_0xe8358b&&(_0x1593f1[_0x27f3fb(0xeb)]['segmentId']=_0xe8358b);}if(_0x1593f1[_0x27f3fb(0xba)]){const _0x4d78cf=_0x149100=>_0x5045bb['attributes'][_0x27f3fb(0x15f)]?.[_0x27f3fb(0x16c)](_0x47de85=>_0x47de85[_0x27f3fb(0x8c)][_0x27f3fb(0x16e)]()===_0x1593f1[_0x27f3fb(0x8c)][_0x27f3fb(0x16e)]())?.[_0x27f3fb(0xba)]?.[_0x149100];for(const _0x10920b of Object[_0x27f3fb(0x10b)](_0x1593f1[_0x27f3fb(0xba)])){const _0x844122=_0x1593f1[_0x27f3fb(0xba)][_0x10920b],_0x1ae0cb=_0x4d78cf(_0x10920b);if(_0x844122[_0x27f3fb(0xa2)]===_0x27f3fb(0x178)&&_0x844122[_0x27f3fb(0x11a)]&&(isPendingActivationId(_0x844122[_0x27f3fb(0x11a)])||_0x844122[_0x27f3fb(0x11a)]==='')){if(_0x1ae0cb?.['journeyActivationStepId']&&isPendingActivationId(_0x1ae0cb[_0x27f3fb(0x11a)])){const _0x4d9f18=extractPendingActivationName(_0x1ae0cb[_0x27f3fb(0x11a)]),_0x13dfea=_0x3685a5[_0x27f3fb(0x185)](_0x4d9f18);_0x13dfea&&(_0x844122[_0x27f3fb(0x11a)]=_0x13dfea);}}if(_0x844122[_0x27f3fb(0xa2)]===_0x27f3fb(0x10a)&&_0x844122[_0x27f3fb(0x187)]&&_0x1ae0cb?.[_0x27f3fb(0x187)])for(let _0x40986f=0x0;_0x40986f<_0x844122[_0x27f3fb(0x187)][_0x27f3fb(0xec)];_0x40986f++){const _0x52c51d=_0x844122['branches'][_0x40986f],_0x2cf092=_0x1ae0cb[_0x27f3fb(0x187)][_0x40986f];if(_0x2cf092?.[_0x27f3fb(0x95)]&&isPendingSegmentId(_0x2cf092[_0x27f3fb(0x95)])){const _0x1b23b0=_0x9f1589(_0x2cf092[_0x27f3fb(0x95)],_0x27f3fb(0x15b)+_0x1593f1['name']+_0x27f3fb(0x117)+(_0x52c51d[_0x27f3fb(0x8c)]||_0x40986f)+'\x27');_0x1b23b0&&(_0x52c51d['segmentId']=_0x1b23b0);}}_0x844122[_0x27f3fb(0xa2)]==='WaitStep'&&_0x1ae0cb?.[_0x27f3fb(0xa2)]===_0x27f3fb(0x148)&&resolveWaitStepPendingIds(_0x844122,_0x1ae0cb,_0x9f1589,_0x1593f1[_0x27f3fb(0x8c)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x493e33,_0x417bc4){const _0x227142=a143_0x7e7f,_0x30bc57=_0x493e33();while(!![]){try{const _0x3acc85=-parseInt(_0x227142(0xc4))/0x1+-parseInt(_0x227142(0xc6))/0x2+-parseInt(_0x227142(0xc2))/0x3+parseInt(_0x227142(0xc0))/0x4+parseInt(_0x227142(0xbe))/0x5*(parseInt(_0x227142(0xb8))/0x6)+parseInt(_0x227142(0xba))/0x7+-parseInt(_0x227142(0xbf))/0x8*(-parseInt(_0x227142(0xc3))/0x9);if(_0x3acc85===_0x417bc4)break;else _0x30bc57['push'](_0x30bc57['shift']());}catch(_0x476399){_0x30bc57['push'](_0x30bc57['shift']());}}}(a143_0x4c94,0x8cb9c));function a143_0x7e7f(_0x1344ee,_0x474247){_0x1344ee=_0x1344ee-0xb8;const _0x4c94fc=a143_0x4c94();let _0x7e7fb4=_0x4c94fc[_0x1344ee];return _0x7e7fb4;}export function buildFolderIdToPathMap(_0x5c8142){const _0x5bfce1=a143_0x7e7f,_0x571eeb=new Map(),_0x1397b7=new Map();for(const _0x4ca77f of _0x5c8142){_0x1397b7[_0x5bfce1(0xbb)](_0x4ca77f['id'],_0x4ca77f);}const _0x4f11b6=new Set();for(const _0x13e0f2 of _0x5c8142){!_0x13e0f2[_0x5bfce1(0xb9)]&&_0x4f11b6[_0x5bfce1(0xbc)](_0x13e0f2['id']);}function _0x3ef238(_0x91f6a9){const _0x18a4b2=_0x5bfce1;if(_0x571eeb['has'](_0x91f6a9['id']))return _0x571eeb[_0x18a4b2(0xbd)](_0x91f6a9['id']);if(_0x4f11b6[_0x18a4b2(0xc5)](_0x91f6a9['id']))return _0x571eeb[_0x18a4b2(0xbb)](_0x91f6a9['id'],''),'';if(_0x91f6a9['parentFolderId']){const _0x246715=_0x1397b7[_0x18a4b2(0xbd)](_0x91f6a9[_0x18a4b2(0xb9)]);if(_0x246715){const _0x333493=_0x3ef238(_0x246715),_0xf2bbbb=_0x333493?_0x333493+'/'+_0x91f6a9[_0x18a4b2(0xc1)]:_0x91f6a9[_0x18a4b2(0xc1)];return _0x571eeb[_0x18a4b2(0xbb)](_0x91f6a9['id'],_0xf2bbbb),_0xf2bbbb;}}const _0x16ad8e=_0x91f6a9[_0x18a4b2(0xc1)];return _0x571eeb[_0x18a4b2(0xbb)](_0x91f6a9['id'],_0x16ad8e),_0x16ad8e;}for(const _0x1d383c of _0x5c8142){_0x3ef238(_0x1d383c);}return _0x571eeb;}export function buildFolderPathToIdMap(_0xaa70b7){const _0xfea502=a143_0x7e7f,_0x57ba27=new Map(),_0x24924d=new Map();for(const _0x427945 of _0xaa70b7){_0x24924d[_0xfea502(0xbb)](_0x427945['id'],_0x427945);}const _0xa8ec05=new Set();for(const _0x10cd8a of _0xaa70b7){!_0x10cd8a[_0xfea502(0xb9)]&&_0xa8ec05['add'](_0x10cd8a['id']);}function _0x41d43a(_0xd1115b){const _0x352448=_0xfea502;if(_0xa8ec05[_0x352448(0xc5)](_0xd1115b['id']))return'';if(_0xd1115b[_0x352448(0xb9)]){const _0x12c7eb=_0x24924d[_0x352448(0xbd)](_0xd1115b['parentFolderId']);if(_0x12c7eb){const _0x2a6dcc=_0x41d43a(_0x12c7eb);return _0x2a6dcc?_0x2a6dcc+'/'+_0xd1115b[_0x352448(0xc1)]:_0xd1115b['name'];}}return _0xd1115b[_0x352448(0xc1)];}for(const _0x5c3d51 of _0xaa70b7){const _0xfc8b92=_0x41d43a(_0x5c3d51);_0x57ba27[_0xfea502(0xbb)](_0xfc8b92,_0x5c3d51['id']);}return _0x57ba27;}export function buildFolderMaps(_0x226e61){const _0x416248=buildFolderIdToPathMap(_0x226e61),_0x29b75f=new Map();for(const [_0x22b53f,_0x2d8df8]of _0x416248){_0x29b75f['set'](_0x2d8df8,_0x22b53f);}return{'idToPath':_0x416248,'pathToId':_0x29b75f};}function a143_0x4c94(){const _0x1f8b9e=['name','865458LZZgBn','1306440RoVgrl','1104788WwCYNs','has','1119212eKuxHN','26268XgjyVO','parentFolderId','4921336WTfvRO','set','add','get','730VzHgwa','8LrSMtg','4167584FeGmzw'];a143_0x4c94=function(){return _0x1f8b9e;};return a143_0x4c94();}export function getFolderPath(_0x5ef5ed,_0x2f1531){if(!_0x5ef5ed)return'';return _0x2f1531['get'](_0x5ef5ed)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x62b332,_0x979fd8){const _0x15c83c=a144_0x4e90,_0x5044e9=_0x62b332();while(!![]){try{const _0x2d2631=-parseInt(_0x15c83c(0x1a1))/0x1*(-parseInt(_0x15c83c(0x19e))/0x2)+parseInt(_0x15c83c(0x198))/0x3+parseInt(_0x15c83c(0x18a))/0x4*(-parseInt(_0x15c83c(0x185))/0x5)+parseInt(_0x15c83c(0x18c))/0x6*(-parseInt(_0x15c83c(0x17b))/0x7)+-parseInt(_0x15c83c(0x190))/0x8*(-parseInt(_0x15c83c(0x183))/0x9)+-parseInt(_0x15c83c(0x1a0))/0xa*(-parseInt(_0x15c83c(0x17e))/0xb)+parseInt(_0x15c83c(0x19a))/0xc;if(_0x2d2631===_0x979fd8)break;else _0x5044e9['push'](_0x5044e9['shift']());}catch(_0x52523a){_0x5044e9['push'](_0x5044e9['shift']());}}}(a144_0x2287,0x1f7a8));import a144_0x5df9b6 from'path';import{parse as a144_0x5a2a69}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x265fbd){const _0x4cf204=a144_0x4e90;if(!_0x265fbd||_0x265fbd[_0x4cf204(0x199)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x27e423=_0x265fbd[_0x4cf204(0x199)]();if(_0x27e423==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x265fbd};const _0x4fd8fa=_0x27e423[_0x4cf204(0x17a)]('/')?_0x27e423[_0x4cf204(0x19c)](0x1):_0x27e423,_0x222c0b=_0x4fd8fa[_0x4cf204(0x195)]('/')['filter'](_0x415177=>_0x415177!=='');if(_0x222c0b[_0x4cf204(0x184)]===0x0)throw new Error(_0x4cf204(0x1a3));const _0x5ac8df=_0x27e423[_0x4cf204(0x17a)]('/')||!isRelativePathSegment(_0x222c0b[0x0]);for(const _0x435921 of _0x222c0b){validatePathSegment(_0x435921);}return{'segments':_0x222c0b,'isAbsolute':_0x5ac8df,'raw':_0x265fbd};}function isRelativePathSegment(_0x28b84e){return _0x28b84e==='.'||_0x28b84e==='..';}function validatePathSegment(_0x1fcf3a){const _0x593223=a144_0x4e90;if(_0x1fcf3a==='')throw new Error(_0x593223(0x197));if(_0x1fcf3a==='.'||_0x1fcf3a==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x1fcf3a))throw new Error(_0x593223(0x18e)+_0x1fcf3a);if(_0x1fcf3a!==_0x1fcf3a['trim']()){}}export function validatePath(_0xf73f29){const _0x1108f1=a144_0x4e90;if(_0xf73f29[_0x1108f1(0x18d)][_0x1108f1(0x184)]===0x0&&!_0xf73f29['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0xf73f29[_0x1108f1(0x192)]){if(_0xf73f29[_0x1108f1(0x18d)][0x0]==='..')throw new Error(_0x1108f1(0x19b));let _0x5f31bf=0x0;for(const _0xd91cb8 of _0xf73f29['segments']){if(_0xd91cb8==='..'){if(_0x5f31bf===0x0)throw new Error(_0x1108f1(0x182));_0x5f31bf--;}else _0xd91cb8!=='.'&&_0x5f31bf++;}}}export function joinPaths(_0x28675a,_0x1a2ff2){const _0x38c1dc=a144_0x4e90;if(!_0x28675a||_0x28675a==='/')return _0x1a2ff2;if(!_0x1a2ff2||_0x1a2ff2==='.')return _0x28675a;if(_0x1a2ff2[_0x38c1dc(0x17a)]('/'))return _0x1a2ff2;const _0x1ac997=parsePath(_0x28675a),_0x3160f4=parsePath(_0x1a2ff2),_0x7b8b47=[..._0x1ac997['segments']];for(const _0x587d15 of _0x3160f4[_0x38c1dc(0x18d)]){if(_0x587d15==='.')continue;else{if(_0x587d15==='..'){if(_0x7b8b47[_0x38c1dc(0x184)]===0x0)throw new Error(_0x38c1dc(0x196));_0x7b8b47['pop']();}else _0x7b8b47[_0x38c1dc(0x18f)](_0x587d15);}}const _0x3c7a20=_0x7b8b47[_0x38c1dc(0x180)]('/');return _0x1ac997[_0x38c1dc(0x189)][_0x38c1dc(0x17a)]('/')?'/'+_0x3c7a20:_0x3c7a20;}function a144_0x2287(){const _0x51698b=['Cannot\x20split\x20empty\x20path','470740jEvVWg','18862Enqkaa','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','File\x20not\x20found:\x20','parent_segment','tdx.json','dirname','.yml','startsWith','3976wUpKXU','pop','slice','11QgPhQb','.yaml','join','name','Path\x20attempts\x20to\x20navigate\x20above\x20root','18lEwQHA','length','5IvpJly','relative','segment','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','raw','67724ABGHYG','exists','1758aoTBIa','segments','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','push','46264kfCKYa','endsWith','isAbsolute','resolve','readFile','split','Cannot\x20navigate\x20above\x20root','Path\x20segment\x20cannot\x20be\x20empty','71424iynzsy','trim','41988RfYoDl','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','substring','journey','24nOdCpG'];a144_0x2287=function(){return _0x51698b;};return a144_0x2287();}export function normalizePath(_0x491f19){const _0x1cf386=a144_0x4e90,_0x44c086=parsePath(_0x491f19),_0x58aa4e=[];for(const _0x2fe4f3 of _0x44c086[_0x1cf386(0x18d)]){if(_0x2fe4f3==='.')continue;else{if(_0x2fe4f3==='..'){if(_0x58aa4e[_0x1cf386(0x184)]===0x0){if(_0x44c086[_0x1cf386(0x192)])throw new Error(_0x1cf386(0x196));_0x58aa4e[_0x1cf386(0x18f)]('..');}else _0x58aa4e[_0x58aa4e['length']-0x1]==='..'?_0x58aa4e[_0x1cf386(0x18f)]('..'):_0x58aa4e[_0x1cf386(0x17c)]();}else _0x58aa4e[_0x1cf386(0x18f)](_0x2fe4f3);}}if(_0x58aa4e[_0x1cf386(0x184)]===0x0)return _0x44c086[_0x1cf386(0x192)]?'/':'.';const _0xa4fb32=_0x58aa4e[_0x1cf386(0x180)]('/');return _0x44c086[_0x1cf386(0x189)][_0x1cf386(0x17a)]('/')?'/'+_0xa4fb32:_0xa4fb32;}function a144_0x4e90(_0x2d5605,_0x140dc1){_0x2d5605=_0x2d5605-0x17a;const _0x2287e8=a144_0x2287();let _0x4e9085=_0x2287e8[_0x2d5605];return _0x4e9085;}export function getParentPath(_0x5b6a89){const _0x4783d0=a144_0x4e90,_0x4c3e6d=parsePath(_0x5b6a89);if(_0x4c3e6d['segments'][_0x4783d0(0x184)]<=0x1)return'/';const _0x40506a=_0x4c3e6d[_0x4783d0(0x18d)][_0x4783d0(0x17d)](0x0,-0x1)[_0x4783d0(0x180)]('/');return _0x4c3e6d[_0x4783d0(0x189)]['startsWith']('/')?'/'+_0x40506a:_0x40506a;}export function getBaseName(_0x23b9e3){const _0x49fea9=a144_0x4e90,_0x5de520=parsePath(_0x23b9e3);return _0x5de520[_0x49fea9(0x18d)][_0x5de520['segments'][_0x49fea9(0x184)]-0x1]||'';}export function isChildPath(_0x3e9dfb,_0x494940){const _0x599c85=a144_0x4e90,_0x14d0e1=parsePath(_0x3e9dfb),_0x287fd0=parsePath(_0x494940);if(_0x14d0e1[_0x599c85(0x18d)][_0x599c85(0x184)]<=_0x287fd0[_0x599c85(0x18d)]['length'])return![];for(let _0x4ee71a=0x0;_0x4ee71a<_0x287fd0['segments']['length'];_0x4ee71a++){if(_0x14d0e1[_0x599c85(0x18d)][_0x4ee71a]!==_0x287fd0[_0x599c85(0x18d)][_0x4ee71a])return![];}return!![];}export function splitPath(_0x522a46){const _0x20b3de=a144_0x4e90,_0x4cc9bb=parsePath(_0x522a46);if(_0x4cc9bb[_0x20b3de(0x18d)]['length']===0x0)throw new Error(_0x20b3de(0x19f));if(_0x4cc9bb[_0x20b3de(0x18d)][_0x20b3de(0x184)]===0x1)return{'parent':_0x4cc9bb['segments'][0x0]};return{'parent':_0x4cc9bb[_0x20b3de(0x18d)][0x0],'child':_0x4cc9bb[_0x20b3de(0x18d)][_0x20b3de(0x17d)](0x1)[_0x20b3de(0x180)]('/')};}export function isYamlFilePath(_0x1bcf29){const _0x12c03f=a144_0x4e90;return _0x1bcf29[_0x12c03f(0x191)](_0x12c03f(0x1a8))||_0x1bcf29[_0x12c03f(0x191)](_0x12c03f(0x17f));}export async function resolveYamlFilePath(_0x5071c8,_0x12ff5e=nodeFileSystem){const _0x4eaf77=a144_0x4e90,_0x146bd4=a144_0x5df9b6[_0x4eaf77(0x193)](_0x5071c8);if(!await _0x12ff5e[_0x4eaf77(0x18b)](_0x146bd4))throw new Error(_0x4eaf77(0x1a4)+_0x5071c8);let _0x35aeca=a144_0x5df9b6['dirname'](_0x146bd4),_0x3edc48=null,_0x3ea01e=null;const _0x2fad12=a144_0x5df9b6['parse'](_0x35aeca)['root'];while(_0x35aeca!==_0x2fad12){const _0x27df40=a144_0x5df9b6[_0x4eaf77(0x180)](_0x35aeca,_0x4eaf77(0x1a6));if(await _0x12ff5e[_0x4eaf77(0x18b)](_0x27df40)){_0x3edc48=_0x27df40,_0x3ea01e=_0x35aeca;break;}_0x35aeca=a144_0x5df9b6[_0x4eaf77(0x1a7)](_0x35aeca);}if(!_0x3edc48||!_0x3ea01e)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x5071c8+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x2c0f36=await _0x12ff5e[_0x4eaf77(0x194)](_0x3edc48),_0x43c566=JSON['parse'](_0x2c0f36),_0x46efd7=_0x43c566[_0x4eaf77(0x1a5)];if(!_0x46efd7)throw new Error(_0x4eaf77(0x1a2));const _0xb8b49a=await _0x12ff5e[_0x4eaf77(0x194)](_0x146bd4),_0x1242aa=a144_0x5a2a69(_0xb8b49a),_0x175cfc=_0x1242aa[_0x4eaf77(0x181)];if(!_0x175cfc)throw new Error(_0x4eaf77(0x188)+_0x5071c8);const _0x101f39=_0x1242aa['type']==='journey'?_0x4eaf77(0x19d):_0x4eaf77(0x187),_0x550346=a144_0x5df9b6[_0x4eaf77(0x186)](_0x3ea01e,_0x146bd4),_0x52fec1=a144_0x5df9b6[_0x4eaf77(0x1a7)](_0x550346),_0x5a84d0=_0x52fec1==='.'?'':_0x52fec1['replace'](/\\/g,'/'),_0x4d5a70=_0x5a84d0?_0x46efd7+'/'+_0x5a84d0+'/'+_0x175cfc:_0x46efd7+'/'+_0x175cfc;return{'parentSegment':_0x46efd7,'segmentName':_0x175cfc,'folderPath':_0x5a84d0,'fullPath':_0x4d5a70,'resourceType':_0x101f39,'content':_0xb8b49a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1cdf02,_0x32a45b){const _0x652dbb=a145_0xb0c9,_0x47ca60=_0x1cdf02();while(!![]){try{const _0x2fe5cd=-parseInt(_0x652dbb(0x16f))/0x1+-parseInt(_0x652dbb(0x17a))/0x2+parseInt(_0x652dbb(0x172))/0x3+-parseInt(_0x652dbb(0x177))/0x4*(parseInt(_0x652dbb(0x178))/0x5)+parseInt(_0x652dbb(0x16d))/0x6*(parseInt(_0x652dbb(0x176))/0x7)+parseInt(_0x652dbb(0x171))/0x8+parseInt(_0x652dbb(0x16e))/0x9;if(_0x2fe5cd===_0x32a45b)break;else _0x47ca60['push'](_0x47ca60['shift']());}catch(_0x290c3a){_0x47ca60['push'](_0x47ca60['shift']());}}}(a145_0x30b1,0x6426c));function a145_0x30b1(){const _0x20463d=['2166556wBuhdN','4msaLLm','1913705Avusll','.\x20Parent\x20name\x20cannot\x20be\x20empty','463354JvDZQD','6HAkFfC','4962627znVEII','627137DuRSYA','substring','5263088HVZuuW','398934UGoDil','Invalid\x20segment\x20reference\x20format:\x20','.\x20Child\x20name\x20cannot\x20be\x20empty','indexOf'];a145_0x30b1=function(){return _0x20463d;};return a145_0x30b1();}function a145_0xb0c9(_0xdb4971,_0x3c3450){_0xdb4971=_0xdb4971-0x16d;const _0x30b145=a145_0x30b1();let _0xb0c918=_0x30b145[_0xdb4971];return _0xb0c918;}export function parseSegmentRef(_0x1b0c27){const _0x976123=a145_0xb0c9,_0x312d02=_0x1b0c27[_0x976123(0x175)]('/');if(_0x312d02===-0x1)return{'parentId':_0x1b0c27};if(_0x312d02===0x0)throw new Error(_0x976123(0x173)+_0x1b0c27+_0x976123(0x179));const _0x20c92f=_0x1b0c27[_0x976123(0x170)](0x0,_0x312d02),_0x50c3eb=_0x1b0c27[_0x976123(0x170)](_0x312d02+0x1);if(_0x50c3eb==='')throw new Error(_0x976123(0x173)+_0x1b0c27+_0x976123(0x174));return{'parentId':_0x20c92f,'childId':_0x50c3eb};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fae87,_0x506773){const _0x28be5d=a146_0x476e,_0x53c28f=_0x4fae87();while(!![]){try{const _0x52d49d=-parseInt(_0x28be5d(0xbb))/0x1*(-parseInt(_0x28be5d(0xc1))/0x2)+parseInt(_0x28be5d(0xb1))/0x3*(-parseInt(_0x28be5d(0xc0))/0x4)+-parseInt(_0x28be5d(0xa6))/0x5+parseInt(_0x28be5d(0x99))/0x6+-parseInt(_0x28be5d(0x9d))/0x7+-parseInt(_0x28be5d(0xad))/0x8*(-parseInt(_0x28be5d(0xaf))/0x9)+-parseInt(_0x28be5d(0xd1))/0xa*(parseInt(_0x28be5d(0xc9))/0xb);if(_0x52d49d===_0x506773)break;else _0x53c28f['push'](_0x53c28f['shift']());}catch(_0x2ebcc2){_0x53c28f['push'](_0x53c28f['shift']());}}}(a146_0x35de,0x4d60e));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x3d0559,_0x1ec594={},_0x56277d={}){const _0x43564d=a146_0x476e;if(_0x56277d[_0x43564d(0xca)])return runSemanticChecks(_0x3d0559,_0x1ec594);const _0x25baa4=SegmentDefSchema['safeParse'](_0x3d0559);if(_0x25baa4['success'])return runSemanticChecks(_0x25baa4['data'],_0x1ec594);return zodErrorsToValidationResult(_0x25baa4[_0x43564d(0xba)],_0x1ec594);}function a146_0x476e(_0x536a0c,_0xc37222){_0x536a0c=_0x536a0c-0x99;const _0x35de20=a146_0x35de();let _0x476ece=_0x35de20[_0x536a0c];return _0x476ece;}export function validateRuleDef(_0x30a35f,_0x2eeb34,_0xabb24a){const _0x31637f=a146_0x476e;if(!_0x30a35f)return[];const _0x1cbc1b=RuleDefSchema[_0x31637f(0xc7)](_0x30a35f);if(_0x1cbc1b[_0x31637f(0xdf)])return checkRule(_0x1cbc1b[_0x31637f(0xbf)],_0x2eeb34,_0xabb24a);const _0x34d0e0=flattenZodIssues(_0x1cbc1b[_0x31637f(0xba)]['issues']);return _0x34d0e0[_0x31637f(0xcd)](_0x3d0583=>{const _0x2edd52=_0x31637f,_0x4ba2ff=formatZodPath(_0x3d0583[_0x2edd52(0xa5)]),_0x324f23=_0x4ba2ff?_0x2eeb34+'.'+_0x4ba2ff:_0x2eeb34,_0x26f80d=mapZodIssueToCode(_0x3d0583,_0x4ba2ff),_0x1c5480=getLocationFromPath(_0xabb24a['document'],_0xabb24a[_0x2edd52(0xe2)],pathToArray(_0x324f23));return{'level':_0x2edd52(0xba),'path':_0x324f23,'code':_0x26f80d,'message':_0x3d0583[_0x2edd52(0xcc)],..._0x1c5480&&{'location':_0x1c5480}};});}function zodErrorsToValidationResult(_0x3cee3b,_0x47914a){const _0x2037fc=a146_0x476e,_0x26c7fc=flattenZodIssues(_0x3cee3b[_0x2037fc(0xb2)]),_0x48fcc0=_0x26c7fc[_0x2037fc(0xcd)](_0x40ccc6=>{const _0x55f742=_0x2037fc,_0x100bad=formatZodPath(_0x40ccc6[_0x55f742(0xa5)]),_0x15245c=mapZodIssueToCode(_0x40ccc6,_0x100bad),_0x1d4c1c=getLocationFromPath(_0x47914a[_0x55f742(0xcf)],_0x47914a[_0x55f742(0xe2)],_0x40ccc6['path'][_0x55f742(0xcd)](_0xfc5bc=>typeof _0xfc5bc===_0x55f742(0xa3)?String(_0xfc5bc):_0xfc5bc));return{'level':_0x55f742(0xba),'path':_0x100bad,'code':_0x15245c,'message':_0x40ccc6[_0x55f742(0xcc)],..._0x1d4c1c&&{'location':_0x1d4c1c}};});return{'valid':![],'errors':_0x48fcc0,'warnings':[]};}function mapZodIssueToCode(_0x32b5b4,_0x4798c8){const _0x1dba8a=a146_0x476e,_0x40f68d=_0x32b5b4[_0x1dba8a(0xd9)]===_0x1dba8a(0xbc)?_0x32b5b4[_0x1dba8a(0xdb)]:undefined;if(_0x4798c8===_0x1dba8a(0xa2))return _0x1dba8a(0xbe);if(_0x4798c8===_0x1dba8a(0xd3)||_0x4798c8[_0x1dba8a(0xdc)]('.type')){if(_0x32b5b4[_0x1dba8a(0xd9)]==='invalid_value'){if(_0x4798c8===_0x1dba8a(0xd3)||_0x4798c8[_0x1dba8a(0xc3)](/\.conditions\[\d+\]\.type$/))return _0x1dba8a(0xe0);}}if(_0x4798c8[_0x1dba8a(0xdc)](_0x1dba8a(0xa8)))return _0x1dba8a(0xa4);if(_0x4798c8['endsWith'](_0x1dba8a(0xc5)))return'MISSING_OPERATOR_VALUE';if(_0x40f68d?.[_0x1dba8a(0xd2)]===_0x1dba8a(0xc2))return _0x1dba8a(0xc2);if(_0x40f68d?.[_0x1dba8a(0xd2)]===_0x1dba8a(0xb8))return'MISSING_TIME_UNIT';if(_0x4798c8[_0x1dba8a(0xdc)](_0x1dba8a(0xce))||_0x4798c8==='conditions')return _0x1dba8a(0xb3);if(_0x4798c8[_0x1dba8a(0xc6)](_0x1dba8a(0x9a)))return _0x1dba8a(0xd7);if(_0x4798c8[_0x1dba8a(0xdc)]('.segment'))return _0x1dba8a(0xdd);return _0x1dba8a(0xd8);}function runSemanticChecks(_0x554673,_0xdb54af){const _0x3e6a36=a146_0x476e,_0x42a9a7=[];_0x554673['rule']&&_0x42a9a7[_0x3e6a36(0xbd)](...checkRule(_0x554673['rule'],'rule',_0xdb54af));const _0x1f5bc7=_0x42a9a7[_0x3e6a36(0xcb)](_0x38e4ff=>_0x38e4ff['level']===_0x3e6a36(0xba)),_0x526b9a=_0x42a9a7[_0x3e6a36(0xcb)](_0x4acaff=>_0x4acaff[_0x3e6a36(0xda)]==='warning');return{'valid':_0x1f5bc7[_0x3e6a36(0xac)]===0x0,'errors':_0x1f5bc7,'warnings':_0x526b9a};}function checkRule(_0x4c8742,_0xd92276,_0x41190e){const _0x5a44fd=a146_0x476e,_0x28ce42=[];if(_0x4c8742[_0x5a44fd(0xd6)][_0x5a44fd(0xac)]===0x0)return _0x28ce42[_0x5a44fd(0xbd)]({'level':_0x5a44fd(0xba),'path':_0xd92276+_0x5a44fd(0xce),'code':_0x5a44fd(0xaa),'message':_0x5a44fd(0x9c),'location':getLocationFromPath(_0x41190e[_0x5a44fd(0xcf)],_0x41190e[_0x5a44fd(0xe2)],pathToArray(_0xd92276+_0x5a44fd(0xce)))}),_0x28ce42;return _0x28ce42['push'](...checkConditions(_0x4c8742[_0x5a44fd(0xd6)],_0xd92276,_0x41190e)),_0x28ce42;}function a146_0x35de(){const _0x4c2f24=['endsWith','MISSING_SEGMENT_REFERENCE','\x27\x20with\x20attribute\x20\x27','success','INVALID_RULE_TYPE','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','source','3582006rxHbvx','arrayMatching','warning','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','164647LkNfLa','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','Value','aggregation','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','name','symbol','INVALID_OPERATOR_TYPE','path','58605EZsGiN','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','.operator.type','Attribute\x20name\x20cannot\x20be\x20empty','EMPTY_CONDITIONS','.filter','length','121224dbkgpG','Behavior','171VEXkDl','type','1005132mcrWOr','issues','MISSING_CONDITIONS','.attribute','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','.source','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','MISSING_TIME_UNIT','And','error','1yYsKob','custom','push','MISSING_NAME','data','4BWJQIK','212204VElzIK','MISSING_BETWEEN_BOUNDS','match','Attribute\x20\x27','.operator.value','includes','safeParse','.conditions[','11fkFKif','skipSchema','filter','message','map','.conditions','document','NESTED_CONDITION_GROUP','3037820kJLNnM','validationCode','rule.type','attribute','EMPTY_ATTRIBUTE','conditions','INVALID_ARRAY_MATCHING','SEGMENT_SCHEMA_ERROR','code','level','params'];a146_0x35de=function(){return _0x4c2f24;};return a146_0x35de();}function checkConditions(_0x2c8177,_0x5efde3,_0x54cdae){const _0x3a7325=a146_0x476e,_0x588861=[];for(let _0x4a5eb8=0x0;_0x4a5eb8<_0x2c8177[_0x3a7325(0xac)];_0x4a5eb8++){const _0x282388=_0x2c8177[_0x4a5eb8],_0x4dfc8d=_0x5efde3+_0x3a7325(0xc8)+_0x4a5eb8+']';_0x588861[_0x3a7325(0xbd)](...checkCondition(_0x282388,_0x4dfc8d,_0x54cdae));}return _0x588861;}function checkCondition(_0xe4c0a8,_0x2a1898,_0x30791c){const _0x319b10=a146_0x476e,_0x835666=[];if(_0xe4c0a8[_0x319b10(0xb0)]===_0x319b10(0xb9)||_0xe4c0a8[_0x319b10(0xb0)]==='Or')return _0xe4c0a8['conditions'][_0x319b10(0xac)]===0x0?_0x835666['push']({'level':_0x319b10(0xba),'path':_0x2a1898+_0x319b10(0xce),'code':_0x319b10(0xaa),'message':_0xe4c0a8[_0x319b10(0xb0)]+_0x319b10(0xe1),'location':getLocationFromPath(_0x30791c[_0x319b10(0xcf)],_0x30791c[_0x319b10(0xe2)],pathToArray(_0x2a1898+_0x319b10(0xce)))}):(_0x835666['push']({'level':_0x319b10(0x9b),'path':_0x2a1898,'code':_0x319b10(0xd0),'message':_0xe4c0a8['type']+_0x319b10(0xa7)+_0x319b10(0xb7)+'conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','location':getLocationFromPath(_0x30791c['document'],_0x30791c[_0x319b10(0xe2)],pathToArray(_0x2a1898))}),_0x835666[_0x319b10(0xbd)](...checkConditions(_0xe4c0a8[_0x319b10(0xd6)],_0x2a1898,_0x30791c))),_0x835666;if(_0xe4c0a8[_0x319b10(0xb0)]===_0x319b10(0x9f)||_0xe4c0a8[_0x319b10(0xb0)]===_0x319b10(0xae)){const _0x274e74=_0xe4c0a8,_0x27223f=_0x274e74['source'],_0x455ed8=_0x274e74[_0x319b10(0xa0)],_0x24f6e2=_0x27223f||_0x455ed8;(!_0x274e74[_0x319b10(0xd4)]||_0x274e74['attribute']==='')&&(!_0x24f6e2&&_0x835666[_0x319b10(0xbd)]({'level':'error','path':_0x2a1898+_0x319b10(0xb4),'code':_0x319b10(0xd5),'message':_0x319b10(0xa9),'location':getLocationFromPath(_0x30791c[_0x319b10(0xcf)],_0x30791c[_0x319b10(0xe2)],pathToArray(_0x2a1898+_0x319b10(0xb4)))}));_0x274e74[_0x319b10(0xcb)]&&_0x835666[_0x319b10(0xbd)](...checkRule(_0x274e74['filter'],_0x2a1898+_0x319b10(0xab),_0x30791c));if(_0x274e74[_0x319b10(0xe2)]){const _0x586509=_0x274e74[_0x319b10(0xd4)]&&_0x274e74[_0x319b10(0xd4)]!=='';_0x586509&&!_0x274e74[_0x319b10(0xcb)]&&_0x835666[_0x319b10(0xbd)]({'level':_0x319b10(0xba),'path':_0x2a1898+_0x319b10(0xb6),'code':'BEHAVIOR_SOURCE_MISSING_FILTER','message':'Behavior\x20source\x20\x27'+_0x274e74[_0x319b10(0xe2)]+_0x319b10(0xde)+_0x274e74[_0x319b10(0xd4)]+'\x27\x20'+'requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20'+'the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20'+_0x319b10(0xa1),'location':getLocationFromPath(_0x30791c['document'],_0x30791c[_0x319b10(0xe2)],pathToArray(_0x2a1898+_0x319b10(0xb6)))}),_0x586509&&_0x274e74[_0x319b10(0xcb)]&&_0x835666['push']({'level':_0x319b10(0x9b),'path':_0x2a1898+_0x319b10(0xb4),'code':'BEHAVIOR_SOURCE_WITH_ATTRIBUTE','message':_0x319b10(0xc4)+_0x274e74['attribute']+_0x319b10(0xb5)+_0x319b10(0x9e),'location':getLocationFromPath(_0x30791c[_0x319b10(0xcf)],_0x30791c[_0x319b10(0xe2)],pathToArray(_0x2a1898+_0x319b10(0xb4)))});}}return _0x835666;}
|