@treasuredata/tdx 2026.7.4 → 2026.7.5

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 (248) 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/cas-command.d.ts.map +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-command.js.map +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-move-command.js +1 -1
  45. package/dist/commands/segment-pull-command.js +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-update-command.js +1 -1
  48. package/dist/commands/segment-use-command.js +1 -1
  49. package/dist/commands/segment-validate-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/status-command.js +1 -1
  53. package/dist/commands/table-deleted.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/work-command.js +1 -1
  60. package/dist/commands/workflow-command.js +1 -1
  61. package/dist/core/auth.js +1 -1
  62. package/dist/core/command-output.js +1 -1
  63. package/dist/core/config.js +1 -1
  64. package/dist/core/connection-cache.js +1 -1
  65. package/dist/core/constants.js +1 -1
  66. package/dist/core/credential-cache.js +1 -1
  67. package/dist/core/global-context.js +1 -1
  68. package/dist/core/keychain.js +1 -1
  69. package/dist/core/oauth-keychain.js +1 -1
  70. package/dist/core/oauth.js +1 -1
  71. package/dist/core/profile.js +1 -1
  72. package/dist/core/project-config.js +1 -1
  73. package/dist/core/session.js +1 -1
  74. package/dist/core/user-cache.js +1 -1
  75. package/dist/core/version.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/mcp/server.js +1 -1
  78. package/dist/mcp/tools/index.js +1 -1
  79. package/dist/mcp/tools/tdx-run.js +1 -1
  80. package/dist/mcp/tools/tdx-search.js +1 -1
  81. package/dist/mcp/tools/work-create-item.js +1 -1
  82. package/dist/mcp/utils.js +1 -1
  83. package/dist/proxy/claude-usage-tracker.js +1 -1
  84. package/dist/proxy/passthrough-server.js +1 -1
  85. package/dist/proxy/sse-usage-parser.js +1 -1
  86. package/dist/sdk/agent/agent-config.js +1 -1
  87. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  88. package/dist/sdk/agent/agent-yaml.js +1 -1
  89. package/dist/sdk/agent/test/evaluator.js +1 -1
  90. package/dist/sdk/agent/test/executor.js +1 -1
  91. package/dist/sdk/agent/test/index.js +1 -1
  92. package/dist/sdk/agent/test/output.js +1 -1
  93. package/dist/sdk/agent/test/parser.js +1 -1
  94. package/dist/sdk/agent/tool-target-registry.js +1 -1
  95. package/dist/sdk/api.js +1 -1
  96. package/dist/sdk/cas/cas-api-client.js +1 -1
  97. package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
  98. package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
  99. package/dist/sdk/cas/cas-audience-schema.js +1 -1
  100. package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
  101. package/dist/sdk/cas/cas-audience-validator.js +1 -1
  102. package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
  103. package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
  104. package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-audience-yaml.js.map +1 -1
  107. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  108. package/dist/sdk/cas/index.js +1 -1
  109. package/dist/sdk/cas/pull-workflow.js +1 -1
  110. package/dist/sdk/cas/push-workflow.d.ts +47 -1
  111. package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
  112. package/dist/sdk/cas/push-workflow.js +1 -1
  113. package/dist/sdk/cas/push-workflow.js.map +1 -1
  114. package/dist/sdk/cas/validate-files.js +1 -1
  115. package/dist/sdk/client/cdp-api-client.js +1 -1
  116. package/dist/sdk/client/delivery-api-client.js +1 -1
  117. package/dist/sdk/client/endpoints.js +1 -1
  118. package/dist/sdk/client/engage-api-client.d.ts +6 -6
  119. package/dist/sdk/client/engage-api-client.js +1 -1
  120. package/dist/sdk/client/engage-api-client.js.map +1 -1
  121. package/dist/sdk/client/http-client.js +1 -1
  122. package/dist/sdk/client/llm-api-client.js +1 -1
  123. package/dist/sdk/client/oauth-refresh.js +1 -1
  124. package/dist/sdk/client/rate-limiter.js +1 -1
  125. package/dist/sdk/client/td-api-client.js +1 -1
  126. package/dist/sdk/client/trino-api-client.js +1 -1
  127. package/dist/sdk/client/workflow-client.js +1 -1
  128. package/dist/sdk/connection-validator.js +1 -1
  129. package/dist/sdk/connection.js +1 -1
  130. package/dist/sdk/delivery.js +1 -1
  131. package/dist/sdk/engage/campaign-pull.js +1 -1
  132. package/dist/sdk/engage/campaign-push.js +1 -1
  133. package/dist/sdk/engage/campaign-validator.js +1 -1
  134. package/dist/sdk/engage/campaign-yaml.js +1 -1
  135. package/dist/sdk/engage/template-pull.js +1 -1
  136. package/dist/sdk/engage/template-push.js +1 -1
  137. package/dist/sdk/engage/template-validator.js +1 -1
  138. package/dist/sdk/engage/template-yaml.js +1 -1
  139. package/dist/sdk/engage/types/campaign-def.js +1 -1
  140. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  141. package/dist/sdk/engage/types/template-schema.js +1 -1
  142. package/dist/sdk/engage.js +1 -1
  143. package/dist/sdk/errors.js +1 -1
  144. package/dist/sdk/index.js +1 -1
  145. package/dist/sdk/io/index.js +1 -1
  146. package/dist/sdk/io/node-filesystem.js +1 -1
  147. package/dist/sdk/job.js +1 -1
  148. package/dist/sdk/journey.js +1 -1
  149. package/dist/sdk/llm/chat-cache.js +1 -1
  150. package/dist/sdk/llm/index.js +1 -1
  151. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  152. package/dist/sdk/llm/model-factors.js +1 -1
  153. package/dist/sdk/llm/user-settings.js +1 -1
  154. package/dist/sdk/personalization.js +1 -1
  155. package/dist/sdk/policy.js +1 -1
  156. package/dist/sdk/query/deleted-table-validation.js +1 -1
  157. package/dist/sdk/query/index.js +1 -1
  158. package/dist/sdk/query/sql-parser.js +1 -1
  159. package/dist/sdk/realtime.js +1 -1
  160. package/dist/sdk/schedule.js +1 -1
  161. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  162. package/dist/sdk/segment/fields-display.js +1 -1
  163. package/dist/sdk/segment/file-discovery.js +1 -1
  164. package/dist/sdk/segment/journey-utils.js +1 -1
  165. package/dist/sdk/segment/journey-validator.js +1 -1
  166. package/dist/sdk/segment/journey-yaml.js +1 -1
  167. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  168. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  169. package/dist/sdk/segment/pull-workflow.js +1 -1
  170. package/dist/sdk/segment/push-recovery.js +1 -1
  171. package/dist/sdk/segment/push-workflow.js +1 -1
  172. package/dist/sdk/segment/resolution-context.js +1 -1
  173. package/dist/sdk/segment/segment-path-parser.js +1 -1
  174. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  175. package/dist/sdk/segment/segment-validator.js +1 -1
  176. package/dist/sdk/segment/target-resolution.js +1 -1
  177. package/dist/sdk/segment/tdx-config.js +1 -1
  178. package/dist/sdk/segment/types/activation-schema.js +1 -1
  179. package/dist/sdk/segment/types/journey-def.js +1 -1
  180. package/dist/sdk/segment/types/journey-schema.js +1 -1
  181. package/dist/sdk/segment/types/segment-def.js +1 -1
  182. package/dist/sdk/segment/types/segment-schema.js +1 -1
  183. package/dist/sdk/segment/validate-files.js +1 -1
  184. package/dist/sdk/segment/yaml-validator.js +1 -1
  185. package/dist/sdk/segment.js +1 -1
  186. package/dist/sdk/types/cas.d.ts +5 -0
  187. package/dist/sdk/types/cas.d.ts.map +1 -1
  188. package/dist/sdk/types/index.js +1 -1
  189. package/dist/sdk/types/progress.js +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/util/tree-search.js +1 -1
  198. package/dist/sdk/workflow/archive-validation.js +1 -1
  199. package/dist/sdk/workflow/clone-workflow.js +1 -1
  200. package/dist/sdk/workflow/index.js +1 -1
  201. package/dist/sdk/workflow/pull-workflow.js +1 -1
  202. package/dist/sdk/workflow/push-workflow.js +1 -1
  203. package/dist/sdk/workflow/task-graph.js +1 -1
  204. package/dist/sdk/workflow/tdx-config.js +1 -1
  205. package/dist/sdk/workflow/workflow-utils.js +1 -1
  206. package/dist/sdk/workspace/access-tracker.js +1 -1
  207. package/dist/sdk/workspace/frontmatter.js +1 -1
  208. package/dist/sdk/workspace/git.js +1 -1
  209. package/dist/sdk/workspace/index.js +1 -1
  210. package/dist/sdk/workspace/templates.js +1 -1
  211. package/dist/sdk/workspace/weekly.js +1 -1
  212. package/dist/sdk/workspace/wikilinks.js +1 -1
  213. package/dist/test-utils/command-runner.js +1 -1
  214. package/dist/test-utils/factories.js +1 -1
  215. package/dist/test-utils/fixtures.js +1 -1
  216. package/dist/test-utils/http-mock.js +1 -1
  217. package/dist/test-utils/index.js +1 -1
  218. package/dist/utils/async.js +1 -1
  219. package/dist/utils/claude-code-state.js +1 -1
  220. package/dist/utils/colors.js +1 -1
  221. package/dist/utils/diff.js +1 -1
  222. package/dist/utils/file-permissions.js +1 -1
  223. package/dist/utils/file-reader.js +1 -1
  224. package/dist/utils/github-releases.js +1 -1
  225. package/dist/utils/global-cache.js +1 -1
  226. package/dist/utils/json-loader.js +1 -1
  227. package/dist/utils/local-cache.js +1 -1
  228. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  229. package/dist/utils/logger/formatters/index.js +1 -1
  230. package/dist/utils/logger/handlers/console-handler.js +1 -1
  231. package/dist/utils/logger/handlers/file-handler.js +1 -1
  232. package/dist/utils/logger/handlers/index.js +1 -1
  233. package/dist/utils/logger/handlers/null-handler.js +1 -1
  234. package/dist/utils/logger/index.js +1 -1
  235. package/dist/utils/logger/logger.js +1 -1
  236. package/dist/utils/logger/types.js +1 -1
  237. package/dist/utils/option-validation.js +1 -1
  238. package/dist/utils/process.js +1 -1
  239. package/dist/utils/prompt.js +1 -1
  240. package/dist/utils/proxy-fetch.js +1 -1
  241. package/dist/utils/proxy-fetch.js.map +1 -1
  242. package/dist/utils/spinner.js +1 -1
  243. package/dist/utils/sse-parser.js +1 -1
  244. package/dist/utils/string-utils.js +1 -1
  245. package/dist/utils/table-ref-parser.js +1 -1
  246. package/dist/utils/tdx-logger.js +1 -1
  247. package/dist/utils/version-check.js +1 -1
  248. package/package.json +1 -1
@@ -1 +1 @@
1
- const a159_0x3ddbd6=a159_0x4982;(function(_0x1e7e40,_0x23f3fa){const _0x437d51=a159_0x4982,_0x111189=_0x1e7e40();while(!![]){try{const _0x691ddd=parseInt(_0x437d51(0x168))/0x1*(parseInt(_0x437d51(0x10c))/0x2)+parseInt(_0x437d51(0x175))/0x3*(-parseInt(_0x437d51(0x1c7))/0x4)+-parseInt(_0x437d51(0x13d))/0x5+-parseInt(_0x437d51(0x1d3))/0x6+-parseInt(_0x437d51(0xfe))/0x7+parseInt(_0x437d51(0x1a9))/0x8+parseInt(_0x437d51(0x136))/0x9*(parseInt(_0x437d51(0x170))/0xa);if(_0x691ddd===_0x23f3fa)break;else _0x111189['push'](_0x111189['shift']());}catch(_0x4ddb51){_0x111189['push'](_0x111189['shift']());}}}(a159_0x535c,0x9f16d));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a159_0x3ddbd6(0x116));export const PENDING_SEGMENT_PREFIX=a159_0x3ddbd6(0x1c4);export const PENDING_ACTIVATION_PREFIX=a159_0x3ddbd6(0x1d9);export function createPendingSegmentId(_0x189e8a){return''+PENDING_SEGMENT_PREFIX+_0x189e8a+'__';}export function isPendingSegmentId(_0x59b35c){const _0x1674ef=a159_0x3ddbd6;return _0x59b35c[_0x1674ef(0x135)](PENDING_SEGMENT_PREFIX)&&!_0x59b35c['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x7c28d6){const _0x33ca63=a159_0x3ddbd6;return _0x7c28d6[_0x33ca63(0x12d)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x286398){return''+PENDING_ACTIVATION_PREFIX+_0x286398+'__';}export function isPendingActivationId(_0x273790){return _0x273790['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x50a9ba){const _0xdb5333=a159_0x3ddbd6;return _0x50a9ba[_0xdb5333(0x12d)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x556986,_0xcbf519){const _0x460f9d=a159_0x3ddbd6,_0x3733a1=_0x556986+'::'+(_0xcbf519[_0x460f9d(0x164)]()||'segment'),_0x28e21a=createHash(_0x460f9d(0x162))[_0x460f9d(0xf5)](_0x3733a1)['digest']('hex')['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x28e21a;}export function ensureJourneyDefaults(_0x577caa){const _0x412250=a159_0x3ddbd6;!_0x577caa['description']&&(_0x577caa['description']=''),!_0x577caa['state']&&(_0x577caa[_0x412250(0x17e)]=_0x412250(0xf9));}export function injectExistingStageIds(_0x50c51d,_0x3fe8b5){const _0x37eb75=a159_0x3ddbd6,_0x3a0faf=new Map(_0x3fe8b5[_0x37eb75(0x185)](_0x4c4ebe=>[_0x4c4ebe[_0x37eb75(0x101)],_0x4c4ebe['id']]));for(const _0x515e41 of _0x50c51d){if(!_0x515e41['id']){const _0xdc56b0=_0x3a0faf['get'](_0x515e41[_0x37eb75(0x101)]);_0xdc56b0&&(_0x515e41['id']=_0xdc56b0);}}}export function resolveTDFolderPath(_0x447e5f,_0x1e87f3,_0x57becb){const _0x8bb841=a159_0x3ddbd6;if(!_0x1e87f3)return _0x447e5f;if(_0x447e5f===_0x57becb||_0x447e5f[_0x8bb841(0x135)](_0x57becb+'/'))return _0x447e5f;return _0x447e5f?_0x57becb+'/'+_0x447e5f:_0x57becb;}export function addFoldersToCreate(_0x567fdf,_0xbfc8d3,_0x238b65){const _0x2ac715=a159_0x3ddbd6;if(!_0x567fdf)return;if(_0xbfc8d3[_0x2ac715(0x18e)](_0x567fdf))return;const _0x4127c8=_0x567fdf['split']('/');let _0x19addc='';for(const _0x47caad of _0x4127c8){_0x19addc=_0x19addc?_0x19addc+'/'+_0x47caad:_0x47caad,!_0xbfc8d3[_0x2ac715(0x18e)](_0x19addc)&&_0x238b65[_0x2ac715(0x1cd)](_0x19addc);}}export function sortFoldersByDepth(_0x5c815f){return[..._0x5c815f]['sort']((_0x55dff1,_0x4cd025)=>{const _0x244ecf=a159_0x4982,_0x52eb3e=(_0x55dff1[_0x244ecf(0x105)](/\//g)||[])[_0x244ecf(0x107)],_0x28044c=(_0x4cd025['match'](/\//g)||[])[_0x244ecf(0x107)];return _0x52eb3e-_0x28044c;});}import*as a159_0x424d42 from'yaml';import{readFileSync}from'fs';import a159_0x59f5d5 from'path';import{isJourneyDef,parseYamlString as a159_0x21833f,toYamlString as a159_0x529b31,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';function a159_0x535c(){const _0x50b571=['utf-8','diff','embedded_activation_created','toString','folder_creating','kind','9092400PTolJn','segment_updated','\x20journey\x20from\x20file:\x20','some','journey_updated','Failed\x20to\x20fetch\x20referenced\x20segment\x20','existingSegments','Stage\x20\x27','conditionSegmentId','create','exitCriterias','Created\x20journey\x20\x27','attributes','createdSegmentId','unchanged','join','existingActivation','folderPath','.$1.push-recovery.json','segmentId','branches','find','\x0a\x20\x20','existingSegment','createSegment','WaitStep','activation_deleted','__pending_','push','size','2404UXKRYr','Duration','activation_updating','action','relationships','folder_created','add','segment_created','\x20error(s)','waitStep','user','\x27\x20by\x20rule\x20content','3499116kKAoeh','valid','\x27\x20from\x20file:\x20','message','journeyStages','embedded_activation_creating','__pending_act_','activationContext',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','logWarning','ACTIVATION_UPDATE_ERROR','index','folderId','segment_deleted','\x27\x20entry\x20criteria','fetchJourney','segment_creating','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','relative','created','getActivation','Updated\x20activation\x20\x27','connector_config','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','isNew','Entry\x20criteria:\x20','connectionIdToNameMap','Delete\x20the\x20push\x20recovery\x20file\x20(','waitStepUnit','deps','schedule','update','errors','embedded_segment_creating','logInfo','draft','createdSegmentIds','parseDocument','Creating\x20folder\x20\x27','progress','5239479rMUZDl','absolutePath','\x20(referenced\x20in\x20journey\x20','name','rootFolderId','Deleting\x20activation\x20\x27','journeyBundlesByFolderAndName','match','conditionTimeoutDuration','length','entry_criteria','resolveJourneyId','from','localName','360jrzkMU','activationActions','folder','uniqueSegmentName','type','results','with','nameToType','folderPathToId','reduce','tdx.sdk.push-workflow','day','journeyBundleId','Creating\x20segment\x20\x27','Matched\x20server\x20segment\x20\x27','decision_point','idToEmailMap','all','listActivations','updateSegmentById','stage\x20\x27','\x27...','\x27\x20wait\x20condition','steps','\x27\x20exit\x20criteria','withProgress','JOURNEY_SYNTAX_ERROR','createActivation','Embedded\x20segment\x20\x27','columns','activation_created','delete','deleted','replace',').\x20','updated','values','existingJourney','segment_deleting','description','getLatestJourneyId','startsWith','104283UblWQM','activations','Segment\x20not\x20found','entryCriteria','isArray','activation_','list','4408250NftTyx','debug','notification','waitStepType','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','validatedRequest','activation_template_id','dirname','Updating\x20segment\x20\x27','entries','getSegment\x20failed\x20for\x20','toISOString','Deleted\x20segment\x20\x27','getJourney','max','journeyActivationStepId','Deleted\x20activation\x20\x27','hasChanges','Segment\x20not\x20found:\x20','keys','updateActivation','Updated\x20journey\x20\x27','resolvedRule','idToName','./child-segment-yaml.js','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Created\x20folder\x20\x27','Created\x20activation\x20\x27','../../utils/async.js','resolveSegment','journey_creating','embedded_segment_created','logSuccess','createFolder','journey_created','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Failed\x20to\x20','sha1','logDeleted','trim','Condition','all_columns','segments','5597mgGCyA','Activation\x20not\x20found:\x20','stringify','embeddedSegmentNameToId','skipSegments','Updating\x20activation\x20\x27','activationParams','./journey-yaml.js','1130nIaveX','Activation','segmentNameToId','onProgress','rule','2937KRZJqT','journeys','segment','journeyName','data','effectiveFolderId','journeyId','journey','DecisionPoint','state','get','segmentFolderId','deleteActivation','createJourneySegment','split','parentId','map','filter','parse','toLowerCase','SEGMENT_UPDATE_ERROR','set','connection','\x27\x20for\x20','conditionTimeoutUnit','has','Journey\x20\x27','journeyById','goal','buildUserMaps','activationsBySegmentId','\x20segment\x20from\x20file:\x20','SEGMENT_SYNTAX_ERROR','milestone','sort','conditions','\x27\x20decision\x20point\x20branch\x20\x27','behavior','run_after_journey_refresh','NOT_FOUND','nameToId','journeyBundleName','yamlConfig','versionNumber','slice','uniqueServerName'];a159_0x535c=function(){return _0x50b571;};return a159_0x535c();}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x9d5916){const _0x3ee24a=a159_0x3ddbd6;if(Array[_0x3ee24a(0x13a)](_0x9d5916))return'['+_0x9d5916[_0x3ee24a(0x185)](_0x1d60f7=>stableStringify(_0x1d60f7))['join'](',')+']';if(_0x9d5916&&typeof _0x9d5916==='object'){const _0x125454=_0x9d5916,_0x5c54e8=Object[_0x3ee24a(0x150)](_0x125454)[_0x3ee24a(0x197)](),_0x5ec8e3=_0x5c54e8[_0x3ee24a(0x185)](_0x4d1ced=>'\x22'+_0x4d1ced+'\x22:'+stableStringify(_0x125454[_0x4d1ced]));return'{'+_0x5ec8e3['join'](',')+'}';}const _0x211504=JSON[_0x3ee24a(0x16a)](_0x9d5916);return _0x211504===undefined?'null':_0x211504;}function activationSignature(_0x1570db){const _0x5e6530=a159_0x3ddbd6,_0x5e57d1={'connection':_0x1570db[_0x5e6530(0x18b)],..._0x1570db['all_columns']!==undefined&&{'all_columns':_0x1570db[_0x5e6530(0x166)]},..._0x1570db[_0x5e6530(0x129)]!==undefined&&{'columns':_0x1570db['columns']},..._0x1570db[_0x5e6530(0x19a)]!==undefined&&{'behavior':_0x1570db[_0x5e6530(0x19a)]},..._0x1570db[_0x5e6530(0xf4)]!==undefined&&{'schedule':_0x1570db['schedule']},..._0x1570db[_0x5e6530(0x13f)]!==undefined&&{'notification':_0x1570db[_0x5e6530(0x13f)]},..._0x1570db[_0x5e6530(0xec)]!==undefined&&{'connector_config':_0x1570db[_0x5e6530(0xec)]},..._0x1570db[_0x5e6530(0x143)]!==undefined&&{'activation_template_id':_0x1570db['activation_template_id']}};return stableStringify(_0x5e57d1);}async function fetchSegment(_0x41ceea,_0x5148b6,_0x2233a6,_0x22be8a){const _0x5aad07=a159_0x3ddbd6,_0x5c1e5e=_0x22be8a?.[_0x5aad07(0x1be)](_0x1aa91d=>_0x1aa91d['id']===_0x2233a6);if(_0x5c1e5e)return _0x5c1e5e;try{return await _0x41ceea[_0x5aad07(0x177)]['getSegment'](_0x5148b6,_0x2233a6);}catch(_0x14c9fd){logger[_0x5aad07(0x13e)](_0x5aad07(0x147)+_0x2233a6+_0x5aad07(0x1db)+_0x14c9fd);try{return await _0x41ceea[_0x5aad07(0x177)]['getSegmentEntity'](_0x2233a6);}catch(_0x21c49a){return logger[_0x5aad07(0x13e)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2233a6+':\x20'+_0x21c49a),null;}}}function recoverSegmentIdsFromPushRecovery(_0x4019f7,_0x51ff2c,_0x481757){const _0x28714e=a159_0x3ddbd6,_0x4faf0a=readPushRecovery(_0x4019f7[_0x28714e(0xff)]);if(_0x4faf0a?.[_0x28714e(0x178)]===_0x4019f7[_0x28714e(0x19f)]['name'])for(const [_0x5763f9,_0x530157]of Object[_0x28714e(0x146)](_0x4faf0a['segments'])){const _0x24c92d=generateDeterministicJourneySegmentName(_0x4019f7[_0x28714e(0x19f)][_0x28714e(0x101)],_0x5763f9);_0x530157[_0x28714e(0x1a2)]===_0x24c92d&&(_0x51ff2c[_0x28714e(0x18a)](_0x5763f9,_0x530157['segmentId']),_0x481757[_0x28714e(0x18a)](_0x5763f9,_0x530157[_0x28714e(0x1bc)]));}}async function createOrRecoverEmbeddedSegment(_0x3b5414,_0x82ff7f,_0x5309a3,_0x180102){const _0x4c51a1=a159_0x3ddbd6;let _0x196d06;try{_0x196d06=await _0x3b5414[_0x4c51a1(0x177)][_0x4c51a1(0x182)]({'name':_0x5309a3[_0x4c51a1(0x10f)],'description':_0x5309a3[_0x4c51a1(0x133)],'journeyId':_0x5309a3[_0x4c51a1(0x17b)],'rule':_0x180102(_0x5309a3[_0x4c51a1(0x153)],!![]),'countPopulation':!![],'parentFolderId':_0x5309a3[_0x4c51a1(0x1df)],'audienceId':_0x5309a3['parentId']});}catch(_0x2c4b9a){const _0x2b8587=_0x2c4b9a instanceof Error&&_0x2c4b9a[_0x4c51a1(0x1d6)]['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x2b8587){const _0xf7868c=readPushRecovery(_0x82ff7f[_0x4c51a1(0xff)]),_0x40f6d3=_0xf7868c?.[_0x4c51a1(0x178)]===_0x82ff7f[_0x4c51a1(0x19f)][_0x4c51a1(0x101)]?_0xf7868c['segments'][_0x5309a3[_0x4c51a1(0x10b)]]:undefined;if(_0x40f6d3?.[_0x4c51a1(0x1a2)]===_0x5309a3[_0x4c51a1(0x10f)])await _0x3b5414[_0x4c51a1(0x177)][_0x4c51a1(0x11f)](_0x5309a3[_0x4c51a1(0x184)],_0x40f6d3[_0x4c51a1(0x1bc)],{'description':_0x5309a3[_0x4c51a1(0x133)],'rule':_0x180102(_0x5309a3[_0x4c51a1(0x153)],!![]),'countPopulation':!![]}),_0x196d06=_0x40f6d3[_0x4c51a1(0x1bc)];else throw new SDKError(ErrorCode[_0x4c51a1(0x189)],_0x4c51a1(0x128)+_0x5309a3['localName']+_0x4c51a1(0x1e4)+(_0x4c51a1(0xf1)+_0x82ff7f[_0x4c51a1(0xff)]['replace'](/([^/]+)$/,_0x4c51a1(0x1bb))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x2c4b9a);}else throw _0x2c4b9a;}return saveSegmentToPushRecovery(_0x82ff7f[_0x4c51a1(0xff)],_0x82ff7f['yamlConfig'][_0x4c51a1(0x101)],_0x5309a3['localName'],{'segmentId':_0x196d06,'uniqueServerName':_0x5309a3['uniqueSegmentName'],'createdAt':new Date()[_0x4c51a1(0x148)]()}),_0x196d06;}export async function prepareSegmentFiles(_0x466a1a,_0x57b966,_0x17e547,_0x444951,_0x48a07b){const _0x4c92a1=a159_0x3ddbd6,{activationDefToCreateRequest:_0x14a08d}=await import(_0x4c92a1(0x155)),_0x5a7a23=[],_0x3f8c7d=new Set();for(const {yamlConfig:_0x1bdaf0,folderPath:_0x277afa,sourcePath:_0x47cbb4}of _0x466a1a){const _0xf6ae90=resolveTDFolderPath(_0x277afa,_0x444951,_0x48a07b),_0x11242e=_0xf6ae90+':'+_0x1bdaf0[_0x4c92a1(0x101)],_0x48f2a8=_0x57b966['segmentByFolderAndName'][_0x4c92a1(0x17f)](_0x11242e),_0x1af312=_0x48f2a8?_0x57b966[_0x4c92a1(0x193)][_0x4c92a1(0x17f)](_0x48f2a8['id'])||[]:[];addFoldersToCreate(_0xf6ae90,_0x57b966[_0x4c92a1(0x114)],_0x3f8c7d);const _0x5dd5b8=calculateActivationActions(_0x1bdaf0[_0x4c92a1(0x137)]||[],_0x1af312,_0x57b966[_0x4c92a1(0x11c)],_0x57b966[_0x4c92a1(0xf0)]);for(const _0x2e1ca0 of _0x5dd5b8){(_0x2e1ca0[_0x4c92a1(0x110)]===_0x4c92a1(0x1b2)||_0x2e1ca0[_0x4c92a1(0x110)]==='update')&&_0x2e1ca0['yamlActivation']&&(_0x2e1ca0[_0x4c92a1(0x142)]=await _0x14a08d(_0x2e1ca0['yamlActivation'],_0x17e547));}const _0x4101aa=calculateSegmentDiff(_0x1bdaf0,_0x48f2a8,_0x1af312,_0x57b966['idToEmailMap'],_0x57b966[_0x4c92a1(0xf0)]);_0x5a7a23[_0x4c92a1(0x1c5)]({'relativePath':_0x1bdaf0['name'],'absolutePath':_0x47cbb4,'yamlConfig':_0x1bdaf0,'folderPath':_0xf6ae90,'existingSegment':_0x48f2a8,'existingActivations':_0x1af312,'isNew':_0x4101aa[_0x4c92a1(0xee)],'hasChanges':_0x4101aa[_0x4c92a1(0x14e)],'diff':_0x4101aa[_0x4c92a1(0x1a4)],'activationActions':_0x5dd5b8});}return{'segmentFiles':_0x5a7a23,'foldersToCreate':_0x3f8c7d};}export async function prepareJourneyFiles(_0x147a66,_0xdac77b,_0x15f24d,_0x28fe3a){const _0x5a3247=a159_0x3ddbd6,_0x4437c4=[],_0xdd308b=new Set();for(const {yamlConfig:_0x1a36a0,folderPath:_0x361168,sourcePath:_0x8bf96f}of _0x147a66){const _0x2d4a2b=resolveTDFolderPath(_0x361168,_0x15f24d,_0x28fe3a),_0x2d0b01=_0x2d4a2b+':'+_0x1a36a0['name'],_0x1b3e09=_0xdac77b[_0x5a3247(0x104)][_0x5a3247(0x17f)](_0x2d0b01);let _0x29de59,_0x487cb5;if(_0x1b3e09&&_0x1b3e09['length']>0x0){const _0x24f23c=buildLocalExpandedRuleMappings(_0x1a36a0),{createYamlContext:_0x202ba1,prefetchJourneySegments:_0x29824d}=createPushYamlContextForBundle(_0xdac77b[_0x5a3247(0xf3)],_0xdac77b[_0x5a3247(0x184)],_0xdac77b[_0x5a3247(0x1af)],_0x24f23c,_0xdac77b[_0x5a3247(0x11c)],_0xdac77b[_0x5a3247(0xf0)],_0xdac77b['activationStepsById'],_0xdac77b[_0x5a3247(0x190)]);await _0x29824d(_0x1b3e09[_0x5a3247(0x185)](_0x381aa8=>_0x381aa8['id']));const _0x3eee6e=await _0xdac77b[_0x5a3247(0xf3)][_0x5a3247(0x17c)][_0x5a3247(0x134)](_0x1b3e09[0x0][_0x5a3247(0x118)]),_0x335159=hasMultipleVersions(_0x1a36a0),_0x3729fd=async _0x2e6781=>{const _0x5cc705=_0x5a3247,_0x3860d9=_0xdac77b['journeyById']?.[_0x5cc705(0x17f)](_0x2e6781);if(_0x3860d9)return _0x3860d9;return _0xdac77b[_0x5cc705(0x1e2)]({'journeyId':_0x2e6781,'journeyName':_0x1a36a0['name'],'isMultiVersion':_0x1b3e09['length']>0x1});};if(_0x335159&&_0x1b3e09[_0x5a3247(0x107)]>0x1){const _0xf816f3=[];for(const _0xa99e95 of _0x1b3e09){const _0xc5357d=_0xa99e95[_0x5a3247(0x1a0)]||0x1;_0xdac77b[_0x5a3247(0xfd)]?.[_0x5a3247(0xf5)]('Fetching\x20'+_0x1a36a0['name']+'\x20v'+_0xc5357d);const _0x36f4c2=await _0x3729fd(_0xa99e95['id']),_0x20d7f1=_0x202ba1(_0xa99e95['id']),_0x39fec1=await journeyResponseToDef(_0x36f4c2,_0x20d7f1);_0xf816f3[_0x5a3247(0x1c5)]({'item':_0xa99e95,'yaml':_0x39fec1});}const _0x1f1b33=buildLocalRuleToNameMappingFromJourney(_0x1a36a0);_0x487cb5=buildMergedJourneyDef(_0xf816f3,_0x1f1b33,_0x3eee6e);const _0x5a7c9b=Math[_0x5a3247(0x14b)](..._0xf816f3[_0x5a3247(0x185)](_0x60d1a3=>_0x60d1a3['item'][_0x5a3247(0x1a0)]||0x0)),_0x4c0c10=_0x1b3e09[_0x5a3247(0x1be)](_0x4a076c=>(_0x4a076c[_0x5a3247(0x1a0)]||0x0)===_0x5a7c9b);_0x4c0c10&&(_0xdac77b['progress']?.[_0x5a3247(0xf5)]('Fetching\x20'+_0x1a36a0[_0x5a3247(0x101)]+'\x20v'+_0x5a7c9b),_0x29de59=await _0x3729fd(_0x4c0c10['id']));}else{const _0x428978=_0x1b3e09[_0x1b3e09[_0x5a3247(0x107)]-0x1];_0xdac77b['progress']?.[_0x5a3247(0xf5)]('Fetching\x20'+_0x1a36a0[_0x5a3247(0x101)]),_0x29de59=await _0x3729fd(_0x428978['id']);const _0x3e4b55=_0x202ba1(_0x428978['id']),_0x2ce8c8=await journeyResponseToDef(_0x29de59,_0x3e4b55),_0x241ead=buildLocalRuleToNameMappingFromJourney(_0x1a36a0);_0x487cb5=buildMergedJourneyDef([{'item':_0x428978,'yaml':_0x2ce8c8}],_0x241ead,_0x3eee6e);}}addFoldersToCreate(_0x2d4a2b,_0xdac77b[_0x5a3247(0x114)],_0xdd308b);const _0x38adb0=calculateJourneyDiff(_0x1a36a0,_0x487cb5);_0x4437c4[_0x5a3247(0x1c5)]({'relativePath':_0x1a36a0[_0x5a3247(0x101)],'absolutePath':_0x8bf96f,'yamlConfig':_0x1a36a0,'folderPath':_0x2d4a2b,'existingJourney':_0x29de59,'isNew':_0x38adb0['isNew'],'hasChanges':_0x38adb0[_0x5a3247(0x14e)],'diff':_0x38adb0[_0x5a3247(0x1a4)]});}return{'journeyFiles':_0x4437c4,'foldersToCreate':_0xdd308b};}export function calculateActivationActions(_0x421e4e,_0x41e73f,_0x2da067,_0x333d30){const _0x21194b=a159_0x3ddbd6,_0x32c6d9=[],_0x355631=new Map();for(const _0x43be73 of _0x41e73f){_0x355631[_0x21194b(0x18a)](_0x43be73[_0x21194b(0x101)],_0x43be73);}const _0x30893e=new Map();for(const _0x486809 of _0x421e4e){_0x30893e[_0x21194b(0x18a)](_0x486809[_0x21194b(0x101)],_0x486809);}for(const _0x3c0a2c of _0x421e4e){const _0x1843aa=_0x355631['get'](_0x3c0a2c[_0x21194b(0x101)]);if(!_0x1843aa)_0x32c6d9[_0x21194b(0x1c5)]({'type':_0x21194b(0x1b2),'name':_0x3c0a2c['name'],'yamlActivation':_0x3c0a2c});else{const _0x498ccb=activationResponseToDef(_0x1843aa,_0x2da067,_0x333d30),_0x37a77a=a159_0x424d42[_0x21194b(0x16a)](_0x498ccb),_0x3033ed=a159_0x424d42[_0x21194b(0x16a)](_0x3c0a2c);_0x37a77a!==_0x3033ed&&_0x32c6d9['push']({'type':_0x21194b(0xf5),'name':_0x3c0a2c[_0x21194b(0x101)],'yamlActivation':_0x3c0a2c,'existingActivation':_0x1843aa});}}for(const _0x5f5dd4 of _0x41e73f){!_0x30893e[_0x21194b(0x18e)](_0x5f5dd4[_0x21194b(0x101)])&&_0x32c6d9['push']({'type':'delete','name':_0x5f5dd4[_0x21194b(0x101)],'existingActivation':_0x5f5dd4});}return _0x32c6d9;}function calculateYamlDiff(_0x39302a,_0x3b05cb){if(_0x3b05cb){const _0x22bd08=generateDiff(_0x3b05cb,_0x39302a),_0x51c10c=hasChanges(_0x22bd08);return{'isNew':![],'hasChanges':_0x51c10c,'diff':_0x51c10c?formatDiffWithColors(_0x22bd08):undefined};}const _0x329843=generateDiff('',_0x39302a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x329843)};}export function calculateSegmentDiff(_0x6a089c,_0xcf5f8e,_0x48eddd,_0x3306ea,_0x1093ff){const _0x4474b8=segmentToYamlString(_0x6a089c),_0x98e5ab=_0xcf5f8e?segmentToYamlString(segmentWithActivationsToYaml(_0xcf5f8e,_0x48eddd,undefined,_0x3306ea,_0x1093ff)):undefined;return calculateYamlDiff(_0x4474b8,_0x98e5ab);}export function calculateJourneyDiff(_0x415540,_0x201ea4){const _0x1dd511=normalizeJourneyDef(_0x415540,_0x415540),_0x6f64ee=a159_0x529b31(_0x1dd511),_0x3fb121=_0x201ea4?a159_0x529b31(normalizeJourneyDef(_0x201ea4,_0x415540)):undefined;return calculateYamlDiff(_0x6f64ee,_0x3fb121);}export function findSegmentsToDelete(_0x46c2b0,_0x4b0740,_0x2e44ed,_0x141045,_0x16b894){const _0x28cb60=a159_0x3ddbd6,_0x10a8c4=new Set();for(const {yamlConfig:_0x16dae9,folderPath:_0x3fd705}of _0x4b0740){_0x10a8c4[_0x28cb60(0x1cd)](_0x3fd705+':'+_0x16dae9[_0x28cb60(0x101)]);}return _0x46c2b0['filter'](_0x4a038d=>{const _0x4ed033=_0x28cb60,_0x2b9623=_0x4a038d[_0x4ed033(0x180)]?_0x2e44ed[_0x4ed033(0x17f)](_0x4a038d[_0x4ed033(0x180)][_0x4ed033(0x1a6)]())||'':'',_0x459e02=_0x2b9623+':'+_0x4a038d[_0x4ed033(0x101)];if(_0x10a8c4[_0x4ed033(0x18e)](_0x459e02))return![];if(_0x16b894)return _0x2b9623===_0x141045||_0x2b9623['startsWith'](_0x141045+'/');return!![];});}export function findJourneysToDelete(_0x47ac5f,_0x4a1748,_0x4f4169,_0x514f16,_0x1e1f09){const _0x33662d=a159_0x3ddbd6,_0x24b469=new Set();for(const {yamlConfig:_0x54eb5f,folderPath:_0xe09dfe}of _0x4a1748){_0x24b469[_0x33662d(0x1cd)](_0xe09dfe+':'+_0x54eb5f[_0x33662d(0x101)]);}return _0x47ac5f['filter'](_0x565fbb=>{const _0x57a5b1=_0x33662d,_0x57cf17=_0x565fbb[_0x57a5b1(0x1df)]?_0x4f4169[_0x57a5b1(0x17f)](_0x565fbb[_0x57a5b1(0x1df)])||'':'',_0x19317d=_0x57cf17+':'+_0x565fbb[_0x57a5b1(0x19e)];if(_0x24b469['has'](_0x19317d))return![];if(_0x1e1f09)return _0x57cf17===_0x514f16||_0x57cf17['startsWith'](_0x514f16+'/');return!![];});}export function buildSegmentLookupMap(_0x3d76b1,_0x3effc9){const _0x4e455f=a159_0x3ddbd6,_0x1d190f=new Map();for(const _0x36eab4 of _0x3d76b1){const _0x59ecf3=_0x36eab4[_0x4e455f(0x180)]?_0x3effc9[_0x4e455f(0x17f)](_0x36eab4[_0x4e455f(0x180)]['toString']())||'':'',_0x559dc8=_0x59ecf3+':'+_0x36eab4[_0x4e455f(0x101)];_0x1d190f[_0x4e455f(0x18a)](_0x559dc8,_0x36eab4);}return _0x1d190f;}export function buildSegmentNameToIdMap(_0x27c33e){const _0x29de9f=a159_0x3ddbd6,_0x27e5ca=new Map();for(const _0x4aa957 of _0x27c33e){_0x27e5ca[_0x29de9f(0x18a)](_0x4aa957['name'],_0x4aa957['id']);}return _0x27e5ca;}export function buildJourneyBundleLookupMap(_0x254ce0,_0x58d226){const _0x53f3e2=a159_0x3ddbd6,_0x354e32=new Map();for(const _0x24a6c3 of _0x254ce0){const _0x926943=_0x24a6c3['folderId']?_0x58d226['get'](_0x24a6c3[_0x53f3e2(0x1df)])||'':'',_0x1ec8e0=_0x926943+':'+_0x24a6c3[_0x53f3e2(0x19e)];!_0x354e32[_0x53f3e2(0x18e)](_0x1ec8e0)&&_0x354e32[_0x53f3e2(0x18a)](_0x1ec8e0,[]),_0x354e32[_0x53f3e2(0x17f)](_0x1ec8e0)[_0x53f3e2(0x1c5)](_0x24a6c3);}for(const _0x56f4a8 of _0x354e32[_0x53f3e2(0x130)]()){_0x56f4a8[_0x53f3e2(0x197)]((_0x510225,_0x459b6a)=>(_0x510225[_0x53f3e2(0x1a0)]||0x0)-(_0x459b6a[_0x53f3e2(0x1a0)]||0x0));}return _0x354e32;}export function collectFoldersToCreate(_0x1bbba4,_0x184051){const _0x27536a=a159_0x3ddbd6,_0x19c57f=new Set();for(const _0x918408 of _0x1bbba4){if(!_0x918408)continue;if(_0x184051[_0x27536a(0x18e)](_0x918408))continue;const _0x3a92cf=_0x918408[_0x27536a(0x183)]('/');let _0x53f568='';for(const _0x341de7 of _0x3a92cf){_0x53f568=_0x53f568?_0x53f568+'/'+_0x341de7:_0x341de7,!_0x184051[_0x27536a(0x18e)](_0x53f568)&&_0x19c57f[_0x27536a(0x1cd)](_0x53f568);}}return _0x19c57f;}export function parseAndClassifyYamlFiles(_0x352933,_0x100b5a,_0x45f328){const _0x59177e=a159_0x3ddbd6,_0x5522e4=[],_0x3c6a3f=[];for(const _0x29973b of _0x352933){const _0x2b7197=a159_0x59f5d5[_0x59177e(0x1e5)](_0x100b5a,a159_0x59f5d5[_0x59177e(0x144)](_0x29973b)),_0x28b192=_0x2b7197==='.'?'':_0x2b7197[_0x59177e(0x12d)](/\\/g,'/'),_0x16a709=readFileSync(_0x29973b,_0x59177e(0x1a3)),_0x27b7a0=a159_0x424d42['parse'](_0x16a709);if(isJourneyDef(_0x27b7a0,_0x29973b)){const _0x5d99d7=a159_0x21833f(_0x16a709);_0x3c6a3f['push']({'yamlConfig':_0x5d99d7,'folderPath':_0x28b192,'sourcePath':_0x29973b});}else{if(!_0x45f328?.[_0x59177e(0x16c)]){const _0x35898d=parseSegmentYamlFile(_0x16a709),_0x472e0d=normalizeChildSegmentYaml(_0x35898d);_0x5522e4[_0x59177e(0x1c5)]({'yamlConfig':_0x472e0d,'folderPath':_0x28b192,'sourcePath':_0x29973b});}}}return{'segments':_0x5522e4,'journeys':_0x3c6a3f};}export function validateParsedFiles(_0xb06a85,_0x3151c0){const _0x4ec6d4=a159_0x3ddbd6,_0x29105a=[];for(const {yamlConfig:_0x30ac84,sourcePath:_0x40e819}of _0xb06a85['segments']){const _0x361e2f=readFileSync(_0x40e819,_0x4ec6d4(0x1a3)),_0x50ac92=a159_0x424d42[_0x4ec6d4(0xfb)](_0x361e2f),_0x43443a=validateSegmentDef(_0x30ac84,{'source':_0x361e2f,'document':_0x50ac92},{'skipSchema':!![]});if(!_0x43443a[_0x4ec6d4(0x1d4)]){const _0x38fb25=a159_0x59f5d5[_0x4ec6d4(0x1e5)](_0x3151c0,_0x40e819);_0x29105a[_0x4ec6d4(0x1c5)]({'filePath':_0x38fb25,'source':_0x361e2f,'result':_0x43443a,'isJourney':![]});}}for(const {yamlConfig:_0x1fe081,sourcePath:_0x554224}of _0xb06a85[_0x4ec6d4(0x176)]){const _0x4428cc=readFileSync(_0x554224,'utf-8'),_0x13b129=a159_0x424d42[_0x4ec6d4(0xfb)](_0x4428cc),_0x4087e3=validateJourneyDef(_0x1fe081,{'source':_0x4428cc,'document':_0x13b129},{'skipSchema':!![]});if(!_0x4087e3[_0x4ec6d4(0x1d4)]){const _0x396ea9=a159_0x59f5d5['relative'](_0x3151c0,_0x554224);_0x29105a['push']({'filePath':_0x396ea9,'source':_0x4428cc,'result':_0x4087e3,'isJourney':!![]});}}return _0x29105a;}export function formatValidationErrors(_0x3889de){const _0x5e99b3=a159_0x3ddbd6,_0x4746b1=[];for(const {filePath:_0x1ad2ef,source:_0x591852,result:_0x58def9,isJourney:_0x316962}of _0x3889de){const _0x1b0b4a=_0x316962?_0x5e99b3(0x17c):_0x5e99b3(0x177);_0x4746b1['push']('\x0a'+_0x1ad2ef+'\x20('+_0x1b0b4a+'):\x20'+_0x58def9[_0x5e99b3(0xf6)][_0x5e99b3(0x107)]+_0x5e99b3(0x1cf)),_0x4746b1[_0x5e99b3(0x1c5)](formatValidationResult(_0x58def9,_0x591852,_0x1ad2ef));}return _0x4746b1[_0x5e99b3(0x1b8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x324376){const _0x4db69d=a159_0x3ddbd6,_0x2da24b=new Set(),_0x13979d=new Map(),_0x5460c9=collectSegmentUsageCounts(_0x324376);if(_0x324376['segments'])for(const [_0x449c6d,_0x25f0c7]of Object[_0x4db69d(0x146)](_0x324376[_0x4db69d(0x167)])){_0x2da24b[_0x4db69d(0x1cd)](_0x449c6d);if(_0x25f0c7['rule']){const _0x5ebc3d=yamlRuleToApi(_0x25f0c7['rule']),_0x56f285=apiRuleToYaml(_0x5ebc3d);_0x13979d['set'](_0x449c6d,_0x56f285);}}const _0x191312=new Map();let _0x501305=0x0;for(const [_0x510055,_0x412bda]of _0x13979d){const _0x2fd155=serializeExpandedRule(_0x412bda,_0x13979d),_0x2fe20d=_0x191312[_0x4db69d(0x17f)](_0x2fd155)||[];_0x2fe20d[_0x4db69d(0x1c5)]({'name':_0x510055,'index':_0x501305}),_0x191312[_0x4db69d(0x18a)](_0x2fd155,_0x2fe20d),_0x501305++;}const _0x3f5795=new Map();for(const [_0x1f93af,_0x420259]of _0x191312){const _0xc17c49=_0x420259['slice']()[_0x4db69d(0x197)]((_0x2d8044,_0x30b390)=>{const _0x136175=_0x4db69d,_0x653ed4=_0x5460c9[_0x136175(0x17f)](_0x2d8044[_0x136175(0x101)])||0x0,_0x42176b=_0x5460c9[_0x136175(0x17f)](_0x30b390[_0x136175(0x101)])||0x0;if(_0x653ed4!==_0x42176b)return _0x42176b-_0x653ed4;return _0x2d8044['index']-_0x30b390[_0x136175(0x1de)];})[_0x4db69d(0x185)](_0x1c9c62=>_0x1c9c62['name']),_0x1fecbb=[];for(const _0x5bc51f of _0xc17c49){const _0x191d42=_0x5460c9[_0x4db69d(0x17f)](_0x5bc51f)||0x0,_0x47eaa4=Math['max'](_0x191d42,0x1);for(let _0x4cf3b7=0x0;_0x4cf3b7<_0x47eaa4;_0x4cf3b7++){_0x1fecbb['push'](_0x5bc51f);}}_0x3f5795[_0x4db69d(0x18a)](_0x1f93af,_0x1fecbb);}return{'existingLocalSegmentNames':_0x2da24b,'localSegmentRules':_0x13979d,'localExpandedRuleToNames':_0x3f5795};}export function createSegmentIdResolver(_0x1a92d5,_0x1e8a33){return async _0x631c3a=>{const _0x39820c=a159_0x4982,_0x3352ec=_0x1a92d5[_0x39820c(0x17f)](_0x631c3a);if(!_0x3352ec)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x39820c(0x14f)+_0x631c3a+_0x39820c(0x141)+_0x1e8a33+'\x27)');return _0x3352ec;};}export function extractRootFolderId(_0x58a596){const _0x25d992=a159_0x3ddbd6;return _0x58a596[_0x25d992(0x1cb)]?.['parentSegmentFolder']?.[_0x25d992(0x179)]?.['id']||_0x58a596[_0x25d992(0x1cb)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x26df14){const _0x550a45=a159_0x3ddbd6,_0x22dd59=new Map(),_0x12602c=new Map(),_0x17fa3b=new Map();for(const _0x54b22a of _0x26df14){_0x22dd59['set'](_0x54b22a['name'],parseInt(_0x54b22a['id'],0xa)),_0x12602c['set'](_0x54b22a['id'],_0x54b22a[_0x550a45(0x101)]),_0x17fa3b[_0x550a45(0x18a)](_0x54b22a[_0x550a45(0x101)],_0x54b22a[_0x550a45(0x110)]);}return{'nameToId':_0x22dd59,'idToName':_0x12602c,'nameToType':_0x17fa3b};}export function calculatePushStats(_0x5e9e02,_0xbb9995,_0x546d80,_0x21a68c,_0x14763b,_0x85f115,_0x4100c8){const _0x21ae8e=a159_0x3ddbd6,_0x2e4c5b=_0x5e9e02[_0x21ae8e(0x186)](_0x37f40f=>_0x37f40f[_0x21ae8e(0xee)]),_0xa10df3=_0x5e9e02[_0x21ae8e(0x186)](_0x1b7828=>!_0x1b7828[_0x21ae8e(0xee)]&&_0x1b7828[_0x21ae8e(0x14e)]),_0x46ed2f=_0x5e9e02['filter'](_0x29b333=>!_0x29b333[_0x21ae8e(0xee)]&&!_0x29b333[_0x21ae8e(0x14e)]),_0x51c46b=_0x85f115?_0x21a68c:[],_0x5654c1=_0xbb9995[_0x21ae8e(0x186)](_0x55a40e=>_0x55a40e[_0x21ae8e(0xee)]),_0x135b1a=_0xbb9995[_0x21ae8e(0x186)](_0x1b8ea0=>!_0x1b8ea0[_0x21ae8e(0xee)]&&_0x1b8ea0['hasChanges']),_0x5490a0=_0xbb9995[_0x21ae8e(0x186)](_0x201938=>!_0x201938[_0x21ae8e(0xee)]&&!_0x201938[_0x21ae8e(0x14e)]),_0x33e8ff=_0x85f115?_0x14763b:[],_0x107b45=_0x5e9e02['flatMap'](_0x11637f=>_0x11637f[_0x21ae8e(0x10d)]),_0x192747=_0x107b45['filter'](_0x3d5be4=>_0x3d5be4['type']===_0x21ae8e(0x1b2)),_0x101f23=_0x107b45['filter'](_0x30df05=>_0x30df05[_0x21ae8e(0x110)]===_0x21ae8e(0xf5)),_0x15dc8e=_0x107b45[_0x21ae8e(0x186)](_0x276e43=>_0x276e43[_0x21ae8e(0x110)]==='delete'),_0x53f613=Array[_0x21ae8e(0x10a)](_0x546d80)[_0x21ae8e(0x197)](),_0x581bd3=_0x4100c8?![]:_0x2e4c5b[_0x21ae8e(0x107)]>0x0||_0xa10df3[_0x21ae8e(0x107)]>0x0||_0x51c46b[_0x21ae8e(0x107)]>0x0,_0x261cc4=_0x5654c1[_0x21ae8e(0x107)]>0x0||_0x135b1a['length']>0x0||_0x33e8ff[_0x21ae8e(0x107)]>0x0,_0xd5b850=_0x4100c8?![]:_0x107b45['length']>0x0,_0xcc67cb=_0x53f613[_0x21ae8e(0x107)]>0x0;return{'segments':{'new':_0x2e4c5b,'changed':_0xa10df3,'unchanged':_0x46ed2f,'toDelete':_0x51c46b},'journeys':{'new':_0x5654c1,'changed':_0x135b1a,'unchanged':_0x5490a0,'toDelete':_0x33e8ff},'activations':{'all':_0x107b45,'toCreate':_0x192747,'toUpdate':_0x101f23,'toDelete':_0x15dc8e},'folders':{'toCreate':_0x53f613},'counts':{'segments':{'new':_0x2e4c5b[_0x21ae8e(0x107)],'changed':_0xa10df3[_0x21ae8e(0x107)],'unchanged':_0x46ed2f[_0x21ae8e(0x107)],'toDelete':_0x51c46b['length']},'journeys':{'new':_0x5654c1[_0x21ae8e(0x107)],'changed':_0x135b1a[_0x21ae8e(0x107)],'unchanged':_0x5490a0[_0x21ae8e(0x107)],'toDelete':_0x33e8ff[_0x21ae8e(0x107)]},'activations':{'create':_0x192747[_0x21ae8e(0x107)],'update':_0x101f23['length'],'delete':_0x15dc8e[_0x21ae8e(0x107)]},'folders':_0x53f613[_0x21ae8e(0x107)]},'hasChanges':_0x581bd3||_0x261cc4||_0xd5b850||_0xcc67cb};}export async function buildPushExecutionContext(_0x56b4ef,_0x9d9b79,_0x43af37,_0x37e042,_0x988ff6,_0x41dd2d){const _0x64af19=a159_0x3ddbd6,_0x1c323d=extractRootFolderId(_0x43af37),{pathToId:_0xf61cfc,idToPath:_0x42bf7f}=buildFolderMaps(_0x988ff6),_0x7aff65=buildSegmentNameToIdMap(_0x37e042),_0x2c6f58=new Map(),{batchAsync:_0x14f706}=await import(_0x64af19(0x159)),[_0x458c0c,_0x29aaf6]=await Promise[_0x64af19(0x11d)]([_0x56b4ef[_0x64af19(0x1d1)][_0x64af19(0x192)](),_0x56b4ef[_0x64af19(0x18b)][_0x64af19(0x13c)](),((async()=>{const _0x26a6aa=_0x64af19;!_0x41dd2d&&_0x37e042[_0x26a6aa(0x107)]>0x0&&await _0x14f706(_0x37e042,async _0x31fafe=>{const _0x1c34c4=_0x26a6aa,_0x3c8f28=await _0x56b4ef[_0x1c34c4(0x177)]['listActivations'](_0x9d9b79,_0x31fafe['id']);_0x2c6f58[_0x1c34c4(0x18a)](_0x31fafe['id'],_0x3c8f28);});})())]),{emailToId:_0x1f8c74,idToEmail:_0x4365a0}=_0x458c0c,_0x3ec595=buildConnectionMaps(_0x29aaf6);return{'rootFolderId':_0x1c323d,'folderPathToId':_0xf61cfc,'folderIdToPath':_0x42bf7f,'segmentNameToId':_0x7aff65,'activationsBySegmentId':_0x2c6f58,'emailToIdMap':_0x1f8c74,'idToEmailMap':_0x4365a0,'connectionNameToIdMap':_0x3ec595[_0x64af19(0x19d)],'connectionIdToNameMap':_0x3ec595[_0x64af19(0x154)],'connectionNameToTypeMap':_0x3ec595[_0x64af19(0x113)]};}function a159_0x4982(_0xeb2b73,_0x29e503){_0xeb2b73=_0xeb2b73-0xec;const _0x535c67=a159_0x535c();let _0x498297=_0x535c67[_0xeb2b73];return _0x498297;}export function createPushYamlContextForBundle(_0x213842,_0x3ca17c,_0x37e0ad,_0x1e01d6,_0x3af9a6,_0x23b6fb,_0x348a84,_0x458a0c){const {existingLocalSegmentNames:_0x301907,localExpandedRuleToNames:_0x10f8e0}=_0x1e01d6,_0x3b7c6a=new Set(),_0x3ef5b6=new Map(),_0x5e0989=new Map(),_0x433325=new Map(),_0x13fce8=createJumpTargetCache(),_0x3d7dc6=new Map(),_0x7e8a48=new Map(),_0x5c3321=new Set();let _0x28472f;const _0x45f796=_0x1b3ebb=>{const _0x14b880={'resolveSegment':async _0x4135e0=>{const _0x5111ae=a159_0x4982,_0x34b582=_0x433325['get'](_0x4135e0);if(_0x34b582!==undefined)return{'name':_0x34b582,'isJourneyLocal':!![]};try{const _0x1d6c5f=await fetchSegment(_0x213842,_0x3ca17c,_0x4135e0,_0x37e0ad);if(!_0x1d6c5f)throw new Error(_0x5111ae(0x138));const _0x17096c=generateJourneyLocalName(_0x1d6c5f[_0x5111ae(0x101)]),_0x3b2f97=_0x1d6c5f[_0x5111ae(0x1a8)]===SEGMENT_KIND_JOURNEY&&_0x17096c!==undefined;let _0x18405e=_0x1d6c5f[_0x5111ae(0x101)],_0x172878;if(_0x3b2f97&&_0x1d6c5f['rule']){const _0x2d8dd1=apiRuleToYaml(_0x1d6c5f[_0x5111ae(0x174)]);_0x7e8a48[_0x5111ae(0x18a)](_0x4135e0,_0x2d8dd1);const _0x53b485=async _0xed1af7=>{const _0x31423a=_0x5111ae,_0x2052aa=collectSegmentRefsFromRule(_0xed1af7);for(const _0x195e76 of _0x2052aa){if(!_0x7e8a48[_0x31423a(0x18e)](_0x195e76))try{const _0x3d19ff=await fetchSegment(_0x213842,_0x3ca17c,_0x195e76,_0x37e0ad);if(_0x3d19ff?.[_0x31423a(0x174)]){const _0x56e184=apiRuleToYaml(_0x3d19ff[_0x31423a(0x174)]);_0x7e8a48[_0x31423a(0x18a)](_0x195e76,_0x56e184),await _0x53b485(_0x56e184);}}catch(_0x5bc22a){logger[_0x31423a(0x13e)](_0x31423a(0x1ae)+_0x195e76+':\x20'+_0x5bc22a);}}};await _0x53b485(_0x2d8dd1);const _0x43fd90=serializeExpandedRule(_0x2d8dd1,_0x7e8a48),_0x106247=_0x10f8e0['get'](_0x43fd90);if(_0x106247&&_0x106247[_0x5111ae(0x107)]>0x0){const _0xa50c45=_0x3ef5b6[_0x5111ae(0x17f)](_0x43fd90)||0x0,_0x2dfb22=_0x106247[_0xa50c45]||_0x106247[_0x106247['length']-0x1];_0x3ef5b6['set'](_0x43fd90,_0xa50c45+0x1),_0x18405e=_0x2dfb22,_0x3b7c6a['add'](_0x18405e),_0x433325[_0x5111ae(0x18a)](_0x4135e0,_0x18405e);const _0x50e34e=await resolveRuleSegmentRefs(_0x2d8dd1,async _0x2fec75=>{const _0x107bff=_0x5111ae,_0x2fc001=_0x433325[_0x107bff(0x17f)](_0x2fec75);if(_0x2fc001)return _0x2fc001;const _0xc5ace4=await _0x28472f[_0x107bff(0x15a)](_0x2fec75);return _0xc5ace4['name'];});_0x172878={'description':_0x1d6c5f[_0x5111ae(0x133)],'rule':_0x50e34e};}else{const _0x28b064=_0x3d7dc6['get'](_0x43fd90);if(_0x28b064)_0x18405e=_0x28b064,_0x433325[_0x5111ae(0x18a)](_0x4135e0,_0x18405e);else{if(_0x17096c){let _0x23d227=_0x17096c,_0x4a2b67=0x2;while(_0x3b7c6a[_0x5111ae(0x18e)](_0x23d227)||_0x301907[_0x5111ae(0x18e)](_0x23d227)){_0x23d227=_0x17096c+'_'+_0x4a2b67,_0x4a2b67++;}_0x3b7c6a[_0x5111ae(0x1cd)](_0x23d227),_0x18405e=_0x23d227;}_0x433325[_0x5111ae(0x18a)](_0x4135e0,_0x18405e),_0x3d7dc6[_0x5111ae(0x18a)](_0x43fd90,_0x18405e);const _0x2d5887=await resolveRuleSegmentRefs(_0x2d8dd1,async _0x2235d2=>{const _0x1dea3d=_0x5111ae,_0x28e94c=_0x433325[_0x1dea3d(0x17f)](_0x2235d2);if(_0x28e94c)return _0x28e94c;const _0x4c5e12=await _0x28472f[_0x1dea3d(0x15a)](_0x2235d2);return _0x4c5e12[_0x1dea3d(0x101)];});_0x172878={'description':_0x1d6c5f[_0x5111ae(0x133)],'rule':_0x2d5887};}}}return{'name':_0x18405e,'isJourneyLocal':_0x3b2f97,'definition':_0x172878};}catch(_0x29a678){return logger[_0x5111ae(0x13e)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4135e0+':\x20'+_0x29a678),{'name':_0x4135e0,'isJourneyLocal':![]};}},'resolveActivation':async _0x29fb77=>{const _0x19eb49=a159_0x4982,_0x2e5dc5=_0x5e0989[_0x19eb49(0x17f)](_0x29fb77);if(_0x2e5dc5!==undefined)return{'name':_0x2e5dc5,'isJourneyLocal':!![]};try{let _0x37ebf8=_0x348a84?.[_0x19eb49(0x17f)](_0x29fb77);!_0x37ebf8&&(_0x37ebf8=await _0x213842['journey'][_0x19eb49(0x1e7)](_0x1b3ebb,_0x29fb77));const _0x219272=_0x37ebf8[_0x19eb49(0x1b5)][_0x19eb49(0x16e)][_0x19eb49(0x101)]||_0x29fb77,_0x4fdfcd=sanitizeYamlKey(_0x219272)||_0x19eb49(0x13b)+_0x29fb77,_0x56225b=_0x4fdfcd;_0x5e0989[_0x19eb49(0x18a)](_0x29fb77,_0x56225b);const _0x19f221=journeyActivationStepToYaml(_0x37ebf8,_0x3af9a6,_0x23b6fb);return{'name':_0x56225b,'isJourneyLocal':!![],'definition':_0x19f221};}catch(_0x17bc6e){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x29fb77+':\x20'+_0x17bc6e),{'name':_0x29fb77,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x26b6aa,_0x2676ba)=>resolveJumpTarget(_0x26b6aa,_0x2676ba,_0x13fce8,async _0x3eafad=>{const _0x4d61ad=a159_0x4982,_0x2686c2=_0x458a0c?.[_0x4d61ad(0x17f)](_0x3eafad);if(_0x2686c2)return _0x2686c2;return _0x213842[_0x4d61ad(0x17c)][_0x4d61ad(0x14a)](_0x3eafad);})};return _0x28472f=_0x14b880,_0x14b880;},_0x466640=async _0x506514=>{const _0x3064a8=a159_0x4982,{collectSegmentIdsFromJourneyApi:_0x344719}=await import('./journey-yaml.js'),{batchAsync:_0x2ed0be}=await import(_0x3064a8(0x159)),_0x6520a=new Set();for(const _0x44e1e9 of _0x506514){let _0x5da265=_0x458a0c?.['get'](_0x44e1e9);!_0x5da265&&(_0x5da265=await _0x213842[_0x3064a8(0x17c)]['getJourney'](_0x44e1e9));const _0x5cd792=_0x344719(_0x5da265);for(const _0xe96335 of _0x5cd792){_0x6520a[_0x3064a8(0x1cd)](_0xe96335);}}let _0x135f31=Array[_0x3064a8(0x10a)](_0x6520a);while(_0x135f31[_0x3064a8(0x107)]>0x0){const _0x23782f=_0x135f31['filter'](_0x5805cb=>!_0x5c3321[_0x3064a8(0x18e)](_0x5805cb));if(_0x23782f[_0x3064a8(0x107)]===0x0)break;const _0x137e7b=await _0x2ed0be(_0x23782f,async _0x13a4a7=>{_0x5c3321['add'](_0x13a4a7);const _0x38e22d=await fetchSegment(_0x213842,_0x3ca17c,_0x13a4a7,_0x37e0ad);if(!_0x38e22d)return null;return{'segmentId':_0x13a4a7,'segment':_0x38e22d};},0xa),_0x4f1877=new Set();for(const _0x2da2e6 of _0x137e7b){if(!_0x2da2e6?.[_0x3064a8(0x177)]?.[_0x3064a8(0x174)])continue;const _0x4c3dc9=apiRuleToYaml(_0x2da2e6[_0x3064a8(0x177)][_0x3064a8(0x174)]);_0x7e8a48[_0x3064a8(0x18a)](_0x2da2e6[_0x3064a8(0x1bc)],_0x4c3dc9);const _0xa88a82=collectSegmentRefsFromRule(_0x4c3dc9);for(const _0x20f213 of _0xa88a82){!_0x5c3321[_0x3064a8(0x18e)](_0x20f213)&&_0x4f1877[_0x3064a8(0x1cd)](_0x20f213);}}_0x135f31=Array[_0x3064a8(0x10a)](_0x4f1877);}};return{'createYamlContext':_0x45f796,'prefetchJourneySegments':_0x466640};}export async function executePushSegments(_0x3190e8,_0x56d9a4,_0x2b089e,_0x9fb39e,_0x45180b){const _0x430339=a159_0x3ddbd6,{segmentDefToCreateRequest:_0x399095,segmentDefToUpdateRequest:_0x184e9c}=await import(_0x430339(0x155)),_0x22ad3b=_0x2b089e[_0x430339(0x114)],_0x1fd4e6=0x5,_0x1ad7f2=async _0x54ba7a=>{const _0x408ff7=_0x430339,_0x5c0ee8=_0x54ba7a['folderPath']?_0x22ad3b[_0x408ff7(0x17f)](_0x54ba7a[_0x408ff7(0x1ba)]):undefined;let _0x5ceaa4;const _0x4d3afc={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x387879=_0x54ba7a[_0x408ff7(0x19f)];if(_0x54ba7a['yamlConfig'][_0x408ff7(0x174)]){const _0x5b27c8=createSegmentIdResolver(_0x2b089e[_0x408ff7(0x172)],_0x54ba7a['yamlConfig']['name']),_0x3f6f79=await resolveRuleSegmentIds(_0x54ba7a[_0x408ff7(0x19f)][_0x408ff7(0x174)],_0x5b27c8);_0x387879={..._0x54ba7a[_0x408ff7(0x19f)],'rule':_0x3f6f79};}try{if(_0x54ba7a[_0x408ff7(0xee)]){_0x45180b[_0x408ff7(0x173)]?.({'type':_0x408ff7(0x1e3),'name':_0x54ba7a[_0x408ff7(0x19f)]['name']});const _0xf5e65c=_0x399095(_0x387879,_0x5c0ee8),_0x4241ae=await _0x45180b['withProgress'](_0x408ff7(0x119)+_0x54ba7a[_0x408ff7(0x19f)]['name']+_0x408ff7(0x121),()=>_0x3190e8[_0x408ff7(0x177)][_0x408ff7(0x1c1)](_0x9fb39e[_0x408ff7(0x184)],_0xf5e65c));_0x5ceaa4=_0x4241ae[_0x408ff7(0x179)]['id'],_0x2b089e[_0x408ff7(0x172)][_0x408ff7(0x18a)](_0x54ba7a[_0x408ff7(0x19f)][_0x408ff7(0x101)],_0x5ceaa4),_0x4d3afc[_0x408ff7(0x1b6)]={'name':_0x54ba7a['yamlConfig'][_0x408ff7(0x101)],'id':_0x5ceaa4},_0x45180b[_0x408ff7(0x173)]?.({'type':_0x408ff7(0x1ce),'name':_0x54ba7a['yamlConfig'][_0x408ff7(0x101)],'segmentId':_0x5ceaa4}),_0x45180b[_0x408ff7(0x15d)]?.('Created\x20segment\x20\x27'+_0x54ba7a[_0x408ff7(0x19f)][_0x408ff7(0x101)]+'\x27'),_0x4d3afc[_0x408ff7(0x1e6)]=0x1;}else{if(_0x54ba7a[_0x408ff7(0x14e)]){_0x45180b[_0x408ff7(0x173)]?.({'type':'segment_updating','name':_0x54ba7a[_0x408ff7(0x19f)][_0x408ff7(0x101)]});const _0x41c3a6=_0x184e9c(_0x387879);_0x5c0ee8!==_0x54ba7a[_0x408ff7(0x1c0)]?.[_0x408ff7(0x180)]&&(_0x41c3a6[_0x408ff7(0x180)]=_0x5c0ee8?parseInt(_0x5c0ee8,0xa):undefined),await _0x45180b[_0x408ff7(0x125)](_0x408ff7(0x145)+_0x54ba7a[_0x408ff7(0x19f)][_0x408ff7(0x101)]+_0x408ff7(0x121),()=>_0x3190e8[_0x408ff7(0x177)]['updateSegmentById'](_0x9fb39e['parentId'],_0x54ba7a['existingSegment']['id'],_0x41c3a6)),_0x5ceaa4=_0x54ba7a[_0x408ff7(0x1c0)]['id'],_0x45180b['onProgress']?.({'type':_0x408ff7(0x1aa),'name':_0x54ba7a['yamlConfig'][_0x408ff7(0x101)]}),_0x45180b[_0x408ff7(0x15d)]?.('Updated\x20segment\x20\x27'+_0x54ba7a[_0x408ff7(0x19f)][_0x408ff7(0x101)]+'\x27'),_0x4d3afc[_0x408ff7(0x12f)]=0x1;}else _0x5ceaa4=_0x54ba7a[_0x408ff7(0x1c0)]['id'];}}catch(_0x25be0c){const _0x1fe2b4=isHttp400Error(_0x25be0c),_0x1b59db=_0x1fe2b4?ErrorCode[_0x408ff7(0x195)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x1d26a0=getErrorMessage(_0x25be0c);throw new SDKError(_0x1b59db,_0x408ff7(0x161)+(_0x54ba7a[_0x408ff7(0xee)]?_0x408ff7(0x1b2):_0x408ff7(0xf5))+_0x408ff7(0x194)+_0x54ba7a[_0x408ff7(0xff)]+'\x0a\x20\x20'+_0x1d26a0,_0x25be0c);}try{const _0x55b0ce=await syncActivationsForSegment(_0x3190e8,_0x9fb39e[_0x408ff7(0x184)],_0x5ceaa4,_0x54ba7a[_0x408ff7(0x19f)]['name'],_0x54ba7a['activationActions'],_0x45180b,_0x54ba7a[_0x408ff7(0xff)]);_0x4d3afc[_0x408ff7(0x137)]=_0x55b0ce;}catch(_0x1765d8){if(_0x1765d8 instanceof SDKError)throw _0x1765d8;throw new SDKError(ErrorCode[_0x408ff7(0x1dd)],_0x408ff7(0x160)+_0x54ba7a[_0x408ff7(0x19f)][_0x408ff7(0x101)]+_0x408ff7(0x1d5)+_0x54ba7a['absolutePath']+_0x408ff7(0x1bf)+getErrorMessage(_0x1765d8),_0x1765d8);}return _0x4d3afc;},_0x42d1b=await batchAsync(_0x56d9a4,_0x1ad7f2,_0x1fd4e6),_0x13ebae={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x48eb86 of _0x42d1b){_0x13ebae[_0x430339(0x1e6)]+=_0x48eb86['created'],_0x13ebae[_0x430339(0x12f)]+=_0x48eb86[_0x430339(0x12f)],_0x48eb86[_0x430339(0x1b6)]&&_0x13ebae[_0x430339(0xfa)][_0x430339(0x18a)](_0x48eb86[_0x430339(0x1b6)][_0x430339(0x101)],_0x48eb86[_0x430339(0x1b6)]['id']),_0x13ebae[_0x430339(0x137)]['created']+=_0x48eb86['activations'][_0x430339(0x1e6)],_0x13ebae['activations'][_0x430339(0x12f)]+=_0x48eb86['activations'][_0x430339(0x12f)],_0x13ebae[_0x430339(0x137)][_0x430339(0x12c)]+=_0x48eb86[_0x430339(0x137)]['deleted'];}return _0x13ebae;}async function syncActivationsForSegment(_0x48881f,_0x4ece03,_0x18ae90,_0x25fbbc,_0x47e806,_0x69bdbd,_0x3ca484){const _0x517636=a159_0x3ddbd6,_0x4859a3={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x482700 of _0x47e806){try{if(_0x482700[_0x517636(0x110)]===_0x517636(0x1b2)&&_0x482700[_0x517636(0x142)])_0x69bdbd[_0x517636(0x173)]?.({'type':'activation_creating','segmentName':_0x25fbbc,'activationName':_0x482700['name']}),await _0x69bdbd['withProgress']('Creating\x20activation\x20\x27'+_0x482700['name']+_0x517636(0x121),()=>_0x48881f['segment'][_0x517636(0x127)](_0x4ece03,_0x18ae90,_0x482700[_0x517636(0x142)])),_0x69bdbd[_0x517636(0x173)]?.({'type':_0x517636(0x12a),'segmentName':_0x25fbbc,'activationName':_0x482700[_0x517636(0x101)]}),_0x69bdbd[_0x517636(0x15d)]?.(_0x517636(0x158)+_0x482700[_0x517636(0x101)]+'\x27'),_0x4859a3[_0x517636(0x1e6)]++;else{if(_0x482700['type']===_0x517636(0xf5)&&_0x482700[_0x517636(0x142)]&&_0x482700[_0x517636(0x1b9)])_0x69bdbd['onProgress']?.({'type':_0x517636(0x1c9),'segmentName':_0x25fbbc,'activationName':_0x482700[_0x517636(0x101)]}),await _0x69bdbd[_0x517636(0x125)](_0x517636(0x16d)+_0x482700[_0x517636(0x101)]+'\x27...',()=>_0x48881f['segment'][_0x517636(0x151)](_0x4ece03,_0x18ae90,_0x482700[_0x517636(0x1b9)]['id'],_0x482700[_0x517636(0x142)])),_0x69bdbd[_0x517636(0x173)]?.({'type':'activation_updated','segmentName':_0x25fbbc,'activationName':_0x482700[_0x517636(0x101)]}),_0x69bdbd[_0x517636(0x15d)]?.(_0x517636(0x1e8)+_0x482700[_0x517636(0x101)]+'\x27'),_0x4859a3[_0x517636(0x12f)]++;else _0x482700[_0x517636(0x110)]===_0x517636(0x12b)&&_0x482700[_0x517636(0x1b9)]&&(_0x69bdbd[_0x517636(0x173)]?.({'type':'activation_deleting','segmentName':_0x25fbbc,'activationName':_0x482700[_0x517636(0x101)]}),await _0x69bdbd[_0x517636(0x125)](_0x517636(0x103)+_0x482700[_0x517636(0x101)]+_0x517636(0x121),()=>_0x48881f['segment'][_0x517636(0x181)](_0x4ece03,_0x18ae90,_0x482700[_0x517636(0x1b9)]['id'])),_0x69bdbd[_0x517636(0x173)]?.({'type':_0x517636(0x1c3),'segmentName':_0x25fbbc,'activationName':_0x482700[_0x517636(0x101)]}),_0x69bdbd[_0x517636(0x163)]?.(_0x517636(0x14d)+_0x482700[_0x517636(0x101)]+'\x27'),_0x4859a3[_0x517636(0x12c)]++);}}catch(_0x247551){const _0x47d37c=isHttp400Error(_0x247551),_0x58c433=_0x47d37c?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x517636(0x1dd)],_0x31e725=getErrorMessage(_0x247551);throw new SDKError(_0x58c433,_0x517636(0x161)+_0x482700['type']+'\x20activation\x20\x27'+_0x482700[_0x517636(0x101)]+_0x517636(0x1d5)+_0x3ca484+_0x517636(0x1bf)+_0x31e725,_0x247551);}}return _0x4859a3;}export async function executePushFolders(_0x5a10fc,_0x72a382,_0x21eed9,_0x4a0601,_0x381743){const _0x516c27=a159_0x3ddbd6,_0x301e9b=new Map(_0x21eed9),_0x2f0e0c=sortFoldersByDepth(_0x72a382);for(const _0x1cf3c4 of _0x2f0e0c){const _0x2bdf84=_0x1cf3c4[_0x516c27(0x183)]('/'),_0x3fe0e5=_0x2bdf84[_0x2bdf84['length']-0x1],_0x19b503=_0x2bdf84[_0x516c27(0x1a1)](0x0,-0x1)[_0x516c27(0x1b8)]('/'),_0x5211e7=_0x301e9b['get'](_0x19b503);_0x381743[_0x516c27(0x173)]?.({'type':_0x516c27(0x1a7),'folder':_0x1cf3c4});const _0x407500={'name':_0x3fe0e5,'parentFolderId':_0x5211e7},_0x1cc155=await _0x381743[_0x516c27(0x125)](_0x516c27(0xfc)+_0x1cf3c4+_0x516c27(0x121),()=>_0x5a10fc[_0x516c27(0x177)][_0x516c27(0x15e)](_0x4a0601[_0x516c27(0x184)],_0x407500));_0x301e9b[_0x516c27(0x18a)](_0x1cf3c4,_0x1cc155[_0x516c27(0x179)]['id']),_0x381743[_0x516c27(0x173)]?.({'type':_0x516c27(0x1cc),'folder':_0x1cf3c4,'folderId':_0x1cc155[_0x516c27(0x179)]['id']}),_0x381743[_0x516c27(0xf8)]?.(_0x516c27(0x157)+_0x1cf3c4+'\x27');}return _0x301e9b;}export async function executePushSegmentDeletions(_0x26e1d1,_0x192d5d,_0x456642){const _0x29c671=a159_0x3ddbd6;if(_0x192d5d['length']===0x0)return 0x0;const {batchAsync:_0xc4aafb}=await import('../../utils/async.js'),_0x5567fe=0x5,_0x152664=await _0xc4aafb(_0x192d5d,async _0x231506=>{const _0x2af410=a159_0x4982;return _0x456642['onProgress']?.({'type':_0x2af410(0x132),'name':_0x231506[_0x2af410(0x101)]}),await _0x26e1d1['segment']['deleteSegment'](_0x231506['id']),_0x456642[_0x2af410(0x173)]?.({'type':_0x2af410(0x1e0),'name':_0x231506[_0x2af410(0x101)]}),_0x456642[_0x2af410(0x163)]?.(_0x2af410(0x149)+_0x231506[_0x2af410(0x101)]+'\x27'),0x1;},_0x5567fe);return _0x152664[_0x29c671(0x115)]((_0x94b135,_0x498c5b)=>_0x94b135+_0x498c5b,0x0);}export async function executePushJourneys(_0x1c81b2,_0x4358de,_0x291d85,_0x584811,_0x3cc3b1){const _0x4a8e03=a159_0x3ddbd6,{journeyDefToRequest:_0x5a7077}=await import(_0x4a8e03(0x16f)),{activationDefToCreateRequest:_0x24f68f,yamlRuleToApi:_0x11aba6,validateSegmentRule:_0xe39753}=await import('./child-segment-yaml.js'),_0x3377ad={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5e991e=new Map(_0x291d85['segmentNameToId']),_0x1f5f61=0x5;for(let _0x85d555=0x0;_0x85d555<_0x4358de[_0x4a8e03(0x107)];_0x85d555+=_0x1f5f61){const _0x2e95fe=_0x4358de[_0x4a8e03(0x1a1)](_0x85d555,_0x85d555+_0x1f5f61),_0x2542eb=await Promise[_0x4a8e03(0x11d)](_0x2e95fe[_0x4a8e03(0x185)](async _0x18f930=>{const _0x53886c=_0x4a8e03;if(!_0x18f930['isNew']&&!_0x18f930[_0x53886c(0x14e)])return{'action':'unchanged','name':_0x18f930[_0x53886c(0x19f)][_0x53886c(0x101)],'journeyId':_0x18f930['existingJourney']?.['id']};const _0x1b6f4f=_0x18f930[_0x53886c(0x1ba)]?_0x291d85[_0x53886c(0x114)][_0x53886c(0x17f)](_0x18f930[_0x53886c(0x1ba)]):undefined;_0x3cc3b1[_0x53886c(0x173)]?.({'type':_0x18f930[_0x53886c(0xee)]?_0x53886c(0x15b):'journey_updating','name':_0x18f930['yamlConfig'][_0x53886c(0x101)]});try{const _0x215b13=await executeSingleJourneyPush(_0x1c81b2,_0x18f930,{..._0x291d85,'segmentNameToId':_0x5e991e},{'parentId':_0x584811[_0x53886c(0x184)],'rootFolderId':_0x584811[_0x53886c(0x102)],'folderId':_0x1b6f4f,'verbose':_0x584811['verbose']},_0x3cc3b1,{'journeyDefToRequest':_0x5a7077,'activationDefToCreateRequest':_0x24f68f,'yamlRuleToApi':_0x11aba6,'validateSegmentRule':_0xe39753});for(const [_0x12fd79,_0x3de34e]of _0x215b13['embeddedSegmentNameToId']){_0x5e991e[_0x53886c(0x18a)](_0x12fd79,_0x3de34e),_0x3377ad[_0x53886c(0x16b)]['set'](_0x12fd79,_0x3de34e);}if(_0x215b13[_0x53886c(0x1ca)]===_0x53886c(0x1e6))_0x3cc3b1['onProgress']?.({'type':_0x53886c(0x15f),'name':_0x18f930['yamlConfig'][_0x53886c(0x101)],'journeyId':_0x215b13['journeyId']}),_0x3cc3b1[_0x53886c(0x15d)]?.(_0x53886c(0x1b4)+_0x18f930[_0x53886c(0x19f)][_0x53886c(0x101)]+'\x27'),_0x3377ad[_0x53886c(0x1e6)]++;else _0x215b13[_0x53886c(0x1ca)]===_0x53886c(0x12f)&&(_0x3cc3b1[_0x53886c(0x173)]?.({'type':_0x53886c(0x1ad),'name':_0x18f930[_0x53886c(0x19f)][_0x53886c(0x101)]}),_0x3cc3b1[_0x53886c(0x15d)]?.(_0x53886c(0x152)+_0x18f930[_0x53886c(0x19f)]['name']+'\x27'),_0x3377ad[_0x53886c(0x12f)]++);return{'action':_0x215b13[_0x53886c(0x1ca)],'name':_0x18f930['yamlConfig'][_0x53886c(0x101)],'journeyId':_0x215b13[_0x53886c(0x17b)]};}catch(_0x298c28){const _0x249566=isHttp400Error(_0x298c28),_0x24f26c=_0x249566?ErrorCode[_0x53886c(0x126)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4f5c17=getErrorMessage(_0x298c28);throw new SDKError(_0x24f26c,_0x53886c(0x161)+(_0x18f930[_0x53886c(0xee)]?_0x53886c(0x1b2):_0x53886c(0xf5))+_0x53886c(0x1ab)+_0x18f930['absolutePath']+_0x53886c(0x1bf)+_0x4f5c17,_0x298c28);}}));_0x3377ad[_0x4a8e03(0x111)][_0x4a8e03(0x1c5)](..._0x2542eb);}return _0x3377ad;}async function matchExistingJourneySegments(_0x35fc9f,_0x9758ab,_0x33d1db,_0x4b22d0,_0x554608){const _0x5af9ac=a159_0x3ddbd6;if(!_0x9758ab[_0x5af9ac(0x131)]||!_0x9758ab[_0x5af9ac(0x19f)][_0x5af9ac(0x167)])return;const _0x10b2c6=new Map(),_0x2c652b=new Set();for(const _0x852e of Object[_0x5af9ac(0x150)](_0x9758ab[_0x5af9ac(0x19f)][_0x5af9ac(0x167)])){const _0xc44f82=generateDeterministicJourneySegmentName(_0x9758ab['yamlConfig'][_0x5af9ac(0x101)],_0x852e);_0x10b2c6[_0x5af9ac(0x18a)](_0xc44f82,_0x852e),_0x2c652b['add'](_0x852e);}const _0x385078=[],_0x280b6f=collectSegmentIdsFromJourneyApi(_0x9758ab[_0x5af9ac(0x131)]);for(const _0x5a7d7b of _0x280b6f){const _0x34b3d4=await fetchSegment(_0x35fc9f,_0x33d1db,_0x5a7d7b,_0x4b22d0);if(!_0x34b3d4?.['name'])continue;const _0x5e6de5=_0x10b2c6[_0x5af9ac(0x17f)](_0x34b3d4[_0x5af9ac(0x101)]);_0x5e6de5?(_0x554608[_0x5af9ac(0x18a)](_0x5e6de5,_0x5a7d7b),_0x2c652b[_0x5af9ac(0x12b)](_0x5e6de5)):_0x385078['push']({'id':_0x5a7d7b,'seg':_0x34b3d4});}if(_0x2c652b[_0x5af9ac(0x1c6)]>0x0&&_0x385078['length']>0x0){const {localExpandedRuleToNames:_0x3e381b}=buildLocalExpandedRuleMappings(_0x9758ab[_0x5af9ac(0x19f)]),_0x5b6c95=new Map();for(const {id:_0x372c27,seg:_0x3f67ac}of _0x385078){if(_0x3f67ac['rule']){const _0x2cdc2a=apiRuleToYaml(_0x3f67ac[_0x5af9ac(0x174)]);_0x5b6c95[_0x5af9ac(0x18a)](_0x372c27,_0x2cdc2a);}}for(const {id:_0x45bc61,seg:_0x1d4dd8}of _0x385078){if(!_0x1d4dd8[_0x5af9ac(0x174)])continue;const _0x34dd93=_0x5b6c95[_0x5af9ac(0x17f)](_0x45bc61);if(!_0x34dd93)continue;const _0x272fc3=serializeExpandedRule(_0x34dd93,_0x5b6c95),_0x214187=_0x3e381b['get'](_0x272fc3);if(_0x214187){const _0x5151d5=_0x214187[_0x5af9ac(0x1be)](_0x2ae34f=>_0x2c652b['has'](_0x2ae34f));_0x5151d5&&(_0x554608[_0x5af9ac(0x18a)](_0x5151d5,_0x45bc61),_0x2c652b['delete'](_0x5151d5),logger[_0x5af9ac(0x13e)](_0x5af9ac(0x11a)+_0x1d4dd8['name']+'\x27\x20to\x20local\x20\x27'+_0x5151d5+_0x5af9ac(0x1d2)));}}}}async function executeSingleJourneyPush(_0x36e0ef,_0x58b363,_0x438c1a,_0x2bbfb6,_0x5391d2,_0x305077){const _0x2b6713=a159_0x3ddbd6,{journeyDefToRequest:_0x556db5,activationDefToCreateRequest:_0x154c53,yamlRuleToApi:_0x1bca46,validateSegmentRule:_0x18fd77}=_0x305077,_0x58ca71=new Map(),_0xf72525=new Map();recoverSegmentIdsFromPushRecovery(_0x58b363,_0x58ca71,_0x438c1a[_0x2b6713(0x172)]);const _0x19f0c6=new Map(),_0x5d21fd=new Map(),_0x21c7c9=new Map();let _0x4608c5;const _0x579531=async()=>{const _0x2201e3=_0x2b6713;if(_0x4608c5)return;_0x4608c5=new Map();if(!_0x58b363[_0x2201e3(0x131)])return;const _0x1a3106=await _0x36e0ef[_0x2201e3(0x17c)][_0x2201e3(0x11e)](_0x58b363[_0x2201e3(0x131)]['id']);for(const _0x120443 of _0x1a3106){const _0x34c74b=journeyActivationStepToYaml(_0x120443,_0x438c1a[_0x2201e3(0x11c)],_0x438c1a['connectionIdToNameMap']),_0x504521=activationSignature(_0x34c74b);!_0x4608c5[_0x2201e3(0x18e)](_0x504521)&&_0x4608c5['set'](_0x504521,_0x120443['id']),_0x34c74b['name']&&_0xf72525['set'](_0x34c74b[_0x2201e3(0x101)],_0x120443['id']);}};await matchExistingJourneySegments(_0x36e0ef,_0x58b363,_0x2bbfb6[_0x2b6713(0x184)],_0x438c1a[_0x2b6713(0x1af)],_0x438c1a['segmentNameToId']);const _0x5537f6={'resolveSegmentId':async _0x2077c1=>{const _0x680330=_0x2b6713,_0x2b368e=_0x438c1a['segmentNameToId'][_0x680330(0x17f)](_0x2077c1);if(!_0x2b368e)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x680330(0x14f)+_0x2077c1+_0x680330(0x100)+_0x58b363[_0x680330(0x19f)][_0x680330(0x101)]+')');return _0x2b368e;},'resolveEmbeddedSegmentId':async(_0x37a335,_0x212d83)=>{const _0x4bae46=_0x2b6713,_0x232642=_0x438c1a['segmentNameToId'][_0x4bae46(0x17f)](_0x37a335);if(_0x232642)return _0x232642;const _0x67e105=_0x438c1a['existingSegments'][_0x4bae46(0x1be)](_0x4fbb7e=>_0x4fbb7e[_0x4bae46(0x101)]===_0x37a335);if(_0x67e105)return _0x438c1a['segmentNameToId'][_0x4bae46(0x18a)](_0x37a335,_0x67e105['id']),_0x67e105['id'];if(_0x58b363[_0x4bae46(0xee)]){const {stageName:_0x488a1a,criteriaName:_0x235aa3}=findSegmentCriteriaLocation(_0x58b363['yamlConfig'],_0x37a335);return _0x18fd77(_0x37a335,_0x212d83[_0x4bae46(0x174)]),_0x5d21fd[_0x4bae46(0x18a)](_0x37a335,{'definition':_0x212d83,'stageName':_0x488a1a,'criteriaName':_0x235aa3}),createPendingSegmentId(_0x37a335);}const _0x691977=_0x58b363[_0x4bae46(0x131)]?.['id'];if(!_0x691977)throw new SDKError(ErrorCode['INTERNAL'],_0x4bae46(0x156));const _0x1fb098=_0x19f0c6[_0x4bae46(0x17f)](_0x37a335);if(_0x1fb098)return _0x1fb098;const _0x2eda60=((async()=>{const _0x19773f=_0x4bae46;_0x18fd77(_0x37a335,_0x212d83[_0x19773f(0x174)]);const _0x32cfc8=generateDeterministicJourneySegmentName(_0x58b363['yamlConfig']['name'],_0x37a335),_0x3cfd0c=_0x438c1a[_0x19773f(0x1af)][_0x19773f(0x1be)](_0x23e057=>_0x23e057[_0x19773f(0x101)]===_0x32cfc8),_0x50ceda=createSegmentIdResolver(_0x438c1a[_0x19773f(0x172)],_0x37a335),_0x5c7d02=await resolveRuleSegmentIds(_0x212d83[_0x19773f(0x174)],_0x50ceda);let _0x56d638;return _0x3cfd0c?(await _0x36e0ef[_0x19773f(0x177)][_0x19773f(0x11f)](_0x2bbfb6[_0x19773f(0x184)],_0x3cfd0c['id'],{'description':_0x212d83[_0x19773f(0x133)]||_0x19773f(0xef)+_0x37a335,'rule':_0x1bca46(_0x5c7d02),'countPopulation':!![]}),_0x56d638=_0x3cfd0c['id'],saveSegmentToPushRecovery(_0x58b363[_0x19773f(0xff)],_0x58b363[_0x19773f(0x19f)][_0x19773f(0x101)],_0x37a335,{'segmentId':_0x56d638,'uniqueServerName':_0x32cfc8,'createdAt':new Date()[_0x19773f(0x148)]()})):_0x56d638=await createOrRecoverEmbeddedSegment(_0x36e0ef,_0x58b363,{'localName':_0x37a335,'uniqueSegmentName':_0x32cfc8,'description':_0x212d83['description']||'Entry\x20criteria:\x20'+_0x37a335,'journeyId':_0x691977,'resolvedRule':_0x5c7d02,'parentId':_0x2bbfb6['parentId'],'folderId':_0x2bbfb6[_0x19773f(0x102)]||''},_0x1bca46),_0x438c1a[_0x19773f(0x172)][_0x19773f(0x18a)](_0x37a335,_0x56d638),_0x58ca71['set'](_0x37a335,_0x56d638),_0x56d638;})());_0x19f0c6[_0x4bae46(0x18a)](_0x37a335,_0x2eda60);try{return await _0x2eda60;}finally{_0x19f0c6[_0x4bae46(0x12b)](_0x37a335);}},'resolveActivationId':async _0x31b084=>{const _0x298b46=_0x2b6713,_0x5e7d01=_0xf72525['get'](_0x31b084);if(_0x5e7d01)return _0x5e7d01;if(_0x58b363['existingJourney']){await _0x579531();const _0x28eea0=_0xf72525[_0x298b46(0x17f)](_0x31b084);if(_0x28eea0)return _0x28eea0;}throw new SDKError(ErrorCode[_0x298b46(0x19c)],_0x298b46(0x169)+_0x31b084+_0x298b46(0x100)+_0x58b363['yamlConfig'][_0x298b46(0x101)]+_0x298b46(0x12e)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x294b2f,_0xbfc3a8)=>{const _0x516bf5=_0x2b6713,_0x18d01e=_0xf72525[_0x516bf5(0x17f)](_0x294b2f);if(_0x18d01e)return _0x18d01e;if(_0x58b363[_0x516bf5(0xee)])return _0x21c7c9[_0x516bf5(0x18a)](_0x294b2f,_0xbfc3a8),createPendingActivationId(_0x294b2f);if(_0x58b363[_0x516bf5(0x131)]){await _0x579531();const _0x439194=_0xf72525[_0x516bf5(0x17f)](_0xbfc3a8[_0x516bf5(0x101)]);if(_0x439194)return _0xf72525[_0x516bf5(0x18a)](_0x294b2f,_0x439194),_0x439194;const _0x3bd372=activationSignature(_0xbfc3a8),_0x9eb485=_0x4608c5?.[_0x516bf5(0x17f)](_0x3bd372);if(_0x9eb485)return _0xf72525[_0x516bf5(0x18a)](_0x294b2f,_0x9eb485),_0x9eb485;const _0x51645f=await _0x154c53(_0xbfc3a8,_0x438c1a[_0x516bf5(0x1da)]),_0x1033c3={..._0x51645f,..._0xbfc3a8[_0x516bf5(0x19b)]!==undefined&&{'runAfterJourneyRefresh':_0xbfc3a8[_0x516bf5(0x19b)]}},_0x90761d=await _0x36e0ef[_0x516bf5(0x17c)][_0x516bf5(0x127)](_0x58b363[_0x516bf5(0x131)]['id'],_0x1033c3);return _0xf72525[_0x516bf5(0x18a)](_0x294b2f,_0x90761d['id']),_0x90761d['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x516bf5(0xed));},'resolveJourneyId':async _0xbb0efe=>{const _0x256b9b=_0x2b6713;try{return await _0x36e0ef[_0x256b9b(0x17c)][_0x256b9b(0x109)](_0x2bbfb6[_0x256b9b(0x184)],_0xbb0efe);}catch(_0x4b3d2f){throw new SDKError(ErrorCode['NOT_FOUND'],_0x256b9b(0x18f)+_0xbb0efe+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x58b363['yamlConfig']['name']+'\x27)',_0x4b3d2f);}},'resolveStageId':async(_0x43439a,_0x3cbf10)=>{const _0x176fc9=_0x2b6713,_0x3cf396=await _0x36e0ef[_0x176fc9(0x17c)]['getJourney'](_0x43439a),_0x20949a=_0x3cf396[_0x176fc9(0x1b5)][_0x176fc9(0x1d7)][_0x176fc9(0x1be)](_0x3c4b40=>_0x3c4b40[_0x176fc9(0x101)][_0x176fc9(0x188)]()===_0x3cbf10[_0x176fc9(0x188)]());if(!_0x20949a?.['id'])throw new SDKError(ErrorCode[_0x176fc9(0x19c)],_0x176fc9(0x1b0)+_0x3cbf10+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3cf396[_0x176fc9(0x1b5)][_0x176fc9(0x19e)]||_0x3cf396[_0x176fc9(0x1b5)][_0x176fc9(0x101)])+'\x27');return _0x20949a['id'];}},_0x4be210=await _0x556db5(_0x58b363[_0x2b6713(0x19f)],_0x2bbfb6[_0x2b6713(0x184)],_0x5537f6),_0x522be4=_0x2bbfb6[_0x2b6713(0x1df)]||_0x2bbfb6[_0x2b6713(0x102)];_0x522be4&&(_0x4be210[_0x2b6713(0x1cb)]={'parentFolder':{'data':{'id':_0x522be4,'type':_0x2b6713(0x10e)}}});if(_0x58b363[_0x2b6713(0xee)]){if(_0x5d21fd['size']>0x0||_0x21c7c9[_0x2b6713(0x1c6)]>0x0)return await executeThreeStepJourneyCreate(_0x36e0ef,_0x58b363,_0x4be210,{'pendingEmbeddedSegments':_0x5d21fd,'pendingEmbeddedActivations':_0x21c7c9,'embeddedSegmentNameToId':_0x58ca71,'journeyActivationNameToId':_0xf72525},{..._0x2bbfb6,'effectiveFolderId':_0x522be4},_0x438c1a,_0x5391d2,_0x305077);else{ensureJourneyDefaults(_0x4be210[_0x2b6713(0x1b5)]);const _0x54decb=await _0x36e0ef[_0x2b6713(0x17c)][_0x2b6713(0x1b2)](_0x4be210);return deletePushRecovery(_0x58b363['absolutePath']),{'action':'created','journeyId':_0x54decb['id'],'embeddedSegmentNameToId':_0x58ca71};}}else{if(_0x58b363['hasChanges']&&_0x58b363[_0x2b6713(0x131)]){_0x4be210['id']=_0x58b363[_0x2b6713(0x131)]['id'];const _0x36323c=_0x4be210[_0x2b6713(0x1b5)];_0x58b363[_0x2b6713(0x131)][_0x2b6713(0x1b5)]?.[_0x2b6713(0x19e)]&&(_0x36323c[_0x2b6713(0x19e)]=_0x58b363['existingJourney'][_0x2b6713(0x1b5)][_0x2b6713(0x19e)]);const _0x240655=_0x58b363[_0x2b6713(0x131)][_0x2b6713(0x1b5)]?.[_0x2b6713(0x1d7)];return _0x240655&&_0x4be210[_0x2b6713(0x1b5)][_0x2b6713(0x1d7)]&&injectExistingStageIds(_0x4be210[_0x2b6713(0x1b5)][_0x2b6713(0x1d7)],_0x240655),ensureJourneyDefaults(_0x36323c),await _0x36e0ef['journey'][_0x2b6713(0xf5)](_0x58b363[_0x2b6713(0x131)]['id'],_0x4be210),deletePushRecovery(_0x58b363[_0x2b6713(0xff)]),{'action':_0x2b6713(0x12f),'journeyId':_0x58b363['existingJourney']['id'],'embeddedSegmentNameToId':_0x58ca71};}}return deletePushRecovery(_0x58b363[_0x2b6713(0xff)]),{'action':_0x2b6713(0x1b7),'journeyId':_0x58b363[_0x2b6713(0x131)]?.['id'],'embeddedSegmentNameToId':_0x58ca71};}function findSegmentCriteriaLocation(_0x580283,_0x304f1e){const _0x179377=a159_0x3ddbd6,_0x2ab95b=_0x580283['stages']||_0x580283[_0x179377(0x176)]?.[0x0]?.['stages']||[];let _0x2ca3d9='entry',_0x443551=_0x304f1e;const _0xbedee9=_0x580283[_0x179377(0x191)]||_0x580283[_0x179377(0x176)]?.[0x0]?.[_0x179377(0x191)];if(_0xbedee9?.[_0x179377(0x177)]===_0x304f1e)return{'stageName':'goal','criteriaName':_0xbedee9['name']||_0x304f1e};_0xc6249e:for(const _0x4d1645 of _0x2ab95b){if(_0x4d1645[_0x179377(0x108)]?.['segment']===_0x304f1e){_0x2ca3d9=_0x4d1645['name'],_0x443551=_0x4d1645['entry_criteria']['name']||_0x304f1e;break;}if(_0x4d1645['steps'])for(const _0x16ca3d of _0x4d1645['steps']){if(_0x16ca3d[_0x179377(0x110)]===_0x179377(0x11b)&&_0x16ca3d[_0x179377(0x112)]?.[_0x179377(0x1bd)])for(const _0x26329d of _0x16ca3d[_0x179377(0x112)][_0x179377(0x1bd)]){if(_0x26329d[_0x179377(0x177)]===_0x304f1e){_0x2ca3d9=_0x4d1645[_0x179377(0x101)],_0x443551=_0x26329d[_0x179377(0x101)]||_0x304f1e;break _0xc6249e;}}}}return{'stageName':_0x2ca3d9,'criteriaName':_0x443551};}async function executeThreeStepJourneyCreate(_0x2ed75b,_0x214dca,_0x7373a5,_0x2e74a6,_0x10ecbd,_0x288cc2,_0x15f8f5,_0x2159f1){const _0x75bcc2=a159_0x3ddbd6,{activationDefToCreateRequest:_0x3efbaa,yamlRuleToApi:_0x1b39ef}=_0x2159f1,{pendingEmbeddedSegments:_0x3ad478,pendingEmbeddedActivations:_0x327331,embeddedSegmentNameToId:_0x1fc859}=_0x2e74a6,_0x4e7ed2=JSON[_0x75bcc2(0x187)](JSON['stringify'](_0x7373a5));ensureJourneyDefaults(_0x4e7ed2[_0x75bcc2(0x1b5)]),stripPendingIds(_0x4e7ed2);const _0xbdeb3c=await _0x2ed75b[_0x75bcc2(0x17c)][_0x75bcc2(0x1b2)](_0x4e7ed2),_0x18d2c3=_0xbdeb3c['id'],_0xaa002e=new Map();for(const _0x25a6b0 of _0xbdeb3c[_0x75bcc2(0x1b5)]['journeyStages']){_0xaa002e[_0x75bcc2(0x18a)](_0x25a6b0[_0x75bcc2(0x101)][_0x75bcc2(0x188)](),_0x25a6b0['id']);}recoverSegmentIdsFromPushRecovery(_0x214dca,_0x1fc859,_0x288cc2[_0x75bcc2(0x172)]);for(const [_0x17eb38,{definition:_0x105059}]of _0x3ad478){if(_0x1fc859[_0x75bcc2(0x18e)](_0x17eb38)){_0x15f8f5[_0x75bcc2(0x173)]?.({'type':'embedded_segment_created','journeyName':_0x214dca[_0x75bcc2(0x19f)][_0x75bcc2(0x101)],'segmentName':_0x17eb38});continue;}const _0x4aca91=generateDeterministicJourneySegmentName(_0x214dca[_0x75bcc2(0x19f)][_0x75bcc2(0x101)],_0x17eb38);_0x15f8f5[_0x75bcc2(0x173)]?.({'type':_0x75bcc2(0xf7),'journeyName':_0x214dca[_0x75bcc2(0x19f)]['name'],'segmentName':_0x17eb38});const _0x2835ae=createSegmentIdResolver(_0x288cc2[_0x75bcc2(0x172)],_0x17eb38),_0x572f51=await resolveRuleSegmentIds(_0x105059[_0x75bcc2(0x174)],_0x2835ae),_0x4e3cab=await createOrRecoverEmbeddedSegment(_0x2ed75b,_0x214dca,{'localName':_0x17eb38,'uniqueSegmentName':_0x4aca91,'description':_0x105059[_0x75bcc2(0x133)]||_0x75bcc2(0xef)+_0x17eb38,'journeyId':_0x18d2c3,'resolvedRule':_0x572f51,'parentId':_0x10ecbd[_0x75bcc2(0x184)],'folderId':_0x10ecbd[_0x75bcc2(0x17a)]||''},_0x1b39ef);_0x1fc859['set'](_0x17eb38,_0x4e3cab),_0x288cc2[_0x75bcc2(0x172)][_0x75bcc2(0x18a)](_0x17eb38,_0x4e3cab),_0x15f8f5[_0x75bcc2(0x173)]?.({'type':_0x75bcc2(0x15c),'journeyName':_0x214dca[_0x75bcc2(0x19f)][_0x75bcc2(0x101)],'segmentName':_0x17eb38});}const _0x3ddde9=new Map();for(const [_0x52cd64,_0x104f52]of _0x327331){_0x15f8f5[_0x75bcc2(0x173)]?.({'type':_0x75bcc2(0x1d8),'journeyName':_0x214dca['yamlConfig'][_0x75bcc2(0x101)],'activationName':_0x52cd64});const _0x2a3d61=await _0x3efbaa(_0x104f52,_0x288cc2[_0x75bcc2(0x1da)]),_0xc95a87={..._0x2a3d61,..._0x104f52[_0x75bcc2(0x19b)]!==undefined&&{'runAfterJourneyRefresh':_0x104f52[_0x75bcc2(0x19b)]}},_0xc2a32c=await _0x2ed75b[_0x75bcc2(0x17c)][_0x75bcc2(0x127)](_0x18d2c3,_0xc95a87);_0x3ddde9['set'](_0x52cd64,_0xc2a32c['id']),_0x2e74a6['journeyActivationNameToId']['set'](_0x52cd64,_0xc2a32c['id']),_0x15f8f5[_0x75bcc2(0x173)]?.({'type':_0x75bcc2(0x1a5),'journeyName':_0x214dca[_0x75bcc2(0x19f)]['name'],'activationName':_0x52cd64});}const _0x590e7f=JSON[_0x75bcc2(0x187)](JSON['stringify'](_0x7373a5));return _0x590e7f['id']=_0x18d2c3,ensureJourneyDefaults(_0x590e7f[_0x75bcc2(0x1b5)]),resolvePendingIdsInRequest(_0x590e7f,_0x7373a5,_0xaa002e,_0x1fc859,_0x3ddde9,_0x15f8f5),await _0x2ed75b[_0x75bcc2(0x17c)][_0x75bcc2(0xf5)](_0x18d2c3,_0x590e7f),deletePushRecovery(_0x214dca[_0x75bcc2(0xff)]),{'action':_0x75bcc2(0x1e6),'journeyId':_0x18d2c3,'embeddedSegmentNameToId':_0x1fc859};}export function stripWaitStepPendingIds(_0x53080b){const _0x362a53=a159_0x3ddbd6,_0x35d699=_0x53080b['conditionSegmentId']&&isPendingSegmentId(_0x53080b[_0x362a53(0x1b1)]),_0x400928=_0x53080b[_0x362a53(0x198)]?.[_0x362a53(0x1ac)](_0x343397=>_0x343397['segmentId']&&isPendingSegmentId(_0x343397[_0x362a53(0x1bc)]));(_0x35d699||_0x400928)&&(_0x53080b['waitStepType']=_0x362a53(0x1c8),_0x53080b['waitStep']=0x1,_0x53080b['waitStepUnit']=_0x362a53(0x117),delete _0x53080b[_0x362a53(0x1b1)],delete _0x53080b['conditionTimeoutDuration'],delete _0x53080b[_0x362a53(0x18d)],delete _0x53080b[_0x362a53(0x198)]);}export function resolveWaitStepPendingIds(_0x26b955,_0x487f7a,_0xb3c3cf,_0x2a6bde){const _0x83578c=a159_0x3ddbd6;if(_0x487f7a[_0x83578c(0x1b1)]&&isPendingSegmentId(_0x487f7a['conditionSegmentId'])){const _0x16c17a=_0xb3c3cf(_0x487f7a['conditionSegmentId'],_0x83578c(0x120)+_0x2a6bde+_0x83578c(0x122));_0x16c17a&&(_0x26b955[_0x83578c(0x140)]=_0x83578c(0x165),_0x26b955[_0x83578c(0x1b1)]=_0x16c17a,delete _0x26b955[_0x83578c(0x1d0)],delete _0x26b955[_0x83578c(0xf2)],_0x487f7a[_0x83578c(0x106)]!==undefined&&(_0x26b955[_0x83578c(0x106)]=_0x487f7a[_0x83578c(0x106)]),_0x487f7a[_0x83578c(0x18d)]&&(_0x26b955[_0x83578c(0x18d)]=_0x487f7a[_0x83578c(0x18d)]));}if(_0x487f7a['conditions']){const _0x5a3a4e=_0x487f7a[_0x83578c(0x198)]['some'](_0x2339d4=>_0x2339d4[_0x83578c(0x1bc)]&&isPendingSegmentId(_0x2339d4[_0x83578c(0x1bc)]));if(_0x5a3a4e){const _0x3ccbca=_0x487f7a[_0x83578c(0x198)][_0x83578c(0x185)](_0x3f0304=>{const _0x2f533b=_0x83578c;if(_0x3f0304[_0x2f533b(0x1bc)]&&isPendingSegmentId(_0x3f0304['segmentId'])){const _0x20f808=_0xb3c3cf(_0x3f0304[_0x2f533b(0x1bc)],_0x2f533b(0x120)+_0x2a6bde+_0x2f533b(0x122));return{..._0x3f0304,'segmentId':_0x20f808||_0x3f0304['segmentId']};}return{..._0x3f0304};});_0x26b955['waitStepType']=_0x83578c(0x165),_0x26b955[_0x83578c(0x198)]=_0x3ccbca,delete _0x26b955[_0x83578c(0x1d0)],delete _0x26b955[_0x83578c(0xf2)],delete _0x26b955[_0x83578c(0x1b1)],delete _0x26b955[_0x83578c(0x106)],delete _0x26b955[_0x83578c(0x18d)];}}}function stripPendingIds(_0x3c30b8){const _0x1ac5d5=a159_0x3ddbd6;_0x3c30b8[_0x1ac5d5(0x1b5)]['goal']?.[_0x1ac5d5(0x1bc)]&&isPendingSegmentId(_0x3c30b8[_0x1ac5d5(0x1b5)][_0x1ac5d5(0x191)][_0x1ac5d5(0x1bc)])&&delete _0x3c30b8[_0x1ac5d5(0x1b5)][_0x1ac5d5(0x191)];for(const _0x9ff70 of _0x3c30b8[_0x1ac5d5(0x1b5)][_0x1ac5d5(0x1d7)]||[]){_0x9ff70[_0x1ac5d5(0x139)]?.[_0x1ac5d5(0x1bc)]&&isPendingSegmentId(_0x9ff70[_0x1ac5d5(0x139)][_0x1ac5d5(0x1bc)])&&delete _0x9ff70['entryCriteria'];_0x9ff70[_0x1ac5d5(0x196)]?.[_0x1ac5d5(0x1bc)]&&isPendingSegmentId(_0x9ff70[_0x1ac5d5(0x196)][_0x1ac5d5(0x1bc)])&&delete _0x9ff70[_0x1ac5d5(0x196)];_0x9ff70[_0x1ac5d5(0x1b3)]&&(_0x9ff70[_0x1ac5d5(0x1b3)]=_0x9ff70['exitCriterias']['filter'](_0x390e67=>!_0x390e67[_0x1ac5d5(0x1bc)]||!isPendingSegmentId(_0x390e67['segmentId'])));if(_0x9ff70[_0x1ac5d5(0x123)])for(const _0xcacf49 of Object[_0x1ac5d5(0x150)](_0x9ff70[_0x1ac5d5(0x123)])){const _0x351992=_0x9ff70[_0x1ac5d5(0x123)][_0xcacf49];_0x351992[_0x1ac5d5(0x110)]===_0x1ac5d5(0x171)&&_0x351992[_0x1ac5d5(0x14c)]&&isPendingActivationId(_0x351992[_0x1ac5d5(0x14c)])&&(_0x351992[_0x1ac5d5(0x14c)]='');if(_0x351992[_0x1ac5d5(0x110)]==='DecisionPoint'&&_0x351992[_0x1ac5d5(0x1bd)])for(const _0x52bad0 of _0x351992['branches']){_0x52bad0[_0x1ac5d5(0x1bc)]&&isPendingSegmentId(_0x52bad0[_0x1ac5d5(0x1bc)])&&(_0x52bad0[_0x1ac5d5(0x1bc)]='');}_0x351992[_0x1ac5d5(0x110)]==='WaitStep'&&stripWaitStepPendingIds(_0x351992);}}}function resolvePendingIdsInRequest(_0x4750a8,_0x42670d,_0x2f44ec,_0x2823e4,_0x3af4e5,_0x368dd6){const _0x1d9803=a159_0x3ddbd6,_0x223d98=(_0x10f220,_0x1ff20a)=>{const _0x405326=a159_0x4982;if(!isPendingSegmentId(_0x10f220))return _0x10f220;const _0x15e08d=extractPendingSegmentName(_0x10f220),_0x17f771=_0x2823e4['get'](_0x15e08d);return!_0x17f771&&_0x368dd6[_0x405326(0x1dc)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x15e08d+_0x405326(0x18c)+_0x1ff20a),_0x17f771;};if(_0x4750a8['attributes'][_0x1d9803(0x191)]?.['segmentId']&&isPendingSegmentId(_0x4750a8[_0x1d9803(0x1b5)]['goal'][_0x1d9803(0x1bc)])){const _0x57ce20=_0x223d98(_0x4750a8[_0x1d9803(0x1b5)][_0x1d9803(0x191)]['segmentId'],'goal\x20criteria');_0x57ce20&&(_0x4750a8[_0x1d9803(0x1b5)][_0x1d9803(0x191)][_0x1d9803(0x1bc)]=_0x57ce20);}for(const _0x1dcc73 of _0x4750a8['attributes'][_0x1d9803(0x1d7)]||[]){const _0x5d5b2a=_0x2f44ec[_0x1d9803(0x17f)](_0x1dcc73[_0x1d9803(0x101)][_0x1d9803(0x188)]());_0x5d5b2a&&(_0x1dcc73['id']=_0x5d5b2a);if(_0x1dcc73[_0x1d9803(0x139)]?.[_0x1d9803(0x1bc)]&&isPendingSegmentId(_0x1dcc73[_0x1d9803(0x139)][_0x1d9803(0x1bc)])){const _0x2d9ce1=_0x223d98(_0x1dcc73[_0x1d9803(0x139)][_0x1d9803(0x1bc)],_0x1d9803(0x120)+_0x1dcc73['name']+_0x1d9803(0x1e1));_0x2d9ce1&&(_0x1dcc73[_0x1d9803(0x139)]['segmentId']=_0x2d9ce1);}if(_0x1dcc73['exitCriterias'])for(const _0x54745d of _0x1dcc73[_0x1d9803(0x1b3)]){if(_0x54745d[_0x1d9803(0x1bc)]&&isPendingSegmentId(_0x54745d[_0x1d9803(0x1bc)])){const _0x5ab252=_0x223d98(_0x54745d[_0x1d9803(0x1bc)],_0x1d9803(0x120)+_0x1dcc73[_0x1d9803(0x101)]+_0x1d9803(0x124));_0x5ab252&&(_0x54745d[_0x1d9803(0x1bc)]=_0x5ab252);}}if(_0x1dcc73[_0x1d9803(0x196)]?.[_0x1d9803(0x1bc)]&&isPendingSegmentId(_0x1dcc73[_0x1d9803(0x196)][_0x1d9803(0x1bc)])){const _0xd8f6fb=_0x223d98(_0x1dcc73[_0x1d9803(0x196)][_0x1d9803(0x1bc)],'stage\x20\x27'+_0x1dcc73[_0x1d9803(0x101)]+'\x27\x20milestone');_0xd8f6fb&&(_0x1dcc73['milestone'][_0x1d9803(0x1bc)]=_0xd8f6fb);}if(_0x1dcc73['steps']){const _0x4d0e47=_0x5e0458=>_0x42670d['attributes'][_0x1d9803(0x1d7)]?.['find'](_0x314dac=>_0x314dac[_0x1d9803(0x101)][_0x1d9803(0x188)]()===_0x1dcc73[_0x1d9803(0x101)]['toLowerCase']())?.[_0x1d9803(0x123)]?.[_0x5e0458];for(const _0x95c171 of Object['keys'](_0x1dcc73[_0x1d9803(0x123)])){const _0x3312b0=_0x1dcc73[_0x1d9803(0x123)][_0x95c171],_0x49d45e=_0x4d0e47(_0x95c171);if(_0x3312b0[_0x1d9803(0x110)]===_0x1d9803(0x171)&&_0x3312b0[_0x1d9803(0x14c)]&&(isPendingActivationId(_0x3312b0[_0x1d9803(0x14c)])||_0x3312b0['journeyActivationStepId']==='')){if(_0x49d45e?.[_0x1d9803(0x14c)]&&isPendingActivationId(_0x49d45e[_0x1d9803(0x14c)])){const _0x59b28c=extractPendingActivationName(_0x49d45e[_0x1d9803(0x14c)]),_0x593dcb=_0x3af4e5[_0x1d9803(0x17f)](_0x59b28c);_0x593dcb&&(_0x3312b0[_0x1d9803(0x14c)]=_0x593dcb);}}if(_0x3312b0[_0x1d9803(0x110)]===_0x1d9803(0x17d)&&_0x3312b0[_0x1d9803(0x1bd)]&&_0x49d45e?.[_0x1d9803(0x1bd)])for(let _0x5d3155=0x0;_0x5d3155<_0x3312b0['branches'][_0x1d9803(0x107)];_0x5d3155++){const _0x1cd8ef=_0x3312b0[_0x1d9803(0x1bd)][_0x5d3155],_0x461462=_0x49d45e['branches'][_0x5d3155];if(_0x461462?.[_0x1d9803(0x1bc)]&&isPendingSegmentId(_0x461462[_0x1d9803(0x1bc)])){const _0x49bc53=_0x223d98(_0x461462[_0x1d9803(0x1bc)],'stage\x20\x27'+_0x1dcc73[_0x1d9803(0x101)]+_0x1d9803(0x199)+(_0x1cd8ef[_0x1d9803(0x101)]||_0x5d3155)+'\x27');_0x49bc53&&(_0x1cd8ef['segmentId']=_0x49bc53);}}_0x3312b0[_0x1d9803(0x110)]==='WaitStep'&&_0x49d45e?.['type']===_0x1d9803(0x1c2)&&resolveWaitStepPendingIds(_0x3312b0,_0x49d45e,_0x223d98,_0x1dcc73['name']);}}}}
1
+ const a159_0x34a518=a159_0x2ae9;(function(_0x2b1f20,_0x36d0dc){const _0x3ce985=a159_0x2ae9,_0x478e21=_0x2b1f20();while(!![]){try{const _0x302f15=parseInt(_0x3ce985(0x1a9))/0x1*(parseInt(_0x3ce985(0x16e))/0x2)+parseInt(_0x3ce985(0x19b))/0x3+-parseInt(_0x3ce985(0x10c))/0x4+parseInt(_0x3ce985(0x1d1))/0x5*(-parseInt(_0x3ce985(0x1b3))/0x6)+-parseInt(_0x3ce985(0x112))/0x7*(-parseInt(_0x3ce985(0x145))/0x8)+parseInt(_0x3ce985(0x139))/0x9*(parseInt(_0x3ce985(0x166))/0xa)+-parseInt(_0x3ce985(0x18e))/0xb;if(_0x302f15===_0x36d0dc)break;else _0x478e21['push'](_0x478e21['shift']());}catch(_0xf780ee){_0x478e21['push'](_0x478e21['shift']());}}}(a159_0x2781,0xe6afd));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a159_0x34a518(0x1a1));export const PENDING_SEGMENT_PREFIX=a159_0x34a518(0x172);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x6136cf){return''+PENDING_SEGMENT_PREFIX+_0x6136cf+'__';}export function isPendingSegmentId(_0x1c6e6b){const _0x43b9aa=a159_0x34a518;return _0x1c6e6b[_0x43b9aa(0x1ec)](PENDING_SEGMENT_PREFIX)&&!_0x1c6e6b[_0x43b9aa(0x1ec)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x5075bb){const _0x128a11=a159_0x34a518;return _0x5075bb[_0x128a11(0x12f)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5a0f77){return''+PENDING_ACTIVATION_PREFIX+_0x5a0f77+'__';}export function isPendingActivationId(_0x1e60cf){const _0x2fd0e2=a159_0x34a518;return _0x1e60cf[_0x2fd0e2(0x1ec)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x223364){const _0x49f9f6=a159_0x34a518;return _0x223364[_0x49f9f6(0x12f)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xe38a24,_0x42fbc1){const _0x403f13=a159_0x34a518,_0x3f6524=_0xe38a24+'::'+(_0x42fbc1[_0x403f13(0x183)]()||'segment'),_0x374916=createHash('sha1')['update'](_0x3f6524)[_0x403f13(0x16c)]('hex')[_0x403f13(0x1c0)](0x0,0xc);return'journey_entry_criteria_'+_0x374916;}export function ensureJourneyDefaults(_0x21c943){const _0x43ef35=a159_0x34a518;!_0x21c943[_0x43ef35(0x1a4)]&&(_0x21c943[_0x43ef35(0x1a4)]=''),!_0x21c943[_0x43ef35(0x196)]&&(_0x21c943[_0x43ef35(0x196)]=_0x43ef35(0x16b));}export function injectExistingStageIds(_0x1f5115,_0x19053c){const _0x57ae70=a159_0x34a518,_0x13b6d8=new Map(_0x19053c[_0x57ae70(0x155)](_0x341cb4=>[_0x341cb4[_0x57ae70(0x17f)],_0x341cb4['id']]));for(const _0xca5705 of _0x1f5115){if(!_0xca5705['id']){const _0xa00e10=_0x13b6d8[_0x57ae70(0x197)](_0xca5705[_0x57ae70(0x17f)]);_0xa00e10&&(_0xca5705['id']=_0xa00e10);}}}export function resolveTDFolderPath(_0x36593a,_0x17bae2,_0x49c72b){const _0x3b2b82=a159_0x34a518;if(!_0x17bae2)return _0x36593a;if(_0x36593a===_0x49c72b||_0x36593a[_0x3b2b82(0x1ec)](_0x49c72b+'/'))return _0x36593a;return _0x36593a?_0x49c72b+'/'+_0x36593a:_0x49c72b;}export function addFoldersToCreate(_0x226902,_0x5977b2,_0x5bfd4f){const _0x43ecf6=a159_0x34a518;if(!_0x226902)return;if(_0x5977b2['has'](_0x226902))return;const _0x24a939=_0x226902[_0x43ecf6(0x167)]('/');let _0x5d379b='';for(const _0x321de3 of _0x24a939){_0x5d379b=_0x5d379b?_0x5d379b+'/'+_0x321de3:_0x321de3,!_0x5977b2[_0x43ecf6(0x1c5)](_0x5d379b)&&_0x5bfd4f[_0x43ecf6(0x15f)](_0x5d379b);}}export function sortFoldersByDepth(_0x32f6e9){const _0x2c67e3=a159_0x34a518;return[..._0x32f6e9][_0x2c67e3(0x143)]((_0x2319a5,_0x2bd8ce)=>{const _0x3a3d5d=_0x2c67e3,_0x4d0af7=(_0x2319a5[_0x3a3d5d(0x194)](/\//g)||[])[_0x3a3d5d(0x116)],_0x5d0fbf=(_0x2bd8ce[_0x3a3d5d(0x194)](/\//g)||[])[_0x3a3d5d(0x116)];return _0x4d0af7-_0x5d0fbf;});}import*as a159_0xb9525d from'yaml';import{readFileSync}from'fs';import a159_0x4930b8 from'path';import{isJourneyDef,parseYamlString as a159_0x1e2933,toYamlString as a159_0x3e2fec,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x1154b4){const _0xf8fc56=a159_0x34a518;if(Array['isArray'](_0x1154b4))return'['+_0x1154b4[_0xf8fc56(0x155)](_0x323239=>stableStringify(_0x323239))[_0xf8fc56(0x1cb)](',')+']';if(_0x1154b4&&typeof _0x1154b4==='object'){const _0x3fa6c9=_0x1154b4,_0x498346=Object['keys'](_0x3fa6c9)[_0xf8fc56(0x143)](),_0x28ed64=_0x498346[_0xf8fc56(0x155)](_0x2bc4d3=>'\x22'+_0x2bc4d3+'\x22:'+stableStringify(_0x3fa6c9[_0x2bc4d3]));return'{'+_0x28ed64[_0xf8fc56(0x1cb)](',')+'}';}const _0x25e668=JSON[_0xf8fc56(0x1d9)](_0x1154b4);return _0x25e668===undefined?_0xf8fc56(0x154):_0x25e668;}function activationSignature(_0x38bf23){const _0x1a7d4f=a159_0x34a518,_0x4e1e6c={'connection':_0x38bf23[_0x1a7d4f(0x129)],..._0x38bf23[_0x1a7d4f(0x12e)]!==undefined&&{'all_columns':_0x38bf23[_0x1a7d4f(0x12e)]},..._0x38bf23[_0x1a7d4f(0x1bf)]!==undefined&&{'columns':_0x38bf23['columns']},..._0x38bf23[_0x1a7d4f(0x1c7)]!==undefined&&{'behavior':_0x38bf23[_0x1a7d4f(0x1c7)]},..._0x38bf23['schedule']!==undefined&&{'schedule':_0x38bf23[_0x1a7d4f(0x11f)]},..._0x38bf23[_0x1a7d4f(0x142)]!==undefined&&{'notification':_0x38bf23[_0x1a7d4f(0x142)]},..._0x38bf23[_0x1a7d4f(0x1c3)]!==undefined&&{'connector_config':_0x38bf23[_0x1a7d4f(0x1c3)]},..._0x38bf23[_0x1a7d4f(0x1af)]!==undefined&&{'activation_template_id':_0x38bf23['activation_template_id']}};return stableStringify(_0x4e1e6c);}async function fetchSegment(_0x5d4d5f,_0xaa60be,_0x87c600,_0x342799){const _0x4059e3=a159_0x34a518,_0x3096e9=_0x342799?.['find'](_0x435f95=>_0x435f95['id']===_0x87c600);if(_0x3096e9)return _0x3096e9;try{return await _0x5d4d5f[_0x4059e3(0x163)][_0x4059e3(0x1b8)](_0xaa60be,_0x87c600);}catch(_0x44717b){logger['debug'](_0x4059e3(0x137)+_0x87c600+_0x4059e3(0x1de)+_0x44717b);try{return await _0x5d4d5f[_0x4059e3(0x163)]['getSegmentEntity'](_0x87c600);}catch(_0x4468d8){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x87c600+':\x20'+_0x4468d8),null;}}}function a159_0x2ae9(_0x32f5d6,_0x2e8cca){_0x32f5d6=_0x32f5d6-0x10c;const _0x2781a7=a159_0x2781();let _0x2ae9b9=_0x2781a7[_0x32f5d6];return _0x2ae9b9;}function recoverSegmentIdsFromPushRecovery(_0x2b7b2f,_0x4e8111,_0x1ded2c){const _0x4ff8dc=a159_0x34a518,_0x4d07e3=readPushRecovery(_0x2b7b2f[_0x4ff8dc(0x206)]);if(_0x4d07e3?.['journeyName']===_0x2b7b2f[_0x4ff8dc(0x124)][_0x4ff8dc(0x17f)])for(const [_0x1cea4a,_0x468360]of Object[_0x4ff8dc(0x147)](_0x4d07e3[_0x4ff8dc(0x115)])){const _0x20fd89=generateDeterministicJourneySegmentName(_0x2b7b2f[_0x4ff8dc(0x124)][_0x4ff8dc(0x17f)],_0x1cea4a);_0x468360[_0x4ff8dc(0x1c8)]===_0x20fd89&&(_0x4e8111[_0x4ff8dc(0x148)](_0x1cea4a,_0x468360['segmentId']),_0x1ded2c[_0x4ff8dc(0x148)](_0x1cea4a,_0x468360[_0x4ff8dc(0x12d)]));}}async function createOrRecoverEmbeddedSegment(_0x421f29,_0x34a30b,_0x32a424,_0x3bf5d8){const _0xc0bf59=a159_0x34a518;let _0x40ef96;try{_0x40ef96=await _0x421f29[_0xc0bf59(0x163)][_0xc0bf59(0x1b0)]({'name':_0x32a424[_0xc0bf59(0x192)],'description':_0x32a424[_0xc0bf59(0x1a4)],'journeyId':_0x32a424['journeyId'],'rule':_0x3bf5d8(_0x32a424[_0xc0bf59(0x1d6)],!![]),'countPopulation':!![],'parentFolderId':_0x32a424[_0xc0bf59(0x202)],'audienceId':_0x32a424[_0xc0bf59(0x1db)]});}catch(_0x512e00){const _0xb4b6c3=_0x512e00 instanceof Error&&_0x512e00[_0xc0bf59(0x18f)][_0xc0bf59(0x150)](_0xc0bf59(0x186));if(_0xb4b6c3){const _0x40f5b3=readPushRecovery(_0x34a30b[_0xc0bf59(0x206)]),_0x1a774c=_0x40f5b3?.['journeyName']===_0x34a30b['yamlConfig']['name']?_0x40f5b3[_0xc0bf59(0x115)][_0x32a424[_0xc0bf59(0x120)]]:undefined;if(_0x1a774c?.['uniqueServerName']===_0x32a424['uniqueSegmentName'])await _0x421f29[_0xc0bf59(0x163)][_0xc0bf59(0x1f6)](_0x32a424[_0xc0bf59(0x1db)],_0x1a774c[_0xc0bf59(0x12d)],{'description':_0x32a424['description'],'rule':_0x3bf5d8(_0x32a424['resolvedRule'],!![]),'countPopulation':!![]}),_0x40ef96=_0x1a774c[_0xc0bf59(0x12d)];else throw new SDKError(ErrorCode[_0xc0bf59(0x189)],_0xc0bf59(0x15d)+_0x32a424[_0xc0bf59(0x120)]+_0xc0bf59(0x118)+(_0xc0bf59(0x1ae)+_0x34a30b[_0xc0bf59(0x206)][_0xc0bf59(0x12f)](/([^/]+)$/,_0xc0bf59(0x20c))+')\x20')+_0xc0bf59(0x125),_0x512e00);}else throw _0x512e00;}return saveSegmentToPushRecovery(_0x34a30b[_0xc0bf59(0x206)],_0x34a30b[_0xc0bf59(0x124)][_0xc0bf59(0x17f)],_0x32a424['localName'],{'segmentId':_0x40ef96,'uniqueServerName':_0x32a424[_0xc0bf59(0x192)],'createdAt':new Date()[_0xc0bf59(0x175)]()}),_0x40ef96;}export async function prepareSegmentFiles(_0x4e593e,_0xe2db5a,_0x5703cb,_0x418a38,_0x4dff4f){const _0x327cb4=a159_0x34a518,{activationDefToCreateRequest:_0x382832}=await import(_0x327cb4(0x11e)),_0xf36d24=[],_0x5f27bb=new Set();for(const {yamlConfig:_0x16dc16,folderPath:_0x5ecbe6,sourcePath:_0x22c3cb}of _0x4e593e){const _0x180909=resolveTDFolderPath(_0x5ecbe6,_0x418a38,_0x4dff4f),_0x1b1ae2=_0x180909+':'+_0x16dc16[_0x327cb4(0x17f)],_0x13b23b=_0xe2db5a[_0x327cb4(0x1c2)][_0x327cb4(0x197)](_0x1b1ae2),_0x442b4b=_0x13b23b?_0xe2db5a[_0x327cb4(0x15a)][_0x327cb4(0x197)](_0x13b23b['id'])||[]:[];addFoldersToCreate(_0x180909,_0xe2db5a[_0x327cb4(0x16d)],_0x5f27bb);const _0x3da693=calculateActivationActions(_0x16dc16[_0x327cb4(0x126)]||[],_0x442b4b,_0xe2db5a[_0x327cb4(0x15b)],_0xe2db5a[_0x327cb4(0x1da)]);for(const _0x24d9e8 of _0x3da693){(_0x24d9e8[_0x327cb4(0x152)]===_0x327cb4(0x1a3)||_0x24d9e8['type']===_0x327cb4(0x1d7))&&_0x24d9e8[_0x327cb4(0x19d)]&&(_0x24d9e8[_0x327cb4(0x20b)]=await _0x382832(_0x24d9e8[_0x327cb4(0x19d)],_0x5703cb));}const _0xd4aeb1=calculateSegmentDiff(_0x16dc16,_0x13b23b,_0x442b4b,_0xe2db5a['idToEmailMap'],_0xe2db5a[_0x327cb4(0x1da)]);_0xf36d24['push']({'relativePath':_0x16dc16[_0x327cb4(0x17f)],'absolutePath':_0x22c3cb,'yamlConfig':_0x16dc16,'folderPath':_0x180909,'existingSegment':_0x13b23b,'existingActivations':_0x442b4b,'isNew':_0xd4aeb1[_0x327cb4(0x164)],'hasChanges':_0xd4aeb1[_0x327cb4(0x1f9)],'diff':_0xd4aeb1[_0x327cb4(0x1ef)],'activationActions':_0x3da693});}return{'segmentFiles':_0xf36d24,'foldersToCreate':_0x5f27bb};}export async function prepareJourneyFiles(_0x5edfb6,_0x35815e,_0x39bc3c,_0x47978e){const _0x20a7ab=a159_0x34a518,_0x72a0d1=[],_0x134764=new Set();for(const {yamlConfig:_0x37bab9,folderPath:_0x487480,sourcePath:_0x320dc6}of _0x5edfb6){const _0x2d7870=resolveTDFolderPath(_0x487480,_0x39bc3c,_0x47978e),_0x53db0b=_0x2d7870+':'+_0x37bab9[_0x20a7ab(0x17f)],_0x4f0c7a=_0x35815e[_0x20a7ab(0x1ab)][_0x20a7ab(0x197)](_0x53db0b);let _0x37df15,_0x2d6067;if(_0x4f0c7a&&_0x4f0c7a[_0x20a7ab(0x116)]>0x0){const _0x3fe335=buildLocalExpandedRuleMappings(_0x37bab9),{createYamlContext:_0x200139,prefetchJourneySegments:_0x3c4138}=createPushYamlContextForBundle(_0x35815e[_0x20a7ab(0x1fd)],_0x35815e[_0x20a7ab(0x1db)],_0x35815e[_0x20a7ab(0x117)],_0x3fe335,_0x35815e[_0x20a7ab(0x15b)],_0x35815e[_0x20a7ab(0x1da)],_0x35815e[_0x20a7ab(0x1a2)],_0x35815e[_0x20a7ab(0x207)]);await _0x3c4138(_0x4f0c7a[_0x20a7ab(0x155)](_0x59bc50=>_0x59bc50['id']));const _0x2263e1=await _0x35815e['deps'][_0x20a7ab(0x113)][_0x20a7ab(0x1fa)](_0x4f0c7a[0x0][_0x20a7ab(0x1e1)]),_0x3169e1=hasMultipleVersions(_0x37bab9),_0x3dc8b6=async _0x40f92a=>{const _0xb58e3d=_0x20a7ab,_0xd54d76=_0x35815e[_0xb58e3d(0x207)]?.[_0xb58e3d(0x197)](_0x40f92a);if(_0xd54d76)return _0xd54d76;return _0x35815e[_0xb58e3d(0x14a)]({'journeyId':_0x40f92a,'journeyName':_0x37bab9[_0xb58e3d(0x17f)],'isMultiVersion':_0x4f0c7a[_0xb58e3d(0x116)]>0x1});};if(_0x3169e1&&_0x4f0c7a[_0x20a7ab(0x116)]>0x1){const _0x4525ff=[];for(const _0x3f5475 of _0x4f0c7a){const _0x336ed6=_0x3f5475[_0x20a7ab(0x162)]||0x1;_0x35815e[_0x20a7ab(0x165)]?.[_0x20a7ab(0x1d7)](_0x20a7ab(0x193)+_0x37bab9[_0x20a7ab(0x17f)]+'\x20v'+_0x336ed6);const _0x271507=await _0x3dc8b6(_0x3f5475['id']),_0x1112f6=_0x200139(_0x3f5475['id']),_0x3ca49d=await journeyResponseToDef(_0x271507,_0x1112f6);_0x4525ff['push']({'item':_0x3f5475,'yaml':_0x3ca49d});}const _0x5ec5c2=buildLocalRuleToNameMappingFromJourney(_0x37bab9);_0x2d6067=buildMergedJourneyDef(_0x4525ff,_0x5ec5c2,_0x2263e1);const _0x432f71=Math['max'](..._0x4525ff[_0x20a7ab(0x155)](_0x377987=>_0x377987[_0x20a7ab(0x11b)][_0x20a7ab(0x162)]||0x0)),_0x1873f7=_0x4f0c7a[_0x20a7ab(0x1f8)](_0x4d93f4=>(_0x4d93f4[_0x20a7ab(0x162)]||0x0)===_0x432f71);_0x1873f7&&(_0x35815e[_0x20a7ab(0x165)]?.[_0x20a7ab(0x1d7)]('Fetching\x20'+_0x37bab9[_0x20a7ab(0x17f)]+'\x20v'+_0x432f71),_0x37df15=await _0x3dc8b6(_0x1873f7['id']));}else{const _0xedcee5=_0x4f0c7a[_0x4f0c7a['length']-0x1];_0x35815e[_0x20a7ab(0x165)]?.['update'](_0x20a7ab(0x193)+_0x37bab9['name']),_0x37df15=await _0x3dc8b6(_0xedcee5['id']);const _0x44e378=_0x200139(_0xedcee5['id']),_0x54d308=await journeyResponseToDef(_0x37df15,_0x44e378),_0x2ee6df=buildLocalRuleToNameMappingFromJourney(_0x37bab9);_0x2d6067=buildMergedJourneyDef([{'item':_0xedcee5,'yaml':_0x54d308}],_0x2ee6df,_0x2263e1);}}addFoldersToCreate(_0x2d7870,_0x35815e['folderPathToId'],_0x134764);const _0x57225a=calculateJourneyDiff(_0x37bab9,_0x2d6067);_0x72a0d1[_0x20a7ab(0x1eb)]({'relativePath':_0x37bab9[_0x20a7ab(0x17f)],'absolutePath':_0x320dc6,'yamlConfig':_0x37bab9,'folderPath':_0x2d7870,'existingJourney':_0x37df15,'isNew':_0x57225a['isNew'],'hasChanges':_0x57225a['hasChanges'],'diff':_0x57225a[_0x20a7ab(0x1ef)]});}return{'journeyFiles':_0x72a0d1,'foldersToCreate':_0x134764};}export function calculateActivationActions(_0x2d1ff6,_0x5074dd,_0x7c55ff,_0x274fa5){const _0x50930e=a159_0x34a518,_0x7f05a9=[],_0xe00cd9=new Map();for(const _0x4de2c9 of _0x5074dd){_0xe00cd9[_0x50930e(0x148)](_0x4de2c9['name'],_0x4de2c9);}const _0x8bf0c7=new Map();for(const _0x594611 of _0x2d1ff6){_0x8bf0c7[_0x50930e(0x148)](_0x594611[_0x50930e(0x17f)],_0x594611);}for(const _0x398e0f of _0x2d1ff6){const _0x4cc0b9=_0xe00cd9[_0x50930e(0x197)](_0x398e0f['name']);if(!_0x4cc0b9)_0x7f05a9[_0x50930e(0x1eb)]({'type':_0x50930e(0x1a3),'name':_0x398e0f['name'],'yamlActivation':_0x398e0f});else{const _0x1bfe7a=activationResponseToDef(_0x4cc0b9,_0x7c55ff,_0x274fa5),_0x51b060=a159_0xb9525d[_0x50930e(0x1d9)](_0x1bfe7a),_0x3a5817=a159_0xb9525d['stringify'](_0x398e0f);_0x51b060!==_0x3a5817&&_0x7f05a9[_0x50930e(0x1eb)]({'type':'update','name':_0x398e0f['name'],'yamlActivation':_0x398e0f,'existingActivation':_0x4cc0b9});}}for(const _0x2b6295 of _0x5074dd){!_0x8bf0c7[_0x50930e(0x1c5)](_0x2b6295[_0x50930e(0x17f)])&&_0x7f05a9[_0x50930e(0x1eb)]({'type':'delete','name':_0x2b6295[_0x50930e(0x17f)],'existingActivation':_0x2b6295});}return _0x7f05a9;}function calculateYamlDiff(_0x27deaf,_0x330dfa){if(_0x330dfa){const _0x440d14=generateDiff(_0x330dfa,_0x27deaf),_0x5b0751=hasChanges(_0x440d14);return{'isNew':![],'hasChanges':_0x5b0751,'diff':_0x5b0751?formatDiffWithColors(_0x440d14):undefined};}const _0x12de49=generateDiff('',_0x27deaf);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x12de49)};}export function calculateSegmentDiff(_0x195396,_0x9a681b,_0x17cb8b,_0x5f2393,_0x133407){const _0x1b3248=segmentToYamlString(_0x195396),_0x182d7e=_0x9a681b?segmentToYamlString(segmentWithActivationsToYaml(_0x9a681b,_0x17cb8b,undefined,_0x5f2393,_0x133407)):undefined;return calculateYamlDiff(_0x1b3248,_0x182d7e);}export function calculateJourneyDiff(_0x483208,_0x2f03e8){const _0x6615f=normalizeJourneyDef(_0x483208,_0x483208),_0x156464=a159_0x3e2fec(_0x6615f),_0x2a2435=_0x2f03e8?a159_0x3e2fec(normalizeJourneyDef(_0x2f03e8,_0x483208)):undefined;return calculateYamlDiff(_0x156464,_0x2a2435);}export function findSegmentsToDelete(_0x5fca2a,_0x4ce35b,_0x10592e,_0x3b2a26,_0x48cfcd){const _0x4de5e5=a159_0x34a518,_0x4c508e=new Set();for(const {yamlConfig:_0xca26be,folderPath:_0x4742e1}of _0x4ce35b){_0x4c508e[_0x4de5e5(0x15f)](_0x4742e1+':'+_0xca26be[_0x4de5e5(0x17f)]);}return _0x5fca2a[_0x4de5e5(0x1fc)](_0x5ac496=>{const _0xfda5e9=_0x4de5e5,_0x161166=_0x5ac496[_0xfda5e9(0x208)]?_0x10592e[_0xfda5e9(0x197)](_0x5ac496[_0xfda5e9(0x208)][_0xfda5e9(0x168)]())||'':'',_0x3365ba=_0x161166+':'+_0x5ac496['name'];if(_0x4c508e[_0xfda5e9(0x1c5)](_0x3365ba))return![];if(_0x48cfcd)return _0x161166===_0x3b2a26||_0x161166[_0xfda5e9(0x1ec)](_0x3b2a26+'/');return!![];});}export function findJourneysToDelete(_0x29bd27,_0x1139d2,_0x484ebb,_0x4ec412,_0x2ced3f){const _0x331e0d=a159_0x34a518,_0x5093e6=new Set();for(const {yamlConfig:_0x1be87c,folderPath:_0x4ec799}of _0x1139d2){_0x5093e6[_0x331e0d(0x15f)](_0x4ec799+':'+_0x1be87c[_0x331e0d(0x17f)]);}return _0x29bd27[_0x331e0d(0x1fc)](_0x195820=>{const _0x330160=_0x331e0d,_0x2755c6=_0x195820[_0x330160(0x202)]?_0x484ebb[_0x330160(0x197)](_0x195820['folderId'])||'':'',_0xf4b62b=_0x2755c6+':'+_0x195820['journeyBundleName'];if(_0x5093e6['has'](_0xf4b62b))return![];if(_0x2ced3f)return _0x2755c6===_0x4ec412||_0x2755c6[_0x330160(0x1ec)](_0x4ec412+'/');return!![];});}function a159_0x2781(){const _0x37f600=['exitCriterias','tdx.sdk.push-workflow','activationStepsById','create','description','deleteSegment','onProgress','parentSegmentFolder','\x20journey\x20from\x20file:\x20','1232788DKYTFH','Updated\x20activation\x20\x27','journeyBundlesByFolderAndName','\x27\x20exit\x20criteria','effectiveFolderId','Delete\x20the\x20push\x20recovery\x20file\x20(','activation_template_id','createJourneySegment','entryCriteria','user','54lSKDrq','):\x20','activation_creating','journeyId','\x20segment\x20from\x20file:\x20','getSegment','reduce','milestone','branches','logInfo','journeyStages','max','columns','slice','logWarning','segmentByFolderAndName','connector_config','waitStep','has','Created\x20folder\x20\x27','behavior','uniqueServerName','Deleted\x20segment\x20\x27','waitStepUnit','join','Failed\x20to\x20fetch\x20referenced\x20segment\x20','updated','goal','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','results','59095tQzHka','relationships','Creating\x20activation\x20\x27','withProgress','kind','resolvedRule','update','resolveJourneyId','stringify','connectionIdToNameMap','parentId','stages','day',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','./journey-yaml.js','embedded_activation_creating','journeyBundleId','all','debug','conditionSegmentId','\x27\x20entry\x20criteria','activationParams','goal\x20criteria','conditionTimeoutDuration','NOT_FOUND','deleteActivation','push','startsWith','data','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','diff','conditionTimeoutUnit','Condition','getActivation','WaitStep','some','createdSegmentIds','updateSegmentById','parseDocument','find','hasChanges','getLatestJourneyId','segment_deleted','filter','deps','journeyActivationStepId','Creating\x20folder\x20\x27','activation_created','Matched\x20server\x20segment\x20\x27','folderId','journey_updating','resolveSegment','idToName','absolutePath','journeyById','segmentFolderId','listActivations','steps','validatedRequest','.$1.push-recovery.json','\x0a\x20\x20','run_after_journey_refresh','verbose','2047016gwYOXJ','flatMap','unchanged','relative','existingJourney','createActivation','148309zuakbx','journey','Updated\x20segment\x20\x27','segments','length','existingSegments','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x27\x20decision\x20point\x20branch\x20\x27','utf-8','item','createdSegmentId','waitStepType','./child-segment-yaml.js','schedule','localName','Segment\x20not\x20found:\x20','keys','created','yamlConfig','and\x20the\x20server\x20segment,\x20then\x20retry.','activations','action','journeyBundleName','connection','embedded_segment_created','\x27...','INTERNAL','segmentId','all_columns','replace','logSuccess','segment_updating','with','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','folder_created','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','\x27\x20wait\x20condition','getSegment\x20failed\x20for\x20','activation_deleted','1494sGEFGc','Segment\x20not\x20found','\x20(referenced\x20in\x20journey\x20','conditions','stage\x20\x27','Journey\x20\x27','segmentNameToId','\x27\x20for\x20','deleted','notification','sort','activationContext','136DdjCwV','Updating\x20segment\x20\x27','entries','set','valid','fetchJourney','list','ACTIVATION_UPDATE_ERROR','entry_criteria','Stage\x20\x27','folder','includes','SEGMENT_NOT_FOUND','type','segment_updated','null','map','errors','skipSegments','journey_creating','JOURNEY_SYNTAX_ERROR','activationsBySegmentId','idToEmailMap','JOURNEY_UPDATE_ERROR','Embedded\x20segment\x20\x27','parse','add','\x20error(s)','\x27\x20from\x20file:\x20','versionNumber','segment','isNew','progress','24500dLQSrf','split','toString','existingSegment','Failed\x20to\x20','draft','digest','folderPathToId','2sZWtYG','journeys','\x20activation\x20\x27','delete','__pending_','DecisionPoint','Deleting\x20activation\x20\x27','toISOString','../../utils/async.js','dirname','values','\x27\x20to\x20local\x20\x27','toLowerCase','\x27\x20not\x20found\x20in\x20journey\x20\x27','index','Updating\x20activation\x20\x27','parentFolder','name','Created\x20segment\x20\x27','Entry\x20criteria:\x20','segment_created','trim',').\x20','rule','Name\x20has\x20already\x20been\x20taken','embedded_segment_creating','getJourney','SEGMENT_UPDATE_ERROR','logDeleted','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','existingActivation','attributes','18820879hqyLGA','message','activationActions','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','uniqueSegmentName','Fetching\x20','match','\x27\x20by\x20rule\x20content','state','get','Duration','journeyActivationNameToId','size','3823020EZIEdc','from','yamlActivation','rootFolderId','folderPath'];a159_0x2781=function(){return _0x37f600;};return a159_0x2781();}export function buildSegmentLookupMap(_0x58bfbd,_0x28197c){const _0x4f98d5=a159_0x34a518,_0x3df20a=new Map();for(const _0x4816d3 of _0x58bfbd){const _0x11174b=_0x4816d3[_0x4f98d5(0x208)]?_0x28197c[_0x4f98d5(0x197)](_0x4816d3['segmentFolderId'][_0x4f98d5(0x168)]())||'':'',_0x50925c=_0x11174b+':'+_0x4816d3['name'];_0x3df20a[_0x4f98d5(0x148)](_0x50925c,_0x4816d3);}return _0x3df20a;}export function buildSegmentNameToIdMap(_0x4a5247){const _0xa236d3=a159_0x34a518,_0x52ae20=new Map();for(const _0x3a3605 of _0x4a5247){_0x52ae20['set'](_0x3a3605[_0xa236d3(0x17f)],_0x3a3605['id']);}return _0x52ae20;}export function buildJourneyBundleLookupMap(_0x56b62b,_0x58b5a0){const _0x2f0819=a159_0x34a518,_0x3aa68a=new Map();for(const _0xc83904 of _0x56b62b){const _0x1027bb=_0xc83904[_0x2f0819(0x202)]?_0x58b5a0['get'](_0xc83904[_0x2f0819(0x202)])||'':'',_0x358699=_0x1027bb+':'+_0xc83904[_0x2f0819(0x128)];!_0x3aa68a[_0x2f0819(0x1c5)](_0x358699)&&_0x3aa68a[_0x2f0819(0x148)](_0x358699,[]),_0x3aa68a['get'](_0x358699)[_0x2f0819(0x1eb)](_0xc83904);}for(const _0x36e205 of _0x3aa68a[_0x2f0819(0x178)]()){_0x36e205[_0x2f0819(0x143)]((_0x4ef664,_0x36c710)=>(_0x4ef664[_0x2f0819(0x162)]||0x0)-(_0x36c710[_0x2f0819(0x162)]||0x0));}return _0x3aa68a;}export function collectFoldersToCreate(_0x296a1b,_0x1ca209){const _0x4dd6d0=a159_0x34a518,_0x5caad5=new Set();for(const _0x1f6052 of _0x296a1b){if(!_0x1f6052)continue;if(_0x1ca209['has'](_0x1f6052))continue;const _0x39dc65=_0x1f6052[_0x4dd6d0(0x167)]('/');let _0x4ca07f='';for(const _0x5392ad of _0x39dc65){_0x4ca07f=_0x4ca07f?_0x4ca07f+'/'+_0x5392ad:_0x5392ad,!_0x1ca209[_0x4dd6d0(0x1c5)](_0x4ca07f)&&_0x5caad5['add'](_0x4ca07f);}}return _0x5caad5;}export function parseAndClassifyYamlFiles(_0x5707c4,_0x56335c,_0x5e94ac){const _0x724cf2=a159_0x34a518,_0x90cad0=[],_0x16623d=[];for(const _0x320c20 of _0x5707c4){const _0xe0d983=a159_0x4930b8[_0x724cf2(0x10f)](_0x56335c,a159_0x4930b8[_0x724cf2(0x177)](_0x320c20)),_0x3356a2=_0xe0d983==='.'?'':_0xe0d983[_0x724cf2(0x12f)](/\\/g,'/'),_0x90c0ae=readFileSync(_0x320c20,_0x724cf2(0x11a)),_0x196e2e=a159_0xb9525d[_0x724cf2(0x15e)](_0x90c0ae);if(isJourneyDef(_0x196e2e,_0x320c20)){const _0x166c1e=a159_0x1e2933(_0x90c0ae);_0x16623d[_0x724cf2(0x1eb)]({'yamlConfig':_0x166c1e,'folderPath':_0x3356a2,'sourcePath':_0x320c20});}else{if(!_0x5e94ac?.[_0x724cf2(0x157)]){const _0x4f0a36=parseSegmentYamlFile(_0x90c0ae),_0x35d65f=normalizeChildSegmentYaml(_0x4f0a36);_0x90cad0['push']({'yamlConfig':_0x35d65f,'folderPath':_0x3356a2,'sourcePath':_0x320c20});}}}return{'segments':_0x90cad0,'journeys':_0x16623d};}export function validateParsedFiles(_0x264626,_0x6a6478){const _0x24d07d=a159_0x34a518,_0x114028=[];for(const {yamlConfig:_0xf5acf2,sourcePath:_0x1a151b}of _0x264626['segments']){const _0x53eccb=readFileSync(_0x1a151b,_0x24d07d(0x11a)),_0x23bf4f=a159_0xb9525d[_0x24d07d(0x1f7)](_0x53eccb),_0x50d910=validateSegmentDef(_0xf5acf2,{'source':_0x53eccb,'document':_0x23bf4f},{'skipSchema':!![]});if(!_0x50d910[_0x24d07d(0x149)]){const _0x34f354=a159_0x4930b8[_0x24d07d(0x10f)](_0x6a6478,_0x1a151b);_0x114028[_0x24d07d(0x1eb)]({'filePath':_0x34f354,'source':_0x53eccb,'result':_0x50d910,'isJourney':![]});}}for(const {yamlConfig:_0xc75101,sourcePath:_0x71e95c}of _0x264626['journeys']){const _0x1c8b58=readFileSync(_0x71e95c,_0x24d07d(0x11a)),_0x3d3c2d=a159_0xb9525d[_0x24d07d(0x1f7)](_0x1c8b58),_0x1dc19d=validateJourneyDef(_0xc75101,{'source':_0x1c8b58,'document':_0x3d3c2d},{'skipSchema':!![]});if(!_0x1dc19d[_0x24d07d(0x149)]){const _0x499815=a159_0x4930b8['relative'](_0x6a6478,_0x71e95c);_0x114028['push']({'filePath':_0x499815,'source':_0x1c8b58,'result':_0x1dc19d,'isJourney':!![]});}}return _0x114028;}export function formatValidationErrors(_0x1cf9e1){const _0x12434c=a159_0x34a518,_0xbbe672=[];for(const {filePath:_0x14354b,source:_0x30d594,result:_0x4cf857,isJourney:_0x337bd5}of _0x1cf9e1){const _0x2692ba=_0x337bd5?'journey':_0x12434c(0x163);_0xbbe672[_0x12434c(0x1eb)]('\x0a'+_0x14354b+'\x20('+_0x2692ba+_0x12434c(0x1b4)+_0x4cf857[_0x12434c(0x156)]['length']+_0x12434c(0x160)),_0xbbe672['push'](formatValidationResult(_0x4cf857,_0x30d594,_0x14354b));}return _0xbbe672['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x5588a6){const _0x3d0a6b=a159_0x34a518,_0x24c331=new Set(),_0x1d476a=new Map(),_0x413fc3=collectSegmentUsageCounts(_0x5588a6);if(_0x5588a6[_0x3d0a6b(0x115)])for(const [_0x251a9a,_0xa1a2d7]of Object[_0x3d0a6b(0x147)](_0x5588a6['segments'])){_0x24c331['add'](_0x251a9a);if(_0xa1a2d7[_0x3d0a6b(0x185)]){const _0x1e9845=yamlRuleToApi(_0xa1a2d7[_0x3d0a6b(0x185)]),_0x18bfed=apiRuleToYaml(_0x1e9845);_0x1d476a[_0x3d0a6b(0x148)](_0x251a9a,_0x18bfed);}}const _0x39befb=new Map();let _0x29911b=0x0;for(const [_0x401f68,_0x11bc81]of _0x1d476a){const _0x2ea3af=serializeExpandedRule(_0x11bc81,_0x1d476a),_0x302de6=_0x39befb[_0x3d0a6b(0x197)](_0x2ea3af)||[];_0x302de6[_0x3d0a6b(0x1eb)]({'name':_0x401f68,'index':_0x29911b}),_0x39befb['set'](_0x2ea3af,_0x302de6),_0x29911b++;}const _0x164127=new Map();for(const [_0x14979c,_0x39d85c]of _0x39befb){const _0x576f34=_0x39d85c['slice']()[_0x3d0a6b(0x143)]((_0x310a6b,_0xa2720a)=>{const _0x527b83=_0x3d0a6b,_0x51769d=_0x413fc3[_0x527b83(0x197)](_0x310a6b['name'])||0x0,_0x5c6956=_0x413fc3[_0x527b83(0x197)](_0xa2720a[_0x527b83(0x17f)])||0x0;if(_0x51769d!==_0x5c6956)return _0x5c6956-_0x51769d;return _0x310a6b[_0x527b83(0x17c)]-_0xa2720a['index'];})[_0x3d0a6b(0x155)](_0xc6152e=>_0xc6152e['name']),_0xba8e88=[];for(const _0x36a6a3 of _0x576f34){const _0x3ca1a2=_0x413fc3[_0x3d0a6b(0x197)](_0x36a6a3)||0x0,_0xeb60b4=Math[_0x3d0a6b(0x1be)](_0x3ca1a2,0x1);for(let _0x10d4cb=0x0;_0x10d4cb<_0xeb60b4;_0x10d4cb++){_0xba8e88['push'](_0x36a6a3);}}_0x164127[_0x3d0a6b(0x148)](_0x14979c,_0xba8e88);}return{'existingLocalSegmentNames':_0x24c331,'localSegmentRules':_0x1d476a,'localExpandedRuleToNames':_0x164127};}export function createSegmentIdResolver(_0x529a4b,_0x2cff07){return async _0x30a902=>{const _0x188dff=a159_0x2ae9,_0x20f9b7=_0x529a4b[_0x188dff(0x197)](_0x30a902);if(!_0x20f9b7)throw new SDKError(ErrorCode[_0x188dff(0x151)],_0x188dff(0x121)+_0x30a902+_0x188dff(0x1cf)+_0x2cff07+'\x27)');return _0x20f9b7;};}export function extractRootFolderId(_0x203a82){const _0x17d840=a159_0x34a518;return _0x203a82[_0x17d840(0x1d2)]?.[_0x17d840(0x1a7)]?.[_0x17d840(0x1ed)]?.['id']||_0x203a82['relationships']?.[_0x17d840(0x17e)]?.[_0x17d840(0x1ed)]?.['id'];}export function buildConnectionMaps(_0x1619ce){const _0x430afb=a159_0x34a518,_0x552b1a=new Map(),_0x1b9fb4=new Map(),_0x1fea94=new Map();for(const _0xb2966 of _0x1619ce){_0x552b1a[_0x430afb(0x148)](_0xb2966[_0x430afb(0x17f)],parseInt(_0xb2966['id'],0xa)),_0x1b9fb4[_0x430afb(0x148)](_0xb2966['id'],_0xb2966[_0x430afb(0x17f)]),_0x1fea94[_0x430afb(0x148)](_0xb2966[_0x430afb(0x17f)],_0xb2966['type']);}return{'nameToId':_0x552b1a,'idToName':_0x1b9fb4,'nameToType':_0x1fea94};}export function calculatePushStats(_0x2e12b6,_0x499108,_0x1af619,_0x24b4c4,_0x44ccd2,_0x3d29d6,_0x3e281f){const _0x412d0c=a159_0x34a518,_0x2cee87=_0x2e12b6[_0x412d0c(0x1fc)](_0x4bf3e1=>_0x4bf3e1['isNew']),_0x5e22a7=_0x2e12b6['filter'](_0x1d05ee=>!_0x1d05ee[_0x412d0c(0x164)]&&_0x1d05ee['hasChanges']),_0x57c929=_0x2e12b6['filter'](_0x4a370c=>!_0x4a370c[_0x412d0c(0x164)]&&!_0x4a370c[_0x412d0c(0x1f9)]),_0x5293b0=_0x3d29d6?_0x24b4c4:[],_0x2fcf36=_0x499108[_0x412d0c(0x1fc)](_0x186ead=>_0x186ead['isNew']),_0x53985e=_0x499108[_0x412d0c(0x1fc)](_0x3a04a3=>!_0x3a04a3[_0x412d0c(0x164)]&&_0x3a04a3['hasChanges']),_0x220cf8=_0x499108[_0x412d0c(0x1fc)](_0x587e56=>!_0x587e56[_0x412d0c(0x164)]&&!_0x587e56[_0x412d0c(0x1f9)]),_0x373601=_0x3d29d6?_0x44ccd2:[],_0x2d8fbd=_0x2e12b6[_0x412d0c(0x10d)](_0x1df999=>_0x1df999[_0x412d0c(0x190)]),_0x1e5977=_0x2d8fbd[_0x412d0c(0x1fc)](_0x3f825b=>_0x3f825b[_0x412d0c(0x152)]===_0x412d0c(0x1a3)),_0x1c669b=_0x2d8fbd[_0x412d0c(0x1fc)](_0x2f099b=>_0x2f099b[_0x412d0c(0x152)]==='update'),_0x4b5837=_0x2d8fbd[_0x412d0c(0x1fc)](_0x2dcf93=>_0x2dcf93[_0x412d0c(0x152)]==='delete'),_0x25e2ff=Array[_0x412d0c(0x19c)](_0x1af619)['sort'](),_0x503393=_0x3e281f?![]:_0x2cee87['length']>0x0||_0x5e22a7['length']>0x0||_0x5293b0[_0x412d0c(0x116)]>0x0,_0x1ba823=_0x2fcf36[_0x412d0c(0x116)]>0x0||_0x53985e[_0x412d0c(0x116)]>0x0||_0x373601[_0x412d0c(0x116)]>0x0,_0xd28255=_0x3e281f?![]:_0x2d8fbd[_0x412d0c(0x116)]>0x0,_0x106959=_0x25e2ff[_0x412d0c(0x116)]>0x0;return{'segments':{'new':_0x2cee87,'changed':_0x5e22a7,'unchanged':_0x57c929,'toDelete':_0x5293b0},'journeys':{'new':_0x2fcf36,'changed':_0x53985e,'unchanged':_0x220cf8,'toDelete':_0x373601},'activations':{'all':_0x2d8fbd,'toCreate':_0x1e5977,'toUpdate':_0x1c669b,'toDelete':_0x4b5837},'folders':{'toCreate':_0x25e2ff},'counts':{'segments':{'new':_0x2cee87['length'],'changed':_0x5e22a7[_0x412d0c(0x116)],'unchanged':_0x57c929[_0x412d0c(0x116)],'toDelete':_0x5293b0[_0x412d0c(0x116)]},'journeys':{'new':_0x2fcf36[_0x412d0c(0x116)],'changed':_0x53985e[_0x412d0c(0x116)],'unchanged':_0x220cf8[_0x412d0c(0x116)],'toDelete':_0x373601[_0x412d0c(0x116)]},'activations':{'create':_0x1e5977['length'],'update':_0x1c669b[_0x412d0c(0x116)],'delete':_0x4b5837[_0x412d0c(0x116)]},'folders':_0x25e2ff[_0x412d0c(0x116)]},'hasChanges':_0x503393||_0x1ba823||_0xd28255||_0x106959};}export async function buildPushExecutionContext(_0xa14563,_0xd4a49e,_0x50ee23,_0x384a40,_0x3c584f,_0x1ee596){const _0x2d5357=a159_0x34a518,_0x1f24d2=extractRootFolderId(_0x50ee23),{pathToId:_0x4e04b0,idToPath:_0x11955d}=buildFolderMaps(_0x3c584f),_0x466f80=buildSegmentNameToIdMap(_0x384a40),_0x2859d6=new Map(),{batchAsync:_0x3a9724}=await import(_0x2d5357(0x176)),[_0x3da6ad,_0x1f8f82]=await Promise[_0x2d5357(0x1e2)]([_0xa14563[_0x2d5357(0x1b2)]['buildUserMaps'](),_0xa14563['connection'][_0x2d5357(0x14b)](),((async()=>{const _0x10365e=_0x2d5357;!_0x1ee596&&_0x384a40[_0x10365e(0x116)]>0x0&&await _0x3a9724(_0x384a40,async _0x31bca7=>{const _0x1af3e9=_0x10365e,_0x31dea2=await _0xa14563[_0x1af3e9(0x163)][_0x1af3e9(0x209)](_0xd4a49e,_0x31bca7['id']);_0x2859d6['set'](_0x31bca7['id'],_0x31dea2);});})())]),{emailToId:_0x221b6e,idToEmail:_0x251649}=_0x3da6ad,_0x299ae2=buildConnectionMaps(_0x1f8f82);return{'rootFolderId':_0x1f24d2,'folderPathToId':_0x4e04b0,'folderIdToPath':_0x11955d,'segmentNameToId':_0x466f80,'activationsBySegmentId':_0x2859d6,'emailToIdMap':_0x221b6e,'idToEmailMap':_0x251649,'connectionNameToIdMap':_0x299ae2['nameToId'],'connectionIdToNameMap':_0x299ae2[_0x2d5357(0x205)],'connectionNameToTypeMap':_0x299ae2['nameToType']};}export function createPushYamlContextForBundle(_0x3a6795,_0x2feda8,_0x2c8816,_0x50dcea,_0xdbc8ae,_0x7a7d70,_0x56efd1,_0x34770c){const {existingLocalSegmentNames:_0x2ad87c,localExpandedRuleToNames:_0xc76099}=_0x50dcea,_0xc8e1f0=new Set(),_0x286350=new Map(),_0xc0fe48=new Map(),_0xbf5c44=new Map(),_0x2db5ac=createJumpTargetCache(),_0x489b7f=new Map(),_0x220f5b=new Map(),_0x51a960=new Set();let _0x5248b5;const _0x3f83fa=_0x298e0a=>{const _0x71ed76={'resolveSegment':async _0x377cc3=>{const _0x44175d=a159_0x2ae9,_0x29e88c=_0xbf5c44[_0x44175d(0x197)](_0x377cc3);if(_0x29e88c!==undefined)return{'name':_0x29e88c,'isJourneyLocal':!![]};try{const _0x1149c5=await fetchSegment(_0x3a6795,_0x2feda8,_0x377cc3,_0x2c8816);if(!_0x1149c5)throw new Error(_0x44175d(0x13a));const _0x429cd9=generateJourneyLocalName(_0x1149c5[_0x44175d(0x17f)]),_0x156570=_0x1149c5[_0x44175d(0x1d5)]===SEGMENT_KIND_JOURNEY&&_0x429cd9!==undefined;let _0x3b8fbe=_0x1149c5[_0x44175d(0x17f)],_0x26e587;if(_0x156570&&_0x1149c5[_0x44175d(0x185)]){const _0x5e03d6=apiRuleToYaml(_0x1149c5['rule']);_0x220f5b[_0x44175d(0x148)](_0x377cc3,_0x5e03d6);const _0x25a437=async _0xb7a035=>{const _0x2be817=_0x44175d,_0x2a70c0=collectSegmentRefsFromRule(_0xb7a035);for(const _0x356a2b of _0x2a70c0){if(!_0x220f5b['has'](_0x356a2b))try{const _0x23bcb6=await fetchSegment(_0x3a6795,_0x2feda8,_0x356a2b,_0x2c8816);if(_0x23bcb6?.[_0x2be817(0x185)]){const _0x47d382=apiRuleToYaml(_0x23bcb6[_0x2be817(0x185)]);_0x220f5b[_0x2be817(0x148)](_0x356a2b,_0x47d382),await _0x25a437(_0x47d382);}}catch(_0x3147e9){logger[_0x2be817(0x1e3)](_0x2be817(0x1cc)+_0x356a2b+':\x20'+_0x3147e9);}}};await _0x25a437(_0x5e03d6);const _0x4cc2ae=serializeExpandedRule(_0x5e03d6,_0x220f5b),_0x43cee8=_0xc76099['get'](_0x4cc2ae);if(_0x43cee8&&_0x43cee8[_0x44175d(0x116)]>0x0){const _0x353d2e=_0x286350[_0x44175d(0x197)](_0x4cc2ae)||0x0,_0x52d9ea=_0x43cee8[_0x353d2e]||_0x43cee8[_0x43cee8['length']-0x1];_0x286350[_0x44175d(0x148)](_0x4cc2ae,_0x353d2e+0x1),_0x3b8fbe=_0x52d9ea,_0xc8e1f0[_0x44175d(0x15f)](_0x3b8fbe),_0xbf5c44[_0x44175d(0x148)](_0x377cc3,_0x3b8fbe);const _0x88dc3d=await resolveRuleSegmentRefs(_0x5e03d6,async _0x5457e4=>{const _0xade1cd=_0x44175d,_0x405e6b=_0xbf5c44[_0xade1cd(0x197)](_0x5457e4);if(_0x405e6b)return _0x405e6b;const _0x2ab62b=await _0x5248b5['resolveSegment'](_0x5457e4);return _0x2ab62b['name'];});_0x26e587={'description':_0x1149c5[_0x44175d(0x1a4)],'rule':_0x88dc3d};}else{const _0xdc6123=_0x489b7f[_0x44175d(0x197)](_0x4cc2ae);if(_0xdc6123)_0x3b8fbe=_0xdc6123,_0xbf5c44[_0x44175d(0x148)](_0x377cc3,_0x3b8fbe);else{if(_0x429cd9){let _0x41e9aa=_0x429cd9,_0x42c299=0x2;while(_0xc8e1f0[_0x44175d(0x1c5)](_0x41e9aa)||_0x2ad87c[_0x44175d(0x1c5)](_0x41e9aa)){_0x41e9aa=_0x429cd9+'_'+_0x42c299,_0x42c299++;}_0xc8e1f0[_0x44175d(0x15f)](_0x41e9aa),_0x3b8fbe=_0x41e9aa;}_0xbf5c44[_0x44175d(0x148)](_0x377cc3,_0x3b8fbe),_0x489b7f[_0x44175d(0x148)](_0x4cc2ae,_0x3b8fbe);const _0x3fb064=await resolveRuleSegmentRefs(_0x5e03d6,async _0x46451c=>{const _0x23ec18=_0x44175d,_0x5df218=_0xbf5c44[_0x23ec18(0x197)](_0x46451c);if(_0x5df218)return _0x5df218;const _0x59e05f=await _0x5248b5[_0x23ec18(0x204)](_0x46451c);return _0x59e05f[_0x23ec18(0x17f)];});_0x26e587={'description':_0x1149c5[_0x44175d(0x1a4)],'rule':_0x3fb064};}}}return{'name':_0x3b8fbe,'isJourneyLocal':_0x156570,'definition':_0x26e587};}catch(_0x59c6c5){return logger[_0x44175d(0x1e3)]('Failed\x20to\x20resolve\x20segment\x20'+_0x377cc3+':\x20'+_0x59c6c5),{'name':_0x377cc3,'isJourneyLocal':![]};}},'resolveActivation':async _0x584719=>{const _0x26ac49=a159_0x2ae9,_0x492091=_0xc0fe48[_0x26ac49(0x197)](_0x584719);if(_0x492091!==undefined)return{'name':_0x492091,'isJourneyLocal':!![]};try{let _0x52340c=_0x56efd1?.[_0x26ac49(0x197)](_0x584719);!_0x52340c&&(_0x52340c=await _0x3a6795[_0x26ac49(0x113)][_0x26ac49(0x1f2)](_0x298e0a,_0x584719));const _0xd79454=_0x52340c[_0x26ac49(0x18d)][_0x26ac49(0x1e6)]['name']||_0x584719,_0x336b14=sanitizeYamlKey(_0xd79454)||'activation_'+_0x584719,_0x3b1e44=_0x336b14;_0xc0fe48[_0x26ac49(0x148)](_0x584719,_0x3b1e44);const _0x1c3d91=journeyActivationStepToYaml(_0x52340c,_0xdbc8ae,_0x7a7d70);return{'name':_0x3b1e44,'isJourneyLocal':!![],'definition':_0x1c3d91};}catch(_0x34d162){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x584719+':\x20'+_0x34d162),{'name':_0x584719,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x6a083a,_0x41da75)=>resolveJumpTarget(_0x6a083a,_0x41da75,_0x2db5ac,async _0x4d87ac=>{const _0x2ffcb0=a159_0x2ae9,_0x25610c=_0x34770c?.[_0x2ffcb0(0x197)](_0x4d87ac);if(_0x25610c)return _0x25610c;return _0x3a6795[_0x2ffcb0(0x113)][_0x2ffcb0(0x188)](_0x4d87ac);})};return _0x5248b5=_0x71ed76,_0x71ed76;},_0x3b472e=async _0x139d60=>{const _0xb06fad=a159_0x2ae9,{collectSegmentIdsFromJourneyApi:_0x2e8bf8}=await import(_0xb06fad(0x1df)),{batchAsync:_0x2a08db}=await import(_0xb06fad(0x176)),_0x3ad36a=new Set();for(const _0x1755ce of _0x139d60){let _0x105303=_0x34770c?.[_0xb06fad(0x197)](_0x1755ce);!_0x105303&&(_0x105303=await _0x3a6795[_0xb06fad(0x113)]['getJourney'](_0x1755ce));const _0x4e6b9e=_0x2e8bf8(_0x105303);for(const _0x2ef5eb of _0x4e6b9e){_0x3ad36a[_0xb06fad(0x15f)](_0x2ef5eb);}}let _0x107e68=Array[_0xb06fad(0x19c)](_0x3ad36a);while(_0x107e68[_0xb06fad(0x116)]>0x0){const _0x370157=_0x107e68[_0xb06fad(0x1fc)](_0x39b261=>!_0x51a960[_0xb06fad(0x1c5)](_0x39b261));if(_0x370157[_0xb06fad(0x116)]===0x0)break;const _0x2248ef=await _0x2a08db(_0x370157,async _0x286cef=>{const _0x1f803b=_0xb06fad;_0x51a960[_0x1f803b(0x15f)](_0x286cef);const _0x2bc4a5=await fetchSegment(_0x3a6795,_0x2feda8,_0x286cef,_0x2c8816);if(!_0x2bc4a5)return null;return{'segmentId':_0x286cef,'segment':_0x2bc4a5};},0xa),_0x34fe67=new Set();for(const _0x274a37 of _0x2248ef){if(!_0x274a37?.[_0xb06fad(0x163)]?.[_0xb06fad(0x185)])continue;const _0x5c7e48=apiRuleToYaml(_0x274a37[_0xb06fad(0x163)][_0xb06fad(0x185)]);_0x220f5b['set'](_0x274a37[_0xb06fad(0x12d)],_0x5c7e48);const _0x58f685=collectSegmentRefsFromRule(_0x5c7e48);for(const _0x341eaa of _0x58f685){!_0x51a960[_0xb06fad(0x1c5)](_0x341eaa)&&_0x34fe67[_0xb06fad(0x15f)](_0x341eaa);}}_0x107e68=Array[_0xb06fad(0x19c)](_0x34fe67);}};return{'createYamlContext':_0x3f83fa,'prefetchJourneySegments':_0x3b472e};}export async function executePushSegments(_0x26856e,_0x6e2aa8,_0x1261da,_0x5791a8,_0xc2dd1b){const _0x51d0c9=a159_0x34a518,{segmentDefToCreateRequest:_0x1221a6,segmentDefToUpdateRequest:_0xdeee81}=await import(_0x51d0c9(0x11e)),_0x35a60=_0x1261da[_0x51d0c9(0x16d)],_0x52827d=0x5,_0x4fbfb5=async _0x2d84bc=>{const _0x5e48d9=_0x51d0c9,_0x31fa91=_0x2d84bc['folderPath']?_0x35a60[_0x5e48d9(0x197)](_0x2d84bc['folderPath']):undefined;let _0x30918b;const _0x6c4d37={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x543d72=_0x2d84bc[_0x5e48d9(0x124)];if(_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x185)]){const _0x55c9d4=createSegmentIdResolver(_0x1261da['segmentNameToId'],_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]),_0x21f1dd=await resolveRuleSegmentIds(_0x2d84bc['yamlConfig'][_0x5e48d9(0x185)],_0x55c9d4);_0x543d72={..._0x2d84bc['yamlConfig'],'rule':_0x21f1dd};}try{if(_0x2d84bc['isNew']){_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':'segment_creating','name':_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]});const _0x955548=_0x1221a6(_0x543d72,_0x31fa91),_0x1dfd4c=await _0xc2dd1b['withProgress']('Creating\x20segment\x20\x27'+_0x2d84bc[_0x5e48d9(0x124)]['name']+_0x5e48d9(0x12b),()=>_0x26856e[_0x5e48d9(0x163)]['createSegment'](_0x5791a8[_0x5e48d9(0x1db)],_0x955548));_0x30918b=_0x1dfd4c[_0x5e48d9(0x1ed)]['id'],_0x1261da[_0x5e48d9(0x13f)][_0x5e48d9(0x148)](_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)],_0x30918b),_0x6c4d37[_0x5e48d9(0x11c)]={'name':_0x2d84bc['yamlConfig']['name'],'id':_0x30918b},_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':_0x5e48d9(0x182),'name':_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)],'segmentId':_0x30918b}),_0xc2dd1b[_0x5e48d9(0x130)]?.(_0x5e48d9(0x180)+_0x2d84bc['yamlConfig'][_0x5e48d9(0x17f)]+'\x27'),_0x6c4d37[_0x5e48d9(0x123)]=0x1;}else{if(_0x2d84bc[_0x5e48d9(0x1f9)]){_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':_0x5e48d9(0x131),'name':_0x2d84bc[_0x5e48d9(0x124)]['name']});const _0x50221b=_0xdeee81(_0x543d72);_0x31fa91!==_0x2d84bc[_0x5e48d9(0x169)]?.['segmentFolderId']&&(_0x50221b['segmentFolderId']=_0x31fa91?parseInt(_0x31fa91,0xa):undefined),await _0xc2dd1b[_0x5e48d9(0x1d4)](_0x5e48d9(0x146)+_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]+_0x5e48d9(0x12b),()=>_0x26856e[_0x5e48d9(0x163)][_0x5e48d9(0x1f6)](_0x5791a8[_0x5e48d9(0x1db)],_0x2d84bc['existingSegment']['id'],_0x50221b)),_0x30918b=_0x2d84bc['existingSegment']['id'],_0xc2dd1b[_0x5e48d9(0x1a6)]?.({'type':_0x5e48d9(0x153),'name':_0x2d84bc[_0x5e48d9(0x124)]['name']}),_0xc2dd1b[_0x5e48d9(0x130)]?.(_0x5e48d9(0x114)+_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)]+'\x27'),_0x6c4d37['updated']=0x1;}else _0x30918b=_0x2d84bc[_0x5e48d9(0x169)]['id'];}}catch(_0x8884ec){const _0x27d629=isHttp400Error(_0x8884ec),_0x5e707d=_0x27d629?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x5e48d9(0x189)],_0x537e7b=getErrorMessage(_0x8884ec);throw new SDKError(_0x5e707d,_0x5e48d9(0x16a)+(_0x2d84bc[_0x5e48d9(0x164)]?_0x5e48d9(0x1a3):_0x5e48d9(0x1d7))+_0x5e48d9(0x1b7)+_0x2d84bc['absolutePath']+'\x0a\x20\x20'+_0x537e7b,_0x8884ec);}try{const _0x2cc918=await syncActivationsForSegment(_0x26856e,_0x5791a8['parentId'],_0x30918b,_0x2d84bc[_0x5e48d9(0x124)][_0x5e48d9(0x17f)],_0x2d84bc[_0x5e48d9(0x190)],_0xc2dd1b,_0x2d84bc[_0x5e48d9(0x206)]);_0x6c4d37['activations']=_0x2cc918;}catch(_0x39b8f9){if(_0x39b8f9 instanceof SDKError)throw _0x39b8f9;throw new SDKError(ErrorCode[_0x5e48d9(0x14c)],_0x5e48d9(0x191)+_0x2d84bc[_0x5e48d9(0x124)]['name']+'\x27\x20from\x20file:\x20'+_0x2d84bc['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x39b8f9),_0x39b8f9);}return _0x6c4d37;},_0xd70414=await batchAsync(_0x6e2aa8,_0x4fbfb5,_0x52827d),_0x3feb06={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xe36169 of _0xd70414){_0x3feb06[_0x51d0c9(0x123)]+=_0xe36169[_0x51d0c9(0x123)],_0x3feb06['updated']+=_0xe36169[_0x51d0c9(0x1cd)],_0xe36169[_0x51d0c9(0x11c)]&&_0x3feb06[_0x51d0c9(0x1f5)][_0x51d0c9(0x148)](_0xe36169[_0x51d0c9(0x11c)][_0x51d0c9(0x17f)],_0xe36169[_0x51d0c9(0x11c)]['id']),_0x3feb06[_0x51d0c9(0x126)][_0x51d0c9(0x123)]+=_0xe36169['activations'][_0x51d0c9(0x123)],_0x3feb06[_0x51d0c9(0x126)][_0x51d0c9(0x1cd)]+=_0xe36169[_0x51d0c9(0x126)][_0x51d0c9(0x1cd)],_0x3feb06[_0x51d0c9(0x126)]['deleted']+=_0xe36169[_0x51d0c9(0x126)][_0x51d0c9(0x141)];}return _0x3feb06;}async function syncActivationsForSegment(_0x51a454,_0x44852e,_0x53ca19,_0xe872f8,_0x5b9b90,_0x14fe73,_0x375735){const _0x270724=a159_0x34a518,_0x7b2ac0={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5b5fd3 of _0x5b9b90){try{if(_0x5b5fd3['type']===_0x270724(0x1a3)&&_0x5b5fd3[_0x270724(0x20b)])_0x14fe73['onProgress']?.({'type':_0x270724(0x1b5),'segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),await _0x14fe73[_0x270724(0x1d4)](_0x270724(0x1d3)+_0x5b5fd3[_0x270724(0x17f)]+_0x270724(0x12b),()=>_0x51a454[_0x270724(0x163)][_0x270724(0x111)](_0x44852e,_0x53ca19,_0x5b5fd3[_0x270724(0x20b)])),_0x14fe73[_0x270724(0x1a6)]?.({'type':_0x270724(0x200),'segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),_0x14fe73[_0x270724(0x130)]?.('Created\x20activation\x20\x27'+_0x5b5fd3[_0x270724(0x17f)]+'\x27'),_0x7b2ac0[_0x270724(0x123)]++;else{if(_0x5b5fd3[_0x270724(0x152)]===_0x270724(0x1d7)&&_0x5b5fd3[_0x270724(0x20b)]&&_0x5b5fd3['existingActivation'])_0x14fe73['onProgress']?.({'type':'activation_updating','segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),await _0x14fe73[_0x270724(0x1d4)](_0x270724(0x17d)+_0x5b5fd3[_0x270724(0x17f)]+'\x27...',()=>_0x51a454[_0x270724(0x163)]['updateActivation'](_0x44852e,_0x53ca19,_0x5b5fd3['existingActivation']['id'],_0x5b5fd3[_0x270724(0x20b)])),_0x14fe73['onProgress']?.({'type':'activation_updated','segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),_0x14fe73[_0x270724(0x130)]?.(_0x270724(0x1aa)+_0x5b5fd3['name']+'\x27'),_0x7b2ac0['updated']++;else _0x5b5fd3[_0x270724(0x152)]===_0x270724(0x171)&&_0x5b5fd3['existingActivation']&&(_0x14fe73[_0x270724(0x1a6)]?.({'type':'activation_deleting','segmentName':_0xe872f8,'activationName':_0x5b5fd3['name']}),await _0x14fe73['withProgress'](_0x270724(0x174)+_0x5b5fd3['name']+'\x27...',()=>_0x51a454[_0x270724(0x163)][_0x270724(0x1ea)](_0x44852e,_0x53ca19,_0x5b5fd3[_0x270724(0x18c)]['id'])),_0x14fe73['onProgress']?.({'type':_0x270724(0x138),'segmentName':_0xe872f8,'activationName':_0x5b5fd3[_0x270724(0x17f)]}),_0x14fe73[_0x270724(0x18a)]?.('Deleted\x20activation\x20\x27'+_0x5b5fd3[_0x270724(0x17f)]+'\x27'),_0x7b2ac0['deleted']++);}}catch(_0x49dc7f){const _0x1ad56a=isHttp400Error(_0x49dc7f),_0x2408d8=_0x1ad56a?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x44f3ea=getErrorMessage(_0x49dc7f);throw new SDKError(_0x2408d8,_0x270724(0x16a)+_0x5b5fd3[_0x270724(0x152)]+_0x270724(0x170)+_0x5b5fd3[_0x270724(0x17f)]+_0x270724(0x161)+_0x375735+_0x270724(0x20d)+_0x44f3ea,_0x49dc7f);}}return _0x7b2ac0;}export async function executePushFolders(_0x5c8809,_0x56c8a7,_0x17bf9d,_0x352ba2,_0x8ebfb2){const _0x3f5ce5=a159_0x34a518,_0x70f73e=new Map(_0x17bf9d),_0x24a1bb=sortFoldersByDepth(_0x56c8a7);for(const _0x2745df of _0x24a1bb){const _0x5bbd21=_0x2745df[_0x3f5ce5(0x167)]('/'),_0x1e2756=_0x5bbd21[_0x5bbd21[_0x3f5ce5(0x116)]-0x1],_0xa2ab51=_0x5bbd21['slice'](0x0,-0x1)['join']('/'),_0x47e288=_0x70f73e[_0x3f5ce5(0x197)](_0xa2ab51);_0x8ebfb2[_0x3f5ce5(0x1a6)]?.({'type':'folder_creating','folder':_0x2745df});const _0x5c503b={'name':_0x1e2756,'parentFolderId':_0x47e288},_0x573185=await _0x8ebfb2['withProgress'](_0x3f5ce5(0x1ff)+_0x2745df+_0x3f5ce5(0x12b),()=>_0x5c8809[_0x3f5ce5(0x163)]['createFolder'](_0x352ba2['parentId'],_0x5c503b));_0x70f73e['set'](_0x2745df,_0x573185[_0x3f5ce5(0x1ed)]['id']),_0x8ebfb2[_0x3f5ce5(0x1a6)]?.({'type':_0x3f5ce5(0x134),'folder':_0x2745df,'folderId':_0x573185[_0x3f5ce5(0x1ed)]['id']}),_0x8ebfb2[_0x3f5ce5(0x1bc)]?.(_0x3f5ce5(0x1c6)+_0x2745df+'\x27');}return _0x70f73e;}export async function executePushSegmentDeletions(_0x3281b0,_0x478541,_0x26c8dc){const _0x53eea2=a159_0x34a518;if(_0x478541[_0x53eea2(0x116)]===0x0)return 0x0;const {batchAsync:_0x340193}=await import(_0x53eea2(0x176)),_0x22773a=0x5,_0x3edfad=await _0x340193(_0x478541,async _0x37c607=>{const _0x34ce83=_0x53eea2;return _0x26c8dc['onProgress']?.({'type':'segment_deleting','name':_0x37c607['name']}),await _0x3281b0[_0x34ce83(0x163)][_0x34ce83(0x1a5)](_0x37c607['id']),_0x26c8dc[_0x34ce83(0x1a6)]?.({'type':_0x34ce83(0x1fb),'name':_0x37c607[_0x34ce83(0x17f)]}),_0x26c8dc[_0x34ce83(0x18a)]?.(_0x34ce83(0x1c9)+_0x37c607[_0x34ce83(0x17f)]+'\x27'),0x1;},_0x22773a);return _0x3edfad[_0x53eea2(0x1b9)]((_0x4db6c8,_0x48c05c)=>_0x4db6c8+_0x48c05c,0x0);}export async function executePushJourneys(_0x45c351,_0x49c271,_0x295703,_0x233b1c,_0x1eb3b0){const _0x3d6286=a159_0x34a518,{journeyDefToRequest:_0x499b4f}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x558fff,yamlRuleToApi:_0x19360f,validateSegmentRule:_0x11c323}=await import('./child-segment-yaml.js'),_0x8cb18={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x42b513=new Map(_0x295703['segmentNameToId']),_0x68c83b=0x5;for(let _0x4d1e7f=0x0;_0x4d1e7f<_0x49c271[_0x3d6286(0x116)];_0x4d1e7f+=_0x68c83b){const _0x547335=_0x49c271[_0x3d6286(0x1c0)](_0x4d1e7f,_0x4d1e7f+_0x68c83b),_0x1c1f58=await Promise['all'](_0x547335['map'](async _0xfb8c1a=>{const _0x38f03d=_0x3d6286;if(!_0xfb8c1a['isNew']&&!_0xfb8c1a[_0x38f03d(0x1f9)])return{'action':_0x38f03d(0x10e),'name':_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)],'journeyId':_0xfb8c1a[_0x38f03d(0x110)]?.['id']};const _0x2c3640=_0xfb8c1a['folderPath']?_0x295703[_0x38f03d(0x16d)][_0x38f03d(0x197)](_0xfb8c1a[_0x38f03d(0x19f)]):undefined;_0x1eb3b0[_0x38f03d(0x1a6)]?.({'type':_0xfb8c1a['isNew']?_0x38f03d(0x158):_0x38f03d(0x203),'name':_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)]});try{const _0x1d24e5=await executeSingleJourneyPush(_0x45c351,_0xfb8c1a,{..._0x295703,'segmentNameToId':_0x42b513},{'parentId':_0x233b1c['parentId'],'rootFolderId':_0x233b1c[_0x38f03d(0x19e)],'folderId':_0x2c3640,'verbose':_0x233b1c[_0x38f03d(0x20f)]},_0x1eb3b0,{'journeyDefToRequest':_0x499b4f,'activationDefToCreateRequest':_0x558fff,'yamlRuleToApi':_0x19360f,'validateSegmentRule':_0x11c323});for(const [_0x3afd32,_0x1f005c]of _0x1d24e5['embeddedSegmentNameToId']){_0x42b513[_0x38f03d(0x148)](_0x3afd32,_0x1f005c),_0x8cb18['embeddedSegmentNameToId'][_0x38f03d(0x148)](_0x3afd32,_0x1f005c);}if(_0x1d24e5[_0x38f03d(0x127)]===_0x38f03d(0x123))_0x1eb3b0[_0x38f03d(0x1a6)]?.({'type':'journey_created','name':_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)],'journeyId':_0x1d24e5[_0x38f03d(0x1b6)]}),_0x1eb3b0[_0x38f03d(0x130)]?.('Created\x20journey\x20\x27'+_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)]+'\x27'),_0x8cb18[_0x38f03d(0x123)]++;else _0x1d24e5[_0x38f03d(0x127)]===_0x38f03d(0x1cd)&&(_0x1eb3b0[_0x38f03d(0x1a6)]?.({'type':'journey_updated','name':_0xfb8c1a['yamlConfig'][_0x38f03d(0x17f)]}),_0x1eb3b0[_0x38f03d(0x130)]?.('Updated\x20journey\x20\x27'+_0xfb8c1a[_0x38f03d(0x124)][_0x38f03d(0x17f)]+'\x27'),_0x8cb18[_0x38f03d(0x1cd)]++);return{'action':_0x1d24e5[_0x38f03d(0x127)],'name':_0xfb8c1a[_0x38f03d(0x124)]['name'],'journeyId':_0x1d24e5['journeyId']};}catch(_0x33326a){const _0x1d62bd=isHttp400Error(_0x33326a),_0x2b943c=_0x1d62bd?ErrorCode[_0x38f03d(0x159)]:ErrorCode[_0x38f03d(0x15c)],_0x33bda3=getErrorMessage(_0x33326a);throw new SDKError(_0x2b943c,'Failed\x20to\x20'+(_0xfb8c1a[_0x38f03d(0x164)]?_0x38f03d(0x1a3):'update')+_0x38f03d(0x1a8)+_0xfb8c1a[_0x38f03d(0x206)]+_0x38f03d(0x20d)+_0x33bda3,_0x33326a);}}));_0x8cb18[_0x3d6286(0x1d0)][_0x3d6286(0x1eb)](..._0x1c1f58);}return _0x8cb18;}async function matchExistingJourneySegments(_0x2e1da6,_0x36a1e9,_0x39b463,_0x2f7325,_0x2b3cf7){const _0xa04630=a159_0x34a518;if(!_0x36a1e9['existingJourney']||!_0x36a1e9[_0xa04630(0x124)][_0xa04630(0x115)])return;const _0x1e597b=new Map(),_0x4cc1c8=new Set();for(const _0x48c231 of Object[_0xa04630(0x122)](_0x36a1e9[_0xa04630(0x124)]['segments'])){const _0x3aa716=generateDeterministicJourneySegmentName(_0x36a1e9['yamlConfig'][_0xa04630(0x17f)],_0x48c231);_0x1e597b[_0xa04630(0x148)](_0x3aa716,_0x48c231),_0x4cc1c8[_0xa04630(0x15f)](_0x48c231);}const _0x74e446=[],_0xc5cd02=collectSegmentIdsFromJourneyApi(_0x36a1e9[_0xa04630(0x110)]);for(const _0x100731 of _0xc5cd02){const _0x8ecb13=await fetchSegment(_0x2e1da6,_0x39b463,_0x100731,_0x2f7325);if(!_0x8ecb13?.[_0xa04630(0x17f)])continue;const _0x4cdfbe=_0x1e597b['get'](_0x8ecb13[_0xa04630(0x17f)]);_0x4cdfbe?(_0x2b3cf7[_0xa04630(0x148)](_0x4cdfbe,_0x100731),_0x4cc1c8[_0xa04630(0x171)](_0x4cdfbe)):_0x74e446[_0xa04630(0x1eb)]({'id':_0x100731,'seg':_0x8ecb13});}if(_0x4cc1c8[_0xa04630(0x19a)]>0x0&&_0x74e446['length']>0x0){const {localExpandedRuleToNames:_0x1ef071}=buildLocalExpandedRuleMappings(_0x36a1e9[_0xa04630(0x124)]),_0xfb101c=new Map();for(const {id:_0x5ae34e,seg:_0x241ad7}of _0x74e446){if(_0x241ad7[_0xa04630(0x185)]){const _0x30ba18=apiRuleToYaml(_0x241ad7[_0xa04630(0x185)]);_0xfb101c[_0xa04630(0x148)](_0x5ae34e,_0x30ba18);}}for(const {id:_0xb246a2,seg:_0x5ae9dc}of _0x74e446){if(!_0x5ae9dc['rule'])continue;const _0x2ac0e4=_0xfb101c['get'](_0xb246a2);if(!_0x2ac0e4)continue;const _0xf8e7ce=serializeExpandedRule(_0x2ac0e4,_0xfb101c),_0x233ea8=_0x1ef071['get'](_0xf8e7ce);if(_0x233ea8){const _0x530d0a=_0x233ea8[_0xa04630(0x1f8)](_0x340fc9=>_0x4cc1c8[_0xa04630(0x1c5)](_0x340fc9));_0x530d0a&&(_0x2b3cf7[_0xa04630(0x148)](_0x530d0a,_0xb246a2),_0x4cc1c8[_0xa04630(0x171)](_0x530d0a),logger[_0xa04630(0x1e3)](_0xa04630(0x201)+_0x5ae9dc[_0xa04630(0x17f)]+_0xa04630(0x179)+_0x530d0a+_0xa04630(0x195)));}}}}async function executeSingleJourneyPush(_0x323f6a,_0x5baa5,_0x3a74b2,_0x3faae5,_0x286262,_0x2a4e4){const _0x2fbf79=a159_0x34a518,{journeyDefToRequest:_0x7af9b9,activationDefToCreateRequest:_0x1ebaa6,yamlRuleToApi:_0xcfabce,validateSegmentRule:_0x1d13e6}=_0x2a4e4,_0x2b71b=new Map(),_0x271866=new Map();recoverSegmentIdsFromPushRecovery(_0x5baa5,_0x2b71b,_0x3a74b2['segmentNameToId']);const _0x327584=new Map(),_0x46a99f=new Map(),_0x4098d2=new Map();let _0x4d40b2;const _0x571cd9=async()=>{const _0x1a26a9=a159_0x2ae9;if(_0x4d40b2)return;_0x4d40b2=new Map();if(!_0x5baa5[_0x1a26a9(0x110)])return;const _0x3d7516=await _0x323f6a[_0x1a26a9(0x113)][_0x1a26a9(0x209)](_0x5baa5[_0x1a26a9(0x110)]['id']);for(const _0x4ca843 of _0x3d7516){const _0x2b26ad=journeyActivationStepToYaml(_0x4ca843,_0x3a74b2[_0x1a26a9(0x15b)],_0x3a74b2[_0x1a26a9(0x1da)]),_0x3c402a=activationSignature(_0x2b26ad);!_0x4d40b2[_0x1a26a9(0x1c5)](_0x3c402a)&&_0x4d40b2[_0x1a26a9(0x148)](_0x3c402a,_0x4ca843['id']),_0x2b26ad[_0x1a26a9(0x17f)]&&_0x271866[_0x1a26a9(0x148)](_0x2b26ad['name'],_0x4ca843['id']);}};await matchExistingJourneySegments(_0x323f6a,_0x5baa5,_0x3faae5[_0x2fbf79(0x1db)],_0x3a74b2[_0x2fbf79(0x117)],_0x3a74b2['segmentNameToId']);const _0x46937c={'resolveSegmentId':async _0x33dab2=>{const _0x47a927=_0x2fbf79,_0x187272=_0x3a74b2[_0x47a927(0x13f)][_0x47a927(0x197)](_0x33dab2);if(!_0x187272)throw new SDKError(ErrorCode[_0x47a927(0x151)],_0x47a927(0x121)+_0x33dab2+'\x20(referenced\x20in\x20journey\x20'+_0x5baa5['yamlConfig'][_0x47a927(0x17f)]+')');return _0x187272;},'resolveEmbeddedSegmentId':async(_0x32abb2,_0x3ef799)=>{const _0x4927b0=_0x2fbf79,_0x391fb6=_0x3a74b2[_0x4927b0(0x13f)][_0x4927b0(0x197)](_0x32abb2);if(_0x391fb6)return _0x391fb6;const _0x2eaa4d=_0x3a74b2[_0x4927b0(0x117)][_0x4927b0(0x1f8)](_0x2563d8=>_0x2563d8['name']===_0x32abb2);if(_0x2eaa4d)return _0x3a74b2[_0x4927b0(0x13f)][_0x4927b0(0x148)](_0x32abb2,_0x2eaa4d['id']),_0x2eaa4d['id'];if(_0x5baa5[_0x4927b0(0x164)]){const {stageName:_0xdc641a,criteriaName:_0x1aa525}=findSegmentCriteriaLocation(_0x5baa5[_0x4927b0(0x124)],_0x32abb2);return _0x1d13e6(_0x32abb2,_0x3ef799[_0x4927b0(0x185)]),_0x46a99f[_0x4927b0(0x148)](_0x32abb2,{'definition':_0x3ef799,'stageName':_0xdc641a,'criteriaName':_0x1aa525}),createPendingSegmentId(_0x32abb2);}const _0x499994=_0x5baa5[_0x4927b0(0x110)]?.['id'];if(!_0x499994)throw new SDKError(ErrorCode[_0x4927b0(0x12c)],_0x4927b0(0x18b));const _0x597990=_0x327584['get'](_0x32abb2);if(_0x597990)return _0x597990;const _0x2b5396=((async()=>{const _0x12b1dd=_0x4927b0;_0x1d13e6(_0x32abb2,_0x3ef799[_0x12b1dd(0x185)]);const _0x529d47=generateDeterministicJourneySegmentName(_0x5baa5[_0x12b1dd(0x124)][_0x12b1dd(0x17f)],_0x32abb2),_0x4ddd7d=_0x3a74b2[_0x12b1dd(0x117)][_0x12b1dd(0x1f8)](_0x3e5247=>_0x3e5247[_0x12b1dd(0x17f)]===_0x529d47),_0x3d9109=createSegmentIdResolver(_0x3a74b2['segmentNameToId'],_0x32abb2),_0x59820b=await resolveRuleSegmentIds(_0x3ef799['rule'],_0x3d9109);let _0x365e12;return _0x4ddd7d?(await _0x323f6a[_0x12b1dd(0x163)][_0x12b1dd(0x1f6)](_0x3faae5['parentId'],_0x4ddd7d['id'],{'description':_0x3ef799[_0x12b1dd(0x1a4)]||_0x12b1dd(0x181)+_0x32abb2,'rule':_0xcfabce(_0x59820b),'countPopulation':!![]}),_0x365e12=_0x4ddd7d['id'],saveSegmentToPushRecovery(_0x5baa5[_0x12b1dd(0x206)],_0x5baa5[_0x12b1dd(0x124)][_0x12b1dd(0x17f)],_0x32abb2,{'segmentId':_0x365e12,'uniqueServerName':_0x529d47,'createdAt':new Date()['toISOString']()})):_0x365e12=await createOrRecoverEmbeddedSegment(_0x323f6a,_0x5baa5,{'localName':_0x32abb2,'uniqueSegmentName':_0x529d47,'description':_0x3ef799[_0x12b1dd(0x1a4)]||_0x12b1dd(0x181)+_0x32abb2,'journeyId':_0x499994,'resolvedRule':_0x59820b,'parentId':_0x3faae5[_0x12b1dd(0x1db)],'folderId':_0x3faae5[_0x12b1dd(0x19e)]||''},_0xcfabce),_0x3a74b2[_0x12b1dd(0x13f)][_0x12b1dd(0x148)](_0x32abb2,_0x365e12),_0x2b71b[_0x12b1dd(0x148)](_0x32abb2,_0x365e12),_0x365e12;})());_0x327584['set'](_0x32abb2,_0x2b5396);try{return await _0x2b5396;}finally{_0x327584[_0x4927b0(0x171)](_0x32abb2);}},'resolveActivationId':async _0x4d451c=>{const _0x5c7fb7=_0x2fbf79,_0x30cec5=_0x271866[_0x5c7fb7(0x197)](_0x4d451c);if(_0x30cec5)return _0x30cec5;if(_0x5baa5[_0x5c7fb7(0x110)]){await _0x571cd9();const _0x49da9e=_0x271866[_0x5c7fb7(0x197)](_0x4d451c);if(_0x49da9e)return _0x49da9e;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x4d451c+_0x5c7fb7(0x13b)+_0x5baa5[_0x5c7fb7(0x124)][_0x5c7fb7(0x17f)]+_0x5c7fb7(0x184)+_0x5c7fb7(0x1ee));},'resolveEmbeddedActivationId':async(_0x3f67e9,_0x2790d6)=>{const _0x36fbc3=_0x2fbf79,_0x19ee02=_0x271866['get'](_0x3f67e9);if(_0x19ee02)return _0x19ee02;if(_0x5baa5['isNew'])return _0x4098d2[_0x36fbc3(0x148)](_0x3f67e9,_0x2790d6),createPendingActivationId(_0x3f67e9);if(_0x5baa5[_0x36fbc3(0x110)]){await _0x571cd9();const _0xe6ed46=_0x271866[_0x36fbc3(0x197)](_0x2790d6[_0x36fbc3(0x17f)]);if(_0xe6ed46)return _0x271866['set'](_0x3f67e9,_0xe6ed46),_0xe6ed46;const _0x1d720f=activationSignature(_0x2790d6),_0x5b932f=_0x4d40b2?.['get'](_0x1d720f);if(_0x5b932f)return _0x271866['set'](_0x3f67e9,_0x5b932f),_0x5b932f;const _0x57673a=await _0x1ebaa6(_0x2790d6,_0x3a74b2[_0x36fbc3(0x144)]),_0x3ef2a7={..._0x57673a,..._0x2790d6['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x2790d6[_0x36fbc3(0x20e)]}},_0x494229=await _0x323f6a['journey'][_0x36fbc3(0x111)](_0x5baa5['existingJourney']['id'],_0x3ef2a7);return _0x271866[_0x36fbc3(0x148)](_0x3f67e9,_0x494229['id']),_0x494229['id'];}throw new SDKError(ErrorCode[_0x36fbc3(0x12c)],_0x36fbc3(0x133));},'resolveJourneyId':async _0x3102c0=>{const _0x257b47=_0x2fbf79;try{return await _0x323f6a[_0x257b47(0x113)][_0x257b47(0x1d8)](_0x3faae5[_0x257b47(0x1db)],_0x3102c0);}catch(_0x405942){throw new SDKError(ErrorCode[_0x257b47(0x1e9)],_0x257b47(0x13e)+_0x3102c0+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x5baa5[_0x257b47(0x124)][_0x257b47(0x17f)]+'\x27)',_0x405942);}},'resolveStageId':async(_0x1b9dde,_0x56f733)=>{const _0x448ab7=_0x2fbf79,_0x227f5a=await _0x323f6a[_0x448ab7(0x113)][_0x448ab7(0x188)](_0x1b9dde),_0x1b639f=_0x227f5a[_0x448ab7(0x18d)][_0x448ab7(0x1bd)]['find'](_0x567c2e=>_0x567c2e[_0x448ab7(0x17f)][_0x448ab7(0x17a)]()===_0x56f733[_0x448ab7(0x17a)]());if(!_0x1b639f?.['id'])throw new SDKError(ErrorCode[_0x448ab7(0x1e9)],_0x448ab7(0x14e)+_0x56f733+_0x448ab7(0x17b)+(_0x227f5a[_0x448ab7(0x18d)][_0x448ab7(0x128)]||_0x227f5a['attributes']['name'])+'\x27');return _0x1b639f['id'];}},_0x1dda79=await _0x7af9b9(_0x5baa5['yamlConfig'],_0x3faae5[_0x2fbf79(0x1db)],_0x46937c),_0x1e15b1=_0x3faae5['folderId']||_0x3faae5[_0x2fbf79(0x19e)];_0x1e15b1&&(_0x1dda79[_0x2fbf79(0x1d2)]={'parentFolder':{'data':{'id':_0x1e15b1,'type':_0x2fbf79(0x14f)}}});if(_0x5baa5[_0x2fbf79(0x164)]){if(_0x46a99f[_0x2fbf79(0x19a)]>0x0||_0x4098d2[_0x2fbf79(0x19a)]>0x0)return await executeThreeStepJourneyCreate(_0x323f6a,_0x5baa5,_0x1dda79,{'pendingEmbeddedSegments':_0x46a99f,'pendingEmbeddedActivations':_0x4098d2,'embeddedSegmentNameToId':_0x2b71b,'journeyActivationNameToId':_0x271866},{..._0x3faae5,'effectiveFolderId':_0x1e15b1},_0x3a74b2,_0x286262,_0x2a4e4);else{ensureJourneyDefaults(_0x1dda79['attributes']);const _0x24a261=await _0x323f6a[_0x2fbf79(0x113)][_0x2fbf79(0x1a3)](_0x1dda79);return deletePushRecovery(_0x5baa5[_0x2fbf79(0x206)]),{'action':'created','journeyId':_0x24a261['id'],'embeddedSegmentNameToId':_0x2b71b};}}else{if(_0x5baa5[_0x2fbf79(0x1f9)]&&_0x5baa5[_0x2fbf79(0x110)]){_0x1dda79['id']=_0x5baa5[_0x2fbf79(0x110)]['id'];const _0x582808=_0x1dda79[_0x2fbf79(0x18d)];_0x5baa5[_0x2fbf79(0x110)][_0x2fbf79(0x18d)]?.[_0x2fbf79(0x128)]&&(_0x582808['journeyBundleName']=_0x5baa5[_0x2fbf79(0x110)][_0x2fbf79(0x18d)]['journeyBundleName']);const _0x386fea=_0x5baa5[_0x2fbf79(0x110)]['attributes']?.[_0x2fbf79(0x1bd)];return _0x386fea&&_0x1dda79[_0x2fbf79(0x18d)][_0x2fbf79(0x1bd)]&&injectExistingStageIds(_0x1dda79[_0x2fbf79(0x18d)][_0x2fbf79(0x1bd)],_0x386fea),ensureJourneyDefaults(_0x582808),await _0x323f6a[_0x2fbf79(0x113)][_0x2fbf79(0x1d7)](_0x5baa5[_0x2fbf79(0x110)]['id'],_0x1dda79),deletePushRecovery(_0x5baa5[_0x2fbf79(0x206)]),{'action':_0x2fbf79(0x1cd),'journeyId':_0x5baa5['existingJourney']['id'],'embeddedSegmentNameToId':_0x2b71b};}}return deletePushRecovery(_0x5baa5[_0x2fbf79(0x206)]),{'action':_0x2fbf79(0x10e),'journeyId':_0x5baa5[_0x2fbf79(0x110)]?.['id'],'embeddedSegmentNameToId':_0x2b71b};}function findSegmentCriteriaLocation(_0x13b664,_0x458699){const _0x4a26c0=a159_0x34a518,_0x5e26c9=_0x13b664[_0x4a26c0(0x1dc)]||_0x13b664[_0x4a26c0(0x16f)]?.[0x0]?.[_0x4a26c0(0x1dc)]||[];let _0x230044='entry',_0x2b199f=_0x458699;const _0x4dbc27=_0x13b664[_0x4a26c0(0x1ce)]||_0x13b664[_0x4a26c0(0x16f)]?.[0x0]?.[_0x4a26c0(0x1ce)];if(_0x4dbc27?.[_0x4a26c0(0x163)]===_0x458699)return{'stageName':_0x4a26c0(0x1ce),'criteriaName':_0x4dbc27[_0x4a26c0(0x17f)]||_0x458699};_0x351095:for(const _0x5d3ffa of _0x5e26c9){if(_0x5d3ffa[_0x4a26c0(0x14d)]?.[_0x4a26c0(0x163)]===_0x458699){_0x230044=_0x5d3ffa['name'],_0x2b199f=_0x5d3ffa['entry_criteria'][_0x4a26c0(0x17f)]||_0x458699;break;}if(_0x5d3ffa[_0x4a26c0(0x20a)])for(const _0x502617 of _0x5d3ffa[_0x4a26c0(0x20a)]){if(_0x502617[_0x4a26c0(0x152)]==='decision_point'&&_0x502617[_0x4a26c0(0x132)]?.['branches'])for(const _0x209e98 of _0x502617[_0x4a26c0(0x132)][_0x4a26c0(0x1bb)]){if(_0x209e98[_0x4a26c0(0x163)]===_0x458699){_0x230044=_0x5d3ffa[_0x4a26c0(0x17f)],_0x2b199f=_0x209e98['name']||_0x458699;break _0x351095;}}}}return{'stageName':_0x230044,'criteriaName':_0x2b199f};}async function executeThreeStepJourneyCreate(_0x1b6469,_0x171a49,_0x5e4f55,_0x407ec7,_0x2d0de3,_0x34acef,_0x399906,_0x29639b){const _0x34aa12=a159_0x34a518,{activationDefToCreateRequest:_0x14024f,yamlRuleToApi:_0x977746}=_0x29639b,{pendingEmbeddedSegments:_0xc85fe,pendingEmbeddedActivations:_0x56f0b7,embeddedSegmentNameToId:_0x3d57ad}=_0x407ec7,_0xb3d53c=JSON[_0x34aa12(0x15e)](JSON['stringify'](_0x5e4f55));ensureJourneyDefaults(_0xb3d53c[_0x34aa12(0x18d)]),stripPendingIds(_0xb3d53c);const _0x5a18af=await _0x1b6469['journey'][_0x34aa12(0x1a3)](_0xb3d53c),_0x11790d=_0x5a18af['id'],_0x1c158c=new Map();for(const _0x21f54e of _0x5a18af['attributes'][_0x34aa12(0x1bd)]){_0x1c158c[_0x34aa12(0x148)](_0x21f54e[_0x34aa12(0x17f)][_0x34aa12(0x17a)](),_0x21f54e['id']);}recoverSegmentIdsFromPushRecovery(_0x171a49,_0x3d57ad,_0x34acef[_0x34aa12(0x13f)]);for(const [_0x3f0393,{definition:_0x444f51}]of _0xc85fe){if(_0x3d57ad[_0x34aa12(0x1c5)](_0x3f0393)){_0x399906[_0x34aa12(0x1a6)]?.({'type':_0x34aa12(0x12a),'journeyName':_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],'segmentName':_0x3f0393});continue;}const _0x2548d9=generateDeterministicJourneySegmentName(_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],_0x3f0393);_0x399906[_0x34aa12(0x1a6)]?.({'type':_0x34aa12(0x187),'journeyName':_0x171a49[_0x34aa12(0x124)]['name'],'segmentName':_0x3f0393});const _0xcf4be4=createSegmentIdResolver(_0x34acef[_0x34aa12(0x13f)],_0x3f0393),_0x1a3f09=await resolveRuleSegmentIds(_0x444f51[_0x34aa12(0x185)],_0xcf4be4),_0x294c40=await createOrRecoverEmbeddedSegment(_0x1b6469,_0x171a49,{'localName':_0x3f0393,'uniqueSegmentName':_0x2548d9,'description':_0x444f51[_0x34aa12(0x1a4)]||_0x34aa12(0x181)+_0x3f0393,'journeyId':_0x11790d,'resolvedRule':_0x1a3f09,'parentId':_0x2d0de3[_0x34aa12(0x1db)],'folderId':_0x2d0de3[_0x34aa12(0x1ad)]||''},_0x977746);_0x3d57ad['set'](_0x3f0393,_0x294c40),_0x34acef['segmentNameToId'][_0x34aa12(0x148)](_0x3f0393,_0x294c40),_0x399906[_0x34aa12(0x1a6)]?.({'type':'embedded_segment_created','journeyName':_0x171a49['yamlConfig'][_0x34aa12(0x17f)],'segmentName':_0x3f0393});}const _0x4e8551=new Map();for(const [_0x2d65f5,_0x1d256c]of _0x56f0b7){_0x399906[_0x34aa12(0x1a6)]?.({'type':_0x34aa12(0x1e0),'journeyName':_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],'activationName':_0x2d65f5});const _0x3a8c22=await _0x14024f(_0x1d256c,_0x34acef[_0x34aa12(0x144)]),_0x3d2ed8={..._0x3a8c22,..._0x1d256c['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1d256c['run_after_journey_refresh']}},_0x51fc09=await _0x1b6469[_0x34aa12(0x113)][_0x34aa12(0x111)](_0x11790d,_0x3d2ed8);_0x4e8551['set'](_0x2d65f5,_0x51fc09['id']),_0x407ec7[_0x34aa12(0x199)][_0x34aa12(0x148)](_0x2d65f5,_0x51fc09['id']),_0x399906[_0x34aa12(0x1a6)]?.({'type':'embedded_activation_created','journeyName':_0x171a49[_0x34aa12(0x124)][_0x34aa12(0x17f)],'activationName':_0x2d65f5});}const _0x2f4434=JSON[_0x34aa12(0x15e)](JSON[_0x34aa12(0x1d9)](_0x5e4f55));return _0x2f4434['id']=_0x11790d,ensureJourneyDefaults(_0x2f4434['attributes']),resolvePendingIdsInRequest(_0x2f4434,_0x5e4f55,_0x1c158c,_0x3d57ad,_0x4e8551,_0x399906),await _0x1b6469['journey'][_0x34aa12(0x1d7)](_0x11790d,_0x2f4434),deletePushRecovery(_0x171a49[_0x34aa12(0x206)]),{'action':'created','journeyId':_0x11790d,'embeddedSegmentNameToId':_0x3d57ad};}export function stripWaitStepPendingIds(_0x475f60){const _0x5c8431=a159_0x34a518,_0x1314c5=_0x475f60['conditionSegmentId']&&isPendingSegmentId(_0x475f60[_0x5c8431(0x1e4)]),_0x17434f=_0x475f60[_0x5c8431(0x13c)]?.[_0x5c8431(0x1f4)](_0x5d06e5=>_0x5d06e5[_0x5c8431(0x12d)]&&isPendingSegmentId(_0x5d06e5[_0x5c8431(0x12d)]));(_0x1314c5||_0x17434f)&&(_0x475f60['waitStepType']=_0x5c8431(0x198),_0x475f60[_0x5c8431(0x1c4)]=0x1,_0x475f60[_0x5c8431(0x1ca)]=_0x5c8431(0x1dd),delete _0x475f60[_0x5c8431(0x1e4)],delete _0x475f60[_0x5c8431(0x1e8)],delete _0x475f60[_0x5c8431(0x1f0)],delete _0x475f60[_0x5c8431(0x13c)]);}export function resolveWaitStepPendingIds(_0xa030d7,_0x41bcd9,_0x15cb4e,_0x2e94f1){const _0x290dc7=a159_0x34a518;if(_0x41bcd9[_0x290dc7(0x1e4)]&&isPendingSegmentId(_0x41bcd9[_0x290dc7(0x1e4)])){const _0x27f92d=_0x15cb4e(_0x41bcd9['conditionSegmentId'],_0x290dc7(0x13d)+_0x2e94f1+'\x27\x20wait\x20condition');_0x27f92d&&(_0xa030d7[_0x290dc7(0x11d)]=_0x290dc7(0x1f1),_0xa030d7[_0x290dc7(0x1e4)]=_0x27f92d,delete _0xa030d7[_0x290dc7(0x1c4)],delete _0xa030d7[_0x290dc7(0x1ca)],_0x41bcd9[_0x290dc7(0x1e8)]!==undefined&&(_0xa030d7['conditionTimeoutDuration']=_0x41bcd9[_0x290dc7(0x1e8)]),_0x41bcd9[_0x290dc7(0x1f0)]&&(_0xa030d7[_0x290dc7(0x1f0)]=_0x41bcd9['conditionTimeoutUnit']));}if(_0x41bcd9['conditions']){const _0x442896=_0x41bcd9[_0x290dc7(0x13c)][_0x290dc7(0x1f4)](_0x549450=>_0x549450[_0x290dc7(0x12d)]&&isPendingSegmentId(_0x549450[_0x290dc7(0x12d)]));if(_0x442896){const _0x2961bc=_0x41bcd9[_0x290dc7(0x13c)][_0x290dc7(0x155)](_0x2b6b8e=>{const _0x435d2a=_0x290dc7;if(_0x2b6b8e['segmentId']&&isPendingSegmentId(_0x2b6b8e[_0x435d2a(0x12d)])){const _0x4443f9=_0x15cb4e(_0x2b6b8e[_0x435d2a(0x12d)],_0x435d2a(0x13d)+_0x2e94f1+_0x435d2a(0x136));return{..._0x2b6b8e,'segmentId':_0x4443f9||_0x2b6b8e['segmentId']};}return{..._0x2b6b8e};});_0xa030d7[_0x290dc7(0x11d)]=_0x290dc7(0x1f1),_0xa030d7['conditions']=_0x2961bc,delete _0xa030d7['waitStep'],delete _0xa030d7[_0x290dc7(0x1ca)],delete _0xa030d7['conditionSegmentId'],delete _0xa030d7[_0x290dc7(0x1e8)],delete _0xa030d7[_0x290dc7(0x1f0)];}}}function stripPendingIds(_0x33ca86){const _0x1acd12=a159_0x34a518;_0x33ca86['attributes']['goal']?.[_0x1acd12(0x12d)]&&isPendingSegmentId(_0x33ca86[_0x1acd12(0x18d)][_0x1acd12(0x1ce)][_0x1acd12(0x12d)])&&delete _0x33ca86[_0x1acd12(0x18d)]['goal'];for(const _0x10bc88 of _0x33ca86[_0x1acd12(0x18d)][_0x1acd12(0x1bd)]||[]){_0x10bc88[_0x1acd12(0x1b1)]?.['segmentId']&&isPendingSegmentId(_0x10bc88[_0x1acd12(0x1b1)][_0x1acd12(0x12d)])&&delete _0x10bc88[_0x1acd12(0x1b1)];_0x10bc88[_0x1acd12(0x1ba)]?.[_0x1acd12(0x12d)]&&isPendingSegmentId(_0x10bc88[_0x1acd12(0x1ba)][_0x1acd12(0x12d)])&&delete _0x10bc88[_0x1acd12(0x1ba)];_0x10bc88[_0x1acd12(0x1a0)]&&(_0x10bc88[_0x1acd12(0x1a0)]=_0x10bc88[_0x1acd12(0x1a0)][_0x1acd12(0x1fc)](_0x3a680f=>!_0x3a680f['segmentId']||!isPendingSegmentId(_0x3a680f['segmentId'])));if(_0x10bc88[_0x1acd12(0x20a)])for(const _0x4808a0 of Object[_0x1acd12(0x122)](_0x10bc88[_0x1acd12(0x20a)])){const _0x3af3d3=_0x10bc88[_0x1acd12(0x20a)][_0x4808a0];_0x3af3d3[_0x1acd12(0x152)]==='Activation'&&_0x3af3d3['journeyActivationStepId']&&isPendingActivationId(_0x3af3d3[_0x1acd12(0x1fe)])&&(_0x3af3d3['journeyActivationStepId']='');if(_0x3af3d3[_0x1acd12(0x152)]===_0x1acd12(0x173)&&_0x3af3d3[_0x1acd12(0x1bb)])for(const _0x521bdf of _0x3af3d3[_0x1acd12(0x1bb)]){_0x521bdf[_0x1acd12(0x12d)]&&isPendingSegmentId(_0x521bdf[_0x1acd12(0x12d)])&&(_0x521bdf['segmentId']='');}_0x3af3d3[_0x1acd12(0x152)]==='WaitStep'&&stripWaitStepPendingIds(_0x3af3d3);}}}function resolvePendingIdsInRequest(_0x37dd43,_0x580773,_0x34e2f1,_0x1cc9b9,_0x41807b,_0x4220e2){const _0x441675=a159_0x34a518,_0x3b5ac1=(_0x120ade,_0x1eb0fc)=>{const _0x2e6cd0=a159_0x2ae9;if(!isPendingSegmentId(_0x120ade))return _0x120ade;const _0x413bd0=extractPendingSegmentName(_0x120ade),_0x1704e9=_0x1cc9b9[_0x2e6cd0(0x197)](_0x413bd0);return!_0x1704e9&&_0x4220e2[_0x2e6cd0(0x1c1)]?.(_0x2e6cd0(0x135)+_0x413bd0+_0x2e6cd0(0x140)+_0x1eb0fc),_0x1704e9;};if(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)]?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)][_0x441675(0x12d)])){const _0x5bb4ed=_0x3b5ac1(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)][_0x441675(0x12d)],_0x441675(0x1e7));_0x5bb4ed&&(_0x37dd43[_0x441675(0x18d)][_0x441675(0x1ce)][_0x441675(0x12d)]=_0x5bb4ed);}for(const _0x495a04 of _0x37dd43[_0x441675(0x18d)]['journeyStages']||[]){const _0x40886f=_0x34e2f1[_0x441675(0x197)](_0x495a04['name']['toLowerCase']());_0x40886f&&(_0x495a04['id']=_0x40886f);if(_0x495a04[_0x441675(0x1b1)]?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x495a04[_0x441675(0x1b1)][_0x441675(0x12d)])){const _0x42f22b=_0x3b5ac1(_0x495a04[_0x441675(0x1b1)]['segmentId'],'stage\x20\x27'+_0x495a04[_0x441675(0x17f)]+_0x441675(0x1e5));_0x42f22b&&(_0x495a04[_0x441675(0x1b1)][_0x441675(0x12d)]=_0x42f22b);}if(_0x495a04['exitCriterias'])for(const _0x1c18e9 of _0x495a04[_0x441675(0x1a0)]){if(_0x1c18e9[_0x441675(0x12d)]&&isPendingSegmentId(_0x1c18e9[_0x441675(0x12d)])){const _0x5a5009=_0x3b5ac1(_0x1c18e9[_0x441675(0x12d)],'stage\x20\x27'+_0x495a04[_0x441675(0x17f)]+_0x441675(0x1ac));_0x5a5009&&(_0x1c18e9['segmentId']=_0x5a5009);}}if(_0x495a04[_0x441675(0x1ba)]?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x495a04[_0x441675(0x1ba)]['segmentId'])){const _0x52d964=_0x3b5ac1(_0x495a04[_0x441675(0x1ba)]['segmentId'],_0x441675(0x13d)+_0x495a04[_0x441675(0x17f)]+'\x27\x20milestone');_0x52d964&&(_0x495a04[_0x441675(0x1ba)]['segmentId']=_0x52d964);}if(_0x495a04[_0x441675(0x20a)]){const _0x52d00d=_0x566a28=>_0x580773['attributes'][_0x441675(0x1bd)]?.[_0x441675(0x1f8)](_0x277899=>_0x277899[_0x441675(0x17f)][_0x441675(0x17a)]()===_0x495a04['name'][_0x441675(0x17a)]())?.['steps']?.[_0x566a28];for(const _0x183ad1 of Object[_0x441675(0x122)](_0x495a04['steps'])){const _0x576310=_0x495a04[_0x441675(0x20a)][_0x183ad1],_0x3a6cc1=_0x52d00d(_0x183ad1);if(_0x576310[_0x441675(0x152)]==='Activation'&&_0x576310[_0x441675(0x1fe)]&&(isPendingActivationId(_0x576310[_0x441675(0x1fe)])||_0x576310[_0x441675(0x1fe)]==='')){if(_0x3a6cc1?.[_0x441675(0x1fe)]&&isPendingActivationId(_0x3a6cc1[_0x441675(0x1fe)])){const _0x26c2b6=extractPendingActivationName(_0x3a6cc1[_0x441675(0x1fe)]),_0x871734=_0x41807b[_0x441675(0x197)](_0x26c2b6);_0x871734&&(_0x576310[_0x441675(0x1fe)]=_0x871734);}}if(_0x576310['type']==='DecisionPoint'&&_0x576310[_0x441675(0x1bb)]&&_0x3a6cc1?.[_0x441675(0x1bb)])for(let _0x150f36=0x0;_0x150f36<_0x576310[_0x441675(0x1bb)][_0x441675(0x116)];_0x150f36++){const _0x2438f7=_0x576310[_0x441675(0x1bb)][_0x150f36],_0x36a46e=_0x3a6cc1[_0x441675(0x1bb)][_0x150f36];if(_0x36a46e?.[_0x441675(0x12d)]&&isPendingSegmentId(_0x36a46e['segmentId'])){const _0x24741a=_0x3b5ac1(_0x36a46e[_0x441675(0x12d)],_0x441675(0x13d)+_0x495a04[_0x441675(0x17f)]+_0x441675(0x119)+(_0x2438f7[_0x441675(0x17f)]||_0x150f36)+'\x27');_0x24741a&&(_0x2438f7[_0x441675(0x12d)]=_0x24741a);}}_0x576310[_0x441675(0x152)]===_0x441675(0x1f3)&&_0x3a6cc1?.['type']===_0x441675(0x1f3)&&resolveWaitStepPendingIds(_0x576310,_0x3a6cc1,_0x3b5ac1,_0x495a04['name']);}}}}
@@ -1 +1 @@
1
- (function(_0x4e2147,_0x5bd933){const _0x14612c=a160_0x2455,_0x5073cd=_0x4e2147();while(!![]){try{const _0x510538=parseInt(_0x14612c(0x13c))/0x1+parseInt(_0x14612c(0x142))/0x2+-parseInt(_0x14612c(0x140))/0x3*(-parseInt(_0x14612c(0x13b))/0x4)+parseInt(_0x14612c(0x139))/0x5+parseInt(_0x14612c(0x13f))/0x6+-parseInt(_0x14612c(0x13a))/0x7*(-parseInt(_0x14612c(0x143))/0x8)+-parseInt(_0x14612c(0x135))/0x9;if(_0x510538===_0x5bd933)break;else _0x5073cd['push'](_0x5073cd['shift']());}catch(_0x44b97a){_0x5073cd['push'](_0x5073cd['shift']());}}}(a160_0x23ee,0x79705));export function buildFolderIdToPathMap(_0x37d450){const _0x169c69=a160_0x2455,_0x2ce08c=new Map(),_0x559002=new Map();for(const _0x3adefc of _0x37d450){_0x559002[_0x169c69(0x136)](_0x3adefc['id'],_0x3adefc);}const _0x420e9f=new Set();for(const _0xdb7c57 of _0x37d450){!_0xdb7c57['parentFolderId']&&_0x420e9f[_0x169c69(0x138)](_0xdb7c57['id']);}function _0x29728b(_0x193b99){const _0x536b61=_0x169c69;if(_0x2ce08c[_0x536b61(0x13e)](_0x193b99['id']))return _0x2ce08c[_0x536b61(0x137)](_0x193b99['id']);if(_0x420e9f['has'](_0x193b99['id']))return _0x2ce08c['set'](_0x193b99['id'],''),'';if(_0x193b99[_0x536b61(0x13d)]){const _0x170893=_0x559002['get'](_0x193b99[_0x536b61(0x13d)]);if(_0x170893){const _0x3c41b4=_0x29728b(_0x170893),_0x51d95c=_0x3c41b4?_0x3c41b4+'/'+_0x193b99[_0x536b61(0x141)]:_0x193b99[_0x536b61(0x141)];return _0x2ce08c[_0x536b61(0x136)](_0x193b99['id'],_0x51d95c),_0x51d95c;}}const _0x5a221c=_0x193b99['name'];return _0x2ce08c[_0x536b61(0x136)](_0x193b99['id'],_0x5a221c),_0x5a221c;}for(const _0x20c6f4 of _0x37d450){_0x29728b(_0x20c6f4);}return _0x2ce08c;}function a160_0x23ee(){const _0x2f1715=['has','1262670SYNwOw','4425rwoeXs','name','52798svQUHt','8SdNheh','8156574pFQLWQ','set','get','add','723875vDdPIP','240310BCftVI','816drwwzm','686850rQSEGb','parentFolderId'];a160_0x23ee=function(){return _0x2f1715;};return a160_0x23ee();}export function buildFolderPathToIdMap(_0x546f12){const _0x389887=a160_0x2455,_0x12c0a1=new Map(),_0x6d8f2=new Map();for(const _0x2db1ac of _0x546f12){_0x6d8f2['set'](_0x2db1ac['id'],_0x2db1ac);}const _0x37fd9b=new Set();for(const _0x310993 of _0x546f12){!_0x310993[_0x389887(0x13d)]&&_0x37fd9b[_0x389887(0x138)](_0x310993['id']);}function _0x94ca0d(_0x281e61){const _0x103e7c=_0x389887;if(_0x37fd9b[_0x103e7c(0x13e)](_0x281e61['id']))return'';if(_0x281e61[_0x103e7c(0x13d)]){const _0x5af4a5=_0x6d8f2[_0x103e7c(0x137)](_0x281e61[_0x103e7c(0x13d)]);if(_0x5af4a5){const _0x2721eb=_0x94ca0d(_0x5af4a5);return _0x2721eb?_0x2721eb+'/'+_0x281e61[_0x103e7c(0x141)]:_0x281e61[_0x103e7c(0x141)];}}return _0x281e61[_0x103e7c(0x141)];}for(const _0x5a8761 of _0x546f12){const _0x1d69ce=_0x94ca0d(_0x5a8761);_0x12c0a1['set'](_0x1d69ce,_0x5a8761['id']);}return _0x12c0a1;}export function buildFolderMaps(_0x2f7c0b){const _0x7bd6b=a160_0x2455,_0x5dfb60=buildFolderIdToPathMap(_0x2f7c0b),_0x192c48=new Map();for(const [_0x155946,_0x15b195]of _0x5dfb60){_0x192c48[_0x7bd6b(0x136)](_0x15b195,_0x155946);}return{'idToPath':_0x5dfb60,'pathToId':_0x192c48};}function a160_0x2455(_0x5bdee7,_0x2063ec){_0x5bdee7=_0x5bdee7-0x135;const _0x23eec7=a160_0x23ee();let _0x2455f8=_0x23eec7[_0x5bdee7];return _0x2455f8;}export function getFolderPath(_0x12e7c8,_0x337507){const _0x1c8d04=a160_0x2455;if(!_0x12e7c8)return'';return _0x337507[_0x1c8d04(0x137)](_0x12e7c8)??'';}
1
+ (function(_0x5aee85,_0x5b6af7){const _0x84a64f=a160_0x45ba,_0x59ce85=_0x5aee85();while(!![]){try{const _0x727e80=parseInt(_0x84a64f(0x17b))/0x1+-parseInt(_0x84a64f(0x188))/0x2*(parseInt(_0x84a64f(0x180))/0x3)+-parseInt(_0x84a64f(0x17f))/0x4*(-parseInt(_0x84a64f(0x186))/0x5)+-parseInt(_0x84a64f(0x182))/0x6+parseInt(_0x84a64f(0x185))/0x7+parseInt(_0x84a64f(0x18a))/0x8*(parseInt(_0x84a64f(0x17e))/0x9)+-parseInt(_0x84a64f(0x184))/0xa;if(_0x727e80===_0x5b6af7)break;else _0x59ce85['push'](_0x59ce85['shift']());}catch(_0x1fa79a){_0x59ce85['push'](_0x59ce85['shift']());}}}(a160_0x1495,0xb6336));function a160_0x1495(){const _0xfc4063=['506192sDqDcR','827865gzxkJL','set','has','153xlvZdy','12ikWqaA','348rLiZKh','name','2763798aHcUIa','add','14763890xhZIdu','7949228uqdbhG','931995mWthkH','get','15776oqazrE','parentFolderId'];a160_0x1495=function(){return _0xfc4063;};return a160_0x1495();}export function buildFolderIdToPathMap(_0x4c1a9e){const _0x2c33ae=a160_0x45ba,_0x257fb0=new Map(),_0x382411=new Map();for(const _0x10a48a of _0x4c1a9e){_0x382411[_0x2c33ae(0x17c)](_0x10a48a['id'],_0x10a48a);}const _0x128ade=new Set();for(const _0x51d871 of _0x4c1a9e){!_0x51d871['parentFolderId']&&_0x128ade[_0x2c33ae(0x183)](_0x51d871['id']);}function _0xbb2929(_0x59a4b4){const _0x427a34=_0x2c33ae;if(_0x257fb0[_0x427a34(0x17d)](_0x59a4b4['id']))return _0x257fb0[_0x427a34(0x187)](_0x59a4b4['id']);if(_0x128ade['has'](_0x59a4b4['id']))return _0x257fb0[_0x427a34(0x17c)](_0x59a4b4['id'],''),'';if(_0x59a4b4[_0x427a34(0x189)]){const _0x2f207b=_0x382411[_0x427a34(0x187)](_0x59a4b4['parentFolderId']);if(_0x2f207b){const _0x31b51b=_0xbb2929(_0x2f207b),_0x3010af=_0x31b51b?_0x31b51b+'/'+_0x59a4b4[_0x427a34(0x181)]:_0x59a4b4[_0x427a34(0x181)];return _0x257fb0['set'](_0x59a4b4['id'],_0x3010af),_0x3010af;}}const _0x80d25f=_0x59a4b4['name'];return _0x257fb0[_0x427a34(0x17c)](_0x59a4b4['id'],_0x80d25f),_0x80d25f;}for(const _0x1898ed of _0x4c1a9e){_0xbb2929(_0x1898ed);}return _0x257fb0;}function a160_0x45ba(_0x3c478e,_0x4d744b){_0x3c478e=_0x3c478e-0x17b;const _0x149501=a160_0x1495();let _0x45ba6e=_0x149501[_0x3c478e];return _0x45ba6e;}export function buildFolderPathToIdMap(_0x256ca0){const _0xdba2f2=a160_0x45ba,_0x35fabf=new Map(),_0x51ade1=new Map();for(const _0x5bb3ff of _0x256ca0){_0x51ade1[_0xdba2f2(0x17c)](_0x5bb3ff['id'],_0x5bb3ff);}const _0x5aa115=new Set();for(const _0x2a5bc4 of _0x256ca0){!_0x2a5bc4[_0xdba2f2(0x189)]&&_0x5aa115[_0xdba2f2(0x183)](_0x2a5bc4['id']);}function _0xe87db9(_0x3de98c){const _0x44a970=_0xdba2f2;if(_0x5aa115[_0x44a970(0x17d)](_0x3de98c['id']))return'';if(_0x3de98c[_0x44a970(0x189)]){const _0x4f7f27=_0x51ade1[_0x44a970(0x187)](_0x3de98c[_0x44a970(0x189)]);if(_0x4f7f27){const _0x14f967=_0xe87db9(_0x4f7f27);return _0x14f967?_0x14f967+'/'+_0x3de98c['name']:_0x3de98c[_0x44a970(0x181)];}}return _0x3de98c['name'];}for(const _0x6e50c0 of _0x256ca0){const _0x5de20b=_0xe87db9(_0x6e50c0);_0x35fabf[_0xdba2f2(0x17c)](_0x5de20b,_0x6e50c0['id']);}return _0x35fabf;}export function buildFolderMaps(_0x26d8c3){const _0x1f4252=a160_0x45ba,_0x34fc90=buildFolderIdToPathMap(_0x26d8c3),_0x3760fd=new Map();for(const [_0x231bc0,_0x122212]of _0x34fc90){_0x3760fd[_0x1f4252(0x17c)](_0x122212,_0x231bc0);}return{'idToPath':_0x34fc90,'pathToId':_0x3760fd};}export function getFolderPath(_0x177ca2,_0x5ad105){if(!_0x177ca2)return'';return _0x5ad105['get'](_0x177ca2)??'';}
@@ -1 +1 @@
1
- (function(_0x51d4d5,_0x3a740d){const _0x3ed01c=a161_0x75b5,_0x4bb270=_0x51d4d5();while(!![]){try{const _0x39b9d5=parseInt(_0x3ed01c(0x12e))/0x1*(parseInt(_0x3ed01c(0x12f))/0x2)+parseInt(_0x3ed01c(0x140))/0x3+parseInt(_0x3ed01c(0x14c))/0x4*(-parseInt(_0x3ed01c(0x152))/0x5)+-parseInt(_0x3ed01c(0x142))/0x6+-parseInt(_0x3ed01c(0x14f))/0x7+-parseInt(_0x3ed01c(0x149))/0x8+-parseInt(_0x3ed01c(0x132))/0x9*(-parseInt(_0x3ed01c(0x12c))/0xa);if(_0x39b9d5===_0x3a740d)break;else _0x4bb270['push'](_0x4bb270['shift']());}catch(_0x12a307){_0x4bb270['push'](_0x4bb270['shift']());}}}(a161_0x2225,0x9f443));import a161_0x2f9bf5 from'path';function a161_0x2225(){const _0xb43086=['test','raw','segments','pop','File\x20not\x20found:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20cannot\x20be\x20empty','name','resolve','3111483XpoKCY','dirname','5993130OImewJ','endsWith','journey','Cannot\x20split\x20empty\x20path','segment','join','trim','7027640TeLqxe','isAbsolute','substring','48qRQVmM','replace','startsWith','4080426qkVtqL','tdx.json','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','364705fpkNwu','slice','Cannot\x20navigate\x20above\x20root','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','exists','relative','16631110cPtDMJ','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','3GnxJfg','858402fdwYDy','parse','length','9jEhIHM','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','.yaml','filter','push'];a161_0x2225=function(){return _0xb43086;};return a161_0x2225();}import{parse as a161_0x36ca1d}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x189d49){const _0x4107af=a161_0x75b5;if(!_0x189d49||_0x189d49[_0x4107af(0x148)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x7c6ef1=_0x189d49[_0x4107af(0x148)]();if(_0x7c6ef1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x189d49};const _0x4f3021=_0x7c6ef1[_0x4107af(0x14e)]('/')?_0x7c6ef1[_0x4107af(0x14b)](0x1):_0x7c6ef1,_0x28c18c=_0x4f3021['split']('/')[_0x4107af(0x135)](_0x13d5e7=>_0x13d5e7!=='');if(_0x28c18c[_0x4107af(0x131)]===0x0)throw new Error(_0x4107af(0x133));const _0x18d89d=_0x7c6ef1[_0x4107af(0x14e)]('/')||!isRelativePathSegment(_0x28c18c[0x0]);for(const _0xce7146 of _0x28c18c){validatePathSegment(_0xce7146);}return{'segments':_0x28c18c,'isAbsolute':_0x18d89d,'raw':_0x189d49};}function isRelativePathSegment(_0x25dba0){return _0x25dba0==='.'||_0x25dba0==='..';}function validatePathSegment(_0x377da7){const _0x135d40=a161_0x75b5;if(_0x377da7==='')throw new Error(_0x135d40(0x13d));if(_0x377da7==='.'||_0x377da7==='..')return;if(/[\x00-\x1F\x7F]/[_0x135d40(0x137)](_0x377da7))throw new Error(_0x135d40(0x151)+_0x377da7);if(_0x377da7!==_0x377da7[_0x135d40(0x148)]()){}}export function validatePath(_0x2e4f7a){const _0x1a95fa=a161_0x75b5;if(_0x2e4f7a[_0x1a95fa(0x139)][_0x1a95fa(0x131)]===0x0&&!_0x2e4f7a[_0x1a95fa(0x14a)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x2e4f7a[_0x1a95fa(0x14a)]){if(_0x2e4f7a[_0x1a95fa(0x139)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x3c6a3f=0x0;for(const _0x22a43c of _0x2e4f7a[_0x1a95fa(0x139)]){if(_0x22a43c==='..'){if(_0x3c6a3f===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x3c6a3f--;}else _0x22a43c!=='.'&&_0x3c6a3f++;}}}export function joinPaths(_0x34d4a6,_0x1da798){const _0xab8cf0=a161_0x75b5;if(!_0x34d4a6||_0x34d4a6==='/')return _0x1da798;if(!_0x1da798||_0x1da798==='.')return _0x34d4a6;if(_0x1da798[_0xab8cf0(0x14e)]('/'))return _0x1da798;const _0x172ad3=parsePath(_0x34d4a6),_0x267c95=parsePath(_0x1da798),_0x85ada=[..._0x172ad3[_0xab8cf0(0x139)]];for(const _0xb134a of _0x267c95[_0xab8cf0(0x139)]){if(_0xb134a==='.')continue;else{if(_0xb134a==='..'){if(_0x85ada[_0xab8cf0(0x131)]===0x0)throw new Error(_0xab8cf0(0x128));_0x85ada[_0xab8cf0(0x13a)]();}else _0x85ada[_0xab8cf0(0x136)](_0xb134a);}}const _0x491a09=_0x85ada['join']('/');return _0x172ad3[_0xab8cf0(0x138)][_0xab8cf0(0x14e)]('/')?'/'+_0x491a09:_0x491a09;}export function normalizePath(_0x41d4d9){const _0x476c52=a161_0x75b5,_0x4bc8cc=parsePath(_0x41d4d9),_0x28d737=[];for(const _0xe3d37a of _0x4bc8cc['segments']){if(_0xe3d37a==='.')continue;else{if(_0xe3d37a==='..'){if(_0x28d737[_0x476c52(0x131)]===0x0){if(_0x4bc8cc[_0x476c52(0x14a)])throw new Error(_0x476c52(0x128));_0x28d737[_0x476c52(0x136)]('..');}else _0x28d737[_0x28d737[_0x476c52(0x131)]-0x1]==='..'?_0x28d737['push']('..'):_0x28d737[_0x476c52(0x13a)]();}else _0x28d737['push'](_0xe3d37a);}}if(_0x28d737[_0x476c52(0x131)]===0x0)return _0x4bc8cc[_0x476c52(0x14a)]?'/':'.';const _0x481e8e=_0x28d737[_0x476c52(0x147)]('/');return _0x4bc8cc[_0x476c52(0x138)][_0x476c52(0x14e)]('/')?'/'+_0x481e8e:_0x481e8e;}export function getParentPath(_0x4fbb89){const _0x56e3d0=a161_0x75b5,_0x12ab1f=parsePath(_0x4fbb89);if(_0x12ab1f[_0x56e3d0(0x139)][_0x56e3d0(0x131)]<=0x1)return'/';const _0x5e2e2e=_0x12ab1f[_0x56e3d0(0x139)][_0x56e3d0(0x127)](0x0,-0x1)[_0x56e3d0(0x147)]('/');return _0x12ab1f[_0x56e3d0(0x138)][_0x56e3d0(0x14e)]('/')?'/'+_0x5e2e2e:_0x5e2e2e;}function a161_0x75b5(_0x7ae4f2,_0x3653a2){_0x7ae4f2=_0x7ae4f2-0x127;const _0x222520=a161_0x2225();let _0x75b53c=_0x222520[_0x7ae4f2];return _0x75b53c;}export function getBaseName(_0x3e2f76){const _0x20468e=a161_0x75b5,_0x223fef=parsePath(_0x3e2f76);return _0x223fef['segments'][_0x223fef['segments'][_0x20468e(0x131)]-0x1]||'';}export function isChildPath(_0x2d3290,_0x4d0686){const _0x15fbf3=a161_0x75b5,_0x82f85=parsePath(_0x2d3290),_0xd5c115=parsePath(_0x4d0686);if(_0x82f85[_0x15fbf3(0x139)][_0x15fbf3(0x131)]<=_0xd5c115[_0x15fbf3(0x139)][_0x15fbf3(0x131)])return![];for(let _0x2880c6=0x0;_0x2880c6<_0xd5c115['segments']['length'];_0x2880c6++){if(_0x82f85['segments'][_0x2880c6]!==_0xd5c115['segments'][_0x2880c6])return![];}return!![];}export function splitPath(_0x45d8f4){const _0x15ca89=a161_0x75b5,_0x5c1336=parsePath(_0x45d8f4);if(_0x5c1336[_0x15ca89(0x139)][_0x15ca89(0x131)]===0x0)throw new Error(_0x15ca89(0x145));if(_0x5c1336[_0x15ca89(0x139)]['length']===0x1)return{'parent':_0x5c1336['segments'][0x0]};return{'parent':_0x5c1336[_0x15ca89(0x139)][0x0],'child':_0x5c1336[_0x15ca89(0x139)][_0x15ca89(0x127)](0x1)[_0x15ca89(0x147)]('/')};}export function isYamlFilePath(_0x298345){const _0x4970fc=a161_0x75b5;return _0x298345[_0x4970fc(0x143)]('.yml')||_0x298345['endsWith'](_0x4970fc(0x134));}export async function resolveYamlFilePath(_0x4dc1ef,_0x5a77bd=nodeFileSystem){const _0x4d2205=a161_0x75b5,_0x496744=a161_0x2f9bf5[_0x4d2205(0x13f)](_0x4dc1ef);if(!await _0x5a77bd[_0x4d2205(0x12a)](_0x496744))throw new Error(_0x4d2205(0x13b)+_0x4dc1ef);let _0x183412=a161_0x2f9bf5[_0x4d2205(0x141)](_0x496744),_0x1c0fb1=null,_0x445e6b=null;const _0xcf6698=a161_0x2f9bf5[_0x4d2205(0x130)](_0x183412)['root'];while(_0x183412!==_0xcf6698){const _0x22656e=a161_0x2f9bf5[_0x4d2205(0x147)](_0x183412,_0x4d2205(0x150));if(await _0x5a77bd['exists'](_0x22656e)){_0x1c0fb1=_0x22656e,_0x445e6b=_0x183412;break;}_0x183412=a161_0x2f9bf5[_0x4d2205(0x141)](_0x183412);}if(!_0x1c0fb1||!_0x445e6b)throw new Error(_0x4d2205(0x13c)+_0x4dc1ef+'\x0a'+_0x4d2205(0x129));const _0x328f69=await _0x5a77bd['readFile'](_0x1c0fb1),_0x30f654=JSON[_0x4d2205(0x130)](_0x328f69),_0x299751=_0x30f654['parent_segment'];if(!_0x299751)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0xc5c92=await _0x5a77bd['readFile'](_0x496744),_0x528b3a=a161_0x36ca1d(_0xc5c92),_0x9af11c=_0x528b3a[_0x4d2205(0x13e)];if(!_0x9af11c)throw new Error(_0x4d2205(0x12d)+_0x4dc1ef);const _0x35e532=isJourneyDef(_0x528b3a,_0x496744)?_0x4d2205(0x144):_0x4d2205(0x146),_0xed6ceb=a161_0x2f9bf5[_0x4d2205(0x12b)](_0x445e6b,_0x496744),_0x4a8ebd=a161_0x2f9bf5[_0x4d2205(0x141)](_0xed6ceb),_0x4802ea=_0x4a8ebd==='.'?'':_0x4a8ebd[_0x4d2205(0x14d)](/\\/g,'/'),_0x3911b=_0x4802ea?_0x299751+'/'+_0x4802ea+'/'+_0x9af11c:_0x299751+'/'+_0x9af11c;return{'parentSegment':_0x299751,'segmentName':_0x9af11c,'folderPath':_0x4802ea,'fullPath':_0x3911b,'resourceType':_0x35e532,'content':_0xc5c92};}
1
+ (function(_0x19be66,_0x58b36a){const _0x38ad62=a161_0x1154,_0x364430=_0x19be66();while(!![]){try{const _0x3f946a=parseInt(_0x38ad62(0xc4))/0x1*(-parseInt(_0x38ad62(0xd2))/0x2)+-parseInt(_0x38ad62(0xe2))/0x3+-parseInt(_0x38ad62(0xc6))/0x4*(-parseInt(_0x38ad62(0xc2))/0x5)+-parseInt(_0x38ad62(0xce))/0x6*(-parseInt(_0x38ad62(0xe4))/0x7)+parseInt(_0x38ad62(0xca))/0x8+parseInt(_0x38ad62(0xb8))/0x9+parseInt(_0x38ad62(0xe6))/0xa*(parseInt(_0x38ad62(0xbe))/0xb);if(_0x3f946a===_0x58b36a)break;else _0x364430['push'](_0x364430['shift']());}catch(_0x59245a){_0x364430['push'](_0x364430['shift']());}}}(a161_0x2ce1,0x872a6));import a161_0x2975cb from'path';import{parse as a161_0x5e0511}from'yaml';function a161_0x1154(_0x568942,_0xd68d9b){_0x568942=_0x568942-0xb8;const _0x2ce147=a161_0x2ce1();let _0x11545b=_0x2ce147[_0x568942];return _0x11545b;}import{nodeFileSystem}from'../io/node-filesystem.js';import{isJourneyDef}from'./journey-yaml.js';export function parsePath(_0x2e6315){const _0x3d3de2=a161_0x1154;if(!_0x2e6315||_0x2e6315[_0x3d3de2(0xda)]()==='')throw new Error(_0x3d3de2(0xc1));const _0x45c8a4=_0x2e6315[_0x3d3de2(0xda)]();if(_0x45c8a4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x2e6315};const _0x596133=_0x45c8a4['startsWith']('/')?_0x45c8a4[_0x3d3de2(0xbf)](0x1):_0x45c8a4,_0x2af71c=_0x596133['split']('/')[_0x3d3de2(0xb9)](_0xff1fcb=>_0xff1fcb!=='');if(_0x2af71c[_0x3d3de2(0xd9)]===0x0)throw new Error(_0x3d3de2(0xe0));const _0x2b9180=_0x45c8a4[_0x3d3de2(0xdd)]('/')||!isRelativePathSegment(_0x2af71c[0x0]);for(const _0x4545ad of _0x2af71c){validatePathSegment(_0x4545ad);}return{'segments':_0x2af71c,'isAbsolute':_0x2b9180,'raw':_0x2e6315};}function isRelativePathSegment(_0x4176f1){return _0x4176f1==='.'||_0x4176f1==='..';}function a161_0x2ce1(){const _0x23587a=['push','1267422AeXNIk','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Relative\x20path\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','112414BrAEmN','exists','replace','File\x20not\x20found:\x20','No\x20tdx.json\x20found\x20for\x20file:\x20','isAbsolute','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','length','trim','relative','root','startsWith','tdx.json','raw','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','endsWith','2849049UArHYE','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','21HRWsFA','slice','6723660bQJFis','name','journey','1865205ikRjcr','filter','.yaml','pop','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','join','22hnYrzR','substring','Path\x20segment\x20cannot\x20be\x20empty','Path\x20cannot\x20be\x20empty','380IBvkBv','Cannot\x20split\x20empty\x20path','13eYoJkq','readFile','928JpUwDS','segments','resolve','parse','245536LUDMud','dirname','.yml'];a161_0x2ce1=function(){return _0x23587a;};return a161_0x2ce1();}function validatePathSegment(_0x517e98){const _0x3a635b=a161_0x1154;if(_0x517e98==='')throw new Error(_0x3a635b(0xc0));if(_0x517e98==='.'||_0x517e98==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x517e98))throw new Error(_0x3a635b(0xd8)+_0x517e98);if(_0x517e98!==_0x517e98[_0x3a635b(0xda)]()){}}export function validatePath(_0x1daff9){const _0x49d1bf=a161_0x1154;if(_0x1daff9['segments'][_0x49d1bf(0xd9)]===0x0&&!_0x1daff9[_0x49d1bf(0xd7)])throw new Error(_0x49d1bf(0xd0));if(_0x1daff9[_0x49d1bf(0xd7)]){if(_0x1daff9[_0x49d1bf(0xc7)][0x0]==='..')throw new Error(_0x49d1bf(0xbc));let _0x424010=0x0;for(const _0x9a0dfd of _0x1daff9[_0x49d1bf(0xc7)]){if(_0x9a0dfd==='..'){if(_0x424010===0x0)throw new Error(_0x49d1bf(0xd1));_0x424010--;}else _0x9a0dfd!=='.'&&_0x424010++;}}}export function joinPaths(_0x305cf5,_0x187293){const _0x57cb4f=a161_0x1154;if(!_0x305cf5||_0x305cf5==='/')return _0x187293;if(!_0x187293||_0x187293==='.')return _0x305cf5;if(_0x187293[_0x57cb4f(0xdd)]('/'))return _0x187293;const _0x591e11=parsePath(_0x305cf5),_0x20b2ae=parsePath(_0x187293),_0x1f523a=[..._0x591e11['segments']];for(const _0x74bfcd of _0x20b2ae[_0x57cb4f(0xc7)]){if(_0x74bfcd==='.')continue;else{if(_0x74bfcd==='..'){if(_0x1f523a['length']===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x1f523a[_0x57cb4f(0xbb)]();}else _0x1f523a['push'](_0x74bfcd);}}const _0x3f71a7=_0x1f523a[_0x57cb4f(0xbd)]('/');return _0x591e11[_0x57cb4f(0xdf)][_0x57cb4f(0xdd)]('/')?'/'+_0x3f71a7:_0x3f71a7;}export function normalizePath(_0x79f988){const _0x590f98=a161_0x1154,_0x212c12=parsePath(_0x79f988),_0x2c15ee=[];for(const _0x36439e of _0x212c12['segments']){if(_0x36439e==='.')continue;else{if(_0x36439e==='..'){if(_0x2c15ee[_0x590f98(0xd9)]===0x0){if(_0x212c12['isAbsolute'])throw new Error('Cannot\x20navigate\x20above\x20root');_0x2c15ee[_0x590f98(0xcd)]('..');}else _0x2c15ee[_0x2c15ee[_0x590f98(0xd9)]-0x1]==='..'?_0x2c15ee[_0x590f98(0xcd)]('..'):_0x2c15ee[_0x590f98(0xbb)]();}else _0x2c15ee[_0x590f98(0xcd)](_0x36439e);}}if(_0x2c15ee[_0x590f98(0xd9)]===0x0)return _0x212c12[_0x590f98(0xd7)]?'/':'.';const _0x5324b2=_0x2c15ee[_0x590f98(0xbd)]('/');return _0x212c12[_0x590f98(0xdf)]['startsWith']('/')?'/'+_0x5324b2:_0x5324b2;}export function getParentPath(_0x3ed2d4){const _0x155b8e=a161_0x1154,_0x4ba7e2=parsePath(_0x3ed2d4);if(_0x4ba7e2[_0x155b8e(0xc7)][_0x155b8e(0xd9)]<=0x1)return'/';const _0xf43c9a=_0x4ba7e2['segments'][_0x155b8e(0xe5)](0x0,-0x1)[_0x155b8e(0xbd)]('/');return _0x4ba7e2['raw']['startsWith']('/')?'/'+_0xf43c9a:_0xf43c9a;}export function getBaseName(_0x18f408){const _0x49d1b6=a161_0x1154,_0x2d332b=parsePath(_0x18f408);return _0x2d332b['segments'][_0x2d332b['segments'][_0x49d1b6(0xd9)]-0x1]||'';}export function isChildPath(_0x4448f4,_0x2f5474){const _0x5b94a2=a161_0x1154,_0x337b9e=parsePath(_0x4448f4),_0x496efc=parsePath(_0x2f5474);if(_0x337b9e[_0x5b94a2(0xc7)][_0x5b94a2(0xd9)]<=_0x496efc[_0x5b94a2(0xc7)][_0x5b94a2(0xd9)])return![];for(let _0x186277=0x0;_0x186277<_0x496efc[_0x5b94a2(0xc7)]['length'];_0x186277++){if(_0x337b9e[_0x5b94a2(0xc7)][_0x186277]!==_0x496efc[_0x5b94a2(0xc7)][_0x186277])return![];}return!![];}export function splitPath(_0x4b24cb){const _0x440da9=a161_0x1154,_0x5f389b=parsePath(_0x4b24cb);if(_0x5f389b[_0x440da9(0xc7)][_0x440da9(0xd9)]===0x0)throw new Error(_0x440da9(0xc3));if(_0x5f389b[_0x440da9(0xc7)][_0x440da9(0xd9)]===0x1)return{'parent':_0x5f389b[_0x440da9(0xc7)][0x0]};return{'parent':_0x5f389b[_0x440da9(0xc7)][0x0],'child':_0x5f389b['segments']['slice'](0x1)[_0x440da9(0xbd)]('/')};}export function isYamlFilePath(_0x5ce7e2){const _0xe0139d=a161_0x1154;return _0x5ce7e2[_0xe0139d(0xe1)](_0xe0139d(0xcc))||_0x5ce7e2[_0xe0139d(0xe1)](_0xe0139d(0xba));}export async function resolveYamlFilePath(_0x4a6268,_0x335e97=nodeFileSystem){const _0x2fa3b6=a161_0x1154,_0x2214f4=a161_0x2975cb[_0x2fa3b6(0xc8)](_0x4a6268);if(!await _0x335e97[_0x2fa3b6(0xd3)](_0x2214f4))throw new Error(_0x2fa3b6(0xd5)+_0x4a6268);let _0x1dbffd=a161_0x2975cb[_0x2fa3b6(0xcb)](_0x2214f4),_0x21cc40=null,_0x444311=null;const _0x482101=a161_0x2975cb[_0x2fa3b6(0xc9)](_0x1dbffd)[_0x2fa3b6(0xdc)];while(_0x1dbffd!==_0x482101){const _0x1e674d=a161_0x2975cb['join'](_0x1dbffd,_0x2fa3b6(0xde));if(await _0x335e97[_0x2fa3b6(0xd3)](_0x1e674d)){_0x21cc40=_0x1e674d,_0x444311=_0x1dbffd;break;}_0x1dbffd=a161_0x2975cb['dirname'](_0x1dbffd);}if(!_0x21cc40||!_0x444311)throw new Error(_0x2fa3b6(0xd6)+_0x4a6268+'\x0a'+_0x2fa3b6(0xcf));const _0x435571=await _0x335e97[_0x2fa3b6(0xc5)](_0x21cc40),_0xd9358e=JSON[_0x2fa3b6(0xc9)](_0x435571),_0x105612=_0xd9358e['parent_segment'];if(!_0x105612)throw new Error(_0x2fa3b6(0xe3));const _0x375314=await _0x335e97['readFile'](_0x2214f4),_0x489845=a161_0x5e0511(_0x375314),_0x2db5cc=_0x489845[_0x2fa3b6(0xe7)];if(!_0x2db5cc)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x4a6268);const _0x2200d9=isJourneyDef(_0x489845,_0x2214f4)?_0x2fa3b6(0xe8):'segment',_0x524ccc=a161_0x2975cb[_0x2fa3b6(0xdb)](_0x444311,_0x2214f4),_0x3aa768=a161_0x2975cb['dirname'](_0x524ccc),_0x5d823e=_0x3aa768==='.'?'':_0x3aa768[_0x2fa3b6(0xd4)](/\\/g,'/'),_0x1e12fe=_0x5d823e?_0x105612+'/'+_0x5d823e+'/'+_0x2db5cc:_0x105612+'/'+_0x2db5cc;return{'parentSegment':_0x105612,'segmentName':_0x2db5cc,'folderPath':_0x5d823e,'fullPath':_0x1e12fe,'resourceType':_0x2200d9,'content':_0x375314};}
@@ -1 +1 @@
1
- function a162_0x260b(_0x77530e,_0x10fd7a){_0x77530e=_0x77530e-0x102;const _0x4e97eb=a162_0x4e97();let _0x260bd8=_0x4e97eb[_0x77530e];return _0x260bd8;}function a162_0x4e97(){const _0x44e765=['160597ecuodq','2192eBshrc','117225pZKaMO','690RzdXkH','633ScPOjK','245012JBQuVY','1245450mBeuVQ','.\x20Child\x20name\x20cannot\x20be\x20empty','745220iIpHXX','.\x20Parent\x20name\x20cannot\x20be\x20empty','19998ABhvxk','Invalid\x20segment\x20reference\x20format:\x20','5fcJVFc','substring','16sJbAFE'];a162_0x4e97=function(){return _0x44e765;};return a162_0x4e97();}(function(_0x5bd5ca,_0x5987f5){const _0x47774a=a162_0x260b,_0x4896dd=_0x5bd5ca();while(!![]){try{const _0x307e9a=-parseInt(_0x47774a(0x10e))/0x1+parseInt(_0x47774a(0x10f))/0x2*(-parseInt(_0x47774a(0x103))/0x3)+parseInt(_0x47774a(0x104))/0x4+-parseInt(_0x47774a(0x10b))/0x5*(-parseInt(_0x47774a(0x105))/0x6)+parseInt(_0x47774a(0x107))/0x7+-parseInt(_0x47774a(0x10d))/0x8*(-parseInt(_0x47774a(0x110))/0x9)+-parseInt(_0x47774a(0x102))/0xa*(-parseInt(_0x47774a(0x109))/0xb);if(_0x307e9a===_0x5987f5)break;else _0x4896dd['push'](_0x4896dd['shift']());}catch(_0x138e23){_0x4896dd['push'](_0x4896dd['shift']());}}}(a162_0x4e97,0x20f0f));export function parseSegmentRef(_0xa78f71){const _0x3a04f6=a162_0x260b,_0x5fb336=_0xa78f71['indexOf']('/');if(_0x5fb336===-0x1)return{'parentId':_0xa78f71};if(_0x5fb336===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xa78f71+_0x3a04f6(0x108));const _0x53cbd0=_0xa78f71['substring'](0x0,_0x5fb336),_0x44338f=_0xa78f71[_0x3a04f6(0x10c)](_0x5fb336+0x1);if(_0x44338f==='')throw new Error(_0x3a04f6(0x10a)+_0xa78f71+_0x3a04f6(0x106));return{'parentId':_0x53cbd0,'childId':_0x44338f};}
1
+ function a162_0x4c62(_0x353d6f,_0x5b2fbf){_0x353d6f=_0x353d6f-0xbf;const _0x39122d=a162_0x3912();let _0x4c62ec=_0x39122d[_0x353d6f];return _0x4c62ec;}function a162_0x3912(){const _0x1c2436=['715092tPMGre','4191PTHDEc','substring','1290vWvCDN','744364cccaMm','616080FyfCrt','.\x20Child\x20name\x20cannot\x20be\x20empty','7ZvNcOh','100078omfCxl','1615740kQyeVw','374103GHtdHb','indexOf','Invalid\x20segment\x20reference\x20format:\x20','3KozCvy','8fHJevw'];a162_0x3912=function(){return _0x1c2436;};return a162_0x3912();}(function(_0x2668fc,_0x1915b1){const _0x5f44bb=a162_0x4c62,_0x20ff7c=_0x2668fc();while(!![]){try{const _0x24493c=parseInt(_0x5f44bb(0xc6))/0x1*(parseInt(_0x5f44bb(0xc7))/0x2)+-parseInt(_0x5f44bb(0xcc))/0x3*(-parseInt(_0x5f44bb(0xc3))/0x4)+-parseInt(_0x5f44bb(0xc8))/0x5+-parseInt(_0x5f44bb(0xc4))/0x6+-parseInt(_0x5f44bb(0xbf))/0x7*(-parseInt(_0x5f44bb(0xcd))/0x8)+-parseInt(_0x5f44bb(0xc9))/0x9+parseInt(_0x5f44bb(0xc2))/0xa*(parseInt(_0x5f44bb(0xc0))/0xb);if(_0x24493c===_0x1915b1)break;else _0x20ff7c['push'](_0x20ff7c['shift']());}catch(_0x241e32){_0x20ff7c['push'](_0x20ff7c['shift']());}}}(a162_0x3912,0x35c72));export function parseSegmentRef(_0x3d499d){const _0xea379c=a162_0x4c62,_0x53a723=_0x3d499d[_0xea379c(0xca)]('/');if(_0x53a723===-0x1)return{'parentId':_0x3d499d};if(_0x53a723===0x0)throw new Error(_0xea379c(0xcb)+_0x3d499d+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x1e2567=_0x3d499d[_0xea379c(0xc1)](0x0,_0x53a723),_0x500c2f=_0x3d499d[_0xea379c(0xc1)](_0x53a723+0x1);if(_0x500c2f==='')throw new Error(_0xea379c(0xcb)+_0x3d499d+_0xea379c(0xc5));return{'parentId':_0x1e2567,'childId':_0x500c2f};}
@@ -1 +1 @@
1
- (function(_0x6d8b4a,_0x513294){const _0x242f5d=a163_0x5d63,_0x134e7c=_0x6d8b4a();while(!![]){try{const _0xe09cdc=parseInt(_0x242f5d(0x1ac))/0x1+-parseInt(_0x242f5d(0x16c))/0x2*(parseInt(_0x242f5d(0x16f))/0x3)+-parseInt(_0x242f5d(0x19c))/0x4+-parseInt(_0x242f5d(0x1ab))/0x5*(-parseInt(_0x242f5d(0x180))/0x6)+-parseInt(_0x242f5d(0x167))/0x7+parseInt(_0x242f5d(0x1a4))/0x8*(-parseInt(_0x242f5d(0x160))/0x9)+parseInt(_0x242f5d(0x168))/0xa;if(_0xe09cdc===_0x513294)break;else _0x134e7c['push'](_0x134e7c['shift']());}catch(_0x7d05d4){_0x134e7c['push'](_0x134e7c['shift']());}}}(a163_0x4501,0x52363));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';function a163_0x4501(){const _0x4f849f=['name','params','8094QwUrit','arrayMatching','skipSchema','Attribute\x20name\x20cannot\x20be\x20empty','length','push','invalid_value','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','MISSING_NAME','includes','endsWith','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','MISSING_SEGMENT_REFERENCE','NESTED_CONDITION_GROUP','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','description','\x27\x20with\x20attribute\x20\x27','SEGMENT_SCHEMA_ERROR','source','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','symbol','MISSING_TIME_UNIT','BEHAVIOR_SOURCE_MISSING_FILTER','.operator.value','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','data','MISSING_BETWEEN_BOUNDS','1785148UwdeyM','Operator\x20\x27','INVALID_ARRAY_MATCHING','.attribute','.segment','Composite','error','type','224NWfWMz','validationCode','.conditions[','path','match','INVALID_RULE_TYPE','success','925vKnNnk','283162nAzfth','operator','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','safeParse','TimeWithinNext','rule.type','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','92997FWoXTZ','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','rule','code','.filter','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','1500401BoHhhy','9846220JKZtkU','warning','attribute','Behavior\x20source\x20\x27','57664nclMWM','EMPTY_CONDITIONS','.source','24dxjKbz','custom','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','.conditions','MISSING_CONDITIONS','issues','filter','map','document','conditions','And','level','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','EMPTY_ATTRIBUTE','MISSING_OPERATOR_VALUE'];a163_0x4501=function(){return _0x4f849f;};return a163_0x4501();}import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x33176a,_0x454673={},_0x3dda7a={}){const _0x32b680=a163_0x5d63;if(_0x3dda7a[_0x32b680(0x182)])return runSemanticChecks(_0x33176a,_0x454673);const _0x39a373=SegmentDefSchema[_0x32b680(0x1af)](_0x33176a);if(_0x39a373[_0x32b680(0x1aa)])return runSemanticChecks(_0x39a373[_0x32b680(0x19a)],_0x454673);return zodErrorsToValidationResult(_0x39a373['error'],_0x454673);}export function validateRuleDef(_0x2c2192,_0x1a9a1e,_0x494254){const _0x3abbe7=a163_0x5d63;if(!_0x2c2192)return[];const _0x119558=RuleDefSchema['safeParse'](_0x2c2192);if(_0x119558[_0x3abbe7(0x1aa)])return checkRule(_0x119558[_0x3abbe7(0x19a)],_0x1a9a1e,_0x494254);const _0xe9c4ab=flattenZodIssues(_0x119558[_0x3abbe7(0x1a2)][_0x3abbe7(0x174)]);return _0xe9c4ab['map'](_0x7a9457=>{const _0x123519=_0x3abbe7,_0x23233c=formatZodPath(_0x7a9457[_0x123519(0x1a7)]),_0x1ff034=_0x23233c?_0x1a9a1e+'.'+_0x23233c:_0x1a9a1e,_0x59bf4b=mapZodIssueToCode(_0x7a9457,_0x23233c),_0x10151d=getLocationFromPath(_0x494254[_0x123519(0x177)],_0x494254['source'],pathToArray(_0x1ff034));return{'level':_0x123519(0x1a2),'path':_0x1ff034,'code':_0x59bf4b,'message':_0x7a9457['message'],..._0x10151d&&{'location':_0x10151d}};});}function zodErrorsToValidationResult(_0x5d493b,_0x6daa01){const _0x3f2a0c=a163_0x5d63,_0x269812=flattenZodIssues(_0x5d493b['issues']),_0x726eab=_0x269812[_0x3f2a0c(0x176)](_0x46dd15=>{const _0x33c069=_0x3f2a0c,_0x38cf1d=formatZodPath(_0x46dd15[_0x33c069(0x1a7)]),_0x47ed7c=mapZodIssueToCode(_0x46dd15,_0x38cf1d),_0x361a34=getLocationFromPath(_0x6daa01['document'],_0x6daa01[_0x33c069(0x193)],_0x46dd15[_0x33c069(0x1a7)][_0x33c069(0x176)](_0x95a66a=>typeof _0x95a66a===_0x33c069(0x195)?String(_0x95a66a):_0x95a66a));return{'level':_0x33c069(0x1a2),'path':_0x38cf1d,'code':_0x47ed7c,'message':_0x46dd15['message'],..._0x361a34&&{'location':_0x361a34}};});return{'valid':![],'errors':_0x726eab,'warnings':[]};}function mapZodIssueToCode(_0x58abe9,_0xfc64f3){const _0x252b01=a163_0x5d63,_0x387998=_0x58abe9[_0x252b01(0x163)]===_0x252b01(0x170)?_0x58abe9[_0x252b01(0x17f)]:undefined;if(_0xfc64f3===_0x252b01(0x17e))return _0x252b01(0x189);if(_0xfc64f3===_0x252b01(0x15e)||_0xfc64f3[_0x252b01(0x18b)]('.type')){if(_0x58abe9['code']===_0x252b01(0x186)){if(_0xfc64f3==='rule.type'||_0xfc64f3[_0x252b01(0x1a8)](/\.conditions\[\d+\]\.type$/))return _0x252b01(0x1a9);}}if(_0xfc64f3[_0x252b01(0x18b)]('.operator.type'))return'INVALID_OPERATOR_TYPE';if(_0xfc64f3['endsWith'](_0x252b01(0x198)))return _0x252b01(0x17d);if(_0x387998?.['validationCode']===_0x252b01(0x19b))return _0x252b01(0x19b);if(_0x387998?.[_0x252b01(0x1a5)]===_0x252b01(0x196))return _0x252b01(0x196);if(_0xfc64f3[_0x252b01(0x18b)](_0x252b01(0x172))||_0xfc64f3===_0x252b01(0x178))return _0x252b01(0x173);if(_0xfc64f3[_0x252b01(0x18a)](_0x252b01(0x181)))return _0x252b01(0x19e);if(_0xfc64f3['endsWith'](_0x252b01(0x1a0)))return _0x252b01(0x18d);return _0x252b01(0x192);}function runSemanticChecks(_0x5378de,_0x3c2d12){const _0x36c64e=a163_0x5d63,_0x10dd9c=[];_0x5378de[_0x36c64e(0x162)]&&_0x10dd9c[_0x36c64e(0x185)](...checkRule(_0x5378de[_0x36c64e(0x162)],_0x36c64e(0x162),_0x3c2d12));const _0x500ce3=_0x10dd9c['filter'](_0x59ffa3=>_0x59ffa3[_0x36c64e(0x17a)]===_0x36c64e(0x1a2)),_0x1eb3d6=_0x10dd9c[_0x36c64e(0x175)](_0x109af4=>_0x109af4[_0x36c64e(0x17a)]===_0x36c64e(0x169));return{'valid':_0x500ce3[_0x36c64e(0x184)]===0x0,'errors':_0x500ce3,'warnings':_0x1eb3d6};}function checkRule(_0x5d51a8,_0x521514,_0x13159e){const _0x51d64b=a163_0x5d63,_0x294aa6=[];if(_0x5d51a8['conditions'][_0x51d64b(0x184)]===0x0)return _0x294aa6[_0x51d64b(0x185)]({'level':_0x51d64b(0x1a2),'path':_0x521514+_0x51d64b(0x172),'code':_0x51d64b(0x16d),'message':_0x51d64b(0x188),'location':getLocationFromPath(_0x13159e[_0x51d64b(0x177)],_0x13159e[_0x51d64b(0x193)],pathToArray(_0x521514+_0x51d64b(0x172)))}),_0x294aa6;return _0x294aa6[_0x51d64b(0x185)](...checkConditions(_0x5d51a8[_0x51d64b(0x178)],_0x521514,_0x13159e)),_0x294aa6;}function a163_0x5d63(_0x1319a8,_0x3c6345){_0x1319a8=_0x1319a8-0x15d;const _0x45010c=a163_0x4501();let _0x5d6382=_0x45010c[_0x1319a8];return _0x5d6382;}function checkConditions(_0x36f59c,_0x22d440,_0x407f06){const _0x322daa=a163_0x5d63,_0x58817e=[];for(let _0x320b70=0x0;_0x320b70<_0x36f59c[_0x322daa(0x184)];_0x320b70++){const _0x4cb4af=_0x36f59c[_0x320b70],_0x1ddf81=_0x22d440+_0x322daa(0x1a6)+_0x320b70+']';_0x58817e[_0x322daa(0x185)](...checkCondition(_0x4cb4af,_0x1ddf81,_0x407f06));}return _0x58817e;}function checkCondition(_0x4846aa,_0x5627a9,_0x1e3f3a){const _0x284cc8=a163_0x5d63,_0x4d7ed9=[];if(_0x4846aa[_0x284cc8(0x1a3)]===_0x284cc8(0x179)||_0x4846aa[_0x284cc8(0x1a3)]==='Or'||_0x4846aa[_0x284cc8(0x1a3)]===_0x284cc8(0x1a1)){if(_0x4846aa[_0x284cc8(0x178)][_0x284cc8(0x184)]===0x0)_0x4d7ed9[_0x284cc8(0x185)]({'level':_0x284cc8(0x1a2),'path':_0x5627a9+'.conditions','code':'EMPTY_CONDITIONS','message':_0x4846aa[_0x284cc8(0x1a3)]+'\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','location':getLocationFromPath(_0x1e3f3a['document'],_0x1e3f3a['source'],pathToArray(_0x5627a9+_0x284cc8(0x172)))});else{const _0x4544c1=_0x4846aa[_0x284cc8(0x190)]!==undefined,_0x587a55=_0x4846aa[_0x284cc8(0x1a3)]==='Composite';!_0x4544c1&&!_0x587a55&&_0x4d7ed9[_0x284cc8(0x185)]({'level':_0x284cc8(0x169),'path':_0x5627a9,'code':_0x284cc8(0x18e),'message':_0x4846aa['type']+_0x284cc8(0x187)+_0x284cc8(0x18f)+_0x284cc8(0x17b),'location':getLocationFromPath(_0x1e3f3a[_0x284cc8(0x177)],_0x1e3f3a[_0x284cc8(0x193)],pathToArray(_0x5627a9))}),_0x4d7ed9[_0x284cc8(0x185)](...checkConditions(_0x4846aa[_0x284cc8(0x178)],_0x5627a9,_0x1e3f3a));}return _0x4d7ed9;}if(_0x4846aa[_0x284cc8(0x1a3)]==='Value'||_0x4846aa[_0x284cc8(0x1a3)]==='Behavior'){const _0x1a39ff=_0x4846aa,_0x4312ba=_0x1a39ff[_0x284cc8(0x193)],_0x5114e6=_0x1a39ff['aggregation'],_0x270e9e=_0x4312ba||_0x5114e6,_0x9fea90=_0x1a39ff[_0x284cc8(0x1ad)]?.[_0x284cc8(0x1a3)];if((_0x9fea90==='TimeWithinPast'||_0x9fea90===_0x284cc8(0x15d))&&_0x1a39ff[_0x284cc8(0x1ad)]?.['not']!==undefined){const _0x45397f=_0x1a39ff[_0x284cc8(0x1ad)]['not']===!![];_0x4d7ed9['push']({'level':_0x45397f?_0x284cc8(0x1a2):'warning','path':_0x5627a9+'.operator.not','code':'TEMPORAL_NEGATION_UNSUPPORTED','message':_0x45397f?_0x284cc8(0x19d)+_0x9fea90+_0x284cc8(0x15f)+_0x284cc8(0x161)+_0x284cc8(0x194):_0x284cc8(0x19d)+_0x9fea90+_0x284cc8(0x18c)+_0x284cc8(0x1ae),'location':getLocationFromPath(_0x1e3f3a['document'],_0x1e3f3a['source'],pathToArray(_0x5627a9+'.operator.not'))});}(!_0x1a39ff[_0x284cc8(0x16a)]||_0x1a39ff[_0x284cc8(0x16a)]==='')&&(!_0x270e9e&&_0x4d7ed9[_0x284cc8(0x185)]({'level':'error','path':_0x5627a9+_0x284cc8(0x19f),'code':_0x284cc8(0x17c),'message':_0x284cc8(0x183),'location':getLocationFromPath(_0x1e3f3a['document'],_0x1e3f3a[_0x284cc8(0x193)],pathToArray(_0x5627a9+_0x284cc8(0x19f)))}));_0x1a39ff[_0x284cc8(0x175)]&&_0x4d7ed9[_0x284cc8(0x185)](...checkRule(_0x1a39ff['filter'],_0x5627a9+_0x284cc8(0x164),_0x1e3f3a));if(_0x1a39ff[_0x284cc8(0x193)]){const _0x24683d=_0x1a39ff[_0x284cc8(0x16a)]&&_0x1a39ff[_0x284cc8(0x16a)]!=='';_0x24683d&&!_0x1a39ff['filter']&&_0x4d7ed9['push']({'level':'error','path':_0x5627a9+_0x284cc8(0x16e),'code':_0x284cc8(0x197),'message':_0x284cc8(0x16b)+_0x1a39ff['source']+_0x284cc8(0x191)+_0x1a39ff[_0x284cc8(0x16a)]+'\x27\x20'+_0x284cc8(0x166)+_0x284cc8(0x171)+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x1e3f3a['document'],_0x1e3f3a[_0x284cc8(0x193)],pathToArray(_0x5627a9+'.source'))}),_0x24683d&&_0x1a39ff['filter']&&_0x4d7ed9['push']({'level':_0x284cc8(0x169),'path':_0x5627a9+_0x284cc8(0x19f),'code':_0x284cc8(0x165),'message':'Attribute\x20\x27'+_0x1a39ff[_0x284cc8(0x16a)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0x284cc8(0x199),'location':getLocationFromPath(_0x1e3f3a[_0x284cc8(0x177)],_0x1e3f3a[_0x284cc8(0x193)],pathToArray(_0x5627a9+_0x284cc8(0x19f)))});}}return _0x4d7ed9;}
1
+ (function(_0x237a65,_0xf9f58f){const _0x4f9b81=a163_0x48a0,_0x1be824=_0x237a65();while(!![]){try{const _0x175eab=parseInt(_0x4f9b81(0xe4))/0x1*(parseInt(_0x4f9b81(0x100))/0x2)+-parseInt(_0x4f9b81(0xfa))/0x3*(parseInt(_0x4f9b81(0x121))/0x4)+parseInt(_0x4f9b81(0xf6))/0x5+parseInt(_0x4f9b81(0xfd))/0x6+-parseInt(_0x4f9b81(0xe5))/0x7*(-parseInt(_0x4f9b81(0x12a))/0x8)+parseInt(_0x4f9b81(0x112))/0x9+-parseInt(_0x4f9b81(0xec))/0xa;if(_0x175eab===_0xf9f58f)break;else _0x1be824['push'](_0x1be824['shift']());}catch(_0xf1f06c){_0x1be824['push'](_0x1be824['shift']());}}}(a163_0x8484,0x935a2));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x9421e5,_0x32b544={},_0x1f8fb6={}){const _0x56e330=a163_0x48a0;if(_0x1f8fb6['skipSchema'])return runSemanticChecks(_0x9421e5,_0x32b544);const _0x31bf8c=SegmentDefSchema[_0x56e330(0xe1)](_0x9421e5);if(_0x31bf8c[_0x56e330(0xe0)])return runSemanticChecks(_0x31bf8c[_0x56e330(0x101)],_0x32b544);return zodErrorsToValidationResult(_0x31bf8c[_0x56e330(0x105)],_0x32b544);}export function validateRuleDef(_0x414f81,_0x478e99,_0x4539b2){const _0x5459bc=a163_0x48a0;if(!_0x414f81)return[];const _0x296571=RuleDefSchema[_0x5459bc(0xe1)](_0x414f81);if(_0x296571['success'])return checkRule(_0x296571[_0x5459bc(0x101)],_0x478e99,_0x4539b2);const _0x2bb173=flattenZodIssues(_0x296571[_0x5459bc(0x105)]['issues']);return _0x2bb173['map'](_0x310e53=>{const _0x85edc6=_0x5459bc,_0x320198=formatZodPath(_0x310e53[_0x85edc6(0xea)]),_0x2af466=_0x320198?_0x478e99+'.'+_0x320198:_0x478e99,_0x5f1798=mapZodIssueToCode(_0x310e53,_0x320198),_0x17a4bc=getLocationFromPath(_0x4539b2[_0x85edc6(0x10a)],_0x4539b2[_0x85edc6(0xed)],pathToArray(_0x2af466));return{'level':_0x85edc6(0x105),'path':_0x2af466,'code':_0x5f1798,'message':_0x310e53[_0x85edc6(0xf3)],..._0x17a4bc&&{'location':_0x17a4bc}};});}function zodErrorsToValidationResult(_0x1b0d9e,_0x2e8895){const _0x2e503b=a163_0x48a0,_0x5d7b3a=flattenZodIssues(_0x1b0d9e[_0x2e503b(0x12b)]),_0x3909a8=_0x5d7b3a['map'](_0x5160c0=>{const _0x104db1=_0x2e503b,_0x479bba=formatZodPath(_0x5160c0[_0x104db1(0xea)]),_0x555a3=mapZodIssueToCode(_0x5160c0,_0x479bba),_0x76793e=getLocationFromPath(_0x2e8895[_0x104db1(0x10a)],_0x2e8895[_0x104db1(0xed)],_0x5160c0[_0x104db1(0xea)][_0x104db1(0x11d)](_0x1e6de8=>typeof _0x1e6de8===_0x104db1(0x10d)?String(_0x1e6de8):_0x1e6de8));return{'level':_0x104db1(0x105),'path':_0x479bba,'code':_0x555a3,'message':_0x5160c0[_0x104db1(0xf3)],..._0x76793e&&{'location':_0x76793e}};});return{'valid':![],'errors':_0x3909a8,'warnings':[]};}function mapZodIssueToCode(_0x50fe0d,_0xd31ab8){const _0x475511=a163_0x48a0,_0x35e7f4=_0x50fe0d[_0x475511(0xdf)]==='custom'?_0x50fe0d[_0x475511(0x117)]:undefined;if(_0xd31ab8===_0x475511(0x10c))return _0x475511(0xe8);if(_0xd31ab8===_0x475511(0x12d)||_0xd31ab8[_0x475511(0xfc)](_0x475511(0x102))){if(_0x50fe0d[_0x475511(0xdf)]===_0x475511(0xf9)){if(_0xd31ab8===_0x475511(0x12d)||_0xd31ab8[_0x475511(0x115)](/\.conditions\[\d+\]\.type$/))return _0x475511(0xe7);}}if(_0xd31ab8[_0x475511(0xfc)]('.operator.type'))return _0x475511(0xfe);if(_0xd31ab8[_0x475511(0xfc)](_0x475511(0xf1)))return _0x475511(0x11c);if(_0x35e7f4?.['validationCode']==='MISSING_BETWEEN_BOUNDS')return _0x475511(0xf8);if(_0x35e7f4?.[_0x475511(0xee)]==='MISSING_TIME_UNIT')return'MISSING_TIME_UNIT';if(_0xd31ab8[_0x475511(0xfc)](_0x475511(0x10e))||_0xd31ab8===_0x475511(0x110))return _0x475511(0x12e);if(_0xd31ab8['includes'](_0x475511(0x124)))return _0x475511(0x118);if(_0xd31ab8[_0x475511(0xfc)](_0x475511(0x113)))return'MISSING_SEGMENT_REFERENCE';return'SEGMENT_SCHEMA_ERROR';}function runSemanticChecks(_0x468b8d,_0x8b1a50){const _0x22a2eb=a163_0x48a0,_0x5d8ff8=[];_0x468b8d['rule']&&_0x5d8ff8[_0x22a2eb(0xe6)](...checkRule(_0x468b8d[_0x22a2eb(0xe3)],_0x22a2eb(0xe3),_0x8b1a50));const _0x5a72b2=_0x5d8ff8[_0x22a2eb(0x116)](_0x13e7d6=>_0x13e7d6['level']===_0x22a2eb(0x105)),_0x490343=_0x5d8ff8['filter'](_0x8a60b0=>_0x8a60b0[_0x22a2eb(0x107)]===_0x22a2eb(0x11a));return{'valid':_0x5a72b2[_0x22a2eb(0x127)]===0x0,'errors':_0x5a72b2,'warnings':_0x490343};}function checkRule(_0x51c580,_0x17a485,_0x331963){const _0x1c2d09=a163_0x48a0,_0x5d3268=[];if(_0x51c580[_0x1c2d09(0x110)][_0x1c2d09(0x127)]===0x0)return _0x5d3268[_0x1c2d09(0xe6)]({'level':_0x1c2d09(0x105),'path':_0x17a485+_0x1c2d09(0x10e),'code':_0x1c2d09(0x108),'message':_0x1c2d09(0xde),'location':getLocationFromPath(_0x331963['document'],_0x331963[_0x1c2d09(0xed)],pathToArray(_0x17a485+_0x1c2d09(0x10e)))}),_0x5d3268;return _0x5d3268[_0x1c2d09(0xe6)](...checkConditions(_0x51c580[_0x1c2d09(0x110)],_0x17a485,_0x331963)),_0x5d3268;}function checkConditions(_0xf0cb8d,_0x3655ab,_0x59c5de){const _0x7d818d=a163_0x48a0,_0x1613f6=[];for(let _0x58f4cc=0x0;_0x58f4cc<_0xf0cb8d['length'];_0x58f4cc++){const _0x4b7d2b=_0xf0cb8d[_0x58f4cc],_0xca286b=_0x3655ab+_0x7d818d(0x106)+_0x58f4cc+']';_0x1613f6['push'](...checkCondition(_0x4b7d2b,_0xca286b,_0x59c5de));}return _0x1613f6;}function checkCondition(_0x1c1362,_0x30c1fa,_0x1cf761){const _0x3fa41e=a163_0x48a0,_0x5c1454=[];if(_0x1c1362[_0x3fa41e(0xf5)]==='And'||_0x1c1362[_0x3fa41e(0xf5)]==='Or'||_0x1c1362[_0x3fa41e(0xf5)]===_0x3fa41e(0x10f)){if(_0x1c1362['conditions'][_0x3fa41e(0x127)]===0x0)_0x5c1454[_0x3fa41e(0xe6)]({'level':_0x3fa41e(0x105),'path':_0x30c1fa+'.conditions','code':_0x3fa41e(0x108),'message':_0x1c1362[_0x3fa41e(0xf5)]+'\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','location':getLocationFromPath(_0x1cf761[_0x3fa41e(0x10a)],_0x1cf761[_0x3fa41e(0xed)],pathToArray(_0x30c1fa+_0x3fa41e(0x10e)))});else{const _0x109587=_0x1c1362[_0x3fa41e(0x11f)]!==undefined,_0x41fec0=_0x1c1362[_0x3fa41e(0xf5)]===_0x3fa41e(0x10f);!_0x109587&&!_0x41fec0&&_0x5c1454[_0x3fa41e(0xe6)]({'level':'warning','path':_0x30c1fa,'code':_0x3fa41e(0xf4),'message':_0x1c1362[_0x3fa41e(0xf5)]+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+_0x3fa41e(0x103)+_0x3fa41e(0xef),'location':getLocationFromPath(_0x1cf761[_0x3fa41e(0x10a)],_0x1cf761['source'],pathToArray(_0x30c1fa))}),_0x5c1454[_0x3fa41e(0xe6)](...checkConditions(_0x1c1362['conditions'],_0x30c1fa,_0x1cf761));}return _0x5c1454;}if(_0x1c1362[_0x3fa41e(0xf5)]===_0x3fa41e(0x111)||_0x1c1362[_0x3fa41e(0xf5)]===_0x3fa41e(0x11e)){const _0x298a7d=_0x1c1362,_0x379837=_0x298a7d[_0x3fa41e(0xed)],_0x9ca227=_0x298a7d[_0x3fa41e(0xff)],_0xea5bf1=_0x379837||_0x9ca227,_0x1fbda5=_0x298a7d[_0x3fa41e(0x120)]?.[_0x3fa41e(0xf5)];if((_0x1fbda5===_0x3fa41e(0x126)||_0x1fbda5===_0x3fa41e(0xf7))&&_0x298a7d[_0x3fa41e(0x120)]?.[_0x3fa41e(0x129)]!==undefined){const _0xe63980=_0x298a7d[_0x3fa41e(0x120)][_0x3fa41e(0x129)]===!![];_0x5c1454[_0x3fa41e(0xe6)]({'level':_0xe63980?_0x3fa41e(0x105):'warning','path':_0x30c1fa+_0x3fa41e(0x125),'code':_0x3fa41e(0x109),'message':_0xe63980?_0x3fa41e(0xeb)+_0x1fbda5+_0x3fa41e(0xe2)+'The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20'+_0x3fa41e(0x123):_0x3fa41e(0xeb)+_0x1fbda5+_0x3fa41e(0xfb)+_0x3fa41e(0xf0),'location':getLocationFromPath(_0x1cf761[_0x3fa41e(0x10a)],_0x1cf761[_0x3fa41e(0xed)],pathToArray(_0x30c1fa+'.operator.not'))});}(!_0x298a7d[_0x3fa41e(0x114)]||_0x298a7d[_0x3fa41e(0x114)]==='')&&(!_0xea5bf1&&_0x5c1454[_0x3fa41e(0xe6)]({'level':_0x3fa41e(0x105),'path':_0x30c1fa+_0x3fa41e(0x104),'code':'EMPTY_ATTRIBUTE','message':_0x3fa41e(0x122),'location':getLocationFromPath(_0x1cf761['document'],_0x1cf761[_0x3fa41e(0xed)],pathToArray(_0x30c1fa+_0x3fa41e(0x104)))}));_0x298a7d[_0x3fa41e(0x116)]&&_0x5c1454['push'](...checkRule(_0x298a7d[_0x3fa41e(0x116)],_0x30c1fa+_0x3fa41e(0x119),_0x1cf761));if(_0x298a7d[_0x3fa41e(0xed)]){const _0x1a0313=_0x298a7d['attribute']&&_0x298a7d['attribute']!=='';_0x1a0313&&!_0x298a7d[_0x3fa41e(0x116)]&&_0x5c1454['push']({'level':_0x3fa41e(0x105),'path':_0x30c1fa+_0x3fa41e(0xe9),'code':'BEHAVIOR_SOURCE_MISSING_FILTER','message':_0x3fa41e(0x128)+_0x298a7d[_0x3fa41e(0xed)]+'\x27\x20with\x20attribute\x20\x27'+_0x298a7d[_0x3fa41e(0x114)]+'\x27\x20'+_0x3fa41e(0x11b)+_0x3fa41e(0x10b)+_0x3fa41e(0x12c),'location':getLocationFromPath(_0x1cf761['document'],_0x1cf761[_0x3fa41e(0xed)],pathToArray(_0x30c1fa+_0x3fa41e(0xe9)))}),_0x1a0313&&_0x298a7d[_0x3fa41e(0x116)]&&_0x5c1454['push']({'level':_0x3fa41e(0x11a),'path':_0x30c1fa+_0x3fa41e(0x104),'code':'BEHAVIOR_SOURCE_WITH_ATTRIBUTE','message':_0x3fa41e(0xf2)+_0x298a7d[_0x3fa41e(0x114)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x1cf761[_0x3fa41e(0x10a)],_0x1cf761[_0x3fa41e(0xed)],pathToArray(_0x30c1fa+_0x3fa41e(0x104)))});}}return _0x5c1454;}function a163_0x48a0(_0x5ed741,_0x2da345){_0x5ed741=_0x5ed741-0xde;const _0x8484f3=a163_0x8484();let _0x48a011=_0x8484f3[_0x5ed741];return _0x48a011;}function a163_0x8484(){const _0x18cfdc=['INVALID_RULE_TYPE','MISSING_NAME','.source','path','Operator\x20\x27','23134700VImDGA','source','validationCode','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','.operator.value','Attribute\x20\x27','message','NESTED_CONDITION_GROUP','type','5414215aRuXLP','TimeWithinNext','MISSING_BETWEEN_BOUNDS','invalid_value','36GkegTg','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','endsWith','5681994gcvKZq','INVALID_OPERATOR_TYPE','aggregation','282lcDnBj','data','.type','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','.attribute','error','.conditions[','level','EMPTY_CONDITIONS','TEMPORAL_NEGATION_UNSUPPORTED','document','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','name','symbol','.conditions','Composite','conditions','Value','668205IMdUCd','.segment','attribute','match','filter','params','INVALID_ARRAY_MATCHING','.filter','warning','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','MISSING_OPERATOR_VALUE','map','Behavior','description','operator','96532dkcdbn','Attribute\x20name\x20cannot\x20be\x20empty','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','arrayMatching','.operator.not','TimeWithinPast','length','Behavior\x20source\x20\x27','not','76312XXoboU','issues','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','rule.type','MISSING_CONDITIONS','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','code','success','safeParse','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','rule','107YyBzyx','798cdOTUF','push'];a163_0x8484=function(){return _0x18cfdc;};return a163_0x8484();}