@treasuredata/tdx 2026.3.5 → 2026.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.d.ts.map +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/auth-command.js.map +1 -1
  14. package/dist/commands/auth-login-command.d.ts +29 -0
  15. package/dist/commands/auth-login-command.d.ts.map +1 -0
  16. package/dist/commands/auth-login-command.js +1 -0
  17. package/dist/commands/auth-login-command.js.map +1 -0
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-template-pull-command.js +1 -1
  32. package/dist/commands/engage-template-push-command.js +1 -1
  33. package/dist/commands/engage-template-validate-command.js +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/journey-command.js +1 -1
  36. package/dist/commands/journey-validate-command.js +1 -1
  37. package/dist/commands/llm-command.js +1 -1
  38. package/dist/commands/mcp-command.d.ts.map +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/mcp-command.js.map +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/profile-command.d.ts.map +1 -1
  43. package/dist/commands/profile-command.js +1 -1
  44. package/dist/commands/profile-command.js.map +1 -1
  45. package/dist/commands/profiles-command.js +1 -1
  46. package/dist/commands/query-command.js +1 -1
  47. package/dist/commands/schedule-command.js +1 -1
  48. package/dist/commands/segment-command.js +1 -1
  49. package/dist/commands/segment-create-command.js +1 -1
  50. package/dist/commands/segment-fields-command.js +1 -1
  51. package/dist/commands/segment-pull-command.js +1 -1
  52. package/dist/commands/segment-push-command.js +1 -1
  53. package/dist/commands/segment-update-command.js +1 -1
  54. package/dist/commands/segment-use-command.js +1 -1
  55. package/dist/commands/segment-validate-command.js +1 -1
  56. package/dist/commands/segments.js +1 -1
  57. package/dist/commands/show.js +1 -1
  58. package/dist/commands/status-command.d.ts.map +1 -1
  59. package/dist/commands/status-command.js +1 -1
  60. package/dist/commands/status-command.js.map +1 -1
  61. package/dist/commands/tables.js +1 -1
  62. package/dist/commands/unset-command.js +1 -1
  63. package/dist/commands/upgrade-command.js +1 -1
  64. package/dist/commands/use-command.js +1 -1
  65. package/dist/commands/user-command.js +1 -1
  66. package/dist/commands/workflow-command.js +1 -1
  67. package/dist/core/auth.js +1 -1
  68. package/dist/core/command-output.js +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/connection-cache.js +1 -1
  71. package/dist/core/constants.d.ts +11 -0
  72. package/dist/core/constants.d.ts.map +1 -1
  73. package/dist/core/constants.js +1 -1
  74. package/dist/core/constants.js.map +1 -1
  75. package/dist/core/credential-cache.js +1 -1
  76. package/dist/core/global-context.d.ts.map +1 -1
  77. package/dist/core/global-context.js +1 -1
  78. package/dist/core/global-context.js.map +1 -1
  79. package/dist/core/keychain.js +1 -1
  80. package/dist/core/oauth-keychain.d.ts +32 -0
  81. package/dist/core/oauth-keychain.d.ts.map +1 -0
  82. package/dist/core/oauth-keychain.js +1 -0
  83. package/dist/core/oauth-keychain.js.map +1 -0
  84. package/dist/core/oauth.d.ts +112 -0
  85. package/dist/core/oauth.d.ts.map +1 -0
  86. package/dist/core/oauth.js +1 -0
  87. package/dist/core/oauth.js.map +1 -0
  88. package/dist/core/profile.js +1 -1
  89. package/dist/core/project-config.js +1 -1
  90. package/dist/core/session.js +1 -1
  91. package/dist/core/user-cache.js +1 -1
  92. package/dist/core/version.js +1 -1
  93. package/dist/index.js +1 -1
  94. package/dist/mcp/server.js +1 -1
  95. package/dist/mcp/tools/index.js +1 -1
  96. package/dist/mcp/tools/tdx-run.js +1 -1
  97. package/dist/mcp/tools/tdx-search.js +1 -1
  98. package/dist/mcp/utils.js +1 -1
  99. package/dist/proxy/claude-usage-tracker.js +1 -1
  100. package/dist/proxy/passthrough-server.js +1 -1
  101. package/dist/proxy/sse-usage-parser.js +1 -1
  102. package/dist/sdk/agent/agent-config.js +1 -1
  103. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  104. package/dist/sdk/agent/agent-yaml.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js +1 -1
  106. package/dist/sdk/agent/test/executor.js +1 -1
  107. package/dist/sdk/agent/test/index.js +1 -1
  108. package/dist/sdk/agent/test/output.js +1 -1
  109. package/dist/sdk/agent/test/parser.js +1 -1
  110. package/dist/sdk/agent/tool-target-registry.js +1 -1
  111. package/dist/sdk/api.js +1 -1
  112. package/dist/sdk/client/cdp-api-client.js +1 -1
  113. package/dist/sdk/client/delivery-api-client.js +1 -1
  114. package/dist/sdk/client/endpoints.js +1 -1
  115. package/dist/sdk/client/endpoints.js.map +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.d.ts +16 -0
  120. package/dist/sdk/client/oauth-refresh.d.ts.map +1 -0
  121. package/dist/sdk/client/oauth-refresh.js +1 -0
  122. package/dist/sdk/client/oauth-refresh.js.map +1 -0
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.js +1 -1
  127. package/dist/sdk/connection-validator.js +1 -1
  128. package/dist/sdk/connection.js +1 -1
  129. package/dist/sdk/delivery.js +1 -1
  130. package/dist/sdk/engage/campaign-pull.js +1 -1
  131. package/dist/sdk/engage/campaign-push.js +1 -1
  132. package/dist/sdk/engage/campaign-validator.js +1 -1
  133. package/dist/sdk/engage/campaign-yaml.js +1 -1
  134. package/dist/sdk/engage/template-pull.js +1 -1
  135. package/dist/sdk/engage/template-push.js +1 -1
  136. package/dist/sdk/engage/template-validator.js +1 -1
  137. package/dist/sdk/engage/template-yaml.js +1 -1
  138. package/dist/sdk/engage/types/campaign-def.js +1 -1
  139. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  140. package/dist/sdk/engage/types/template-schema.js +1 -1
  141. package/dist/sdk/engage.js +1 -1
  142. package/dist/sdk/errors.js +1 -1
  143. package/dist/sdk/index.js +1 -1
  144. package/dist/sdk/io/index.js +1 -1
  145. package/dist/sdk/io/node-filesystem.js +1 -1
  146. package/dist/sdk/job.js +1 -1
  147. package/dist/sdk/journey.js +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/index.js +1 -1
  150. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  151. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  152. package/dist/sdk/llm/model-factors.js +1 -1
  153. package/dist/sdk/llm/model-factors.js.map +1 -1
  154. package/dist/sdk/personalization.js +1 -1
  155. package/dist/sdk/query/index.js +1 -1
  156. package/dist/sdk/query/sql-parser.js +1 -1
  157. package/dist/sdk/realtime.js +1 -1
  158. package/dist/sdk/schedule.js +1 -1
  159. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/fields-display.js +1 -1
  161. package/dist/sdk/segment/file-discovery.js +1 -1
  162. package/dist/sdk/segment/journey-utils.js +1 -1
  163. package/dist/sdk/segment/journey-validator.js +1 -1
  164. package/dist/sdk/segment/journey-yaml.js +1 -1
  165. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  166. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  167. package/dist/sdk/segment/pull-workflow.js +1 -1
  168. package/dist/sdk/segment/push-recovery.js +1 -1
  169. package/dist/sdk/segment/push-workflow.js +1 -1
  170. package/dist/sdk/segment/resolution-context.js +1 -1
  171. package/dist/sdk/segment/segment-path-parser.js +1 -1
  172. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  173. package/dist/sdk/segment/segment-validator.js +1 -1
  174. package/dist/sdk/segment/target-resolution.js +1 -1
  175. package/dist/sdk/segment/tdx-config.js +1 -1
  176. package/dist/sdk/segment/types/activation-schema.js +1 -1
  177. package/dist/sdk/segment/types/journey-def.js +1 -1
  178. package/dist/sdk/segment/types/journey-schema.js +1 -1
  179. package/dist/sdk/segment/types/segment-def.js +1 -1
  180. package/dist/sdk/segment/types/segment-schema.js +1 -1
  181. package/dist/sdk/segment/validate-files.js +1 -1
  182. package/dist/sdk/segment/yaml-validator.js +1 -1
  183. package/dist/sdk/segment.js +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/progress.js +1 -1
  186. package/dist/sdk/user.js +1 -1
  187. package/dist/sdk/util/format-detector.js +1 -1
  188. package/dist/sdk/util/formatters.js +1 -1
  189. package/dist/sdk/util/index.js +1 -1
  190. package/dist/sdk/util/paginate.js +1 -1
  191. package/dist/sdk/util/tree-formatter.js +1 -1
  192. package/dist/sdk/workflow/archive-validation.js +1 -1
  193. package/dist/sdk/workflow/clone-workflow.js +1 -1
  194. package/dist/sdk/workflow/index.js +1 -1
  195. package/dist/sdk/workflow/pull-workflow.js +1 -1
  196. package/dist/sdk/workflow/push-workflow.js +1 -1
  197. package/dist/sdk/workflow/tdx-config.js +1 -1
  198. package/dist/sdk/workflow/workflow-utils.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -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_0x4c9f16=a120_0x3eb6;(function(_0x149e43,_0x492bca){const _0x59772c=a120_0x3eb6,_0x390a8d=_0x149e43();while(!![]){try{const _0x293c3a=-parseInt(_0x59772c(0xed))/0x1+parseInt(_0x59772c(0xb5))/0x2*(parseInt(_0x59772c(0xfe))/0x3)+parseInt(_0x59772c(0x9b))/0x4*(parseInt(_0x59772c(0xd1))/0x5)+-parseInt(_0x59772c(0xe5))/0x6*(-parseInt(_0x59772c(0xdd))/0x7)+-parseInt(_0x59772c(0xc3))/0x8+parseInt(_0x59772c(0xff))/0x9+-parseInt(_0x59772c(0xc1))/0xa;if(_0x293c3a===_0x492bca)break;else _0x390a8d['push'](_0x390a8d['shift']());}catch(_0x19a6b8){_0x390a8d['push'](_0x390a8d['shift']());}}}(a120_0x9775,0xe0551));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x1334b3){const _0x4a0362=a120_0x3eb6;return _0x1334b3[_0x4a0362(0x94)]??_0x1334b3[_0x4a0362(0xf9)]?.[_0x4a0362(0x94)]??undefined;}function getVersionNumber(_0xa5fb0b){const _0x2a6d06=a120_0x3eb6;return _0xa5fb0b[_0x2a6d06(0xac)]??_0xa5fb0b['attributes']?.[_0x2a6d06(0xac)]??0x0;}function getState(_0x3d51f1){const _0x3da5d1=a120_0x3eb6;return _0x3d51f1[_0x3da5d1(0xbe)]??_0x3d51f1['attributes']?.[_0x3da5d1(0xbe)];}export function deduplicateJourneysByBundle(_0x2d7efe){const _0x27fc11=a120_0x3eb6,_0x4230d6=new Map();let _0x272940=0x0;for(const _0x820d6a of _0x2d7efe){const _0x59208d=getBundleId(_0x820d6a);if(!_0x59208d){const _0x521ce2=_0x27fc11(0xaf)+(_0x820d6a['id']??_0x27fc11(0xfb)+_0x272940++);_0x4230d6[_0x27fc11(0xcf)](_0x521ce2,_0x820d6a);continue;}const _0x1e50ad=_0x4230d6['get'](_0x59208d);if(!_0x1e50ad)_0x4230d6['set'](_0x59208d,_0x820d6a);else{const _0x17a493=getState(_0x1e50ad)===_0x27fc11(0xf3),_0xf4d095=getState(_0x820d6a)==='launched';if(_0xf4d095&&!_0x17a493)_0x4230d6['set'](_0x59208d,_0x820d6a);else{if(!_0xf4d095&&_0x17a493){}else{const _0x45fd5e=getVersionNumber(_0x1e50ad),_0x153bae=getVersionNumber(_0x820d6a);_0x153bae>_0x45fd5e&&_0x4230d6[_0x27fc11(0xcf)](_0x59208d,_0x820d6a);}}}}return Array['from'](_0x4230d6[_0x27fc11(0x104)]());}const VALID_JOURNEY_STATES=new Set([a120_0x4c9f16(0xfc),a120_0x4c9f16(0xd5),a120_0x4c9f16(0xf3)]);export function parseJourneyState(_0x16bbdb){const _0x45bcd0=a120_0x4c9f16;if(typeof _0x16bbdb==='string'&&VALID_JOURNEY_STATES[_0x45bcd0(0x106)](_0x16bbdb))return _0x16bbdb;return'draft';}function a120_0x3eb6(_0xbae9ea,_0x4c4405){_0xbae9ea=_0xbae9ea-0x87;const _0x977502=a120_0x9775();let _0x3eb6dc=_0x977502[_0xbae9ea];return _0x3eb6dc;}export function entityToJourneyListItem(_0xab2518,_0x39118e){const _0x2ae198=a120_0x4c9f16,_0x51da91=_0xab2518[_0x2ae198(0xf9)];return{'id':_0xab2518['id'],'name':_0x51da91[_0x2ae198(0x10c)]??'','journeyBundleName':_0x51da91[_0x2ae198(0xd4)]??_0x51da91[_0x2ae198(0x10c)]??'','journeyBundleId':_0x51da91[_0x2ae198(0x94)]??'','versionNumber':_0x51da91[_0x2ae198(0xac)],'description':_0x51da91[_0x2ae198(0xe6)]??null,'state':parseJourneyState(_0x51da91[_0x2ae198(0xbe)]),'paused':_0x51da91[_0x2ae198(0x9c)]??![],'audienceId':_0x39118e,'folderId':_0x51da91[_0x2ae198(0xb0)]??_0xab2518[_0x2ae198(0x98)]?.[_0x2ae198(0x8e)]?.['data']?.['id']??null,'createdAt':_0x51da91[_0x2ae198(0xba)]??'','updatedAt':_0x51da91[_0x2ae198(0xd2)]??''};}function convertToColumnId(_0x149a2a){const _0x51dc42=a120_0x4c9f16;return _0x149a2a[_0x51dc42(0x96)](/-/g,'_');}function getStepEntries(_0x76d5b5){const _0x5ad304=a120_0x4c9f16;if(!_0x76d5b5)return[];if(Array[_0x5ad304(0x89)](_0x76d5b5))return _0x76d5b5['map'](_0x1cb967=>[_0x1cb967['id'],_0x1cb967]);return Object[_0x5ad304(0xf7)](_0x76d5b5);}export function flattenJourneyActivation(_0x1c0cd5){const _0x43dce0=a120_0x4c9f16,{activationParams:_0x1bab26,activationId:_0x395890,runAfterJourneyRefresh:_0xfe2c27}=_0x1c0cd5[_0x43dce0(0xf9)];return{'id':_0x1c0cd5['id'],'activationId':_0x395890,'runAfterJourneyRefresh':_0xfe2c27,..._0x1bab26};}function col(_0x37d033,_0xa5724c={}){const _0x38eec3=a120_0x4c9f16;return{'column':_0x37d033,'direction':null,'stageIndex':null,'stageName':null,'category':_0x38eec3(0xb8),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0xa5724c};}export function generateColumnMapping(_0x4dd478){const _0x9998e8=a120_0x4c9f16,_0x57ecf4=[];_0x57ecf4[_0x9998e8(0xb2)](col(_0x9998e8(0xb1))),_0x57ecf4['push'](col(_0x9998e8(0xa3),{'direction':'in','category':'journey'})),_0x57ecf4['push'](col(_0x9998e8(0x10d),{'direction':_0x9998e8(0xb3),'category':_0x9998e8(0xcd)}));_0x4dd478[_0x9998e8(0xf9)][_0x9998e8(0x8b)]&&_0x57ecf4['push'](col(_0x9998e8(0x102),{'direction':'in','category':_0x9998e8(0x8b),'detail':_0x4dd478['attributes'][_0x9998e8(0x8b)][_0x9998e8(0x10c)]||null}));const _0x11e5c3=_0x4dd478[_0x9998e8(0xf9)]['journeyStages']||[];for(let _0x3051b0=0x0;_0x3051b0<_0x11e5c3[_0x9998e8(0x107)];_0x3051b0++){const _0x521f63=_0x11e5c3[_0x3051b0],_0x88cf01=_0x521f63[_0x9998e8(0x10c)],_0x51224d={'stageIndex':_0x3051b0,'stageName':_0x88cf01},_0x32594a=_0x521f63['entryCriteria']?.[_0x9998e8(0x10c)]||null;_0x57ecf4[_0x9998e8(0xb2)](col(_0x9998e8(0xdf)+_0x3051b0,{..._0x51224d,'direction':'in','category':'stage','detail':_0x32594a})),_0x57ecf4[_0x9998e8(0xb2)](col('outtime_stage_'+_0x3051b0,{..._0x51224d,'direction':_0x9998e8(0xb3),'category':'stage','detail':_0x32594a}));_0x521f63[_0x9998e8(0x109)]&&_0x57ecf4[_0x9998e8(0xb2)](col(_0x9998e8(0xdf)+_0x3051b0+_0x9998e8(0x103),{..._0x51224d,'direction':'in','category':'milestone','detail':_0x521f63[_0x9998e8(0x109)][_0x9998e8(0x10c)]||null}));const _0xe293ee=_0x521f63[_0x9998e8(0xa4)]||_0x521f63[_0x9998e8(0x105)]||[];for(let _0x22a894=0x0;_0x22a894<_0xe293ee[_0x9998e8(0x107)];_0x22a894++){_0x57ecf4[_0x9998e8(0xb2)](col('intime_stage_'+_0x3051b0+'_exit_'+_0x22a894,{..._0x51224d,'direction':'in','category':_0x9998e8(0xa8),'detail':_0xe293ee[_0x22a894][_0x9998e8(0x10c)]||null}));}const _0x4b9a08=getStepEntries(_0x521f63[_0x9998e8(0xe2)]);for(const [_0x47c129,_0xb2048b]of _0x4b9a08){const _0x11ae06=convertToColumnId(_0x47c129),_0x29b835=_0xb2048b[_0x9998e8(0xe3)]||null,_0x2c89d5=_0xb2048b[_0x9998e8(0x10c)]||null,_0x29b8a8={..._0x51224d,'stepType':_0x29b835,'stepName':_0x2c89d5,'stepId':_0x47c129};_0x57ecf4['push'](col(_0x9998e8(0xdf)+_0x3051b0+'_'+_0x11ae06,{..._0x29b8a8,'direction':'in','category':'step'})),_0x57ecf4[_0x9998e8(0xb2)](col('outtime_stage_'+_0x3051b0+'_'+_0x11ae06,{..._0x29b8a8,'direction':_0x9998e8(0xb3),'category':_0x9998e8(0x93)}));if(_0xb2048b['type']===_0x9998e8(0xfd)&&_0xb2048b[_0x9998e8(0x101)])for(const _0x2597d1 of _0xb2048b['branches']){_0x2597d1[_0x9998e8(0xc2)]&&_0x57ecf4[_0x9998e8(0xb2)](col(_0x9998e8(0xdf)+_0x3051b0+'_'+_0x11ae06+'_'+_0x2597d1[_0x9998e8(0xc2)],{..._0x29b8a8,'direction':'in','category':_0x9998e8(0xc7),'detail':_0x2597d1[_0x9998e8(0x10c)]||(_0x2597d1[_0x9998e8(0x100)]?'Excluded\x20profiles':null)}));}if((_0xb2048b[_0x9998e8(0xe3)]===_0x9998e8(0xa5)||_0xb2048b[_0x9998e8(0xe3)]===_0x9998e8(0xb6))&&_0xb2048b[_0x9998e8(0xd8)])for(const _0x5e4201 of _0xb2048b[_0x9998e8(0xd8)]){_0x5e4201['id']&&_0x57ecf4[_0x9998e8(0xb2)](col(_0x9998e8(0xdf)+_0x3051b0+'_'+_0x11ae06+_0x9998e8(0xa6)+convertToColumnId(_0x5e4201['id']),{..._0x29b8a8,'direction':'in','category':_0x9998e8(0xee),'detail':_0x5e4201[_0x9998e8(0x10c)]||null}));}if(_0xb2048b[_0x9998e8(0xe3)]===_0x9998e8(0xf6)||_0xb2048b['type']===_0x9998e8(0x95)){const _0x2a2ff4=[];if(_0xb2048b[_0x9998e8(0x10a)])_0x2a2ff4[_0x9998e8(0xb2)](_0xb2048b[_0x9998e8(0x10a)]);else{if(Array[_0x9998e8(0x89)](_0xb2048b[_0x9998e8(0x10b)]))for(const _0x26e8f5 of _0xb2048b[_0x9998e8(0x10b)]){_0x26e8f5['segmentId']&&!_0x26e8f5['timedOutPath']&&_0x2a2ff4[_0x9998e8(0xb2)](_0x26e8f5[_0x9998e8(0xc2)]);}else _0xb2048b['waitCondition']?.[_0x9998e8(0xc2)]&&_0x2a2ff4[_0x9998e8(0xb2)](_0xb2048b['waitCondition'][_0x9998e8(0xc2)]);}for(const _0x5a6617 of _0x2a2ff4){_0x57ecf4[_0x9998e8(0xb2)](col(_0x9998e8(0xdf)+_0x3051b0+'_'+_0x11ae06+'_'+_0x5a6617,{..._0x29b8a8,'direction':'in','category':'branch'}));}}}}return _0x57ecf4[_0x9998e8(0xb2)](col(_0x9998e8(0xce))),_0x57ecf4;}export function aggregateJourneyHistory(_0x324932){const _0x4e1242=a120_0x4c9f16,_0x130aff=_0x324932[_0x4e1242(0xf4)]((_0x4de43c,_0x50c432)=>_0x4de43c+(_0x50c432[_0x4e1242(0x8f)]??0x0),0x0),_0x98073f=_0x324932[_0x4e1242(0xf4)]((_0x1d5a93,_0x12bf38)=>_0x1d5a93+(_0x12bf38['goalInflux']??0x0),0x0),_0x2571af=_0x324932[_0x4e1242(0xf4)]((_0x75de7c,_0x252163)=>_0x75de7c+((_0x252163[_0x4e1242(0xd3)]??0x0)+(_0x252163[_0x4e1242(0xe8)]??0x0)),0x0),_0x49294a=_0x324932[_0x324932[_0x4e1242(0x107)]-0x1];return{'size':_0x49294a?.[_0x4e1242(0xf8)]??0x0,'entered':_0x130aff,'goal_achieved':_0x98073f,'completion_rate':_0x98073f&&_0x130aff?_0x98073f/_0x130aff*0x64:0x0,'exit_or_jump':_0x2571af,'exit_or_jump_rate':_0x2571af&&_0x130aff?_0x2571af/_0x130aff*0x64:0x0};}export function aggregateStageHistory(_0x1d324b){const _0x33aac6=a120_0x4c9f16,_0x33c19e=_0x1d324b[_0x33aac6(0xf4)]((_0x5ef219,_0x35023f)=>_0x5ef219+(_0x35023f[_0x33aac6(0x8f)]??0x0),0x0),_0x518126=_0x1d324b['reduce']((_0x6dc1f,_0x479e78)=>_0x6dc1f+(_0x479e78['milestoneInflux']??0x0),0x0),_0x566384=_0x1d324b[_0x33aac6(0xf4)]((_0x42fd49,_0x744408)=>_0x42fd49+((_0x744408[_0x33aac6(0xd3)]??0x0)+(_0x744408[_0x33aac6(0xe8)]??0x0)),0x0),_0x7e8331=_0x1d324b[_0x1d324b[_0x33aac6(0x107)]-0x1];return{'size':_0x7e8331?.[_0x33aac6(0xf8)]??0x0,'entered':_0x33c19e,'milestone':_0x518126,'milestone_rate':_0x518126&&_0x33c19e?_0x518126/_0x33c19e*0x64:0x0,'exit_or_jump':_0x566384,'exit_or_jump_rate':_0x566384&&_0x33c19e?_0x566384/_0x33c19e*0x64:0x0};}export function assembleJourneyStats(_0x3c42c5,_0x40f557){const _0x2f7c7f=a120_0x4c9f16,_0x141b70=!!(_0x40f557?.[_0x2f7c7f(0x8a)]||_0x40f557?.['to'])&&!!_0x3c42c5[_0x2f7c7f(0xd7)]?.[_0x2f7c7f(0x107)];if(_0x141b70){const _0x1e2f8d=aggregateJourneyHistory(_0x3c42c5[_0x2f7c7f(0xd7)]),_0x141715={'journey_id':_0x3c42c5[_0x2f7c7f(0x9e)],..._0x40f557?.[_0x2f7c7f(0x8a)]&&{'from':_0x40f557[_0x2f7c7f(0x8a)]},..._0x40f557?.['to']&&{'to':_0x40f557['to']},..._0x1e2f8d};return _0x40f557?.[_0x2f7c7f(0x9f)]&&(_0x141715[_0x2f7c7f(0xd7)]=_0x3c42c5[_0x2f7c7f(0xd7)]),_0x141715;}return{'journey_id':_0x3c42c5[_0x2f7c7f(0x9e)],'size':_0x3c42c5[_0x2f7c7f(0xf8)],'entered':_0x3c42c5[_0x2f7c7f(0x88)],'goal_achieved':_0x3c42c5[_0x2f7c7f(0xe4)],'completion_rate':_0x3c42c5[_0x2f7c7f(0xf1)],'exit_or_jump':_0x3c42c5[_0x2f7c7f(0xc6)],'exit_or_jump_rate':_0x3c42c5['exitOrJumpRate']};}export function formatVersionsFromBundle(_0x15feda){const _0x32d830=a120_0x4c9f16,_0xe66c24=_0x15feda[_0x32d830(0xbb)][_0x32d830(0xeb)](_0x191b81=>({'journeyId':_0x191b81['id'],'versionNumber':_0x191b81[_0x32d830(0xf9)][_0x32d830(0xac)]??0x0,'name':_0x191b81['attributes'][_0x32d830(0x10c)],'state':_0x191b81[_0x32d830(0xf9)][_0x32d830(0xbe)],'paused':_0x191b81[_0x32d830(0xf9)][_0x32d830(0x9c)],'createdAt':_0x191b81[_0x32d830(0xf9)][_0x32d830(0xba)],'updatedAt':_0x191b81[_0x32d830(0xf9)]['updatedAt']}));return _0xe66c24['sort']((_0x51b479,_0x25ed80)=>_0x51b479['versionNumber']-_0x25ed80[_0x32d830(0xac)]),_0xe66c24;}export function synthesizePreBundleVersion(_0x4567aa){const _0x53f016=a120_0x4c9f16;return{'journeyId':_0x4567aa['id'],'versionNumber':0x1,'name':_0x4567aa[_0x53f016(0xf9)][_0x53f016(0x10c)],'state':_0x4567aa[_0x53f016(0xf9)][_0x53f016(0xbe)],'paused':_0x4567aa[_0x53f016(0xf9)][_0x53f016(0x9c)],'createdAt':_0x4567aa[_0x53f016(0xf9)][_0x53f016(0xba)],'updatedAt':_0x4567aa[_0x53f016(0xf9)][_0x53f016(0xd2)]};}export function buildStageNameMap(_0x28e06d){const _0x422144=a120_0x4c9f16;return new Map(_0x28e06d[_0x422144(0xf9)][_0x422144(0xde)]?.['map'](_0x1b9d95=>[_0x1b9d95['id'],_0x1b9d95[_0x422144(0x10c)]])??[]);}export class JourneySDK{['client'];constructor(_0x261987){this['client']=new CDPApiClient(_0x261987);}[a120_0x4c9f16(0xa7)](_0x2e1342,_0x37f7b7){return _0x37f7b7?_0x2e1342:deduplicateJourneysByBundle(_0x2e1342);}async[a120_0x4c9f16(0x99)](_0x28d477,_0x205eb8){const _0x4be6ae=a120_0x4c9f16;try{const _0x5adaff=await this[_0x4be6ae(0x8c)][_0x4be6ae(0x99)](_0x28d477);return{'journeys':this[_0x4be6ae(0xa7)](_0x5adaff[_0x4be6ae(0xbb)],_0x205eb8),'activationStepsById':_0x5adaff[_0x4be6ae(0xbc)]};}catch(_0x3996bc){if(isHttp404Error(_0x3996bc))return{'journeys':[],'activationStepsById':new Map()};throw _0x3996bc;}}async[a120_0x4c9f16(0xb7)](_0x5703fc,_0x552b22,_0x5550f1){const _0x39e536=a120_0x4c9f16;let _0x1d8a62=_0x552b22;if(!_0x1d8a62)try{const _0xf5ff41=await this[_0x39e536(0x8c)][_0x39e536(0xd6)](_0x5703fc);_0x1d8a62=_0xf5ff41['rootFolderId']??undefined;}catch(_0x262dff){if(isHttp404Error(_0x262dff))return[];throw _0x262dff;}if(!_0x1d8a62)return[];let _0x33724e;if(_0x5550f1?.[_0x39e536(0x92)]){const _0x29f509=await this['client']['listSegmentFolders'](_0x5703fc),_0x2faee6=_0x29f509[_0x39e536(0xeb)](_0x28e4cb=>this[_0x39e536(0x8c)][_0x39e536(0xad)](_0x28e4cb['id'])),_0x4b5a80=await Promise[_0x39e536(0xc0)](_0x2faee6),_0x92d3f9=new Set();_0x33724e=_0x4b5a80['flat']()[_0x39e536(0xd0)](_0x288457=>{const _0x259348=_0x39e536;if(_0x92d3f9[_0x259348(0x106)](_0x288457['id']))return![];return _0x92d3f9['add'](_0x288457['id']),!![];});}else{const _0x525330=await this[_0x39e536(0x8c)][_0x39e536(0xcb)](_0x1d8a62,0x20,![]),_0x30d5f8=_0x525330[_0x39e536(0x9a)],_0x4ab064=_0x30d5f8['filter'](_0x17bce0=>_0x17bce0[_0x39e536(0xe3)]==='journey');_0x33724e=_0x4ab064['map'](_0x13f111=>entityToJourneyListItem(_0x13f111,_0x5703fc));}return this['applyVersionDeduplication'](_0x33724e,_0x5550f1?.[_0x39e536(0x92)]);}async['listJourneysWithFolders'](_0x417dfe,_0x551c18,_0xc2bcbb){const _0x44c375=a120_0x4c9f16;if(!_0x551c18)return{'journeys':[],'folders':[]};const _0x19c2d4=await this[_0x44c375(0x8c)]['listEntitiesByFolder'](_0x551c18,0x20,![]),_0x1f225b=_0x19c2d4[_0x44c375(0x9a)],_0x4f5843=_0x1f225b[_0x44c375(0xd0)](_0x599b83=>_0x599b83[_0x44c375(0xe3)]==='folder-segment'&&_0x599b83['id']!==_0x551c18),_0x86f853=_0x4f5843[_0x44c375(0xeb)](_0x3bf65a=>({'id':_0x3bf65a['id'],'name':_0x3bf65a[_0x44c375(0xf9)][_0x44c375(0x10c)]})),_0x496e4b=_0x1f225b[_0x44c375(0xd0)](_0x5f0753=>_0x5f0753[_0x44c375(0xe3)]===_0x44c375(0xcd)),_0x33e9c4=_0x496e4b[_0x44c375(0xeb)](_0x5b3f00=>entityToJourneyListItem(_0x5b3f00,_0x417dfe));return{'journeys':this['applyVersionDeduplication'](_0x33e9c4,_0xc2bcbb?.[_0x44c375(0x92)]),'folders':_0x86f853};}async[a120_0x4c9f16(0xe7)](_0x54381f,_0x256218){const _0xd38cbd=a120_0x4c9f16;let _0x129e32;try{_0x129e32=await this[_0xd38cbd(0x8c)][_0xd38cbd(0xa2)](_0x54381f);}catch(_0x4ebaa1){if(isHttp404Error(_0x4ebaa1))return{'journeys':[],'activationStepsById':new Map()};throw _0x4ebaa1;}const _0x333dfe=_0x129e32[_0xd38cbd(0xeb)](async _0x16fa5c=>{const _0x470833=_0xd38cbd;return await this[_0x470833(0x99)](_0x16fa5c['id'],_0x256218?.[_0x470833(0x92)]);}),_0x1f4ef1=await Promise['all'](_0x333dfe),_0x528db2=new Map(),_0x2c5b19=[];for(const _0x4393f6 of _0x1f4ef1){_0x2c5b19[_0xd38cbd(0xb2)](..._0x4393f6[_0xd38cbd(0xbb)]);for(const [_0x5f05ce,_0x4e29e7]of _0x4393f6[_0xd38cbd(0xbc)]){_0x528db2[_0xd38cbd(0xcf)](_0x5f05ce,_0x4e29e7);}}const _0x3d51c0=new Set(),_0x455ada=_0x2c5b19[_0xd38cbd(0xd0)](_0x561f46=>{const _0x3e7e23=_0xd38cbd;if(_0x3d51c0[_0x3e7e23(0x106)](_0x561f46['id']))return![];return _0x3d51c0[_0x3e7e23(0xec)](_0x561f46['id']),!![];});return{'journeys':this['applyVersionDeduplication'](_0x455ada,_0x256218?.['includeAllVersions']),'activationStepsById':_0x528db2};}async[a120_0x4c9f16(0x97)](_0x3708c4){const _0x3c0ab9=a120_0x4c9f16;try{return await this[_0x3c0ab9(0x8c)][_0x3c0ab9(0x97)](_0x3708c4);}catch(_0xe16d5e){if(isHttp404Error(_0xe16d5e))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x3c0ab9(0xe0)+_0x3708c4,_0xe16d5e);throw _0xe16d5e;}}async['resolveJourneyId'](_0x33c243,_0x5072ad){const _0xe93f50=a120_0x4c9f16,_0x177640=await this[_0xe93f50(0xb7)](_0x33c243),_0x369ae6=_0x177640[_0xe93f50(0xae)](_0x45a8be=>_0x45a8be[_0xe93f50(0xd4)][_0xe93f50(0xb9)]()===_0x5072ad[_0xe93f50(0xb9)]());if(!_0x369ae6)throw new SDKError(ErrorCode[_0xe93f50(0xe1)],_0xe93f50(0xe0)+_0x5072ad,undefined,{'helpText':_0xe93f50(0xdc)});return _0x369ae6['id'];}async[a120_0x4c9f16(0xaa)](_0xbbd499,_0x4730a1){const _0x27e7f7=a120_0x4c9f16;try{return await this[_0x27e7f7(0x8c)][_0x27e7f7(0xcc)](_0xbbd499,_0x4730a1);}catch(_0x220585){if(isHttp404Error(_0x220585))throw new SDKError(ErrorCode[_0x27e7f7(0xe1)],_0x27e7f7(0xe0)+_0xbbd499,_0x220585);throw _0x220585;}}async[a120_0x4c9f16(0x91)](_0xad9aad,_0x434f49){const _0x482d9c=a120_0x4c9f16,_0xcb894e={'from':_0x434f49?.[_0x482d9c(0x8a)],'to':_0x434f49?.['to'],'limit':_0x434f49?.[_0x482d9c(0xdb)]},_0x4e1c68=_0x434f49?.['type']!==_0x482d9c(0xb4);try{const [_0x4df88b,_0x389ecf]=await Promise[_0x482d9c(0xc0)]([this[_0x482d9c(0xa9)](_0xad9aad,_0x434f49?.[_0x482d9c(0xe3)],_0xcb894e),_0x4e1c68?this['getJourney'](_0xad9aad):undefined]);if(_0x4df88b[_0x482d9c(0xf0)]&&_0x389ecf){const _0xe7e0e7=buildStageNameMap(_0x389ecf);_0x4df88b[_0x482d9c(0xf0)]=_0x4df88b[_0x482d9c(0xf0)][_0x482d9c(0xeb)](_0x2230fc=>({..._0x2230fc,'journeyStageName':_0xe7e0e7[_0x482d9c(0xf5)](_0x2230fc[_0x482d9c(0xd9)])??_0x2230fc[_0x482d9c(0xd9)]}));}return _0x4df88b;}catch(_0x1127ee){if(isHttp404Error(_0x1127ee))throw new SDKError(ErrorCode['JOURNEY_NOT_FOUND'],_0x482d9c(0xe0)+_0xad9aad,_0x1127ee);throw _0x1127ee;}}async[a120_0x4c9f16(0xa9)](_0x51faba,_0x5600c9,_0x3c3b06){const _0x5057d4=a120_0x4c9f16;if(_0x5600c9==='conversion'){const _0x559f01=await this['client']['getConversionSankeyChart'](_0x51faba,_0x3c3b06);return{'conversion':_0x559f01};}if(_0x5600c9===_0x5057d4(0xf0)){const _0x773af0=await this['client'][_0x5057d4(0xc8)](_0x51faba,_0x3c3b06);return{'activation':_0x773af0};}const [_0x2ba7be,_0x580414]=await Promise[_0x5057d4(0xc0)]([this[_0x5057d4(0x8c)][_0x5057d4(0x10e)](_0x51faba,_0x3c3b06),this[_0x5057d4(0x8c)][_0x5057d4(0xc8)](_0x51faba,_0x3c3b06)]);return{'conversion':_0x2ba7be,'activation':_0x580414};}async[a120_0x4c9f16(0xbf)](_0x511d9a){const _0x3c8427=a120_0x4c9f16;try{return await this[_0x3c8427(0x8c)][_0x3c8427(0x9d)](_0x511d9a);}catch(_0x4ca069){if(isHttp404Error(_0x4ca069))throw new SDKError(ErrorCode[_0x3c8427(0xe1)],'Journey\x20not\x20found:\x20'+_0x511d9a,_0x4ca069);throw _0x4ca069;}}async[a120_0x4c9f16(0xe9)](_0x457f48){const _0x4fd904=a120_0x4c9f16;try{return await this[_0x4fd904(0x8c)][_0x4fd904(0xc9)](_0x457f48);}catch(_0x301aef){if(isHttp404Error(_0x301aef))throw new SDKError(ErrorCode[_0x4fd904(0xe1)],_0x4fd904(0xe0)+_0x457f48,_0x301aef);throw _0x301aef;}}async['create'](_0x3fbd0a){const _0x20ad9b=a120_0x4c9f16;return await this[_0x20ad9b(0x8c)][_0x20ad9b(0xda)](_0x3fbd0a);}async[a120_0x4c9f16(0xef)](_0x5efe47,_0x44ede6){const _0x2c7ce1=a120_0x4c9f16;try{return await this[_0x2c7ce1(0x8c)][_0x2c7ce1(0x90)](_0x5efe47,_0x44ede6);}catch(_0x2e7d48){if(isHttp404Error(_0x2e7d48))throw new SDKError(ErrorCode[_0x2c7ce1(0xe1)],_0x2c7ce1(0xe0)+_0x5efe47,_0x2e7d48);throw _0x2e7d48;}}async['getActivation'](_0x1ac5f4,_0x269f27){const _0x2278f1=a120_0x4c9f16;try{return await this[_0x2278f1(0x8c)]['getJourneyActivation'](_0x1ac5f4,_0x269f27);}catch(_0xe895b9){if(isHttp404Error(_0xe895b9))throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20activation\x20step\x20not\x20found:\x20'+_0x269f27+_0x2278f1(0xf2)+_0x1ac5f4,_0xe895b9);throw _0xe895b9;}}async[a120_0x4c9f16(0xa0)](_0x1c8bfa){const _0x2e94f8=a120_0x4c9f16;try{return await this['client'][_0x2e94f8(0x8d)](_0x1c8bfa);}catch(_0x120f2c){if(isHttp404Error(_0x120f2c))return[];throw _0x120f2c;}}async['listActivationsFlat'](_0x25c423){const _0x22b0e9=a120_0x4c9f16,_0x30e99e=await this[_0x22b0e9(0xa0)](_0x25c423);return _0x30e99e[_0x22b0e9(0xeb)](flattenJourneyActivation);}async[a120_0x4c9f16(0x108)](_0xf4f507,_0x2a80d3){const _0x220d8d=a120_0x4c9f16;return await this[_0x220d8d(0x8c)][_0x220d8d(0xc5)](_0xf4f507,_0x2a80d3);}async['getColumnMapping'](_0x19da67){const _0x20b634=a120_0x4c9f16,_0x5ce676=await this['getJourney'](_0x19da67),_0x5533f4=generateColumnMapping(_0x5ce676);return{'journeyId':_0x5ce676['id'],'journeyName':_0x5ce676['attributes'][_0x20b634(0x10c)],'database':_0x20b634(0xa1)+_0x5ce676[_0x20b634(0xf9)][_0x20b634(0xab)],'table':_0x20b634(0xea)+_0x5ce676['id'],'columns':_0x5533f4};}async[a120_0x4c9f16(0xfa)](_0x265adc){const _0x5ec5bc=a120_0x4c9f16;return this[_0x5ec5bc(0x8c)][_0x5ec5bc(0xbd)](_0x265adc);}async[a120_0x4c9f16(0x10f)](_0x59a919){const _0x3b92da=a120_0x4c9f16;if(!_0x59a919)return undefined;try{const _0x25c545=await this[_0x3b92da(0xfa)](_0x59a919);return _0x25c545[_0x3b92da(0x87)];}catch{return undefined;}}async['listVersions'](_0x3db85a){const _0x1dcbc2=a120_0x4c9f16,_0x10e5a3=await this['getJourney'](_0x3db85a),_0x1e8306=_0x10e5a3[_0x1dcbc2(0xf9)][_0x1dcbc2(0x94)];if(!_0x1e8306)return{'bundleId':'','bundleName':_0x10e5a3['attributes'][_0x1dcbc2(0x10c)],'bundleDescription':_0x10e5a3[_0x1dcbc2(0xf9)][_0x1dcbc2(0xe6)]??null,'latestJourneyId':_0x10e5a3['id'],'versions':[synthesizePreBundleVersion(_0x10e5a3)]};const _0x47cda2=await this[_0x1dcbc2(0xfa)](_0x1e8306);return{'bundleId':_0x1e8306,'bundleName':_0x47cda2[_0x1dcbc2(0x10c)],'bundleDescription':_0x47cda2[_0x1dcbc2(0xe6)]??null,'latestJourneyId':_0x47cda2[_0x1dcbc2(0x87)],'versions':formatVersionsFromBundle(_0x47cda2)};}async['createVersion'](_0x1c39e7){const _0x3cbb15=a120_0x4c9f16,_0xe0d714=await this['getJourney'](_0x1c39e7),_0x46b3b4=_0xe0d714['attributes'][_0x3cbb15(0x94)];if(!_0x46b3b4)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle');await this['client'][_0x3cbb15(0xc4)](_0x46b3b4);const _0x28cc5a=await this[_0x3cbb15(0x8c)][_0x3cbb15(0xbd)](_0x46b3b4),_0x1b7a7a=_0x28cc5a[_0x3cbb15(0x10c)]+'\x20v'+(_0x28cc5a['lastVersionNumber']+0x1);return this['client'][_0x3cbb15(0xca)](_0x46b3b4,{'sourceId':_0x1c39e7,'attributes':{'name':_0x1b7a7a}});}}function a120_0x9775(){const _0x51e67c=['createActivation','milestone','conditionSegmentId','conditions','name','outtime_journey','getConversionSankeyChart','getLatestJourneyId','latestJourneyId','enteredSize','isArray','from','goal','client','listJourneyActivations','parentFolder','entryInflux','updateJourney','getTrafficData','includeAllVersions','step','journeyBundleId','Wait','replace','getJourney','relationships','listJourneysWithDetails','data','4854856dooITp','paused','pauseJourney','journeyId','includeHistory','listActivations','cdp_audience_','listSegmentFolders','intime_journey','exitCriterias','AbTest','_variant_','applyVersionDeduplication','exit_criteria','fetchTrafficRaw','getStatistics','audienceId','versionNumber','listJourneys','find','no-bundle-','segmentFolderId','cdp_customer_id','push','out','conversion','8844RdEjhu','ABTest','listJourneysFromParentSegment','fixed','toLowerCase','createdAt','journeys','activationStepsById','getJourneyBundle','state','pause','all','19998700cUrOop','segmentId','9147880GDVqAY','checkJourneyAppendable','createJourneyActivation','exitOrJumpSize','branch','getActivationSankeyChart','resumeJourney','createJourneyVersion','listEntitiesByFolder','getJourneyStatistics','journey','time','set','filter','5Qgrove','updatedAt','exitInflux','journeyBundleName','simulation','getParentSegmentFull','history','variants','journeyStageId','createJourney','limit','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','7uDoBDR','journeyStages','intime_stage_','Journey\x20not\x20found:\x20','JOURNEY_NOT_FOUND','steps','type','goalSize','10952022kvaPlp','description','listJourneysWithDetailsFromParentSegment','jumpInflux','resume','journey_','map','add','688078vXComY','variant','update','activation','completionRate','\x20in\x20journey\x20','launched','reduce','get','WaitStep','entries','size','attributes','getBundle','idx-','draft','DecisionPoint','90DJVeqk','14207283eaNThh','excluded','branches','intime_goal','_milestone','values','exitCriteria','has','length'];a120_0x9775=function(){return _0x51e67c;};return a120_0x9775();}
@@ -1 +1 @@
1
- function a117_0x1604(){const _0x39f7d5=['1243744oblUef','last_chat_id','2989016eyWhXm','511iYMhdH','444aVQmAR','1299LNQoME','25968UHlkJd','463450tvBTZJ','clear','394403EGOUhk','write','523629EqRayg'];a117_0x1604=function(){return _0x39f7d5;};return a117_0x1604();}function a117_0x2328(_0x4c07ea,_0x277eb4){_0x4c07ea=_0x4c07ea-0xc9;const _0x16045b=a117_0x1604();let _0x232883=_0x16045b[_0x4c07ea];return _0x232883;}const a117_0x32de03=a117_0x2328;(function(_0x51dfb7,_0x797e5){const _0x59939b=a117_0x2328,_0x568563=_0x51dfb7();while(!![]){try{const _0x3aa77a=parseInt(_0x59939b(0xd3))/0x1+parseInt(_0x59939b(0xce))/0x2*(parseInt(_0x59939b(0xcf))/0x3)+-parseInt(_0x59939b(0xca))/0x4+parseInt(_0x59939b(0xd1))/0x5+-parseInt(_0x59939b(0xd0))/0x6*(parseInt(_0x59939b(0xcd))/0x7)+parseInt(_0x59939b(0xcc))/0x8+-parseInt(_0x59939b(0xc9))/0x9;if(_0x3aa77a===_0x797e5)break;else _0x568563['push'](_0x568563['shift']());}catch(_0x48ad13){_0x568563['push'](_0x568563['shift']());}}}(a117_0x1604,0x425a9));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a117_0x32de03(0xcb),'llm/chat');export function saveLastChatId(_0x2a8545){const _0x562425=a117_0x32de03;chatIdCache[_0x562425(0xd4)](_0x2a8545);}export function loadLastChatId(){return chatIdCache['read']();}export function clearLastChatId(){const _0x545c44=a117_0x32de03;chatIdCache[_0x545c44(0xd2)]();}
1
+ function a121_0x4dbc(){const _0x31ccd7=['2786937GKebTX','write','2MyEYnN','589640xoFeaS','23607162ihuGmI','read','10jGAJLB','35yuykdT','4121742fXMmyS','1074528xehFJf','last_chat_id','947431SdQerO','8433980SsCxYv','llm/chat'];a121_0x4dbc=function(){return _0x31ccd7;};return a121_0x4dbc();}const a121_0x2c7232=a121_0x2083;function a121_0x2083(_0xafc1bf,_0x55e07d){_0xafc1bf=_0xafc1bf-0x1d4;const _0x4dbcb7=a121_0x4dbc();let _0x20833e=_0x4dbcb7[_0xafc1bf];return _0x20833e;}(function(_0x3d13b2,_0x2b10c1){const _0x19581f=a121_0x2083,_0x1a0a84=_0x3d13b2();while(!![]){try{const _0x54097b=-parseInt(_0x19581f(0x1d9))/0x1*(-parseInt(_0x19581f(0x1de))/0x2)+parseInt(_0x19581f(0x1dc))/0x3+parseInt(_0x19581f(0x1d7))/0x4+parseInt(_0x19581f(0x1da))/0x5+-parseInt(_0x19581f(0x1d6))/0x6+-parseInt(_0x19581f(0x1d5))/0x7*(-parseInt(_0x19581f(0x1df))/0x8)+-parseInt(_0x19581f(0x1e0))/0x9*(parseInt(_0x19581f(0x1d4))/0xa);if(_0x54097b===_0x2b10c1)break;else _0x1a0a84['push'](_0x1a0a84['shift']());}catch(_0x2a73cf){_0x1a0a84['push'](_0x1a0a84['shift']());}}}(a121_0x4dbc,0xd9614));import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a121_0x2c7232(0x1d8),a121_0x2c7232(0x1db));export function saveLastChatId(_0x313b92){const _0x3e5ae0=a121_0x2c7232;chatIdCache[_0x3e5ae0(0x1dd)](_0x313b92);}export function loadLastChatId(){const _0x27eae3=a121_0x2c7232;return chatIdCache[_0x27eae3(0x1e1)]();}export function clearLastChatId(){chatIdCache['clear']();}