@treasuredata/tdx 2026.8.5 → 2026.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/codex-command.d.ts +52 -0
- package/dist/commands/codex-command.d.ts.map +1 -0
- package/dist/commands/codex-command.js +1 -0
- package/dist/commands/codex-command.js.map +1 -0
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/p13n-command.d.ts +16 -1
- package/dist/commands/p13n-command.d.ts.map +1 -1
- package/dist/commands/p13n-command.js +1 -1
- package/dist/commands/p13n-command.js.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.d.ts +1 -0
- package/dist/commands/unset-command.d.ts.map +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/unset-command.js.map +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.d.ts +1 -0
- package/dist/commands/use-command.d.ts.map +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/use-command.js.map +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +2 -1
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/site-mismatch.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.d.ts +3 -3
- package/dist/core/version.d.ts.map +1 -1
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/auth-token.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +10 -2
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/p13n-studio-api-client.d.ts +65 -1
- package/dist/sdk/client/p13n-studio-api-client.d.ts.map +1 -1
- package/dist/sdk/client/p13n-studio-api-client.js +1 -1
- package/dist/sdk/client/p13n-studio-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/template-yaml.js.map +1 -1
- package/dist/sdk/engage/types/always-on-campaign-schema.d.ts +1 -0
- package/dist/sdk/engage/types/always-on-campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/always-on-campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +2 -0
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.d.ts +1 -0
- package/dist/sdk/engage/types/template-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js.map +1 -1
- package/dist/sdk/engage.d.ts +7 -2
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +5 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/p13n-studio.d.ts +148 -1
- package/dist/sdk/p13n-studio.d.ts.map +1 -1
- package/dist/sdk/p13n-studio.js +1 -1
- package/dist/sdk/p13n-studio.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +49 -0
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +3 -2
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/p13n-studio.d.ts +73 -0
- package/dist/sdk/types/p13n-studio.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.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 +2 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
const a174_0x32cc05=a174_0x1505;(function(_0x9d5f7f,_0x185a6e){const _0x54ad0b=a174_0x1505,_0x979c33=_0x9d5f7f();while(!![]){try{const _0x406374=-parseInt(_0x54ad0b(0x293))/0x1*(parseInt(_0x54ad0b(0x28d))/0x2)+-parseInt(_0x54ad0b(0x1cb))/0x3+parseInt(_0x54ad0b(0x211))/0x4*(-parseInt(_0x54ad0b(0x288))/0x5)+parseInt(_0x54ad0b(0x19b))/0x6*(-parseInt(_0x54ad0b(0x1c6))/0x7)+parseInt(_0x54ad0b(0x269))/0x8*(parseInt(_0x54ad0b(0x197))/0x9)+parseInt(_0x54ad0b(0x1a2))/0xa*(-parseInt(_0x54ad0b(0x284))/0xb)+-parseInt(_0x54ad0b(0x1a5))/0xc*(-parseInt(_0x54ad0b(0x1ad))/0xd);if(_0x406374===_0x185a6e)break;else _0x979c33['push'](_0x979c33['shift']());}catch(_0x1c7cf2){_0x979c33['push'](_0x979c33['shift']());}}}(a174_0x4452,0x4b638));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a174_0x32cc05(0x1d3));export const PENDING_SEGMENT_PREFIX=a174_0x32cc05(0x1fe);export const PENDING_ACTIVATION_PREFIX=a174_0x32cc05(0x1f6);export function createPendingSegmentId(_0x24288c){return''+PENDING_SEGMENT_PREFIX+_0x24288c+'__';}export function isPendingSegmentId(_0x41b2ab){const _0x2e31bf=a174_0x32cc05;return _0x41b2ab[_0x2e31bf(0x1fa)](PENDING_SEGMENT_PREFIX)&&!_0x41b2ab[_0x2e31bf(0x1fa)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1c2f3e){return _0x1c2f3e['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4c688b){return''+PENDING_ACTIVATION_PREFIX+_0x4c688b+'__';}export function isPendingActivationId(_0x4d91ee){const _0x3abca5=a174_0x32cc05;return _0x4d91ee[_0x3abca5(0x1fa)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x9ca93f){return _0x9ca93f['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3c6232,_0x466637){const _0x2fcdbb=a174_0x32cc05,_0x3f6b71=_0x3c6232+'::'+(_0x466637[_0x2fcdbb(0x227)]()||_0x2fcdbb(0x290)),_0x346e71=createHash(_0x2fcdbb(0x212))[_0x2fcdbb(0x27a)](_0x3f6b71)['digest'](_0x2fcdbb(0x1ee))[_0x2fcdbb(0x27f)](0x0,0xc);return _0x2fcdbb(0x263)+_0x346e71;}function a174_0x4452(){const _0x2129d2=['5fTyYrj','journey','goal\x20criteria','\x27\x20from\x20file:\x20','Embedded\x20segment\x20\x27','59776KZFgyz','segments','connectionIdToNameMap','segment','activation_deleted','existingSegments','18GWQUYh','existingSegment','journeyId','ACTIVATION_SYNTAX_ERROR','Updated\x20segment\x20\x27','columns','createActivation','created','schedule','utf-8','\x27\x20wait\x20condition','conditionTimeoutUnit','some','and\x20the\x20server\x20segment,\x20then\x20retry.','logInfo','journeyStages','updated','journeyName','18moCOdh','match','\x27\x20decision\x20point\x20branch\x20\x27','validatedRequest','369918YIWMgg','waitStep','embedded_segment_created','segment_created','SEGMENT_SYNTAX_ERROR','Failed\x20to\x20','Condition','10oVoUsr','max','\x20segment\x20from\x20file:\x20','261672eTfrIc','waitStepType','\x20journey\x20from\x20file:\x20','WaitStep','activationsBySegmentId','uniqueSegmentName','folderId','effectiveFolderId','949cGadRf','segment_updated','push','Journey\x20\x27','journeys','activations','all_columns','map','journeyById','journeyBundleId','stringify','activation_updating','JOURNEY_UPDATE_ERROR','relationships','name','object','activation_created','day','attributes','localName','behavior','SEGMENT_UPDATE_ERROR','onProgress','isArray','journeyActivationNameToId','35qHcsAL','length','yamlActivation','replace','createSegment','1141227JAvnHS','getSegment\x20failed\x20for\x20','message','journeyBundleName','logDeleted','folder','Failed\x20to\x20resolve\x20activation\x20','Creating\x20activation\x20\x27','tdx.sdk.push-workflow','keys','draft','deleted','\x27\x20entry\x20criteria','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','errors','goal','rootFolderId','parentFolder','sort','item','state','exitCriterias','description','delete',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','connection','Entry\x20criteria:\x20','parentId','toString','SEGMENT_NOT_FOUND','yamlConfig','flatMap','createdSegmentIds','NOT_FOUND','join','hex','user','updateSegmentById','set','valid','journeyBundlesByFolderAndName','Activation','from','__pending_act_','Updating\x20segment\x20\x27','reduce','resolvedRule','startsWith','existingJourney','run_after_journey_refresh','has','__pending_','embedded_activation_creating','segmentId','segmentFolderId','segmentByFolderAndName','resolveJourneyId','Created\x20folder\x20\x27','parentSegmentFolder','./child-segment-yaml.js','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','activation_','Segment\x20not\x20found:\x20','activation_template_id','getJourney','debug','Deleted\x20segment\x20\x27','deps','activation_deleting','kind','1958840WyZPNA','sha1','rule','getSegment','\x27\x20not\x20found\x20in\x20journey\x20\x27','all','conditions','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','fetchJourney','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Duration','index','verbose','Created\x20journey\x20\x27','embeddedSegmentNameToId','create','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','folder_created','data','createJourneySegment','type','segment_deleted','trim','createdSegmentId','embedded_activation_created','entry_criteria','journey_created','includes','nameToId','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.',').\x20','entries','isNew','\x20activation\x20\x27','getSegmentEntity','behaviors','hasChanges','null','existingActivation','uniqueServerName','branches','getLatestJourneyId','Updating\x20activation\x20\x27','activationContext','Segment\x20not\x20found','Activation\x20not\x20found:\x20','listActivations','folderPathToId','\x27\x20to\x20local\x20\x27','waitStepUnit','withProgress','\x27...','journey_updated','createFolder','progress','stage\x20\x27','conditionTimeoutDuration','action','activationParams','../../utils/async.js','\x0a\x20\x20','\x27\x20by\x20rule\x20content','\x27\x20for\x20','versionNumber','toLowerCase','get','Delete\x20the\x20push\x20recovery\x20file\x20(','Fetching\x20','relative','find','unchanged','updateActivation','connector_config','parse','JOURNEY_SYNTAX_ERROR','Created\x20activation\x20\x27','folder_creating','):\x20','folderPath','ACTIVATION_UPDATE_ERROR','deleteSegment','journey_entry_criteria_','idToEmailMap','activationActions','./journey-yaml.js','conditionSegmentId','entryCriteria','2346608ULRhdh','Deleting\x20activation\x20\x27','filter','Created\x20segment\x20\x27','add','dirname','.$1.push-recovery.json','embedded_segment_creating','INTERNAL','logWarning','\x27\x20milestone','DecisionPoint','segmentNameToId','parseDocument','milestone','decision_point','\x20(referenced\x20in\x20journey\x20','update','journeyActivationStepId','activation_creating','Stage\x20\x27','absolutePath','slice','notification','segment_updating','steps','activation_updated','1686630ALthSI','size','logSuccess','segment_creating'];a174_0x4452=function(){return _0x2129d2;};return a174_0x4452();}export function ensureJourneyDefaults(_0x3843d5){const _0x4e3b88=a174_0x32cc05;!_0x3843d5[_0x4e3b88(0x1e1)]&&(_0x3843d5[_0x4e3b88(0x1e1)]=''),!_0x3843d5[_0x4e3b88(0x1df)]&&(_0x3843d5[_0x4e3b88(0x1df)]=_0x4e3b88(0x1d5));}export function injectExistingStageIds(_0x1e488d,_0x8bd298){const _0x1c2693=a174_0x32cc05,_0x1b14be=new Map(_0x8bd298['map'](_0xdd55c9=>[_0xdd55c9[_0x1c2693(0x1bb)],_0xdd55c9['id']]));for(const _0x63fd34 of _0x1e488d){if(!_0x63fd34['id']){const _0x5b13e7=_0x1b14be[_0x1c2693(0x253)](_0x63fd34['name']);_0x5b13e7&&(_0x63fd34['id']=_0x5b13e7);}}}export function resolveTDFolderPath(_0x46ac12,_0x3e0e33,_0x2d52de){const _0x3eac43=a174_0x32cc05;if(!_0x3e0e33)return _0x46ac12;if(_0x46ac12===_0x2d52de||_0x46ac12[_0x3eac43(0x1fa)](_0x2d52de+'/'))return _0x46ac12;return _0x46ac12?_0x2d52de+'/'+_0x46ac12:_0x2d52de;}export function addFoldersToCreate(_0x359272,_0x300f5a,_0x1f3760){const _0xb5957d=a174_0x32cc05;if(!_0x359272)return;if(_0x300f5a[_0xb5957d(0x1fd)](_0x359272))return;const _0x12936d=_0x359272['split']('/');let _0xeec98c='';for(const _0x2a9397 of _0x12936d){_0xeec98c=_0xeec98c?_0xeec98c+'/'+_0x2a9397:_0x2a9397,!_0x300f5a[_0xb5957d(0x1fd)](_0xeec98c)&&_0x1f3760[_0xb5957d(0x26d)](_0xeec98c);}}export function sortFoldersByDepth(_0x3fc69e){const _0x33f589=a174_0x32cc05;return[..._0x3fc69e][_0x33f589(0x1dd)]((_0x24b031,_0x35d2f3)=>{const _0x4e9101=_0x33f589,_0x504cdb=(_0x24b031[_0x4e9101(0x198)](/\//g)||[])['length'],_0x2052f7=(_0x35d2f3[_0x4e9101(0x198)](/\//g)||[])['length'];return _0x504cdb-_0x2052f7;});}import*as a174_0x454c22 from'yaml';import{readFileSync}from'fs';import a174_0x4d34ce from'path';import{isJourneyDef,parseYamlString as a174_0x236a99,toYamlString as a174_0x49ab5c,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x5f20a9){const _0x379ddc=a174_0x32cc05;if(Array[_0x379ddc(0x1c4)](_0x5f20a9))return'['+_0x5f20a9[_0x379ddc(0x1b4)](_0x495680=>stableStringify(_0x495680))[_0x379ddc(0x1ed)](',')+']';if(_0x5f20a9&&typeof _0x5f20a9===_0x379ddc(0x1bc)){const _0x311035=_0x5f20a9,_0x56888e=Object[_0x379ddc(0x1d4)](_0x311035)[_0x379ddc(0x1dd)](),_0xa50f4b=_0x56888e[_0x379ddc(0x1b4)](_0x44e1d7=>'\x22'+_0x44e1d7+'\x22:'+stableStringify(_0x311035[_0x44e1d7]));return'{'+_0xa50f4b['join'](',')+'}';}const _0x523a87=JSON[_0x379ddc(0x1b7)](_0x5f20a9);return _0x523a87===undefined?_0x379ddc(0x237):_0x523a87;}function activationSignature(_0x4be2c2){const _0x58c04e=a174_0x32cc05,_0x4b6bbb={'connection':_0x4be2c2[_0x58c04e(0x1e4)],..._0x4be2c2[_0x58c04e(0x1b3)]!==undefined&&{'all_columns':_0x4be2c2[_0x58c04e(0x1b3)]},..._0x4be2c2[_0x58c04e(0x298)]!==undefined&&{'columns':_0x4be2c2[_0x58c04e(0x298)]},..._0x4be2c2[_0x58c04e(0x1c1)]!==undefined&&{'behavior':_0x4be2c2[_0x58c04e(0x1c1)]},..._0x4be2c2[_0x58c04e(0x235)]!==undefined&&{'behaviors':_0x4be2c2[_0x58c04e(0x235)]},..._0x4be2c2[_0x58c04e(0x18d)]!==undefined&&{'schedule':_0x4be2c2[_0x58c04e(0x18d)]},..._0x4be2c2[_0x58c04e(0x280)]!==undefined&&{'notification':_0x4be2c2[_0x58c04e(0x280)]},..._0x4be2c2[_0x58c04e(0x25a)]!==undefined&&{'connector_config':_0x4be2c2[_0x58c04e(0x25a)]},..._0x4be2c2['activation_template_id']!==undefined&&{'activation_template_id':_0x4be2c2[_0x58c04e(0x20a)]}};return stableStringify(_0x4b6bbb);}async function fetchSegment(_0xfc7167,_0x34541a,_0x338dc8,_0x4b5877){const _0x56f3fc=a174_0x32cc05,_0x45c5ea=_0x4b5877?.[_0x56f3fc(0x257)](_0x521cb3=>_0x521cb3['id']===_0x338dc8);if(_0x45c5ea)return _0x45c5ea;try{return await _0xfc7167[_0x56f3fc(0x290)][_0x56f3fc(0x214)](_0x34541a,_0x338dc8);}catch(_0x141399){logger[_0x56f3fc(0x20c)](_0x56f3fc(0x1cc)+_0x338dc8+_0x56f3fc(0x1e3)+_0x141399);try{return await _0xfc7167[_0x56f3fc(0x290)][_0x56f3fc(0x234)](_0x338dc8);}catch(_0x11b3e7){return logger[_0x56f3fc(0x20c)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x338dc8+':\x20'+_0x11b3e7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x439817,_0x102402,_0x306550){const _0x260893=a174_0x32cc05,_0x1f0956=readPushRecovery(_0x439817[_0x260893(0x27e)]);if(_0x1f0956?.[_0x260893(0x196)]===_0x439817[_0x260893(0x1e9)][_0x260893(0x1bb)])for(const [_0x26df06,_0x9ae7a]of Object[_0x260893(0x231)](_0x1f0956[_0x260893(0x28e)])){const _0x3853c0=generateDeterministicJourneySegmentName(_0x439817['yamlConfig']['name'],_0x26df06);_0x9ae7a[_0x260893(0x239)]===_0x3853c0&&(_0x102402[_0x260893(0x1f1)](_0x26df06,_0x9ae7a['segmentId']),_0x306550[_0x260893(0x1f1)](_0x26df06,_0x9ae7a[_0x260893(0x200)]));}}async function createOrRecoverEmbeddedSegment(_0x1c0646,_0x2e13f5,_0x218973,_0x3dc5bd){const _0x9a91f0=a174_0x32cc05;let _0x1e71e3;try{_0x1e71e3=await _0x1c0646[_0x9a91f0(0x290)][_0x9a91f0(0x224)]({'name':_0x218973[_0x9a91f0(0x1aa)],'description':_0x218973[_0x9a91f0(0x1e1)],'journeyId':_0x218973[_0x9a91f0(0x295)],'rule':_0x3dc5bd(_0x218973[_0x9a91f0(0x1f9)],!![]),'countPopulation':!![],'parentFolderId':_0x218973[_0x9a91f0(0x1ab)],'audienceId':_0x218973[_0x9a91f0(0x1e6)]});}catch(_0x333053){const _0x19ea04=_0x333053 instanceof Error&&_0x333053[_0x9a91f0(0x1cd)][_0x9a91f0(0x22c)]('Name\x20has\x20already\x20been\x20taken');if(_0x19ea04){const _0x180ff2=readPushRecovery(_0x2e13f5['absolutePath']),_0x3d011b=_0x180ff2?.[_0x9a91f0(0x196)]===_0x2e13f5[_0x9a91f0(0x1e9)]['name']?_0x180ff2[_0x9a91f0(0x28e)][_0x218973[_0x9a91f0(0x1c0)]]:undefined;if(_0x3d011b?.['uniqueServerName']===_0x218973[_0x9a91f0(0x1aa)])await _0x1c0646[_0x9a91f0(0x290)]['updateSegmentById'](_0x218973[_0x9a91f0(0x1e6)],_0x3d011b[_0x9a91f0(0x200)],{'description':_0x218973[_0x9a91f0(0x1e1)],'rule':_0x3dc5bd(_0x218973[_0x9a91f0(0x1f9)],!![]),'countPopulation':!![]}),_0x1e71e3=_0x3d011b[_0x9a91f0(0x200)];else throw new SDKError(ErrorCode[_0x9a91f0(0x1c2)],_0x9a91f0(0x28c)+_0x218973['localName']+_0x9a91f0(0x21a)+(_0x9a91f0(0x254)+_0x2e13f5[_0x9a91f0(0x27e)][_0x9a91f0(0x1c9)](/([^/]+)$/,_0x9a91f0(0x26f))+')\x20')+_0x9a91f0(0x192),_0x333053);}else throw _0x333053;}return saveSegmentToPushRecovery(_0x2e13f5[_0x9a91f0(0x27e)],_0x2e13f5[_0x9a91f0(0x1e9)][_0x9a91f0(0x1bb)],_0x218973['localName'],{'segmentId':_0x1e71e3,'uniqueServerName':_0x218973[_0x9a91f0(0x1aa)],'createdAt':new Date()['toISOString']()}),_0x1e71e3;}export async function prepareSegmentFiles(_0x3ae81c,_0x588e78,_0x221484,_0xd4f417,_0x5f2035){const _0x4d4263=a174_0x32cc05,{activationDefToCreateRequest:_0x2d132c}=await import(_0x4d4263(0x206)),_0x289fbd=[],_0x23b8de=new Set();for(const {yamlConfig:_0x29ac02,folderPath:_0x1587cd,sourcePath:_0x4429eb}of _0x3ae81c){const _0x5e306f=resolveTDFolderPath(_0x1587cd,_0xd4f417,_0x5f2035),_0x3ab8d0=_0x5e306f+':'+_0x29ac02[_0x4d4263(0x1bb)],_0x3b3aa0=_0x588e78[_0x4d4263(0x202)][_0x4d4263(0x253)](_0x3ab8d0),_0x3c5292=_0x3b3aa0?_0x588e78[_0x4d4263(0x1a9)][_0x4d4263(0x253)](_0x3b3aa0['id'])||[]:[];addFoldersToCreate(_0x5e306f,_0x588e78['folderPathToId'],_0x23b8de);const _0x4068c7=calculateActivationActions(_0x29ac02[_0x4d4263(0x1b2)]||[],_0x3c5292,_0x588e78[_0x4d4263(0x264)],_0x588e78[_0x4d4263(0x28f)]);for(const _0x5f1dc2 of _0x4068c7){(_0x5f1dc2[_0x4d4263(0x225)]===_0x4d4263(0x220)||_0x5f1dc2[_0x4d4263(0x225)]===_0x4d4263(0x27a))&&_0x5f1dc2[_0x4d4263(0x1c8)]&&(_0x5f1dc2['validatedRequest']=await _0x2d132c(_0x5f1dc2[_0x4d4263(0x1c8)],_0x221484));}const _0x13e682=calculateSegmentDiff(_0x29ac02,_0x3b3aa0,_0x3c5292,_0x588e78[_0x4d4263(0x264)],_0x588e78['connectionIdToNameMap']);_0x289fbd[_0x4d4263(0x1af)]({'relativePath':_0x29ac02[_0x4d4263(0x1bb)],'absolutePath':_0x4429eb,'yamlConfig':_0x29ac02,'folderPath':_0x5e306f,'existingSegment':_0x3b3aa0,'existingActivations':_0x3c5292,'isNew':_0x13e682[_0x4d4263(0x232)],'hasChanges':_0x13e682[_0x4d4263(0x236)],'diff':_0x13e682['diff'],'activationActions':_0x4068c7});}return{'segmentFiles':_0x289fbd,'foldersToCreate':_0x23b8de};}export async function prepareJourneyFiles(_0x4339b4,_0xb3d2fb,_0x2626ba,_0x4f9128){const _0x1a7528=a174_0x32cc05,_0x478684=[],_0x4ab3e5=new Set();for(const {yamlConfig:_0x30d8e8,folderPath:_0x3a1bf8,sourcePath:_0x500de0}of _0x4339b4){const _0x3e5edd=resolveTDFolderPath(_0x3a1bf8,_0x2626ba,_0x4f9128),_0x5113bc=_0x3e5edd+':'+_0x30d8e8[_0x1a7528(0x1bb)],_0x164ed2=_0xb3d2fb[_0x1a7528(0x1f3)][_0x1a7528(0x253)](_0x5113bc);let _0x2c4a37,_0x2f48c;if(_0x164ed2&&_0x164ed2[_0x1a7528(0x1c7)]>0x0){const _0x45edc9=buildLocalExpandedRuleMappings(_0x30d8e8),{createYamlContext:_0x25190f,prefetchJourneySegments:_0x1a39a6}=createPushYamlContextForBundle(_0xb3d2fb[_0x1a7528(0x20e)],_0xb3d2fb[_0x1a7528(0x1e6)],_0xb3d2fb[_0x1a7528(0x292)],_0x45edc9,_0xb3d2fb['idToEmailMap'],_0xb3d2fb[_0x1a7528(0x28f)],_0xb3d2fb['activationStepsById'],_0xb3d2fb[_0x1a7528(0x1b5)]);await _0x1a39a6(_0x164ed2[_0x1a7528(0x1b4)](_0x43ff0c=>_0x43ff0c['id']));const _0x58b35c=await _0xb3d2fb[_0x1a7528(0x20e)][_0x1a7528(0x289)][_0x1a7528(0x23b)](_0x164ed2[0x0][_0x1a7528(0x1b6)]),_0x1484e9=hasMultipleVersions(_0x30d8e8),_0x227082=async _0x431eeb=>{const _0x4f4f2a=_0x1a7528,_0xa5ed73=_0xb3d2fb[_0x4f4f2a(0x1b5)]?.[_0x4f4f2a(0x253)](_0x431eeb);if(_0xa5ed73)return _0xa5ed73;return _0xb3d2fb[_0x4f4f2a(0x219)]({'journeyId':_0x431eeb,'journeyName':_0x30d8e8['name'],'isMultiVersion':_0x164ed2[_0x4f4f2a(0x1c7)]>0x1});};if(_0x1484e9&&_0x164ed2[_0x1a7528(0x1c7)]>0x1){const _0x15626b=[];for(const _0x211615 of _0x164ed2){const _0x1b611d=_0x211615[_0x1a7528(0x251)]||0x1;_0xb3d2fb[_0x1a7528(0x248)]?.[_0x1a7528(0x27a)](_0x1a7528(0x255)+_0x30d8e8[_0x1a7528(0x1bb)]+'\x20v'+_0x1b611d);const _0x550d1f=await _0x227082(_0x211615['id']),_0x24eacd=_0x25190f(_0x211615['id']),_0x4a9bae=await journeyResponseToDef(_0x550d1f,_0x24eacd);_0x15626b[_0x1a7528(0x1af)]({'item':_0x211615,'yaml':_0x4a9bae});}const _0x405347=buildLocalRuleToNameMappingFromJourney(_0x30d8e8);_0x2f48c=buildMergedJourneyDef(_0x15626b,_0x405347,_0x58b35c);const _0x57e8aa=Math[_0x1a7528(0x1a3)](..._0x15626b[_0x1a7528(0x1b4)](_0x365a99=>_0x365a99[_0x1a7528(0x1de)][_0x1a7528(0x251)]||0x0)),_0x412c2e=_0x164ed2['find'](_0x2cbfd9=>(_0x2cbfd9['versionNumber']||0x0)===_0x57e8aa);_0x412c2e&&(_0xb3d2fb[_0x1a7528(0x248)]?.[_0x1a7528(0x27a)]('Fetching\x20'+_0x30d8e8[_0x1a7528(0x1bb)]+'\x20v'+_0x57e8aa),_0x2c4a37=await _0x227082(_0x412c2e['id']));}else{const _0x4f2533=_0x164ed2[_0x164ed2[_0x1a7528(0x1c7)]-0x1];_0xb3d2fb['progress']?.['update']('Fetching\x20'+_0x30d8e8['name']),_0x2c4a37=await _0x227082(_0x4f2533['id']);const _0x1a5771=_0x25190f(_0x4f2533['id']),_0x435b53=await journeyResponseToDef(_0x2c4a37,_0x1a5771),_0x37351d=buildLocalRuleToNameMappingFromJourney(_0x30d8e8);_0x2f48c=buildMergedJourneyDef([{'item':_0x4f2533,'yaml':_0x435b53}],_0x37351d,_0x58b35c);}}addFoldersToCreate(_0x3e5edd,_0xb3d2fb['folderPathToId'],_0x4ab3e5);const _0x311e83=calculateJourneyDiff(_0x30d8e8,_0x2f48c);_0x478684[_0x1a7528(0x1af)]({'relativePath':_0x30d8e8[_0x1a7528(0x1bb)],'absolutePath':_0x500de0,'yamlConfig':_0x30d8e8,'folderPath':_0x3e5edd,'existingJourney':_0x2c4a37,'isNew':_0x311e83[_0x1a7528(0x232)],'hasChanges':_0x311e83[_0x1a7528(0x236)],'diff':_0x311e83['diff']});}return{'journeyFiles':_0x478684,'foldersToCreate':_0x4ab3e5};}export function calculateActivationActions(_0x11af3d,_0x4560f5,_0x44b8ef,_0x4fb812){const _0xef30fc=a174_0x32cc05,_0x5868fc=[],_0x44b262=new Map();for(const _0x70b028 of _0x4560f5){_0x44b262[_0xef30fc(0x1f1)](_0x70b028[_0xef30fc(0x1bb)],_0x70b028);}const _0x4b21f6=new Map();for(const _0x2d0d90 of _0x11af3d){_0x4b21f6[_0xef30fc(0x1f1)](_0x2d0d90[_0xef30fc(0x1bb)],_0x2d0d90);}for(const _0x536ce0 of _0x11af3d){const _0x16cc55=_0x44b262[_0xef30fc(0x253)](_0x536ce0['name']);if(!_0x16cc55)_0x5868fc[_0xef30fc(0x1af)]({'type':_0xef30fc(0x220),'name':_0x536ce0[_0xef30fc(0x1bb)],'yamlActivation':_0x536ce0});else{const _0x5f56b7=activationResponseToDef(_0x16cc55,_0x44b8ef,_0x4fb812),_0x793930=a174_0x454c22['stringify'](_0x5f56b7),_0x4fe0f3=a174_0x454c22[_0xef30fc(0x1b7)](_0x536ce0);_0x793930!==_0x4fe0f3&&_0x5868fc[_0xef30fc(0x1af)]({'type':_0xef30fc(0x27a),'name':_0x536ce0['name'],'yamlActivation':_0x536ce0,'existingActivation':_0x16cc55});}}for(const _0x43aaee of _0x4560f5){!_0x4b21f6[_0xef30fc(0x1fd)](_0x43aaee[_0xef30fc(0x1bb)])&&_0x5868fc[_0xef30fc(0x1af)]({'type':'delete','name':_0x43aaee[_0xef30fc(0x1bb)],'existingActivation':_0x43aaee});}return _0x5868fc;}function calculateYamlDiff(_0x31a511,_0x1955c1){if(_0x1955c1){const _0x3dbff7=generateDiff(_0x1955c1,_0x31a511),_0x50547a=hasChanges(_0x3dbff7);return{'isNew':![],'hasChanges':_0x50547a,'diff':_0x50547a?formatDiffWithColors(_0x3dbff7):undefined};}const _0xc7574b=generateDiff('',_0x31a511);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xc7574b)};}export function calculateSegmentDiff(_0x239eac,_0x118ddb,_0x444a3b,_0x451707,_0x16df03){const _0x3d99fc=segmentToYamlString(_0x239eac),_0x10c011=_0x118ddb?segmentToYamlString(segmentWithActivationsToYaml(_0x118ddb,_0x444a3b,undefined,_0x451707,_0x16df03)):undefined;return calculateYamlDiff(_0x3d99fc,_0x10c011);}export function calculateJourneyDiff(_0x29340a,_0x4d1e68){const _0x4f0325=normalizeJourneyDef(_0x29340a,_0x29340a),_0x325eb5=a174_0x49ab5c(_0x4f0325),_0xea8172=_0x4d1e68?a174_0x49ab5c(normalizeJourneyDef(_0x4d1e68,_0x29340a)):undefined;return calculateYamlDiff(_0x325eb5,_0xea8172);}export function findSegmentsToDelete(_0x4c04c2,_0x7b8053,_0x1f450a,_0x3eae3c,_0x1d2d62){const _0x3f83fa=a174_0x32cc05,_0x31de00=new Set();for(const {yamlConfig:_0x4b9108,folderPath:_0x29c023}of _0x7b8053){_0x31de00[_0x3f83fa(0x26d)](_0x29c023+':'+_0x4b9108[_0x3f83fa(0x1bb)]);}return _0x4c04c2[_0x3f83fa(0x26b)](_0x221f03=>{const _0x5a3f49=_0x3f83fa,_0xdc93ff=_0x221f03[_0x5a3f49(0x201)]?_0x1f450a[_0x5a3f49(0x253)](_0x221f03[_0x5a3f49(0x201)]['toString']())||'':'',_0x5bce23=_0xdc93ff+':'+_0x221f03[_0x5a3f49(0x1bb)];if(_0x31de00[_0x5a3f49(0x1fd)](_0x5bce23))return![];if(_0x1d2d62)return _0xdc93ff===_0x3eae3c||_0xdc93ff[_0x5a3f49(0x1fa)](_0x3eae3c+'/');return!![];});}export function findJourneysToDelete(_0x53a39b,_0x13d696,_0x37d889,_0x5d929c,_0x2b3d37){const _0x243867=a174_0x32cc05,_0x310ba8=new Set();for(const {yamlConfig:_0x2b6377,folderPath:_0xc5e969}of _0x13d696){_0x310ba8[_0x243867(0x26d)](_0xc5e969+':'+_0x2b6377[_0x243867(0x1bb)]);}return _0x53a39b[_0x243867(0x26b)](_0x1eb3b1=>{const _0x1f0d75=_0x243867,_0x1c51e2=_0x1eb3b1[_0x1f0d75(0x1ab)]?_0x37d889[_0x1f0d75(0x253)](_0x1eb3b1[_0x1f0d75(0x1ab)])||'':'',_0x2cff21=_0x1c51e2+':'+_0x1eb3b1['journeyBundleName'];if(_0x310ba8[_0x1f0d75(0x1fd)](_0x2cff21))return![];if(_0x2b3d37)return _0x1c51e2===_0x5d929c||_0x1c51e2[_0x1f0d75(0x1fa)](_0x5d929c+'/');return!![];});}export function buildSegmentLookupMap(_0x5e9789,_0x22e957){const _0x30aa92=a174_0x32cc05,_0x33f4c1=new Map();for(const _0x169b00 of _0x5e9789){const _0x325ce=_0x169b00[_0x30aa92(0x201)]?_0x22e957['get'](_0x169b00['segmentFolderId'][_0x30aa92(0x1e7)]())||'':'',_0x526d57=_0x325ce+':'+_0x169b00[_0x30aa92(0x1bb)];_0x33f4c1[_0x30aa92(0x1f1)](_0x526d57,_0x169b00);}return _0x33f4c1;}export function buildSegmentNameToIdMap(_0x3c2a47){const _0x3acb83=a174_0x32cc05,_0x26b6b6=new Map();for(const _0x2ae0ae of _0x3c2a47){_0x26b6b6[_0x3acb83(0x1f1)](_0x2ae0ae[_0x3acb83(0x1bb)],_0x2ae0ae['id']);}return _0x26b6b6;}export function buildJourneyBundleLookupMap(_0x351889,_0x10ed24){const _0x4ef18c=a174_0x32cc05,_0x5566cd=new Map();for(const _0x33ca60 of _0x351889){const _0xb9aa23=_0x33ca60['folderId']?_0x10ed24[_0x4ef18c(0x253)](_0x33ca60[_0x4ef18c(0x1ab)])||'':'',_0x156bbe=_0xb9aa23+':'+_0x33ca60[_0x4ef18c(0x1ce)];!_0x5566cd[_0x4ef18c(0x1fd)](_0x156bbe)&&_0x5566cd[_0x4ef18c(0x1f1)](_0x156bbe,[]),_0x5566cd['get'](_0x156bbe)['push'](_0x33ca60);}for(const _0x36322d of _0x5566cd['values']()){_0x36322d[_0x4ef18c(0x1dd)]((_0x34b457,_0x4b8d9e)=>(_0x34b457[_0x4ef18c(0x251)]||0x0)-(_0x4b8d9e[_0x4ef18c(0x251)]||0x0));}return _0x5566cd;}export function collectFoldersToCreate(_0x2d64be,_0x1b8ef2){const _0x4e712a=a174_0x32cc05,_0x4d0a53=new Set();for(const _0x24bcfc of _0x2d64be){if(!_0x24bcfc)continue;if(_0x1b8ef2[_0x4e712a(0x1fd)](_0x24bcfc))continue;const _0x5f11ba=_0x24bcfc['split']('/');let _0x3be47c='';for(const _0xa8e3c9 of _0x5f11ba){_0x3be47c=_0x3be47c?_0x3be47c+'/'+_0xa8e3c9:_0xa8e3c9,!_0x1b8ef2[_0x4e712a(0x1fd)](_0x3be47c)&&_0x4d0a53[_0x4e712a(0x26d)](_0x3be47c);}}return _0x4d0a53;}export function parseAndClassifyYamlFiles(_0x2afbc5,_0x4b6aa1,_0x321832){const _0x43e4b1=a174_0x32cc05,_0x20c95d=[],_0x34172a=[];for(const _0x23d4fa of _0x2afbc5){const _0x1071a7=a174_0x4d34ce['relative'](_0x4b6aa1,a174_0x4d34ce[_0x43e4b1(0x26e)](_0x23d4fa)),_0x49c132=_0x1071a7==='.'?'':_0x1071a7[_0x43e4b1(0x1c9)](/\\/g,'/'),_0x4a0da3=readFileSync(_0x23d4fa,_0x43e4b1(0x18e)),_0x12f6fe=a174_0x454c22[_0x43e4b1(0x25b)](_0x4a0da3);if(isJourneyDef(_0x12f6fe,_0x23d4fa)){const _0x1926c1=a174_0x236a99(_0x4a0da3);_0x34172a[_0x43e4b1(0x1af)]({'yamlConfig':_0x1926c1,'folderPath':_0x49c132,'sourcePath':_0x23d4fa});}else{if(!_0x321832?.['skipSegments']){const _0x8b9fd9=parseSegmentYamlFile(_0x4a0da3),_0x595a2d=normalizeChildSegmentYaml(_0x8b9fd9);_0x20c95d[_0x43e4b1(0x1af)]({'yamlConfig':_0x595a2d,'folderPath':_0x49c132,'sourcePath':_0x23d4fa});}}}return{'segments':_0x20c95d,'journeys':_0x34172a};}export function validateParsedFiles(_0x3961a1,_0x3f26f3){const _0x2673fc=a174_0x32cc05,_0x3851cf=[];for(const {yamlConfig:_0x7983fe,sourcePath:_0x41bf92}of _0x3961a1[_0x2673fc(0x28e)]){const _0x17ed6d=readFileSync(_0x41bf92,_0x2673fc(0x18e)),_0xb8d62e=a174_0x454c22[_0x2673fc(0x276)](_0x17ed6d),_0x4f5157=validateSegmentDef(_0x7983fe,{'source':_0x17ed6d,'document':_0xb8d62e},{'skipSchema':!![]});if(!_0x4f5157['valid']){const _0x566117=a174_0x4d34ce[_0x2673fc(0x256)](_0x3f26f3,_0x41bf92);_0x3851cf[_0x2673fc(0x1af)]({'filePath':_0x566117,'source':_0x17ed6d,'result':_0x4f5157,'isJourney':![]});}}for(const {yamlConfig:_0x13b64e,sourcePath:_0x59b622}of _0x3961a1[_0x2673fc(0x1b1)]){const _0x299cec=readFileSync(_0x59b622,_0x2673fc(0x18e)),_0x1e306d=a174_0x454c22[_0x2673fc(0x276)](_0x299cec),_0x2ae338=validateJourneyDef(_0x13b64e,{'source':_0x299cec,'document':_0x1e306d},{'skipSchema':!![]});if(!_0x2ae338[_0x2673fc(0x1f2)]){const _0xf2e4c=a174_0x4d34ce[_0x2673fc(0x256)](_0x3f26f3,_0x59b622);_0x3851cf['push']({'filePath':_0xf2e4c,'source':_0x299cec,'result':_0x2ae338,'isJourney':!![]});}}return _0x3851cf;}export function formatValidationErrors(_0x4efd91){const _0x3a399b=a174_0x32cc05,_0x5e5547=[];for(const {filePath:_0x14bc30,source:_0x469c7e,result:_0x234a9d,isJourney:_0x2f99f4}of _0x4efd91){const _0xf0f215=_0x2f99f4?_0x3a399b(0x289):_0x3a399b(0x290);_0x5e5547[_0x3a399b(0x1af)]('\x0a'+_0x14bc30+'\x20('+_0xf0f215+_0x3a399b(0x25f)+_0x234a9d[_0x3a399b(0x1d9)]['length']+'\x20error(s)'),_0x5e5547[_0x3a399b(0x1af)](formatValidationResult(_0x234a9d,_0x469c7e,_0x14bc30));}return _0x5e5547['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x3e8912){const _0x2b069d=a174_0x32cc05,_0x2f6e28=new Set(),_0x849d20=new Map(),_0x18d2f9=collectSegmentUsageCounts(_0x3e8912);if(_0x3e8912[_0x2b069d(0x28e)])for(const [_0x1c77d6,_0x54b80b]of Object['entries'](_0x3e8912[_0x2b069d(0x28e)])){_0x2f6e28[_0x2b069d(0x26d)](_0x1c77d6);if(_0x54b80b['rule']){const _0x412449=yamlRuleToApi(_0x54b80b['rule']),_0x2542da=apiRuleToYaml(_0x412449);_0x849d20['set'](_0x1c77d6,_0x2542da);}}const _0x42e200=new Map();let _0x58eb56=0x0;for(const [_0x21c01b,_0x2cda03]of _0x849d20){const _0xa9c915=serializeExpandedRule(_0x2cda03,_0x849d20),_0x433a64=_0x42e200[_0x2b069d(0x253)](_0xa9c915)||[];_0x433a64[_0x2b069d(0x1af)]({'name':_0x21c01b,'index':_0x58eb56}),_0x42e200['set'](_0xa9c915,_0x433a64),_0x58eb56++;}const _0x294b56=new Map();for(const [_0x19936d,_0x1dbb9f]of _0x42e200){const _0x13746c=_0x1dbb9f[_0x2b069d(0x27f)]()[_0x2b069d(0x1dd)]((_0x2ff3d2,_0x379d71)=>{const _0x3fbd1b=_0x2b069d,_0x47e98d=_0x18d2f9[_0x3fbd1b(0x253)](_0x2ff3d2['name'])||0x0,_0xb4493e=_0x18d2f9[_0x3fbd1b(0x253)](_0x379d71[_0x3fbd1b(0x1bb)])||0x0;if(_0x47e98d!==_0xb4493e)return _0xb4493e-_0x47e98d;return _0x2ff3d2[_0x3fbd1b(0x21c)]-_0x379d71['index'];})[_0x2b069d(0x1b4)](_0x49dcb8=>_0x49dcb8[_0x2b069d(0x1bb)]),_0x1bc1b8=[];for(const _0x4e4af1 of _0x13746c){const _0x597aa0=_0x18d2f9[_0x2b069d(0x253)](_0x4e4af1)||0x0,_0x453992=Math[_0x2b069d(0x1a3)](_0x597aa0,0x1);for(let _0x4855a6=0x0;_0x4855a6<_0x453992;_0x4855a6++){_0x1bc1b8[_0x2b069d(0x1af)](_0x4e4af1);}}_0x294b56[_0x2b069d(0x1f1)](_0x19936d,_0x1bc1b8);}return{'existingLocalSegmentNames':_0x2f6e28,'localSegmentRules':_0x849d20,'localExpandedRuleToNames':_0x294b56};}export function createSegmentIdResolver(_0xd83a42,_0x32df2f){return async _0x496b9a=>{const _0x10852f=a174_0x1505,_0x4bcfb7=_0xd83a42[_0x10852f(0x253)](_0x496b9a);if(!_0x4bcfb7)throw new SDKError(ErrorCode[_0x10852f(0x1e8)],_0x10852f(0x209)+_0x496b9a+_0x10852f(0x1d8)+_0x32df2f+'\x27)');return _0x4bcfb7;};}export function extractRootFolderId(_0x578dc8){const _0x579f96=a174_0x32cc05;return _0x578dc8[_0x579f96(0x1ba)]?.[_0x579f96(0x205)]?.[_0x579f96(0x223)]?.['id']||_0x578dc8[_0x579f96(0x1ba)]?.[_0x579f96(0x1dc)]?.[_0x579f96(0x223)]?.['id'];}export function buildConnectionMaps(_0x4600b7){const _0x356d28=a174_0x32cc05,_0xf54412=new Map(),_0x5b1d3a=new Map(),_0x3c208f=new Map();for(const _0x510c0e of _0x4600b7){_0xf54412[_0x356d28(0x1f1)](_0x510c0e[_0x356d28(0x1bb)],parseInt(_0x510c0e['id'],0xa)),_0x5b1d3a[_0x356d28(0x1f1)](_0x510c0e['id'],_0x510c0e['name']),_0x3c208f[_0x356d28(0x1f1)](_0x510c0e[_0x356d28(0x1bb)],_0x510c0e[_0x356d28(0x225)]);}return{'nameToId':_0xf54412,'idToName':_0x5b1d3a,'nameToType':_0x3c208f};}export function calculatePushStats(_0x15afe6,_0x3c2f72,_0x34e654,_0x13b397,_0x54a5dc,_0x2b268e,_0x3c71f5){const _0x14ae38=a174_0x32cc05,_0x296d0e=_0x15afe6['filter'](_0x11c165=>_0x11c165[_0x14ae38(0x232)]),_0x2a4fce=_0x15afe6[_0x14ae38(0x26b)](_0x2ca689=>!_0x2ca689[_0x14ae38(0x232)]&&_0x2ca689[_0x14ae38(0x236)]),_0x7cec26=_0x15afe6['filter'](_0x28b9d5=>!_0x28b9d5[_0x14ae38(0x232)]&&!_0x28b9d5[_0x14ae38(0x236)]),_0x4e19a0=_0x2b268e?_0x13b397:[],_0x22e25e=_0x3c2f72['filter'](_0x32cdb1=>_0x32cdb1['isNew']),_0x830c5c=_0x3c2f72['filter'](_0x405c94=>!_0x405c94[_0x14ae38(0x232)]&&_0x405c94['hasChanges']),_0x19e63f=_0x3c2f72[_0x14ae38(0x26b)](_0x5c6620=>!_0x5c6620[_0x14ae38(0x232)]&&!_0x5c6620[_0x14ae38(0x236)]),_0x1aa8f4=_0x2b268e?_0x54a5dc:[],_0x476da2=_0x15afe6[_0x14ae38(0x1ea)](_0x333d0b=>_0x333d0b[_0x14ae38(0x265)]),_0x16298d=_0x476da2[_0x14ae38(0x26b)](_0x2e80ac=>_0x2e80ac[_0x14ae38(0x225)]==='create'),_0x50ed92=_0x476da2['filter'](_0x246f53=>_0x246f53[_0x14ae38(0x225)]==='update'),_0x5a7f50=_0x476da2[_0x14ae38(0x26b)](_0x154507=>_0x154507[_0x14ae38(0x225)]===_0x14ae38(0x1e2)),_0x4f6e51=Array[_0x14ae38(0x1f5)](_0x34e654)[_0x14ae38(0x1dd)](),_0x909fde=_0x3c71f5?![]:_0x296d0e['length']>0x0||_0x2a4fce['length']>0x0||_0x4e19a0['length']>0x0,_0xb2fb6b=_0x22e25e['length']>0x0||_0x830c5c['length']>0x0||_0x1aa8f4[_0x14ae38(0x1c7)]>0x0,_0xab6d0f=_0x3c71f5?![]:_0x476da2[_0x14ae38(0x1c7)]>0x0,_0x51e67c=_0x4f6e51[_0x14ae38(0x1c7)]>0x0;return{'segments':{'new':_0x296d0e,'changed':_0x2a4fce,'unchanged':_0x7cec26,'toDelete':_0x4e19a0},'journeys':{'new':_0x22e25e,'changed':_0x830c5c,'unchanged':_0x19e63f,'toDelete':_0x1aa8f4},'activations':{'all':_0x476da2,'toCreate':_0x16298d,'toUpdate':_0x50ed92,'toDelete':_0x5a7f50},'folders':{'toCreate':_0x4f6e51},'counts':{'segments':{'new':_0x296d0e[_0x14ae38(0x1c7)],'changed':_0x2a4fce[_0x14ae38(0x1c7)],'unchanged':_0x7cec26['length'],'toDelete':_0x4e19a0[_0x14ae38(0x1c7)]},'journeys':{'new':_0x22e25e[_0x14ae38(0x1c7)],'changed':_0x830c5c[_0x14ae38(0x1c7)],'unchanged':_0x19e63f['length'],'toDelete':_0x1aa8f4['length']},'activations':{'create':_0x16298d['length'],'update':_0x50ed92['length'],'delete':_0x5a7f50['length']},'folders':_0x4f6e51['length']},'hasChanges':_0x909fde||_0xb2fb6b||_0xab6d0f||_0x51e67c};}export async function buildPushExecutionContext(_0x47c45a,_0x1178fc,_0x3a3636,_0x1e1d58,_0x29427d,_0xd352f1){const _0x4b2837=a174_0x32cc05,_0x3ed823=extractRootFolderId(_0x3a3636),{pathToId:_0x2a79e4,idToPath:_0x1af02b}=buildFolderMaps(_0x29427d),_0x19d7b7=buildSegmentNameToIdMap(_0x1e1d58),_0x4937e4=new Map(),{batchAsync:_0x380b52}=await import(_0x4b2837(0x24d)),[_0xfd5e8,_0x360b36]=await Promise[_0x4b2837(0x216)]([_0x47c45a[_0x4b2837(0x1ef)]['buildUserMaps'](),_0x47c45a[_0x4b2837(0x1e4)]['list'](),((async()=>{const _0x1bfbb0=_0x4b2837;!_0xd352f1&&_0x1e1d58[_0x1bfbb0(0x1c7)]>0x0&&await _0x380b52(_0x1e1d58,async _0x19915b=>{const _0x44b650=_0x1bfbb0,_0x2f1e26=await _0x47c45a[_0x44b650(0x290)][_0x44b650(0x240)](_0x1178fc,_0x19915b['id']);_0x4937e4[_0x44b650(0x1f1)](_0x19915b['id'],_0x2f1e26);});})())]),{emailToId:_0x379928,idToEmail:_0x2bd0fc}=_0xfd5e8,_0x164ce9=buildConnectionMaps(_0x360b36);return{'rootFolderId':_0x3ed823,'folderPathToId':_0x2a79e4,'folderIdToPath':_0x1af02b,'segmentNameToId':_0x19d7b7,'activationsBySegmentId':_0x4937e4,'emailToIdMap':_0x379928,'idToEmailMap':_0x2bd0fc,'connectionNameToIdMap':_0x164ce9[_0x4b2837(0x22d)],'connectionIdToNameMap':_0x164ce9['idToName'],'connectionNameToTypeMap':_0x164ce9['nameToType']};}export function createPushYamlContextForBundle(_0x30b846,_0x423fb7,_0x95f1a3,_0x4904c7,_0x3431d5,_0x4af1cb,_0x39f822,_0x33e7e6){const {existingLocalSegmentNames:_0x2beaf7,localExpandedRuleToNames:_0x42338f}=_0x4904c7,_0x1c1008=new Set(),_0x1a58bd=new Map(),_0x4bbd1f=new Map(),_0x2f3516=new Map(),_0x44bcfe=createJumpTargetCache(),_0x3a2cb2=new Map(),_0x512e50=new Map(),_0x1a82e6=new Set();let _0x3fe0f8;const _0x47d61e=_0x358d49=>{const _0x246c17={'resolveSegment':async _0x37e89f=>{const _0x2fd818=a174_0x1505,_0x5ba480=_0x2f3516[_0x2fd818(0x253)](_0x37e89f);if(_0x5ba480!==undefined)return{'name':_0x5ba480,'isJourneyLocal':!![]};try{const _0x4c5103=await fetchSegment(_0x30b846,_0x423fb7,_0x37e89f,_0x95f1a3);if(!_0x4c5103)throw new Error(_0x2fd818(0x23e));const _0x501ff3=generateJourneyLocalName(_0x4c5103[_0x2fd818(0x1bb)]),_0x108aaa=_0x4c5103[_0x2fd818(0x210)]===SEGMENT_KIND_JOURNEY&&_0x501ff3!==undefined;let _0x1b77d1=_0x4c5103['name'],_0x154401;if(_0x108aaa&&_0x4c5103[_0x2fd818(0x213)]){const _0x25567b=apiRuleToYaml(_0x4c5103['rule']);_0x512e50['set'](_0x37e89f,_0x25567b);const _0x204a01=async _0x3c5b77=>{const _0xf8332f=_0x2fd818,_0x345f3a=collectSegmentRefsFromRule(_0x3c5b77);for(const _0x34d9a8 of _0x345f3a){if(!_0x512e50['has'](_0x34d9a8))try{const _0x203151=await fetchSegment(_0x30b846,_0x423fb7,_0x34d9a8,_0x95f1a3);if(_0x203151?.[_0xf8332f(0x213)]){const _0x3496a5=apiRuleToYaml(_0x203151[_0xf8332f(0x213)]);_0x512e50[_0xf8332f(0x1f1)](_0x34d9a8,_0x3496a5),await _0x204a01(_0x3496a5);}}catch(_0x33afcc){logger[_0xf8332f(0x20c)](_0xf8332f(0x22e)+_0x34d9a8+':\x20'+_0x33afcc);}}};await _0x204a01(_0x25567b);const _0x4f5dcc=serializeExpandedRule(_0x25567b,_0x512e50),_0x5b0bbf=_0x42338f['get'](_0x4f5dcc);if(_0x5b0bbf&&_0x5b0bbf[_0x2fd818(0x1c7)]>0x0){const _0x295bcf=_0x1a58bd[_0x2fd818(0x253)](_0x4f5dcc)||0x0,_0x496849=_0x5b0bbf[_0x295bcf]||_0x5b0bbf[_0x5b0bbf[_0x2fd818(0x1c7)]-0x1];_0x1a58bd[_0x2fd818(0x1f1)](_0x4f5dcc,_0x295bcf+0x1),_0x1b77d1=_0x496849,_0x1c1008[_0x2fd818(0x26d)](_0x1b77d1),_0x2f3516[_0x2fd818(0x1f1)](_0x37e89f,_0x1b77d1);const _0x5e8b3d=await resolveRuleSegmentRefs(_0x25567b,async _0x1f2619=>{const _0x367eef=_0x2fd818,_0x38acae=_0x2f3516[_0x367eef(0x253)](_0x1f2619);if(_0x38acae)return _0x38acae;const _0x122929=await _0x3fe0f8['resolveSegment'](_0x1f2619);return _0x122929['name'];});_0x154401={'description':_0x4c5103[_0x2fd818(0x1e1)],'rule':_0x5e8b3d};}else{const _0x484476=_0x3a2cb2[_0x2fd818(0x253)](_0x4f5dcc);if(_0x484476)_0x1b77d1=_0x484476,_0x2f3516['set'](_0x37e89f,_0x1b77d1);else{if(_0x501ff3){let _0x3c7002=_0x501ff3,_0x735026=0x2;while(_0x1c1008[_0x2fd818(0x1fd)](_0x3c7002)||_0x2beaf7[_0x2fd818(0x1fd)](_0x3c7002)){_0x3c7002=_0x501ff3+'_'+_0x735026,_0x735026++;}_0x1c1008['add'](_0x3c7002),_0x1b77d1=_0x3c7002;}_0x2f3516[_0x2fd818(0x1f1)](_0x37e89f,_0x1b77d1),_0x3a2cb2[_0x2fd818(0x1f1)](_0x4f5dcc,_0x1b77d1);const _0x573adc=await resolveRuleSegmentRefs(_0x25567b,async _0x591c70=>{const _0x5187e8=_0x2fd818,_0xd6cf55=_0x2f3516[_0x5187e8(0x253)](_0x591c70);if(_0xd6cf55)return _0xd6cf55;const _0x379d07=await _0x3fe0f8['resolveSegment'](_0x591c70);return _0x379d07[_0x5187e8(0x1bb)];});_0x154401={'description':_0x4c5103[_0x2fd818(0x1e1)],'rule':_0x573adc};}}}return{'name':_0x1b77d1,'isJourneyLocal':_0x108aaa,'definition':_0x154401};}catch(_0x3f9b85){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x37e89f+':\x20'+_0x3f9b85),{'name':_0x37e89f,'isJourneyLocal':![]};}},'resolveActivation':async _0x4c7bca=>{const _0x444bae=a174_0x1505,_0x2184d4=_0x4bbd1f['get'](_0x4c7bca);if(_0x2184d4!==undefined)return{'name':_0x2184d4,'isJourneyLocal':!![]};try{let _0x22289d=_0x39f822?.['get'](_0x4c7bca);!_0x22289d&&(_0x22289d=await _0x30b846['journey']['getActivation'](_0x358d49,_0x4c7bca));const _0x412b74=_0x22289d[_0x444bae(0x1bf)][_0x444bae(0x24c)][_0x444bae(0x1bb)]||_0x4c7bca,_0x1dcf2a=sanitizeYamlKey(_0x412b74)||_0x444bae(0x208)+_0x4c7bca,_0xfb92e5=_0x1dcf2a;_0x4bbd1f['set'](_0x4c7bca,_0xfb92e5);const _0x1a9f55=journeyActivationStepToYaml(_0x22289d,_0x3431d5,_0x4af1cb);return{'name':_0xfb92e5,'isJourneyLocal':!![],'definition':_0x1a9f55};}catch(_0x5ad024){return logger['debug'](_0x444bae(0x1d1)+_0x4c7bca+':\x20'+_0x5ad024),{'name':_0x4c7bca,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5844b1,_0x2cfd53)=>resolveJumpTarget(_0x5844b1,_0x2cfd53,_0x44bcfe,async _0xef2e9e=>{const _0x24eea3=a174_0x1505,_0x1f898f=_0x33e7e6?.[_0x24eea3(0x253)](_0xef2e9e);if(_0x1f898f)return _0x1f898f;return _0x30b846[_0x24eea3(0x289)][_0x24eea3(0x20b)](_0xef2e9e);})};return _0x3fe0f8=_0x246c17,_0x246c17;},_0x2d3219=async _0x25f23f=>{const _0x1cedd6=a174_0x1505,{collectSegmentIdsFromJourneyApi:_0x5a9a67}=await import(_0x1cedd6(0x266)),{batchAsync:_0x49cbae}=await import('../../utils/async.js'),_0x32d639=new Set();for(const _0x118337 of _0x25f23f){let _0x1c563b=_0x33e7e6?.[_0x1cedd6(0x253)](_0x118337);!_0x1c563b&&(_0x1c563b=await _0x30b846[_0x1cedd6(0x289)][_0x1cedd6(0x20b)](_0x118337));const _0x574853=_0x5a9a67(_0x1c563b);for(const _0x4d172e of _0x574853){_0x32d639[_0x1cedd6(0x26d)](_0x4d172e);}}let _0x4ba5da=Array[_0x1cedd6(0x1f5)](_0x32d639);while(_0x4ba5da[_0x1cedd6(0x1c7)]>0x0){const _0x37a522=_0x4ba5da['filter'](_0x4ec87f=>!_0x1a82e6['has'](_0x4ec87f));if(_0x37a522[_0x1cedd6(0x1c7)]===0x0)break;const _0x46fb83=await _0x49cbae(_0x37a522,async _0x3b1d51=>{const _0x1a2787=_0x1cedd6;_0x1a82e6[_0x1a2787(0x26d)](_0x3b1d51);const _0x1698af=await fetchSegment(_0x30b846,_0x423fb7,_0x3b1d51,_0x95f1a3);if(!_0x1698af)return null;return{'segmentId':_0x3b1d51,'segment':_0x1698af};},0xa),_0x2b3b98=new Set();for(const _0x940b4d of _0x46fb83){if(!_0x940b4d?.[_0x1cedd6(0x290)]?.[_0x1cedd6(0x213)])continue;const _0x8f76f6=apiRuleToYaml(_0x940b4d['segment'][_0x1cedd6(0x213)]);_0x512e50[_0x1cedd6(0x1f1)](_0x940b4d[_0x1cedd6(0x200)],_0x8f76f6);const _0xa4df09=collectSegmentRefsFromRule(_0x8f76f6);for(const _0x50e97e of _0xa4df09){!_0x1a82e6[_0x1cedd6(0x1fd)](_0x50e97e)&&_0x2b3b98[_0x1cedd6(0x26d)](_0x50e97e);}}_0x4ba5da=Array[_0x1cedd6(0x1f5)](_0x2b3b98);}};return{'createYamlContext':_0x47d61e,'prefetchJourneySegments':_0x2d3219};}export async function executePushSegments(_0x32072a,_0x493bf1,_0x105244,_0x38acfe,_0x5472e8){const _0x83ae3d=a174_0x32cc05,{segmentDefToCreateRequest:_0x27c263,segmentDefToUpdateRequest:_0x371493}=await import(_0x83ae3d(0x206)),_0x5dd648=_0x105244[_0x83ae3d(0x241)],_0x201ec1=0x5,_0x1441bd=async _0x1cfaf1=>{const _0x58024d=_0x83ae3d,_0x250b50=_0x1cfaf1['folderPath']?_0x5dd648[_0x58024d(0x253)](_0x1cfaf1['folderPath']):undefined;let _0x2d5075;const _0x316f1c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x28c202=_0x1cfaf1[_0x58024d(0x1e9)];if(_0x1cfaf1[_0x58024d(0x1e9)]['rule']){const _0x4a1c0c=createSegmentIdResolver(_0x105244['segmentNameToId'],_0x1cfaf1[_0x58024d(0x1e9)]['name']),_0x2eea0e=await resolveRuleSegmentIds(_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x213)],_0x4a1c0c);_0x28c202={..._0x1cfaf1[_0x58024d(0x1e9)],'rule':_0x2eea0e};}try{if(_0x1cfaf1[_0x58024d(0x232)]){_0x5472e8[_0x58024d(0x1c3)]?.({'type':_0x58024d(0x287),'name':_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]});const _0x578783=_0x27c263(_0x28c202,_0x250b50),_0x4e87d3=await _0x5472e8[_0x58024d(0x244)]('Creating\x20segment\x20\x27'+_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]+_0x58024d(0x245),()=>_0x32072a['segment'][_0x58024d(0x1ca)](_0x38acfe[_0x58024d(0x1e6)],_0x578783));_0x2d5075=_0x4e87d3[_0x58024d(0x223)]['id'],_0x105244[_0x58024d(0x275)][_0x58024d(0x1f1)](_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)],_0x2d5075),_0x316f1c[_0x58024d(0x228)]={'name':_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)],'id':_0x2d5075},_0x5472e8[_0x58024d(0x1c3)]?.({'type':_0x58024d(0x19e),'name':_0x1cfaf1['yamlConfig'][_0x58024d(0x1bb)],'segmentId':_0x2d5075}),_0x5472e8['logSuccess']?.(_0x58024d(0x26c)+_0x1cfaf1[_0x58024d(0x1e9)]['name']+'\x27'),_0x316f1c['created']=0x1;}else{if(_0x1cfaf1[_0x58024d(0x236)]){_0x5472e8['onProgress']?.({'type':_0x58024d(0x281),'name':_0x1cfaf1['yamlConfig'][_0x58024d(0x1bb)]});const _0x2d4694=_0x371493(_0x28c202);_0x250b50!==_0x1cfaf1[_0x58024d(0x294)]?.[_0x58024d(0x201)]&&(_0x2d4694['segmentFolderId']=_0x250b50?parseInt(_0x250b50,0xa):undefined),await _0x5472e8['withProgress'](_0x58024d(0x1f7)+_0x1cfaf1['yamlConfig'][_0x58024d(0x1bb)]+_0x58024d(0x245),()=>_0x32072a[_0x58024d(0x290)]['updateSegmentById'](_0x38acfe['parentId'],_0x1cfaf1['existingSegment']['id'],_0x2d4694)),_0x2d5075=_0x1cfaf1[_0x58024d(0x294)]['id'],_0x5472e8[_0x58024d(0x1c3)]?.({'type':_0x58024d(0x1ae),'name':_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]}),_0x5472e8[_0x58024d(0x286)]?.(_0x58024d(0x297)+_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)]+'\x27'),_0x316f1c[_0x58024d(0x195)]=0x1;}else _0x2d5075=_0x1cfaf1[_0x58024d(0x294)]['id'];}}catch(_0x4da7bb){const _0x2a7476=isHttp400Error(_0x4da7bb),_0x2351b2=_0x2a7476?ErrorCode[_0x58024d(0x19f)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x3d550a=getErrorMessage(_0x4da7bb);throw new SDKError(_0x2351b2,_0x58024d(0x1a0)+(_0x1cfaf1[_0x58024d(0x232)]?_0x58024d(0x220):_0x58024d(0x27a))+_0x58024d(0x1a4)+_0x1cfaf1[_0x58024d(0x27e)]+_0x58024d(0x24e)+_0x3d550a,_0x4da7bb);}try{const _0x3b9f2d=await syncActivationsForSegment(_0x32072a,_0x38acfe['parentId'],_0x2d5075,_0x1cfaf1[_0x58024d(0x1e9)][_0x58024d(0x1bb)],_0x1cfaf1[_0x58024d(0x265)],_0x5472e8,_0x1cfaf1[_0x58024d(0x27e)]);_0x316f1c[_0x58024d(0x1b2)]=_0x3b9f2d;}catch(_0x474033){if(_0x474033 instanceof SDKError)throw _0x474033;throw new SDKError(ErrorCode[_0x58024d(0x261)],_0x58024d(0x207)+_0x1cfaf1[_0x58024d(0x1e9)]['name']+_0x58024d(0x28b)+_0x1cfaf1[_0x58024d(0x27e)]+_0x58024d(0x24e)+getErrorMessage(_0x474033),_0x474033);}return _0x316f1c;},_0x2f46e3=await batchAsync(_0x493bf1,_0x1441bd,_0x201ec1),_0x5f4894={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3e5980 of _0x2f46e3){_0x5f4894['created']+=_0x3e5980[_0x83ae3d(0x18c)],_0x5f4894[_0x83ae3d(0x195)]+=_0x3e5980[_0x83ae3d(0x195)],_0x3e5980[_0x83ae3d(0x228)]&&_0x5f4894[_0x83ae3d(0x1eb)]['set'](_0x3e5980[_0x83ae3d(0x228)][_0x83ae3d(0x1bb)],_0x3e5980[_0x83ae3d(0x228)]['id']),_0x5f4894[_0x83ae3d(0x1b2)][_0x83ae3d(0x18c)]+=_0x3e5980[_0x83ae3d(0x1b2)]['created'],_0x5f4894['activations'][_0x83ae3d(0x195)]+=_0x3e5980[_0x83ae3d(0x1b2)][_0x83ae3d(0x195)],_0x5f4894['activations']['deleted']+=_0x3e5980[_0x83ae3d(0x1b2)][_0x83ae3d(0x1d6)];}return _0x5f4894;}async function syncActivationsForSegment(_0x1f81fb,_0x1d06f4,_0x487e72,_0x11caf0,_0x294584,_0x188e54,_0x4a265d){const _0x403e78=a174_0x32cc05,_0x127e98={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x100a9f of _0x294584){try{if(_0x100a9f[_0x403e78(0x225)]===_0x403e78(0x220)&&_0x100a9f[_0x403e78(0x19a)])_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x27c),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),await _0x188e54[_0x403e78(0x244)](_0x403e78(0x1d2)+_0x100a9f['name']+_0x403e78(0x245),()=>_0x1f81fb[_0x403e78(0x290)][_0x403e78(0x299)](_0x1d06f4,_0x487e72,_0x100a9f[_0x403e78(0x19a)])),_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x1bd),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),_0x188e54['logSuccess']?.(_0x403e78(0x25d)+_0x100a9f[_0x403e78(0x1bb)]+'\x27'),_0x127e98['created']++;else{if(_0x100a9f['type']===_0x403e78(0x27a)&&_0x100a9f[_0x403e78(0x19a)]&&_0x100a9f[_0x403e78(0x238)])_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x1b8),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),await _0x188e54[_0x403e78(0x244)](_0x403e78(0x23c)+_0x100a9f[_0x403e78(0x1bb)]+'\x27...',()=>_0x1f81fb['segment'][_0x403e78(0x259)](_0x1d06f4,_0x487e72,_0x100a9f[_0x403e78(0x238)]['id'],_0x100a9f[_0x403e78(0x19a)])),_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x283),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),_0x188e54[_0x403e78(0x286)]?.('Updated\x20activation\x20\x27'+_0x100a9f[_0x403e78(0x1bb)]+'\x27'),_0x127e98[_0x403e78(0x195)]++;else _0x100a9f[_0x403e78(0x225)]==='delete'&&_0x100a9f[_0x403e78(0x238)]&&(_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x20f),'segmentName':_0x11caf0,'activationName':_0x100a9f[_0x403e78(0x1bb)]}),await _0x188e54['withProgress'](_0x403e78(0x26a)+_0x100a9f['name']+_0x403e78(0x245),()=>_0x1f81fb[_0x403e78(0x290)]['deleteActivation'](_0x1d06f4,_0x487e72,_0x100a9f[_0x403e78(0x238)]['id'])),_0x188e54[_0x403e78(0x1c3)]?.({'type':_0x403e78(0x291),'segmentName':_0x11caf0,'activationName':_0x100a9f['name']}),_0x188e54[_0x403e78(0x1cf)]?.('Deleted\x20activation\x20\x27'+_0x100a9f['name']+'\x27'),_0x127e98['deleted']++);}}catch(_0x4f8b83){const _0x564caf=isHttp400Error(_0x4f8b83),_0x3dca31=_0x564caf?ErrorCode[_0x403e78(0x296)]:ErrorCode[_0x403e78(0x261)],_0x10fb22=getErrorMessage(_0x4f8b83);throw new SDKError(_0x3dca31,_0x403e78(0x1a0)+_0x100a9f[_0x403e78(0x225)]+_0x403e78(0x233)+_0x100a9f[_0x403e78(0x1bb)]+_0x403e78(0x28b)+_0x4a265d+_0x403e78(0x24e)+_0x10fb22,_0x4f8b83);}}return _0x127e98;}export async function executePushFolders(_0x24dab4,_0x51693f,_0x523ab4,_0xc0c299,_0x2d1030){const _0x41385c=a174_0x32cc05,_0x5549fc=new Map(_0x523ab4),_0x22a40a=sortFoldersByDepth(_0x51693f);for(const _0x50e6f8 of _0x22a40a){const _0x31bb33=_0x50e6f8['split']('/'),_0x1c6a1f=_0x31bb33[_0x31bb33[_0x41385c(0x1c7)]-0x1],_0x5a6532=_0x31bb33[_0x41385c(0x27f)](0x0,-0x1)[_0x41385c(0x1ed)]('/'),_0x518690=_0x5549fc[_0x41385c(0x253)](_0x5a6532);_0x2d1030[_0x41385c(0x1c3)]?.({'type':_0x41385c(0x25e),'folder':_0x50e6f8});const _0x126bbc={'name':_0x1c6a1f,'parentFolderId':_0x518690},_0x2d1726=await _0x2d1030[_0x41385c(0x244)]('Creating\x20folder\x20\x27'+_0x50e6f8+_0x41385c(0x245),()=>_0x24dab4['segment'][_0x41385c(0x247)](_0xc0c299[_0x41385c(0x1e6)],_0x126bbc));_0x5549fc[_0x41385c(0x1f1)](_0x50e6f8,_0x2d1726['data']['id']),_0x2d1030[_0x41385c(0x1c3)]?.({'type':_0x41385c(0x222),'folder':_0x50e6f8,'folderId':_0x2d1726[_0x41385c(0x223)]['id']}),_0x2d1030[_0x41385c(0x193)]?.(_0x41385c(0x204)+_0x50e6f8+'\x27');}return _0x5549fc;}export async function executePushSegmentDeletions(_0x236195,_0x42d830,_0x493939){const _0x2462e5=a174_0x32cc05;if(_0x42d830[_0x2462e5(0x1c7)]===0x0)return 0x0;const {batchAsync:_0x3e16c7}=await import(_0x2462e5(0x24d)),_0x2cc99d=0x5,_0x3256fd=await _0x3e16c7(_0x42d830,async _0x55af7e=>{const _0xd6a61a=_0x2462e5;return _0x493939[_0xd6a61a(0x1c3)]?.({'type':'segment_deleting','name':_0x55af7e['name']}),await _0x236195[_0xd6a61a(0x290)][_0xd6a61a(0x262)](_0x55af7e['id']),_0x493939[_0xd6a61a(0x1c3)]?.({'type':_0xd6a61a(0x226),'name':_0x55af7e['name']}),_0x493939[_0xd6a61a(0x1cf)]?.(_0xd6a61a(0x20d)+_0x55af7e[_0xd6a61a(0x1bb)]+'\x27'),0x1;},_0x2cc99d);return _0x3256fd[_0x2462e5(0x1f8)]((_0x152bad,_0x1a1f3c)=>_0x152bad+_0x1a1f3c,0x0);}export async function executePushJourneys(_0x1582fa,_0x6080b7,_0x535e6d,_0x1e6ca2,_0x271189){const _0x42ca3f=a174_0x32cc05,{journeyDefToRequest:_0x371250}=await import(_0x42ca3f(0x266)),{activationDefToCreateRequest:_0x430e2e,yamlRuleToApi:_0x29d1b9,validateSegmentRule:_0x4b0cfc}=await import('./child-segment-yaml.js'),_0x291898={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x36c05b=new Map(_0x535e6d[_0x42ca3f(0x275)]),_0x5310fd=0x5;for(let _0x3c3efa=0x0;_0x3c3efa<_0x6080b7[_0x42ca3f(0x1c7)];_0x3c3efa+=_0x5310fd){const _0x182e55=_0x6080b7['slice'](_0x3c3efa,_0x3c3efa+_0x5310fd),_0x520a62=await Promise[_0x42ca3f(0x216)](_0x182e55[_0x42ca3f(0x1b4)](async _0x22905c=>{const _0x5723cf=_0x42ca3f;if(!_0x22905c[_0x5723cf(0x232)]&&!_0x22905c['hasChanges'])return{'action':_0x5723cf(0x258),'name':_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)],'journeyId':_0x22905c[_0x5723cf(0x1fb)]?.['id']};const _0x421e6b=_0x22905c[_0x5723cf(0x260)]?_0x535e6d[_0x5723cf(0x241)][_0x5723cf(0x253)](_0x22905c[_0x5723cf(0x260)]):undefined;_0x271189[_0x5723cf(0x1c3)]?.({'type':_0x22905c[_0x5723cf(0x232)]?'journey_creating':'journey_updating','name':_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)]});try{const _0x24a37b=await executeSingleJourneyPush(_0x1582fa,_0x22905c,{..._0x535e6d,'segmentNameToId':_0x36c05b},{'parentId':_0x1e6ca2[_0x5723cf(0x1e6)],'rootFolderId':_0x1e6ca2[_0x5723cf(0x1db)],'folderId':_0x421e6b,'verbose':_0x1e6ca2[_0x5723cf(0x21d)]},_0x271189,{'journeyDefToRequest':_0x371250,'activationDefToCreateRequest':_0x430e2e,'yamlRuleToApi':_0x29d1b9,'validateSegmentRule':_0x4b0cfc});for(const [_0x44b3ea,_0x51fef4]of _0x24a37b[_0x5723cf(0x21f)]){_0x36c05b[_0x5723cf(0x1f1)](_0x44b3ea,_0x51fef4),_0x291898[_0x5723cf(0x21f)][_0x5723cf(0x1f1)](_0x44b3ea,_0x51fef4);}if(_0x24a37b['action']===_0x5723cf(0x18c))_0x271189['onProgress']?.({'type':_0x5723cf(0x22b),'name':_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)],'journeyId':_0x24a37b[_0x5723cf(0x295)]}),_0x271189[_0x5723cf(0x286)]?.(_0x5723cf(0x21e)+_0x22905c[_0x5723cf(0x1e9)][_0x5723cf(0x1bb)]+'\x27'),_0x291898[_0x5723cf(0x18c)]++;else _0x24a37b[_0x5723cf(0x24b)]===_0x5723cf(0x195)&&(_0x271189[_0x5723cf(0x1c3)]?.({'type':_0x5723cf(0x246),'name':_0x22905c[_0x5723cf(0x1e9)]['name']}),_0x271189[_0x5723cf(0x286)]?.('Updated\x20journey\x20\x27'+_0x22905c[_0x5723cf(0x1e9)]['name']+'\x27'),_0x291898[_0x5723cf(0x195)]++);return{'action':_0x24a37b[_0x5723cf(0x24b)],'name':_0x22905c[_0x5723cf(0x1e9)]['name'],'journeyId':_0x24a37b[_0x5723cf(0x295)]};}catch(_0x57d929){const _0x2bd739=isHttp400Error(_0x57d929),_0x184666=_0x2bd739?ErrorCode[_0x5723cf(0x25c)]:ErrorCode[_0x5723cf(0x1b9)],_0x3195e6=getErrorMessage(_0x57d929);throw new SDKError(_0x184666,_0x5723cf(0x1a0)+(_0x22905c['isNew']?_0x5723cf(0x220):_0x5723cf(0x27a))+_0x5723cf(0x1a7)+_0x22905c['absolutePath']+_0x5723cf(0x24e)+_0x3195e6,_0x57d929);}}));_0x291898['results'][_0x42ca3f(0x1af)](..._0x520a62);}return _0x291898;}function a174_0x1505(_0x49d67e,_0x32fa23){_0x49d67e=_0x49d67e-0x18c;const _0x445272=a174_0x4452();let _0x150505=_0x445272[_0x49d67e];return _0x150505;}async function matchExistingJourneySegments(_0x56a9fe,_0x11f826,_0x19b5c6,_0x33541e,_0x2c5866){const _0x115c77=a174_0x32cc05;if(!_0x11f826[_0x115c77(0x1fb)]||!_0x11f826[_0x115c77(0x1e9)][_0x115c77(0x28e)])return;const _0xa34be4=new Map(),_0x3595df=new Set();for(const _0x3c4e7b of Object[_0x115c77(0x1d4)](_0x11f826['yamlConfig'][_0x115c77(0x28e)])){const _0x49e486=generateDeterministicJourneySegmentName(_0x11f826[_0x115c77(0x1e9)]['name'],_0x3c4e7b);_0xa34be4[_0x115c77(0x1f1)](_0x49e486,_0x3c4e7b),_0x3595df[_0x115c77(0x26d)](_0x3c4e7b);}const _0x454c49=[],_0x48c6a8=collectSegmentIdsFromJourneyApi(_0x11f826['existingJourney']);for(const _0x338c7d of _0x48c6a8){const _0x207fda=await fetchSegment(_0x56a9fe,_0x19b5c6,_0x338c7d,_0x33541e);if(!_0x207fda?.[_0x115c77(0x1bb)])continue;const _0x214255=_0xa34be4[_0x115c77(0x253)](_0x207fda[_0x115c77(0x1bb)]);_0x214255?(_0x2c5866[_0x115c77(0x1f1)](_0x214255,_0x338c7d),_0x3595df[_0x115c77(0x1e2)](_0x214255)):_0x454c49[_0x115c77(0x1af)]({'id':_0x338c7d,'seg':_0x207fda});}if(_0x3595df[_0x115c77(0x285)]>0x0&&_0x454c49[_0x115c77(0x1c7)]>0x0){const {localExpandedRuleToNames:_0x31232d}=buildLocalExpandedRuleMappings(_0x11f826[_0x115c77(0x1e9)]),_0xe87a6b=new Map();for(const {id:_0x4a69d7,seg:_0x33d0d5}of _0x454c49){if(_0x33d0d5[_0x115c77(0x213)]){const _0x275198=apiRuleToYaml(_0x33d0d5[_0x115c77(0x213)]);_0xe87a6b['set'](_0x4a69d7,_0x275198);}}for(const {id:_0x5f3d5b,seg:_0xdd1d3b}of _0x454c49){if(!_0xdd1d3b['rule'])continue;const _0x4731c6=_0xe87a6b['get'](_0x5f3d5b);if(!_0x4731c6)continue;const _0x490874=serializeExpandedRule(_0x4731c6,_0xe87a6b),_0x5631de=_0x31232d[_0x115c77(0x253)](_0x490874);if(_0x5631de){const _0x29c746=_0x5631de[_0x115c77(0x257)](_0x3867be=>_0x3595df[_0x115c77(0x1fd)](_0x3867be));_0x29c746&&(_0x2c5866[_0x115c77(0x1f1)](_0x29c746,_0x5f3d5b),_0x3595df['delete'](_0x29c746),logger[_0x115c77(0x20c)]('Matched\x20server\x20segment\x20\x27'+_0xdd1d3b[_0x115c77(0x1bb)]+_0x115c77(0x242)+_0x29c746+_0x115c77(0x24f)));}}}}async function executeSingleJourneyPush(_0x2c5848,_0x49225b,_0x2b67ee,_0x32712f,_0xc923bc,_0x209929){const _0x3924c7=a174_0x32cc05,{journeyDefToRequest:_0x37eedb,activationDefToCreateRequest:_0x11779d,yamlRuleToApi:_0x59de19,validateSegmentRule:_0x5e2f4b}=_0x209929,_0x916154=new Map(),_0xc158c6=new Map();recoverSegmentIdsFromPushRecovery(_0x49225b,_0x916154,_0x2b67ee['segmentNameToId']);const _0x2f0260=new Map(),_0x49d22c=new Map(),_0x433128=new Map();let _0x2c415c;const _0x468da9=async()=>{const _0x5c252f=a174_0x1505;if(_0x2c415c)return;_0x2c415c=new Map();if(!_0x49225b[_0x5c252f(0x1fb)])return;const _0x4242a5=await _0x2c5848['journey'][_0x5c252f(0x240)](_0x49225b[_0x5c252f(0x1fb)]['id']);for(const _0x509606 of _0x4242a5){const _0x5691c3=journeyActivationStepToYaml(_0x509606,_0x2b67ee[_0x5c252f(0x264)],_0x2b67ee[_0x5c252f(0x28f)]),_0x17d89b=activationSignature(_0x5691c3);!_0x2c415c['has'](_0x17d89b)&&_0x2c415c['set'](_0x17d89b,_0x509606['id']),_0x5691c3[_0x5c252f(0x1bb)]&&_0xc158c6[_0x5c252f(0x1f1)](_0x5691c3['name'],_0x509606['id']);}};await matchExistingJourneySegments(_0x2c5848,_0x49225b,_0x32712f[_0x3924c7(0x1e6)],_0x2b67ee[_0x3924c7(0x292)],_0x2b67ee[_0x3924c7(0x275)]);const _0x3ab920={'resolveSegmentId':async _0x48605b=>{const _0x1274ae=_0x3924c7,_0x3389ae=_0x2b67ee[_0x1274ae(0x275)][_0x1274ae(0x253)](_0x48605b);if(!_0x3389ae)throw new SDKError(ErrorCode[_0x1274ae(0x1e8)],_0x1274ae(0x209)+_0x48605b+_0x1274ae(0x279)+_0x49225b[_0x1274ae(0x1e9)][_0x1274ae(0x1bb)]+')');return _0x3389ae;},'resolveEmbeddedSegmentId':async(_0x19df70,_0x39a762)=>{const _0x441620=_0x3924c7,_0x2accd3=_0x2b67ee['segmentNameToId'][_0x441620(0x253)](_0x19df70);if(_0x2accd3)return _0x2accd3;const _0x45080d=_0x2b67ee['existingSegments'][_0x441620(0x257)](_0x22af92=>_0x22af92[_0x441620(0x1bb)]===_0x19df70);if(_0x45080d)return _0x2b67ee[_0x441620(0x275)][_0x441620(0x1f1)](_0x19df70,_0x45080d['id']),_0x45080d['id'];if(_0x49225b['isNew']){const {stageName:_0x1f3c87,criteriaName:_0x239b69}=findSegmentCriteriaLocation(_0x49225b[_0x441620(0x1e9)],_0x19df70);return _0x5e2f4b(_0x19df70,_0x39a762[_0x441620(0x213)]),_0x49d22c['set'](_0x19df70,{'definition':_0x39a762,'stageName':_0x1f3c87,'criteriaName':_0x239b69}),createPendingSegmentId(_0x19df70);}const _0x21f707=_0x49225b[_0x441620(0x1fb)]?.['id'];if(!_0x21f707)throw new SDKError(ErrorCode[_0x441620(0x271)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x15bc1c=_0x2f0260['get'](_0x19df70);if(_0x15bc1c)return _0x15bc1c;const _0x211b67=((async()=>{const _0x445280=_0x441620;_0x5e2f4b(_0x19df70,_0x39a762[_0x445280(0x213)]);const _0x940c57=generateDeterministicJourneySegmentName(_0x49225b[_0x445280(0x1e9)][_0x445280(0x1bb)],_0x19df70),_0x3edc45=_0x2b67ee[_0x445280(0x292)][_0x445280(0x257)](_0x33ce04=>_0x33ce04['name']===_0x940c57),_0x3aa71b=createSegmentIdResolver(_0x2b67ee['segmentNameToId'],_0x19df70),_0x439193=await resolveRuleSegmentIds(_0x39a762[_0x445280(0x213)],_0x3aa71b);let _0x3992a0;return _0x3edc45?(await _0x2c5848[_0x445280(0x290)][_0x445280(0x1f0)](_0x32712f[_0x445280(0x1e6)],_0x3edc45['id'],{'description':_0x39a762[_0x445280(0x1e1)]||_0x445280(0x1e5)+_0x19df70,'rule':_0x59de19(_0x439193),'countPopulation':!![]}),_0x3992a0=_0x3edc45['id'],saveSegmentToPushRecovery(_0x49225b['absolutePath'],_0x49225b[_0x445280(0x1e9)][_0x445280(0x1bb)],_0x19df70,{'segmentId':_0x3992a0,'uniqueServerName':_0x940c57,'createdAt':new Date()['toISOString']()})):_0x3992a0=await createOrRecoverEmbeddedSegment(_0x2c5848,_0x49225b,{'localName':_0x19df70,'uniqueSegmentName':_0x940c57,'description':_0x39a762[_0x445280(0x1e1)]||_0x445280(0x1e5)+_0x19df70,'journeyId':_0x21f707,'resolvedRule':_0x439193,'parentId':_0x32712f['parentId'],'folderId':_0x32712f[_0x445280(0x1db)]||''},_0x59de19),_0x2b67ee['segmentNameToId']['set'](_0x19df70,_0x3992a0),_0x916154[_0x445280(0x1f1)](_0x19df70,_0x3992a0),_0x3992a0;})());_0x2f0260[_0x441620(0x1f1)](_0x19df70,_0x211b67);try{return await _0x211b67;}finally{_0x2f0260['delete'](_0x19df70);}},'resolveActivationId':async _0x31171e=>{const _0x4c8c87=_0x3924c7,_0x1727b7=_0xc158c6[_0x4c8c87(0x253)](_0x31171e);if(_0x1727b7)return _0x1727b7;if(_0x49225b[_0x4c8c87(0x1fb)]){await _0x468da9();const _0x5495c1=_0xc158c6[_0x4c8c87(0x253)](_0x31171e);if(_0x5495c1)return _0x5495c1;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x4c8c87(0x23f)+_0x31171e+'\x20(referenced\x20in\x20journey\x20'+_0x49225b[_0x4c8c87(0x1e9)]['name']+_0x4c8c87(0x230)+_0x4c8c87(0x22f));},'resolveEmbeddedActivationId':async(_0x489484,_0x5deaa6)=>{const _0x5875a3=_0x3924c7,_0x11a7bf=_0xc158c6[_0x5875a3(0x253)](_0x489484);if(_0x11a7bf)return _0x11a7bf;if(_0x49225b['isNew'])return _0x433128[_0x5875a3(0x1f1)](_0x489484,_0x5deaa6),createPendingActivationId(_0x489484);if(_0x49225b[_0x5875a3(0x1fb)]){await _0x468da9();const _0x2680a4=_0xc158c6[_0x5875a3(0x253)](_0x5deaa6[_0x5875a3(0x1bb)]);if(_0x2680a4)return _0xc158c6['set'](_0x489484,_0x2680a4),_0x2680a4;const _0x88d8e9=activationSignature(_0x5deaa6),_0x272d34=_0x2c415c?.[_0x5875a3(0x253)](_0x88d8e9);if(_0x272d34)return _0xc158c6['set'](_0x489484,_0x272d34),_0x272d34;const _0x4b0b25=await _0x11779d(_0x5deaa6,_0x2b67ee[_0x5875a3(0x23d)]),_0x4cc875={..._0x4b0b25,..._0x5deaa6[_0x5875a3(0x1fc)]!==undefined&&{'runAfterJourneyRefresh':_0x5deaa6[_0x5875a3(0x1fc)]}},_0x146de9=await _0x2c5848[_0x5875a3(0x289)][_0x5875a3(0x299)](_0x49225b[_0x5875a3(0x1fb)]['id'],_0x4cc875);return _0xc158c6[_0x5875a3(0x1f1)](_0x489484,_0x146de9['id']),_0x146de9['id'];}throw new SDKError(ErrorCode[_0x5875a3(0x271)],_0x5875a3(0x218));},'resolveJourneyId':async _0x4741d8=>{const _0x21b307=_0x3924c7;try{return await _0x2c5848[_0x21b307(0x289)][_0x21b307(0x203)](_0x32712f[_0x21b307(0x1e6)],_0x4741d8);}catch(_0x50b0ed){throw new SDKError(ErrorCode[_0x21b307(0x1ec)],_0x21b307(0x1b0)+_0x4741d8+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x49225b['yamlConfig'][_0x21b307(0x1bb)]+'\x27)',_0x50b0ed);}},'resolveStageId':async(_0x55e9c8,_0x6ebf32)=>{const _0x4c98d7=_0x3924c7,_0x41a6dc=await _0x2c5848[_0x4c98d7(0x289)][_0x4c98d7(0x20b)](_0x55e9c8),_0x2bd0f0=_0x41a6dc[_0x4c98d7(0x1bf)][_0x4c98d7(0x194)][_0x4c98d7(0x257)](_0x32a14a=>_0x32a14a['name'][_0x4c98d7(0x252)]()===_0x6ebf32[_0x4c98d7(0x252)]());if(!_0x2bd0f0?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x4c98d7(0x27d)+_0x6ebf32+_0x4c98d7(0x215)+(_0x41a6dc['attributes']['journeyBundleName']||_0x41a6dc[_0x4c98d7(0x1bf)][_0x4c98d7(0x1bb)])+'\x27');return _0x2bd0f0['id'];}},_0x2d7706=await _0x37eedb(_0x49225b[_0x3924c7(0x1e9)],_0x32712f['parentId'],_0x3ab920),_0x188ca6=_0x32712f['folderId']||_0x32712f['rootFolderId'];_0x188ca6&&(_0x2d7706[_0x3924c7(0x1ba)]={'parentFolder':{'data':{'id':_0x188ca6,'type':_0x3924c7(0x1d0)}}});if(_0x49225b[_0x3924c7(0x232)]){if(_0x49d22c['size']>0x0||_0x433128[_0x3924c7(0x285)]>0x0)return await executeThreeStepJourneyCreate(_0x2c5848,_0x49225b,_0x2d7706,{'pendingEmbeddedSegments':_0x49d22c,'pendingEmbeddedActivations':_0x433128,'embeddedSegmentNameToId':_0x916154,'journeyActivationNameToId':_0xc158c6},{..._0x32712f,'effectiveFolderId':_0x188ca6},_0x2b67ee,_0xc923bc,_0x209929);else{ensureJourneyDefaults(_0x2d7706[_0x3924c7(0x1bf)]);const _0x3f5080=await _0x2c5848[_0x3924c7(0x289)][_0x3924c7(0x220)](_0x2d7706);return deletePushRecovery(_0x49225b[_0x3924c7(0x27e)]),{'action':_0x3924c7(0x18c),'journeyId':_0x3f5080['id'],'embeddedSegmentNameToId':_0x916154};}}else{if(_0x49225b[_0x3924c7(0x236)]&&_0x49225b[_0x3924c7(0x1fb)]){_0x2d7706['id']=_0x49225b['existingJourney']['id'];const _0x2c5c4f=_0x2d7706[_0x3924c7(0x1bf)];_0x49225b[_0x3924c7(0x1fb)]['attributes']?.[_0x3924c7(0x1ce)]&&(_0x2c5c4f[_0x3924c7(0x1ce)]=_0x49225b[_0x3924c7(0x1fb)][_0x3924c7(0x1bf)]['journeyBundleName']);const _0x2b24a6=_0x49225b[_0x3924c7(0x1fb)]['attributes']?.[_0x3924c7(0x194)];return _0x2b24a6&&_0x2d7706[_0x3924c7(0x1bf)][_0x3924c7(0x194)]&&injectExistingStageIds(_0x2d7706[_0x3924c7(0x1bf)][_0x3924c7(0x194)],_0x2b24a6),ensureJourneyDefaults(_0x2c5c4f),await _0x2c5848[_0x3924c7(0x289)][_0x3924c7(0x27a)](_0x49225b[_0x3924c7(0x1fb)]['id'],_0x2d7706),deletePushRecovery(_0x49225b[_0x3924c7(0x27e)]),{'action':_0x3924c7(0x195),'journeyId':_0x49225b[_0x3924c7(0x1fb)]['id'],'embeddedSegmentNameToId':_0x916154};}}return deletePushRecovery(_0x49225b['absolutePath']),{'action':_0x3924c7(0x258),'journeyId':_0x49225b['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x916154};}function findSegmentCriteriaLocation(_0x44ba79,_0x559e70){const _0x325dc4=a174_0x32cc05,_0x4cad16=_0x44ba79['stages']||_0x44ba79[_0x325dc4(0x1b1)]?.[0x0]?.['stages']||[];let _0x537b58='entry',_0x1f7a19=_0x559e70;const _0x33c787=_0x44ba79[_0x325dc4(0x1da)]||_0x44ba79['journeys']?.[0x0]?.['goal'];if(_0x33c787?.[_0x325dc4(0x290)]===_0x559e70)return{'stageName':_0x325dc4(0x1da),'criteriaName':_0x33c787[_0x325dc4(0x1bb)]||_0x559e70};_0x13d437:for(const _0x440447 of _0x4cad16){if(_0x440447[_0x325dc4(0x22a)]?.[_0x325dc4(0x290)]===_0x559e70){_0x537b58=_0x440447[_0x325dc4(0x1bb)],_0x1f7a19=_0x440447[_0x325dc4(0x22a)][_0x325dc4(0x1bb)]||_0x559e70;break;}if(_0x440447[_0x325dc4(0x282)])for(const _0x4e0a46 of _0x440447[_0x325dc4(0x282)]){if(_0x4e0a46[_0x325dc4(0x225)]===_0x325dc4(0x278)&&_0x4e0a46['with']?.[_0x325dc4(0x23a)])for(const _0x389412 of _0x4e0a46['with']['branches']){if(_0x389412['segment']===_0x559e70){_0x537b58=_0x440447[_0x325dc4(0x1bb)],_0x1f7a19=_0x389412[_0x325dc4(0x1bb)]||_0x559e70;break _0x13d437;}}}}return{'stageName':_0x537b58,'criteriaName':_0x1f7a19};}async function executeThreeStepJourneyCreate(_0x32ebf7,_0x495e85,_0x4e5dfd,_0x124cfe,_0x1b507d,_0x490a23,_0x144aa8,_0x21abd3){const _0x5ef169=a174_0x32cc05,{activationDefToCreateRequest:_0x3317f4,yamlRuleToApi:_0x543dbb}=_0x21abd3,{pendingEmbeddedSegments:_0x366184,pendingEmbeddedActivations:_0x3a6009,embeddedSegmentNameToId:_0xfd4280}=_0x124cfe,_0x1af048=JSON[_0x5ef169(0x25b)](JSON['stringify'](_0x4e5dfd));ensureJourneyDefaults(_0x1af048['attributes']),stripPendingIds(_0x1af048);const _0x287e93=await _0x32ebf7[_0x5ef169(0x289)][_0x5ef169(0x220)](_0x1af048),_0x14e764=_0x287e93['id'],_0x305206=new Map();for(const _0x5dffee of _0x287e93[_0x5ef169(0x1bf)][_0x5ef169(0x194)]){_0x305206[_0x5ef169(0x1f1)](_0x5dffee[_0x5ef169(0x1bb)]['toLowerCase'](),_0x5dffee['id']);}recoverSegmentIdsFromPushRecovery(_0x495e85,_0xfd4280,_0x490a23[_0x5ef169(0x275)]);for(const [_0xcdcdb2,{definition:_0x2063a7}]of _0x366184){if(_0xfd4280[_0x5ef169(0x1fd)](_0xcdcdb2)){_0x144aa8[_0x5ef169(0x1c3)]?.({'type':_0x5ef169(0x19d),'journeyName':_0x495e85[_0x5ef169(0x1e9)][_0x5ef169(0x1bb)],'segmentName':_0xcdcdb2});continue;}const _0x3001ce=generateDeterministicJourneySegmentName(_0x495e85['yamlConfig']['name'],_0xcdcdb2);_0x144aa8[_0x5ef169(0x1c3)]?.({'type':_0x5ef169(0x270),'journeyName':_0x495e85['yamlConfig'][_0x5ef169(0x1bb)],'segmentName':_0xcdcdb2});const _0x4a60b5=createSegmentIdResolver(_0x490a23[_0x5ef169(0x275)],_0xcdcdb2),_0x4395a3=await resolveRuleSegmentIds(_0x2063a7['rule'],_0x4a60b5),_0x5ef7e2=await createOrRecoverEmbeddedSegment(_0x32ebf7,_0x495e85,{'localName':_0xcdcdb2,'uniqueSegmentName':_0x3001ce,'description':_0x2063a7[_0x5ef169(0x1e1)]||_0x5ef169(0x1e5)+_0xcdcdb2,'journeyId':_0x14e764,'resolvedRule':_0x4395a3,'parentId':_0x1b507d[_0x5ef169(0x1e6)],'folderId':_0x1b507d[_0x5ef169(0x1ac)]||''},_0x543dbb);_0xfd4280[_0x5ef169(0x1f1)](_0xcdcdb2,_0x5ef7e2),_0x490a23[_0x5ef169(0x275)]['set'](_0xcdcdb2,_0x5ef7e2),_0x144aa8['onProgress']?.({'type':'embedded_segment_created','journeyName':_0x495e85[_0x5ef169(0x1e9)][_0x5ef169(0x1bb)],'segmentName':_0xcdcdb2});}const _0x392906=new Map();for(const [_0x448a79,_0x49c4a7]of _0x3a6009){_0x144aa8['onProgress']?.({'type':_0x5ef169(0x1ff),'journeyName':_0x495e85[_0x5ef169(0x1e9)]['name'],'activationName':_0x448a79});const _0x22e954=await _0x3317f4(_0x49c4a7,_0x490a23[_0x5ef169(0x23d)]),_0x9b9c49={..._0x22e954,..._0x49c4a7[_0x5ef169(0x1fc)]!==undefined&&{'runAfterJourneyRefresh':_0x49c4a7[_0x5ef169(0x1fc)]}},_0x426913=await _0x32ebf7[_0x5ef169(0x289)][_0x5ef169(0x299)](_0x14e764,_0x9b9c49);_0x392906[_0x5ef169(0x1f1)](_0x448a79,_0x426913['id']),_0x124cfe[_0x5ef169(0x1c5)][_0x5ef169(0x1f1)](_0x448a79,_0x426913['id']),_0x144aa8[_0x5ef169(0x1c3)]?.({'type':_0x5ef169(0x229),'journeyName':_0x495e85[_0x5ef169(0x1e9)][_0x5ef169(0x1bb)],'activationName':_0x448a79});}const _0x53bb2c=JSON[_0x5ef169(0x25b)](JSON[_0x5ef169(0x1b7)](_0x4e5dfd));return _0x53bb2c['id']=_0x14e764,ensureJourneyDefaults(_0x53bb2c[_0x5ef169(0x1bf)]),resolvePendingIdsInRequest(_0x53bb2c,_0x4e5dfd,_0x305206,_0xfd4280,_0x392906,_0x144aa8),await _0x32ebf7['journey'][_0x5ef169(0x27a)](_0x14e764,_0x53bb2c),deletePushRecovery(_0x495e85['absolutePath']),{'action':_0x5ef169(0x18c),'journeyId':_0x14e764,'embeddedSegmentNameToId':_0xfd4280};}export function stripWaitStepPendingIds(_0x565df5){const _0x13ae0e=a174_0x32cc05,_0x4eba5a=_0x565df5['conditionSegmentId']&&isPendingSegmentId(_0x565df5[_0x13ae0e(0x267)]),_0x442cc2=_0x565df5[_0x13ae0e(0x217)]?.[_0x13ae0e(0x191)](_0x45b86c=>_0x45b86c['segmentId']&&isPendingSegmentId(_0x45b86c[_0x13ae0e(0x200)]));(_0x4eba5a||_0x442cc2)&&(_0x565df5[_0x13ae0e(0x1a6)]=_0x13ae0e(0x21b),_0x565df5[_0x13ae0e(0x19c)]=0x1,_0x565df5[_0x13ae0e(0x243)]=_0x13ae0e(0x1be),delete _0x565df5[_0x13ae0e(0x267)],delete _0x565df5[_0x13ae0e(0x24a)],delete _0x565df5[_0x13ae0e(0x190)],delete _0x565df5[_0x13ae0e(0x217)]);}export function resolveWaitStepPendingIds(_0x242dee,_0x52a48d,_0x4afe7c,_0xf062ae){const _0x331dd1=a174_0x32cc05;if(_0x52a48d[_0x331dd1(0x267)]&&isPendingSegmentId(_0x52a48d[_0x331dd1(0x267)])){const _0x4836ba=_0x4afe7c(_0x52a48d[_0x331dd1(0x267)],_0x331dd1(0x249)+_0xf062ae+_0x331dd1(0x18f));_0x4836ba&&(_0x242dee[_0x331dd1(0x1a6)]=_0x331dd1(0x1a1),_0x242dee[_0x331dd1(0x267)]=_0x4836ba,delete _0x242dee['waitStep'],delete _0x242dee[_0x331dd1(0x243)],_0x52a48d[_0x331dd1(0x24a)]!==undefined&&(_0x242dee[_0x331dd1(0x24a)]=_0x52a48d['conditionTimeoutDuration']),_0x52a48d['conditionTimeoutUnit']&&(_0x242dee['conditionTimeoutUnit']=_0x52a48d[_0x331dd1(0x190)]));}if(_0x52a48d[_0x331dd1(0x217)]){const _0x5a20b0=_0x52a48d[_0x331dd1(0x217)][_0x331dd1(0x191)](_0x4a8dc3=>_0x4a8dc3['segmentId']&&isPendingSegmentId(_0x4a8dc3['segmentId']));if(_0x5a20b0){const _0xa13d1f=_0x52a48d[_0x331dd1(0x217)][_0x331dd1(0x1b4)](_0xaa3dc8=>{const _0x4636e5=_0x331dd1;if(_0xaa3dc8[_0x4636e5(0x200)]&&isPendingSegmentId(_0xaa3dc8['segmentId'])){const _0x3ad4cb=_0x4afe7c(_0xaa3dc8[_0x4636e5(0x200)],'stage\x20\x27'+_0xf062ae+'\x27\x20wait\x20condition');return{..._0xaa3dc8,'segmentId':_0x3ad4cb||_0xaa3dc8[_0x4636e5(0x200)]};}return{..._0xaa3dc8};});_0x242dee['waitStepType']=_0x331dd1(0x1a1),_0x242dee[_0x331dd1(0x217)]=_0xa13d1f,delete _0x242dee[_0x331dd1(0x19c)],delete _0x242dee[_0x331dd1(0x243)],delete _0x242dee[_0x331dd1(0x267)],delete _0x242dee['conditionTimeoutDuration'],delete _0x242dee[_0x331dd1(0x190)];}}}function stripPendingIds(_0x44d3f1){const _0x1ae447=a174_0x32cc05;_0x44d3f1['attributes'][_0x1ae447(0x1da)]?.[_0x1ae447(0x200)]&&isPendingSegmentId(_0x44d3f1[_0x1ae447(0x1bf)]['goal']['segmentId'])&&delete _0x44d3f1['attributes']['goal'];for(const _0x3d1b1a of _0x44d3f1[_0x1ae447(0x1bf)][_0x1ae447(0x194)]||[]){_0x3d1b1a[_0x1ae447(0x268)]?.[_0x1ae447(0x200)]&&isPendingSegmentId(_0x3d1b1a[_0x1ae447(0x268)][_0x1ae447(0x200)])&&delete _0x3d1b1a[_0x1ae447(0x268)];_0x3d1b1a[_0x1ae447(0x277)]?.['segmentId']&&isPendingSegmentId(_0x3d1b1a['milestone'][_0x1ae447(0x200)])&&delete _0x3d1b1a[_0x1ae447(0x277)];_0x3d1b1a[_0x1ae447(0x1e0)]&&(_0x3d1b1a[_0x1ae447(0x1e0)]=_0x3d1b1a[_0x1ae447(0x1e0)]['filter'](_0x5818aa=>!_0x5818aa['segmentId']||!isPendingSegmentId(_0x5818aa['segmentId'])));if(_0x3d1b1a[_0x1ae447(0x282)])for(const _0x4113f8 of Object[_0x1ae447(0x1d4)](_0x3d1b1a[_0x1ae447(0x282)])){const _0x1bfc17=_0x3d1b1a[_0x1ae447(0x282)][_0x4113f8];_0x1bfc17[_0x1ae447(0x225)]===_0x1ae447(0x1f4)&&_0x1bfc17[_0x1ae447(0x27b)]&&isPendingActivationId(_0x1bfc17[_0x1ae447(0x27b)])&&(_0x1bfc17[_0x1ae447(0x27b)]='');if(_0x1bfc17[_0x1ae447(0x225)]===_0x1ae447(0x274)&&_0x1bfc17[_0x1ae447(0x23a)])for(const _0xb74a75 of _0x1bfc17[_0x1ae447(0x23a)]){_0xb74a75[_0x1ae447(0x200)]&&isPendingSegmentId(_0xb74a75['segmentId'])&&(_0xb74a75[_0x1ae447(0x200)]='');}_0x1bfc17[_0x1ae447(0x225)]===_0x1ae447(0x1a8)&&stripWaitStepPendingIds(_0x1bfc17);}}}function resolvePendingIdsInRequest(_0x3619a6,_0x3a862e,_0xd86a2e,_0x30f33e,_0x577393,_0x17d1b7){const _0x4208fb=a174_0x32cc05,_0x1b3321=(_0x31529c,_0xeca886)=>{const _0x561c47=a174_0x1505;if(!isPendingSegmentId(_0x31529c))return _0x31529c;const _0x89ebe1=extractPendingSegmentName(_0x31529c),_0x175178=_0x30f33e['get'](_0x89ebe1);return!_0x175178&&_0x17d1b7[_0x561c47(0x272)]?.(_0x561c47(0x221)+_0x89ebe1+_0x561c47(0x250)+_0xeca886),_0x175178;};if(_0x3619a6[_0x4208fb(0x1bf)][_0x4208fb(0x1da)]?.[_0x4208fb(0x200)]&&isPendingSegmentId(_0x3619a6[_0x4208fb(0x1bf)][_0x4208fb(0x1da)][_0x4208fb(0x200)])){const _0x406545=_0x1b3321(_0x3619a6[_0x4208fb(0x1bf)]['goal'][_0x4208fb(0x200)],_0x4208fb(0x28a));_0x406545&&(_0x3619a6[_0x4208fb(0x1bf)][_0x4208fb(0x1da)][_0x4208fb(0x200)]=_0x406545);}for(const _0x537798 of _0x3619a6['attributes'][_0x4208fb(0x194)]||[]){const _0x15a0e3=_0xd86a2e[_0x4208fb(0x253)](_0x537798[_0x4208fb(0x1bb)]['toLowerCase']());_0x15a0e3&&(_0x537798['id']=_0x15a0e3);if(_0x537798[_0x4208fb(0x268)]?.[_0x4208fb(0x200)]&&isPendingSegmentId(_0x537798[_0x4208fb(0x268)][_0x4208fb(0x200)])){const _0x594883=_0x1b3321(_0x537798[_0x4208fb(0x268)][_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+_0x4208fb(0x1d7));_0x594883&&(_0x537798[_0x4208fb(0x268)][_0x4208fb(0x200)]=_0x594883);}if(_0x537798[_0x4208fb(0x1e0)])for(const _0x1da2f3 of _0x537798[_0x4208fb(0x1e0)]){if(_0x1da2f3[_0x4208fb(0x200)]&&isPendingSegmentId(_0x1da2f3[_0x4208fb(0x200)])){const _0x47e020=_0x1b3321(_0x1da2f3[_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+'\x27\x20exit\x20criteria');_0x47e020&&(_0x1da2f3['segmentId']=_0x47e020);}}if(_0x537798[_0x4208fb(0x277)]?.[_0x4208fb(0x200)]&&isPendingSegmentId(_0x537798[_0x4208fb(0x277)][_0x4208fb(0x200)])){const _0x3be31f=_0x1b3321(_0x537798[_0x4208fb(0x277)][_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+_0x4208fb(0x273));_0x3be31f&&(_0x537798[_0x4208fb(0x277)][_0x4208fb(0x200)]=_0x3be31f);}if(_0x537798[_0x4208fb(0x282)]){const _0x57db63=_0x1650d3=>_0x3a862e[_0x4208fb(0x1bf)][_0x4208fb(0x194)]?.[_0x4208fb(0x257)](_0x2149f0=>_0x2149f0[_0x4208fb(0x1bb)][_0x4208fb(0x252)]()===_0x537798[_0x4208fb(0x1bb)][_0x4208fb(0x252)]())?.[_0x4208fb(0x282)]?.[_0x1650d3];for(const _0x580850 of Object[_0x4208fb(0x1d4)](_0x537798[_0x4208fb(0x282)])){const _0x28d925=_0x537798[_0x4208fb(0x282)][_0x580850],_0x2ca26b=_0x57db63(_0x580850);if(_0x28d925[_0x4208fb(0x225)]===_0x4208fb(0x1f4)&&_0x28d925[_0x4208fb(0x27b)]&&(isPendingActivationId(_0x28d925[_0x4208fb(0x27b)])||_0x28d925[_0x4208fb(0x27b)]==='')){if(_0x2ca26b?.['journeyActivationStepId']&&isPendingActivationId(_0x2ca26b['journeyActivationStepId'])){const _0x377ff7=extractPendingActivationName(_0x2ca26b[_0x4208fb(0x27b)]),_0x36c5e7=_0x577393['get'](_0x377ff7);_0x36c5e7&&(_0x28d925['journeyActivationStepId']=_0x36c5e7);}}if(_0x28d925[_0x4208fb(0x225)]==='DecisionPoint'&&_0x28d925[_0x4208fb(0x23a)]&&_0x2ca26b?.['branches'])for(let _0x39d026=0x0;_0x39d026<_0x28d925[_0x4208fb(0x23a)]['length'];_0x39d026++){const _0x552548=_0x28d925[_0x4208fb(0x23a)][_0x39d026],_0x24be24=_0x2ca26b[_0x4208fb(0x23a)][_0x39d026];if(_0x24be24?.['segmentId']&&isPendingSegmentId(_0x24be24[_0x4208fb(0x200)])){const _0x3f1acd=_0x1b3321(_0x24be24[_0x4208fb(0x200)],_0x4208fb(0x249)+_0x537798[_0x4208fb(0x1bb)]+_0x4208fb(0x199)+(_0x552548['name']||_0x39d026)+'\x27');_0x3f1acd&&(_0x552548[_0x4208fb(0x200)]=_0x3f1acd);}}_0x28d925[_0x4208fb(0x225)]===_0x4208fb(0x1a8)&&_0x2ca26b?.['type']===_0x4208fb(0x1a8)&&resolveWaitStepPendingIds(_0x28d925,_0x2ca26b,_0x1b3321,_0x537798['name']);}}}}
|
|
1
|
+
const a175_0x2205f5=a175_0x3619;(function(_0x10e602,_0x42faac){const _0x4907f8=a175_0x3619,_0x5bd7e5=_0x10e602();while(!![]){try{const _0x3aa2b4=parseInt(_0x4907f8(0x153))/0x1+-parseInt(_0x4907f8(0x1a7))/0x2+-parseInt(_0x4907f8(0x19c))/0x3*(parseInt(_0x4907f8(0x13f))/0x4)+-parseInt(_0x4907f8(0x11d))/0x5*(-parseInt(_0x4907f8(0x16c))/0x6)+parseInt(_0x4907f8(0xe1))/0x7*(-parseInt(_0x4907f8(0x127))/0x8)+-parseInt(_0x4907f8(0x100))/0x9+parseInt(_0x4907f8(0x13d))/0xa*(parseInt(_0x4907f8(0xe8))/0xb);if(_0x3aa2b4===_0x42faac)break;else _0x5bd7e5['push'](_0x5bd7e5['shift']());}catch(_0x2d52f3){_0x5bd7e5['push'](_0x5bd7e5['shift']());}}}(a175_0x9f8a,0xb461f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a175_0x2205f5(0x199);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x55974d){return''+PENDING_SEGMENT_PREFIX+_0x55974d+'__';}export function isPendingSegmentId(_0x1ee879){const _0x27d742=a175_0x2205f5;return _0x1ee879[_0x27d742(0x120)](PENDING_SEGMENT_PREFIX)&&!_0x1ee879[_0x27d742(0x120)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x294f19){return _0x294f19['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x57699b){return''+PENDING_ACTIVATION_PREFIX+_0x57699b+'__';}export function isPendingActivationId(_0x1344ce){const _0xccaf08=a175_0x2205f5;return _0x1344ce[_0xccaf08(0x120)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1b5f21){const _0x4d4d3b=a175_0x2205f5;return _0x1b5f21[_0x4d4d3b(0x103)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x42b3e6,_0x402719){const _0x13c40f=a175_0x2205f5,_0x4c7692=_0x42b3e6+'::'+(_0x402719[_0x13c40f(0xee)]()||'segment'),_0x4789c4=createHash(_0x13c40f(0x137))['update'](_0x4c7692)[_0x13c40f(0x116)](_0x13c40f(0x10c))[_0x13c40f(0x1d1)](0x0,0xc);return _0x13c40f(0x193)+_0x4789c4;}export function ensureJourneyDefaults(_0x22931d){const _0x215cd9=a175_0x2205f5;!_0x22931d[_0x215cd9(0x135)]&&(_0x22931d['description']=''),!_0x22931d[_0x215cd9(0xe6)]&&(_0x22931d[_0x215cd9(0xe6)]=_0x215cd9(0x1a8));}export function injectExistingStageIds(_0x19a943,_0x11f7a6){const _0x526f95=a175_0x2205f5,_0x28f66c=new Map(_0x11f7a6[_0x526f95(0x12e)](_0x59a3c9=>[_0x59a3c9[_0x526f95(0x168)],_0x59a3c9['id']]));for(const _0x4a2050 of _0x19a943){if(!_0x4a2050['id']){const _0x3367eb=_0x28f66c[_0x526f95(0x1b0)](_0x4a2050['name']);_0x3367eb&&(_0x4a2050['id']=_0x3367eb);}}}export function resolveTDFolderPath(_0x28a3f6,_0x29a529,_0x3251aa){const _0x2985dd=a175_0x2205f5;if(!_0x29a529)return _0x28a3f6;if(_0x28a3f6===_0x3251aa||_0x28a3f6[_0x2985dd(0x120)](_0x3251aa+'/'))return _0x28a3f6;return _0x28a3f6?_0x3251aa+'/'+_0x28a3f6:_0x3251aa;}export function addFoldersToCreate(_0xc60942,_0x21e7b9,_0x1862f8){const _0xeaacba=a175_0x2205f5;if(!_0xc60942)return;if(_0x21e7b9[_0xeaacba(0x1b9)](_0xc60942))return;const _0x954e4=_0xc60942[_0xeaacba(0x148)]('/');let _0x4160be='';for(const _0x5014c8 of _0x954e4){_0x4160be=_0x4160be?_0x4160be+'/'+_0x5014c8:_0x5014c8,!_0x21e7b9[_0xeaacba(0x1b9)](_0x4160be)&&_0x1862f8[_0xeaacba(0x140)](_0x4160be);}}export function sortFoldersByDepth(_0xac043c){const _0x3aa7ca=a175_0x2205f5;return[..._0xac043c][_0x3aa7ca(0x114)]((_0x11c5e0,_0xe24357)=>{const _0x3fc143=_0x3aa7ca,_0x2b008e=(_0x11c5e0[_0x3fc143(0x1bf)](/\//g)||[])[_0x3fc143(0xe4)],_0x159146=(_0xe24357['match'](/\//g)||[])['length'];return _0x2b008e-_0x159146;});}import*as a175_0x12209f from'yaml';import{readFileSync}from'fs';import a175_0x32919d from'path';import{isJourneyDef,parseYamlString as a175_0x2951ba,toYamlString as a175_0x12068e,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0xb2a89c){const _0x5551bd=a175_0x2205f5;if(Array['isArray'](_0xb2a89c))return'['+_0xb2a89c[_0x5551bd(0x12e)](_0xcdbda0=>stableStringify(_0xcdbda0))['join'](',')+']';if(_0xb2a89c&&typeof _0xb2a89c===_0x5551bd(0x1d8)){const _0x120f90=_0xb2a89c,_0xd2b4e3=Object[_0x5551bd(0xd7)](_0x120f90)[_0x5551bd(0x114)](),_0x1ff93f=_0xd2b4e3[_0x5551bd(0x12e)](_0x2dda1a=>'\x22'+_0x2dda1a+'\x22:'+stableStringify(_0x120f90[_0x2dda1a]));return'{'+_0x1ff93f[_0x5551bd(0x112)](',')+'}';}const _0x2db374=JSON[_0x5551bd(0x17b)](_0xb2a89c);return _0x2db374===undefined?'null':_0x2db374;}function activationSignature(_0x4f0438){const _0x3a6958=a175_0x2205f5,_0x33043a={'connection':_0x4f0438[_0x3a6958(0x12a)],..._0x4f0438[_0x3a6958(0xea)]!==undefined&&{'all_columns':_0x4f0438[_0x3a6958(0xea)]},..._0x4f0438[_0x3a6958(0x125)]!==undefined&&{'columns':_0x4f0438[_0x3a6958(0x125)]},..._0x4f0438[_0x3a6958(0x157)]!==undefined&&{'behavior':_0x4f0438[_0x3a6958(0x157)]},..._0x4f0438[_0x3a6958(0x108)]!==undefined&&{'behaviors':_0x4f0438[_0x3a6958(0x108)]},..._0x4f0438[_0x3a6958(0xdb)]!==undefined&&{'schedule':_0x4f0438[_0x3a6958(0xdb)]},..._0x4f0438[_0x3a6958(0x19b)]!==undefined&&{'notification':_0x4f0438[_0x3a6958(0x19b)]},..._0x4f0438['connector_config']!==undefined&&{'connector_config':_0x4f0438[_0x3a6958(0x105)]},..._0x4f0438[_0x3a6958(0x12d)]!==undefined&&{'activation_template_id':_0x4f0438['activation_template_id']}};return stableStringify(_0x33043a);}async function fetchSegment(_0x32e28e,_0x4a5fca,_0x25a37d,_0x2ad296){const _0xbb7d6d=a175_0x2205f5,_0x2f8b97=_0x2ad296?.[_0xbb7d6d(0x14a)](_0xb9cf13=>_0xb9cf13['id']===_0x25a37d);if(_0x2f8b97)return _0x2f8b97;try{return await _0x32e28e[_0xbb7d6d(0x183)][_0xbb7d6d(0x115)](_0x4a5fca,_0x25a37d);}catch(_0x1a528d){logger['debug'](_0xbb7d6d(0x119)+_0x25a37d+_0xbb7d6d(0x138)+_0x1a528d);try{return await _0x32e28e[_0xbb7d6d(0x183)][_0xbb7d6d(0x1a5)](_0x25a37d);}catch(_0x6a7636){return logger[_0xbb7d6d(0x1a3)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x25a37d+':\x20'+_0x6a7636),null;}}}function recoverSegmentIdsFromPushRecovery(_0x46a246,_0x35f3f0,_0x30114b){const _0x558fac=a175_0x2205f5,_0x4cf06d=readPushRecovery(_0x46a246[_0x558fac(0x1b3)]);if(_0x4cf06d?.['journeyName']===_0x46a246[_0x558fac(0x198)][_0x558fac(0x168)])for(const [_0x1a97d9,_0x59ed7d]of Object['entries'](_0x4cf06d['segments'])){const _0x4563d0=generateDeterministicJourneySegmentName(_0x46a246[_0x558fac(0x198)][_0x558fac(0x168)],_0x1a97d9);_0x59ed7d['uniqueServerName']===_0x4563d0&&(_0x35f3f0['set'](_0x1a97d9,_0x59ed7d[_0x558fac(0x1bc)]),_0x30114b[_0x558fac(0x150)](_0x1a97d9,_0x59ed7d['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x101e85,_0xe6bf3b,_0x503f3c,_0x35dd1a){const _0x3c75ec=a175_0x2205f5;let _0x3decb4;try{_0x3decb4=await _0x101e85[_0x3c75ec(0x183)][_0x3c75ec(0x1cc)]({'name':_0x503f3c[_0x3c75ec(0x160)],'description':_0x503f3c[_0x3c75ec(0x135)],'journeyId':_0x503f3c[_0x3c75ec(0x1ce)],'rule':_0x35dd1a(_0x503f3c[_0x3c75ec(0x182)],!![]),'countPopulation':!![],'parentFolderId':_0x503f3c['folderId'],'audienceId':_0x503f3c['parentId']});}catch(_0x51e4eb){const _0x41dcaa=_0x51e4eb instanceof Error&&_0x51e4eb['message'][_0x3c75ec(0x169)]('Name\x20has\x20already\x20been\x20taken');if(_0x41dcaa){const _0x208114=readPushRecovery(_0xe6bf3b[_0x3c75ec(0x1b3)]),_0x5ae383=_0x208114?.['journeyName']===_0xe6bf3b[_0x3c75ec(0x198)][_0x3c75ec(0x168)]?_0x208114[_0x3c75ec(0x179)][_0x503f3c[_0x3c75ec(0xfe)]]:undefined;if(_0x5ae383?.[_0x3c75ec(0x173)]===_0x503f3c[_0x3c75ec(0x160)])await _0x101e85['segment'][_0x3c75ec(0xf7)](_0x503f3c[_0x3c75ec(0x130)],_0x5ae383[_0x3c75ec(0x1bc)],{'description':_0x503f3c[_0x3c75ec(0x135)],'rule':_0x35dd1a(_0x503f3c[_0x3c75ec(0x182)],!![]),'countPopulation':!![]}),_0x3decb4=_0x5ae383[_0x3c75ec(0x1bc)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],'Embedded\x20segment\x20\x27'+_0x503f3c[_0x3c75ec(0xfe)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x3c75ec(0x10b)+_0xe6bf3b[_0x3c75ec(0x1b3)]['replace'](/([^/]+)$/,_0x3c75ec(0x1a9))+')\x20')+_0x3c75ec(0x155),_0x51e4eb);}else throw _0x51e4eb;}return saveSegmentToPushRecovery(_0xe6bf3b[_0x3c75ec(0x1b3)],_0xe6bf3b[_0x3c75ec(0x198)]['name'],_0x503f3c[_0x3c75ec(0xfe)],{'segmentId':_0x3decb4,'uniqueServerName':_0x503f3c[_0x3c75ec(0x160)],'createdAt':new Date()[_0x3c75ec(0x1a4)]()}),_0x3decb4;}export async function prepareSegmentFiles(_0x311017,_0x5b6d94,_0xd2d363,_0x18d17f,_0x962890){const _0x22589c=a175_0x2205f5,{activationDefToCreateRequest:_0x5b8bb1}=await import(_0x22589c(0x16d)),_0x53081b=[],_0x30fe08=new Set();for(const {yamlConfig:_0x5606e4,folderPath:_0x586ae5,sourcePath:_0x1c8196}of _0x311017){const _0x51036a=resolveTDFolderPath(_0x586ae5,_0x18d17f,_0x962890),_0x14cd29=_0x51036a+':'+_0x5606e4[_0x22589c(0x168)],_0x1fee17=_0x5b6d94['segmentByFolderAndName'][_0x22589c(0x1b0)](_0x14cd29),_0x49285b=_0x1fee17?_0x5b6d94['activationsBySegmentId'][_0x22589c(0x1b0)](_0x1fee17['id'])||[]:[];addFoldersToCreate(_0x51036a,_0x5b6d94['folderPathToId'],_0x30fe08);const _0x34d647=calculateActivationActions(_0x5606e4[_0x22589c(0x113)]||[],_0x49285b,_0x5b6d94['idToEmailMap'],_0x5b6d94[_0x22589c(0x1ba)]);for(const _0x9d1846 of _0x34d647){(_0x9d1846[_0x22589c(0xd3)]===_0x22589c(0x12c)||_0x9d1846[_0x22589c(0xd3)]===_0x22589c(0x1c1))&&_0x9d1846[_0x22589c(0xd8)]&&(_0x9d1846[_0x22589c(0xf3)]=await _0x5b8bb1(_0x9d1846['yamlActivation'],_0xd2d363));}const _0x5166c7=calculateSegmentDiff(_0x5606e4,_0x1fee17,_0x49285b,_0x5b6d94[_0x22589c(0x1a2)],_0x5b6d94[_0x22589c(0x1ba)]);_0x53081b[_0x22589c(0x151)]({'relativePath':_0x5606e4['name'],'absolutePath':_0x1c8196,'yamlConfig':_0x5606e4,'folderPath':_0x51036a,'existingSegment':_0x1fee17,'existingActivations':_0x49285b,'isNew':_0x5166c7[_0x22589c(0xff)],'hasChanges':_0x5166c7['hasChanges'],'diff':_0x5166c7['diff'],'activationActions':_0x34d647});}return{'segmentFiles':_0x53081b,'foldersToCreate':_0x30fe08};}export async function prepareJourneyFiles(_0x16de6a,_0x2a47a7,_0x521e02,_0x2e1de6){const _0x4c053a=a175_0x2205f5,_0x29eb0b=[],_0x1a27e1=new Set();for(const {yamlConfig:_0x146a61,folderPath:_0xd1f446,sourcePath:_0x3a63dc}of _0x16de6a){const _0xaf7b2b=resolveTDFolderPath(_0xd1f446,_0x521e02,_0x2e1de6),_0x3762cd=_0xaf7b2b+':'+_0x146a61[_0x4c053a(0x168)],_0x13c3b4=_0x2a47a7[_0x4c053a(0xd2)][_0x4c053a(0x1b0)](_0x3762cd);let _0x518df9,_0xd7acf5;if(_0x13c3b4&&_0x13c3b4[_0x4c053a(0xe4)]>0x0){const _0x3f1bb8=buildLocalExpandedRuleMappings(_0x146a61),{createYamlContext:_0x1aedc8,prefetchJourneySegments:_0x32295d}=createPushYamlContextForBundle(_0x2a47a7[_0x4c053a(0x132)],_0x2a47a7[_0x4c053a(0x130)],_0x2a47a7[_0x4c053a(0x165)],_0x3f1bb8,_0x2a47a7[_0x4c053a(0x1a2)],_0x2a47a7[_0x4c053a(0x1ba)],_0x2a47a7[_0x4c053a(0x111)],_0x2a47a7[_0x4c053a(0x10f)]);await _0x32295d(_0x13c3b4[_0x4c053a(0x12e)](_0x37bc8e=>_0x37bc8e['id']));const _0x5402fc=await _0x2a47a7[_0x4c053a(0x132)][_0x4c053a(0x16b)][_0x4c053a(0x154)](_0x13c3b4[0x0][_0x4c053a(0x191)]),_0x59f203=hasMultipleVersions(_0x146a61),_0x4c875a=async _0x3a82d3=>{const _0x4a22b9=_0x4c053a,_0x48c7f9=_0x2a47a7[_0x4a22b9(0x10f)]?.[_0x4a22b9(0x1b0)](_0x3a82d3);if(_0x48c7f9)return _0x48c7f9;return _0x2a47a7[_0x4a22b9(0x123)]({'journeyId':_0x3a82d3,'journeyName':_0x146a61[_0x4a22b9(0x168)],'isMultiVersion':_0x13c3b4['length']>0x1});};if(_0x59f203&&_0x13c3b4['length']>0x1){const _0x1f4171=[];for(const _0x4c6869 of _0x13c3b4){const _0x46d44a=_0x4c6869[_0x4c053a(0x17a)]||0x1;_0x2a47a7[_0x4c053a(0x109)]?.[_0x4c053a(0x1c1)]('Fetching\x20'+_0x146a61['name']+'\x20v'+_0x46d44a);const _0x27cee3=await _0x4c875a(_0x4c6869['id']),_0x524f36=_0x1aedc8(_0x4c6869['id']),_0x39abd2=await journeyResponseToDef(_0x27cee3,_0x524f36);_0x1f4171['push']({'item':_0x4c6869,'yaml':_0x39abd2});}const _0x5b9d47=buildLocalRuleToNameMappingFromJourney(_0x146a61);_0xd7acf5=buildMergedJourneyDef(_0x1f4171,_0x5b9d47,_0x5402fc);const _0x5608a4=Math[_0x4c053a(0x149)](..._0x1f4171['map'](_0x2e01ff=>_0x2e01ff[_0x4c053a(0x13c)][_0x4c053a(0x17a)]||0x0)),_0x5523aa=_0x13c3b4[_0x4c053a(0x14a)](_0x1fc4b4=>(_0x1fc4b4[_0x4c053a(0x17a)]||0x0)===_0x5608a4);_0x5523aa&&(_0x2a47a7['progress']?.[_0x4c053a(0x1c1)](_0x4c053a(0x1ac)+_0x146a61[_0x4c053a(0x168)]+'\x20v'+_0x5608a4),_0x518df9=await _0x4c875a(_0x5523aa['id']));}else{const _0x5838d4=_0x13c3b4[_0x13c3b4['length']-0x1];_0x2a47a7['progress']?.[_0x4c053a(0x1c1)](_0x4c053a(0x1ac)+_0x146a61[_0x4c053a(0x168)]),_0x518df9=await _0x4c875a(_0x5838d4['id']);const _0x4c7a2d=_0x1aedc8(_0x5838d4['id']),_0x37a8c5=await journeyResponseToDef(_0x518df9,_0x4c7a2d),_0x5b4909=buildLocalRuleToNameMappingFromJourney(_0x146a61);_0xd7acf5=buildMergedJourneyDef([{'item':_0x5838d4,'yaml':_0x37a8c5}],_0x5b4909,_0x5402fc);}}addFoldersToCreate(_0xaf7b2b,_0x2a47a7[_0x4c053a(0xdd)],_0x1a27e1);const _0x4f5d4c=calculateJourneyDiff(_0x146a61,_0xd7acf5);_0x29eb0b['push']({'relativePath':_0x146a61[_0x4c053a(0x168)],'absolutePath':_0x3a63dc,'yamlConfig':_0x146a61,'folderPath':_0xaf7b2b,'existingJourney':_0x518df9,'isNew':_0x4f5d4c[_0x4c053a(0xff)],'hasChanges':_0x4f5d4c[_0x4c053a(0x1b1)],'diff':_0x4f5d4c[_0x4c053a(0xd5)]});}return{'journeyFiles':_0x29eb0b,'foldersToCreate':_0x1a27e1};}export function calculateActivationActions(_0xddcbc2,_0x27e0a9,_0x3e5ce2,_0x9c981c){const _0xf664d8=a175_0x2205f5,_0x3a8f0f=[],_0x1ce6e0=new Map();for(const _0x27fac5 of _0x27e0a9){_0x1ce6e0[_0xf664d8(0x150)](_0x27fac5[_0xf664d8(0x168)],_0x27fac5);}const _0x44782e=new Map();for(const _0x5be77b of _0xddcbc2){_0x44782e[_0xf664d8(0x150)](_0x5be77b[_0xf664d8(0x168)],_0x5be77b);}for(const _0x4ccfa3 of _0xddcbc2){const _0xa08013=_0x1ce6e0[_0xf664d8(0x1b0)](_0x4ccfa3[_0xf664d8(0x168)]);if(!_0xa08013)_0x3a8f0f[_0xf664d8(0x151)]({'type':_0xf664d8(0x12c),'name':_0x4ccfa3[_0xf664d8(0x168)],'yamlActivation':_0x4ccfa3});else{const _0x9a892e=activationResponseToDef(_0xa08013,_0x3e5ce2,_0x9c981c),_0x239920=a175_0x12209f['stringify'](_0x9a892e),_0x5c8c44=a175_0x12209f[_0xf664d8(0x17b)](_0x4ccfa3);_0x239920!==_0x5c8c44&&_0x3a8f0f[_0xf664d8(0x151)]({'type':'update','name':_0x4ccfa3[_0xf664d8(0x168)],'yamlActivation':_0x4ccfa3,'existingActivation':_0xa08013});}}for(const _0x18866b of _0x27e0a9){!_0x44782e[_0xf664d8(0x1b9)](_0x18866b['name'])&&_0x3a8f0f[_0xf664d8(0x151)]({'type':_0xf664d8(0x161),'name':_0x18866b[_0xf664d8(0x168)],'existingActivation':_0x18866b});}return _0x3a8f0f;}function calculateYamlDiff(_0x11cf64,_0x32e3ed){if(_0x32e3ed){const _0x430d97=generateDiff(_0x32e3ed,_0x11cf64),_0x3dcfb3=hasChanges(_0x430d97);return{'isNew':![],'hasChanges':_0x3dcfb3,'diff':_0x3dcfb3?formatDiffWithColors(_0x430d97):undefined};}const _0x3fbb33=generateDiff('',_0x11cf64);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3fbb33)};}export function calculateSegmentDiff(_0x2a332d,_0x5f0eaa,_0x5da4f1,_0x2d3f7a,_0x3ef300){const _0x92727f=segmentToYamlString(_0x2a332d),_0x18b0ef=_0x5f0eaa?segmentToYamlString(segmentWithActivationsToYaml(_0x5f0eaa,_0x5da4f1,undefined,_0x2d3f7a,_0x3ef300)):undefined;return calculateYamlDiff(_0x92727f,_0x18b0ef);}export function calculateJourneyDiff(_0x23ff58,_0x4bff19){const _0x2dd861=normalizeJourneyDef(_0x23ff58,_0x23ff58),_0x334534=a175_0x12068e(_0x2dd861),_0x50a7f2=_0x4bff19?a175_0x12068e(normalizeJourneyDef(_0x4bff19,_0x23ff58)):undefined;return calculateYamlDiff(_0x334534,_0x50a7f2);}export function findSegmentsToDelete(_0x2b3ed7,_0x302c1d,_0x4e5e58,_0x4772af,_0x5e4959){const _0x638324=a175_0x2205f5,_0x35c652=new Set();for(const {yamlConfig:_0x25031e,folderPath:_0x48d496}of _0x302c1d){_0x35c652[_0x638324(0x140)](_0x48d496+':'+_0x25031e[_0x638324(0x168)]);}return _0x2b3ed7[_0x638324(0xdc)](_0x24c43a=>{const _0x300522=_0x638324,_0x4b5398=_0x24c43a[_0x300522(0xf8)]?_0x4e5e58[_0x300522(0x1b0)](_0x24c43a[_0x300522(0xf8)][_0x300522(0xf1)]())||'':'',_0x375501=_0x4b5398+':'+_0x24c43a[_0x300522(0x168)];if(_0x35c652[_0x300522(0x1b9)](_0x375501))return![];if(_0x5e4959)return _0x4b5398===_0x4772af||_0x4b5398['startsWith'](_0x4772af+'/');return!![];});}export function findJourneysToDelete(_0x391fb5,_0x1d0b8c,_0x175ef5,_0x55364e,_0x3dea0b){const _0x5c0ecd=a175_0x2205f5,_0xf85b62=new Set();for(const {yamlConfig:_0x54cbc5,folderPath:_0x2fa121}of _0x1d0b8c){_0xf85b62[_0x5c0ecd(0x140)](_0x2fa121+':'+_0x54cbc5[_0x5c0ecd(0x168)]);}return _0x391fb5[_0x5c0ecd(0xdc)](_0x557090=>{const _0x9c35a1=_0x5c0ecd,_0x384dce=_0x557090[_0x9c35a1(0x104)]?_0x175ef5['get'](_0x557090[_0x9c35a1(0x104)])||'':'',_0x33ba0c=_0x384dce+':'+_0x557090[_0x9c35a1(0x174)];if(_0xf85b62[_0x9c35a1(0x1b9)](_0x33ba0c))return![];if(_0x3dea0b)return _0x384dce===_0x55364e||_0x384dce[_0x9c35a1(0x120)](_0x55364e+'/');return!![];});}export function buildSegmentLookupMap(_0x4cb853,_0x2a415a){const _0x5d43f4=a175_0x2205f5,_0x558e4c=new Map();for(const _0x4f4ff2 of _0x4cb853){const _0x50fad7=_0x4f4ff2[_0x5d43f4(0xf8)]?_0x2a415a['get'](_0x4f4ff2[_0x5d43f4(0xf8)]['toString']())||'':'',_0x291257=_0x50fad7+':'+_0x4f4ff2['name'];_0x558e4c['set'](_0x291257,_0x4f4ff2);}return _0x558e4c;}export function buildSegmentNameToIdMap(_0x3c4016){const _0x2c4e35=a175_0x2205f5,_0x47cc77=new Map();for(const _0x384591 of _0x3c4016){_0x47cc77[_0x2c4e35(0x150)](_0x384591[_0x2c4e35(0x168)],_0x384591['id']);}return _0x47cc77;}export function buildJourneyBundleLookupMap(_0xd4f350,_0x57dea0){const _0x40a903=a175_0x2205f5,_0x54087e=new Map();for(const _0x418b2a of _0xd4f350){const _0x234e24=_0x418b2a['folderId']?_0x57dea0[_0x40a903(0x1b0)](_0x418b2a[_0x40a903(0x104)])||'':'',_0x322e95=_0x234e24+':'+_0x418b2a[_0x40a903(0x174)];!_0x54087e[_0x40a903(0x1b9)](_0x322e95)&&_0x54087e['set'](_0x322e95,[]),_0x54087e[_0x40a903(0x1b0)](_0x322e95)[_0x40a903(0x151)](_0x418b2a);}for(const _0x4ac7c2 of _0x54087e[_0x40a903(0x141)]()){_0x4ac7c2[_0x40a903(0x114)]((_0x53f028,_0x34a074)=>(_0x53f028['versionNumber']||0x0)-(_0x34a074[_0x40a903(0x17a)]||0x0));}return _0x54087e;}export function collectFoldersToCreate(_0x3786e7,_0x461fd3){const _0x5e1e87=a175_0x2205f5,_0x35ea35=new Set();for(const _0x468c11 of _0x3786e7){if(!_0x468c11)continue;if(_0x461fd3[_0x5e1e87(0x1b9)](_0x468c11))continue;const _0x3f8da7=_0x468c11[_0x5e1e87(0x148)]('/');let _0x108f3a='';for(const _0x5820c3 of _0x3f8da7){_0x108f3a=_0x108f3a?_0x108f3a+'/'+_0x5820c3:_0x5820c3,!_0x461fd3[_0x5e1e87(0x1b9)](_0x108f3a)&&_0x35ea35['add'](_0x108f3a);}}return _0x35ea35;}export function parseAndClassifyYamlFiles(_0x188fb6,_0x40d50f,_0x346035){const _0x545a7d=a175_0x2205f5,_0x2984e6=[],_0x47b452=[];for(const _0x29b014 of _0x188fb6){const _0x4026cf=a175_0x32919d['relative'](_0x40d50f,a175_0x32919d[_0x545a7d(0x1b2)](_0x29b014)),_0x32d231=_0x4026cf==='.'?'':_0x4026cf['replace'](/\\/g,'/'),_0x10550a=readFileSync(_0x29b014,_0x545a7d(0x1d3)),_0x365cbb=a175_0x12209f[_0x545a7d(0x189)](_0x10550a);if(isJourneyDef(_0x365cbb,_0x29b014)){const _0x158d74=a175_0x2951ba(_0x10550a);_0x47b452[_0x545a7d(0x151)]({'yamlConfig':_0x158d74,'folderPath':_0x32d231,'sourcePath':_0x29b014});}else{if(!_0x346035?.[_0x545a7d(0x19d)]){const _0x322340=parseSegmentYamlFile(_0x10550a),_0x5ed1a2=normalizeChildSegmentYaml(_0x322340);_0x2984e6[_0x545a7d(0x151)]({'yamlConfig':_0x5ed1a2,'folderPath':_0x32d231,'sourcePath':_0x29b014});}}}return{'segments':_0x2984e6,'journeys':_0x47b452};}export function validateParsedFiles(_0x14c15b,_0x1e4763){const _0x379eba=a175_0x2205f5,_0x44f2d4=[];for(const {yamlConfig:_0x30124a,sourcePath:_0x28e461}of _0x14c15b[_0x379eba(0x179)]){const _0x1cda53=readFileSync(_0x28e461,_0x379eba(0x1d3)),_0x38bb68=a175_0x12209f[_0x379eba(0x1b8)](_0x1cda53),_0x2f5691=validateSegmentDef(_0x30124a,{'source':_0x1cda53,'document':_0x38bb68},{'skipSchema':!![]});if(!_0x2f5691[_0x379eba(0x163)]){const _0x56dd07=a175_0x32919d['relative'](_0x1e4763,_0x28e461);_0x44f2d4[_0x379eba(0x151)]({'filePath':_0x56dd07,'source':_0x1cda53,'result':_0x2f5691,'isJourney':![]});}}for(const {yamlConfig:_0x1a6574,sourcePath:_0x5827b6}of _0x14c15b[_0x379eba(0x147)]){const _0x3e5c2d=readFileSync(_0x5827b6,'utf-8'),_0xb9a20e=a175_0x12209f[_0x379eba(0x1b8)](_0x3e5c2d),_0x4353ca=validateJourneyDef(_0x1a6574,{'source':_0x3e5c2d,'document':_0xb9a20e},{'skipSchema':!![]});if(!_0x4353ca[_0x379eba(0x163)]){const _0x486f80=a175_0x32919d[_0x379eba(0xf2)](_0x1e4763,_0x5827b6);_0x44f2d4[_0x379eba(0x151)]({'filePath':_0x486f80,'source':_0x3e5c2d,'result':_0x4353ca,'isJourney':!![]});}}return _0x44f2d4;}function a175_0x9f8a(){const _0x2a5d8f=['segment_deleted','some','journeyBundlesByFolderAndName','type','deleteActivation','diff','embedded_segment_created','keys','yamlActivation','rootFolderId','getJourney','schedule','filter','folderPathToId','entry','Failed\x20to\x20','steps','5064353XISFIf','getActivation','index','length','conditions','state','Created\x20activation\x20\x27','11sOCwgB','segment_created','all_columns','toLowerCase','embedded_activation_creating','existingSegment','trim','journeyActivationNameToId','waitStepType','toString','relative','validatedRequest','Updated\x20segment\x20\x27','waitStepUnit','size','updateSegmentById','segmentFolderId','activationParams','Journey\x20\x27','Deleted\x20segment\x20\x27','entry_criteria','createdSegmentId','localName','isNew','8066907JoruZR','Entry\x20criteria:\x20','nameToId','replace','folderId','connector_config','\x27\x20wait\x20condition','existingActivation','behaviors','progress','\x0a\x20\x20','Delete\x20the\x20push\x20recovery\x20file\x20(','hex','./journey-yaml.js','run_after_journey_refresh','journeyById','data','activationStepsById','join','activations','sort','getSegment','digest','journey_created','withProgress','getSegment\x20failed\x20for\x20','NOT_FOUND','activation_created','Activation\x20not\x20found:\x20','6538115IqEnDG','Creating\x20folder\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','startsWith','Failed\x20to\x20resolve\x20activation\x20','conditionSegmentId','fetchJourney','action','columns','embedded_activation_created','16lqDJJV','kind','verbose','connection','entries','create','activation_template_id','map','DecisionPoint','parentId','conditionTimeoutUnit','deps','rule','Updated\x20journey\x20\x27','description','\x27\x20to\x20local\x20\x27','sha1',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','Activation','\x27\x20by\x20rule\x20content','stage\x20\x27','item','28976270WmENNp','Creating\x20segment\x20\x27','3936dhwfDc','add','values','\x27\x20entry\x20criteria','logInfo','waitStep','journeyActivationStepId','reduce','journeys','split','max','find','branches','createActivation','JOURNEY_SYNTAX_ERROR','Segment\x20not\x20found:\x20','listActivations','set','push','nameToType','589474TVSjPK','getLatestJourneyId','and\x20the\x20server\x20segment,\x20then\x20retry.','deleted','behavior','\x27...','createdSegmentIds','activation_updating','Condition','folder','activationActions','resolveSegment','Updated\x20activation\x20\x27','uniqueSegmentName','delete','logSuccess','valid','exitCriterias','existingSegments','goal','from','name','includes','journey_updated','journey','6fAznwj','./child-segment-yaml.js','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','existingJourney','updated','Updating\x20activation\x20\x27','goal\x20criteria','uniqueServerName','journeyBundleName','ACTIVATION_SYNTAX_ERROR','segment_updating','results','segment_creating','segments','versionNumber','stringify','user','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','segment_deleting','unchanged','list','logWarning','resolvedRule','segment','relationships','logDeleted','milestone','folderPath','WaitStep','parse','\x27\x20from\x20file:\x20','created','entryCriteria','createSegment','with','Failed\x20to\x20resolve\x20segment\x20','Created\x20segment\x20\x27','journeyBundleId','SEGMENT_NOT_FOUND','journey_entry_criteria_','Deleted\x20activation\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journey_creating','segment_updated','yamlConfig','__pending_','segmentNameToId','notification','4020MrawPi','skipSegments','Deleting\x20activation\x20\x27','deleteSegment','\x27\x20milestone','decision_point','idToEmailMap','debug','toISOString','getSegmentEntity','conditionTimeoutDuration','788072VjvzNP','draft','.$1.push-recovery.json','buildUserMaps','\x20(referenced\x20in\x20journey\x20','Fetching\x20','activation_deleting','../../utils/async.js','\x27\x20decision\x20point\x20branch\x20\x27','get','hasChanges','dirname','absolutePath','all',').\x20','parentFolder','):\x20','parseDocument','has','connectionIdToNameMap','\x20segment\x20from\x20file:\x20','segmentId','journey_updating','journeyStages','match','idToName','update','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','SEGMENT_UPDATE_ERROR','onProgress','\x20activation\x20\x27','Stage\x20\x27','INTERNAL','\x27\x20exit\x20criteria','attributes','embedded_segment_creating','Segment\x20not\x20found','createJourneySegment','effectiveFolderId','journeyId','stages','Created\x20journey\x20\x27','slice','JOURNEY_UPDATE_ERROR','utf-8','SEGMENT_SYNTAX_ERROR','activationContext','createFolder','ACTIVATION_UPDATE_ERROR','object','\x27\x20not\x20found\x20in\x20journey\x20\x27'];a175_0x9f8a=function(){return _0x2a5d8f;};return a175_0x9f8a();}export function formatValidationErrors(_0x4d354d){const _0x4b95a9=a175_0x2205f5,_0x305670=[];for(const {filePath:_0x321a31,source:_0x91e49a,result:_0x3adabc,isJourney:_0x56b0d9}of _0x4d354d){const _0x598864=_0x56b0d9?_0x4b95a9(0x16b):_0x4b95a9(0x183);_0x305670[_0x4b95a9(0x151)]('\x0a'+_0x321a31+'\x20('+_0x598864+_0x4b95a9(0x1b7)+_0x3adabc['errors']['length']+'\x20error(s)'),_0x305670[_0x4b95a9(0x151)](formatValidationResult(_0x3adabc,_0x91e49a,_0x321a31));}return _0x305670[_0x4b95a9(0x112)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x31cafb){const _0x593d32=a175_0x2205f5,_0x3a1479=new Set(),_0x405136=new Map(),_0x36011c=collectSegmentUsageCounts(_0x31cafb);if(_0x31cafb[_0x593d32(0x179)])for(const [_0x26069e,_0x51036e]of Object[_0x593d32(0x12b)](_0x31cafb[_0x593d32(0x179)])){_0x3a1479[_0x593d32(0x140)](_0x26069e);if(_0x51036e['rule']){const _0x5737fc=yamlRuleToApi(_0x51036e[_0x593d32(0x133)]),_0x19acf7=apiRuleToYaml(_0x5737fc);_0x405136[_0x593d32(0x150)](_0x26069e,_0x19acf7);}}const _0x53a8bf=new Map();let _0x3acede=0x0;for(const [_0x3c796b,_0x57122c]of _0x405136){const _0x44ed30=serializeExpandedRule(_0x57122c,_0x405136),_0x31bd92=_0x53a8bf[_0x593d32(0x1b0)](_0x44ed30)||[];_0x31bd92[_0x593d32(0x151)]({'name':_0x3c796b,'index':_0x3acede}),_0x53a8bf['set'](_0x44ed30,_0x31bd92),_0x3acede++;}const _0x1bad88=new Map();for(const [_0x145be0,_0x2c3c1d]of _0x53a8bf){const _0x303e45=_0x2c3c1d[_0x593d32(0x1d1)]()[_0x593d32(0x114)]((_0x44e7e6,_0x41292b)=>{const _0x5f3dc9=_0x593d32,_0xd677a3=_0x36011c[_0x5f3dc9(0x1b0)](_0x44e7e6[_0x5f3dc9(0x168)])||0x0,_0xa42f9d=_0x36011c[_0x5f3dc9(0x1b0)](_0x41292b[_0x5f3dc9(0x168)])||0x0;if(_0xd677a3!==_0xa42f9d)return _0xa42f9d-_0xd677a3;return _0x44e7e6['index']-_0x41292b[_0x5f3dc9(0xe3)];})[_0x593d32(0x12e)](_0x2bcdd2=>_0x2bcdd2[_0x593d32(0x168)]),_0xcd3919=[];for(const _0x79aac6 of _0x303e45){const _0x40abb7=_0x36011c[_0x593d32(0x1b0)](_0x79aac6)||0x0,_0x8493a0=Math['max'](_0x40abb7,0x1);for(let _0x485d84=0x0;_0x485d84<_0x8493a0;_0x485d84++){_0xcd3919['push'](_0x79aac6);}}_0x1bad88[_0x593d32(0x150)](_0x145be0,_0xcd3919);}return{'existingLocalSegmentNames':_0x3a1479,'localSegmentRules':_0x405136,'localExpandedRuleToNames':_0x1bad88};}export function createSegmentIdResolver(_0x516a6d,_0x2a57a0){return async _0x47b74d=>{const _0x1040fa=a175_0x3619,_0x5da8e2=_0x516a6d['get'](_0x47b74d);if(!_0x5da8e2)throw new SDKError(ErrorCode[_0x1040fa(0x192)],'Segment\x20not\x20found:\x20'+_0x47b74d+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x2a57a0+'\x27)');return _0x5da8e2;};}export function extractRootFolderId(_0xe7af7d){const _0x2c8d9a=a175_0x2205f5;return _0xe7af7d[_0x2c8d9a(0x184)]?.['parentSegmentFolder']?.[_0x2c8d9a(0x110)]?.['id']||_0xe7af7d[_0x2c8d9a(0x184)]?.[_0x2c8d9a(0x1b6)]?.[_0x2c8d9a(0x110)]?.['id'];}export function buildConnectionMaps(_0x362dce){const _0x479213=a175_0x2205f5,_0x143b35=new Map(),_0x30f98e=new Map(),_0x3386e5=new Map();for(const _0xe6e2f9 of _0x362dce){_0x143b35[_0x479213(0x150)](_0xe6e2f9[_0x479213(0x168)],parseInt(_0xe6e2f9['id'],0xa)),_0x30f98e[_0x479213(0x150)](_0xe6e2f9['id'],_0xe6e2f9[_0x479213(0x168)]),_0x3386e5['set'](_0xe6e2f9[_0x479213(0x168)],_0xe6e2f9[_0x479213(0xd3)]);}return{'nameToId':_0x143b35,'idToName':_0x30f98e,'nameToType':_0x3386e5};}export function calculatePushStats(_0x285e39,_0x5cbee6,_0x784a97,_0x2b28f8,_0x3b70d1,_0x520be9,_0x31d962){const _0x5ab4eb=a175_0x2205f5,_0x234b45=_0x285e39['filter'](_0x2f2d42=>_0x2f2d42[_0x5ab4eb(0xff)]),_0x2083b6=_0x285e39[_0x5ab4eb(0xdc)](_0x346b0b=>!_0x346b0b[_0x5ab4eb(0xff)]&&_0x346b0b[_0x5ab4eb(0x1b1)]),_0x392b51=_0x285e39[_0x5ab4eb(0xdc)](_0x3eb578=>!_0x3eb578[_0x5ab4eb(0xff)]&&!_0x3eb578['hasChanges']),_0x185d99=_0x520be9?_0x2b28f8:[],_0x2a2be1=_0x5cbee6[_0x5ab4eb(0xdc)](_0x4029e5=>_0x4029e5[_0x5ab4eb(0xff)]),_0x3a198e=_0x5cbee6[_0x5ab4eb(0xdc)](_0xd22d22=>!_0xd22d22['isNew']&&_0xd22d22[_0x5ab4eb(0x1b1)]),_0x479923=_0x5cbee6[_0x5ab4eb(0xdc)](_0x32ee44=>!_0x32ee44[_0x5ab4eb(0xff)]&&!_0x32ee44[_0x5ab4eb(0x1b1)]),_0x3fe650=_0x520be9?_0x3b70d1:[],_0x1039f1=_0x285e39['flatMap'](_0x37ffe0=>_0x37ffe0[_0x5ab4eb(0x15d)]),_0x3c731c=_0x1039f1[_0x5ab4eb(0xdc)](_0x49a461=>_0x49a461[_0x5ab4eb(0xd3)]===_0x5ab4eb(0x12c)),_0x4ec3b7=_0x1039f1[_0x5ab4eb(0xdc)](_0x1e512f=>_0x1e512f[_0x5ab4eb(0xd3)]==='update'),_0x1bc0c4=_0x1039f1[_0x5ab4eb(0xdc)](_0x3338b2=>_0x3338b2[_0x5ab4eb(0xd3)]===_0x5ab4eb(0x161)),_0x2eeae8=Array[_0x5ab4eb(0x167)](_0x784a97)[_0x5ab4eb(0x114)](),_0x219457=_0x31d962?![]:_0x234b45[_0x5ab4eb(0xe4)]>0x0||_0x2083b6[_0x5ab4eb(0xe4)]>0x0||_0x185d99[_0x5ab4eb(0xe4)]>0x0,_0x3ccac9=_0x2a2be1[_0x5ab4eb(0xe4)]>0x0||_0x3a198e[_0x5ab4eb(0xe4)]>0x0||_0x3fe650[_0x5ab4eb(0xe4)]>0x0,_0x17ff9a=_0x31d962?![]:_0x1039f1[_0x5ab4eb(0xe4)]>0x0,_0x4cbcf2=_0x2eeae8[_0x5ab4eb(0xe4)]>0x0;return{'segments':{'new':_0x234b45,'changed':_0x2083b6,'unchanged':_0x392b51,'toDelete':_0x185d99},'journeys':{'new':_0x2a2be1,'changed':_0x3a198e,'unchanged':_0x479923,'toDelete':_0x3fe650},'activations':{'all':_0x1039f1,'toCreate':_0x3c731c,'toUpdate':_0x4ec3b7,'toDelete':_0x1bc0c4},'folders':{'toCreate':_0x2eeae8},'counts':{'segments':{'new':_0x234b45[_0x5ab4eb(0xe4)],'changed':_0x2083b6[_0x5ab4eb(0xe4)],'unchanged':_0x392b51[_0x5ab4eb(0xe4)],'toDelete':_0x185d99['length']},'journeys':{'new':_0x2a2be1[_0x5ab4eb(0xe4)],'changed':_0x3a198e[_0x5ab4eb(0xe4)],'unchanged':_0x479923[_0x5ab4eb(0xe4)],'toDelete':_0x3fe650[_0x5ab4eb(0xe4)]},'activations':{'create':_0x3c731c[_0x5ab4eb(0xe4)],'update':_0x4ec3b7[_0x5ab4eb(0xe4)],'delete':_0x1bc0c4[_0x5ab4eb(0xe4)]},'folders':_0x2eeae8[_0x5ab4eb(0xe4)]},'hasChanges':_0x219457||_0x3ccac9||_0x17ff9a||_0x4cbcf2};}export async function buildPushExecutionContext(_0x46a7ba,_0x2eb3a1,_0x1ad83d,_0x2c8060,_0x52c88f,_0x24f1bc){const _0x5f383e=a175_0x2205f5,_0x46e8b7=extractRootFolderId(_0x1ad83d),{pathToId:_0x2cf279,idToPath:_0x4586ab}=buildFolderMaps(_0x52c88f),_0x2d56c9=buildSegmentNameToIdMap(_0x2c8060),_0x2efb0e=new Map(),{batchAsync:_0x21823e}=await import(_0x5f383e(0x1ae)),[_0x362f21,_0x45c601]=await Promise[_0x5f383e(0x1b4)]([_0x46a7ba[_0x5f383e(0x17c)][_0x5f383e(0x1aa)](),_0x46a7ba[_0x5f383e(0x12a)][_0x5f383e(0x180)](),((async()=>{const _0xcbc5c3=_0x5f383e;!_0x24f1bc&&_0x2c8060[_0xcbc5c3(0xe4)]>0x0&&await _0x21823e(_0x2c8060,async _0xe50d61=>{const _0x1affd3=_0xcbc5c3,_0x2bb0fc=await _0x46a7ba[_0x1affd3(0x183)][_0x1affd3(0x14f)](_0x2eb3a1,_0xe50d61['id']);_0x2efb0e[_0x1affd3(0x150)](_0xe50d61['id'],_0x2bb0fc);});})())]),{emailToId:_0x4288e5,idToEmail:_0x210f59}=_0x362f21,_0x46618b=buildConnectionMaps(_0x45c601);return{'rootFolderId':_0x46e8b7,'folderPathToId':_0x2cf279,'folderIdToPath':_0x4586ab,'segmentNameToId':_0x2d56c9,'activationsBySegmentId':_0x2efb0e,'emailToIdMap':_0x4288e5,'idToEmailMap':_0x210f59,'connectionNameToIdMap':_0x46618b[_0x5f383e(0x102)],'connectionIdToNameMap':_0x46618b[_0x5f383e(0x1c0)],'connectionNameToTypeMap':_0x46618b[_0x5f383e(0x152)]};}export function createPushYamlContextForBundle(_0x420bff,_0x341716,_0x376df7,_0x2b551e,_0x12a582,_0x37d4f7,_0x1b92c9,_0x272004){const {existingLocalSegmentNames:_0x1ba3d0,localExpandedRuleToNames:_0xcba0a8}=_0x2b551e,_0xaf2795=new Set(),_0x9c150=new Map(),_0x476915=new Map(),_0x1ee10c=new Map(),_0x50de49=createJumpTargetCache(),_0x6a4ca8=new Map(),_0xb4b2cd=new Map(),_0xde2417=new Set();let _0x250259;const _0x4dd1f9=_0xaae6a7=>{const _0x3e36eb={'resolveSegment':async _0x10a774=>{const _0x39d11e=a175_0x3619,_0x1067ce=_0x1ee10c['get'](_0x10a774);if(_0x1067ce!==undefined)return{'name':_0x1067ce,'isJourneyLocal':!![]};try{const _0x511310=await fetchSegment(_0x420bff,_0x341716,_0x10a774,_0x376df7);if(!_0x511310)throw new Error(_0x39d11e(0x1cb));const _0x158496=generateJourneyLocalName(_0x511310['name']),_0x55cc98=_0x511310[_0x39d11e(0x128)]===SEGMENT_KIND_JOURNEY&&_0x158496!==undefined;let _0x992ef=_0x511310[_0x39d11e(0x168)],_0x27eee7;if(_0x55cc98&&_0x511310[_0x39d11e(0x133)]){const _0x312492=apiRuleToYaml(_0x511310['rule']);_0xb4b2cd['set'](_0x10a774,_0x312492);const _0xc26a3d=async _0x2f65cf=>{const _0x3dc61d=_0x39d11e,_0x506d0f=collectSegmentRefsFromRule(_0x2f65cf);for(const _0x35f978 of _0x506d0f){if(!_0xb4b2cd['has'](_0x35f978))try{const _0x45737e=await fetchSegment(_0x420bff,_0x341716,_0x35f978,_0x376df7);if(_0x45737e?.['rule']){const _0x1fa97d=apiRuleToYaml(_0x45737e['rule']);_0xb4b2cd[_0x3dc61d(0x150)](_0x35f978,_0x1fa97d),await _0xc26a3d(_0x1fa97d);}}catch(_0x1d936a){logger[_0x3dc61d(0x1a3)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x35f978+':\x20'+_0x1d936a);}}};await _0xc26a3d(_0x312492);const _0x275675=serializeExpandedRule(_0x312492,_0xb4b2cd),_0x285b17=_0xcba0a8[_0x39d11e(0x1b0)](_0x275675);if(_0x285b17&&_0x285b17[_0x39d11e(0xe4)]>0x0){const _0x366033=_0x9c150[_0x39d11e(0x1b0)](_0x275675)||0x0,_0x5bee69=_0x285b17[_0x366033]||_0x285b17[_0x285b17[_0x39d11e(0xe4)]-0x1];_0x9c150[_0x39d11e(0x150)](_0x275675,_0x366033+0x1),_0x992ef=_0x5bee69,_0xaf2795[_0x39d11e(0x140)](_0x992ef),_0x1ee10c[_0x39d11e(0x150)](_0x10a774,_0x992ef);const _0x30a234=await resolveRuleSegmentRefs(_0x312492,async _0x4ce1fe=>{const _0x827b72=_0x39d11e,_0x272d39=_0x1ee10c[_0x827b72(0x1b0)](_0x4ce1fe);if(_0x272d39)return _0x272d39;const _0x527cd3=await _0x250259[_0x827b72(0x15e)](_0x4ce1fe);return _0x527cd3[_0x827b72(0x168)];});_0x27eee7={'description':_0x511310[_0x39d11e(0x135)],'rule':_0x30a234};}else{const _0x4b6bfb=_0x6a4ca8[_0x39d11e(0x1b0)](_0x275675);if(_0x4b6bfb)_0x992ef=_0x4b6bfb,_0x1ee10c[_0x39d11e(0x150)](_0x10a774,_0x992ef);else{if(_0x158496){let _0x4a066d=_0x158496,_0x2733b1=0x2;while(_0xaf2795[_0x39d11e(0x1b9)](_0x4a066d)||_0x1ba3d0[_0x39d11e(0x1b9)](_0x4a066d)){_0x4a066d=_0x158496+'_'+_0x2733b1,_0x2733b1++;}_0xaf2795[_0x39d11e(0x140)](_0x4a066d),_0x992ef=_0x4a066d;}_0x1ee10c[_0x39d11e(0x150)](_0x10a774,_0x992ef),_0x6a4ca8[_0x39d11e(0x150)](_0x275675,_0x992ef);const _0x4b2944=await resolveRuleSegmentRefs(_0x312492,async _0x5a94ae=>{const _0x5cfc9f=_0x39d11e,_0x3b75fd=_0x1ee10c[_0x5cfc9f(0x1b0)](_0x5a94ae);if(_0x3b75fd)return _0x3b75fd;const _0x4d2d9d=await _0x250259[_0x5cfc9f(0x15e)](_0x5a94ae);return _0x4d2d9d[_0x5cfc9f(0x168)];});_0x27eee7={'description':_0x511310[_0x39d11e(0x135)],'rule':_0x4b2944};}}}return{'name':_0x992ef,'isJourneyLocal':_0x55cc98,'definition':_0x27eee7};}catch(_0x173840){return logger[_0x39d11e(0x1a3)](_0x39d11e(0x18f)+_0x10a774+':\x20'+_0x173840),{'name':_0x10a774,'isJourneyLocal':![]};}},'resolveActivation':async _0x1a3261=>{const _0x229b3c=a175_0x3619,_0x22b553=_0x476915[_0x229b3c(0x1b0)](_0x1a3261);if(_0x22b553!==undefined)return{'name':_0x22b553,'isJourneyLocal':!![]};try{let _0x244480=_0x1b92c9?.[_0x229b3c(0x1b0)](_0x1a3261);!_0x244480&&(_0x244480=await _0x420bff['journey'][_0x229b3c(0xe2)](_0xaae6a7,_0x1a3261));const _0x358178=_0x244480['attributes'][_0x229b3c(0xf9)][_0x229b3c(0x168)]||_0x1a3261,_0x652347=sanitizeYamlKey(_0x358178)||'activation_'+_0x1a3261,_0x1d7521=_0x652347;_0x476915[_0x229b3c(0x150)](_0x1a3261,_0x1d7521);const _0x65e6a9=journeyActivationStepToYaml(_0x244480,_0x12a582,_0x37d4f7);return{'name':_0x1d7521,'isJourneyLocal':!![],'definition':_0x65e6a9};}catch(_0x84991d){return logger['debug'](_0x229b3c(0x121)+_0x1a3261+':\x20'+_0x84991d),{'name':_0x1a3261,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1407ef,_0xed1197)=>resolveJumpTarget(_0x1407ef,_0xed1197,_0x50de49,async _0x4a0f15=>{const _0x2c3451=a175_0x3619,_0x43a2e3=_0x272004?.[_0x2c3451(0x1b0)](_0x4a0f15);if(_0x43a2e3)return _0x43a2e3;return _0x420bff[_0x2c3451(0x16b)][_0x2c3451(0xda)](_0x4a0f15);})};return _0x250259=_0x3e36eb,_0x3e36eb;},_0x1dd852=async _0x5cd7d7=>{const _0x3ca2d0=a175_0x3619,{collectSegmentIdsFromJourneyApi:_0x2e2091}=await import(_0x3ca2d0(0x10d)),{batchAsync:_0xed6163}=await import(_0x3ca2d0(0x1ae)),_0xfda81a=new Set();for(const _0x40659a of _0x5cd7d7){let _0x196f09=_0x272004?.[_0x3ca2d0(0x1b0)](_0x40659a);!_0x196f09&&(_0x196f09=await _0x420bff['journey'][_0x3ca2d0(0xda)](_0x40659a));const _0x99849c=_0x2e2091(_0x196f09);for(const _0x5877e7 of _0x99849c){_0xfda81a[_0x3ca2d0(0x140)](_0x5877e7);}}let _0x1c9149=Array['from'](_0xfda81a);while(_0x1c9149[_0x3ca2d0(0xe4)]>0x0){const _0x3fcbc9=_0x1c9149[_0x3ca2d0(0xdc)](_0x1ab6aa=>!_0xde2417['has'](_0x1ab6aa));if(_0x3fcbc9[_0x3ca2d0(0xe4)]===0x0)break;const _0x471043=await _0xed6163(_0x3fcbc9,async _0x50d54f=>{const _0xc804a=_0x3ca2d0;_0xde2417[_0xc804a(0x140)](_0x50d54f);const _0x524a2d=await fetchSegment(_0x420bff,_0x341716,_0x50d54f,_0x376df7);if(!_0x524a2d)return null;return{'segmentId':_0x50d54f,'segment':_0x524a2d};},0xa),_0x39d989=new Set();for(const _0x2f34bc of _0x471043){if(!_0x2f34bc?.[_0x3ca2d0(0x183)]?.[_0x3ca2d0(0x133)])continue;const _0x19788a=apiRuleToYaml(_0x2f34bc['segment'][_0x3ca2d0(0x133)]);_0xb4b2cd['set'](_0x2f34bc['segmentId'],_0x19788a);const _0x299aa5=collectSegmentRefsFromRule(_0x19788a);for(const _0x39da7e of _0x299aa5){!_0xde2417[_0x3ca2d0(0x1b9)](_0x39da7e)&&_0x39d989[_0x3ca2d0(0x140)](_0x39da7e);}}_0x1c9149=Array[_0x3ca2d0(0x167)](_0x39d989);}};return{'createYamlContext':_0x4dd1f9,'prefetchJourneySegments':_0x1dd852};}export async function executePushSegments(_0x234249,_0x554a9a,_0x3f3279,_0x322182,_0x2af25c){const _0x2203a6=a175_0x2205f5,{segmentDefToCreateRequest:_0x598366,segmentDefToUpdateRequest:_0x1758c2}=await import('./child-segment-yaml.js'),_0x19a043=_0x3f3279[_0x2203a6(0xdd)],_0x54228f=0x5,_0x2fb836=async _0x51a33f=>{const _0x2e2e7c=_0x2203a6,_0x6a4664=_0x51a33f['folderPath']?_0x19a043[_0x2e2e7c(0x1b0)](_0x51a33f['folderPath']):undefined;let _0xd2cb07;const _0x4c4f92={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x493835=_0x51a33f[_0x2e2e7c(0x198)];if(_0x51a33f['yamlConfig'][_0x2e2e7c(0x133)]){const _0x105ab3=createSegmentIdResolver(_0x3f3279['segmentNameToId'],_0x51a33f['yamlConfig'][_0x2e2e7c(0x168)]),_0x5b0c71=await resolveRuleSegmentIds(_0x51a33f['yamlConfig'][_0x2e2e7c(0x133)],_0x105ab3);_0x493835={..._0x51a33f[_0x2e2e7c(0x198)],'rule':_0x5b0c71};}try{if(_0x51a33f[_0x2e2e7c(0xff)]){_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0x178),'name':_0x51a33f['yamlConfig']['name']});const _0x3e4866=_0x598366(_0x493835,_0x6a4664),_0x255101=await _0x2af25c['withProgress'](_0x2e2e7c(0x13e)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+_0x2e2e7c(0x158),()=>_0x234249[_0x2e2e7c(0x183)][_0x2e2e7c(0x18d)](_0x322182[_0x2e2e7c(0x130)],_0x3e4866));_0xd2cb07=_0x255101[_0x2e2e7c(0x110)]['id'],_0x3f3279[_0x2e2e7c(0x19a)]['set'](_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)],_0xd2cb07),_0x4c4f92[_0x2e2e7c(0xfd)]={'name':_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)],'id':_0xd2cb07},_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0xe9),'name':_0x51a33f[_0x2e2e7c(0x198)]['name'],'segmentId':_0xd2cb07}),_0x2af25c['logSuccess']?.(_0x2e2e7c(0x190)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27'),_0x4c4f92['created']=0x1;}else{if(_0x51a33f['hasChanges']){_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0x176),'name':_0x51a33f[_0x2e2e7c(0x198)]['name']});const _0x53c4f2=_0x1758c2(_0x493835);_0x6a4664!==_0x51a33f[_0x2e2e7c(0xed)]?.['segmentFolderId']&&(_0x53c4f2['segmentFolderId']=_0x6a4664?parseInt(_0x6a4664,0xa):undefined),await _0x2af25c[_0x2e2e7c(0x118)]('Updating\x20segment\x20\x27'+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27...',()=>_0x234249[_0x2e2e7c(0x183)][_0x2e2e7c(0xf7)](_0x322182['parentId'],_0x51a33f[_0x2e2e7c(0xed)]['id'],_0x53c4f2)),_0xd2cb07=_0x51a33f['existingSegment']['id'],_0x2af25c[_0x2e2e7c(0x1c4)]?.({'type':_0x2e2e7c(0x197),'name':_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]}),_0x2af25c[_0x2e2e7c(0x162)]?.(_0x2e2e7c(0xf4)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27'),_0x4c4f92[_0x2e2e7c(0x170)]=0x1;}else _0xd2cb07=_0x51a33f[_0x2e2e7c(0xed)]['id'];}}catch(_0x125d0c){const _0x21c072=isHttp400Error(_0x125d0c),_0x379258=_0x21c072?ErrorCode[_0x2e2e7c(0x1d4)]:ErrorCode[_0x2e2e7c(0x1c3)],_0x5dc70e=getErrorMessage(_0x125d0c);throw new SDKError(_0x379258,_0x2e2e7c(0xdf)+(_0x51a33f[_0x2e2e7c(0xff)]?_0x2e2e7c(0x12c):'update')+_0x2e2e7c(0x1bb)+_0x51a33f[_0x2e2e7c(0x1b3)]+_0x2e2e7c(0x10a)+_0x5dc70e,_0x125d0c);}try{const _0x309c0a=await syncActivationsForSegment(_0x234249,_0x322182[_0x2e2e7c(0x130)],_0xd2cb07,_0x51a33f[_0x2e2e7c(0x198)]['name'],_0x51a33f['activationActions'],_0x2af25c,_0x51a33f[_0x2e2e7c(0x1b3)]);_0x4c4f92[_0x2e2e7c(0x113)]=_0x309c0a;}catch(_0x31a0a1){if(_0x31a0a1 instanceof SDKError)throw _0x31a0a1;throw new SDKError(ErrorCode[_0x2e2e7c(0x1d7)],_0x2e2e7c(0x195)+_0x51a33f[_0x2e2e7c(0x198)][_0x2e2e7c(0x168)]+'\x27\x20from\x20file:\x20'+_0x51a33f[_0x2e2e7c(0x1b3)]+_0x2e2e7c(0x10a)+getErrorMessage(_0x31a0a1),_0x31a0a1);}return _0x4c4f92;},_0x19dc02=await batchAsync(_0x554a9a,_0x2fb836,_0x54228f),_0x5618c3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x50ad63 of _0x19dc02){_0x5618c3['created']+=_0x50ad63['created'],_0x5618c3[_0x2203a6(0x170)]+=_0x50ad63[_0x2203a6(0x170)],_0x50ad63[_0x2203a6(0xfd)]&&_0x5618c3[_0x2203a6(0x159)]['set'](_0x50ad63[_0x2203a6(0xfd)]['name'],_0x50ad63[_0x2203a6(0xfd)]['id']),_0x5618c3[_0x2203a6(0x113)][_0x2203a6(0x18b)]+=_0x50ad63[_0x2203a6(0x113)][_0x2203a6(0x18b)],_0x5618c3[_0x2203a6(0x113)][_0x2203a6(0x170)]+=_0x50ad63[_0x2203a6(0x113)][_0x2203a6(0x170)],_0x5618c3[_0x2203a6(0x113)][_0x2203a6(0x156)]+=_0x50ad63[_0x2203a6(0x113)][_0x2203a6(0x156)];}return _0x5618c3;}async function syncActivationsForSegment(_0xe31ec7,_0x3e7226,_0x389192,_0x53a3fe,_0x13465a,_0x1c3b2a,_0x445bbd){const _0xffc15f=a175_0x2205f5,_0x16e77b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x140772 of _0x13465a){try{if(_0x140772[_0xffc15f(0xd3)]===_0xffc15f(0x12c)&&_0x140772['validatedRequest'])_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':'activation_creating','segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),await _0x1c3b2a[_0xffc15f(0x118)]('Creating\x20activation\x20\x27'+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x158),()=>_0xe31ec7[_0xffc15f(0x183)]['createActivation'](_0x3e7226,_0x389192,_0x140772[_0xffc15f(0xf3)])),_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':_0xffc15f(0x11b),'segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),_0x1c3b2a[_0xffc15f(0x162)]?.(_0xffc15f(0xe7)+_0x140772[_0xffc15f(0x168)]+'\x27'),_0x16e77b['created']++;else{if(_0x140772['type']==='update'&&_0x140772[_0xffc15f(0xf3)]&&_0x140772[_0xffc15f(0x107)])_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':_0xffc15f(0x15a),'segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),await _0x1c3b2a[_0xffc15f(0x118)](_0xffc15f(0x171)+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x158),()=>_0xe31ec7['segment']['updateActivation'](_0x3e7226,_0x389192,_0x140772['existingActivation']['id'],_0x140772[_0xffc15f(0xf3)])),_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':'activation_updated','segmentName':_0x53a3fe,'activationName':_0x140772['name']}),_0x1c3b2a[_0xffc15f(0x162)]?.(_0xffc15f(0x15f)+_0x140772[_0xffc15f(0x168)]+'\x27'),_0x16e77b[_0xffc15f(0x170)]++;else _0x140772[_0xffc15f(0xd3)]===_0xffc15f(0x161)&&_0x140772[_0xffc15f(0x107)]&&(_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':_0xffc15f(0x1ad),'segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),await _0x1c3b2a['withProgress'](_0xffc15f(0x19e)+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x158),()=>_0xe31ec7[_0xffc15f(0x183)][_0xffc15f(0xd4)](_0x3e7226,_0x389192,_0x140772[_0xffc15f(0x107)]['id'])),_0x1c3b2a[_0xffc15f(0x1c4)]?.({'type':'activation_deleted','segmentName':_0x53a3fe,'activationName':_0x140772[_0xffc15f(0x168)]}),_0x1c3b2a[_0xffc15f(0x185)]?.(_0xffc15f(0x194)+_0x140772[_0xffc15f(0x168)]+'\x27'),_0x16e77b['deleted']++);}}catch(_0x4a6f62){const _0x151bb2=isHttp400Error(_0x4a6f62),_0x4f139a=_0x151bb2?ErrorCode[_0xffc15f(0x175)]:ErrorCode[_0xffc15f(0x1d7)],_0x324634=getErrorMessage(_0x4a6f62);throw new SDKError(_0x4f139a,_0xffc15f(0xdf)+_0x140772[_0xffc15f(0xd3)]+_0xffc15f(0x1c5)+_0x140772[_0xffc15f(0x168)]+_0xffc15f(0x18a)+_0x445bbd+_0xffc15f(0x10a)+_0x324634,_0x4a6f62);}}return _0x16e77b;}export async function executePushFolders(_0x397ce0,_0x3e157a,_0x11691f,_0x37084c,_0x53ca75){const _0x56c24a=a175_0x2205f5,_0x381b9a=new Map(_0x11691f),_0xc3ed52=sortFoldersByDepth(_0x3e157a);for(const _0x51515c of _0xc3ed52){const _0x480a62=_0x51515c[_0x56c24a(0x148)]('/'),_0x417301=_0x480a62[_0x480a62[_0x56c24a(0xe4)]-0x1],_0x481c3b=_0x480a62[_0x56c24a(0x1d1)](0x0,-0x1)['join']('/'),_0x313757=_0x381b9a[_0x56c24a(0x1b0)](_0x481c3b);_0x53ca75[_0x56c24a(0x1c4)]?.({'type':'folder_creating','folder':_0x51515c});const _0x2012a6={'name':_0x417301,'parentFolderId':_0x313757},_0x5b02b6=await _0x53ca75[_0x56c24a(0x118)](_0x56c24a(0x11e)+_0x51515c+_0x56c24a(0x158),()=>_0x397ce0[_0x56c24a(0x183)][_0x56c24a(0x1d6)](_0x37084c[_0x56c24a(0x130)],_0x2012a6));_0x381b9a[_0x56c24a(0x150)](_0x51515c,_0x5b02b6[_0x56c24a(0x110)]['id']),_0x53ca75['onProgress']?.({'type':'folder_created','folder':_0x51515c,'folderId':_0x5b02b6['data']['id']}),_0x53ca75[_0x56c24a(0x143)]?.('Created\x20folder\x20\x27'+_0x51515c+'\x27');}return _0x381b9a;}export async function executePushSegmentDeletions(_0x3d895e,_0xe1aa63,_0x1e3990){const _0x1e11ad=a175_0x2205f5;if(_0xe1aa63[_0x1e11ad(0xe4)]===0x0)return 0x0;const {batchAsync:_0x2ae4a5}=await import(_0x1e11ad(0x1ae)),_0x10315d=0x5,_0x25b8ad=await _0x2ae4a5(_0xe1aa63,async _0x43c49a=>{const _0x4c2367=_0x1e11ad;return _0x1e3990['onProgress']?.({'type':_0x4c2367(0x17e),'name':_0x43c49a[_0x4c2367(0x168)]}),await _0x3d895e[_0x4c2367(0x183)][_0x4c2367(0x19f)](_0x43c49a['id']),_0x1e3990[_0x4c2367(0x1c4)]?.({'type':_0x4c2367(0x1da),'name':_0x43c49a['name']}),_0x1e3990[_0x4c2367(0x185)]?.(_0x4c2367(0xfb)+_0x43c49a[_0x4c2367(0x168)]+'\x27'),0x1;},_0x10315d);return _0x25b8ad[_0x1e11ad(0x146)]((_0x357151,_0x22a136)=>_0x357151+_0x22a136,0x0);}export async function executePushJourneys(_0x4050a7,_0x391df7,_0x1008f6,_0xa719f6,_0x3691ee){const _0x41dd04=a175_0x2205f5,{journeyDefToRequest:_0x235123}=await import(_0x41dd04(0x10d)),{activationDefToCreateRequest:_0xa0d197,yamlRuleToApi:_0x2c2653,validateSegmentRule:_0x313b86}=await import(_0x41dd04(0x16d)),_0x3b9093={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4e4458=new Map(_0x1008f6['segmentNameToId']),_0x36fd79=0x5;for(let _0x144879=0x0;_0x144879<_0x391df7[_0x41dd04(0xe4)];_0x144879+=_0x36fd79){const _0x2536a9=_0x391df7[_0x41dd04(0x1d1)](_0x144879,_0x144879+_0x36fd79),_0x100517=await Promise['all'](_0x2536a9[_0x41dd04(0x12e)](async _0x52e97e=>{const _0x4dc0d9=_0x41dd04;if(!_0x52e97e['isNew']&&!_0x52e97e['hasChanges'])return{'action':_0x4dc0d9(0x17f),'name':_0x52e97e[_0x4dc0d9(0x198)][_0x4dc0d9(0x168)],'journeyId':_0x52e97e[_0x4dc0d9(0x16f)]?.['id']};const _0x348912=_0x52e97e[_0x4dc0d9(0x187)]?_0x1008f6[_0x4dc0d9(0xdd)][_0x4dc0d9(0x1b0)](_0x52e97e[_0x4dc0d9(0x187)]):undefined;_0x3691ee['onProgress']?.({'type':_0x52e97e['isNew']?_0x4dc0d9(0x196):_0x4dc0d9(0x1bd),'name':_0x52e97e['yamlConfig'][_0x4dc0d9(0x168)]});try{const _0x12a92c=await executeSingleJourneyPush(_0x4050a7,_0x52e97e,{..._0x1008f6,'segmentNameToId':_0x4e4458},{'parentId':_0xa719f6['parentId'],'rootFolderId':_0xa719f6[_0x4dc0d9(0xd9)],'folderId':_0x348912,'verbose':_0xa719f6[_0x4dc0d9(0x129)]},_0x3691ee,{'journeyDefToRequest':_0x235123,'activationDefToCreateRequest':_0xa0d197,'yamlRuleToApi':_0x2c2653,'validateSegmentRule':_0x313b86});for(const [_0xb9d96b,_0x5456b0]of _0x12a92c['embeddedSegmentNameToId']){_0x4e4458[_0x4dc0d9(0x150)](_0xb9d96b,_0x5456b0),_0x3b9093['embeddedSegmentNameToId'][_0x4dc0d9(0x150)](_0xb9d96b,_0x5456b0);}if(_0x12a92c[_0x4dc0d9(0x124)]===_0x4dc0d9(0x18b))_0x3691ee[_0x4dc0d9(0x1c4)]?.({'type':_0x4dc0d9(0x117),'name':_0x52e97e[_0x4dc0d9(0x198)][_0x4dc0d9(0x168)],'journeyId':_0x12a92c['journeyId']}),_0x3691ee[_0x4dc0d9(0x162)]?.(_0x4dc0d9(0x1d0)+_0x52e97e['yamlConfig'][_0x4dc0d9(0x168)]+'\x27'),_0x3b9093[_0x4dc0d9(0x18b)]++;else _0x12a92c[_0x4dc0d9(0x124)]===_0x4dc0d9(0x170)&&(_0x3691ee[_0x4dc0d9(0x1c4)]?.({'type':_0x4dc0d9(0x16a),'name':_0x52e97e['yamlConfig'][_0x4dc0d9(0x168)]}),_0x3691ee[_0x4dc0d9(0x162)]?.(_0x4dc0d9(0x134)+_0x52e97e[_0x4dc0d9(0x198)]['name']+'\x27'),_0x3b9093['updated']++);return{'action':_0x12a92c['action'],'name':_0x52e97e[_0x4dc0d9(0x198)][_0x4dc0d9(0x168)],'journeyId':_0x12a92c['journeyId']};}catch(_0x1f0476){const _0x46d923=isHttp400Error(_0x1f0476),_0x1d4f2b=_0x46d923?ErrorCode[_0x4dc0d9(0x14d)]:ErrorCode[_0x4dc0d9(0x1d2)],_0x5e5cde=getErrorMessage(_0x1f0476);throw new SDKError(_0x1d4f2b,_0x4dc0d9(0xdf)+(_0x52e97e['isNew']?_0x4dc0d9(0x12c):_0x4dc0d9(0x1c1))+'\x20journey\x20from\x20file:\x20'+_0x52e97e[_0x4dc0d9(0x1b3)]+'\x0a\x20\x20'+_0x5e5cde,_0x1f0476);}}));_0x3b9093[_0x41dd04(0x177)][_0x41dd04(0x151)](..._0x100517);}return _0x3b9093;}async function matchExistingJourneySegments(_0x436dcf,_0x7a576a,_0x877c42,_0x3756c9,_0x1cb2b4){const _0x8412dc=a175_0x2205f5;if(!_0x7a576a[_0x8412dc(0x16f)]||!_0x7a576a['yamlConfig']['segments'])return;const _0x5651fc=new Map(),_0x555849=new Set();for(const _0x1448b5 of Object[_0x8412dc(0xd7)](_0x7a576a[_0x8412dc(0x198)][_0x8412dc(0x179)])){const _0xd8f7e=generateDeterministicJourneySegmentName(_0x7a576a[_0x8412dc(0x198)][_0x8412dc(0x168)],_0x1448b5);_0x5651fc[_0x8412dc(0x150)](_0xd8f7e,_0x1448b5),_0x555849[_0x8412dc(0x140)](_0x1448b5);}const _0xe20592=[],_0x4a15ae=collectSegmentIdsFromJourneyApi(_0x7a576a['existingJourney']);for(const _0x3b4ecf of _0x4a15ae){const _0x48ab34=await fetchSegment(_0x436dcf,_0x877c42,_0x3b4ecf,_0x3756c9);if(!_0x48ab34?.[_0x8412dc(0x168)])continue;const _0x5bcca2=_0x5651fc[_0x8412dc(0x1b0)](_0x48ab34['name']);_0x5bcca2?(_0x1cb2b4[_0x8412dc(0x150)](_0x5bcca2,_0x3b4ecf),_0x555849[_0x8412dc(0x161)](_0x5bcca2)):_0xe20592[_0x8412dc(0x151)]({'id':_0x3b4ecf,'seg':_0x48ab34});}if(_0x555849[_0x8412dc(0xf6)]>0x0&&_0xe20592['length']>0x0){const {localExpandedRuleToNames:_0x3b0d69}=buildLocalExpandedRuleMappings(_0x7a576a[_0x8412dc(0x198)]),_0x5ba8bc=new Map();for(const {id:_0x4df9de,seg:_0x1b2a3e}of _0xe20592){if(_0x1b2a3e[_0x8412dc(0x133)]){const _0x38558a=apiRuleToYaml(_0x1b2a3e[_0x8412dc(0x133)]);_0x5ba8bc[_0x8412dc(0x150)](_0x4df9de,_0x38558a);}}for(const {id:_0x1b02d1,seg:_0x31c1cc}of _0xe20592){if(!_0x31c1cc[_0x8412dc(0x133)])continue;const _0x1c70cf=_0x5ba8bc[_0x8412dc(0x1b0)](_0x1b02d1);if(!_0x1c70cf)continue;const _0x9c23d=serializeExpandedRule(_0x1c70cf,_0x5ba8bc),_0x5bd899=_0x3b0d69[_0x8412dc(0x1b0)](_0x9c23d);if(_0x5bd899){const _0x42100c=_0x5bd899['find'](_0x5977fc=>_0x555849[_0x8412dc(0x1b9)](_0x5977fc));_0x42100c&&(_0x1cb2b4[_0x8412dc(0x150)](_0x42100c,_0x1b02d1),_0x555849[_0x8412dc(0x161)](_0x42100c),logger[_0x8412dc(0x1a3)]('Matched\x20server\x20segment\x20\x27'+_0x31c1cc[_0x8412dc(0x168)]+_0x8412dc(0x136)+_0x42100c+_0x8412dc(0x13a)));}}}}function a175_0x3619(_0x418369,_0x3d3c2e){_0x418369=_0x418369-0xd2;const _0x9f8a81=a175_0x9f8a();let _0x36192d=_0x9f8a81[_0x418369];return _0x36192d;}async function executeSingleJourneyPush(_0x187f6b,_0xe45ba1,_0x27b000,_0x58ac7d,_0x4f0187,_0x250753){const _0x191a25=a175_0x2205f5,{journeyDefToRequest:_0x143dc2,activationDefToCreateRequest:_0x40965f,yamlRuleToApi:_0xc83fbe,validateSegmentRule:_0x5a9ee6}=_0x250753,_0x3d80e9=new Map(),_0x39fb64=new Map();recoverSegmentIdsFromPushRecovery(_0xe45ba1,_0x3d80e9,_0x27b000[_0x191a25(0x19a)]);const _0x2b0313=new Map(),_0x117538=new Map(),_0x490ca1=new Map();let _0x2da08d;const _0x5cf248=async()=>{const _0x584002=_0x191a25;if(_0x2da08d)return;_0x2da08d=new Map();if(!_0xe45ba1[_0x584002(0x16f)])return;const _0x2b6f98=await _0x187f6b[_0x584002(0x16b)][_0x584002(0x14f)](_0xe45ba1[_0x584002(0x16f)]['id']);for(const _0x17d2fd of _0x2b6f98){const _0x2c53ca=journeyActivationStepToYaml(_0x17d2fd,_0x27b000[_0x584002(0x1a2)],_0x27b000[_0x584002(0x1ba)]),_0x40a38d=activationSignature(_0x2c53ca);!_0x2da08d[_0x584002(0x1b9)](_0x40a38d)&&_0x2da08d[_0x584002(0x150)](_0x40a38d,_0x17d2fd['id']),_0x2c53ca['name']&&_0x39fb64[_0x584002(0x150)](_0x2c53ca[_0x584002(0x168)],_0x17d2fd['id']);}};await matchExistingJourneySegments(_0x187f6b,_0xe45ba1,_0x58ac7d['parentId'],_0x27b000[_0x191a25(0x165)],_0x27b000[_0x191a25(0x19a)]);const _0xf08e49={'resolveSegmentId':async _0x2ae31f=>{const _0x3cce2c=_0x191a25,_0x586def=_0x27b000[_0x3cce2c(0x19a)][_0x3cce2c(0x1b0)](_0x2ae31f);if(!_0x586def)throw new SDKError(ErrorCode[_0x3cce2c(0x192)],_0x3cce2c(0x14e)+_0x2ae31f+'\x20(referenced\x20in\x20journey\x20'+_0xe45ba1[_0x3cce2c(0x198)][_0x3cce2c(0x168)]+')');return _0x586def;},'resolveEmbeddedSegmentId':async(_0x46431c,_0x2920a2)=>{const _0x4d81d3=_0x191a25,_0x5b3aa4=_0x27b000[_0x4d81d3(0x19a)][_0x4d81d3(0x1b0)](_0x46431c);if(_0x5b3aa4)return _0x5b3aa4;const _0x26db24=_0x27b000['existingSegments']['find'](_0x2653bb=>_0x2653bb[_0x4d81d3(0x168)]===_0x46431c);if(_0x26db24)return _0x27b000['segmentNameToId'][_0x4d81d3(0x150)](_0x46431c,_0x26db24['id']),_0x26db24['id'];if(_0xe45ba1[_0x4d81d3(0xff)]){const {stageName:_0x1f9dc6,criteriaName:_0x394f36}=findSegmentCriteriaLocation(_0xe45ba1[_0x4d81d3(0x198)],_0x46431c);return _0x5a9ee6(_0x46431c,_0x2920a2[_0x4d81d3(0x133)]),_0x117538[_0x4d81d3(0x150)](_0x46431c,{'definition':_0x2920a2,'stageName':_0x1f9dc6,'criteriaName':_0x394f36}),createPendingSegmentId(_0x46431c);}const _0x3e23df=_0xe45ba1[_0x4d81d3(0x16f)]?.['id'];if(!_0x3e23df)throw new SDKError(ErrorCode[_0x4d81d3(0x1c7)],_0x4d81d3(0x17d));const _0x3cb161=_0x2b0313[_0x4d81d3(0x1b0)](_0x46431c);if(_0x3cb161)return _0x3cb161;const _0x4dc41a=((async()=>{const _0x540512=_0x4d81d3;_0x5a9ee6(_0x46431c,_0x2920a2[_0x540512(0x133)]);const _0x162b75=generateDeterministicJourneySegmentName(_0xe45ba1[_0x540512(0x198)]['name'],_0x46431c),_0x7e1819=_0x27b000[_0x540512(0x165)][_0x540512(0x14a)](_0x3bc7e9=>_0x3bc7e9[_0x540512(0x168)]===_0x162b75),_0x292c53=createSegmentIdResolver(_0x27b000[_0x540512(0x19a)],_0x46431c),_0x5cb33c=await resolveRuleSegmentIds(_0x2920a2[_0x540512(0x133)],_0x292c53);let _0x5872ba;return _0x7e1819?(await _0x187f6b[_0x540512(0x183)][_0x540512(0xf7)](_0x58ac7d['parentId'],_0x7e1819['id'],{'description':_0x2920a2[_0x540512(0x135)]||'Entry\x20criteria:\x20'+_0x46431c,'rule':_0xc83fbe(_0x5cb33c),'countPopulation':!![]}),_0x5872ba=_0x7e1819['id'],saveSegmentToPushRecovery(_0xe45ba1[_0x540512(0x1b3)],_0xe45ba1[_0x540512(0x198)][_0x540512(0x168)],_0x46431c,{'segmentId':_0x5872ba,'uniqueServerName':_0x162b75,'createdAt':new Date()[_0x540512(0x1a4)]()})):_0x5872ba=await createOrRecoverEmbeddedSegment(_0x187f6b,_0xe45ba1,{'localName':_0x46431c,'uniqueSegmentName':_0x162b75,'description':_0x2920a2['description']||_0x540512(0x101)+_0x46431c,'journeyId':_0x3e23df,'resolvedRule':_0x5cb33c,'parentId':_0x58ac7d[_0x540512(0x130)],'folderId':_0x58ac7d[_0x540512(0xd9)]||''},_0xc83fbe),_0x27b000[_0x540512(0x19a)][_0x540512(0x150)](_0x46431c,_0x5872ba),_0x3d80e9[_0x540512(0x150)](_0x46431c,_0x5872ba),_0x5872ba;})());_0x2b0313['set'](_0x46431c,_0x4dc41a);try{return await _0x4dc41a;}finally{_0x2b0313['delete'](_0x46431c);}},'resolveActivationId':async _0x341974=>{const _0x2670cd=_0x191a25,_0x458939=_0x39fb64[_0x2670cd(0x1b0)](_0x341974);if(_0x458939)return _0x458939;if(_0xe45ba1[_0x2670cd(0x16f)]){await _0x5cf248();const _0x1bca01=_0x39fb64[_0x2670cd(0x1b0)](_0x341974);if(_0x1bca01)return _0x1bca01;}throw new SDKError(ErrorCode[_0x2670cd(0x11a)],_0x2670cd(0x11c)+_0x341974+_0x2670cd(0x1ab)+_0xe45ba1[_0x2670cd(0x198)][_0x2670cd(0x168)]+_0x2670cd(0x1b5)+_0x2670cd(0x16e));},'resolveEmbeddedActivationId':async(_0x37aabe,_0x29e937)=>{const _0x3c0c7e=_0x191a25,_0x3f1c88=_0x39fb64[_0x3c0c7e(0x1b0)](_0x37aabe);if(_0x3f1c88)return _0x3f1c88;if(_0xe45ba1['isNew'])return _0x490ca1[_0x3c0c7e(0x150)](_0x37aabe,_0x29e937),createPendingActivationId(_0x37aabe);if(_0xe45ba1[_0x3c0c7e(0x16f)]){await _0x5cf248();const _0x2c7de2=_0x39fb64['get'](_0x29e937[_0x3c0c7e(0x168)]);if(_0x2c7de2)return _0x39fb64[_0x3c0c7e(0x150)](_0x37aabe,_0x2c7de2),_0x2c7de2;const _0x2443df=activationSignature(_0x29e937),_0x5edcc3=_0x2da08d?.[_0x3c0c7e(0x1b0)](_0x2443df);if(_0x5edcc3)return _0x39fb64[_0x3c0c7e(0x150)](_0x37aabe,_0x5edcc3),_0x5edcc3;const _0x658dee=await _0x40965f(_0x29e937,_0x27b000['activationContext']),_0x3fa191={..._0x658dee,..._0x29e937['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x29e937[_0x3c0c7e(0x10e)]}},_0x126f95=await _0x187f6b[_0x3c0c7e(0x16b)][_0x3c0c7e(0x14c)](_0xe45ba1[_0x3c0c7e(0x16f)]['id'],_0x3fa191);return _0x39fb64[_0x3c0c7e(0x150)](_0x37aabe,_0x126f95['id']),_0x126f95['id'];}throw new SDKError(ErrorCode[_0x3c0c7e(0x1c7)],_0x3c0c7e(0x11f));},'resolveJourneyId':async _0x3014c3=>{const _0x448d79=_0x191a25;try{return await _0x187f6b[_0x448d79(0x16b)]['resolveJourneyId'](_0x58ac7d['parentId'],_0x3014c3);}catch(_0x3f14aa){throw new SDKError(ErrorCode['NOT_FOUND'],_0x448d79(0xfa)+_0x3014c3+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xe45ba1[_0x448d79(0x198)][_0x448d79(0x168)]+'\x27)',_0x3f14aa);}},'resolveStageId':async(_0x17aa40,_0x13fa99)=>{const _0x576cf9=_0x191a25,_0x1dc6d9=await _0x187f6b[_0x576cf9(0x16b)][_0x576cf9(0xda)](_0x17aa40),_0x1df5a8=_0x1dc6d9[_0x576cf9(0x1c9)][_0x576cf9(0x1be)][_0x576cf9(0x14a)](_0xb090de=>_0xb090de[_0x576cf9(0x168)][_0x576cf9(0xeb)]()===_0x13fa99['toLowerCase']());if(!_0x1df5a8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x576cf9(0x1c6)+_0x13fa99+_0x576cf9(0x1d9)+(_0x1dc6d9[_0x576cf9(0x1c9)][_0x576cf9(0x174)]||_0x1dc6d9['attributes'][_0x576cf9(0x168)])+'\x27');return _0x1df5a8['id'];}},_0x290224=await _0x143dc2(_0xe45ba1[_0x191a25(0x198)],_0x58ac7d[_0x191a25(0x130)],_0xf08e49),_0xb95d75=_0x58ac7d[_0x191a25(0x104)]||_0x58ac7d[_0x191a25(0xd9)];_0xb95d75&&(_0x290224[_0x191a25(0x184)]={'parentFolder':{'data':{'id':_0xb95d75,'type':_0x191a25(0x15c)}}});if(_0xe45ba1[_0x191a25(0xff)]){if(_0x117538[_0x191a25(0xf6)]>0x0||_0x490ca1['size']>0x0)return await executeThreeStepJourneyCreate(_0x187f6b,_0xe45ba1,_0x290224,{'pendingEmbeddedSegments':_0x117538,'pendingEmbeddedActivations':_0x490ca1,'embeddedSegmentNameToId':_0x3d80e9,'journeyActivationNameToId':_0x39fb64},{..._0x58ac7d,'effectiveFolderId':_0xb95d75},_0x27b000,_0x4f0187,_0x250753);else{ensureJourneyDefaults(_0x290224[_0x191a25(0x1c9)]);const _0x2c3ad9=await _0x187f6b[_0x191a25(0x16b)][_0x191a25(0x12c)](_0x290224);return deletePushRecovery(_0xe45ba1['absolutePath']),{'action':'created','journeyId':_0x2c3ad9['id'],'embeddedSegmentNameToId':_0x3d80e9};}}else{if(_0xe45ba1[_0x191a25(0x1b1)]&&_0xe45ba1[_0x191a25(0x16f)]){_0x290224['id']=_0xe45ba1[_0x191a25(0x16f)]['id'];const _0x2e5605=_0x290224[_0x191a25(0x1c9)];_0xe45ba1[_0x191a25(0x16f)][_0x191a25(0x1c9)]?.[_0x191a25(0x174)]&&(_0x2e5605[_0x191a25(0x174)]=_0xe45ba1[_0x191a25(0x16f)][_0x191a25(0x1c9)]['journeyBundleName']);const _0x1d2fea=_0xe45ba1['existingJourney']['attributes']?.[_0x191a25(0x1be)];return _0x1d2fea&&_0x290224['attributes'][_0x191a25(0x1be)]&&injectExistingStageIds(_0x290224[_0x191a25(0x1c9)][_0x191a25(0x1be)],_0x1d2fea),ensureJourneyDefaults(_0x2e5605),await _0x187f6b['journey'][_0x191a25(0x1c1)](_0xe45ba1[_0x191a25(0x16f)]['id'],_0x290224),deletePushRecovery(_0xe45ba1[_0x191a25(0x1b3)]),{'action':_0x191a25(0x170),'journeyId':_0xe45ba1['existingJourney']['id'],'embeddedSegmentNameToId':_0x3d80e9};}}return deletePushRecovery(_0xe45ba1[_0x191a25(0x1b3)]),{'action':_0x191a25(0x17f),'journeyId':_0xe45ba1[_0x191a25(0x16f)]?.['id'],'embeddedSegmentNameToId':_0x3d80e9};}function findSegmentCriteriaLocation(_0x385776,_0x4ea042){const _0x2d622b=a175_0x2205f5,_0x6a1e84=_0x385776[_0x2d622b(0x1cf)]||_0x385776[_0x2d622b(0x147)]?.[0x0]?.['stages']||[];let _0x513acc=_0x2d622b(0xde),_0x58b52c=_0x4ea042;const _0xae0031=_0x385776[_0x2d622b(0x166)]||_0x385776['journeys']?.[0x0]?.[_0x2d622b(0x166)];if(_0xae0031?.['segment']===_0x4ea042)return{'stageName':_0x2d622b(0x166),'criteriaName':_0xae0031['name']||_0x4ea042};_0x22c1f8:for(const _0x3b5d69 of _0x6a1e84){if(_0x3b5d69[_0x2d622b(0xfc)]?.[_0x2d622b(0x183)]===_0x4ea042){_0x513acc=_0x3b5d69[_0x2d622b(0x168)],_0x58b52c=_0x3b5d69[_0x2d622b(0xfc)]['name']||_0x4ea042;break;}if(_0x3b5d69['steps'])for(const _0xe56baa of _0x3b5d69[_0x2d622b(0xe0)]){if(_0xe56baa[_0x2d622b(0xd3)]===_0x2d622b(0x1a1)&&_0xe56baa[_0x2d622b(0x18e)]?.[_0x2d622b(0x14b)])for(const _0x2ea9d9 of _0xe56baa[_0x2d622b(0x18e)][_0x2d622b(0x14b)]){if(_0x2ea9d9[_0x2d622b(0x183)]===_0x4ea042){_0x513acc=_0x3b5d69[_0x2d622b(0x168)],_0x58b52c=_0x2ea9d9[_0x2d622b(0x168)]||_0x4ea042;break _0x22c1f8;}}}}return{'stageName':_0x513acc,'criteriaName':_0x58b52c};}async function executeThreeStepJourneyCreate(_0x8c9c27,_0x1fce2c,_0x28b069,_0x2791fa,_0x2f4282,_0x45a9b7,_0x7b9cb5,_0xa614b9){const _0x1d6d4d=a175_0x2205f5,{activationDefToCreateRequest:_0x5b3982,yamlRuleToApi:_0x5ecf60}=_0xa614b9,{pendingEmbeddedSegments:_0x25638c,pendingEmbeddedActivations:_0x494ff1,embeddedSegmentNameToId:_0x18d2cf}=_0x2791fa,_0x479ca2=JSON[_0x1d6d4d(0x189)](JSON[_0x1d6d4d(0x17b)](_0x28b069));ensureJourneyDefaults(_0x479ca2[_0x1d6d4d(0x1c9)]),stripPendingIds(_0x479ca2);const _0x2a7070=await _0x8c9c27['journey'][_0x1d6d4d(0x12c)](_0x479ca2),_0x23b332=_0x2a7070['id'],_0x1d6abe=new Map();for(const _0x16179c of _0x2a7070[_0x1d6d4d(0x1c9)][_0x1d6d4d(0x1be)]){_0x1d6abe[_0x1d6d4d(0x150)](_0x16179c[_0x1d6d4d(0x168)][_0x1d6d4d(0xeb)](),_0x16179c['id']);}recoverSegmentIdsFromPushRecovery(_0x1fce2c,_0x18d2cf,_0x45a9b7[_0x1d6d4d(0x19a)]);for(const [_0x466fa0,{definition:_0x12bb31}]of _0x25638c){if(_0x18d2cf[_0x1d6d4d(0x1b9)](_0x466fa0)){_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0xd6),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],'segmentName':_0x466fa0});continue;}const _0x2fbae3=generateDeterministicJourneySegmentName(_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],_0x466fa0);_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0x1ca),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],'segmentName':_0x466fa0});const _0x533766=createSegmentIdResolver(_0x45a9b7[_0x1d6d4d(0x19a)],_0x466fa0),_0x17b465=await resolveRuleSegmentIds(_0x12bb31[_0x1d6d4d(0x133)],_0x533766),_0x591a6a=await createOrRecoverEmbeddedSegment(_0x8c9c27,_0x1fce2c,{'localName':_0x466fa0,'uniqueSegmentName':_0x2fbae3,'description':_0x12bb31[_0x1d6d4d(0x135)]||_0x1d6d4d(0x101)+_0x466fa0,'journeyId':_0x23b332,'resolvedRule':_0x17b465,'parentId':_0x2f4282['parentId'],'folderId':_0x2f4282[_0x1d6d4d(0x1cd)]||''},_0x5ecf60);_0x18d2cf[_0x1d6d4d(0x150)](_0x466fa0,_0x591a6a),_0x45a9b7[_0x1d6d4d(0x19a)][_0x1d6d4d(0x150)](_0x466fa0,_0x591a6a),_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0xd6),'journeyName':_0x1fce2c['yamlConfig']['name'],'segmentName':_0x466fa0});}const _0x1730a4=new Map();for(const [_0x383ce6,_0x667f4f]of _0x494ff1){_0x7b9cb5['onProgress']?.({'type':_0x1d6d4d(0xec),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)]['name'],'activationName':_0x383ce6});const _0x387d67=await _0x5b3982(_0x667f4f,_0x45a9b7[_0x1d6d4d(0x1d5)]),_0x235c98={..._0x387d67,..._0x667f4f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x667f4f[_0x1d6d4d(0x10e)]}},_0x269775=await _0x8c9c27[_0x1d6d4d(0x16b)][_0x1d6d4d(0x14c)](_0x23b332,_0x235c98);_0x1730a4['set'](_0x383ce6,_0x269775['id']),_0x2791fa[_0x1d6d4d(0xef)][_0x1d6d4d(0x150)](_0x383ce6,_0x269775['id']),_0x7b9cb5[_0x1d6d4d(0x1c4)]?.({'type':_0x1d6d4d(0x126),'journeyName':_0x1fce2c[_0x1d6d4d(0x198)][_0x1d6d4d(0x168)],'activationName':_0x383ce6});}const _0x74fefd=JSON[_0x1d6d4d(0x189)](JSON[_0x1d6d4d(0x17b)](_0x28b069));return _0x74fefd['id']=_0x23b332,ensureJourneyDefaults(_0x74fefd[_0x1d6d4d(0x1c9)]),resolvePendingIdsInRequest(_0x74fefd,_0x28b069,_0x1d6abe,_0x18d2cf,_0x1730a4,_0x7b9cb5),await _0x8c9c27[_0x1d6d4d(0x16b)][_0x1d6d4d(0x1c1)](_0x23b332,_0x74fefd),deletePushRecovery(_0x1fce2c[_0x1d6d4d(0x1b3)]),{'action':'created','journeyId':_0x23b332,'embeddedSegmentNameToId':_0x18d2cf};}export function stripWaitStepPendingIds(_0x562fab){const _0x37b090=a175_0x2205f5,_0x4639ea=_0x562fab['conditionSegmentId']&&isPendingSegmentId(_0x562fab[_0x37b090(0x122)]),_0x47c9f6=_0x562fab[_0x37b090(0xe5)]?.[_0x37b090(0x1db)](_0x4c9973=>_0x4c9973['segmentId']&&isPendingSegmentId(_0x4c9973[_0x37b090(0x1bc)]));(_0x4639ea||_0x47c9f6)&&(_0x562fab[_0x37b090(0xf0)]='Duration',_0x562fab['waitStep']=0x1,_0x562fab['waitStepUnit']='day',delete _0x562fab['conditionSegmentId'],delete _0x562fab[_0x37b090(0x1a6)],delete _0x562fab['conditionTimeoutUnit'],delete _0x562fab[_0x37b090(0xe5)]);}export function resolveWaitStepPendingIds(_0x9675fe,_0x3a9b30,_0x135842,_0x257fad){const _0x537055=a175_0x2205f5;if(_0x3a9b30[_0x537055(0x122)]&&isPendingSegmentId(_0x3a9b30[_0x537055(0x122)])){const _0x5f46ba=_0x135842(_0x3a9b30[_0x537055(0x122)],_0x537055(0x13b)+_0x257fad+_0x537055(0x106));_0x5f46ba&&(_0x9675fe[_0x537055(0xf0)]='Condition',_0x9675fe['conditionSegmentId']=_0x5f46ba,delete _0x9675fe[_0x537055(0x144)],delete _0x9675fe[_0x537055(0xf5)],_0x3a9b30['conditionTimeoutDuration']!==undefined&&(_0x9675fe[_0x537055(0x1a6)]=_0x3a9b30['conditionTimeoutDuration']),_0x3a9b30[_0x537055(0x131)]&&(_0x9675fe[_0x537055(0x131)]=_0x3a9b30[_0x537055(0x131)]));}if(_0x3a9b30['conditions']){const _0x2a6959=_0x3a9b30[_0x537055(0xe5)][_0x537055(0x1db)](_0x318d45=>_0x318d45['segmentId']&&isPendingSegmentId(_0x318d45[_0x537055(0x1bc)]));if(_0x2a6959){const _0x10f9a7=_0x3a9b30['conditions'][_0x537055(0x12e)](_0x58b756=>{const _0x319b6d=_0x537055;if(_0x58b756[_0x319b6d(0x1bc)]&&isPendingSegmentId(_0x58b756[_0x319b6d(0x1bc)])){const _0x3e3f92=_0x135842(_0x58b756[_0x319b6d(0x1bc)],'stage\x20\x27'+_0x257fad+_0x319b6d(0x106));return{..._0x58b756,'segmentId':_0x3e3f92||_0x58b756[_0x319b6d(0x1bc)]};}return{..._0x58b756};});_0x9675fe['waitStepType']=_0x537055(0x15b),_0x9675fe['conditions']=_0x10f9a7,delete _0x9675fe[_0x537055(0x144)],delete _0x9675fe['waitStepUnit'],delete _0x9675fe[_0x537055(0x122)],delete _0x9675fe['conditionTimeoutDuration'],delete _0x9675fe[_0x537055(0x131)];}}}function stripPendingIds(_0x3c456f){const _0x467918=a175_0x2205f5;_0x3c456f[_0x467918(0x1c9)]['goal']?.[_0x467918(0x1bc)]&&isPendingSegmentId(_0x3c456f[_0x467918(0x1c9)][_0x467918(0x166)][_0x467918(0x1bc)])&&delete _0x3c456f[_0x467918(0x1c9)][_0x467918(0x166)];for(const _0x4533d0 of _0x3c456f[_0x467918(0x1c9)][_0x467918(0x1be)]||[]){_0x4533d0[_0x467918(0x18c)]?.[_0x467918(0x1bc)]&&isPendingSegmentId(_0x4533d0[_0x467918(0x18c)][_0x467918(0x1bc)])&&delete _0x4533d0['entryCriteria'];_0x4533d0[_0x467918(0x186)]?.[_0x467918(0x1bc)]&&isPendingSegmentId(_0x4533d0[_0x467918(0x186)]['segmentId'])&&delete _0x4533d0[_0x467918(0x186)];_0x4533d0[_0x467918(0x164)]&&(_0x4533d0[_0x467918(0x164)]=_0x4533d0[_0x467918(0x164)][_0x467918(0xdc)](_0x1390d8=>!_0x1390d8[_0x467918(0x1bc)]||!isPendingSegmentId(_0x1390d8[_0x467918(0x1bc)])));if(_0x4533d0[_0x467918(0xe0)])for(const _0x4d6798 of Object[_0x467918(0xd7)](_0x4533d0[_0x467918(0xe0)])){const _0x5b87a6=_0x4533d0['steps'][_0x4d6798];_0x5b87a6[_0x467918(0xd3)]==='Activation'&&_0x5b87a6['journeyActivationStepId']&&isPendingActivationId(_0x5b87a6[_0x467918(0x145)])&&(_0x5b87a6[_0x467918(0x145)]='');if(_0x5b87a6[_0x467918(0xd3)]===_0x467918(0x12f)&&_0x5b87a6[_0x467918(0x14b)])for(const _0x31066a of _0x5b87a6[_0x467918(0x14b)]){_0x31066a[_0x467918(0x1bc)]&&isPendingSegmentId(_0x31066a[_0x467918(0x1bc)])&&(_0x31066a[_0x467918(0x1bc)]='');}_0x5b87a6[_0x467918(0xd3)]===_0x467918(0x188)&&stripWaitStepPendingIds(_0x5b87a6);}}}function resolvePendingIdsInRequest(_0x32a476,_0x303503,_0x5e69b8,_0x1ea504,_0x4dcc52,_0x23e25c){const _0x510f69=a175_0x2205f5,_0x18165e=(_0x193cc1,_0x3b19fd)=>{const _0x91e4d1=a175_0x3619;if(!isPendingSegmentId(_0x193cc1))return _0x193cc1;const _0x4be3cb=extractPendingSegmentName(_0x193cc1),_0x4fd121=_0x1ea504[_0x91e4d1(0x1b0)](_0x4be3cb);return!_0x4fd121&&_0x23e25c[_0x91e4d1(0x181)]?.(_0x91e4d1(0x1c2)+_0x4be3cb+'\x27\x20for\x20'+_0x3b19fd),_0x4fd121;};if(_0x32a476[_0x510f69(0x1c9)]['goal']?.['segmentId']&&isPendingSegmentId(_0x32a476[_0x510f69(0x1c9)]['goal']['segmentId'])){const _0x49c7b2=_0x18165e(_0x32a476[_0x510f69(0x1c9)][_0x510f69(0x166)][_0x510f69(0x1bc)],_0x510f69(0x172));_0x49c7b2&&(_0x32a476[_0x510f69(0x1c9)]['goal'][_0x510f69(0x1bc)]=_0x49c7b2);}for(const _0x1f53dc of _0x32a476[_0x510f69(0x1c9)][_0x510f69(0x1be)]||[]){const _0x8f7760=_0x5e69b8[_0x510f69(0x1b0)](_0x1f53dc[_0x510f69(0x168)]['toLowerCase']());_0x8f7760&&(_0x1f53dc['id']=_0x8f7760);if(_0x1f53dc[_0x510f69(0x18c)]?.[_0x510f69(0x1bc)]&&isPendingSegmentId(_0x1f53dc[_0x510f69(0x18c)][_0x510f69(0x1bc)])){const _0x9ea7fb=_0x18165e(_0x1f53dc[_0x510f69(0x18c)][_0x510f69(0x1bc)],_0x510f69(0x13b)+_0x1f53dc['name']+_0x510f69(0x142));_0x9ea7fb&&(_0x1f53dc['entryCriteria'][_0x510f69(0x1bc)]=_0x9ea7fb);}if(_0x1f53dc[_0x510f69(0x164)])for(const _0x377dad of _0x1f53dc[_0x510f69(0x164)]){if(_0x377dad[_0x510f69(0x1bc)]&&isPendingSegmentId(_0x377dad[_0x510f69(0x1bc)])){const _0x26c0c5=_0x18165e(_0x377dad[_0x510f69(0x1bc)],_0x510f69(0x13b)+_0x1f53dc[_0x510f69(0x168)]+_0x510f69(0x1c8));_0x26c0c5&&(_0x377dad['segmentId']=_0x26c0c5);}}if(_0x1f53dc[_0x510f69(0x186)]?.['segmentId']&&isPendingSegmentId(_0x1f53dc['milestone'][_0x510f69(0x1bc)])){const _0xd3edaf=_0x18165e(_0x1f53dc['milestone'][_0x510f69(0x1bc)],_0x510f69(0x13b)+_0x1f53dc[_0x510f69(0x168)]+_0x510f69(0x1a0));_0xd3edaf&&(_0x1f53dc[_0x510f69(0x186)][_0x510f69(0x1bc)]=_0xd3edaf);}if(_0x1f53dc['steps']){const _0x166f9b=_0x1e8600=>_0x303503[_0x510f69(0x1c9)][_0x510f69(0x1be)]?.[_0x510f69(0x14a)](_0x423c42=>_0x423c42['name'][_0x510f69(0xeb)]()===_0x1f53dc[_0x510f69(0x168)]['toLowerCase']())?.[_0x510f69(0xe0)]?.[_0x1e8600];for(const _0x3a6ca2 of Object[_0x510f69(0xd7)](_0x1f53dc[_0x510f69(0xe0)])){const _0x24591d=_0x1f53dc[_0x510f69(0xe0)][_0x3a6ca2],_0xdea7f7=_0x166f9b(_0x3a6ca2);if(_0x24591d['type']===_0x510f69(0x139)&&_0x24591d[_0x510f69(0x145)]&&(isPendingActivationId(_0x24591d[_0x510f69(0x145)])||_0x24591d[_0x510f69(0x145)]==='')){if(_0xdea7f7?.[_0x510f69(0x145)]&&isPendingActivationId(_0xdea7f7[_0x510f69(0x145)])){const _0x6a7f44=extractPendingActivationName(_0xdea7f7[_0x510f69(0x145)]),_0x20bc12=_0x4dcc52[_0x510f69(0x1b0)](_0x6a7f44);_0x20bc12&&(_0x24591d[_0x510f69(0x145)]=_0x20bc12);}}if(_0x24591d[_0x510f69(0xd3)]===_0x510f69(0x12f)&&_0x24591d[_0x510f69(0x14b)]&&_0xdea7f7?.[_0x510f69(0x14b)])for(let _0x3f35f4=0x0;_0x3f35f4<_0x24591d[_0x510f69(0x14b)][_0x510f69(0xe4)];_0x3f35f4++){const _0x40c6ff=_0x24591d['branches'][_0x3f35f4],_0x34b32d=_0xdea7f7[_0x510f69(0x14b)][_0x3f35f4];if(_0x34b32d?.['segmentId']&&isPendingSegmentId(_0x34b32d['segmentId'])){const _0x159dc6=_0x18165e(_0x34b32d['segmentId'],_0x510f69(0x13b)+_0x1f53dc[_0x510f69(0x168)]+_0x510f69(0x1af)+(_0x40c6ff[_0x510f69(0x168)]||_0x3f35f4)+'\x27');_0x159dc6&&(_0x40c6ff['segmentId']=_0x159dc6);}}_0x24591d[_0x510f69(0xd3)]===_0x510f69(0x188)&&_0xdea7f7?.[_0x510f69(0xd3)]===_0x510f69(0x188)&&resolveWaitStepPendingIds(_0x24591d,_0xdea7f7,_0x18165e,_0x1f53dc[_0x510f69(0x168)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x242ea9,_0x88bdb9){const _0x25ab36=a176_0x26aa,_0x22732d=_0x242ea9();while(!![]){try{const _0x3ac231=parseInt(_0x25ab36(0x1cd))/0x1*(parseInt(_0x25ab36(0x1c8))/0x2)+parseInt(_0x25ab36(0x1c3))/0x3*(-parseInt(_0x25ab36(0x1c9))/0x4)+-parseInt(_0x25ab36(0x1c4))/0x5+-parseInt(_0x25ab36(0x1ce))/0x6+-parseInt(_0x25ab36(0x1cc))/0x7*(parseInt(_0x25ab36(0x1d0))/0x8)+-parseInt(_0x25ab36(0x1d3))/0x9*(parseInt(_0x25ab36(0x1cf))/0xa)+-parseInt(_0x25ab36(0x1d1))/0xb*(-parseInt(_0x25ab36(0x1c5))/0xc);if(_0x3ac231===_0x88bdb9)break;else _0x22732d['push'](_0x22732d['shift']());}catch(_0x32971e){_0x22732d['push'](_0x22732d['shift']());}}}(a176_0x3035,0x3d48c));function a176_0x3035(){const _0x4c713a=['1895945SqvoBR','24NxyTqD','get','add','2mtmNgf','413332FOhBvA','has','name','63SENMcp','276116DHSivr','1971252tXQxEB','10YuTbHe','406960JYTJtt','8697777sNdgvb','parentFolderId','248553JfMCQB','set','12oalmUp'];a176_0x3035=function(){return _0x4c713a;};return a176_0x3035();}export function buildFolderIdToPathMap(_0x599d79){const _0x5df7d6=a176_0x26aa,_0xb5a935=new Map(),_0x3a70f3=new Map();for(const _0x532d3e of _0x599d79){_0x3a70f3['set'](_0x532d3e['id'],_0x532d3e);}const _0xc2807f=new Set();for(const _0x23759a of _0x599d79){!_0x23759a[_0x5df7d6(0x1d2)]&&_0xc2807f[_0x5df7d6(0x1c7)](_0x23759a['id']);}function _0x5bb86a(_0x1da2f4){const _0x20f2c0=_0x5df7d6;if(_0xb5a935[_0x20f2c0(0x1ca)](_0x1da2f4['id']))return _0xb5a935['get'](_0x1da2f4['id']);if(_0xc2807f[_0x20f2c0(0x1ca)](_0x1da2f4['id']))return _0xb5a935[_0x20f2c0(0x1d4)](_0x1da2f4['id'],''),'';if(_0x1da2f4[_0x20f2c0(0x1d2)]){const _0x8c4a25=_0x3a70f3['get'](_0x1da2f4[_0x20f2c0(0x1d2)]);if(_0x8c4a25){const _0x530d8f=_0x5bb86a(_0x8c4a25),_0x4be203=_0x530d8f?_0x530d8f+'/'+_0x1da2f4[_0x20f2c0(0x1cb)]:_0x1da2f4[_0x20f2c0(0x1cb)];return _0xb5a935[_0x20f2c0(0x1d4)](_0x1da2f4['id'],_0x4be203),_0x4be203;}}const _0x572278=_0x1da2f4[_0x20f2c0(0x1cb)];return _0xb5a935[_0x20f2c0(0x1d4)](_0x1da2f4['id'],_0x572278),_0x572278;}for(const _0x38ed86 of _0x599d79){_0x5bb86a(_0x38ed86);}return _0xb5a935;}export function buildFolderPathToIdMap(_0x4e59cf){const _0x1bf432=a176_0x26aa,_0x11829d=new Map(),_0x1d08e2=new Map();for(const _0x16930e of _0x4e59cf){_0x1d08e2['set'](_0x16930e['id'],_0x16930e);}const _0x16ec87=new Set();for(const _0x4c94f9 of _0x4e59cf){!_0x4c94f9['parentFolderId']&&_0x16ec87[_0x1bf432(0x1c7)](_0x4c94f9['id']);}function _0x38d541(_0x3e6661){const _0x2972ea=_0x1bf432;if(_0x16ec87[_0x2972ea(0x1ca)](_0x3e6661['id']))return'';if(_0x3e6661[_0x2972ea(0x1d2)]){const _0x1bfca6=_0x1d08e2[_0x2972ea(0x1c6)](_0x3e6661[_0x2972ea(0x1d2)]);if(_0x1bfca6){const _0x5a4c4c=_0x38d541(_0x1bfca6);return _0x5a4c4c?_0x5a4c4c+'/'+_0x3e6661[_0x2972ea(0x1cb)]:_0x3e6661[_0x2972ea(0x1cb)];}}return _0x3e6661[_0x2972ea(0x1cb)];}for(const _0x303c82 of _0x4e59cf){const _0x50ea02=_0x38d541(_0x303c82);_0x11829d['set'](_0x50ea02,_0x303c82['id']);}return _0x11829d;}export function buildFolderMaps(_0x36077b){const _0x151d46=a176_0x26aa,_0xcc6913=buildFolderIdToPathMap(_0x36077b),_0x486915=new Map();for(const [_0x6c77ca,_0x107c63]of _0xcc6913){_0x486915[_0x151d46(0x1d4)](_0x107c63,_0x6c77ca);}return{'idToPath':_0xcc6913,'pathToId':_0x486915};}function a176_0x26aa(_0x28f4fe,_0x335026){_0x28f4fe=_0x28f4fe-0x1c3;const _0x303571=a176_0x3035();let _0x26aa7b=_0x303571[_0x28f4fe];return _0x26aa7b;}export function getFolderPath(_0x10252b,_0x48af38){const _0x4673b7=a176_0x26aa;if(!_0x10252b)return'';return _0x48af38[_0x4673b7(0x1c6)](_0x10252b)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a177_0xf91b(_0x274161,_0x502cf7){_0x274161=_0x274161-0x1f0;const _0x5d0e78=a177_0x5d0e();let _0xf91b39=_0x5d0e78[_0x274161];return _0xf91b39;}(function(_0x180407,_0x52d69a){const _0x24dfb0=a177_0xf91b,_0x1ec56f=_0x180407();while(!![]){try{const _0x34d5ef=-parseInt(_0x24dfb0(0x1f0))/0x1*(parseInt(_0x24dfb0(0x208))/0x2)+parseInt(_0x24dfb0(0x20e))/0x3+parseInt(_0x24dfb0(0x217))/0x4*(parseInt(_0x24dfb0(0x201))/0x5)+parseInt(_0x24dfb0(0x1f6))/0x6*(-parseInt(_0x24dfb0(0x21b))/0x7)+-parseInt(_0x24dfb0(0x1f5))/0x8*(parseInt(_0x24dfb0(0x205))/0x9)+parseInt(_0x24dfb0(0x1f2))/0xa*(parseInt(_0x24dfb0(0x221))/0xb)+parseInt(_0x24dfb0(0x20f))/0xc*(parseInt(_0x24dfb0(0x213))/0xd);if(_0x34d5ef===_0x52d69a)break;else _0x1ec56f['push'](_0x1ec56f['shift']());}catch(_0x5f36b1){_0x1ec56f['push'](_0x1ec56f['shift']());}}}(a177_0x5d0e,0x27266));import a177_0x6f2cfa from'path';import{parse as a177_0x295ea4}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x32bde2){const _0x544de6=a177_0xf91b;if(!_0x32bde2||_0x32bde2['trim']()==='')throw new Error(_0x544de6(0x211));const _0x4a8fb7=_0x32bde2[_0x544de6(0x1fc)]();if(_0x4a8fb7==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x32bde2};const _0x36f15d=_0x4a8fb7['startsWith']('/')?_0x4a8fb7[_0x544de6(0x203)](0x1):_0x4a8fb7,_0x5a34cf=_0x36f15d[_0x544de6(0x206)]('/')['filter'](_0x25dc26=>_0x25dc26!=='');if(_0x5a34cf[_0x544de6(0x1f7)]===0x0)throw new Error(_0x544de6(0x222));const _0x3a5590=_0x4a8fb7[_0x544de6(0x20c)]('/')||!isRelativePathSegment(_0x5a34cf[0x0]);for(const _0x5e7867 of _0x5a34cf){validatePathSegment(_0x5e7867);}return{'segments':_0x5a34cf,'isAbsolute':_0x3a5590,'raw':_0x32bde2};}function isRelativePathSegment(_0x5503f8){return _0x5503f8==='.'||_0x5503f8==='..';}function validatePathSegment(_0x3a682b){const _0x373cc6=a177_0xf91b;if(_0x3a682b==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x3a682b==='.'||_0x3a682b==='..')return;if(/[\x00-\x1F\x7F]/[_0x373cc6(0x20a)](_0x3a682b))throw new Error(_0x373cc6(0x215)+_0x3a682b);if(_0x3a682b!==_0x3a682b[_0x373cc6(0x1fc)]()){}}export function validatePath(_0x355c00){const _0x1e6847=a177_0xf91b;if(_0x355c00[_0x1e6847(0x204)][_0x1e6847(0x1f7)]===0x0&&!_0x355c00[_0x1e6847(0x1fa)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x355c00[_0x1e6847(0x1fa)]){if(_0x355c00[_0x1e6847(0x204)][0x0]==='..')throw new Error(_0x1e6847(0x219));let _0x3f3653=0x0;for(const _0x10c3f8 of _0x355c00['segments']){if(_0x10c3f8==='..'){if(_0x3f3653===0x0)throw new Error(_0x1e6847(0x1fe));_0x3f3653--;}else _0x10c3f8!=='.'&&_0x3f3653++;}}}export function joinPaths(_0x235287,_0x561863){const _0x326c54=a177_0xf91b;if(!_0x235287||_0x235287==='/')return _0x561863;if(!_0x561863||_0x561863==='.')return _0x235287;if(_0x561863['startsWith']('/'))return _0x561863;const _0x45bb67=parsePath(_0x235287),_0x2a6d32=parsePath(_0x561863),_0x480134=[..._0x45bb67[_0x326c54(0x204)]];for(const _0x3ebe40 of _0x2a6d32[_0x326c54(0x204)]){if(_0x3ebe40==='.')continue;else{if(_0x3ebe40==='..'){if(_0x480134['length']===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x480134[_0x326c54(0x209)]();}else _0x480134[_0x326c54(0x220)](_0x3ebe40);}}const _0x2dd810=_0x480134[_0x326c54(0x1f9)]('/');return _0x45bb67[_0x326c54(0x21f)]['startsWith']('/')?'/'+_0x2dd810:_0x2dd810;}export function normalizePath(_0x4681a8){const _0x50709d=a177_0xf91b,_0x387b43=parsePath(_0x4681a8),_0x9e5634=[];for(const _0x58523e of _0x387b43[_0x50709d(0x204)]){if(_0x58523e==='.')continue;else{if(_0x58523e==='..'){if(_0x9e5634[_0x50709d(0x1f7)]===0x0){if(_0x387b43[_0x50709d(0x1fa)])throw new Error(_0x50709d(0x20b));_0x9e5634[_0x50709d(0x220)]('..');}else _0x9e5634[_0x9e5634[_0x50709d(0x1f7)]-0x1]==='..'?_0x9e5634[_0x50709d(0x220)]('..'):_0x9e5634[_0x50709d(0x209)]();}else _0x9e5634[_0x50709d(0x220)](_0x58523e);}}if(_0x9e5634[_0x50709d(0x1f7)]===0x0)return _0x387b43[_0x50709d(0x1fa)]?'/':'.';const _0x57ef3c=_0x9e5634[_0x50709d(0x1f9)]('/');return _0x387b43[_0x50709d(0x21f)][_0x50709d(0x20c)]('/')?'/'+_0x57ef3c:_0x57ef3c;}export function getParentPath(_0x10538f){const _0x53153a=a177_0xf91b,_0x2568d3=parsePath(_0x10538f);if(_0x2568d3[_0x53153a(0x204)][_0x53153a(0x1f7)]<=0x1)return'/';const _0x213ad5=_0x2568d3[_0x53153a(0x204)][_0x53153a(0x1ff)](0x0,-0x1)['join']('/');return _0x2568d3[_0x53153a(0x21f)]['startsWith']('/')?'/'+_0x213ad5:_0x213ad5;}export function getBaseName(_0xa5b0ae){const _0x754a9b=a177_0xf91b,_0x94a53a=parsePath(_0xa5b0ae);return _0x94a53a[_0x754a9b(0x204)][_0x94a53a[_0x754a9b(0x204)][_0x754a9b(0x1f7)]-0x1]||'';}function a177_0x5d0e(){const _0x350873=['2292SyQqAl','pop','test','Cannot\x20navigate\x20above\x20root','startsWith','.yaml','466044EonXsv','84bvdRQk','root','Path\x20cannot\x20be\x20empty','replace','446888uEkaGA','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','tdx.json','88nJncNh','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','name','15358YNyZjy','segment','relative','dirname','raw','push','638dUqyac','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','107ItUJiD','No\x20tdx.json\x20found\x20for\x20file:\x20','23230dYAXfz','parse','exists','16pRTGZX','750BOnCcM','length','journey','join','isAbsolute','readFile','trim','Cannot\x20split\x20empty\x20path','Path\x20attempts\x20to\x20navigate\x20above\x20root','slice','endsWith','57725azGoTi','resolve','substring','segments','1023633JCKvWj','split','File\x20not\x20found:\x20'];a177_0x5d0e=function(){return _0x350873;};return a177_0x5d0e();}export function isChildPath(_0x571fec,_0x3f8ee8){const _0x3884b5=a177_0xf91b,_0x37c9fc=parsePath(_0x571fec),_0x54b9b2=parsePath(_0x3f8ee8);if(_0x37c9fc[_0x3884b5(0x204)][_0x3884b5(0x1f7)]<=_0x54b9b2['segments'][_0x3884b5(0x1f7)])return![];for(let _0x44d6fd=0x0;_0x44d6fd<_0x54b9b2[_0x3884b5(0x204)]['length'];_0x44d6fd++){if(_0x37c9fc[_0x3884b5(0x204)][_0x44d6fd]!==_0x54b9b2[_0x3884b5(0x204)][_0x44d6fd])return![];}return!![];}export function splitPath(_0x22a62d){const _0x518cf1=a177_0xf91b,_0x10e9d1=parsePath(_0x22a62d);if(_0x10e9d1[_0x518cf1(0x204)][_0x518cf1(0x1f7)]===0x0)throw new Error(_0x518cf1(0x1fd));if(_0x10e9d1['segments'][_0x518cf1(0x1f7)]===0x1)return{'parent':_0x10e9d1['segments'][0x0]};return{'parent':_0x10e9d1[_0x518cf1(0x204)][0x0],'child':_0x10e9d1['segments'][_0x518cf1(0x1ff)](0x1)[_0x518cf1(0x1f9)]('/')};}export function isYamlFilePath(_0x4324e2){const _0x414c05=a177_0xf91b;return _0x4324e2[_0x414c05(0x200)]('.yml')||_0x4324e2[_0x414c05(0x200)](_0x414c05(0x20d));}export async function resolveYamlFilePath(_0x3f6c5b,_0x427ade=nodeFileSystem){const _0x1768f3=a177_0xf91b,_0x340cff=a177_0x6f2cfa[_0x1768f3(0x202)](_0x3f6c5b);if(!await _0x427ade[_0x1768f3(0x1f4)](_0x340cff))throw new Error(_0x1768f3(0x207)+_0x3f6c5b);let _0x16144b=a177_0x6f2cfa[_0x1768f3(0x21e)](_0x340cff),_0x14b2e5=null,_0x473919=null;const _0x54378c=a177_0x6f2cfa[_0x1768f3(0x1f3)](_0x16144b)[_0x1768f3(0x210)];while(_0x16144b!==_0x54378c){const _0x27d9f5=a177_0x6f2cfa[_0x1768f3(0x1f9)](_0x16144b,_0x1768f3(0x216));if(await _0x427ade[_0x1768f3(0x1f4)](_0x27d9f5)){_0x14b2e5=_0x27d9f5,_0x473919=_0x16144b;break;}_0x16144b=a177_0x6f2cfa[_0x1768f3(0x21e)](_0x16144b);}if(!_0x14b2e5||!_0x473919)throw new Error(_0x1768f3(0x1f1)+_0x3f6c5b+'\x0a'+_0x1768f3(0x214));const _0x4af12f=await _0x427ade[_0x1768f3(0x1fb)](_0x14b2e5),_0xfce8d8=JSON[_0x1768f3(0x1f3)](_0x4af12f),_0x300a9e=_0xfce8d8['parent_segment'];if(!_0x300a9e)throw new Error(_0x1768f3(0x218));const _0x124d8d=await _0x427ade[_0x1768f3(0x1fb)](_0x340cff),_0x490150=a177_0x295ea4(_0x124d8d),_0x228c36=_0x490150[_0x1768f3(0x21a)];if(!_0x228c36)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x3f6c5b);const _0x600d2f=isJourneyDef(_0x490150,_0x340cff)?_0x1768f3(0x1f8):_0x1768f3(0x21c),_0x36cd58=a177_0x6f2cfa[_0x1768f3(0x21d)](_0x473919,_0x340cff),_0x54b0ca=a177_0x6f2cfa[_0x1768f3(0x21e)](_0x36cd58),_0x31edae=_0x54b0ca==='.'?'':_0x54b0ca[_0x1768f3(0x212)](/\\/g,'/'),_0x14c3bb=_0x31edae?_0x300a9e+'/'+_0x31edae+'/'+_0x228c36:_0x300a9e+'/'+_0x228c36;return{'parentSegment':_0x300a9e,'segmentName':_0x228c36,'folderPath':_0x31edae,'fullPath':_0x14c3bb,'resourceType':_0x600d2f,'content':_0x124d8d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a178_0x3591(){const _0x330d6f=['.\x20Parent\x20name\x20cannot\x20be\x20empty','1897lOPnDs','4GZYbIX','393188hWvapJ','3858090JYulby','27354zOuLVE','10jSUjRK','2ntREWm','24249804kikDbF','Invalid\x20segment\x20reference\x20format:\x20','10952139XkTBsh','3225879HtSpyT','13Mzivgb','2902233QepepU','indexOf','substring','8KfOXEp'];a178_0x3591=function(){return _0x330d6f;};return a178_0x3591();}(function(_0x3b4cb3,_0x2fe3d1){const _0xa5f0de=a178_0x1d53,_0x404508=_0x3b4cb3();while(!![]){try{const _0x362940=parseInt(_0xa5f0de(0xb0))/0x1*(parseInt(_0xa5f0de(0xb4))/0x2)+parseInt(_0xa5f0de(0xa9))/0x3*(-parseInt(_0xa5f0de(0xaf))/0x4)+parseInt(_0xa5f0de(0xb1))/0x5+-parseInt(_0xa5f0de(0xb2))/0x6*(-parseInt(_0xa5f0de(0xae))/0x7)+parseInt(_0xa5f0de(0xac))/0x8*(parseInt(_0xa5f0de(0xa7))/0x9)+-parseInt(_0xa5f0de(0xb3))/0xa*(-parseInt(_0xa5f0de(0xb7))/0xb)+-parseInt(_0xa5f0de(0xb5))/0xc*(parseInt(_0xa5f0de(0xa8))/0xd);if(_0x362940===_0x2fe3d1)break;else _0x404508['push'](_0x404508['shift']());}catch(_0x3c9703){_0x404508['push'](_0x404508['shift']());}}}(a178_0x3591,0xbb0c3));function a178_0x1d53(_0x1810c9,_0xfdafd4){_0x1810c9=_0x1810c9-0xa7;const _0x3591c8=a178_0x3591();let _0x1d5306=_0x3591c8[_0x1810c9];return _0x1d5306;}export function parseSegmentRef(_0x48aacd){const _0x5e1785=a178_0x1d53,_0x4336ce=_0x48aacd[_0x5e1785(0xaa)]('/');if(_0x4336ce===-0x1)return{'parentId':_0x48aacd};if(_0x4336ce===0x0)throw new Error(_0x5e1785(0xb6)+_0x48aacd+_0x5e1785(0xad));const _0x1b9c88=_0x48aacd['substring'](0x0,_0x4336ce),_0x36b6e2=_0x48aacd[_0x5e1785(0xab)](_0x4336ce+0x1);if(_0x36b6e2==='')throw new Error(_0x5e1785(0xb6)+_0x48aacd+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x1b9c88,'childId':_0x36b6e2};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3cbeb5,_0x482179){const _0x12b9f8=a178_0x4a1d,_0x320125=_0x3cbeb5();while(!![]){try{const _0x2b0e8b=parseInt(_0x12b9f8(0x131))/0x1+-parseInt(_0x12b9f8(0x133))/0x2*(-parseInt(_0x12b9f8(0x118))/0x3)+-parseInt(_0x12b9f8(0x115))/0x4+-parseInt(_0x12b9f8(0x139))/0x5+-parseInt(_0x12b9f8(0x129))/0x6+parseInt(_0x12b9f8(0x15e))/0x7+parseInt(_0x12b9f8(0x128))/0x8;if(_0x2b0e8b===_0x482179)break;else _0x320125['push'](_0x320125['shift']());}catch(_0xe37a64){_0x320125['push'](_0x320125['shift']());}}}(a178_0x5ce0,0xd8bfc));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x57bf9a,_0x390d41={},_0x6d3d42={}){const _0x232541=a178_0x4a1d;if(_0x6d3d42[_0x232541(0x146)])return runSemanticChecks(_0x57bf9a,_0x390d41);const _0x15c7ad=SegmentDefSchema['safeParse'](_0x57bf9a);if(_0x15c7ad[_0x232541(0x167)])return runSemanticChecks(_0x15c7ad[_0x232541(0x14f)],_0x390d41);return zodErrorsToValidationResult(_0x15c7ad[_0x232541(0x161)],_0x390d41);}export function validateRuleDef(_0xc8e793,_0x4e4db9,_0x3f2683){const _0xf046cc=a178_0x4a1d;if(!_0xc8e793)return[];const _0x44d647=RuleDefSchema[_0xf046cc(0x126)](_0xc8e793);if(_0x44d647[_0xf046cc(0x167)])return checkRule(_0x44d647[_0xf046cc(0x14f)],_0x4e4db9,_0x3f2683);const _0x13cece=flattenZodIssues(_0x44d647['error'][_0xf046cc(0x165)]);return _0x13cece[_0xf046cc(0x11a)](_0x194b71=>{const _0x449655=_0xf046cc,_0xe5083c=formatZodPath(_0x194b71[_0x449655(0x11c)]),_0x22050c=_0xe5083c?_0x4e4db9+'.'+_0xe5083c:_0x4e4db9,_0x19da67=mapZodIssueToCode(_0x194b71,_0xe5083c),_0x54f597=getLocationFromPath(_0x3f2683[_0x449655(0x136)],_0x3f2683['source'],pathToArray(_0x22050c));return{'level':_0x449655(0x161),'path':_0x22050c,'code':_0x19da67,'message':_0x194b71[_0x449655(0x12b)],..._0x54f597&&{'location':_0x54f597}};});}function a178_0x4a1d(_0x2cc0d3,_0x3d827d){_0x2cc0d3=_0x2cc0d3-0x114;const _0x5ce074=a178_0x5ce0();let _0x4a1dfe=_0x5ce074[_0x2cc0d3];return _0x4a1dfe;}function zodErrorsToValidationResult(_0x2287de,_0x169cca){const _0x9ab542=a178_0x4a1d,_0x178d71=flattenZodIssues(_0x2287de[_0x9ab542(0x165)]),_0x126940=_0x178d71['map'](_0x107a26=>{const _0xbf72b6=_0x9ab542,_0x40719d=formatZodPath(_0x107a26[_0xbf72b6(0x11c)]),_0x986ced=mapZodIssueToCode(_0x107a26,_0x40719d),_0x317113=getLocationFromPath(_0x169cca['document'],_0x169cca[_0xbf72b6(0x15a)],_0x107a26[_0xbf72b6(0x11c)][_0xbf72b6(0x11a)](_0x291327=>typeof _0x291327===_0xbf72b6(0x155)?String(_0x291327):_0x291327));return{'level':_0xbf72b6(0x161),'path':_0x40719d,'code':_0x986ced,'message':_0x107a26[_0xbf72b6(0x12b)],..._0x317113&&{'location':_0x317113}};});return{'valid':![],'errors':_0x126940,'warnings':[]};}function mapZodIssueToCode(_0x413a79,_0x441bdd){const _0x4fb7c7=a178_0x4a1d,_0x4a18d5=_0x413a79[_0x4fb7c7(0x13b)]===_0x4fb7c7(0x153)?_0x413a79[_0x4fb7c7(0x13d)]:undefined;if(_0x441bdd===_0x4fb7c7(0x135))return _0x4fb7c7(0x120);if(_0x441bdd==='rule.type'||_0x441bdd['endsWith'](_0x4fb7c7(0x13c))){if(_0x413a79[_0x4fb7c7(0x13b)]===_0x4fb7c7(0x12e)){if(_0x441bdd===_0x4fb7c7(0x13a)||_0x441bdd[_0x4fb7c7(0x160)](/\.conditions\[\d+\]\.type$/))return'INVALID_RULE_TYPE';}}if(_0x441bdd[_0x4fb7c7(0x116)](_0x4fb7c7(0x132)))return _0x4fb7c7(0x14b);if(_0x441bdd[_0x4fb7c7(0x116)](_0x4fb7c7(0x11d)))return _0x4fb7c7(0x12a);if(_0x4a18d5?.[_0x4fb7c7(0x156)]===_0x4fb7c7(0x163))return _0x4fb7c7(0x163);if(_0x4a18d5?.[_0x4fb7c7(0x156)]===_0x4fb7c7(0x12f))return _0x4fb7c7(0x12f);if(_0x441bdd['endsWith'](_0x4fb7c7(0x149))||_0x441bdd===_0x4fb7c7(0x144))return _0x4fb7c7(0x11f);if(_0x441bdd[_0x4fb7c7(0x140)](_0x4fb7c7(0x168)))return _0x4fb7c7(0x16a);if(_0x441bdd[_0x4fb7c7(0x116)](_0x4fb7c7(0x12c)))return'MISSING_SEGMENT_REFERENCE';return _0x4fb7c7(0x157);}function runSemanticChecks(_0x18a730,_0x5247a7){const _0x520a93=a178_0x4a1d,_0x512208=[];_0x18a730['rule']&&_0x512208['push'](...checkRule(_0x18a730[_0x520a93(0x141)],_0x520a93(0x141),_0x5247a7));const _0x1f07f9=_0x512208[_0x520a93(0x124)](_0x19ef01=>_0x19ef01[_0x520a93(0x117)]===_0x520a93(0x161)),_0x55213d=_0x512208[_0x520a93(0x124)](_0x299c74=>_0x299c74[_0x520a93(0x117)]===_0x520a93(0x159));return{'valid':_0x1f07f9['length']===0x0,'errors':_0x1f07f9,'warnings':_0x55213d};}function checkRule(_0xd85d42,_0x342a40,_0x2c28fb){const _0x2fd365=a178_0x4a1d,_0x22c34e=[];if(_0xd85d42[_0x2fd365(0x144)][_0x2fd365(0x145)]===0x0)return _0x22c34e[_0x2fd365(0x14e)]({'level':_0x2fd365(0x161),'path':_0x342a40+_0x2fd365(0x149),'code':_0x2fd365(0x147),'message':'Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','location':getLocationFromPath(_0x2c28fb['document'],_0x2c28fb[_0x2fd365(0x15a)],pathToArray(_0x342a40+'.conditions'))}),_0x22c34e;return _0x22c34e[_0x2fd365(0x14e)](...checkConditions(_0xd85d42[_0x2fd365(0x144)],_0x342a40,_0x2c28fb)),_0x22c34e;}function a178_0x5ce0(){const _0x14d3bf=['.source','includes','rule','Attribute\x20name\x20cannot\x20be\x20empty','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','conditions','length','skipSchema','EMPTY_CONDITIONS','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','.conditions','Value','INVALID_OPERATOR_TYPE','.operator.not','EMPTY_ATTRIBUTE','push','data','.conditions[','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','.attribute','custom','NESTED_CONDITION_GROUP','symbol','validationCode','SEGMENT_SCHEMA_ERROR','attribute','warning','source','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','aggregation','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','10403925VDhjfE','Behavior','match','error','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','MISSING_BETWEEN_BOUNDS','Attribute\x20\x27','issues','TimeWithinNext','success','arrayMatching','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','INVALID_ARRAY_MATCHING','Behavior\x20source\x20\x27','TimeWithinPast','4718988aRQDEn','endsWith','level','637395LNjJnB','description','map','operator','path','.operator.value','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','MISSING_CONDITIONS','MISSING_NAME','not','Composite','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','filter','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','safeParse','BEHAVIOR_SOURCE_MISSING_FILTER','14784720HqrFqX','10514688KCZxdW','MISSING_OPERATOR_VALUE','message','.segment','\x27\x20with\x20attribute\x20\x27','invalid_value','MISSING_TIME_UNIT','Operator\x20\x27','705025eqcXwB','.operator.type','14uplZqa','.filter','name','document','type','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','8533230yPpXGE','rule.type','code','.type','params','TEMPORAL_NEGATION_UNSUPPORTED'];a178_0x5ce0=function(){return _0x14d3bf;};return a178_0x5ce0();}function checkConditions(_0x1db93a,_0x108de9,_0x1b0c70){const _0x38fbef=a178_0x4a1d,_0x5387d3=[];for(let _0x33aed1=0x0;_0x33aed1<_0x1db93a['length'];_0x33aed1++){const _0x2a1352=_0x1db93a[_0x33aed1],_0x49fdf5=_0x108de9+_0x38fbef(0x150)+_0x33aed1+']';_0x5387d3[_0x38fbef(0x14e)](...checkCondition(_0x2a1352,_0x49fdf5,_0x1b0c70));}return _0x5387d3;}function checkCondition(_0x233f5e,_0x5a4c80,_0x53da8b){const _0x71fd22=a178_0x4a1d,_0x1d98d7=[];if(_0x233f5e[_0x71fd22(0x137)]==='And'||_0x233f5e[_0x71fd22(0x137)]==='Or'||_0x233f5e[_0x71fd22(0x137)]===_0x71fd22(0x122)){if(_0x233f5e['conditions']['length']===0x0)_0x1d98d7['push']({'level':_0x71fd22(0x161),'path':_0x5a4c80+_0x71fd22(0x149),'code':_0x71fd22(0x147),'message':_0x233f5e[_0x71fd22(0x137)]+'\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','location':getLocationFromPath(_0x53da8b[_0x71fd22(0x136)],_0x53da8b[_0x71fd22(0x15a)],pathToArray(_0x5a4c80+_0x71fd22(0x149)))});else{const _0x406b88=_0x233f5e[_0x71fd22(0x119)]!==undefined,_0x48f410=_0x233f5e['type']===_0x71fd22(0x122);!_0x406b88&&!_0x48f410&&_0x1d98d7[_0x71fd22(0x14e)]({'level':_0x71fd22(0x159),'path':_0x5a4c80,'code':_0x71fd22(0x154),'message':_0x233f5e[_0x71fd22(0x137)]+_0x71fd22(0x143)+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+_0x71fd22(0x151),'location':getLocationFromPath(_0x53da8b['document'],_0x53da8b[_0x71fd22(0x15a)],pathToArray(_0x5a4c80))}),_0x1d98d7[_0x71fd22(0x14e)](...checkConditions(_0x233f5e[_0x71fd22(0x144)],_0x5a4c80,_0x53da8b));}return _0x1d98d7;}if(_0x233f5e[_0x71fd22(0x137)]===_0x71fd22(0x14a)||_0x233f5e['type']===_0x71fd22(0x15f)){const _0x1765c0=_0x233f5e,_0xed2a77=_0x1765c0[_0x71fd22(0x15a)],_0xdd37b8=_0x1765c0[_0x71fd22(0x15c)],_0x40588e=_0xed2a77||_0xdd37b8,_0x28c9f2=_0x1765c0['operator']?.[_0x71fd22(0x137)];if((_0x28c9f2===_0x71fd22(0x114)||_0x28c9f2===_0x71fd22(0x166))&&_0x1765c0[_0x71fd22(0x11b)]?.[_0x71fd22(0x121)]!==undefined){const _0x47695f=_0x1765c0['operator'][_0x71fd22(0x121)]===!![];_0x1d98d7[_0x71fd22(0x14e)]({'level':_0x47695f?'error':_0x71fd22(0x159),'path':_0x5a4c80+_0x71fd22(0x14c),'code':_0x71fd22(0x13e),'message':_0x47695f?_0x71fd22(0x130)+_0x28c9f2+_0x71fd22(0x15d)+_0x71fd22(0x123)+_0x71fd22(0x148):_0x71fd22(0x130)+_0x28c9f2+_0x71fd22(0x15b)+_0x71fd22(0x162),'location':getLocationFromPath(_0x53da8b[_0x71fd22(0x136)],_0x53da8b[_0x71fd22(0x15a)],pathToArray(_0x5a4c80+_0x71fd22(0x14c)))});}(!_0x1765c0[_0x71fd22(0x158)]||_0x1765c0[_0x71fd22(0x158)]==='')&&(!_0x40588e&&_0x1d98d7[_0x71fd22(0x14e)]({'level':_0x71fd22(0x161),'path':_0x5a4c80+_0x71fd22(0x152),'code':_0x71fd22(0x14d),'message':_0x71fd22(0x142),'location':getLocationFromPath(_0x53da8b[_0x71fd22(0x136)],_0x53da8b[_0x71fd22(0x15a)],pathToArray(_0x5a4c80+_0x71fd22(0x152)))}));_0x1765c0[_0x71fd22(0x124)]&&_0x1d98d7[_0x71fd22(0x14e)](...checkRule(_0x1765c0['filter'],_0x5a4c80+_0x71fd22(0x134),_0x53da8b));if(_0x1765c0['source']){const _0x349483=_0x1765c0['attribute']&&_0x1765c0[_0x71fd22(0x158)]!=='';_0x349483&&!_0x1765c0[_0x71fd22(0x124)]&&_0x1d98d7['push']({'level':_0x71fd22(0x161),'path':_0x5a4c80+'.source','code':_0x71fd22(0x127),'message':_0x71fd22(0x16b)+_0x1765c0[_0x71fd22(0x15a)]+_0x71fd22(0x12d)+_0x1765c0[_0x71fd22(0x158)]+'\x27\x20'+_0x71fd22(0x125)+_0x71fd22(0x11e)+_0x71fd22(0x169),'location':getLocationFromPath(_0x53da8b['document'],_0x53da8b[_0x71fd22(0x15a)],pathToArray(_0x5a4c80+_0x71fd22(0x13f)))}),_0x349483&&_0x1765c0[_0x71fd22(0x124)]&&_0x1d98d7[_0x71fd22(0x14e)]({'level':'warning','path':_0x5a4c80+_0x71fd22(0x152),'code':'BEHAVIOR_SOURCE_WITH_ATTRIBUTE','message':_0x71fd22(0x164)+_0x1765c0[_0x71fd22(0x158)]+_0x71fd22(0x138)+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x53da8b['document'],_0x53da8b[_0x71fd22(0x15a)],pathToArray(_0x5a4c80+'.attribute'))});}}return _0x1d98d7;}
|
|
1
|
+
(function(_0x71f408,_0x4f2453){const _0x48a0fa=a179_0x5b5d,_0x26f719=_0x71f408();while(!![]){try{const _0x168cf2=-parseInt(_0x48a0fa(0x1f5))/0x1*(-parseInt(_0x48a0fa(0x1fd))/0x2)+parseInt(_0x48a0fa(0x1ee))/0x3*(parseInt(_0x48a0fa(0x1dc))/0x4)+parseInt(_0x48a0fa(0x1ff))/0x5*(-parseInt(_0x48a0fa(0x1d6))/0x6)+-parseInt(_0x48a0fa(0x1db))/0x7+-parseInt(_0x48a0fa(0x1d8))/0x8+-parseInt(_0x48a0fa(0x206))/0x9+parseInt(_0x48a0fa(0x1c5))/0xa;if(_0x168cf2===_0x4f2453)break;else _0x26f719['push'](_0x26f719['shift']());}catch(_0x4efb0c){_0x26f719['push'](_0x26f719['shift']());}}}(a179_0x12d3,0x24989));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x343f50,_0x46bc99={},_0x3f26df={}){const _0x26d15f=a179_0x5b5d;if(_0x3f26df[_0x26d15f(0x1d1)])return runSemanticChecks(_0x343f50,_0x46bc99);const _0x142ba2=SegmentDefSchema[_0x26d15f(0x1c6)](_0x343f50);if(_0x142ba2[_0x26d15f(0x1fc)])return runSemanticChecks(_0x142ba2[_0x26d15f(0x1f4)],_0x46bc99);return zodErrorsToValidationResult(_0x142ba2[_0x26d15f(0x1e8)],_0x46bc99);}export function validateRuleDef(_0xb84da2,_0x5462c9,_0x14cb66){const _0x4400e2=a179_0x5b5d;if(!_0xb84da2)return[];const _0xbfd22f=RuleDefSchema[_0x4400e2(0x1c6)](_0xb84da2);if(_0xbfd22f[_0x4400e2(0x1fc)])return checkRule(_0xbfd22f['data'],_0x5462c9,_0x14cb66);const _0x1c222b=flattenZodIssues(_0xbfd22f['error'][_0x4400e2(0x208)]);return _0x1c222b[_0x4400e2(0x1c4)](_0x44c07b=>{const _0x3285c7=_0x4400e2,_0x489230=formatZodPath(_0x44c07b[_0x3285c7(0x1fb)]),_0x3b35c5=_0x489230?_0x5462c9+'.'+_0x489230:_0x5462c9,_0x395485=mapZodIssueToCode(_0x44c07b,_0x489230),_0x4368f5=getLocationFromPath(_0x14cb66['document'],_0x14cb66[_0x3285c7(0x209)],pathToArray(_0x3b35c5));return{'level':_0x3285c7(0x1e8),'path':_0x3b35c5,'code':_0x395485,'message':_0x44c07b[_0x3285c7(0x1eb)],..._0x4368f5&&{'location':_0x4368f5}};});}function zodErrorsToValidationResult(_0x4241d0,_0x44c916){const _0x7c55c4=a179_0x5b5d,_0x2f95ec=flattenZodIssues(_0x4241d0[_0x7c55c4(0x208)]),_0x3e5b23=_0x2f95ec[_0x7c55c4(0x1c4)](_0x120166=>{const _0x41acb9=_0x7c55c4,_0x57105c=formatZodPath(_0x120166['path']),_0x48084e=mapZodIssueToCode(_0x120166,_0x57105c),_0x38471b=getLocationFromPath(_0x44c916[_0x41acb9(0x1c7)],_0x44c916[_0x41acb9(0x209)],_0x120166[_0x41acb9(0x1fb)]['map'](_0xd5e703=>typeof _0xd5e703===_0x41acb9(0x1bd)?String(_0xd5e703):_0xd5e703));return{'level':_0x41acb9(0x1e8),'path':_0x57105c,'code':_0x48084e,'message':_0x120166[_0x41acb9(0x1eb)],..._0x38471b&&{'location':_0x38471b}};});return{'valid':![],'errors':_0x3e5b23,'warnings':[]};}function mapZodIssueToCode(_0x3d22a2,_0x12ee18){const _0x389c56=a179_0x5b5d,_0x153c38=_0x3d22a2['code']==='custom'?_0x3d22a2['params']:undefined;if(_0x12ee18===_0x389c56(0x1c1))return _0x389c56(0x1da);if(_0x12ee18===_0x389c56(0x1ec)||_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x20d))){if(_0x3d22a2[_0x389c56(0x1c3)]===_0x389c56(0x202)){if(_0x12ee18===_0x389c56(0x1ec)||_0x12ee18[_0x389c56(0x1f7)](/\.conditions\[\d+\]\.type$/))return'INVALID_RULE_TYPE';}}if(_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x1df)))return _0x389c56(0x201);if(_0x12ee18['endsWith'](_0x389c56(0x1ca)))return'MISSING_OPERATOR_VALUE';if(_0x153c38?.[_0x389c56(0x1e6)]==='MISSING_BETWEEN_BOUNDS')return'MISSING_BETWEEN_BOUNDS';if(_0x153c38?.[_0x389c56(0x1e6)]===_0x389c56(0x1d4))return _0x389c56(0x1d4);if(_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x1e7))||_0x12ee18===_0x389c56(0x20c))return'MISSING_CONDITIONS';if(_0x12ee18[_0x389c56(0x1c0)](_0x389c56(0x1cb)))return _0x389c56(0x204);if(_0x12ee18[_0x389c56(0x1be)](_0x389c56(0x1f6)))return _0x389c56(0x1d0);return'SEGMENT_SCHEMA_ERROR';}function a179_0x12d3(){const _0x269997=['error','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','.attribute','message','rule.type','type','295020edNfdb','warning','\x27\x20with\x20attribute\x20\x27','And','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','Value','data','6TsLIHl','.segment','match','filter','not','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','path','success','62772YQinmc','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','1465LAberE','.conditions[','INVALID_OPERATOR_TYPE','invalid_value','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','INVALID_ARRAY_MATCHING','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','1789542tJwbfO','level','issues','source','.operator.not','EMPTY_CONDITIONS','conditions','.type','push','NESTED_CONDITION_GROUP','symbol','endsWith','BEHAVIOR_SOURCE_MISSING_FILTER','includes','name','operator','code','map','3271480gBgwqI','safeParse','document','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','.source','.operator.value','arrayMatching','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','description','MISSING_SEGMENT_REFERENCE','skipSchema','EMPTY_ATTRIBUTE','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','MISSING_TIME_UNIT','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','4866WdJQQd','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','893216PwGATm','aggregation','MISSING_NAME','787318JAQoCW','12uavnjM','length','TimeWithinPast','.operator.type','attribute','rule','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','TEMPORAL_NEGATION_UNSUPPORTED','Behavior','TimeWithinNext','validationCode','.conditions'];a179_0x12d3=function(){return _0x269997;};return a179_0x12d3();}function a179_0x5b5d(_0x5d25e8,_0x4e767c){_0x5d25e8=_0x5d25e8-0x1bb;const _0x12d33f=a179_0x12d3();let _0x5b5d2c=_0x12d33f[_0x5d25e8];return _0x5b5d2c;}function runSemanticChecks(_0x5e49a8,_0x42ccb0){const _0x590dbd=a179_0x5b5d,_0x1dbdae=[];_0x5e49a8[_0x590dbd(0x1e1)]&&_0x1dbdae[_0x590dbd(0x1bb)](...checkRule(_0x5e49a8[_0x590dbd(0x1e1)],'rule',_0x42ccb0));const _0x105cd5=_0x1dbdae[_0x590dbd(0x1f8)](_0x119e4d=>_0x119e4d['level']==='error'),_0x4b8762=_0x1dbdae[_0x590dbd(0x1f8)](_0x169825=>_0x169825[_0x590dbd(0x207)]===_0x590dbd(0x1ef));return{'valid':_0x105cd5[_0x590dbd(0x1dd)]===0x0,'errors':_0x105cd5,'warnings':_0x4b8762};}function checkRule(_0x6a37ed,_0x4e029a,_0x2c4ed0){const _0x2fa011=a179_0x5b5d,_0x101737=[];if(_0x6a37ed[_0x2fa011(0x20c)][_0x2fa011(0x1dd)]===0x0)return _0x101737['push']({'level':'error','path':_0x4e029a+_0x2fa011(0x1e7),'code':'EMPTY_CONDITIONS','message':_0x2fa011(0x1f2),'location':getLocationFromPath(_0x2c4ed0[_0x2fa011(0x1c7)],_0x2c4ed0[_0x2fa011(0x209)],pathToArray(_0x4e029a+'.conditions'))}),_0x101737;return _0x101737[_0x2fa011(0x1bb)](...checkConditions(_0x6a37ed[_0x2fa011(0x20c)],_0x4e029a,_0x2c4ed0)),_0x101737;}function checkConditions(_0xe3e703,_0xd83f6e,_0x57925d){const _0x361e90=a179_0x5b5d,_0xe55265=[];for(let _0x4f6846=0x0;_0x4f6846<_0xe3e703['length'];_0x4f6846++){const _0x4a7367=_0xe3e703[_0x4f6846],_0x35b649=_0xd83f6e+_0x361e90(0x200)+_0x4f6846+']';_0xe55265[_0x361e90(0x1bb)](...checkCondition(_0x4a7367,_0x35b649,_0x57925d));}return _0xe55265;}function checkCondition(_0x256687,_0x18bbdd,_0x49822e){const _0x3d09e3=a179_0x5b5d,_0x359500=[];if(_0x256687['type']===_0x3d09e3(0x1f1)||_0x256687[_0x3d09e3(0x1ed)]==='Or'||_0x256687['type']==='Composite'){if(_0x256687[_0x3d09e3(0x20c)]['length']===0x0)_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1e8),'path':_0x18bbdd+_0x3d09e3(0x1e7),'code':_0x3d09e3(0x20b),'message':_0x256687['type']+_0x3d09e3(0x1fe),'location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e[_0x3d09e3(0x209)],pathToArray(_0x18bbdd+'.conditions'))});else{const _0x374f75=_0x256687[_0x3d09e3(0x1cf)]!==undefined,_0x5b722c=_0x256687[_0x3d09e3(0x1ed)]==='Composite';!_0x374f75&&!_0x5b722c&&_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1ef),'path':_0x18bbdd,'code':_0x3d09e3(0x1bc),'message':_0x256687[_0x3d09e3(0x1ed)]+_0x3d09e3(0x1d7)+_0x3d09e3(0x1e9)+_0x3d09e3(0x1ce),'location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e[_0x3d09e3(0x209)],pathToArray(_0x18bbdd))}),_0x359500[_0x3d09e3(0x1bb)](...checkConditions(_0x256687['conditions'],_0x18bbdd,_0x49822e));}return _0x359500;}if(_0x256687[_0x3d09e3(0x1ed)]===_0x3d09e3(0x1f3)||_0x256687[_0x3d09e3(0x1ed)]===_0x3d09e3(0x1e4)){const _0x38ba71=_0x256687,_0x3e245f=_0x38ba71[_0x3d09e3(0x209)],_0xd04312=_0x38ba71[_0x3d09e3(0x1d9)],_0x537ddd=_0x3e245f||_0xd04312,_0x480aea=_0x38ba71['operator']?.[_0x3d09e3(0x1ed)];if((_0x480aea===_0x3d09e3(0x1de)||_0x480aea===_0x3d09e3(0x1e5))&&_0x38ba71[_0x3d09e3(0x1c2)]?.[_0x3d09e3(0x1f9)]!==undefined){const _0x877779=_0x38ba71[_0x3d09e3(0x1c2)][_0x3d09e3(0x1f9)]===!![];_0x359500[_0x3d09e3(0x1bb)]({'level':_0x877779?_0x3d09e3(0x1e8):'warning','path':_0x18bbdd+_0x3d09e3(0x20a),'code':_0x3d09e3(0x1e3),'message':_0x877779?'Operator\x20\x27'+_0x480aea+_0x3d09e3(0x1e2)+_0x3d09e3(0x203)+_0x3d09e3(0x1cc):'Operator\x20\x27'+_0x480aea+_0x3d09e3(0x1cd)+'Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e['source'],pathToArray(_0x18bbdd+_0x3d09e3(0x20a)))});}(!_0x38ba71[_0x3d09e3(0x1e0)]||_0x38ba71['attribute']==='')&&(!_0x537ddd&&_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1e8),'path':_0x18bbdd+_0x3d09e3(0x1ea),'code':_0x3d09e3(0x1d2),'message':'Attribute\x20name\x20cannot\x20be\x20empty','location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e[_0x3d09e3(0x209)],pathToArray(_0x18bbdd+'.attribute'))}));_0x38ba71[_0x3d09e3(0x1f8)]&&_0x359500[_0x3d09e3(0x1bb)](...checkRule(_0x38ba71[_0x3d09e3(0x1f8)],_0x18bbdd+'.filter',_0x49822e));if(_0x38ba71[_0x3d09e3(0x209)]){const _0x175e9f=_0x38ba71[_0x3d09e3(0x1e0)]&&_0x38ba71[_0x3d09e3(0x1e0)]!=='';_0x175e9f&&!_0x38ba71[_0x3d09e3(0x1f8)]&&_0x359500[_0x3d09e3(0x1bb)]({'level':'error','path':_0x18bbdd+_0x3d09e3(0x1c9),'code':_0x3d09e3(0x1bf),'message':'Behavior\x20source\x20\x27'+_0x38ba71[_0x3d09e3(0x209)]+_0x3d09e3(0x1f0)+_0x38ba71[_0x3d09e3(0x1e0)]+'\x27\x20'+_0x3d09e3(0x1d3)+_0x3d09e3(0x205)+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e['source'],pathToArray(_0x18bbdd+_0x3d09e3(0x1c9)))}),_0x175e9f&&_0x38ba71[_0x3d09e3(0x1f8)]&&_0x359500[_0x3d09e3(0x1bb)]({'level':_0x3d09e3(0x1ef),'path':_0x18bbdd+'.attribute','code':_0x3d09e3(0x1d5),'message':'Attribute\x20\x27'+_0x38ba71['attribute']+_0x3d09e3(0x1fa)+_0x3d09e3(0x1c8),'location':getLocationFromPath(_0x49822e[_0x3d09e3(0x1c7)],_0x49822e['source'],pathToArray(_0x18bbdd+_0x3d09e3(0x1ea)))});}}return _0x359500;}
|