@treasuredata/tdx 2026.3.5 → 2026.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/auth-login-command.d.ts +29 -0
- package/dist/commands/auth-login-command.d.ts.map +1 -0
- package/dist/commands/auth-login-command.js +1 -0
- package/dist/commands/auth-login-command.js.map +1 -0
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.d.ts.map +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/mcp-command.js.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/status-command.js.map +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.d.ts +11 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/core/credential-cache.js +1 -1
- 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.d.ts +32 -0
- package/dist/core/oauth-keychain.d.ts.map +1 -0
- package/dist/core/oauth-keychain.js +1 -0
- package/dist/core/oauth-keychain.js.map +1 -0
- package/dist/core/oauth.d.ts +112 -0
- package/dist/core/oauth.d.ts.map +1 -0
- package/dist/core/oauth.js +1 -0
- package/dist/core/oauth.js.map +1 -0
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.d.ts +16 -0
- package/dist/sdk/client/oauth-refresh.d.ts.map +1 -0
- package/dist/sdk/client/oauth-refresh.js +1 -0
- package/dist/sdk/client/oauth-refresh.js.map +1 -0
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/journey.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a116_0x22cd65=a116_0x5618;(function(_0x3c9670,_0x16ae84){const _0x4aa3af=a116_0x5618,_0x17fb2c=_0x3c9670();while(!![]){try{const _0x1f2171=parseInt(_0x4aa3af(0x132))/0x1+-parseInt(_0x4aa3af(0x174))/0x2+-parseInt(_0x4aa3af(0x18b))/0x3+parseInt(_0x4aa3af(0x149))/0x4+-parseInt(_0x4aa3af(0x16c))/0x5+parseInt(_0x4aa3af(0x140))/0x6*(-parseInt(_0x4aa3af(0x167))/0x7)+parseInt(_0x4aa3af(0x17d))/0x8;if(_0x1f2171===_0x16ae84)break;else _0x17fb2c['push'](_0x17fb2c['shift']());}catch(_0x3e8ee9){_0x17fb2c['push'](_0x17fb2c['shift']());}}}(a116_0x402e,0xb5af9));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x2b54ef){const _0x11c9ce=a116_0x5618;return _0x2b54ef[_0x11c9ce(0x191)]??_0x2b54ef['attributes']?.[_0x11c9ce(0x191)]??undefined;}function getVersionNumber(_0x55f714){const _0x3a89ff=a116_0x5618;return _0x55f714[_0x3a89ff(0x183)]??_0x55f714[_0x3a89ff(0x177)]?.[_0x3a89ff(0x183)]??0x0;}function getState(_0x592df4){const _0x3c8420=a116_0x5618;return _0x592df4[_0x3c8420(0x12f)]??_0x592df4[_0x3c8420(0x177)]?.['state'];}function a116_0x402e(){const _0x563e9c=['2348520ANNcnI','completionRate','goalInflux','latestJourneyId','get','listVersions','draft','getActivation','1240476Xtgfrq','description','create','attributes','goalSize','branch','excluded','journeys','name','18084000cMnYQd','find','\x20in\x20journey\x20','exit_criteria','cdp_customer_id','Excluded\x20profiles','versionNumber','values','listJourneyActivations','variants','applyVersionDeduplication','branches','add','journeyStageId','4289349uNWZXC','timedOutPath','createdAt','WaitStep','size','listJourneysFromParentSegment','journeyBundleId','limit','intime_goal','all','paused','history','conversion','from','resumeJourney','createVersion','intime_stage_','client','has','resolveJourneyId','data','includeAllVersions','getTrafficData','conditionSegmentId','activation','pauseJourney','step','lastVersionNumber','length','isArray','out','listEntitiesByFolder','exitCriterias','getColumnMapping','map','listJourneysWithDetailsFromParentSegment','listSegmentFolders','segmentId','getJourneyStatistics','cdp_audience_','folder-segment','audienceId','Journey\x20not\x20found:\x20','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','fetchTrafficRaw','flat','listJourneysWithDetails','state','getActivationSankeyChart','JOURNEY_NOT_FOUND','587810GfQxLa','toLowerCase','push','resume','segmentFolderId','NOT_FOUND','outtime_stage_','jumpInflux','relationships','set','updatedAt','filter','entries','Journey\x20activation\x20step\x20not\x20found:\x20','8412pMpWer','journeyBundleName','getJourneyActivation','launched','conditions','listActivations','getJourneyBundle','goal','_exit_','2778392bHpksa','rootFolderId','stage','string','replace','journeyStages','getConversionSankeyChart','checkJourneyAppendable','Wait','journeyId','parentFolder','sort','idx-','createActivation','listActivationsFlat','milestoneInflux','listJourneysWithFolders','DecisionPoint','type','steps','enteredSize','INVALID_ARGUMENT','exitOrJumpRate','getStatistics','reduce','waitCondition','getJourney','getBundle','intime_journey','exitInflux','1393FNYalq','journey_','journey','createJourney','activationStepsById'];a116_0x402e=function(){return _0x563e9c;};return a116_0x402e();}export function deduplicateJourneysByBundle(_0x5e24e3){const _0x282385=a116_0x5618,_0x57ef80=new Map();let _0x1dc690=0x0;for(const _0x4786d1 of _0x5e24e3){const _0xfc68c3=getBundleId(_0x4786d1);if(!_0xfc68c3){const _0x421051='no-bundle-'+(_0x4786d1['id']??_0x282385(0x155)+_0x1dc690++);_0x57ef80[_0x282385(0x13b)](_0x421051,_0x4786d1);continue;}const _0x58da1f=_0x57ef80['get'](_0xfc68c3);if(!_0x58da1f)_0x57ef80['set'](_0xfc68c3,_0x4786d1);else{const _0x41465a=getState(_0x58da1f)===_0x282385(0x143),_0x4127ea=getState(_0x4786d1)===_0x282385(0x143);if(_0x4127ea&&!_0x41465a)_0x57ef80[_0x282385(0x13b)](_0xfc68c3,_0x4786d1);else{if(!_0x4127ea&&_0x41465a){}else{const _0x599a79=getVersionNumber(_0x58da1f),_0x3a74cd=getVersionNumber(_0x4786d1);_0x3a74cd>_0x599a79&&_0x57ef80[_0x282385(0x13b)](_0xfc68c3,_0x4786d1);}}}}return Array[_0x282385(0x198)](_0x57ef80[_0x282385(0x184)]());}const VALID_JOURNEY_STATES=new Set([a116_0x22cd65(0x172),'simulation','launched']);export function parseJourneyState(_0x209bf5){const _0x189bfa=a116_0x22cd65;if(typeof _0x209bf5===_0x189bfa(0x14c)&&VALID_JOURNEY_STATES[_0x189bfa(0x112)](_0x209bf5))return _0x209bf5;return _0x189bfa(0x172);}export function entityToJourneyListItem(_0x6ea2dc,_0x2f3485){const _0x467ea3=a116_0x22cd65,_0x4b111b=_0x6ea2dc['attributes'];return{'id':_0x6ea2dc['id'],'name':_0x4b111b['name']??'','journeyBundleName':_0x4b111b[_0x467ea3(0x141)]??_0x4b111b['name']??'','journeyBundleId':_0x4b111b[_0x467ea3(0x191)]??'','versionNumber':_0x4b111b[_0x467ea3(0x183)],'description':_0x4b111b[_0x467ea3(0x175)]??null,'state':parseJourneyState(_0x4b111b[_0x467ea3(0x12f)]),'paused':_0x4b111b[_0x467ea3(0x195)]??![],'audienceId':_0x2f3485,'folderId':_0x4b111b[_0x467ea3(0x136)]??_0x6ea2dc[_0x467ea3(0x13a)]?.[_0x467ea3(0x153)]?.[_0x467ea3(0x114)]?.['id']??null,'createdAt':_0x4b111b[_0x467ea3(0x18d)]??'','updatedAt':_0x4b111b['updatedAt']??''};}function convertToColumnId(_0x3bec43){const _0x1ec738=a116_0x22cd65;return _0x3bec43[_0x1ec738(0x14d)](/-/g,'_');}function getStepEntries(_0x1e4ed0){const _0xc50c04=a116_0x22cd65;if(!_0x1e4ed0)return[];if(Array[_0xc50c04(0x11d)](_0x1e4ed0))return _0x1e4ed0[_0xc50c04(0x122)](_0x1deae8=>[_0x1deae8['id'],_0x1deae8]);return Object[_0xc50c04(0x13e)](_0x1e4ed0);}export function flattenJourneyActivation(_0x4b2508){const _0x4ec694=a116_0x22cd65,{activationParams:_0x1335cd,activationId:_0x3b2110,runAfterJourneyRefresh:_0x3cadd0}=_0x4b2508[_0x4ec694(0x177)];return{'id':_0x4b2508['id'],'activationId':_0x3b2110,'runAfterJourneyRefresh':_0x3cadd0,..._0x1335cd};}function col(_0x4733b9,_0x4501d7={}){return{'column':_0x4733b9,'direction':null,'stageIndex':null,'stageName':null,'category':'fixed','stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x4501d7};}function a116_0x5618(_0x21b2b2,_0x263e71){_0x21b2b2=_0x21b2b2-0x112;const _0x402e11=a116_0x402e();let _0x5618e4=_0x402e11[_0x21b2b2];return _0x5618e4;}export function generateColumnMapping(_0x5198d2){const _0x224f3c=a116_0x22cd65,_0x25a676=[];_0x25a676[_0x224f3c(0x134)](col(_0x224f3c(0x181))),_0x25a676[_0x224f3c(0x134)](col(_0x224f3c(0x165),{'direction':'in','category':_0x224f3c(0x169)})),_0x25a676[_0x224f3c(0x134)](col('outtime_journey',{'direction':_0x224f3c(0x11e),'category':_0x224f3c(0x169)}));_0x5198d2[_0x224f3c(0x177)][_0x224f3c(0x147)]&&_0x25a676[_0x224f3c(0x134)](col(_0x224f3c(0x193),{'direction':'in','category':_0x224f3c(0x147),'detail':_0x5198d2['attributes'][_0x224f3c(0x147)][_0x224f3c(0x17c)]||null}));const _0x364a3a=_0x5198d2[_0x224f3c(0x177)][_0x224f3c(0x14e)]||[];for(let _0x6620b8=0x0;_0x6620b8<_0x364a3a[_0x224f3c(0x11c)];_0x6620b8++){const _0x3e6282=_0x364a3a[_0x6620b8],_0x2e191b=_0x3e6282[_0x224f3c(0x17c)],_0x258082={'stageIndex':_0x6620b8,'stageName':_0x2e191b},_0x1fd357=_0x3e6282['entryCriteria']?.[_0x224f3c(0x17c)]||null;_0x25a676['push'](col(_0x224f3c(0x19b)+_0x6620b8,{..._0x258082,'direction':'in','category':_0x224f3c(0x14b),'detail':_0x1fd357})),_0x25a676[_0x224f3c(0x134)](col(_0x224f3c(0x138)+_0x6620b8,{..._0x258082,'direction':_0x224f3c(0x11e),'category':_0x224f3c(0x14b),'detail':_0x1fd357}));_0x3e6282['milestone']&&_0x25a676[_0x224f3c(0x134)](col('intime_stage_'+_0x6620b8+'_milestone',{..._0x258082,'direction':'in','category':'milestone','detail':_0x3e6282['milestone'][_0x224f3c(0x17c)]||null}));const _0x23adef=_0x3e6282[_0x224f3c(0x120)]||_0x3e6282['exitCriteria']||[];for(let _0x121147=0x0;_0x121147<_0x23adef[_0x224f3c(0x11c)];_0x121147++){_0x25a676[_0x224f3c(0x134)](col('intime_stage_'+_0x6620b8+_0x224f3c(0x148)+_0x121147,{..._0x258082,'direction':'in','category':_0x224f3c(0x180),'detail':_0x23adef[_0x121147][_0x224f3c(0x17c)]||null}));}const _0x2d87fb=getStepEntries(_0x3e6282[_0x224f3c(0x15c)]);for(const [_0x489c95,_0x406b2e]of _0x2d87fb){const _0x2c8a42=convertToColumnId(_0x489c95),_0x13ce24=_0x406b2e[_0x224f3c(0x15b)]||null,_0x28d765=_0x406b2e[_0x224f3c(0x17c)]||null,_0xe92c36={..._0x258082,'stepType':_0x13ce24,'stepName':_0x28d765,'stepId':_0x489c95};_0x25a676['push'](col(_0x224f3c(0x19b)+_0x6620b8+'_'+_0x2c8a42,{..._0xe92c36,'direction':'in','category':_0x224f3c(0x11a)})),_0x25a676['push'](col(_0x224f3c(0x138)+_0x6620b8+'_'+_0x2c8a42,{..._0xe92c36,'direction':_0x224f3c(0x11e),'category':_0x224f3c(0x11a)}));if(_0x406b2e[_0x224f3c(0x15b)]===_0x224f3c(0x15a)&&_0x406b2e[_0x224f3c(0x188)])for(const _0x384559 of _0x406b2e[_0x224f3c(0x188)]){_0x384559['segmentId']&&_0x25a676[_0x224f3c(0x134)](col('intime_stage_'+_0x6620b8+'_'+_0x2c8a42+'_'+_0x384559[_0x224f3c(0x125)],{..._0xe92c36,'direction':'in','category':'branch','detail':_0x384559[_0x224f3c(0x17c)]||(_0x384559[_0x224f3c(0x17a)]?_0x224f3c(0x182):null)}));}if((_0x406b2e['type']==='AbTest'||_0x406b2e['type']==='ABTest')&&_0x406b2e[_0x224f3c(0x186)])for(const _0x52c795 of _0x406b2e[_0x224f3c(0x186)]){_0x52c795['id']&&_0x25a676[_0x224f3c(0x134)](col(_0x224f3c(0x19b)+_0x6620b8+'_'+_0x2c8a42+'_variant_'+convertToColumnId(_0x52c795['id']),{..._0xe92c36,'direction':'in','category':'variant','detail':_0x52c795[_0x224f3c(0x17c)]||null}));}if(_0x406b2e[_0x224f3c(0x15b)]===_0x224f3c(0x18e)||_0x406b2e[_0x224f3c(0x15b)]===_0x224f3c(0x151)){const _0x226647=[];if(_0x406b2e['conditionSegmentId'])_0x226647[_0x224f3c(0x134)](_0x406b2e[_0x224f3c(0x117)]);else{if(Array[_0x224f3c(0x11d)](_0x406b2e[_0x224f3c(0x144)]))for(const _0x296abf of _0x406b2e[_0x224f3c(0x144)]){_0x296abf[_0x224f3c(0x125)]&&!_0x296abf[_0x224f3c(0x18c)]&&_0x226647['push'](_0x296abf[_0x224f3c(0x125)]);}else _0x406b2e[_0x224f3c(0x162)]?.[_0x224f3c(0x125)]&&_0x226647[_0x224f3c(0x134)](_0x406b2e['waitCondition'][_0x224f3c(0x125)]);}for(const _0x12e7c2 of _0x226647){_0x25a676[_0x224f3c(0x134)](col(_0x224f3c(0x19b)+_0x6620b8+'_'+_0x2c8a42+'_'+_0x12e7c2,{..._0xe92c36,'direction':'in','category':_0x224f3c(0x179)}));}}}}return _0x25a676['push'](col('time')),_0x25a676;}export function aggregateJourneyHistory(_0x264a03){const _0x59d176=a116_0x22cd65,_0x1c5a6b=_0x264a03[_0x59d176(0x161)]((_0xd11216,_0x17b888)=>_0xd11216+(_0x17b888['entryInflux']??0x0),0x0),_0x1038fd=_0x264a03[_0x59d176(0x161)]((_0x1e2dab,_0x532550)=>_0x1e2dab+(_0x532550[_0x59d176(0x16e)]??0x0),0x0),_0xde4c00=_0x264a03[_0x59d176(0x161)]((_0x48f522,_0x5f5ae9)=>_0x48f522+((_0x5f5ae9[_0x59d176(0x166)]??0x0)+(_0x5f5ae9[_0x59d176(0x139)]??0x0)),0x0),_0x5d7897=_0x264a03[_0x264a03['length']-0x1];return{'size':_0x5d7897?.[_0x59d176(0x18f)]??0x0,'entered':_0x1c5a6b,'goal_achieved':_0x1038fd,'completion_rate':_0x1038fd&&_0x1c5a6b?_0x1038fd/_0x1c5a6b*0x64:0x0,'exit_or_jump':_0xde4c00,'exit_or_jump_rate':_0xde4c00&&_0x1c5a6b?_0xde4c00/_0x1c5a6b*0x64:0x0};}export function aggregateStageHistory(_0x58dd38){const _0x2085d9=a116_0x22cd65,_0x8fe240=_0x58dd38[_0x2085d9(0x161)]((_0xe01035,_0x20334e)=>_0xe01035+(_0x20334e['entryInflux']??0x0),0x0),_0x386748=_0x58dd38['reduce']((_0x8a1ecf,_0x5da299)=>_0x8a1ecf+(_0x5da299[_0x2085d9(0x158)]??0x0),0x0),_0x536e1a=_0x58dd38[_0x2085d9(0x161)]((_0x3324ee,_0x5eee9b)=>_0x3324ee+((_0x5eee9b[_0x2085d9(0x166)]??0x0)+(_0x5eee9b[_0x2085d9(0x139)]??0x0)),0x0),_0x18d436=_0x58dd38[_0x58dd38[_0x2085d9(0x11c)]-0x1];return{'size':_0x18d436?.[_0x2085d9(0x18f)]??0x0,'entered':_0x8fe240,'milestone':_0x386748,'milestone_rate':_0x386748&&_0x8fe240?_0x386748/_0x8fe240*0x64:0x0,'exit_or_jump':_0x536e1a,'exit_or_jump_rate':_0x536e1a&&_0x8fe240?_0x536e1a/_0x8fe240*0x64:0x0};}export function assembleJourneyStats(_0x39d83c,_0x4bbc21){const _0x30cebd=a116_0x22cd65,_0x3d066b=!!(_0x4bbc21?.[_0x30cebd(0x198)]||_0x4bbc21?.['to'])&&!!_0x39d83c[_0x30cebd(0x196)]?.[_0x30cebd(0x11c)];if(_0x3d066b){const _0x357c9e=aggregateJourneyHistory(_0x39d83c[_0x30cebd(0x196)]),_0x471e6c={'journey_id':_0x39d83c[_0x30cebd(0x152)],..._0x4bbc21?.[_0x30cebd(0x198)]&&{'from':_0x4bbc21[_0x30cebd(0x198)]},..._0x4bbc21?.['to']&&{'to':_0x4bbc21['to']},..._0x357c9e};return _0x4bbc21?.['includeHistory']&&(_0x471e6c['history']=_0x39d83c[_0x30cebd(0x196)]),_0x471e6c;}return{'journey_id':_0x39d83c['journeyId'],'size':_0x39d83c[_0x30cebd(0x18f)],'entered':_0x39d83c[_0x30cebd(0x15d)],'goal_achieved':_0x39d83c[_0x30cebd(0x178)],'completion_rate':_0x39d83c[_0x30cebd(0x16d)],'exit_or_jump':_0x39d83c['exitOrJumpSize'],'exit_or_jump_rate':_0x39d83c[_0x30cebd(0x15f)]};}export function formatVersionsFromBundle(_0x153613){const _0x4fe2d9=a116_0x22cd65,_0x4c0ce6=_0x153613[_0x4fe2d9(0x17b)][_0x4fe2d9(0x122)](_0x4957ea=>({'journeyId':_0x4957ea['id'],'versionNumber':_0x4957ea['attributes'][_0x4fe2d9(0x183)]??0x0,'name':_0x4957ea[_0x4fe2d9(0x177)][_0x4fe2d9(0x17c)],'state':_0x4957ea[_0x4fe2d9(0x177)][_0x4fe2d9(0x12f)],'paused':_0x4957ea[_0x4fe2d9(0x177)][_0x4fe2d9(0x195)],'createdAt':_0x4957ea[_0x4fe2d9(0x177)][_0x4fe2d9(0x18d)],'updatedAt':_0x4957ea['attributes'][_0x4fe2d9(0x13c)]}));return _0x4c0ce6[_0x4fe2d9(0x154)]((_0x429974,_0x187e6e)=>_0x429974[_0x4fe2d9(0x183)]-_0x187e6e[_0x4fe2d9(0x183)]),_0x4c0ce6;}export function synthesizePreBundleVersion(_0x2a8e42){const _0x40e5e2=a116_0x22cd65;return{'journeyId':_0x2a8e42['id'],'versionNumber':0x1,'name':_0x2a8e42[_0x40e5e2(0x177)][_0x40e5e2(0x17c)],'state':_0x2a8e42[_0x40e5e2(0x177)][_0x40e5e2(0x12f)],'paused':_0x2a8e42[_0x40e5e2(0x177)][_0x40e5e2(0x195)],'createdAt':_0x2a8e42[_0x40e5e2(0x177)]['createdAt'],'updatedAt':_0x2a8e42['attributes']['updatedAt']};}export function buildStageNameMap(_0x5974e4){const _0x24b10=a116_0x22cd65;return new Map(_0x5974e4['attributes'][_0x24b10(0x14e)]?.[_0x24b10(0x122)](_0x458c4c=>[_0x458c4c['id'],_0x458c4c[_0x24b10(0x17c)]])??[]);}export class JourneySDK{['client'];constructor(_0xa389be){this['client']=new CDPApiClient(_0xa389be);}['applyVersionDeduplication'](_0x8ccf72,_0x52dbe3){return _0x52dbe3?_0x8ccf72:deduplicateJourneysByBundle(_0x8ccf72);}async[a116_0x22cd65(0x12e)](_0x251b0b,_0x3ca3b2){const _0x33d049=a116_0x22cd65;try{const _0x3b7a56=await this[_0x33d049(0x19c)][_0x33d049(0x12e)](_0x251b0b);return{'journeys':this[_0x33d049(0x187)](_0x3b7a56[_0x33d049(0x17b)],_0x3ca3b2),'activationStepsById':_0x3b7a56[_0x33d049(0x16b)]};}catch(_0x1ad094){if(isHttp404Error(_0x1ad094))return{'journeys':[],'activationStepsById':new Map()};throw _0x1ad094;}}async[a116_0x22cd65(0x190)](_0x3b26be,_0x55f78d,_0x904f4d){const _0x4d79b7=a116_0x22cd65;let _0x416932=_0x55f78d;if(!_0x416932)try{const _0x3ace0d=await this[_0x4d79b7(0x19c)]['getParentSegmentFull'](_0x3b26be);_0x416932=_0x3ace0d[_0x4d79b7(0x14a)]??undefined;}catch(_0x5d1b94){if(isHttp404Error(_0x5d1b94))return[];throw _0x5d1b94;}if(!_0x416932)return[];let _0x1fd894;if(_0x904f4d?.[_0x4d79b7(0x115)]){const _0x20d22=await this[_0x4d79b7(0x19c)][_0x4d79b7(0x124)](_0x3b26be),_0x7c333a=_0x20d22[_0x4d79b7(0x122)](_0x3435b5=>this['client']['listJourneys'](_0x3435b5['id'])),_0x573e7a=await Promise[_0x4d79b7(0x194)](_0x7c333a),_0x11dfe9=new Set();_0x1fd894=_0x573e7a[_0x4d79b7(0x12d)]()[_0x4d79b7(0x13d)](_0x15a0f3=>{const _0x33ef81=_0x4d79b7;if(_0x11dfe9[_0x33ef81(0x112)](_0x15a0f3['id']))return![];return _0x11dfe9['add'](_0x15a0f3['id']),!![];});}else{const _0x1d3766=await this['client'][_0x4d79b7(0x11f)](_0x416932,0x20,![]),_0x468592=_0x1d3766[_0x4d79b7(0x114)],_0x1a7922=_0x468592[_0x4d79b7(0x13d)](_0x4a0641=>_0x4a0641['type']==='journey');_0x1fd894=_0x1a7922[_0x4d79b7(0x122)](_0x22259d=>entityToJourneyListItem(_0x22259d,_0x3b26be));}return this[_0x4d79b7(0x187)](_0x1fd894,_0x904f4d?.[_0x4d79b7(0x115)]);}async[a116_0x22cd65(0x159)](_0x3668de,_0xaeeb15,_0x1ef615){const _0x2948a8=a116_0x22cd65;if(!_0xaeeb15)return{'journeys':[],'folders':[]};const _0x50c8ce=await this['client']['listEntitiesByFolder'](_0xaeeb15,0x20,![]),_0x411ac4=_0x50c8ce[_0x2948a8(0x114)],_0x25f759=_0x411ac4[_0x2948a8(0x13d)](_0x17440e=>_0x17440e[_0x2948a8(0x15b)]===_0x2948a8(0x128)&&_0x17440e['id']!==_0xaeeb15),_0x23c0c7=_0x25f759[_0x2948a8(0x122)](_0x72a5c1=>({'id':_0x72a5c1['id'],'name':_0x72a5c1[_0x2948a8(0x177)][_0x2948a8(0x17c)]})),_0x5cb7fc=_0x411ac4['filter'](_0x336212=>_0x336212[_0x2948a8(0x15b)]==='journey'),_0x35038e=_0x5cb7fc['map'](_0x10a03e=>entityToJourneyListItem(_0x10a03e,_0x3668de));return{'journeys':this[_0x2948a8(0x187)](_0x35038e,_0x1ef615?.[_0x2948a8(0x115)]),'folders':_0x23c0c7};}async[a116_0x22cd65(0x123)](_0x39271d,_0x5ccc7a){const _0x1693a0=a116_0x22cd65;let _0x20636a;try{_0x20636a=await this[_0x1693a0(0x19c)]['listSegmentFolders'](_0x39271d);}catch(_0x187331){if(isHttp404Error(_0x187331))return{'journeys':[],'activationStepsById':new Map()};throw _0x187331;}const _0x3b36fa=_0x20636a['map'](async _0x24aa26=>{const _0x80c090=_0x1693a0;return await this[_0x80c090(0x12e)](_0x24aa26['id'],_0x5ccc7a?.[_0x80c090(0x115)]);}),_0x4b4618=await Promise['all'](_0x3b36fa),_0x1ef8af=new Map(),_0x52d185=[];for(const _0x3d0242 of _0x4b4618){_0x52d185[_0x1693a0(0x134)](..._0x3d0242[_0x1693a0(0x17b)]);for(const [_0xa27858,_0x46ffbc]of _0x3d0242[_0x1693a0(0x16b)]){_0x1ef8af[_0x1693a0(0x13b)](_0xa27858,_0x46ffbc);}}const _0x622402=new Set(),_0x128ebf=_0x52d185[_0x1693a0(0x13d)](_0x58302f=>{const _0xb5ca69=_0x1693a0;if(_0x622402[_0xb5ca69(0x112)](_0x58302f['id']))return![];return _0x622402[_0xb5ca69(0x189)](_0x58302f['id']),!![];});return{'journeys':this[_0x1693a0(0x187)](_0x128ebf,_0x5ccc7a?.[_0x1693a0(0x115)]),'activationStepsById':_0x1ef8af};}async[a116_0x22cd65(0x163)](_0x573032){const _0x5dcdc4=a116_0x22cd65;try{return await this['client'][_0x5dcdc4(0x163)](_0x573032);}catch(_0x2698b8){if(isHttp404Error(_0x2698b8))throw new SDKError(ErrorCode[_0x5dcdc4(0x131)],_0x5dcdc4(0x12a)+_0x573032,_0x2698b8);throw _0x2698b8;}}async[a116_0x22cd65(0x113)](_0xa8eb64,_0x4fd195){const _0x5de827=a116_0x22cd65,_0xc1eaea=await this[_0x5de827(0x190)](_0xa8eb64),_0x4ed9f7=_0xc1eaea[_0x5de827(0x17e)](_0x111fee=>_0x111fee[_0x5de827(0x141)][_0x5de827(0x133)]()===_0x4fd195['toLowerCase']());if(!_0x4ed9f7)throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x5de827(0x12a)+_0x4fd195,undefined,{'helpText':'Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'});return _0x4ed9f7['id'];}async[a116_0x22cd65(0x160)](_0x201126,_0x5b0b50){const _0x3b4154=a116_0x22cd65;try{return await this['client'][_0x3b4154(0x126)](_0x201126,_0x5b0b50);}catch(_0x45ca4f){if(isHttp404Error(_0x45ca4f))throw new SDKError(ErrorCode[_0x3b4154(0x131)],_0x3b4154(0x12a)+_0x201126,_0x45ca4f);throw _0x45ca4f;}}async[a116_0x22cd65(0x116)](_0x36b4bc,_0x307a21){const _0x1c75bd=a116_0x22cd65,_0x522817={'from':_0x307a21?.['from'],'to':_0x307a21?.['to'],'limit':_0x307a21?.[_0x1c75bd(0x192)]},_0xd2f452=_0x307a21?.[_0x1c75bd(0x15b)]!=='conversion';try{const [_0x150b40,_0x50f075]=await Promise['all']([this['fetchTrafficRaw'](_0x36b4bc,_0x307a21?.[_0x1c75bd(0x15b)],_0x522817),_0xd2f452?this[_0x1c75bd(0x163)](_0x36b4bc):undefined]);if(_0x150b40[_0x1c75bd(0x118)]&&_0x50f075){const _0xaaffb7=buildStageNameMap(_0x50f075);_0x150b40[_0x1c75bd(0x118)]=_0x150b40[_0x1c75bd(0x118)][_0x1c75bd(0x122)](_0x2773ce=>({..._0x2773ce,'journeyStageName':_0xaaffb7[_0x1c75bd(0x170)](_0x2773ce[_0x1c75bd(0x18a)])??_0x2773ce[_0x1c75bd(0x18a)]}));}return _0x150b40;}catch(_0x4c5f59){if(isHttp404Error(_0x4c5f59))throw new SDKError(ErrorCode[_0x1c75bd(0x131)],_0x1c75bd(0x12a)+_0x36b4bc,_0x4c5f59);throw _0x4c5f59;}}async[a116_0x22cd65(0x12c)](_0x263eda,_0x3767af,_0x7c8ab){const _0xdfb337=a116_0x22cd65;if(_0x3767af===_0xdfb337(0x197)){const _0x40faa9=await this[_0xdfb337(0x19c)][_0xdfb337(0x14f)](_0x263eda,_0x7c8ab);return{'conversion':_0x40faa9};}if(_0x3767af===_0xdfb337(0x118)){const _0x94a09d=await this['client'][_0xdfb337(0x130)](_0x263eda,_0x7c8ab);return{'activation':_0x94a09d};}const [_0x5d019b,_0x309be5]=await Promise[_0xdfb337(0x194)]([this[_0xdfb337(0x19c)][_0xdfb337(0x14f)](_0x263eda,_0x7c8ab),this['client'][_0xdfb337(0x130)](_0x263eda,_0x7c8ab)]);return{'conversion':_0x5d019b,'activation':_0x309be5};}async['pause'](_0xb08d9f){const _0x494deb=a116_0x22cd65;try{return await this[_0x494deb(0x19c)][_0x494deb(0x119)](_0xb08d9f);}catch(_0x525f0b){if(isHttp404Error(_0x525f0b))throw new SDKError(ErrorCode[_0x494deb(0x131)],_0x494deb(0x12a)+_0xb08d9f,_0x525f0b);throw _0x525f0b;}}async[a116_0x22cd65(0x135)](_0x4b5bc0){const _0x3e01a2=a116_0x22cd65;try{return await this[_0x3e01a2(0x19c)][_0x3e01a2(0x199)](_0x4b5bc0);}catch(_0xfc2fd0){if(isHttp404Error(_0xfc2fd0))throw new SDKError(ErrorCode[_0x3e01a2(0x131)],'Journey\x20not\x20found:\x20'+_0x4b5bc0,_0xfc2fd0);throw _0xfc2fd0;}}async[a116_0x22cd65(0x176)](_0x13300b){const _0x48e7b5=a116_0x22cd65;return await this['client'][_0x48e7b5(0x16a)](_0x13300b);}async['update'](_0x1c23b2,_0x1d2673){const _0x23b564=a116_0x22cd65;try{return await this[_0x23b564(0x19c)]['updateJourney'](_0x1c23b2,_0x1d2673);}catch(_0x3d8645){if(isHttp404Error(_0x3d8645))throw new SDKError(ErrorCode[_0x23b564(0x131)],'Journey\x20not\x20found:\x20'+_0x1c23b2,_0x3d8645);throw _0x3d8645;}}async[a116_0x22cd65(0x173)](_0x502c24,_0x19cc9c){const _0x491796=a116_0x22cd65;try{return await this[_0x491796(0x19c)][_0x491796(0x142)](_0x502c24,_0x19cc9c);}catch(_0x25ce50){if(isHttp404Error(_0x25ce50))throw new SDKError(ErrorCode[_0x491796(0x137)],_0x491796(0x13f)+_0x19cc9c+_0x491796(0x17f)+_0x502c24,_0x25ce50);throw _0x25ce50;}}async[a116_0x22cd65(0x145)](_0x36f6f4){const _0x497596=a116_0x22cd65;try{return await this[_0x497596(0x19c)][_0x497596(0x185)](_0x36f6f4);}catch(_0x19ac07){if(isHttp404Error(_0x19ac07))return[];throw _0x19ac07;}}async[a116_0x22cd65(0x157)](_0x76f986){const _0x5b9a27=a116_0x22cd65,_0x21a02a=await this[_0x5b9a27(0x145)](_0x76f986);return _0x21a02a[_0x5b9a27(0x122)](flattenJourneyActivation);}async[a116_0x22cd65(0x156)](_0x380818,_0x2969f6){const _0x5e02b3=a116_0x22cd65;return await this[_0x5e02b3(0x19c)]['createJourneyActivation'](_0x380818,_0x2969f6);}async[a116_0x22cd65(0x121)](_0x288c26){const _0x1e15e7=a116_0x22cd65,_0x3ff800=await this[_0x1e15e7(0x163)](_0x288c26),_0x53fe0b=generateColumnMapping(_0x3ff800);return{'journeyId':_0x3ff800['id'],'journeyName':_0x3ff800[_0x1e15e7(0x177)][_0x1e15e7(0x17c)],'database':_0x1e15e7(0x127)+_0x3ff800[_0x1e15e7(0x177)][_0x1e15e7(0x129)],'table':_0x1e15e7(0x168)+_0x3ff800['id'],'columns':_0x53fe0b};}async[a116_0x22cd65(0x164)](_0x5b64f6){const _0x428413=a116_0x22cd65;return this[_0x428413(0x19c)][_0x428413(0x146)](_0x5b64f6);}async['getLatestJourneyId'](_0x4a0ebe){const _0x3f6c71=a116_0x22cd65;if(!_0x4a0ebe)return undefined;try{const _0x33f7b2=await this[_0x3f6c71(0x164)](_0x4a0ebe);return _0x33f7b2[_0x3f6c71(0x16f)];}catch{return undefined;}}async[a116_0x22cd65(0x171)](_0x45f21c){const _0x45ede8=a116_0x22cd65,_0x5ec878=await this[_0x45ede8(0x163)](_0x45f21c),_0xc33ca2=_0x5ec878[_0x45ede8(0x177)][_0x45ede8(0x191)];if(!_0xc33ca2)return{'bundleId':'','bundleName':_0x5ec878[_0x45ede8(0x177)][_0x45ede8(0x17c)],'bundleDescription':_0x5ec878[_0x45ede8(0x177)]['description']??null,'latestJourneyId':_0x5ec878['id'],'versions':[synthesizePreBundleVersion(_0x5ec878)]};const _0x439732=await this[_0x45ede8(0x164)](_0xc33ca2);return{'bundleId':_0xc33ca2,'bundleName':_0x439732[_0x45ede8(0x17c)],'bundleDescription':_0x439732['description']??null,'latestJourneyId':_0x439732[_0x45ede8(0x16f)],'versions':formatVersionsFromBundle(_0x439732)};}async[a116_0x22cd65(0x19a)](_0x489013){const _0x15bd15=a116_0x22cd65,_0x66ff86=await this[_0x15bd15(0x163)](_0x489013),_0x4245b7=_0x66ff86[_0x15bd15(0x177)]['journeyBundleId'];if(!_0x4245b7)throw new SDKError(ErrorCode[_0x15bd15(0x15e)],_0x15bd15(0x12b));await this[_0x15bd15(0x19c)][_0x15bd15(0x150)](_0x4245b7);const _0x25a3f2=await this[_0x15bd15(0x19c)][_0x15bd15(0x146)](_0x4245b7),_0x4e69d=_0x25a3f2[_0x15bd15(0x17c)]+'\x20v'+(_0x25a3f2[_0x15bd15(0x11b)]+0x1);return this[_0x15bd15(0x19c)]['createJourneyVersion'](_0x4245b7,{'sourceId':_0x489013,'attributes':{'name':_0x4e69d}});}}
|
|
1
|
+
const a120_0xa3fbe1=a120_0x58bb;(function(_0x2a7c95,_0x368f0e){const _0x2c3642=a120_0x58bb,_0x2ab094=_0x2a7c95();while(!![]){try{const _0x4d3f33=-parseInt(_0x2c3642(0x180))/0x1+-parseInt(_0x2c3642(0x177))/0x2*(parseInt(_0x2c3642(0x151))/0x3)+parseInt(_0x2c3642(0x184))/0x4+parseInt(_0x2c3642(0x18e))/0x5+parseInt(_0x2c3642(0x199))/0x6+parseInt(_0x2c3642(0x152))/0x7+parseInt(_0x2c3642(0x13e))/0x8*(parseInt(_0x2c3642(0x16f))/0x9);if(_0x4d3f33===_0x368f0e)break;else _0x2ab094['push'](_0x2ab094['shift']());}catch(_0x309c97){_0x2ab094['push'](_0x2ab094['shift']());}}}(a120_0x1020,0xe7fa5));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x1c8de5){const _0x447403=a120_0x58bb;return _0x1c8de5[_0x447403(0x18f)]??_0x1c8de5[_0x447403(0x1ae)]?.[_0x447403(0x18f)]??undefined;}function getVersionNumber(_0x39fa9a){const _0x4d8b30=a120_0x58bb;return _0x39fa9a[_0x4d8b30(0x165)]??_0x39fa9a[_0x4d8b30(0x1ae)]?.[_0x4d8b30(0x165)]??0x0;}function getState(_0x100ee1){const _0x402770=a120_0x58bb;return _0x100ee1[_0x402770(0x17c)]??_0x100ee1['attributes']?.[_0x402770(0x17c)];}export function deduplicateJourneysByBundle(_0x2eba9e){const _0x1d711f=a120_0x58bb,_0x271370=new Map();let _0x182311=0x0;for(const _0x21dded of _0x2eba9e){const _0x1a4376=getBundleId(_0x21dded);if(!_0x1a4376){const _0x562ae9='no-bundle-'+(_0x21dded['id']??_0x1d711f(0x1a3)+_0x182311++);_0x271370[_0x1d711f(0x13d)](_0x562ae9,_0x21dded);continue;}const _0x2cf8c1=_0x271370[_0x1d711f(0x13c)](_0x1a4376);if(!_0x2cf8c1)_0x271370[_0x1d711f(0x13d)](_0x1a4376,_0x21dded);else{const _0x1cd262=getState(_0x2cf8c1)==='launched',_0x1be88b=getState(_0x21dded)===_0x1d711f(0x181);if(_0x1be88b&&!_0x1cd262)_0x271370[_0x1d711f(0x13d)](_0x1a4376,_0x21dded);else{if(!_0x1be88b&&_0x1cd262){}else{const _0x1f4128=getVersionNumber(_0x2cf8c1),_0x1c6dd9=getVersionNumber(_0x21dded);_0x1c6dd9>_0x1f4128&&_0x271370[_0x1d711f(0x13d)](_0x1a4376,_0x21dded);}}}}return Array[_0x1d711f(0x173)](_0x271370[_0x1d711f(0x164)]());}const VALID_JOURNEY_STATES=new Set(['draft',a120_0xa3fbe1(0x147),a120_0xa3fbe1(0x181)]);export function parseJourneyState(_0x22eadd){const _0x31bebd=a120_0xa3fbe1;if(typeof _0x22eadd===_0x31bebd(0x137)&&VALID_JOURNEY_STATES[_0x31bebd(0x185)](_0x22eadd))return _0x22eadd;return _0x31bebd(0x1a8);}export function entityToJourneyListItem(_0x40525e,_0x5cc0c0){const _0x1dc9ea=a120_0xa3fbe1,_0x5f175e=_0x40525e[_0x1dc9ea(0x1ae)];return{'id':_0x40525e['id'],'name':_0x5f175e[_0x1dc9ea(0x138)]??'','journeyBundleName':_0x5f175e['journeyBundleName']??_0x5f175e['name']??'','journeyBundleId':_0x5f175e['journeyBundleId']??'','versionNumber':_0x5f175e[_0x1dc9ea(0x165)],'description':_0x5f175e[_0x1dc9ea(0x1a6)]??null,'state':parseJourneyState(_0x5f175e[_0x1dc9ea(0x17c)]),'paused':_0x5f175e['paused']??![],'audienceId':_0x5cc0c0,'folderId':_0x5f175e['segmentFolderId']??_0x40525e['relationships']?.[_0x1dc9ea(0x172)]?.[_0x1dc9ea(0x162)]?.['id']??null,'createdAt':_0x5f175e[_0x1dc9ea(0x191)]??'','updatedAt':_0x5f175e[_0x1dc9ea(0x150)]??''};}function convertToColumnId(_0x299c5f){return _0x299c5f['replace'](/-/g,'_');}function getStepEntries(_0x3b74e8){const _0x2af0f6=a120_0xa3fbe1;if(!_0x3b74e8)return[];if(Array['isArray'](_0x3b74e8))return _0x3b74e8['map'](_0x1a92a5=>[_0x1a92a5['id'],_0x1a92a5]);return Object[_0x2af0f6(0x1ad)](_0x3b74e8);}export function flattenJourneyActivation(_0x570a65){const _0x1dd23d=a120_0xa3fbe1,{activationParams:_0x1d0ce1,activationId:_0x170563,runAfterJourneyRefresh:_0x546e7d}=_0x570a65[_0x1dd23d(0x1ae)];return{'id':_0x570a65['id'],'activationId':_0x170563,'runAfterJourneyRefresh':_0x546e7d,..._0x1d0ce1};}function col(_0x2e6efc,_0x48401e={}){const _0xf1e516=a120_0xa3fbe1;return{'column':_0x2e6efc,'direction':null,'stageIndex':null,'stageName':null,'category':_0xf1e516(0x14e),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x48401e};}export function generateColumnMapping(_0x4672a9){const _0x21b500=a120_0xa3fbe1,_0x10fa7d=[];_0x10fa7d['push'](col('cdp_customer_id')),_0x10fa7d[_0x21b500(0x170)](col('intime_journey',{'direction':'in','category':_0x21b500(0x143)})),_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x158),{'direction':_0x21b500(0x153),'category':_0x21b500(0x143)}));_0x4672a9[_0x21b500(0x1ae)][_0x21b500(0x1ab)]&&_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x15e),{'direction':'in','category':_0x21b500(0x1ab),'detail':_0x4672a9['attributes'][_0x21b500(0x1ab)][_0x21b500(0x138)]||null}));const _0xc663f=_0x4672a9[_0x21b500(0x1ae)]['journeyStages']||[];for(let _0x8a5a5=0x0;_0x8a5a5<_0xc663f[_0x21b500(0x1a9)];_0x8a5a5++){const _0x595bd7=_0xc663f[_0x8a5a5],_0xcc1e53=_0x595bd7[_0x21b500(0x138)],_0x4910ba={'stageIndex':_0x8a5a5,'stageName':_0xcc1e53},_0x22a003=_0x595bd7[_0x21b500(0x1b7)]?.[_0x21b500(0x138)]||null;_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x1af)+_0x8a5a5,{..._0x4910ba,'direction':'in','category':_0x21b500(0x190),'detail':_0x22a003})),_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x16a)+_0x8a5a5,{..._0x4910ba,'direction':'out','category':_0x21b500(0x190),'detail':_0x22a003}));_0x595bd7[_0x21b500(0x15c)]&&_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x1af)+_0x8a5a5+'_milestone',{..._0x4910ba,'direction':'in','category':_0x21b500(0x15c),'detail':_0x595bd7[_0x21b500(0x15c)][_0x21b500(0x138)]||null}));const _0x16e3a1=_0x595bd7[_0x21b500(0x155)]||_0x595bd7[_0x21b500(0x1a2)]||[];for(let _0x499b1e=0x0;_0x499b1e<_0x16e3a1[_0x21b500(0x1a9)];_0x499b1e++){_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x1af)+_0x8a5a5+_0x21b500(0x166)+_0x499b1e,{..._0x4910ba,'direction':'in','category':_0x21b500(0x193),'detail':_0x16e3a1[_0x499b1e][_0x21b500(0x138)]||null}));}const _0x406744=getStepEntries(_0x595bd7[_0x21b500(0x13f)]);for(const [_0x536f9c,_0x2202d2]of _0x406744){const _0x5e3184=convertToColumnId(_0x536f9c),_0x102bfb=_0x2202d2[_0x21b500(0x17d)]||null,_0x4071e9=_0x2202d2[_0x21b500(0x138)]||null,_0x5f3d03={..._0x4910ba,'stepType':_0x102bfb,'stepName':_0x4071e9,'stepId':_0x536f9c};_0x10fa7d['push'](col('intime_stage_'+_0x8a5a5+'_'+_0x5e3184,{..._0x5f3d03,'direction':'in','category':'step'})),_0x10fa7d['push'](col(_0x21b500(0x16a)+_0x8a5a5+'_'+_0x5e3184,{..._0x5f3d03,'direction':_0x21b500(0x153),'category':_0x21b500(0x14c)}));if(_0x2202d2[_0x21b500(0x17d)]===_0x21b500(0x19a)&&_0x2202d2[_0x21b500(0x19b)])for(const _0x26cbc2 of _0x2202d2[_0x21b500(0x19b)]){_0x26cbc2['segmentId']&&_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x1af)+_0x8a5a5+'_'+_0x5e3184+'_'+_0x26cbc2[_0x21b500(0x183)],{..._0x5f3d03,'direction':'in','category':_0x21b500(0x14b),'detail':_0x26cbc2['name']||(_0x26cbc2[_0x21b500(0x194)]?_0x21b500(0x1b5):null)}));}if((_0x2202d2[_0x21b500(0x17d)]===_0x21b500(0x189)||_0x2202d2[_0x21b500(0x17d)]===_0x21b500(0x14f))&&_0x2202d2[_0x21b500(0x14d)])for(const _0x542346 of _0x2202d2[_0x21b500(0x14d)]){_0x542346['id']&&_0x10fa7d[_0x21b500(0x170)](col('intime_stage_'+_0x8a5a5+'_'+_0x5e3184+_0x21b500(0x1a7)+convertToColumnId(_0x542346['id']),{..._0x5f3d03,'direction':'in','category':_0x21b500(0x188),'detail':_0x542346['name']||null}));}if(_0x2202d2['type']===_0x21b500(0x182)||_0x2202d2[_0x21b500(0x17d)]==='Wait'){const _0x3eea88=[];if(_0x2202d2[_0x21b500(0x1b9)])_0x3eea88[_0x21b500(0x170)](_0x2202d2['conditionSegmentId']);else{if(Array[_0x21b500(0x154)](_0x2202d2[_0x21b500(0x17b)]))for(const _0x1e3c27 of _0x2202d2[_0x21b500(0x17b)]){_0x1e3c27[_0x21b500(0x183)]&&!_0x1e3c27[_0x21b500(0x14a)]&&_0x3eea88['push'](_0x1e3c27[_0x21b500(0x183)]);}else _0x2202d2[_0x21b500(0x142)]?.[_0x21b500(0x183)]&&_0x3eea88['push'](_0x2202d2[_0x21b500(0x142)]['segmentId']);}for(const _0x34b9a2 of _0x3eea88){_0x10fa7d[_0x21b500(0x170)](col(_0x21b500(0x1af)+_0x8a5a5+'_'+_0x5e3184+'_'+_0x34b9a2,{..._0x5f3d03,'direction':'in','category':_0x21b500(0x14b)}));}}}}return _0x10fa7d['push'](col(_0x21b500(0x15a))),_0x10fa7d;}export function aggregateJourneyHistory(_0x47c719){const _0x50171b=a120_0xa3fbe1,_0x570989=_0x47c719['reduce']((_0x4dd998,_0x577d44)=>_0x4dd998+(_0x577d44['entryInflux']??0x0),0x0),_0x5a0e7e=_0x47c719[_0x50171b(0x163)]((_0x51d7a3,_0x3624cd)=>_0x51d7a3+(_0x3624cd[_0x50171b(0x198)]??0x0),0x0),_0x224d05=_0x47c719[_0x50171b(0x163)]((_0x21f778,_0x2e46ef)=>_0x21f778+((_0x2e46ef[_0x50171b(0x1a4)]??0x0)+(_0x2e46ef[_0x50171b(0x13b)]??0x0)),0x0),_0x1e93fc=_0x47c719[_0x47c719[_0x50171b(0x1a9)]-0x1];return{'size':_0x1e93fc?.[_0x50171b(0x19f)]??0x0,'entered':_0x570989,'goal_achieved':_0x5a0e7e,'completion_rate':_0x5a0e7e&&_0x570989?_0x5a0e7e/_0x570989*0x64:0x0,'exit_or_jump':_0x224d05,'exit_or_jump_rate':_0x224d05&&_0x570989?_0x224d05/_0x570989*0x64:0x0};}function a120_0x1020(){const _0x450614=['fetchTrafficRaw','journeys','simulation','getActivation','folder-segment','timedOutPath','branch','step','variants','fixed','ABTest','updatedAt','148206Pvlhhc','5459104dbpRnl','out','isArray','exitCriterias','\x20in\x20journey\x20','update','outtime_journey','getStatistics','time','listActivationsFlat','milestone','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','intime_goal','getConversionSankeyChart','cdp_audience_','includeAllVersions','data','reduce','values','versionNumber','_exit_','listEntitiesByFolder','listJourneysWithDetailsFromParentSegment','client','outtime_stage_','updateJourney','rootFolderId','all','resumeJourney','144okuKht','push','createJourney','parentFolder','from','getJourney','sort','filter','34KINCAM','getJourneyBundle','journeyBundleName','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','conditions','state','type','getLatestJourneyId','conversion','1894513MSSMjV','launched','WaitStep','segmentId','2403932LvFdrm','has','journeyStageId','createJourneyActivation','variant','AbTest','lastVersionNumber','limit','journeyStages','milestoneInflux','7905485yELzkd','journeyBundleId','stage','createdAt','resume','exit_criteria','excluded','Journey\x20activation\x20step\x20not\x20found:\x20','find','create','goalInflux','1772928jChMEv','DecisionPoint','branches','INVALID_ARGUMENT','getActivationSankeyChart','listSegmentFolders','size','listJourneys','listJourneysFromParentSegment','exitCriteria','idx-','exitInflux','exitOrJumpSize','description','_variant_','draft','length','add','goal','getTrafficData','entries','attributes','intime_stage_','getJourneyStatistics','toLowerCase','listActivations','paused','listVersions','Excluded\x20profiles','completionRate','entryCriteria','pauseJourney','conditionSegmentId','latestJourneyId','goalSize','activation','getBundle','history','JOURNEY_NOT_FOUND','journeyId','applyVersionDeduplication','string','name','map','Journey\x20not\x20found:\x20','jumpInflux','get','set','213544TiLjPw','steps','NOT_FOUND','listJourneyActivations','waitCondition','journey','listJourneysWithDetails'];a120_0x1020=function(){return _0x450614;};return a120_0x1020();}export function aggregateStageHistory(_0x7d8880){const _0x3e9586=a120_0xa3fbe1,_0x4542a5=_0x7d8880[_0x3e9586(0x163)]((_0x4206ce,_0x2f68de)=>_0x4206ce+(_0x2f68de['entryInflux']??0x0),0x0),_0x31ae3c=_0x7d8880['reduce']((_0x2c82c7,_0x3b9bea)=>_0x2c82c7+(_0x3b9bea[_0x3e9586(0x18d)]??0x0),0x0),_0x58e9a2=_0x7d8880['reduce']((_0x523e49,_0x273067)=>_0x523e49+((_0x273067['exitInflux']??0x0)+(_0x273067[_0x3e9586(0x13b)]??0x0)),0x0),_0x1ddb13=_0x7d8880[_0x7d8880[_0x3e9586(0x1a9)]-0x1];return{'size':_0x1ddb13?.[_0x3e9586(0x19f)]??0x0,'entered':_0x4542a5,'milestone':_0x31ae3c,'milestone_rate':_0x31ae3c&&_0x4542a5?_0x31ae3c/_0x4542a5*0x64:0x0,'exit_or_jump':_0x58e9a2,'exit_or_jump_rate':_0x58e9a2&&_0x4542a5?_0x58e9a2/_0x4542a5*0x64:0x0};}export function assembleJourneyStats(_0x263150,_0x448be2){const _0x436a77=a120_0xa3fbe1,_0x40bffc=!!(_0x448be2?.[_0x436a77(0x173)]||_0x448be2?.['to'])&&!!_0x263150['history']?.[_0x436a77(0x1a9)];if(_0x40bffc){const _0x3bc7e5=aggregateJourneyHistory(_0x263150[_0x436a77(0x133)]),_0x310400={'journey_id':_0x263150[_0x436a77(0x135)],..._0x448be2?.['from']&&{'from':_0x448be2[_0x436a77(0x173)]},..._0x448be2?.['to']&&{'to':_0x448be2['to']},..._0x3bc7e5};return _0x448be2?.['includeHistory']&&(_0x310400[_0x436a77(0x133)]=_0x263150['history']),_0x310400;}return{'journey_id':_0x263150[_0x436a77(0x135)],'size':_0x263150[_0x436a77(0x19f)],'entered':_0x263150['enteredSize'],'goal_achieved':_0x263150[_0x436a77(0x1bb)],'completion_rate':_0x263150[_0x436a77(0x1b6)],'exit_or_jump':_0x263150[_0x436a77(0x1a5)],'exit_or_jump_rate':_0x263150['exitOrJumpRate']};}function a120_0x58bb(_0x1e95b2,_0x233285){_0x1e95b2=_0x1e95b2-0x131;const _0x10202d=a120_0x1020();let _0x58bbf0=_0x10202d[_0x1e95b2];return _0x58bbf0;}export function formatVersionsFromBundle(_0x51c707){const _0x4e4671=a120_0xa3fbe1,_0x54bd26=_0x51c707['journeys'][_0x4e4671(0x139)](_0x6365a3=>({'journeyId':_0x6365a3['id'],'versionNumber':_0x6365a3[_0x4e4671(0x1ae)][_0x4e4671(0x165)]??0x0,'name':_0x6365a3[_0x4e4671(0x1ae)][_0x4e4671(0x138)],'state':_0x6365a3[_0x4e4671(0x1ae)][_0x4e4671(0x17c)],'paused':_0x6365a3[_0x4e4671(0x1ae)][_0x4e4671(0x1b3)],'createdAt':_0x6365a3[_0x4e4671(0x1ae)][_0x4e4671(0x191)],'updatedAt':_0x6365a3['attributes'][_0x4e4671(0x150)]}));return _0x54bd26[_0x4e4671(0x175)]((_0x1334d3,_0x2ff739)=>_0x1334d3[_0x4e4671(0x165)]-_0x2ff739[_0x4e4671(0x165)]),_0x54bd26;}export function synthesizePreBundleVersion(_0x34149){const _0x3347da=a120_0xa3fbe1;return{'journeyId':_0x34149['id'],'versionNumber':0x1,'name':_0x34149['attributes']['name'],'state':_0x34149[_0x3347da(0x1ae)]['state'],'paused':_0x34149[_0x3347da(0x1ae)]['paused'],'createdAt':_0x34149['attributes']['createdAt'],'updatedAt':_0x34149[_0x3347da(0x1ae)][_0x3347da(0x150)]};}export function buildStageNameMap(_0x502926){const _0x3daf4a=a120_0xa3fbe1;return new Map(_0x502926['attributes'][_0x3daf4a(0x18c)]?.['map'](_0x4dbd85=>[_0x4dbd85['id'],_0x4dbd85[_0x3daf4a(0x138)]])??[]);}export class JourneySDK{[a120_0xa3fbe1(0x169)];constructor(_0x47c952){const _0x3a93b5=a120_0xa3fbe1;this[_0x3a93b5(0x169)]=new CDPApiClient(_0x47c952);}['applyVersionDeduplication'](_0x15b240,_0x5d7142){return _0x5d7142?_0x15b240:deduplicateJourneysByBundle(_0x15b240);}async[a120_0xa3fbe1(0x144)](_0x3d92dd,_0x4f80a1){const _0x158b0a=a120_0xa3fbe1;try{const _0x518110=await this['client'][_0x158b0a(0x144)](_0x3d92dd);return{'journeys':this[_0x158b0a(0x136)](_0x518110[_0x158b0a(0x146)],_0x4f80a1),'activationStepsById':_0x518110['activationStepsById']};}catch(_0x25793e){if(isHttp404Error(_0x25793e))return{'journeys':[],'activationStepsById':new Map()};throw _0x25793e;}}async[a120_0xa3fbe1(0x1a1)](_0x143cc5,_0x401250,_0x1c4894){const _0x25fe44=a120_0xa3fbe1;let _0x5aa6ed=_0x401250;if(!_0x5aa6ed)try{const _0x2c3cc0=await this['client']['getParentSegmentFull'](_0x143cc5);_0x5aa6ed=_0x2c3cc0[_0x25fe44(0x16c)]??undefined;}catch(_0x2aa14d){if(isHttp404Error(_0x2aa14d))return[];throw _0x2aa14d;}if(!_0x5aa6ed)return[];let _0x19af92;if(_0x1c4894?.[_0x25fe44(0x161)]){const _0x2693d9=await this['client']['listSegmentFolders'](_0x143cc5),_0x21692b=_0x2693d9[_0x25fe44(0x139)](_0x5efe2a=>this['client'][_0x25fe44(0x1a0)](_0x5efe2a['id'])),_0x252e06=await Promise[_0x25fe44(0x16d)](_0x21692b),_0x1f4953=new Set();_0x19af92=_0x252e06['flat']()[_0x25fe44(0x176)](_0x52d6ac=>{const _0x175619=_0x25fe44;if(_0x1f4953[_0x175619(0x185)](_0x52d6ac['id']))return![];return _0x1f4953[_0x175619(0x1aa)](_0x52d6ac['id']),!![];});}else{const _0x53a9d2=await this[_0x25fe44(0x169)]['listEntitiesByFolder'](_0x5aa6ed,0x20,![]),_0x1d73c3=_0x53a9d2[_0x25fe44(0x162)],_0x742e13=_0x1d73c3[_0x25fe44(0x176)](_0x3dc3fd=>_0x3dc3fd[_0x25fe44(0x17d)]===_0x25fe44(0x143));_0x19af92=_0x742e13[_0x25fe44(0x139)](_0x4f70d4=>entityToJourneyListItem(_0x4f70d4,_0x143cc5));}return this[_0x25fe44(0x136)](_0x19af92,_0x1c4894?.[_0x25fe44(0x161)]);}async['listJourneysWithFolders'](_0x3c50f0,_0x5cd370,_0x4c3e49){const _0x4c8ce8=a120_0xa3fbe1;if(!_0x5cd370)return{'journeys':[],'folders':[]};const _0x24400b=await this[_0x4c8ce8(0x169)][_0x4c8ce8(0x167)](_0x5cd370,0x20,![]),_0x373a6b=_0x24400b[_0x4c8ce8(0x162)],_0x110689=_0x373a6b['filter'](_0x37f397=>_0x37f397[_0x4c8ce8(0x17d)]===_0x4c8ce8(0x149)&&_0x37f397['id']!==_0x5cd370),_0x297c45=_0x110689[_0x4c8ce8(0x139)](_0x266714=>({'id':_0x266714['id'],'name':_0x266714[_0x4c8ce8(0x1ae)][_0x4c8ce8(0x138)]})),_0xfc317a=_0x373a6b[_0x4c8ce8(0x176)](_0x182f9d=>_0x182f9d[_0x4c8ce8(0x17d)]==='journey'),_0x177227=_0xfc317a['map'](_0x37c233=>entityToJourneyListItem(_0x37c233,_0x3c50f0));return{'journeys':this[_0x4c8ce8(0x136)](_0x177227,_0x4c3e49?.[_0x4c8ce8(0x161)]),'folders':_0x297c45};}async[a120_0xa3fbe1(0x168)](_0x2f710d,_0x4d591c){const _0x3c0e68=a120_0xa3fbe1;let _0x4a2bb8;try{_0x4a2bb8=await this[_0x3c0e68(0x169)][_0x3c0e68(0x19e)](_0x2f710d);}catch(_0x4a8d94){if(isHttp404Error(_0x4a8d94))return{'journeys':[],'activationStepsById':new Map()};throw _0x4a8d94;}const _0x491d17=_0x4a2bb8[_0x3c0e68(0x139)](async _0x437bf7=>{const _0x38bcbe=_0x3c0e68;return await this[_0x38bcbe(0x144)](_0x437bf7['id'],_0x4d591c?.['includeAllVersions']);}),_0x3d18c1=await Promise['all'](_0x491d17),_0xac1c4e=new Map(),_0x16cdf6=[];for(const _0x53d5e0 of _0x3d18c1){_0x16cdf6['push'](..._0x53d5e0['journeys']);for(const [_0x5c4423,_0x4403b6]of _0x53d5e0['activationStepsById']){_0xac1c4e['set'](_0x5c4423,_0x4403b6);}}const _0x124bc2=new Set(),_0x513fde=_0x16cdf6[_0x3c0e68(0x176)](_0x50af48=>{const _0x2df8d9=_0x3c0e68;if(_0x124bc2[_0x2df8d9(0x185)](_0x50af48['id']))return![];return _0x124bc2[_0x2df8d9(0x1aa)](_0x50af48['id']),!![];});return{'journeys':this['applyVersionDeduplication'](_0x513fde,_0x4d591c?.[_0x3c0e68(0x161)]),'activationStepsById':_0xac1c4e};}async[a120_0xa3fbe1(0x174)](_0xd028ec){const _0xb33a63=a120_0xa3fbe1;try{return await this[_0xb33a63(0x169)][_0xb33a63(0x174)](_0xd028ec);}catch(_0xbdc9dc){if(isHttp404Error(_0xbdc9dc))throw new SDKError(ErrorCode[_0xb33a63(0x134)],'Journey\x20not\x20found:\x20'+_0xd028ec,_0xbdc9dc);throw _0xbdc9dc;}}async['resolveJourneyId'](_0x6e3f70,_0xcd240d){const _0x4a01c5=a120_0xa3fbe1,_0x23dda0=await this['listJourneysFromParentSegment'](_0x6e3f70),_0x159ca9=_0x23dda0[_0x4a01c5(0x196)](_0x2223a9=>_0x2223a9[_0x4a01c5(0x179)][_0x4a01c5(0x1b1)]()===_0xcd240d['toLowerCase']());if(!_0x159ca9)throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x4a01c5(0x13a)+_0xcd240d,undefined,{'helpText':_0x4a01c5(0x15d)});return _0x159ca9['id'];}async[a120_0xa3fbe1(0x159)](_0x23cdb1,_0x1840cb){const _0x2a2f35=a120_0xa3fbe1;try{return await this[_0x2a2f35(0x169)][_0x2a2f35(0x1b0)](_0x23cdb1,_0x1840cb);}catch(_0x3396c2){if(isHttp404Error(_0x3396c2))throw new SDKError(ErrorCode[_0x2a2f35(0x134)],'Journey\x20not\x20found:\x20'+_0x23cdb1,_0x3396c2);throw _0x3396c2;}}async[a120_0xa3fbe1(0x1ac)](_0x220e15,_0x5145a9){const _0x34c1f9=a120_0xa3fbe1,_0x4c6aaa={'from':_0x5145a9?.['from'],'to':_0x5145a9?.['to'],'limit':_0x5145a9?.[_0x34c1f9(0x18b)]},_0x538fc9=_0x5145a9?.['type']!==_0x34c1f9(0x17f);try{const [_0x26ef10,_0x3c4c83]=await Promise[_0x34c1f9(0x16d)]([this['fetchTrafficRaw'](_0x220e15,_0x5145a9?.[_0x34c1f9(0x17d)],_0x4c6aaa),_0x538fc9?this['getJourney'](_0x220e15):undefined]);if(_0x26ef10['activation']&&_0x3c4c83){const _0x575603=buildStageNameMap(_0x3c4c83);_0x26ef10[_0x34c1f9(0x131)]=_0x26ef10[_0x34c1f9(0x131)][_0x34c1f9(0x139)](_0x1049f7=>({..._0x1049f7,'journeyStageName':_0x575603[_0x34c1f9(0x13c)](_0x1049f7[_0x34c1f9(0x186)])??_0x1049f7[_0x34c1f9(0x186)]}));}return _0x26ef10;}catch(_0x3af1ca){if(isHttp404Error(_0x3af1ca))throw new SDKError(ErrorCode[_0x34c1f9(0x134)],_0x34c1f9(0x13a)+_0x220e15,_0x3af1ca);throw _0x3af1ca;}}async[a120_0xa3fbe1(0x145)](_0x3a6e5d,_0x39ce14,_0x33a25c){const _0x204b96=a120_0xa3fbe1;if(_0x39ce14==='conversion'){const _0xd73c24=await this[_0x204b96(0x169)][_0x204b96(0x15f)](_0x3a6e5d,_0x33a25c);return{'conversion':_0xd73c24};}if(_0x39ce14===_0x204b96(0x131)){const _0x2057c9=await this['client'][_0x204b96(0x19d)](_0x3a6e5d,_0x33a25c);return{'activation':_0x2057c9};}const [_0x165ab8,_0x473fec]=await Promise['all']([this[_0x204b96(0x169)][_0x204b96(0x15f)](_0x3a6e5d,_0x33a25c),this['client'][_0x204b96(0x19d)](_0x3a6e5d,_0x33a25c)]);return{'conversion':_0x165ab8,'activation':_0x473fec};}async['pause'](_0x2d109b){const _0x1c5a85=a120_0xa3fbe1;try{return await this['client'][_0x1c5a85(0x1b8)](_0x2d109b);}catch(_0x9f8ae1){if(isHttp404Error(_0x9f8ae1))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],'Journey\x20not\x20found:\x20'+_0x2d109b,_0x9f8ae1);throw _0x9f8ae1;}}async[a120_0xa3fbe1(0x192)](_0x836a14){const _0x323422=a120_0xa3fbe1;try{return await this[_0x323422(0x169)][_0x323422(0x16e)](_0x836a14);}catch(_0x34597a){if(isHttp404Error(_0x34597a))throw new SDKError(ErrorCode[_0x323422(0x134)],'Journey\x20not\x20found:\x20'+_0x836a14,_0x34597a);throw _0x34597a;}}async[a120_0xa3fbe1(0x197)](_0x31678d){const _0x36f34e=a120_0xa3fbe1;return await this['client'][_0x36f34e(0x171)](_0x31678d);}async[a120_0xa3fbe1(0x157)](_0xed9d60,_0x593e96){const _0x106858=a120_0xa3fbe1;try{return await this[_0x106858(0x169)][_0x106858(0x16b)](_0xed9d60,_0x593e96);}catch(_0x6bf35e){if(isHttp404Error(_0x6bf35e))throw new SDKError(ErrorCode[_0x106858(0x134)],_0x106858(0x13a)+_0xed9d60,_0x6bf35e);throw _0x6bf35e;}}async[a120_0xa3fbe1(0x148)](_0x5908d3,_0x33930d){const _0x42487a=a120_0xa3fbe1;try{return await this[_0x42487a(0x169)]['getJourneyActivation'](_0x5908d3,_0x33930d);}catch(_0x57ff92){if(isHttp404Error(_0x57ff92))throw new SDKError(ErrorCode[_0x42487a(0x140)],_0x42487a(0x195)+_0x33930d+_0x42487a(0x156)+_0x5908d3,_0x57ff92);throw _0x57ff92;}}async[a120_0xa3fbe1(0x1b2)](_0x48e915){const _0x3ce455=a120_0xa3fbe1;try{return await this[_0x3ce455(0x169)][_0x3ce455(0x141)](_0x48e915);}catch(_0x42df97){if(isHttp404Error(_0x42df97))return[];throw _0x42df97;}}async[a120_0xa3fbe1(0x15b)](_0x481b11){const _0x5eca7d=a120_0xa3fbe1,_0x458a45=await this[_0x5eca7d(0x1b2)](_0x481b11);return _0x458a45[_0x5eca7d(0x139)](flattenJourneyActivation);}async['createActivation'](_0x4198e6,_0x5e5b4a){const _0x342549=a120_0xa3fbe1;return await this[_0x342549(0x169)][_0x342549(0x187)](_0x4198e6,_0x5e5b4a);}async['getColumnMapping'](_0x3494f7){const _0x5a007f=a120_0xa3fbe1,_0xe1f56a=await this['getJourney'](_0x3494f7),_0x173c1c=generateColumnMapping(_0xe1f56a);return{'journeyId':_0xe1f56a['id'],'journeyName':_0xe1f56a[_0x5a007f(0x1ae)][_0x5a007f(0x138)],'database':_0x5a007f(0x160)+_0xe1f56a['attributes']['audienceId'],'table':'journey_'+_0xe1f56a['id'],'columns':_0x173c1c};}async['getBundle'](_0x524cc1){const _0x3f78d6=a120_0xa3fbe1;return this['client'][_0x3f78d6(0x178)](_0x524cc1);}async[a120_0xa3fbe1(0x17e)](_0x39cd10){const _0x1e1a70=a120_0xa3fbe1;if(!_0x39cd10)return undefined;try{const _0xfa7529=await this[_0x1e1a70(0x132)](_0x39cd10);return _0xfa7529[_0x1e1a70(0x1ba)];}catch{return undefined;}}async[a120_0xa3fbe1(0x1b4)](_0x59d262){const _0x5921ec=a120_0xa3fbe1,_0xd7cd00=await this[_0x5921ec(0x174)](_0x59d262),_0x1eab8c=_0xd7cd00['attributes'][_0x5921ec(0x18f)];if(!_0x1eab8c)return{'bundleId':'','bundleName':_0xd7cd00[_0x5921ec(0x1ae)][_0x5921ec(0x138)],'bundleDescription':_0xd7cd00['attributes']['description']??null,'latestJourneyId':_0xd7cd00['id'],'versions':[synthesizePreBundleVersion(_0xd7cd00)]};const _0x42620d=await this[_0x5921ec(0x132)](_0x1eab8c);return{'bundleId':_0x1eab8c,'bundleName':_0x42620d[_0x5921ec(0x138)],'bundleDescription':_0x42620d[_0x5921ec(0x1a6)]??null,'latestJourneyId':_0x42620d[_0x5921ec(0x1ba)],'versions':formatVersionsFromBundle(_0x42620d)};}async['createVersion'](_0x2fa247){const _0x562a9e=a120_0xa3fbe1,_0x7d23d3=await this['getJourney'](_0x2fa247),_0x264ad0=_0x7d23d3['attributes'][_0x562a9e(0x18f)];if(!_0x264ad0)throw new SDKError(ErrorCode[_0x562a9e(0x19c)],_0x562a9e(0x17a));await this[_0x562a9e(0x169)]['checkJourneyAppendable'](_0x264ad0);const _0x541b1d=await this[_0x562a9e(0x169)]['getJourneyBundle'](_0x264ad0),_0x1b6dd0=_0x541b1d[_0x562a9e(0x138)]+'\x20v'+(_0x541b1d[_0x562a9e(0x18a)]+0x1);return this['client']['createJourneyVersion'](_0x264ad0,{'sourceId':_0x2fa247,'attributes':{'name':_0x1b6dd0}});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a121_0x5096(){const _0x3ee8c1=['last_chat_id','1347269hgBvMe','918440TtFnCe','2157185rJFRKo','write','31AetOBu','2139530UuvPWV','3000zgYJEm','18kHBSah','807777oLnGvd','2112840AQVvnx','clear','4xRRtwX'];a121_0x5096=function(){return _0x3ee8c1;};return a121_0x5096();}const a121_0x50d24f=a121_0x174e;(function(_0x589d9c,_0x4ce06f){const _0xdfb75b=a121_0x174e,_0x31d149=_0x589d9c();while(!![]){try{const _0x5e8f2b=parseInt(_0xdfb75b(0xc0))/0x1*(-parseInt(_0xdfb75b(0xc2))/0x2)+-parseInt(_0xdfb75b(0xc4))/0x3*(parseInt(_0xdfb75b(0xc7))/0x4)+-parseInt(_0xdfb75b(0xcb))/0x5+parseInt(_0xdfb75b(0xc5))/0x6+parseInt(_0xdfb75b(0xc9))/0x7+parseInt(_0xdfb75b(0xca))/0x8+parseInt(_0xdfb75b(0xc3))/0x9*(parseInt(_0xdfb75b(0xc1))/0xa);if(_0x5e8f2b===_0x4ce06f)break;else _0x31d149['push'](_0x31d149['shift']());}catch(_0x33837b){_0x31d149['push'](_0x31d149['shift']());}}}(a121_0x5096,0x5309a));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a121_0x50d24f(0xc8),'llm/chat');export function saveLastChatId(_0x1d6f13){const _0x1c42f=a121_0x50d24f;chatIdCache[_0x1c42f(0xbf)](_0x1d6f13);}export function loadLastChatId(){return chatIdCache['read']();}function a121_0x174e(_0x23aee5,_0x4acb40){_0x23aee5=_0x23aee5-0xbf;const _0x5096f3=a121_0x5096();let _0x174e8b=_0x5096f3[_0x23aee5];return _0x174e8b;}export function clearLastChatId(){const _0x4f93a8=a121_0x50d24f;chatIdCache[_0x4f93a8(0xc6)]();}
|