@treasuredata/tdx 0.28.3 → 0.28.4

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.
Files changed (184) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/delivery-command.js +1 -1
  18. package/dist/commands/describe.js +1 -1
  19. package/dist/commands/engage-campaign-pull-command.js +1 -1
  20. package/dist/commands/engage-campaign-push-command.js +1 -1
  21. package/dist/commands/engage-campaign-validate-command.js +1 -1
  22. package/dist/commands/engage-command.js +1 -1
  23. package/dist/commands/job-command.js +1 -1
  24. package/dist/commands/journey-command.js +1 -1
  25. package/dist/commands/journey-validate-command.js +1 -1
  26. package/dist/commands/llm-command.js +1 -1
  27. package/dist/commands/mcp-command.js +1 -1
  28. package/dist/commands/parent-segment-command.js +1 -1
  29. package/dist/commands/profile-command.js +1 -1
  30. package/dist/commands/profiles-command.js +1 -1
  31. package/dist/commands/query-command.js +1 -1
  32. package/dist/commands/schedule-command.js +1 -1
  33. package/dist/commands/segment-command.js +1 -1
  34. package/dist/commands/segment-create-command.js +1 -1
  35. package/dist/commands/segment-fields-command.js +1 -1
  36. package/dist/commands/segment-pull-command.js +1 -1
  37. package/dist/commands/segment-push-command.js +1 -1
  38. package/dist/commands/segment-update-command.js +1 -1
  39. package/dist/commands/segment-use-command.js +1 -1
  40. package/dist/commands/segment-validate-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/status-command.js +1 -1
  44. package/dist/commands/tables.js +1 -1
  45. package/dist/commands/unset-command.js +1 -1
  46. package/dist/commands/use-command.js +1 -1
  47. package/dist/commands/user-command.js +1 -1
  48. package/dist/commands/workflow-command.js +1 -1
  49. package/dist/core/auth.js +1 -1
  50. package/dist/core/command-output.js +1 -1
  51. package/dist/core/config.js +1 -1
  52. package/dist/core/connection-cache.js +1 -1
  53. package/dist/core/constants.js +1 -1
  54. package/dist/core/credential-cache.js +1 -1
  55. package/dist/core/global-context.js +1 -1
  56. package/dist/core/keychain.js +1 -1
  57. package/dist/core/profile.js +1 -1
  58. package/dist/core/project-config.js +1 -1
  59. package/dist/core/session.js +1 -1
  60. package/dist/core/user-cache.js +1 -1
  61. package/dist/core/version.js +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/mcp/server.js +1 -1
  64. package/dist/mcp/tools/index.js +1 -1
  65. package/dist/mcp/tools/tdx-run.js +1 -1
  66. package/dist/mcp/tools/tdx-search.js +1 -1
  67. package/dist/mcp/utils.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/passthrough-server.js +1 -1
  70. package/dist/proxy/sse-usage-parser.js +1 -1
  71. package/dist/sdk/agent/agent-config.js +1 -1
  72. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/agent/test/evaluator.js +1 -1
  75. package/dist/sdk/agent/test/executor.js +1 -1
  76. package/dist/sdk/agent/test/index.js +1 -1
  77. package/dist/sdk/agent/test/output.js +1 -1
  78. package/dist/sdk/agent/test/parser.js +1 -1
  79. package/dist/sdk/agent/tool-target-registry.js +1 -1
  80. package/dist/sdk/api.js +1 -1
  81. package/dist/sdk/client/cdp-api-client.js +1 -1
  82. package/dist/sdk/client/delivery-api-client.js +1 -1
  83. package/dist/sdk/client/endpoints.js +1 -1
  84. package/dist/sdk/client/engage-api-client.js +1 -1
  85. package/dist/sdk/client/http-client.js +1 -1
  86. package/dist/sdk/client/llm-api-client.js +1 -1
  87. package/dist/sdk/client/rate-limiter.js +1 -1
  88. package/dist/sdk/client/td-api-client.js +1 -1
  89. package/dist/sdk/client/trino-api-client.js +1 -1
  90. package/dist/sdk/client/workflow-client.js +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection.js +1 -1
  93. package/dist/sdk/delivery.js +1 -1
  94. package/dist/sdk/engage/campaign-pull.js +1 -1
  95. package/dist/sdk/engage/campaign-push.js +1 -1
  96. package/dist/sdk/engage/campaign-validator.js +1 -1
  97. package/dist/sdk/engage/campaign-yaml.js +1 -1
  98. package/dist/sdk/engage/types/campaign-def.js +1 -1
  99. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  100. package/dist/sdk/engage.js +1 -1
  101. package/dist/sdk/errors.js +1 -1
  102. package/dist/sdk/index.js +1 -1
  103. package/dist/sdk/io/index.js +1 -1
  104. package/dist/sdk/io/node-filesystem.js +1 -1
  105. package/dist/sdk/job.js +1 -1
  106. package/dist/sdk/journey.js +1 -1
  107. package/dist/sdk/llm/chat-cache.js +1 -1
  108. package/dist/sdk/llm/index.js +1 -1
  109. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  110. package/dist/sdk/llm/model-factors.js +1 -1
  111. package/dist/sdk/personalization.js +1 -1
  112. package/dist/sdk/query/index.js +1 -1
  113. package/dist/sdk/query/sql-parser.js +1 -1
  114. package/dist/sdk/realtime.js +1 -1
  115. package/dist/sdk/schedule.js +1 -1
  116. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  117. package/dist/sdk/segment/fields-display.js +1 -1
  118. package/dist/sdk/segment/file-discovery.js +1 -1
  119. package/dist/sdk/segment/journey-utils.d.ts.map +1 -1
  120. package/dist/sdk/segment/journey-utils.js +1 -1
  121. package/dist/sdk/segment/journey-utils.js.map +1 -1
  122. package/dist/sdk/segment/journey-validator.js +1 -1
  123. package/dist/sdk/segment/journey-validator.js.map +1 -1
  124. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  125. package/dist/sdk/segment/journey-yaml.js +1 -1
  126. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  127. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  128. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  129. package/dist/sdk/segment/pull-workflow.js +1 -1
  130. package/dist/sdk/segment/push-recovery.js +1 -1
  131. package/dist/sdk/segment/push-workflow.js +1 -1
  132. package/dist/sdk/segment/resolution-context.js +1 -1
  133. package/dist/sdk/segment/segment-path-parser.js +1 -1
  134. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  135. package/dist/sdk/segment/target-resolution.js +1 -1
  136. package/dist/sdk/segment/tdx-config.js +1 -1
  137. package/dist/sdk/segment/validate-files.js +1 -1
  138. package/dist/sdk/segment/yaml-validator.js +1 -1
  139. package/dist/sdk/segment.js +1 -1
  140. package/dist/sdk/types/index.js +1 -1
  141. package/dist/sdk/types/progress.js +1 -1
  142. package/dist/sdk/user.js +1 -1
  143. package/dist/sdk/util/format-detector.js +1 -1
  144. package/dist/sdk/util/formatters.js +1 -1
  145. package/dist/sdk/util/index.js +1 -1
  146. package/dist/sdk/util/tree-formatter.js +1 -1
  147. package/dist/sdk/workflow/archive-validation.js +1 -1
  148. package/dist/sdk/workflow/clone-workflow.js +1 -1
  149. package/dist/sdk/workflow/index.js +1 -1
  150. package/dist/sdk/workflow/pull-workflow.js +1 -1
  151. package/dist/sdk/workflow/push-workflow.js +1 -1
  152. package/dist/sdk/workflow/tdx-config.js +1 -1
  153. package/dist/sdk/workflow/workflow-utils.js +1 -1
  154. package/dist/test-utils/command-runner.js +1 -1
  155. package/dist/test-utils/factories.js +1 -1
  156. package/dist/test-utils/fixtures.js +1 -1
  157. package/dist/test-utils/http-mock.js +1 -1
  158. package/dist/test-utils/index.js +1 -1
  159. package/dist/utils/async.js +1 -1
  160. package/dist/utils/colors.js +1 -1
  161. package/dist/utils/diff.js +1 -1
  162. package/dist/utils/file-permissions.js +1 -1
  163. package/dist/utils/global-cache.js +1 -1
  164. package/dist/utils/json-loader.js +1 -1
  165. package/dist/utils/local-cache.js +1 -1
  166. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  167. package/dist/utils/logger/formatters/index.js +1 -1
  168. package/dist/utils/logger/handlers/console-handler.js +1 -1
  169. package/dist/utils/logger/handlers/file-handler.js +1 -1
  170. package/dist/utils/logger/handlers/index.js +1 -1
  171. package/dist/utils/logger/handlers/null-handler.js +1 -1
  172. package/dist/utils/logger/index.js +1 -1
  173. package/dist/utils/logger/logger.js +1 -1
  174. package/dist/utils/logger/types.js +1 -1
  175. package/dist/utils/option-validation.js +1 -1
  176. package/dist/utils/process.js +1 -1
  177. package/dist/utils/prompt.js +1 -1
  178. package/dist/utils/spinner.js +1 -1
  179. package/dist/utils/sse-parser.js +1 -1
  180. package/dist/utils/string-utils.js +1 -1
  181. package/dist/utils/table-ref-parser.js +1 -1
  182. package/dist/utils/tdx-logger.js +1 -1
  183. package/dist/utils/version-check.js +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- function a107_0x80da(_0x39cdf4,_0x1b073b){_0x39cdf4=_0x39cdf4-0x18e;const _0x56d019=a107_0x56d0();let _0x80da5=_0x56d019[_0x39cdf4];return _0x80da5;}const a107_0x2ceb61=a107_0x80da;(function(_0x454298,_0x141609){const _0x1eee0e=a107_0x80da,_0x3a62c4=_0x454298();while(!![]){try{const _0x50fd08=-parseInt(_0x1eee0e(0x19e))/0x1*(-parseInt(_0x1eee0e(0x192))/0x2)+parseInt(_0x1eee0e(0x203))/0x3+-parseInt(_0x1eee0e(0x1a9))/0x4*(parseInt(_0x1eee0e(0x1ec))/0x5)+-parseInt(_0x1eee0e(0x195))/0x6+parseInt(_0x1eee0e(0x200))/0x7*(parseInt(_0x1eee0e(0x206))/0x8)+parseInt(_0x1eee0e(0x210))/0x9*(-parseInt(_0x1eee0e(0x1fb))/0xa)+-parseInt(_0x1eee0e(0x1e0))/0xb;if(_0x50fd08===_0x141609)break;else _0x3a62c4['push'](_0x3a62c4['shift']());}catch(_0x290666){_0x3a62c4['push'](_0x3a62c4['shift']());}}}(a107_0x56d0,0x53038));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x4a41af){const _0x389751=a107_0x80da;return _0x4a41af['journeyBundleId']??_0x4a41af[_0x389751(0x1b2)]?.[_0x389751(0x1c7)]??undefined;}function getVersionNumber(_0x24c9e2){const _0x245a52=a107_0x80da;return _0x24c9e2[_0x245a52(0x217)]??_0x24c9e2[_0x245a52(0x1b2)]?.[_0x245a52(0x217)]??0x0;}export function deduplicateJourneysByBundle(_0x5c2b1e){const _0x138195=a107_0x80da,_0x400bed=new Map();let _0x5699d4=0x0;for(const _0x1bf36f of _0x5c2b1e){const _0x3f3455=getBundleId(_0x1bf36f);if(!_0x3f3455){const _0x3e3dd9='no-bundle-'+(_0x1bf36f['id']??'idx-'+_0x5699d4++);_0x400bed[_0x138195(0x1b3)](_0x3e3dd9,_0x1bf36f);continue;}const _0x5a0056=_0x400bed['get'](_0x3f3455);if(!_0x5a0056)_0x400bed['set'](_0x3f3455,_0x1bf36f);else{const _0x44bb72=getVersionNumber(_0x5a0056),_0x5347bb=getVersionNumber(_0x1bf36f);_0x5347bb>_0x44bb72&&_0x400bed[_0x138195(0x1b3)](_0x3f3455,_0x1bf36f);}}return Array[_0x138195(0x19c)](_0x400bed[_0x138195(0x1a7)]());}const VALID_JOURNEY_STATES=new Set([a107_0x2ceb61(0x1c4),a107_0x2ceb61(0x1cd),a107_0x2ceb61(0x1a5)]);export function parseJourneyState(_0xabc45){const _0x4ee56a=a107_0x2ceb61;if(typeof _0xabc45===_0x4ee56a(0x218)&&VALID_JOURNEY_STATES[_0x4ee56a(0x19b)](_0xabc45))return _0xabc45;return _0x4ee56a(0x1c4);}export function entityToJourneyListItem(_0x4bdf1f,_0x248793){const _0x481cd3=a107_0x2ceb61,_0x203e09=_0x4bdf1f[_0x481cd3(0x1b2)];return{'id':_0x4bdf1f['id'],'name':_0x203e09[_0x481cd3(0x1b9)]??'','journeyBundleName':_0x203e09[_0x481cd3(0x1c5)]??_0x203e09[_0x481cd3(0x1b9)]??'','journeyBundleId':_0x203e09[_0x481cd3(0x1c7)]??'','versionNumber':_0x203e09['versionNumber'],'description':_0x203e09['description']??null,'state':parseJourneyState(_0x203e09[_0x481cd3(0x1fc)]),'paused':_0x203e09[_0x481cd3(0x204)]??![],'audienceId':_0x248793,'folderId':_0x203e09['segmentFolderId']??_0x4bdf1f[_0x481cd3(0x18f)]?.[_0x481cd3(0x19d)]?.[_0x481cd3(0x1e6)]?.['id']??null,'createdAt':_0x203e09[_0x481cd3(0x1cb)]??'','updatedAt':_0x203e09[_0x481cd3(0x20f)]??''};}function a107_0x56d0(){const _0x4cd501=['5405Wthezj','fetchTrafficRaw','lastVersionNumber','step','add','steps','JOURNEY_NOT_FOUND','launched','listJourneysWithDetails','values','_variant_','8DdDSNw','exitCriterias','createActivation','rootFolderId','find','createJourneyVersion','createJourneyActivation','DecisionPoint','exit_criteria','attributes','set','journeyStages','conditions','checkJourneyAppendable','goal','type','name','cdp_customer_id','goalInflux','getJourneyActivation','history','reduce','resumeJourney','update','journeyStageId','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','excluded','draft','journeyBundleName','listSegmentFolders','journeyBundleId','pause','getJourneyBundle','length','createdAt','resolveJourneyId','simulation','client','journeys','cdp_audience_','out','variants','listJourneysFromParentSegment','description','Journey\x20not\x20found:\x20','ABTest','listJourneyActivations','listEntitiesByFolder','flat','createVersion','milestone','conditionSegmentId','limit','jumpInflux','exitInflux','563101oRQHfi','listActivationsFlat','fixed','filter','pauseJourney','getParentSegmentFull','data','map','getColumnMapping','exitCriteria','exitOrJumpRate','entryCriteria','745610DDfheg','WaitStep','variant','isArray','getJourney','INVALID_ARGUMENT','outtime_stage_','applyVersionDeduplication','intime_goal','waitCondition','includeAllVersions','folder-segment','getJourneyStatistics','getStatistics','enteredSize','110JIVVHs','state','_exit_','branch','size','244741Pihnqe','create','listJourneysWithFolders','224349pzbXsX','paused','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','152giAtyD','replace','entryInflux','includeHistory','getConversionSankeyChart','AbTest','entries','Wait','push','updatedAt','187623OHdkEA','activationStepsById','toLowerCase','Excluded\x20profiles','all','sort','activation','versionNumber','string','journey','intime_stage_','listActivations','relationships','getBundle','outtime_journey','194phdLdD','listJourneys','completionRate','2067534FhbYEk','conversion','segmentId','getActivation','getActivationSankeyChart','audienceId','has','from','parentFolder'];a107_0x56d0=function(){return _0x4cd501;};return a107_0x56d0();}function convertToColumnId(_0x4c2154){const _0xe115=a107_0x2ceb61;return _0x4c2154[_0xe115(0x207)](/-/g,'_');}function getStepEntries(_0x3d7bc8){const _0x5e06fa=a107_0x2ceb61;if(!_0x3d7bc8)return[];if(Array['isArray'](_0x3d7bc8))return _0x3d7bc8[_0x5e06fa(0x1e7)](_0x2ca490=>[_0x2ca490['id'],_0x2ca490]);return Object[_0x5e06fa(0x20c)](_0x3d7bc8);}export function flattenJourneyActivation(_0x489294){const _0x1ddc47=a107_0x2ceb61,{activationParams:_0x1e207f,activationId:_0x13d594,runAfterJourneyRefresh:_0x44088b}=_0x489294[_0x1ddc47(0x1b2)];return{'id':_0x489294['id'],'activationId':_0x13d594,'runAfterJourneyRefresh':_0x44088b,..._0x1e207f};}function col(_0x285a0b,_0x30f3d9={}){const _0x42c142=a107_0x2ceb61;return{'column':_0x285a0b,'direction':null,'stageIndex':null,'stageName':null,'category':_0x42c142(0x1e2),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x30f3d9};}export function generateColumnMapping(_0x11e027){const _0x5f4d32=a107_0x2ceb61,_0x4025b6=[];_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x1ba))),_0x4025b6['push'](col('intime_journey',{'direction':'in','category':'journey'})),_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x191),{'direction':_0x5f4d32(0x1d1),'category':_0x5f4d32(0x219)}));_0x11e027['attributes'][_0x5f4d32(0x1b7)]&&_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x1f4),{'direction':'in','category':_0x5f4d32(0x1b7),'detail':_0x11e027['attributes'][_0x5f4d32(0x1b7)][_0x5f4d32(0x1b9)]||null}));const _0x4718b9=_0x11e027[_0x5f4d32(0x1b2)][_0x5f4d32(0x1b4)]||[];for(let _0x528173=0x0;_0x528173<_0x4718b9[_0x5f4d32(0x1ca)];_0x528173++){const _0x19c0b9=_0x4718b9[_0x528173],_0x49374b=_0x19c0b9['name'],_0x1c38f1={'stageIndex':_0x528173,'stageName':_0x49374b},_0x5db347=_0x19c0b9[_0x5f4d32(0x1eb)]?.[_0x5f4d32(0x1b9)]||null;_0x4025b6['push'](col(_0x5f4d32(0x21a)+_0x528173,{..._0x1c38f1,'direction':'in','category':'stage','detail':_0x5db347})),_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x1f2)+_0x528173,{..._0x1c38f1,'direction':'out','category':'stage','detail':_0x5db347}));_0x19c0b9[_0x5f4d32(0x1db)]&&_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x21a)+_0x528173+'_milestone',{..._0x1c38f1,'direction':'in','category':'milestone','detail':_0x19c0b9[_0x5f4d32(0x1db)][_0x5f4d32(0x1b9)]||null}));const _0xe2dd08=_0x19c0b9[_0x5f4d32(0x1aa)]||_0x19c0b9[_0x5f4d32(0x1e9)]||[];for(let _0x4fc690=0x0;_0x4fc690<_0xe2dd08[_0x5f4d32(0x1ca)];_0x4fc690++){_0x4025b6[_0x5f4d32(0x20e)](col('intime_stage_'+_0x528173+_0x5f4d32(0x1fd)+_0x4fc690,{..._0x1c38f1,'direction':'in','category':_0x5f4d32(0x1b1),'detail':_0xe2dd08[_0x4fc690]['name']||null}));}const _0x3241e8=getStepEntries(_0x19c0b9[_0x5f4d32(0x1a3)]);for(const [_0x498dd8,_0x5ae55b]of _0x3241e8){const _0x5634f8=convertToColumnId(_0x498dd8),_0x16d774=_0x5ae55b[_0x5f4d32(0x1b8)]||null,_0x4803a0=_0x5ae55b[_0x5f4d32(0x1b9)]||null,_0x433f7f={..._0x1c38f1,'stepType':_0x16d774,'stepName':_0x4803a0,'stepId':_0x498dd8};_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x21a)+_0x528173+'_'+_0x5634f8,{..._0x433f7f,'direction':'in','category':_0x5f4d32(0x1a1)})),_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x1f2)+_0x528173+'_'+_0x5634f8,{..._0x433f7f,'direction':_0x5f4d32(0x1d1),'category':_0x5f4d32(0x1a1)}));if(_0x5ae55b[_0x5f4d32(0x1b8)]===_0x5f4d32(0x1b0)&&_0x5ae55b['branches'])for(const _0x15392d of _0x5ae55b['branches']){_0x15392d[_0x5f4d32(0x197)]&&_0x4025b6[_0x5f4d32(0x20e)](col('intime_stage_'+_0x528173+'_'+_0x5634f8+'_'+_0x15392d[_0x5f4d32(0x197)],{..._0x433f7f,'direction':'in','category':_0x5f4d32(0x1fe),'detail':_0x15392d[_0x5f4d32(0x1b9)]||(_0x15392d[_0x5f4d32(0x1c3)]?_0x5f4d32(0x213):null)}));}if((_0x5ae55b[_0x5f4d32(0x1b8)]===_0x5f4d32(0x20b)||_0x5ae55b['type']===_0x5f4d32(0x1d6))&&_0x5ae55b[_0x5f4d32(0x1d2)])for(const _0x31dafe of _0x5ae55b['variants']){_0x31dafe['id']&&_0x4025b6['push'](col(_0x5f4d32(0x21a)+_0x528173+'_'+_0x5634f8+_0x5f4d32(0x1a8)+convertToColumnId(_0x31dafe['id']),{..._0x433f7f,'direction':'in','category':_0x5f4d32(0x1ee),'detail':_0x31dafe[_0x5f4d32(0x1b9)]||null}));}if(_0x5ae55b[_0x5f4d32(0x1b8)]===_0x5f4d32(0x1ed)||_0x5ae55b[_0x5f4d32(0x1b8)]===_0x5f4d32(0x20d)){const _0xf839da=[];if(_0x5ae55b[_0x5f4d32(0x1dc)])_0xf839da[_0x5f4d32(0x20e)](_0x5ae55b['conditionSegmentId']);else{if(Array[_0x5f4d32(0x1ef)](_0x5ae55b[_0x5f4d32(0x1b5)]))for(const _0x307ffe of _0x5ae55b[_0x5f4d32(0x1b5)]){_0x307ffe[_0x5f4d32(0x197)]&&!_0x307ffe['timedOutPath']&&_0xf839da[_0x5f4d32(0x20e)](_0x307ffe[_0x5f4d32(0x197)]);}else _0x5ae55b[_0x5f4d32(0x1f5)]?.['segmentId']&&_0xf839da[_0x5f4d32(0x20e)](_0x5ae55b[_0x5f4d32(0x1f5)][_0x5f4d32(0x197)]);}for(const _0x3b16d5 of _0xf839da){_0x4025b6[_0x5f4d32(0x20e)](col(_0x5f4d32(0x21a)+_0x528173+'_'+_0x5634f8+'_'+_0x3b16d5,{..._0x433f7f,'direction':'in','category':_0x5f4d32(0x1fe)}));}}}}return _0x4025b6[_0x5f4d32(0x20e)](col('time')),_0x4025b6;}export function aggregateJourneyHistory(_0x5443ac){const _0x5ce2be=a107_0x2ceb61,_0x38a46d=_0x5443ac[_0x5ce2be(0x1be)]((_0x213ea4,_0x4229ad)=>_0x213ea4+(_0x4229ad['entryInflux']??0x0),0x0),_0x57a298=_0x5443ac[_0x5ce2be(0x1be)]((_0x3c488b,_0x2e1f49)=>_0x3c488b+(_0x2e1f49[_0x5ce2be(0x1bb)]??0x0),0x0),_0x4f0c45=_0x5443ac[_0x5ce2be(0x1be)]((_0x4aab0e,_0x22d19b)=>_0x4aab0e+((_0x22d19b[_0x5ce2be(0x1df)]??0x0)+(_0x22d19b[_0x5ce2be(0x1de)]??0x0)),0x0),_0x5bb6ab=_0x5443ac[_0x5443ac['length']-0x1];return{'size':_0x5bb6ab?.[_0x5ce2be(0x1ff)]??0x0,'entered':_0x38a46d,'goal_achieved':_0x57a298,'completion_rate':_0x57a298&&_0x38a46d?_0x57a298/_0x38a46d*0x64:0x0,'exit_or_jump':_0x4f0c45,'exit_or_jump_rate':_0x4f0c45&&_0x38a46d?_0x4f0c45/_0x38a46d*0x64:0x0};}export function aggregateStageHistory(_0x40c83c){const _0x20239f=a107_0x2ceb61,_0x1121ed=_0x40c83c[_0x20239f(0x1be)]((_0x45bf93,_0x4f5823)=>_0x45bf93+(_0x4f5823[_0x20239f(0x208)]??0x0),0x0),_0x59016d=_0x40c83c[_0x20239f(0x1be)]((_0x1e00db,_0x1cf917)=>_0x1e00db+(_0x1cf917['milestoneInflux']??0x0),0x0),_0x407d90=_0x40c83c[_0x20239f(0x1be)]((_0x43e91b,_0x15868f)=>_0x43e91b+((_0x15868f['exitInflux']??0x0)+(_0x15868f['jumpInflux']??0x0)),0x0),_0x2a0952=_0x40c83c[_0x40c83c[_0x20239f(0x1ca)]-0x1];return{'size':_0x2a0952?.[_0x20239f(0x1ff)]??0x0,'entered':_0x1121ed,'milestone':_0x59016d,'milestone_rate':_0x59016d&&_0x1121ed?_0x59016d/_0x1121ed*0x64:0x0,'exit_or_jump':_0x407d90,'exit_or_jump_rate':_0x407d90&&_0x1121ed?_0x407d90/_0x1121ed*0x64:0x0};}export function assembleJourneyStats(_0x2f7a42,_0x3b2ade){const _0x52fead=a107_0x2ceb61,_0x3fa17d=!!(_0x3b2ade?.[_0x52fead(0x19c)]||_0x3b2ade?.['to'])&&!!_0x2f7a42['history']?.[_0x52fead(0x1ca)];if(_0x3fa17d){const _0x58d35c=aggregateJourneyHistory(_0x2f7a42['history']),_0x4afc5e={'journey_id':_0x2f7a42['journeyId'],..._0x3b2ade?.[_0x52fead(0x19c)]&&{'from':_0x3b2ade[_0x52fead(0x19c)]},..._0x3b2ade?.['to']&&{'to':_0x3b2ade['to']},..._0x58d35c};return _0x3b2ade?.[_0x52fead(0x209)]&&(_0x4afc5e[_0x52fead(0x1bd)]=_0x2f7a42[_0x52fead(0x1bd)]),_0x4afc5e;}return{'journey_id':_0x2f7a42['journeyId'],'size':_0x2f7a42[_0x52fead(0x1ff)],'entered':_0x2f7a42[_0x52fead(0x1fa)],'goal_achieved':_0x2f7a42['goalSize'],'completion_rate':_0x2f7a42[_0x52fead(0x194)],'exit_or_jump':_0x2f7a42['exitOrJumpSize'],'exit_or_jump_rate':_0x2f7a42[_0x52fead(0x1ea)]};}export function formatVersionsFromBundle(_0x12bfb9){const _0x4a6080=a107_0x2ceb61,_0x29619a=_0x12bfb9[_0x4a6080(0x1cf)][_0x4a6080(0x1e7)](_0x2630fc=>({'journeyId':_0x2630fc['id'],'versionNumber':_0x2630fc[_0x4a6080(0x1b2)][_0x4a6080(0x217)]??0x0,'name':_0x2630fc[_0x4a6080(0x1b2)][_0x4a6080(0x1b9)],'state':_0x2630fc[_0x4a6080(0x1b2)][_0x4a6080(0x1fc)],'paused':_0x2630fc[_0x4a6080(0x1b2)][_0x4a6080(0x204)],'createdAt':_0x2630fc['attributes']['createdAt'],'updatedAt':_0x2630fc[_0x4a6080(0x1b2)][_0x4a6080(0x20f)]}));return _0x29619a[_0x4a6080(0x215)]((_0x3f65cb,_0xec5de8)=>_0x3f65cb['versionNumber']-_0xec5de8['versionNumber']),_0x29619a;}export function synthesizePreBundleVersion(_0x274812){const _0x47c014=a107_0x2ceb61;return{'journeyId':_0x274812['id'],'versionNumber':0x1,'name':_0x274812[_0x47c014(0x1b2)][_0x47c014(0x1b9)],'state':_0x274812[_0x47c014(0x1b2)][_0x47c014(0x1fc)],'paused':_0x274812['attributes'][_0x47c014(0x204)],'createdAt':_0x274812[_0x47c014(0x1b2)][_0x47c014(0x1cb)],'updatedAt':_0x274812['attributes'][_0x47c014(0x20f)]};}export function buildStageNameMap(_0x286352){const _0x1a4cd4=a107_0x2ceb61;return new Map(_0x286352['attributes'][_0x1a4cd4(0x1b4)]?.[_0x1a4cd4(0x1e7)](_0x1db748=>[_0x1db748['id'],_0x1db748['name']])??[]);}export class JourneySDK{[a107_0x2ceb61(0x1ce)];constructor(_0x388564){const _0x52628f=a107_0x2ceb61;this[_0x52628f(0x1ce)]=new CDPApiClient(_0x388564);}[a107_0x2ceb61(0x1f3)](_0x55032f,_0x2e0304){return _0x2e0304?_0x55032f:deduplicateJourneysByBundle(_0x55032f);}async[a107_0x2ceb61(0x1a6)](_0x4e54bf,_0x208025){const _0x3aa2f0=a107_0x2ceb61;try{const _0x352d82=await this[_0x3aa2f0(0x1ce)]['listJourneysWithDetails'](_0x4e54bf);return{'journeys':this['applyVersionDeduplication'](_0x352d82[_0x3aa2f0(0x1cf)],_0x208025),'activationStepsById':_0x352d82['activationStepsById']};}catch(_0x5a2688){if(isHttp404Error(_0x5a2688))return{'journeys':[],'activationStepsById':new Map()};throw _0x5a2688;}}async[a107_0x2ceb61(0x1d3)](_0x2037a1,_0x598540,_0x1e1604){const _0x3872ce=a107_0x2ceb61;let _0x1d699c=_0x598540;if(!_0x1d699c)try{const _0x143bb2=await this[_0x3872ce(0x1ce)][_0x3872ce(0x1e5)](_0x2037a1);_0x1d699c=_0x143bb2[_0x3872ce(0x1ac)]??undefined;}catch(_0x38cddf){if(isHttp404Error(_0x38cddf))return[];throw _0x38cddf;}if(!_0x1d699c)return[];let _0x454a1d;if(_0x1e1604?.[_0x3872ce(0x1f6)]){const _0x344839=await this['client'][_0x3872ce(0x1c6)](_0x2037a1),_0x10f00d=_0x344839[_0x3872ce(0x1e7)](_0x404352=>this[_0x3872ce(0x1ce)][_0x3872ce(0x193)](_0x404352['id'])),_0x741b1b=await Promise['all'](_0x10f00d),_0x15c77a=new Set();_0x454a1d=_0x741b1b[_0x3872ce(0x1d9)]()[_0x3872ce(0x1e3)](_0xf6f0e1=>{const _0x32c4c8=_0x3872ce;if(_0x15c77a['has'](_0xf6f0e1['id']))return![];return _0x15c77a[_0x32c4c8(0x1a2)](_0xf6f0e1['id']),!![];});}else{const _0x40f343=await this[_0x3872ce(0x1ce)][_0x3872ce(0x1d8)](_0x1d699c,0x20,![]),_0x4966bd=_0x40f343[_0x3872ce(0x1e6)],_0x16181b=_0x4966bd[_0x3872ce(0x1e3)](_0x4fdb15=>_0x4fdb15[_0x3872ce(0x1b8)]==='journey');_0x454a1d=_0x16181b[_0x3872ce(0x1e7)](_0x4a49a4=>entityToJourneyListItem(_0x4a49a4,_0x2037a1));}return this[_0x3872ce(0x1f3)](_0x454a1d,_0x1e1604?.[_0x3872ce(0x1f6)]);}async[a107_0x2ceb61(0x202)](_0x4d0185,_0x1bb255,_0x249cde){const _0x57b01d=a107_0x2ceb61;if(!_0x1bb255)return{'journeys':[],'folders':[]};const _0x354938=await this[_0x57b01d(0x1ce)][_0x57b01d(0x1d8)](_0x1bb255,0x20,![]),_0x48a168=_0x354938[_0x57b01d(0x1e6)],_0x117810=_0x48a168[_0x57b01d(0x1e3)](_0x2a92a2=>_0x2a92a2[_0x57b01d(0x1b8)]===_0x57b01d(0x1f7)&&_0x2a92a2['id']!==_0x1bb255),_0x39bb67=_0x117810[_0x57b01d(0x1e7)](_0x3a8dce=>({'id':_0x3a8dce['id'],'name':_0x3a8dce[_0x57b01d(0x1b2)]['name']})),_0x4728d3=_0x48a168[_0x57b01d(0x1e3)](_0x208f38=>_0x208f38[_0x57b01d(0x1b8)]==='journey'),_0x16461c=_0x4728d3[_0x57b01d(0x1e7)](_0x102f33=>entityToJourneyListItem(_0x102f33,_0x4d0185));return{'journeys':this[_0x57b01d(0x1f3)](_0x16461c,_0x249cde?.[_0x57b01d(0x1f6)]),'folders':_0x39bb67};}async['listJourneysWithDetailsFromParentSegment'](_0x11f0e9,_0x572f51){const _0x5e9247=a107_0x2ceb61;let _0x19f68a;try{_0x19f68a=await this[_0x5e9247(0x1ce)][_0x5e9247(0x1c6)](_0x11f0e9);}catch(_0x474e65){if(isHttp404Error(_0x474e65))return{'journeys':[],'activationStepsById':new Map()};throw _0x474e65;}const _0x1375fe=_0x19f68a[_0x5e9247(0x1e7)](async _0x250837=>{const _0x2eea1d=_0x5e9247;return await this[_0x2eea1d(0x1a6)](_0x250837['id'],_0x572f51?.['includeAllVersions']);}),_0x88ef0c=await Promise[_0x5e9247(0x214)](_0x1375fe),_0xdf2d1c=new Map(),_0x571770=[];for(const _0x59e9c6 of _0x88ef0c){_0x571770[_0x5e9247(0x20e)](..._0x59e9c6[_0x5e9247(0x1cf)]);for(const [_0x4deca2,_0x9dcc07]of _0x59e9c6[_0x5e9247(0x211)]){_0xdf2d1c[_0x5e9247(0x1b3)](_0x4deca2,_0x9dcc07);}}const _0x39666a=new Set(),_0x230ac8=_0x571770[_0x5e9247(0x1e3)](_0x35b899=>{const _0x4500c2=_0x5e9247;if(_0x39666a[_0x4500c2(0x19b)](_0x35b899['id']))return![];return _0x39666a['add'](_0x35b899['id']),!![];});return{'journeys':this[_0x5e9247(0x1f3)](_0x230ac8,_0x572f51?.[_0x5e9247(0x1f6)]),'activationStepsById':_0xdf2d1c};}async[a107_0x2ceb61(0x1f0)](_0x3eedf7){const _0x9efb8f=a107_0x2ceb61;try{return await this[_0x9efb8f(0x1ce)][_0x9efb8f(0x1f0)](_0x3eedf7);}catch(_0x26fbf0){if(isHttp404Error(_0x26fbf0))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],'Journey\x20not\x20found:\x20'+_0x3eedf7,_0x26fbf0);throw _0x26fbf0;}}async[a107_0x2ceb61(0x1cc)](_0x4a6e00,_0x36f4ee){const _0x881638=a107_0x2ceb61,_0x10ac8f=await this[_0x881638(0x1d3)](_0x4a6e00),_0x37e0d3=_0x10ac8f[_0x881638(0x1ad)](_0x442ea8=>_0x442ea8[_0x881638(0x1c5)][_0x881638(0x212)]()===_0x36f4ee[_0x881638(0x212)]());if(!_0x37e0d3)throw new SDKError(ErrorCode[_0x881638(0x1a4)],_0x881638(0x1d5)+_0x36f4ee,undefined,{'helpText':_0x881638(0x1c2)});return _0x37e0d3['id'];}async[a107_0x2ceb61(0x1f9)](_0x5e9eac,_0x107c47){const _0x234e73=a107_0x2ceb61;try{return await this[_0x234e73(0x1ce)][_0x234e73(0x1f8)](_0x5e9eac,_0x107c47);}catch(_0x1b93af){if(isHttp404Error(_0x1b93af))throw new SDKError(ErrorCode[_0x234e73(0x1a4)],_0x234e73(0x1d5)+_0x5e9eac,_0x1b93af);throw _0x1b93af;}}async['getTrafficData'](_0x3851f8,_0x18226e){const _0x4535c6=a107_0x2ceb61,_0x1ee2b3={'from':_0x18226e?.[_0x4535c6(0x19c)],'to':_0x18226e?.['to'],'limit':_0x18226e?.[_0x4535c6(0x1dd)]},_0x3d826e=_0x18226e?.[_0x4535c6(0x1b8)]!==_0x4535c6(0x196);try{const [_0x361cda,_0x17312a]=await Promise['all']([this[_0x4535c6(0x19f)](_0x3851f8,_0x18226e?.[_0x4535c6(0x1b8)],_0x1ee2b3),_0x3d826e?this[_0x4535c6(0x1f0)](_0x3851f8):undefined]);if(_0x361cda[_0x4535c6(0x216)]&&_0x17312a){const _0x5ccbd2=buildStageNameMap(_0x17312a);_0x361cda['activation']=_0x361cda[_0x4535c6(0x216)][_0x4535c6(0x1e7)](_0x229922=>({..._0x229922,'journeyStageName':_0x5ccbd2['get'](_0x229922[_0x4535c6(0x1c1)])??_0x229922[_0x4535c6(0x1c1)]}));}return _0x361cda;}catch(_0x536329){if(isHttp404Error(_0x536329))throw new SDKError(ErrorCode[_0x4535c6(0x1a4)],'Journey\x20not\x20found:\x20'+_0x3851f8,_0x536329);throw _0x536329;}}async['fetchTrafficRaw'](_0x49b013,_0x55f346,_0x24a565){const _0x5f5bcd=a107_0x2ceb61;if(_0x55f346===_0x5f5bcd(0x196)){const _0x480b4d=await this['client'][_0x5f5bcd(0x20a)](_0x49b013,_0x24a565);return{'conversion':_0x480b4d};}if(_0x55f346===_0x5f5bcd(0x216)){const _0x37fa71=await this[_0x5f5bcd(0x1ce)][_0x5f5bcd(0x199)](_0x49b013,_0x24a565);return{'activation':_0x37fa71};}const [_0x8cae6e,_0x1e5440]=await Promise[_0x5f5bcd(0x214)]([this['client'][_0x5f5bcd(0x20a)](_0x49b013,_0x24a565),this['client'][_0x5f5bcd(0x199)](_0x49b013,_0x24a565)]);return{'conversion':_0x8cae6e,'activation':_0x1e5440};}async[a107_0x2ceb61(0x1c8)](_0x341fa6){const _0x12e95d=a107_0x2ceb61;try{return await this['client'][_0x12e95d(0x1e4)](_0x341fa6);}catch(_0x4d8c8c){if(isHttp404Error(_0x4d8c8c))throw new SDKError(ErrorCode[_0x12e95d(0x1a4)],_0x12e95d(0x1d5)+_0x341fa6,_0x4d8c8c);throw _0x4d8c8c;}}async['resume'](_0xab3be8){const _0x459b0d=a107_0x2ceb61;try{return await this[_0x459b0d(0x1ce)][_0x459b0d(0x1bf)](_0xab3be8);}catch(_0x98b60c){if(isHttp404Error(_0x98b60c))throw new SDKError(ErrorCode[_0x459b0d(0x1a4)],_0x459b0d(0x1d5)+_0xab3be8,_0x98b60c);throw _0x98b60c;}}async[a107_0x2ceb61(0x201)](_0x35cd44){const _0x5a07fb=a107_0x2ceb61;return await this[_0x5a07fb(0x1ce)]['createJourney'](_0x35cd44);}async[a107_0x2ceb61(0x1c0)](_0x710687,_0x7b038c){const _0x26f36b=a107_0x2ceb61;try{return await this[_0x26f36b(0x1ce)]['updateJourney'](_0x710687,_0x7b038c);}catch(_0x570412){if(isHttp404Error(_0x570412))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x26f36b(0x1d5)+_0x710687,_0x570412);throw _0x570412;}}async[a107_0x2ceb61(0x198)](_0x2be1b0,_0x12bf46){const _0x395666=a107_0x2ceb61;try{return await this[_0x395666(0x1ce)][_0x395666(0x1bc)](_0x2be1b0,_0x12bf46);}catch(_0x2b3105){if(isHttp404Error(_0x2b3105))throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20activation\x20step\x20not\x20found:\x20'+_0x12bf46+'\x20in\x20journey\x20'+_0x2be1b0,_0x2b3105);throw _0x2b3105;}}async[a107_0x2ceb61(0x18e)](_0x3cc19b){const _0x1a08b3=a107_0x2ceb61;try{return await this[_0x1a08b3(0x1ce)][_0x1a08b3(0x1d7)](_0x3cc19b);}catch(_0x12e96d){if(isHttp404Error(_0x12e96d))return[];throw _0x12e96d;}}async[a107_0x2ceb61(0x1e1)](_0x4f8ec9){const _0x5adeea=a107_0x2ceb61,_0x2c9dda=await this[_0x5adeea(0x18e)](_0x4f8ec9);return _0x2c9dda[_0x5adeea(0x1e7)](flattenJourneyActivation);}async[a107_0x2ceb61(0x1ab)](_0x40e210,_0x104d72){const _0x2b88a1=a107_0x2ceb61;return await this['client'][_0x2b88a1(0x1af)](_0x40e210,_0x104d72);}async[a107_0x2ceb61(0x1e8)](_0x3a12b6){const _0x3c1d19=a107_0x2ceb61,_0x476e3f=await this['getJourney'](_0x3a12b6),_0x263be6=generateColumnMapping(_0x476e3f);return{'journeyId':_0x476e3f['id'],'journeyName':_0x476e3f[_0x3c1d19(0x1b2)][_0x3c1d19(0x1b9)],'database':_0x3c1d19(0x1d0)+_0x476e3f[_0x3c1d19(0x1b2)][_0x3c1d19(0x19a)],'table':'journey_'+_0x476e3f['id'],'columns':_0x263be6};}async[a107_0x2ceb61(0x190)](_0x5b97c3){const _0x5afd21=a107_0x2ceb61;return this['client'][_0x5afd21(0x1c9)](_0x5b97c3);}async['listVersions'](_0x13879f){const _0x5aa813=a107_0x2ceb61,_0x165887=await this[_0x5aa813(0x1f0)](_0x13879f),_0x366bb0=_0x165887[_0x5aa813(0x1b2)]['journeyBundleId'];if(!_0x366bb0)return{'bundleId':'','bundleName':_0x165887[_0x5aa813(0x1b2)][_0x5aa813(0x1b9)],'bundleDescription':_0x165887['attributes'][_0x5aa813(0x1d4)]??null,'latestJourneyId':_0x165887['id'],'versions':[synthesizePreBundleVersion(_0x165887)]};const _0x5c616=await this['getBundle'](_0x366bb0);return{'bundleId':_0x366bb0,'bundleName':_0x5c616[_0x5aa813(0x1b9)],'bundleDescription':_0x5c616[_0x5aa813(0x1d4)]??null,'latestJourneyId':_0x5c616['latestJourneyId'],'versions':formatVersionsFromBundle(_0x5c616)};}async[a107_0x2ceb61(0x1da)](_0x5c4c8f){const _0x4000b2=a107_0x2ceb61,_0x4b004e=await this[_0x4000b2(0x1f0)](_0x5c4c8f),_0x18202a=_0x4b004e['attributes'][_0x4000b2(0x1c7)];if(!_0x18202a)throw new SDKError(ErrorCode[_0x4000b2(0x1f1)],_0x4000b2(0x205));await this['client'][_0x4000b2(0x1b6)](_0x18202a);const _0x22e95e=await this['client'][_0x4000b2(0x1c9)](_0x18202a),_0x159f91=_0x22e95e[_0x4000b2(0x1b9)]+'\x20v'+(_0x22e95e[_0x4000b2(0x1a0)]+0x1);return this[_0x4000b2(0x1ce)][_0x4000b2(0x1ae)](_0x18202a,{'sourceId':_0x5c4c8f,'attributes':{'name':_0x159f91}});}}
1
+ const a107_0x10abf2=a107_0x34ff;function a107_0x34ff(_0x29dc76,_0x131b67){_0x29dc76=_0x29dc76-0x111;const _0x7341a9=a107_0x7341();let _0x34ff0b=_0x7341a9[_0x29dc76];return _0x34ff0b;}(function(_0x52b110,_0x446d59){const _0x3d16b1=a107_0x34ff,_0x1d2b72=_0x52b110();while(!![]){try{const _0x58d4d1=parseInt(_0x3d16b1(0x111))/0x1+parseInt(_0x3d16b1(0x18e))/0x2*(-parseInt(_0x3d16b1(0x168))/0x3)+-parseInt(_0x3d16b1(0x12c))/0x4+parseInt(_0x3d16b1(0x12b))/0x5*(parseInt(_0x3d16b1(0x13d))/0x6)+parseInt(_0x3d16b1(0x19c))/0x7+parseInt(_0x3d16b1(0x18c))/0x8*(parseInt(_0x3d16b1(0x16c))/0x9)+-parseInt(_0x3d16b1(0x151))/0xa*(parseInt(_0x3d16b1(0x172))/0xb);if(_0x58d4d1===_0x446d59)break;else _0x1d2b72['push'](_0x1d2b72['shift']());}catch(_0x91d178){_0x1d2b72['push'](_0x1d2b72['shift']());}}}(a107_0x7341,0x55847));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x44911b){const _0x1353c3=a107_0x34ff;return _0x44911b['journeyBundleId']??_0x44911b[_0x1353c3(0x188)]?.[_0x1353c3(0x17c)]??undefined;}function getVersionNumber(_0xd07d22){const _0x3b7b28=a107_0x34ff;return _0xd07d22['versionNumber']??_0xd07d22[_0x3b7b28(0x188)]?.[_0x3b7b28(0x140)]??0x0;}export function deduplicateJourneysByBundle(_0x21ef75){const _0x42c9e0=a107_0x34ff,_0x37cd23=new Map();let _0x4b63b7=0x0;for(const _0xde04c5 of _0x21ef75){const _0xcafb9d=getBundleId(_0xde04c5);if(!_0xcafb9d){const _0x3c0c47=_0x42c9e0(0x145)+(_0xde04c5['id']??'idx-'+_0x4b63b7++);_0x37cd23[_0x42c9e0(0x141)](_0x3c0c47,_0xde04c5);continue;}const _0x49c371=_0x37cd23['get'](_0xcafb9d);if(!_0x49c371)_0x37cd23[_0x42c9e0(0x141)](_0xcafb9d,_0xde04c5);else{const _0x2f7f60=getVersionNumber(_0x49c371),_0x11df65=getVersionNumber(_0xde04c5);_0x11df65>_0x2f7f60&&_0x37cd23[_0x42c9e0(0x141)](_0xcafb9d,_0xde04c5);}}return Array['from'](_0x37cd23[_0x42c9e0(0x18a)]());}const VALID_JOURNEY_STATES=new Set([a107_0x10abf2(0x148),a107_0x10abf2(0x195),'launched']);export function parseJourneyState(_0x304125){const _0x296636=a107_0x10abf2;if(typeof _0x304125==='string'&&VALID_JOURNEY_STATES[_0x296636(0x184)](_0x304125))return _0x304125;return'draft';}export function entityToJourneyListItem(_0x18939e,_0x5bf0d9){const _0x3d3f2f=a107_0x10abf2,_0x3e91d1=_0x18939e[_0x3d3f2f(0x188)];return{'id':_0x18939e['id'],'name':_0x3e91d1[_0x3d3f2f(0x177)]??'','journeyBundleName':_0x3e91d1[_0x3d3f2f(0x11b)]??_0x3e91d1['name']??'','journeyBundleId':_0x3e91d1['journeyBundleId']??'','versionNumber':_0x3e91d1[_0x3d3f2f(0x140)],'description':_0x3e91d1['description']??null,'state':parseJourneyState(_0x3e91d1[_0x3d3f2f(0x146)]),'paused':_0x3e91d1[_0x3d3f2f(0x134)]??![],'audienceId':_0x5bf0d9,'folderId':_0x3e91d1[_0x3d3f2f(0x150)]??_0x18939e[_0x3d3f2f(0x19f)]?.['parentFolder']?.[_0x3d3f2f(0x12a)]?.['id']??null,'createdAt':_0x3e91d1[_0x3d3f2f(0x129)]??'','updatedAt':_0x3e91d1['updatedAt']??''};}function convertToColumnId(_0x435deb){const _0x3f9bde=a107_0x10abf2;return _0x435deb[_0x3f9bde(0x193)](/-/g,'_');}function getStepEntries(_0x2cecff){const _0x42184f=a107_0x10abf2;if(!_0x2cecff)return[];if(Array[_0x42184f(0x15a)](_0x2cecff))return _0x2cecff[_0x42184f(0x15e)](_0x562a81=>[_0x562a81['id'],_0x562a81]);return Object[_0x42184f(0x181)](_0x2cecff);}function a107_0x7341(){const _0x2573b3=['getJourneyActivation','paused','reduce','exitCriterias','getTrafficData','exitOrJumpSize','getJourneyBundle','latestJourneyId','add','getActivation','942PaaeXw','push','description','versionNumber','set','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','goalSize','milestoneInflux','no-bundle-','state','filter','draft','intime_goal','listJourneyActivations','entryInflux','segmentId','all','intime_journey','get','segmentFolderId','30jUEado','Wait','resolveJourneyId','activation','JOURNEY_NOT_FOUND','listVersions','activationStepsById','jumpInflux','variant','isArray','DecisionPoint','steps','create','map','limit','fetchTrafficRaw','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','getJourney','conditionSegmentId','size','folder-segment','stage','includeHistory','309YHNZaN','exit_criteria','excluded','variants','153BnCPEU','listJourneysWithFolders','applyVersionDeduplication','exitCriteria','_variant_','fixed','2630749ZaJQwc','outtime_stage_','toLowerCase','lastVersionNumber','completionRate','name','createVersion','from','updatedAt','getParentSegmentFull','journeyBundleId','conversion','journeys','exitOrJumpRate','pauseJourney','entries','journey','journeyId','has','NOT_FOUND','Journey\x20activation\x20step\x20not\x20found:\x20','intime_stage_','attributes','cdp_customer_id','values','journey_','277496xAuGUw','listJourneys','4782mbVxHd','conditions','WaitStep','type','listEntitiesByFolder','replace','journeyStageId','simulation','createJourneyVersion','entryCriteria','resumeJourney','includeAllVersions','AbTest','enteredSize','1424066XOXJyR','journeyStages','milestone','relationships','624443duJrmh','goalInflux','length','client','rootFolderId','createJourney','listActivations','out','listJourneysWithDetails','getJourneyStatistics','journeyBundleName','getStatistics','getActivationSankeyChart','history','getConversionSankeyChart','listJourneysFromParentSegment','exitInflux','time','resume','listSegmentFolders','branch','Journey\x20not\x20found:\x20','INVALID_ARGUMENT','_milestone','createdAt','data','14660TcNiPO','2255420cYaJQH','listJourneysWithDetailsFromParentSegment','updateJourney','goal','find','cdp_audience_','getBundle'];a107_0x7341=function(){return _0x2573b3;};return a107_0x7341();}export function flattenJourneyActivation(_0x48f7c2){const _0x121d36=a107_0x10abf2,{activationParams:_0x3873d3,activationId:_0x33924d,runAfterJourneyRefresh:_0x4ea48c}=_0x48f7c2[_0x121d36(0x188)];return{'id':_0x48f7c2['id'],'activationId':_0x33924d,'runAfterJourneyRefresh':_0x4ea48c,..._0x3873d3};}function col(_0x3efd63,_0x4a4be1={}){const _0x24218a=a107_0x10abf2;return{'column':_0x3efd63,'direction':null,'stageIndex':null,'stageName':null,'category':_0x24218a(0x171),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x4a4be1};}export function generateColumnMapping(_0x4794a9){const _0x33ab27=a107_0x10abf2,_0x5b588c=[];_0x5b588c['push'](col(_0x33ab27(0x189))),_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x14e),{'direction':'in','category':'journey'})),_0x5b588c[_0x33ab27(0x13e)](col('outtime_journey',{'direction':_0x33ab27(0x118),'category':_0x33ab27(0x182)}));_0x4794a9['attributes'][_0x33ab27(0x12f)]&&_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x149),{'direction':'in','category':_0x33ab27(0x12f),'detail':_0x4794a9[_0x33ab27(0x188)][_0x33ab27(0x12f)][_0x33ab27(0x177)]||null}));const _0x5489f4=_0x4794a9[_0x33ab27(0x188)]['journeyStages']||[];for(let _0x4635bd=0x0;_0x4635bd<_0x5489f4[_0x33ab27(0x113)];_0x4635bd++){const _0x1580c7=_0x5489f4[_0x4635bd],_0x351ab6=_0x1580c7['name'],_0x3ca155={'stageIndex':_0x4635bd,'stageName':_0x351ab6},_0x31e8f4=_0x1580c7[_0x33ab27(0x197)]?.[_0x33ab27(0x177)]||null;_0x5b588c['push'](col(_0x33ab27(0x187)+_0x4635bd,{..._0x3ca155,'direction':'in','category':_0x33ab27(0x166),'detail':_0x31e8f4})),_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x173)+_0x4635bd,{..._0x3ca155,'direction':_0x33ab27(0x118),'category':'stage','detail':_0x31e8f4}));_0x1580c7['milestone']&&_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x187)+_0x4635bd+_0x33ab27(0x128),{..._0x3ca155,'direction':'in','category':_0x33ab27(0x19e),'detail':_0x1580c7['milestone'][_0x33ab27(0x177)]||null}));const _0x15071c=_0x1580c7[_0x33ab27(0x136)]||_0x1580c7[_0x33ab27(0x16f)]||[];for(let _0x4bd360=0x0;_0x4bd360<_0x15071c[_0x33ab27(0x113)];_0x4bd360++){_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x187)+_0x4635bd+'_exit_'+_0x4bd360,{..._0x3ca155,'direction':'in','category':_0x33ab27(0x169),'detail':_0x15071c[_0x4bd360][_0x33ab27(0x177)]||null}));}const _0x7fb746=getStepEntries(_0x1580c7[_0x33ab27(0x15c)]);for(const [_0xa69faf,_0xb1820a]of _0x7fb746){const _0x46ecb1=convertToColumnId(_0xa69faf),_0x1471dc=_0xb1820a[_0x33ab27(0x191)]||null,_0x2a07e0=_0xb1820a[_0x33ab27(0x177)]||null,_0x5f38a6={..._0x3ca155,'stepType':_0x1471dc,'stepName':_0x2a07e0,'stepId':_0xa69faf};_0x5b588c['push'](col('intime_stage_'+_0x4635bd+'_'+_0x46ecb1,{..._0x5f38a6,'direction':'in','category':'step'})),_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x173)+_0x4635bd+'_'+_0x46ecb1,{..._0x5f38a6,'direction':_0x33ab27(0x118),'category':'step'}));if(_0xb1820a[_0x33ab27(0x191)]===_0x33ab27(0x15b)&&_0xb1820a['branches'])for(const _0x5011f6 of _0xb1820a['branches']){_0x5011f6[_0x33ab27(0x14c)]&&_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x187)+_0x4635bd+'_'+_0x46ecb1+'_'+_0x5011f6[_0x33ab27(0x14c)],{..._0x5f38a6,'direction':'in','category':'branch','detail':_0x5011f6[_0x33ab27(0x177)]||(_0x5011f6[_0x33ab27(0x16a)]?'Excluded\x20profiles':null)}));}if((_0xb1820a[_0x33ab27(0x191)]===_0x33ab27(0x19a)||_0xb1820a['type']==='ABTest')&&_0xb1820a[_0x33ab27(0x16b)])for(const _0x4a483d of _0xb1820a[_0x33ab27(0x16b)]){_0x4a483d['id']&&_0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x187)+_0x4635bd+'_'+_0x46ecb1+_0x33ab27(0x170)+convertToColumnId(_0x4a483d['id']),{..._0x5f38a6,'direction':'in','category':_0x33ab27(0x159),'detail':_0x4a483d[_0x33ab27(0x177)]||null}));}if(_0xb1820a[_0x33ab27(0x191)]===_0x33ab27(0x190)||_0xb1820a[_0x33ab27(0x191)]===_0x33ab27(0x152)){const _0x13c80d=[];if(_0xb1820a[_0x33ab27(0x163)])_0x13c80d['push'](_0xb1820a[_0x33ab27(0x163)]);else{if(Array[_0x33ab27(0x15a)](_0xb1820a['conditions']))for(const _0x3b3aee of _0xb1820a[_0x33ab27(0x18f)]){_0x3b3aee[_0x33ab27(0x14c)]&&!_0x3b3aee['timedOutPath']&&_0x13c80d[_0x33ab27(0x13e)](_0x3b3aee['segmentId']);}else _0xb1820a['waitCondition']?.[_0x33ab27(0x14c)]&&_0x13c80d[_0x33ab27(0x13e)](_0xb1820a['waitCondition'][_0x33ab27(0x14c)]);}for(const _0x24311c of _0x13c80d){_0x5b588c['push'](col(_0x33ab27(0x187)+_0x4635bd+'_'+_0x46ecb1+'_'+_0x24311c,{..._0x5f38a6,'direction':'in','category':_0x33ab27(0x125)}));}}}}return _0x5b588c[_0x33ab27(0x13e)](col(_0x33ab27(0x122))),_0x5b588c;}export function aggregateJourneyHistory(_0x539b0c){const _0x157483=a107_0x10abf2,_0x3cd126=_0x539b0c['reduce']((_0xe74bc8,_0x297fc4)=>_0xe74bc8+(_0x297fc4['entryInflux']??0x0),0x0),_0x5863e1=_0x539b0c[_0x157483(0x135)]((_0x4c2ed3,_0x7deef1)=>_0x4c2ed3+(_0x7deef1[_0x157483(0x112)]??0x0),0x0),_0x27e9ec=_0x539b0c[_0x157483(0x135)]((_0x4a9b05,_0x4b7408)=>_0x4a9b05+((_0x4b7408[_0x157483(0x121)]??0x0)+(_0x4b7408[_0x157483(0x158)]??0x0)),0x0),_0x1375c3=_0x539b0c[_0x539b0c[_0x157483(0x113)]-0x1];return{'size':_0x1375c3?.[_0x157483(0x164)]??0x0,'entered':_0x3cd126,'goal_achieved':_0x5863e1,'completion_rate':_0x5863e1&&_0x3cd126?_0x5863e1/_0x3cd126*0x64:0x0,'exit_or_jump':_0x27e9ec,'exit_or_jump_rate':_0x27e9ec&&_0x3cd126?_0x27e9ec/_0x3cd126*0x64:0x0};}export function aggregateStageHistory(_0x308755){const _0x51fa58=a107_0x10abf2,_0x42ae40=_0x308755[_0x51fa58(0x135)]((_0x1694ae,_0x48113b)=>_0x1694ae+(_0x48113b[_0x51fa58(0x14b)]??0x0),0x0),_0x5c72cb=_0x308755[_0x51fa58(0x135)]((_0xa4eaec,_0x49f9e4)=>_0xa4eaec+(_0x49f9e4[_0x51fa58(0x144)]??0x0),0x0),_0x1291ef=_0x308755['reduce']((_0x1dd489,_0x3ea7c9)=>_0x1dd489+((_0x3ea7c9[_0x51fa58(0x121)]??0x0)+(_0x3ea7c9[_0x51fa58(0x158)]??0x0)),0x0),_0x5096a5=_0x308755[_0x308755['length']-0x1];return{'size':_0x5096a5?.[_0x51fa58(0x164)]??0x0,'entered':_0x42ae40,'milestone':_0x5c72cb,'milestone_rate':_0x5c72cb&&_0x42ae40?_0x5c72cb/_0x42ae40*0x64:0x0,'exit_or_jump':_0x1291ef,'exit_or_jump_rate':_0x1291ef&&_0x42ae40?_0x1291ef/_0x42ae40*0x64:0x0};}export function assembleJourneyStats(_0x4de3eb,_0x8c6d0a){const _0x46ccd0=a107_0x10abf2,_0x41d6ed=!!(_0x8c6d0a?.[_0x46ccd0(0x179)]||_0x8c6d0a?.['to'])&&!!_0x4de3eb[_0x46ccd0(0x11e)]?.[_0x46ccd0(0x113)];if(_0x41d6ed){const _0x2a59d8=aggregateJourneyHistory(_0x4de3eb[_0x46ccd0(0x11e)]),_0x45e27f={'journey_id':_0x4de3eb[_0x46ccd0(0x183)],..._0x8c6d0a?.['from']&&{'from':_0x8c6d0a['from']},..._0x8c6d0a?.['to']&&{'to':_0x8c6d0a['to']},..._0x2a59d8};return _0x8c6d0a?.[_0x46ccd0(0x167)]&&(_0x45e27f['history']=_0x4de3eb['history']),_0x45e27f;}return{'journey_id':_0x4de3eb[_0x46ccd0(0x183)],'size':_0x4de3eb[_0x46ccd0(0x164)],'entered':_0x4de3eb[_0x46ccd0(0x19b)],'goal_achieved':_0x4de3eb[_0x46ccd0(0x143)],'completion_rate':_0x4de3eb[_0x46ccd0(0x176)],'exit_or_jump':_0x4de3eb[_0x46ccd0(0x138)],'exit_or_jump_rate':_0x4de3eb[_0x46ccd0(0x17f)]};}export function formatVersionsFromBundle(_0x1056fd){const _0x25daff=a107_0x10abf2,_0x29fe67=_0x1056fd[_0x25daff(0x17e)][_0x25daff(0x15e)](_0x3bb321=>({'journeyId':_0x3bb321['id'],'versionNumber':_0x3bb321[_0x25daff(0x188)][_0x25daff(0x140)]??0x0,'name':_0x3bb321[_0x25daff(0x188)][_0x25daff(0x177)],'state':_0x3bb321[_0x25daff(0x188)][_0x25daff(0x146)],'paused':_0x3bb321[_0x25daff(0x188)][_0x25daff(0x134)],'createdAt':_0x3bb321['attributes']['createdAt'],'updatedAt':_0x3bb321[_0x25daff(0x188)][_0x25daff(0x17a)]}));return _0x29fe67['sort']((_0x5a5367,_0x85402a)=>_0x5a5367[_0x25daff(0x140)]-_0x85402a[_0x25daff(0x140)]),_0x29fe67;}export function synthesizePreBundleVersion(_0x265158){const _0x5627be=a107_0x10abf2;return{'journeyId':_0x265158['id'],'versionNumber':0x1,'name':_0x265158['attributes']['name'],'state':_0x265158[_0x5627be(0x188)]['state'],'paused':_0x265158['attributes'][_0x5627be(0x134)],'createdAt':_0x265158[_0x5627be(0x188)][_0x5627be(0x129)],'updatedAt':_0x265158[_0x5627be(0x188)][_0x5627be(0x17a)]};}export function buildStageNameMap(_0x1959c1){const _0x344c08=a107_0x10abf2;return new Map(_0x1959c1[_0x344c08(0x188)][_0x344c08(0x19d)]?.[_0x344c08(0x15e)](_0x317f79=>[_0x317f79['id'],_0x317f79[_0x344c08(0x177)]])??[]);}export class JourneySDK{[a107_0x10abf2(0x114)];constructor(_0x56ce16){const _0x20d175=a107_0x10abf2;this[_0x20d175(0x114)]=new CDPApiClient(_0x56ce16);}['applyVersionDeduplication'](_0x424e7d,_0x3cd4e9){return _0x3cd4e9?_0x424e7d:deduplicateJourneysByBundle(_0x424e7d);}async[a107_0x10abf2(0x119)](_0x596838,_0x28659a){const _0x2801e4=a107_0x10abf2;try{const _0x40a83e=await this[_0x2801e4(0x114)]['listJourneysWithDetails'](_0x596838);return{'journeys':this[_0x2801e4(0x16e)](_0x40a83e['journeys'],_0x28659a),'activationStepsById':_0x40a83e['activationStepsById']};}catch(_0x2726d7){if(isHttp404Error(_0x2726d7))return{'journeys':[],'activationStepsById':new Map()};throw _0x2726d7;}}async[a107_0x10abf2(0x120)](_0xae9578,_0x3db600,_0x3faab4){const _0x15cba4=a107_0x10abf2;let _0x43bba4=_0x3db600;if(!_0x43bba4)try{const _0x3afe6d=await this[_0x15cba4(0x114)][_0x15cba4(0x17b)](_0xae9578);_0x43bba4=_0x3afe6d[_0x15cba4(0x115)]??undefined;}catch(_0x15929b){if(isHttp404Error(_0x15929b))return[];throw _0x15929b;}if(!_0x43bba4)return[];let _0x57fdcc;if(_0x3faab4?.[_0x15cba4(0x199)]){const _0x4feda0=await this[_0x15cba4(0x114)][_0x15cba4(0x124)](_0xae9578),_0x3fd279=_0x4feda0[_0x15cba4(0x15e)](_0x5f379b=>this[_0x15cba4(0x114)][_0x15cba4(0x18d)](_0x5f379b['id'])),_0x84850e=await Promise[_0x15cba4(0x14d)](_0x3fd279),_0x4aff30=new Set();_0x57fdcc=_0x84850e['flat']()[_0x15cba4(0x147)](_0x38b963=>{const _0x55bbf9=_0x15cba4;if(_0x4aff30[_0x55bbf9(0x184)](_0x38b963['id']))return![];return _0x4aff30[_0x55bbf9(0x13b)](_0x38b963['id']),!![];});}else{const _0x3a2157=await this[_0x15cba4(0x114)]['listEntitiesByFolder'](_0x43bba4,0x20,![]),_0x259d71=_0x3a2157[_0x15cba4(0x12a)],_0x30df38=_0x259d71[_0x15cba4(0x147)](_0x53be66=>_0x53be66[_0x15cba4(0x191)]===_0x15cba4(0x182));_0x57fdcc=_0x30df38[_0x15cba4(0x15e)](_0x206e08=>entityToJourneyListItem(_0x206e08,_0xae9578));}return this[_0x15cba4(0x16e)](_0x57fdcc,_0x3faab4?.[_0x15cba4(0x199)]);}async[a107_0x10abf2(0x16d)](_0x351245,_0x3a61c1,_0x4bbe50){const _0x358d39=a107_0x10abf2;if(!_0x3a61c1)return{'journeys':[],'folders':[]};const _0x30b1b2=await this[_0x358d39(0x114)][_0x358d39(0x192)](_0x3a61c1,0x20,![]),_0x515571=_0x30b1b2[_0x358d39(0x12a)],_0x3b907c=_0x515571[_0x358d39(0x147)](_0x50a4fa=>_0x50a4fa[_0x358d39(0x191)]===_0x358d39(0x165)&&_0x50a4fa['id']!==_0x3a61c1),_0x2c82c7=_0x3b907c[_0x358d39(0x15e)](_0x4efcf7=>({'id':_0x4efcf7['id'],'name':_0x4efcf7['attributes'][_0x358d39(0x177)]})),_0x21ea93=_0x515571[_0x358d39(0x147)](_0x1100f7=>_0x1100f7[_0x358d39(0x191)]===_0x358d39(0x182)),_0x2fef68=_0x21ea93['map'](_0x27223c=>entityToJourneyListItem(_0x27223c,_0x351245));return{'journeys':this[_0x358d39(0x16e)](_0x2fef68,_0x4bbe50?.[_0x358d39(0x199)]),'folders':_0x2c82c7};}async[a107_0x10abf2(0x12d)](_0xbafc37,_0x5e1991){const _0xd74dac=a107_0x10abf2;let _0x5d57e4;try{_0x5d57e4=await this['client'][_0xd74dac(0x124)](_0xbafc37);}catch(_0x53e935){if(isHttp404Error(_0x53e935))return{'journeys':[],'activationStepsById':new Map()};throw _0x53e935;}const _0x388d1f=_0x5d57e4[_0xd74dac(0x15e)](async _0x981ec9=>{return await this['listJourneysWithDetails'](_0x981ec9['id'],_0x5e1991?.['includeAllVersions']);}),_0x147bf6=await Promise[_0xd74dac(0x14d)](_0x388d1f),_0x550a48=new Map(),_0x4c25eb=[];for(const _0x1e29bd of _0x147bf6){_0x4c25eb[_0xd74dac(0x13e)](..._0x1e29bd[_0xd74dac(0x17e)]);for(const [_0x6ed07c,_0x157a66]of _0x1e29bd[_0xd74dac(0x157)]){_0x550a48[_0xd74dac(0x141)](_0x6ed07c,_0x157a66);}}const _0x57cfcb=new Set(),_0x2beaea=_0x4c25eb[_0xd74dac(0x147)](_0x5af20b=>{const _0x372955=_0xd74dac;if(_0x57cfcb[_0x372955(0x184)](_0x5af20b['id']))return![];return _0x57cfcb[_0x372955(0x13b)](_0x5af20b['id']),!![];});return{'journeys':this[_0xd74dac(0x16e)](_0x2beaea,_0x5e1991?.['includeAllVersions']),'activationStepsById':_0x550a48};}async[a107_0x10abf2(0x162)](_0x458ed2){const _0x464395=a107_0x10abf2;try{return await this[_0x464395(0x114)][_0x464395(0x162)](_0x458ed2);}catch(_0x5b293d){if(isHttp404Error(_0x5b293d))throw new SDKError(ErrorCode[_0x464395(0x155)],_0x464395(0x126)+_0x458ed2,_0x5b293d);throw _0x5b293d;}}async[a107_0x10abf2(0x153)](_0xd91645,_0x5a642b){const _0xe1c3d5=a107_0x10abf2,_0x14ba01=await this[_0xe1c3d5(0x120)](_0xd91645),_0x45e762=_0x14ba01[_0xe1c3d5(0x130)](_0x1999bd=>_0x1999bd['journeyBundleName'][_0xe1c3d5(0x174)]()===_0x5a642b['toLowerCase']());if(!_0x45e762)throw new SDKError(ErrorCode[_0xe1c3d5(0x155)],_0xe1c3d5(0x126)+_0x5a642b,undefined,{'helpText':_0xe1c3d5(0x161)});return _0x45e762['id'];}async[a107_0x10abf2(0x11c)](_0x17a503,_0x40508c){const _0x1ef040=a107_0x10abf2;try{return await this[_0x1ef040(0x114)][_0x1ef040(0x11a)](_0x17a503,_0x40508c);}catch(_0x56ed8e){if(isHttp404Error(_0x56ed8e))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],'Journey\x20not\x20found:\x20'+_0x17a503,_0x56ed8e);throw _0x56ed8e;}}async[a107_0x10abf2(0x137)](_0x58dbbb,_0x322089){const _0x58a160=a107_0x10abf2,_0x132e3d={'from':_0x322089?.[_0x58a160(0x179)],'to':_0x322089?.['to'],'limit':_0x322089?.[_0x58a160(0x15f)]},_0x1c19d2=_0x322089?.[_0x58a160(0x191)]!==_0x58a160(0x17d);try{const [_0x1b716a,_0x288790]=await Promise[_0x58a160(0x14d)]([this[_0x58a160(0x160)](_0x58dbbb,_0x322089?.[_0x58a160(0x191)],_0x132e3d),_0x1c19d2?this[_0x58a160(0x162)](_0x58dbbb):undefined]);if(_0x1b716a['activation']&&_0x288790){const _0x41fe2e=buildStageNameMap(_0x288790);_0x1b716a[_0x58a160(0x154)]=_0x1b716a['activation'][_0x58a160(0x15e)](_0x5682a4=>({..._0x5682a4,'journeyStageName':_0x41fe2e[_0x58a160(0x14f)](_0x5682a4['journeyStageId'])??_0x5682a4[_0x58a160(0x194)]}));}return _0x1b716a;}catch(_0x303830){if(isHttp404Error(_0x303830))throw new SDKError(ErrorCode[_0x58a160(0x155)],'Journey\x20not\x20found:\x20'+_0x58dbbb,_0x303830);throw _0x303830;}}async[a107_0x10abf2(0x160)](_0x42884e,_0x50c2b5,_0x36ff84){const _0x203807=a107_0x10abf2;if(_0x50c2b5===_0x203807(0x17d)){const _0x98a8c=await this['client'][_0x203807(0x11f)](_0x42884e,_0x36ff84);return{'conversion':_0x98a8c};}if(_0x50c2b5==='activation'){const _0x28ad94=await this[_0x203807(0x114)][_0x203807(0x11d)](_0x42884e,_0x36ff84);return{'activation':_0x28ad94};}const [_0x1384f8,_0xb41db7]=await Promise[_0x203807(0x14d)]([this[_0x203807(0x114)]['getConversionSankeyChart'](_0x42884e,_0x36ff84),this[_0x203807(0x114)]['getActivationSankeyChart'](_0x42884e,_0x36ff84)]);return{'conversion':_0x1384f8,'activation':_0xb41db7};}async['pause'](_0x405549){const _0x204207=a107_0x10abf2;try{return await this[_0x204207(0x114)][_0x204207(0x180)](_0x405549);}catch(_0x4c1414){if(isHttp404Error(_0x4c1414))throw new SDKError(ErrorCode[_0x204207(0x155)],'Journey\x20not\x20found:\x20'+_0x405549,_0x4c1414);throw _0x4c1414;}}async[a107_0x10abf2(0x123)](_0x3a46c7){const _0x3038ef=a107_0x10abf2;try{return await this[_0x3038ef(0x114)][_0x3038ef(0x198)](_0x3a46c7);}catch(_0x233cd8){if(isHttp404Error(_0x233cd8))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x3038ef(0x126)+_0x3a46c7,_0x233cd8);throw _0x233cd8;}}async[a107_0x10abf2(0x15d)](_0x1d7b4c){const _0x1f6e71=a107_0x10abf2;return await this[_0x1f6e71(0x114)][_0x1f6e71(0x116)](_0x1d7b4c);}async['update'](_0x5eea76,_0x3ecd11){const _0x59e881=a107_0x10abf2;try{return await this[_0x59e881(0x114)][_0x59e881(0x12e)](_0x5eea76,_0x3ecd11);}catch(_0x12b0b5){if(isHttp404Error(_0x12b0b5))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x59e881(0x126)+_0x5eea76,_0x12b0b5);throw _0x12b0b5;}}async[a107_0x10abf2(0x13c)](_0x4165f7,_0x2ce316){const _0x435f04=a107_0x10abf2;try{return await this['client'][_0x435f04(0x133)](_0x4165f7,_0x2ce316);}catch(_0xab496e){if(isHttp404Error(_0xab496e))throw new SDKError(ErrorCode[_0x435f04(0x185)],_0x435f04(0x186)+_0x2ce316+'\x20in\x20journey\x20'+_0x4165f7,_0xab496e);throw _0xab496e;}}async['listActivations'](_0x3d79f0){const _0x56e898=a107_0x10abf2;try{return await this['client'][_0x56e898(0x14a)](_0x3d79f0);}catch(_0x32b3ac){if(isHttp404Error(_0x32b3ac))return[];throw _0x32b3ac;}}async['listActivationsFlat'](_0x3a9f9c){const _0x36bf1d=a107_0x10abf2,_0x72d342=await this[_0x36bf1d(0x117)](_0x3a9f9c);return _0x72d342[_0x36bf1d(0x15e)](flattenJourneyActivation);}async['createActivation'](_0x33362c,_0x371f82){const _0x1be982=a107_0x10abf2;return await this[_0x1be982(0x114)]['createJourneyActivation'](_0x33362c,_0x371f82);}async['getColumnMapping'](_0x5ea21d){const _0x63db46=a107_0x10abf2,_0x401de8=await this[_0x63db46(0x162)](_0x5ea21d),_0x4b5b19=generateColumnMapping(_0x401de8);return{'journeyId':_0x401de8['id'],'journeyName':_0x401de8[_0x63db46(0x188)]['name'],'database':_0x63db46(0x131)+_0x401de8['attributes']['audienceId'],'table':_0x63db46(0x18b)+_0x401de8['id'],'columns':_0x4b5b19};}async[a107_0x10abf2(0x132)](_0x36af36){const _0x5c75d1=a107_0x10abf2;return this[_0x5c75d1(0x114)][_0x5c75d1(0x139)](_0x36af36);}async[a107_0x10abf2(0x156)](_0xf4b292){const _0x1bcbff=a107_0x10abf2,_0x192267=await this[_0x1bcbff(0x162)](_0xf4b292),_0x56edd1=_0x192267['attributes'][_0x1bcbff(0x17c)];if(!_0x56edd1)return{'bundleId':'','bundleName':_0x192267[_0x1bcbff(0x188)][_0x1bcbff(0x177)],'bundleDescription':_0x192267[_0x1bcbff(0x188)]['description']??null,'latestJourneyId':_0x192267['id'],'versions':[synthesizePreBundleVersion(_0x192267)]};const _0x3a8343=await this[_0x1bcbff(0x132)](_0x56edd1);return{'bundleId':_0x56edd1,'bundleName':_0x3a8343['name'],'bundleDescription':_0x3a8343[_0x1bcbff(0x13f)]??null,'latestJourneyId':_0x3a8343[_0x1bcbff(0x13a)],'versions':formatVersionsFromBundle(_0x3a8343)};}async[a107_0x10abf2(0x178)](_0x9a6921){const _0x21d511=a107_0x10abf2,_0x5518a8=await this[_0x21d511(0x162)](_0x9a6921),_0x1877ec=_0x5518a8['attributes']['journeyBundleId'];if(!_0x1877ec)throw new SDKError(ErrorCode[_0x21d511(0x127)],_0x21d511(0x142));await this[_0x21d511(0x114)]['checkJourneyAppendable'](_0x1877ec);const _0x132ed9=await this[_0x21d511(0x114)][_0x21d511(0x139)](_0x1877ec),_0x41cb39=_0x132ed9['name']+'\x20v'+(_0x132ed9[_0x21d511(0x175)]+0x1);return this[_0x21d511(0x114)][_0x21d511(0x196)](_0x1877ec,{'sourceId':_0x9a6921,'attributes':{'name':_0x41cb39}});}}
@@ -1 +1 @@
1
- const a108_0x5c210f=a108_0x10b9;(function(_0x3e826e,_0x5b6490){const _0x5cf9a5=a108_0x10b9,_0x268f4b=_0x3e826e();while(!![]){try{const _0x506f75=parseInt(_0x5cf9a5(0xf0))/0x1*(-parseInt(_0x5cf9a5(0xec))/0x2)+-parseInt(_0x5cf9a5(0xf1))/0x3*(parseInt(_0x5cf9a5(0xf4))/0x4)+parseInt(_0x5cf9a5(0xee))/0x5+parseInt(_0x5cf9a5(0xea))/0x6*(-parseInt(_0x5cf9a5(0xf8))/0x7)+parseInt(_0x5cf9a5(0xf2))/0x8*(-parseInt(_0x5cf9a5(0xf6))/0x9)+parseInt(_0x5cf9a5(0xeb))/0xa*(parseInt(_0x5cf9a5(0xf7))/0xb)+parseInt(_0x5cf9a5(0xed))/0xc*(parseInt(_0x5cf9a5(0xef))/0xd);if(_0x506f75===_0x5b6490)break;else _0x268f4b['push'](_0x268f4b['shift']());}catch(_0xc33b96){_0x268f4b['push'](_0x268f4b['shift']());}}}(a108_0x505c,0xf0ce2));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a108_0x5c210f(0xf3),'llm/chat');function a108_0x10b9(_0x59791b,_0x19846e){_0x59791b=_0x59791b-0xea;const _0x505cf1=a108_0x505c();let _0x10b9e9=_0x505cf1[_0x59791b];return _0x10b9e9;}export function saveLastChatId(_0x167d56){const _0x4db1d3=a108_0x5c210f;chatIdCache[_0x4db1d3(0xf5)](_0x167d56);}export function loadLastChatId(){const _0x4070ef=a108_0x5c210f;return chatIdCache[_0x4070ef(0xf9)]();}function a108_0x505c(){const _0x2974c2=['1754679nwsOLX','3872kuCWlz','last_chat_id','4VKmUub','write','17226mIcznV','44cVucqM','153503aQebsw','read','150ApUXUV','1131560gpLphF','2XpLAAz','12LKAnKy','832030lisfRq','42196141OobanS','819055EyJdOS'];a108_0x505c=function(){return _0x2974c2;};return a108_0x505c();}export function clearLastChatId(){chatIdCache['clear']();}
1
+ const a108_0x2654ec=a108_0xcc16;(function(_0x1460ef,_0x479892){const _0x3909cd=a108_0xcc16,_0x49392c=_0x1460ef();while(!![]){try{const _0x18a6ca=parseInt(_0x3909cd(0xba))/0x1+parseInt(_0x3909cd(0xc1))/0x2+-parseInt(_0x3909cd(0xc3))/0x3+-parseInt(_0x3909cd(0xc4))/0x4*(parseInt(_0x3909cd(0xbf))/0x5)+parseInt(_0x3909cd(0xc2))/0x6+parseInt(_0x3909cd(0xbb))/0x7+parseInt(_0x3909cd(0xbc))/0x8;if(_0x18a6ca===_0x479892)break;else _0x49392c['push'](_0x49392c['shift']());}catch(_0x48dd5b){_0x49392c['push'](_0x49392c['shift']());}}}(a108_0x1a99,0xbb5c8));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a108_0x2654ec(0xc5),a108_0x2654ec(0xbd));export function saveLastChatId(_0x5335cd){const _0x36a2d2=a108_0x2654ec;chatIdCache[_0x36a2d2(0xbe)](_0x5335cd);}function a108_0xcc16(_0x6a63ca,_0x362e6c){_0x6a63ca=_0x6a63ca-0xba;const _0x1a993f=a108_0x1a99();let _0xcc160e=_0x1a993f[_0x6a63ca];return _0xcc160e;}export function loadLastChatId(){return chatIdCache['read']();}export function clearLastChatId(){const _0xeb911c=a108_0x2654ec;chatIdCache[_0xeb911c(0xc0)]();}function a108_0x1a99(){const _0x35c7d1=['write','34025PeVKoV','clear','412948DOGGJp','410514AuDODu','158574pUPMVV','752csdDzr','last_chat_id','141140tauxHM','200004YrBckm','13240200xOilwU','llm/chat'];a108_0x1a99=function(){return _0x35c7d1;};return a108_0x1a99();}