@treasuredata/tdx 0.13.2 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.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/api-command.js +1 -1
- package/dist/commands/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +1 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts +3 -4
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +37 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +2 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +86 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -0
- package/dist/proxy/passthrough-server.js +1 -0
- package/dist/proxy/passthrough-server.js.map +1 -0
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +99 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -0
- package/dist/proxy/sse-usage-parser.js +1 -0
- package/dist/proxy/sse-usage-parser.js.map +1 -0
- 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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +5 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +1 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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/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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a98_0x546590=a98_0xd296;(function(_0x2441b4,_0x43e714){const _0x2152bd=a98_0xd296,_0x2c5e05=_0x2441b4();while(!![]){try{const _0x4adaef=-parseInt(_0x2152bd(0xc7))/0x1*(parseInt(_0x2152bd(0x160))/0x2)+parseInt(_0x2152bd(0xf4))/0x3+parseInt(_0x2152bd(0x173))/0x4*(parseInt(_0x2152bd(0x12b))/0x5)+parseInt(_0x2152bd(0x181))/0x6+parseInt(_0x2152bd(0x152))/0x7+parseInt(_0x2152bd(0xd2))/0x8+-parseInt(_0x2152bd(0x170))/0x9*(parseInt(_0x2152bd(0xad))/0xa);if(_0x4adaef===_0x43e714)break;else _0x2c5e05['push'](_0x2c5e05['shift']());}catch(_0x59804b){_0x2c5e05['push'](_0x2c5e05['shift']());}}}(a98_0x2237,0xead1b));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a98_0x546590(0x18c);export const PENDING_ACTIVATION_PREFIX=a98_0x546590(0xab);function a98_0xd296(_0x18db13,_0xd35a32){_0x18db13=_0x18db13-0xa8;const _0x2237ea=a98_0x2237();let _0xd296a7=_0x2237ea[_0x18db13];return _0xd296a7;}export function createPendingSegmentId(_0x4acb34){return''+PENDING_SEGMENT_PREFIX+_0x4acb34+'__';}export function isPendingSegmentId(_0x4c6ba3){return _0x4c6ba3['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x3ca966){const _0x5e4e95=a98_0x546590;return _0x3ca966[_0x5e4e95(0xf6)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4a87e6){return''+PENDING_ACTIVATION_PREFIX+_0x4a87e6+'__';}export function isPendingActivationId(_0x5f172d){const _0x5983b9=a98_0x546590;return _0x5f172d[_0x5983b9(0x18e)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1c17a1){const _0x57ab94=a98_0x546590;return _0x1c17a1[_0x57ab94(0xf6)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x20a23d,_0x5bbf93){const _0x4c6ab5=a98_0x546590,_0x5435f1=_0x20a23d+'::'+(_0x5bbf93[_0x4c6ab5(0x150)]()||_0x4c6ab5(0x147)),_0x315d8f=createHash('sha1')[_0x4c6ab5(0xac)](_0x5435f1)['digest'](_0x4c6ab5(0xb2))[_0x4c6ab5(0x138)](0x0,0xc);return _0x4c6ab5(0xf8)+_0x315d8f;}export function ensureJourneyDefaults(_0x3d59bc){const _0x46c261=a98_0x546590;!_0x3d59bc[_0x46c261(0x15c)]&&(_0x3d59bc[_0x46c261(0x15c)]=''),!_0x3d59bc[_0x46c261(0x13d)]&&(_0x3d59bc[_0x46c261(0x13d)]=_0x46c261(0x130));}export function resolveTDFolderPath(_0x2aad59,_0x678b3b,_0x2c40cc){const _0x25bacd=a98_0x546590;if(!_0x678b3b)return _0x2aad59;if(_0x2aad59===_0x2c40cc||_0x2aad59[_0x25bacd(0x18e)](_0x2c40cc+'/'))return _0x2aad59;return _0x2aad59?_0x2c40cc+'/'+_0x2aad59:_0x2c40cc;}export function addFoldersToCreate(_0x40d632,_0x24deb0,_0x2e0af4){const _0x1ec03b=a98_0x546590;if(!_0x40d632)return;if(_0x24deb0[_0x1ec03b(0x148)](_0x40d632))return;const _0x13ce8f=_0x40d632[_0x1ec03b(0x10f)]('/');let _0x1e632b='';for(const _0x1869b5 of _0x13ce8f){_0x1e632b=_0x1e632b?_0x1e632b+'/'+_0x1869b5:_0x1869b5,!_0x24deb0[_0x1ec03b(0x148)](_0x1e632b)&&_0x2e0af4[_0x1ec03b(0xde)](_0x1e632b);}}import*as a98_0x86e150 from'yaml';import{readFileSync}from'fs';import a98_0x310c11 from'path';import{isJourneyDef,parseYamlString as a98_0x11249f,toYamlString as a98_0x5c395a,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x2c300a){const _0x2ea1ea=a98_0x546590;if(Array[_0x2ea1ea(0x17a)](_0x2c300a))return'['+_0x2c300a['map'](_0x381c58=>stableStringify(_0x381c58))[_0x2ea1ea(0xdd)](',')+']';if(_0x2c300a&&typeof _0x2c300a==='object'){const _0x3907fe=_0x2c300a,_0xcca712=Object['keys'](_0x3907fe)[_0x2ea1ea(0x156)](),_0x453bd5=_0xcca712[_0x2ea1ea(0xe9)](_0x191502=>'\x22'+_0x191502+'\x22:'+stableStringify(_0x3907fe[_0x191502]));return'{'+_0x453bd5[_0x2ea1ea(0xdd)](',')+'}';}const _0x2b02b5=JSON[_0x2ea1ea(0xc1)](_0x2c300a);return _0x2b02b5===undefined?_0x2ea1ea(0xf1):_0x2b02b5;}function activationSignature(_0x7105a3){const _0x454a16=a98_0x546590,_0x3e7a66={'connection':_0x7105a3[_0x454a16(0x139)],..._0x7105a3['all_columns']!==undefined&&{'all_columns':_0x7105a3[_0x454a16(0xb0)]},..._0x7105a3[_0x454a16(0x15e)]!==undefined&&{'columns':_0x7105a3[_0x454a16(0x15e)]},..._0x7105a3[_0x454a16(0x161)]!==undefined&&{'behavior':_0x7105a3[_0x454a16(0x161)]},..._0x7105a3[_0x454a16(0xdb)]!==undefined&&{'schedule':_0x7105a3[_0x454a16(0xdb)]},..._0x7105a3[_0x454a16(0x14a)]!==undefined&&{'notification':_0x7105a3['notification']},..._0x7105a3['connector_config']!==undefined&&{'connector_config':_0x7105a3[_0x454a16(0x105)]},..._0x7105a3['activation_template_id']!==undefined&&{'activation_template_id':_0x7105a3['activation_template_id']}};return stableStringify(_0x3e7a66);}export async function prepareSegmentFiles(_0x6f0e69,_0x1b7e04,_0x26a9c1,_0x347ccd,_0x196cb6){const _0x4605b4=a98_0x546590,{activationDefToCreateRequest:_0x185042}=await import(_0x4605b4(0x12f)),_0x139b6c=[],_0x5d11e0=new Set();for(const {yamlConfig:_0x104f27,folderPath:_0x2d8f46,sourcePath:_0x39ecde}of _0x6f0e69){const _0x5815b9=resolveTDFolderPath(_0x2d8f46,_0x347ccd,_0x196cb6),_0x36a0f9=_0x5815b9+':'+_0x104f27['name'],_0x5e2a8b=_0x1b7e04['segmentByFolderAndName'][_0x4605b4(0xcc)](_0x36a0f9),_0x25d817=_0x5e2a8b?_0x1b7e04[_0x4605b4(0x18d)]['get'](_0x5e2a8b['id'])||[]:[];addFoldersToCreate(_0x5815b9,_0x1b7e04['folderPathToId'],_0x5d11e0);const _0xa25c80=calculateActivationActions(_0x104f27[_0x4605b4(0x154)]||[],_0x25d817,_0x1b7e04[_0x4605b4(0x159)],_0x1b7e04[_0x4605b4(0x195)]);for(const _0x315478 of _0xa25c80){(_0x315478[_0x4605b4(0x104)]===_0x4605b4(0x168)||_0x315478[_0x4605b4(0x104)]===_0x4605b4(0xac))&&_0x315478[_0x4605b4(0x188)]&&(_0x315478['validatedRequest']=await _0x185042(_0x315478['yamlActivation'],_0x26a9c1));}const _0x4bbfaf=calculateSegmentDiff(_0x104f27,_0x5e2a8b,_0x25d817,_0x1b7e04['idToEmailMap'],_0x1b7e04[_0x4605b4(0x195)]);_0x139b6c['push']({'relativePath':_0x104f27[_0x4605b4(0x196)],'absolutePath':_0x39ecde,'yamlConfig':_0x104f27,'folderPath':_0x5815b9,'existingSegment':_0x5e2a8b,'existingActivations':_0x25d817,'isNew':_0x4bbfaf[_0x4605b4(0xd3)],'hasChanges':_0x4bbfaf['hasChanges'],'diff':_0x4bbfaf[_0x4605b4(0xbd)],'activationActions':_0xa25c80});}return{'segmentFiles':_0x139b6c,'foldersToCreate':_0x5d11e0};}export async function prepareJourneyFiles(_0x58a813,_0x349277,_0x59825d,_0x38f891){const _0x433497=a98_0x546590,_0xa3aa31=[],_0x1cef8f=new Set();for(const {yamlConfig:_0x837987,folderPath:_0x23e24f,sourcePath:_0x576bcc}of _0x58a813){const _0x130fe4=resolveTDFolderPath(_0x23e24f,_0x59825d,_0x38f891),_0x281c41=_0x130fe4+':'+_0x837987[_0x433497(0x196)],_0x9f2a20=_0x349277[_0x433497(0x108)][_0x433497(0xcc)](_0x281c41);let _0x435889,_0x538f1f;if(_0x9f2a20&&_0x9f2a20[_0x433497(0x16f)]>0x0){const _0x2d5442=buildLocalExpandedRuleMappings(_0x837987),{createYamlContext:_0x182e8e,prefetchJourneySegments:_0x323e5f}=createPushYamlContextForBundle(_0x349277[_0x433497(0x15f)],_0x349277['parentId'],_0x349277['existingSegments'],_0x2d5442,_0x349277[_0x433497(0x159)],_0x349277[_0x433497(0x195)],_0x349277['activationStepsById'],_0x349277['journeyById']);await _0x323e5f(_0x9f2a20['map'](_0xa3d490=>_0xa3d490['id']));const _0x26c8dd=hasMultipleVersions(_0x837987),_0x205208=async _0x3d8196=>{const _0x220c0b=_0x433497,_0x9a108c=_0x349277[_0x220c0b(0x120)]?.[_0x220c0b(0xcc)](_0x3d8196);if(_0x9a108c)return _0x9a108c;return _0x349277[_0x220c0b(0xd7)]({'journeyId':_0x3d8196,'journeyName':_0x837987['name'],'isMultiVersion':_0x9f2a20[_0x220c0b(0x16f)]>0x1});};if(_0x26c8dd&&_0x9f2a20[_0x433497(0x16f)]>0x1){const _0x260dc0=[];for(const _0x3be977 of _0x9f2a20){const _0x555b84=_0x3be977[_0x433497(0xef)]||0x1;_0x349277[_0x433497(0x182)]?.[_0x433497(0xac)](_0x433497(0x13c)+_0x837987[_0x433497(0x196)]+'\x20v'+_0x555b84);const _0xee7e4c=await _0x205208(_0x3be977['id']),_0x3d9635=_0x182e8e(_0x3be977['id']),_0x450a12=await journeyResponseToDef(_0xee7e4c,_0x3d9635);_0x260dc0[_0x433497(0xe3)]({'item':_0x3be977,'yaml':_0x450a12});}const _0x32ffe2=buildLocalRuleToNameMappingFromJourney(_0x837987);_0x538f1f=buildMergedJourneyDef(_0x260dc0,_0x32ffe2);const _0x293103=Math[_0x433497(0xf3)](..._0x260dc0[_0x433497(0xe9)](_0x412caa=>_0x412caa[_0x433497(0x135)]['versionNumber']||0x0)),_0x2c1f8f=_0x9f2a20[_0x433497(0xb7)](_0x38869f=>(_0x38869f[_0x433497(0xef)]||0x0)===_0x293103);_0x2c1f8f&&(_0x349277['progress']?.['update'](_0x433497(0x13c)+_0x837987[_0x433497(0x196)]+'\x20v'+_0x293103),_0x435889=await _0x205208(_0x2c1f8f['id']));}else{const _0xbdf34f=_0x9f2a20[_0x9f2a20[_0x433497(0x16f)]-0x1];_0x349277['progress']?.['update'](_0x433497(0x13c)+_0x837987[_0x433497(0x196)]),_0x435889=await _0x205208(_0xbdf34f['id']);const _0x14d563=_0x182e8e(_0xbdf34f['id']),_0x124c56=await journeyResponseToDef(_0x435889,_0x14d563),_0x19c7ab=buildLocalRuleToNameMappingFromJourney(_0x837987);_0x538f1f=buildMergedJourneyDef([{'item':_0xbdf34f,'yaml':_0x124c56}],_0x19c7ab);}}addFoldersToCreate(_0x130fe4,_0x349277[_0x433497(0xc3)],_0x1cef8f);const _0x193af4=calculateJourneyDiff(_0x837987,_0x538f1f);_0xa3aa31[_0x433497(0xe3)]({'relativePath':_0x837987['name'],'absolutePath':_0x576bcc,'yamlConfig':_0x837987,'folderPath':_0x130fe4,'existingJourney':_0x435889,'isNew':_0x193af4[_0x433497(0xd3)],'hasChanges':_0x193af4[_0x433497(0x164)],'diff':_0x193af4['diff']});}return{'journeyFiles':_0xa3aa31,'foldersToCreate':_0x1cef8f};}export function calculateActivationActions(_0x372e61,_0x20ab21,_0x4671bf,_0x44dc0e){const _0x453840=a98_0x546590,_0x1d1883=[],_0x5a9cea=new Map();for(const _0x214d58 of _0x20ab21){_0x5a9cea['set'](_0x214d58[_0x453840(0x196)],_0x214d58);}const _0x30c0c9=new Map();for(const _0x31249f of _0x372e61){_0x30c0c9[_0x453840(0xcf)](_0x31249f['name'],_0x31249f);}for(const _0xf6f439 of _0x372e61){const _0x277c6b=_0x5a9cea[_0x453840(0xcc)](_0xf6f439[_0x453840(0x196)]);if(!_0x277c6b)_0x1d1883[_0x453840(0xe3)]({'type':_0x453840(0x168),'name':_0xf6f439[_0x453840(0x196)],'yamlActivation':_0xf6f439});else{const _0x3ab8b3=activationResponseToDef(_0x277c6b,_0x4671bf,_0x44dc0e),_0x2a956a=a98_0x86e150[_0x453840(0xc1)](_0x3ab8b3),_0x2d6dda=a98_0x86e150[_0x453840(0xc1)](_0xf6f439);_0x2a956a!==_0x2d6dda&&_0x1d1883[_0x453840(0xe3)]({'type':_0x453840(0xac),'name':_0xf6f439['name'],'yamlActivation':_0xf6f439,'existingActivation':_0x277c6b});}}for(const _0x391237 of _0x20ab21){!_0x30c0c9['has'](_0x391237[_0x453840(0x196)])&&_0x1d1883[_0x453840(0xe3)]({'type':'delete','name':_0x391237[_0x453840(0x196)],'existingActivation':_0x391237});}return _0x1d1883;}function a98_0x2237(){const _0x2063a3=['journeyBundleName','Activation','\x20(referenced\x20in\x20journey\x20','resolveSegment','\x27\x20for\x20','from','Entry\x20criteria:\x20','deleted','unchanged','Updated\x20journey\x20\x27','journey_updating','results','journeyById','Created\x20activation\x20\x27','updateActivation','idToName','./journey-yaml.js','ACTIVATION_UPDATE_ERROR','onProgress','ACTIVATION_SYNTAX_ERROR','verbose','segment_deleted','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','10YkBarr','NOT_FOUND','index','exitCriterias','./child-segment-yaml.js','draft','Deleting\x20activation\x20\x27','folder','rootFolderId','activation_created','item','deleteSegment','all','slice','connection','logDeleted','rule','Fetching\x20','state','journey_created','getJourney','JOURNEY_UPDATE_ERROR','\x27...','folderPath','Created\x20journey\x20\x27','Creating\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','Updated\x20segment\x20\x27','segment','has','journey_creating','notification','journey','reduce','size','action','Segment\x20not\x20found:\x20','trim','yamlConfig','12103952djBqrb','embedded_activation_created','activations','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','sort','activation_updated','SEGMENT_NOT_FOUND','idToEmailMap',').\x20','steps','description','folder_creating','columns','deps','34IWUodI','behavior','\x20segment\x20from\x20file:\x20','updated','hasChanges','SEGMENT_UPDATE_ERROR','existingActivation','\x20journey\x20from\x20file:\x20','create','parentFolder','Deleted\x20activation\x20\x27','getActivation','parseDocument','effectiveFolderId','existingSegments','length','2061rAMwig','logWarning','Created\x20folder\x20\x27','3707756AUQHbS','data','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','parse','waitCondition','activation_deleting','goal','isArray','nameToType','skipSegments','listActivations','\x27\x20entry\x20criteria','absolutePath','parentId','9255078iJZGjI','progress','Created\x20segment\x20\x27','validatedRequest','entry_criteria','createActivation','utf-8','yamlActivation','SEGMENT_SYNTAX_ERROR','listSegments','deleteActivation','__pending_','activationsBySegmentId','startsWith','createJourneySegment','journeyActivationStepId','relative','journey_updated','valid','journeyStages','connectionIdToNameMap','name','toLowerCase','with','filter','__pending_act_','update','252610hreYQP','journeyId','toString','all_columns','Stage\x20\x27','hex','\x0a\x20\x20','goal\x20criteria','decision_point','embedded_segment_creating','find','Updating\x20activation\x20\x27','activation_','relationships','segmentId','kind','diff','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','includes','stages','stringify','\x27\x20from\x20file:\x20','folderPathToId','buildUserMaps','embedded_segment_created','\x27\x20milestone','82102cMOhzu','logSuccess','folderId','dirname','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','get','existingSegment','flatMap','set','segment_deleting','embedded_activation_creating','15032528SzVJCE','isNew','segmentNameToId','stage\x20\x27','withProgress','fetchJourney','getSegment','Updating\x20segment\x20\x27','createdSegmentId','schedule','updateSegmentById','join','add','\x27\x20wait\x20condition','Updated\x20activation\x20\x27','message','segmentFolderId','push','branches','entryCriteria','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x27\x20decision\x20point\x20branch\x20\x27','Creating\x20folder\x20\x27','map','createFolder','segments','milestone','existingJourney','delete','versionNumber','activation_updating','null','activationActions','max','3413187KAyIlj','parentSegmentFolder','replace','createSegment','journey_entry_criteria_','activationParams','Failed\x20to\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','activationContext','DecisionPoint','WaitStep','embeddedSegmentNameToId','keys','activation_deleted','journeys','Deleted\x20segment\x20\x27','type','connector_config','logInfo','resolveJourneyId','journeyBundlesByFolderAndName','created','../../utils/async.js','segment_updated','createdSegmentIds','Name\x20has\x20already\x20been\x20taken','segment_creating','split','attributes','entries','activation_creating','\x20error(s)'];a98_0x2237=function(){return _0x2063a3;};return a98_0x2237();}export function calculateSegmentDiff(_0x46caca,_0x548d68,_0xd6c05f,_0x264fb4,_0x9310ef){const _0x5cf6dc=segmentToYamlString(_0x46caca);if(_0x548d68){const _0x3a1ce3=segmentWithActivationsToYaml(_0x548d68,_0xd6c05f,undefined,_0x264fb4,_0x9310ef),_0x5c61bc=segmentToYamlString(_0x3a1ce3),_0xde9dba=generateDiff(_0x5c61bc,_0x5cf6dc),_0x938edc=hasChanges(_0xde9dba);return{'isNew':![],'hasChanges':_0x938edc,'diff':_0x938edc?formatDiffWithColors(_0xde9dba):undefined};}const _0xb6ad38=generateDiff('',_0x5cf6dc);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb6ad38)};}export function calculateJourneyDiff(_0x1a9890,_0x19b00b){const _0x193abb=normalizeJourneyDef(_0x1a9890,_0x1a9890),_0x23747d=a98_0x5c395a(_0x193abb);if(_0x19b00b){const _0xe30b2e=normalizeJourneyDef(_0x19b00b,_0x1a9890),_0x5b7a12=a98_0x5c395a(_0xe30b2e),_0x276263=generateDiff(_0x5b7a12,_0x23747d),_0xe9435b=hasChanges(_0x276263);return{'isNew':![],'hasChanges':_0xe9435b,'diff':_0xe9435b?formatDiffWithColors(_0x276263):undefined};}const _0x23f2fd=generateDiff('',_0x23747d);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x23f2fd)};}export function findSegmentsToDelete(_0xd8e94e,_0x4f985c,_0x574733,_0x20c0f3,_0x3d264f){const _0x4388c6=a98_0x546590,_0x4e1b89=new Set();for(const {yamlConfig:_0x5c137a,folderPath:_0x4d0176}of _0x4f985c){_0x4e1b89[_0x4388c6(0xde)](_0x4d0176+':'+_0x5c137a['name']);}return _0xd8e94e[_0x4388c6(0xaa)](_0x5bb4e6=>{const _0x47b73f=_0x4388c6,_0xf1fcf9=_0x5bb4e6[_0x47b73f(0xe2)]?_0x574733[_0x47b73f(0xcc)](_0x5bb4e6['segmentFolderId']['toString']())||'':'',_0x500990=_0xf1fcf9+':'+_0x5bb4e6['name'];if(_0x4e1b89[_0x47b73f(0x148)](_0x500990))return![];if(_0x3d264f)return _0xf1fcf9===_0x20c0f3||_0xf1fcf9['startsWith'](_0x20c0f3+'/');return!![];});}export function findJourneysToDelete(_0x1125f4,_0xac066e,_0x3f5774,_0x4f76a9,_0x5e0ae2){const _0x3535fa=a98_0x546590,_0x3d2c78=new Set();for(const {yamlConfig:_0x319495,folderPath:_0x120655}of _0xac066e){_0x3d2c78['add'](_0x120655+':'+_0x319495[_0x3535fa(0x196)]);}return _0x1125f4[_0x3535fa(0xaa)](_0x37c0d1=>{const _0x3e48c8=_0x3535fa,_0x3c7a54=_0x37c0d1[_0x3e48c8(0xc9)]?_0x3f5774[_0x3e48c8(0xcc)](_0x37c0d1[_0x3e48c8(0xc9)])||'':'',_0x51f542=_0x3c7a54+':'+_0x37c0d1[_0x3e48c8(0x114)];if(_0x3d2c78[_0x3e48c8(0x148)](_0x51f542))return![];if(_0x5e0ae2)return _0x3c7a54===_0x4f76a9||_0x3c7a54[_0x3e48c8(0x18e)](_0x4f76a9+'/');return!![];});}export function buildSegmentLookupMap(_0x5654b4,_0x5b18cb){const _0x2d8099=a98_0x546590,_0x1118d6=new Map();for(const _0x3230fd of _0x5654b4){const _0x25556c=_0x3230fd[_0x2d8099(0xe2)]?_0x5b18cb['get'](_0x3230fd[_0x2d8099(0xe2)][_0x2d8099(0xaf)]())||'':'',_0x194ae3=_0x25556c+':'+_0x3230fd[_0x2d8099(0x196)];_0x1118d6[_0x2d8099(0xcf)](_0x194ae3,_0x3230fd);}return _0x1118d6;}export function buildSegmentNameToIdMap(_0x58340b){const _0x5c6465=a98_0x546590,_0x342309=new Map();for(const _0x51ac03 of _0x58340b){_0x342309['set'](_0x51ac03[_0x5c6465(0x196)],_0x51ac03['id']);}return _0x342309;}export function buildJourneyBundleLookupMap(_0x466dab,_0x534085){const _0xc44c76=a98_0x546590,_0x4ae871=new Map();for(const _0x14f694 of _0x466dab){const _0x159ec0=_0x14f694[_0xc44c76(0xc9)]?_0x534085[_0xc44c76(0xcc)](_0x14f694[_0xc44c76(0xc9)])||'':'',_0x30883f=_0x159ec0+':'+_0x14f694[_0xc44c76(0x114)];!_0x4ae871[_0xc44c76(0x148)](_0x30883f)&&_0x4ae871[_0xc44c76(0xcf)](_0x30883f,[]),_0x4ae871[_0xc44c76(0xcc)](_0x30883f)[_0xc44c76(0xe3)](_0x14f694);}for(const _0x112193 of _0x4ae871['values']()){_0x112193[_0xc44c76(0x156)]((_0x2039e6,_0x42993d)=>(_0x2039e6[_0xc44c76(0xef)]||0x0)-(_0x42993d['versionNumber']||0x0));}return _0x4ae871;}export function collectFoldersToCreate(_0x84feee,_0x392a96){const _0x36462c=a98_0x546590,_0x587146=new Set();for(const _0x31e784 of _0x84feee){if(!_0x31e784)continue;if(_0x392a96[_0x36462c(0x148)](_0x31e784))continue;const _0x48d544=_0x31e784[_0x36462c(0x10f)]('/');let _0x1dffcf='';for(const _0x402116 of _0x48d544){_0x1dffcf=_0x1dffcf?_0x1dffcf+'/'+_0x402116:_0x402116,!_0x392a96[_0x36462c(0x148)](_0x1dffcf)&&_0x587146[_0x36462c(0xde)](_0x1dffcf);}}return _0x587146;}export function parseAndClassifyYamlFiles(_0x1fb348,_0x4674f0,_0x54cf9e){const _0x4d4cc1=a98_0x546590,_0x29b97b=[],_0x512e78=[];for(const _0x2a5995 of _0x1fb348){const _0x5cd1e4=a98_0x310c11[_0x4d4cc1(0x191)](_0x4674f0,a98_0x310c11[_0x4d4cc1(0xca)](_0x2a5995)),_0x4110b8=_0x5cd1e4==='.'?'':_0x5cd1e4,_0x17a1ea=readFileSync(_0x2a5995,_0x4d4cc1(0x187)),_0x35ea1a=a98_0x86e150[_0x4d4cc1(0x176)](_0x17a1ea);if(isJourneyDef(_0x35ea1a)){const _0xaaf436=a98_0x11249f(_0x17a1ea);_0x512e78[_0x4d4cc1(0xe3)]({'yamlConfig':_0xaaf436,'folderPath':_0x4110b8,'sourcePath':_0x2a5995});}else{if(!_0x54cf9e?.[_0x4d4cc1(0x17c)]){const _0x3a4d48=parseSegmentYamlFile(_0x17a1ea),_0x1b0381=normalizeChildSegmentYaml(_0x3a4d48);_0x29b97b[_0x4d4cc1(0xe3)]({'yamlConfig':_0x1b0381,'folderPath':_0x4110b8,'sourcePath':_0x2a5995});}}}return{'segments':_0x29b97b,'journeys':_0x512e78};}export function validateParsedFiles(_0x2141f1,_0x16e8e8){const _0x2145a1=a98_0x546590,_0xbdb406=[];for(const {yamlConfig:_0x482549,sourcePath:_0x13fd5f}of _0x2141f1[_0x2145a1(0xeb)]){const _0x2db136=readFileSync(_0x13fd5f,_0x2145a1(0x187)),_0xcefcae=a98_0x86e150[_0x2145a1(0x16c)](_0x2db136),_0x2702cc=validateSegmentDef(_0x482549,{'source':_0x2db136,'document':_0xcefcae});if(!_0x2702cc['valid']){const _0x31debe=a98_0x310c11[_0x2145a1(0x191)](_0x16e8e8,_0x13fd5f);_0xbdb406['push']({'filePath':_0x31debe,'source':_0x2db136,'result':_0x2702cc,'isJourney':![]});}}for(const {yamlConfig:_0x58960e,sourcePath:_0x446f2f}of _0x2141f1[_0x2145a1(0x102)]){const _0x3d2558=readFileSync(_0x446f2f,'utf-8'),_0x2cec84=a98_0x86e150[_0x2145a1(0x16c)](_0x3d2558),_0x127a10=validateJourneyDef(_0x58960e,{'source':_0x3d2558,'document':_0x2cec84});if(!_0x127a10[_0x2145a1(0x193)]){const _0xfe36c8=a98_0x310c11[_0x2145a1(0x191)](_0x16e8e8,_0x446f2f);_0xbdb406[_0x2145a1(0xe3)]({'filePath':_0xfe36c8,'source':_0x3d2558,'result':_0x127a10,'isJourney':!![]});}}return _0xbdb406;}export function formatValidationErrors(_0x1c2cc2){const _0x416aa7=a98_0x546590,_0x4ce90c=[];for(const {filePath:_0x4e22e6,source:_0x1b23ad,result:_0x3fa428,isJourney:_0x3072be}of _0x1c2cc2){const _0x409aab=_0x3072be?'journey':_0x416aa7(0x147);_0x4ce90c['push']('\x0a'+_0x4e22e6+'\x20('+_0x409aab+'):\x20'+_0x3fa428['errors'][_0x416aa7(0x16f)]+_0x416aa7(0x113)),_0x4ce90c[_0x416aa7(0xe3)](formatValidationResult(_0x3fa428,_0x1b23ad,_0x4e22e6));}return _0x4ce90c[_0x416aa7(0xdd)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4ca2a5){const _0xb48791=a98_0x546590,_0x582e3d=new Set(),_0x3ff9e8=new Map(),_0x46f580=collectSegmentUsageCounts(_0x4ca2a5);if(_0x4ca2a5[_0xb48791(0xeb)])for(const [_0x5e20a2,_0x5dce6c]of Object[_0xb48791(0x111)](_0x4ca2a5[_0xb48791(0xeb)])){_0x582e3d[_0xb48791(0xde)](_0x5e20a2);if(_0x5dce6c[_0xb48791(0x13b)]){const _0x443573=yamlRuleToApi(_0x5dce6c['rule']),_0x55c06d=apiRuleToYaml(_0x443573);_0x3ff9e8[_0xb48791(0xcf)](_0x5e20a2,_0x55c06d);}}const _0x26046b=new Map();let _0x1a0766=0x0;for(const [_0x1815b2,_0x2003a8]of _0x3ff9e8){const _0x20ae6a=serializeExpandedRule(_0x2003a8,_0x3ff9e8),_0x502295=_0x26046b[_0xb48791(0xcc)](_0x20ae6a)||[];_0x502295[_0xb48791(0xe3)]({'name':_0x1815b2,'index':_0x1a0766}),_0x26046b[_0xb48791(0xcf)](_0x20ae6a,_0x502295),_0x1a0766++;}const _0x51dd64=new Map();for(const [_0x59c5ab,_0x2503ce]of _0x26046b){const _0x4eb8cc=_0x2503ce[_0xb48791(0x138)]()[_0xb48791(0x156)]((_0x582a60,_0x268811)=>{const _0x4ae317=_0xb48791,_0x1900da=_0x46f580[_0x4ae317(0xcc)](_0x582a60['name'])||0x0,_0x26f47f=_0x46f580[_0x4ae317(0xcc)](_0x268811['name'])||0x0;if(_0x1900da!==_0x26f47f)return _0x26f47f-_0x1900da;return _0x582a60[_0x4ae317(0x12d)]-_0x268811['index'];})['map'](_0x4d9158=>_0x4d9158[_0xb48791(0x196)]),_0x18796e=[];for(const _0x199002 of _0x4eb8cc){const _0x4e6657=_0x46f580['get'](_0x199002)||0x0,_0x335095=Math[_0xb48791(0xf3)](_0x4e6657,0x1);for(let _0x506fee=0x0;_0x506fee<_0x335095;_0x506fee++){_0x18796e[_0xb48791(0xe3)](_0x199002);}}_0x51dd64[_0xb48791(0xcf)](_0x59c5ab,_0x18796e);}return{'existingLocalSegmentNames':_0x582e3d,'localSegmentRules':_0x3ff9e8,'localExpandedRuleToNames':_0x51dd64};}async function buildServerSegmentRuleMap(_0x4e1115,_0x14851f,_0x55e2a1,_0x3fb735){const _0x595cdf=new Map(),_0x2cdbba=new Set(),_0x241066=async _0x5345f4=>{const _0x60c926=a98_0xd296;if(_0x2cdbba[_0x60c926(0x148)](_0x5345f4))return;_0x2cdbba[_0x60c926(0xde)](_0x5345f4);let _0xf13c16=_0x55e2a1['find'](_0x3fe27b=>_0x3fe27b['id']===_0x5345f4);if(!_0xf13c16)try{_0xf13c16=await _0x4e1115[_0x60c926(0x147)][_0x60c926(0xd8)](_0x14851f,_0x5345f4);}catch{return;}if(!_0xf13c16?.[_0x60c926(0x13b)])return;const _0x481856=apiRuleToYaml(_0xf13c16[_0x60c926(0x13b)]);_0x595cdf[_0x60c926(0xcf)](_0x5345f4,_0x481856);const _0x1d6601=collectSegmentRefsFromRule(_0x481856);for(const _0x1d227a of _0x1d6601){await _0x241066(_0x1d227a);}};for(const _0x204f9c of _0x3fb735){await _0x241066(_0x204f9c);}return _0x595cdf;}export function createSegmentIdResolver(_0x5add50,_0x582334){return async _0x1b9958=>{const _0x4dfb2e=a98_0xd296,_0x1caf80=_0x5add50['get'](_0x1b9958);if(!_0x1caf80)throw new SDKError(ErrorCode[_0x4dfb2e(0x158)],_0x4dfb2e(0x14f)+_0x1b9958+_0x4dfb2e(0xcb)+_0x582334+'\x27)');return _0x1caf80;};}export function extractRootFolderId(_0xa8549c){const _0x1de18c=a98_0x546590;return _0xa8549c['relationships']?.[_0x1de18c(0xf5)]?.[_0x1de18c(0x174)]?.['id']||_0xa8549c['relationships']?.[_0x1de18c(0x169)]?.['data']?.['id'];}export function buildConnectionMaps(_0x1b1788){const _0x2c0c33=a98_0x546590,_0x2b4ea0=new Map(),_0x2fee18=new Map(),_0x12b334=new Map();for(const _0x29b643 of _0x1b1788){_0x2b4ea0[_0x2c0c33(0xcf)](_0x29b643[_0x2c0c33(0x196)],parseInt(_0x29b643['id'],0xa)),_0x2fee18[_0x2c0c33(0xcf)](_0x29b643['id'],_0x29b643[_0x2c0c33(0x196)]),_0x12b334[_0x2c0c33(0xcf)](_0x29b643[_0x2c0c33(0x196)],_0x29b643[_0x2c0c33(0x104)]);}return{'nameToId':_0x2b4ea0,'idToName':_0x2fee18,'nameToType':_0x12b334};}export function calculatePushStats(_0x3fb367,_0x3bde59,_0x1dfc58,_0x11919f,_0x595ef2,_0x2f36b9,_0x19153b){const _0x254df8=a98_0x546590,_0x2dc648=_0x3fb367['filter'](_0x21e224=>_0x21e224[_0x254df8(0xd3)]),_0x2627dc=_0x3fb367[_0x254df8(0xaa)](_0xc79fb5=>!_0xc79fb5['isNew']&&_0xc79fb5[_0x254df8(0x164)]),_0x13594c=_0x3fb367[_0x254df8(0xaa)](_0x9b40f1=>!_0x9b40f1['isNew']&&!_0x9b40f1[_0x254df8(0x164)]),_0x40722d=_0x2f36b9?_0x11919f:[],_0x579ad9=_0x3bde59[_0x254df8(0xaa)](_0x12a5e8=>_0x12a5e8[_0x254df8(0xd3)]),_0x1d9e1b=_0x3bde59[_0x254df8(0xaa)](_0x20e124=>!_0x20e124[_0x254df8(0xd3)]&&_0x20e124['hasChanges']),_0x13dbd0=_0x3bde59[_0x254df8(0xaa)](_0x391fac=>!_0x391fac[_0x254df8(0xd3)]&&!_0x391fac['hasChanges']),_0x56876d=_0x2f36b9?_0x595ef2:[],_0x1220e9=_0x3fb367[_0x254df8(0xce)](_0x6a29e4=>_0x6a29e4[_0x254df8(0xf2)]),_0x52078d=_0x1220e9[_0x254df8(0xaa)](_0x406525=>_0x406525[_0x254df8(0x104)]===_0x254df8(0x168)),_0xb4ed50=_0x1220e9['filter'](_0x6bce5e=>_0x6bce5e[_0x254df8(0x104)]===_0x254df8(0xac)),_0x43cacc=_0x1220e9[_0x254df8(0xaa)](_0x5e4baa=>_0x5e4baa[_0x254df8(0x104)]===_0x254df8(0xee)),_0x5e98c1=Array[_0x254df8(0x119)](_0x1dfc58)[_0x254df8(0x156)](),_0x1cd3df=_0x19153b?![]:_0x2dc648[_0x254df8(0x16f)]>0x0||_0x2627dc['length']>0x0||_0x40722d[_0x254df8(0x16f)]>0x0,_0x3f1a48=_0x579ad9[_0x254df8(0x16f)]>0x0||_0x1d9e1b[_0x254df8(0x16f)]>0x0||_0x56876d[_0x254df8(0x16f)]>0x0,_0x46fbe0=_0x19153b?![]:_0x1220e9['length']>0x0,_0x30f437=_0x5e98c1[_0x254df8(0x16f)]>0x0;return{'segments':{'new':_0x2dc648,'changed':_0x2627dc,'unchanged':_0x13594c,'toDelete':_0x40722d},'journeys':{'new':_0x579ad9,'changed':_0x1d9e1b,'unchanged':_0x13dbd0,'toDelete':_0x56876d},'activations':{'all':_0x1220e9,'toCreate':_0x52078d,'toUpdate':_0xb4ed50,'toDelete':_0x43cacc},'folders':{'toCreate':_0x5e98c1},'counts':{'segments':{'new':_0x2dc648[_0x254df8(0x16f)],'changed':_0x2627dc['length'],'unchanged':_0x13594c[_0x254df8(0x16f)],'toDelete':_0x40722d[_0x254df8(0x16f)]},'journeys':{'new':_0x579ad9[_0x254df8(0x16f)],'changed':_0x1d9e1b['length'],'unchanged':_0x13dbd0['length'],'toDelete':_0x56876d['length']},'activations':{'create':_0x52078d[_0x254df8(0x16f)],'update':_0xb4ed50[_0x254df8(0x16f)],'delete':_0x43cacc[_0x254df8(0x16f)]},'folders':_0x5e98c1['length']},'hasChanges':_0x1cd3df||_0x3f1a48||_0x46fbe0||_0x30f437};}export async function buildPushExecutionContext(_0x44a662,_0x13c17b,_0x5390e6,_0x939d8c,_0x2a4604,_0x1149a8){const _0x248859=a98_0x546590,_0x42a59e=extractRootFolderId(_0x5390e6),{pathToId:_0x4e9620,idToPath:_0x337463}=buildFolderMaps(_0x2a4604),_0x1406d5=buildSegmentNameToIdMap(_0x939d8c),_0x1bab96=new Map(),{batchAsync:_0x4ffa15}=await import(_0x248859(0x10a)),[_0x40c58a,_0x47b058]=await Promise[_0x248859(0x137)]([_0x44a662['user'][_0x248859(0xc4)](),_0x44a662[_0x248859(0x139)]['list'](),((async()=>{const _0x5eb3ff=_0x248859;!_0x1149a8&&_0x939d8c[_0x5eb3ff(0x16f)]>0x0&&await _0x4ffa15(_0x939d8c,async _0x1d5697=>{const _0x549c6d=_0x5eb3ff,_0x913891=await _0x44a662['segment'][_0x549c6d(0x17d)](_0x13c17b,_0x1d5697['id']);_0x1bab96[_0x549c6d(0xcf)](_0x1d5697['id'],_0x913891);});})())]),{emailToId:_0x126e1f,idToEmail:_0x5d239e}=_0x40c58a,_0x7ba783=buildConnectionMaps(_0x47b058);return{'rootFolderId':_0x42a59e,'folderPathToId':_0x4e9620,'folderIdToPath':_0x337463,'segmentNameToId':_0x1406d5,'activationsBySegmentId':_0x1bab96,'emailToIdMap':_0x126e1f,'idToEmailMap':_0x5d239e,'connectionNameToIdMap':_0x7ba783['nameToId'],'connectionIdToNameMap':_0x7ba783[_0x248859(0x123)],'connectionNameToTypeMap':_0x7ba783[_0x248859(0x17b)]};}export function createPushYamlContextForBundle(_0x28dbbc,_0x5d95a0,_0x4e02f8,_0x5023c4,_0x10cd91,_0x16d0d6,_0x522fb4,_0x5844ba){const {existingLocalSegmentNames:_0xe747c5,localExpandedRuleToNames:_0xec30d7}=_0x5023c4,_0x2f4a01=new Set(),_0x550d26=new Map(),_0x51afe1=new Map(),_0x1c405e=new Map(),_0x3a8443=createJumpTargetCache(),_0x59acbb=new Map(),_0x4a4336=new Map(),_0x4dba09=new Set();let _0x187a94;const _0x3f35d=_0x4922ad=>{const _0xaf1bb7={'resolveSegment':async _0x143f39=>{const _0x3ca987=a98_0xd296,_0x554498=_0x1c405e[_0x3ca987(0xcc)](_0x143f39);if(_0x554498!==undefined)return{'name':_0x554498,'isJourneyLocal':!![]};try{let _0x1ac50c=_0x4e02f8[_0x3ca987(0xb7)](_0x693654=>_0x693654['id']===_0x143f39);!_0x1ac50c&&(_0x1ac50c=await _0x28dbbc[_0x3ca987(0x147)][_0x3ca987(0xd8)](_0x5d95a0,_0x143f39));const _0x110486=generateJourneyLocalName(_0x1ac50c[_0x3ca987(0x196)]),_0x179685=_0x1ac50c[_0x3ca987(0xbc)]===SEGMENT_KIND_JOURNEY&&_0x110486!==undefined;let _0x3353be=_0x1ac50c[_0x3ca987(0x196)],_0x4456d7;if(_0x179685&&_0x1ac50c[_0x3ca987(0x13b)]){const _0x482a52=apiRuleToYaml(_0x1ac50c[_0x3ca987(0x13b)]);_0x4a4336[_0x3ca987(0xcf)](_0x143f39,_0x482a52);const _0x5261b9=async _0x4d3269=>{const _0x58bd6=_0x3ca987,_0x99e4c2=collectSegmentRefsFromRule(_0x4d3269);for(const _0x19952d of _0x99e4c2){if(!_0x4a4336[_0x58bd6(0x148)](_0x19952d))try{const _0x6f1a69=await _0x28dbbc[_0x58bd6(0x147)][_0x58bd6(0xd8)](_0x5d95a0,_0x19952d);if(_0x6f1a69?.[_0x58bd6(0x13b)]){const _0x5f0746=apiRuleToYaml(_0x6f1a69[_0x58bd6(0x13b)]);_0x4a4336[_0x58bd6(0xcf)](_0x19952d,_0x5f0746),await _0x5261b9(_0x5f0746);}}catch{}}};await _0x5261b9(_0x482a52);const _0x1714ba=serializeExpandedRule(_0x482a52,_0x4a4336),_0x186cdd=_0xec30d7[_0x3ca987(0xcc)](_0x1714ba);if(_0x186cdd&&_0x186cdd[_0x3ca987(0x16f)]>0x0){const _0x5b1828=_0x550d26['get'](_0x1714ba)||0x0,_0x3a526e=_0x186cdd[_0x5b1828]||_0x186cdd[_0x186cdd[_0x3ca987(0x16f)]-0x1];_0x550d26['set'](_0x1714ba,_0x5b1828+0x1),_0x3353be=_0x3a526e,_0x2f4a01[_0x3ca987(0xde)](_0x3353be),_0x1c405e[_0x3ca987(0xcf)](_0x143f39,_0x3353be);const _0x381104=await resolveRuleSegmentRefs(_0x482a52,async _0x397b3c=>{const _0x537dd1=_0x3ca987,_0x5ba8c5=_0x1c405e['get'](_0x397b3c);if(_0x5ba8c5)return _0x5ba8c5;const _0x279b91=await _0x187a94[_0x537dd1(0x117)](_0x397b3c);return _0x279b91['name'];});_0x4456d7={'description':_0x1ac50c['description'],'rule':_0x381104};}else{const _0x5bc351=_0x59acbb[_0x3ca987(0xcc)](_0x1714ba);if(_0x5bc351)_0x3353be=_0x5bc351,_0x1c405e[_0x3ca987(0xcf)](_0x143f39,_0x3353be);else{if(_0x110486){let _0x5945aa=_0x110486,_0x4ae8d4=0x2;while(_0x2f4a01[_0x3ca987(0x148)](_0x5945aa)||_0xe747c5['has'](_0x5945aa)){_0x5945aa=_0x110486+'_'+_0x4ae8d4,_0x4ae8d4++;}_0x2f4a01[_0x3ca987(0xde)](_0x5945aa),_0x3353be=_0x5945aa;}_0x1c405e[_0x3ca987(0xcf)](_0x143f39,_0x3353be),_0x59acbb[_0x3ca987(0xcf)](_0x1714ba,_0x3353be);const _0x47e387=await resolveRuleSegmentRefs(_0x482a52,async _0xc9bf2=>{const _0x42c691=_0x3ca987,_0x4073ef=_0x1c405e['get'](_0xc9bf2);if(_0x4073ef)return _0x4073ef;const _0x1fa6f9=await _0x187a94[_0x42c691(0x117)](_0xc9bf2);return _0x1fa6f9[_0x42c691(0x196)];});_0x4456d7={'description':_0x1ac50c['description'],'rule':_0x47e387};}}}return{'name':_0x3353be,'isJourneyLocal':_0x179685,'definition':_0x4456d7};}catch{return{'name':_0x143f39,'isJourneyLocal':![]};}},'resolveActivation':async _0x22f177=>{const _0x666eef=a98_0xd296,_0xa82292=_0x51afe1[_0x666eef(0xcc)](_0x22f177);if(_0xa82292!==undefined)return{'name':_0xa82292,'isJourneyLocal':!![]};try{let _0x1efb5d=_0x522fb4?.[_0x666eef(0xcc)](_0x22f177);!_0x1efb5d&&(_0x1efb5d=await _0x28dbbc[_0x666eef(0x14b)][_0x666eef(0x16b)](_0x4922ad,_0x22f177));const _0xc3dae6=_0x1efb5d[_0x666eef(0x110)][_0x666eef(0xf9)]['name']||_0x22f177,_0x8d75b0=sanitizeYamlKey(_0xc3dae6)||_0x666eef(0xb9)+_0x22f177,_0x3acba0=_0x8d75b0;_0x51afe1[_0x666eef(0xcf)](_0x22f177,_0x3acba0);const _0x4c18a0=journeyActivationStepToYaml(_0x1efb5d,_0x10cd91,_0x16d0d6);return{'name':_0x3acba0,'isJourneyLocal':!![],'definition':_0x4c18a0};}catch{return{'name':_0x22f177,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x579685,_0x2f9a1c)=>resolveJumpTarget(_0x579685,_0x2f9a1c,_0x3a8443,async _0x150f78=>{const _0x246f70=a98_0xd296,_0x385829=_0x5844ba?.[_0x246f70(0xcc)](_0x150f78);if(_0x385829)return _0x385829;return _0x28dbbc[_0x246f70(0x14b)][_0x246f70(0x13f)](_0x150f78);})};return _0x187a94=_0xaf1bb7,_0xaf1bb7;},_0x38077c=async _0x189c63=>{const _0x358bc3=a98_0xd296,{collectSegmentIdsFromJourneyApi:_0x5d9469}=await import(_0x358bc3(0x124)),{batchAsync:_0x19d101}=await import(_0x358bc3(0x10a)),_0x5c1890=new Set();for(const _0x2cac23 of _0x189c63){let _0x1ca78b=_0x5844ba?.['get'](_0x2cac23);!_0x1ca78b&&(_0x1ca78b=await _0x28dbbc[_0x358bc3(0x14b)][_0x358bc3(0x13f)](_0x2cac23));const _0x1aa722=_0x5d9469(_0x1ca78b);for(const _0x1fefd8 of _0x1aa722){_0x5c1890[_0x358bc3(0xde)](_0x1fefd8);}}let _0x4b717d=Array[_0x358bc3(0x119)](_0x5c1890);while(_0x4b717d[_0x358bc3(0x16f)]>0x0){const _0x74c37=_0x4b717d[_0x358bc3(0xaa)](_0x3ebfa4=>!_0x4dba09[_0x358bc3(0x148)](_0x3ebfa4));if(_0x74c37['length']===0x0)break;const _0x4dccc8=await _0x19d101(_0x74c37,async _0x14fd29=>{const _0x3bba5f=_0x358bc3;_0x4dba09[_0x3bba5f(0xde)](_0x14fd29);let _0x307900=_0x4e02f8[_0x3bba5f(0xb7)](_0x38fec0=>_0x38fec0['id']===_0x14fd29);if(!_0x307900)try{_0x307900=await _0x28dbbc[_0x3bba5f(0x147)][_0x3bba5f(0xd8)](_0x5d95a0,_0x14fd29);}catch{return null;}return{'segmentId':_0x14fd29,'segment':_0x307900};},0xa),_0x179fe5=new Set();for(const _0x5dcdad of _0x4dccc8){if(!_0x5dcdad?.[_0x358bc3(0x147)]?.[_0x358bc3(0x13b)])continue;const _0x3f80b8=apiRuleToYaml(_0x5dcdad['segment']['rule']);_0x4a4336[_0x358bc3(0xcf)](_0x5dcdad[_0x358bc3(0xbb)],_0x3f80b8);const _0x432a3d=collectSegmentRefsFromRule(_0x3f80b8);for(const _0x2d10f6 of _0x432a3d){!_0x4dba09['has'](_0x2d10f6)&&_0x179fe5[_0x358bc3(0xde)](_0x2d10f6);}}_0x4b717d=Array[_0x358bc3(0x119)](_0x179fe5);}};return{'createYamlContext':_0x3f35d,'prefetchJourneySegments':_0x38077c};}export async function executePushSegments(_0xde0d9d,_0x2bfa01,_0x3820b3,_0x4f0246,_0x1b748b){const _0x5e48a8=a98_0x546590,{segmentDefToCreateRequest:_0x492409,segmentDefToUpdateRequest:_0x2d3973}=await import(_0x5e48a8(0x12f)),_0x26f039=_0x3820b3[_0x5e48a8(0xc3)],_0x169a72=0x5,_0x24ea0a=async _0x4e6d17=>{const _0x390780=_0x5e48a8,_0x49143d=_0x4e6d17['folderPath']?_0x26f039['get'](_0x4e6d17[_0x390780(0x142)]):undefined;let _0x4d494e;const _0x2f2f2e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x4e6d17['isNew']){_0x1b748b[_0x390780(0x126)]?.({'type':_0x390780(0x10e),'name':_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]});const _0x26cb62=_0x492409(_0x4e6d17['yamlConfig'],_0x49143d),_0x34a48b=await _0x1b748b[_0x390780(0xd6)]('Creating\x20segment\x20\x27'+_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]+_0x390780(0x141),()=>_0xde0d9d[_0x390780(0x147)][_0x390780(0xf7)](_0x4f0246['parentId'],_0x26cb62));_0x4d494e=_0x34a48b[_0x390780(0x174)]['id'],_0x2f2f2e[_0x390780(0xda)]={'name':_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)],'id':_0x4d494e},_0x1b748b[_0x390780(0x126)]?.({'type':'segment_created','name':_0x4e6d17['yamlConfig'][_0x390780(0x196)],'segmentId':_0x4d494e}),_0x1b748b[_0x390780(0xc8)]?.(_0x390780(0x183)+_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]+'\x27'),_0x2f2f2e[_0x390780(0x109)]=0x1;}else{if(_0x4e6d17[_0x390780(0x164)]){_0x1b748b[_0x390780(0x126)]?.({'type':'segment_updating','name':_0x4e6d17['yamlConfig'][_0x390780(0x196)]});const _0x1eb3af=_0x2d3973(_0x4e6d17['yamlConfig']);_0x49143d!==_0x4e6d17[_0x390780(0xcd)]?.[_0x390780(0xe2)]&&(_0x1eb3af[_0x390780(0xe2)]=_0x49143d?parseInt(_0x49143d,0xa):undefined),await _0x1b748b[_0x390780(0xd6)](_0x390780(0xd9)+_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]+_0x390780(0x141),()=>_0xde0d9d['segment'][_0x390780(0xdc)](_0x4f0246['parentId'],_0x4e6d17[_0x390780(0xcd)]['id'],_0x1eb3af)),_0x4d494e=_0x4e6d17[_0x390780(0xcd)]['id'],_0x1b748b['onProgress']?.({'type':_0x390780(0x10b),'name':_0x4e6d17[_0x390780(0x151)]['name']}),_0x1b748b[_0x390780(0xc8)]?.(_0x390780(0x146)+_0x4e6d17['yamlConfig'][_0x390780(0x196)]+'\x27'),_0x2f2f2e[_0x390780(0x163)]=0x1;}else _0x4d494e=_0x4e6d17[_0x390780(0xcd)]['id'];}}catch(_0x51b948){const _0xd80965=isHttp400Error(_0x51b948),_0x9141c6=_0xd80965?ErrorCode[_0x390780(0x189)]:ErrorCode[_0x390780(0x165)],_0x23c98f=getErrorMessage(_0x51b948);throw new SDKError(_0x9141c6,'Failed\x20to\x20'+(_0x4e6d17['isNew']?_0x390780(0x168):_0x390780(0xac))+_0x390780(0x162)+_0x4e6d17[_0x390780(0x17f)]+_0x390780(0xb3)+_0x23c98f,_0x51b948);}try{const _0x4cff78=await syncActivationsForSegment(_0xde0d9d,_0x4f0246[_0x390780(0x180)],_0x4d494e,_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)],_0x4e6d17['activationActions'],_0x1b748b,_0x4e6d17[_0x390780(0x17f)]);_0x2f2f2e[_0x390780(0x154)]=_0x4cff78;}catch(_0x46ee42){if(_0x46ee42 instanceof SDKError)throw _0x46ee42;throw new SDKError(ErrorCode[_0x390780(0x125)],_0x390780(0x175)+_0x4e6d17['yamlConfig'][_0x390780(0x196)]+_0x390780(0xc2)+_0x4e6d17[_0x390780(0x17f)]+_0x390780(0xb3)+getErrorMessage(_0x46ee42),_0x46ee42);}return _0x2f2f2e;},_0x6ff7f9=await batchAsync(_0x2bfa01,_0x24ea0a,_0x169a72),_0x3de68a={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x542f78 of _0x6ff7f9){_0x3de68a[_0x5e48a8(0x109)]+=_0x542f78[_0x5e48a8(0x109)],_0x3de68a[_0x5e48a8(0x163)]+=_0x542f78[_0x5e48a8(0x163)],_0x542f78[_0x5e48a8(0xda)]&&_0x3de68a[_0x5e48a8(0x10c)][_0x5e48a8(0xcf)](_0x542f78['createdSegmentId'][_0x5e48a8(0x196)],_0x542f78[_0x5e48a8(0xda)]['id']),_0x3de68a['activations'][_0x5e48a8(0x109)]+=_0x542f78['activations'][_0x5e48a8(0x109)],_0x3de68a['activations'][_0x5e48a8(0x163)]+=_0x542f78[_0x5e48a8(0x154)][_0x5e48a8(0x163)],_0x3de68a[_0x5e48a8(0x154)]['deleted']+=_0x542f78[_0x5e48a8(0x154)][_0x5e48a8(0x11b)];}return _0x3de68a;}async function syncActivationsForSegment(_0x53f520,_0x2ab962,_0x51fd55,_0x2029c5,_0x30fd42,_0x710a4f,_0x8d6f33){const _0xc46cf6=a98_0x546590,_0x4882c0={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3498b3 of _0x30fd42){try{if(_0x3498b3[_0xc46cf6(0x104)]===_0xc46cf6(0x168)&&_0x3498b3[_0xc46cf6(0x184)])_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x112),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),await _0x710a4f['withProgress'](_0xc46cf6(0x144)+_0x3498b3[_0xc46cf6(0x196)]+_0xc46cf6(0x141),()=>_0x53f520[_0xc46cf6(0x147)][_0xc46cf6(0x186)](_0x2ab962,_0x51fd55,_0x3498b3[_0xc46cf6(0x184)])),_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x134),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),_0x710a4f[_0xc46cf6(0xc8)]?.(_0xc46cf6(0x121)+_0x3498b3[_0xc46cf6(0x196)]+'\x27'),_0x4882c0[_0xc46cf6(0x109)]++;else{if(_0x3498b3[_0xc46cf6(0x104)]===_0xc46cf6(0xac)&&_0x3498b3[_0xc46cf6(0x184)]&&_0x3498b3[_0xc46cf6(0x166)])_0x710a4f['onProgress']?.({'type':_0xc46cf6(0xf0),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),await _0x710a4f['withProgress'](_0xc46cf6(0xb8)+_0x3498b3[_0xc46cf6(0x196)]+_0xc46cf6(0x141),()=>_0x53f520['segment'][_0xc46cf6(0x122)](_0x2ab962,_0x51fd55,_0x3498b3[_0xc46cf6(0x166)]['id'],_0x3498b3[_0xc46cf6(0x184)])),_0x710a4f['onProgress']?.({'type':_0xc46cf6(0x157),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),_0x710a4f[_0xc46cf6(0xc8)]?.(_0xc46cf6(0xe0)+_0x3498b3[_0xc46cf6(0x196)]+'\x27'),_0x4882c0[_0xc46cf6(0x163)]++;else _0x3498b3[_0xc46cf6(0x104)]===_0xc46cf6(0xee)&&_0x3498b3[_0xc46cf6(0x166)]&&(_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x178),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),await _0x710a4f['withProgress'](_0xc46cf6(0x131)+_0x3498b3[_0xc46cf6(0x196)]+_0xc46cf6(0x141),()=>_0x53f520[_0xc46cf6(0x147)][_0xc46cf6(0x18b)](_0x2ab962,_0x51fd55,_0x3498b3[_0xc46cf6(0x166)]['id'])),_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x101),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),_0x710a4f[_0xc46cf6(0x13a)]?.(_0xc46cf6(0x16a)+_0x3498b3['name']+'\x27'),_0x4882c0[_0xc46cf6(0x11b)]++);}}catch(_0x44bfcf){const _0x22cef6=isHttp400Error(_0x44bfcf),_0x58f3ba=_0x22cef6?ErrorCode[_0xc46cf6(0x127)]:ErrorCode[_0xc46cf6(0x125)],_0x446a3f=getErrorMessage(_0x44bfcf);throw new SDKError(_0x58f3ba,_0xc46cf6(0xfa)+_0x3498b3[_0xc46cf6(0x104)]+'\x20activation\x20\x27'+_0x3498b3[_0xc46cf6(0x196)]+'\x27\x20from\x20file:\x20'+_0x8d6f33+_0xc46cf6(0xb3)+_0x446a3f,_0x44bfcf);}}return _0x4882c0;}export async function executePushFolders(_0x426f3f,_0x587a11,_0x49d620,_0x393746,_0x141cc1){const _0x69c48=a98_0x546590,_0x3c2c21=new Map(_0x49d620);for(const _0x26b795 of _0x587a11){const _0x1f09d3=_0x26b795[_0x69c48(0x10f)]('/'),_0x355c3c=_0x1f09d3[_0x1f09d3['length']-0x1],_0x2b759a=_0x1f09d3[_0x69c48(0x138)](0x0,-0x1)[_0x69c48(0xdd)]('/'),_0xd46295=_0x3c2c21[_0x69c48(0xcc)](_0x2b759a);_0x141cc1[_0x69c48(0x126)]?.({'type':_0x69c48(0x15d),'folder':_0x26b795});const _0x3eedd1={'name':_0x355c3c,'parentFolderId':_0xd46295},_0x47594b=await _0x141cc1['withProgress'](_0x69c48(0xe8)+_0x26b795+_0x69c48(0x141),()=>_0x426f3f[_0x69c48(0x147)][_0x69c48(0xea)](_0x393746[_0x69c48(0x180)],_0x3eedd1));_0x3c2c21['set'](_0x26b795,_0x47594b[_0x69c48(0x174)]['id']),_0x141cc1[_0x69c48(0x126)]?.({'type':'folder_created','folder':_0x26b795,'folderId':_0x47594b[_0x69c48(0x174)]['id']}),_0x141cc1[_0x69c48(0x106)]?.(_0x69c48(0x172)+_0x26b795+'\x27');}return _0x3c2c21;}export async function executePushSegmentDeletions(_0x20fefb,_0x1c5e73,_0x4e66d0){const _0x24aa7b=a98_0x546590;if(_0x1c5e73[_0x24aa7b(0x16f)]===0x0)return 0x0;const {batchAsync:_0x30d404}=await import(_0x24aa7b(0x10a)),_0x400474=0x5,_0x47044b=await _0x30d404(_0x1c5e73,async _0x488798=>{const _0x2b67ef=_0x24aa7b;return _0x4e66d0[_0x2b67ef(0x126)]?.({'type':_0x2b67ef(0xd0),'name':_0x488798[_0x2b67ef(0x196)]}),await _0x20fefb[_0x2b67ef(0x147)][_0x2b67ef(0x136)](_0x488798['id']),_0x4e66d0[_0x2b67ef(0x126)]?.({'type':_0x2b67ef(0x129),'name':_0x488798['name']}),_0x4e66d0[_0x2b67ef(0x13a)]?.(_0x2b67ef(0x103)+_0x488798[_0x2b67ef(0x196)]+'\x27'),0x1;},_0x400474);return _0x47044b[_0x24aa7b(0x14c)]((_0x27e417,_0x55b509)=>_0x27e417+_0x55b509,0x0);}export async function executePushJourneys(_0x1b0c8f,_0x314c55,_0x1fbfbd,_0x2a4069,_0x3f2878){const _0x913fbd=a98_0x546590,{journeyDefToRequest:_0x523195}=await import(_0x913fbd(0x124)),{activationDefToCreateRequest:_0x43f7e0,yamlRuleToApi:_0x52e75e,validateSegmentRule:_0x25c0bb}=await import('./child-segment-yaml.js'),_0x12bb1f={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5d162d=new Map(_0x1fbfbd[_0x913fbd(0xd4)]),_0x4c3ad4=0x5;for(let _0x43e0ee=0x0;_0x43e0ee<_0x314c55[_0x913fbd(0x16f)];_0x43e0ee+=_0x4c3ad4){const _0x9779ec=_0x314c55[_0x913fbd(0x138)](_0x43e0ee,_0x43e0ee+_0x4c3ad4),_0x3ead63=await Promise['all'](_0x9779ec[_0x913fbd(0xe9)](async _0x4751f7=>{const _0xface2=_0x913fbd;if(!_0x4751f7[_0xface2(0xd3)]&&!_0x4751f7[_0xface2(0x164)])return{'action':_0xface2(0x11c),'name':_0x4751f7[_0xface2(0x151)][_0xface2(0x196)],'journeyId':_0x4751f7[_0xface2(0xed)]?.['id']};const _0x1d788f=_0x4751f7[_0xface2(0x142)]?_0x1fbfbd[_0xface2(0xc3)][_0xface2(0xcc)](_0x4751f7['folderPath']):undefined;_0x3f2878[_0xface2(0x126)]?.({'type':_0x4751f7[_0xface2(0xd3)]?_0xface2(0x149):_0xface2(0x11e),'name':_0x4751f7[_0xface2(0x151)][_0xface2(0x196)]});try{const _0x3fa76a=await executeSingleJourneyPush(_0x1b0c8f,_0x4751f7,{..._0x1fbfbd,'segmentNameToId':_0x5d162d},{'parentId':_0x2a4069[_0xface2(0x180)],'rootFolderId':_0x2a4069[_0xface2(0x133)],'folderId':_0x1d788f,'verbose':_0x2a4069[_0xface2(0x128)]},_0x3f2878,{'journeyDefToRequest':_0x523195,'activationDefToCreateRequest':_0x43f7e0,'yamlRuleToApi':_0x52e75e,'validateSegmentRule':_0x25c0bb});for(const [_0x421650,_0x534bb2]of _0x3fa76a['embeddedSegmentNameToId']){_0x5d162d['set'](_0x421650,_0x534bb2),_0x12bb1f[_0xface2(0xff)][_0xface2(0xcf)](_0x421650,_0x534bb2);}if(_0x3fa76a[_0xface2(0x14e)]===_0xface2(0x109))_0x3f2878[_0xface2(0x126)]?.({'type':_0xface2(0x13e),'name':_0x4751f7[_0xface2(0x151)][_0xface2(0x196)],'journeyId':_0x3fa76a[_0xface2(0xae)]}),_0x3f2878[_0xface2(0xc8)]?.(_0xface2(0x143)+_0x4751f7[_0xface2(0x151)][_0xface2(0x196)]+'\x27'),_0x12bb1f[_0xface2(0x109)]++;else _0x3fa76a[_0xface2(0x14e)]==='updated'&&(_0x3f2878[_0xface2(0x126)]?.({'type':_0xface2(0x192),'name':_0x4751f7[_0xface2(0x151)]['name']}),_0x3f2878[_0xface2(0xc8)]?.(_0xface2(0x11d)+_0x4751f7[_0xface2(0x151)][_0xface2(0x196)]+'\x27'),_0x12bb1f[_0xface2(0x163)]++);return{'action':_0x3fa76a[_0xface2(0x14e)],'name':_0x4751f7[_0xface2(0x151)]['name'],'journeyId':_0x3fa76a[_0xface2(0xae)]};}catch(_0xb29729){const _0x2951e2=isHttp400Error(_0xb29729),_0x47471a=_0x2951e2?ErrorCode[_0xface2(0x145)]:ErrorCode[_0xface2(0x140)],_0x2c42d1=getErrorMessage(_0xb29729);throw new SDKError(_0x47471a,_0xface2(0xfa)+(_0x4751f7[_0xface2(0xd3)]?'create':_0xface2(0xac))+_0xface2(0x167)+_0x4751f7[_0xface2(0x17f)]+_0xface2(0xb3)+_0x2c42d1,_0xb29729);}}));_0x12bb1f[_0x913fbd(0x11f)][_0x913fbd(0xe3)](..._0x3ead63);}return _0x12bb1f;}async function executeSingleJourneyPush(_0x54537b,_0x5c27b6,_0x5e96f2,_0x12953b,_0x3c8862,_0x2d7f66){const _0x417ec2=a98_0x546590,{journeyDefToRequest:_0x29e93e,activationDefToCreateRequest:_0x135786,yamlRuleToApi:_0x1c27fe,validateSegmentRule:_0x156d6e}=_0x2d7f66,_0x2ebaad=new Map(),_0x5f1a84=new Map(),_0x22d887=new Map(),_0x3d92f9=new Map(),_0x8208a1=new Map();let _0x59d352;const _0x49e31e=async()=>{const _0x3ac681=a98_0xd296;if(_0x59d352)return;_0x59d352=new Map();if(!_0x5c27b6[_0x3ac681(0xed)])return;const _0x2e7121=await _0x54537b['journey'][_0x3ac681(0x17d)](_0x5c27b6[_0x3ac681(0xed)]['id']);for(const _0xaf873 of _0x2e7121){const _0x33a2ff=journeyActivationStepToYaml(_0xaf873,_0x5e96f2[_0x3ac681(0x159)],_0x5e96f2[_0x3ac681(0x195)]),_0x3861a4=activationSignature(_0x33a2ff);!_0x59d352[_0x3ac681(0x148)](_0x3861a4)&&_0x59d352[_0x3ac681(0xcf)](_0x3861a4,_0xaf873['id']),_0x33a2ff[_0x3ac681(0x196)]&&_0x5f1a84['set'](_0x33a2ff[_0x3ac681(0x196)],_0xaf873['id']);}};if(_0x5c27b6[_0x417ec2(0xed)]&&_0x5c27b6['yamlConfig'][_0x417ec2(0xeb)]){const _0x3785f9=buildLocalExpandedRuleMappings(_0x5c27b6[_0x417ec2(0x151)]),_0x54ca70=_0x3785f9['localSegmentRules'];if(_0x54ca70['size']>0x0){const _0xf6461e=new Map();for(const [_0x2af2df,_0x14290f]of _0x54ca70){const _0x23c8e5=serializeExpandedRule(_0x14290f,_0x54ca70);_0xf6461e[_0x417ec2(0xcf)](_0x2af2df,_0x23c8e5);}const _0x5594ec=collectSegmentIdsFromJourneyApi(_0x5c27b6[_0x417ec2(0xed)]);if(_0x5594ec['size']>0x0){const _0x499578=await buildServerSegmentRuleMap(_0x54537b,_0x12953b[_0x417ec2(0x180)],_0x5e96f2[_0x417ec2(0x16e)],_0x5594ec);if(_0x499578[_0x417ec2(0x14d)]>0x0){const _0x1365b4=new Map();for(const [_0x530c85,_0x581acc]of _0x499578){const _0x5354d9=serializeExpandedRule(_0x581acc,_0x499578);!_0x1365b4[_0x417ec2(0x148)](_0x5354d9)&&_0x1365b4[_0x417ec2(0xcf)](_0x5354d9,_0x530c85);}for(const [_0xb64e64,_0x69b9f2]of _0xf6461e){const _0x44a46b=_0x1365b4[_0x417ec2(0xcc)](_0x69b9f2);_0x44a46b&&(_0x8208a1[_0x417ec2(0xcf)](_0xb64e64,_0x44a46b),_0x5e96f2['segmentNameToId'][_0x417ec2(0xcf)](_0xb64e64,_0x44a46b));}}}}}const _0x210ab5={'resolveSegmentId':async _0x2f738a=>{const _0xafef6f=_0x417ec2,_0x52e6ab=_0x5e96f2['segmentNameToId'][_0xafef6f(0xcc)](_0x2f738a);if(!_0x52e6ab)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x2f738a+'\x20(referenced\x20in\x20journey\x20'+_0x5c27b6[_0xafef6f(0x151)][_0xafef6f(0x196)]+')');return _0x52e6ab;},'resolveEmbeddedSegmentId':async(_0x442064,_0x241429)=>{const _0x1d7312=_0x417ec2,_0x427199=_0x5e96f2[_0x1d7312(0xd4)]['get'](_0x442064);if(_0x427199)return _0x427199;const _0x34a2af=_0x8208a1[_0x1d7312(0xcc)](_0x442064);if(_0x34a2af)return _0x5e96f2[_0x1d7312(0xd4)][_0x1d7312(0xcf)](_0x442064,_0x34a2af),_0x34a2af;const _0x7d25dc=_0x5e96f2[_0x1d7312(0x16e)]['find'](_0x2c5a31=>_0x2c5a31[_0x1d7312(0x196)]===_0x442064);if(_0x7d25dc)return _0x5e96f2[_0x1d7312(0xd4)]['set'](_0x442064,_0x7d25dc['id']),_0x7d25dc['id'];if(_0x5c27b6[_0x1d7312(0xd3)]){const {stageName:_0x1d0628,criteriaName:_0x46d5a4}=findSegmentCriteriaLocation(_0x5c27b6['yamlConfig'],_0x442064);return _0x156d6e(_0x442064,_0x241429[_0x1d7312(0x13b)]),_0x22d887[_0x1d7312(0xcf)](_0x442064,{'definition':_0x241429,'stageName':_0x1d0628,'criteriaName':_0x46d5a4}),createPendingSegmentId(_0x442064);}const _0x2b3cf1=_0x5c27b6[_0x1d7312(0xed)]?.['id'];if(!_0x2b3cf1)throw new SDKError(ErrorCode['INTERNAL'],_0x1d7312(0x12a));_0x156d6e(_0x442064,_0x241429[_0x1d7312(0x13b)]);const _0x27d176=generateDeterministicJourneySegmentName(_0x5c27b6[_0x1d7312(0x151)][_0x1d7312(0x196)],_0x442064),_0x3535b7=_0x5e96f2[_0x1d7312(0x16e)][_0x1d7312(0xb7)](_0x57ad87=>_0x57ad87[_0x1d7312(0x196)]===_0x27d176),_0x304ca4=createSegmentIdResolver(_0x5e96f2[_0x1d7312(0xd4)],_0x442064),_0x454fc5=await resolveRuleSegmentIds(_0x241429['rule'],_0x304ca4);let _0x674048;if(_0x3535b7)await _0x54537b[_0x1d7312(0x147)][_0x1d7312(0xdc)](_0x12953b[_0x1d7312(0x180)],_0x3535b7['id'],{'description':_0x241429[_0x1d7312(0x15c)]||_0x1d7312(0x11a)+_0x442064,'rule':_0x1c27fe(_0x454fc5,!![]),'countPopulation':!![]}),_0x674048=_0x3535b7['id'];else try{_0x674048=await _0x54537b['segment']['createJourneySegment']({'name':_0x27d176,'description':_0x241429[_0x1d7312(0x15c)]||_0x1d7312(0x11a)+_0x442064,'journeyId':_0x2b3cf1,'rule':_0x1c27fe(_0x454fc5,!![]),'countPopulation':!![],'parentFolderId':_0x12953b['rootFolderId']||'','audienceId':_0x12953b[_0x1d7312(0x180)]});}catch(_0x836d43){const _0x4af9ee=_0x836d43 instanceof Error&&_0x836d43[_0x1d7312(0xe1)][_0x1d7312(0xbf)](_0x1d7312(0x10d));if(_0x4af9ee){const _0x596fd6=await _0x54537b[_0x1d7312(0x147)][_0x1d7312(0x18a)](_0x12953b[_0x1d7312(0x180)]),_0x2f2624=_0x596fd6[_0x1d7312(0xb7)](_0x1b4dc5=>_0x1b4dc5[_0x1d7312(0x196)]===_0x27d176);if(_0x2f2624)await _0x54537b['segment'][_0x1d7312(0xdc)](_0x12953b['parentId'],_0x2f2624['id'],{'description':_0x241429['description']||_0x1d7312(0x11a)+_0x442064,'rule':_0x1c27fe(_0x454fc5,!![]),'countPopulation':!![]}),_0x674048=_0x2f2624['id'];else throw _0x836d43;}else throw _0x836d43;}return _0x5e96f2[_0x1d7312(0xd4)][_0x1d7312(0xcf)](_0x442064,_0x674048),_0x2ebaad['set'](_0x442064,_0x674048),_0x674048;},'resolveActivationId':async _0x3be93b=>{const _0x129aef=_0x417ec2,_0x2f46bb=_0x5f1a84[_0x129aef(0xcc)](_0x3be93b);if(_0x2f46bb)return _0x2f46bb;if(_0x5c27b6[_0x129aef(0xed)]){await _0x49e31e();const _0x48c1d8=_0x5f1a84[_0x129aef(0xcc)](_0x3be93b);if(_0x48c1d8)return _0x48c1d8;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x3be93b+_0x129aef(0x116)+_0x5c27b6['yamlConfig'][_0x129aef(0x196)]+_0x129aef(0x15a)+_0x129aef(0xe6));},'resolveEmbeddedActivationId':async(_0x12296d,_0x4dd2c1)=>{const _0x2268e1=_0x417ec2,_0x410307=_0x5f1a84['get'](_0x12296d);if(_0x410307)return _0x410307;if(_0x5c27b6['isNew'])return _0x3d92f9[_0x2268e1(0xcf)](_0x12296d,_0x4dd2c1),createPendingActivationId(_0x12296d);if(_0x5c27b6[_0x2268e1(0xed)]){await _0x49e31e();const _0x1f493=_0x5f1a84[_0x2268e1(0xcc)](_0x4dd2c1['name']);if(_0x1f493)return _0x5f1a84[_0x2268e1(0xcf)](_0x12296d,_0x1f493),_0x1f493;const _0x200f66=activationSignature(_0x4dd2c1),_0x15622b=_0x59d352?.['get'](_0x200f66);if(_0x15622b)return _0x5f1a84[_0x2268e1(0xcf)](_0x12296d,_0x15622b),_0x15622b;const _0x22dd95=await _0x135786(_0x4dd2c1,_0x5e96f2[_0x2268e1(0xfc)]),_0x5781a8=await _0x54537b[_0x2268e1(0x14b)][_0x2268e1(0x186)](_0x5c27b6['existingJourney']['id'],_0x22dd95);return _0x5f1a84['set'](_0x12296d,_0x5781a8['id']),_0x5781a8['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x2268e1(0x155));},'resolveJourneyId':async _0x192137=>{const _0x329db6=_0x417ec2;try{return await _0x54537b[_0x329db6(0x14b)][_0x329db6(0x107)](_0x12953b[_0x329db6(0x180)],_0x192137);}catch(_0x2c5799){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x192137+_0x329db6(0xfb)+_0x5c27b6[_0x329db6(0x151)][_0x329db6(0x196)]+'\x27)',_0x2c5799);}},'resolveStageId':async(_0x1e2f56,_0x4c54f7)=>{const _0xfc55c3=_0x417ec2,_0x1be8e=await _0x54537b[_0xfc55c3(0x14b)][_0xfc55c3(0x13f)](_0x1e2f56),_0x59b39a=_0x1be8e[_0xfc55c3(0x110)][_0xfc55c3(0x194)][_0xfc55c3(0xb7)](_0x28ed1b=>_0x28ed1b[_0xfc55c3(0x196)]['toLowerCase']()===_0x4c54f7['toLowerCase']());if(!_0x59b39a?.['id'])throw new SDKError(ErrorCode[_0xfc55c3(0x12c)],_0xfc55c3(0xb1)+_0x4c54f7+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x1be8e['attributes'][_0xfc55c3(0x114)]||_0x1be8e[_0xfc55c3(0x110)]['name'])+'\x27');return _0x59b39a['id'];}},_0x89d491=await _0x29e93e(_0x5c27b6[_0x417ec2(0x151)],_0x12953b[_0x417ec2(0x180)],_0x210ab5),_0x3d3b9f=_0x12953b['folderId']||_0x12953b['rootFolderId'];_0x3d3b9f&&(_0x89d491[_0x417ec2(0xba)]={'parentFolder':{'data':{'id':_0x3d3b9f,'type':_0x417ec2(0x132)}}});if(_0x5c27b6['isNew']){if(_0x22d887[_0x417ec2(0x14d)]>0x0||_0x3d92f9[_0x417ec2(0x14d)]>0x0)return await executeThreeStepJourneyCreate(_0x54537b,_0x5c27b6,_0x89d491,{'pendingEmbeddedSegments':_0x22d887,'pendingEmbeddedActivations':_0x3d92f9,'embeddedSegmentNameToId':_0x2ebaad,'journeyActivationNameToId':_0x5f1a84},{..._0x12953b,'effectiveFolderId':_0x3d3b9f},_0x5e96f2,_0x3c8862,_0x2d7f66);else{ensureJourneyDefaults(_0x89d491[_0x417ec2(0x110)]);const _0x167e67=await _0x54537b[_0x417ec2(0x14b)][_0x417ec2(0x168)](_0x89d491);return{'action':_0x417ec2(0x109),'journeyId':_0x167e67['id'],'embeddedSegmentNameToId':_0x2ebaad};}}else{if(_0x5c27b6[_0x417ec2(0x164)]&&_0x5c27b6[_0x417ec2(0xed)])return ensureJourneyDefaults(_0x89d491[_0x417ec2(0x110)]),await _0x54537b[_0x417ec2(0x14b)][_0x417ec2(0xac)](_0x5c27b6['existingJourney']['id'],_0x89d491),{'action':'updated','journeyId':_0x5c27b6['existingJourney']['id'],'embeddedSegmentNameToId':_0x2ebaad};}return{'action':_0x417ec2(0x11c),'journeyId':_0x5c27b6['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x2ebaad};}function findSegmentCriteriaLocation(_0x5c2fe8,_0x17f5c9){const _0x448d27=a98_0x546590,_0x5a1ba9=_0x5c2fe8[_0x448d27(0xc0)]||_0x5c2fe8['journeys']?.[0x0]?.[_0x448d27(0xc0)]||[];let _0xf11fba='entry',_0x1b8734=_0x17f5c9;const _0x373aea=_0x5c2fe8['goal']||_0x5c2fe8['journeys']?.[0x0]?.[_0x448d27(0x179)];if(_0x373aea?.[_0x448d27(0x147)]===_0x17f5c9)return{'stageName':_0x448d27(0x179),'criteriaName':_0x373aea[_0x448d27(0x196)]||_0x17f5c9};_0x53670f:for(const _0x2df1a5 of _0x5a1ba9){if(_0x2df1a5[_0x448d27(0x185)]?.[_0x448d27(0x147)]===_0x17f5c9){_0xf11fba=_0x2df1a5[_0x448d27(0x196)],_0x1b8734=_0x2df1a5[_0x448d27(0x185)][_0x448d27(0x196)]||_0x17f5c9;break;}if(_0x2df1a5[_0x448d27(0x15b)])for(const _0x349ec5 of _0x2df1a5[_0x448d27(0x15b)]){if(_0x349ec5[_0x448d27(0x104)]===_0x448d27(0xb5)&&_0x349ec5['with']?.[_0x448d27(0xe4)])for(const _0x3be348 of _0x349ec5[_0x448d27(0xa9)][_0x448d27(0xe4)]){if(_0x3be348['segment']===_0x17f5c9){_0xf11fba=_0x2df1a5['name'],_0x1b8734=_0x3be348['name']||_0x17f5c9;break _0x53670f;}}}}return{'stageName':_0xf11fba,'criteriaName':_0x1b8734};}async function executeThreeStepJourneyCreate(_0x1d60a9,_0xc601b2,_0x3069fb,_0x3dd6e8,_0x532cef,_0x4edd22,_0x56b4f8,_0x4cdacf){const _0x3ed775=a98_0x546590,{activationDefToCreateRequest:_0x2aa74e,yamlRuleToApi:_0x197fa7}=_0x4cdacf,{pendingEmbeddedSegments:_0x1af192,pendingEmbeddedActivations:_0x473531,embeddedSegmentNameToId:_0x10f7fd}=_0x3dd6e8,_0x4fd9e7=JSON[_0x3ed775(0x176)](JSON['stringify'](_0x3069fb));ensureJourneyDefaults(_0x4fd9e7['attributes']),stripPendingIds(_0x4fd9e7);const _0x39148c=await _0x1d60a9[_0x3ed775(0x14b)][_0x3ed775(0x168)](_0x4fd9e7),_0x48a56f=_0x39148c['id'],_0x47815c=new Map();for(const _0x5196b9 of _0x39148c['attributes']['journeyStages']){_0x47815c[_0x3ed775(0xcf)](_0x5196b9[_0x3ed775(0x196)]['toLowerCase'](),_0x5196b9['id']);}for(const [_0x22a7a7,{definition:_0x520b57}]of _0x1af192){const _0x10dba9=generateDeterministicJourneySegmentName(_0xc601b2['yamlConfig'][_0x3ed775(0x196)],_0x22a7a7);_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0xb6),'journeyName':_0xc601b2['yamlConfig'][_0x3ed775(0x196)],'segmentName':_0x22a7a7});const _0x4e9d1c=createSegmentIdResolver(_0x4edd22[_0x3ed775(0xd4)],_0x22a7a7),_0x283079=await resolveRuleSegmentIds(_0x520b57[_0x3ed775(0x13b)],_0x4e9d1c),_0x4e9dba=await _0x1d60a9[_0x3ed775(0x147)][_0x3ed775(0x18f)]({'name':_0x10dba9,'description':_0x520b57[_0x3ed775(0x15c)]||'Entry\x20criteria:\x20'+_0x22a7a7,'journeyId':_0x48a56f,'rule':_0x197fa7(_0x283079,!![]),'countPopulation':!![],'parentFolderId':_0x532cef[_0x3ed775(0x16d)]||'','audienceId':_0x532cef[_0x3ed775(0x180)]});_0x10f7fd[_0x3ed775(0xcf)](_0x22a7a7,_0x4e9dba),_0x4edd22[_0x3ed775(0xd4)]['set'](_0x22a7a7,_0x4e9dba),_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0xc5),'journeyName':_0xc601b2[_0x3ed775(0x151)][_0x3ed775(0x196)],'segmentName':_0x22a7a7});}const _0x4fe1f4=new Map();for(const [_0x44694c,_0x1e30cd]of _0x473531){_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0xd1),'journeyName':_0xc601b2[_0x3ed775(0x151)][_0x3ed775(0x196)],'activationName':_0x44694c});const _0x334216=await _0x2aa74e(_0x1e30cd,_0x4edd22['activationContext']),_0x294490=await _0x1d60a9['journey']['createActivation'](_0x48a56f,_0x334216);_0x4fe1f4[_0x3ed775(0xcf)](_0x44694c,_0x294490['id']),_0x3dd6e8['journeyActivationNameToId'][_0x3ed775(0xcf)](_0x44694c,_0x294490['id']),_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0x153),'journeyName':_0xc601b2[_0x3ed775(0x151)]['name'],'activationName':_0x44694c});}const _0x30af86=JSON[_0x3ed775(0x176)](JSON[_0x3ed775(0xc1)](_0x3069fb));return _0x30af86['id']=_0x48a56f,ensureJourneyDefaults(_0x30af86[_0x3ed775(0x110)]),resolvePendingIdsInRequest(_0x30af86,_0x3069fb,_0x47815c,_0x10f7fd,_0x4fe1f4,_0x56b4f8),await _0x1d60a9[_0x3ed775(0x14b)][_0x3ed775(0xac)](_0x48a56f,_0x30af86),{'action':_0x3ed775(0x109),'journeyId':_0x48a56f,'embeddedSegmentNameToId':_0x10f7fd};}function stripPendingIds(_0x1a81e3){const _0x502357=a98_0x546590;for(const _0xed62e1 of _0x1a81e3[_0x502357(0x110)][_0x502357(0x194)]||[]){_0xed62e1['entryCriteria']?.[_0x502357(0xbb)]&&isPendingSegmentId(_0xed62e1['entryCriteria'][_0x502357(0xbb)])&&delete _0xed62e1['entryCriteria'];if(_0xed62e1[_0x502357(0x15b)])for(const _0x5e0abb of Object['keys'](_0xed62e1[_0x502357(0x15b)])){const _0x30ba1e=_0xed62e1[_0x502357(0x15b)][_0x5e0abb];_0x30ba1e[_0x502357(0x104)]===_0x502357(0x115)&&_0x30ba1e[_0x502357(0x190)]&&isPendingActivationId(_0x30ba1e[_0x502357(0x190)])&&(_0x30ba1e['journeyActivationStepId']='');if(_0x30ba1e[_0x502357(0x104)]==='DecisionPoint'&&_0x30ba1e[_0x502357(0xe4)])for(const _0x120840 of _0x30ba1e[_0x502357(0xe4)]){_0x120840[_0x502357(0xbb)]&&isPendingSegmentId(_0x120840['segmentId'])&&(_0x120840['segmentId']='');}_0x30ba1e['type']===_0x502357(0xfe)&&_0x30ba1e[_0x502357(0x177)]?.[_0x502357(0xbb)]&&isPendingSegmentId(_0x30ba1e[_0x502357(0x177)]['segmentId'])&&(_0x30ba1e['waitCondition'][_0x502357(0xbb)]='');}}}function resolvePendingIdsInRequest(_0x5c2843,_0x30f2fc,_0x41780e,_0x450ed1,_0x2596f7,_0xed2c59){const _0x1d270e=a98_0x546590,_0x183b87=(_0x5d9167,_0x5e96d0)=>{const _0x4f892b=a98_0xd296;if(!isPendingSegmentId(_0x5d9167))return _0x5d9167;const _0x55666c=extractPendingSegmentName(_0x5d9167),_0x3b7759=_0x450ed1[_0x4f892b(0xcc)](_0x55666c);return!_0x3b7759&&_0xed2c59[_0x4f892b(0x171)]?.(_0x4f892b(0xbe)+_0x55666c+_0x4f892b(0x118)+_0x5e96d0),_0x3b7759;};if(_0x5c2843[_0x1d270e(0x110)][_0x1d270e(0x179)]?.[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x5c2843[_0x1d270e(0x110)][_0x1d270e(0x179)][_0x1d270e(0xbb)])){const _0x240646=_0x183b87(_0x5c2843[_0x1d270e(0x110)]['goal'][_0x1d270e(0xbb)],_0x1d270e(0xb4));_0x240646&&(_0x5c2843['attributes'][_0x1d270e(0x179)][_0x1d270e(0xbb)]=_0x240646);}for(const _0x139df9 of _0x5c2843[_0x1d270e(0x110)][_0x1d270e(0x194)]||[]){const _0x5a7c24=_0x41780e[_0x1d270e(0xcc)](_0x139df9[_0x1d270e(0x196)][_0x1d270e(0xa8)]());_0x5a7c24&&(_0x139df9['id']=_0x5a7c24);if(_0x139df9[_0x1d270e(0xe5)]?.[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x139df9[_0x1d270e(0xe5)][_0x1d270e(0xbb)])){const _0x2cd4fc=_0x183b87(_0x139df9[_0x1d270e(0xe5)]['segmentId'],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0x17e));_0x2cd4fc&&(_0x139df9[_0x1d270e(0xe5)][_0x1d270e(0xbb)]=_0x2cd4fc);}if(_0x139df9[_0x1d270e(0x12e)])for(const _0x3b6988 of _0x139df9['exitCriterias']){if(_0x3b6988[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x3b6988[_0x1d270e(0xbb)])){const _0x5963bc=_0x183b87(_0x3b6988[_0x1d270e(0xbb)],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+'\x27\x20exit\x20criteria');_0x5963bc&&(_0x3b6988['segmentId']=_0x5963bc);}}if(_0x139df9[_0x1d270e(0xec)]?.['segmentId']&&isPendingSegmentId(_0x139df9[_0x1d270e(0xec)][_0x1d270e(0xbb)])){const _0x4b9cd3=_0x183b87(_0x139df9[_0x1d270e(0xec)]['segmentId'],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0xc6));_0x4b9cd3&&(_0x139df9[_0x1d270e(0xec)][_0x1d270e(0xbb)]=_0x4b9cd3);}if(_0x139df9[_0x1d270e(0x15b)]){const _0x1ec80d=_0x3e8f3e=>_0x30f2fc[_0x1d270e(0x110)]['journeyStages'][_0x1d270e(0xb7)](_0x199a67=>_0x199a67[_0x1d270e(0x196)][_0x1d270e(0xa8)]()===_0x139df9[_0x1d270e(0x196)][_0x1d270e(0xa8)]())?.['steps']?.[_0x3e8f3e];for(const _0x1e218e of Object[_0x1d270e(0x100)](_0x139df9[_0x1d270e(0x15b)])){const _0x22f18f=_0x139df9['steps'][_0x1e218e],_0x22e6a2=_0x1ec80d(_0x1e218e);if(_0x22f18f[_0x1d270e(0x104)]===_0x1d270e(0x115)&&_0x22f18f[_0x1d270e(0x190)]&&(isPendingActivationId(_0x22f18f[_0x1d270e(0x190)])||_0x22f18f['journeyActivationStepId']==='')){if(_0x22e6a2?.[_0x1d270e(0x190)]&&isPendingActivationId(_0x22e6a2['journeyActivationStepId'])){const _0x34e34c=extractPendingActivationName(_0x22e6a2[_0x1d270e(0x190)]),_0x4216b7=_0x2596f7[_0x1d270e(0xcc)](_0x34e34c);_0x4216b7&&(_0x22f18f[_0x1d270e(0x190)]=_0x4216b7);}}if(_0x22f18f[_0x1d270e(0x104)]===_0x1d270e(0xfd)&&_0x22f18f[_0x1d270e(0xe4)]&&_0x22e6a2?.[_0x1d270e(0xe4)])for(let _0x3c4ec9=0x0;_0x3c4ec9<_0x22f18f[_0x1d270e(0xe4)][_0x1d270e(0x16f)];_0x3c4ec9++){const _0x3afc10=_0x22f18f[_0x1d270e(0xe4)][_0x3c4ec9],_0x29922e=_0x22e6a2[_0x1d270e(0xe4)][_0x3c4ec9];if(_0x29922e?.['segmentId']&&isPendingSegmentId(_0x29922e[_0x1d270e(0xbb)])){const _0x1ef0a4=_0x183b87(_0x29922e[_0x1d270e(0xbb)],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0xe7)+(_0x3afc10[_0x1d270e(0x196)]||_0x3c4ec9)+'\x27');_0x1ef0a4&&(_0x3afc10[_0x1d270e(0xbb)]=_0x1ef0a4);}}if(_0x22f18f['type']===_0x1d270e(0xfe)&&_0x22f18f['waitCondition']?.[_0x1d270e(0xbb)]&&_0x22e6a2?.[_0x1d270e(0x177)]?.[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x22e6a2[_0x1d270e(0x177)][_0x1d270e(0xbb)])){const _0x2c8f37=_0x183b87(_0x22e6a2[_0x1d270e(0x177)]['segmentId'],'stage\x20\x27'+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0xdf));_0x2c8f37&&(_0x22f18f[_0x1d270e(0x177)][_0x1d270e(0xbb)]=_0x2c8f37);}}}}}
|
|
1
|
+
const a100_0x25feef=a100_0x386c;(function(_0x22a4b7,_0x46a1e5){const _0x19cce8=a100_0x386c,_0x497656=_0x22a4b7();while(!![]){try{const _0x7ee3e3=-parseInt(_0x19cce8(0x1c6))/0x1+-parseInt(_0x19cce8(0x18f))/0x2+parseInt(_0x19cce8(0x1b4))/0x3*(parseInt(_0x19cce8(0x199))/0x4)+parseInt(_0x19cce8(0xfb))/0x5+parseInt(_0x19cce8(0x17a))/0x6*(-parseInt(_0x19cce8(0x192))/0x7)+parseInt(_0x19cce8(0x130))/0x8+parseInt(_0x19cce8(0x13d))/0x9*(parseInt(_0x19cce8(0x164))/0xa);if(_0x7ee3e3===_0x46a1e5)break;else _0x497656['push'](_0x497656['shift']());}catch(_0x2426e3){_0x497656['push'](_0x497656['shift']());}}}(a100_0x4dc7,0x92e5d));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x25feef(0x189);export const PENDING_ACTIVATION_PREFIX=a100_0x25feef(0x1c5);export function createPendingSegmentId(_0x463766){return''+PENDING_SEGMENT_PREFIX+_0x463766+'__';}export function isPendingSegmentId(_0x2fc4e7){return _0x2fc4e7['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x276644){return _0x276644['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x195359){return''+PENDING_ACTIVATION_PREFIX+_0x195359+'__';}export function isPendingActivationId(_0x595b58){const _0x555455=a100_0x25feef;return _0x595b58[_0x555455(0x1bb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x2e6133){const _0x46f2cc=a100_0x25feef;return _0x2e6133[_0x46f2cc(0x1ac)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x1daae3,_0x5f08a9){const _0x2cdee3=a100_0x25feef,_0x53491e=_0x1daae3+'::'+(_0x5f08a9[_0x2cdee3(0x14a)]()||_0x2cdee3(0x15d)),_0x4481aa=createHash(_0x2cdee3(0x1c3))[_0x2cdee3(0x10a)](_0x53491e)['digest'](_0x2cdee3(0x142))['slice'](0x0,0xc);return _0x2cdee3(0x1c0)+_0x4481aa;}export function ensureJourneyDefaults(_0x5e910e){const _0x5162ef=a100_0x25feef;!_0x5e910e['description']&&(_0x5e910e[_0x5162ef(0x114)]=''),!_0x5e910e[_0x5162ef(0x158)]&&(_0x5e910e['state']=_0x5162ef(0x1d1));}export function resolveTDFolderPath(_0x17e495,_0x458e8d,_0x38a48e){const _0x13d878=a100_0x25feef;if(!_0x458e8d)return _0x17e495;if(_0x17e495===_0x38a48e||_0x17e495[_0x13d878(0x1bb)](_0x38a48e+'/'))return _0x17e495;return _0x17e495?_0x38a48e+'/'+_0x17e495:_0x38a48e;}export function addFoldersToCreate(_0x1adbff,_0x56995e,_0x4d0562){const _0x11c41b=a100_0x25feef;if(!_0x1adbff)return;if(_0x56995e[_0x11c41b(0x16a)](_0x1adbff))return;const _0x53a48c=_0x1adbff[_0x11c41b(0x162)]('/');let _0x13ff3a='';for(const _0x3beb49 of _0x53a48c){_0x13ff3a=_0x13ff3a?_0x13ff3a+'/'+_0x3beb49:_0x3beb49,!_0x56995e[_0x11c41b(0x16a)](_0x13ff3a)&&_0x4d0562[_0x11c41b(0x132)](_0x13ff3a);}}function a100_0x4dc7(){const _0x3093fa=['getJourney','171940QvBpDU','waitCondition','\x27\x20for\x20','getActivation','idToEmailMap','Updating\x20segment\x20\x27','has','null','activation_updated','folder','existingSegment','activation_updating','flatMap','valid','SEGMENT_UPDATE_ERROR','NOT_FOUND','Activation','folder_created','type','slice','\x27...','versionNumber','12UYSKoM','entry_criteria','DecisionPoint','hasChanges','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','updateSegmentById','Entry\x20criteria:\x20','existingJourney','journey','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','toLowerCase','activation_deleting','Deleted\x20activation\x20\x27','relationships','yamlConfig','__pending_','listSegments','columns','getSegment','embedded_activation_creating','connection','775658MLbCAq','Created\x20folder\x20\x27','nameToType','2611966RTmKkj','journeyStages','logInfo','segment_deleted','entries','segments','decision_point','100396UDhpzz','activation_','behavior','goal','push','localSegmentRules','progress','createSegment','withProgress','fetchJourney','exitCriterias','activationContext','idToName','branches','effectiveFolderId','diff','Activation\x20not\x20found:\x20','activation_template_id','all_columns','replace','existingActivation','\x20activation\x20\x27','createFolder','buildUserMaps','all','activation_deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','21JFBjyH','createdSegmentIds','validatedRequest','rule','deps','folderPathToId','Name\x20has\x20already\x20been\x20taken','startsWith','entryCriteria','journeyId','created','connectionIdToNameMap','journey_entry_criteria_','milestone','activationStepsById','sha1','segmentByFolderAndName','__pending_act_','408934pEoUta','with','Created\x20journey\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','isNew','\x0a\x20\x20','stages','journeys','filter','segmentNameToId','find','draft','JOURNEY_UPDATE_ERROR','keys','journey_updating','kind','data','JOURNEY_SYNTAX_ERROR','activation_creating','journey_updated','segment_created','1058785XxPhCH','values','Fetching\x20','Creating\x20activation\x20\x27','dirname','reduce','folderPath','segment_updated','delete','deleteSegment','Journey\x20\x27','notification','relative','steps','list','update','index','get','folder_creating','journeyActivationNameToId','segment_creating','unchanged','ACTIVATION_UPDATE_ERROR','createdSegmentId','schedule','description','sort','\x27\x20decision\x20point\x20branch\x20\x27','object','segment_updating','utf-8','Updated\x20activation\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','INTERNAL','WaitStep','length','activations','action','errors','):\x20','segment_deleting','activation_created','createActivation','skipSegments','\x27\x20exit\x20criteria','updated','logSuccess','includes','\x20error(s)','updateActivation','existingSegments','join','6768000fYkJAd','Creating\x20segment\x20\x27','add','../../utils/async.js','createJourneySegment','./journey-yaml.js','create','Failed\x20to\x20','item','size','max','absolutePath','\x27\x20wait\x20condition','477fyzDuO','parse','journeyById','parentFolder','logDeleted','hex','stage\x20\x27','attributes','segmentId','journeyActivationStepId','segmentFolderId','resolveJourneyId','\x20(referenced\x20in\x20journey\x20','trim','ACTIVATION_SYNTAX_ERROR','deleted','map','journeyBundleName','name','from','\x27\x20not\x20found\x20in\x20journey\x20\x27','onProgress','deleteActivation','Deleted\x20segment\x20\x27','parentId','folderId','\x20segment\x20from\x20file:\x20','state','set','yamlActivation','Updated\x20journey\x20\x27','SEGMENT_NOT_FOUND','segment','Created\x20segment\x20\x27','embeddedSegmentNameToId','stringify','./child-segment-yaml.js','split'];a100_0x4dc7=function(){return _0x3093fa;};return a100_0x4dc7();}import*as a100_0x226117 from'yaml';import{readFileSync}from'fs';import a100_0x4cc6a1 from'path';import{isJourneyDef,parseYamlString as a100_0x54e692,toYamlString as a100_0x3a64c3,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function a100_0x386c(_0x3a574f,_0x5d35d2){_0x3a574f=_0x3a574f-0xf2;const _0x4dc740=a100_0x4dc7();let _0x386c82=_0x4dc740[_0x3a574f];return _0x386c82;}function stableStringify(_0x53ea2d){const _0x607793=a100_0x25feef;if(Array['isArray'](_0x53ea2d))return'['+_0x53ea2d[_0x607793(0x14d)](_0x427ceb=>stableStringify(_0x427ceb))[_0x607793(0x12f)](',')+']';if(_0x53ea2d&&typeof _0x53ea2d===_0x607793(0x117)){const _0x49ad58=_0x53ea2d,_0x84f5b3=Object[_0x607793(0xf3)](_0x49ad58)['sort'](),_0x454b33=_0x84f5b3[_0x607793(0x14d)](_0xc09907=>'\x22'+_0xc09907+'\x22:'+stableStringify(_0x49ad58[_0xc09907]));return'{'+_0x454b33['join'](',')+'}';}const _0x4b06aa=JSON[_0x607793(0x160)](_0x53ea2d);return _0x4b06aa===undefined?_0x607793(0x16b):_0x4b06aa;}function activationSignature(_0xc68326){const _0x7db68e=a100_0x25feef,_0x15b19c={'connection':_0xc68326[_0x7db68e(0x18e)],..._0xc68326[_0x7db68e(0x1ab)]!==undefined&&{'all_columns':_0xc68326[_0x7db68e(0x1ab)]},..._0xc68326[_0x7db68e(0x18b)]!==undefined&&{'columns':_0xc68326[_0x7db68e(0x18b)]},..._0xc68326[_0x7db68e(0x19b)]!==undefined&&{'behavior':_0xc68326[_0x7db68e(0x19b)]},..._0xc68326[_0x7db68e(0x113)]!==undefined&&{'schedule':_0xc68326['schedule']},..._0xc68326['notification']!==undefined&&{'notification':_0xc68326[_0x7db68e(0x106)]},..._0xc68326['connector_config']!==undefined&&{'connector_config':_0xc68326['connector_config']},..._0xc68326[_0x7db68e(0x1aa)]!==undefined&&{'activation_template_id':_0xc68326[_0x7db68e(0x1aa)]}};return stableStringify(_0x15b19c);}export async function prepareSegmentFiles(_0x565e7d,_0x243453,_0x958042,_0x35c742,_0x37195f){const _0x360f04=a100_0x25feef,{activationDefToCreateRequest:_0x590795}=await import(_0x360f04(0x161)),_0x119450=[],_0x4eed78=new Set();for(const {yamlConfig:_0x1c9fcf,folderPath:_0xab9427,sourcePath:_0x1124dc}of _0x565e7d){const _0x4c0072=resolveTDFolderPath(_0xab9427,_0x35c742,_0x37195f),_0x3cf690=_0x4c0072+':'+_0x1c9fcf[_0x360f04(0x14f)],_0x3af6f2=_0x243453[_0x360f04(0x1c4)]['get'](_0x3cf690),_0xd874e0=_0x3af6f2?_0x243453['activationsBySegmentId']['get'](_0x3af6f2['id'])||[]:[];addFoldersToCreate(_0x4c0072,_0x243453[_0x360f04(0x1b9)],_0x4eed78);const _0x4f4361=calculateActivationActions(_0x1c9fcf[_0x360f04(0x120)]||[],_0xd874e0,_0x243453[_0x360f04(0x168)],_0x243453[_0x360f04(0x1bf)]);for(const _0x2f81b9 of _0x4f4361){(_0x2f81b9[_0x360f04(0x176)]===_0x360f04(0x136)||_0x2f81b9['type']==='update')&&_0x2f81b9[_0x360f04(0x15a)]&&(_0x2f81b9[_0x360f04(0x1b6)]=await _0x590795(_0x2f81b9[_0x360f04(0x15a)],_0x958042));}const _0x2be191=calculateSegmentDiff(_0x1c9fcf,_0x3af6f2,_0xd874e0,_0x243453[_0x360f04(0x168)],_0x243453[_0x360f04(0x1bf)]);_0x119450[_0x360f04(0x19d)]({'relativePath':_0x1c9fcf[_0x360f04(0x14f)],'absolutePath':_0x1124dc,'yamlConfig':_0x1c9fcf,'folderPath':_0x4c0072,'existingSegment':_0x3af6f2,'existingActivations':_0xd874e0,'isNew':_0x2be191[_0x360f04(0x1ca)],'hasChanges':_0x2be191[_0x360f04(0x17d)],'diff':_0x2be191['diff'],'activationActions':_0x4f4361});}return{'segmentFiles':_0x119450,'foldersToCreate':_0x4eed78};}export async function prepareJourneyFiles(_0x570d78,_0x1052fd,_0x310958,_0x4d0321){const _0x8bc3e8=a100_0x25feef,_0x40b4b1=[],_0x590deb=new Set();for(const {yamlConfig:_0x5834ff,folderPath:_0x530eeb,sourcePath:_0x3e52ed}of _0x570d78){const _0x3bb115=resolveTDFolderPath(_0x530eeb,_0x310958,_0x4d0321),_0x35a1d4=_0x3bb115+':'+_0x5834ff[_0x8bc3e8(0x14f)],_0x3969f1=_0x1052fd['journeyBundlesByFolderAndName'][_0x8bc3e8(0x10c)](_0x35a1d4);let _0x2a4591,_0x406b94;if(_0x3969f1&&_0x3969f1[_0x8bc3e8(0x11f)]>0x0){const _0x1e76b9=buildLocalExpandedRuleMappings(_0x5834ff),{createYamlContext:_0x29ce12,prefetchJourneySegments:_0x197019}=createPushYamlContextForBundle(_0x1052fd[_0x8bc3e8(0x1b8)],_0x1052fd[_0x8bc3e8(0x155)],_0x1052fd['existingSegments'],_0x1e76b9,_0x1052fd[_0x8bc3e8(0x168)],_0x1052fd[_0x8bc3e8(0x1bf)],_0x1052fd[_0x8bc3e8(0x1c2)],_0x1052fd[_0x8bc3e8(0x13f)]);await _0x197019(_0x3969f1[_0x8bc3e8(0x14d)](_0x446ef8=>_0x446ef8['id']));const _0x2895ab=hasMultipleVersions(_0x5834ff),_0xff17a7=async _0x321016=>{const _0x534b41=_0x8bc3e8,_0x5ef366=_0x1052fd[_0x534b41(0x13f)]?.[_0x534b41(0x10c)](_0x321016);if(_0x5ef366)return _0x5ef366;return _0x1052fd[_0x534b41(0x1a2)]({'journeyId':_0x321016,'journeyName':_0x5834ff[_0x534b41(0x14f)],'isMultiVersion':_0x3969f1['length']>0x1});};if(_0x2895ab&&_0x3969f1['length']>0x1){const _0x52651c=[];for(const _0x2c3010 of _0x3969f1){const _0x5e841d=_0x2c3010[_0x8bc3e8(0x179)]||0x1;_0x1052fd['progress']?.[_0x8bc3e8(0x10a)](_0x8bc3e8(0xfd)+_0x5834ff[_0x8bc3e8(0x14f)]+'\x20v'+_0x5e841d);const _0x375ff2=await _0xff17a7(_0x2c3010['id']),_0x5b263f=_0x29ce12(_0x2c3010['id']),_0x48d507=await journeyResponseToDef(_0x375ff2,_0x5b263f);_0x52651c[_0x8bc3e8(0x19d)]({'item':_0x2c3010,'yaml':_0x48d507});}const _0x58f8df=buildLocalRuleToNameMappingFromJourney(_0x5834ff);_0x406b94=buildMergedJourneyDef(_0x52651c,_0x58f8df);const _0x38fb58=Math['max'](..._0x52651c[_0x8bc3e8(0x14d)](_0x3afdb7=>_0x3afdb7[_0x8bc3e8(0x138)]['versionNumber']||0x0)),_0x45ce53=_0x3969f1[_0x8bc3e8(0x1d0)](_0x531a8d=>(_0x531a8d[_0x8bc3e8(0x179)]||0x0)===_0x38fb58);_0x45ce53&&(_0x1052fd[_0x8bc3e8(0x19f)]?.[_0x8bc3e8(0x10a)]('Fetching\x20'+_0x5834ff['name']+'\x20v'+_0x38fb58),_0x2a4591=await _0xff17a7(_0x45ce53['id']));}else{const _0x28b4ce=_0x3969f1[_0x3969f1[_0x8bc3e8(0x11f)]-0x1];_0x1052fd[_0x8bc3e8(0x19f)]?.[_0x8bc3e8(0x10a)]('Fetching\x20'+_0x5834ff[_0x8bc3e8(0x14f)]),_0x2a4591=await _0xff17a7(_0x28b4ce['id']);const _0x3f99cf=_0x29ce12(_0x28b4ce['id']),_0x2f0d01=await journeyResponseToDef(_0x2a4591,_0x3f99cf),_0x2f98f8=buildLocalRuleToNameMappingFromJourney(_0x5834ff);_0x406b94=buildMergedJourneyDef([{'item':_0x28b4ce,'yaml':_0x2f0d01}],_0x2f98f8);}}addFoldersToCreate(_0x3bb115,_0x1052fd[_0x8bc3e8(0x1b9)],_0x590deb);const _0x518b35=calculateJourneyDiff(_0x5834ff,_0x406b94);_0x40b4b1[_0x8bc3e8(0x19d)]({'relativePath':_0x5834ff[_0x8bc3e8(0x14f)],'absolutePath':_0x3e52ed,'yamlConfig':_0x5834ff,'folderPath':_0x3bb115,'existingJourney':_0x2a4591,'isNew':_0x518b35[_0x8bc3e8(0x1ca)],'hasChanges':_0x518b35[_0x8bc3e8(0x17d)],'diff':_0x518b35[_0x8bc3e8(0x1a8)]});}return{'journeyFiles':_0x40b4b1,'foldersToCreate':_0x590deb};}export function calculateActivationActions(_0x111326,_0x50ec3f,_0x2b4628,_0x3f943e){const _0x3072bd=a100_0x25feef,_0x221470=[],_0x219336=new Map();for(const _0xeb4d89 of _0x50ec3f){_0x219336[_0x3072bd(0x159)](_0xeb4d89[_0x3072bd(0x14f)],_0xeb4d89);}const _0x501a42=new Map();for(const _0x2753f3 of _0x111326){_0x501a42[_0x3072bd(0x159)](_0x2753f3[_0x3072bd(0x14f)],_0x2753f3);}for(const _0xb08ec of _0x111326){const _0x4d37e8=_0x219336[_0x3072bd(0x10c)](_0xb08ec['name']);if(!_0x4d37e8)_0x221470[_0x3072bd(0x19d)]({'type':_0x3072bd(0x136),'name':_0xb08ec[_0x3072bd(0x14f)],'yamlActivation':_0xb08ec});else{const _0x262c6a=activationResponseToDef(_0x4d37e8,_0x2b4628,_0x3f943e),_0x23e3e3=a100_0x226117[_0x3072bd(0x160)](_0x262c6a),_0xa41d18=a100_0x226117[_0x3072bd(0x160)](_0xb08ec);_0x23e3e3!==_0xa41d18&&_0x221470[_0x3072bd(0x19d)]({'type':'update','name':_0xb08ec[_0x3072bd(0x14f)],'yamlActivation':_0xb08ec,'existingActivation':_0x4d37e8});}}for(const _0x42a5d7 of _0x50ec3f){!_0x501a42[_0x3072bd(0x16a)](_0x42a5d7[_0x3072bd(0x14f)])&&_0x221470[_0x3072bd(0x19d)]({'type':'delete','name':_0x42a5d7[_0x3072bd(0x14f)],'existingActivation':_0x42a5d7});}return _0x221470;}export function calculateSegmentDiff(_0x48b2bc,_0x85908b,_0x1043d6,_0x3160bd,_0x3bbbc2){const _0x34d2b0=segmentToYamlString(_0x48b2bc);if(_0x85908b){const _0x209c04=segmentWithActivationsToYaml(_0x85908b,_0x1043d6,undefined,_0x3160bd,_0x3bbbc2),_0x21295d=segmentToYamlString(_0x209c04),_0x30e86f=generateDiff(_0x21295d,_0x34d2b0),_0x1aad55=hasChanges(_0x30e86f);return{'isNew':![],'hasChanges':_0x1aad55,'diff':_0x1aad55?formatDiffWithColors(_0x30e86f):undefined};}const _0x1884e9=generateDiff('',_0x34d2b0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1884e9)};}export function calculateJourneyDiff(_0x217d49,_0xe74366){const _0x408cc1=normalizeJourneyDef(_0x217d49,_0x217d49),_0x4075b6=a100_0x3a64c3(_0x408cc1);if(_0xe74366){const _0x1c8b14=normalizeJourneyDef(_0xe74366,_0x217d49),_0x58baaa=a100_0x3a64c3(_0x1c8b14),_0x1b9e7d=generateDiff(_0x58baaa,_0x4075b6),_0x527ebd=hasChanges(_0x1b9e7d);return{'isNew':![],'hasChanges':_0x527ebd,'diff':_0x527ebd?formatDiffWithColors(_0x1b9e7d):undefined};}const _0x3a827a=generateDiff('',_0x4075b6);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3a827a)};}export function findSegmentsToDelete(_0x9a3183,_0x13e86d,_0x3cf85d,_0x386633,_0x21f14d){const _0x282703=a100_0x25feef,_0x40e5f4=new Set();for(const {yamlConfig:_0x1fa284,folderPath:_0xf6cb32}of _0x13e86d){_0x40e5f4[_0x282703(0x132)](_0xf6cb32+':'+_0x1fa284[_0x282703(0x14f)]);}return _0x9a3183[_0x282703(0x1ce)](_0x2f1af2=>{const _0x300dbc=_0x282703,_0x2fcfaa=_0x2f1af2['segmentFolderId']?_0x3cf85d[_0x300dbc(0x10c)](_0x2f1af2[_0x300dbc(0x147)]['toString']())||'':'',_0x4c6d05=_0x2fcfaa+':'+_0x2f1af2[_0x300dbc(0x14f)];if(_0x40e5f4['has'](_0x4c6d05))return![];if(_0x21f14d)return _0x2fcfaa===_0x386633||_0x2fcfaa[_0x300dbc(0x1bb)](_0x386633+'/');return!![];});}export function findJourneysToDelete(_0x213412,_0x44023b,_0x5065c1,_0x47f03e,_0x336ca9){const _0x36e731=a100_0x25feef,_0x5a8505=new Set();for(const {yamlConfig:_0x573c0b,folderPath:_0x58990f}of _0x44023b){_0x5a8505[_0x36e731(0x132)](_0x58990f+':'+_0x573c0b['name']);}return _0x213412['filter'](_0x2f70ee=>{const _0x583494=_0x36e731,_0x3c59bf=_0x2f70ee[_0x583494(0x156)]?_0x5065c1['get'](_0x2f70ee[_0x583494(0x156)])||'':'',_0x2f2f64=_0x3c59bf+':'+_0x2f70ee[_0x583494(0x14e)];if(_0x5a8505[_0x583494(0x16a)](_0x2f2f64))return![];if(_0x336ca9)return _0x3c59bf===_0x47f03e||_0x3c59bf['startsWith'](_0x47f03e+'/');return!![];});}export function buildSegmentLookupMap(_0x1e8f68,_0x4d8179){const _0x514713=a100_0x25feef,_0x2f7b18=new Map();for(const _0x25c1f4 of _0x1e8f68){const _0x343f65=_0x25c1f4[_0x514713(0x147)]?_0x4d8179['get'](_0x25c1f4[_0x514713(0x147)]['toString']())||'':'',_0x1c4c7a=_0x343f65+':'+_0x25c1f4['name'];_0x2f7b18[_0x514713(0x159)](_0x1c4c7a,_0x25c1f4);}return _0x2f7b18;}export function buildSegmentNameToIdMap(_0x18cda8){const _0x185073=a100_0x25feef,_0x3f25af=new Map();for(const _0x282b93 of _0x18cda8){_0x3f25af[_0x185073(0x159)](_0x282b93[_0x185073(0x14f)],_0x282b93['id']);}return _0x3f25af;}export function buildJourneyBundleLookupMap(_0x5d2e21,_0x22fb90){const _0x13a754=a100_0x25feef,_0x4e1d29=new Map();for(const _0x5aee1f of _0x5d2e21){const _0x30fe9b=_0x5aee1f[_0x13a754(0x156)]?_0x22fb90[_0x13a754(0x10c)](_0x5aee1f['folderId'])||'':'',_0x533376=_0x30fe9b+':'+_0x5aee1f['journeyBundleName'];!_0x4e1d29['has'](_0x533376)&&_0x4e1d29[_0x13a754(0x159)](_0x533376,[]),_0x4e1d29[_0x13a754(0x10c)](_0x533376)[_0x13a754(0x19d)](_0x5aee1f);}for(const _0x238463 of _0x4e1d29[_0x13a754(0xfc)]()){_0x238463[_0x13a754(0x115)]((_0x5dd7b6,_0x1bb8a8)=>(_0x5dd7b6[_0x13a754(0x179)]||0x0)-(_0x1bb8a8[_0x13a754(0x179)]||0x0));}return _0x4e1d29;}export function collectFoldersToCreate(_0x41c4de,_0xb17952){const _0x23cb9d=a100_0x25feef,_0x43a951=new Set();for(const _0x55cd2f of _0x41c4de){if(!_0x55cd2f)continue;if(_0xb17952['has'](_0x55cd2f))continue;const _0x26f997=_0x55cd2f[_0x23cb9d(0x162)]('/');let _0xd6b761='';for(const _0x11664d of _0x26f997){_0xd6b761=_0xd6b761?_0xd6b761+'/'+_0x11664d:_0x11664d,!_0xb17952['has'](_0xd6b761)&&_0x43a951[_0x23cb9d(0x132)](_0xd6b761);}}return _0x43a951;}export function parseAndClassifyYamlFiles(_0x4cdd3f,_0x4b2718,_0x2028bc){const _0x156247=a100_0x25feef,_0x46a8cc=[],_0x4cd260=[];for(const _0x17152f of _0x4cdd3f){const _0x55d3db=a100_0x4cc6a1[_0x156247(0x107)](_0x4b2718,a100_0x4cc6a1[_0x156247(0xff)](_0x17152f)),_0x108238=_0x55d3db==='.'?'':_0x55d3db,_0x8b8c2=readFileSync(_0x17152f,'utf-8'),_0x2785fe=a100_0x226117['parse'](_0x8b8c2);if(isJourneyDef(_0x2785fe)){const _0x33e42e=a100_0x54e692(_0x8b8c2);_0x4cd260['push']({'yamlConfig':_0x33e42e,'folderPath':_0x108238,'sourcePath':_0x17152f});}else{if(!_0x2028bc?.[_0x156247(0x127)]){const _0x443ec9=parseSegmentYamlFile(_0x8b8c2),_0x3ed6bb=normalizeChildSegmentYaml(_0x443ec9);_0x46a8cc[_0x156247(0x19d)]({'yamlConfig':_0x3ed6bb,'folderPath':_0x108238,'sourcePath':_0x17152f});}}}return{'segments':_0x46a8cc,'journeys':_0x4cd260};}export function validateParsedFiles(_0x12490a,_0x29bcd0){const _0x544a07=a100_0x25feef,_0x2d7449=[];for(const {yamlConfig:_0x327a00,sourcePath:_0x4dbfb7}of _0x12490a[_0x544a07(0x197)]){const _0x126224=readFileSync(_0x4dbfb7,_0x544a07(0x119)),_0xf564cd=a100_0x226117['parseDocument'](_0x126224),_0x338e01=validateSegmentDef(_0x327a00,{'source':_0x126224,'document':_0xf564cd});if(!_0x338e01[_0x544a07(0x171)]){const _0x297c5b=a100_0x4cc6a1['relative'](_0x29bcd0,_0x4dbfb7);_0x2d7449[_0x544a07(0x19d)]({'filePath':_0x297c5b,'source':_0x126224,'result':_0x338e01,'isJourney':![]});}}for(const {yamlConfig:_0x401cfa,sourcePath:_0x2bd86a}of _0x12490a['journeys']){const _0x97bd36=readFileSync(_0x2bd86a,_0x544a07(0x119)),_0x57be96=a100_0x226117['parseDocument'](_0x97bd36),_0x5c7b45=validateJourneyDef(_0x401cfa,{'source':_0x97bd36,'document':_0x57be96});if(!_0x5c7b45[_0x544a07(0x171)]){const _0x4a4220=a100_0x4cc6a1['relative'](_0x29bcd0,_0x2bd86a);_0x2d7449[_0x544a07(0x19d)]({'filePath':_0x4a4220,'source':_0x97bd36,'result':_0x5c7b45,'isJourney':!![]});}}return _0x2d7449;}export function formatValidationErrors(_0x4e2b7e){const _0x4f45de=a100_0x25feef,_0x17b13b=[];for(const {filePath:_0x335588,source:_0x1fe930,result:_0x3f3344,isJourney:_0xa2cf56}of _0x4e2b7e){const _0x264fb0=_0xa2cf56?_0x4f45de(0x182):_0x4f45de(0x15d);_0x17b13b[_0x4f45de(0x19d)]('\x0a'+_0x335588+'\x20('+_0x264fb0+_0x4f45de(0x123)+_0x3f3344[_0x4f45de(0x122)][_0x4f45de(0x11f)]+_0x4f45de(0x12c)),_0x17b13b[_0x4f45de(0x19d)](formatValidationResult(_0x3f3344,_0x1fe930,_0x335588));}return _0x17b13b[_0x4f45de(0x12f)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4da6de){const _0x4eb50e=a100_0x25feef,_0x48f2da=new Set(),_0x2e1ec3=new Map(),_0x52e150=collectSegmentUsageCounts(_0x4da6de);if(_0x4da6de['segments'])for(const [_0x3cac72,_0x24db47]of Object[_0x4eb50e(0x196)](_0x4da6de['segments'])){_0x48f2da[_0x4eb50e(0x132)](_0x3cac72);if(_0x24db47[_0x4eb50e(0x1b7)]){const _0x5a9f5f=yamlRuleToApi(_0x24db47['rule']),_0x5da0aa=apiRuleToYaml(_0x5a9f5f);_0x2e1ec3['set'](_0x3cac72,_0x5da0aa);}}const _0x3681c3=new Map();let _0x3ca06c=0x0;for(const [_0x3ec044,_0x1ad216]of _0x2e1ec3){const _0x5611f1=serializeExpandedRule(_0x1ad216,_0x2e1ec3),_0x153df1=_0x3681c3[_0x4eb50e(0x10c)](_0x5611f1)||[];_0x153df1[_0x4eb50e(0x19d)]({'name':_0x3ec044,'index':_0x3ca06c}),_0x3681c3[_0x4eb50e(0x159)](_0x5611f1,_0x153df1),_0x3ca06c++;}const _0x178347=new Map();for(const [_0x1f33e9,_0x62e387]of _0x3681c3){const _0x5d0665=_0x62e387[_0x4eb50e(0x177)]()[_0x4eb50e(0x115)]((_0xf1c9cb,_0x14b34a)=>{const _0x42f6c3=_0x4eb50e,_0x26ac09=_0x52e150[_0x42f6c3(0x10c)](_0xf1c9cb[_0x42f6c3(0x14f)])||0x0,_0x4eceb3=_0x52e150[_0x42f6c3(0x10c)](_0x14b34a['name'])||0x0;if(_0x26ac09!==_0x4eceb3)return _0x4eceb3-_0x26ac09;return _0xf1c9cb[_0x42f6c3(0x10b)]-_0x14b34a['index'];})[_0x4eb50e(0x14d)](_0x3bc743=>_0x3bc743[_0x4eb50e(0x14f)]),_0x59ced5=[];for(const _0x17dcc1 of _0x5d0665){const _0x2cbeba=_0x52e150[_0x4eb50e(0x10c)](_0x17dcc1)||0x0,_0x53fb6f=Math[_0x4eb50e(0x13a)](_0x2cbeba,0x1);for(let _0x424032=0x0;_0x424032<_0x53fb6f;_0x424032++){_0x59ced5[_0x4eb50e(0x19d)](_0x17dcc1);}}_0x178347[_0x4eb50e(0x159)](_0x1f33e9,_0x59ced5);}return{'existingLocalSegmentNames':_0x48f2da,'localSegmentRules':_0x2e1ec3,'localExpandedRuleToNames':_0x178347};}async function buildServerSegmentRuleMap(_0x3cdeb0,_0x37cd1b,_0x59d1be,_0x44fa05){const _0x51ed15=new Map(),_0x51d913=new Set(),_0x5cbe15=async _0x4ab291=>{const _0x1a914d=a100_0x386c;if(_0x51d913[_0x1a914d(0x16a)](_0x4ab291))return;_0x51d913['add'](_0x4ab291);let _0x638bed=_0x59d1be[_0x1a914d(0x1d0)](_0x1fbec8=>_0x1fbec8['id']===_0x4ab291);if(!_0x638bed)try{_0x638bed=await _0x3cdeb0[_0x1a914d(0x15d)][_0x1a914d(0x18c)](_0x37cd1b,_0x4ab291);}catch{return;}if(!_0x638bed?.[_0x1a914d(0x1b7)])return;const _0x10c604=apiRuleToYaml(_0x638bed[_0x1a914d(0x1b7)]);_0x51ed15['set'](_0x4ab291,_0x10c604);const _0x2b763c=collectSegmentRefsFromRule(_0x10c604);for(const _0x2bc21e of _0x2b763c){await _0x5cbe15(_0x2bc21e);}};for(const _0x1f58ab of _0x44fa05){await _0x5cbe15(_0x1f58ab);}return _0x51ed15;}export function createSegmentIdResolver(_0x43a493,_0xb2d04e){return async _0x37a7e2=>{const _0x48f5c5=a100_0x386c,_0xb8effa=_0x43a493[_0x48f5c5(0x10c)](_0x37a7e2);if(!_0xb8effa)throw new SDKError(ErrorCode[_0x48f5c5(0x15c)],'Segment\x20not\x20found:\x20'+_0x37a7e2+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0xb2d04e+'\x27)');return _0xb8effa;};}export function extractRootFolderId(_0x2fd8a7){const _0x5b555b=a100_0x25feef;return _0x2fd8a7['relationships']?.['parentSegmentFolder']?.[_0x5b555b(0xf6)]?.['id']||_0x2fd8a7[_0x5b555b(0x187)]?.[_0x5b555b(0x140)]?.[_0x5b555b(0xf6)]?.['id'];}export function buildConnectionMaps(_0x48b5e8){const _0x2a7258=a100_0x25feef,_0x284d48=new Map(),_0x583706=new Map(),_0x26ebcd=new Map();for(const _0x24b0c6 of _0x48b5e8){_0x284d48['set'](_0x24b0c6[_0x2a7258(0x14f)],parseInt(_0x24b0c6['id'],0xa)),_0x583706[_0x2a7258(0x159)](_0x24b0c6['id'],_0x24b0c6[_0x2a7258(0x14f)]),_0x26ebcd[_0x2a7258(0x159)](_0x24b0c6[_0x2a7258(0x14f)],_0x24b0c6[_0x2a7258(0x176)]);}return{'nameToId':_0x284d48,'idToName':_0x583706,'nameToType':_0x26ebcd};}export function calculatePushStats(_0x200ca7,_0x553e96,_0x35ca59,_0x20d880,_0x5dc3f9,_0x82c12c,_0x217e5c){const _0x1320c3=a100_0x25feef,_0x41d2d0=_0x200ca7[_0x1320c3(0x1ce)](_0x143a09=>_0x143a09[_0x1320c3(0x1ca)]),_0x4bc284=_0x200ca7[_0x1320c3(0x1ce)](_0x45f0db=>!_0x45f0db['isNew']&&_0x45f0db[_0x1320c3(0x17d)]),_0x35e4dc=_0x200ca7[_0x1320c3(0x1ce)](_0x49973f=>!_0x49973f[_0x1320c3(0x1ca)]&&!_0x49973f[_0x1320c3(0x17d)]),_0x587697=_0x82c12c?_0x20d880:[],_0x340f65=_0x553e96[_0x1320c3(0x1ce)](_0x20d5ea=>_0x20d5ea['isNew']),_0x1df204=_0x553e96[_0x1320c3(0x1ce)](_0x2cf066=>!_0x2cf066[_0x1320c3(0x1ca)]&&_0x2cf066[_0x1320c3(0x17d)]),_0x4da5ab=_0x553e96['filter'](_0x3a9266=>!_0x3a9266['isNew']&&!_0x3a9266[_0x1320c3(0x17d)]),_0x482a70=_0x82c12c?_0x5dc3f9:[],_0x584d79=_0x200ca7[_0x1320c3(0x170)](_0x1d3d99=>_0x1d3d99['activationActions']),_0x1163bb=_0x584d79[_0x1320c3(0x1ce)](_0x371cc1=>_0x371cc1['type']===_0x1320c3(0x136)),_0xd20dfc=_0x584d79['filter'](_0x527703=>_0x527703['type']===_0x1320c3(0x10a)),_0x2fbc98=_0x584d79[_0x1320c3(0x1ce)](_0x4dfe48=>_0x4dfe48['type']===_0x1320c3(0x103)),_0x28ec1a=Array[_0x1320c3(0x150)](_0x35ca59)[_0x1320c3(0x115)](),_0x1623c3=_0x217e5c?![]:_0x41d2d0['length']>0x0||_0x4bc284[_0x1320c3(0x11f)]>0x0||_0x587697[_0x1320c3(0x11f)]>0x0,_0x50537b=_0x340f65[_0x1320c3(0x11f)]>0x0||_0x1df204[_0x1320c3(0x11f)]>0x0||_0x482a70[_0x1320c3(0x11f)]>0x0,_0x3fb01f=_0x217e5c?![]:_0x584d79[_0x1320c3(0x11f)]>0x0,_0x5b08df=_0x28ec1a[_0x1320c3(0x11f)]>0x0;return{'segments':{'new':_0x41d2d0,'changed':_0x4bc284,'unchanged':_0x35e4dc,'toDelete':_0x587697},'journeys':{'new':_0x340f65,'changed':_0x1df204,'unchanged':_0x4da5ab,'toDelete':_0x482a70},'activations':{'all':_0x584d79,'toCreate':_0x1163bb,'toUpdate':_0xd20dfc,'toDelete':_0x2fbc98},'folders':{'toCreate':_0x28ec1a},'counts':{'segments':{'new':_0x41d2d0[_0x1320c3(0x11f)],'changed':_0x4bc284[_0x1320c3(0x11f)],'unchanged':_0x35e4dc[_0x1320c3(0x11f)],'toDelete':_0x587697[_0x1320c3(0x11f)]},'journeys':{'new':_0x340f65[_0x1320c3(0x11f)],'changed':_0x1df204['length'],'unchanged':_0x4da5ab[_0x1320c3(0x11f)],'toDelete':_0x482a70['length']},'activations':{'create':_0x1163bb[_0x1320c3(0x11f)],'update':_0xd20dfc[_0x1320c3(0x11f)],'delete':_0x2fbc98[_0x1320c3(0x11f)]},'folders':_0x28ec1a[_0x1320c3(0x11f)]},'hasChanges':_0x1623c3||_0x50537b||_0x3fb01f||_0x5b08df};}export async function buildPushExecutionContext(_0x1ebaaa,_0x4655d8,_0x41d378,_0x28eea3,_0x15d7bb,_0x4774fc){const _0x434fe2=a100_0x25feef,_0x6fe49d=extractRootFolderId(_0x41d378),{pathToId:_0x5c6fd9,idToPath:_0x168058}=buildFolderMaps(_0x15d7bb),_0x54f1f3=buildSegmentNameToIdMap(_0x28eea3),_0x1bec3b=new Map(),{batchAsync:_0x490ca2}=await import(_0x434fe2(0x133)),[_0x167c1b,_0x127032]=await Promise['all']([_0x1ebaaa['user'][_0x434fe2(0x1b0)](),_0x1ebaaa[_0x434fe2(0x18e)][_0x434fe2(0x109)](),((async()=>{const _0x279e51=_0x434fe2;!_0x4774fc&&_0x28eea3[_0x279e51(0x11f)]>0x0&&await _0x490ca2(_0x28eea3,async _0x44bc30=>{const _0x2a964e=_0x279e51,_0x88ecd2=await _0x1ebaaa['segment']['listActivations'](_0x4655d8,_0x44bc30['id']);_0x1bec3b[_0x2a964e(0x159)](_0x44bc30['id'],_0x88ecd2);});})())]),{emailToId:_0xe7a3eb,idToEmail:_0x287290}=_0x167c1b,_0x32330e=buildConnectionMaps(_0x127032);return{'rootFolderId':_0x6fe49d,'folderPathToId':_0x5c6fd9,'folderIdToPath':_0x168058,'segmentNameToId':_0x54f1f3,'activationsBySegmentId':_0x1bec3b,'emailToIdMap':_0xe7a3eb,'idToEmailMap':_0x287290,'connectionNameToIdMap':_0x32330e['nameToId'],'connectionIdToNameMap':_0x32330e[_0x434fe2(0x1a5)],'connectionNameToTypeMap':_0x32330e[_0x434fe2(0x191)]};}export function createPushYamlContextForBundle(_0x386929,_0x227b0e,_0xa252b7,_0x4a44eb,_0x175c77,_0x20aaa9,_0x57db2f,_0x394025){const {existingLocalSegmentNames:_0x27e0ee,localExpandedRuleToNames:_0x2ffd04}=_0x4a44eb,_0x4166cf=new Set(),_0x593cac=new Map(),_0x11d8e8=new Map(),_0x183b24=new Map(),_0x2f8992=createJumpTargetCache(),_0x2e7852=new Map(),_0x208fcb=new Map(),_0x1ece52=new Set();let _0x19119e;const _0x365397=_0x31ff70=>{const _0xc544c1={'resolveSegment':async _0x3f5091=>{const _0x4c80c7=a100_0x386c,_0x257f5e=_0x183b24[_0x4c80c7(0x10c)](_0x3f5091);if(_0x257f5e!==undefined)return{'name':_0x257f5e,'isJourneyLocal':!![]};try{let _0x15eba3=_0xa252b7[_0x4c80c7(0x1d0)](_0x5c988f=>_0x5c988f['id']===_0x3f5091);!_0x15eba3&&(_0x15eba3=await _0x386929[_0x4c80c7(0x15d)][_0x4c80c7(0x18c)](_0x227b0e,_0x3f5091));const _0x440889=generateJourneyLocalName(_0x15eba3['name']),_0x322d53=_0x15eba3[_0x4c80c7(0xf5)]===SEGMENT_KIND_JOURNEY&&_0x440889!==undefined;let _0x12e89b=_0x15eba3[_0x4c80c7(0x14f)],_0x4c5df3;if(_0x322d53&&_0x15eba3[_0x4c80c7(0x1b7)]){const _0x40073d=apiRuleToYaml(_0x15eba3['rule']);_0x208fcb[_0x4c80c7(0x159)](_0x3f5091,_0x40073d);const _0x1b16fc=async _0x291f93=>{const _0x185afa=_0x4c80c7,_0x5f2c0b=collectSegmentRefsFromRule(_0x291f93);for(const _0x29d7b4 of _0x5f2c0b){if(!_0x208fcb['has'](_0x29d7b4))try{const _0x244e03=await _0x386929['segment'][_0x185afa(0x18c)](_0x227b0e,_0x29d7b4);if(_0x244e03?.['rule']){const _0x54a74c=apiRuleToYaml(_0x244e03[_0x185afa(0x1b7)]);_0x208fcb[_0x185afa(0x159)](_0x29d7b4,_0x54a74c),await _0x1b16fc(_0x54a74c);}}catch{}}};await _0x1b16fc(_0x40073d);const _0x3a2abc=serializeExpandedRule(_0x40073d,_0x208fcb),_0x378c1a=_0x2ffd04[_0x4c80c7(0x10c)](_0x3a2abc);if(_0x378c1a&&_0x378c1a[_0x4c80c7(0x11f)]>0x0){const _0x197fee=_0x593cac[_0x4c80c7(0x10c)](_0x3a2abc)||0x0,_0x36450f=_0x378c1a[_0x197fee]||_0x378c1a[_0x378c1a['length']-0x1];_0x593cac[_0x4c80c7(0x159)](_0x3a2abc,_0x197fee+0x1),_0x12e89b=_0x36450f,_0x4166cf[_0x4c80c7(0x132)](_0x12e89b),_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b);const _0x2f896a=await resolveRuleSegmentRefs(_0x40073d,async _0x4cdc20=>{const _0x5427fc=_0x4c80c7,_0x1bcda7=_0x183b24[_0x5427fc(0x10c)](_0x4cdc20);if(_0x1bcda7)return _0x1bcda7;const _0x16aaa1=await _0x19119e['resolveSegment'](_0x4cdc20);return _0x16aaa1[_0x5427fc(0x14f)];});_0x4c5df3={'description':_0x15eba3[_0x4c80c7(0x114)],'rule':_0x2f896a};}else{const _0x14db26=_0x2e7852[_0x4c80c7(0x10c)](_0x3a2abc);if(_0x14db26)_0x12e89b=_0x14db26,_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b);else{if(_0x440889){let _0x1c05c2=_0x440889,_0x530f49=0x2;while(_0x4166cf['has'](_0x1c05c2)||_0x27e0ee[_0x4c80c7(0x16a)](_0x1c05c2)){_0x1c05c2=_0x440889+'_'+_0x530f49,_0x530f49++;}_0x4166cf[_0x4c80c7(0x132)](_0x1c05c2),_0x12e89b=_0x1c05c2;}_0x183b24[_0x4c80c7(0x159)](_0x3f5091,_0x12e89b),_0x2e7852[_0x4c80c7(0x159)](_0x3a2abc,_0x12e89b);const _0x55cbeb=await resolveRuleSegmentRefs(_0x40073d,async _0x40f9b4=>{const _0x50df96=_0x4c80c7,_0x2a0da1=_0x183b24[_0x50df96(0x10c)](_0x40f9b4);if(_0x2a0da1)return _0x2a0da1;const _0x17478f=await _0x19119e['resolveSegment'](_0x40f9b4);return _0x17478f['name'];});_0x4c5df3={'description':_0x15eba3[_0x4c80c7(0x114)],'rule':_0x55cbeb};}}}return{'name':_0x12e89b,'isJourneyLocal':_0x322d53,'definition':_0x4c5df3};}catch{return{'name':_0x3f5091,'isJourneyLocal':![]};}},'resolveActivation':async _0x38124f=>{const _0x369996=a100_0x386c,_0x282bca=_0x11d8e8[_0x369996(0x10c)](_0x38124f);if(_0x282bca!==undefined)return{'name':_0x282bca,'isJourneyLocal':!![]};try{let _0x163e8c=_0x57db2f?.[_0x369996(0x10c)](_0x38124f);!_0x163e8c&&(_0x163e8c=await _0x386929[_0x369996(0x182)][_0x369996(0x167)](_0x31ff70,_0x38124f));const _0x46bc30=_0x163e8c[_0x369996(0x144)]['activationParams'][_0x369996(0x14f)]||_0x38124f,_0x35ebf7=sanitizeYamlKey(_0x46bc30)||_0x369996(0x19a)+_0x38124f,_0x5b94ff=_0x35ebf7;_0x11d8e8[_0x369996(0x159)](_0x38124f,_0x5b94ff);const _0x345f82=journeyActivationStepToYaml(_0x163e8c,_0x175c77,_0x20aaa9);return{'name':_0x5b94ff,'isJourneyLocal':!![],'definition':_0x345f82};}catch{return{'name':_0x38124f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4e1e1b,_0x2a2117)=>resolveJumpTarget(_0x4e1e1b,_0x2a2117,_0x2f8992,async _0x4b0271=>{const _0x502267=a100_0x386c,_0x3204a9=_0x394025?.[_0x502267(0x10c)](_0x4b0271);if(_0x3204a9)return _0x3204a9;return _0x386929[_0x502267(0x182)]['getJourney'](_0x4b0271);})};return _0x19119e=_0xc544c1,_0xc544c1;},_0x3b0fd3=async _0x4fbac0=>{const _0x4df796=a100_0x386c,{collectSegmentIdsFromJourneyApi:_0x548159}=await import('./journey-yaml.js'),{batchAsync:_0x30c8f6}=await import('../../utils/async.js'),_0x4d1fb1=new Set();for(const _0x48de19 of _0x4fbac0){let _0x44bc1a=_0x394025?.[_0x4df796(0x10c)](_0x48de19);!_0x44bc1a&&(_0x44bc1a=await _0x386929[_0x4df796(0x182)]['getJourney'](_0x48de19));const _0x2f606a=_0x548159(_0x44bc1a);for(const _0x19ede5 of _0x2f606a){_0x4d1fb1['add'](_0x19ede5);}}let _0x2bc497=Array['from'](_0x4d1fb1);while(_0x2bc497[_0x4df796(0x11f)]>0x0){const _0x30f1c1=_0x2bc497['filter'](_0x9d235d=>!_0x1ece52[_0x4df796(0x16a)](_0x9d235d));if(_0x30f1c1['length']===0x0)break;const _0x4d3fc9=await _0x30c8f6(_0x30f1c1,async _0x11dc8c=>{const _0x55c81f=_0x4df796;_0x1ece52['add'](_0x11dc8c);let _0x3b48e1=_0xa252b7[_0x55c81f(0x1d0)](_0x45a78a=>_0x45a78a['id']===_0x11dc8c);if(!_0x3b48e1)try{_0x3b48e1=await _0x386929[_0x55c81f(0x15d)][_0x55c81f(0x18c)](_0x227b0e,_0x11dc8c);}catch{return null;}return{'segmentId':_0x11dc8c,'segment':_0x3b48e1};},0xa),_0xa8c982=new Set();for(const _0x17de7d of _0x4d3fc9){if(!_0x17de7d?.[_0x4df796(0x15d)]?.[_0x4df796(0x1b7)])continue;const _0x23b405=apiRuleToYaml(_0x17de7d[_0x4df796(0x15d)][_0x4df796(0x1b7)]);_0x208fcb[_0x4df796(0x159)](_0x17de7d[_0x4df796(0x145)],_0x23b405);const _0x50a3f8=collectSegmentRefsFromRule(_0x23b405);for(const _0x4eec5a of _0x50a3f8){!_0x1ece52[_0x4df796(0x16a)](_0x4eec5a)&&_0xa8c982[_0x4df796(0x132)](_0x4eec5a);}}_0x2bc497=Array['from'](_0xa8c982);}};return{'createYamlContext':_0x365397,'prefetchJourneySegments':_0x3b0fd3};}export async function executePushSegments(_0x374883,_0x3f4f2f,_0x1ecc57,_0x5c74eb,_0x47c2cb){const _0x58968c=a100_0x25feef,{segmentDefToCreateRequest:_0x18e430,segmentDefToUpdateRequest:_0x3705e1}=await import('./child-segment-yaml.js'),_0x55d4b3=_0x1ecc57[_0x58968c(0x1b9)],_0x2fdcf3=0x5,_0x4ae8c8=async _0x1ebc3f=>{const _0x1335ae=_0x58968c,_0x2597d3=_0x1ebc3f[_0x1335ae(0x101)]?_0x55d4b3[_0x1335ae(0x10c)](_0x1ebc3f[_0x1335ae(0x101)]):undefined;let _0x36fafe;const _0x44095f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x1ebc3f[_0x1335ae(0x1ca)]){_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x10f),'name':_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]});const _0x3d0d82=_0x18e430(_0x1ebc3f['yamlConfig'],_0x2597d3),_0x2b3bcd=await _0x47c2cb[_0x1335ae(0x1a1)](_0x1335ae(0x131)+_0x1ebc3f[_0x1335ae(0x188)]['name']+_0x1335ae(0x178),()=>_0x374883[_0x1335ae(0x15d)][_0x1335ae(0x1a0)](_0x5c74eb[_0x1335ae(0x155)],_0x3d0d82));_0x36fafe=_0x2b3bcd['data']['id'],_0x44095f[_0x1335ae(0x112)]={'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],'id':_0x36fafe},_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0xfa),'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],'segmentId':_0x36fafe}),_0x47c2cb[_0x1335ae(0x12a)]?.(_0x1335ae(0x15e)+_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]+'\x27'),_0x44095f[_0x1335ae(0x1be)]=0x1;}else{if(_0x1ebc3f[_0x1335ae(0x17d)]){_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x118),'name':_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]});const _0xf60ba4=_0x3705e1(_0x1ebc3f['yamlConfig']);_0x2597d3!==_0x1ebc3f[_0x1335ae(0x16e)]?.[_0x1335ae(0x147)]&&(_0xf60ba4[_0x1335ae(0x147)]=_0x2597d3?parseInt(_0x2597d3,0xa):undefined),await _0x47c2cb['withProgress'](_0x1335ae(0x169)+_0x1ebc3f[_0x1335ae(0x188)][_0x1335ae(0x14f)]+'\x27...',()=>_0x374883[_0x1335ae(0x15d)][_0x1335ae(0x17f)](_0x5c74eb[_0x1335ae(0x155)],_0x1ebc3f['existingSegment']['id'],_0xf60ba4)),_0x36fafe=_0x1ebc3f[_0x1335ae(0x16e)]['id'],_0x47c2cb[_0x1335ae(0x152)]?.({'type':_0x1335ae(0x102),'name':_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)]}),_0x47c2cb[_0x1335ae(0x12a)]?.('Updated\x20segment\x20\x27'+_0x1ebc3f['yamlConfig']['name']+'\x27'),_0x44095f[_0x1335ae(0x129)]=0x1;}else _0x36fafe=_0x1ebc3f[_0x1335ae(0x16e)]['id'];}}catch(_0x30b8d2){const _0xdc807=isHttp400Error(_0x30b8d2),_0x2e1f92=_0xdc807?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1335ae(0x172)],_0x367992=getErrorMessage(_0x30b8d2);throw new SDKError(_0x2e1f92,'Failed\x20to\x20'+(_0x1ebc3f[_0x1335ae(0x1ca)]?_0x1335ae(0x136):_0x1335ae(0x10a))+_0x1335ae(0x157)+_0x1ebc3f[_0x1335ae(0x13b)]+'\x0a\x20\x20'+_0x367992,_0x30b8d2);}try{const _0x229ca8=await syncActivationsForSegment(_0x374883,_0x5c74eb[_0x1335ae(0x155)],_0x36fafe,_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)],_0x1ebc3f['activationActions'],_0x47c2cb,_0x1ebc3f['absolutePath']);_0x44095f['activations']=_0x229ca8;}catch(_0x4cfbb8){if(_0x4cfbb8 instanceof SDKError)throw _0x4cfbb8;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x1335ae(0x183)+_0x1ebc3f['yamlConfig'][_0x1335ae(0x14f)]+'\x27\x20from\x20file:\x20'+_0x1ebc3f[_0x1335ae(0x13b)]+_0x1335ae(0x1cb)+getErrorMessage(_0x4cfbb8),_0x4cfbb8);}return _0x44095f;},_0x5db3bc=await batchAsync(_0x3f4f2f,_0x4ae8c8,_0x2fdcf3),_0x1433a4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x336581 of _0x5db3bc){_0x1433a4[_0x58968c(0x1be)]+=_0x336581['created'],_0x1433a4[_0x58968c(0x129)]+=_0x336581['updated'],_0x336581[_0x58968c(0x112)]&&_0x1433a4[_0x58968c(0x1b5)][_0x58968c(0x159)](_0x336581['createdSegmentId']['name'],_0x336581['createdSegmentId']['id']),_0x1433a4[_0x58968c(0x120)][_0x58968c(0x1be)]+=_0x336581[_0x58968c(0x120)]['created'],_0x1433a4[_0x58968c(0x120)]['updated']+=_0x336581[_0x58968c(0x120)][_0x58968c(0x129)],_0x1433a4['activations'][_0x58968c(0x14c)]+=_0x336581[_0x58968c(0x120)][_0x58968c(0x14c)];}return _0x1433a4;}async function syncActivationsForSegment(_0x4ab81d,_0x79536c,_0x55adc2,_0x36bc7d,_0x4f3b86,_0x166a80,_0x1d6c87){const _0x50867e=a100_0x25feef,_0x21edfc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5a4b84 of _0x4f3b86){try{if(_0x5a4b84[_0x50867e(0x176)]===_0x50867e(0x136)&&_0x5a4b84['validatedRequest'])_0x166a80['onProgress']?.({'type':_0x50867e(0xf8),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)](_0x50867e(0xfe)+_0x5a4b84[_0x50867e(0x14f)]+_0x50867e(0x178),()=>_0x4ab81d[_0x50867e(0x15d)]['createActivation'](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1b6)])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x125),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x12a)]?.('Created\x20activation\x20\x27'+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc['created']++;else{if(_0x5a4b84[_0x50867e(0x176)]===_0x50867e(0x10a)&&_0x5a4b84[_0x50867e(0x1b6)]&&_0x5a4b84['existingActivation'])_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x16f),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)]('Updating\x20activation\x20\x27'+_0x5a4b84[_0x50867e(0x14f)]+'\x27...',()=>_0x4ab81d[_0x50867e(0x15d)][_0x50867e(0x12d)](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1ad)]['id'],_0x5a4b84[_0x50867e(0x1b6)])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x16c),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x12a)]?.(_0x50867e(0x11a)+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc['updated']++;else _0x5a4b84['type']===_0x50867e(0x103)&&_0x5a4b84['existingActivation']&&(_0x166a80['onProgress']?.({'type':_0x50867e(0x185),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),await _0x166a80[_0x50867e(0x1a1)]('Deleting\x20activation\x20\x27'+_0x5a4b84['name']+_0x50867e(0x178),()=>_0x4ab81d[_0x50867e(0x15d)][_0x50867e(0x153)](_0x79536c,_0x55adc2,_0x5a4b84[_0x50867e(0x1ad)]['id'])),_0x166a80[_0x50867e(0x152)]?.({'type':_0x50867e(0x1b2),'segmentName':_0x36bc7d,'activationName':_0x5a4b84[_0x50867e(0x14f)]}),_0x166a80[_0x50867e(0x141)]?.(_0x50867e(0x186)+_0x5a4b84[_0x50867e(0x14f)]+'\x27'),_0x21edfc[_0x50867e(0x14c)]++);}}catch(_0x1d6d4c){const _0x3f3834=isHttp400Error(_0x1d6d4c),_0x2ca210=_0x3f3834?ErrorCode[_0x50867e(0x14b)]:ErrorCode[_0x50867e(0x111)],_0x29d32b=getErrorMessage(_0x1d6d4c);throw new SDKError(_0x2ca210,_0x50867e(0x137)+_0x5a4b84['type']+_0x50867e(0x1ae)+_0x5a4b84[_0x50867e(0x14f)]+'\x27\x20from\x20file:\x20'+_0x1d6c87+'\x0a\x20\x20'+_0x29d32b,_0x1d6d4c);}}return _0x21edfc;}export async function executePushFolders(_0x46951e,_0x35d080,_0x3a81be,_0x58580d,_0x1e3cc7){const _0xe162e0=a100_0x25feef,_0x32e730=new Map(_0x3a81be);for(const _0x573677 of _0x35d080){const _0x14acc0=_0x573677[_0xe162e0(0x162)]('/'),_0xd5e29b=_0x14acc0[_0x14acc0[_0xe162e0(0x11f)]-0x1],_0xec2a01=_0x14acc0['slice'](0x0,-0x1)['join']('/'),_0x3755c2=_0x32e730[_0xe162e0(0x10c)](_0xec2a01);_0x1e3cc7['onProgress']?.({'type':_0xe162e0(0x10d),'folder':_0x573677});const _0x1b5709={'name':_0xd5e29b,'parentFolderId':_0x3755c2},_0x2389cf=await _0x1e3cc7[_0xe162e0(0x1a1)]('Creating\x20folder\x20\x27'+_0x573677+_0xe162e0(0x178),()=>_0x46951e[_0xe162e0(0x15d)][_0xe162e0(0x1af)](_0x58580d[_0xe162e0(0x155)],_0x1b5709));_0x32e730[_0xe162e0(0x159)](_0x573677,_0x2389cf[_0xe162e0(0xf6)]['id']),_0x1e3cc7[_0xe162e0(0x152)]?.({'type':_0xe162e0(0x175),'folder':_0x573677,'folderId':_0x2389cf[_0xe162e0(0xf6)]['id']}),_0x1e3cc7[_0xe162e0(0x194)]?.(_0xe162e0(0x190)+_0x573677+'\x27');}return _0x32e730;}export async function executePushSegmentDeletions(_0x565b8e,_0x4bb3fb,_0x3e3402){const _0x46b454=a100_0x25feef;if(_0x4bb3fb[_0x46b454(0x11f)]===0x0)return 0x0;const {batchAsync:_0x33a112}=await import(_0x46b454(0x133)),_0x217b3d=0x5,_0x4e8876=await _0x33a112(_0x4bb3fb,async _0x154c6b=>{const _0x449f13=_0x46b454;return _0x3e3402[_0x449f13(0x152)]?.({'type':_0x449f13(0x124),'name':_0x154c6b[_0x449f13(0x14f)]}),await _0x565b8e[_0x449f13(0x15d)][_0x449f13(0x104)](_0x154c6b['id']),_0x3e3402[_0x449f13(0x152)]?.({'type':_0x449f13(0x195),'name':_0x154c6b[_0x449f13(0x14f)]}),_0x3e3402[_0x449f13(0x141)]?.(_0x449f13(0x154)+_0x154c6b[_0x449f13(0x14f)]+'\x27'),0x1;},_0x217b3d);return _0x4e8876[_0x46b454(0x100)]((_0x2335cf,_0x41ffb5)=>_0x2335cf+_0x41ffb5,0x0);}export async function executePushJourneys(_0x2097e7,_0x48d7a1,_0x4bad9a,_0x4174cb,_0x137d00){const _0x3188dd=a100_0x25feef,{journeyDefToRequest:_0x118189}=await import(_0x3188dd(0x135)),{activationDefToCreateRequest:_0x4c3086,yamlRuleToApi:_0x4c3041,validateSegmentRule:_0x4ae32f}=await import('./child-segment-yaml.js'),_0x3c9bba={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x437e0c=new Map(_0x4bad9a[_0x3188dd(0x1cf)]),_0x120463=0x5;for(let _0x1c30c1=0x0;_0x1c30c1<_0x48d7a1[_0x3188dd(0x11f)];_0x1c30c1+=_0x120463){const _0x2649c2=_0x48d7a1[_0x3188dd(0x177)](_0x1c30c1,_0x1c30c1+_0x120463),_0x48e35d=await Promise[_0x3188dd(0x1b1)](_0x2649c2['map'](async _0x5a0998=>{const _0x550a8e=_0x3188dd;if(!_0x5a0998[_0x550a8e(0x1ca)]&&!_0x5a0998[_0x550a8e(0x17d)])return{'action':_0x550a8e(0x110),'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)],'journeyId':_0x5a0998[_0x550a8e(0x181)]?.['id']};const _0x5ba12a=_0x5a0998['folderPath']?_0x4bad9a[_0x550a8e(0x1b9)][_0x550a8e(0x10c)](_0x5a0998['folderPath']):undefined;_0x137d00[_0x550a8e(0x152)]?.({'type':_0x5a0998['isNew']?'journey_creating':_0x550a8e(0xf4),'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)]});try{const _0x29b3aa=await executeSingleJourneyPush(_0x2097e7,_0x5a0998,{..._0x4bad9a,'segmentNameToId':_0x437e0c},{'parentId':_0x4174cb[_0x550a8e(0x155)],'rootFolderId':_0x4174cb['rootFolderId'],'folderId':_0x5ba12a,'verbose':_0x4174cb['verbose']},_0x137d00,{'journeyDefToRequest':_0x118189,'activationDefToCreateRequest':_0x4c3086,'yamlRuleToApi':_0x4c3041,'validateSegmentRule':_0x4ae32f});for(const [_0x370cff,_0x48b4ab]of _0x29b3aa[_0x550a8e(0x15f)]){_0x437e0c[_0x550a8e(0x159)](_0x370cff,_0x48b4ab),_0x3c9bba[_0x550a8e(0x15f)]['set'](_0x370cff,_0x48b4ab);}if(_0x29b3aa[_0x550a8e(0x121)]===_0x550a8e(0x1be))_0x137d00[_0x550a8e(0x152)]?.({'type':'journey_created','name':_0x5a0998['yamlConfig']['name'],'journeyId':_0x29b3aa['journeyId']}),_0x137d00[_0x550a8e(0x12a)]?.(_0x550a8e(0x1c8)+_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)]+'\x27'),_0x3c9bba[_0x550a8e(0x1be)]++;else _0x29b3aa['action']===_0x550a8e(0x129)&&(_0x137d00['onProgress']?.({'type':_0x550a8e(0xf9),'name':_0x5a0998[_0x550a8e(0x188)]['name']}),_0x137d00[_0x550a8e(0x12a)]?.(_0x550a8e(0x15b)+_0x5a0998['yamlConfig'][_0x550a8e(0x14f)]+'\x27'),_0x3c9bba[_0x550a8e(0x129)]++);return{'action':_0x29b3aa[_0x550a8e(0x121)],'name':_0x5a0998[_0x550a8e(0x188)][_0x550a8e(0x14f)],'journeyId':_0x29b3aa[_0x550a8e(0x1bd)]};}catch(_0x395372){const _0x1def86=isHttp400Error(_0x395372),_0xa74bfe=_0x1def86?ErrorCode[_0x550a8e(0xf7)]:ErrorCode[_0x550a8e(0xf2)],_0x2ac4a2=getErrorMessage(_0x395372);throw new SDKError(_0xa74bfe,_0x550a8e(0x137)+(_0x5a0998['isNew']?'create':_0x550a8e(0x10a))+'\x20journey\x20from\x20file:\x20'+_0x5a0998['absolutePath']+_0x550a8e(0x1cb)+_0x2ac4a2,_0x395372);}}));_0x3c9bba['results'][_0x3188dd(0x19d)](..._0x48e35d);}return _0x3c9bba;}async function executeSingleJourneyPush(_0x18ed20,_0x52292c,_0x137ad8,_0x5ab9a4,_0x254e9a,_0x200578){const _0x4e5ac6=a100_0x25feef,{journeyDefToRequest:_0x2409d4,activationDefToCreateRequest:_0x12da5e,yamlRuleToApi:_0x489c4,validateSegmentRule:_0x5b2153}=_0x200578,_0x23426c=new Map(),_0x4e723f=new Map(),_0x287088=new Map(),_0x589f1e=new Map(),_0x4c564=new Map();let _0x26ed48;const _0x15ddd4=async()=>{const _0x4706fe=a100_0x386c;if(_0x26ed48)return;_0x26ed48=new Map();if(!_0x52292c[_0x4706fe(0x181)])return;const _0x4a0f82=await _0x18ed20[_0x4706fe(0x182)]['listActivations'](_0x52292c[_0x4706fe(0x181)]['id']);for(const _0x3bbe7e of _0x4a0f82){const _0x4311e5=journeyActivationStepToYaml(_0x3bbe7e,_0x137ad8[_0x4706fe(0x168)],_0x137ad8[_0x4706fe(0x1bf)]),_0x5b550e=activationSignature(_0x4311e5);!_0x26ed48[_0x4706fe(0x16a)](_0x5b550e)&&_0x26ed48[_0x4706fe(0x159)](_0x5b550e,_0x3bbe7e['id']),_0x4311e5[_0x4706fe(0x14f)]&&_0x4e723f[_0x4706fe(0x159)](_0x4311e5[_0x4706fe(0x14f)],_0x3bbe7e['id']);}};if(_0x52292c[_0x4e5ac6(0x181)]&&_0x52292c[_0x4e5ac6(0x188)]['segments']){const _0x3d7bd3=buildLocalExpandedRuleMappings(_0x52292c[_0x4e5ac6(0x188)]),_0x73e929=_0x3d7bd3[_0x4e5ac6(0x19e)];if(_0x73e929['size']>0x0){const _0x2b36d8=new Map();for(const [_0x3028a8,_0x2fc1e7]of _0x73e929){const _0x1adf8f=serializeExpandedRule(_0x2fc1e7,_0x73e929);_0x2b36d8[_0x4e5ac6(0x159)](_0x3028a8,_0x1adf8f);}const _0x154ffd=collectSegmentIdsFromJourneyApi(_0x52292c[_0x4e5ac6(0x181)]);if(_0x154ffd['size']>0x0){const _0xef50c9=await buildServerSegmentRuleMap(_0x18ed20,_0x5ab9a4[_0x4e5ac6(0x155)],_0x137ad8[_0x4e5ac6(0x12e)],_0x154ffd);if(_0xef50c9[_0x4e5ac6(0x139)]>0x0){const _0x4a199c=new Map();for(const [_0x5323a9,_0x2d8a02]of _0xef50c9){const _0x406a5c=serializeExpandedRule(_0x2d8a02,_0xef50c9);!_0x4a199c['has'](_0x406a5c)&&_0x4a199c[_0x4e5ac6(0x159)](_0x406a5c,_0x5323a9);}for(const [_0x59903d,_0x8c1098]of _0x2b36d8){const _0x30a153=_0x4a199c[_0x4e5ac6(0x10c)](_0x8c1098);_0x30a153&&(_0x4c564[_0x4e5ac6(0x159)](_0x59903d,_0x30a153),_0x137ad8['segmentNameToId'][_0x4e5ac6(0x159)](_0x59903d,_0x30a153));}}}}}const _0x2988a8={'resolveSegmentId':async _0xeb666e=>{const _0x33da77=_0x4e5ac6,_0x236887=_0x137ad8[_0x33da77(0x1cf)]['get'](_0xeb666e);if(!_0x236887)throw new SDKError(ErrorCode[_0x33da77(0x15c)],'Segment\x20not\x20found:\x20'+_0xeb666e+_0x33da77(0x149)+_0x52292c[_0x33da77(0x188)][_0x33da77(0x14f)]+')');return _0x236887;},'resolveEmbeddedSegmentId':async(_0x8c315d,_0x2a2ebe)=>{const _0x5e5886=_0x4e5ac6,_0x419382=_0x137ad8[_0x5e5886(0x1cf)][_0x5e5886(0x10c)](_0x8c315d);if(_0x419382)return _0x419382;const _0x17b02a=_0x4c564['get'](_0x8c315d);if(_0x17b02a)return _0x137ad8['segmentNameToId']['set'](_0x8c315d,_0x17b02a),_0x17b02a;const _0x458a89=_0x137ad8[_0x5e5886(0x12e)]['find'](_0x21c4e9=>_0x21c4e9[_0x5e5886(0x14f)]===_0x8c315d);if(_0x458a89)return _0x137ad8['segmentNameToId'][_0x5e5886(0x159)](_0x8c315d,_0x458a89['id']),_0x458a89['id'];if(_0x52292c[_0x5e5886(0x1ca)]){const {stageName:_0x42c396,criteriaName:_0x2f4644}=findSegmentCriteriaLocation(_0x52292c['yamlConfig'],_0x8c315d);return _0x5b2153(_0x8c315d,_0x2a2ebe[_0x5e5886(0x1b7)]),_0x287088['set'](_0x8c315d,{'definition':_0x2a2ebe,'stageName':_0x42c396,'criteriaName':_0x2f4644}),createPendingSegmentId(_0x8c315d);}const _0x508ba1=_0x52292c[_0x5e5886(0x181)]?.['id'];if(!_0x508ba1)throw new SDKError(ErrorCode[_0x5e5886(0x11d)],_0x5e5886(0x11c));_0x5b2153(_0x8c315d,_0x2a2ebe[_0x5e5886(0x1b7)]);const _0x2afd7c=generateDeterministicJourneySegmentName(_0x52292c[_0x5e5886(0x188)]['name'],_0x8c315d),_0xd99351=_0x137ad8[_0x5e5886(0x12e)][_0x5e5886(0x1d0)](_0x2c90b5=>_0x2c90b5[_0x5e5886(0x14f)]===_0x2afd7c),_0x425388=createSegmentIdResolver(_0x137ad8[_0x5e5886(0x1cf)],_0x8c315d),_0x446045=await resolveRuleSegmentIds(_0x2a2ebe[_0x5e5886(0x1b7)],_0x425388);let _0xc9191e;if(_0xd99351)await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x17f)](_0x5ab9a4[_0x5e5886(0x155)],_0xd99351['id'],{'description':_0x2a2ebe[_0x5e5886(0x114)]||'Entry\x20criteria:\x20'+_0x8c315d,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![]}),_0xc9191e=_0xd99351['id'];else try{_0xc9191e=await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x134)]({'name':_0x2afd7c,'description':_0x2a2ebe[_0x5e5886(0x114)]||_0x5e5886(0x180)+_0x8c315d,'journeyId':_0x508ba1,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![],'parentFolderId':_0x5ab9a4['rootFolderId']||'','audienceId':_0x5ab9a4[_0x5e5886(0x155)]});}catch(_0x20347c){const _0x13cf2a=_0x20347c instanceof Error&&_0x20347c['message'][_0x5e5886(0x12b)](_0x5e5886(0x1ba));if(_0x13cf2a){const _0x4315e=await _0x18ed20['segment'][_0x5e5886(0x18a)](_0x5ab9a4[_0x5e5886(0x155)]),_0x401c7e=_0x4315e[_0x5e5886(0x1d0)](_0xe0774d=>_0xe0774d[_0x5e5886(0x14f)]===_0x2afd7c);if(_0x401c7e)await _0x18ed20[_0x5e5886(0x15d)][_0x5e5886(0x17f)](_0x5ab9a4[_0x5e5886(0x155)],_0x401c7e['id'],{'description':_0x2a2ebe[_0x5e5886(0x114)]||_0x5e5886(0x180)+_0x8c315d,'rule':_0x489c4(_0x446045,!![]),'countPopulation':!![]}),_0xc9191e=_0x401c7e['id'];else throw _0x20347c;}else throw _0x20347c;}return _0x137ad8['segmentNameToId'][_0x5e5886(0x159)](_0x8c315d,_0xc9191e),_0x23426c[_0x5e5886(0x159)](_0x8c315d,_0xc9191e),_0xc9191e;},'resolveActivationId':async _0x4dd80e=>{const _0x20f5b9=_0x4e5ac6,_0x46f6aa=_0x4e723f[_0x20f5b9(0x10c)](_0x4dd80e);if(_0x46f6aa)return _0x46f6aa;if(_0x52292c['existingJourney']){await _0x15ddd4();const _0x22acdb=_0x4e723f[_0x20f5b9(0x10c)](_0x4dd80e);if(_0x22acdb)return _0x22acdb;}throw new SDKError(ErrorCode[_0x20f5b9(0x173)],_0x20f5b9(0x1a9)+_0x4dd80e+_0x20f5b9(0x149)+_0x52292c['yamlConfig'][_0x20f5b9(0x14f)]+').\x20'+_0x20f5b9(0x11b));},'resolveEmbeddedActivationId':async(_0x8a0731,_0x538947)=>{const _0x20e8ee=_0x4e5ac6,_0x670ef1=_0x4e723f['get'](_0x8a0731);if(_0x670ef1)return _0x670ef1;if(_0x52292c[_0x20e8ee(0x1ca)])return _0x589f1e[_0x20e8ee(0x159)](_0x8a0731,_0x538947),createPendingActivationId(_0x8a0731);if(_0x52292c[_0x20e8ee(0x181)]){await _0x15ddd4();const _0x3f6132=_0x4e723f[_0x20e8ee(0x10c)](_0x538947[_0x20e8ee(0x14f)]);if(_0x3f6132)return _0x4e723f[_0x20e8ee(0x159)](_0x8a0731,_0x3f6132),_0x3f6132;const _0x4d7823=activationSignature(_0x538947),_0x2b7434=_0x26ed48?.[_0x20e8ee(0x10c)](_0x4d7823);if(_0x2b7434)return _0x4e723f[_0x20e8ee(0x159)](_0x8a0731,_0x2b7434),_0x2b7434;const _0x5f432c=await _0x12da5e(_0x538947,_0x137ad8['activationContext']),_0x1f744a=await _0x18ed20[_0x20e8ee(0x182)][_0x20e8ee(0x126)](_0x52292c[_0x20e8ee(0x181)]['id'],_0x5f432c);return _0x4e723f['set'](_0x8a0731,_0x1f744a['id']),_0x1f744a['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x20e8ee(0x1b3));},'resolveJourneyId':async _0x584705=>{const _0xf67636=_0x4e5ac6;try{return await _0x18ed20[_0xf67636(0x182)][_0xf67636(0x148)](_0x5ab9a4[_0xf67636(0x155)],_0x584705);}catch(_0x21bb58){throw new SDKError(ErrorCode[_0xf67636(0x173)],_0xf67636(0x105)+_0x584705+_0xf67636(0x1c9)+_0x52292c['yamlConfig']['name']+'\x27)',_0x21bb58);}},'resolveStageId':async(_0x57edaa,_0x2bc85a)=>{const _0x3e161b=_0x4e5ac6,_0xd028e0=await _0x18ed20[_0x3e161b(0x182)][_0x3e161b(0x163)](_0x57edaa),_0x5ce3d4=_0xd028e0[_0x3e161b(0x144)]['journeyStages'][_0x3e161b(0x1d0)](_0x23ab6d=>_0x23ab6d[_0x3e161b(0x14f)][_0x3e161b(0x184)]()===_0x2bc85a[_0x3e161b(0x184)]());if(!_0x5ce3d4?.['id'])throw new SDKError(ErrorCode[_0x3e161b(0x173)],'Stage\x20\x27'+_0x2bc85a+_0x3e161b(0x151)+(_0xd028e0['attributes'][_0x3e161b(0x14e)]||_0xd028e0[_0x3e161b(0x144)][_0x3e161b(0x14f)])+'\x27');return _0x5ce3d4['id'];}},_0x1934ae=await _0x2409d4(_0x52292c[_0x4e5ac6(0x188)],_0x5ab9a4[_0x4e5ac6(0x155)],_0x2988a8),_0x216707=_0x5ab9a4[_0x4e5ac6(0x156)]||_0x5ab9a4['rootFolderId'];_0x216707&&(_0x1934ae[_0x4e5ac6(0x187)]={'parentFolder':{'data':{'id':_0x216707,'type':_0x4e5ac6(0x16d)}}});if(_0x52292c['isNew']){if(_0x287088[_0x4e5ac6(0x139)]>0x0||_0x589f1e[_0x4e5ac6(0x139)]>0x0)return await executeThreeStepJourneyCreate(_0x18ed20,_0x52292c,_0x1934ae,{'pendingEmbeddedSegments':_0x287088,'pendingEmbeddedActivations':_0x589f1e,'embeddedSegmentNameToId':_0x23426c,'journeyActivationNameToId':_0x4e723f},{..._0x5ab9a4,'effectiveFolderId':_0x216707},_0x137ad8,_0x254e9a,_0x200578);else{ensureJourneyDefaults(_0x1934ae[_0x4e5ac6(0x144)]);const _0x1c9b89=await _0x18ed20[_0x4e5ac6(0x182)]['create'](_0x1934ae);return{'action':'created','journeyId':_0x1c9b89['id'],'embeddedSegmentNameToId':_0x23426c};}}else{if(_0x52292c[_0x4e5ac6(0x17d)]&&_0x52292c['existingJourney'])return ensureJourneyDefaults(_0x1934ae['attributes']),await _0x18ed20['journey'][_0x4e5ac6(0x10a)](_0x52292c[_0x4e5ac6(0x181)]['id'],_0x1934ae),{'action':_0x4e5ac6(0x129),'journeyId':_0x52292c[_0x4e5ac6(0x181)]['id'],'embeddedSegmentNameToId':_0x23426c};}return{'action':_0x4e5ac6(0x110),'journeyId':_0x52292c[_0x4e5ac6(0x181)]?.['id'],'embeddedSegmentNameToId':_0x23426c};}function findSegmentCriteriaLocation(_0x31ec65,_0xdb759c){const _0x5d9756=a100_0x25feef,_0x2f9bd0=_0x31ec65[_0x5d9756(0x1cc)]||_0x31ec65[_0x5d9756(0x1cd)]?.[0x0]?.['stages']||[];let _0x44575d='entry',_0x83824a=_0xdb759c;const _0x2e6313=_0x31ec65[_0x5d9756(0x19c)]||_0x31ec65[_0x5d9756(0x1cd)]?.[0x0]?.[_0x5d9756(0x19c)];if(_0x2e6313?.['segment']===_0xdb759c)return{'stageName':_0x5d9756(0x19c),'criteriaName':_0x2e6313[_0x5d9756(0x14f)]||_0xdb759c};_0x4c0952:for(const _0x59073d of _0x2f9bd0){if(_0x59073d[_0x5d9756(0x17b)]?.[_0x5d9756(0x15d)]===_0xdb759c){_0x44575d=_0x59073d['name'],_0x83824a=_0x59073d[_0x5d9756(0x17b)][_0x5d9756(0x14f)]||_0xdb759c;break;}if(_0x59073d[_0x5d9756(0x108)])for(const _0x10e7ac of _0x59073d[_0x5d9756(0x108)]){if(_0x10e7ac[_0x5d9756(0x176)]===_0x5d9756(0x198)&&_0x10e7ac['with']?.['branches'])for(const _0x23f6e3 of _0x10e7ac[_0x5d9756(0x1c7)][_0x5d9756(0x1a6)]){if(_0x23f6e3['segment']===_0xdb759c){_0x44575d=_0x59073d['name'],_0x83824a=_0x23f6e3['name']||_0xdb759c;break _0x4c0952;}}}}return{'stageName':_0x44575d,'criteriaName':_0x83824a};}async function executeThreeStepJourneyCreate(_0x26384b,_0x8d4915,_0xf2fbed,_0x66dfb0,_0x15a7d1,_0x4e6a6d,_0x1d183d,_0x240f1a){const _0x251d45=a100_0x25feef,{activationDefToCreateRequest:_0x16d222,yamlRuleToApi:_0x49eeba}=_0x240f1a,{pendingEmbeddedSegments:_0x112402,pendingEmbeddedActivations:_0x359671,embeddedSegmentNameToId:_0x54193b}=_0x66dfb0,_0x56bf57=JSON[_0x251d45(0x13e)](JSON[_0x251d45(0x160)](_0xf2fbed));ensureJourneyDefaults(_0x56bf57[_0x251d45(0x144)]),stripPendingIds(_0x56bf57);const _0x17f446=await _0x26384b[_0x251d45(0x182)][_0x251d45(0x136)](_0x56bf57),_0x2d6be5=_0x17f446['id'],_0x4aa9dd=new Map();for(const _0x242090 of _0x17f446[_0x251d45(0x144)]['journeyStages']){_0x4aa9dd[_0x251d45(0x159)](_0x242090['name'][_0x251d45(0x184)](),_0x242090['id']);}for(const [_0x469c65,{definition:_0x5432c6}]of _0x112402){const _0x245cf4=generateDeterministicJourneySegmentName(_0x8d4915[_0x251d45(0x188)]['name'],_0x469c65);_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_segment_creating','journeyName':_0x8d4915[_0x251d45(0x188)]['name'],'segmentName':_0x469c65});const _0x5a6f72=createSegmentIdResolver(_0x4e6a6d[_0x251d45(0x1cf)],_0x469c65),_0x3ce80e=await resolveRuleSegmentIds(_0x5432c6['rule'],_0x5a6f72),_0x20fe56=await _0x26384b['segment']['createJourneySegment']({'name':_0x245cf4,'description':_0x5432c6[_0x251d45(0x114)]||_0x251d45(0x180)+_0x469c65,'journeyId':_0x2d6be5,'rule':_0x49eeba(_0x3ce80e,!![]),'countPopulation':!![],'parentFolderId':_0x15a7d1[_0x251d45(0x1a7)]||'','audienceId':_0x15a7d1[_0x251d45(0x155)]});_0x54193b[_0x251d45(0x159)](_0x469c65,_0x20fe56),_0x4e6a6d[_0x251d45(0x1cf)]['set'](_0x469c65,_0x20fe56),_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_segment_created','journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'segmentName':_0x469c65});}const _0x4424a4=new Map();for(const [_0x55fc1f,_0x44f3ac]of _0x359671){_0x1d183d['onProgress']?.({'type':_0x251d45(0x18d),'journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'activationName':_0x55fc1f});const _0x4224bb=await _0x16d222(_0x44f3ac,_0x4e6a6d[_0x251d45(0x1a4)]),_0x24d34a=await _0x26384b[_0x251d45(0x182)][_0x251d45(0x126)](_0x2d6be5,_0x4224bb);_0x4424a4[_0x251d45(0x159)](_0x55fc1f,_0x24d34a['id']),_0x66dfb0[_0x251d45(0x10e)]['set'](_0x55fc1f,_0x24d34a['id']),_0x1d183d[_0x251d45(0x152)]?.({'type':'embedded_activation_created','journeyName':_0x8d4915[_0x251d45(0x188)][_0x251d45(0x14f)],'activationName':_0x55fc1f});}const _0x5489be=JSON[_0x251d45(0x13e)](JSON[_0x251d45(0x160)](_0xf2fbed));return _0x5489be['id']=_0x2d6be5,ensureJourneyDefaults(_0x5489be['attributes']),resolvePendingIdsInRequest(_0x5489be,_0xf2fbed,_0x4aa9dd,_0x54193b,_0x4424a4,_0x1d183d),await _0x26384b[_0x251d45(0x182)]['update'](_0x2d6be5,_0x5489be),{'action':_0x251d45(0x1be),'journeyId':_0x2d6be5,'embeddedSegmentNameToId':_0x54193b};}function stripPendingIds(_0x46ed52){const _0x48e07c=a100_0x25feef;for(const _0x1e1cef of _0x46ed52['attributes'][_0x48e07c(0x193)]||[]){_0x1e1cef[_0x48e07c(0x1bc)]?.[_0x48e07c(0x145)]&&isPendingSegmentId(_0x1e1cef[_0x48e07c(0x1bc)][_0x48e07c(0x145)])&&delete _0x1e1cef[_0x48e07c(0x1bc)];if(_0x1e1cef['steps'])for(const _0x238c68 of Object[_0x48e07c(0xf3)](_0x1e1cef[_0x48e07c(0x108)])){const _0x1be8a3=_0x1e1cef[_0x48e07c(0x108)][_0x238c68];_0x1be8a3[_0x48e07c(0x176)]===_0x48e07c(0x174)&&_0x1be8a3[_0x48e07c(0x146)]&&isPendingActivationId(_0x1be8a3[_0x48e07c(0x146)])&&(_0x1be8a3['journeyActivationStepId']='');if(_0x1be8a3['type']===_0x48e07c(0x17c)&&_0x1be8a3[_0x48e07c(0x1a6)])for(const _0x3a68e5 of _0x1be8a3['branches']){_0x3a68e5[_0x48e07c(0x145)]&&isPendingSegmentId(_0x3a68e5[_0x48e07c(0x145)])&&(_0x3a68e5[_0x48e07c(0x145)]='');}_0x1be8a3[_0x48e07c(0x176)]==='WaitStep'&&_0x1be8a3[_0x48e07c(0x165)]?.[_0x48e07c(0x145)]&&isPendingSegmentId(_0x1be8a3[_0x48e07c(0x165)]['segmentId'])&&(_0x1be8a3[_0x48e07c(0x165)]['segmentId']='');}}}function resolvePendingIdsInRequest(_0x205a87,_0x50adad,_0x48f9df,_0x2d8df1,_0x225cf0,_0x44685f){const _0x247f80=a100_0x25feef,_0xdc9029=(_0x3eee4a,_0x3425cd)=>{const _0x33b1d1=a100_0x386c;if(!isPendingSegmentId(_0x3eee4a))return _0x3eee4a;const _0x364c57=extractPendingSegmentName(_0x3eee4a),_0x846f89=_0x2d8df1[_0x33b1d1(0x10c)](_0x364c57);return!_0x846f89&&_0x44685f['logWarning']?.(_0x33b1d1(0x17e)+_0x364c57+_0x33b1d1(0x166)+_0x3425cd),_0x846f89;};if(_0x205a87[_0x247f80(0x144)]['goal']?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x205a87['attributes']['goal'][_0x247f80(0x145)])){const _0x43bd40=_0xdc9029(_0x205a87[_0x247f80(0x144)]['goal'][_0x247f80(0x145)],'goal\x20criteria');_0x43bd40&&(_0x205a87[_0x247f80(0x144)][_0x247f80(0x19c)][_0x247f80(0x145)]=_0x43bd40);}for(const _0x24b721 of _0x205a87[_0x247f80(0x144)][_0x247f80(0x193)]||[]){const _0x17352c=_0x48f9df[_0x247f80(0x10c)](_0x24b721[_0x247f80(0x14f)][_0x247f80(0x184)]());_0x17352c&&(_0x24b721['id']=_0x17352c);if(_0x24b721[_0x247f80(0x1bc)]?.['segmentId']&&isPendingSegmentId(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)])){const _0x15aa1d=_0xdc9029(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+'\x27\x20entry\x20criteria');_0x15aa1d&&(_0x24b721[_0x247f80(0x1bc)][_0x247f80(0x145)]=_0x15aa1d);}if(_0x24b721[_0x247f80(0x1a3)])for(const _0x1a8afa of _0x24b721[_0x247f80(0x1a3)]){if(_0x1a8afa['segmentId']&&isPendingSegmentId(_0x1a8afa['segmentId'])){const _0x1a74ce=_0xdc9029(_0x1a8afa['segmentId'],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x128));_0x1a74ce&&(_0x1a8afa[_0x247f80(0x145)]=_0x1a74ce);}}if(_0x24b721[_0x247f80(0x1c1)]?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x24b721['milestone'][_0x247f80(0x145)])){const _0x299ac4=_0xdc9029(_0x24b721[_0x247f80(0x1c1)]['segmentId'],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+'\x27\x20milestone');_0x299ac4&&(_0x24b721[_0x247f80(0x1c1)][_0x247f80(0x145)]=_0x299ac4);}if(_0x24b721[_0x247f80(0x108)]){const _0x55941a=_0x13a993=>_0x50adad[_0x247f80(0x144)][_0x247f80(0x193)][_0x247f80(0x1d0)](_0x372ad7=>_0x372ad7[_0x247f80(0x14f)][_0x247f80(0x184)]()===_0x24b721[_0x247f80(0x14f)][_0x247f80(0x184)]())?.[_0x247f80(0x108)]?.[_0x13a993];for(const _0x8824b6 of Object[_0x247f80(0xf3)](_0x24b721['steps'])){const _0x322845=_0x24b721[_0x247f80(0x108)][_0x8824b6],_0x4dc8bc=_0x55941a(_0x8824b6);if(_0x322845['type']===_0x247f80(0x174)&&_0x322845['journeyActivationStepId']&&(isPendingActivationId(_0x322845[_0x247f80(0x146)])||_0x322845[_0x247f80(0x146)]==='')){if(_0x4dc8bc?.[_0x247f80(0x146)]&&isPendingActivationId(_0x4dc8bc['journeyActivationStepId'])){const _0x47301b=extractPendingActivationName(_0x4dc8bc[_0x247f80(0x146)]),_0x391e1f=_0x225cf0[_0x247f80(0x10c)](_0x47301b);_0x391e1f&&(_0x322845[_0x247f80(0x146)]=_0x391e1f);}}if(_0x322845[_0x247f80(0x176)]==='DecisionPoint'&&_0x322845['branches']&&_0x4dc8bc?.[_0x247f80(0x1a6)])for(let _0xe03e7=0x0;_0xe03e7<_0x322845['branches'][_0x247f80(0x11f)];_0xe03e7++){const _0x44d8cc=_0x322845[_0x247f80(0x1a6)][_0xe03e7],_0x1dbe39=_0x4dc8bc['branches'][_0xe03e7];if(_0x1dbe39?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x1dbe39[_0x247f80(0x145)])){const _0x193a56=_0xdc9029(_0x1dbe39[_0x247f80(0x145)],_0x247f80(0x143)+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x116)+(_0x44d8cc['name']||_0xe03e7)+'\x27');_0x193a56&&(_0x44d8cc['segmentId']=_0x193a56);}}if(_0x322845[_0x247f80(0x176)]===_0x247f80(0x11e)&&_0x322845[_0x247f80(0x165)]?.[_0x247f80(0x145)]&&_0x4dc8bc?.[_0x247f80(0x165)]?.[_0x247f80(0x145)]&&isPendingSegmentId(_0x4dc8bc[_0x247f80(0x165)][_0x247f80(0x145)])){const _0x56cb26=_0xdc9029(_0x4dc8bc['waitCondition']['segmentId'],'stage\x20\x27'+_0x24b721[_0x247f80(0x14f)]+_0x247f80(0x13c));_0x56cb26&&(_0x322845[_0x247f80(0x165)]['segmentId']=_0x56cb26);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x372593,_0x2e3106){const _0x4c76a8=a101_0x3e27,_0x294a1f=_0x372593();while(!![]){try{const _0x32d02b=parseInt(_0x4c76a8(0x118))/0x1+-parseInt(_0x4c76a8(0x126))/0x2+-parseInt(_0x4c76a8(0x122))/0x3+parseInt(_0x4c76a8(0x11b))/0x4*(parseInt(_0x4c76a8(0x11e))/0x5)+-parseInt(_0x4c76a8(0x123))/0x6*(-parseInt(_0x4c76a8(0x124))/0x7)+parseInt(_0x4c76a8(0x119))/0x8+-parseInt(_0x4c76a8(0x121))/0x9*(parseInt(_0x4c76a8(0x11d))/0xa);if(_0x32d02b===_0x2e3106)break;else _0x294a1f['push'](_0x294a1f['shift']());}catch(_0x225d9c){_0x294a1f['push'](_0x294a1f['shift']());}}}(a101_0x472b,0x8baf9));function a101_0x472b(){const _0x90c4a4=['1574470NcAfAB','parentFolderId','1117012aIrozM','2509936eDhFhq','get','1468cxyppN','set','809260mHHGBr','4475LgoUKv','name','has','45cVZFUE','3009393WGWavy','12342kDQKgA','3430cpoBtc','add'];a101_0x472b=function(){return _0x90c4a4;};return a101_0x472b();}export function buildFolderIdToPathMap(_0x3f7cd5){const _0x145e2f=a101_0x3e27,_0x9da250=new Map(),_0x4cc3a3=new Map();for(const _0xd68099 of _0x3f7cd5){_0x4cc3a3[_0x145e2f(0x11c)](_0xd68099['id'],_0xd68099);}const _0x5e0c9e=new Set();for(const _0x37ddda of _0x3f7cd5){!_0x37ddda['parentFolderId']&&_0x5e0c9e[_0x145e2f(0x125)](_0x37ddda['id']);}function _0x863281(_0x191cc9){const _0x8c1c11=_0x145e2f;if(_0x9da250[_0x8c1c11(0x120)](_0x191cc9['id']))return _0x9da250[_0x8c1c11(0x11a)](_0x191cc9['id']);if(_0x5e0c9e[_0x8c1c11(0x120)](_0x191cc9['id']))return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],''),'';if(_0x191cc9['parentFolderId']){const _0x2fea4b=_0x4cc3a3['get'](_0x191cc9['parentFolderId']);if(_0x2fea4b){const _0x4a799f=_0x863281(_0x2fea4b),_0x1ed406=_0x4a799f?_0x4a799f+'/'+_0x191cc9['name']:_0x191cc9[_0x8c1c11(0x11f)];return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],_0x1ed406),_0x1ed406;}}const _0x493600=_0x191cc9[_0x8c1c11(0x11f)];return _0x9da250[_0x8c1c11(0x11c)](_0x191cc9['id'],_0x493600),_0x493600;}for(const _0x206157 of _0x3f7cd5){_0x863281(_0x206157);}return _0x9da250;}export function buildFolderPathToIdMap(_0x1f509d){const _0x2b5085=a101_0x3e27,_0x3b20d7=new Map(),_0x3bdce0=new Map();for(const _0x456e99 of _0x1f509d){_0x3bdce0[_0x2b5085(0x11c)](_0x456e99['id'],_0x456e99);}const _0x1b1049=new Set();for(const _0x58d9d3 of _0x1f509d){!_0x58d9d3['parentFolderId']&&_0x1b1049['add'](_0x58d9d3['id']);}function _0x167a29(_0x24a830){const _0xcba426=_0x2b5085;if(_0x1b1049[_0xcba426(0x120)](_0x24a830['id']))return'';if(_0x24a830['parentFolderId']){const _0x85971=_0x3bdce0[_0xcba426(0x11a)](_0x24a830[_0xcba426(0x117)]);if(_0x85971){const _0x533a31=_0x167a29(_0x85971);return _0x533a31?_0x533a31+'/'+_0x24a830[_0xcba426(0x11f)]:_0x24a830[_0xcba426(0x11f)];}}return _0x24a830[_0xcba426(0x11f)];}for(const _0x2b2356 of _0x1f509d){const _0x37ca2b=_0x167a29(_0x2b2356);_0x3b20d7[_0x2b5085(0x11c)](_0x37ca2b,_0x2b2356['id']);}return _0x3b20d7;}function a101_0x3e27(_0x238694,_0x508a04){_0x238694=_0x238694-0x117;const _0x472bc3=a101_0x472b();let _0x3e27ff=_0x472bc3[_0x238694];return _0x3e27ff;}export function buildFolderMaps(_0x3323cf){const _0x13de85=a101_0x3e27,_0x576777=buildFolderIdToPathMap(_0x3323cf),_0x71fda4=new Map();for(const [_0x37e79e,_0x1ab03f]of _0x576777){_0x71fda4[_0x13de85(0x11c)](_0x1ab03f,_0x37e79e);}return{'idToPath':_0x576777,'pathToId':_0x71fda4};}export function getFolderPath(_0x23f595,_0xf05700){const _0x5685bf=a101_0x3e27;if(!_0x23f595)return'';return _0xf05700[_0x5685bf(0x11a)](_0x23f595)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a102_0x2862(_0x2e8be9,_0x5845ea){_0x2e8be9=_0x2e8be9-0x1e2;const _0x14de2d=a102_0x14de();let _0x28620f=_0x14de2d[_0x2e8be9];return _0x28620f;}function a102_0x14de(){const _0x49b8d0=['.yml','split','segments','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','1821515ouekcc','test','trim','File\x20not\x20found:\x20','startsWith','exists','raw','122454CsJfHJ','endsWith','name','3326jzNDox','journey','Relative\x20path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','parent_segment','130ZnwNTo','dirname','type','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','pop','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','readFile','1033602TVIMre','4029040FANioy','push','join','977123sqyIAt','parse','No\x20tdx.json\x20found\x20for\x20file:\x20','length','18vgjkym','isAbsolute','4MPQSTD','substring','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','slice','relative','6295124sbfMhW','144UGYqsV','resolve','Cannot\x20split\x20empty\x20path','tdx.json','segment'];a102_0x14de=function(){return _0x49b8d0;};return a102_0x14de();}(function(_0x38a6a1,_0x556e00){const _0x22940a=a102_0x2862,_0x1ddc5d=_0x38a6a1();while(!![]){try{const _0x403a87=-parseInt(_0x22940a(0x1e3))/0x1*(parseInt(_0x22940a(0x20d))/0x2)+parseInt(_0x22940a(0x1ea))/0x3+parseInt(_0x22940a(0x1f4))/0x4*(-parseInt(_0x22940a(0x203))/0x5)+-parseInt(_0x22940a(0x1f2))/0x6*(-parseInt(_0x22940a(0x1ee))/0x7)+parseInt(_0x22940a(0x1fa))/0x8*(parseInt(_0x22940a(0x20a))/0x9)+parseInt(_0x22940a(0x1eb))/0xa+-parseInt(_0x22940a(0x1f9))/0xb;if(_0x403a87===_0x556e00)break;else _0x1ddc5d['push'](_0x1ddc5d['shift']());}catch(_0x22caaa){_0x1ddc5d['push'](_0x1ddc5d['shift']());}}}(a102_0x14de,0x3f120));import a102_0x4bf119 from'path';import{parse as a102_0x159e68}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0xfeac8e){const _0x1d642b=a102_0x2862;if(!_0xfeac8e||_0xfeac8e[_0x1d642b(0x205)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x4932f1=_0xfeac8e[_0x1d642b(0x205)]();if(_0x4932f1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0xfeac8e};const _0x2591c8=_0x4932f1[_0x1d642b(0x207)]('/')?_0x4932f1[_0x1d642b(0x1f5)](0x1):_0x4932f1,_0x2a8fbe=_0x2591c8[_0x1d642b(0x200)]('/')['filter'](_0x5e8a15=>_0x5e8a15!=='');if(_0x2a8fbe[_0x1d642b(0x1f1)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x18ccf5=_0x4932f1[_0x1d642b(0x207)]('/')||!isRelativePathSegment(_0x2a8fbe[0x0]);for(const _0x5a9b67 of _0x2a8fbe){validatePathSegment(_0x5a9b67);}return{'segments':_0x2a8fbe,'isAbsolute':_0x18ccf5,'raw':_0xfeac8e};}function isRelativePathSegment(_0x211d24){return _0x211d24==='.'||_0x211d24==='..';}function validatePathSegment(_0x9aaeeb){const _0x298c3b=a102_0x2862;if(_0x9aaeeb==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x9aaeeb==='.'||_0x9aaeeb==='..')return;if(/[\x00-\x1F\x7F]/[_0x298c3b(0x204)](_0x9aaeeb))throw new Error(_0x298c3b(0x1f6)+_0x9aaeeb);if(_0x9aaeeb!==_0x9aaeeb[_0x298c3b(0x205)]()){}}export function validatePath(_0x156a18){const _0x1e42d2=a102_0x2862;if(_0x156a18[_0x1e42d2(0x201)][_0x1e42d2(0x1f1)]===0x0&&!_0x156a18[_0x1e42d2(0x1f3)])throw new Error(_0x1e42d2(0x20f));if(_0x156a18['isAbsolute']){if(_0x156a18[_0x1e42d2(0x201)][0x0]==='..')throw new Error(_0x1e42d2(0x202));let _0xa1f8c4=0x0;for(const _0x5821f0 of _0x156a18[_0x1e42d2(0x201)]){if(_0x5821f0==='..'){if(_0xa1f8c4===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0xa1f8c4--;}else _0x5821f0!=='.'&&_0xa1f8c4++;}}}export function joinPaths(_0x371a8b,_0x5d387e){const _0x36fa3f=a102_0x2862;if(!_0x371a8b||_0x371a8b==='/')return _0x5d387e;if(!_0x5d387e||_0x5d387e==='.')return _0x371a8b;if(_0x5d387e[_0x36fa3f(0x207)]('/'))return _0x5d387e;const _0xcb4f99=parsePath(_0x371a8b),_0x53fdf9=parsePath(_0x5d387e),_0x27c780=[..._0xcb4f99[_0x36fa3f(0x201)]];for(const _0x15e73b of _0x53fdf9[_0x36fa3f(0x201)]){if(_0x15e73b==='.')continue;else{if(_0x15e73b==='..'){if(_0x27c780[_0x36fa3f(0x1f1)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x27c780[_0x36fa3f(0x1e7)]();}else _0x27c780[_0x36fa3f(0x1ec)](_0x15e73b);}}const _0x5a6c20=_0x27c780[_0x36fa3f(0x1ed)]('/');return _0xcb4f99[_0x36fa3f(0x209)]['startsWith']('/')?'/'+_0x5a6c20:_0x5a6c20;}export function normalizePath(_0xffabdf){const _0x2a25a5=a102_0x2862,_0x5ccd65=parsePath(_0xffabdf),_0x21d310=[];for(const _0x476144 of _0x5ccd65[_0x2a25a5(0x201)]){if(_0x476144==='.')continue;else{if(_0x476144==='..'){if(_0x21d310['length']===0x0){if(_0x5ccd65[_0x2a25a5(0x1f3)])throw new Error(_0x2a25a5(0x210));_0x21d310[_0x2a25a5(0x1ec)]('..');}else _0x21d310[_0x21d310[_0x2a25a5(0x1f1)]-0x1]==='..'?_0x21d310['push']('..'):_0x21d310[_0x2a25a5(0x1e7)]();}else _0x21d310[_0x2a25a5(0x1ec)](_0x476144);}}if(_0x21d310[_0x2a25a5(0x1f1)]===0x0)return _0x5ccd65[_0x2a25a5(0x1f3)]?'/':'.';const _0x4c9368=_0x21d310[_0x2a25a5(0x1ed)]('/');return _0x5ccd65[_0x2a25a5(0x209)]['startsWith']('/')?'/'+_0x4c9368:_0x4c9368;}export function getParentPath(_0x49a57a){const _0x505b99=a102_0x2862,_0x5ba633=parsePath(_0x49a57a);if(_0x5ba633['segments']['length']<=0x1)return'/';const _0x9f1b2a=_0x5ba633['segments'][_0x505b99(0x1f7)](0x0,-0x1)[_0x505b99(0x1ed)]('/');return _0x5ba633[_0x505b99(0x209)]['startsWith']('/')?'/'+_0x9f1b2a:_0x9f1b2a;}export function getBaseName(_0x5bdd9c){const _0x1ca84d=a102_0x2862,_0xabf7cf=parsePath(_0x5bdd9c);return _0xabf7cf[_0x1ca84d(0x201)][_0xabf7cf['segments'][_0x1ca84d(0x1f1)]-0x1]||'';}export function isChildPath(_0x3199ef,_0x3906e5){const _0x135be9=a102_0x2862,_0x20cf7d=parsePath(_0x3199ef),_0x57b5ad=parsePath(_0x3906e5);if(_0x20cf7d['segments'][_0x135be9(0x1f1)]<=_0x57b5ad[_0x135be9(0x201)][_0x135be9(0x1f1)])return![];for(let _0x1da0a6=0x0;_0x1da0a6<_0x57b5ad[_0x135be9(0x201)][_0x135be9(0x1f1)];_0x1da0a6++){if(_0x20cf7d['segments'][_0x1da0a6]!==_0x57b5ad['segments'][_0x1da0a6])return![];}return!![];}export function splitPath(_0x711321){const _0xefc985=a102_0x2862,_0x2ad63d=parsePath(_0x711321);if(_0x2ad63d['segments'][_0xefc985(0x1f1)]===0x0)throw new Error(_0xefc985(0x1fc));if(_0x2ad63d[_0xefc985(0x201)][_0xefc985(0x1f1)]===0x1)return{'parent':_0x2ad63d[_0xefc985(0x201)][0x0]};return{'parent':_0x2ad63d['segments'][0x0],'child':_0x2ad63d['segments']['slice'](0x1)['join']('/')};}export function isYamlFilePath(_0x51bda9){const _0x5dd84f=a102_0x2862;return _0x51bda9[_0x5dd84f(0x20b)](_0x5dd84f(0x1ff))||_0x51bda9['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x2aac25,_0x474100=nodeFileSystem){const _0x592c07=a102_0x2862,_0x3e5f4a=a102_0x4bf119[_0x592c07(0x1fb)](_0x2aac25);if(!await _0x474100['exists'](_0x3e5f4a))throw new Error(_0x592c07(0x206)+_0x2aac25);let _0x2f406d=a102_0x4bf119[_0x592c07(0x1e4)](_0x3e5f4a),_0x43032a=null,_0x263d8b=null;const _0x10f771=a102_0x4bf119[_0x592c07(0x1ef)](_0x2f406d)['root'];while(_0x2f406d!==_0x10f771){const _0x5f49c2=a102_0x4bf119[_0x592c07(0x1ed)](_0x2f406d,_0x592c07(0x1fd));if(await _0x474100[_0x592c07(0x208)](_0x5f49c2)){_0x43032a=_0x5f49c2,_0x263d8b=_0x2f406d;break;}_0x2f406d=a102_0x4bf119['dirname'](_0x2f406d);}if(!_0x43032a||!_0x263d8b)throw new Error(_0x592c07(0x1f0)+_0x2aac25);const _0x2fdb69=await _0x474100[_0x592c07(0x1e9)](_0x43032a),_0x2a4796=JSON[_0x592c07(0x1ef)](_0x2fdb69),_0x3ba69b=_0x2a4796[_0x592c07(0x1e2)];if(!_0x3ba69b)throw new Error(_0x592c07(0x1e8));const _0x3adae8=await _0x474100['readFile'](_0x3e5f4a),_0x1fd307=a102_0x159e68(_0x3adae8),_0x5a953e=_0x1fd307[_0x592c07(0x20c)];if(!_0x5a953e)throw new Error(_0x592c07(0x1e6)+_0x2aac25);const _0x2e578e=_0x1fd307[_0x592c07(0x1e5)]==='journey'?_0x592c07(0x20e):_0x592c07(0x1fe),_0x546e40=a102_0x4bf119[_0x592c07(0x1f8)](_0x263d8b,_0x3e5f4a),_0x556a48=a102_0x4bf119[_0x592c07(0x1e4)](_0x546e40),_0x574ed1=_0x556a48==='.'?'':_0x556a48['replace'](/\\/g,'/'),_0xe866d5=_0x574ed1?_0x3ba69b+'/'+_0x574ed1+'/'+_0x5a953e:_0x3ba69b+'/'+_0x5a953e;return{'parentSegment':_0x3ba69b,'segmentName':_0x5a953e,'folderPath':_0x574ed1,'fullPath':_0xe866d5,'resourceType':_0x2e578e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a103_0x19f9(){const _0x28a501=['2146220QuoTyi','3006342YKkBvM','Invalid\x20segment\x20reference\x20format:\x20','433812ZxLXCu','415872LAiOyr','10vQCfHh','indexOf','3poCdzw','15810399Hjsaze','495650yHWpVD','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring','7hNmPEu','.\x20Child\x20name\x20cannot\x20be\x20empty','286952BegbPu'];a103_0x19f9=function(){return _0x28a501;};return a103_0x19f9();}function a103_0x2d9d(_0x419ba5,_0x20c401){_0x419ba5=_0x419ba5-0x12c;const _0x19f970=a103_0x19f9();let _0x2d9d39=_0x19f970[_0x419ba5];return _0x2d9d39;}(function(_0x1ef557,_0x672136){const _0x1696a1=a103_0x2d9d,_0x10828f=_0x1ef557();while(!![]){try{const _0x2b0a3e=-parseInt(_0x1696a1(0x132))/0x1+-parseInt(_0x1696a1(0x12d))/0x2+parseInt(_0x1696a1(0x130))/0x3*(parseInt(_0x1696a1(0x12c))/0x4)+-parseInt(_0x1696a1(0x138))/0x5+-parseInt(_0x1696a1(0x139))/0x6*(parseInt(_0x1696a1(0x135))/0x7)+parseInt(_0x1696a1(0x137))/0x8+parseInt(_0x1696a1(0x131))/0x9*(parseInt(_0x1696a1(0x12e))/0xa);if(_0x2b0a3e===_0x672136)break;else _0x10828f['push'](_0x10828f['shift']());}catch(_0x448931){_0x10828f['push'](_0x10828f['shift']());}}}(a103_0x19f9,0x4138a));export function parseSegmentRef(_0x2ed90c){const _0x72f7e9=a103_0x2d9d,_0x2e5811=_0x2ed90c[_0x72f7e9(0x12f)]('/');if(_0x2e5811===-0x1)return{'parentId':_0x2ed90c};if(_0x2e5811===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x2ed90c+_0x72f7e9(0x133));const _0x56f7f8=_0x2ed90c[_0x72f7e9(0x134)](0x0,_0x2e5811),_0x4246a3=_0x2ed90c['substring'](_0x2e5811+0x1);if(_0x4246a3==='')throw new Error(_0x72f7e9(0x13a)+_0x2ed90c+_0x72f7e9(0x136));return{'parentId':_0x56f7f8,'childId':_0x4246a3};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15e651,_0x58a0b7){const _0x57a3ba=a104_0x3ba5,_0x3e18e1=_0x15e651();while(!![]){try{const _0x272681=parseInt(_0x57a3ba(0x1d6))/0x1+parseInt(_0x57a3ba(0x1de))/0x2*(parseInt(_0x57a3ba(0x1df))/0x3)+-parseInt(_0x57a3ba(0x202))/0x4*(parseInt(_0x57a3ba(0x20d))/0x5)+-parseInt(_0x57a3ba(0x1db))/0x6*(-parseInt(_0x57a3ba(0x1f1))/0x7)+-parseInt(_0x57a3ba(0x200))/0x8+-parseInt(_0x57a3ba(0x20c))/0x9*(-parseInt(_0x57a3ba(0x209))/0xa)+-parseInt(_0x57a3ba(0x205))/0xb;if(_0x272681===_0x58a0b7)break;else _0x3e18e1['push'](_0x3e18e1['shift']());}catch(_0x1869cc){_0x3e18e1['push'](_0x3e18e1['shift']());}}}(a104_0x351d,0x65f59));import a104_0x2c2053 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x287136){const _0x3742da=a104_0x3ba5;return _0x287136[_0x3742da(0x1e8)]!=='error';}export function isScopedResolution(_0x22cf69){const _0x42dedb=a104_0x3ba5;return _0x22cf69[_0x42dedb(0x1e8)]==='directory'||_0x22cf69['type']===_0x42dedb(0x1f5)||_0x22cf69[_0x42dedb(0x1e8)]===_0x42dedb(0x20f);}function a104_0x351d(){const _0x4f045f=['join','extname','4095144dtlJhZ','File\x20not\x20found','76KcjJRA','segment','resourceType','2314862RqVdQj','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','Parent\x20segment\x20not\x20specified','string','10990sNUyMK','no_parent','parentSegment','279cFuMAW','2410kjKxjx','parent_name','context','scopedFolderPath','497708TIBSIV','readFile','folderPath','message','error','3102276OppZBJ','File\x20not\x20found:\x20','root','130LnEAmW','4629KNlghc','stat','No\x20tdx.json\x20found','match','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Not\x20a\x20YAML\x20file:\x20','journey','includes','No\x20tdx.json\x20found\x20for\x20file:\x20','type','resolve','cwd','invalid_yaml','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','replace','directory','configDir','isScoped','7nAYbnj','trim','file_not_found','dirname','file','tdx.json','no_config','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','exists','parent_segment','basename','parse','segmentName'];a104_0x351d=function(){return _0x4f045f;};return a104_0x351d();}export function getScopedDetails(_0xd96558){const _0x29b98f=a104_0x3ba5;if(isScopedResolution(_0xd96558))return{'isScoped':_0xd96558[_0x29b98f(0x1f0)],'scopedFolderPath':_0xd96558['scopedFolderPath']};return undefined;}async function findTdxConfigAsync(_0x111db1,_0x3dbb10){const _0x1dc57c=a104_0x3ba5;let _0x2492f4=a104_0x2c2053[_0x1dc57c(0x1e9)](_0x111db1);const _0x55242b=a104_0x2c2053['parse'](_0x2492f4)[_0x1dc57c(0x1dd)];while(_0x2492f4!==_0x55242b){const _0x24b9e0=a104_0x2c2053[_0x1dc57c(0x1fe)](_0x2492f4,_0x1dc57c(0x1f6));if(await _0x3dbb10[_0x1dc57c(0x1f9)](_0x24b9e0))try{const _0x336e4b=await _0x3dbb10[_0x1dc57c(0x1d7)](_0x24b9e0),_0x1c4932=JSON[_0x1dc57c(0x1fc)](_0x336e4b);if(_0x1c4932[_0x1dc57c(0x1fa)]&&typeof _0x1c4932[_0x1dc57c(0x1fa)]===_0x1dc57c(0x208))return{'configPath':_0x24b9e0,'configDir':_0x2492f4,'parentSegment':_0x1c4932['parent_segment']};}catch{}_0x2492f4=a104_0x2c2053['dirname'](_0x2492f4);}return null;}function a104_0x3ba5(_0x4e692e,_0x590d79){_0x4e692e=_0x4e692e-0x1d6;const _0x351d9a=a104_0x351d();let _0x3ba5e9=_0x351d9a[_0x4e692e];return _0x3ba5e9;}function calculateScopedPath(_0x120e6b,_0x146969){const _0x237259=a104_0x3ba5,_0x131989=a104_0x2c2053['relative'](_0x146969,_0x120e6b),_0x29db6d=_0x131989!==''&&_0x131989!=='.'&&!_0x131989['startsWith']('..');return{'isScoped':_0x29db6d,'scopedFolderPath':_0x29db6d?_0x131989[_0x237259(0x1ed)](/\\/g,'/'):''};}export async function resolveTarget(_0x1c9060){const _0x2ae4a3=a104_0x3ba5,{arg:_0x41f349,contextParent:_0x484a66,cwd:cwd=process[_0x2ae4a3(0x1ea)](),fs:fs=nodeFileSystem}=_0x1c9060;if(_0x41f349&&isYamlFilePath(_0x41f349))try{const _0x5375f2=await resolveYamlFilePath(_0x41f349,fs),_0x5e7813=a104_0x2c2053['resolve'](_0x41f349),_0x4cb4f5=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x5e7813),_0x35db88=await findTdxConfigAsync(_0x4cb4f5,fs);if(!_0x35db88){if(_0x484a66){const _0x54ca07=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x5e7813);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x484a66,'targetDir':_0x54ca07,'configRoot':_0x54ca07,'filePath':_0x5e7813,'resourceName':_0x5375f2[_0x2ae4a3(0x1fd)],'folderPath':_0x5375f2[_0x2ae4a3(0x1d8)],'resourceType':_0x5375f2[_0x2ae4a3(0x204)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e7)+_0x41f349,'arg':_0x41f349,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x394f64=calculateScopedPath(_0x4cb4f5,_0x35db88[_0x2ae4a3(0x1ef)]);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x35db88[_0x2ae4a3(0x20b)],'targetDir':_0x35db88[_0x2ae4a3(0x1ef)],'configRoot':_0x35db88[_0x2ae4a3(0x1ef)],'filePath':_0x5e7813,'resourceName':_0x5375f2[_0x2ae4a3(0x1fd)],'folderPath':_0x5375f2[_0x2ae4a3(0x1d8)],'resourceType':_0x5375f2[_0x2ae4a3(0x204)],'isScoped':_0x394f64[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x394f64[_0x2ae4a3(0x210)]};}catch(_0x51f007){const _0x1aaa4c=_0x51f007 instanceof Error?_0x51f007[_0x2ae4a3(0x1d9)]:String(_0x51f007);if(_0x1aaa4c['includes'](_0x2ae4a3(0x201)))return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f3),'message':_0x2ae4a3(0x1dc)+_0x41f349,'arg':_0x41f349};if(_0x1aaa4c[_0x2ae4a3(0x1e6)](_0x2ae4a3(0x1e1))){if(_0x484a66){const _0x4114c7=a104_0x2c2053[_0x2ae4a3(0x1e9)](_0x41f349);if(await fs[_0x2ae4a3(0x1f9)](_0x4114c7)){const _0x15628a=a104_0x2c2053[_0x2ae4a3(0x1f4)](_0x4114c7),_0xa04114=await fs[_0x2ae4a3(0x1d7)](_0x4114c7),_0x1d8f0c=_0xa04114['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x4ee644=_0xa04114[_0x2ae4a3(0x1e2)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x101a6c=_0x1d8f0c?_0x1d8f0c[0x1]['trim']():a104_0x2c2053[_0x2ae4a3(0x1fb)](_0x41f349,a104_0x2c2053[_0x2ae4a3(0x1ff)](_0x41f349)),_0x35f45a=_0x4ee644&&_0x4ee644[0x1][_0x2ae4a3(0x1f2)]()===_0x2ae4a3(0x1e5)?_0x2ae4a3(0x1e5):_0x2ae4a3(0x203);return{'type':_0x2ae4a3(0x1f5),'parentName':_0x484a66,'targetDir':_0x15628a,'configRoot':_0x15628a,'filePath':_0x4114c7,'resourceName':_0x101a6c,'folderPath':'','resourceType':_0x35f45a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e7)+_0x41f349,'arg':_0x41f349,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1eb),'message':_0x1aaa4c,'arg':_0x41f349};}if(_0x41f349){const _0x537405=a104_0x2c2053[_0x2ae4a3(0x1e9)](cwd,_0x41f349);let _0x1a90f5=null;try{_0x1a90f5=await fs[_0x2ae4a3(0x1e0)](_0x537405);}catch{}if(_0x1a90f5?.['isDirectory']()){const _0x48f447=await findTdxConfigAsync(_0x537405,fs);if(_0x48f447){const _0x414025=calculateScopedPath(_0x537405,_0x48f447['configDir']);return{'type':'directory','parentName':_0x48f447[_0x2ae4a3(0x20b)],'targetDir':_0x537405,'configRoot':_0x48f447['configDir'],'isScoped':_0x414025[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x414025[_0x2ae4a3(0x210)]};}if(_0x484a66)return{'type':_0x2ae4a3(0x1ee),'parentName':_0x484a66,'targetDir':_0x537405,'configRoot':_0x537405,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x2ae4a3(0x1f7),'message':_0x2ae4a3(0x1e3)+_0x41f349,'arg':_0x41f349,'helpText':_0x2ae4a3(0x206)};}if(_0x1a90f5?.['isFile']())return{'type':_0x2ae4a3(0x1da),'errorCode':_0x2ae4a3(0x1eb),'message':_0x2ae4a3(0x1e4)+_0x41f349,'arg':_0x41f349,'helpText':_0x2ae4a3(0x1f8)};const _0x3f1d72=sanitizeFileName(_0x41f349),_0x18859b=getSegmentRootDir(_0x3f1d72,cwd);return{'type':_0x2ae4a3(0x20e),'parentName':_0x41f349,'targetDir':_0x18859b,'configRoot':_0x18859b};}const _0x486ac4=await findTdxConfigAsync(cwd,fs);if(_0x486ac4){const _0x12ae28=calculateScopedPath(cwd,_0x486ac4[_0x2ae4a3(0x1ef)]);return{'type':_0x2ae4a3(0x20f),'parentName':_0x486ac4[_0x2ae4a3(0x20b)],'targetDir':cwd,'configRoot':_0x486ac4[_0x2ae4a3(0x1ef)],'isScoped':_0x12ae28[_0x2ae4a3(0x1f0)],'scopedFolderPath':_0x12ae28[_0x2ae4a3(0x210)]};}if(_0x484a66){const _0x17f81c=sanitizeFileName(_0x484a66),_0x3539cd=getSegmentRootDir(_0x17f81c,cwd);return{'type':_0x2ae4a3(0x20f),'parentName':_0x484a66,'targetDir':_0x3539cd,'configRoot':_0x3539cd,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x2ae4a3(0x20a),'message':_0x2ae4a3(0x207),'helpText':_0x2ae4a3(0x1ec)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a105_0x316567=a105_0x16ef;(function(_0x583e17,_0x4a3cdc){const _0x3ce386=a105_0x16ef,_0x26ab3d=_0x583e17();while(!![]){try{const _0x257dd6=parseInt(_0x3ce386(0x105))/0x1*(-parseInt(_0x3ce386(0x117))/0x2)+-parseInt(_0x3ce386(0x103))/0x3*(-parseInt(_0x3ce386(0x10a))/0x4)+parseInt(_0x3ce386(0x116))/0x5*(-parseInt(_0x3ce386(0x107))/0x6)+-parseInt(_0x3ce386(0xfe))/0x7*(-parseInt(_0x3ce386(0x109))/0x8)+-parseInt(_0x3ce386(0x111))/0x9+parseInt(_0x3ce386(0xfc))/0xa+parseInt(_0x3ce386(0x10b))/0xb;if(_0x257dd6===_0x4a3cdc)break;else _0x26ab3d['push'](_0x26ab3d['shift']());}catch(_0x3c51be){_0x26ab3d['push'](_0x26ab3d['shift']());}}}(a105_0x48e5,0x753c5));function a105_0x48e5(){const _0x5c3f4c=['524iXiNwb','22978131kXCYbp','parent_segment','string','root','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','5576337BIFJEo','startsWith','tdx.json','replace','join','3018325aBHWZr','2SbpUQO','1398250unRsZe','object','91385HetQJZ','resolve','cwd','Invalid\x20tdx.json:\x20expected\x20object','dirname','3855CvcYoP','parse','745846pfRZLa','relative','6cSOMGK','Invalid\x20JSON\x20in\x20','32wBVuIf'];a105_0x48e5=function(){return _0x5c3f4c;};return a105_0x48e5();}import{existsSync,readFileSync}from'fs';import a105_0x14be35 from'path';const TDX_CONFIG_FILE=a105_0x316567(0x113),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x5d973a=process['cwd']()){const _0x2f1bb0=a105_0x316567;let _0x5ee1a5=a105_0x14be35[_0x2f1bb0(0xff)](_0x5d973a);const _0xcf30cf=a105_0x14be35[_0x2f1bb0(0x104)](_0x5ee1a5)[_0x2f1bb0(0x10e)];while(_0x5ee1a5!==_0xcf30cf){const _0x3813df=a105_0x14be35['join'](_0x5ee1a5,TDX_CONFIG_FILE);if(existsSync(_0x3813df))return _0x3813df;_0x5ee1a5=a105_0x14be35[_0x2f1bb0(0x102)](_0x5ee1a5);}return null;}export function loadTdxConfig(_0x5b3108){const _0x2c1f00=a105_0x316567,_0x2eebae=readFileSync(_0x5b3108,'utf-8');let _0x169183;try{_0x169183=JSON[_0x2c1f00(0x104)](_0x2eebae);}catch{throw new Error(_0x2c1f00(0x108)+_0x5b3108);}if(!_0x169183||typeof _0x169183!==_0x2c1f00(0xfd))throw new Error(_0x2c1f00(0x101));const _0xd6d9fb=_0x169183;if(!_0xd6d9fb['parent_segment']||typeof _0xd6d9fb[_0x2c1f00(0x10c)]!==_0x2c1f00(0x10d))throw new Error(_0x2c1f00(0x110));return{'parent_segment':_0xd6d9fb[_0x2c1f00(0x10c)]};}function a105_0x16ef(_0x4dacef,_0xd00f17){_0x4dacef=_0x4dacef-0xfc;const _0x48e50d=a105_0x48e5();let _0x16effe=_0x48e50d[_0x4dacef];return _0x16effe;}export function findTdxConfig(_0x32c200=process['cwd']()){const _0x3393e2=a105_0x316567,_0xab2e07=findTdxConfigPath(_0x32c200);if(!_0xab2e07)throw new Error(_0x3393e2(0x10f));const _0x138e0b=loadTdxConfig(_0xab2e07),_0x25596a=a105_0x14be35[_0x3393e2(0x102)](_0xab2e07);return{'config':_0x138e0b,'configPath':_0xab2e07,'configDir':_0x25596a};}export function tryFindTdxConfig(_0x4f4397){try{return findTdxConfig(_0x4f4397);}catch{return null;}}export function getSegmentRootDir(_0x2a678a,_0x292e85=process[a105_0x316567(0x100)]()){const _0x19f384=a105_0x316567;return a105_0x14be35[_0x19f384(0x115)](_0x292e85,SEGMENTS_DIR,_0x2a678a);}export function getTdxConfigPath(_0x218cb8,_0x28415c=process['cwd']()){const _0x49761a=a105_0x316567;return a105_0x14be35[_0x49761a(0x115)](getSegmentRootDir(_0x218cb8,_0x28415c),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x3fc48d,_0x982fa4){const _0x19b0e8=a105_0x316567,_0x4b61b8=a105_0x14be35[_0x19b0e8(0xff)](_0x3fc48d),_0x4a5cbe=a105_0x14be35[_0x19b0e8(0x106)](_0x982fa4,_0x4b61b8);if(_0x4a5cbe[_0x19b0e8(0x112)]('..'))return'';return _0x4a5cbe;}export function localPathToTdFolderPath(_0x40149a){const _0x2b4c45=a105_0x316567,_0x19a4e4=a105_0x14be35[_0x2b4c45(0x102)](_0x40149a);if(_0x19a4e4==='.'||_0x19a4e4==='')return'';return _0x19a4e4[_0x2b4c45(0x114)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x4cd92d,_0x104318){const _0x26f577=a105_0x316567;if(!_0x4cd92d)return _0x104318;return a105_0x14be35[_0x26f577(0x115)](_0x104318,_0x4cd92d);}export function createTdxConfigContent(_0x1892d9){const _0x5e183a={'parent_segment':_0x1892d9};return JSON['stringify'](_0x5e183a,null,0x2)+'\x0a';}
|