@treasuredata/tdx 2026.3.48 → 2026.3.49

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 (255) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.d.ts +22 -0
  12. package/dist/commands/auth-command.d.ts.map +1 -1
  13. package/dist/commands/auth-command.js +1 -1
  14. package/dist/commands/auth-command.js.map +1 -1
  15. package/dist/commands/cas-command.js +1 -1
  16. package/dist/commands/cas-segment-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/databases.js +1 -1
  24. package/dist/commands/delivery-command.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-campaign-pull-command.js +1 -1
  27. package/dist/commands/engage-campaign-push-command.js +1 -1
  28. package/dist/commands/engage-campaign-validate-command.js +1 -1
  29. package/dist/commands/engage-command.js +1 -1
  30. package/dist/commands/engage-template-pull-command.js +1 -1
  31. package/dist/commands/engage-template-push-command.js +1 -1
  32. package/dist/commands/engage-template-validate-command.js +1 -1
  33. package/dist/commands/job-command.js +1 -1
  34. package/dist/commands/journey-command.js +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.d.ts +5 -5
  41. package/dist/commands/profile-command.d.ts.map +1 -1
  42. package/dist/commands/profile-command.js +1 -1
  43. package/dist/commands/profile-command.js.map +1 -1
  44. package/dist/commands/profiles-command.js +1 -1
  45. package/dist/commands/query-command.js +1 -1
  46. package/dist/commands/schedule-command.js +1 -1
  47. package/dist/commands/segment-command.js +1 -1
  48. package/dist/commands/segment-create-command.js +1 -1
  49. package/dist/commands/segment-fields-command.js +1 -1
  50. package/dist/commands/segment-pull-command.js +1 -1
  51. package/dist/commands/segment-push-command.js +1 -1
  52. package/dist/commands/segment-update-command.js +1 -1
  53. package/dist/commands/segment-use-command.js +1 -1
  54. package/dist/commands/segment-validate-command.js +1 -1
  55. package/dist/commands/segments.js +1 -1
  56. package/dist/commands/show.js +1 -1
  57. package/dist/commands/status-command.js +1 -1
  58. package/dist/commands/tables.js +1 -1
  59. package/dist/commands/unset-command.js +1 -1
  60. package/dist/commands/upgrade-command.js +1 -1
  61. package/dist/commands/use-command.js +1 -1
  62. package/dist/commands/user-command.js +1 -1
  63. package/dist/commands/work-command.js +1 -1
  64. package/dist/commands/workflow-command.js +1 -1
  65. package/dist/core/auth.js +1 -1
  66. package/dist/core/command-output.js +1 -1
  67. package/dist/core/config.js +1 -1
  68. package/dist/core/connection-cache.js +1 -1
  69. package/dist/core/constants.js +1 -1
  70. package/dist/core/credential-cache.js +1 -1
  71. package/dist/core/global-context.js +1 -1
  72. package/dist/core/keychain.js +1 -1
  73. package/dist/core/oauth-keychain.js +1 -1
  74. package/dist/core/oauth.d.ts +12 -8
  75. package/dist/core/oauth.d.ts.map +1 -1
  76. package/dist/core/oauth.js +1 -1
  77. package/dist/core/oauth.js.map +1 -1
  78. package/dist/core/profile.js +1 -1
  79. package/dist/core/project-config.js +1 -1
  80. package/dist/core/session.js +1 -1
  81. package/dist/core/user-cache.js +1 -1
  82. package/dist/core/version.js +1 -1
  83. package/dist/index.js +1 -1
  84. package/dist/mcp/server.js +1 -1
  85. package/dist/mcp/tools/index.js +1 -1
  86. package/dist/mcp/tools/tdx-run.js +1 -1
  87. package/dist/mcp/tools/tdx-search.js +1 -1
  88. package/dist/mcp/utils.d.ts.map +1 -1
  89. package/dist/mcp/utils.js +1 -1
  90. package/dist/mcp/utils.js.map +1 -1
  91. package/dist/proxy/claude-usage-tracker.js +1 -1
  92. package/dist/proxy/passthrough-server.js +1 -1
  93. package/dist/proxy/sse-usage-parser.js +1 -1
  94. package/dist/sdk/agent/agent-config.js +1 -1
  95. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  96. package/dist/sdk/agent/agent-yaml.js +1 -1
  97. package/dist/sdk/agent/test/evaluator.js +1 -1
  98. package/dist/sdk/agent/test/executor.js +1 -1
  99. package/dist/sdk/agent/test/index.js +1 -1
  100. package/dist/sdk/agent/test/output.js +1 -1
  101. package/dist/sdk/agent/test/parser.js +1 -1
  102. package/dist/sdk/agent/tool-target-registry.js +1 -1
  103. package/dist/sdk/api.js +1 -1
  104. package/dist/sdk/cas/cas-api-client.js +1 -1
  105. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  106. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  107. package/dist/sdk/cas/index.js +1 -1
  108. package/dist/sdk/cas/pull-workflow.js +1 -1
  109. package/dist/sdk/cas/push-workflow.js +1 -1
  110. package/dist/sdk/client/cdp-api-client.js +1 -1
  111. package/dist/sdk/client/delivery-api-client.js +1 -1
  112. package/dist/sdk/client/endpoints.js +1 -1
  113. package/dist/sdk/client/engage-api-client.js +1 -1
  114. package/dist/sdk/client/http-client.js +1 -1
  115. package/dist/sdk/client/llm-api-client.js +1 -1
  116. package/dist/sdk/client/oauth-refresh.js +1 -1
  117. package/dist/sdk/client/rate-limiter.js +1 -1
  118. package/dist/sdk/client/td-api-client.js +1 -1
  119. package/dist/sdk/client/trino-api-client.js +1 -1
  120. package/dist/sdk/client/workflow-client.js +1 -1
  121. package/dist/sdk/connection-validator.js +1 -1
  122. package/dist/sdk/connection.js +1 -1
  123. package/dist/sdk/delivery.js +1 -1
  124. package/dist/sdk/engage/campaign-pull.js +1 -1
  125. package/dist/sdk/engage/campaign-push.js +1 -1
  126. package/dist/sdk/engage/campaign-validator.js +1 -1
  127. package/dist/sdk/engage/campaign-yaml.js +1 -1
  128. package/dist/sdk/engage/template-pull.js +1 -1
  129. package/dist/sdk/engage/template-push.js +1 -1
  130. package/dist/sdk/engage/template-validator.js +1 -1
  131. package/dist/sdk/engage/template-yaml.js +1 -1
  132. package/dist/sdk/engage/types/campaign-def.js +1 -1
  133. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  134. package/dist/sdk/engage/types/template-schema.js +1 -1
  135. package/dist/sdk/engage.js +1 -1
  136. package/dist/sdk/errors.js +1 -1
  137. package/dist/sdk/index.js +1 -1
  138. package/dist/sdk/io/index.js +1 -1
  139. package/dist/sdk/io/node-filesystem.js +1 -1
  140. package/dist/sdk/job.js +1 -1
  141. package/dist/sdk/journey.js +1 -1
  142. package/dist/sdk/llm/chat-cache.js +1 -1
  143. package/dist/sdk/llm/index.js +1 -1
  144. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  145. package/dist/sdk/llm/model-factors.js +1 -1
  146. package/dist/sdk/personalization.js +1 -1
  147. package/dist/sdk/policy.js +1 -1
  148. package/dist/sdk/query/index.js +1 -1
  149. package/dist/sdk/query/sql-parser.js +1 -1
  150. package/dist/sdk/realtime.js +1 -1
  151. package/dist/sdk/schedule.js +1 -1
  152. package/dist/sdk/segment/child-segment-yaml.d.ts +8 -0
  153. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  154. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  156. package/dist/sdk/segment/fields-display.js +1 -1
  157. package/dist/sdk/segment/file-discovery.js +1 -1
  158. package/dist/sdk/segment/journey-utils.js +1 -1
  159. package/dist/sdk/segment/journey-validator.js +1 -1
  160. package/dist/sdk/segment/journey-yaml.js +1 -1
  161. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  162. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  163. package/dist/sdk/segment/pull-workflow.js +1 -1
  164. package/dist/sdk/segment/push-recovery.js +1 -1
  165. package/dist/sdk/segment/push-workflow.js +1 -1
  166. package/dist/sdk/segment/resolution-context.js +1 -1
  167. package/dist/sdk/segment/segment-path-parser.js +1 -1
  168. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  169. package/dist/sdk/segment/segment-validator.js +1 -1
  170. package/dist/sdk/segment/target-resolution.js +1 -1
  171. package/dist/sdk/segment/tdx-config.js +1 -1
  172. package/dist/sdk/segment/types/activation-schema.js +1 -1
  173. package/dist/sdk/segment/types/journey-def.js +1 -1
  174. package/dist/sdk/segment/types/journey-schema.js +1 -1
  175. package/dist/sdk/segment/types/segment-def.js +1 -1
  176. package/dist/sdk/segment/types/segment-schema.js +1 -1
  177. package/dist/sdk/segment/validate-files.js +1 -1
  178. package/dist/sdk/segment/yaml-validator.js +1 -1
  179. package/dist/sdk/segment.js +1 -1
  180. package/dist/sdk/types/index.d.ts +1 -1
  181. package/dist/sdk/types/index.d.ts.map +1 -1
  182. package/dist/sdk/types/index.js +1 -1
  183. package/dist/sdk/types/index.js.map +1 -1
  184. package/dist/sdk/types/progress.js +1 -1
  185. package/dist/sdk/types/workspace.d.ts +29 -0
  186. package/dist/sdk/types/workspace.d.ts.map +1 -1
  187. package/dist/sdk/types/workspace.js +1 -1
  188. package/dist/sdk/user.js +1 -1
  189. package/dist/sdk/util/format-detector.js +1 -1
  190. package/dist/sdk/util/formatters.js +1 -1
  191. package/dist/sdk/util/index.js +1 -1
  192. package/dist/sdk/util/paginate.js +1 -1
  193. package/dist/sdk/util/tree-formatter.js +1 -1
  194. package/dist/sdk/workflow/archive-validation.js +1 -1
  195. package/dist/sdk/workflow/clone-workflow.js +1 -1
  196. package/dist/sdk/workflow/index.js +1 -1
  197. package/dist/sdk/workflow/pull-workflow.js +1 -1
  198. package/dist/sdk/workflow/push-workflow.js +1 -1
  199. package/dist/sdk/workflow/tdx-config.js +1 -1
  200. package/dist/sdk/workflow/workflow-utils.js +1 -1
  201. package/dist/sdk/workspace/frontmatter.js +1 -1
  202. package/dist/sdk/workspace/git.d.ts +4 -1
  203. package/dist/sdk/workspace/git.d.ts.map +1 -1
  204. package/dist/sdk/workspace/git.js +1 -1
  205. package/dist/sdk/workspace/git.js.map +1 -1
  206. package/dist/sdk/workspace/index.d.ts +8 -15
  207. package/dist/sdk/workspace/index.d.ts.map +1 -1
  208. package/dist/sdk/workspace/index.js +1 -1
  209. package/dist/sdk/workspace/index.js.map +1 -1
  210. package/dist/sdk/workspace/templates.js +1 -1
  211. package/dist/sdk/workspace/weekly.d.ts +3 -13
  212. package/dist/sdk/workspace/weekly.d.ts.map +1 -1
  213. package/dist/sdk/workspace/weekly.js +1 -1
  214. package/dist/sdk/workspace/weekly.js.map +1 -1
  215. package/dist/sdk/workspace/wikilinks.d.ts +15 -0
  216. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  217. package/dist/sdk/workspace/wikilinks.js +1 -1
  218. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  219. package/dist/test-utils/command-runner.js +1 -1
  220. package/dist/test-utils/factories.js +1 -1
  221. package/dist/test-utils/fixtures.js +1 -1
  222. package/dist/test-utils/http-mock.js +1 -1
  223. package/dist/test-utils/index.js +1 -1
  224. package/dist/utils/async.js +1 -1
  225. package/dist/utils/colors.js +1 -1
  226. package/dist/utils/diff.js +1 -1
  227. package/dist/utils/file-permissions.js +1 -1
  228. package/dist/utils/file-reader.js +1 -1
  229. package/dist/utils/github-releases.js +1 -1
  230. package/dist/utils/global-cache.js +1 -1
  231. package/dist/utils/json-loader.js +1 -1
  232. package/dist/utils/local-cache.js +1 -1
  233. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  234. package/dist/utils/logger/formatters/index.js +1 -1
  235. package/dist/utils/logger/handlers/console-handler.js +1 -1
  236. package/dist/utils/logger/handlers/file-handler.js +1 -1
  237. package/dist/utils/logger/handlers/index.js +1 -1
  238. package/dist/utils/logger/handlers/null-handler.js +1 -1
  239. package/dist/utils/logger/index.js +1 -1
  240. package/dist/utils/logger/logger.js +1 -1
  241. package/dist/utils/logger/types.js +1 -1
  242. package/dist/utils/option-validation.js +1 -1
  243. package/dist/utils/process.js +1 -1
  244. package/dist/utils/prompt.js +1 -1
  245. package/dist/utils/spinner.js +1 -1
  246. package/dist/utils/sse-parser.js +1 -1
  247. package/dist/utils/string-utils.js +1 -1
  248. package/dist/utils/table-ref-parser.js +1 -1
  249. package/dist/utils/tdx-logger.js +1 -1
  250. package/dist/utils/version-check.js +1 -1
  251. package/package.json +1 -1
  252. package/dist/commands/auth-login-command.d.ts +0 -29
  253. package/dist/commands/auth-login-command.d.ts.map +0 -1
  254. package/dist/commands/auth-login-command.js +0 -1
  255. package/dist/commands/auth-login-command.js.map +0 -1
@@ -1 +1 @@
1
- const a152_0x32dbf6=a152_0x13c2;(function(_0x59ed90,_0x52d4d9){const _0x44ad11=a152_0x13c2,_0x55368b=_0x59ed90();while(!![]){try{const _0x445fb9=-parseInt(_0x44ad11(0x168))/0x1*(-parseInt(_0x44ad11(0x1a3))/0x2)+parseInt(_0x44ad11(0x1db))/0x3+-parseInt(_0x44ad11(0x24c))/0x4+parseInt(_0x44ad11(0x176))/0x5+-parseInt(_0x44ad11(0x245))/0x6*(-parseInt(_0x44ad11(0x1f2))/0x7)+-parseInt(_0x44ad11(0x204))/0x8*(parseInt(_0x44ad11(0x19d))/0x9)+-parseInt(_0x44ad11(0x198))/0xa*(parseInt(_0x44ad11(0x1a4))/0xb);if(_0x445fb9===_0x52d4d9)break;else _0x55368b['push'](_0x55368b['shift']());}catch(_0x3863fd){_0x55368b['push'](_0x55368b['shift']());}}}(a152_0x5e75,0x8da48));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0x32dbf6(0x14e);export const PENDING_ACTIVATION_PREFIX=a152_0x32dbf6(0x250);export function createPendingSegmentId(_0xf76103){return''+PENDING_SEGMENT_PREFIX+_0xf76103+'__';}export function isPendingSegmentId(_0x4ff10d){return _0x4ff10d['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x4ff10d['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x460375){const _0x3e8a55=a152_0x32dbf6;return _0x460375[_0x3e8a55(0x202)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4fe2ba){return''+PENDING_ACTIVATION_PREFIX+_0x4fe2ba+'__';}export function isPendingActivationId(_0x2a3480){return _0x2a3480['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3a0946){const _0x40681a=a152_0x32dbf6;return _0x3a0946[_0x40681a(0x202)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1ec216,_0x5b3f31){const _0x2bc67b=a152_0x32dbf6,_0x2961d0=_0x1ec216+'::'+(_0x5b3f31[_0x2bc67b(0x183)]()||_0x2bc67b(0x196)),_0x53fae6=createHash('sha1')[_0x2bc67b(0x166)](_0x2961d0)['digest']('hex')[_0x2bc67b(0x223)](0x0,0xc);return'journey_entry_criteria_'+_0x53fae6;}export function ensureJourneyDefaults(_0x20767d){const _0x47fb7e=a152_0x32dbf6;!_0x20767d['description']&&(_0x20767d[_0x47fb7e(0x1d7)]=''),!_0x20767d['state']&&(_0x20767d[_0x47fb7e(0x1e1)]='draft');}export function injectExistingStageIds(_0x5a2864,_0x5a0b6b){const _0x1476c5=a152_0x32dbf6,_0x4c7a01=new Map(_0x5a0b6b[_0x1476c5(0x189)](_0x3ddc8b=>[_0x3ddc8b[_0x1476c5(0x1de)],_0x3ddc8b['id']]));for(const _0xd0a563 of _0x5a2864){if(!_0xd0a563['id']){const _0x358177=_0x4c7a01[_0x1476c5(0x162)](_0xd0a563[_0x1476c5(0x1de)]);_0x358177&&(_0xd0a563['id']=_0x358177);}}}export function resolveTDFolderPath(_0x2e8db3,_0x2ef4d0,_0x147ec3){if(!_0x2ef4d0)return _0x2e8db3;if(_0x2e8db3===_0x147ec3||_0x2e8db3['startsWith'](_0x147ec3+'/'))return _0x2e8db3;return _0x2e8db3?_0x147ec3+'/'+_0x2e8db3:_0x147ec3;}export function addFoldersToCreate(_0x555e00,_0x342070,_0x525b29){const _0x3cced1=a152_0x32dbf6;if(!_0x555e00)return;if(_0x342070[_0x3cced1(0x1a6)](_0x555e00))return;const _0x572fc4=_0x555e00[_0x3cced1(0x1e6)]('/');let _0x455869='';for(const _0x22e991 of _0x572fc4){_0x455869=_0x455869?_0x455869+'/'+_0x22e991:_0x22e991,!_0x342070[_0x3cced1(0x1a6)](_0x455869)&&_0x525b29[_0x3cced1(0x1c1)](_0x455869);}}export function sortFoldersByDepth(_0x17eb1f){return[..._0x17eb1f]['sort']((_0x2e0c4f,_0x1c4bad)=>{const _0x1f9272=a152_0x13c2,_0x57a20a=(_0x2e0c4f[_0x1f9272(0x190)](/\//g)||[])[_0x1f9272(0x24d)],_0x354c67=(_0x1c4bad['match'](/\//g)||[])['length'];return _0x57a20a-_0x354c67;});}import*as a152_0x13b23a from'yaml';import{readFileSync}from'fs';import a152_0x54f873 from'path';import{isJourneyDef,parseYamlString as a152_0x3d28f1,toYamlString as a152_0x2358d9,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(_0x5b2cf0){const _0x1ccbe4=a152_0x32dbf6;if(Array[_0x1ccbe4(0x1f7)](_0x5b2cf0))return'['+_0x5b2cf0[_0x1ccbe4(0x189)](_0xbf68c6=>stableStringify(_0xbf68c6))['join'](',')+']';if(_0x5b2cf0&&typeof _0x5b2cf0===_0x1ccbe4(0x178)){const _0x3d758a=_0x5b2cf0,_0x373858=Object[_0x1ccbe4(0x21f)](_0x3d758a)[_0x1ccbe4(0x1a7)](),_0x28b956=_0x373858[_0x1ccbe4(0x189)](_0x331a7c=>'\x22'+_0x331a7c+'\x22:'+stableStringify(_0x3d758a[_0x331a7c]));return'{'+_0x28b956['join'](',')+'}';}const _0xff51ec=JSON[_0x1ccbe4(0x151)](_0x5b2cf0);return _0xff51ec===undefined?_0x1ccbe4(0x208):_0xff51ec;}function activationSignature(_0x2c49ca){const _0x4fe541=a152_0x32dbf6,_0x2b465c={'connection':_0x2c49ca[_0x4fe541(0x214)],..._0x2c49ca['all_columns']!==undefined&&{'all_columns':_0x2c49ca[_0x4fe541(0x1f3)]},..._0x2c49ca['columns']!==undefined&&{'columns':_0x2c49ca[_0x4fe541(0x167)]},..._0x2c49ca[_0x4fe541(0x235)]!==undefined&&{'behavior':_0x2c49ca[_0x4fe541(0x235)]},..._0x2c49ca['schedule']!==undefined&&{'schedule':_0x2c49ca['schedule']},..._0x2c49ca['notification']!==undefined&&{'notification':_0x2c49ca[_0x4fe541(0x251)]},..._0x2c49ca[_0x4fe541(0x17c)]!==undefined&&{'connector_config':_0x2c49ca[_0x4fe541(0x17c)]},..._0x2c49ca[_0x4fe541(0x1cf)]!==undefined&&{'activation_template_id':_0x2c49ca[_0x4fe541(0x1cf)]}};return stableStringify(_0x2b465c);}async function fetchSegment(_0x35aa07,_0x423e58,_0x21e0b0,_0x18d603){const _0xdbb54f=a152_0x32dbf6,_0x410450=_0x18d603?.['find'](_0x51c098=>_0x51c098['id']===_0x21e0b0);if(_0x410450)return _0x410450;try{return await _0x35aa07[_0xdbb54f(0x196)][_0xdbb54f(0x1b7)](_0x423e58,_0x21e0b0);}catch(_0x40afd6){logger['debug'](_0xdbb54f(0x206)+_0x21e0b0+_0xdbb54f(0x1e7)+_0x40afd6);try{return await _0x35aa07['segment'][_0xdbb54f(0x1e0)](_0x21e0b0);}catch(_0x204de7){return logger[_0xdbb54f(0x21e)](_0xdbb54f(0x1ff)+_0x21e0b0+':\x20'+_0x204de7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x14461f,_0x22271c,_0x2f34bd){const _0xfdc7bb=a152_0x32dbf6,_0x378232=readPushRecovery(_0x14461f[_0xfdc7bb(0x160)]);if(_0x378232?.['journeyName']===_0x14461f[_0xfdc7bb(0x154)][_0xfdc7bb(0x1de)])for(const [_0x5eba50,_0x11f04a]of Object[_0xfdc7bb(0x21b)](_0x378232[_0xfdc7bb(0x175)])){const _0x5489c3=generateDeterministicJourneySegmentName(_0x14461f[_0xfdc7bb(0x154)][_0xfdc7bb(0x1de)],_0x5eba50);_0x11f04a[_0xfdc7bb(0x1a8)]===_0x5489c3&&(_0x22271c[_0xfdc7bb(0x20a)](_0x5eba50,_0x11f04a[_0xfdc7bb(0x15e)]),_0x2f34bd['set'](_0x5eba50,_0x11f04a['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x23f279,_0x56bd88,_0x2f3da4,_0x28d98d){const _0x80257d=a152_0x32dbf6;let _0x4b55d4;try{_0x4b55d4=await _0x23f279[_0x80257d(0x196)][_0x80257d(0x1bc)]({'name':_0x2f3da4['uniqueSegmentName'],'description':_0x2f3da4[_0x80257d(0x1d7)],'journeyId':_0x2f3da4['journeyId'],'rule':_0x28d98d(_0x2f3da4[_0x80257d(0x1b3)],!![]),'countPopulation':!![],'parentFolderId':_0x2f3da4[_0x80257d(0x22b)],'audienceId':_0x2f3da4[_0x80257d(0x1fd)]});}catch(_0x551da7){const _0x94c25=_0x551da7 instanceof Error&&_0x551da7[_0x80257d(0x163)][_0x80257d(0x1d1)]('Name\x20has\x20already\x20been\x20taken');if(_0x94c25){const _0x46a908=readPushRecovery(_0x56bd88[_0x80257d(0x160)]),_0x4938d1=_0x46a908?.[_0x80257d(0x216)]===_0x56bd88[_0x80257d(0x154)][_0x80257d(0x1de)]?_0x46a908[_0x80257d(0x175)][_0x2f3da4[_0x80257d(0x1be)]]:undefined;if(_0x4938d1?.[_0x80257d(0x1a8)]===_0x2f3da4[_0x80257d(0x188)])await _0x23f279[_0x80257d(0x196)][_0x80257d(0x1d6)](_0x2f3da4[_0x80257d(0x1fd)],_0x4938d1['segmentId'],{'description':_0x2f3da4[_0x80257d(0x1d7)],'rule':_0x28d98d(_0x2f3da4[_0x80257d(0x1b3)],!![]),'countPopulation':!![]}),_0x4b55d4=_0x4938d1[_0x80257d(0x15e)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x80257d(0x1ef)+_0x2f3da4['localName']+_0x80257d(0x220)+(_0x80257d(0x1f8)+_0x56bd88[_0x80257d(0x160)]['replace'](/([^/]+)$/,_0x80257d(0x217))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x551da7);}else throw _0x551da7;}return saveSegmentToPushRecovery(_0x56bd88[_0x80257d(0x160)],_0x56bd88[_0x80257d(0x154)]['name'],_0x2f3da4[_0x80257d(0x1be)],{'segmentId':_0x4b55d4,'uniqueServerName':_0x2f3da4['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x4b55d4;}export async function prepareSegmentFiles(_0x4128d6,_0x48b934,_0x1a5bf3,_0x9b4b24,_0x2728f3){const _0x14796a=a152_0x32dbf6,{activationDefToCreateRequest:_0x1bef0f}=await import(_0x14796a(0x224)),_0x243552=[],_0x278c80=new Set();for(const {yamlConfig:_0x3fbd9f,folderPath:_0x11bddc,sourcePath:_0x32bc48}of _0x4128d6){const _0x3d9ac6=resolveTDFolderPath(_0x11bddc,_0x9b4b24,_0x2728f3),_0x516668=_0x3d9ac6+':'+_0x3fbd9f[_0x14796a(0x1de)],_0x4a9dd7=_0x48b934[_0x14796a(0x1b2)][_0x14796a(0x162)](_0x516668),_0x23b174=_0x4a9dd7?_0x48b934[_0x14796a(0x22e)][_0x14796a(0x162)](_0x4a9dd7['id'])||[]:[];addFoldersToCreate(_0x3d9ac6,_0x48b934[_0x14796a(0x192)],_0x278c80);const _0x11ffcc=calculateActivationActions(_0x3fbd9f['activations']||[],_0x23b174,_0x48b934[_0x14796a(0x199)],_0x48b934[_0x14796a(0x23d)]);for(const _0x34fbb4 of _0x11ffcc){(_0x34fbb4[_0x14796a(0x187)]===_0x14796a(0x1d9)||_0x34fbb4[_0x14796a(0x187)]===_0x14796a(0x166))&&_0x34fbb4[_0x14796a(0x203)]&&(_0x34fbb4[_0x14796a(0x1fb)]=await _0x1bef0f(_0x34fbb4[_0x14796a(0x203)],_0x1a5bf3));}const _0xe7a0db=calculateSegmentDiff(_0x3fbd9f,_0x4a9dd7,_0x23b174,_0x48b934['idToEmailMap'],_0x48b934[_0x14796a(0x23d)]);_0x243552[_0x14796a(0x1a2)]({'relativePath':_0x3fbd9f['name'],'absolutePath':_0x32bc48,'yamlConfig':_0x3fbd9f,'folderPath':_0x3d9ac6,'existingSegment':_0x4a9dd7,'existingActivations':_0x23b174,'isNew':_0xe7a0db[_0x14796a(0x22f)],'hasChanges':_0xe7a0db['hasChanges'],'diff':_0xe7a0db[_0x14796a(0x17b)],'activationActions':_0x11ffcc});}return{'segmentFiles':_0x243552,'foldersToCreate':_0x278c80};}export async function prepareJourneyFiles(_0x4e9adb,_0x41f8b6,_0xf627bd,_0x1fd26f){const _0x2c123b=a152_0x32dbf6,_0x99cc9b=[],_0x43c923=new Set();for(const {yamlConfig:_0x5b5d14,folderPath:_0x1f075e,sourcePath:_0x2dc631}of _0x4e9adb){const _0x127ab6=resolveTDFolderPath(_0x1f075e,_0xf627bd,_0x1fd26f),_0x44d0f2=_0x127ab6+':'+_0x5b5d14['name'],_0x56d3f0=_0x41f8b6[_0x2c123b(0x24f)][_0x2c123b(0x162)](_0x44d0f2);let _0x2d820b,_0x2aef2f;if(_0x56d3f0&&_0x56d3f0[_0x2c123b(0x24d)]>0x0){const _0x208c0b=buildLocalExpandedRuleMappings(_0x5b5d14),{createYamlContext:_0x13f57c,prefetchJourneySegments:_0x573611}=createPushYamlContextForBundle(_0x41f8b6[_0x2c123b(0x201)],_0x41f8b6[_0x2c123b(0x1fd)],_0x41f8b6[_0x2c123b(0x1b8)],_0x208c0b,_0x41f8b6[_0x2c123b(0x199)],_0x41f8b6[_0x2c123b(0x23d)],_0x41f8b6['activationStepsById'],_0x41f8b6[_0x2c123b(0x1fc)]);await _0x573611(_0x56d3f0[_0x2c123b(0x189)](_0x5cc970=>_0x5cc970['id']));const _0x399dc3=await _0x41f8b6['deps']['journey'][_0x2c123b(0x1ca)](_0x56d3f0[0x0][_0x2c123b(0x1c0)]),_0x5d1753=hasMultipleVersions(_0x5b5d14),_0x6c8e64=async _0x4b25f9=>{const _0x1d68c2=_0x2c123b,_0x1d0846=_0x41f8b6['journeyById']?.[_0x1d68c2(0x162)](_0x4b25f9);if(_0x1d0846)return _0x1d0846;return _0x41f8b6[_0x1d68c2(0x209)]({'journeyId':_0x4b25f9,'journeyName':_0x5b5d14[_0x1d68c2(0x1de)],'isMultiVersion':_0x56d3f0[_0x1d68c2(0x24d)]>0x1});};if(_0x5d1753&&_0x56d3f0[_0x2c123b(0x24d)]>0x1){const _0x42c4ef=[];for(const _0x44fe3a of _0x56d3f0){const _0x3684ca=_0x44fe3a[_0x2c123b(0x1cd)]||0x1;_0x41f8b6['progress']?.['update'](_0x2c123b(0x19c)+_0x5b5d14[_0x2c123b(0x1de)]+'\x20v'+_0x3684ca);const _0x2b3fd3=await _0x6c8e64(_0x44fe3a['id']),_0x540d9c=_0x13f57c(_0x44fe3a['id']),_0x419e3d=await journeyResponseToDef(_0x2b3fd3,_0x540d9c);_0x42c4ef[_0x2c123b(0x1a2)]({'item':_0x44fe3a,'yaml':_0x419e3d});}const _0x41da0f=buildLocalRuleToNameMappingFromJourney(_0x5b5d14);_0x2aef2f=buildMergedJourneyDef(_0x42c4ef,_0x41da0f,_0x399dc3);const _0x1781a1=Math['max'](..._0x42c4ef[_0x2c123b(0x189)](_0x1d115b=>_0x1d115b[_0x2c123b(0x1e5)]['versionNumber']||0x0)),_0x5dd509=_0x56d3f0['find'](_0x5d5091=>(_0x5d5091[_0x2c123b(0x1cd)]||0x0)===_0x1781a1);_0x5dd509&&(_0x41f8b6[_0x2c123b(0x1e3)]?.[_0x2c123b(0x166)](_0x2c123b(0x19c)+_0x5b5d14[_0x2c123b(0x1de)]+'\x20v'+_0x1781a1),_0x2d820b=await _0x6c8e64(_0x5dd509['id']));}else{const _0x3b86cd=_0x56d3f0[_0x56d3f0[_0x2c123b(0x24d)]-0x1];_0x41f8b6['progress']?.[_0x2c123b(0x166)](_0x2c123b(0x19c)+_0x5b5d14[_0x2c123b(0x1de)]),_0x2d820b=await _0x6c8e64(_0x3b86cd['id']);const _0x12a61c=_0x13f57c(_0x3b86cd['id']),_0x5d0205=await journeyResponseToDef(_0x2d820b,_0x12a61c),_0x1d882f=buildLocalRuleToNameMappingFromJourney(_0x5b5d14);_0x2aef2f=buildMergedJourneyDef([{'item':_0x3b86cd,'yaml':_0x5d0205}],_0x1d882f,_0x399dc3);}}addFoldersToCreate(_0x127ab6,_0x41f8b6['folderPathToId'],_0x43c923);const _0x49a049=calculateJourneyDiff(_0x5b5d14,_0x2aef2f);_0x99cc9b[_0x2c123b(0x1a2)]({'relativePath':_0x5b5d14[_0x2c123b(0x1de)],'absolutePath':_0x2dc631,'yamlConfig':_0x5b5d14,'folderPath':_0x127ab6,'existingJourney':_0x2d820b,'isNew':_0x49a049[_0x2c123b(0x22f)],'hasChanges':_0x49a049['hasChanges'],'diff':_0x49a049[_0x2c123b(0x17b)]});}return{'journeyFiles':_0x99cc9b,'foldersToCreate':_0x43c923};}function a152_0x13c2(_0x5687e5,_0x19af00){_0x5687e5=_0x5687e5-0x14b;const _0x5e75bb=a152_0x5e75();let _0x13c21c=_0x5e75bb[_0x5687e5];return _0x13c21c;}export function calculateActivationActions(_0x4ff80a,_0x2e682c,_0xc82dc3,_0x40998c){const _0x41694d=a152_0x32dbf6,_0x136928=[],_0x53214a=new Map();for(const _0xe21270 of _0x2e682c){_0x53214a[_0x41694d(0x20a)](_0xe21270[_0x41694d(0x1de)],_0xe21270);}const _0x5a8a5f=new Map();for(const _0x24ad2c of _0x4ff80a){_0x5a8a5f[_0x41694d(0x20a)](_0x24ad2c['name'],_0x24ad2c);}for(const _0x440dac of _0x4ff80a){const _0x49807c=_0x53214a[_0x41694d(0x162)](_0x440dac['name']);if(!_0x49807c)_0x136928[_0x41694d(0x1a2)]({'type':_0x41694d(0x1d9),'name':_0x440dac[_0x41694d(0x1de)],'yamlActivation':_0x440dac});else{const _0x4648bb=activationResponseToDef(_0x49807c,_0xc82dc3,_0x40998c),_0x521b9f=a152_0x13b23a['stringify'](_0x4648bb),_0x3e6929=a152_0x13b23a[_0x41694d(0x151)](_0x440dac);_0x521b9f!==_0x3e6929&&_0x136928[_0x41694d(0x1a2)]({'type':_0x41694d(0x166),'name':_0x440dac['name'],'yamlActivation':_0x440dac,'existingActivation':_0x49807c});}}for(const _0x67b3a5 of _0x2e682c){!_0x5a8a5f[_0x41694d(0x1a6)](_0x67b3a5[_0x41694d(0x1de)])&&_0x136928[_0x41694d(0x1a2)]({'type':'delete','name':_0x67b3a5[_0x41694d(0x1de)],'existingActivation':_0x67b3a5});}return _0x136928;}function calculateYamlDiff(_0x1eb796,_0x3a142c){if(_0x3a142c){const _0x36982c=generateDiff(_0x3a142c,_0x1eb796),_0x157f9d=hasChanges(_0x36982c);return{'isNew':![],'hasChanges':_0x157f9d,'diff':_0x157f9d?formatDiffWithColors(_0x36982c):undefined};}const _0x442ef=generateDiff('',_0x1eb796);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x442ef)};}export function calculateSegmentDiff(_0x1c6966,_0x522918,_0x343344,_0x343bb4,_0x11d837){const _0x386ec6=segmentToYamlString(_0x1c6966),_0x3f68e3=_0x522918?segmentToYamlString(segmentWithActivationsToYaml(_0x522918,_0x343344,undefined,_0x343bb4,_0x11d837)):undefined;return calculateYamlDiff(_0x386ec6,_0x3f68e3);}export function calculateJourneyDiff(_0x2ab124,_0x417913){const _0x42f1f3=normalizeJourneyDef(_0x2ab124,_0x2ab124),_0x429b97=a152_0x2358d9(_0x42f1f3),_0xfd05cf=_0x417913?a152_0x2358d9(normalizeJourneyDef(_0x417913,_0x2ab124)):undefined;return calculateYamlDiff(_0x429b97,_0xfd05cf);}export function findSegmentsToDelete(_0xd05d34,_0x31e3fc,_0x2b483c,_0x365058,_0x5addfe){const _0x107411=a152_0x32dbf6,_0x3ce545=new Set();for(const {yamlConfig:_0x110309,folderPath:_0x444290}of _0x31e3fc){_0x3ce545['add'](_0x444290+':'+_0x110309['name']);}return _0xd05d34[_0x107411(0x18c)](_0xd1ab8b=>{const _0x2ffa5e=_0x107411,_0x36cb01=_0xd1ab8b[_0x2ffa5e(0x1ac)]?_0x2b483c[_0x2ffa5e(0x162)](_0xd1ab8b[_0x2ffa5e(0x1ac)][_0x2ffa5e(0x19a)]())||'':'',_0x519b88=_0x36cb01+':'+_0xd1ab8b[_0x2ffa5e(0x1de)];if(_0x3ce545['has'](_0x519b88))return![];if(_0x5addfe)return _0x36cb01===_0x365058||_0x36cb01[_0x2ffa5e(0x179)](_0x365058+'/');return!![];});}export function findJourneysToDelete(_0x5394eb,_0x16bbc2,_0x40568f,_0x20514f,_0x1ef940){const _0x29f1fb=a152_0x32dbf6,_0x20fc68=new Set();for(const {yamlConfig:_0x69ec46,folderPath:_0x1e1a07}of _0x16bbc2){_0x20fc68[_0x29f1fb(0x1c1)](_0x1e1a07+':'+_0x69ec46[_0x29f1fb(0x1de)]);}return _0x5394eb['filter'](_0x490139=>{const _0x5bcf16=_0x29f1fb,_0x1b1ad9=_0x490139[_0x5bcf16(0x22b)]?_0x40568f[_0x5bcf16(0x162)](_0x490139['folderId'])||'':'',_0x46cf96=_0x1b1ad9+':'+_0x490139[_0x5bcf16(0x1b5)];if(_0x20fc68[_0x5bcf16(0x1a6)](_0x46cf96))return![];if(_0x1ef940)return _0x1b1ad9===_0x20514f||_0x1b1ad9[_0x5bcf16(0x179)](_0x20514f+'/');return!![];});}export function buildSegmentLookupMap(_0x5af2f9,_0xce25f1){const _0x53038b=a152_0x32dbf6,_0x5b57e3=new Map();for(const _0xbbb4d3 of _0x5af2f9){const _0x52d390=_0xbbb4d3[_0x53038b(0x1ac)]?_0xce25f1[_0x53038b(0x162)](_0xbbb4d3[_0x53038b(0x1ac)][_0x53038b(0x19a)]())||'':'',_0x4af619=_0x52d390+':'+_0xbbb4d3['name'];_0x5b57e3[_0x53038b(0x20a)](_0x4af619,_0xbbb4d3);}return _0x5b57e3;}export function buildSegmentNameToIdMap(_0x5593a9){const _0x9df65a=a152_0x32dbf6,_0x3c9c56=new Map();for(const _0x1eeb59 of _0x5593a9){_0x3c9c56['set'](_0x1eeb59[_0x9df65a(0x1de)],_0x1eeb59['id']);}return _0x3c9c56;}export function buildJourneyBundleLookupMap(_0x33aee3,_0x43d7ab){const _0x477842=a152_0x32dbf6,_0x18f331=new Map();for(const _0x53be9f of _0x33aee3){const _0xfaea48=_0x53be9f[_0x477842(0x22b)]?_0x43d7ab['get'](_0x53be9f[_0x477842(0x22b)])||'':'',_0x509670=_0xfaea48+':'+_0x53be9f[_0x477842(0x1b5)];!_0x18f331[_0x477842(0x1a6)](_0x509670)&&_0x18f331[_0x477842(0x20a)](_0x509670,[]),_0x18f331[_0x477842(0x162)](_0x509670)[_0x477842(0x1a2)](_0x53be9f);}for(const _0x68a03d of _0x18f331[_0x477842(0x226)]()){_0x68a03d[_0x477842(0x1a7)]((_0x56a81e,_0x241aaf)=>(_0x56a81e['versionNumber']||0x0)-(_0x241aaf[_0x477842(0x1cd)]||0x0));}return _0x18f331;}export function collectFoldersToCreate(_0x1f4460,_0x5bdd4a){const _0x7e45c6=a152_0x32dbf6,_0x42dca4=new Set();for(const _0x4df7c4 of _0x1f4460){if(!_0x4df7c4)continue;if(_0x5bdd4a[_0x7e45c6(0x1a6)](_0x4df7c4))continue;const _0x2f58ae=_0x4df7c4['split']('/');let _0x23ed99='';for(const _0x23f5a2 of _0x2f58ae){_0x23ed99=_0x23ed99?_0x23ed99+'/'+_0x23f5a2:_0x23f5a2,!_0x5bdd4a[_0x7e45c6(0x1a6)](_0x23ed99)&&_0x42dca4[_0x7e45c6(0x1c1)](_0x23ed99);}}return _0x42dca4;}export function parseAndClassifyYamlFiles(_0x1216a1,_0x3c125a,_0x1aef7d){const _0x34a16a=a152_0x32dbf6,_0x3c3ac3=[],_0x306721=[];for(const _0x4d8f54 of _0x1216a1){const _0x47adc4=a152_0x54f873[_0x34a16a(0x1c4)](_0x3c125a,a152_0x54f873['dirname'](_0x4d8f54)),_0x3d09ab=_0x47adc4==='.'?'':_0x47adc4,_0x1ba758=readFileSync(_0x4d8f54,_0x34a16a(0x20b)),_0xc6c597=a152_0x13b23a[_0x34a16a(0x247)](_0x1ba758);if(isJourneyDef(_0xc6c597)){const _0xed3500=a152_0x3d28f1(_0x1ba758);_0x306721[_0x34a16a(0x1a2)]({'yamlConfig':_0xed3500,'folderPath':_0x3d09ab,'sourcePath':_0x4d8f54});}else{if(!_0x1aef7d?.[_0x34a16a(0x1a1)]){const _0x4243af=parseSegmentYamlFile(_0x1ba758),_0x3d91d0=normalizeChildSegmentYaml(_0x4243af);_0x3c3ac3[_0x34a16a(0x1a2)]({'yamlConfig':_0x3d91d0,'folderPath':_0x3d09ab,'sourcePath':_0x4d8f54});}}}return{'segments':_0x3c3ac3,'journeys':_0x306721};}export function validateParsedFiles(_0x25f9b1,_0x41cc34){const _0x5c6dff=a152_0x32dbf6,_0x26d131=[];for(const {yamlConfig:_0x4be28e,sourcePath:_0x11b834}of _0x25f9b1[_0x5c6dff(0x175)]){const _0xa82da8=readFileSync(_0x11b834,_0x5c6dff(0x20b)),_0x39b153=a152_0x13b23a[_0x5c6dff(0x19f)](_0xa82da8),_0x543a6f=validateSegmentDef(_0x4be28e,{'source':_0xa82da8,'document':_0x39b153},{'skipSchema':!![]});if(!_0x543a6f['valid']){const _0x5251ff=a152_0x54f873[_0x5c6dff(0x1c4)](_0x41cc34,_0x11b834);_0x26d131[_0x5c6dff(0x1a2)]({'filePath':_0x5251ff,'source':_0xa82da8,'result':_0x543a6f,'isJourney':![]});}}for(const {yamlConfig:_0x5d0987,sourcePath:_0x19d337}of _0x25f9b1[_0x5c6dff(0x16d)]){const _0x54a36e=readFileSync(_0x19d337,'utf-8'),_0x1234c1=a152_0x13b23a['parseDocument'](_0x54a36e),_0x2f30bd=validateJourneyDef(_0x5d0987,{'source':_0x54a36e,'document':_0x1234c1},{'skipSchema':!![]});if(!_0x2f30bd[_0x5c6dff(0x240)]){const _0x5149f2=a152_0x54f873[_0x5c6dff(0x1c4)](_0x41cc34,_0x19d337);_0x26d131[_0x5c6dff(0x1a2)]({'filePath':_0x5149f2,'source':_0x54a36e,'result':_0x2f30bd,'isJourney':!![]});}}return _0x26d131;}export function formatValidationErrors(_0x17269a){const _0x23ec03=a152_0x32dbf6,_0x2ef58e=[];for(const {filePath:_0x5cf193,source:_0x3a8187,result:_0x301742,isJourney:_0x5301e5}of _0x17269a){const _0x30af79=_0x5301e5?_0x23ec03(0x1c3):_0x23ec03(0x196);_0x2ef58e[_0x23ec03(0x1a2)]('\x0a'+_0x5cf193+'\x20('+_0x30af79+_0x23ec03(0x14f)+_0x301742[_0x23ec03(0x17d)][_0x23ec03(0x24d)]+_0x23ec03(0x174)),_0x2ef58e[_0x23ec03(0x1a2)](formatValidationResult(_0x301742,_0x3a8187,_0x5cf193));}return _0x2ef58e[_0x23ec03(0x197)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x36c494){const _0x5768cb=a152_0x32dbf6,_0x1d88e5=new Set(),_0x4e2b7c=new Map(),_0x54232f=collectSegmentUsageCounts(_0x36c494);if(_0x36c494[_0x5768cb(0x175)])for(const [_0x2e61b2,_0x206d98]of Object['entries'](_0x36c494[_0x5768cb(0x175)])){_0x1d88e5[_0x5768cb(0x1c1)](_0x2e61b2);if(_0x206d98[_0x5768cb(0x195)]){const _0x3e3e37=yamlRuleToApi(_0x206d98['rule']),_0x11ec16=apiRuleToYaml(_0x3e3e37);_0x4e2b7c[_0x5768cb(0x20a)](_0x2e61b2,_0x11ec16);}}const _0x4a3a73=new Map();let _0x5242d5=0x0;for(const [_0x366790,_0x140e5f]of _0x4e2b7c){const _0x387911=serializeExpandedRule(_0x140e5f,_0x4e2b7c),_0x1d2aa0=_0x4a3a73[_0x5768cb(0x162)](_0x387911)||[];_0x1d2aa0[_0x5768cb(0x1a2)]({'name':_0x366790,'index':_0x5242d5}),_0x4a3a73[_0x5768cb(0x20a)](_0x387911,_0x1d2aa0),_0x5242d5++;}const _0x290123=new Map();for(const [_0xf4723a,_0x8f68fd]of _0x4a3a73){const _0xfa6479=_0x8f68fd[_0x5768cb(0x223)]()[_0x5768cb(0x1a7)]((_0x2850af,_0x341973)=>{const _0x507ce1=_0x5768cb,_0x239289=_0x54232f['get'](_0x2850af['name'])||0x0,_0x3fac9a=_0x54232f[_0x507ce1(0x162)](_0x341973[_0x507ce1(0x1de)])||0x0;if(_0x239289!==_0x3fac9a)return _0x3fac9a-_0x239289;return _0x2850af[_0x507ce1(0x15a)]-_0x341973[_0x507ce1(0x15a)];})[_0x5768cb(0x189)](_0x1ff9a1=>_0x1ff9a1[_0x5768cb(0x1de)]),_0x4a07df=[];for(const _0x4af1ef of _0xfa6479){const _0x497eca=_0x54232f[_0x5768cb(0x162)](_0x4af1ef)||0x0,_0x5f1aea=Math['max'](_0x497eca,0x1);for(let _0x474e29=0x0;_0x474e29<_0x5f1aea;_0x474e29++){_0x4a07df[_0x5768cb(0x1a2)](_0x4af1ef);}}_0x290123[_0x5768cb(0x20a)](_0xf4723a,_0x4a07df);}return{'existingLocalSegmentNames':_0x1d88e5,'localSegmentRules':_0x4e2b7c,'localExpandedRuleToNames':_0x290123};}export function createSegmentIdResolver(_0x393674,_0x36c2d7){return async _0x1974e0=>{const _0x6781cb=a152_0x13c2,_0x5e92fa=_0x393674['get'](_0x1974e0);if(!_0x5e92fa)throw new SDKError(ErrorCode[_0x6781cb(0x249)],_0x6781cb(0x1ab)+_0x1974e0+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x36c2d7+'\x27)');return _0x5e92fa;};}export function extractRootFolderId(_0x587ffb){const _0x4bcef1=a152_0x32dbf6;return _0x587ffb[_0x4bcef1(0x181)]?.[_0x4bcef1(0x182)]?.[_0x4bcef1(0x20f)]?.['id']||_0x587ffb[_0x4bcef1(0x181)]?.[_0x4bcef1(0x1c8)]?.[_0x4bcef1(0x20f)]?.['id'];}export function buildConnectionMaps(_0x3361a1){const _0x2e46f6=a152_0x32dbf6,_0x2761d4=new Map(),_0x4ff7cc=new Map(),_0xd348d9=new Map();for(const _0x5738e of _0x3361a1){_0x2761d4[_0x2e46f6(0x20a)](_0x5738e[_0x2e46f6(0x1de)],parseInt(_0x5738e['id'],0xa)),_0x4ff7cc['set'](_0x5738e['id'],_0x5738e['name']),_0xd348d9[_0x2e46f6(0x20a)](_0x5738e[_0x2e46f6(0x1de)],_0x5738e['type']);}return{'nameToId':_0x2761d4,'idToName':_0x4ff7cc,'nameToType':_0xd348d9};}export function calculatePushStats(_0x1bba01,_0xebb439,_0x17605b,_0x28c6cd,_0x2af139,_0x77fc07,_0x56cfd8){const _0x1c4f1c=a152_0x32dbf6,_0x4294d6=_0x1bba01[_0x1c4f1c(0x18c)](_0x20c8af=>_0x20c8af['isNew']),_0x492788=_0x1bba01[_0x1c4f1c(0x18c)](_0x577292=>!_0x577292[_0x1c4f1c(0x22f)]&&_0x577292['hasChanges']),_0xa55aed=_0x1bba01[_0x1c4f1c(0x18c)](_0x320796=>!_0x320796['isNew']&&!_0x320796[_0x1c4f1c(0x1c2)]),_0x477561=_0x77fc07?_0x28c6cd:[],_0x2df384=_0xebb439[_0x1c4f1c(0x18c)](_0x3a008d=>_0x3a008d[_0x1c4f1c(0x22f)]),_0x4bdb19=_0xebb439[_0x1c4f1c(0x18c)](_0x18e816=>!_0x18e816[_0x1c4f1c(0x22f)]&&_0x18e816[_0x1c4f1c(0x1c2)]),_0x38477c=_0xebb439[_0x1c4f1c(0x18c)](_0x44e10c=>!_0x44e10c[_0x1c4f1c(0x22f)]&&!_0x44e10c[_0x1c4f1c(0x1c2)]),_0x5926a8=_0x77fc07?_0x2af139:[],_0x87f706=_0x1bba01[_0x1c4f1c(0x152)](_0x4f3f1a=>_0x4f3f1a[_0x1c4f1c(0x14b)]),_0x1aa298=_0x87f706[_0x1c4f1c(0x18c)](_0x12d09b=>_0x12d09b[_0x1c4f1c(0x187)]==='create'),_0x4f3bf2=_0x87f706[_0x1c4f1c(0x18c)](_0x2a0338=>_0x2a0338['type']===_0x1c4f1c(0x166)),_0x20e069=_0x87f706[_0x1c4f1c(0x18c)](_0x590354=>_0x590354['type']===_0x1c4f1c(0x1a9)),_0x432739=Array['from'](_0x17605b)[_0x1c4f1c(0x1a7)](),_0x3ad0e6=_0x56cfd8?![]:_0x4294d6[_0x1c4f1c(0x24d)]>0x0||_0x492788['length']>0x0||_0x477561[_0x1c4f1c(0x24d)]>0x0,_0x353752=_0x2df384['length']>0x0||_0x4bdb19[_0x1c4f1c(0x24d)]>0x0||_0x5926a8[_0x1c4f1c(0x24d)]>0x0,_0x11e56f=_0x56cfd8?![]:_0x87f706[_0x1c4f1c(0x24d)]>0x0,_0x42e0c3=_0x432739['length']>0x0;return{'segments':{'new':_0x4294d6,'changed':_0x492788,'unchanged':_0xa55aed,'toDelete':_0x477561},'journeys':{'new':_0x2df384,'changed':_0x4bdb19,'unchanged':_0x38477c,'toDelete':_0x5926a8},'activations':{'all':_0x87f706,'toCreate':_0x1aa298,'toUpdate':_0x4f3bf2,'toDelete':_0x20e069},'folders':{'toCreate':_0x432739},'counts':{'segments':{'new':_0x4294d6[_0x1c4f1c(0x24d)],'changed':_0x492788[_0x1c4f1c(0x24d)],'unchanged':_0xa55aed[_0x1c4f1c(0x24d)],'toDelete':_0x477561[_0x1c4f1c(0x24d)]},'journeys':{'new':_0x2df384[_0x1c4f1c(0x24d)],'changed':_0x4bdb19['length'],'unchanged':_0x38477c['length'],'toDelete':_0x5926a8[_0x1c4f1c(0x24d)]},'activations':{'create':_0x1aa298[_0x1c4f1c(0x24d)],'update':_0x4f3bf2[_0x1c4f1c(0x24d)],'delete':_0x20e069[_0x1c4f1c(0x24d)]},'folders':_0x432739['length']},'hasChanges':_0x3ad0e6||_0x353752||_0x11e56f||_0x42e0c3};}export async function buildPushExecutionContext(_0x35ea84,_0x453094,_0xe9ce0b,_0x39ba3a,_0x366ae4,_0x25b800){const _0x118f75=a152_0x32dbf6,_0x25da3f=extractRootFolderId(_0xe9ce0b),{pathToId:_0x5dc2af,idToPath:_0x237e4f}=buildFolderMaps(_0x366ae4),_0x3ccfbb=buildSegmentNameToIdMap(_0x39ba3a),_0x47868e=new Map(),{batchAsync:_0x452506}=await import('../../utils/async.js'),[_0x574b61,_0x36a5b3]=await Promise['all']([_0x35ea84['user']['buildUserMaps'](),_0x35ea84[_0x118f75(0x214)]['list'](),((async()=>{const _0x3cfe11=_0x118f75;!_0x25b800&&_0x39ba3a[_0x3cfe11(0x24d)]>0x0&&await _0x452506(_0x39ba3a,async _0x40bcf7=>{const _0x4bbe1e=_0x3cfe11,_0x52839a=await _0x35ea84['segment']['listActivations'](_0x453094,_0x40bcf7['id']);_0x47868e[_0x4bbe1e(0x20a)](_0x40bcf7['id'],_0x52839a);});})())]),{emailToId:_0x271929,idToEmail:_0x51b1cb}=_0x574b61,_0x463f8b=buildConnectionMaps(_0x36a5b3);return{'rootFolderId':_0x25da3f,'folderPathToId':_0x5dc2af,'folderIdToPath':_0x237e4f,'segmentNameToId':_0x3ccfbb,'activationsBySegmentId':_0x47868e,'emailToIdMap':_0x271929,'idToEmailMap':_0x51b1cb,'connectionNameToIdMap':_0x463f8b[_0x118f75(0x1d4)],'connectionIdToNameMap':_0x463f8b['idToName'],'connectionNameToTypeMap':_0x463f8b[_0x118f75(0x241)]};}export function createPushYamlContextForBundle(_0x1683fa,_0x4f54b1,_0x570ad8,_0x50ede4,_0x20b6fc,_0x56efe6,_0x56603f,_0x17e974){const {existingLocalSegmentNames:_0x53ef0b,localExpandedRuleToNames:_0x3fb97f}=_0x50ede4,_0x292db5=new Set(),_0xa41288=new Map(),_0x956ac=new Map(),_0x17d478=new Map(),_0x45dd48=createJumpTargetCache(),_0x269c3f=new Map(),_0x3910c1=new Map(),_0xd4dcd7=new Set();let _0x65399f;const _0x10de23=_0x4d778a=>{const _0xa8379d={'resolveSegment':async _0x19eb9e=>{const _0x261be3=a152_0x13c2,_0xd2dd57=_0x17d478[_0x261be3(0x162)](_0x19eb9e);if(_0xd2dd57!==undefined)return{'name':_0xd2dd57,'isJourneyLocal':!![]};try{const _0x20fb19=await fetchSegment(_0x1683fa,_0x4f54b1,_0x19eb9e,_0x570ad8);if(!_0x20fb19)throw new Error(_0x261be3(0x159));const _0x489bf4=generateJourneyLocalName(_0x20fb19['name']),_0x1d4301=_0x20fb19[_0x261be3(0x243)]===SEGMENT_KIND_JOURNEY&&_0x489bf4!==undefined;let _0x62c2d3=_0x20fb19[_0x261be3(0x1de)],_0xc2d38a;if(_0x1d4301&&_0x20fb19[_0x261be3(0x195)]){const _0x23195e=apiRuleToYaml(_0x20fb19[_0x261be3(0x195)]);_0x3910c1[_0x261be3(0x20a)](_0x19eb9e,_0x23195e);const _0x50e17a=async _0x260595=>{const _0x2f1b81=_0x261be3,_0x56c993=collectSegmentRefsFromRule(_0x260595);for(const _0x4307f2 of _0x56c993){if(!_0x3910c1[_0x2f1b81(0x1a6)](_0x4307f2))try{const _0x109ebe=await fetchSegment(_0x1683fa,_0x4f54b1,_0x4307f2,_0x570ad8);if(_0x109ebe?.[_0x2f1b81(0x195)]){const _0x5b117d=apiRuleToYaml(_0x109ebe[_0x2f1b81(0x195)]);_0x3910c1[_0x2f1b81(0x20a)](_0x4307f2,_0x5b117d),await _0x50e17a(_0x5b117d);}}catch(_0x48aa78){logger['debug'](_0x2f1b81(0x228)+_0x4307f2+':\x20'+_0x48aa78);}}};await _0x50e17a(_0x23195e);const _0x23f3fe=serializeExpandedRule(_0x23195e,_0x3910c1),_0x2da367=_0x3fb97f[_0x261be3(0x162)](_0x23f3fe);if(_0x2da367&&_0x2da367['length']>0x0){const _0x25c4bb=_0xa41288[_0x261be3(0x162)](_0x23f3fe)||0x0,_0x3f366d=_0x2da367[_0x25c4bb]||_0x2da367[_0x2da367['length']-0x1];_0xa41288['set'](_0x23f3fe,_0x25c4bb+0x1),_0x62c2d3=_0x3f366d,_0x292db5[_0x261be3(0x1c1)](_0x62c2d3),_0x17d478['set'](_0x19eb9e,_0x62c2d3);const _0x35db11=await resolveRuleSegmentRefs(_0x23195e,async _0x509936=>{const _0x244466=_0x261be3,_0x5f4852=_0x17d478[_0x244466(0x162)](_0x509936);if(_0x5f4852)return _0x5f4852;const _0x1d40ad=await _0x65399f[_0x244466(0x191)](_0x509936);return _0x1d40ad[_0x244466(0x1de)];});_0xc2d38a={'description':_0x20fb19[_0x261be3(0x1d7)],'rule':_0x35db11};}else{const _0xa08885=_0x269c3f[_0x261be3(0x162)](_0x23f3fe);if(_0xa08885)_0x62c2d3=_0xa08885,_0x17d478['set'](_0x19eb9e,_0x62c2d3);else{if(_0x489bf4){let _0x1be920=_0x489bf4,_0x225514=0x2;while(_0x292db5[_0x261be3(0x1a6)](_0x1be920)||_0x53ef0b[_0x261be3(0x1a6)](_0x1be920)){_0x1be920=_0x489bf4+'_'+_0x225514,_0x225514++;}_0x292db5['add'](_0x1be920),_0x62c2d3=_0x1be920;}_0x17d478[_0x261be3(0x20a)](_0x19eb9e,_0x62c2d3),_0x269c3f['set'](_0x23f3fe,_0x62c2d3);const _0x26f639=await resolveRuleSegmentRefs(_0x23195e,async _0x46db30=>{const _0x382c6e=_0x261be3,_0x5bce9c=_0x17d478[_0x382c6e(0x162)](_0x46db30);if(_0x5bce9c)return _0x5bce9c;const _0x3469fe=await _0x65399f[_0x382c6e(0x191)](_0x46db30);return _0x3469fe[_0x382c6e(0x1de)];});_0xc2d38a={'description':_0x20fb19[_0x261be3(0x1d7)],'rule':_0x26f639};}}}return{'name':_0x62c2d3,'isJourneyLocal':_0x1d4301,'definition':_0xc2d38a};}catch(_0x3f2a59){return logger[_0x261be3(0x21e)](_0x261be3(0x23c)+_0x19eb9e+':\x20'+_0x3f2a59),{'name':_0x19eb9e,'isJourneyLocal':![]};}},'resolveActivation':async _0x53b18e=>{const _0x5b2cec=a152_0x13c2,_0x41f57a=_0x956ac['get'](_0x53b18e);if(_0x41f57a!==undefined)return{'name':_0x41f57a,'isJourneyLocal':!![]};try{let _0x474ae7=_0x56603f?.['get'](_0x53b18e);!_0x474ae7&&(_0x474ae7=await _0x1683fa[_0x5b2cec(0x1c3)]['getActivation'](_0x4d778a,_0x53b18e));const _0x233e5b=_0x474ae7['attributes'][_0x5b2cec(0x185)][_0x5b2cec(0x1de)]||_0x53b18e,_0x1c7937=sanitizeYamlKey(_0x233e5b)||_0x5b2cec(0x17a)+_0x53b18e,_0x416e15=_0x1c7937;_0x956ac['set'](_0x53b18e,_0x416e15);const _0x468f76=journeyActivationStepToYaml(_0x474ae7,_0x20b6fc,_0x56efe6);return{'name':_0x416e15,'isJourneyLocal':!![],'definition':_0x468f76};}catch(_0x3acee5){return logger[_0x5b2cec(0x21e)]('Failed\x20to\x20resolve\x20activation\x20'+_0x53b18e+':\x20'+_0x3acee5),{'name':_0x53b18e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x128f91,_0x2da0b6)=>resolveJumpTarget(_0x128f91,_0x2da0b6,_0x45dd48,async _0x60c5a0=>{const _0x5b8aec=a152_0x13c2,_0x253c18=_0x17e974?.[_0x5b8aec(0x162)](_0x60c5a0);if(_0x253c18)return _0x253c18;return _0x1683fa[_0x5b8aec(0x1c3)][_0x5b8aec(0x232)](_0x60c5a0);})};return _0x65399f=_0xa8379d,_0xa8379d;},_0x4c10f8=async _0x479453=>{const _0x5919ee=a152_0x13c2,{collectSegmentIdsFromJourneyApi:_0xdd41c3}=await import(_0x5919ee(0x171)),{batchAsync:_0x1880d5}=await import(_0x5919ee(0x180)),_0x1f4228=new Set();for(const _0x468bfe of _0x479453){let _0xfa7f9c=_0x17e974?.[_0x5919ee(0x162)](_0x468bfe);!_0xfa7f9c&&(_0xfa7f9c=await _0x1683fa[_0x5919ee(0x1c3)][_0x5919ee(0x232)](_0x468bfe));const _0x55e665=_0xdd41c3(_0xfa7f9c);for(const _0x470a39 of _0x55e665){_0x1f4228[_0x5919ee(0x1c1)](_0x470a39);}}let _0x21e93a=Array[_0x5919ee(0x230)](_0x1f4228);while(_0x21e93a['length']>0x0){const _0x30d59d=_0x21e93a[_0x5919ee(0x18c)](_0x2cf22a=>!_0xd4dcd7[_0x5919ee(0x1a6)](_0x2cf22a));if(_0x30d59d['length']===0x0)break;const _0x2ace2a=await _0x1880d5(_0x30d59d,async _0x34561e=>{const _0x39612f=_0x5919ee;_0xd4dcd7[_0x39612f(0x1c1)](_0x34561e);const _0x29fe17=await fetchSegment(_0x1683fa,_0x4f54b1,_0x34561e,_0x570ad8);if(!_0x29fe17)return null;return{'segmentId':_0x34561e,'segment':_0x29fe17};},0xa),_0x5d59c3=new Set();for(const _0x74e20 of _0x2ace2a){if(!_0x74e20?.['segment']?.[_0x5919ee(0x195)])continue;const _0x207cf2=apiRuleToYaml(_0x74e20[_0x5919ee(0x196)][_0x5919ee(0x195)]);_0x3910c1[_0x5919ee(0x20a)](_0x74e20[_0x5919ee(0x15e)],_0x207cf2);const _0xa3e71d=collectSegmentRefsFromRule(_0x207cf2);for(const _0x215ccc of _0xa3e71d){!_0xd4dcd7[_0x5919ee(0x1a6)](_0x215ccc)&&_0x5d59c3[_0x5919ee(0x1c1)](_0x215ccc);}}_0x21e93a=Array['from'](_0x5d59c3);}};return{'createYamlContext':_0x10de23,'prefetchJourneySegments':_0x4c10f8};}export async function executePushSegments(_0x2700fe,_0xba8d1,_0x53b62e,_0x227b84,_0x4869d8){const _0xcc4da8=a152_0x32dbf6,{segmentDefToCreateRequest:_0x272c1a,segmentDefToUpdateRequest:_0x82ce6b}=await import('./child-segment-yaml.js'),_0x1eebd7=_0x53b62e['folderPathToId'],_0x2de08e=0x5,_0x451356=async _0x49b1df=>{const _0x1c1b21=a152_0x13c2,_0x37a2f2=_0x49b1df[_0x1c1b21(0x237)]?_0x1eebd7[_0x1c1b21(0x162)](_0x49b1df[_0x1c1b21(0x237)]):undefined;let _0x1668d3;const _0x3f51f2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xcc77ae=_0x49b1df[_0x1c1b21(0x154)];if(_0x49b1df[_0x1c1b21(0x154)]['rule']){const _0x12d548=createSegmentIdResolver(_0x53b62e['segmentNameToId'],_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]),_0x447af9=await resolveRuleSegmentIds(_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x195)],_0x12d548);_0xcc77ae={..._0x49b1df[_0x1c1b21(0x154)],'rule':_0x447af9};}try{if(_0x49b1df[_0x1c1b21(0x22f)]){_0x4869d8[_0x1c1b21(0x1da)]?.({'type':_0x1c1b21(0x15d),'name':_0x49b1df['yamlConfig'][_0x1c1b21(0x1de)]});const _0x11c956=_0x272c1a(_0xcc77ae,_0x37a2f2),_0x1f0b70=await _0x4869d8[_0x1c1b21(0x150)](_0x1c1b21(0x1af)+_0x49b1df[_0x1c1b21(0x154)]['name']+_0x1c1b21(0x18e),()=>_0x2700fe[_0x1c1b21(0x196)][_0x1c1b21(0x222)](_0x227b84[_0x1c1b21(0x1fd)],_0x11c956));_0x1668d3=_0x1f0b70[_0x1c1b21(0x20f)]['id'],_0x53b62e[_0x1c1b21(0x212)][_0x1c1b21(0x20a)](_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)],_0x1668d3),_0x3f51f2[_0x1c1b21(0x1e8)]={'name':_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)],'id':_0x1668d3},_0x4869d8['onProgress']?.({'type':_0x1c1b21(0x186),'name':_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)],'segmentId':_0x1668d3}),_0x4869d8[_0x1c1b21(0x18b)]?.(_0x1c1b21(0x1f9)+_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]+'\x27'),_0x3f51f2[_0x1c1b21(0x1a5)]=0x1;}else{if(_0x49b1df[_0x1c1b21(0x1c2)]){_0x4869d8['onProgress']?.({'type':_0x1c1b21(0x1c5),'name':_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]});const _0x2fb742=_0x82ce6b(_0xcc77ae);_0x37a2f2!==_0x49b1df[_0x1c1b21(0x19b)]?.[_0x1c1b21(0x1ac)]&&(_0x2fb742['segmentFolderId']=_0x37a2f2?parseInt(_0x37a2f2,0xa):undefined),await _0x4869d8[_0x1c1b21(0x150)](_0x1c1b21(0x15b)+_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]+_0x1c1b21(0x18e),()=>_0x2700fe[_0x1c1b21(0x196)][_0x1c1b21(0x1d6)](_0x227b84['parentId'],_0x49b1df[_0x1c1b21(0x19b)]['id'],_0x2fb742)),_0x1668d3=_0x49b1df['existingSegment']['id'],_0x4869d8[_0x1c1b21(0x1da)]?.({'type':_0x1c1b21(0x246),'name':_0x49b1df['yamlConfig'][_0x1c1b21(0x1de)]}),_0x4869d8[_0x1c1b21(0x18b)]?.('Updated\x20segment\x20\x27'+_0x49b1df[_0x1c1b21(0x154)][_0x1c1b21(0x1de)]+'\x27'),_0x3f51f2[_0x1c1b21(0x1b9)]=0x1;}else _0x1668d3=_0x49b1df[_0x1c1b21(0x19b)]['id'];}}catch(_0x388942){const _0x629179=isHttp400Error(_0x388942),_0x4fc9ef=_0x629179?ErrorCode[_0x1c1b21(0x161)]:ErrorCode[_0x1c1b21(0x205)],_0x123ed9=getErrorMessage(_0x388942);throw new SDKError(_0x4fc9ef,'Failed\x20to\x20'+(_0x49b1df[_0x1c1b21(0x22f)]?_0x1c1b21(0x1d9):'update')+_0x1c1b21(0x1ad)+_0x49b1df[_0x1c1b21(0x160)]+'\x0a\x20\x20'+_0x123ed9,_0x388942);}try{const _0x2754ce=await syncActivationsForSegment(_0x2700fe,_0x227b84['parentId'],_0x1668d3,_0x49b1df['yamlConfig'][_0x1c1b21(0x1de)],_0x49b1df[_0x1c1b21(0x14b)],_0x4869d8,_0x49b1df[_0x1c1b21(0x160)]);_0x3f51f2['activations']=_0x2754ce;}catch(_0x45bbd4){if(_0x45bbd4 instanceof SDKError)throw _0x45bbd4;throw new SDKError(ErrorCode[_0x1c1b21(0x239)],_0x1c1b21(0x1b4)+_0x49b1df[_0x1c1b21(0x154)]['name']+'\x27\x20from\x20file:\x20'+_0x49b1df[_0x1c1b21(0x160)]+'\x0a\x20\x20'+getErrorMessage(_0x45bbd4),_0x45bbd4);}return _0x3f51f2;},_0x3094b1=await batchAsync(_0xba8d1,_0x451356,_0x2de08e),_0x3dcdfe={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x31deca of _0x3094b1){_0x3dcdfe['created']+=_0x31deca['created'],_0x3dcdfe[_0xcc4da8(0x1b9)]+=_0x31deca[_0xcc4da8(0x1b9)],_0x31deca[_0xcc4da8(0x1e8)]&&_0x3dcdfe['createdSegmentIds']['set'](_0x31deca[_0xcc4da8(0x1e8)][_0xcc4da8(0x1de)],_0x31deca[_0xcc4da8(0x1e8)]['id']),_0x3dcdfe[_0xcc4da8(0x169)]['created']+=_0x31deca[_0xcc4da8(0x169)][_0xcc4da8(0x1a5)],_0x3dcdfe['activations']['updated']+=_0x31deca[_0xcc4da8(0x169)][_0xcc4da8(0x1b9)],_0x3dcdfe[_0xcc4da8(0x169)][_0xcc4da8(0x1b0)]+=_0x31deca['activations'][_0xcc4da8(0x1b0)];}return _0x3dcdfe;}async function syncActivationsForSegment(_0xf11400,_0x578ae8,_0x255c44,_0x54640e,_0x12c2ed,_0x28417b,_0x2119ba){const _0x532b45=a152_0x32dbf6,_0x6a977a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1f98ee of _0x12c2ed){try{if(_0x1f98ee[_0x532b45(0x187)]===_0x532b45(0x1d9)&&_0x1f98ee[_0x532b45(0x1fb)])_0x28417b['onProgress']?.({'type':'activation_creating','segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),await _0x28417b[_0x532b45(0x150)](_0x532b45(0x15f)+_0x1f98ee[_0x532b45(0x1de)]+_0x532b45(0x18e),()=>_0xf11400['segment'][_0x532b45(0x14d)](_0x578ae8,_0x255c44,_0x1f98ee[_0x532b45(0x1fb)])),_0x28417b['onProgress']?.({'type':_0x532b45(0x236),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),_0x28417b[_0x532b45(0x18b)]?.('Created\x20activation\x20\x27'+_0x1f98ee['name']+'\x27'),_0x6a977a[_0x532b45(0x1a5)]++;else{if(_0x1f98ee['type']==='update'&&_0x1f98ee[_0x532b45(0x1fb)]&&_0x1f98ee[_0x532b45(0x158)])_0x28417b[_0x532b45(0x1da)]?.({'type':'activation_updating','segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),await _0x28417b[_0x532b45(0x150)](_0x532b45(0x173)+_0x1f98ee['name']+_0x532b45(0x18e),()=>_0xf11400['segment'][_0x532b45(0x1aa)](_0x578ae8,_0x255c44,_0x1f98ee[_0x532b45(0x158)]['id'],_0x1f98ee[_0x532b45(0x1fb)])),_0x28417b[_0x532b45(0x1da)]?.({'type':_0x532b45(0x24b),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),_0x28417b[_0x532b45(0x18b)]?.(_0x532b45(0x1f0)+_0x1f98ee['name']+'\x27'),_0x6a977a[_0x532b45(0x1b9)]++;else _0x1f98ee['type']===_0x532b45(0x1a9)&&_0x1f98ee[_0x532b45(0x158)]&&(_0x28417b[_0x532b45(0x1da)]?.({'type':_0x532b45(0x1c9),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),await _0x28417b[_0x532b45(0x150)](_0x532b45(0x221)+_0x1f98ee[_0x532b45(0x1de)]+_0x532b45(0x18e),()=>_0xf11400[_0x532b45(0x196)][_0x532b45(0x1dc)](_0x578ae8,_0x255c44,_0x1f98ee[_0x532b45(0x158)]['id'])),_0x28417b[_0x532b45(0x1da)]?.({'type':_0x532b45(0x219),'segmentName':_0x54640e,'activationName':_0x1f98ee[_0x532b45(0x1de)]}),_0x28417b[_0x532b45(0x1df)]?.(_0x532b45(0x1f5)+_0x1f98ee['name']+'\x27'),_0x6a977a[_0x532b45(0x1b0)]++);}}catch(_0x681c67){const _0x2c5880=isHttp400Error(_0x681c67),_0x2c3c72=_0x2c5880?ErrorCode[_0x532b45(0x1b1)]:ErrorCode[_0x532b45(0x239)],_0x4abd5b=getErrorMessage(_0x681c67);throw new SDKError(_0x2c3c72,_0x532b45(0x23e)+_0x1f98ee['type']+_0x532b45(0x177)+_0x1f98ee['name']+'\x27\x20from\x20file:\x20'+_0x2119ba+_0x532b45(0x172)+_0x4abd5b,_0x681c67);}}return _0x6a977a;}export async function executePushFolders(_0x330548,_0x150109,_0xf366c4,_0x170341,_0x5bfc14){const _0x711e3e=a152_0x32dbf6,_0x56540d=new Map(_0xf366c4),_0x39002f=sortFoldersByDepth(_0x150109);for(const _0x4fe15b of _0x39002f){const _0x36e453=_0x4fe15b[_0x711e3e(0x1e6)]('/'),_0x1e8187=_0x36e453[_0x36e453['length']-0x1],_0x464db1=_0x36e453[_0x711e3e(0x223)](0x0,-0x1)[_0x711e3e(0x197)]('/'),_0x417864=_0x56540d[_0x711e3e(0x162)](_0x464db1);_0x5bfc14[_0x711e3e(0x1da)]?.({'type':_0x711e3e(0x24e),'folder':_0x4fe15b});const _0x37027b={'name':_0x1e8187,'parentFolderId':_0x417864},_0x5ad411=await _0x5bfc14[_0x711e3e(0x150)](_0x711e3e(0x156)+_0x4fe15b+_0x711e3e(0x18e),()=>_0x330548['segment'][_0x711e3e(0x210)](_0x170341[_0x711e3e(0x1fd)],_0x37027b));_0x56540d[_0x711e3e(0x20a)](_0x4fe15b,_0x5ad411[_0x711e3e(0x20f)]['id']),_0x5bfc14[_0x711e3e(0x1da)]?.({'type':_0x711e3e(0x153),'folder':_0x4fe15b,'folderId':_0x5ad411[_0x711e3e(0x20f)]['id']}),_0x5bfc14[_0x711e3e(0x21c)]?.(_0x711e3e(0x1ea)+_0x4fe15b+'\x27');}return _0x56540d;}export async function executePushSegmentDeletions(_0x58b575,_0xe7738e,_0x539f99){const _0x20a7ed=a152_0x32dbf6;if(_0xe7738e[_0x20a7ed(0x24d)]===0x0)return 0x0;const {batchAsync:_0x30ed91}=await import(_0x20a7ed(0x180)),_0x37451e=0x5,_0x499a52=await _0x30ed91(_0xe7738e,async _0x2c0185=>{const _0x172870=_0x20a7ed;return _0x539f99['onProgress']?.({'type':_0x172870(0x1fe),'name':_0x2c0185[_0x172870(0x1de)]}),await _0x58b575[_0x172870(0x196)][_0x172870(0x1d0)](_0x2c0185['id']),_0x539f99[_0x172870(0x1da)]?.({'type':_0x172870(0x1cb),'name':_0x2c0185[_0x172870(0x1de)]}),_0x539f99[_0x172870(0x1df)]?.(_0x172870(0x227)+_0x2c0185[_0x172870(0x1de)]+'\x27'),0x1;},_0x37451e);return _0x499a52[_0x20a7ed(0x1ee)]((_0x58e842,_0x1cf218)=>_0x58e842+_0x1cf218,0x0);}export async function executePushJourneys(_0x5a98d9,_0x51647e,_0x1c8144,_0x285749,_0x5056b9){const _0x5c7385=a152_0x32dbf6,{journeyDefToRequest:_0x3c0262}=await import(_0x5c7385(0x171)),{activationDefToCreateRequest:_0x10729f,yamlRuleToApi:_0x552eef,validateSegmentRule:_0x4af711}=await import('./child-segment-yaml.js'),_0x1e7fa0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1e2fe2=new Map(_0x1c8144['segmentNameToId']),_0x522318=0x5;for(let _0x1a81c2=0x0;_0x1a81c2<_0x51647e[_0x5c7385(0x24d)];_0x1a81c2+=_0x522318){const _0x5d1bc4=_0x51647e[_0x5c7385(0x223)](_0x1a81c2,_0x1a81c2+_0x522318),_0x3ecc54=await Promise[_0x5c7385(0x1b6)](_0x5d1bc4[_0x5c7385(0x189)](async _0x41f425=>{const _0x9d6ab3=_0x5c7385;if(!_0x41f425[_0x9d6ab3(0x22f)]&&!_0x41f425['hasChanges'])return{'action':_0x9d6ab3(0x16e),'name':_0x41f425[_0x9d6ab3(0x154)][_0x9d6ab3(0x1de)],'journeyId':_0x41f425[_0x9d6ab3(0x1f4)]?.['id']};const _0x12549c=_0x41f425[_0x9d6ab3(0x237)]?_0x1c8144[_0x9d6ab3(0x192)]['get'](_0x41f425[_0x9d6ab3(0x237)]):undefined;_0x5056b9[_0x9d6ab3(0x1da)]?.({'type':_0x41f425[_0x9d6ab3(0x22f)]?_0x9d6ab3(0x184):'journey_updating','name':_0x41f425[_0x9d6ab3(0x154)][_0x9d6ab3(0x1de)]});try{const _0x31cc3c=await executeSingleJourneyPush(_0x5a98d9,_0x41f425,{..._0x1c8144,'segmentNameToId':_0x1e2fe2},{'parentId':_0x285749[_0x9d6ab3(0x1fd)],'rootFolderId':_0x285749['rootFolderId'],'folderId':_0x12549c,'verbose':_0x285749[_0x9d6ab3(0x14c)]},_0x5056b9,{'journeyDefToRequest':_0x3c0262,'activationDefToCreateRequest':_0x10729f,'yamlRuleToApi':_0x552eef,'validateSegmentRule':_0x4af711});for(const [_0x5ee115,_0x24ea24]of _0x31cc3c[_0x9d6ab3(0x21a)]){_0x1e2fe2[_0x9d6ab3(0x20a)](_0x5ee115,_0x24ea24),_0x1e7fa0[_0x9d6ab3(0x21a)][_0x9d6ab3(0x20a)](_0x5ee115,_0x24ea24);}if(_0x31cc3c[_0x9d6ab3(0x242)]===_0x9d6ab3(0x1a5))_0x5056b9[_0x9d6ab3(0x1da)]?.({'type':_0x9d6ab3(0x1fa),'name':_0x41f425['yamlConfig']['name'],'journeyId':_0x31cc3c['journeyId']}),_0x5056b9[_0x9d6ab3(0x18b)]?.(_0x9d6ab3(0x165)+_0x41f425[_0x9d6ab3(0x154)][_0x9d6ab3(0x1de)]+'\x27'),_0x1e7fa0[_0x9d6ab3(0x1a5)]++;else _0x31cc3c[_0x9d6ab3(0x242)]===_0x9d6ab3(0x1b9)&&(_0x5056b9[_0x9d6ab3(0x1da)]?.({'type':_0x9d6ab3(0x157),'name':_0x41f425['yamlConfig'][_0x9d6ab3(0x1de)]}),_0x5056b9['logSuccess']?.(_0x9d6ab3(0x225)+_0x41f425['yamlConfig']['name']+'\x27'),_0x1e7fa0['updated']++);return{'action':_0x31cc3c[_0x9d6ab3(0x242)],'name':_0x41f425['yamlConfig'][_0x9d6ab3(0x1de)],'journeyId':_0x31cc3c[_0x9d6ab3(0x244)]};}catch(_0x517670){const _0x114e4d=isHttp400Error(_0x517670),_0x599b31=_0x114e4d?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x1a95de=getErrorMessage(_0x517670);throw new SDKError(_0x599b31,'Failed\x20to\x20'+(_0x41f425[_0x9d6ab3(0x22f)]?_0x9d6ab3(0x1d9):_0x9d6ab3(0x166))+_0x9d6ab3(0x1ae)+_0x41f425[_0x9d6ab3(0x160)]+_0x9d6ab3(0x172)+_0x1a95de,_0x517670);}}));_0x1e7fa0['results'][_0x5c7385(0x1a2)](..._0x3ecc54);}return _0x1e7fa0;}function a152_0x5e75(){const _0x55c04f=['entries','logInfo','Entry\x20criteria:\x20','debug','keys','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Deleting\x20activation\x20\x27','createSegment','slice','./child-segment-yaml.js','Updated\x20journey\x20\x27','values','Deleted\x20segment\x20\x27','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20entry\x20criteria','waitStepType','folderId','\x27\x20exit\x20criteria','\x20(referenced\x20in\x20journey\x20','activationsBySegmentId','isNew','from','logWarning','getJourney','entryCriteria','Journey\x20\x27','behavior','activation_created','folderPath','activationContext','ACTIVATION_UPDATE_ERROR','branches','day','Failed\x20to\x20resolve\x20segment\x20','connectionIdToNameMap','Failed\x20to\x20','\x27\x20wait\x20condition','valid','nameToType','action','kind','journeyId','24XZqDdI','segment_updated','parse','rootFolderId','SEGMENT_NOT_FOUND','NOT_FOUND','activation_updated','2859288XdYAgY','length','folder_creating','journeyBundlesByFolderAndName','__pending_act_','notification','activationActions','verbose','createActivation','__pending_','):\x20','withProgress','stringify','flatMap','folder_created','yamlConfig','goal','Creating\x20folder\x20\x27','journey_updated','existingActivation','Segment\x20not\x20found','index','Updating\x20segment\x20\x27','conditionTimeoutUnit','segment_creating','segmentId','Creating\x20activation\x20\x27','absolutePath','SEGMENT_SYNTAX_ERROR','get','message','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Created\x20journey\x20\x27','update','columns','133782Xhqcbt','activations','waitStepUnit','some','toISOString','journeys','unchanged','embedded_activation_creating','toLowerCase','./journey-yaml.js','\x0a\x20\x20','Updating\x20activation\x20\x27','\x20error(s)','segments','4097355KgzfQz','\x20activation\x20\x27','object','startsWith','activation_','diff','connector_config','errors','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','Activation','../../utils/async.js','relationships','parentSegmentFolder','trim','journey_creating','activationParams','segment_created','type','uniqueSegmentName','map','Duration','logSuccess','filter','journeyActivationStepId','\x27...','steps','match','resolveSegment','folderPathToId','conditionSegmentId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','rule','segment','join','2300TXMFNY','idToEmailMap','toString','existingSegment','Fetching\x20','1746378yBESkw','journeyStages','parseDocument','find','skipSegments','push','6XPPxKv','33704YefAzy','created','has','sort','uniqueServerName','delete','updateActivation','Segment\x20not\x20found:\x20','segmentFolderId','\x20segment\x20from\x20file:\x20','\x20journey\x20from\x20file:\x20','Creating\x20segment\x20\x27','deleted','ACTIVATION_SYNTAX_ERROR','segmentByFolderAndName','resolvedRule','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journeyBundleName','all','getSegment','existingSegments','updated','WaitStep','Stage\x20\x27','createJourneySegment','milestone','localName','decision_point','journeyBundleId','add','hasChanges','journey','relative','segment_updating','\x27\x20for\x20','\x27\x20to\x20local\x20\x27','parentFolder','activation_deleting','getLatestJourneyId','segment_deleted','embedded_segment_created','versionNumber','\x27\x20not\x20found\x20in\x20journey\x20\x27','activation_template_id','deleteSegment','includes','INTERNAL','Activation\x20not\x20found:\x20','nameToId','journeyActivationNameToId','updateSegmentById','description','entry_criteria','create','onProgress','336885pQoInl','deleteActivation',').\x20','name','logDeleted','getSegmentEntity','state','Condition','progress','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','item','split',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','createdSegmentId','conditionTimeoutDuration','Created\x20folder\x20\x27','waitStep','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','resolveJourneyId','reduce','Embedded\x20segment\x20\x27','Updated\x20activation\x20\x27','\x27\x20by\x20rule\x20content','1506120PewSNf','all_columns','existingJourney','Deleted\x20activation\x20\x27','exitCriterias','isArray','Delete\x20the\x20push\x20recovery\x20file\x20(','Created\x20segment\x20\x27','journey_created','validatedRequest','journeyById','parentId','segment_deleting','getSegmentEntity\x20also\x20failed\x20for\x20','conditions','deps','replace','yamlActivation','8wjdRtU','SEGMENT_UPDATE_ERROR','getSegment\x20failed\x20for\x20','stage\x20\x27','null','fetchJourney','set','utf-8','embedded_segment_creating','attributes','goal\x20criteria','data','createFolder','stages','segmentNameToId','\x27\x20decision\x20point\x20branch\x20\x27','connection','Matched\x20server\x20segment\x20\x27','journeyName','.$1.push-recovery.json','listActivations','activation_deleted','embeddedSegmentNameToId'];a152_0x5e75=function(){return _0x55c04f;};return a152_0x5e75();}async function matchExistingJourneySegments(_0x57046a,_0x10d4c3,_0x2572d6,_0x40a6a7,_0x5689af){const _0x7c1553=a152_0x32dbf6;if(!_0x10d4c3['existingJourney']||!_0x10d4c3['yamlConfig'][_0x7c1553(0x175)])return;const _0x37b736=new Map(),_0x45368e=new Set();for(const _0x9f800 of Object[_0x7c1553(0x21f)](_0x10d4c3[_0x7c1553(0x154)][_0x7c1553(0x175)])){const _0x4254d7=generateDeterministicJourneySegmentName(_0x10d4c3['yamlConfig'][_0x7c1553(0x1de)],_0x9f800);_0x37b736['set'](_0x4254d7,_0x9f800),_0x45368e[_0x7c1553(0x1c1)](_0x9f800);}const _0x30a98c=[],_0x33bf39=collectSegmentIdsFromJourneyApi(_0x10d4c3[_0x7c1553(0x1f4)]);for(const _0x403013 of _0x33bf39){const _0x122771=await fetchSegment(_0x57046a,_0x2572d6,_0x403013,_0x40a6a7);if(!_0x122771?.[_0x7c1553(0x1de)])continue;const _0x4b0d0c=_0x37b736[_0x7c1553(0x162)](_0x122771[_0x7c1553(0x1de)]);_0x4b0d0c?(_0x5689af[_0x7c1553(0x20a)](_0x4b0d0c,_0x403013),_0x45368e[_0x7c1553(0x1a9)](_0x4b0d0c)):_0x30a98c[_0x7c1553(0x1a2)]({'id':_0x403013,'seg':_0x122771});}if(_0x45368e['size']>0x0&&_0x30a98c['length']>0x0){const {localExpandedRuleToNames:_0xb9e90b}=buildLocalExpandedRuleMappings(_0x10d4c3[_0x7c1553(0x154)]),_0x1b5c68=new Map();for(const {id:_0x89494,seg:_0x4fb910}of _0x30a98c){if(_0x4fb910['rule']){const _0x290be4=apiRuleToYaml(_0x4fb910[_0x7c1553(0x195)]);_0x1b5c68['set'](_0x89494,_0x290be4);}}for(const {id:_0x18e9a8,seg:_0x1273dc}of _0x30a98c){if(!_0x1273dc[_0x7c1553(0x195)])continue;const _0x1b7f36=_0x1b5c68[_0x7c1553(0x162)](_0x18e9a8);if(!_0x1b7f36)continue;const _0x1c8f96=serializeExpandedRule(_0x1b7f36,_0x1b5c68),_0x37b30e=_0xb9e90b[_0x7c1553(0x162)](_0x1c8f96);if(_0x37b30e){const _0x4c1b9a=_0x37b30e[_0x7c1553(0x1a0)](_0x3120f8=>_0x45368e[_0x7c1553(0x1a6)](_0x3120f8));_0x4c1b9a&&(_0x5689af[_0x7c1553(0x20a)](_0x4c1b9a,_0x18e9a8),_0x45368e['delete'](_0x4c1b9a),logger['debug'](_0x7c1553(0x215)+_0x1273dc[_0x7c1553(0x1de)]+_0x7c1553(0x1c7)+_0x4c1b9a+_0x7c1553(0x1f1)));}}}}async function executeSingleJourneyPush(_0x55a76c,_0x17f149,_0x56e15d,_0x4b1fe0,_0x11f751,_0x41364d){const _0xd80b1=a152_0x32dbf6,{journeyDefToRequest:_0x5277b9,activationDefToCreateRequest:_0x2c0b5b,yamlRuleToApi:_0x191bbc,validateSegmentRule:_0x43f25f}=_0x41364d,_0x34cb49=new Map(),_0x586bac=new Map();recoverSegmentIdsFromPushRecovery(_0x17f149,_0x34cb49,_0x56e15d['segmentNameToId']);const _0xf8a3b0=new Map(),_0x4244f4=new Map(),_0x2901c0=new Map();let _0x52d195;const _0x4c6b0c=async()=>{const _0x404509=a152_0x13c2;if(_0x52d195)return;_0x52d195=new Map();if(!_0x17f149[_0x404509(0x1f4)])return;const _0xc7251=await _0x55a76c[_0x404509(0x1c3)][_0x404509(0x218)](_0x17f149['existingJourney']['id']);for(const _0xa1911 of _0xc7251){const _0x802c85=journeyActivationStepToYaml(_0xa1911,_0x56e15d[_0x404509(0x199)],_0x56e15d[_0x404509(0x23d)]),_0x37a58b=activationSignature(_0x802c85);!_0x52d195[_0x404509(0x1a6)](_0x37a58b)&&_0x52d195[_0x404509(0x20a)](_0x37a58b,_0xa1911['id']),_0x802c85[_0x404509(0x1de)]&&_0x586bac[_0x404509(0x20a)](_0x802c85[_0x404509(0x1de)],_0xa1911['id']);}};await matchExistingJourneySegments(_0x55a76c,_0x17f149,_0x4b1fe0['parentId'],_0x56e15d[_0xd80b1(0x1b8)],_0x56e15d['segmentNameToId']);const _0x233c60={'resolveSegmentId':async _0x43a279=>{const _0x3c7be5=_0xd80b1,_0x5f0f3c=_0x56e15d[_0x3c7be5(0x212)][_0x3c7be5(0x162)](_0x43a279);if(!_0x5f0f3c)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3c7be5(0x1ab)+_0x43a279+_0x3c7be5(0x22d)+_0x17f149[_0x3c7be5(0x154)][_0x3c7be5(0x1de)]+')');return _0x5f0f3c;},'resolveEmbeddedSegmentId':async(_0x49822e,_0xb5d941)=>{const _0x5eb066=_0xd80b1,_0x47534c=_0x56e15d[_0x5eb066(0x212)][_0x5eb066(0x162)](_0x49822e);if(_0x47534c)return _0x47534c;const _0x3e6bf3=_0x56e15d[_0x5eb066(0x1b8)][_0x5eb066(0x1a0)](_0x1535c1=>_0x1535c1[_0x5eb066(0x1de)]===_0x49822e);if(_0x3e6bf3)return _0x56e15d[_0x5eb066(0x212)]['set'](_0x49822e,_0x3e6bf3['id']),_0x3e6bf3['id'];if(_0x17f149[_0x5eb066(0x22f)]){const {stageName:_0x27b083,criteriaName:_0x36f98b}=findSegmentCriteriaLocation(_0x17f149[_0x5eb066(0x154)],_0x49822e);return _0x43f25f(_0x49822e,_0xb5d941[_0x5eb066(0x195)]),_0x4244f4['set'](_0x49822e,{'definition':_0xb5d941,'stageName':_0x27b083,'criteriaName':_0x36f98b}),createPendingSegmentId(_0x49822e);}const _0x14ede2=_0x17f149[_0x5eb066(0x1f4)]?.['id'];if(!_0x14ede2)throw new SDKError(ErrorCode[_0x5eb066(0x1d2)],_0x5eb066(0x1e4));const _0x157534=_0xf8a3b0[_0x5eb066(0x162)](_0x49822e);if(_0x157534)return _0x157534;const _0x369dfa=((async()=>{const _0x5f51bf=_0x5eb066;_0x43f25f(_0x49822e,_0xb5d941[_0x5f51bf(0x195)]);const _0x118fb1=generateDeterministicJourneySegmentName(_0x17f149[_0x5f51bf(0x154)][_0x5f51bf(0x1de)],_0x49822e),_0x138bc1=_0x56e15d[_0x5f51bf(0x1b8)]['find'](_0x2fe66d=>_0x2fe66d[_0x5f51bf(0x1de)]===_0x118fb1),_0x2190a3=createSegmentIdResolver(_0x56e15d[_0x5f51bf(0x212)],_0x49822e),_0x106a8b=await resolveRuleSegmentIds(_0xb5d941[_0x5f51bf(0x195)],_0x2190a3);let _0x4a13df;return _0x138bc1?(await _0x55a76c['segment']['updateSegmentById'](_0x4b1fe0[_0x5f51bf(0x1fd)],_0x138bc1['id'],{'description':_0xb5d941[_0x5f51bf(0x1d7)]||_0x5f51bf(0x21d)+_0x49822e,'rule':_0x191bbc(_0x106a8b),'countPopulation':!![]}),_0x4a13df=_0x138bc1['id'],saveSegmentToPushRecovery(_0x17f149[_0x5f51bf(0x160)],_0x17f149[_0x5f51bf(0x154)][_0x5f51bf(0x1de)],_0x49822e,{'segmentId':_0x4a13df,'uniqueServerName':_0x118fb1,'createdAt':new Date()[_0x5f51bf(0x16c)]()})):_0x4a13df=await createOrRecoverEmbeddedSegment(_0x55a76c,_0x17f149,{'localName':_0x49822e,'uniqueSegmentName':_0x118fb1,'description':_0xb5d941['description']||_0x5f51bf(0x21d)+_0x49822e,'journeyId':_0x14ede2,'resolvedRule':_0x106a8b,'parentId':_0x4b1fe0['parentId'],'folderId':_0x4b1fe0[_0x5f51bf(0x248)]||''},_0x191bbc),_0x56e15d[_0x5f51bf(0x212)]['set'](_0x49822e,_0x4a13df),_0x34cb49[_0x5f51bf(0x20a)](_0x49822e,_0x4a13df),_0x4a13df;})());_0xf8a3b0[_0x5eb066(0x20a)](_0x49822e,_0x369dfa);try{return await _0x369dfa;}finally{_0xf8a3b0[_0x5eb066(0x1a9)](_0x49822e);}},'resolveActivationId':async _0x48c942=>{const _0x3bf37c=_0xd80b1,_0x7b2917=_0x586bac[_0x3bf37c(0x162)](_0x48c942);if(_0x7b2917)return _0x7b2917;if(_0x17f149[_0x3bf37c(0x1f4)]){await _0x4c6b0c();const _0x1bbeba=_0x586bac[_0x3bf37c(0x162)](_0x48c942);if(_0x1bbeba)return _0x1bbeba;}throw new SDKError(ErrorCode[_0x3bf37c(0x24a)],_0x3bf37c(0x1d3)+_0x48c942+_0x3bf37c(0x22d)+_0x17f149[_0x3bf37c(0x154)]['name']+_0x3bf37c(0x1dd)+_0x3bf37c(0x17e));},'resolveEmbeddedActivationId':async(_0xb90571,_0x45a33f)=>{const _0x37de9f=_0xd80b1,_0x4d74d2=_0x586bac[_0x37de9f(0x162)](_0xb90571);if(_0x4d74d2)return _0x4d74d2;if(_0x17f149[_0x37de9f(0x22f)])return _0x2901c0['set'](_0xb90571,_0x45a33f),createPendingActivationId(_0xb90571);if(_0x17f149[_0x37de9f(0x1f4)]){await _0x4c6b0c();const _0x117e8b=_0x586bac['get'](_0x45a33f[_0x37de9f(0x1de)]);if(_0x117e8b)return _0x586bac['set'](_0xb90571,_0x117e8b),_0x117e8b;const _0x3e5298=activationSignature(_0x45a33f),_0x2e9770=_0x52d195?.['get'](_0x3e5298);if(_0x2e9770)return _0x586bac[_0x37de9f(0x20a)](_0xb90571,_0x2e9770),_0x2e9770;const _0x1d1e02=await _0x2c0b5b(_0x45a33f,_0x56e15d[_0x37de9f(0x238)]),_0x5dcae2={..._0x1d1e02,..._0x45a33f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x45a33f['run_after_journey_refresh']}},_0x544a10=await _0x55a76c[_0x37de9f(0x1c3)][_0x37de9f(0x14d)](_0x17f149[_0x37de9f(0x1f4)]['id'],_0x5dcae2);return _0x586bac['set'](_0xb90571,_0x544a10['id']),_0x544a10['id'];}throw new SDKError(ErrorCode[_0x37de9f(0x1d2)],_0x37de9f(0x1ec));},'resolveJourneyId':async _0xa131cd=>{const _0xd0f49=_0xd80b1;try{return await _0x55a76c[_0xd0f49(0x1c3)][_0xd0f49(0x1ed)](_0x4b1fe0[_0xd0f49(0x1fd)],_0xa131cd);}catch(_0x3808d6){throw new SDKError(ErrorCode[_0xd0f49(0x24a)],_0xd0f49(0x234)+_0xa131cd+_0xd0f49(0x164)+_0x17f149['yamlConfig'][_0xd0f49(0x1de)]+'\x27)',_0x3808d6);}},'resolveStageId':async(_0x3ef602,_0x3572d3)=>{const _0x49ccb9=_0xd80b1,_0x3ca75e=await _0x55a76c['journey'][_0x49ccb9(0x232)](_0x3ef602),_0x28eb49=_0x3ca75e[_0x49ccb9(0x20d)][_0x49ccb9(0x19e)][_0x49ccb9(0x1a0)](_0x474930=>_0x474930['name'][_0x49ccb9(0x170)]()===_0x3572d3[_0x49ccb9(0x170)]());if(!_0x28eb49?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x49ccb9(0x1bb)+_0x3572d3+_0x49ccb9(0x1ce)+(_0x3ca75e['attributes'][_0x49ccb9(0x1b5)]||_0x3ca75e['attributes'][_0x49ccb9(0x1de)])+'\x27');return _0x28eb49['id'];}},_0x259c41=await _0x5277b9(_0x17f149[_0xd80b1(0x154)],_0x4b1fe0[_0xd80b1(0x1fd)],_0x233c60),_0x2020bc=_0x4b1fe0[_0xd80b1(0x22b)]||_0x4b1fe0[_0xd80b1(0x248)];_0x2020bc&&(_0x259c41[_0xd80b1(0x181)]={'parentFolder':{'data':{'id':_0x2020bc,'type':'folder'}}});if(_0x17f149['isNew']){if(_0x4244f4['size']>0x0||_0x2901c0['size']>0x0)return await executeThreeStepJourneyCreate(_0x55a76c,_0x17f149,_0x259c41,{'pendingEmbeddedSegments':_0x4244f4,'pendingEmbeddedActivations':_0x2901c0,'embeddedSegmentNameToId':_0x34cb49,'journeyActivationNameToId':_0x586bac},{..._0x4b1fe0,'effectiveFolderId':_0x2020bc},_0x56e15d,_0x11f751,_0x41364d);else{ensureJourneyDefaults(_0x259c41[_0xd80b1(0x20d)]);const _0x3a8f49=await _0x55a76c['journey'][_0xd80b1(0x1d9)](_0x259c41);return deletePushRecovery(_0x17f149[_0xd80b1(0x160)]),{'action':_0xd80b1(0x1a5),'journeyId':_0x3a8f49['id'],'embeddedSegmentNameToId':_0x34cb49};}}else{if(_0x17f149[_0xd80b1(0x1c2)]&&_0x17f149[_0xd80b1(0x1f4)]){_0x259c41['id']=_0x17f149[_0xd80b1(0x1f4)]['id'];const _0x831204=_0x259c41[_0xd80b1(0x20d)];_0x17f149[_0xd80b1(0x1f4)][_0xd80b1(0x20d)]?.['journeyBundleName']&&(_0x831204[_0xd80b1(0x1b5)]=_0x17f149[_0xd80b1(0x1f4)][_0xd80b1(0x20d)]['journeyBundleName']);const _0x272e23=_0x17f149[_0xd80b1(0x1f4)]['attributes']?.[_0xd80b1(0x19e)];return _0x272e23&&_0x259c41[_0xd80b1(0x20d)][_0xd80b1(0x19e)]&&injectExistingStageIds(_0x259c41[_0xd80b1(0x20d)][_0xd80b1(0x19e)],_0x272e23),ensureJourneyDefaults(_0x831204),await _0x55a76c['journey'][_0xd80b1(0x166)](_0x17f149[_0xd80b1(0x1f4)]['id'],_0x259c41),deletePushRecovery(_0x17f149[_0xd80b1(0x160)]),{'action':_0xd80b1(0x1b9),'journeyId':_0x17f149[_0xd80b1(0x1f4)]['id'],'embeddedSegmentNameToId':_0x34cb49};}}return deletePushRecovery(_0x17f149['absolutePath']),{'action':_0xd80b1(0x16e),'journeyId':_0x17f149[_0xd80b1(0x1f4)]?.['id'],'embeddedSegmentNameToId':_0x34cb49};}function findSegmentCriteriaLocation(_0x4eb0e0,_0x376b08){const _0x55cebc=a152_0x32dbf6,_0x11f83d=_0x4eb0e0[_0x55cebc(0x211)]||_0x4eb0e0['journeys']?.[0x0]?.['stages']||[];let _0x3a4da0='entry',_0x450a1d=_0x376b08;const _0x39157c=_0x4eb0e0[_0x55cebc(0x155)]||_0x4eb0e0[_0x55cebc(0x16d)]?.[0x0]?.[_0x55cebc(0x155)];if(_0x39157c?.[_0x55cebc(0x196)]===_0x376b08)return{'stageName':_0x55cebc(0x155),'criteriaName':_0x39157c[_0x55cebc(0x1de)]||_0x376b08};_0x316bb0:for(const _0x5e4828 of _0x11f83d){if(_0x5e4828[_0x55cebc(0x1d8)]?.['segment']===_0x376b08){_0x3a4da0=_0x5e4828[_0x55cebc(0x1de)],_0x450a1d=_0x5e4828[_0x55cebc(0x1d8)]['name']||_0x376b08;break;}if(_0x5e4828[_0x55cebc(0x18f)])for(const _0xc4fb23 of _0x5e4828['steps']){if(_0xc4fb23[_0x55cebc(0x187)]===_0x55cebc(0x1bf)&&_0xc4fb23['with']?.['branches'])for(const _0x3047cc of _0xc4fb23['with'][_0x55cebc(0x23a)]){if(_0x3047cc[_0x55cebc(0x196)]===_0x376b08){_0x3a4da0=_0x5e4828[_0x55cebc(0x1de)],_0x450a1d=_0x3047cc[_0x55cebc(0x1de)]||_0x376b08;break _0x316bb0;}}}}return{'stageName':_0x3a4da0,'criteriaName':_0x450a1d};}async function executeThreeStepJourneyCreate(_0x29d0ab,_0x3c7e39,_0x12e7a4,_0x23046b,_0x171619,_0x3e5f7e,_0x232cf0,_0x25bc64){const _0x2f8821=a152_0x32dbf6,{activationDefToCreateRequest:_0xc52b68,yamlRuleToApi:_0x5b7351}=_0x25bc64,{pendingEmbeddedSegments:_0x50b0e8,pendingEmbeddedActivations:_0x25a833,embeddedSegmentNameToId:_0x1bf645}=_0x23046b,_0x5b660f=JSON[_0x2f8821(0x247)](JSON['stringify'](_0x12e7a4));ensureJourneyDefaults(_0x5b660f[_0x2f8821(0x20d)]),stripPendingIds(_0x5b660f);const _0x1c2b38=await _0x29d0ab[_0x2f8821(0x1c3)]['create'](_0x5b660f),_0x2c0922=_0x1c2b38['id'],_0x4eb878=new Map();for(const _0x435420 of _0x1c2b38[_0x2f8821(0x20d)]['journeyStages']){_0x4eb878['set'](_0x435420['name'][_0x2f8821(0x170)](),_0x435420['id']);}recoverSegmentIdsFromPushRecovery(_0x3c7e39,_0x1bf645,_0x3e5f7e[_0x2f8821(0x212)]);for(const [_0x6e9945,{definition:_0x243180}]of _0x50b0e8){if(_0x1bf645[_0x2f8821(0x1a6)](_0x6e9945)){_0x232cf0['onProgress']?.({'type':_0x2f8821(0x1cc),'journeyName':_0x3c7e39[_0x2f8821(0x154)]['name'],'segmentName':_0x6e9945});continue;}const _0x1dc874=generateDeterministicJourneySegmentName(_0x3c7e39['yamlConfig'][_0x2f8821(0x1de)],_0x6e9945);_0x232cf0[_0x2f8821(0x1da)]?.({'type':_0x2f8821(0x20c),'journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'segmentName':_0x6e9945});const _0x2ce45a=createSegmentIdResolver(_0x3e5f7e['segmentNameToId'],_0x6e9945),_0x42f114=await resolveRuleSegmentIds(_0x243180['rule'],_0x2ce45a),_0x411b42=await createOrRecoverEmbeddedSegment(_0x29d0ab,_0x3c7e39,{'localName':_0x6e9945,'uniqueSegmentName':_0x1dc874,'description':_0x243180[_0x2f8821(0x1d7)]||_0x2f8821(0x21d)+_0x6e9945,'journeyId':_0x2c0922,'resolvedRule':_0x42f114,'parentId':_0x171619['parentId'],'folderId':_0x171619['effectiveFolderId']||''},_0x5b7351);_0x1bf645[_0x2f8821(0x20a)](_0x6e9945,_0x411b42),_0x3e5f7e[_0x2f8821(0x212)][_0x2f8821(0x20a)](_0x6e9945,_0x411b42),_0x232cf0[_0x2f8821(0x1da)]?.({'type':_0x2f8821(0x1cc),'journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'segmentName':_0x6e9945});}const _0xf8a079=new Map();for(const [_0x2d1a54,_0x28fcec]of _0x25a833){_0x232cf0[_0x2f8821(0x1da)]?.({'type':_0x2f8821(0x16f),'journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'activationName':_0x2d1a54});const _0x3ca21d=await _0xc52b68(_0x28fcec,_0x3e5f7e[_0x2f8821(0x238)]),_0x3f29ea={..._0x3ca21d,..._0x28fcec['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x28fcec['run_after_journey_refresh']}},_0x1d7b10=await _0x29d0ab['journey'][_0x2f8821(0x14d)](_0x2c0922,_0x3f29ea);_0xf8a079[_0x2f8821(0x20a)](_0x2d1a54,_0x1d7b10['id']),_0x23046b[_0x2f8821(0x1d5)][_0x2f8821(0x20a)](_0x2d1a54,_0x1d7b10['id']),_0x232cf0['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x3c7e39[_0x2f8821(0x154)][_0x2f8821(0x1de)],'activationName':_0x2d1a54});}const _0x270243=JSON['parse'](JSON['stringify'](_0x12e7a4));return _0x270243['id']=_0x2c0922,ensureJourneyDefaults(_0x270243[_0x2f8821(0x20d)]),resolvePendingIdsInRequest(_0x270243,_0x12e7a4,_0x4eb878,_0x1bf645,_0xf8a079,_0x232cf0),await _0x29d0ab[_0x2f8821(0x1c3)][_0x2f8821(0x166)](_0x2c0922,_0x270243),deletePushRecovery(_0x3c7e39[_0x2f8821(0x160)]),{'action':_0x2f8821(0x1a5),'journeyId':_0x2c0922,'embeddedSegmentNameToId':_0x1bf645};}export function stripWaitStepPendingIds(_0x198c93){const _0x2f6a8a=a152_0x32dbf6,_0x434cc1=_0x198c93['conditionSegmentId']&&isPendingSegmentId(_0x198c93['conditionSegmentId']),_0x391c3d=_0x198c93[_0x2f6a8a(0x200)]?.[_0x2f6a8a(0x16b)](_0x113b04=>_0x113b04[_0x2f6a8a(0x15e)]&&isPendingSegmentId(_0x113b04[_0x2f6a8a(0x15e)]));(_0x434cc1||_0x391c3d)&&(_0x198c93[_0x2f6a8a(0x22a)]=_0x2f6a8a(0x18a),_0x198c93[_0x2f6a8a(0x1eb)]=0x1,_0x198c93[_0x2f6a8a(0x16a)]=_0x2f6a8a(0x23b),delete _0x198c93['conditionSegmentId'],delete _0x198c93[_0x2f6a8a(0x1e9)],delete _0x198c93[_0x2f6a8a(0x15c)],delete _0x198c93[_0x2f6a8a(0x200)]);}export function resolveWaitStepPendingIds(_0x44baa9,_0x30683a,_0x4f7294,_0x1efa71){const _0x4255a2=a152_0x32dbf6;if(_0x30683a[_0x4255a2(0x193)]&&isPendingSegmentId(_0x30683a[_0x4255a2(0x193)])){const _0x51b039=_0x4f7294(_0x30683a['conditionSegmentId'],_0x4255a2(0x207)+_0x1efa71+_0x4255a2(0x23f));_0x51b039&&(_0x44baa9[_0x4255a2(0x22a)]=_0x4255a2(0x1e2),_0x44baa9['conditionSegmentId']=_0x51b039,delete _0x44baa9[_0x4255a2(0x1eb)],delete _0x44baa9[_0x4255a2(0x16a)],_0x30683a[_0x4255a2(0x1e9)]!==undefined&&(_0x44baa9[_0x4255a2(0x1e9)]=_0x30683a[_0x4255a2(0x1e9)]),_0x30683a[_0x4255a2(0x15c)]&&(_0x44baa9[_0x4255a2(0x15c)]=_0x30683a[_0x4255a2(0x15c)]));}if(_0x30683a[_0x4255a2(0x200)]){const _0x2fa65a=_0x30683a['conditions'][_0x4255a2(0x16b)](_0x5cd22b=>_0x5cd22b[_0x4255a2(0x15e)]&&isPendingSegmentId(_0x5cd22b['segmentId']));if(_0x2fa65a){const _0x30fde3=_0x30683a['conditions'][_0x4255a2(0x189)](_0x44707d=>{const _0x2d5650=_0x4255a2;if(_0x44707d['segmentId']&&isPendingSegmentId(_0x44707d[_0x2d5650(0x15e)])){const _0x39d324=_0x4f7294(_0x44707d[_0x2d5650(0x15e)],'stage\x20\x27'+_0x1efa71+'\x27\x20wait\x20condition');return{..._0x44707d,'segmentId':_0x39d324||_0x44707d['segmentId']};}return{..._0x44707d};});_0x44baa9['waitStepType']=_0x4255a2(0x1e2),_0x44baa9[_0x4255a2(0x200)]=_0x30fde3,delete _0x44baa9['waitStep'],delete _0x44baa9[_0x4255a2(0x16a)],delete _0x44baa9[_0x4255a2(0x193)],delete _0x44baa9[_0x4255a2(0x1e9)],delete _0x44baa9[_0x4255a2(0x15c)];}}}function stripPendingIds(_0x5f5ae2){const _0xd700d=a152_0x32dbf6;_0x5f5ae2['attributes'][_0xd700d(0x155)]?.[_0xd700d(0x15e)]&&isPendingSegmentId(_0x5f5ae2['attributes']['goal']['segmentId'])&&delete _0x5f5ae2[_0xd700d(0x20d)][_0xd700d(0x155)];for(const _0x25294a of _0x5f5ae2[_0xd700d(0x20d)][_0xd700d(0x19e)]||[]){_0x25294a[_0xd700d(0x233)]?.[_0xd700d(0x15e)]&&isPendingSegmentId(_0x25294a[_0xd700d(0x233)][_0xd700d(0x15e)])&&delete _0x25294a[_0xd700d(0x233)];_0x25294a['milestone']?.[_0xd700d(0x15e)]&&isPendingSegmentId(_0x25294a[_0xd700d(0x1bd)][_0xd700d(0x15e)])&&delete _0x25294a[_0xd700d(0x1bd)];_0x25294a['exitCriterias']&&(_0x25294a[_0xd700d(0x1f6)]=_0x25294a[_0xd700d(0x1f6)]['filter'](_0x33e6eb=>!_0x33e6eb[_0xd700d(0x15e)]||!isPendingSegmentId(_0x33e6eb[_0xd700d(0x15e)])));if(_0x25294a['steps'])for(const _0x24d7d2 of Object['keys'](_0x25294a['steps'])){const _0x4136e0=_0x25294a['steps'][_0x24d7d2];_0x4136e0[_0xd700d(0x187)]==='Activation'&&_0x4136e0[_0xd700d(0x18d)]&&isPendingActivationId(_0x4136e0[_0xd700d(0x18d)])&&(_0x4136e0[_0xd700d(0x18d)]='');if(_0x4136e0[_0xd700d(0x187)]==='DecisionPoint'&&_0x4136e0[_0xd700d(0x23a)])for(const _0x4c7ba2 of _0x4136e0['branches']){_0x4c7ba2[_0xd700d(0x15e)]&&isPendingSegmentId(_0x4c7ba2[_0xd700d(0x15e)])&&(_0x4c7ba2[_0xd700d(0x15e)]='');}_0x4136e0[_0xd700d(0x187)]==='WaitStep'&&stripWaitStepPendingIds(_0x4136e0);}}}function resolvePendingIdsInRequest(_0x693057,_0x2ae16c,_0x4c4f63,_0x351523,_0x1ff869,_0x176935){const _0x556d18=a152_0x32dbf6,_0x8606a9=(_0x5952d5,_0x27eb8e)=>{const _0x1dae31=a152_0x13c2;if(!isPendingSegmentId(_0x5952d5))return _0x5952d5;const _0x1e345a=extractPendingSegmentName(_0x5952d5),_0x5985be=_0x351523[_0x1dae31(0x162)](_0x1e345a);return!_0x5985be&&_0x176935[_0x1dae31(0x231)]?.(_0x1dae31(0x194)+_0x1e345a+_0x1dae31(0x1c6)+_0x27eb8e),_0x5985be;};if(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)]?.[_0x556d18(0x15e)]&&isPendingSegmentId(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)][_0x556d18(0x15e)])){const _0x47c5c5=_0x8606a9(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)][_0x556d18(0x15e)],_0x556d18(0x20e));_0x47c5c5&&(_0x693057[_0x556d18(0x20d)][_0x556d18(0x155)][_0x556d18(0x15e)]=_0x47c5c5);}for(const _0x2b379c of _0x693057['attributes'][_0x556d18(0x19e)]||[]){const _0x5aaa6a=_0x4c4f63[_0x556d18(0x162)](_0x2b379c[_0x556d18(0x1de)]['toLowerCase']());_0x5aaa6a&&(_0x2b379c['id']=_0x5aaa6a);if(_0x2b379c['entryCriteria']?.[_0x556d18(0x15e)]&&isPendingSegmentId(_0x2b379c[_0x556d18(0x233)]['segmentId'])){const _0xf00029=_0x8606a9(_0x2b379c[_0x556d18(0x233)][_0x556d18(0x15e)],_0x556d18(0x207)+_0x2b379c[_0x556d18(0x1de)]+_0x556d18(0x229));_0xf00029&&(_0x2b379c[_0x556d18(0x233)][_0x556d18(0x15e)]=_0xf00029);}if(_0x2b379c[_0x556d18(0x1f6)])for(const _0x2a7c1b of _0x2b379c[_0x556d18(0x1f6)]){if(_0x2a7c1b[_0x556d18(0x15e)]&&isPendingSegmentId(_0x2a7c1b[_0x556d18(0x15e)])){const _0x275792=_0x8606a9(_0x2a7c1b[_0x556d18(0x15e)],'stage\x20\x27'+_0x2b379c[_0x556d18(0x1de)]+_0x556d18(0x22c));_0x275792&&(_0x2a7c1b['segmentId']=_0x275792);}}if(_0x2b379c[_0x556d18(0x1bd)]?.[_0x556d18(0x15e)]&&isPendingSegmentId(_0x2b379c['milestone'][_0x556d18(0x15e)])){const _0x571132=_0x8606a9(_0x2b379c['milestone']['segmentId'],_0x556d18(0x207)+_0x2b379c[_0x556d18(0x1de)]+'\x27\x20milestone');_0x571132&&(_0x2b379c[_0x556d18(0x1bd)]['segmentId']=_0x571132);}if(_0x2b379c[_0x556d18(0x18f)]){const _0x345583=_0x5f4a74=>_0x2ae16c[_0x556d18(0x20d)]['journeyStages']?.[_0x556d18(0x1a0)](_0x1122cf=>_0x1122cf[_0x556d18(0x1de)][_0x556d18(0x170)]()===_0x2b379c[_0x556d18(0x1de)][_0x556d18(0x170)]())?.[_0x556d18(0x18f)]?.[_0x5f4a74];for(const _0x5c2101 of Object[_0x556d18(0x21f)](_0x2b379c[_0x556d18(0x18f)])){const _0x5eb1fd=_0x2b379c[_0x556d18(0x18f)][_0x5c2101],_0x3507f9=_0x345583(_0x5c2101);if(_0x5eb1fd['type']===_0x556d18(0x17f)&&_0x5eb1fd[_0x556d18(0x18d)]&&(isPendingActivationId(_0x5eb1fd['journeyActivationStepId'])||_0x5eb1fd[_0x556d18(0x18d)]==='')){if(_0x3507f9?.['journeyActivationStepId']&&isPendingActivationId(_0x3507f9[_0x556d18(0x18d)])){const _0x783b90=extractPendingActivationName(_0x3507f9[_0x556d18(0x18d)]),_0x34ef66=_0x1ff869[_0x556d18(0x162)](_0x783b90);_0x34ef66&&(_0x5eb1fd[_0x556d18(0x18d)]=_0x34ef66);}}if(_0x5eb1fd[_0x556d18(0x187)]==='DecisionPoint'&&_0x5eb1fd[_0x556d18(0x23a)]&&_0x3507f9?.[_0x556d18(0x23a)])for(let _0x5ad68d=0x0;_0x5ad68d<_0x5eb1fd[_0x556d18(0x23a)]['length'];_0x5ad68d++){const _0x93763f=_0x5eb1fd['branches'][_0x5ad68d],_0x528ac9=_0x3507f9[_0x556d18(0x23a)][_0x5ad68d];if(_0x528ac9?.['segmentId']&&isPendingSegmentId(_0x528ac9['segmentId'])){const _0x39fbba=_0x8606a9(_0x528ac9[_0x556d18(0x15e)],_0x556d18(0x207)+_0x2b379c[_0x556d18(0x1de)]+_0x556d18(0x213)+(_0x93763f[_0x556d18(0x1de)]||_0x5ad68d)+'\x27');_0x39fbba&&(_0x93763f[_0x556d18(0x15e)]=_0x39fbba);}}_0x5eb1fd['type']==='WaitStep'&&_0x3507f9?.[_0x556d18(0x187)]===_0x556d18(0x1ba)&&resolveWaitStepPendingIds(_0x5eb1fd,_0x3507f9,_0x8606a9,_0x2b379c[_0x556d18(0x1de)]);}}}}
1
+ const a151_0x4508fd=a151_0x2980;(function(_0x4c0da5,_0x3e1c7e){const _0x16304f=a151_0x2980,_0x25526a=_0x4c0da5();while(!![]){try{const _0x5e5fae=-parseInt(_0x16304f(0x181))/0x1*(-parseInt(_0x16304f(0x17f))/0x2)+-parseInt(_0x16304f(0xf7))/0x3*(-parseInt(_0x16304f(0x12e))/0x4)+-parseInt(_0x16304f(0xe2))/0x5+parseInt(_0x16304f(0xe9))/0x6+parseInt(_0x16304f(0x1a1))/0x7*(parseInt(_0x16304f(0x179))/0x8)+parseInt(_0x16304f(0xf0))/0x9+-parseInt(_0x16304f(0x185))/0xa*(parseInt(_0x16304f(0x170))/0xb);if(_0x5e5fae===_0x3e1c7e)break;else _0x25526a['push'](_0x25526a['shift']());}catch(_0x5aa3d5){_0x25526a['push'](_0x25526a['shift']());}}}(a151_0x5c5c,0x52d06));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x4508fd(0x126));export const PENDING_SEGMENT_PREFIX=a151_0x4508fd(0xf2);export const PENDING_ACTIVATION_PREFIX=a151_0x4508fd(0x18f);export function createPendingSegmentId(_0x14db45){return''+PENDING_SEGMENT_PREFIX+_0x14db45+'__';}export function isPendingSegmentId(_0x102b7c){const _0x23c096=a151_0x4508fd;return _0x102b7c[_0x23c096(0x1b3)](PENDING_SEGMENT_PREFIX)&&!_0x102b7c[_0x23c096(0x1b3)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x4de8e9){const _0x20e368=a151_0x4508fd;return _0x4de8e9[_0x20e368(0xf5)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4dbbb9){return''+PENDING_ACTIVATION_PREFIX+_0x4dbbb9+'__';}export function isPendingActivationId(_0x307c4b){const _0x24e267=a151_0x4508fd;return _0x307c4b[_0x24e267(0x1b3)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x95e32b){const _0x287e47=a151_0x4508fd;return _0x95e32b[_0x287e47(0xf5)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3a8f10,_0x39cd09){const _0x270b65=a151_0x4508fd,_0x4ea8c5=_0x3a8f10+'::'+(_0x39cd09[_0x270b65(0x15a)]()||_0x270b65(0x105)),_0x169b94=createHash(_0x270b65(0xcf))[_0x270b65(0x182)](_0x4ea8c5)['digest'](_0x270b65(0xcd))[_0x270b65(0x162)](0x0,0xc);return _0x270b65(0x16f)+_0x169b94;}export function ensureJourneyDefaults(_0x329615){const _0x10d0e1=a151_0x4508fd;!_0x329615[_0x10d0e1(0x164)]&&(_0x329615[_0x10d0e1(0x164)]=''),!_0x329615['state']&&(_0x329615[_0x10d0e1(0x15c)]='draft');}export function injectExistingStageIds(_0x1122e2,_0x32264c){const _0x30c44a=a151_0x4508fd,_0x263808=new Map(_0x32264c[_0x30c44a(0x1ac)](_0x2d741f=>[_0x2d741f['name'],_0x2d741f['id']]));for(const _0x11accc of _0x1122e2){if(!_0x11accc['id']){const _0x57f0f3=_0x263808['get'](_0x11accc[_0x30c44a(0x10d)]);_0x57f0f3&&(_0x11accc['id']=_0x57f0f3);}}}export function resolveTDFolderPath(_0x8dab64,_0x50e5d8,_0xacddec){const _0x52757a=a151_0x4508fd;if(!_0x50e5d8)return _0x8dab64;if(_0x8dab64===_0xacddec||_0x8dab64[_0x52757a(0x1b3)](_0xacddec+'/'))return _0x8dab64;return _0x8dab64?_0xacddec+'/'+_0x8dab64:_0xacddec;}function a151_0x2980(_0x2c6fa3,_0x246748){_0x2c6fa3=_0x2c6fa3-0xbc;const _0x5c5cde=a151_0x5c5c();let _0x29803f=_0x5c5cde[_0x2c6fa3];return _0x29803f;}export function addFoldersToCreate(_0x21c5b0,_0x450553,_0x13a65a){const _0x4991dc=a151_0x4508fd;if(!_0x21c5b0)return;if(_0x450553[_0x4991dc(0x116)](_0x21c5b0))return;const _0x102be1=_0x21c5b0[_0x4991dc(0x1ab)]('/');let _0x584705='';for(const _0x462be1 of _0x102be1){_0x584705=_0x584705?_0x584705+'/'+_0x462be1:_0x462be1,!_0x450553[_0x4991dc(0x116)](_0x584705)&&_0x13a65a[_0x4991dc(0x111)](_0x584705);}}export function sortFoldersByDepth(_0x1c481a){const _0x1215c8=a151_0x4508fd;return[..._0x1c481a][_0x1215c8(0x161)]((_0x17718b,_0x1ce829)=>{const _0x116f13=_0x1215c8,_0x530013=(_0x17718b[_0x116f13(0x110)](/\//g)||[])['length'],_0x2c3cbf=(_0x1ce829[_0x116f13(0x110)](/\//g)||[])['length'];return _0x530013-_0x2c3cbf;});}import*as a151_0x2d9a1b from'yaml';import{readFileSync}from'fs';import a151_0x2f34b3 from'path';import{isJourneyDef,parseYamlString as a151_0x519f41,toYamlString as a151_0x261316,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';function a151_0x5c5c(){const _0x4f231c=['Deleted\x20activation\x20\x27','notification','entries','verbose','waitStepType','action','hasChanges','unchanged','conditionTimeoutUnit','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','./child-segment-yaml.js','toISOString','create','1736980kPQRNP','SEGMENT_NOT_FOUND','Embedded\x20segment\x20\x27','journeyActivationNameToId','onProgress','yamlActivation','rootFolderId','988578ciivpq','uniqueServerName','uniqueSegmentName','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','journeys','\x20error(s)','goal','2045277SgYuRa','activation_','__pending_','relative','\x20activation\x20\x27','replace','filter','307218mxCfsd','Stage\x20\x27','Matched\x20server\x20segment\x20\x27','journeyBundleName','activationActions','existingActivation','yamlConfig','parse','behavior','Duration','activation_template_id','deleted','stage\x20\x27','toLowerCase','segment','parentFolder','schedule','exitCriterias','embeddedSegmentNameToId','Failed\x20to\x20resolve\x20segment\x20','getJourney','activation_creating','name','Name\x20has\x20already\x20been\x20taken','Deleting\x20activation\x20\x27','match','add','NOT_FOUND','with','index','\x27\x20from\x20file:\x20','has','length','max','Created\x20activation\x20\x27','getSegment\x20failed\x20for\x20','parseDocument','entry_criteria','message','JOURNEY_UPDATE_ERROR','logSuccess','Creating\x20activation\x20\x27','nameToType','journeyId','Activation','all_columns','\x27\x20entry\x20criteria','tdx.sdk.push-workflow','validatedRequest','Created\x20folder\x20\x27','deleteSegment','Creating\x20segment\x20\x27','WaitStep','activation_deleted','Failed\x20to\x20fetch\x20referenced\x20segment\x20','4JJpFNe','\x20journey\x20from\x20file:\x20','dirname','\x27...','conditionSegmentId','segmentNameToId','keys','day','journeyActivationStepId','localName','segment_updated','existingJourney','journey','milestone','rule','kind','flatMap','DecisionPoint','activationsBySegmentId','branches','../../utils/async.js','find','debug','Segment\x20not\x20found','and\x20the\x20server\x20segment,\x20then\x20retry.','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','columns','type','Creating\x20folder\x20\x27','list',').\x20','activationStepsById','getLatestJourneyId','segmentByFolderAndName',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_created','valid','logWarning','Journey\x20\x27','deleteActivation','journey_created','all','relationships','stringify','trim','logDeleted','state','journeyStages','folder_created','activation_created','join','sort','slice','stages','description','segment_creating','versionNumber','delete','idToEmailMap','Updated\x20journey\x20\x27','\x20segment\x20from\x20file:\x20','Delete\x20the\x20push\x20recovery\x20file\x20(','connection','conditions','folder','journey_entry_criteria_','11TMRYlW','connector_config','Activation\x20not\x20found:\x20','Condition','createdSegmentIds','createFolder','activationParams','folderId','from','155624IATaDv','steps','connectionIdToNameMap','segment_updating','Updating\x20segment\x20\x27','listActivations','8NqMhir','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','154201JhvKfn','update','\x20(referenced\x20in\x20journey\x20','Fetching\x20','6386070jtnGOO','attributes','set','\x27\x20exit\x20criteria','segmentId','updateSegmentById','embedded_activation_creating','updated','segments','created','__pending_act_','activation_updated','data','run_after_journey_refresh','get','parentSegmentFolder','SEGMENT_UPDATE_ERROR','decision_point','Created\x20journey\x20\x27','getSegment','some','journeyBundlesByFolderAndName','journeyById','./journey-yaml.js','folderPathToId','ACTIVATION_UPDATE_ERROR','utf-8','\x27\x20wait\x20condition','77OFklWq','withProgress','getActivation','getSegmentEntity\x20also\x20failed\x20for\x20','.$1.push-recovery.json','entryCriteria','folderPath','activation_deleting','conditionTimeoutDuration','size','split','map','isNew','activationContext','fetchJourney','push','segmentFolderId','resolveSegment','startsWith','entry','createdSegmentId','existingSegments','parentId','progress','resolvedRule','includes','null','Updated\x20segment\x20\x27','resolveJourneyId','\x27\x20not\x20found\x20in\x20journey\x20\x27','existingSegment','journeyBundleId','Entry\x20criteria:\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','ACTIVATION_SYNTAX_ERROR','\x27\x20to\x20local\x20\x27','activations','deps','waitStepUnit','Failed\x20to\x20resolve\x20activation\x20','hex','isArray','sha1','INTERNAL','\x0a\x20\x20','logInfo','absolutePath','embedded_segment_created'];a151_0x5c5c=function(){return _0x4f231c;};return a151_0x5c5c();}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(_0x4b4500){const _0x111f62=a151_0x4508fd;if(Array[_0x111f62(0xce)](_0x4b4500))return'['+_0x4b4500['map'](_0x174806=>stableStringify(_0x174806))[_0x111f62(0x160)](',')+']';if(_0x4b4500&&typeof _0x4b4500==='object'){const _0x55addd=_0x4b4500,_0x30b959=Object['keys'](_0x55addd)[_0x111f62(0x161)](),_0x39bb62=_0x30b959[_0x111f62(0x1ac)](_0x5561dd=>'\x22'+_0x5561dd+'\x22:'+stableStringify(_0x55addd[_0x5561dd]));return'{'+_0x39bb62['join'](',')+'}';}const _0x5bed43=JSON[_0x111f62(0x159)](_0x4b4500);return _0x5bed43===undefined?_0x111f62(0xbf):_0x5bed43;}function activationSignature(_0x81b5aa){const _0x5dcfd9=a151_0x4508fd,_0x1475e4={'connection':_0x81b5aa[_0x5dcfd9(0x16c)],..._0x81b5aa[_0x5dcfd9(0x124)]!==undefined&&{'all_columns':_0x81b5aa['all_columns']},..._0x81b5aa[_0x5dcfd9(0x148)]!==undefined&&{'columns':_0x81b5aa['columns']},..._0x81b5aa['behavior']!==undefined&&{'behavior':_0x81b5aa[_0x5dcfd9(0xff)]},..._0x81b5aa[_0x5dcfd9(0x107)]!==undefined&&{'schedule':_0x81b5aa['schedule']},..._0x81b5aa[_0x5dcfd9(0xd6)]!==undefined&&{'notification':_0x81b5aa['notification']},..._0x81b5aa[_0x5dcfd9(0x171)]!==undefined&&{'connector_config':_0x81b5aa[_0x5dcfd9(0x171)]},..._0x81b5aa[_0x5dcfd9(0x101)]!==undefined&&{'activation_template_id':_0x81b5aa[_0x5dcfd9(0x101)]}};return stableStringify(_0x1475e4);}async function fetchSegment(_0xe284b7,_0x78fa4f,_0x3a5c16,_0x5d2bfe){const _0xcc70ee=a151_0x4508fd,_0xc9277d=_0x5d2bfe?.[_0xcc70ee(0x143)](_0x346864=>_0x346864['id']===_0x3a5c16);if(_0xc9277d)return _0xc9277d;try{return await _0xe284b7[_0xcc70ee(0x105)][_0xcc70ee(0x198)](_0x78fa4f,_0x3a5c16);}catch(_0x37dcbe){logger[_0xcc70ee(0x144)](_0xcc70ee(0x11a)+_0x3a5c16+_0xcc70ee(0x150)+_0x37dcbe);try{return await _0xe284b7[_0xcc70ee(0x105)]['getSegmentEntity'](_0x3a5c16);}catch(_0x9e9d06){return logger[_0xcc70ee(0x144)](_0xcc70ee(0x1a4)+_0x3a5c16+':\x20'+_0x9e9d06),null;}}}function recoverSegmentIdsFromPushRecovery(_0x29047c,_0x3098e1,_0x3193b5){const _0x3b3ea2=a151_0x4508fd,_0x17fdbb=readPushRecovery(_0x29047c['absolutePath']);if(_0x17fdbb?.['journeyName']===_0x29047c['yamlConfig']['name'])for(const [_0x36d0e0,_0x1ff02d]of Object['entries'](_0x17fdbb[_0x3b3ea2(0x18d)])){const _0x159284=generateDeterministicJourneySegmentName(_0x29047c[_0x3b3ea2(0xfd)]['name'],_0x36d0e0);_0x1ff02d['uniqueServerName']===_0x159284&&(_0x3098e1[_0x3b3ea2(0x187)](_0x36d0e0,_0x1ff02d[_0x3b3ea2(0x189)]),_0x3193b5[_0x3b3ea2(0x187)](_0x36d0e0,_0x1ff02d['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0xb1a89c,_0x4a6139,_0x20275f,_0x31178d){const _0x1d7026=a151_0x4508fd;let _0x3e38af;try{_0x3e38af=await _0xb1a89c[_0x1d7026(0x105)]['createJourneySegment']({'name':_0x20275f[_0x1d7026(0xeb)],'description':_0x20275f[_0x1d7026(0x164)],'journeyId':_0x20275f[_0x1d7026(0x122)],'rule':_0x31178d(_0x20275f[_0x1d7026(0xbd)],!![]),'countPopulation':!![],'parentFolderId':_0x20275f[_0x1d7026(0x177)],'audienceId':_0x20275f['parentId']});}catch(_0x789051){const _0xf2bf83=_0x789051 instanceof Error&&_0x789051[_0x1d7026(0x11d)][_0x1d7026(0xbe)](_0x1d7026(0x10e));if(_0xf2bf83){const _0x23bb0f=readPushRecovery(_0x4a6139[_0x1d7026(0xd3)]),_0x3a456f=_0x23bb0f?.['journeyName']===_0x4a6139[_0x1d7026(0xfd)][_0x1d7026(0x10d)]?_0x23bb0f[_0x1d7026(0x18d)][_0x20275f['localName']]:undefined;if(_0x3a456f?.[_0x1d7026(0xea)]===_0x20275f[_0x1d7026(0xeb)])await _0xb1a89c[_0x1d7026(0x105)][_0x1d7026(0x18a)](_0x20275f[_0x1d7026(0x1b7)],_0x3a456f['segmentId'],{'description':_0x20275f[_0x1d7026(0x164)],'rule':_0x31178d(_0x20275f[_0x1d7026(0xbd)],!![]),'countPopulation':!![]}),_0x3e38af=_0x3a456f[_0x1d7026(0x189)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x1d7026(0xe4)+_0x20275f['localName']+_0x1d7026(0xde)+(_0x1d7026(0x16b)+_0x4a6139[_0x1d7026(0xd3)][_0x1d7026(0xf5)](/([^/]+)$/,_0x1d7026(0x1a5))+')\x20')+_0x1d7026(0x146),_0x789051);}else throw _0x789051;}return saveSegmentToPushRecovery(_0x4a6139[_0x1d7026(0xd3)],_0x4a6139[_0x1d7026(0xfd)][_0x1d7026(0x10d)],_0x20275f[_0x1d7026(0x137)],{'segmentId':_0x3e38af,'uniqueServerName':_0x20275f[_0x1d7026(0xeb)],'createdAt':new Date()[_0x1d7026(0xe0)]()}),_0x3e38af;}export async function prepareSegmentFiles(_0x5b22ec,_0x57d203,_0x437170,_0xd13977,_0x190766){const _0x2caee4=a151_0x4508fd,{activationDefToCreateRequest:_0x4f3c8a}=await import(_0x2caee4(0xdf)),_0xfd35bf=[],_0x3463d2=new Set();for(const {yamlConfig:_0x3e3072,folderPath:_0x572c60,sourcePath:_0x380530}of _0x5b22ec){const _0x4b7602=resolveTDFolderPath(_0x572c60,_0xd13977,_0x190766),_0x512ee7=_0x4b7602+':'+_0x3e3072[_0x2caee4(0x10d)],_0x22e8d0=_0x57d203[_0x2caee4(0x14f)][_0x2caee4(0x193)](_0x512ee7),_0x4332b6=_0x22e8d0?_0x57d203[_0x2caee4(0x140)][_0x2caee4(0x193)](_0x22e8d0['id'])||[]:[];addFoldersToCreate(_0x4b7602,_0x57d203[_0x2caee4(0x19d)],_0x3463d2);const _0x162dad=calculateActivationActions(_0x3e3072[_0x2caee4(0xc9)]||[],_0x4332b6,_0x57d203['idToEmailMap'],_0x57d203[_0x2caee4(0x17b)]);for(const _0x508326 of _0x162dad){(_0x508326[_0x2caee4(0x149)]===_0x2caee4(0xe1)||_0x508326[_0x2caee4(0x149)]==='update')&&_0x508326[_0x2caee4(0xe7)]&&(_0x508326[_0x2caee4(0x127)]=await _0x4f3c8a(_0x508326['yamlActivation'],_0x437170));}const _0x2e21c5=calculateSegmentDiff(_0x3e3072,_0x22e8d0,_0x4332b6,_0x57d203['idToEmailMap'],_0x57d203[_0x2caee4(0x17b)]);_0xfd35bf['push']({'relativePath':_0x3e3072[_0x2caee4(0x10d)],'absolutePath':_0x380530,'yamlConfig':_0x3e3072,'folderPath':_0x4b7602,'existingSegment':_0x22e8d0,'existingActivations':_0x4332b6,'isNew':_0x2e21c5[_0x2caee4(0x1ad)],'hasChanges':_0x2e21c5[_0x2caee4(0xdb)],'diff':_0x2e21c5['diff'],'activationActions':_0x162dad});}return{'segmentFiles':_0xfd35bf,'foldersToCreate':_0x3463d2};}export async function prepareJourneyFiles(_0x341506,_0x58c8c1,_0x5e3d26,_0x2a768d){const _0x31691a=a151_0x4508fd,_0x950596=[],_0x240cc4=new Set();for(const {yamlConfig:_0x4b5497,folderPath:_0x1f1890,sourcePath:_0x50180b}of _0x341506){const _0x2167a8=resolveTDFolderPath(_0x1f1890,_0x5e3d26,_0x2a768d),_0xe6b2e1=_0x2167a8+':'+_0x4b5497['name'],_0x41812b=_0x58c8c1[_0x31691a(0x19a)][_0x31691a(0x193)](_0xe6b2e1);let _0x45b4b6,_0x5164d6;if(_0x41812b&&_0x41812b[_0x31691a(0x117)]>0x0){const _0xf7035c=buildLocalExpandedRuleMappings(_0x4b5497),{createYamlContext:_0x40b4c8,prefetchJourneySegments:_0x42590b}=createPushYamlContextForBundle(_0x58c8c1[_0x31691a(0xca)],_0x58c8c1[_0x31691a(0x1b7)],_0x58c8c1['existingSegments'],_0xf7035c,_0x58c8c1['idToEmailMap'],_0x58c8c1[_0x31691a(0x17b)],_0x58c8c1[_0x31691a(0x14d)],_0x58c8c1[_0x31691a(0x19b)]);await _0x42590b(_0x41812b['map'](_0x369b00=>_0x369b00['id']));const _0x28ff95=await _0x58c8c1['deps'][_0x31691a(0x13a)][_0x31691a(0x14e)](_0x41812b[0x0][_0x31691a(0xc4)]),_0x1dd63c=hasMultipleVersions(_0x4b5497),_0x19e72c=async _0x5a5a38=>{const _0x43add7=_0x31691a,_0x12cb68=_0x58c8c1[_0x43add7(0x19b)]?.['get'](_0x5a5a38);if(_0x12cb68)return _0x12cb68;return _0x58c8c1[_0x43add7(0x1af)]({'journeyId':_0x5a5a38,'journeyName':_0x4b5497['name'],'isMultiVersion':_0x41812b[_0x43add7(0x117)]>0x1});};if(_0x1dd63c&&_0x41812b['length']>0x1){const _0x247df1=[];for(const _0x45e17d of _0x41812b){const _0x5aae09=_0x45e17d[_0x31691a(0x166)]||0x1;_0x58c8c1[_0x31691a(0xbc)]?.[_0x31691a(0x182)](_0x31691a(0x184)+_0x4b5497['name']+'\x20v'+_0x5aae09);const _0x197622=await _0x19e72c(_0x45e17d['id']),_0x14d75c=_0x40b4c8(_0x45e17d['id']),_0x29112a=await journeyResponseToDef(_0x197622,_0x14d75c);_0x247df1[_0x31691a(0x1b0)]({'item':_0x45e17d,'yaml':_0x29112a});}const _0x40af10=buildLocalRuleToNameMappingFromJourney(_0x4b5497);_0x5164d6=buildMergedJourneyDef(_0x247df1,_0x40af10,_0x28ff95);const _0xce2303=Math[_0x31691a(0x118)](..._0x247df1[_0x31691a(0x1ac)](_0x58cbb7=>_0x58cbb7['item']['versionNumber']||0x0)),_0x37de61=_0x41812b[_0x31691a(0x143)](_0x4aa6a4=>(_0x4aa6a4[_0x31691a(0x166)]||0x0)===_0xce2303);_0x37de61&&(_0x58c8c1[_0x31691a(0xbc)]?.['update'](_0x31691a(0x184)+_0x4b5497[_0x31691a(0x10d)]+'\x20v'+_0xce2303),_0x45b4b6=await _0x19e72c(_0x37de61['id']));}else{const _0x4d83a0=_0x41812b[_0x41812b['length']-0x1];_0x58c8c1[_0x31691a(0xbc)]?.[_0x31691a(0x182)](_0x31691a(0x184)+_0x4b5497[_0x31691a(0x10d)]),_0x45b4b6=await _0x19e72c(_0x4d83a0['id']);const _0x920d7e=_0x40b4c8(_0x4d83a0['id']),_0x34a9aa=await journeyResponseToDef(_0x45b4b6,_0x920d7e),_0xfca090=buildLocalRuleToNameMappingFromJourney(_0x4b5497);_0x5164d6=buildMergedJourneyDef([{'item':_0x4d83a0,'yaml':_0x34a9aa}],_0xfca090,_0x28ff95);}}addFoldersToCreate(_0x2167a8,_0x58c8c1['folderPathToId'],_0x240cc4);const _0x2929fa=calculateJourneyDiff(_0x4b5497,_0x5164d6);_0x950596[_0x31691a(0x1b0)]({'relativePath':_0x4b5497[_0x31691a(0x10d)],'absolutePath':_0x50180b,'yamlConfig':_0x4b5497,'folderPath':_0x2167a8,'existingJourney':_0x45b4b6,'isNew':_0x2929fa['isNew'],'hasChanges':_0x2929fa[_0x31691a(0xdb)],'diff':_0x2929fa['diff']});}return{'journeyFiles':_0x950596,'foldersToCreate':_0x240cc4};}export function calculateActivationActions(_0x1cd99c,_0x11b7cd,_0x32c743,_0x1d302c){const _0x25e666=a151_0x4508fd,_0x2b1479=[],_0x2f9567=new Map();for(const _0x59c4b9 of _0x11b7cd){_0x2f9567[_0x25e666(0x187)](_0x59c4b9[_0x25e666(0x10d)],_0x59c4b9);}const _0x24d6ac=new Map();for(const _0x29ec18 of _0x1cd99c){_0x24d6ac['set'](_0x29ec18[_0x25e666(0x10d)],_0x29ec18);}for(const _0x427142 of _0x1cd99c){const _0x4b637f=_0x2f9567[_0x25e666(0x193)](_0x427142[_0x25e666(0x10d)]);if(!_0x4b637f)_0x2b1479[_0x25e666(0x1b0)]({'type':_0x25e666(0xe1),'name':_0x427142[_0x25e666(0x10d)],'yamlActivation':_0x427142});else{const _0xa59306=activationResponseToDef(_0x4b637f,_0x32c743,_0x1d302c),_0x4d43c5=a151_0x2d9a1b[_0x25e666(0x159)](_0xa59306),_0x1f6629=a151_0x2d9a1b[_0x25e666(0x159)](_0x427142);_0x4d43c5!==_0x1f6629&&_0x2b1479[_0x25e666(0x1b0)]({'type':_0x25e666(0x182),'name':_0x427142[_0x25e666(0x10d)],'yamlActivation':_0x427142,'existingActivation':_0x4b637f});}}for(const _0x583b8d of _0x11b7cd){!_0x24d6ac[_0x25e666(0x116)](_0x583b8d['name'])&&_0x2b1479['push']({'type':_0x25e666(0x167),'name':_0x583b8d[_0x25e666(0x10d)],'existingActivation':_0x583b8d});}return _0x2b1479;}function calculateYamlDiff(_0x24dfcf,_0x39b215){if(_0x39b215){const _0xf5d29f=generateDiff(_0x39b215,_0x24dfcf),_0x3fe514=hasChanges(_0xf5d29f);return{'isNew':![],'hasChanges':_0x3fe514,'diff':_0x3fe514?formatDiffWithColors(_0xf5d29f):undefined};}const _0x307147=generateDiff('',_0x24dfcf);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x307147)};}export function calculateSegmentDiff(_0x32f7ea,_0xa1ae43,_0x4778e4,_0x139121,_0x4da584){const _0x2c4656=segmentToYamlString(_0x32f7ea),_0x4e533b=_0xa1ae43?segmentToYamlString(segmentWithActivationsToYaml(_0xa1ae43,_0x4778e4,undefined,_0x139121,_0x4da584)):undefined;return calculateYamlDiff(_0x2c4656,_0x4e533b);}export function calculateJourneyDiff(_0x50f32f,_0x259005){const _0x17fc9a=normalizeJourneyDef(_0x50f32f,_0x50f32f),_0x165fe9=a151_0x261316(_0x17fc9a),_0x4d9e39=_0x259005?a151_0x261316(normalizeJourneyDef(_0x259005,_0x50f32f)):undefined;return calculateYamlDiff(_0x165fe9,_0x4d9e39);}export function findSegmentsToDelete(_0x42b268,_0x558300,_0x1fdcf4,_0x2a415c,_0x2136a9){const _0x3895be=a151_0x4508fd,_0x31417a=new Set();for(const {yamlConfig:_0x4dc923,folderPath:_0x1e6a85}of _0x558300){_0x31417a['add'](_0x1e6a85+':'+_0x4dc923['name']);}return _0x42b268[_0x3895be(0xf6)](_0x5347c8=>{const _0x9183a8=_0x3895be,_0x235f1e=_0x5347c8['segmentFolderId']?_0x1fdcf4[_0x9183a8(0x193)](_0x5347c8[_0x9183a8(0x1b1)]['toString']())||'':'',_0x1c5553=_0x235f1e+':'+_0x5347c8[_0x9183a8(0x10d)];if(_0x31417a[_0x9183a8(0x116)](_0x1c5553))return![];if(_0x2136a9)return _0x235f1e===_0x2a415c||_0x235f1e[_0x9183a8(0x1b3)](_0x2a415c+'/');return!![];});}export function findJourneysToDelete(_0x489cbd,_0x3725e2,_0x2f7024,_0x2cb09d,_0x18c033){const _0x332068=a151_0x4508fd,_0x244ec6=new Set();for(const {yamlConfig:_0xa748da,folderPath:_0x1d28c0}of _0x3725e2){_0x244ec6[_0x332068(0x111)](_0x1d28c0+':'+_0xa748da['name']);}return _0x489cbd[_0x332068(0xf6)](_0x64c33=>{const _0x13ebf1=_0x332068,_0x49257b=_0x64c33['folderId']?_0x2f7024[_0x13ebf1(0x193)](_0x64c33[_0x13ebf1(0x177)])||'':'',_0x310868=_0x49257b+':'+_0x64c33['journeyBundleName'];if(_0x244ec6[_0x13ebf1(0x116)](_0x310868))return![];if(_0x18c033)return _0x49257b===_0x2cb09d||_0x49257b['startsWith'](_0x2cb09d+'/');return!![];});}export function buildSegmentLookupMap(_0x341b9d,_0x28f8c1){const _0x164dd=a151_0x4508fd,_0x281ec5=new Map();for(const _0x2f2b91 of _0x341b9d){const _0x508997=_0x2f2b91[_0x164dd(0x1b1)]?_0x28f8c1[_0x164dd(0x193)](_0x2f2b91[_0x164dd(0x1b1)]['toString']())||'':'',_0x11f941=_0x508997+':'+_0x2f2b91[_0x164dd(0x10d)];_0x281ec5[_0x164dd(0x187)](_0x11f941,_0x2f2b91);}return _0x281ec5;}export function buildSegmentNameToIdMap(_0x2aef63){const _0x1681b6=a151_0x4508fd,_0x1c7665=new Map();for(const _0x5ba0b6 of _0x2aef63){_0x1c7665[_0x1681b6(0x187)](_0x5ba0b6['name'],_0x5ba0b6['id']);}return _0x1c7665;}export function buildJourneyBundleLookupMap(_0x443ad3,_0x22d028){const _0x17debe=a151_0x4508fd,_0x56d821=new Map();for(const _0x240047 of _0x443ad3){const _0x2ace24=_0x240047[_0x17debe(0x177)]?_0x22d028[_0x17debe(0x193)](_0x240047['folderId'])||'':'',_0x57b9c1=_0x2ace24+':'+_0x240047[_0x17debe(0xfa)];!_0x56d821[_0x17debe(0x116)](_0x57b9c1)&&_0x56d821[_0x17debe(0x187)](_0x57b9c1,[]),_0x56d821['get'](_0x57b9c1)[_0x17debe(0x1b0)](_0x240047);}for(const _0x28cab2 of _0x56d821['values']()){_0x28cab2['sort']((_0x215cf7,_0x42c2bd)=>(_0x215cf7[_0x17debe(0x166)]||0x0)-(_0x42c2bd[_0x17debe(0x166)]||0x0));}return _0x56d821;}export function collectFoldersToCreate(_0x24e875,_0x102f26){const _0x154296=a151_0x4508fd,_0x43185e=new Set();for(const _0x43699a of _0x24e875){if(!_0x43699a)continue;if(_0x102f26[_0x154296(0x116)](_0x43699a))continue;const _0x5c85d3=_0x43699a[_0x154296(0x1ab)]('/');let _0x394c07='';for(const _0x3f506d of _0x5c85d3){_0x394c07=_0x394c07?_0x394c07+'/'+_0x3f506d:_0x3f506d,!_0x102f26[_0x154296(0x116)](_0x394c07)&&_0x43185e[_0x154296(0x111)](_0x394c07);}}return _0x43185e;}export function parseAndClassifyYamlFiles(_0x42a4a5,_0x1c56ae,_0x3e35f8){const _0x3acdfc=a151_0x4508fd,_0x46c71e=[],_0x453114=[];for(const _0x3c4fa0 of _0x42a4a5){const _0x252d4a=a151_0x2f34b3[_0x3acdfc(0xf3)](_0x1c56ae,a151_0x2f34b3[_0x3acdfc(0x130)](_0x3c4fa0)),_0x58eb1f=_0x252d4a==='.'?'':_0x252d4a,_0x461693=readFileSync(_0x3c4fa0,_0x3acdfc(0x19f)),_0x9f3c7c=a151_0x2d9a1b[_0x3acdfc(0xfe)](_0x461693);if(isJourneyDef(_0x9f3c7c)){const _0x580c64=a151_0x519f41(_0x461693);_0x453114[_0x3acdfc(0x1b0)]({'yamlConfig':_0x580c64,'folderPath':_0x58eb1f,'sourcePath':_0x3c4fa0});}else{if(!_0x3e35f8?.['skipSegments']){const _0x142a9f=parseSegmentYamlFile(_0x461693),_0x2502df=normalizeChildSegmentYaml(_0x142a9f);_0x46c71e[_0x3acdfc(0x1b0)]({'yamlConfig':_0x2502df,'folderPath':_0x58eb1f,'sourcePath':_0x3c4fa0});}}}return{'segments':_0x46c71e,'journeys':_0x453114};}export function validateParsedFiles(_0xb3db5c,_0x367d1d){const _0x2bc9f5=a151_0x4508fd,_0x2b2f5d=[];for(const {yamlConfig:_0x178e6f,sourcePath:_0xe0a694}of _0xb3db5c[_0x2bc9f5(0x18d)]){const _0x5071c3=readFileSync(_0xe0a694,_0x2bc9f5(0x19f)),_0x5ad116=a151_0x2d9a1b['parseDocument'](_0x5071c3),_0x3fcb33=validateSegmentDef(_0x178e6f,{'source':_0x5071c3,'document':_0x5ad116},{'skipSchema':!![]});if(!_0x3fcb33['valid']){const _0x5b063c=a151_0x2f34b3['relative'](_0x367d1d,_0xe0a694);_0x2b2f5d['push']({'filePath':_0x5b063c,'source':_0x5071c3,'result':_0x3fcb33,'isJourney':![]});}}for(const {yamlConfig:_0x3d5093,sourcePath:_0x1b4360}of _0xb3db5c[_0x2bc9f5(0xed)]){const _0x4daaf4=readFileSync(_0x1b4360,_0x2bc9f5(0x19f)),_0x1301fc=a151_0x2d9a1b[_0x2bc9f5(0x11b)](_0x4daaf4),_0x34a1d7=validateJourneyDef(_0x3d5093,{'source':_0x4daaf4,'document':_0x1301fc},{'skipSchema':!![]});if(!_0x34a1d7[_0x2bc9f5(0x152)]){const _0x2fad30=a151_0x2f34b3[_0x2bc9f5(0xf3)](_0x367d1d,_0x1b4360);_0x2b2f5d[_0x2bc9f5(0x1b0)]({'filePath':_0x2fad30,'source':_0x4daaf4,'result':_0x34a1d7,'isJourney':!![]});}}return _0x2b2f5d;}export function formatValidationErrors(_0x2535cc){const _0x3ccef6=a151_0x4508fd,_0x5784c3=[];for(const {filePath:_0x115de4,source:_0x483d51,result:_0x3db78c,isJourney:_0x3b7cd6}of _0x2535cc){const _0x1530e5=_0x3b7cd6?_0x3ccef6(0x13a):_0x3ccef6(0x105);_0x5784c3[_0x3ccef6(0x1b0)]('\x0a'+_0x115de4+'\x20('+_0x1530e5+'):\x20'+_0x3db78c['errors'][_0x3ccef6(0x117)]+_0x3ccef6(0xee)),_0x5784c3[_0x3ccef6(0x1b0)](formatValidationResult(_0x3db78c,_0x483d51,_0x115de4));}return _0x5784c3['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x284a6c){const _0x1147e2=a151_0x4508fd,_0x59755f=new Set(),_0x9fbada=new Map(),_0x55b58d=collectSegmentUsageCounts(_0x284a6c);if(_0x284a6c[_0x1147e2(0x18d)])for(const [_0x137c33,_0x36c122]of Object[_0x1147e2(0xd7)](_0x284a6c[_0x1147e2(0x18d)])){_0x59755f['add'](_0x137c33);if(_0x36c122[_0x1147e2(0x13c)]){const _0x5dfd71=yamlRuleToApi(_0x36c122[_0x1147e2(0x13c)]),_0x4ff635=apiRuleToYaml(_0x5dfd71);_0x9fbada[_0x1147e2(0x187)](_0x137c33,_0x4ff635);}}const _0xa183eb=new Map();let _0x579856=0x0;for(const [_0x122bfd,_0x347686]of _0x9fbada){const _0x52a744=serializeExpandedRule(_0x347686,_0x9fbada),_0x5b6abb=_0xa183eb[_0x1147e2(0x193)](_0x52a744)||[];_0x5b6abb[_0x1147e2(0x1b0)]({'name':_0x122bfd,'index':_0x579856}),_0xa183eb[_0x1147e2(0x187)](_0x52a744,_0x5b6abb),_0x579856++;}const _0x3c8e1a=new Map();for(const [_0x4af2d1,_0x34910e]of _0xa183eb){const _0x4ef6be=_0x34910e['slice']()[_0x1147e2(0x161)]((_0x165ccd,_0x4e768f)=>{const _0x2c15e6=_0x1147e2,_0x11eb24=_0x55b58d[_0x2c15e6(0x193)](_0x165ccd[_0x2c15e6(0x10d)])||0x0,_0x260b51=_0x55b58d[_0x2c15e6(0x193)](_0x4e768f[_0x2c15e6(0x10d)])||0x0;if(_0x11eb24!==_0x260b51)return _0x260b51-_0x11eb24;return _0x165ccd[_0x2c15e6(0x114)]-_0x4e768f[_0x2c15e6(0x114)];})[_0x1147e2(0x1ac)](_0x4273e4=>_0x4273e4[_0x1147e2(0x10d)]),_0x42b39c=[];for(const _0x3c01e7 of _0x4ef6be){const _0x34555a=_0x55b58d[_0x1147e2(0x193)](_0x3c01e7)||0x0,_0x3d898c=Math[_0x1147e2(0x118)](_0x34555a,0x1);for(let _0x3766ff=0x0;_0x3766ff<_0x3d898c;_0x3766ff++){_0x42b39c[_0x1147e2(0x1b0)](_0x3c01e7);}}_0x3c8e1a[_0x1147e2(0x187)](_0x4af2d1,_0x42b39c);}return{'existingLocalSegmentNames':_0x59755f,'localSegmentRules':_0x9fbada,'localExpandedRuleToNames':_0x3c8e1a};}export function createSegmentIdResolver(_0x5047ed,_0x548ef6){return async _0x42f668=>{const _0xef75d=a151_0x2980,_0x56c6ba=_0x5047ed['get'](_0x42f668);if(!_0x56c6ba)throw new SDKError(ErrorCode[_0xef75d(0xe3)],'Segment\x20not\x20found:\x20'+_0x42f668+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x548ef6+'\x27)');return _0x56c6ba;};}export function extractRootFolderId(_0x52991b){const _0x21e0a1=a151_0x4508fd;return _0x52991b[_0x21e0a1(0x158)]?.[_0x21e0a1(0x194)]?.[_0x21e0a1(0x191)]?.['id']||_0x52991b[_0x21e0a1(0x158)]?.[_0x21e0a1(0x106)]?.[_0x21e0a1(0x191)]?.['id'];}export function buildConnectionMaps(_0x5af4bb){const _0x1d167c=a151_0x4508fd,_0x1b3e58=new Map(),_0x184ee6=new Map(),_0x43309f=new Map();for(const _0x723027 of _0x5af4bb){_0x1b3e58[_0x1d167c(0x187)](_0x723027['name'],parseInt(_0x723027['id'],0xa)),_0x184ee6[_0x1d167c(0x187)](_0x723027['id'],_0x723027[_0x1d167c(0x10d)]),_0x43309f['set'](_0x723027[_0x1d167c(0x10d)],_0x723027[_0x1d167c(0x149)]);}return{'nameToId':_0x1b3e58,'idToName':_0x184ee6,'nameToType':_0x43309f};}export function calculatePushStats(_0x50630b,_0x23e1e0,_0x4ab43d,_0x3f46dd,_0x4c977e,_0x3f21a7,_0x2453bc){const _0x5a8dc2=a151_0x4508fd,_0x4ff161=_0x50630b[_0x5a8dc2(0xf6)](_0x37ff7b=>_0x37ff7b['isNew']),_0x5dc4f2=_0x50630b[_0x5a8dc2(0xf6)](_0x596028=>!_0x596028[_0x5a8dc2(0x1ad)]&&_0x596028[_0x5a8dc2(0xdb)]),_0xefe79f=_0x50630b[_0x5a8dc2(0xf6)](_0x4b9945=>!_0x4b9945[_0x5a8dc2(0x1ad)]&&!_0x4b9945['hasChanges']),_0x2ce188=_0x3f21a7?_0x3f46dd:[],_0x4e452e=_0x23e1e0[_0x5a8dc2(0xf6)](_0x361a87=>_0x361a87[_0x5a8dc2(0x1ad)]),_0x1d5d97=_0x23e1e0['filter'](_0x912dfb=>!_0x912dfb[_0x5a8dc2(0x1ad)]&&_0x912dfb[_0x5a8dc2(0xdb)]),_0x4cb6d2=_0x23e1e0[_0x5a8dc2(0xf6)](_0x3a2f5d=>!_0x3a2f5d['isNew']&&!_0x3a2f5d[_0x5a8dc2(0xdb)]),_0x31209a=_0x3f21a7?_0x4c977e:[],_0x4ace03=_0x50630b[_0x5a8dc2(0x13e)](_0x49ccc6=>_0x49ccc6[_0x5a8dc2(0xfb)]),_0x5bca8c=_0x4ace03[_0x5a8dc2(0xf6)](_0x4b42e2=>_0x4b42e2[_0x5a8dc2(0x149)]===_0x5a8dc2(0xe1)),_0xb76f9b=_0x4ace03['filter'](_0x4c1034=>_0x4c1034[_0x5a8dc2(0x149)]===_0x5a8dc2(0x182)),_0x13ec7f=_0x4ace03[_0x5a8dc2(0xf6)](_0x2fb20d=>_0x2fb20d['type']===_0x5a8dc2(0x167)),_0x18dd25=Array[_0x5a8dc2(0x178)](_0x4ab43d)[_0x5a8dc2(0x161)](),_0x5142cb=_0x2453bc?![]:_0x4ff161[_0x5a8dc2(0x117)]>0x0||_0x5dc4f2[_0x5a8dc2(0x117)]>0x0||_0x2ce188[_0x5a8dc2(0x117)]>0x0,_0x564303=_0x4e452e[_0x5a8dc2(0x117)]>0x0||_0x1d5d97[_0x5a8dc2(0x117)]>0x0||_0x31209a[_0x5a8dc2(0x117)]>0x0,_0x1d95cc=_0x2453bc?![]:_0x4ace03[_0x5a8dc2(0x117)]>0x0,_0x394164=_0x18dd25['length']>0x0;return{'segments':{'new':_0x4ff161,'changed':_0x5dc4f2,'unchanged':_0xefe79f,'toDelete':_0x2ce188},'journeys':{'new':_0x4e452e,'changed':_0x1d5d97,'unchanged':_0x4cb6d2,'toDelete':_0x31209a},'activations':{'all':_0x4ace03,'toCreate':_0x5bca8c,'toUpdate':_0xb76f9b,'toDelete':_0x13ec7f},'folders':{'toCreate':_0x18dd25},'counts':{'segments':{'new':_0x4ff161[_0x5a8dc2(0x117)],'changed':_0x5dc4f2['length'],'unchanged':_0xefe79f[_0x5a8dc2(0x117)],'toDelete':_0x2ce188['length']},'journeys':{'new':_0x4e452e[_0x5a8dc2(0x117)],'changed':_0x1d5d97[_0x5a8dc2(0x117)],'unchanged':_0x4cb6d2['length'],'toDelete':_0x31209a[_0x5a8dc2(0x117)]},'activations':{'create':_0x5bca8c[_0x5a8dc2(0x117)],'update':_0xb76f9b[_0x5a8dc2(0x117)],'delete':_0x13ec7f[_0x5a8dc2(0x117)]},'folders':_0x18dd25[_0x5a8dc2(0x117)]},'hasChanges':_0x5142cb||_0x564303||_0x1d95cc||_0x394164};}export async function buildPushExecutionContext(_0x4be5ea,_0x2eed96,_0x4ca778,_0x2c1903,_0x325ca0,_0x1dc682){const _0x516134=a151_0x4508fd,_0x297e7d=extractRootFolderId(_0x4ca778),{pathToId:_0x570882,idToPath:_0x229242}=buildFolderMaps(_0x325ca0),_0x596ac7=buildSegmentNameToIdMap(_0x2c1903),_0xc001fa=new Map(),{batchAsync:_0x57108d}=await import(_0x516134(0x142)),[_0x26374e,_0x338d6f]=await Promise[_0x516134(0x157)]([_0x4be5ea['user']['buildUserMaps'](),_0x4be5ea[_0x516134(0x16c)][_0x516134(0x14b)](),((async()=>{const _0x29c9ca=_0x516134;!_0x1dc682&&_0x2c1903[_0x29c9ca(0x117)]>0x0&&await _0x57108d(_0x2c1903,async _0x1378fe=>{const _0x18813c=_0x29c9ca,_0x434f51=await _0x4be5ea[_0x18813c(0x105)][_0x18813c(0x17e)](_0x2eed96,_0x1378fe['id']);_0xc001fa[_0x18813c(0x187)](_0x1378fe['id'],_0x434f51);});})())]),{emailToId:_0x1b4f77,idToEmail:_0x95ded7}=_0x26374e,_0x401075=buildConnectionMaps(_0x338d6f);return{'rootFolderId':_0x297e7d,'folderPathToId':_0x570882,'folderIdToPath':_0x229242,'segmentNameToId':_0x596ac7,'activationsBySegmentId':_0xc001fa,'emailToIdMap':_0x1b4f77,'idToEmailMap':_0x95ded7,'connectionNameToIdMap':_0x401075['nameToId'],'connectionIdToNameMap':_0x401075['idToName'],'connectionNameToTypeMap':_0x401075[_0x516134(0x121)]};}export function createPushYamlContextForBundle(_0x4b6c21,_0x2f523e,_0x1d697f,_0x19d3ec,_0x2c0db3,_0xe1889,_0x1ce3ed,_0x477490){const {existingLocalSegmentNames:_0x2b187d,localExpandedRuleToNames:_0x99468a}=_0x19d3ec,_0x4985e4=new Set(),_0x5f1a55=new Map(),_0xe1b986=new Map(),_0x1959fe=new Map(),_0x19a2ae=createJumpTargetCache(),_0x19b894=new Map(),_0x2d1bc4=new Map(),_0x4fe10e=new Set();let _0x4577f6;const _0x58f7bb=_0x189930=>{const _0x299daf={'resolveSegment':async _0x125338=>{const _0x29d003=a151_0x2980,_0x5ae39d=_0x1959fe[_0x29d003(0x193)](_0x125338);if(_0x5ae39d!==undefined)return{'name':_0x5ae39d,'isJourneyLocal':!![]};try{const _0x513779=await fetchSegment(_0x4b6c21,_0x2f523e,_0x125338,_0x1d697f);if(!_0x513779)throw new Error(_0x29d003(0x145));const _0x4b69c2=generateJourneyLocalName(_0x513779[_0x29d003(0x10d)]),_0x8513b4=_0x513779[_0x29d003(0x13d)]===SEGMENT_KIND_JOURNEY&&_0x4b69c2!==undefined;let _0x47f5df=_0x513779[_0x29d003(0x10d)],_0x459883;if(_0x8513b4&&_0x513779[_0x29d003(0x13c)]){const _0x5c0cbe=apiRuleToYaml(_0x513779[_0x29d003(0x13c)]);_0x2d1bc4[_0x29d003(0x187)](_0x125338,_0x5c0cbe);const _0x3cdcc0=async _0x2e5026=>{const _0x49c2c0=_0x29d003,_0x52d585=collectSegmentRefsFromRule(_0x2e5026);for(const _0x1b1fc3 of _0x52d585){if(!_0x2d1bc4['has'](_0x1b1fc3))try{const _0x35d376=await fetchSegment(_0x4b6c21,_0x2f523e,_0x1b1fc3,_0x1d697f);if(_0x35d376?.['rule']){const _0x5700f9=apiRuleToYaml(_0x35d376[_0x49c2c0(0x13c)]);_0x2d1bc4[_0x49c2c0(0x187)](_0x1b1fc3,_0x5700f9),await _0x3cdcc0(_0x5700f9);}}catch(_0x5d0169){logger[_0x49c2c0(0x144)](_0x49c2c0(0x12d)+_0x1b1fc3+':\x20'+_0x5d0169);}}};await _0x3cdcc0(_0x5c0cbe);const _0x4eed08=serializeExpandedRule(_0x5c0cbe,_0x2d1bc4),_0x5bf9db=_0x99468a['get'](_0x4eed08);if(_0x5bf9db&&_0x5bf9db[_0x29d003(0x117)]>0x0){const _0x3eeea3=_0x5f1a55[_0x29d003(0x193)](_0x4eed08)||0x0,_0x586704=_0x5bf9db[_0x3eeea3]||_0x5bf9db[_0x5bf9db[_0x29d003(0x117)]-0x1];_0x5f1a55[_0x29d003(0x187)](_0x4eed08,_0x3eeea3+0x1),_0x47f5df=_0x586704,_0x4985e4[_0x29d003(0x111)](_0x47f5df),_0x1959fe[_0x29d003(0x187)](_0x125338,_0x47f5df);const _0x297d9b=await resolveRuleSegmentRefs(_0x5c0cbe,async _0x13cfc6=>{const _0x1d0e29=_0x29d003,_0x20aa9c=_0x1959fe[_0x1d0e29(0x193)](_0x13cfc6);if(_0x20aa9c)return _0x20aa9c;const _0x25a18f=await _0x4577f6['resolveSegment'](_0x13cfc6);return _0x25a18f[_0x1d0e29(0x10d)];});_0x459883={'description':_0x513779['description'],'rule':_0x297d9b};}else{const _0x431016=_0x19b894['get'](_0x4eed08);if(_0x431016)_0x47f5df=_0x431016,_0x1959fe['set'](_0x125338,_0x47f5df);else{if(_0x4b69c2){let _0x1462e2=_0x4b69c2,_0x32a09e=0x2;while(_0x4985e4[_0x29d003(0x116)](_0x1462e2)||_0x2b187d['has'](_0x1462e2)){_0x1462e2=_0x4b69c2+'_'+_0x32a09e,_0x32a09e++;}_0x4985e4[_0x29d003(0x111)](_0x1462e2),_0x47f5df=_0x1462e2;}_0x1959fe['set'](_0x125338,_0x47f5df),_0x19b894[_0x29d003(0x187)](_0x4eed08,_0x47f5df);const _0x2225f0=await resolveRuleSegmentRefs(_0x5c0cbe,async _0x7d7779=>{const _0x5dfce8=_0x29d003,_0xd76af8=_0x1959fe[_0x5dfce8(0x193)](_0x7d7779);if(_0xd76af8)return _0xd76af8;const _0x1ff323=await _0x4577f6[_0x5dfce8(0x1b2)](_0x7d7779);return _0x1ff323[_0x5dfce8(0x10d)];});_0x459883={'description':_0x513779['description'],'rule':_0x2225f0};}}}return{'name':_0x47f5df,'isJourneyLocal':_0x8513b4,'definition':_0x459883};}catch(_0x196d61){return logger[_0x29d003(0x144)](_0x29d003(0x10a)+_0x125338+':\x20'+_0x196d61),{'name':_0x125338,'isJourneyLocal':![]};}},'resolveActivation':async _0x4fd867=>{const _0x48778e=a151_0x2980,_0x2ec68e=_0xe1b986[_0x48778e(0x193)](_0x4fd867);if(_0x2ec68e!==undefined)return{'name':_0x2ec68e,'isJourneyLocal':!![]};try{let _0x27fa18=_0x1ce3ed?.[_0x48778e(0x193)](_0x4fd867);!_0x27fa18&&(_0x27fa18=await _0x4b6c21['journey'][_0x48778e(0x1a3)](_0x189930,_0x4fd867));const _0x1326d2=_0x27fa18[_0x48778e(0x186)][_0x48778e(0x176)][_0x48778e(0x10d)]||_0x4fd867,_0x503e04=sanitizeYamlKey(_0x1326d2)||_0x48778e(0xf1)+_0x4fd867,_0x48edfd=_0x503e04;_0xe1b986['set'](_0x4fd867,_0x48edfd);const _0x8f0475=journeyActivationStepToYaml(_0x27fa18,_0x2c0db3,_0xe1889);return{'name':_0x48edfd,'isJourneyLocal':!![],'definition':_0x8f0475};}catch(_0x474581){return logger[_0x48778e(0x144)](_0x48778e(0xcc)+_0x4fd867+':\x20'+_0x474581),{'name':_0x4fd867,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1c7c7a,_0xb94f2b)=>resolveJumpTarget(_0x1c7c7a,_0xb94f2b,_0x19a2ae,async _0x407c95=>{const _0x3af8c1=a151_0x2980,_0x412688=_0x477490?.[_0x3af8c1(0x193)](_0x407c95);if(_0x412688)return _0x412688;return _0x4b6c21['journey'][_0x3af8c1(0x10b)](_0x407c95);})};return _0x4577f6=_0x299daf,_0x299daf;},_0x1011bb=async _0x29e668=>{const _0x21a3e3=a151_0x2980,{collectSegmentIdsFromJourneyApi:_0x52c0bd}=await import(_0x21a3e3(0x19c)),{batchAsync:_0x534a2e}=await import('../../utils/async.js'),_0x200418=new Set();for(const _0x4c7472 of _0x29e668){let _0x159b45=_0x477490?.[_0x21a3e3(0x193)](_0x4c7472);!_0x159b45&&(_0x159b45=await _0x4b6c21[_0x21a3e3(0x13a)]['getJourney'](_0x4c7472));const _0x54f3fc=_0x52c0bd(_0x159b45);for(const _0x24ccde of _0x54f3fc){_0x200418[_0x21a3e3(0x111)](_0x24ccde);}}let _0x3ab30f=Array[_0x21a3e3(0x178)](_0x200418);while(_0x3ab30f[_0x21a3e3(0x117)]>0x0){const _0x25307a=_0x3ab30f[_0x21a3e3(0xf6)](_0x232789=>!_0x4fe10e['has'](_0x232789));if(_0x25307a[_0x21a3e3(0x117)]===0x0)break;const _0x1f836d=await _0x534a2e(_0x25307a,async _0x1a5137=>{const _0x2b0325=_0x21a3e3;_0x4fe10e[_0x2b0325(0x111)](_0x1a5137);const _0x21f82e=await fetchSegment(_0x4b6c21,_0x2f523e,_0x1a5137,_0x1d697f);if(!_0x21f82e)return null;return{'segmentId':_0x1a5137,'segment':_0x21f82e};},0xa),_0x2bf8a6=new Set();for(const _0x262ffc of _0x1f836d){if(!_0x262ffc?.[_0x21a3e3(0x105)]?.[_0x21a3e3(0x13c)])continue;const _0x105ae3=apiRuleToYaml(_0x262ffc[_0x21a3e3(0x105)][_0x21a3e3(0x13c)]);_0x2d1bc4[_0x21a3e3(0x187)](_0x262ffc[_0x21a3e3(0x189)],_0x105ae3);const _0x20f460=collectSegmentRefsFromRule(_0x105ae3);for(const _0x4c93fb of _0x20f460){!_0x4fe10e[_0x21a3e3(0x116)](_0x4c93fb)&&_0x2bf8a6[_0x21a3e3(0x111)](_0x4c93fb);}}_0x3ab30f=Array[_0x21a3e3(0x178)](_0x2bf8a6);}};return{'createYamlContext':_0x58f7bb,'prefetchJourneySegments':_0x1011bb};}export async function executePushSegments(_0x4a263f,_0xa3788b,_0x3673b6,_0x384af4,_0x218015){const _0x7992e=a151_0x4508fd,{segmentDefToCreateRequest:_0x4a0443,segmentDefToUpdateRequest:_0x58542e}=await import(_0x7992e(0xdf)),_0x4f1075=_0x3673b6[_0x7992e(0x19d)],_0x37673a=0x5,_0x165254=async _0x368502=>{const _0xeee3e5=_0x7992e,_0x6c0cd8=_0x368502[_0xeee3e5(0x1a7)]?_0x4f1075[_0xeee3e5(0x193)](_0x368502[_0xeee3e5(0x1a7)]):undefined;let _0x2f58e8;const _0x2c4a8d={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x323c21=_0x368502[_0xeee3e5(0xfd)];if(_0x368502['yamlConfig'][_0xeee3e5(0x13c)]){const _0x5c3f8e=createSegmentIdResolver(_0x3673b6['segmentNameToId'],_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)]),_0x483951=await resolveRuleSegmentIds(_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x13c)],_0x5c3f8e);_0x323c21={..._0x368502[_0xeee3e5(0xfd)],'rule':_0x483951};}try{if(_0x368502['isNew']){_0x218015[_0xeee3e5(0xe6)]?.({'type':_0xeee3e5(0x165),'name':_0x368502[_0xeee3e5(0xfd)]['name']});const _0x562f0b=_0x4a0443(_0x323c21,_0x6c0cd8),_0x1dc7c3=await _0x218015[_0xeee3e5(0x1a2)](_0xeee3e5(0x12a)+_0x368502['yamlConfig'][_0xeee3e5(0x10d)]+'\x27...',()=>_0x4a263f[_0xeee3e5(0x105)]['createSegment'](_0x384af4[_0xeee3e5(0x1b7)],_0x562f0b));_0x2f58e8=_0x1dc7c3[_0xeee3e5(0x191)]['id'],_0x3673b6[_0xeee3e5(0x133)][_0xeee3e5(0x187)](_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)],_0x2f58e8),_0x2c4a8d[_0xeee3e5(0x1b5)]={'name':_0x368502['yamlConfig'][_0xeee3e5(0x10d)],'id':_0x2f58e8},_0x218015[_0xeee3e5(0xe6)]?.({'type':_0xeee3e5(0x151),'name':_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)],'segmentId':_0x2f58e8}),_0x218015[_0xeee3e5(0x11f)]?.('Created\x20segment\x20\x27'+_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)]+'\x27'),_0x2c4a8d['created']=0x1;}else{if(_0x368502[_0xeee3e5(0xdb)]){_0x218015['onProgress']?.({'type':_0xeee3e5(0x17c),'name':_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)]});const _0x405616=_0x58542e(_0x323c21);_0x6c0cd8!==_0x368502[_0xeee3e5(0xc3)]?.['segmentFolderId']&&(_0x405616[_0xeee3e5(0x1b1)]=_0x6c0cd8?parseInt(_0x6c0cd8,0xa):undefined),await _0x218015[_0xeee3e5(0x1a2)](_0xeee3e5(0x17d)+_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)]+_0xeee3e5(0x131),()=>_0x4a263f[_0xeee3e5(0x105)][_0xeee3e5(0x18a)](_0x384af4[_0xeee3e5(0x1b7)],_0x368502[_0xeee3e5(0xc3)]['id'],_0x405616)),_0x2f58e8=_0x368502[_0xeee3e5(0xc3)]['id'],_0x218015[_0xeee3e5(0xe6)]?.({'type':_0xeee3e5(0x138),'name':_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)]}),_0x218015[_0xeee3e5(0x11f)]?.(_0xeee3e5(0xc0)+_0x368502['yamlConfig'][_0xeee3e5(0x10d)]+'\x27'),_0x2c4a8d[_0xeee3e5(0x18c)]=0x1;}else _0x2f58e8=_0x368502[_0xeee3e5(0xc3)]['id'];}}catch(_0x38d050){const _0x532612=isHttp400Error(_0x38d050),_0x560705=_0x532612?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0xeee3e5(0x195)],_0x3c9fca=getErrorMessage(_0x38d050);throw new SDKError(_0x560705,'Failed\x20to\x20'+(_0x368502['isNew']?_0xeee3e5(0xe1):_0xeee3e5(0x182))+_0xeee3e5(0x16a)+_0x368502[_0xeee3e5(0xd3)]+'\x0a\x20\x20'+_0x3c9fca,_0x38d050);}try{const _0x4ff680=await syncActivationsForSegment(_0x4a263f,_0x384af4[_0xeee3e5(0x1b7)],_0x2f58e8,_0x368502[_0xeee3e5(0xfd)][_0xeee3e5(0x10d)],_0x368502[_0xeee3e5(0xfb)],_0x218015,_0x368502[_0xeee3e5(0xd3)]);_0x2c4a8d[_0xeee3e5(0xc9)]=_0x4ff680;}catch(_0x5818be){if(_0x5818be instanceof SDKError)throw _0x5818be;throw new SDKError(ErrorCode[_0xeee3e5(0x19e)],_0xeee3e5(0xec)+_0x368502[_0xeee3e5(0xfd)]['name']+_0xeee3e5(0x115)+_0x368502[_0xeee3e5(0xd3)]+_0xeee3e5(0xd1)+getErrorMessage(_0x5818be),_0x5818be);}return _0x2c4a8d;},_0x134302=await batchAsync(_0xa3788b,_0x165254,_0x37673a),_0x596021={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4d6496 of _0x134302){_0x596021[_0x7992e(0x18e)]+=_0x4d6496['created'],_0x596021[_0x7992e(0x18c)]+=_0x4d6496[_0x7992e(0x18c)],_0x4d6496['createdSegmentId']&&_0x596021[_0x7992e(0x174)][_0x7992e(0x187)](_0x4d6496['createdSegmentId'][_0x7992e(0x10d)],_0x4d6496[_0x7992e(0x1b5)]['id']),_0x596021['activations']['created']+=_0x4d6496[_0x7992e(0xc9)]['created'],_0x596021['activations']['updated']+=_0x4d6496[_0x7992e(0xc9)][_0x7992e(0x18c)],_0x596021['activations'][_0x7992e(0x102)]+=_0x4d6496[_0x7992e(0xc9)]['deleted'];}return _0x596021;}async function syncActivationsForSegment(_0x200f7b,_0x4e5726,_0x5f1df7,_0x388f18,_0x1afaac,_0x24ff4b,_0x2808a5){const _0x4c011e=a151_0x4508fd,_0x478a03={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5ce861 of _0x1afaac){try{if(_0x5ce861[_0x4c011e(0x149)]===_0x4c011e(0xe1)&&_0x5ce861['validatedRequest'])_0x24ff4b['onProgress']?.({'type':_0x4c011e(0x10c),'segmentName':_0x388f18,'activationName':_0x5ce861[_0x4c011e(0x10d)]}),await _0x24ff4b['withProgress'](_0x4c011e(0x120)+_0x5ce861[_0x4c011e(0x10d)]+'\x27...',()=>_0x200f7b['segment']['createActivation'](_0x4e5726,_0x5f1df7,_0x5ce861[_0x4c011e(0x127)])),_0x24ff4b['onProgress']?.({'type':_0x4c011e(0x15f),'segmentName':_0x388f18,'activationName':_0x5ce861[_0x4c011e(0x10d)]}),_0x24ff4b[_0x4c011e(0x11f)]?.(_0x4c011e(0x119)+_0x5ce861['name']+'\x27'),_0x478a03[_0x4c011e(0x18e)]++;else{if(_0x5ce861['type']===_0x4c011e(0x182)&&_0x5ce861[_0x4c011e(0x127)]&&_0x5ce861[_0x4c011e(0xfc)])_0x24ff4b[_0x4c011e(0xe6)]?.({'type':'activation_updating','segmentName':_0x388f18,'activationName':_0x5ce861[_0x4c011e(0x10d)]}),await _0x24ff4b[_0x4c011e(0x1a2)]('Updating\x20activation\x20\x27'+_0x5ce861[_0x4c011e(0x10d)]+_0x4c011e(0x131),()=>_0x200f7b[_0x4c011e(0x105)]['updateActivation'](_0x4e5726,_0x5f1df7,_0x5ce861[_0x4c011e(0xfc)]['id'],_0x5ce861['validatedRequest'])),_0x24ff4b[_0x4c011e(0xe6)]?.({'type':_0x4c011e(0x190),'segmentName':_0x388f18,'activationName':_0x5ce861['name']}),_0x24ff4b[_0x4c011e(0x11f)]?.('Updated\x20activation\x20\x27'+_0x5ce861['name']+'\x27'),_0x478a03[_0x4c011e(0x18c)]++;else _0x5ce861[_0x4c011e(0x149)]===_0x4c011e(0x167)&&_0x5ce861[_0x4c011e(0xfc)]&&(_0x24ff4b['onProgress']?.({'type':_0x4c011e(0x1a8),'segmentName':_0x388f18,'activationName':_0x5ce861[_0x4c011e(0x10d)]}),await _0x24ff4b[_0x4c011e(0x1a2)](_0x4c011e(0x10f)+_0x5ce861['name']+_0x4c011e(0x131),()=>_0x200f7b[_0x4c011e(0x105)][_0x4c011e(0x155)](_0x4e5726,_0x5f1df7,_0x5ce861['existingActivation']['id'])),_0x24ff4b[_0x4c011e(0xe6)]?.({'type':_0x4c011e(0x12c),'segmentName':_0x388f18,'activationName':_0x5ce861[_0x4c011e(0x10d)]}),_0x24ff4b[_0x4c011e(0x15b)]?.(_0x4c011e(0xd5)+_0x5ce861[_0x4c011e(0x10d)]+'\x27'),_0x478a03[_0x4c011e(0x102)]++);}}catch(_0x3cc9e7){const _0x5a3d9a=isHttp400Error(_0x3cc9e7),_0x23a6e0=_0x5a3d9a?ErrorCode[_0x4c011e(0xc7)]:ErrorCode[_0x4c011e(0x19e)],_0x209c9d=getErrorMessage(_0x3cc9e7);throw new SDKError(_0x23a6e0,'Failed\x20to\x20'+_0x5ce861[_0x4c011e(0x149)]+_0x4c011e(0xf4)+_0x5ce861[_0x4c011e(0x10d)]+_0x4c011e(0x115)+_0x2808a5+_0x4c011e(0xd1)+_0x209c9d,_0x3cc9e7);}}return _0x478a03;}export async function executePushFolders(_0x19bcd9,_0x1d6e3d,_0x41e4f5,_0x40a46e,_0x53ed46){const _0x35ea9d=a151_0x4508fd,_0xdea7be=new Map(_0x41e4f5),_0x25c380=sortFoldersByDepth(_0x1d6e3d);for(const _0x232446 of _0x25c380){const _0xc720ca=_0x232446['split']('/'),_0x55d62e=_0xc720ca[_0xc720ca['length']-0x1],_0x56cebb=_0xc720ca['slice'](0x0,-0x1)['join']('/'),_0x46f0d7=_0xdea7be[_0x35ea9d(0x193)](_0x56cebb);_0x53ed46[_0x35ea9d(0xe6)]?.({'type':'folder_creating','folder':_0x232446});const _0x2e6a08={'name':_0x55d62e,'parentFolderId':_0x46f0d7},_0x30d5aa=await _0x53ed46[_0x35ea9d(0x1a2)](_0x35ea9d(0x14a)+_0x232446+_0x35ea9d(0x131),()=>_0x19bcd9['segment'][_0x35ea9d(0x175)](_0x40a46e[_0x35ea9d(0x1b7)],_0x2e6a08));_0xdea7be['set'](_0x232446,_0x30d5aa['data']['id']),_0x53ed46['onProgress']?.({'type':_0x35ea9d(0x15e),'folder':_0x232446,'folderId':_0x30d5aa[_0x35ea9d(0x191)]['id']}),_0x53ed46[_0x35ea9d(0xd2)]?.(_0x35ea9d(0x128)+_0x232446+'\x27');}return _0xdea7be;}export async function executePushSegmentDeletions(_0x260857,_0x3557ee,_0x59eb7e){const _0x52081b=a151_0x4508fd;if(_0x3557ee[_0x52081b(0x117)]===0x0)return 0x0;const {batchAsync:_0x4a47d6}=await import('../../utils/async.js'),_0x318f19=0x5,_0x3d22ba=await _0x4a47d6(_0x3557ee,async _0x437416=>{const _0x3dc9e0=_0x52081b;return _0x59eb7e[_0x3dc9e0(0xe6)]?.({'type':'segment_deleting','name':_0x437416[_0x3dc9e0(0x10d)]}),await _0x260857['segment'][_0x3dc9e0(0x129)](_0x437416['id']),_0x59eb7e[_0x3dc9e0(0xe6)]?.({'type':'segment_deleted','name':_0x437416[_0x3dc9e0(0x10d)]}),_0x59eb7e[_0x3dc9e0(0x15b)]?.('Deleted\x20segment\x20\x27'+_0x437416[_0x3dc9e0(0x10d)]+'\x27'),0x1;},_0x318f19);return _0x3d22ba['reduce']((_0x500f41,_0xafbfa3)=>_0x500f41+_0xafbfa3,0x0);}export async function executePushJourneys(_0xfd0fae,_0x30645f,_0x21e32e,_0x2e3277,_0x52170d){const _0x18d3c6=a151_0x4508fd,{journeyDefToRequest:_0x94b54}=await import(_0x18d3c6(0x19c)),{activationDefToCreateRequest:_0x308faa,yamlRuleToApi:_0x1777e7,validateSegmentRule:_0x33141a}=await import(_0x18d3c6(0xdf)),_0x2331ae={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0xeba30a=new Map(_0x21e32e[_0x18d3c6(0x133)]),_0x4b6690=0x5;for(let _0x2f4320=0x0;_0x2f4320<_0x30645f[_0x18d3c6(0x117)];_0x2f4320+=_0x4b6690){const _0x4b112d=_0x30645f['slice'](_0x2f4320,_0x2f4320+_0x4b6690),_0x25270a=await Promise[_0x18d3c6(0x157)](_0x4b112d[_0x18d3c6(0x1ac)](async _0x3f14e1=>{const _0x317d3c=_0x18d3c6;if(!_0x3f14e1[_0x317d3c(0x1ad)]&&!_0x3f14e1['hasChanges'])return{'action':'unchanged','name':_0x3f14e1[_0x317d3c(0xfd)]['name'],'journeyId':_0x3f14e1[_0x317d3c(0x139)]?.['id']};const _0x3908f4=_0x3f14e1[_0x317d3c(0x1a7)]?_0x21e32e[_0x317d3c(0x19d)]['get'](_0x3f14e1['folderPath']):undefined;_0x52170d['onProgress']?.({'type':_0x3f14e1[_0x317d3c(0x1ad)]?'journey_creating':'journey_updating','name':_0x3f14e1['yamlConfig'][_0x317d3c(0x10d)]});try{const _0x8feaba=await executeSingleJourneyPush(_0xfd0fae,_0x3f14e1,{..._0x21e32e,'segmentNameToId':_0xeba30a},{'parentId':_0x2e3277[_0x317d3c(0x1b7)],'rootFolderId':_0x2e3277[_0x317d3c(0xe8)],'folderId':_0x3908f4,'verbose':_0x2e3277[_0x317d3c(0xd8)]},_0x52170d,{'journeyDefToRequest':_0x94b54,'activationDefToCreateRequest':_0x308faa,'yamlRuleToApi':_0x1777e7,'validateSegmentRule':_0x33141a});for(const [_0x39ac39,_0x3eb175]of _0x8feaba[_0x317d3c(0x109)]){_0xeba30a['set'](_0x39ac39,_0x3eb175),_0x2331ae['embeddedSegmentNameToId']['set'](_0x39ac39,_0x3eb175);}if(_0x8feaba[_0x317d3c(0xda)]===_0x317d3c(0x18e))_0x52170d['onProgress']?.({'type':_0x317d3c(0x156),'name':_0x3f14e1['yamlConfig'][_0x317d3c(0x10d)],'journeyId':_0x8feaba[_0x317d3c(0x122)]}),_0x52170d['logSuccess']?.(_0x317d3c(0x197)+_0x3f14e1['yamlConfig'][_0x317d3c(0x10d)]+'\x27'),_0x2331ae['created']++;else _0x8feaba[_0x317d3c(0xda)]===_0x317d3c(0x18c)&&(_0x52170d[_0x317d3c(0xe6)]?.({'type':'journey_updated','name':_0x3f14e1[_0x317d3c(0xfd)][_0x317d3c(0x10d)]}),_0x52170d[_0x317d3c(0x11f)]?.(_0x317d3c(0x169)+_0x3f14e1[_0x317d3c(0xfd)][_0x317d3c(0x10d)]+'\x27'),_0x2331ae[_0x317d3c(0x18c)]++);return{'action':_0x8feaba[_0x317d3c(0xda)],'name':_0x3f14e1[_0x317d3c(0xfd)][_0x317d3c(0x10d)],'journeyId':_0x8feaba[_0x317d3c(0x122)]};}catch(_0xeb3e63){const _0x561362=isHttp400Error(_0xeb3e63),_0x2f4e94=_0x561362?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x317d3c(0x11e)],_0x352cc5=getErrorMessage(_0xeb3e63);throw new SDKError(_0x2f4e94,'Failed\x20to\x20'+(_0x3f14e1[_0x317d3c(0x1ad)]?'create':_0x317d3c(0x182))+_0x317d3c(0x12f)+_0x3f14e1[_0x317d3c(0xd3)]+_0x317d3c(0xd1)+_0x352cc5,_0xeb3e63);}}));_0x2331ae['results']['push'](..._0x25270a);}return _0x2331ae;}async function matchExistingJourneySegments(_0x3113b9,_0x31f593,_0x2f4166,_0x502f3a,_0x5834d5){const _0x271554=a151_0x4508fd;if(!_0x31f593['existingJourney']||!_0x31f593[_0x271554(0xfd)]['segments'])return;const _0x46fd55=new Map(),_0x524037=new Set();for(const _0x807bb3 of Object[_0x271554(0x134)](_0x31f593['yamlConfig'][_0x271554(0x18d)])){const _0x30e400=generateDeterministicJourneySegmentName(_0x31f593[_0x271554(0xfd)][_0x271554(0x10d)],_0x807bb3);_0x46fd55[_0x271554(0x187)](_0x30e400,_0x807bb3),_0x524037[_0x271554(0x111)](_0x807bb3);}const _0x830232=[],_0x1ede55=collectSegmentIdsFromJourneyApi(_0x31f593[_0x271554(0x139)]);for(const _0x183a9b of _0x1ede55){const _0x336db5=await fetchSegment(_0x3113b9,_0x2f4166,_0x183a9b,_0x502f3a);if(!_0x336db5?.[_0x271554(0x10d)])continue;const _0x5cda11=_0x46fd55['get'](_0x336db5['name']);_0x5cda11?(_0x5834d5[_0x271554(0x187)](_0x5cda11,_0x183a9b),_0x524037[_0x271554(0x167)](_0x5cda11)):_0x830232[_0x271554(0x1b0)]({'id':_0x183a9b,'seg':_0x336db5});}if(_0x524037[_0x271554(0x1aa)]>0x0&&_0x830232['length']>0x0){const {localExpandedRuleToNames:_0x13e3ae}=buildLocalExpandedRuleMappings(_0x31f593[_0x271554(0xfd)]),_0x2790c9=new Map();for(const {id:_0x1382c5,seg:_0x1ff2b5}of _0x830232){if(_0x1ff2b5[_0x271554(0x13c)]){const _0x140277=apiRuleToYaml(_0x1ff2b5['rule']);_0x2790c9[_0x271554(0x187)](_0x1382c5,_0x140277);}}for(const {id:_0x373024,seg:_0xfc0bd7}of _0x830232){if(!_0xfc0bd7['rule'])continue;const _0x21b840=_0x2790c9[_0x271554(0x193)](_0x373024);if(!_0x21b840)continue;const _0x3f3ef4=serializeExpandedRule(_0x21b840,_0x2790c9),_0x43516e=_0x13e3ae[_0x271554(0x193)](_0x3f3ef4);if(_0x43516e){const _0x5dd377=_0x43516e[_0x271554(0x143)](_0x2bcf62=>_0x524037['has'](_0x2bcf62));_0x5dd377&&(_0x5834d5[_0x271554(0x187)](_0x5dd377,_0x373024),_0x524037['delete'](_0x5dd377),logger[_0x271554(0x144)](_0x271554(0xf9)+_0xfc0bd7[_0x271554(0x10d)]+_0x271554(0xc8)+_0x5dd377+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x214e88,_0x5f5659,_0x547200,_0x2356a9,_0x5a48fd,_0x4f56cf){const _0xa35ebb=a151_0x4508fd,{journeyDefToRequest:_0x125c9d,activationDefToCreateRequest:_0x86a344,yamlRuleToApi:_0x27e5a1,validateSegmentRule:_0xd2ad82}=_0x4f56cf,_0x145eb0=new Map(),_0x5e1211=new Map();recoverSegmentIdsFromPushRecovery(_0x5f5659,_0x145eb0,_0x547200['segmentNameToId']);const _0x1c1253=new Map(),_0x1c88e8=new Map(),_0x562c9e=new Map();let _0x3c27b9;const _0x2d9c75=async()=>{const _0x57175d=a151_0x2980;if(_0x3c27b9)return;_0x3c27b9=new Map();if(!_0x5f5659[_0x57175d(0x139)])return;const _0x49ac64=await _0x214e88[_0x57175d(0x13a)][_0x57175d(0x17e)](_0x5f5659[_0x57175d(0x139)]['id']);for(const _0x2a0c80 of _0x49ac64){const _0x10e5bd=journeyActivationStepToYaml(_0x2a0c80,_0x547200[_0x57175d(0x168)],_0x547200[_0x57175d(0x17b)]),_0x27e223=activationSignature(_0x10e5bd);!_0x3c27b9['has'](_0x27e223)&&_0x3c27b9[_0x57175d(0x187)](_0x27e223,_0x2a0c80['id']),_0x10e5bd['name']&&_0x5e1211[_0x57175d(0x187)](_0x10e5bd[_0x57175d(0x10d)],_0x2a0c80['id']);}};await matchExistingJourneySegments(_0x214e88,_0x5f5659,_0x2356a9[_0xa35ebb(0x1b7)],_0x547200[_0xa35ebb(0x1b6)],_0x547200[_0xa35ebb(0x133)]);const _0x2e6968={'resolveSegmentId':async _0x5af5a4=>{const _0xa83ad3=_0xa35ebb,_0x2f5df1=_0x547200[_0xa83ad3(0x133)][_0xa83ad3(0x193)](_0x5af5a4);if(!_0x2f5df1)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x5af5a4+_0xa83ad3(0x183)+_0x5f5659[_0xa83ad3(0xfd)][_0xa83ad3(0x10d)]+')');return _0x2f5df1;},'resolveEmbeddedSegmentId':async(_0x46334d,_0x17c0c8)=>{const _0x22127e=_0xa35ebb,_0x34eae7=_0x547200['segmentNameToId'][_0x22127e(0x193)](_0x46334d);if(_0x34eae7)return _0x34eae7;const _0x3f6c8a=_0x547200[_0x22127e(0x1b6)][_0x22127e(0x143)](_0x3dee13=>_0x3dee13[_0x22127e(0x10d)]===_0x46334d);if(_0x3f6c8a)return _0x547200[_0x22127e(0x133)][_0x22127e(0x187)](_0x46334d,_0x3f6c8a['id']),_0x3f6c8a['id'];if(_0x5f5659[_0x22127e(0x1ad)]){const {stageName:_0x2b85ff,criteriaName:_0x584700}=findSegmentCriteriaLocation(_0x5f5659[_0x22127e(0xfd)],_0x46334d);return _0xd2ad82(_0x46334d,_0x17c0c8[_0x22127e(0x13c)]),_0x1c88e8[_0x22127e(0x187)](_0x46334d,{'definition':_0x17c0c8,'stageName':_0x2b85ff,'criteriaName':_0x584700}),createPendingSegmentId(_0x46334d);}const _0x16de84=_0x5f5659[_0x22127e(0x139)]?.['id'];if(!_0x16de84)throw new SDKError(ErrorCode['INTERNAL'],_0x22127e(0xc6));const _0x24d18f=_0x1c1253[_0x22127e(0x193)](_0x46334d);if(_0x24d18f)return _0x24d18f;const _0x4c3fb2=((async()=>{const _0x12de2a=_0x22127e;_0xd2ad82(_0x46334d,_0x17c0c8['rule']);const _0x1015a7=generateDeterministicJourneySegmentName(_0x5f5659[_0x12de2a(0xfd)][_0x12de2a(0x10d)],_0x46334d),_0x614104=_0x547200[_0x12de2a(0x1b6)][_0x12de2a(0x143)](_0x4795d9=>_0x4795d9[_0x12de2a(0x10d)]===_0x1015a7),_0x5b26f6=createSegmentIdResolver(_0x547200[_0x12de2a(0x133)],_0x46334d),_0xe3ca91=await resolveRuleSegmentIds(_0x17c0c8[_0x12de2a(0x13c)],_0x5b26f6);let _0x55bfb1;return _0x614104?(await _0x214e88[_0x12de2a(0x105)][_0x12de2a(0x18a)](_0x2356a9[_0x12de2a(0x1b7)],_0x614104['id'],{'description':_0x17c0c8['description']||'Entry\x20criteria:\x20'+_0x46334d,'rule':_0x27e5a1(_0xe3ca91),'countPopulation':!![]}),_0x55bfb1=_0x614104['id'],saveSegmentToPushRecovery(_0x5f5659[_0x12de2a(0xd3)],_0x5f5659[_0x12de2a(0xfd)][_0x12de2a(0x10d)],_0x46334d,{'segmentId':_0x55bfb1,'uniqueServerName':_0x1015a7,'createdAt':new Date()[_0x12de2a(0xe0)]()})):_0x55bfb1=await createOrRecoverEmbeddedSegment(_0x214e88,_0x5f5659,{'localName':_0x46334d,'uniqueSegmentName':_0x1015a7,'description':_0x17c0c8[_0x12de2a(0x164)]||_0x12de2a(0xc5)+_0x46334d,'journeyId':_0x16de84,'resolvedRule':_0xe3ca91,'parentId':_0x2356a9['parentId'],'folderId':_0x2356a9[_0x12de2a(0xe8)]||''},_0x27e5a1),_0x547200[_0x12de2a(0x133)][_0x12de2a(0x187)](_0x46334d,_0x55bfb1),_0x145eb0[_0x12de2a(0x187)](_0x46334d,_0x55bfb1),_0x55bfb1;})());_0x1c1253[_0x22127e(0x187)](_0x46334d,_0x4c3fb2);try{return await _0x4c3fb2;}finally{_0x1c1253['delete'](_0x46334d);}},'resolveActivationId':async _0x45d4cd=>{const _0x1d1623=_0xa35ebb,_0x2e1470=_0x5e1211['get'](_0x45d4cd);if(_0x2e1470)return _0x2e1470;if(_0x5f5659['existingJourney']){await _0x2d9c75();const _0x58e18e=_0x5e1211[_0x1d1623(0x193)](_0x45d4cd);if(_0x58e18e)return _0x58e18e;}throw new SDKError(ErrorCode[_0x1d1623(0x112)],_0x1d1623(0x172)+_0x45d4cd+_0x1d1623(0x183)+_0x5f5659[_0x1d1623(0xfd)][_0x1d1623(0x10d)]+_0x1d1623(0x14c)+_0x1d1623(0x147));},'resolveEmbeddedActivationId':async(_0x1754e8,_0x100059)=>{const _0x5d7592=_0xa35ebb,_0x382b46=_0x5e1211[_0x5d7592(0x193)](_0x1754e8);if(_0x382b46)return _0x382b46;if(_0x5f5659[_0x5d7592(0x1ad)])return _0x562c9e[_0x5d7592(0x187)](_0x1754e8,_0x100059),createPendingActivationId(_0x1754e8);if(_0x5f5659[_0x5d7592(0x139)]){await _0x2d9c75();const _0x1cb679=_0x5e1211[_0x5d7592(0x193)](_0x100059[_0x5d7592(0x10d)]);if(_0x1cb679)return _0x5e1211[_0x5d7592(0x187)](_0x1754e8,_0x1cb679),_0x1cb679;const _0x589b01=activationSignature(_0x100059),_0x3373cb=_0x3c27b9?.[_0x5d7592(0x193)](_0x589b01);if(_0x3373cb)return _0x5e1211[_0x5d7592(0x187)](_0x1754e8,_0x3373cb),_0x3373cb;const _0x492f7b=await _0x86a344(_0x100059,_0x547200[_0x5d7592(0x1ae)]),_0x1502e6={..._0x492f7b,..._0x100059[_0x5d7592(0x192)]!==undefined&&{'runAfterJourneyRefresh':_0x100059[_0x5d7592(0x192)]}},_0x3ed10e=await _0x214e88['journey']['createActivation'](_0x5f5659[_0x5d7592(0x139)]['id'],_0x1502e6);return _0x5e1211[_0x5d7592(0x187)](_0x1754e8,_0x3ed10e['id']),_0x3ed10e['id'];}throw new SDKError(ErrorCode[_0x5d7592(0xd0)],_0x5d7592(0x180));},'resolveJourneyId':async _0x36bbb5=>{const _0x19d25d=_0xa35ebb;try{return await _0x214e88[_0x19d25d(0x13a)][_0x19d25d(0xc1)](_0x2356a9[_0x19d25d(0x1b7)],_0x36bbb5);}catch(_0x2aabf6){throw new SDKError(ErrorCode[_0x19d25d(0x112)],_0x19d25d(0x154)+_0x36bbb5+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x5f5659[_0x19d25d(0xfd)][_0x19d25d(0x10d)]+'\x27)',_0x2aabf6);}},'resolveStageId':async(_0x4f61ff,_0x4b90c1)=>{const _0x552ffa=_0xa35ebb,_0x56a4fc=await _0x214e88[_0x552ffa(0x13a)][_0x552ffa(0x10b)](_0x4f61ff),_0x1a2396=_0x56a4fc[_0x552ffa(0x186)][_0x552ffa(0x15d)][_0x552ffa(0x143)](_0x395335=>_0x395335['name'][_0x552ffa(0x104)]()===_0x4b90c1[_0x552ffa(0x104)]());if(!_0x1a2396?.['id'])throw new SDKError(ErrorCode[_0x552ffa(0x112)],_0x552ffa(0xf8)+_0x4b90c1+_0x552ffa(0xc2)+(_0x56a4fc[_0x552ffa(0x186)][_0x552ffa(0xfa)]||_0x56a4fc[_0x552ffa(0x186)]['name'])+'\x27');return _0x1a2396['id'];}},_0x191be9=await _0x125c9d(_0x5f5659[_0xa35ebb(0xfd)],_0x2356a9['parentId'],_0x2e6968),_0x2482ad=_0x2356a9[_0xa35ebb(0x177)]||_0x2356a9[_0xa35ebb(0xe8)];_0x2482ad&&(_0x191be9[_0xa35ebb(0x158)]={'parentFolder':{'data':{'id':_0x2482ad,'type':_0xa35ebb(0x16e)}}});if(_0x5f5659[_0xa35ebb(0x1ad)]){if(_0x1c88e8[_0xa35ebb(0x1aa)]>0x0||_0x562c9e['size']>0x0)return await executeThreeStepJourneyCreate(_0x214e88,_0x5f5659,_0x191be9,{'pendingEmbeddedSegments':_0x1c88e8,'pendingEmbeddedActivations':_0x562c9e,'embeddedSegmentNameToId':_0x145eb0,'journeyActivationNameToId':_0x5e1211},{..._0x2356a9,'effectiveFolderId':_0x2482ad},_0x547200,_0x5a48fd,_0x4f56cf);else{ensureJourneyDefaults(_0x191be9[_0xa35ebb(0x186)]);const _0x1dc1e7=await _0x214e88[_0xa35ebb(0x13a)][_0xa35ebb(0xe1)](_0x191be9);return deletePushRecovery(_0x5f5659[_0xa35ebb(0xd3)]),{'action':_0xa35ebb(0x18e),'journeyId':_0x1dc1e7['id'],'embeddedSegmentNameToId':_0x145eb0};}}else{if(_0x5f5659[_0xa35ebb(0xdb)]&&_0x5f5659[_0xa35ebb(0x139)]){_0x191be9['id']=_0x5f5659[_0xa35ebb(0x139)]['id'];const _0xa7bb30=_0x191be9[_0xa35ebb(0x186)];_0x5f5659[_0xa35ebb(0x139)]['attributes']?.[_0xa35ebb(0xfa)]&&(_0xa7bb30[_0xa35ebb(0xfa)]=_0x5f5659[_0xa35ebb(0x139)]['attributes'][_0xa35ebb(0xfa)]);const _0x303d4f=_0x5f5659[_0xa35ebb(0x139)][_0xa35ebb(0x186)]?.[_0xa35ebb(0x15d)];return _0x303d4f&&_0x191be9[_0xa35ebb(0x186)][_0xa35ebb(0x15d)]&&injectExistingStageIds(_0x191be9['attributes'][_0xa35ebb(0x15d)],_0x303d4f),ensureJourneyDefaults(_0xa7bb30),await _0x214e88[_0xa35ebb(0x13a)]['update'](_0x5f5659[_0xa35ebb(0x139)]['id'],_0x191be9),deletePushRecovery(_0x5f5659[_0xa35ebb(0xd3)]),{'action':_0xa35ebb(0x18c),'journeyId':_0x5f5659[_0xa35ebb(0x139)]['id'],'embeddedSegmentNameToId':_0x145eb0};}}return deletePushRecovery(_0x5f5659[_0xa35ebb(0xd3)]),{'action':_0xa35ebb(0xdc),'journeyId':_0x5f5659[_0xa35ebb(0x139)]?.['id'],'embeddedSegmentNameToId':_0x145eb0};}function findSegmentCriteriaLocation(_0x18fbfc,_0x44c348){const _0x4dade3=a151_0x4508fd,_0x242f7c=_0x18fbfc[_0x4dade3(0x163)]||_0x18fbfc[_0x4dade3(0xed)]?.[0x0]?.[_0x4dade3(0x163)]||[];let _0x564b21=_0x4dade3(0x1b4),_0xe164ce=_0x44c348;const _0x470b8a=_0x18fbfc[_0x4dade3(0xef)]||_0x18fbfc['journeys']?.[0x0]?.[_0x4dade3(0xef)];if(_0x470b8a?.[_0x4dade3(0x105)]===_0x44c348)return{'stageName':_0x4dade3(0xef),'criteriaName':_0x470b8a[_0x4dade3(0x10d)]||_0x44c348};_0x18d804:for(const _0x5139cf of _0x242f7c){if(_0x5139cf[_0x4dade3(0x11c)]?.[_0x4dade3(0x105)]===_0x44c348){_0x564b21=_0x5139cf[_0x4dade3(0x10d)],_0xe164ce=_0x5139cf[_0x4dade3(0x11c)][_0x4dade3(0x10d)]||_0x44c348;break;}if(_0x5139cf[_0x4dade3(0x17a)])for(const _0x4905e3 of _0x5139cf[_0x4dade3(0x17a)]){if(_0x4905e3['type']===_0x4dade3(0x196)&&_0x4905e3[_0x4dade3(0x113)]?.['branches'])for(const _0x231feb of _0x4905e3['with'][_0x4dade3(0x141)]){if(_0x231feb[_0x4dade3(0x105)]===_0x44c348){_0x564b21=_0x5139cf['name'],_0xe164ce=_0x231feb[_0x4dade3(0x10d)]||_0x44c348;break _0x18d804;}}}}return{'stageName':_0x564b21,'criteriaName':_0xe164ce};}async function executeThreeStepJourneyCreate(_0x7eeab7,_0x455cae,_0x4eb28c,_0x362859,_0x3d5666,_0x359644,_0x2ae999,_0x57fdd7){const _0x5f1ece=a151_0x4508fd,{activationDefToCreateRequest:_0x25a770,yamlRuleToApi:_0x5ac024}=_0x57fdd7,{pendingEmbeddedSegments:_0x268f1c,pendingEmbeddedActivations:_0x440663,embeddedSegmentNameToId:_0x73759f}=_0x362859,_0x5797d8=JSON['parse'](JSON[_0x5f1ece(0x159)](_0x4eb28c));ensureJourneyDefaults(_0x5797d8[_0x5f1ece(0x186)]),stripPendingIds(_0x5797d8);const _0x4de910=await _0x7eeab7[_0x5f1ece(0x13a)]['create'](_0x5797d8),_0x4141d0=_0x4de910['id'],_0x28655b=new Map();for(const _0x52a140 of _0x4de910[_0x5f1ece(0x186)][_0x5f1ece(0x15d)]){_0x28655b['set'](_0x52a140['name'][_0x5f1ece(0x104)](),_0x52a140['id']);}recoverSegmentIdsFromPushRecovery(_0x455cae,_0x73759f,_0x359644[_0x5f1ece(0x133)]);for(const [_0x28d83d,{definition:_0x5d47a1}]of _0x268f1c){if(_0x73759f[_0x5f1ece(0x116)](_0x28d83d)){_0x2ae999[_0x5f1ece(0xe6)]?.({'type':'embedded_segment_created','journeyName':_0x455cae['yamlConfig'][_0x5f1ece(0x10d)],'segmentName':_0x28d83d});continue;}const _0x4d1ff4=generateDeterministicJourneySegmentName(_0x455cae[_0x5f1ece(0xfd)][_0x5f1ece(0x10d)],_0x28d83d);_0x2ae999[_0x5f1ece(0xe6)]?.({'type':'embedded_segment_creating','journeyName':_0x455cae['yamlConfig']['name'],'segmentName':_0x28d83d});const _0x76c3a3=createSegmentIdResolver(_0x359644['segmentNameToId'],_0x28d83d),_0x1b9220=await resolveRuleSegmentIds(_0x5d47a1[_0x5f1ece(0x13c)],_0x76c3a3),_0x1a65d2=await createOrRecoverEmbeddedSegment(_0x7eeab7,_0x455cae,{'localName':_0x28d83d,'uniqueSegmentName':_0x4d1ff4,'description':_0x5d47a1[_0x5f1ece(0x164)]||'Entry\x20criteria:\x20'+_0x28d83d,'journeyId':_0x4141d0,'resolvedRule':_0x1b9220,'parentId':_0x3d5666[_0x5f1ece(0x1b7)],'folderId':_0x3d5666['effectiveFolderId']||''},_0x5ac024);_0x73759f[_0x5f1ece(0x187)](_0x28d83d,_0x1a65d2),_0x359644[_0x5f1ece(0x133)]['set'](_0x28d83d,_0x1a65d2),_0x2ae999[_0x5f1ece(0xe6)]?.({'type':_0x5f1ece(0xd4),'journeyName':_0x455cae['yamlConfig'][_0x5f1ece(0x10d)],'segmentName':_0x28d83d});}const _0x364c7d=new Map();for(const [_0x3904c5,_0xbe988d]of _0x440663){_0x2ae999['onProgress']?.({'type':_0x5f1ece(0x18b),'journeyName':_0x455cae[_0x5f1ece(0xfd)][_0x5f1ece(0x10d)],'activationName':_0x3904c5});const _0x3652c2=await _0x25a770(_0xbe988d,_0x359644['activationContext']),_0x373746={..._0x3652c2,..._0xbe988d[_0x5f1ece(0x192)]!==undefined&&{'runAfterJourneyRefresh':_0xbe988d[_0x5f1ece(0x192)]}},_0x1f754d=await _0x7eeab7[_0x5f1ece(0x13a)]['createActivation'](_0x4141d0,_0x373746);_0x364c7d['set'](_0x3904c5,_0x1f754d['id']),_0x362859[_0x5f1ece(0xe5)][_0x5f1ece(0x187)](_0x3904c5,_0x1f754d['id']),_0x2ae999[_0x5f1ece(0xe6)]?.({'type':'embedded_activation_created','journeyName':_0x455cae[_0x5f1ece(0xfd)][_0x5f1ece(0x10d)],'activationName':_0x3904c5});}const _0x2ea332=JSON[_0x5f1ece(0xfe)](JSON[_0x5f1ece(0x159)](_0x4eb28c));return _0x2ea332['id']=_0x4141d0,ensureJourneyDefaults(_0x2ea332[_0x5f1ece(0x186)]),resolvePendingIdsInRequest(_0x2ea332,_0x4eb28c,_0x28655b,_0x73759f,_0x364c7d,_0x2ae999),await _0x7eeab7['journey'][_0x5f1ece(0x182)](_0x4141d0,_0x2ea332),deletePushRecovery(_0x455cae[_0x5f1ece(0xd3)]),{'action':'created','journeyId':_0x4141d0,'embeddedSegmentNameToId':_0x73759f};}export function stripWaitStepPendingIds(_0x2ac8ce){const _0x1583e3=a151_0x4508fd,_0x13b044=_0x2ac8ce['conditionSegmentId']&&isPendingSegmentId(_0x2ac8ce[_0x1583e3(0x132)]),_0x1ec044=_0x2ac8ce[_0x1583e3(0x16d)]?.[_0x1583e3(0x199)](_0x240f6a=>_0x240f6a[_0x1583e3(0x189)]&&isPendingSegmentId(_0x240f6a[_0x1583e3(0x189)]));(_0x13b044||_0x1ec044)&&(_0x2ac8ce[_0x1583e3(0xd9)]=_0x1583e3(0x100),_0x2ac8ce['waitStep']=0x1,_0x2ac8ce[_0x1583e3(0xcb)]=_0x1583e3(0x135),delete _0x2ac8ce['conditionSegmentId'],delete _0x2ac8ce['conditionTimeoutDuration'],delete _0x2ac8ce[_0x1583e3(0xdd)],delete _0x2ac8ce[_0x1583e3(0x16d)]);}export function resolveWaitStepPendingIds(_0x717da5,_0x33e8fe,_0x30cabc,_0x1dc5ad){const _0x3212c3=a151_0x4508fd;if(_0x33e8fe[_0x3212c3(0x132)]&&isPendingSegmentId(_0x33e8fe['conditionSegmentId'])){const _0x59ef35=_0x30cabc(_0x33e8fe[_0x3212c3(0x132)],_0x3212c3(0x103)+_0x1dc5ad+_0x3212c3(0x1a0));_0x59ef35&&(_0x717da5[_0x3212c3(0xd9)]=_0x3212c3(0x173),_0x717da5['conditionSegmentId']=_0x59ef35,delete _0x717da5['waitStep'],delete _0x717da5[_0x3212c3(0xcb)],_0x33e8fe[_0x3212c3(0x1a9)]!==undefined&&(_0x717da5['conditionTimeoutDuration']=_0x33e8fe[_0x3212c3(0x1a9)]),_0x33e8fe[_0x3212c3(0xdd)]&&(_0x717da5[_0x3212c3(0xdd)]=_0x33e8fe[_0x3212c3(0xdd)]));}if(_0x33e8fe[_0x3212c3(0x16d)]){const _0x180158=_0x33e8fe[_0x3212c3(0x16d)][_0x3212c3(0x199)](_0x5f0a5b=>_0x5f0a5b['segmentId']&&isPendingSegmentId(_0x5f0a5b[_0x3212c3(0x189)]));if(_0x180158){const _0x2f2624=_0x33e8fe[_0x3212c3(0x16d)][_0x3212c3(0x1ac)](_0x498376=>{const _0x478a90=_0x3212c3;if(_0x498376[_0x478a90(0x189)]&&isPendingSegmentId(_0x498376[_0x478a90(0x189)])){const _0x1687c3=_0x30cabc(_0x498376[_0x478a90(0x189)],_0x478a90(0x103)+_0x1dc5ad+_0x478a90(0x1a0));return{..._0x498376,'segmentId':_0x1687c3||_0x498376[_0x478a90(0x189)]};}return{..._0x498376};});_0x717da5[_0x3212c3(0xd9)]=_0x3212c3(0x173),_0x717da5[_0x3212c3(0x16d)]=_0x2f2624,delete _0x717da5['waitStep'],delete _0x717da5['waitStepUnit'],delete _0x717da5[_0x3212c3(0x132)],delete _0x717da5[_0x3212c3(0x1a9)],delete _0x717da5[_0x3212c3(0xdd)];}}}function stripPendingIds(_0x12b6fd){const _0x3c015a=a151_0x4508fd;_0x12b6fd['attributes'][_0x3c015a(0xef)]?.[_0x3c015a(0x189)]&&isPendingSegmentId(_0x12b6fd[_0x3c015a(0x186)][_0x3c015a(0xef)][_0x3c015a(0x189)])&&delete _0x12b6fd[_0x3c015a(0x186)][_0x3c015a(0xef)];for(const _0xdc10aa of _0x12b6fd[_0x3c015a(0x186)]['journeyStages']||[]){_0xdc10aa[_0x3c015a(0x1a6)]?.[_0x3c015a(0x189)]&&isPendingSegmentId(_0xdc10aa[_0x3c015a(0x1a6)]['segmentId'])&&delete _0xdc10aa[_0x3c015a(0x1a6)];_0xdc10aa[_0x3c015a(0x13b)]?.[_0x3c015a(0x189)]&&isPendingSegmentId(_0xdc10aa[_0x3c015a(0x13b)][_0x3c015a(0x189)])&&delete _0xdc10aa[_0x3c015a(0x13b)];_0xdc10aa[_0x3c015a(0x108)]&&(_0xdc10aa[_0x3c015a(0x108)]=_0xdc10aa['exitCriterias']['filter'](_0x31c2f5=>!_0x31c2f5[_0x3c015a(0x189)]||!isPendingSegmentId(_0x31c2f5[_0x3c015a(0x189)])));if(_0xdc10aa['steps'])for(const _0x106462 of Object[_0x3c015a(0x134)](_0xdc10aa[_0x3c015a(0x17a)])){const _0x2f2206=_0xdc10aa[_0x3c015a(0x17a)][_0x106462];_0x2f2206[_0x3c015a(0x149)]==='Activation'&&_0x2f2206['journeyActivationStepId']&&isPendingActivationId(_0x2f2206[_0x3c015a(0x136)])&&(_0x2f2206[_0x3c015a(0x136)]='');if(_0x2f2206[_0x3c015a(0x149)]===_0x3c015a(0x13f)&&_0x2f2206[_0x3c015a(0x141)])for(const _0x49764d of _0x2f2206[_0x3c015a(0x141)]){_0x49764d[_0x3c015a(0x189)]&&isPendingSegmentId(_0x49764d[_0x3c015a(0x189)])&&(_0x49764d[_0x3c015a(0x189)]='');}_0x2f2206[_0x3c015a(0x149)]==='WaitStep'&&stripWaitStepPendingIds(_0x2f2206);}}}function resolvePendingIdsInRequest(_0x2db828,_0x210341,_0x416e17,_0x11ce15,_0x5871fc,_0x18b8c5){const _0x1c58db=a151_0x4508fd,_0x5b910b=(_0x154aee,_0x2316b3)=>{const _0xf7cd6a=a151_0x2980;if(!isPendingSegmentId(_0x154aee))return _0x154aee;const _0x428605=extractPendingSegmentName(_0x154aee),_0x10ffea=_0x11ce15[_0xf7cd6a(0x193)](_0x428605);return!_0x10ffea&&_0x18b8c5[_0xf7cd6a(0x153)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x428605+'\x27\x20for\x20'+_0x2316b3),_0x10ffea;};if(_0x2db828['attributes']['goal']?.[_0x1c58db(0x189)]&&isPendingSegmentId(_0x2db828[_0x1c58db(0x186)][_0x1c58db(0xef)]['segmentId'])){const _0x2dd3de=_0x5b910b(_0x2db828['attributes'][_0x1c58db(0xef)]['segmentId'],'goal\x20criteria');_0x2dd3de&&(_0x2db828[_0x1c58db(0x186)]['goal'][_0x1c58db(0x189)]=_0x2dd3de);}for(const _0x23b221 of _0x2db828[_0x1c58db(0x186)][_0x1c58db(0x15d)]||[]){const _0x1f74e3=_0x416e17[_0x1c58db(0x193)](_0x23b221[_0x1c58db(0x10d)][_0x1c58db(0x104)]());_0x1f74e3&&(_0x23b221['id']=_0x1f74e3);if(_0x23b221[_0x1c58db(0x1a6)]?.['segmentId']&&isPendingSegmentId(_0x23b221[_0x1c58db(0x1a6)][_0x1c58db(0x189)])){const _0x2bb7ce=_0x5b910b(_0x23b221[_0x1c58db(0x1a6)][_0x1c58db(0x189)],_0x1c58db(0x103)+_0x23b221[_0x1c58db(0x10d)]+_0x1c58db(0x125));_0x2bb7ce&&(_0x23b221[_0x1c58db(0x1a6)][_0x1c58db(0x189)]=_0x2bb7ce);}if(_0x23b221[_0x1c58db(0x108)])for(const _0x50219a of _0x23b221[_0x1c58db(0x108)]){if(_0x50219a[_0x1c58db(0x189)]&&isPendingSegmentId(_0x50219a[_0x1c58db(0x189)])){const _0x5c3342=_0x5b910b(_0x50219a['segmentId'],_0x1c58db(0x103)+_0x23b221['name']+_0x1c58db(0x188));_0x5c3342&&(_0x50219a[_0x1c58db(0x189)]=_0x5c3342);}}if(_0x23b221['milestone']?.['segmentId']&&isPendingSegmentId(_0x23b221[_0x1c58db(0x13b)][_0x1c58db(0x189)])){const _0x263a4e=_0x5b910b(_0x23b221[_0x1c58db(0x13b)][_0x1c58db(0x189)],_0x1c58db(0x103)+_0x23b221[_0x1c58db(0x10d)]+'\x27\x20milestone');_0x263a4e&&(_0x23b221[_0x1c58db(0x13b)][_0x1c58db(0x189)]=_0x263a4e);}if(_0x23b221[_0x1c58db(0x17a)]){const _0x28622d=_0x349835=>_0x210341[_0x1c58db(0x186)][_0x1c58db(0x15d)]?.[_0x1c58db(0x143)](_0xf66d6d=>_0xf66d6d['name']['toLowerCase']()===_0x23b221[_0x1c58db(0x10d)][_0x1c58db(0x104)]())?.[_0x1c58db(0x17a)]?.[_0x349835];for(const _0x5b1d11 of Object[_0x1c58db(0x134)](_0x23b221[_0x1c58db(0x17a)])){const _0xa50ba9=_0x23b221['steps'][_0x5b1d11],_0x42fcf6=_0x28622d(_0x5b1d11);if(_0xa50ba9[_0x1c58db(0x149)]===_0x1c58db(0x123)&&_0xa50ba9[_0x1c58db(0x136)]&&(isPendingActivationId(_0xa50ba9[_0x1c58db(0x136)])||_0xa50ba9['journeyActivationStepId']==='')){if(_0x42fcf6?.[_0x1c58db(0x136)]&&isPendingActivationId(_0x42fcf6[_0x1c58db(0x136)])){const _0x277271=extractPendingActivationName(_0x42fcf6[_0x1c58db(0x136)]),_0x4319ba=_0x5871fc[_0x1c58db(0x193)](_0x277271);_0x4319ba&&(_0xa50ba9['journeyActivationStepId']=_0x4319ba);}}if(_0xa50ba9[_0x1c58db(0x149)]===_0x1c58db(0x13f)&&_0xa50ba9[_0x1c58db(0x141)]&&_0x42fcf6?.[_0x1c58db(0x141)])for(let _0x4b7d95=0x0;_0x4b7d95<_0xa50ba9['branches'][_0x1c58db(0x117)];_0x4b7d95++){const _0x2527ad=_0xa50ba9[_0x1c58db(0x141)][_0x4b7d95],_0x2c76a4=_0x42fcf6[_0x1c58db(0x141)][_0x4b7d95];if(_0x2c76a4?.[_0x1c58db(0x189)]&&isPendingSegmentId(_0x2c76a4[_0x1c58db(0x189)])){const _0x1965fe=_0x5b910b(_0x2c76a4['segmentId'],_0x1c58db(0x103)+_0x23b221[_0x1c58db(0x10d)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2527ad[_0x1c58db(0x10d)]||_0x4b7d95)+'\x27');_0x1965fe&&(_0x2527ad[_0x1c58db(0x189)]=_0x1965fe);}}_0xa50ba9[_0x1c58db(0x149)]===_0x1c58db(0x12b)&&_0x42fcf6?.[_0x1c58db(0x149)]===_0x1c58db(0x12b)&&resolveWaitStepPendingIds(_0xa50ba9,_0x42fcf6,_0x5b910b,_0x23b221['name']);}}}}
@@ -1 +1 @@
1
- (function(_0x5a1158,_0x1515b1){const _0x574a50=a153_0x47fa,_0x3bfe93=_0x5a1158();while(!![]){try{const _0x4f7577=parseInt(_0x574a50(0xff))/0x1+-parseInt(_0x574a50(0x103))/0x2*(parseInt(_0x574a50(0xfb))/0x3)+-parseInt(_0x574a50(0x102))/0x4+-parseInt(_0x574a50(0xf6))/0x5+-parseInt(_0x574a50(0xf8))/0x6*(parseInt(_0x574a50(0x105))/0x7)+parseInt(_0x574a50(0xf7))/0x8*(-parseInt(_0x574a50(0x100))/0x9)+parseInt(_0x574a50(0xf9))/0xa;if(_0x4f7577===_0x1515b1)break;else _0x3bfe93['push'](_0x3bfe93['shift']());}catch(_0x2786a3){_0x3bfe93['push'](_0x3bfe93['shift']());}}}(a153_0x50bd,0x8c976));function a153_0x47fa(_0x14cb86,_0x40b4a1){_0x14cb86=_0x14cb86-0xf6;const _0x50bdd9=a153_0x50bd();let _0x47fadb=_0x50bdd9[_0x14cb86];return _0x47fadb;}export function buildFolderIdToPathMap(_0x2b8b08){const _0x52fdcb=a153_0x47fa,_0x39b603=new Map(),_0x588dcf=new Map();for(const _0x3bed59 of _0x2b8b08){_0x588dcf['set'](_0x3bed59['id'],_0x3bed59);}const _0x14490b=new Set();for(const _0x59e904 of _0x2b8b08){!_0x59e904[_0x52fdcb(0xfa)]&&_0x14490b[_0x52fdcb(0xfd)](_0x59e904['id']);}function _0x2793f8(_0x30630c){const _0x1fb4e4=_0x52fdcb;if(_0x39b603[_0x1fb4e4(0x101)](_0x30630c['id']))return _0x39b603[_0x1fb4e4(0xfc)](_0x30630c['id']);if(_0x14490b[_0x1fb4e4(0x101)](_0x30630c['id']))return _0x39b603[_0x1fb4e4(0x104)](_0x30630c['id'],''),'';if(_0x30630c[_0x1fb4e4(0xfa)]){const _0x3dae1a=_0x588dcf[_0x1fb4e4(0xfc)](_0x30630c[_0x1fb4e4(0xfa)]);if(_0x3dae1a){const _0xb2a164=_0x2793f8(_0x3dae1a),_0x396a75=_0xb2a164?_0xb2a164+'/'+_0x30630c[_0x1fb4e4(0xfe)]:_0x30630c[_0x1fb4e4(0xfe)];return _0x39b603[_0x1fb4e4(0x104)](_0x30630c['id'],_0x396a75),_0x396a75;}}const _0x268194=_0x30630c['name'];return _0x39b603['set'](_0x30630c['id'],_0x268194),_0x268194;}for(const _0x4e429c of _0x2b8b08){_0x2793f8(_0x4e429c);}return _0x39b603;}function a153_0x50bd(){const _0x268ad5=['5778794LngrtJ','4164710slIEou','128HKGDmg','6mZjPJt','24036820fwSWNs','parentFolderId','2859iCHOYU','get','add','name','1024477PPtlRZ','217395vsDzGC','has','366520XIYdlK','1502QWOwSv','set'];a153_0x50bd=function(){return _0x268ad5;};return a153_0x50bd();}export function buildFolderPathToIdMap(_0x109c2b){const _0x41028a=a153_0x47fa,_0x4ad673=new Map(),_0x10e06d=new Map();for(const _0x183cfb of _0x109c2b){_0x10e06d[_0x41028a(0x104)](_0x183cfb['id'],_0x183cfb);}const _0x52ae39=new Set();for(const _0x42f427 of _0x109c2b){!_0x42f427[_0x41028a(0xfa)]&&_0x52ae39[_0x41028a(0xfd)](_0x42f427['id']);}function _0x1b08c9(_0x56ab9e){const _0x25fe28=_0x41028a;if(_0x52ae39[_0x25fe28(0x101)](_0x56ab9e['id']))return'';if(_0x56ab9e['parentFolderId']){const _0x467b27=_0x10e06d[_0x25fe28(0xfc)](_0x56ab9e[_0x25fe28(0xfa)]);if(_0x467b27){const _0x14111f=_0x1b08c9(_0x467b27);return _0x14111f?_0x14111f+'/'+_0x56ab9e[_0x25fe28(0xfe)]:_0x56ab9e[_0x25fe28(0xfe)];}}return _0x56ab9e[_0x25fe28(0xfe)];}for(const _0x2ac97b of _0x109c2b){const _0x401cad=_0x1b08c9(_0x2ac97b);_0x4ad673[_0x41028a(0x104)](_0x401cad,_0x2ac97b['id']);}return _0x4ad673;}export function buildFolderMaps(_0x7a78aa){const _0x382789=a153_0x47fa,_0x12a23e=buildFolderIdToPathMap(_0x7a78aa),_0x4faa14=new Map();for(const [_0x548361,_0x20c53d]of _0x12a23e){_0x4faa14[_0x382789(0x104)](_0x20c53d,_0x548361);}return{'idToPath':_0x12a23e,'pathToId':_0x4faa14};}export function getFolderPath(_0x12fcb7,_0x5e8440){const _0x382c7f=a153_0x47fa;if(!_0x12fcb7)return'';return _0x5e8440[_0x382c7f(0xfc)](_0x12fcb7)??'';}
1
+ (function(_0x41150f,_0x207576){const _0x4ea7bb=a152_0x3b92,_0x5dba5f=_0x41150f();while(!![]){try{const _0x5bedb5=parseInt(_0x4ea7bb(0x70))/0x1+-parseInt(_0x4ea7bb(0x66))/0x2+-parseInt(_0x4ea7bb(0x6d))/0x3*(parseInt(_0x4ea7bb(0x73))/0x4)+parseInt(_0x4ea7bb(0x67))/0x5+-parseInt(_0x4ea7bb(0x6e))/0x6*(-parseInt(_0x4ea7bb(0x65))/0x7)+-parseInt(_0x4ea7bb(0x64))/0x8*(parseInt(_0x4ea7bb(0x6b))/0x9)+-parseInt(_0x4ea7bb(0x68))/0xa*(-parseInt(_0x4ea7bb(0x74))/0xb);if(_0x5bedb5===_0x207576)break;else _0x5dba5f['push'](_0x5dba5f['shift']());}catch(_0x20873a){_0x5dba5f['push'](_0x5dba5f['shift']());}}}(a152_0x3dbb,0x27541));export function buildFolderIdToPathMap(_0x55d3cc){const _0x1da8a1=a152_0x3b92,_0x4bd36e=new Map(),_0x3abc49=new Map();for(const _0xde4d05 of _0x55d3cc){_0x3abc49[_0x1da8a1(0x6a)](_0xde4d05['id'],_0xde4d05);}const _0x29b636=new Set();for(const _0x5dcf3c of _0x55d3cc){!_0x5dcf3c[_0x1da8a1(0x6f)]&&_0x29b636['add'](_0x5dcf3c['id']);}function _0x208f57(_0x462675){const _0x33527f=_0x1da8a1;if(_0x4bd36e['has'](_0x462675['id']))return _0x4bd36e[_0x33527f(0x6c)](_0x462675['id']);if(_0x29b636[_0x33527f(0x71)](_0x462675['id']))return _0x4bd36e[_0x33527f(0x6a)](_0x462675['id'],''),'';if(_0x462675['parentFolderId']){const _0x576c8a=_0x3abc49[_0x33527f(0x6c)](_0x462675[_0x33527f(0x6f)]);if(_0x576c8a){const _0x1303e6=_0x208f57(_0x576c8a),_0x5e6012=_0x1303e6?_0x1303e6+'/'+_0x462675[_0x33527f(0x69)]:_0x462675['name'];return _0x4bd36e[_0x33527f(0x6a)](_0x462675['id'],_0x5e6012),_0x5e6012;}}const _0x471043=_0x462675[_0x33527f(0x69)];return _0x4bd36e[_0x33527f(0x6a)](_0x462675['id'],_0x471043),_0x471043;}for(const _0x591ddc of _0x55d3cc){_0x208f57(_0x591ddc);}return _0x4bd36e;}function a152_0x3b92(_0x1b82e3,_0x381e6b){_0x1b82e3=_0x1b82e3-0x64;const _0x3dbb97=a152_0x3dbb();let _0x3b9265=_0x3dbb97[_0x1b82e3];return _0x3b9265;}export function buildFolderPathToIdMap(_0x53505c){const _0x1d7b88=a152_0x3b92,_0x2fd8c6=new Map(),_0x299087=new Map();for(const _0xd23008 of _0x53505c){_0x299087['set'](_0xd23008['id'],_0xd23008);}const _0x33fb6a=new Set();for(const _0x570101 of _0x53505c){!_0x570101[_0x1d7b88(0x6f)]&&_0x33fb6a[_0x1d7b88(0x72)](_0x570101['id']);}function _0x23d09c(_0x5f5448){const _0x5e1780=_0x1d7b88;if(_0x33fb6a[_0x5e1780(0x71)](_0x5f5448['id']))return'';if(_0x5f5448[_0x5e1780(0x6f)]){const _0x45a362=_0x299087[_0x5e1780(0x6c)](_0x5f5448[_0x5e1780(0x6f)]);if(_0x45a362){const _0x391074=_0x23d09c(_0x45a362);return _0x391074?_0x391074+'/'+_0x5f5448[_0x5e1780(0x69)]:_0x5f5448['name'];}}return _0x5f5448[_0x5e1780(0x69)];}for(const _0x2c01f1 of _0x53505c){const _0x391f5d=_0x23d09c(_0x2c01f1);_0x2fd8c6[_0x1d7b88(0x6a)](_0x391f5d,_0x2c01f1['id']);}return _0x2fd8c6;}export function buildFolderMaps(_0x5569b0){const _0x255109=a152_0x3b92,_0x3e8df1=buildFolderIdToPathMap(_0x5569b0),_0x409909=new Map();for(const [_0x390597,_0x238586]of _0x3e8df1){_0x409909[_0x255109(0x6a)](_0x238586,_0x390597);}return{'idToPath':_0x3e8df1,'pathToId':_0x409909};}export function getFolderPath(_0xa696ef,_0x2123f2){const _0xafb1bc=a152_0x3b92;if(!_0xa696ef)return'';return _0x2123f2[_0xafb1bc(0x6c)](_0xa696ef)??'';}function a152_0x3dbb(){const _0x55b54d=['add','234400dnRWue','1573693bENNzM','7624lQvMwy','643321QjZdfg','2614FfsIiL','179335fYvYnS','10Rktzrq','name','set','306cAWhQY','get','15wLLexL','12cJvRRr','parentFolderId','125062UAZttk','has'];a152_0x3dbb=function(){return _0x55b54d;};return a152_0x3dbb();}
@@ -1 +1 @@
1
- function a154_0x533b(_0x384e3a,_0x5d4a96){_0x384e3a=_0x384e3a-0xf6;const _0xab92af=a154_0xab92();let _0x533b07=_0xab92af[_0x384e3a];return _0x533b07;}(function(_0x3974f6,_0x3cfd34){const _0x2170f9=a154_0x533b,_0x552342=_0x3974f6();while(!![]){try{const _0x376426=-parseInt(_0x2170f9(0x10b))/0x1*(parseInt(_0x2170f9(0x101))/0x2)+-parseInt(_0x2170f9(0x117))/0x3*(-parseInt(_0x2170f9(0x11b))/0x4)+parseInt(_0x2170f9(0x106))/0x5+parseInt(_0x2170f9(0x127))/0x6*(-parseInt(_0x2170f9(0x123))/0x7)+parseInt(_0x2170f9(0x102))/0x8*(-parseInt(_0x2170f9(0xf7))/0x9)+-parseInt(_0x2170f9(0x10f))/0xa*(parseInt(_0x2170f9(0x114))/0xb)+parseInt(_0x2170f9(0xfd))/0xc;if(_0x376426===_0x3cfd34)break;else _0x552342['push'](_0x552342['shift']());}catch(_0x2546a6){_0x552342['push'](_0x552342['shift']());}}}(a154_0xab92,0x4f912));import a154_0x522b0c from'path';import{parse as a154_0x23a388}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x4d8b98){const _0x233c13=a154_0x533b;if(!_0x4d8b98||_0x4d8b98['trim']()==='')throw new Error(_0x233c13(0x120));const _0x398e61=_0x4d8b98[_0x233c13(0x112)]();if(_0x398e61==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4d8b98};const _0x3f3034=_0x398e61[_0x233c13(0x110)]('/')?_0x398e61[_0x233c13(0x128)](0x1):_0x398e61,_0x3fff0f=_0x3f3034['split']('/')['filter'](_0x3fd34e=>_0x3fd34e!=='');if(_0x3fff0f[_0x233c13(0x10c)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x178b9=_0x398e61[_0x233c13(0x110)]('/')||!isRelativePathSegment(_0x3fff0f[0x0]);for(const _0x30e6d8 of _0x3fff0f){validatePathSegment(_0x30e6d8);}return{'segments':_0x3fff0f,'isAbsolute':_0x178b9,'raw':_0x4d8b98};}function isRelativePathSegment(_0x1806e3){return _0x1806e3==='.'||_0x1806e3==='..';}function validatePathSegment(_0x53bcdf){const _0x3e39c3=a154_0x533b;if(_0x53bcdf==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x53bcdf==='.'||_0x53bcdf==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x53bcdf))throw new Error(_0x3e39c3(0x124)+_0x53bcdf);if(_0x53bcdf!==_0x53bcdf['trim']()){}}export function validatePath(_0x38f9e8){const _0xc9e926=a154_0x533b;if(_0x38f9e8[_0xc9e926(0x11d)][_0xc9e926(0x10c)]===0x0&&!_0x38f9e8[_0xc9e926(0x108)])throw new Error(_0xc9e926(0x11a));if(_0x38f9e8[_0xc9e926(0x108)]){if(_0x38f9e8[_0xc9e926(0x11d)][0x0]==='..')throw new Error(_0xc9e926(0xfe));let _0x8c9c9a=0x0;for(const _0xe8b61 of _0x38f9e8['segments']){if(_0xe8b61==='..'){if(_0x8c9c9a===0x0)throw new Error(_0xc9e926(0xfb));_0x8c9c9a--;}else _0xe8b61!=='.'&&_0x8c9c9a++;}}}export function joinPaths(_0x1624ae,_0x1a327b){const _0x172d51=a154_0x533b;if(!_0x1624ae||_0x1624ae==='/')return _0x1a327b;if(!_0x1a327b||_0x1a327b==='.')return _0x1624ae;if(_0x1a327b[_0x172d51(0x110)]('/'))return _0x1a327b;const _0x4d447d=parsePath(_0x1624ae),_0x330aec=parsePath(_0x1a327b),_0x169435=[..._0x4d447d['segments']];for(const _0xf2024f of _0x330aec['segments']){if(_0xf2024f==='.')continue;else{if(_0xf2024f==='..'){if(_0x169435['length']===0x0)throw new Error(_0x172d51(0x116));_0x169435[_0x172d51(0x107)]();}else _0x169435[_0x172d51(0x11f)](_0xf2024f);}}const _0xc31d90=_0x169435[_0x172d51(0x121)]('/');return _0x4d447d[_0x172d51(0x115)][_0x172d51(0x110)]('/')?'/'+_0xc31d90:_0xc31d90;}function a154_0xab92(){const _0x3b5996=['837133anlVBo','raw','Cannot\x20navigate\x20above\x20root','643407PLwmNE','No\x20tdx.json\x20found\x20for\x20file:\x20','type','Relative\x20path\x20cannot\x20be\x20empty','4RQhDDI','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','segments','parse','push','Path\x20cannot\x20be\x20empty','join','File\x20not\x20found:\x20','7bcSxiB','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','segment','root','2394534qSExbF','substring','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','538506TZnhjF','replace','.yml','slice','Path\x20attempts\x20to\x20navigate\x20above\x20root','journey','3480588GWJevs','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','resolve','tdx.json','272206vkMZYO','16MrcHEE','parent_segment','dirname','exists','2761755bShmGm','pop','isAbsolute','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','endsWith','1dAlvpx','length','.yaml','relative','10CBvBGu','startsWith','readFile','trim','name'];a154_0xab92=function(){return _0x3b5996;};return a154_0xab92();}export function normalizePath(_0x3680f9){const _0x344a78=a154_0x533b,_0x1fee79=parsePath(_0x3680f9),_0x2d61ac=[];for(const _0x18c89f of _0x1fee79[_0x344a78(0x11d)]){if(_0x18c89f==='.')continue;else{if(_0x18c89f==='..'){if(_0x2d61ac[_0x344a78(0x10c)]===0x0){if(_0x1fee79[_0x344a78(0x108)])throw new Error(_0x344a78(0x116));_0x2d61ac[_0x344a78(0x11f)]('..');}else _0x2d61ac[_0x2d61ac[_0x344a78(0x10c)]-0x1]==='..'?_0x2d61ac[_0x344a78(0x11f)]('..'):_0x2d61ac['pop']();}else _0x2d61ac[_0x344a78(0x11f)](_0x18c89f);}}if(_0x2d61ac['length']===0x0)return _0x1fee79[_0x344a78(0x108)]?'/':'.';const _0x39c3da=_0x2d61ac[_0x344a78(0x121)]('/');return _0x1fee79[_0x344a78(0x115)][_0x344a78(0x110)]('/')?'/'+_0x39c3da:_0x39c3da;}export function getParentPath(_0x491a11){const _0x3ddf4f=a154_0x533b,_0x548986=parsePath(_0x491a11);if(_0x548986['segments'][_0x3ddf4f(0x10c)]<=0x1)return'/';const _0x208ac2=_0x548986[_0x3ddf4f(0x11d)][_0x3ddf4f(0xfa)](0x0,-0x1)['join']('/');return _0x548986[_0x3ddf4f(0x115)][_0x3ddf4f(0x110)]('/')?'/'+_0x208ac2:_0x208ac2;}export function getBaseName(_0x5c412f){const _0x1f01a6=a154_0x533b,_0x5d06f9=parsePath(_0x5c412f);return _0x5d06f9[_0x1f01a6(0x11d)][_0x5d06f9[_0x1f01a6(0x11d)][_0x1f01a6(0x10c)]-0x1]||'';}export function isChildPath(_0x468a74,_0x17b192){const _0x2ace28=a154_0x533b,_0x4ef66c=parsePath(_0x468a74),_0x4a0161=parsePath(_0x17b192);if(_0x4ef66c['segments'][_0x2ace28(0x10c)]<=_0x4a0161['segments'][_0x2ace28(0x10c)])return![];for(let _0x135ba1=0x0;_0x135ba1<_0x4a0161[_0x2ace28(0x11d)][_0x2ace28(0x10c)];_0x135ba1++){if(_0x4ef66c[_0x2ace28(0x11d)][_0x135ba1]!==_0x4a0161['segments'][_0x135ba1])return![];}return!![];}export function splitPath(_0x2a4138){const _0x964248=a154_0x533b,_0x347605=parsePath(_0x2a4138);if(_0x347605[_0x964248(0x11d)][_0x964248(0x10c)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x347605[_0x964248(0x11d)][_0x964248(0x10c)]===0x1)return{'parent':_0x347605[_0x964248(0x11d)][0x0]};return{'parent':_0x347605[_0x964248(0x11d)][0x0],'child':_0x347605[_0x964248(0x11d)][_0x964248(0xfa)](0x1)['join']('/')};}export function isYamlFilePath(_0x4d5738){const _0x1923ad=a154_0x533b;return _0x4d5738['endsWith'](_0x1923ad(0xf9))||_0x4d5738[_0x1923ad(0x10a)](_0x1923ad(0x10d));}export async function resolveYamlFilePath(_0x3e12f0,_0x1ff209=nodeFileSystem){const _0x45d050=a154_0x533b,_0x10fb6e=a154_0x522b0c[_0x45d050(0xff)](_0x3e12f0);if(!await _0x1ff209[_0x45d050(0x105)](_0x10fb6e))throw new Error(_0x45d050(0x122)+_0x3e12f0);let _0x435201=a154_0x522b0c['dirname'](_0x10fb6e),_0x4524be=null,_0x5e8782=null;const _0x179697=a154_0x522b0c['parse'](_0x435201)[_0x45d050(0x126)];while(_0x435201!==_0x179697){const _0x14718e=a154_0x522b0c[_0x45d050(0x121)](_0x435201,_0x45d050(0x100));if(await _0x1ff209[_0x45d050(0x105)](_0x14718e)){_0x4524be=_0x14718e,_0x5e8782=_0x435201;break;}_0x435201=a154_0x522b0c[_0x45d050(0x104)](_0x435201);}if(!_0x4524be||!_0x5e8782)throw new Error(_0x45d050(0x118)+_0x3e12f0+'\x0a'+_0x45d050(0x109));const _0x119417=await _0x1ff209[_0x45d050(0x111)](_0x4524be),_0x33fd36=JSON[_0x45d050(0x11e)](_0x119417),_0x2d33df=_0x33fd36[_0x45d050(0x103)];if(!_0x2d33df)throw new Error(_0x45d050(0xf6));const _0x4a85b7=await _0x1ff209['readFile'](_0x10fb6e),_0x5be24e=a154_0x23a388(_0x4a85b7),_0x576e8f=_0x5be24e[_0x45d050(0x113)];if(!_0x576e8f)throw new Error(_0x45d050(0x11c)+_0x3e12f0);const _0x38d360=_0x5be24e[_0x45d050(0x119)]===_0x45d050(0xfc)?_0x45d050(0xfc):_0x45d050(0x125),_0x81086=a154_0x522b0c[_0x45d050(0x10e)](_0x5e8782,_0x10fb6e),_0x22938a=a154_0x522b0c[_0x45d050(0x104)](_0x81086),_0x30da80=_0x22938a==='.'?'':_0x22938a[_0x45d050(0xf8)](/\\/g,'/'),_0x303457=_0x30da80?_0x2d33df+'/'+_0x30da80+'/'+_0x576e8f:_0x2d33df+'/'+_0x576e8f;return{'parentSegment':_0x2d33df,'segmentName':_0x576e8f,'folderPath':_0x30da80,'fullPath':_0x303457,'resourceType':_0x38d360,'content':_0x4a85b7};}
1
+ (function(_0x17f194,_0x3d34c0){const _0x52ef8c=a153_0x2373,_0x202d30=_0x17f194();while(!![]){try{const _0x27555f=parseInt(_0x52ef8c(0xe0))/0x1+-parseInt(_0x52ef8c(0x105))/0x2+parseInt(_0x52ef8c(0xe1))/0x3+parseInt(_0x52ef8c(0x102))/0x4*(-parseInt(_0x52ef8c(0x100))/0x5)+-parseInt(_0x52ef8c(0xfd))/0x6+-parseInt(_0x52ef8c(0xf7))/0x7*(parseInt(_0x52ef8c(0xfc))/0x8)+-parseInt(_0x52ef8c(0xdd))/0x9*(-parseInt(_0x52ef8c(0xed))/0xa);if(_0x27555f===_0x3d34c0)break;else _0x202d30['push'](_0x202d30['shift']());}catch(_0x3edd3b){_0x202d30['push'](_0x202d30['shift']());}}}(a153_0x4091,0x713cd));import a153_0x590a54 from'path';import{parse as a153_0x2cee9e}from'yaml';function a153_0x4091(){const _0x5c21c8=['48454JHxzpl','replace','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Path\x20attempts\x20to\x20navigate\x20above\x20root','segments','800DKlQii','1612014MltGRC','filter','dirname','403150tswAeA','length','4fZWrOj','parent_segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','462960vGSOXt','test','File\x20not\x20found:\x20','.yml','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','18261YIJeLk','journey','parse','261618witzBN','1424655gUcWRu','startsWith','Path\x20segment\x20cannot\x20be\x20empty','name','pop','push','endsWith','exists','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','join','tdx.json','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','4930OtNHEN','No\x20tdx.json\x20found\x20for\x20file:\x20','Cannot\x20navigate\x20above\x20root','trim','.yaml','Cannot\x20split\x20empty\x20path','raw','Relative\x20path\x20cannot\x20be\x20empty','split','isAbsolute'];a153_0x4091=function(){return _0x5c21c8;};return a153_0x4091();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5661bb){const _0x334e4e=a153_0x2373;if(!_0x5661bb||_0x5661bb['trim']()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0xc0622e=_0x5661bb[_0x334e4e(0xf0)]();if(_0xc0622e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5661bb};const _0xc38bd7=_0xc0622e['startsWith']('/')?_0xc0622e['substring'](0x1):_0xc0622e,_0x265ff5=_0xc38bd7[_0x334e4e(0xf5)]('/')[_0x334e4e(0xfe)](_0x14de23=>_0x14de23!=='');if(_0x265ff5[_0x334e4e(0x101)]===0x0)throw new Error(_0x334e4e(0x104));const _0x2e95f0=_0xc0622e['startsWith']('/')||!isRelativePathSegment(_0x265ff5[0x0]);for(const _0x1075e7 of _0x265ff5){validatePathSegment(_0x1075e7);}return{'segments':_0x265ff5,'isAbsolute':_0x2e95f0,'raw':_0x5661bb};}function isRelativePathSegment(_0x5d5fb3){return _0x5d5fb3==='.'||_0x5d5fb3==='..';}function a153_0x2373(_0x2c566f,_0xc0c5e7){_0x2c566f=_0x2c566f-0xdb;const _0x409129=a153_0x4091();let _0x237392=_0x409129[_0x2c566f];return _0x237392;}function validatePathSegment(_0x452bd3){const _0x3ebe9b=a153_0x2373;if(_0x452bd3==='')throw new Error(_0x3ebe9b(0xe3));if(_0x452bd3==='.'||_0x452bd3==='..')return;if(/[\x00-\x1F\x7F]/[_0x3ebe9b(0x106)](_0x452bd3))throw new Error(_0x3ebe9b(0xe9)+_0x452bd3);if(_0x452bd3!==_0x452bd3[_0x3ebe9b(0xf0)]()){}}export function validatePath(_0x489465){const _0x5a95a6=a153_0x2373;if(_0x489465['segments'][_0x5a95a6(0x101)]===0x0&&!_0x489465[_0x5a95a6(0xf6)])throw new Error(_0x5a95a6(0xf4));if(_0x489465[_0x5a95a6(0xf6)]){if(_0x489465[_0x5a95a6(0xfb)][0x0]==='..')throw new Error(_0x5a95a6(0xf9));let _0x3fadb3=0x0;for(const _0xcd332d of _0x489465['segments']){if(_0xcd332d==='..'){if(_0x3fadb3===0x0)throw new Error(_0x5a95a6(0xfa));_0x3fadb3--;}else _0xcd332d!=='.'&&_0x3fadb3++;}}}export function joinPaths(_0x87c464,_0x570cfd){const _0x1696b1=a153_0x2373;if(!_0x87c464||_0x87c464==='/')return _0x570cfd;if(!_0x570cfd||_0x570cfd==='.')return _0x87c464;if(_0x570cfd['startsWith']('/'))return _0x570cfd;const _0x4b741b=parsePath(_0x87c464),_0x5e13b4=parsePath(_0x570cfd),_0x2d9e9c=[..._0x4b741b['segments']];for(const _0x546b46 of _0x5e13b4['segments']){if(_0x546b46==='.')continue;else{if(_0x546b46==='..'){if(_0x2d9e9c['length']===0x0)throw new Error(_0x1696b1(0xef));_0x2d9e9c[_0x1696b1(0xe5)]();}else _0x2d9e9c[_0x1696b1(0xe6)](_0x546b46);}}const _0x55f6be=_0x2d9e9c[_0x1696b1(0xea)]('/');return _0x4b741b['raw'][_0x1696b1(0xe2)]('/')?'/'+_0x55f6be:_0x55f6be;}export function normalizePath(_0x593d5d){const _0x38d978=a153_0x2373,_0x105dd4=parsePath(_0x593d5d),_0x20f590=[];for(const _0x4f2427 of _0x105dd4[_0x38d978(0xfb)]){if(_0x4f2427==='.')continue;else{if(_0x4f2427==='..'){if(_0x20f590[_0x38d978(0x101)]===0x0){if(_0x105dd4[_0x38d978(0xf6)])throw new Error(_0x38d978(0xef));_0x20f590[_0x38d978(0xe6)]('..');}else _0x20f590[_0x20f590[_0x38d978(0x101)]-0x1]==='..'?_0x20f590[_0x38d978(0xe6)]('..'):_0x20f590[_0x38d978(0xe5)]();}else _0x20f590[_0x38d978(0xe6)](_0x4f2427);}}if(_0x20f590[_0x38d978(0x101)]===0x0)return _0x105dd4[_0x38d978(0xf6)]?'/':'.';const _0x1cb0ab=_0x20f590[_0x38d978(0xea)]('/');return _0x105dd4[_0x38d978(0xf3)][_0x38d978(0xe2)]('/')?'/'+_0x1cb0ab:_0x1cb0ab;}export function getParentPath(_0x4fb0c4){const _0xf82c4e=a153_0x2373,_0x3ee5c7=parsePath(_0x4fb0c4);if(_0x3ee5c7[_0xf82c4e(0xfb)][_0xf82c4e(0x101)]<=0x1)return'/';const _0x219bc8=_0x3ee5c7[_0xf82c4e(0xfb)]['slice'](0x0,-0x1)[_0xf82c4e(0xea)]('/');return _0x3ee5c7['raw'][_0xf82c4e(0xe2)]('/')?'/'+_0x219bc8:_0x219bc8;}export function getBaseName(_0x5a7625){const _0x13ad71=a153_0x2373,_0x2666a8=parsePath(_0x5a7625);return _0x2666a8[_0x13ad71(0xfb)][_0x2666a8[_0x13ad71(0xfb)][_0x13ad71(0x101)]-0x1]||'';}export function isChildPath(_0x360445,_0x4baa64){const _0x11343f=a153_0x2373,_0x3e6216=parsePath(_0x360445),_0x3d0499=parsePath(_0x4baa64);if(_0x3e6216[_0x11343f(0xfb)][_0x11343f(0x101)]<=_0x3d0499[_0x11343f(0xfb)]['length'])return![];for(let _0x3e8ede=0x0;_0x3e8ede<_0x3d0499['segments'][_0x11343f(0x101)];_0x3e8ede++){if(_0x3e6216[_0x11343f(0xfb)][_0x3e8ede]!==_0x3d0499[_0x11343f(0xfb)][_0x3e8ede])return![];}return!![];}export function splitPath(_0x5e42af){const _0x52a8fe=a153_0x2373,_0x33b180=parsePath(_0x5e42af);if(_0x33b180[_0x52a8fe(0xfb)][_0x52a8fe(0x101)]===0x0)throw new Error(_0x52a8fe(0xf2));if(_0x33b180[_0x52a8fe(0xfb)]['length']===0x1)return{'parent':_0x33b180[_0x52a8fe(0xfb)][0x0]};return{'parent':_0x33b180[_0x52a8fe(0xfb)][0x0],'child':_0x33b180[_0x52a8fe(0xfb)]['slice'](0x1)[_0x52a8fe(0xea)]('/')};}export function isYamlFilePath(_0x338f2e){const _0x597b4b=a153_0x2373;return _0x338f2e['endsWith'](_0x597b4b(0xdb))||_0x338f2e[_0x597b4b(0xe7)](_0x597b4b(0xf1));}export async function resolveYamlFilePath(_0xe580c7,_0x55ef2e=nodeFileSystem){const _0x39db3e=a153_0x2373,_0xae36c7=a153_0x590a54['resolve'](_0xe580c7);if(!await _0x55ef2e[_0x39db3e(0xe8)](_0xae36c7))throw new Error(_0x39db3e(0x107)+_0xe580c7);let _0x59a54d=a153_0x590a54[_0x39db3e(0xff)](_0xae36c7),_0x2e1e8e=null,_0x42a141=null;const _0xe55d9f=a153_0x590a54[_0x39db3e(0xdf)](_0x59a54d)['root'];while(_0x59a54d!==_0xe55d9f){const _0xc2028c=a153_0x590a54[_0x39db3e(0xea)](_0x59a54d,_0x39db3e(0xeb));if(await _0x55ef2e[_0x39db3e(0xe8)](_0xc2028c)){_0x2e1e8e=_0xc2028c,_0x42a141=_0x59a54d;break;}_0x59a54d=a153_0x590a54[_0x39db3e(0xff)](_0x59a54d);}if(!_0x2e1e8e||!_0x42a141)throw new Error(_0x39db3e(0xee)+_0xe580c7+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x42e751=await _0x55ef2e['readFile'](_0x2e1e8e),_0x50e5d0=JSON[_0x39db3e(0xdf)](_0x42e751),_0x249021=_0x50e5d0[_0x39db3e(0x103)];if(!_0x249021)throw new Error(_0x39db3e(0xdc));const _0x101fdf=await _0x55ef2e['readFile'](_0xae36c7),_0x286731=a153_0x2cee9e(_0x101fdf),_0x3eec46=_0x286731[_0x39db3e(0xe4)];if(!_0x3eec46)throw new Error(_0x39db3e(0xec)+_0xe580c7);const _0xd79041=_0x286731['type']==='journey'?_0x39db3e(0xde):'segment',_0x177066=a153_0x590a54['relative'](_0x42a141,_0xae36c7),_0x3f0739=a153_0x590a54[_0x39db3e(0xff)](_0x177066),_0x28e358=_0x3f0739==='.'?'':_0x3f0739[_0x39db3e(0xf8)](/\\/g,'/'),_0xbb794e=_0x28e358?_0x249021+'/'+_0x28e358+'/'+_0x3eec46:_0x249021+'/'+_0x3eec46;return{'parentSegment':_0x249021,'segmentName':_0x3eec46,'folderPath':_0x28e358,'fullPath':_0xbb794e,'resourceType':_0xd79041,'content':_0x101fdf};}
@@ -1 +1 @@
1
- (function(_0x3a2828,_0x32f1fb){const _0x157623=a155_0x4eb6,_0x8783b9=_0x3a2828();while(!![]){try{const _0x50d7c3=parseInt(_0x157623(0xb8))/0x1*(parseInt(_0x157623(0xb7))/0x2)+parseInt(_0x157623(0xae))/0x3*(-parseInt(_0x157623(0xb3))/0x4)+-parseInt(_0x157623(0xba))/0x5*(parseInt(_0x157623(0xb2))/0x6)+parseInt(_0x157623(0xb4))/0x7*(parseInt(_0x157623(0xac))/0x8)+-parseInt(_0x157623(0xb9))/0x9*(parseInt(_0x157623(0xbb))/0xa)+parseInt(_0x157623(0xb5))/0xb+parseInt(_0x157623(0xb6))/0xc;if(_0x50d7c3===_0x32f1fb)break;else _0x8783b9['push'](_0x8783b9['shift']());}catch(_0xecf252){_0x8783b9['push'](_0x8783b9['shift']());}}}(a155_0x9b8c,0xa3a0d));export function parseSegmentRef(_0x487a19){const _0x133793=a155_0x4eb6,_0x104f0c=_0x487a19['indexOf']('/');if(_0x104f0c===-0x1)return{'parentId':_0x487a19};if(_0x104f0c===0x0)throw new Error(_0x133793(0xb1)+_0x487a19+_0x133793(0xaf));const _0x308846=_0x487a19[_0x133793(0xb0)](0x0,_0x104f0c),_0xc0f2df=_0x487a19[_0x133793(0xb0)](_0x104f0c+0x1);if(_0xc0f2df==='')throw new Error(_0x133793(0xb1)+_0x487a19+_0x133793(0xad));return{'parentId':_0x308846,'childId':_0xc0f2df};}function a155_0x4eb6(_0x1666af,_0x214a58){_0x1666af=_0x1666af-0xac;const _0x9b8cd6=a155_0x9b8c();let _0x4eb6d0=_0x9b8cd6[_0x1666af];return _0x4eb6d0;}function a155_0x9b8c(){const _0x2c3fee=['Invalid\x20segment\x20reference\x20format:\x20','198246uGTSZy','23948VPrmUT','3535dvSrxe','6388008aMCcIl','7809552vpLtRm','274954GZTEBG','1NyivDT','297JafPSu','55SYRnmL','131050HxhMfF','5048Depfho','.\x20Child\x20name\x20cannot\x20be\x20empty','111kmUuLe','.\x20Parent\x20name\x20cannot\x20be\x20empty','substring'];a155_0x9b8c=function(){return _0x2c3fee;};return a155_0x9b8c();}
1
+ function a154_0x133e(){const _0x44110e=['9932188qFJYYA','indexOf','4186497GQRRaj','4JfUEDG','103346tNwFpa','39700080sCnulF','8JVkZix','11139894OYmGTi','.\x20Child\x20name\x20cannot\x20be\x20empty','8277830cHJPHP','20yNoPJb','3996042LfIYPY','substring'];a154_0x133e=function(){return _0x44110e;};return a154_0x133e();}(function(_0x4ac217,_0x11ed52){const _0x2aa1e0=a154_0x2990,_0x3b4f8c=_0x4ac217();while(!![]){try{const _0x42029a=-parseInt(_0x2aa1e0(0xb4))/0x1*(-parseInt(_0x2aa1e0(0xae))/0x2)+parseInt(_0x2aa1e0(0xac))/0x3*(parseInt(_0x2aa1e0(0xad))/0x4)+parseInt(_0x2aa1e0(0xb3))/0x5+parseInt(_0x2aa1e0(0xb5))/0x6+parseInt(_0x2aa1e0(0xaa))/0x7*(parseInt(_0x2aa1e0(0xb0))/0x8)+-parseInt(_0x2aa1e0(0xb1))/0x9+-parseInt(_0x2aa1e0(0xaf))/0xa;if(_0x42029a===_0x11ed52)break;else _0x3b4f8c['push'](_0x3b4f8c['shift']());}catch(_0x2a33f8){_0x3b4f8c['push'](_0x3b4f8c['shift']());}}}(a154_0x133e,0xeac6a));function a154_0x2990(_0x4672f5,_0x1f9166){_0x4672f5=_0x4672f5-0xa9;const _0x133e1e=a154_0x133e();let _0x2990d1=_0x133e1e[_0x4672f5];return _0x2990d1;}export function parseSegmentRef(_0x4dafcd){const _0x1ef78c=a154_0x2990,_0x48733f=_0x4dafcd[_0x1ef78c(0xab)]('/');if(_0x48733f===-0x1)return{'parentId':_0x4dafcd};if(_0x48733f===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4dafcd+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x558e38=_0x4dafcd[_0x1ef78c(0xa9)](0x0,_0x48733f),_0x5c955b=_0x4dafcd['substring'](_0x48733f+0x1);if(_0x5c955b==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x4dafcd+_0x1ef78c(0xb2));return{'parentId':_0x558e38,'childId':_0x5c955b};}
@@ -1 +1 @@
1
- (function(_0x224fdb,_0x5c3419){const _0xe98964=a156_0xd34c,_0x136525=_0x224fdb();while(!![]){try{const _0xa6b7ed=-parseInt(_0xe98964(0xc6))/0x1*(parseInt(_0xe98964(0xd4))/0x2)+parseInt(_0xe98964(0xc3))/0x3+-parseInt(_0xe98964(0xeb))/0x4*(parseInt(_0xe98964(0xb3))/0x5)+parseInt(_0xe98964(0xbe))/0x6+parseInt(_0xe98964(0xda))/0x7*(parseInt(_0xe98964(0xb1))/0x8)+parseInt(_0xe98964(0xd3))/0x9+parseInt(_0xe98964(0xe1))/0xa*(parseInt(_0xe98964(0xb4))/0xb);if(_0xa6b7ed===_0x5c3419)break;else _0x136525['push'](_0x136525['shift']());}catch(_0x5b4a0d){_0x136525['push'](_0x136525['shift']());}}}(a156_0x3394,0xb42fb));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x50b5e5,_0x1fdf9d={},_0x4383e8={}){const _0xea0c8f=a156_0xd34c;if(_0x4383e8['skipSchema'])return runSemanticChecks(_0x50b5e5,_0x1fdf9d);const _0x4988d1=SegmentDefSchema[_0xea0c8f(0xec)](_0x50b5e5);if(_0x4988d1['success'])return runSemanticChecks(_0x4988d1[_0xea0c8f(0xe6)],_0x1fdf9d);return zodErrorsToValidationResult(_0x4988d1[_0xea0c8f(0xf3)],_0x1fdf9d);}function a156_0x3394(){const _0x4599c1=['EMPTY_CONDITIONS','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','custom','description','map','endsWith','.operator.value','5593932LOqkbQ','conditions','INVALID_ARRAY_MATCHING','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','Value','970884wOPlPz','.attribute','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','1jZdppU','MISSING_TIME_UNIT','push','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','Attribute\x20name\x20cannot\x20be\x20empty','attribute','arrayMatching','.source','aggregation','source','MISSING_OPERATOR_VALUE','.filter','type','2053233zZQMZU','270232rjWejH','validationCode','params','warning','.type','INVALID_OPERATOR_TYPE','91rBNmIa','And','SEGMENT_SCHEMA_ERROR','filter','MISSING_SEGMENT_REFERENCE','EMPTY_ATTRIBUTE','.operator.type','10EmNKLE','INVALID_RULE_TYPE','issues','name','invalid_value','data','Behavior','.conditions','BEHAVIOR_SOURCE_MISSING_FILTER','success','337396pSYPzE','safeParse','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','includes','path','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','message','error','NESTED_CONDITION_GROUP','symbol','document','Behavior\x20source\x20\x27','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','rule','level','.conditions[','\x27\x20with\x20attribute\x20\x27','length','107512YDkQrh','MISSING_NAME','70mBizXT','4347761wVCIxK','code'];a156_0x3394=function(){return _0x4599c1;};return a156_0x3394();}export function validateRuleDef(_0xdc66ac,_0x1ecf35,_0x422aff){const _0x1a06da=a156_0xd34c;if(!_0xdc66ac)return[];const _0x64bfcc=RuleDefSchema[_0x1a06da(0xec)](_0xdc66ac);if(_0x64bfcc[_0x1a06da(0xea)])return checkRule(_0x64bfcc[_0x1a06da(0xe6)],_0x1ecf35,_0x422aff);const _0x58d2e6=flattenZodIssues(_0x64bfcc['error']['issues']);return _0x58d2e6[_0x1a06da(0xbb)](_0x8762a7=>{const _0x4e7607=_0x1a06da,_0x5c27d8=formatZodPath(_0x8762a7[_0x4e7607(0xf0)]),_0x34caf9=_0x5c27d8?_0x1ecf35+'.'+_0x5c27d8:_0x1ecf35,_0x1fe89e=mapZodIssueToCode(_0x8762a7,_0x5c27d8),_0x143152=getLocationFromPath(_0x422aff[_0x4e7607(0xf6)],_0x422aff[_0x4e7607(0xcf)],pathToArray(_0x34caf9));return{'level':_0x4e7607(0xf3),'path':_0x34caf9,'code':_0x1fe89e,'message':_0x8762a7[_0x4e7607(0xf2)],..._0x143152&&{'location':_0x143152}};});}function zodErrorsToValidationResult(_0x237833,_0x137d5a){const _0x460b7f=a156_0xd34c,_0x116bc8=flattenZodIssues(_0x237833[_0x460b7f(0xe3)]),_0x15dea3=_0x116bc8[_0x460b7f(0xbb)](_0x2bfd9a=>{const _0x55c883=_0x460b7f,_0x531b9f=formatZodPath(_0x2bfd9a[_0x55c883(0xf0)]),_0x3e0529=mapZodIssueToCode(_0x2bfd9a,_0x531b9f),_0x1252a4=getLocationFromPath(_0x137d5a[_0x55c883(0xf6)],_0x137d5a[_0x55c883(0xcf)],_0x2bfd9a[_0x55c883(0xf0)]['map'](_0x299794=>typeof _0x299794===_0x55c883(0xf5)?String(_0x299794):_0x299794));return{'level':_0x55c883(0xf3),'path':_0x531b9f,'code':_0x3e0529,'message':_0x2bfd9a[_0x55c883(0xf2)],..._0x1252a4&&{'location':_0x1252a4}};});return{'valid':![],'errors':_0x15dea3,'warnings':[]};}function mapZodIssueToCode(_0x395d99,_0x41d022){const _0xdbd5aa=a156_0xd34c,_0x2ff60f=_0x395d99['code']===_0xdbd5aa(0xb9)?_0x395d99[_0xdbd5aa(0xd6)]:undefined;if(_0x41d022===_0xdbd5aa(0xe4))return _0xdbd5aa(0xb2);if(_0x41d022==='rule.type'||_0x41d022[_0xdbd5aa(0xbc)](_0xdbd5aa(0xd8))){if(_0x395d99[_0xdbd5aa(0xb5)]===_0xdbd5aa(0xe5)){if(_0x41d022==='rule.type'||_0x41d022['match'](/\.conditions\[\d+\]\.type$/))return _0xdbd5aa(0xe2);}}if(_0x41d022[_0xdbd5aa(0xbc)](_0xdbd5aa(0xe0)))return _0xdbd5aa(0xd9);if(_0x41d022[_0xdbd5aa(0xbc)](_0xdbd5aa(0xbd)))return _0xdbd5aa(0xd0);if(_0x2ff60f?.[_0xdbd5aa(0xd5)]==='MISSING_BETWEEN_BOUNDS')return'MISSING_BETWEEN_BOUNDS';if(_0x2ff60f?.[_0xdbd5aa(0xd5)]==='MISSING_TIME_UNIT')return _0xdbd5aa(0xc7);if(_0x41d022[_0xdbd5aa(0xbc)]('.conditions')||_0x41d022==='conditions')return'MISSING_CONDITIONS';if(_0x41d022[_0xdbd5aa(0xef)](_0xdbd5aa(0xcc)))return _0xdbd5aa(0xc0);if(_0x41d022['endsWith']('.segment'))return _0xdbd5aa(0xde);return _0xdbd5aa(0xdc);}function runSemanticChecks(_0x1e5e9b,_0x45b253){const _0xc75127=a156_0xd34c,_0x53128a=[];_0x1e5e9b[_0xc75127(0xf9)]&&_0x53128a['push'](...checkRule(_0x1e5e9b[_0xc75127(0xf9)],_0xc75127(0xf9),_0x45b253));const _0xbb3041=_0x53128a[_0xc75127(0xdd)](_0xb5371f=>_0xb5371f[_0xc75127(0xfa)]===_0xc75127(0xf3)),_0x58f0be=_0x53128a[_0xc75127(0xdd)](_0x57a529=>_0x57a529[_0xc75127(0xfa)]==='warning');return{'valid':_0xbb3041[_0xc75127(0xb0)]===0x0,'errors':_0xbb3041,'warnings':_0x58f0be};}function checkRule(_0x2d51c4,_0x138c19,_0x35757f){const _0x3ff8fd=a156_0xd34c,_0x1cb9db=[];if(_0x2d51c4['conditions']['length']===0x0)return _0x1cb9db['push']({'level':_0x3ff8fd(0xf3),'path':_0x138c19+_0x3ff8fd(0xe8),'code':_0x3ff8fd(0xb6),'message':_0x3ff8fd(0xee),'location':getLocationFromPath(_0x35757f[_0x3ff8fd(0xf6)],_0x35757f[_0x3ff8fd(0xcf)],pathToArray(_0x138c19+_0x3ff8fd(0xe8)))}),_0x1cb9db;return _0x1cb9db[_0x3ff8fd(0xc8)](...checkConditions(_0x2d51c4[_0x3ff8fd(0xbf)],_0x138c19,_0x35757f)),_0x1cb9db;}function checkConditions(_0x3ecba7,_0x1a971c,_0x43e852){const _0x26b3ac=a156_0xd34c,_0x2aa999=[];for(let _0x4b7bd3=0x0;_0x4b7bd3<_0x3ecba7['length'];_0x4b7bd3++){const _0x42a851=_0x3ecba7[_0x4b7bd3],_0x105a19=_0x1a971c+_0x26b3ac(0xae)+_0x4b7bd3+']';_0x2aa999['push'](...checkCondition(_0x42a851,_0x105a19,_0x43e852));}return _0x2aa999;}function a156_0xd34c(_0x17f14d,_0x3894b9){_0x17f14d=_0x17f14d-0xae;const _0x339420=a156_0x3394();let _0xd34c17=_0x339420[_0x17f14d];return _0xd34c17;}function checkCondition(_0x228987,_0x3e33c2,_0x3368dc){const _0x562f71=a156_0xd34c,_0x284fb3=[];if(_0x228987[_0x562f71(0xd2)]===_0x562f71(0xdb)||_0x228987['type']==='Or'){if(_0x228987[_0x562f71(0xbf)]['length']===0x0)_0x284fb3[_0x562f71(0xc8)]({'level':_0x562f71(0xf3),'path':_0x3e33c2+_0x562f71(0xe8),'code':_0x562f71(0xb6),'message':_0x228987[_0x562f71(0xd2)]+_0x562f71(0xf1),'location':getLocationFromPath(_0x3368dc['document'],_0x3368dc['source'],pathToArray(_0x3e33c2+_0x562f71(0xe8)))});else{const _0x4b3e2d=_0x228987[_0x562f71(0xba)]!==undefined;!_0x4b3e2d&&_0x284fb3[_0x562f71(0xc8)]({'level':_0x562f71(0xd7),'path':_0x3e33c2,'code':_0x562f71(0xf4),'message':_0x228987[_0x562f71(0xd2)]+_0x562f71(0xed)+_0x562f71(0xb7)+'conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','location':getLocationFromPath(_0x3368dc[_0x562f71(0xf6)],_0x3368dc['source'],pathToArray(_0x3e33c2))}),_0x284fb3[_0x562f71(0xc8)](...checkConditions(_0x228987[_0x562f71(0xbf)],_0x3e33c2,_0x3368dc));}return _0x284fb3;}if(_0x228987[_0x562f71(0xd2)]===_0x562f71(0xc2)||_0x228987[_0x562f71(0xd2)]===_0x562f71(0xe7)){const _0x2a86e1=_0x228987,_0x6a9238=_0x2a86e1[_0x562f71(0xcf)],_0xa1e0fd=_0x2a86e1[_0x562f71(0xce)],_0x2d602c=_0x6a9238||_0xa1e0fd;(!_0x2a86e1[_0x562f71(0xcb)]||_0x2a86e1[_0x562f71(0xcb)]==='')&&(!_0x2d602c&&_0x284fb3['push']({'level':_0x562f71(0xf3),'path':_0x3e33c2+'.attribute','code':_0x562f71(0xdf),'message':_0x562f71(0xca),'location':getLocationFromPath(_0x3368dc[_0x562f71(0xf6)],_0x3368dc['source'],pathToArray(_0x3e33c2+_0x562f71(0xc4)))}));_0x2a86e1[_0x562f71(0xdd)]&&_0x284fb3[_0x562f71(0xc8)](...checkRule(_0x2a86e1[_0x562f71(0xdd)],_0x3e33c2+_0x562f71(0xd1),_0x3368dc));if(_0x2a86e1['source']){const _0x3389a1=_0x2a86e1[_0x562f71(0xcb)]&&_0x2a86e1[_0x562f71(0xcb)]!=='';_0x3389a1&&!_0x2a86e1[_0x562f71(0xdd)]&&_0x284fb3[_0x562f71(0xc8)]({'level':_0x562f71(0xf3),'path':_0x3e33c2+_0x562f71(0xcd),'code':_0x562f71(0xe9),'message':_0x562f71(0xf7)+_0x2a86e1[_0x562f71(0xcf)]+_0x562f71(0xaf)+_0x2a86e1[_0x562f71(0xcb)]+'\x27\x20'+_0x562f71(0xc1)+'the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20'+_0x562f71(0xc5),'location':getLocationFromPath(_0x3368dc['document'],_0x3368dc['source'],pathToArray(_0x3e33c2+_0x562f71(0xcd)))}),_0x3389a1&&_0x2a86e1[_0x562f71(0xdd)]&&_0x284fb3['push']({'level':_0x562f71(0xd7),'path':_0x3e33c2+_0x562f71(0xc4),'code':_0x562f71(0xb8),'message':'Attribute\x20\x27'+_0x2a86e1['attribute']+_0x562f71(0xf8)+_0x562f71(0xc9),'location':getLocationFromPath(_0x3368dc[_0x562f71(0xf6)],_0x3368dc[_0x562f71(0xcf)],pathToArray(_0x3e33c2+_0x562f71(0xc4)))});}}return _0x284fb3;}
1
+ (function(_0x4a51ec,_0x2a23dc){const _0x2dc3fe=a155_0x2dc9,_0x15ae07=_0x4a51ec();while(!![]){try{const _0x1ac242=parseInt(_0x2dc3fe(0x1c5))/0x1*(parseInt(_0x2dc3fe(0x1be))/0x2)+-parseInt(_0x2dc3fe(0x1c3))/0x3*(parseInt(_0x2dc3fe(0x1b7))/0x4)+parseInt(_0x2dc3fe(0x1b9))/0x5+-parseInt(_0x2dc3fe(0x194))/0x6+parseInt(_0x2dc3fe(0x1b8))/0x7+parseInt(_0x2dc3fe(0x1a6))/0x8+-parseInt(_0x2dc3fe(0x1b3))/0x9;if(_0x1ac242===_0x2a23dc)break;else _0x15ae07['push'](_0x15ae07['shift']());}catch(_0x325888){_0x15ae07['push'](_0x15ae07['shift']());}}}(a155_0x127d,0xc4b63));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x2e2d16,_0x10f62f={},_0x190f67={}){const _0x322064=a155_0x2dc9;if(_0x190f67[_0x322064(0x198)])return runSemanticChecks(_0x2e2d16,_0x10f62f);const _0x1084f1=SegmentDefSchema[_0x322064(0x18c)](_0x2e2d16);if(_0x1084f1['success'])return runSemanticChecks(_0x1084f1[_0x322064(0x19b)],_0x10f62f);return zodErrorsToValidationResult(_0x1084f1[_0x322064(0x1c6)],_0x10f62f);}export function validateRuleDef(_0x451a0,_0x56ab45,_0x357eee){const _0x4ee61f=a155_0x2dc9;if(!_0x451a0)return[];const _0x59ac03=RuleDefSchema['safeParse'](_0x451a0);if(_0x59ac03['success'])return checkRule(_0x59ac03[_0x4ee61f(0x19b)],_0x56ab45,_0x357eee);const _0x2a5260=flattenZodIssues(_0x59ac03['error']['issues']);return _0x2a5260[_0x4ee61f(0x1c7)](_0x343656=>{const _0x622a2=_0x4ee61f,_0x5cde78=formatZodPath(_0x343656[_0x622a2(0x1ab)]),_0x3e40ed=_0x5cde78?_0x56ab45+'.'+_0x5cde78:_0x56ab45,_0x68b9a9=mapZodIssueToCode(_0x343656,_0x5cde78),_0x450d46=getLocationFromPath(_0x357eee['document'],_0x357eee[_0x622a2(0x1a2)],pathToArray(_0x3e40ed));return{'level':_0x622a2(0x1c6),'path':_0x3e40ed,'code':_0x68b9a9,'message':_0x343656[_0x622a2(0x189)],..._0x450d46&&{'location':_0x450d46}};});}function zodErrorsToValidationResult(_0x96f958,_0x3090f9){const _0x11fce9=a155_0x2dc9,_0x16cd0b=flattenZodIssues(_0x96f958[_0x11fce9(0x1ca)]),_0x2635d6=_0x16cd0b[_0x11fce9(0x1c7)](_0x3e7e17=>{const _0x47cfec=_0x11fce9,_0xaa5e70=formatZodPath(_0x3e7e17[_0x47cfec(0x1ab)]),_0x484c32=mapZodIssueToCode(_0x3e7e17,_0xaa5e70),_0xbaa753=getLocationFromPath(_0x3090f9['document'],_0x3090f9[_0x47cfec(0x1a2)],_0x3e7e17['path'][_0x47cfec(0x1c7)](_0x556b05=>typeof _0x556b05===_0x47cfec(0x1c1)?String(_0x556b05):_0x556b05));return{'level':_0x47cfec(0x1c6),'path':_0xaa5e70,'code':_0x484c32,'message':_0x3e7e17[_0x47cfec(0x189)],..._0xbaa753&&{'location':_0xbaa753}};});return{'valid':![],'errors':_0x2635d6,'warnings':[]};}function mapZodIssueToCode(_0xef543f,_0x117dbf){const _0x444884=a155_0x2dc9,_0x39960b=_0xef543f[_0x444884(0x1ba)]===_0x444884(0x18a)?_0xef543f[_0x444884(0x1b5)]:undefined;if(_0x117dbf==='name')return _0x444884(0x1a9);if(_0x117dbf===_0x444884(0x1bc)||_0x117dbf[_0x444884(0x1a5)]('.type')){if(_0xef543f[_0x444884(0x1ba)]===_0x444884(0x1b1)){if(_0x117dbf===_0x444884(0x1bc)||_0x117dbf[_0x444884(0x1b2)](/\.conditions\[\d+\]\.type$/))return _0x444884(0x187);}}if(_0x117dbf['endsWith']('.operator.type'))return _0x444884(0x192);if(_0x117dbf[_0x444884(0x1a5)](_0x444884(0x1aa)))return _0x444884(0x197);if(_0x39960b?.[_0x444884(0x1c2)]==='MISSING_BETWEEN_BOUNDS')return'MISSING_BETWEEN_BOUNDS';if(_0x39960b?.['validationCode']===_0x444884(0x18e))return'MISSING_TIME_UNIT';if(_0x117dbf[_0x444884(0x1a5)](_0x444884(0x190))||_0x117dbf==='conditions')return'MISSING_CONDITIONS';if(_0x117dbf[_0x444884(0x191)](_0x444884(0x18f)))return _0x444884(0x1c4);if(_0x117dbf[_0x444884(0x1a5)](_0x444884(0x1ae)))return _0x444884(0x1bf);return _0x444884(0x195);}function runSemanticChecks(_0x45b43c,_0x216cd0){const _0x19ced3=a155_0x2dc9,_0x58d2ea=[];_0x45b43c['rule']&&_0x58d2ea['push'](...checkRule(_0x45b43c[_0x19ced3(0x199)],_0x19ced3(0x199),_0x216cd0));const _0x6ed18e=_0x58d2ea['filter'](_0x1fd030=>_0x1fd030['level']===_0x19ced3(0x1c6)),_0x59b71a=_0x58d2ea['filter'](_0x4d6ff4=>_0x4d6ff4[_0x19ced3(0x1bb)]===_0x19ced3(0x1bd));return{'valid':_0x6ed18e[_0x19ced3(0x1ad)]===0x0,'errors':_0x6ed18e,'warnings':_0x59b71a};}function checkRule(_0x11d2d7,_0x4296c8,_0x4dff8a){const _0x241600=a155_0x2dc9,_0x2fbd3a=[];if(_0x11d2d7['conditions'][_0x241600(0x1ad)]===0x0)return _0x2fbd3a[_0x241600(0x1a0)]({'level':_0x241600(0x1c6),'path':_0x4296c8+_0x241600(0x190),'code':_0x241600(0x19e),'message':'Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','location':getLocationFromPath(_0x4dff8a[_0x241600(0x1ac)],_0x4dff8a[_0x241600(0x1a2)],pathToArray(_0x4296c8+_0x241600(0x190)))}),_0x2fbd3a;return _0x2fbd3a[_0x241600(0x1a0)](...checkConditions(_0x11d2d7[_0x241600(0x1a4)],_0x4296c8,_0x4dff8a)),_0x2fbd3a;}function a155_0x2dc9(_0x4312c9,_0xb51796){_0x4312c9=_0x4312c9-0x187;const _0x127d32=a155_0x127d();let _0x2dc97a=_0x127d32[_0x4312c9];return _0x2dc97a;}function a155_0x127d(){const _0x57c7f1=['code','level','rule.type','warning','86kcnBeY','MISSING_SEGMENT_REFERENCE','attribute','symbol','validationCode','1683657ynLqci','INVALID_ARRAY_MATCHING','17421IQuknc','error','map','description','Behavior\x20source\x20\x27','issues','Attribute\x20\x27','INVALID_RULE_TYPE','NESTED_CONDITION_GROUP','message','custom','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','safeParse','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','MISSING_TIME_UNIT','arrayMatching','.conditions','includes','INVALID_OPERATOR_TYPE','Attribute\x20name\x20cannot\x20be\x20empty','6725514NNKhgM','SEGMENT_SCHEMA_ERROR','BEHAVIOR_SOURCE_MISSING_FILTER','MISSING_OPERATOR_VALUE','skipSchema','rule','.source','data','\x27\x20with\x20attribute\x20\x27','Behavior','EMPTY_CONDITIONS','filter','push','EMPTY_ATTRIBUTE','source','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','conditions','endsWith','903536dwZqaU','type','Value','MISSING_NAME','.operator.value','path','document','length','.segment','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','.attribute','invalid_value','match','4360950sTqXNx','And','params','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','8PflZGX','9643529eflscV','6469730tvufxB'];a155_0x127d=function(){return _0x57c7f1;};return a155_0x127d();}function checkConditions(_0x12bb59,_0xe1c274,_0x14e624){const _0x1a8513=a155_0x2dc9,_0x49ba17=[];for(let _0xbc229f=0x0;_0xbc229f<_0x12bb59[_0x1a8513(0x1ad)];_0xbc229f++){const _0x459b0c=_0x12bb59[_0xbc229f],_0x507987=_0xe1c274+'.conditions['+_0xbc229f+']';_0x49ba17[_0x1a8513(0x1a0)](...checkCondition(_0x459b0c,_0x507987,_0x14e624));}return _0x49ba17;}function checkCondition(_0x1e1c4b,_0x3197a8,_0xdfcc19){const _0x28d766=a155_0x2dc9,_0x3013cf=[];if(_0x1e1c4b[_0x28d766(0x1a7)]===_0x28d766(0x1b4)||_0x1e1c4b[_0x28d766(0x1a7)]==='Or'){if(_0x1e1c4b[_0x28d766(0x1a4)][_0x28d766(0x1ad)]===0x0)_0x3013cf['push']({'level':_0x28d766(0x1c6),'path':_0x3197a8+'.conditions','code':_0x28d766(0x19e),'message':_0x1e1c4b[_0x28d766(0x1a7)]+_0x28d766(0x18d),'location':getLocationFromPath(_0xdfcc19[_0x28d766(0x1ac)],_0xdfcc19[_0x28d766(0x1a2)],pathToArray(_0x3197a8+'.conditions'))});else{const _0x4d5a5d=_0x1e1c4b[_0x28d766(0x1c8)]!==undefined;!_0x4d5a5d&&_0x3013cf[_0x28d766(0x1a0)]({'level':'warning','path':_0x3197a8,'code':_0x28d766(0x188),'message':_0x1e1c4b[_0x28d766(0x1a7)]+_0x28d766(0x18b)+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+'conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','location':getLocationFromPath(_0xdfcc19[_0x28d766(0x1ac)],_0xdfcc19[_0x28d766(0x1a2)],pathToArray(_0x3197a8))}),_0x3013cf[_0x28d766(0x1a0)](...checkConditions(_0x1e1c4b['conditions'],_0x3197a8,_0xdfcc19));}return _0x3013cf;}if(_0x1e1c4b[_0x28d766(0x1a7)]===_0x28d766(0x1a8)||_0x1e1c4b[_0x28d766(0x1a7)]===_0x28d766(0x19d)){const _0x373286=_0x1e1c4b,_0x25f510=_0x373286[_0x28d766(0x1a2)],_0x57df35=_0x373286['aggregation'],_0x20c1f7=_0x25f510||_0x57df35;(!_0x373286['attribute']||_0x373286[_0x28d766(0x1c0)]==='')&&(!_0x20c1f7&&_0x3013cf['push']({'level':_0x28d766(0x1c6),'path':_0x3197a8+_0x28d766(0x1b0),'code':_0x28d766(0x1a1),'message':_0x28d766(0x193),'location':getLocationFromPath(_0xdfcc19[_0x28d766(0x1ac)],_0xdfcc19[_0x28d766(0x1a2)],pathToArray(_0x3197a8+'.attribute'))}));_0x373286[_0x28d766(0x19f)]&&_0x3013cf[_0x28d766(0x1a0)](...checkRule(_0x373286['filter'],_0x3197a8+'.filter',_0xdfcc19));if(_0x373286[_0x28d766(0x1a2)]){const _0x455cad=_0x373286[_0x28d766(0x1c0)]&&_0x373286[_0x28d766(0x1c0)]!=='';_0x455cad&&!_0x373286[_0x28d766(0x19f)]&&_0x3013cf[_0x28d766(0x1a0)]({'level':_0x28d766(0x1c6),'path':_0x3197a8+_0x28d766(0x19a),'code':_0x28d766(0x196),'message':_0x28d766(0x1c9)+_0x373286[_0x28d766(0x1a2)]+_0x28d766(0x19c)+_0x373286[_0x28d766(0x1c0)]+'\x27\x20'+'requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20'+_0x28d766(0x1a3)+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0xdfcc19[_0x28d766(0x1ac)],_0xdfcc19['source'],pathToArray(_0x3197a8+_0x28d766(0x19a)))}),_0x455cad&&_0x373286['filter']&&_0x3013cf[_0x28d766(0x1a0)]({'level':_0x28d766(0x1bd),'path':_0x3197a8+_0x28d766(0x1b0),'code':_0x28d766(0x1af),'message':_0x28d766(0x1cb)+_0x373286[_0x28d766(0x1c0)]+_0x28d766(0x1b6)+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0xdfcc19[_0x28d766(0x1ac)],_0xdfcc19[_0x28d766(0x1a2)],pathToArray(_0x3197a8+_0x28d766(0x1b0)))});}}return _0x3013cf;}