@treasuredata/tdx 2026.3.50 → 2026.3.52

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 (228) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.d.ts.map +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-command.js.map +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-validate-command.js +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/mcp-command.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/policy-command.js +1 -1
  37. package/dist/commands/profile-command.js +1 -1
  38. package/dist/commands/profiles-command.js +1 -1
  39. package/dist/commands/query-command.js +1 -1
  40. package/dist/commands/schedule-command.js +1 -1
  41. package/dist/commands/segment-command.js +1 -1
  42. package/dist/commands/segment-create-command.js +1 -1
  43. package/dist/commands/segment-fields-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js +1 -1
  45. package/dist/commands/segment-push-command.js +1 -1
  46. package/dist/commands/segment-update-command.js +1 -1
  47. package/dist/commands/segment-use-command.js +1 -1
  48. package/dist/commands/segment-validate-command.js +1 -1
  49. package/dist/commands/segments.js +1 -1
  50. package/dist/commands/show.js +1 -1
  51. package/dist/commands/status-command.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.d.ts.map +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/global-context.js.map +1 -1
  68. package/dist/core/keychain.js +1 -1
  69. package/dist/core/oauth-keychain.js +1 -1
  70. package/dist/core/oauth.d.ts +1 -0
  71. package/dist/core/oauth.d.ts.map +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/oauth.js.map +1 -1
  74. package/dist/core/profile.js +1 -1
  75. package/dist/core/project-config.js +1 -1
  76. package/dist/core/session.js +1 -1
  77. package/dist/core/user-cache.js +1 -1
  78. package/dist/core/version.js +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/mcp/server.js +1 -1
  81. package/dist/mcp/tools/index.js +1 -1
  82. package/dist/mcp/tools/tdx-run.js +1 -1
  83. package/dist/mcp/tools/tdx-search.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.d.ts +21 -4
  87. package/dist/proxy/passthrough-server.d.ts.map +1 -1
  88. package/dist/proxy/passthrough-server.js +1 -1
  89. package/dist/proxy/passthrough-server.js.map +1 -1
  90. package/dist/proxy/sse-usage-parser.js +1 -1
  91. package/dist/sdk/agent/agent-config.js +1 -1
  92. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  93. package/dist/sdk/agent/agent-yaml.js +1 -1
  94. package/dist/sdk/agent/test/evaluator.js +1 -1
  95. package/dist/sdk/agent/test/executor.js +1 -1
  96. package/dist/sdk/agent/test/index.js +1 -1
  97. package/dist/sdk/agent/test/output.js +1 -1
  98. package/dist/sdk/agent/test/parser.js +1 -1
  99. package/dist/sdk/agent/tool-target-registry.js +1 -1
  100. package/dist/sdk/api.js +1 -1
  101. package/dist/sdk/cas/cas-api-client.js +1 -1
  102. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  103. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  104. package/dist/sdk/cas/index.js +1 -1
  105. package/dist/sdk/cas/pull-workflow.js +1 -1
  106. package/dist/sdk/cas/push-workflow.js +1 -1
  107. package/dist/sdk/client/cdp-api-client.js +1 -1
  108. package/dist/sdk/client/delivery-api-client.js +1 -1
  109. package/dist/sdk/client/endpoints.js +1 -1
  110. package/dist/sdk/client/engage-api-client.js +1 -1
  111. package/dist/sdk/client/http-client.js +1 -1
  112. package/dist/sdk/client/llm-api-client.js +1 -1
  113. package/dist/sdk/client/oauth-refresh.js +1 -1
  114. package/dist/sdk/client/rate-limiter.js +1 -1
  115. package/dist/sdk/client/td-api-client.js +1 -1
  116. package/dist/sdk/client/trino-api-client.js +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/connection-validator.js +1 -1
  119. package/dist/sdk/connection.js +1 -1
  120. package/dist/sdk/delivery.js +1 -1
  121. package/dist/sdk/engage/campaign-pull.js +1 -1
  122. package/dist/sdk/engage/campaign-push.js +1 -1
  123. package/dist/sdk/engage/campaign-validator.js +1 -1
  124. package/dist/sdk/engage/campaign-yaml.js +1 -1
  125. package/dist/sdk/engage/template-pull.js +1 -1
  126. package/dist/sdk/engage/template-push.js +1 -1
  127. package/dist/sdk/engage/template-validator.js +1 -1
  128. package/dist/sdk/engage/template-yaml.js +1 -1
  129. package/dist/sdk/engage/types/campaign-def.js +1 -1
  130. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  131. package/dist/sdk/engage/types/template-schema.js +1 -1
  132. package/dist/sdk/engage.js +1 -1
  133. package/dist/sdk/errors.js +1 -1
  134. package/dist/sdk/index.js +1 -1
  135. package/dist/sdk/io/index.js +1 -1
  136. package/dist/sdk/io/node-filesystem.js +1 -1
  137. package/dist/sdk/job.js +1 -1
  138. package/dist/sdk/journey.js +1 -1
  139. package/dist/sdk/llm/chat-cache.js +1 -1
  140. package/dist/sdk/llm/index.js +1 -1
  141. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  142. package/dist/sdk/llm/model-factors.js +1 -1
  143. package/dist/sdk/personalization.js +1 -1
  144. package/dist/sdk/policy.js +1 -1
  145. package/dist/sdk/query/index.js +1 -1
  146. package/dist/sdk/query/sql-parser.js +1 -1
  147. package/dist/sdk/realtime.js +1 -1
  148. package/dist/sdk/schedule.js +1 -1
  149. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  150. package/dist/sdk/segment/fields-display.js +1 -1
  151. package/dist/sdk/segment/file-discovery.js +1 -1
  152. package/dist/sdk/segment/journey-utils.js +1 -1
  153. package/dist/sdk/segment/journey-validator.js +1 -1
  154. package/dist/sdk/segment/journey-yaml.js +1 -1
  155. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  156. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  157. package/dist/sdk/segment/pull-workflow.js +1 -1
  158. package/dist/sdk/segment/push-recovery.js +1 -1
  159. package/dist/sdk/segment/push-workflow.js +1 -1
  160. package/dist/sdk/segment/resolution-context.js +1 -1
  161. package/dist/sdk/segment/segment-path-parser.js +1 -1
  162. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  163. package/dist/sdk/segment/segment-validator.js +1 -1
  164. package/dist/sdk/segment/target-resolution.js +1 -1
  165. package/dist/sdk/segment/tdx-config.js +1 -1
  166. package/dist/sdk/segment/types/activation-schema.js +1 -1
  167. package/dist/sdk/segment/types/journey-def.js +1 -1
  168. package/dist/sdk/segment/types/journey-schema.js +1 -1
  169. package/dist/sdk/segment/types/segment-def.js +1 -1
  170. package/dist/sdk/segment/types/segment-schema.js +1 -1
  171. package/dist/sdk/segment/validate-files.js +1 -1
  172. package/dist/sdk/segment/yaml-validator.js +1 -1
  173. package/dist/sdk/segment.js +1 -1
  174. package/dist/sdk/types/index.js +1 -1
  175. package/dist/sdk/types/progress.js +1 -1
  176. package/dist/sdk/types/workspace.js +1 -1
  177. package/dist/sdk/user.js +1 -1
  178. package/dist/sdk/util/format-detector.js +1 -1
  179. package/dist/sdk/util/formatters.js +1 -1
  180. package/dist/sdk/util/index.js +1 -1
  181. package/dist/sdk/util/paginate.js +1 -1
  182. package/dist/sdk/util/tree-formatter.js +1 -1
  183. package/dist/sdk/workflow/archive-validation.js +1 -1
  184. package/dist/sdk/workflow/clone-workflow.js +1 -1
  185. package/dist/sdk/workflow/index.js +1 -1
  186. package/dist/sdk/workflow/pull-workflow.js +1 -1
  187. package/dist/sdk/workflow/push-workflow.js +1 -1
  188. package/dist/sdk/workflow/tdx-config.js +1 -1
  189. package/dist/sdk/workflow/workflow-utils.js +1 -1
  190. package/dist/sdk/workspace/frontmatter.js +1 -1
  191. package/dist/sdk/workspace/git.js +1 -1
  192. package/dist/sdk/workspace/index.js +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.js +1 -1
  196. package/dist/test-utils/command-runner.js +1 -1
  197. package/dist/test-utils/factories.js +1 -1
  198. package/dist/test-utils/fixtures.js +1 -1
  199. package/dist/test-utils/http-mock.js +1 -1
  200. package/dist/test-utils/index.js +1 -1
  201. package/dist/utils/async.js +1 -1
  202. package/dist/utils/colors.js +1 -1
  203. package/dist/utils/diff.js +1 -1
  204. package/dist/utils/file-permissions.js +1 -1
  205. package/dist/utils/file-reader.js +1 -1
  206. package/dist/utils/github-releases.js +1 -1
  207. package/dist/utils/global-cache.js +1 -1
  208. package/dist/utils/json-loader.js +1 -1
  209. package/dist/utils/local-cache.js +1 -1
  210. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  211. package/dist/utils/logger/formatters/index.js +1 -1
  212. package/dist/utils/logger/handlers/console-handler.js +1 -1
  213. package/dist/utils/logger/handlers/file-handler.js +1 -1
  214. package/dist/utils/logger/handlers/index.js +1 -1
  215. package/dist/utils/logger/handlers/null-handler.js +1 -1
  216. package/dist/utils/logger/index.js +1 -1
  217. package/dist/utils/logger/logger.js +1 -1
  218. package/dist/utils/logger/types.js +1 -1
  219. package/dist/utils/option-validation.js +1 -1
  220. package/dist/utils/process.js +1 -1
  221. package/dist/utils/prompt.js +1 -1
  222. package/dist/utils/spinner.js +1 -1
  223. package/dist/utils/sse-parser.js +1 -1
  224. package/dist/utils/string-utils.js +1 -1
  225. package/dist/utils/table-ref-parser.js +1 -1
  226. package/dist/utils/tdx-logger.js +1 -1
  227. package/dist/utils/version-check.js +1 -1
  228. package/package.json +1 -1
@@ -1 +1 @@
1
- const a151_0x3dca48=a151_0x1b24;(function(_0x276571,_0xae9608){const _0x4ef68e=a151_0x1b24,_0x5bbf98=_0x276571();while(!![]){try{const _0x40b406=-parseInt(_0x4ef68e(0x200))/0x1*(-parseInt(_0x4ef68e(0x224))/0x2)+parseInt(_0x4ef68e(0x197))/0x3*(-parseInt(_0x4ef68e(0x16f))/0x4)+parseInt(_0x4ef68e(0x1d8))/0x5*(parseInt(_0x4ef68e(0x17f))/0x6)+-parseInt(_0x4ef68e(0x1a1))/0x7+parseInt(_0x4ef68e(0x1b1))/0x8*(parseInt(_0x4ef68e(0x190))/0x9)+-parseInt(_0x4ef68e(0x1da))/0xa*(-parseInt(_0x4ef68e(0x1f0))/0xb)+-parseInt(_0x4ef68e(0x15f))/0xc;if(_0x40b406===_0xae9608)break;else _0x5bbf98['push'](_0x5bbf98['shift']());}catch(_0x6ac668){_0x5bbf98['push'](_0x5bbf98['shift']());}}}(a151_0x4fc4,0x7706c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x3dca48(0x202));export const PENDING_SEGMENT_PREFIX=a151_0x3dca48(0x134);export const PENDING_ACTIVATION_PREFIX=a151_0x3dca48(0x1fe);export function createPendingSegmentId(_0x495bbb){return''+PENDING_SEGMENT_PREFIX+_0x495bbb+'__';}export function isPendingSegmentId(_0x480a7c){const _0x5b2aaa=a151_0x3dca48;return _0x480a7c[_0x5b2aaa(0x1fb)](PENDING_SEGMENT_PREFIX)&&!_0x480a7c['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2e8005){const _0x13991a=a151_0x3dca48;return _0x2e8005[_0x13991a(0x161)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3004d5){return''+PENDING_ACTIVATION_PREFIX+_0x3004d5+'__';}export function isPendingActivationId(_0x463056){const _0xe875ee=a151_0x3dca48;return _0x463056[_0xe875ee(0x1fb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xe56a64){const _0xcc03be=a151_0x3dca48;return _0xe56a64[_0xcc03be(0x161)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x28805f,_0x528547){const _0x337f6b=a151_0x3dca48,_0x2564ad=_0x28805f+'::'+(_0x528547[_0x337f6b(0x189)]()||_0x337f6b(0x1b6)),_0x5a1353=createHash(_0x337f6b(0x238))['update'](_0x2564ad)[_0x337f6b(0x171)](_0x337f6b(0x20e))[_0x337f6b(0x1c3)](0x0,0xc);return _0x337f6b(0x166)+_0x5a1353;}function a151_0x1b24(_0x1f1c79,_0x48c14e){_0x1f1c79=_0x1f1c79-0x133;const _0x4fc478=a151_0x4fc4();let _0x1b24ca=_0x4fc478[_0x1f1c79];return _0x1b24ca;}export function ensureJourneyDefaults(_0x4eac32){const _0x59f255=a151_0x3dca48;!_0x4eac32['description']&&(_0x4eac32['description']=''),!_0x4eac32[_0x59f255(0x239)]&&(_0x4eac32[_0x59f255(0x239)]=_0x59f255(0x1be));}export function injectExistingStageIds(_0x53eef2,_0x1c119f){const _0xa1782f=a151_0x3dca48,_0x4014e5=new Map(_0x1c119f[_0xa1782f(0x237)](_0x3df6f7=>[_0x3df6f7[_0xa1782f(0x1a5)],_0x3df6f7['id']]));for(const _0x46c813 of _0x53eef2){if(!_0x46c813['id']){const _0xf4d631=_0x4014e5['get'](_0x46c813['name']);_0xf4d631&&(_0x46c813['id']=_0xf4d631);}}}export function resolveTDFolderPath(_0x1333a4,_0x4867ed,_0x538940){if(!_0x4867ed)return _0x1333a4;if(_0x1333a4===_0x538940||_0x1333a4['startsWith'](_0x538940+'/'))return _0x1333a4;return _0x1333a4?_0x538940+'/'+_0x1333a4:_0x538940;}export function addFoldersToCreate(_0x517d9f,_0x2ce997,_0x13aa0a){const _0x11f107=a151_0x3dca48;if(!_0x517d9f)return;if(_0x2ce997[_0x11f107(0x232)](_0x517d9f))return;const _0x196c3e=_0x517d9f[_0x11f107(0x1d3)]('/');let _0x4fb439='';for(const _0x35d31a of _0x196c3e){_0x4fb439=_0x4fb439?_0x4fb439+'/'+_0x35d31a:_0x35d31a,!_0x2ce997[_0x11f107(0x232)](_0x4fb439)&&_0x13aa0a[_0x11f107(0x158)](_0x4fb439);}}export function sortFoldersByDepth(_0x1fe3e8){const _0x30a8ce=a151_0x3dca48;return[..._0x1fe3e8][_0x30a8ce(0x1e0)]((_0x5bc1bd,_0x290056)=>{const _0x550b67=_0x30a8ce,_0x418a86=(_0x5bc1bd[_0x550b67(0x19d)](/\//g)||[])[_0x550b67(0x14a)],_0x4f7270=(_0x290056[_0x550b67(0x19d)](/\//g)||[])[_0x550b67(0x14a)];return _0x418a86-_0x4f7270;});}import*as a151_0x2931b5 from'yaml';import{readFileSync}from'fs';import a151_0x38937e from'path';import{isJourneyDef,parseYamlString as a151_0x1f20c,toYamlString as a151_0x290451,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(_0xac3b01){const _0x5ec7e0=a151_0x3dca48;if(Array[_0x5ec7e0(0x162)](_0xac3b01))return'['+_0xac3b01[_0x5ec7e0(0x237)](_0x23a435=>stableStringify(_0x23a435))[_0x5ec7e0(0x1b5)](',')+']';if(_0xac3b01&&typeof _0xac3b01===_0x5ec7e0(0x15d)){const _0x16ce4d=_0xac3b01,_0x25c5e7=Object[_0x5ec7e0(0x143)](_0x16ce4d)['sort'](),_0x7628cf=_0x25c5e7[_0x5ec7e0(0x237)](_0x53a662=>'\x22'+_0x53a662+'\x22:'+stableStringify(_0x16ce4d[_0x53a662]));return'{'+_0x7628cf[_0x5ec7e0(0x1b5)](',')+'}';}const _0x48d8fa=JSON[_0x5ec7e0(0x1eb)](_0xac3b01);return _0x48d8fa===undefined?_0x5ec7e0(0x157):_0x48d8fa;}function activationSignature(_0x3c8acc){const _0x50163a=a151_0x3dca48,_0xc3a648={'connection':_0x3c8acc[_0x50163a(0x231)],..._0x3c8acc['all_columns']!==undefined&&{'all_columns':_0x3c8acc['all_columns']},..._0x3c8acc[_0x50163a(0x141)]!==undefined&&{'columns':_0x3c8acc[_0x50163a(0x141)]},..._0x3c8acc[_0x50163a(0x142)]!==undefined&&{'behavior':_0x3c8acc[_0x50163a(0x142)]},..._0x3c8acc[_0x50163a(0x17e)]!==undefined&&{'schedule':_0x3c8acc[_0x50163a(0x17e)]},..._0x3c8acc['notification']!==undefined&&{'notification':_0x3c8acc['notification']},..._0x3c8acc[_0x50163a(0x13f)]!==undefined&&{'connector_config':_0x3c8acc[_0x50163a(0x13f)]},..._0x3c8acc[_0x50163a(0x221)]!==undefined&&{'activation_template_id':_0x3c8acc[_0x50163a(0x221)]}};return stableStringify(_0xc3a648);}async function fetchSegment(_0x68bf8d,_0x1b138a,_0x2211e5,_0x4d7dda){const _0x1a263d=a151_0x3dca48,_0x57d73f=_0x4d7dda?.['find'](_0x1b84de=>_0x1b84de['id']===_0x2211e5);if(_0x57d73f)return _0x57d73f;try{return await _0x68bf8d[_0x1a263d(0x1b6)]['getSegment'](_0x1b138a,_0x2211e5);}catch(_0x4374b4){logger[_0x1a263d(0x1d5)](_0x1a263d(0x1a0)+_0x2211e5+_0x1a263d(0x181)+_0x4374b4);try{return await _0x68bf8d[_0x1a263d(0x1b6)][_0x1a263d(0x133)](_0x2211e5);}catch(_0x3bab4b){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2211e5+':\x20'+_0x3bab4b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3ba76e,_0x3abc22,_0x4d5d25){const _0x545289=a151_0x3dca48,_0x588d08=readPushRecovery(_0x3ba76e[_0x545289(0x155)]);if(_0x588d08?.[_0x545289(0x1d2)]===_0x3ba76e[_0x545289(0x1f3)][_0x545289(0x1a5)])for(const [_0x47744c,_0x463d05]of Object['entries'](_0x588d08['segments'])){const _0x32af33=generateDeterministicJourneySegmentName(_0x3ba76e['yamlConfig'][_0x545289(0x1a5)],_0x47744c);_0x463d05['uniqueServerName']===_0x32af33&&(_0x3abc22[_0x545289(0x153)](_0x47744c,_0x463d05[_0x545289(0x1f5)]),_0x4d5d25['set'](_0x47744c,_0x463d05['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x20d1b0,_0x22bd83,_0x8363ac,_0x1a5c26){const _0x59baa4=a151_0x3dca48;let _0x17697d;try{_0x17697d=await _0x20d1b0['segment'][_0x59baa4(0x210)]({'name':_0x8363ac[_0x59baa4(0x1f6)],'description':_0x8363ac['description'],'journeyId':_0x8363ac['journeyId'],'rule':_0x1a5c26(_0x8363ac[_0x59baa4(0x188)],!![]),'countPopulation':!![],'parentFolderId':_0x8363ac[_0x59baa4(0x18c)],'audienceId':_0x8363ac[_0x59baa4(0x1cf)]});}catch(_0x5e8cff){const _0x127912=_0x5e8cff instanceof Error&&_0x5e8cff[_0x59baa4(0x1e6)][_0x59baa4(0x136)]('Name\x20has\x20already\x20been\x20taken');if(_0x127912){const _0x5393e5=readPushRecovery(_0x22bd83[_0x59baa4(0x155)]),_0x26e52a=_0x5393e5?.[_0x59baa4(0x1d2)]===_0x22bd83['yamlConfig'][_0x59baa4(0x1a5)]?_0x5393e5[_0x59baa4(0x18a)][_0x8363ac['localName']]:undefined;if(_0x26e52a?.[_0x59baa4(0x23c)]===_0x8363ac[_0x59baa4(0x1f6)])await _0x20d1b0[_0x59baa4(0x1b6)][_0x59baa4(0x1c6)](_0x8363ac['parentId'],_0x26e52a[_0x59baa4(0x1f5)],{'description':_0x8363ac[_0x59baa4(0x13b)],'rule':_0x1a5c26(_0x8363ac[_0x59baa4(0x188)],!![]),'countPopulation':!![]}),_0x17697d=_0x26e52a['segmentId'];else throw new SDKError(ErrorCode[_0x59baa4(0x1e4)],_0x59baa4(0x226)+_0x8363ac[_0x59baa4(0x137)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x59baa4(0x1ad)+_0x22bd83['absolutePath'][_0x59baa4(0x161)](/([^/]+)$/,_0x59baa4(0x235))+')\x20')+_0x59baa4(0x1c9),_0x5e8cff);}else throw _0x5e8cff;}return saveSegmentToPushRecovery(_0x22bd83['absolutePath'],_0x22bd83[_0x59baa4(0x1f3)]['name'],_0x8363ac[_0x59baa4(0x137)],{'segmentId':_0x17697d,'uniqueServerName':_0x8363ac[_0x59baa4(0x1f6)],'createdAt':new Date()['toISOString']()}),_0x17697d;}export async function prepareSegmentFiles(_0x55cc4b,_0x4f9a7b,_0x3cc1aa,_0xf772b9,_0x3b58b9){const _0x57e5cc=a151_0x3dca48,{activationDefToCreateRequest:_0x411978}=await import(_0x57e5cc(0x1a8)),_0x48dc8c=[],_0x48f5bd=new Set();for(const {yamlConfig:_0x5baf2f,folderPath:_0x3b9377,sourcePath:_0x5711d2}of _0x55cc4b){const _0x509274=resolveTDFolderPath(_0x3b9377,_0xf772b9,_0x3b58b9),_0x2876e6=_0x509274+':'+_0x5baf2f[_0x57e5cc(0x1a5)],_0xae3d51=_0x4f9a7b['segmentByFolderAndName'][_0x57e5cc(0x1aa)](_0x2876e6),_0x471a52=_0xae3d51?_0x4f9a7b[_0x57e5cc(0x21b)][_0x57e5cc(0x1aa)](_0xae3d51['id'])||[]:[];addFoldersToCreate(_0x509274,_0x4f9a7b[_0x57e5cc(0x20b)],_0x48f5bd);const _0x474f62=calculateActivationActions(_0x5baf2f[_0x57e5cc(0x20d)]||[],_0x471a52,_0x4f9a7b[_0x57e5cc(0x1d9)],_0x4f9a7b[_0x57e5cc(0x1e1)]);for(const _0xcaf7e3 of _0x474f62){(_0xcaf7e3[_0x57e5cc(0x1ed)]===_0x57e5cc(0x1ac)||_0xcaf7e3['type']===_0x57e5cc(0x219))&&_0xcaf7e3['yamlActivation']&&(_0xcaf7e3[_0x57e5cc(0x16c)]=await _0x411978(_0xcaf7e3['yamlActivation'],_0x3cc1aa));}const _0x420f96=calculateSegmentDiff(_0x5baf2f,_0xae3d51,_0x471a52,_0x4f9a7b[_0x57e5cc(0x1d9)],_0x4f9a7b['connectionIdToNameMap']);_0x48dc8c[_0x57e5cc(0x19b)]({'relativePath':_0x5baf2f['name'],'absolutePath':_0x5711d2,'yamlConfig':_0x5baf2f,'folderPath':_0x509274,'existingSegment':_0xae3d51,'existingActivations':_0x471a52,'isNew':_0x420f96[_0x57e5cc(0x1ff)],'hasChanges':_0x420f96[_0x57e5cc(0x19c)],'diff':_0x420f96[_0x57e5cc(0x1e7)],'activationActions':_0x474f62});}return{'segmentFiles':_0x48dc8c,'foldersToCreate':_0x48f5bd};}export async function prepareJourneyFiles(_0x502536,_0x56a045,_0x4d78d0,_0x58090e){const _0x2bfb91=a151_0x3dca48,_0x56a00a=[],_0x47fd9e=new Set();for(const {yamlConfig:_0x34c17f,folderPath:_0x32254d,sourcePath:_0x1d91ca}of _0x502536){const _0x1e7cb1=resolveTDFolderPath(_0x32254d,_0x4d78d0,_0x58090e),_0x112e63=_0x1e7cb1+':'+_0x34c17f[_0x2bfb91(0x1a5)],_0x1fb185=_0x56a045[_0x2bfb91(0x1a2)][_0x2bfb91(0x1aa)](_0x112e63);let _0x28eb79,_0x56bba2;if(_0x1fb185&&_0x1fb185[_0x2bfb91(0x14a)]>0x0){const _0x1a87c1=buildLocalExpandedRuleMappings(_0x34c17f),{createYamlContext:_0x2c9cd5,prefetchJourneySegments:_0x272d90}=createPushYamlContextForBundle(_0x56a045['deps'],_0x56a045[_0x2bfb91(0x1cf)],_0x56a045[_0x2bfb91(0x192)],_0x1a87c1,_0x56a045[_0x2bfb91(0x1d9)],_0x56a045[_0x2bfb91(0x1e1)],_0x56a045[_0x2bfb91(0x228)],_0x56a045[_0x2bfb91(0x241)]);await _0x272d90(_0x1fb185['map'](_0x5706ee=>_0x5706ee['id']));const _0x6c7d59=await _0x56a045[_0x2bfb91(0x1f4)][_0x2bfb91(0x229)][_0x2bfb91(0x140)](_0x1fb185[0x0][_0x2bfb91(0x1e9)]),_0x2f1a0a=hasMultipleVersions(_0x34c17f),_0x4520e2=async _0x241655=>{const _0xa8606f=_0x2bfb91,_0x18c016=_0x56a045[_0xa8606f(0x241)]?.['get'](_0x241655);if(_0x18c016)return _0x18c016;return _0x56a045[_0xa8606f(0x1bf)]({'journeyId':_0x241655,'journeyName':_0x34c17f['name'],'isMultiVersion':_0x1fb185[_0xa8606f(0x14a)]>0x1});};if(_0x2f1a0a&&_0x1fb185['length']>0x1){const _0x182b8c=[];for(const _0x50d20d of _0x1fb185){const _0x2a2181=_0x50d20d['versionNumber']||0x1;_0x56a045[_0x2bfb91(0x1fd)]?.[_0x2bfb91(0x219)](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]+'\x20v'+_0x2a2181);const _0x3c3e9b=await _0x4520e2(_0x50d20d['id']),_0x239463=_0x2c9cd5(_0x50d20d['id']),_0x322ca0=await journeyResponseToDef(_0x3c3e9b,_0x239463);_0x182b8c['push']({'item':_0x50d20d,'yaml':_0x322ca0});}const _0xf63960=buildLocalRuleToNameMappingFromJourney(_0x34c17f);_0x56bba2=buildMergedJourneyDef(_0x182b8c,_0xf63960,_0x6c7d59);const _0x5d0dc0=Math[_0x2bfb91(0x18d)](..._0x182b8c[_0x2bfb91(0x237)](_0x1ab94a=>_0x1ab94a[_0x2bfb91(0x167)][_0x2bfb91(0x242)]||0x0)),_0x429d49=_0x1fb185['find'](_0x5e2ef3=>(_0x5e2ef3[_0x2bfb91(0x242)]||0x0)===_0x5d0dc0);_0x429d49&&(_0x56a045[_0x2bfb91(0x1fd)]?.['update'](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]+'\x20v'+_0x5d0dc0),_0x28eb79=await _0x4520e2(_0x429d49['id']));}else{const _0x1d291e=_0x1fb185[_0x1fb185[_0x2bfb91(0x14a)]-0x1];_0x56a045['progress']?.[_0x2bfb91(0x219)](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]),_0x28eb79=await _0x4520e2(_0x1d291e['id']);const _0x1d40f8=_0x2c9cd5(_0x1d291e['id']),_0x5733d2=await journeyResponseToDef(_0x28eb79,_0x1d40f8),_0xfd1772=buildLocalRuleToNameMappingFromJourney(_0x34c17f);_0x56bba2=buildMergedJourneyDef([{'item':_0x1d291e,'yaml':_0x5733d2}],_0xfd1772,_0x6c7d59);}}addFoldersToCreate(_0x1e7cb1,_0x56a045[_0x2bfb91(0x20b)],_0x47fd9e);const _0x577df6=calculateJourneyDiff(_0x34c17f,_0x56bba2);_0x56a00a['push']({'relativePath':_0x34c17f[_0x2bfb91(0x1a5)],'absolutePath':_0x1d91ca,'yamlConfig':_0x34c17f,'folderPath':_0x1e7cb1,'existingJourney':_0x28eb79,'isNew':_0x577df6[_0x2bfb91(0x1ff)],'hasChanges':_0x577df6[_0x2bfb91(0x19c)],'diff':_0x577df6[_0x2bfb91(0x1e7)]});}return{'journeyFiles':_0x56a00a,'foldersToCreate':_0x47fd9e};}export function calculateActivationActions(_0xd564fb,_0x63121f,_0xa416fe,_0x249fb9){const _0x411388=a151_0x3dca48,_0x5e29a6=[],_0x15a792=new Map();for(const _0x4a662e of _0x63121f){_0x15a792[_0x411388(0x153)](_0x4a662e['name'],_0x4a662e);}const _0x42dc9e=new Map();for(const _0x440221 of _0xd564fb){_0x42dc9e[_0x411388(0x153)](_0x440221['name'],_0x440221);}for(const _0x2ca367 of _0xd564fb){const _0x1a5b70=_0x15a792[_0x411388(0x1aa)](_0x2ca367[_0x411388(0x1a5)]);if(!_0x1a5b70)_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x1ac),'name':_0x2ca367['name'],'yamlActivation':_0x2ca367});else{const _0x2fd4f4=activationResponseToDef(_0x1a5b70,_0xa416fe,_0x249fb9),_0x472752=a151_0x2931b5[_0x411388(0x1eb)](_0x2fd4f4),_0x3b428a=a151_0x2931b5[_0x411388(0x1eb)](_0x2ca367);_0x472752!==_0x3b428a&&_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x219),'name':_0x2ca367['name'],'yamlActivation':_0x2ca367,'existingActivation':_0x1a5b70});}}for(const _0x3fd6e3 of _0x63121f){!_0x42dc9e[_0x411388(0x232)](_0x3fd6e3[_0x411388(0x1a5)])&&_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x13d),'name':_0x3fd6e3[_0x411388(0x1a5)],'existingActivation':_0x3fd6e3});}return _0x5e29a6;}function calculateYamlDiff(_0x31f3e5,_0x48b3af){if(_0x48b3af){const _0xbf0aef=generateDiff(_0x48b3af,_0x31f3e5),_0x4732fd=hasChanges(_0xbf0aef);return{'isNew':![],'hasChanges':_0x4732fd,'diff':_0x4732fd?formatDiffWithColors(_0xbf0aef):undefined};}const _0x2e7373=generateDiff('',_0x31f3e5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2e7373)};}export function calculateSegmentDiff(_0x1ebf9c,_0x42e376,_0x43cc81,_0x137cba,_0x361031){const _0x3082c2=segmentToYamlString(_0x1ebf9c),_0x11fb41=_0x42e376?segmentToYamlString(segmentWithActivationsToYaml(_0x42e376,_0x43cc81,undefined,_0x137cba,_0x361031)):undefined;return calculateYamlDiff(_0x3082c2,_0x11fb41);}export function calculateJourneyDiff(_0x46bc43,_0x56dea3){const _0x22c06e=normalizeJourneyDef(_0x46bc43,_0x46bc43),_0x1f5817=a151_0x290451(_0x22c06e),_0x5d5f81=_0x56dea3?a151_0x290451(normalizeJourneyDef(_0x56dea3,_0x46bc43)):undefined;return calculateYamlDiff(_0x1f5817,_0x5d5f81);}export function findSegmentsToDelete(_0x3df532,_0x100da5,_0x3cc047,_0x5dfbfa,_0x3fd8f8){const _0xeae45f=a151_0x3dca48,_0xcce7da=new Set();for(const {yamlConfig:_0x3e8b48,folderPath:_0x4d0884}of _0x100da5){_0xcce7da['add'](_0x4d0884+':'+_0x3e8b48[_0xeae45f(0x1a5)]);}return _0x3df532[_0xeae45f(0x1f1)](_0x6faee1=>{const _0x24a512=_0xeae45f,_0x10fc9d=_0x6faee1[_0x24a512(0x17c)]?_0x3cc047[_0x24a512(0x1aa)](_0x6faee1['segmentFolderId']['toString']())||'':'',_0x5cd46b=_0x10fc9d+':'+_0x6faee1[_0x24a512(0x1a5)];if(_0xcce7da[_0x24a512(0x232)](_0x5cd46b))return![];if(_0x3fd8f8)return _0x10fc9d===_0x5dfbfa||_0x10fc9d[_0x24a512(0x1fb)](_0x5dfbfa+'/');return!![];});}export function findJourneysToDelete(_0x43cd30,_0x536e1c,_0x5ed8b6,_0xba4ece,_0x566dbc){const _0x514e0a=a151_0x3dca48,_0x20cd02=new Set();for(const {yamlConfig:_0x4a1541,folderPath:_0x493b51}of _0x536e1c){_0x20cd02[_0x514e0a(0x158)](_0x493b51+':'+_0x4a1541['name']);}return _0x43cd30['filter'](_0x2dc986=>{const _0x191c0a=_0x514e0a,_0x53b679=_0x2dc986[_0x191c0a(0x18c)]?_0x5ed8b6[_0x191c0a(0x1aa)](_0x2dc986[_0x191c0a(0x18c)])||'':'',_0x512f25=_0x53b679+':'+_0x2dc986['journeyBundleName'];if(_0x20cd02[_0x191c0a(0x232)](_0x512f25))return![];if(_0x566dbc)return _0x53b679===_0xba4ece||_0x53b679[_0x191c0a(0x1fb)](_0xba4ece+'/');return!![];});}export function buildSegmentLookupMap(_0x1c1373,_0x1c0b8d){const _0x49ff21=a151_0x3dca48,_0x5ce5da=new Map();for(const _0x12335e of _0x1c1373){const _0x27b48b=_0x12335e[_0x49ff21(0x17c)]?_0x1c0b8d[_0x49ff21(0x1aa)](_0x12335e['segmentFolderId'][_0x49ff21(0x1b9)]())||'':'',_0x3e5556=_0x27b48b+':'+_0x12335e[_0x49ff21(0x1a5)];_0x5ce5da['set'](_0x3e5556,_0x12335e);}return _0x5ce5da;}export function buildSegmentNameToIdMap(_0x71b7f4){const _0x2ebf65=a151_0x3dca48,_0x1159d1=new Map();for(const _0x704d82 of _0x71b7f4){_0x1159d1[_0x2ebf65(0x153)](_0x704d82[_0x2ebf65(0x1a5)],_0x704d82['id']);}return _0x1159d1;}export function buildJourneyBundleLookupMap(_0x53abcd,_0x42a387){const _0x5951c4=a151_0x3dca48,_0x172225=new Map();for(const _0x4a0fc8 of _0x53abcd){const _0x4044ef=_0x4a0fc8[_0x5951c4(0x18c)]?_0x42a387[_0x5951c4(0x1aa)](_0x4a0fc8[_0x5951c4(0x18c)])||'':'',_0x103131=_0x4044ef+':'+_0x4a0fc8['journeyBundleName'];!_0x172225[_0x5951c4(0x232)](_0x103131)&&_0x172225['set'](_0x103131,[]),_0x172225[_0x5951c4(0x1aa)](_0x103131)['push'](_0x4a0fc8);}for(const _0x8e2f66 of _0x172225[_0x5951c4(0x23b)]()){_0x8e2f66[_0x5951c4(0x1e0)]((_0x411f88,_0x305e68)=>(_0x411f88['versionNumber']||0x0)-(_0x305e68[_0x5951c4(0x242)]||0x0));}return _0x172225;}export function collectFoldersToCreate(_0x152f17,_0x48578f){const _0x1e1007=a151_0x3dca48,_0x4176aa=new Set();for(const _0xc12643 of _0x152f17){if(!_0xc12643)continue;if(_0x48578f[_0x1e1007(0x232)](_0xc12643))continue;const _0x18c950=_0xc12643[_0x1e1007(0x1d3)]('/');let _0x2b6240='';for(const _0x44235a of _0x18c950){_0x2b6240=_0x2b6240?_0x2b6240+'/'+_0x44235a:_0x44235a,!_0x48578f[_0x1e1007(0x232)](_0x2b6240)&&_0x4176aa[_0x1e1007(0x158)](_0x2b6240);}}return _0x4176aa;}function a151_0x4fc4(){const _0x42efe5=['logSuccess','\x27\x20decision\x20point\x20branch\x20\x27','flatMap','created','journeyById','versionNumber','getSegmentEntity','__pending_','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','includes','localName','conditions','dirname','embedded_segment_created','description','conditionSegmentId','delete','onProgress','connector_config','getLatestJourneyId','columns','behavior','keys','nameToId','some','embedded_segment_creating','segment_updating','activation_','results','length','journeyActivationNameToId','deleteActivation','unchanged','idToName','Updated\x20journey\x20\x27','journeyActivationStepId','skipSegments','segmentNameToId','set','SEGMENT_SYNTAX_ERROR','absolutePath','Deleted\x20activation\x20\x27','null','add','Activation\x20not\x20found:\x20','kind','logDeleted','nameToType','object','activationContext','15826356HrZbqI','Created\x20journey\x20\x27','replace','isArray','Fetching\x20','updated','createActivation','journey_entry_criteria_','item','journeyId','getJourney','existingActivation','deleteSegment','validatedRequest','Entry\x20criteria:\x20','\x20error(s)','4HwEtae','steps','digest','activation_created','entry','relationships','all','createFolder','Failed\x20to\x20resolve\x20activation\x20','index','activation_deleting','):\x20','existingJourney','segmentFolderId','activation_updated','schedule','23190BkHVNa','INTERNAL',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x20(referenced\x20in\x20journey\x20','waitStep','Stage\x20\x27','Duration','toISOString','data','resolvedRule','trim','segments','getActivation','folderId','max','Deleted\x20segment\x20\x27','entryCriteria','9OaYwzY','Creating\x20segment\x20\x27','existingSegments','rootFolderId','relative','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','utf-8','447357Vduqlu','Updated\x20activation\x20\x27','\x27\x20for\x20','user','push','hasChanges','match','Condition','Failed\x20to\x20fetch\x20referenced\x20segment\x20','getSegment\x20failed\x20for\x20','2967153jWNPCJ','journeyBundlesByFolderAndName','size','createdSegmentId','name','\x20journey\x20from\x20file:\x20','\x27\x20from\x20file:\x20','./child-segment-yaml.js','deleted','get','errors','create','Delete\x20the\x20push\x20recovery\x20file\x20(','waitStepUnit','run_after_journey_refresh','\x0a\x20\x20','6785816MfNkBJ','embedded_activation_created','entry_criteria','waitStepType','join','segment','resolveSegment','journey_created','toString','withProgress','\x20activation\x20\x27','\x27\x20wait\x20condition','activation_updating','draft','fetchJourney','parentFolder','stage\x20\x27','existingSegment','slice','journeyStages','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','updateSegmentById','\x27\x20exit\x20criteria','Updated\x20segment\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','ACTIVATION_UPDATE_ERROR','embedded_activation_creating','activationParams','stages','exitCriterias','parentId','Creating\x20folder\x20\x27','Created\x20activation\x20\x27','journeyName','split','Segment\x20not\x20found:\x20','debug','list','logInfo','315OlZsJA','idToEmailMap','6830PqGLCo','conditionTimeoutUnit','reduce','with','parse','conditionTimeoutDuration','sort','connectionIdToNameMap','\x27\x20not\x20found\x20in\x20journey\x20\x27','segment_creating','SEGMENT_UPDATE_ERROR','verbose','message','diff','journeys','journeyBundleId','createSegment','stringify','attributes','type','ACTIVATION_SYNTAX_ERROR','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','5357UoNTLm','filter','WaitStep','yamlConfig','deps','segmentId','uniqueSegmentName','\x20segment\x20from\x20file:\x20','Segment\x20not\x20found','Matched\x20server\x20segment\x20\x27','\x27\x20entry\x20criteria','startsWith','activation_deleted','progress','__pending_act_','isNew','6367DkhexU','journey_creating','tdx.sdk.push-workflow','toLowerCase','folder_created','find','\x27\x20by\x20rule\x20content','valid','segment_deleting','Created\x20folder\x20\x27','parentSegmentFolder','folderPathToId','parseDocument','activations','hex','Activation','createJourneySegment','segment_deleted',').\x20','buildUserMaps','rule','\x27...','folderPath','resolveJourneyId','action','update','journeyBundleName','activationsBySegmentId','decision_point','Failed\x20to\x20resolve\x20segment\x20','journey_updated','Updating\x20segment\x20\x27','DecisionPoint','activation_template_id','updateActivation','embeddedSegmentNameToId','300wMEyMY','segment_created','Embedded\x20segment\x20\x27','from','activationStepsById','journey','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','SEGMENT_NOT_FOUND','../../utils/async.js','activationActions','./journey-yaml.js','Failed\x20to\x20','goal','connection','has','Deleting\x20activation\x20\x27','branches','.$1.push-recovery.json','effectiveFolderId','map','sha1','state','milestone','values','uniqueServerName'];a151_0x4fc4=function(){return _0x42efe5;};return a151_0x4fc4();}export function parseAndClassifyYamlFiles(_0xc54357,_0x283789,_0x45aa13){const _0x42924f=a151_0x3dca48,_0x9fc425=[],_0x1ce793=[];for(const _0xac5b7c of _0xc54357){const _0x5c39d9=a151_0x38937e[_0x42924f(0x194)](_0x283789,a151_0x38937e[_0x42924f(0x139)](_0xac5b7c)),_0x2bbf1b=_0x5c39d9==='.'?'':_0x5c39d9,_0x5cbbed=readFileSync(_0xac5b7c,_0x42924f(0x196)),_0x15029c=a151_0x2931b5['parse'](_0x5cbbed);if(isJourneyDef(_0x15029c)){const _0x2789b8=a151_0x1f20c(_0x5cbbed);_0x1ce793['push']({'yamlConfig':_0x2789b8,'folderPath':_0x2bbf1b,'sourcePath':_0xac5b7c});}else{if(!_0x45aa13?.[_0x42924f(0x151)]){const _0x254b69=parseSegmentYamlFile(_0x5cbbed),_0x72ac82=normalizeChildSegmentYaml(_0x254b69);_0x9fc425[_0x42924f(0x19b)]({'yamlConfig':_0x72ac82,'folderPath':_0x2bbf1b,'sourcePath':_0xac5b7c});}}}return{'segments':_0x9fc425,'journeys':_0x1ce793};}export function validateParsedFiles(_0x7d84ff,_0x4996c0){const _0x2ae70c=a151_0x3dca48,_0x490818=[];for(const {yamlConfig:_0x3b59d6,sourcePath:_0x230459}of _0x7d84ff['segments']){const _0x884093=readFileSync(_0x230459,_0x2ae70c(0x196)),_0xcef6e0=a151_0x2931b5[_0x2ae70c(0x20c)](_0x884093),_0x4a7d0=validateSegmentDef(_0x3b59d6,{'source':_0x884093,'document':_0xcef6e0},{'skipSchema':!![]});if(!_0x4a7d0[_0x2ae70c(0x207)]){const _0x236a58=a151_0x38937e[_0x2ae70c(0x194)](_0x4996c0,_0x230459);_0x490818[_0x2ae70c(0x19b)]({'filePath':_0x236a58,'source':_0x884093,'result':_0x4a7d0,'isJourney':![]});}}for(const {yamlConfig:_0x209bb9,sourcePath:_0x26a476}of _0x7d84ff[_0x2ae70c(0x1e8)]){const _0x2215e2=readFileSync(_0x26a476,_0x2ae70c(0x196)),_0x4a6488=a151_0x2931b5[_0x2ae70c(0x20c)](_0x2215e2),_0x583fbc=validateJourneyDef(_0x209bb9,{'source':_0x2215e2,'document':_0x4a6488},{'skipSchema':!![]});if(!_0x583fbc[_0x2ae70c(0x207)]){const _0x285ae1=a151_0x38937e[_0x2ae70c(0x194)](_0x4996c0,_0x26a476);_0x490818[_0x2ae70c(0x19b)]({'filePath':_0x285ae1,'source':_0x2215e2,'result':_0x583fbc,'isJourney':!![]});}}return _0x490818;}export function formatValidationErrors(_0x31dca3){const _0x41c2f5=a151_0x3dca48,_0x17e62e=[];for(const {filePath:_0x1da823,source:_0xdcca98,result:_0x33b642,isJourney:_0x5e7476}of _0x31dca3){const _0x55b25a=_0x5e7476?_0x41c2f5(0x229):_0x41c2f5(0x1b6);_0x17e62e[_0x41c2f5(0x19b)]('\x0a'+_0x1da823+'\x20('+_0x55b25a+_0x41c2f5(0x17a)+_0x33b642[_0x41c2f5(0x1ab)]['length']+_0x41c2f5(0x16e)),_0x17e62e[_0x41c2f5(0x19b)](formatValidationResult(_0x33b642,_0xdcca98,_0x1da823));}return _0x17e62e[_0x41c2f5(0x1b5)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x48a3ad){const _0x25e2a3=a151_0x3dca48,_0xb3f72c=new Set(),_0x3a4674=new Map(),_0x36f210=collectSegmentUsageCounts(_0x48a3ad);if(_0x48a3ad[_0x25e2a3(0x18a)])for(const [_0x29e925,_0x58f9b6]of Object['entries'](_0x48a3ad[_0x25e2a3(0x18a)])){_0xb3f72c[_0x25e2a3(0x158)](_0x29e925);if(_0x58f9b6[_0x25e2a3(0x214)]){const _0x42db2c=yamlRuleToApi(_0x58f9b6[_0x25e2a3(0x214)]),_0x1d586f=apiRuleToYaml(_0x42db2c);_0x3a4674['set'](_0x29e925,_0x1d586f);}}const _0x3a1d41=new Map();let _0x5af6c7=0x0;for(const [_0x5e5ce9,_0x1ea9ad]of _0x3a4674){const _0x258bc6=serializeExpandedRule(_0x1ea9ad,_0x3a4674),_0x432ed2=_0x3a1d41['get'](_0x258bc6)||[];_0x432ed2[_0x25e2a3(0x19b)]({'name':_0x5e5ce9,'index':_0x5af6c7}),_0x3a1d41['set'](_0x258bc6,_0x432ed2),_0x5af6c7++;}const _0x13c52d=new Map();for(const [_0x5cb3a4,_0x456768]of _0x3a1d41){const _0x28d60e=_0x456768['slice']()[_0x25e2a3(0x1e0)]((_0x33995d,_0x24950b)=>{const _0x513bd2=_0x25e2a3,_0x321715=_0x36f210[_0x513bd2(0x1aa)](_0x33995d[_0x513bd2(0x1a5)])||0x0,_0xea091f=_0x36f210[_0x513bd2(0x1aa)](_0x24950b[_0x513bd2(0x1a5)])||0x0;if(_0x321715!==_0xea091f)return _0xea091f-_0x321715;return _0x33995d[_0x513bd2(0x178)]-_0x24950b[_0x513bd2(0x178)];})[_0x25e2a3(0x237)](_0x4c4090=>_0x4c4090['name']),_0x3961ec=[];for(const _0x411f81 of _0x28d60e){const _0x35e9ef=_0x36f210[_0x25e2a3(0x1aa)](_0x411f81)||0x0,_0x2d9be0=Math['max'](_0x35e9ef,0x1);for(let _0x16ef2c=0x0;_0x16ef2c<_0x2d9be0;_0x16ef2c++){_0x3961ec[_0x25e2a3(0x19b)](_0x411f81);}}_0x13c52d['set'](_0x5cb3a4,_0x3961ec);}return{'existingLocalSegmentNames':_0xb3f72c,'localSegmentRules':_0x3a4674,'localExpandedRuleToNames':_0x13c52d};}export function createSegmentIdResolver(_0x4d514b,_0x4df41d){return async _0x1fd123=>{const _0xdb2207=a151_0x1b24,_0x1865f8=_0x4d514b['get'](_0x1fd123);if(!_0x1865f8)throw new SDKError(ErrorCode[_0xdb2207(0x22b)],_0xdb2207(0x1d4)+_0x1fd123+_0xdb2207(0x195)+_0x4df41d+'\x27)');return _0x1865f8;};}export function extractRootFolderId(_0x24801b){const _0x57e7d4=a151_0x3dca48;return _0x24801b['relationships']?.[_0x57e7d4(0x20a)]?.[_0x57e7d4(0x187)]?.['id']||_0x24801b['relationships']?.[_0x57e7d4(0x1c0)]?.['data']?.['id'];}export function buildConnectionMaps(_0xbc87e1){const _0x3d497d=a151_0x3dca48,_0x55bb40=new Map(),_0x22b5cf=new Map(),_0x85ac71=new Map();for(const _0x494a57 of _0xbc87e1){_0x55bb40['set'](_0x494a57['name'],parseInt(_0x494a57['id'],0xa)),_0x22b5cf['set'](_0x494a57['id'],_0x494a57[_0x3d497d(0x1a5)]),_0x85ac71[_0x3d497d(0x153)](_0x494a57[_0x3d497d(0x1a5)],_0x494a57[_0x3d497d(0x1ed)]);}return{'nameToId':_0x55bb40,'idToName':_0x22b5cf,'nameToType':_0x85ac71};}export function calculatePushStats(_0x10e260,_0x5247c5,_0x12f293,_0x11d4a1,_0x45cbae,_0x30442e,_0x571759){const _0x5cf736=a151_0x3dca48,_0x180ade=_0x10e260[_0x5cf736(0x1f1)](_0x787e1f=>_0x787e1f[_0x5cf736(0x1ff)]),_0xdddd91=_0x10e260[_0x5cf736(0x1f1)](_0x43685d=>!_0x43685d[_0x5cf736(0x1ff)]&&_0x43685d['hasChanges']),_0xb1d50d=_0x10e260['filter'](_0x599ff8=>!_0x599ff8['isNew']&&!_0x599ff8[_0x5cf736(0x19c)]),_0x320822=_0x30442e?_0x11d4a1:[],_0x2de646=_0x5247c5[_0x5cf736(0x1f1)](_0x33a463=>_0x33a463[_0x5cf736(0x1ff)]),_0x57810a=_0x5247c5[_0x5cf736(0x1f1)](_0x370d23=>!_0x370d23['isNew']&&_0x370d23[_0x5cf736(0x19c)]),_0x460f55=_0x5247c5['filter'](_0x478144=>!_0x478144[_0x5cf736(0x1ff)]&&!_0x478144[_0x5cf736(0x19c)]),_0x26eaeb=_0x30442e?_0x45cbae:[],_0x528344=_0x10e260[_0x5cf736(0x23f)](_0x44385c=>_0x44385c[_0x5cf736(0x22d)]),_0x2b7315=_0x528344[_0x5cf736(0x1f1)](_0x5d1133=>_0x5d1133[_0x5cf736(0x1ed)]===_0x5cf736(0x1ac)),_0x57d97d=_0x528344[_0x5cf736(0x1f1)](_0x2c801a=>_0x2c801a[_0x5cf736(0x1ed)]===_0x5cf736(0x219)),_0x3665e0=_0x528344[_0x5cf736(0x1f1)](_0xd21027=>_0xd21027[_0x5cf736(0x1ed)]==='delete'),_0x1b70d6=Array[_0x5cf736(0x227)](_0x12f293)[_0x5cf736(0x1e0)](),_0xb260e9=_0x571759?![]:_0x180ade[_0x5cf736(0x14a)]>0x0||_0xdddd91[_0x5cf736(0x14a)]>0x0||_0x320822[_0x5cf736(0x14a)]>0x0,_0x471b93=_0x2de646['length']>0x0||_0x57810a['length']>0x0||_0x26eaeb[_0x5cf736(0x14a)]>0x0,_0x35ce2c=_0x571759?![]:_0x528344[_0x5cf736(0x14a)]>0x0,_0x22f0b0=_0x1b70d6['length']>0x0;return{'segments':{'new':_0x180ade,'changed':_0xdddd91,'unchanged':_0xb1d50d,'toDelete':_0x320822},'journeys':{'new':_0x2de646,'changed':_0x57810a,'unchanged':_0x460f55,'toDelete':_0x26eaeb},'activations':{'all':_0x528344,'toCreate':_0x2b7315,'toUpdate':_0x57d97d,'toDelete':_0x3665e0},'folders':{'toCreate':_0x1b70d6},'counts':{'segments':{'new':_0x180ade[_0x5cf736(0x14a)],'changed':_0xdddd91[_0x5cf736(0x14a)],'unchanged':_0xb1d50d[_0x5cf736(0x14a)],'toDelete':_0x320822[_0x5cf736(0x14a)]},'journeys':{'new':_0x2de646[_0x5cf736(0x14a)],'changed':_0x57810a['length'],'unchanged':_0x460f55['length'],'toDelete':_0x26eaeb[_0x5cf736(0x14a)]},'activations':{'create':_0x2b7315[_0x5cf736(0x14a)],'update':_0x57d97d[_0x5cf736(0x14a)],'delete':_0x3665e0[_0x5cf736(0x14a)]},'folders':_0x1b70d6[_0x5cf736(0x14a)]},'hasChanges':_0xb260e9||_0x471b93||_0x35ce2c||_0x22f0b0};}export async function buildPushExecutionContext(_0x560401,_0x26b117,_0x3ea727,_0x3b9bab,_0x22765c,_0x48c2a8){const _0x23f235=a151_0x3dca48,_0x10a3ef=extractRootFolderId(_0x3ea727),{pathToId:_0x12ce25,idToPath:_0x546db8}=buildFolderMaps(_0x22765c),_0x36b12b=buildSegmentNameToIdMap(_0x3b9bab),_0x3a8555=new Map(),{batchAsync:_0x5f0eb9}=await import(_0x23f235(0x22c)),[_0x277e79,_0x4bd1f8]=await Promise[_0x23f235(0x175)]([_0x560401[_0x23f235(0x19a)][_0x23f235(0x213)](),_0x560401[_0x23f235(0x231)][_0x23f235(0x1d6)](),((async()=>{const _0x2545c7=_0x23f235;!_0x48c2a8&&_0x3b9bab[_0x2545c7(0x14a)]>0x0&&await _0x5f0eb9(_0x3b9bab,async _0x356ccf=>{const _0x32e3f2=_0x2545c7,_0xf2ec06=await _0x560401['segment']['listActivations'](_0x26b117,_0x356ccf['id']);_0x3a8555[_0x32e3f2(0x153)](_0x356ccf['id'],_0xf2ec06);});})())]),{emailToId:_0x1529c1,idToEmail:_0x4a8402}=_0x277e79,_0x2a523f=buildConnectionMaps(_0x4bd1f8);return{'rootFolderId':_0x10a3ef,'folderPathToId':_0x12ce25,'folderIdToPath':_0x546db8,'segmentNameToId':_0x36b12b,'activationsBySegmentId':_0x3a8555,'emailToIdMap':_0x1529c1,'idToEmailMap':_0x4a8402,'connectionNameToIdMap':_0x2a523f[_0x23f235(0x144)],'connectionIdToNameMap':_0x2a523f[_0x23f235(0x14e)],'connectionNameToTypeMap':_0x2a523f[_0x23f235(0x15c)]};}export function createPushYamlContextForBundle(_0x42fe70,_0x34d3b2,_0x5cc2fc,_0x294136,_0x2bd79c,_0x3e6161,_0x5e7dfc,_0x256a1a){const {existingLocalSegmentNames:_0xa30759,localExpandedRuleToNames:_0x15172d}=_0x294136,_0x90f283=new Set(),_0x29b9f6=new Map(),_0xa1e6d2=new Map(),_0x557b45=new Map(),_0x5ae371=createJumpTargetCache(),_0x4517da=new Map(),_0x454ff0=new Map(),_0x2c9cf0=new Set();let _0x575070;const _0x58713b=_0x1545c1=>{const _0x2586e9={'resolveSegment':async _0x29a2ff=>{const _0x243c3a=a151_0x1b24,_0x2370c2=_0x557b45['get'](_0x29a2ff);if(_0x2370c2!==undefined)return{'name':_0x2370c2,'isJourneyLocal':!![]};try{const _0x1d65cd=await fetchSegment(_0x42fe70,_0x34d3b2,_0x29a2ff,_0x5cc2fc);if(!_0x1d65cd)throw new Error(_0x243c3a(0x1f8));const _0x4bc1a7=generateJourneyLocalName(_0x1d65cd[_0x243c3a(0x1a5)]),_0x112bb7=_0x1d65cd[_0x243c3a(0x15a)]===SEGMENT_KIND_JOURNEY&&_0x4bc1a7!==undefined;let _0x20dfab=_0x1d65cd['name'],_0x399223;if(_0x112bb7&&_0x1d65cd[_0x243c3a(0x214)]){const _0x383af0=apiRuleToYaml(_0x1d65cd[_0x243c3a(0x214)]);_0x454ff0['set'](_0x29a2ff,_0x383af0);const _0x59d6e3=async _0x54bc19=>{const _0x2d4ed9=_0x243c3a,_0x8eac36=collectSegmentRefsFromRule(_0x54bc19);for(const _0xb140f6 of _0x8eac36){if(!_0x454ff0[_0x2d4ed9(0x232)](_0xb140f6))try{const _0x4ca77c=await fetchSegment(_0x42fe70,_0x34d3b2,_0xb140f6,_0x5cc2fc);if(_0x4ca77c?.['rule']){const _0x28a7e7=apiRuleToYaml(_0x4ca77c[_0x2d4ed9(0x214)]);_0x454ff0['set'](_0xb140f6,_0x28a7e7),await _0x59d6e3(_0x28a7e7);}}catch(_0x3905a4){logger['debug'](_0x2d4ed9(0x19f)+_0xb140f6+':\x20'+_0x3905a4);}}};await _0x59d6e3(_0x383af0);const _0x274005=serializeExpandedRule(_0x383af0,_0x454ff0),_0x5b560f=_0x15172d[_0x243c3a(0x1aa)](_0x274005);if(_0x5b560f&&_0x5b560f['length']>0x0){const _0xbeef08=_0x29b9f6[_0x243c3a(0x1aa)](_0x274005)||0x0,_0x28a7ba=_0x5b560f[_0xbeef08]||_0x5b560f[_0x5b560f[_0x243c3a(0x14a)]-0x1];_0x29b9f6[_0x243c3a(0x153)](_0x274005,_0xbeef08+0x1),_0x20dfab=_0x28a7ba,_0x90f283[_0x243c3a(0x158)](_0x20dfab),_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab);const _0x5dc018=await resolveRuleSegmentRefs(_0x383af0,async _0x3919f6=>{const _0x19fa74=_0x243c3a,_0x2a548d=_0x557b45[_0x19fa74(0x1aa)](_0x3919f6);if(_0x2a548d)return _0x2a548d;const _0x48c867=await _0x575070[_0x19fa74(0x1b7)](_0x3919f6);return _0x48c867[_0x19fa74(0x1a5)];});_0x399223={'description':_0x1d65cd[_0x243c3a(0x13b)],'rule':_0x5dc018};}else{const _0x33c549=_0x4517da[_0x243c3a(0x1aa)](_0x274005);if(_0x33c549)_0x20dfab=_0x33c549,_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab);else{if(_0x4bc1a7){let _0xb13d1c=_0x4bc1a7,_0x29bc7f=0x2;while(_0x90f283[_0x243c3a(0x232)](_0xb13d1c)||_0xa30759[_0x243c3a(0x232)](_0xb13d1c)){_0xb13d1c=_0x4bc1a7+'_'+_0x29bc7f,_0x29bc7f++;}_0x90f283['add'](_0xb13d1c),_0x20dfab=_0xb13d1c;}_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab),_0x4517da[_0x243c3a(0x153)](_0x274005,_0x20dfab);const _0x19514e=await resolveRuleSegmentRefs(_0x383af0,async _0x5320df=>{const _0x53f9d8=_0x243c3a,_0x9bebb4=_0x557b45[_0x53f9d8(0x1aa)](_0x5320df);if(_0x9bebb4)return _0x9bebb4;const _0x2cd45a=await _0x575070[_0x53f9d8(0x1b7)](_0x5320df);return _0x2cd45a[_0x53f9d8(0x1a5)];});_0x399223={'description':_0x1d65cd[_0x243c3a(0x13b)],'rule':_0x19514e};}}}return{'name':_0x20dfab,'isJourneyLocal':_0x112bb7,'definition':_0x399223};}catch(_0x429464){return logger[_0x243c3a(0x1d5)](_0x243c3a(0x21d)+_0x29a2ff+':\x20'+_0x429464),{'name':_0x29a2ff,'isJourneyLocal':![]};}},'resolveActivation':async _0x43e1ef=>{const _0x433c84=a151_0x1b24,_0x1d84c0=_0xa1e6d2[_0x433c84(0x1aa)](_0x43e1ef);if(_0x1d84c0!==undefined)return{'name':_0x1d84c0,'isJourneyLocal':!![]};try{let _0x4ae26e=_0x5e7dfc?.[_0x433c84(0x1aa)](_0x43e1ef);!_0x4ae26e&&(_0x4ae26e=await _0x42fe70[_0x433c84(0x229)][_0x433c84(0x18b)](_0x1545c1,_0x43e1ef));const _0x37ed4a=_0x4ae26e['attributes'][_0x433c84(0x1cc)][_0x433c84(0x1a5)]||_0x43e1ef,_0x3d4df9=sanitizeYamlKey(_0x37ed4a)||_0x433c84(0x148)+_0x43e1ef,_0x48e9cb=_0x3d4df9;_0xa1e6d2['set'](_0x43e1ef,_0x48e9cb);const _0xa390a4=journeyActivationStepToYaml(_0x4ae26e,_0x2bd79c,_0x3e6161);return{'name':_0x48e9cb,'isJourneyLocal':!![],'definition':_0xa390a4};}catch(_0xcefd14){return logger[_0x433c84(0x1d5)](_0x433c84(0x177)+_0x43e1ef+':\x20'+_0xcefd14),{'name':_0x43e1ef,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1a7458,_0x430156)=>resolveJumpTarget(_0x1a7458,_0x430156,_0x5ae371,async _0x462d33=>{const _0x3bbcba=a151_0x1b24,_0x4198e3=_0x256a1a?.[_0x3bbcba(0x1aa)](_0x462d33);if(_0x4198e3)return _0x4198e3;return _0x42fe70[_0x3bbcba(0x229)][_0x3bbcba(0x169)](_0x462d33);})};return _0x575070=_0x2586e9,_0x2586e9;},_0x3c09ca=async _0x4e40f0=>{const _0x52b17a=a151_0x1b24,{collectSegmentIdsFromJourneyApi:_0xe5f7ca}=await import(_0x52b17a(0x22e)),{batchAsync:_0x389cfe}=await import(_0x52b17a(0x22c)),_0x47243f=new Set();for(const _0x3a9f03 of _0x4e40f0){let _0x4cb90a=_0x256a1a?.[_0x52b17a(0x1aa)](_0x3a9f03);!_0x4cb90a&&(_0x4cb90a=await _0x42fe70[_0x52b17a(0x229)][_0x52b17a(0x169)](_0x3a9f03));const _0x58f55e=_0xe5f7ca(_0x4cb90a);for(const _0xba5027 of _0x58f55e){_0x47243f[_0x52b17a(0x158)](_0xba5027);}}let _0x5412ad=Array[_0x52b17a(0x227)](_0x47243f);while(_0x5412ad[_0x52b17a(0x14a)]>0x0){const _0x11b6ea=_0x5412ad[_0x52b17a(0x1f1)](_0x4f2579=>!_0x2c9cf0[_0x52b17a(0x232)](_0x4f2579));if(_0x11b6ea[_0x52b17a(0x14a)]===0x0)break;const _0xd54d06=await _0x389cfe(_0x11b6ea,async _0x45e79f=>{_0x2c9cf0['add'](_0x45e79f);const _0x3323e2=await fetchSegment(_0x42fe70,_0x34d3b2,_0x45e79f,_0x5cc2fc);if(!_0x3323e2)return null;return{'segmentId':_0x45e79f,'segment':_0x3323e2};},0xa),_0x4e4633=new Set();for(const _0x3cf0b4 of _0xd54d06){if(!_0x3cf0b4?.[_0x52b17a(0x1b6)]?.[_0x52b17a(0x214)])continue;const _0x17a842=apiRuleToYaml(_0x3cf0b4[_0x52b17a(0x1b6)][_0x52b17a(0x214)]);_0x454ff0[_0x52b17a(0x153)](_0x3cf0b4['segmentId'],_0x17a842);const _0x31a6d6=collectSegmentRefsFromRule(_0x17a842);for(const _0x54906d of _0x31a6d6){!_0x2c9cf0[_0x52b17a(0x232)](_0x54906d)&&_0x4e4633[_0x52b17a(0x158)](_0x54906d);}}_0x5412ad=Array[_0x52b17a(0x227)](_0x4e4633);}};return{'createYamlContext':_0x58713b,'prefetchJourneySegments':_0x3c09ca};}export async function executePushSegments(_0x1c639b,_0x2fd7f9,_0x273b0e,_0x105280,_0x2bb0a5){const _0x4f5173=a151_0x3dca48,{segmentDefToCreateRequest:_0x1495d2,segmentDefToUpdateRequest:_0x1f564a}=await import(_0x4f5173(0x1a8)),_0x3a9af6=_0x273b0e[_0x4f5173(0x20b)],_0x54438d=0x5,_0x2389c8=async _0x5a202e=>{const _0x57841e=_0x4f5173,_0x191adf=_0x5a202e[_0x57841e(0x216)]?_0x3a9af6[_0x57841e(0x1aa)](_0x5a202e[_0x57841e(0x216)]):undefined;let _0x4274c4;const _0x5a1d7c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x26cee9=_0x5a202e[_0x57841e(0x1f3)];if(_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x214)]){const _0x303c14=createSegmentIdResolver(_0x273b0e['segmentNameToId'],_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]),_0x3bb1dc=await resolveRuleSegmentIds(_0x5a202e['yamlConfig'][_0x57841e(0x214)],_0x303c14);_0x26cee9={..._0x5a202e[_0x57841e(0x1f3)],'rule':_0x3bb1dc};}try{if(_0x5a202e[_0x57841e(0x1ff)]){_0x2bb0a5['onProgress']?.({'type':_0x57841e(0x1e3),'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]});const _0x383b2a=_0x1495d2(_0x26cee9,_0x191adf),_0xab3038=await _0x2bb0a5['withProgress'](_0x57841e(0x191)+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+_0x57841e(0x215),()=>_0x1c639b[_0x57841e(0x1b6)][_0x57841e(0x1ea)](_0x105280[_0x57841e(0x1cf)],_0x383b2a));_0x4274c4=_0xab3038[_0x57841e(0x187)]['id'],_0x273b0e[_0x57841e(0x152)]['set'](_0x5a202e[_0x57841e(0x1f3)]['name'],_0x4274c4),_0x5a1d7c[_0x57841e(0x1a4)]={'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)],'id':_0x4274c4},_0x2bb0a5[_0x57841e(0x13e)]?.({'type':_0x57841e(0x225),'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)],'segmentId':_0x4274c4}),_0x2bb0a5['logSuccess']?.('Created\x20segment\x20\x27'+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+'\x27'),_0x5a1d7c[_0x57841e(0x240)]=0x1;}else{if(_0x5a202e[_0x57841e(0x19c)]){_0x2bb0a5['onProgress']?.({'type':_0x57841e(0x147),'name':_0x5a202e[_0x57841e(0x1f3)]['name']});const _0xd78cf8=_0x1f564a(_0x26cee9);_0x191adf!==_0x5a202e[_0x57841e(0x1c2)]?.[_0x57841e(0x17c)]&&(_0xd78cf8[_0x57841e(0x17c)]=_0x191adf?parseInt(_0x191adf,0xa):undefined),await _0x2bb0a5[_0x57841e(0x1ba)](_0x57841e(0x21f)+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+_0x57841e(0x215),()=>_0x1c639b['segment'][_0x57841e(0x1c6)](_0x105280[_0x57841e(0x1cf)],_0x5a202e[_0x57841e(0x1c2)]['id'],_0xd78cf8)),_0x4274c4=_0x5a202e['existingSegment']['id'],_0x2bb0a5['onProgress']?.({'type':'segment_updated','name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]}),_0x2bb0a5[_0x57841e(0x23d)]?.(_0x57841e(0x1c8)+_0x5a202e['yamlConfig']['name']+'\x27'),_0x5a1d7c['updated']=0x1;}else _0x4274c4=_0x5a202e['existingSegment']['id'];}}catch(_0x5056c4){const _0x4f2864=isHttp400Error(_0x5056c4),_0x99113a=_0x4f2864?ErrorCode[_0x57841e(0x154)]:ErrorCode[_0x57841e(0x1e4)],_0x3d3ef5=getErrorMessage(_0x5056c4);throw new SDKError(_0x99113a,_0x57841e(0x22f)+(_0x5a202e[_0x57841e(0x1ff)]?_0x57841e(0x1ac):_0x57841e(0x219))+_0x57841e(0x1f7)+_0x5a202e[_0x57841e(0x155)]+'\x0a\x20\x20'+_0x3d3ef5,_0x5056c4);}try{const _0x278fdd=await syncActivationsForSegment(_0x1c639b,_0x105280[_0x57841e(0x1cf)],_0x4274c4,_0x5a202e[_0x57841e(0x1f3)]['name'],_0x5a202e[_0x57841e(0x22d)],_0x2bb0a5,_0x5a202e['absolutePath']);_0x5a1d7c[_0x57841e(0x20d)]=_0x278fdd;}catch(_0x16f85b){if(_0x16f85b instanceof SDKError)throw _0x16f85b;throw new SDKError(ErrorCode[_0x57841e(0x1ca)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5a202e['yamlConfig'][_0x57841e(0x1a5)]+_0x57841e(0x1a7)+_0x5a202e['absolutePath']+_0x57841e(0x1b0)+getErrorMessage(_0x16f85b),_0x16f85b);}return _0x5a1d7c;},_0x58bddb=await batchAsync(_0x2fd7f9,_0x2389c8,_0x54438d),_0x454e53={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1a5839 of _0x58bddb){_0x454e53[_0x4f5173(0x240)]+=_0x1a5839['created'],_0x454e53[_0x4f5173(0x164)]+=_0x1a5839[_0x4f5173(0x164)],_0x1a5839[_0x4f5173(0x1a4)]&&_0x454e53['createdSegmentIds'][_0x4f5173(0x153)](_0x1a5839[_0x4f5173(0x1a4)][_0x4f5173(0x1a5)],_0x1a5839[_0x4f5173(0x1a4)]['id']),_0x454e53['activations'][_0x4f5173(0x240)]+=_0x1a5839[_0x4f5173(0x20d)]['created'],_0x454e53[_0x4f5173(0x20d)][_0x4f5173(0x164)]+=_0x1a5839['activations'][_0x4f5173(0x164)],_0x454e53[_0x4f5173(0x20d)][_0x4f5173(0x1a9)]+=_0x1a5839['activations'][_0x4f5173(0x1a9)];}return _0x454e53;}async function syncActivationsForSegment(_0x282aac,_0xeb8277,_0xf14a6e,_0x59286c,_0x88186f,_0x2d6df1,_0x5b2211){const _0x165d29=a151_0x3dca48,_0x5751f8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x474053 of _0x88186f){try{if(_0x474053[_0x165d29(0x1ed)]==='create'&&_0x474053[_0x165d29(0x16c)])_0x2d6df1[_0x165d29(0x13e)]?.({'type':'activation_creating','segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),await _0x2d6df1[_0x165d29(0x1ba)]('Creating\x20activation\x20\x27'+_0x474053['name']+_0x165d29(0x215),()=>_0x282aac['segment'][_0x165d29(0x165)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16c)])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x172),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),_0x2d6df1[_0x165d29(0x23d)]?.(_0x165d29(0x1d1)+_0x474053['name']+'\x27'),_0x5751f8['created']++;else{if(_0x474053[_0x165d29(0x1ed)]===_0x165d29(0x219)&&_0x474053[_0x165d29(0x16c)]&&_0x474053[_0x165d29(0x16a)])_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x1bd),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),await _0x2d6df1[_0x165d29(0x1ba)]('Updating\x20activation\x20\x27'+_0x474053[_0x165d29(0x1a5)]+_0x165d29(0x215),()=>_0x282aac[_0x165d29(0x1b6)][_0x165d29(0x222)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16a)]['id'],_0x474053[_0x165d29(0x16c)])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x17d),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),_0x2d6df1['logSuccess']?.(_0x165d29(0x198)+_0x474053['name']+'\x27'),_0x5751f8[_0x165d29(0x164)]++;else _0x474053[_0x165d29(0x1ed)]===_0x165d29(0x13d)&&_0x474053[_0x165d29(0x16a)]&&(_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x179),'segmentName':_0x59286c,'activationName':_0x474053['name']}),await _0x2d6df1[_0x165d29(0x1ba)](_0x165d29(0x233)+_0x474053['name']+'\x27...',()=>_0x282aac['segment'][_0x165d29(0x14c)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16a)]['id'])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x1fc),'segmentName':_0x59286c,'activationName':_0x474053['name']}),_0x2d6df1[_0x165d29(0x15b)]?.(_0x165d29(0x156)+_0x474053[_0x165d29(0x1a5)]+'\x27'),_0x5751f8[_0x165d29(0x1a9)]++);}}catch(_0x13b7d1){const _0x22c695=isHttp400Error(_0x13b7d1),_0x19df42=_0x22c695?ErrorCode[_0x165d29(0x1ee)]:ErrorCode[_0x165d29(0x1ca)],_0x5a273a=getErrorMessage(_0x13b7d1);throw new SDKError(_0x19df42,_0x165d29(0x22f)+_0x474053[_0x165d29(0x1ed)]+_0x165d29(0x1bb)+_0x474053['name']+_0x165d29(0x1a7)+_0x5b2211+_0x165d29(0x1b0)+_0x5a273a,_0x13b7d1);}}return _0x5751f8;}export async function executePushFolders(_0x4618b3,_0x5cd86c,_0x5e1984,_0x431aa8,_0x4a0ee8){const _0x4f8784=a151_0x3dca48,_0x320e99=new Map(_0x5e1984),_0x4980f2=sortFoldersByDepth(_0x5cd86c);for(const _0x5599ad of _0x4980f2){const _0x2e91a1=_0x5599ad['split']('/'),_0x246119=_0x2e91a1[_0x2e91a1[_0x4f8784(0x14a)]-0x1],_0x3f3bc0=_0x2e91a1[_0x4f8784(0x1c3)](0x0,-0x1)[_0x4f8784(0x1b5)]('/'),_0x59a230=_0x320e99[_0x4f8784(0x1aa)](_0x3f3bc0);_0x4a0ee8[_0x4f8784(0x13e)]?.({'type':'folder_creating','folder':_0x5599ad});const _0xf36e2a={'name':_0x246119,'parentFolderId':_0x59a230},_0x31f017=await _0x4a0ee8[_0x4f8784(0x1ba)](_0x4f8784(0x1d0)+_0x5599ad+_0x4f8784(0x215),()=>_0x4618b3[_0x4f8784(0x1b6)][_0x4f8784(0x176)](_0x431aa8['parentId'],_0xf36e2a));_0x320e99[_0x4f8784(0x153)](_0x5599ad,_0x31f017[_0x4f8784(0x187)]['id']),_0x4a0ee8['onProgress']?.({'type':_0x4f8784(0x204),'folder':_0x5599ad,'folderId':_0x31f017[_0x4f8784(0x187)]['id']}),_0x4a0ee8[_0x4f8784(0x1d7)]?.(_0x4f8784(0x209)+_0x5599ad+'\x27');}return _0x320e99;}export async function executePushSegmentDeletions(_0xf124e0,_0x5e5018,_0x40dbb6){const _0x508a2f=a151_0x3dca48;if(_0x5e5018[_0x508a2f(0x14a)]===0x0)return 0x0;const {batchAsync:_0x5446f0}=await import(_0x508a2f(0x22c)),_0x4a1497=0x5,_0x20fd3e=await _0x5446f0(_0x5e5018,async _0x5a82ba=>{const _0x2442b8=_0x508a2f;return _0x40dbb6[_0x2442b8(0x13e)]?.({'type':_0x2442b8(0x208),'name':_0x5a82ba[_0x2442b8(0x1a5)]}),await _0xf124e0['segment'][_0x2442b8(0x16b)](_0x5a82ba['id']),_0x40dbb6[_0x2442b8(0x13e)]?.({'type':_0x2442b8(0x211),'name':_0x5a82ba['name']}),_0x40dbb6[_0x2442b8(0x15b)]?.(_0x2442b8(0x18e)+_0x5a82ba[_0x2442b8(0x1a5)]+'\x27'),0x1;},_0x4a1497);return _0x20fd3e[_0x508a2f(0x1dc)]((_0x5635d3,_0x35e544)=>_0x5635d3+_0x35e544,0x0);}export async function executePushJourneys(_0x4730a5,_0x358775,_0x594005,_0x355ccb,_0x1c41ae){const _0x255fa3=a151_0x3dca48,{journeyDefToRequest:_0x4469a1}=await import(_0x255fa3(0x22e)),{activationDefToCreateRequest:_0x2c3d5f,yamlRuleToApi:_0x5025c6,validateSegmentRule:_0x10f576}=await import(_0x255fa3(0x1a8)),_0x41d17b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x56d6b6=new Map(_0x594005[_0x255fa3(0x152)]),_0x36a7b0=0x5;for(let _0xbe8b50=0x0;_0xbe8b50<_0x358775['length'];_0xbe8b50+=_0x36a7b0){const _0x383327=_0x358775[_0x255fa3(0x1c3)](_0xbe8b50,_0xbe8b50+_0x36a7b0),_0x5aebdb=await Promise[_0x255fa3(0x175)](_0x383327[_0x255fa3(0x237)](async _0x5620e9=>{const _0x3aa06d=_0x255fa3;if(!_0x5620e9[_0x3aa06d(0x1ff)]&&!_0x5620e9['hasChanges'])return{'action':'unchanged','name':_0x5620e9[_0x3aa06d(0x1f3)]['name'],'journeyId':_0x5620e9[_0x3aa06d(0x17b)]?.['id']};const _0x478fd7=_0x5620e9[_0x3aa06d(0x216)]?_0x594005[_0x3aa06d(0x20b)][_0x3aa06d(0x1aa)](_0x5620e9[_0x3aa06d(0x216)]):undefined;_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x5620e9[_0x3aa06d(0x1ff)]?_0x3aa06d(0x201):'journey_updating','name':_0x5620e9['yamlConfig']['name']});try{const _0x3199bb=await executeSingleJourneyPush(_0x4730a5,_0x5620e9,{..._0x594005,'segmentNameToId':_0x56d6b6},{'parentId':_0x355ccb['parentId'],'rootFolderId':_0x355ccb['rootFolderId'],'folderId':_0x478fd7,'verbose':_0x355ccb[_0x3aa06d(0x1e5)]},_0x1c41ae,{'journeyDefToRequest':_0x4469a1,'activationDefToCreateRequest':_0x2c3d5f,'yamlRuleToApi':_0x5025c6,'validateSegmentRule':_0x10f576});for(const [_0x56fa05,_0x11f695]of _0x3199bb[_0x3aa06d(0x223)]){_0x56d6b6[_0x3aa06d(0x153)](_0x56fa05,_0x11f695),_0x41d17b['embeddedSegmentNameToId']['set'](_0x56fa05,_0x11f695);}if(_0x3199bb[_0x3aa06d(0x218)]==='created')_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x3aa06d(0x1b8),'name':_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)],'journeyId':_0x3199bb[_0x3aa06d(0x168)]}),_0x1c41ae['logSuccess']?.(_0x3aa06d(0x160)+_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]+'\x27'),_0x41d17b[_0x3aa06d(0x240)]++;else _0x3199bb[_0x3aa06d(0x218)]===_0x3aa06d(0x164)&&(_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x3aa06d(0x21e),'name':_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]}),_0x1c41ae['logSuccess']?.(_0x3aa06d(0x14f)+_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]+'\x27'),_0x41d17b['updated']++);return{'action':_0x3199bb['action'],'name':_0x5620e9['yamlConfig'][_0x3aa06d(0x1a5)],'journeyId':_0x3199bb[_0x3aa06d(0x168)]};}catch(_0x154d51){const _0x4748e2=isHttp400Error(_0x154d51),_0xdc8a0d=_0x4748e2?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x214e72=getErrorMessage(_0x154d51);throw new SDKError(_0xdc8a0d,'Failed\x20to\x20'+(_0x5620e9[_0x3aa06d(0x1ff)]?_0x3aa06d(0x1ac):_0x3aa06d(0x219))+_0x3aa06d(0x1a6)+_0x5620e9[_0x3aa06d(0x155)]+_0x3aa06d(0x1b0)+_0x214e72,_0x154d51);}}));_0x41d17b[_0x255fa3(0x149)][_0x255fa3(0x19b)](..._0x5aebdb);}return _0x41d17b;}async function matchExistingJourneySegments(_0x50d340,_0x444cf1,_0x26f9e0,_0x31e173,_0x1231e8){const _0x428222=a151_0x3dca48;if(!_0x444cf1[_0x428222(0x17b)]||!_0x444cf1[_0x428222(0x1f3)][_0x428222(0x18a)])return;const _0xb96477=new Map(),_0x31321e=new Set();for(const _0x39284c of Object['keys'](_0x444cf1[_0x428222(0x1f3)][_0x428222(0x18a)])){const _0x9fded8=generateDeterministicJourneySegmentName(_0x444cf1[_0x428222(0x1f3)][_0x428222(0x1a5)],_0x39284c);_0xb96477['set'](_0x9fded8,_0x39284c),_0x31321e[_0x428222(0x158)](_0x39284c);}const _0x5509fc=[],_0x394abb=collectSegmentIdsFromJourneyApi(_0x444cf1[_0x428222(0x17b)]);for(const _0x26fe96 of _0x394abb){const _0x136374=await fetchSegment(_0x50d340,_0x26f9e0,_0x26fe96,_0x31e173);if(!_0x136374?.[_0x428222(0x1a5)])continue;const _0x331568=_0xb96477[_0x428222(0x1aa)](_0x136374['name']);_0x331568?(_0x1231e8[_0x428222(0x153)](_0x331568,_0x26fe96),_0x31321e['delete'](_0x331568)):_0x5509fc[_0x428222(0x19b)]({'id':_0x26fe96,'seg':_0x136374});}if(_0x31321e[_0x428222(0x1a3)]>0x0&&_0x5509fc[_0x428222(0x14a)]>0x0){const {localExpandedRuleToNames:_0x2636bc}=buildLocalExpandedRuleMappings(_0x444cf1['yamlConfig']),_0x222fb3=new Map();for(const {id:_0x30e5ea,seg:_0x85fa97}of _0x5509fc){if(_0x85fa97[_0x428222(0x214)]){const _0x51b80a=apiRuleToYaml(_0x85fa97[_0x428222(0x214)]);_0x222fb3[_0x428222(0x153)](_0x30e5ea,_0x51b80a);}}for(const {id:_0x227634,seg:_0x315db5}of _0x5509fc){if(!_0x315db5[_0x428222(0x214)])continue;const _0x19ac0e=_0x222fb3[_0x428222(0x1aa)](_0x227634);if(!_0x19ac0e)continue;const _0x262cc8=serializeExpandedRule(_0x19ac0e,_0x222fb3),_0x5ab154=_0x2636bc[_0x428222(0x1aa)](_0x262cc8);if(_0x5ab154){const _0x3ecad0=_0x5ab154[_0x428222(0x205)](_0x6d2a27=>_0x31321e['has'](_0x6d2a27));_0x3ecad0&&(_0x1231e8[_0x428222(0x153)](_0x3ecad0,_0x227634),_0x31321e[_0x428222(0x13d)](_0x3ecad0),logger[_0x428222(0x1d5)](_0x428222(0x1f9)+_0x315db5['name']+'\x27\x20to\x20local\x20\x27'+_0x3ecad0+_0x428222(0x206)));}}}}async function executeSingleJourneyPush(_0x119c0f,_0x1e4ddc,_0x5a1851,_0x7fbbe1,_0x3acb96,_0x10472c){const _0x2ad734=a151_0x3dca48,{journeyDefToRequest:_0x4e41ff,activationDefToCreateRequest:_0x468f52,yamlRuleToApi:_0x482ec4,validateSegmentRule:_0x208c8a}=_0x10472c,_0x119567=new Map(),_0x22a395=new Map();recoverSegmentIdsFromPushRecovery(_0x1e4ddc,_0x119567,_0x5a1851[_0x2ad734(0x152)]);const _0x268fd9=new Map(),_0x498038=new Map(),_0xcb306a=new Map();let _0x1e09cc;const _0x3d3536=async()=>{const _0x217ee4=_0x2ad734;if(_0x1e09cc)return;_0x1e09cc=new Map();if(!_0x1e4ddc[_0x217ee4(0x17b)])return;const _0x2c2ef8=await _0x119c0f[_0x217ee4(0x229)]['listActivations'](_0x1e4ddc['existingJourney']['id']);for(const _0x123299 of _0x2c2ef8){const _0x13e780=journeyActivationStepToYaml(_0x123299,_0x5a1851[_0x217ee4(0x1d9)],_0x5a1851[_0x217ee4(0x1e1)]),_0xbcdecb=activationSignature(_0x13e780);!_0x1e09cc[_0x217ee4(0x232)](_0xbcdecb)&&_0x1e09cc[_0x217ee4(0x153)](_0xbcdecb,_0x123299['id']),_0x13e780[_0x217ee4(0x1a5)]&&_0x22a395[_0x217ee4(0x153)](_0x13e780[_0x217ee4(0x1a5)],_0x123299['id']);}};await matchExistingJourneySegments(_0x119c0f,_0x1e4ddc,_0x7fbbe1[_0x2ad734(0x1cf)],_0x5a1851[_0x2ad734(0x192)],_0x5a1851[_0x2ad734(0x152)]);const _0x30580d={'resolveSegmentId':async _0x216354=>{const _0x4d70e4=_0x2ad734,_0x270c0c=_0x5a1851[_0x4d70e4(0x152)][_0x4d70e4(0x1aa)](_0x216354);if(!_0x270c0c)throw new SDKError(ErrorCode[_0x4d70e4(0x22b)],_0x4d70e4(0x1d4)+_0x216354+_0x4d70e4(0x182)+_0x1e4ddc[_0x4d70e4(0x1f3)][_0x4d70e4(0x1a5)]+')');return _0x270c0c;},'resolveEmbeddedSegmentId':async(_0x550b64,_0x404e39)=>{const _0xc65688=_0x2ad734,_0xff8830=_0x5a1851[_0xc65688(0x152)][_0xc65688(0x1aa)](_0x550b64);if(_0xff8830)return _0xff8830;const _0x10bfb8=_0x5a1851[_0xc65688(0x192)][_0xc65688(0x205)](_0x4ee694=>_0x4ee694['name']===_0x550b64);if(_0x10bfb8)return _0x5a1851[_0xc65688(0x152)][_0xc65688(0x153)](_0x550b64,_0x10bfb8['id']),_0x10bfb8['id'];if(_0x1e4ddc['isNew']){const {stageName:_0x1de239,criteriaName:_0x4cbe90}=findSegmentCriteriaLocation(_0x1e4ddc['yamlConfig'],_0x550b64);return _0x208c8a(_0x550b64,_0x404e39['rule']),_0x498038['set'](_0x550b64,{'definition':_0x404e39,'stageName':_0x1de239,'criteriaName':_0x4cbe90}),createPendingSegmentId(_0x550b64);}const _0x452a78=_0x1e4ddc[_0xc65688(0x17b)]?.['id'];if(!_0x452a78)throw new SDKError(ErrorCode[_0xc65688(0x180)],_0xc65688(0x135));const _0xfbcaf=_0x268fd9['get'](_0x550b64);if(_0xfbcaf)return _0xfbcaf;const _0x27ae87=((async()=>{const _0x5da21e=_0xc65688;_0x208c8a(_0x550b64,_0x404e39['rule']);const _0x21942d=generateDeterministicJourneySegmentName(_0x1e4ddc[_0x5da21e(0x1f3)][_0x5da21e(0x1a5)],_0x550b64),_0x163559=_0x5a1851['existingSegments'][_0x5da21e(0x205)](_0xc38bdf=>_0xc38bdf[_0x5da21e(0x1a5)]===_0x21942d),_0x351b67=createSegmentIdResolver(_0x5a1851[_0x5da21e(0x152)],_0x550b64),_0x9baf72=await resolveRuleSegmentIds(_0x404e39[_0x5da21e(0x214)],_0x351b67);let _0x1a381b;return _0x163559?(await _0x119c0f['segment'][_0x5da21e(0x1c6)](_0x7fbbe1[_0x5da21e(0x1cf)],_0x163559['id'],{'description':_0x404e39['description']||'Entry\x20criteria:\x20'+_0x550b64,'rule':_0x482ec4(_0x9baf72),'countPopulation':!![]}),_0x1a381b=_0x163559['id'],saveSegmentToPushRecovery(_0x1e4ddc['absolutePath'],_0x1e4ddc[_0x5da21e(0x1f3)][_0x5da21e(0x1a5)],_0x550b64,{'segmentId':_0x1a381b,'uniqueServerName':_0x21942d,'createdAt':new Date()[_0x5da21e(0x186)]()})):_0x1a381b=await createOrRecoverEmbeddedSegment(_0x119c0f,_0x1e4ddc,{'localName':_0x550b64,'uniqueSegmentName':_0x21942d,'description':_0x404e39[_0x5da21e(0x13b)]||_0x5da21e(0x16d)+_0x550b64,'journeyId':_0x452a78,'resolvedRule':_0x9baf72,'parentId':_0x7fbbe1['parentId'],'folderId':_0x7fbbe1[_0x5da21e(0x193)]||''},_0x482ec4),_0x5a1851[_0x5da21e(0x152)][_0x5da21e(0x153)](_0x550b64,_0x1a381b),_0x119567[_0x5da21e(0x153)](_0x550b64,_0x1a381b),_0x1a381b;})());_0x268fd9[_0xc65688(0x153)](_0x550b64,_0x27ae87);try{return await _0x27ae87;}finally{_0x268fd9[_0xc65688(0x13d)](_0x550b64);}},'resolveActivationId':async _0xa8a360=>{const _0x282350=_0x2ad734,_0x44d447=_0x22a395['get'](_0xa8a360);if(_0x44d447)return _0x44d447;if(_0x1e4ddc['existingJourney']){await _0x3d3536();const _0xc285b3=_0x22a395[_0x282350(0x1aa)](_0xa8a360);if(_0xc285b3)return _0xc285b3;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x282350(0x159)+_0xa8a360+_0x282350(0x182)+_0x1e4ddc[_0x282350(0x1f3)]['name']+_0x282350(0x212)+_0x282350(0x22a));},'resolveEmbeddedActivationId':async(_0x8fc52c,_0x332cdd)=>{const _0x3d4d7a=_0x2ad734,_0x2526ea=_0x22a395[_0x3d4d7a(0x1aa)](_0x8fc52c);if(_0x2526ea)return _0x2526ea;if(_0x1e4ddc[_0x3d4d7a(0x1ff)])return _0xcb306a[_0x3d4d7a(0x153)](_0x8fc52c,_0x332cdd),createPendingActivationId(_0x8fc52c);if(_0x1e4ddc[_0x3d4d7a(0x17b)]){await _0x3d3536();const _0x2b35e9=_0x22a395[_0x3d4d7a(0x1aa)](_0x332cdd['name']);if(_0x2b35e9)return _0x22a395['set'](_0x8fc52c,_0x2b35e9),_0x2b35e9;const _0x3675a9=activationSignature(_0x332cdd),_0x42ab04=_0x1e09cc?.[_0x3d4d7a(0x1aa)](_0x3675a9);if(_0x42ab04)return _0x22a395[_0x3d4d7a(0x153)](_0x8fc52c,_0x42ab04),_0x42ab04;const _0x34196f=await _0x468f52(_0x332cdd,_0x5a1851[_0x3d4d7a(0x15e)]),_0x5c2a35={..._0x34196f,..._0x332cdd['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x332cdd[_0x3d4d7a(0x1af)]}},_0x25928=await _0x119c0f['journey'][_0x3d4d7a(0x165)](_0x1e4ddc[_0x3d4d7a(0x17b)]['id'],_0x5c2a35);return _0x22a395[_0x3d4d7a(0x153)](_0x8fc52c,_0x25928['id']),_0x25928['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0xc1fab1=>{const _0x48788b=_0x2ad734;try{return await _0x119c0f['journey'][_0x48788b(0x217)](_0x7fbbe1[_0x48788b(0x1cf)],_0xc1fab1);}catch(_0x261187){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0xc1fab1+_0x48788b(0x1c5)+_0x1e4ddc[_0x48788b(0x1f3)][_0x48788b(0x1a5)]+'\x27)',_0x261187);}},'resolveStageId':async(_0x2e6757,_0x156276)=>{const _0x5ca0ee=_0x2ad734,_0x3b0979=await _0x119c0f[_0x5ca0ee(0x229)][_0x5ca0ee(0x169)](_0x2e6757),_0x54bded=_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x1c4)][_0x5ca0ee(0x205)](_0x2dca54=>_0x2dca54['name']['toLowerCase']()===_0x156276[_0x5ca0ee(0x203)]());if(!_0x54bded?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ca0ee(0x184)+_0x156276+_0x5ca0ee(0x1e2)+(_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x21a)]||_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x1a5)])+'\x27');return _0x54bded['id'];}},_0x3e2acd=await _0x4e41ff(_0x1e4ddc[_0x2ad734(0x1f3)],_0x7fbbe1['parentId'],_0x30580d),_0x2ac688=_0x7fbbe1[_0x2ad734(0x18c)]||_0x7fbbe1[_0x2ad734(0x193)];_0x2ac688&&(_0x3e2acd[_0x2ad734(0x174)]={'parentFolder':{'data':{'id':_0x2ac688,'type':'folder'}}});if(_0x1e4ddc[_0x2ad734(0x1ff)]){if(_0x498038[_0x2ad734(0x1a3)]>0x0||_0xcb306a[_0x2ad734(0x1a3)]>0x0)return await executeThreeStepJourneyCreate(_0x119c0f,_0x1e4ddc,_0x3e2acd,{'pendingEmbeddedSegments':_0x498038,'pendingEmbeddedActivations':_0xcb306a,'embeddedSegmentNameToId':_0x119567,'journeyActivationNameToId':_0x22a395},{..._0x7fbbe1,'effectiveFolderId':_0x2ac688},_0x5a1851,_0x3acb96,_0x10472c);else{ensureJourneyDefaults(_0x3e2acd['attributes']);const _0x43d136=await _0x119c0f[_0x2ad734(0x229)][_0x2ad734(0x1ac)](_0x3e2acd);return deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':'created','journeyId':_0x43d136['id'],'embeddedSegmentNameToId':_0x119567};}}else{if(_0x1e4ddc[_0x2ad734(0x19c)]&&_0x1e4ddc['existingJourney']){_0x3e2acd['id']=_0x1e4ddc['existingJourney']['id'];const _0x5ab40c=_0x3e2acd[_0x2ad734(0x1ec)];_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]?.[_0x2ad734(0x21a)]&&(_0x5ab40c[_0x2ad734(0x21a)]=_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]['journeyBundleName']);const _0x508ccf=_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]?.[_0x2ad734(0x1c4)];return _0x508ccf&&_0x3e2acd['attributes'][_0x2ad734(0x1c4)]&&injectExistingStageIds(_0x3e2acd[_0x2ad734(0x1ec)]['journeyStages'],_0x508ccf),ensureJourneyDefaults(_0x5ab40c),await _0x119c0f['journey'][_0x2ad734(0x219)](_0x1e4ddc[_0x2ad734(0x17b)]['id'],_0x3e2acd),deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':_0x2ad734(0x164),'journeyId':_0x1e4ddc[_0x2ad734(0x17b)]['id'],'embeddedSegmentNameToId':_0x119567};}}return deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':_0x2ad734(0x14d),'journeyId':_0x1e4ddc[_0x2ad734(0x17b)]?.['id'],'embeddedSegmentNameToId':_0x119567};}function findSegmentCriteriaLocation(_0x844b00,_0x3af8a5){const _0xad1b9=a151_0x3dca48,_0x3780ee=_0x844b00[_0xad1b9(0x1cd)]||_0x844b00[_0xad1b9(0x1e8)]?.[0x0]?.['stages']||[];let _0x5a0dc7=_0xad1b9(0x173),_0x3f3f89=_0x3af8a5;const _0x57c7c5=_0x844b00[_0xad1b9(0x230)]||_0x844b00[_0xad1b9(0x1e8)]?.[0x0]?.[_0xad1b9(0x230)];if(_0x57c7c5?.['segment']===_0x3af8a5)return{'stageName':'goal','criteriaName':_0x57c7c5[_0xad1b9(0x1a5)]||_0x3af8a5};_0x2e4642:for(const _0x435f70 of _0x3780ee){if(_0x435f70['entry_criteria']?.[_0xad1b9(0x1b6)]===_0x3af8a5){_0x5a0dc7=_0x435f70[_0xad1b9(0x1a5)],_0x3f3f89=_0x435f70[_0xad1b9(0x1b3)][_0xad1b9(0x1a5)]||_0x3af8a5;break;}if(_0x435f70[_0xad1b9(0x170)])for(const _0x5e142f of _0x435f70['steps']){if(_0x5e142f[_0xad1b9(0x1ed)]===_0xad1b9(0x21c)&&_0x5e142f[_0xad1b9(0x1dd)]?.[_0xad1b9(0x234)])for(const _0x2e4e88 of _0x5e142f['with']['branches']){if(_0x2e4e88['segment']===_0x3af8a5){_0x5a0dc7=_0x435f70[_0xad1b9(0x1a5)],_0x3f3f89=_0x2e4e88[_0xad1b9(0x1a5)]||_0x3af8a5;break _0x2e4642;}}}}return{'stageName':_0x5a0dc7,'criteriaName':_0x3f3f89};}async function executeThreeStepJourneyCreate(_0x1cd8f3,_0x4ed854,_0x2c221e,_0x30db65,_0x33f64d,_0x13d81c,_0x131dc4,_0x2b78e7){const _0x4d8b07=a151_0x3dca48,{activationDefToCreateRequest:_0xb4d1ac,yamlRuleToApi:_0x4ea1e6}=_0x2b78e7,{pendingEmbeddedSegments:_0x4df3c1,pendingEmbeddedActivations:_0x4abe42,embeddedSegmentNameToId:_0x4c87fc}=_0x30db65,_0x10d8c3=JSON[_0x4d8b07(0x1de)](JSON['stringify'](_0x2c221e));ensureJourneyDefaults(_0x10d8c3[_0x4d8b07(0x1ec)]),stripPendingIds(_0x10d8c3);const _0xfc9d44=await _0x1cd8f3[_0x4d8b07(0x229)]['create'](_0x10d8c3),_0x568c36=_0xfc9d44['id'],_0x1008b5=new Map();for(const _0x5008eb of _0xfc9d44[_0x4d8b07(0x1ec)][_0x4d8b07(0x1c4)]){_0x1008b5[_0x4d8b07(0x153)](_0x5008eb[_0x4d8b07(0x1a5)]['toLowerCase'](),_0x5008eb['id']);}recoverSegmentIdsFromPushRecovery(_0x4ed854,_0x4c87fc,_0x13d81c[_0x4d8b07(0x152)]);for(const [_0x535637,{definition:_0x2bdf82}]of _0x4df3c1){if(_0x4c87fc[_0x4d8b07(0x232)](_0x535637)){_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x13a),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});continue;}const _0x54c19e=generateDeterministicJourneySegmentName(_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],_0x535637);_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x146),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});const _0x22ed5f=createSegmentIdResolver(_0x13d81c['segmentNameToId'],_0x535637),_0x1d8b67=await resolveRuleSegmentIds(_0x2bdf82[_0x4d8b07(0x214)],_0x22ed5f),_0x2e2d29=await createOrRecoverEmbeddedSegment(_0x1cd8f3,_0x4ed854,{'localName':_0x535637,'uniqueSegmentName':_0x54c19e,'description':_0x2bdf82['description']||'Entry\x20criteria:\x20'+_0x535637,'journeyId':_0x568c36,'resolvedRule':_0x1d8b67,'parentId':_0x33f64d[_0x4d8b07(0x1cf)],'folderId':_0x33f64d[_0x4d8b07(0x236)]||''},_0x4ea1e6);_0x4c87fc[_0x4d8b07(0x153)](_0x535637,_0x2e2d29),_0x13d81c['segmentNameToId'][_0x4d8b07(0x153)](_0x535637,_0x2e2d29),_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x13a),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});}const _0x5f5b16=new Map();for(const [_0x4fbeed,_0x2dbd47]of _0x4abe42){_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x1cb),'journeyName':_0x4ed854['yamlConfig'][_0x4d8b07(0x1a5)],'activationName':_0x4fbeed});const _0x52b063=await _0xb4d1ac(_0x2dbd47,_0x13d81c['activationContext']),_0x194247={..._0x52b063,..._0x2dbd47[_0x4d8b07(0x1af)]!==undefined&&{'runAfterJourneyRefresh':_0x2dbd47[_0x4d8b07(0x1af)]}},_0x2bdc0c=await _0x1cd8f3[_0x4d8b07(0x229)][_0x4d8b07(0x165)](_0x568c36,_0x194247);_0x5f5b16[_0x4d8b07(0x153)](_0x4fbeed,_0x2bdc0c['id']),_0x30db65[_0x4d8b07(0x14b)][_0x4d8b07(0x153)](_0x4fbeed,_0x2bdc0c['id']),_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x1b2),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'activationName':_0x4fbeed});}const _0x2364fd=JSON[_0x4d8b07(0x1de)](JSON[_0x4d8b07(0x1eb)](_0x2c221e));return _0x2364fd['id']=_0x568c36,ensureJourneyDefaults(_0x2364fd[_0x4d8b07(0x1ec)]),resolvePendingIdsInRequest(_0x2364fd,_0x2c221e,_0x1008b5,_0x4c87fc,_0x5f5b16,_0x131dc4),await _0x1cd8f3[_0x4d8b07(0x229)]['update'](_0x568c36,_0x2364fd),deletePushRecovery(_0x4ed854[_0x4d8b07(0x155)]),{'action':'created','journeyId':_0x568c36,'embeddedSegmentNameToId':_0x4c87fc};}export function stripWaitStepPendingIds(_0x16c3e1){const _0x168dc7=a151_0x3dca48,_0x2408b5=_0x16c3e1[_0x168dc7(0x13c)]&&isPendingSegmentId(_0x16c3e1['conditionSegmentId']),_0x59113f=_0x16c3e1[_0x168dc7(0x138)]?.[_0x168dc7(0x145)](_0x2170cf=>_0x2170cf[_0x168dc7(0x1f5)]&&isPendingSegmentId(_0x2170cf[_0x168dc7(0x1f5)]));(_0x2408b5||_0x59113f)&&(_0x16c3e1['waitStepType']=_0x168dc7(0x185),_0x16c3e1[_0x168dc7(0x183)]=0x1,_0x16c3e1[_0x168dc7(0x1ae)]='day',delete _0x16c3e1[_0x168dc7(0x13c)],delete _0x16c3e1[_0x168dc7(0x1df)],delete _0x16c3e1['conditionTimeoutUnit'],delete _0x16c3e1[_0x168dc7(0x138)]);}export function resolveWaitStepPendingIds(_0x24f568,_0x1bdd0e,_0x417fff,_0x53118e){const _0x125730=a151_0x3dca48;if(_0x1bdd0e[_0x125730(0x13c)]&&isPendingSegmentId(_0x1bdd0e[_0x125730(0x13c)])){const _0x4ee527=_0x417fff(_0x1bdd0e[_0x125730(0x13c)],_0x125730(0x1c1)+_0x53118e+_0x125730(0x1bc));_0x4ee527&&(_0x24f568[_0x125730(0x1b4)]='Condition',_0x24f568[_0x125730(0x13c)]=_0x4ee527,delete _0x24f568[_0x125730(0x183)],delete _0x24f568['waitStepUnit'],_0x1bdd0e[_0x125730(0x1df)]!==undefined&&(_0x24f568[_0x125730(0x1df)]=_0x1bdd0e[_0x125730(0x1df)]),_0x1bdd0e['conditionTimeoutUnit']&&(_0x24f568[_0x125730(0x1db)]=_0x1bdd0e['conditionTimeoutUnit']));}if(_0x1bdd0e[_0x125730(0x138)]){const _0x42c2c8=_0x1bdd0e[_0x125730(0x138)]['some'](_0x305992=>_0x305992[_0x125730(0x1f5)]&&isPendingSegmentId(_0x305992[_0x125730(0x1f5)]));if(_0x42c2c8){const _0x4136f1=_0x1bdd0e[_0x125730(0x138)][_0x125730(0x237)](_0x241ce5=>{const _0x56afbb=_0x125730;if(_0x241ce5[_0x56afbb(0x1f5)]&&isPendingSegmentId(_0x241ce5['segmentId'])){const _0x589b2f=_0x417fff(_0x241ce5['segmentId'],_0x56afbb(0x1c1)+_0x53118e+_0x56afbb(0x1bc));return{..._0x241ce5,'segmentId':_0x589b2f||_0x241ce5[_0x56afbb(0x1f5)]};}return{..._0x241ce5};});_0x24f568[_0x125730(0x1b4)]=_0x125730(0x19e),_0x24f568[_0x125730(0x138)]=_0x4136f1,delete _0x24f568['waitStep'],delete _0x24f568[_0x125730(0x1ae)],delete _0x24f568['conditionSegmentId'],delete _0x24f568[_0x125730(0x1df)],delete _0x24f568[_0x125730(0x1db)];}}}function stripPendingIds(_0x37cc64){const _0x2cd91f=a151_0x3dca48;_0x37cc64[_0x2cd91f(0x1ec)][_0x2cd91f(0x230)]?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0x37cc64['attributes'][_0x2cd91f(0x230)][_0x2cd91f(0x1f5)])&&delete _0x37cc64[_0x2cd91f(0x1ec)][_0x2cd91f(0x230)];for(const _0xa93c1f of _0x37cc64[_0x2cd91f(0x1ec)]['journeyStages']||[]){_0xa93c1f[_0x2cd91f(0x18f)]?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0xa93c1f[_0x2cd91f(0x18f)][_0x2cd91f(0x1f5)])&&delete _0xa93c1f['entryCriteria'];_0xa93c1f['milestone']?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0xa93c1f[_0x2cd91f(0x23a)][_0x2cd91f(0x1f5)])&&delete _0xa93c1f[_0x2cd91f(0x23a)];_0xa93c1f['exitCriterias']&&(_0xa93c1f[_0x2cd91f(0x1ce)]=_0xa93c1f['exitCriterias']['filter'](_0x7a8288=>!_0x7a8288[_0x2cd91f(0x1f5)]||!isPendingSegmentId(_0x7a8288['segmentId'])));if(_0xa93c1f['steps'])for(const _0x5b510d of Object[_0x2cd91f(0x143)](_0xa93c1f[_0x2cd91f(0x170)])){const _0x292b67=_0xa93c1f['steps'][_0x5b510d];_0x292b67[_0x2cd91f(0x1ed)]===_0x2cd91f(0x20f)&&_0x292b67[_0x2cd91f(0x150)]&&isPendingActivationId(_0x292b67[_0x2cd91f(0x150)])&&(_0x292b67[_0x2cd91f(0x150)]='');if(_0x292b67[_0x2cd91f(0x1ed)]===_0x2cd91f(0x220)&&_0x292b67[_0x2cd91f(0x234)])for(const _0x1bf9b1 of _0x292b67[_0x2cd91f(0x234)]){_0x1bf9b1['segmentId']&&isPendingSegmentId(_0x1bf9b1[_0x2cd91f(0x1f5)])&&(_0x1bf9b1[_0x2cd91f(0x1f5)]='');}_0x292b67[_0x2cd91f(0x1ed)]==='WaitStep'&&stripWaitStepPendingIds(_0x292b67);}}}function resolvePendingIdsInRequest(_0x52c8b5,_0x56f466,_0x520d0d,_0x4c22c5,_0x442902,_0x2088de){const _0x3a73d2=a151_0x3dca48,_0x23be1b=(_0x370db2,_0x2be263)=>{const _0x529786=a151_0x1b24;if(!isPendingSegmentId(_0x370db2))return _0x370db2;const _0xb5a485=extractPendingSegmentName(_0x370db2),_0x49b4c1=_0x4c22c5['get'](_0xb5a485);return!_0x49b4c1&&_0x2088de['logWarning']?.(_0x529786(0x1ef)+_0xb5a485+_0x529786(0x199)+_0x2be263),_0x49b4c1;};if(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]['segmentId'])){const _0x21cbac=_0x23be1b(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]['segmentId'],'goal\x20criteria');_0x21cbac&&(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)][_0x3a73d2(0x1f5)]=_0x21cbac);}for(const _0x5577a6 of _0x52c8b5['attributes'][_0x3a73d2(0x1c4)]||[]){const _0x54e643=_0x520d0d[_0x3a73d2(0x1aa)](_0x5577a6[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]());_0x54e643&&(_0x5577a6['id']=_0x54e643);if(_0x5577a6['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)])){const _0x31d421=_0x23be1b(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+_0x3a73d2(0x1fa));_0x31d421&&(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)]=_0x31d421);}if(_0x5577a6['exitCriterias'])for(const _0x10b884 of _0x5577a6[_0x3a73d2(0x1ce)]){if(_0x10b884['segmentId']&&isPendingSegmentId(_0x10b884[_0x3a73d2(0x1f5)])){const _0xe6b311=_0x23be1b(_0x10b884[_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+_0x3a73d2(0x1c7));_0xe6b311&&(_0x10b884[_0x3a73d2(0x1f5)]=_0xe6b311);}}if(_0x5577a6[_0x3a73d2(0x23a)]?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x5577a6['milestone']['segmentId'])){const _0x58cabb=_0x23be1b(_0x5577a6[_0x3a73d2(0x23a)][_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+'\x27\x20milestone');_0x58cabb&&(_0x5577a6[_0x3a73d2(0x23a)]['segmentId']=_0x58cabb);}if(_0x5577a6[_0x3a73d2(0x170)]){const _0x3676cf=_0x2f9b93=>_0x56f466[_0x3a73d2(0x1ec)]['journeyStages']?.[_0x3a73d2(0x205)](_0x4b7a41=>_0x4b7a41[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]()===_0x5577a6[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]())?.['steps']?.[_0x2f9b93];for(const _0x7d038a of Object[_0x3a73d2(0x143)](_0x5577a6[_0x3a73d2(0x170)])){const _0x40c647=_0x5577a6[_0x3a73d2(0x170)][_0x7d038a],_0x10b4b6=_0x3676cf(_0x7d038a);if(_0x40c647[_0x3a73d2(0x1ed)]==='Activation'&&_0x40c647[_0x3a73d2(0x150)]&&(isPendingActivationId(_0x40c647[_0x3a73d2(0x150)])||_0x40c647[_0x3a73d2(0x150)]==='')){if(_0x10b4b6?.['journeyActivationStepId']&&isPendingActivationId(_0x10b4b6[_0x3a73d2(0x150)])){const _0x2990df=extractPendingActivationName(_0x10b4b6['journeyActivationStepId']),_0x234ecb=_0x442902[_0x3a73d2(0x1aa)](_0x2990df);_0x234ecb&&(_0x40c647[_0x3a73d2(0x150)]=_0x234ecb);}}if(_0x40c647['type']===_0x3a73d2(0x220)&&_0x40c647[_0x3a73d2(0x234)]&&_0x10b4b6?.[_0x3a73d2(0x234)])for(let _0x8f0ebf=0x0;_0x8f0ebf<_0x40c647[_0x3a73d2(0x234)][_0x3a73d2(0x14a)];_0x8f0ebf++){const _0x111c38=_0x40c647[_0x3a73d2(0x234)][_0x8f0ebf],_0x40bb82=_0x10b4b6[_0x3a73d2(0x234)][_0x8f0ebf];if(_0x40bb82?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x40bb82[_0x3a73d2(0x1f5)])){const _0x2c7de3=_0x23be1b(_0x40bb82['segmentId'],_0x3a73d2(0x1c1)+_0x5577a6[_0x3a73d2(0x1a5)]+_0x3a73d2(0x23e)+(_0x111c38[_0x3a73d2(0x1a5)]||_0x8f0ebf)+'\x27');_0x2c7de3&&(_0x111c38['segmentId']=_0x2c7de3);}}_0x40c647[_0x3a73d2(0x1ed)]===_0x3a73d2(0x1f2)&&_0x10b4b6?.['type']===_0x3a73d2(0x1f2)&&resolveWaitStepPendingIds(_0x40c647,_0x10b4b6,_0x23be1b,_0x5577a6['name']);}}}}
1
+ const a151_0x35cf28=a151_0xb026;(function(_0x36d25d,_0x2b9d4d){const _0x4791e7=a151_0xb026,_0x462be2=_0x36d25d();while(!![]){try{const _0x34f885=-parseInt(_0x4791e7(0x125))/0x1+-parseInt(_0x4791e7(0x15e))/0x2+-parseInt(_0x4791e7(0x13d))/0x3*(parseInt(_0x4791e7(0x112))/0x4)+-parseInt(_0x4791e7(0x1b2))/0x5*(parseInt(_0x4791e7(0x1e5))/0x6)+parseInt(_0x4791e7(0x19a))/0x7*(-parseInt(_0x4791e7(0x191))/0x8)+parseInt(_0x4791e7(0x1bf))/0x9*(-parseInt(_0x4791e7(0x1a8))/0xa)+-parseInt(_0x4791e7(0x14a))/0xb*(-parseInt(_0x4791e7(0xfb))/0xc);if(_0x34f885===_0x2b9d4d)break;else _0x462be2['push'](_0x462be2['shift']());}catch(_0x3027d4){_0x462be2['push'](_0x462be2['shift']());}}}(a151_0x1f65,0x87f66));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');function a151_0x1f65(){const _0x450e77=['create','connectionIdToNameMap','segmentNameToId','add','connection','activation_template_id','message','goal\x20criteria','\x27\x20entry\x20criteria','rule','80MraCsS','trim','behavior','\x27\x20from\x20file:\x20',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','stages','updateSegmentById','conditionTimeoutDuration','SEGMENT_NOT_FOUND','87927ZNzxEx','push','Created\x20folder\x20\x27','notification','segment_updated','createActivation','yamlConfig','Entry\x20criteria:\x20','\x20journey\x20from\x20file:\x20','schedule','\x27\x20exit\x20criteria','journeyActivationNameToId','waitStepType','idToEmailMap','4011790vACPCg','conditionSegmentId','slice','segment','Deleted\x20segment\x20\x27','entry','verbose','\x27\x20milestone','updateActivation','journeyActivationStepId','695ZTebvY','createdSegmentId','buildUserMaps','./child-segment-yaml.js','results','deleteActivation','\x27\x20wait\x20condition','decision_point','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','existingSegments','valid','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Creating\x20activation\x20\x27','9PiJZzS','Matched\x20server\x20segment\x20\x27','\x20error(s)','journeyBundlesByFolderAndName','stringify','uniqueServerName','embeddedSegmentNameToId','null','state','fetchJourney','diff','activation_updating','isNew','\x20(referenced\x20in\x20journey\x20','waitStep','nameToId','validatedRequest','Name\x20has\x20already\x20been\x20taken','Updating\x20activation\x20\x27','DecisionPoint','existingJourney','rootFolderId','unchanged','activationParams','journey_created','activation_updated','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activation_created','\x20segment\x20from\x20file:\x20','draft','join','Failed\x20to\x20fetch\x20referenced\x20segment\x20','all_columns','embedded_segment_creating','entries','journeys','entry_criteria','some','23514uDwWqR','waitStepUnit','logSuccess','length','createJourneySegment','parentSegmentFolder','toString','data','folder','createSegment','embedded_activation_creating','update','digest','INTERNAL','idToName','activationsBySegmentId','milestone','Journey\x20\x27','Fetching\x20','flatMap','Creating\x20segment\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','parentId','stage\x20\x27','journey_entry_criteria_','max','yamlActivation','set','\x27\x20for\x20','getSegment\x20failed\x20for\x20','effectiveFolderId','localName','ACTIVATION_UPDATE_ERROR','17225760PClGkk','./journey-yaml.js','with','parse','Delete\x20the\x20push\x20recovery\x20file\x20(','Segment\x20not\x20found:\x20','Activation','WaitStep','created','Failed\x20to\x20','from','reduce','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','goal','conditionTimeoutUnit','filter','list','\x27\x20decision\x20point\x20branch\x20\x27','embedded_segment_created','exitCriterias','attributes','journeyById','activationActions','2564780MYhKdP','SEGMENT_UPDATE_ERROR','toLowerCase','Created\x20journey\x20\x27','activations','delete','Deleted\x20activation\x20\x27','columns','journey_updating','uniqueSegmentName','versionNumber','resolveSegment','getSegment','../../utils/async.js','segmentByFolderAndName','SEGMENT_SYNTAX_ERROR','nameToType','deps','activationContext','223827lrGBCX','Embedded\x20segment\x20\x27','.$1.push-recovery.json','Segment\x20not\x20found','listActivations','journeyId','description','user','\x27...','Condition','index','folderPathToId','onProgress','utf-8','segment_deleted','Activation\x20not\x20found:\x20','branches','segments','errors','progress','embedded_activation_created','segment_deleting','match','segmentId','3sRUrmk','dirname','entryCriteria',').\x20','segmentFolderId','Failed\x20to\x20resolve\x20segment\x20','conditions','JOURNEY_SYNTAX_ERROR','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_creating','__pending_','withProgress','journey','22AmYegB','keys','has','logInfo','get','sha1','existingActivation','resolveJourneyId','type','debug','getLatestJourneyId','folder_created','all','split','activationStepsById','Updated\x20activation\x20\x27','NOT_FOUND','name','toISOString','item','755012NHVfwf','folderId','activation_','Deleting\x20activation\x20\x27','journeyStages','find','and\x20the\x20server\x20segment,\x20then\x20retry.','action','activation_deleted','parseDocument','hasChanges','absolutePath','logWarning','map','parentFolder','getActivation','\x0a\x20\x20','getSegmentEntity','):\x20','journeyName','getJourney','existingSegment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','includes','deleted','folderPath','updated','journeyBundleName','sort','run_after_journey_refresh','logDeleted','steps','relative','journeyBundleId','size','startsWith','relationships','connector_config','replace','isArray','Created\x20segment\x20\x27'];a151_0x1f65=function(){return _0x450e77;};return a151_0x1f65();}export const PENDING_SEGMENT_PREFIX=a151_0x35cf28(0x147);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x40dfa3){return''+PENDING_SEGMENT_PREFIX+_0x40dfa3+'__';}export function isPendingSegmentId(_0x2fac80){const _0x5d93cf=a151_0x35cf28;return _0x2fac80[_0x5d93cf(0x181)](PENDING_SEGMENT_PREFIX)&&!_0x2fac80[_0x5d93cf(0x181)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x350625){const _0x256f50=a151_0x35cf28;return _0x350625[_0x256f50(0x184)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x389850){return''+PENDING_ACTIVATION_PREFIX+_0x389850+'__';}export function isPendingActivationId(_0x40e166){const _0x492303=a151_0x35cf28;return _0x40e166[_0x492303(0x181)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x177784){const _0x561d0b=a151_0x35cf28;return _0x177784[_0x561d0b(0x184)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4e035a,_0x251e9f){const _0x30168b=a151_0x35cf28,_0x3a4239=_0x4e035a+'::'+(_0x251e9f[_0x30168b(0x192)]()||_0x30168b(0x1ab)),_0xd2a668=createHash(_0x30168b(0x14f))[_0x30168b(0xe5)](_0x3a4239)[_0x30168b(0xe6)]('hex')[_0x30168b(0x1aa)](0x0,0xc);return _0x30168b(0xf2)+_0xd2a668;}export function ensureJourneyDefaults(_0xb98890){const _0x2cf647=a151_0x35cf28;!_0xb98890['description']&&(_0xb98890[_0x2cf647(0x12b)]=''),!_0xb98890[_0x2cf647(0x1c7)]&&(_0xb98890[_0x2cf647(0x1c7)]=_0x2cf647(0x1dc));}export function injectExistingStageIds(_0x3100f8,_0x43c884){const _0x40d5fe=a151_0x35cf28,_0x5541c6=new Map(_0x43c884[_0x40d5fe(0x16b)](_0x5d0eea=>[_0x5d0eea[_0x40d5fe(0x15b)],_0x5d0eea['id']]));for(const _0x461e69 of _0x3100f8){if(!_0x461e69['id']){const _0x27e858=_0x5541c6[_0x40d5fe(0x14e)](_0x461e69['name']);_0x27e858&&(_0x461e69['id']=_0x27e858);}}}export function resolveTDFolderPath(_0x5983d9,_0x5957ee,_0xe08e00){if(!_0x5957ee)return _0x5983d9;if(_0x5983d9===_0xe08e00||_0x5983d9['startsWith'](_0xe08e00+'/'))return _0x5983d9;return _0x5983d9?_0xe08e00+'/'+_0x5983d9:_0xe08e00;}export function addFoldersToCreate(_0x1c1acd,_0xaaa19c,_0x222231){const _0x220899=a151_0x35cf28;if(!_0x1c1acd)return;if(_0xaaa19c['has'](_0x1c1acd))return;const _0x38bf9b=_0x1c1acd[_0x220899(0x157)]('/');let _0x4aacd0='';for(const _0x4d386e of _0x38bf9b){_0x4aacd0=_0x4aacd0?_0x4aacd0+'/'+_0x4d386e:_0x4d386e,!_0xaaa19c['has'](_0x4aacd0)&&_0x222231[_0x220899(0x18a)](_0x4aacd0);}}export function sortFoldersByDepth(_0x1255a4){const _0x1fc478=a151_0x35cf28;return[..._0x1255a4][_0x1fc478(0x17a)]((_0x410d75,_0x283bbd)=>{const _0x194004=_0x1fc478,_0x1c272b=(_0x410d75['match'](/\//g)||[])[_0x194004(0x1e8)],_0x58355f=(_0x283bbd[_0x194004(0x13b)](/\//g)||[])[_0x194004(0x1e8)];return _0x1c272b-_0x58355f;});}import*as a151_0x2b4032 from'yaml';import{readFileSync}from'fs';import a151_0x5f3456 from'path';import{isJourneyDef,parseYamlString as a151_0xcaeed4,toYamlString as a151_0x1864f0,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(_0x8d22d3){const _0x505706=a151_0x35cf28;if(Array[_0x505706(0x185)](_0x8d22d3))return'['+_0x8d22d3[_0x505706(0x16b)](_0x708631=>stableStringify(_0x708631))['join'](',')+']';if(_0x8d22d3&&typeof _0x8d22d3==='object'){const _0x350f1a=_0x8d22d3,_0x51174a=Object['keys'](_0x350f1a)[_0x505706(0x17a)](),_0x147ae0=_0x51174a[_0x505706(0x16b)](_0x492e72=>'\x22'+_0x492e72+'\x22:'+stableStringify(_0x350f1a[_0x492e72]));return'{'+_0x147ae0['join'](',')+'}';}const _0x51f122=JSON['stringify'](_0x8d22d3);return _0x51f122===undefined?_0x505706(0x1c6):_0x51f122;}function activationSignature(_0x375106){const _0x383cf7=a151_0x35cf28,_0x55acbb={'connection':_0x375106[_0x383cf7(0x18b)],..._0x375106[_0x383cf7(0x1df)]!==undefined&&{'all_columns':_0x375106[_0x383cf7(0x1df)]},..._0x375106['columns']!==undefined&&{'columns':_0x375106[_0x383cf7(0x119)]},..._0x375106[_0x383cf7(0x193)]!==undefined&&{'behavior':_0x375106['behavior']},..._0x375106[_0x383cf7(0x1a3)]!==undefined&&{'schedule':_0x375106[_0x383cf7(0x1a3)]},..._0x375106[_0x383cf7(0x19d)]!==undefined&&{'notification':_0x375106['notification']},..._0x375106[_0x383cf7(0x183)]!==undefined&&{'connector_config':_0x375106[_0x383cf7(0x183)]},..._0x375106['activation_template_id']!==undefined&&{'activation_template_id':_0x375106[_0x383cf7(0x18c)]}};return stableStringify(_0x55acbb);}async function fetchSegment(_0x59252c,_0x33d36d,_0x5d8624,_0x1bb926){const _0x165266=a151_0x35cf28,_0x1408f4=_0x1bb926?.[_0x165266(0x163)](_0x8feda4=>_0x8feda4['id']===_0x5d8624);if(_0x1408f4)return _0x1408f4;try{return await _0x59252c['segment'][_0x165266(0x11e)](_0x33d36d,_0x5d8624);}catch(_0xa783ab){logger[_0x165266(0x153)](_0x165266(0xf7)+_0x5d8624+_0x165266(0x195)+_0xa783ab);try{return await _0x59252c['segment'][_0x165266(0x16f)](_0x5d8624);}catch(_0xb9faa7){return logger[_0x165266(0x153)](_0x165266(0xef)+_0x5d8624+':\x20'+_0xb9faa7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5ea338,_0x24777a,_0x6901ee){const _0x524669=a151_0x35cf28,_0xac53be=readPushRecovery(_0x5ea338[_0x524669(0x169)]);if(_0xac53be?.[_0x524669(0x171)]===_0x5ea338[_0x524669(0x1a0)]['name'])for(const [_0x26b812,_0x54643f]of Object[_0x524669(0x1e1)](_0xac53be['segments'])){const _0x5ba234=generateDeterministicJourneySegmentName(_0x5ea338[_0x524669(0x1a0)][_0x524669(0x15b)],_0x26b812);_0x54643f[_0x524669(0x1c4)]===_0x5ba234&&(_0x24777a[_0x524669(0xf5)](_0x26b812,_0x54643f[_0x524669(0x13c)]),_0x6901ee['set'](_0x26b812,_0x54643f[_0x524669(0x13c)]));}}async function createOrRecoverEmbeddedSegment(_0x433471,_0xb186f0,_0xe8d3f9,_0x498131){const _0x3885a4=a151_0x35cf28;let _0x5d5dab;try{_0x5d5dab=await _0x433471[_0x3885a4(0x1ab)][_0x3885a4(0x1e9)]({'name':_0xe8d3f9[_0x3885a4(0x11b)],'description':_0xe8d3f9[_0x3885a4(0x12b)],'journeyId':_0xe8d3f9['journeyId'],'rule':_0x498131(_0xe8d3f9['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0xe8d3f9['folderId'],'audienceId':_0xe8d3f9[_0x3885a4(0xf0)]});}catch(_0x5674a4){const _0x3d96a8=_0x5674a4 instanceof Error&&_0x5674a4[_0x3885a4(0x18d)][_0x3885a4(0x175)](_0x3885a4(0x1d0));if(_0x3d96a8){const _0x4af536=readPushRecovery(_0xb186f0['absolutePath']),_0x717ac4=_0x4af536?.[_0x3885a4(0x171)]===_0xb186f0['yamlConfig'][_0x3885a4(0x15b)]?_0x4af536[_0x3885a4(0x136)][_0xe8d3f9[_0x3885a4(0xf9)]]:undefined;if(_0x717ac4?.[_0x3885a4(0x1c4)]===_0xe8d3f9[_0x3885a4(0x11b)])await _0x433471[_0x3885a4(0x1ab)]['updateSegmentById'](_0xe8d3f9[_0x3885a4(0xf0)],_0x717ac4['segmentId'],{'description':_0xe8d3f9[_0x3885a4(0x12b)],'rule':_0x498131(_0xe8d3f9['resolvedRule'],!![]),'countPopulation':!![]}),_0x5d5dab=_0x717ac4[_0x3885a4(0x13c)];else throw new SDKError(ErrorCode[_0x3885a4(0x113)],_0x3885a4(0x126)+_0xe8d3f9[_0x3885a4(0xf9)]+_0x3885a4(0x145)+(_0x3885a4(0xff)+_0xb186f0[_0x3885a4(0x169)][_0x3885a4(0x184)](/([^/]+)$/,_0x3885a4(0x127))+')\x20')+_0x3885a4(0x164),_0x5674a4);}else throw _0x5674a4;}return saveSegmentToPushRecovery(_0xb186f0['absolutePath'],_0xb186f0[_0x3885a4(0x1a0)][_0x3885a4(0x15b)],_0xe8d3f9['localName'],{'segmentId':_0x5d5dab,'uniqueServerName':_0xe8d3f9['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x5d5dab;}export async function prepareSegmentFiles(_0x5865a7,_0x1415f9,_0x1aff97,_0x51c6a2,_0x1bb82c){const _0x271683=a151_0x35cf28,{activationDefToCreateRequest:_0x55f25e}=await import(_0x271683(0x1b5)),_0x5af5d2=[],_0x6124ef=new Set();for(const {yamlConfig:_0x27c2f1,folderPath:_0x4d6292,sourcePath:_0x225302}of _0x5865a7){const _0x2bc96d=resolveTDFolderPath(_0x4d6292,_0x51c6a2,_0x1bb82c),_0x8088cf=_0x2bc96d+':'+_0x27c2f1[_0x271683(0x15b)],_0x40cc22=_0x1415f9[_0x271683(0x120)][_0x271683(0x14e)](_0x8088cf),_0x1b4627=_0x40cc22?_0x1415f9[_0x271683(0xe9)][_0x271683(0x14e)](_0x40cc22['id'])||[]:[];addFoldersToCreate(_0x2bc96d,_0x1415f9[_0x271683(0x130)],_0x6124ef);const _0xb9bc37=calculateActivationActions(_0x27c2f1[_0x271683(0x116)]||[],_0x1b4627,_0x1415f9[_0x271683(0x1a7)],_0x1415f9[_0x271683(0x188)]);for(const _0x3acee2 of _0xb9bc37){(_0x3acee2[_0x271683(0x152)]===_0x271683(0x187)||_0x3acee2['type']===_0x271683(0xe5))&&_0x3acee2['yamlActivation']&&(_0x3acee2[_0x271683(0x1cf)]=await _0x55f25e(_0x3acee2[_0x271683(0xf4)],_0x1aff97));}const _0x490c13=calculateSegmentDiff(_0x27c2f1,_0x40cc22,_0x1b4627,_0x1415f9['idToEmailMap'],_0x1415f9[_0x271683(0x188)]);_0x5af5d2[_0x271683(0x19b)]({'relativePath':_0x27c2f1['name'],'absolutePath':_0x225302,'yamlConfig':_0x27c2f1,'folderPath':_0x2bc96d,'existingSegment':_0x40cc22,'existingActivations':_0x1b4627,'isNew':_0x490c13['isNew'],'hasChanges':_0x490c13[_0x271683(0x168)],'diff':_0x490c13[_0x271683(0x1c9)],'activationActions':_0xb9bc37});}return{'segmentFiles':_0x5af5d2,'foldersToCreate':_0x6124ef};}export async function prepareJourneyFiles(_0x179056,_0x57eaba,_0x3a6c1,_0x1fdc46){const _0x7f4f78=a151_0x35cf28,_0x3965a6=[],_0x2d0dcf=new Set();for(const {yamlConfig:_0xd2f47a,folderPath:_0x5d3da9,sourcePath:_0x2cda5d}of _0x179056){const _0x54e319=resolveTDFolderPath(_0x5d3da9,_0x3a6c1,_0x1fdc46),_0x49b0d3=_0x54e319+':'+_0xd2f47a[_0x7f4f78(0x15b)],_0x259d39=_0x57eaba[_0x7f4f78(0x1c2)][_0x7f4f78(0x14e)](_0x49b0d3);let _0x52baf0,_0x2d851e;if(_0x259d39&&_0x259d39[_0x7f4f78(0x1e8)]>0x0){const _0xa064cd=buildLocalExpandedRuleMappings(_0xd2f47a),{createYamlContext:_0x4f0ee3,prefetchJourneySegments:_0x3f44d6}=createPushYamlContextForBundle(_0x57eaba['deps'],_0x57eaba['parentId'],_0x57eaba[_0x7f4f78(0x1bb)],_0xa064cd,_0x57eaba[_0x7f4f78(0x1a7)],_0x57eaba[_0x7f4f78(0x188)],_0x57eaba[_0x7f4f78(0x158)],_0x57eaba['journeyById']);await _0x3f44d6(_0x259d39[_0x7f4f78(0x16b)](_0x25b377=>_0x25b377['id']));const _0x375828=await _0x57eaba[_0x7f4f78(0x123)][_0x7f4f78(0x149)][_0x7f4f78(0x154)](_0x259d39[0x0][_0x7f4f78(0x17f)]),_0x1e6a80=hasMultipleVersions(_0xd2f47a),_0x3bbe1e=async _0x520ed3=>{const _0x204c21=_0x7f4f78,_0x52d234=_0x57eaba[_0x204c21(0x110)]?.[_0x204c21(0x14e)](_0x520ed3);if(_0x52d234)return _0x52d234;return _0x57eaba[_0x204c21(0x1c8)]({'journeyId':_0x520ed3,'journeyName':_0xd2f47a['name'],'isMultiVersion':_0x259d39[_0x204c21(0x1e8)]>0x1});};if(_0x1e6a80&&_0x259d39[_0x7f4f78(0x1e8)]>0x1){const _0x18ef8a=[];for(const _0x166641 of _0x259d39){const _0x235255=_0x166641[_0x7f4f78(0x11c)]||0x1;_0x57eaba[_0x7f4f78(0x138)]?.[_0x7f4f78(0xe5)](_0x7f4f78(0xec)+_0xd2f47a[_0x7f4f78(0x15b)]+'\x20v'+_0x235255);const _0x3421c9=await _0x3bbe1e(_0x166641['id']),_0x1b7c80=_0x4f0ee3(_0x166641['id']),_0x488d34=await journeyResponseToDef(_0x3421c9,_0x1b7c80);_0x18ef8a[_0x7f4f78(0x19b)]({'item':_0x166641,'yaml':_0x488d34});}const _0x3d5432=buildLocalRuleToNameMappingFromJourney(_0xd2f47a);_0x2d851e=buildMergedJourneyDef(_0x18ef8a,_0x3d5432,_0x375828);const _0x28ee57=Math[_0x7f4f78(0xf3)](..._0x18ef8a['map'](_0x649049=>_0x649049[_0x7f4f78(0x15d)]['versionNumber']||0x0)),_0x5e92aa=_0x259d39[_0x7f4f78(0x163)](_0x49d988=>(_0x49d988[_0x7f4f78(0x11c)]||0x0)===_0x28ee57);_0x5e92aa&&(_0x57eaba[_0x7f4f78(0x138)]?.[_0x7f4f78(0xe5)](_0x7f4f78(0xec)+_0xd2f47a[_0x7f4f78(0x15b)]+'\x20v'+_0x28ee57),_0x52baf0=await _0x3bbe1e(_0x5e92aa['id']));}else{const _0x36abce=_0x259d39[_0x259d39[_0x7f4f78(0x1e8)]-0x1];_0x57eaba[_0x7f4f78(0x138)]?.['update']('Fetching\x20'+_0xd2f47a[_0x7f4f78(0x15b)]),_0x52baf0=await _0x3bbe1e(_0x36abce['id']);const _0x3a1c7e=_0x4f0ee3(_0x36abce['id']),_0x3942b4=await journeyResponseToDef(_0x52baf0,_0x3a1c7e),_0x3b6357=buildLocalRuleToNameMappingFromJourney(_0xd2f47a);_0x2d851e=buildMergedJourneyDef([{'item':_0x36abce,'yaml':_0x3942b4}],_0x3b6357,_0x375828);}}addFoldersToCreate(_0x54e319,_0x57eaba[_0x7f4f78(0x130)],_0x2d0dcf);const _0x214368=calculateJourneyDiff(_0xd2f47a,_0x2d851e);_0x3965a6['push']({'relativePath':_0xd2f47a[_0x7f4f78(0x15b)],'absolutePath':_0x2cda5d,'yamlConfig':_0xd2f47a,'folderPath':_0x54e319,'existingJourney':_0x52baf0,'isNew':_0x214368[_0x7f4f78(0x1cb)],'hasChanges':_0x214368['hasChanges'],'diff':_0x214368[_0x7f4f78(0x1c9)]});}return{'journeyFiles':_0x3965a6,'foldersToCreate':_0x2d0dcf};}export function calculateActivationActions(_0x1a32b1,_0x58d241,_0x21decd,_0x3906ef){const _0x1cb022=a151_0x35cf28,_0x1b8cdb=[],_0x3dfbf8=new Map();for(const _0x9833d5 of _0x58d241){_0x3dfbf8[_0x1cb022(0xf5)](_0x9833d5[_0x1cb022(0x15b)],_0x9833d5);}const _0x172f74=new Map();for(const _0x51bf97 of _0x1a32b1){_0x172f74[_0x1cb022(0xf5)](_0x51bf97['name'],_0x51bf97);}for(const _0x3bf7f6 of _0x1a32b1){const _0x4f6307=_0x3dfbf8[_0x1cb022(0x14e)](_0x3bf7f6[_0x1cb022(0x15b)]);if(!_0x4f6307)_0x1b8cdb['push']({'type':_0x1cb022(0x187),'name':_0x3bf7f6[_0x1cb022(0x15b)],'yamlActivation':_0x3bf7f6});else{const _0x26bed3=activationResponseToDef(_0x4f6307,_0x21decd,_0x3906ef),_0xc564a7=a151_0x2b4032[_0x1cb022(0x1c3)](_0x26bed3),_0x2a9617=a151_0x2b4032[_0x1cb022(0x1c3)](_0x3bf7f6);_0xc564a7!==_0x2a9617&&_0x1b8cdb['push']({'type':_0x1cb022(0xe5),'name':_0x3bf7f6[_0x1cb022(0x15b)],'yamlActivation':_0x3bf7f6,'existingActivation':_0x4f6307});}}for(const _0x2e5fe5 of _0x58d241){!_0x172f74[_0x1cb022(0x14c)](_0x2e5fe5['name'])&&_0x1b8cdb[_0x1cb022(0x19b)]({'type':'delete','name':_0x2e5fe5['name'],'existingActivation':_0x2e5fe5});}return _0x1b8cdb;}function a151_0xb026(_0x4a732b,_0x52c64e){_0x4a732b=_0x4a732b-0xe2;const _0x1f652b=a151_0x1f65();let _0xb026f2=_0x1f652b[_0x4a732b];return _0xb026f2;}function calculateYamlDiff(_0x272e67,_0x3ff6f9){if(_0x3ff6f9){const _0x1a8aed=generateDiff(_0x3ff6f9,_0x272e67),_0x4d2e68=hasChanges(_0x1a8aed);return{'isNew':![],'hasChanges':_0x4d2e68,'diff':_0x4d2e68?formatDiffWithColors(_0x1a8aed):undefined};}const _0x136a79=generateDiff('',_0x272e67);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x136a79)};}export function calculateSegmentDiff(_0x494441,_0x378b10,_0x12deac,_0x320342,_0x121d12){const _0x384af2=segmentToYamlString(_0x494441),_0x204f68=_0x378b10?segmentToYamlString(segmentWithActivationsToYaml(_0x378b10,_0x12deac,undefined,_0x320342,_0x121d12)):undefined;return calculateYamlDiff(_0x384af2,_0x204f68);}export function calculateJourneyDiff(_0x4b885e,_0x587eb9){const _0x7599e0=normalizeJourneyDef(_0x4b885e,_0x4b885e),_0x270783=a151_0x1864f0(_0x7599e0),_0x4d9f3e=_0x587eb9?a151_0x1864f0(normalizeJourneyDef(_0x587eb9,_0x4b885e)):undefined;return calculateYamlDiff(_0x270783,_0x4d9f3e);}export function findSegmentsToDelete(_0x1f3a95,_0x222918,_0x445719,_0x3d7d4e,_0x3e6bb3){const _0x5b1a64=a151_0x35cf28,_0x2cf424=new Set();for(const {yamlConfig:_0x3dafa5,folderPath:_0x2aa540}of _0x222918){_0x2cf424[_0x5b1a64(0x18a)](_0x2aa540+':'+_0x3dafa5['name']);}return _0x1f3a95['filter'](_0x5be694=>{const _0x48b590=_0x5b1a64,_0x4a5ff5=_0x5be694[_0x48b590(0x141)]?_0x445719[_0x48b590(0x14e)](_0x5be694[_0x48b590(0x141)][_0x48b590(0x1eb)]())||'':'',_0x288eab=_0x4a5ff5+':'+_0x5be694[_0x48b590(0x15b)];if(_0x2cf424[_0x48b590(0x14c)](_0x288eab))return![];if(_0x3e6bb3)return _0x4a5ff5===_0x3d7d4e||_0x4a5ff5[_0x48b590(0x181)](_0x3d7d4e+'/');return!![];});}export function findJourneysToDelete(_0x5c8850,_0x41aedb,_0x57d5bd,_0x5c237c,_0xb40f1c){const _0xc3b658=a151_0x35cf28,_0x33536a=new Set();for(const {yamlConfig:_0xaf455d,folderPath:_0xb17a5f}of _0x41aedb){_0x33536a[_0xc3b658(0x18a)](_0xb17a5f+':'+_0xaf455d[_0xc3b658(0x15b)]);}return _0x5c8850['filter'](_0x3cbbc2=>{const _0x22b242=_0xc3b658,_0x340b33=_0x3cbbc2[_0x22b242(0x15f)]?_0x57d5bd['get'](_0x3cbbc2['folderId'])||'':'',_0x5e891f=_0x340b33+':'+_0x3cbbc2[_0x22b242(0x179)];if(_0x33536a[_0x22b242(0x14c)](_0x5e891f))return![];if(_0xb40f1c)return _0x340b33===_0x5c237c||_0x340b33['startsWith'](_0x5c237c+'/');return!![];});}export function buildSegmentLookupMap(_0x425424,_0x18e5b5){const _0x1405ff=a151_0x35cf28,_0x33750=new Map();for(const _0x52dcf5 of _0x425424){const _0x584ba5=_0x52dcf5[_0x1405ff(0x141)]?_0x18e5b5[_0x1405ff(0x14e)](_0x52dcf5[_0x1405ff(0x141)][_0x1405ff(0x1eb)]())||'':'',_0x5c055f=_0x584ba5+':'+_0x52dcf5[_0x1405ff(0x15b)];_0x33750['set'](_0x5c055f,_0x52dcf5);}return _0x33750;}export function buildSegmentNameToIdMap(_0x52108c){const _0x994583=a151_0x35cf28,_0x1a1cb6=new Map();for(const _0x412eac of _0x52108c){_0x1a1cb6['set'](_0x412eac[_0x994583(0x15b)],_0x412eac['id']);}return _0x1a1cb6;}export function buildJourneyBundleLookupMap(_0x413da5,_0x440b93){const _0x25bb3b=a151_0x35cf28,_0x59a879=new Map();for(const _0x5e26d5 of _0x413da5){const _0xbdfff9=_0x5e26d5[_0x25bb3b(0x15f)]?_0x440b93[_0x25bb3b(0x14e)](_0x5e26d5['folderId'])||'':'',_0x3a10c5=_0xbdfff9+':'+_0x5e26d5['journeyBundleName'];!_0x59a879[_0x25bb3b(0x14c)](_0x3a10c5)&&_0x59a879[_0x25bb3b(0xf5)](_0x3a10c5,[]),_0x59a879[_0x25bb3b(0x14e)](_0x3a10c5)[_0x25bb3b(0x19b)](_0x5e26d5);}for(const _0x507d98 of _0x59a879['values']()){_0x507d98[_0x25bb3b(0x17a)]((_0x7c629d,_0x412fc1)=>(_0x7c629d[_0x25bb3b(0x11c)]||0x0)-(_0x412fc1[_0x25bb3b(0x11c)]||0x0));}return _0x59a879;}export function collectFoldersToCreate(_0x5d01c1,_0x5a6cc1){const _0x33aa94=a151_0x35cf28,_0x3c6afa=new Set();for(const _0x53ebf3 of _0x5d01c1){if(!_0x53ebf3)continue;if(_0x5a6cc1[_0x33aa94(0x14c)](_0x53ebf3))continue;const _0x3c5926=_0x53ebf3[_0x33aa94(0x157)]('/');let _0x9569a3='';for(const _0x1eea4d of _0x3c5926){_0x9569a3=_0x9569a3?_0x9569a3+'/'+_0x1eea4d:_0x1eea4d,!_0x5a6cc1[_0x33aa94(0x14c)](_0x9569a3)&&_0x3c6afa['add'](_0x9569a3);}}return _0x3c6afa;}export function parseAndClassifyYamlFiles(_0x4268af,_0x296a64,_0xce9d6e){const _0x1315fb=a151_0x35cf28,_0x2a7b5b=[],_0x157cd0=[];for(const _0x590ad5 of _0x4268af){const _0x2446cb=a151_0x5f3456[_0x1315fb(0x17e)](_0x296a64,a151_0x5f3456[_0x1315fb(0x13e)](_0x590ad5)),_0x54dcf8=_0x2446cb==='.'?'':_0x2446cb,_0x3593d0=readFileSync(_0x590ad5,_0x1315fb(0x132)),_0x30a90f=a151_0x2b4032[_0x1315fb(0xfe)](_0x3593d0);if(isJourneyDef(_0x30a90f)){const _0x16bb28=a151_0xcaeed4(_0x3593d0);_0x157cd0[_0x1315fb(0x19b)]({'yamlConfig':_0x16bb28,'folderPath':_0x54dcf8,'sourcePath':_0x590ad5});}else{if(!_0xce9d6e?.['skipSegments']){const _0x51217b=parseSegmentYamlFile(_0x3593d0),_0x353e35=normalizeChildSegmentYaml(_0x51217b);_0x2a7b5b[_0x1315fb(0x19b)]({'yamlConfig':_0x353e35,'folderPath':_0x54dcf8,'sourcePath':_0x590ad5});}}}return{'segments':_0x2a7b5b,'journeys':_0x157cd0};}export function validateParsedFiles(_0x1b4e69,_0x4e0ca4){const _0x419408=a151_0x35cf28,_0x43cb1b=[];for(const {yamlConfig:_0x4249dc,sourcePath:_0x3abb8d}of _0x1b4e69['segments']){const _0x46bdb0=readFileSync(_0x3abb8d,_0x419408(0x132)),_0x32722a=a151_0x2b4032[_0x419408(0x167)](_0x46bdb0),_0x11fda4=validateSegmentDef(_0x4249dc,{'source':_0x46bdb0,'document':_0x32722a},{'skipSchema':!![]});if(!_0x11fda4[_0x419408(0x1bc)]){const _0x15464c=a151_0x5f3456[_0x419408(0x17e)](_0x4e0ca4,_0x3abb8d);_0x43cb1b[_0x419408(0x19b)]({'filePath':_0x15464c,'source':_0x46bdb0,'result':_0x11fda4,'isJourney':![]});}}for(const {yamlConfig:_0x4a1b9e,sourcePath:_0x2ffc3b}of _0x1b4e69[_0x419408(0x1e2)]){const _0x169acf=readFileSync(_0x2ffc3b,_0x419408(0x132)),_0x255d28=a151_0x2b4032[_0x419408(0x167)](_0x169acf),_0x1ea208=validateJourneyDef(_0x4a1b9e,{'source':_0x169acf,'document':_0x255d28},{'skipSchema':!![]});if(!_0x1ea208[_0x419408(0x1bc)]){const _0x3c8249=a151_0x5f3456[_0x419408(0x17e)](_0x4e0ca4,_0x2ffc3b);_0x43cb1b['push']({'filePath':_0x3c8249,'source':_0x169acf,'result':_0x1ea208,'isJourney':!![]});}}return _0x43cb1b;}export function formatValidationErrors(_0x185f7f){const _0x4bc7bf=a151_0x35cf28,_0x1d968f=[];for(const {filePath:_0x550f24,source:_0x24814b,result:_0x35e47d,isJourney:_0xe8bd2b}of _0x185f7f){const _0x2c89f7=_0xe8bd2b?_0x4bc7bf(0x149):_0x4bc7bf(0x1ab);_0x1d968f[_0x4bc7bf(0x19b)]('\x0a'+_0x550f24+'\x20('+_0x2c89f7+_0x4bc7bf(0x170)+_0x35e47d[_0x4bc7bf(0x137)]['length']+_0x4bc7bf(0x1c1)),_0x1d968f['push'](formatValidationResult(_0x35e47d,_0x24814b,_0x550f24));}return _0x1d968f[_0x4bc7bf(0x1dd)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2d268b){const _0x38ea6c=a151_0x35cf28,_0x3d17ca=new Set(),_0x380e01=new Map(),_0x18f4ff=collectSegmentUsageCounts(_0x2d268b);if(_0x2d268b[_0x38ea6c(0x136)])for(const [_0xb585de,_0x3b4eba]of Object['entries'](_0x2d268b[_0x38ea6c(0x136)])){_0x3d17ca[_0x38ea6c(0x18a)](_0xb585de);if(_0x3b4eba['rule']){const _0xb204a3=yamlRuleToApi(_0x3b4eba['rule']),_0x468c8a=apiRuleToYaml(_0xb204a3);_0x380e01[_0x38ea6c(0xf5)](_0xb585de,_0x468c8a);}}const _0x29d1e5=new Map();let _0x3e6624=0x0;for(const [_0x5312ce,_0x39d9b8]of _0x380e01){const _0x2193b8=serializeExpandedRule(_0x39d9b8,_0x380e01),_0x2ce099=_0x29d1e5[_0x38ea6c(0x14e)](_0x2193b8)||[];_0x2ce099[_0x38ea6c(0x19b)]({'name':_0x5312ce,'index':_0x3e6624}),_0x29d1e5['set'](_0x2193b8,_0x2ce099),_0x3e6624++;}const _0x20a64e=new Map();for(const [_0x2048e8,_0x1d11a5]of _0x29d1e5){const _0x4cd2a9=_0x1d11a5['slice']()[_0x38ea6c(0x17a)]((_0x53cc47,_0x3ac8c8)=>{const _0x419b85=_0x38ea6c,_0x5b5296=_0x18f4ff[_0x419b85(0x14e)](_0x53cc47[_0x419b85(0x15b)])||0x0,_0x2e6102=_0x18f4ff[_0x419b85(0x14e)](_0x3ac8c8['name'])||0x0;if(_0x5b5296!==_0x2e6102)return _0x2e6102-_0x5b5296;return _0x53cc47['index']-_0x3ac8c8[_0x419b85(0x12f)];})[_0x38ea6c(0x16b)](_0x4d840d=>_0x4d840d[_0x38ea6c(0x15b)]),_0x480a7a=[];for(const _0x495f72 of _0x4cd2a9){const _0x8b3f43=_0x18f4ff[_0x38ea6c(0x14e)](_0x495f72)||0x0,_0x14663e=Math[_0x38ea6c(0xf3)](_0x8b3f43,0x1);for(let _0x115d03=0x0;_0x115d03<_0x14663e;_0x115d03++){_0x480a7a[_0x38ea6c(0x19b)](_0x495f72);}}_0x20a64e[_0x38ea6c(0xf5)](_0x2048e8,_0x480a7a);}return{'existingLocalSegmentNames':_0x3d17ca,'localSegmentRules':_0x380e01,'localExpandedRuleToNames':_0x20a64e};}export function createSegmentIdResolver(_0x4034b9,_0x349e46){return async _0x19fb33=>{const _0x1a3a2a=a151_0xb026,_0x4a1749=_0x4034b9[_0x1a3a2a(0x14e)](_0x19fb33);if(!_0x4a1749)throw new SDKError(ErrorCode[_0x1a3a2a(0x199)],_0x1a3a2a(0x100)+_0x19fb33+_0x1a3a2a(0x1ba)+_0x349e46+'\x27)');return _0x4a1749;};}export function extractRootFolderId(_0x4291da){const _0x417bf8=a151_0x35cf28;return _0x4291da[_0x417bf8(0x182)]?.[_0x417bf8(0x1ea)]?.[_0x417bf8(0x1ec)]?.['id']||_0x4291da[_0x417bf8(0x182)]?.[_0x417bf8(0x16c)]?.[_0x417bf8(0x1ec)]?.['id'];}export function buildConnectionMaps(_0x2fd884){const _0x50ccea=a151_0x35cf28,_0x1cc437=new Map(),_0x3c8c1c=new Map(),_0x3f8855=new Map();for(const _0x319a34 of _0x2fd884){_0x1cc437[_0x50ccea(0xf5)](_0x319a34[_0x50ccea(0x15b)],parseInt(_0x319a34['id'],0xa)),_0x3c8c1c['set'](_0x319a34['id'],_0x319a34[_0x50ccea(0x15b)]),_0x3f8855['set'](_0x319a34['name'],_0x319a34['type']);}return{'nameToId':_0x1cc437,'idToName':_0x3c8c1c,'nameToType':_0x3f8855};}export function calculatePushStats(_0x5f00f5,_0xe1f663,_0x3532ab,_0x11ddd1,_0x1a0349,_0x44ca1c,_0x4ff27a){const _0x51f60d=a151_0x35cf28,_0x3066b9=_0x5f00f5[_0x51f60d(0x10a)](_0x5ee28f=>_0x5ee28f[_0x51f60d(0x1cb)]),_0x3543e3=_0x5f00f5[_0x51f60d(0x10a)](_0x3802ad=>!_0x3802ad[_0x51f60d(0x1cb)]&&_0x3802ad[_0x51f60d(0x168)]),_0x200d09=_0x5f00f5['filter'](_0x1adbc3=>!_0x1adbc3[_0x51f60d(0x1cb)]&&!_0x1adbc3['hasChanges']),_0x3bfb7d=_0x44ca1c?_0x11ddd1:[],_0x3f80d3=_0xe1f663['filter'](_0xb0f7a2=>_0xb0f7a2['isNew']),_0x47c07b=_0xe1f663[_0x51f60d(0x10a)](_0x1cba3f=>!_0x1cba3f[_0x51f60d(0x1cb)]&&_0x1cba3f[_0x51f60d(0x168)]),_0x44a578=_0xe1f663[_0x51f60d(0x10a)](_0x5a0422=>!_0x5a0422[_0x51f60d(0x1cb)]&&!_0x5a0422['hasChanges']),_0x1c6aa7=_0x44ca1c?_0x1a0349:[],_0x2bbd16=_0x5f00f5[_0x51f60d(0xed)](_0x3f11b4=>_0x3f11b4[_0x51f60d(0x111)]),_0x45866e=_0x2bbd16[_0x51f60d(0x10a)](_0x1696ce=>_0x1696ce[_0x51f60d(0x152)]===_0x51f60d(0x187)),_0x5d60b7=_0x2bbd16[_0x51f60d(0x10a)](_0x4fcfa6=>_0x4fcfa6[_0x51f60d(0x152)]==='update'),_0x419188=_0x2bbd16[_0x51f60d(0x10a)](_0x9ad505=>_0x9ad505[_0x51f60d(0x152)]==='delete'),_0x44784a=Array[_0x51f60d(0x105)](_0x3532ab)[_0x51f60d(0x17a)](),_0x212845=_0x4ff27a?![]:_0x3066b9['length']>0x0||_0x3543e3[_0x51f60d(0x1e8)]>0x0||_0x3bfb7d[_0x51f60d(0x1e8)]>0x0,_0x1e7604=_0x3f80d3['length']>0x0||_0x47c07b[_0x51f60d(0x1e8)]>0x0||_0x1c6aa7[_0x51f60d(0x1e8)]>0x0,_0x218fc2=_0x4ff27a?![]:_0x2bbd16[_0x51f60d(0x1e8)]>0x0,_0x1915a7=_0x44784a[_0x51f60d(0x1e8)]>0x0;return{'segments':{'new':_0x3066b9,'changed':_0x3543e3,'unchanged':_0x200d09,'toDelete':_0x3bfb7d},'journeys':{'new':_0x3f80d3,'changed':_0x47c07b,'unchanged':_0x44a578,'toDelete':_0x1c6aa7},'activations':{'all':_0x2bbd16,'toCreate':_0x45866e,'toUpdate':_0x5d60b7,'toDelete':_0x419188},'folders':{'toCreate':_0x44784a},'counts':{'segments':{'new':_0x3066b9[_0x51f60d(0x1e8)],'changed':_0x3543e3[_0x51f60d(0x1e8)],'unchanged':_0x200d09[_0x51f60d(0x1e8)],'toDelete':_0x3bfb7d[_0x51f60d(0x1e8)]},'journeys':{'new':_0x3f80d3['length'],'changed':_0x47c07b[_0x51f60d(0x1e8)],'unchanged':_0x44a578[_0x51f60d(0x1e8)],'toDelete':_0x1c6aa7[_0x51f60d(0x1e8)]},'activations':{'create':_0x45866e[_0x51f60d(0x1e8)],'update':_0x5d60b7[_0x51f60d(0x1e8)],'delete':_0x419188[_0x51f60d(0x1e8)]},'folders':_0x44784a[_0x51f60d(0x1e8)]},'hasChanges':_0x212845||_0x1e7604||_0x218fc2||_0x1915a7};}export async function buildPushExecutionContext(_0x4acef6,_0x3390f9,_0x18a8fc,_0x544d47,_0x287a96,_0x639403){const _0x255f8=a151_0x35cf28,_0x255f44=extractRootFolderId(_0x18a8fc),{pathToId:_0x4d2f6c,idToPath:_0x53bce1}=buildFolderMaps(_0x287a96),_0x138c0f=buildSegmentNameToIdMap(_0x544d47),_0x35ae94=new Map(),{batchAsync:_0x372bf1}=await import(_0x255f8(0x11f)),[_0x32b7d0,_0x2f5363]=await Promise[_0x255f8(0x156)]([_0x4acef6[_0x255f8(0x12c)][_0x255f8(0x1b4)](),_0x4acef6[_0x255f8(0x18b)][_0x255f8(0x10b)](),((async()=>{const _0xa29ff9=_0x255f8;!_0x639403&&_0x544d47[_0xa29ff9(0x1e8)]>0x0&&await _0x372bf1(_0x544d47,async _0x38f311=>{const _0x28253e=_0xa29ff9,_0x90c9d5=await _0x4acef6[_0x28253e(0x1ab)][_0x28253e(0x129)](_0x3390f9,_0x38f311['id']);_0x35ae94[_0x28253e(0xf5)](_0x38f311['id'],_0x90c9d5);});})())]),{emailToId:_0x150631,idToEmail:_0x5cf1a5}=_0x32b7d0,_0x5c507f=buildConnectionMaps(_0x2f5363);return{'rootFolderId':_0x255f44,'folderPathToId':_0x4d2f6c,'folderIdToPath':_0x53bce1,'segmentNameToId':_0x138c0f,'activationsBySegmentId':_0x35ae94,'emailToIdMap':_0x150631,'idToEmailMap':_0x5cf1a5,'connectionNameToIdMap':_0x5c507f[_0x255f8(0x1ce)],'connectionIdToNameMap':_0x5c507f[_0x255f8(0xe8)],'connectionNameToTypeMap':_0x5c507f[_0x255f8(0x122)]};}export function createPushYamlContextForBundle(_0x1f02a5,_0x433ad8,_0x548bc3,_0x57bcdd,_0xb33365,_0x9c0130,_0x4e708a,_0x3cb814){const {existingLocalSegmentNames:_0x832647,localExpandedRuleToNames:_0x30f306}=_0x57bcdd,_0x1c956b=new Set(),_0x38f4be=new Map(),_0xe99928=new Map(),_0x5f2861=new Map(),_0x487f63=createJumpTargetCache(),_0x525779=new Map(),_0x267ccf=new Map(),_0x1a2418=new Set();let _0x4eb650;const _0x3e43d8=_0x52c540=>{const _0x131eca={'resolveSegment':async _0x3c2449=>{const _0x2518a1=a151_0xb026,_0x5944ad=_0x5f2861[_0x2518a1(0x14e)](_0x3c2449);if(_0x5944ad!==undefined)return{'name':_0x5944ad,'isJourneyLocal':!![]};try{const _0x14bfaa=await fetchSegment(_0x1f02a5,_0x433ad8,_0x3c2449,_0x548bc3);if(!_0x14bfaa)throw new Error(_0x2518a1(0x128));const _0x37db3a=generateJourneyLocalName(_0x14bfaa[_0x2518a1(0x15b)]),_0x2325e9=_0x14bfaa['kind']===SEGMENT_KIND_JOURNEY&&_0x37db3a!==undefined;let _0x576868=_0x14bfaa[_0x2518a1(0x15b)],_0x131951;if(_0x2325e9&&_0x14bfaa[_0x2518a1(0x190)]){const _0x5a766c=apiRuleToYaml(_0x14bfaa[_0x2518a1(0x190)]);_0x267ccf['set'](_0x3c2449,_0x5a766c);const _0x2315ca=async _0x2a1c74=>{const _0x3d3e11=_0x2518a1,_0x45d0b6=collectSegmentRefsFromRule(_0x2a1c74);for(const _0x2e5298 of _0x45d0b6){if(!_0x267ccf[_0x3d3e11(0x14c)](_0x2e5298))try{const _0x46371d=await fetchSegment(_0x1f02a5,_0x433ad8,_0x2e5298,_0x548bc3);if(_0x46371d?.[_0x3d3e11(0x190)]){const _0x5a5151=apiRuleToYaml(_0x46371d[_0x3d3e11(0x190)]);_0x267ccf['set'](_0x2e5298,_0x5a5151),await _0x2315ca(_0x5a5151);}}catch(_0x4a4cb3){logger[_0x3d3e11(0x153)](_0x3d3e11(0x1de)+_0x2e5298+':\x20'+_0x4a4cb3);}}};await _0x2315ca(_0x5a766c);const _0xbbaa2f=serializeExpandedRule(_0x5a766c,_0x267ccf),_0x29b25b=_0x30f306['get'](_0xbbaa2f);if(_0x29b25b&&_0x29b25b['length']>0x0){const _0x43c9b9=_0x38f4be[_0x2518a1(0x14e)](_0xbbaa2f)||0x0,_0x1a5662=_0x29b25b[_0x43c9b9]||_0x29b25b[_0x29b25b[_0x2518a1(0x1e8)]-0x1];_0x38f4be[_0x2518a1(0xf5)](_0xbbaa2f,_0x43c9b9+0x1),_0x576868=_0x1a5662,_0x1c956b[_0x2518a1(0x18a)](_0x576868),_0x5f2861[_0x2518a1(0xf5)](_0x3c2449,_0x576868);const _0x29c25a=await resolveRuleSegmentRefs(_0x5a766c,async _0x2ef6f9=>{const _0x32b676=_0x2518a1,_0x31b4b2=_0x5f2861[_0x32b676(0x14e)](_0x2ef6f9);if(_0x31b4b2)return _0x31b4b2;const _0x4bac1e=await _0x4eb650[_0x32b676(0x11d)](_0x2ef6f9);return _0x4bac1e['name'];});_0x131951={'description':_0x14bfaa['description'],'rule':_0x29c25a};}else{const _0xe2c49f=_0x525779[_0x2518a1(0x14e)](_0xbbaa2f);if(_0xe2c49f)_0x576868=_0xe2c49f,_0x5f2861['set'](_0x3c2449,_0x576868);else{if(_0x37db3a){let _0x257332=_0x37db3a,_0x3f4952=0x2;while(_0x1c956b[_0x2518a1(0x14c)](_0x257332)||_0x832647[_0x2518a1(0x14c)](_0x257332)){_0x257332=_0x37db3a+'_'+_0x3f4952,_0x3f4952++;}_0x1c956b[_0x2518a1(0x18a)](_0x257332),_0x576868=_0x257332;}_0x5f2861[_0x2518a1(0xf5)](_0x3c2449,_0x576868),_0x525779['set'](_0xbbaa2f,_0x576868);const _0x2ae6e1=await resolveRuleSegmentRefs(_0x5a766c,async _0x4c57cc=>{const _0x3cfbec=_0x2518a1,_0xac7cf1=_0x5f2861[_0x3cfbec(0x14e)](_0x4c57cc);if(_0xac7cf1)return _0xac7cf1;const _0x56b277=await _0x4eb650[_0x3cfbec(0x11d)](_0x4c57cc);return _0x56b277[_0x3cfbec(0x15b)];});_0x131951={'description':_0x14bfaa[_0x2518a1(0x12b)],'rule':_0x2ae6e1};}}}return{'name':_0x576868,'isJourneyLocal':_0x2325e9,'definition':_0x131951};}catch(_0x452b8a){return logger[_0x2518a1(0x153)](_0x2518a1(0x142)+_0x3c2449+':\x20'+_0x452b8a),{'name':_0x3c2449,'isJourneyLocal':![]};}},'resolveActivation':async _0x299a93=>{const _0x76feb6=a151_0xb026,_0x432a19=_0xe99928[_0x76feb6(0x14e)](_0x299a93);if(_0x432a19!==undefined)return{'name':_0x432a19,'isJourneyLocal':!![]};try{let _0x35b9f9=_0x4e708a?.[_0x76feb6(0x14e)](_0x299a93);!_0x35b9f9&&(_0x35b9f9=await _0x1f02a5[_0x76feb6(0x149)][_0x76feb6(0x16d)](_0x52c540,_0x299a93));const _0xca774a=_0x35b9f9['attributes'][_0x76feb6(0x1d6)]['name']||_0x299a93,_0x855448=sanitizeYamlKey(_0xca774a)||_0x76feb6(0x160)+_0x299a93,_0x4d0747=_0x855448;_0xe99928[_0x76feb6(0xf5)](_0x299a93,_0x4d0747);const _0x53a041=journeyActivationStepToYaml(_0x35b9f9,_0xb33365,_0x9c0130);return{'name':_0x4d0747,'isJourneyLocal':!![],'definition':_0x53a041};}catch(_0x179661){return logger[_0x76feb6(0x153)]('Failed\x20to\x20resolve\x20activation\x20'+_0x299a93+':\x20'+_0x179661),{'name':_0x299a93,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2c99d5,_0x43b0fe)=>resolveJumpTarget(_0x2c99d5,_0x43b0fe,_0x487f63,async _0x53808c=>{const _0x496035=a151_0xb026,_0x5d2e8e=_0x3cb814?.[_0x496035(0x14e)](_0x53808c);if(_0x5d2e8e)return _0x5d2e8e;return _0x1f02a5[_0x496035(0x149)]['getJourney'](_0x53808c);})};return _0x4eb650=_0x131eca,_0x131eca;},_0x38c06b=async _0x1a3006=>{const _0x254880=a151_0xb026,{collectSegmentIdsFromJourneyApi:_0x3b2710}=await import(_0x254880(0xfc)),{batchAsync:_0x570e15}=await import(_0x254880(0x11f)),_0x512a69=new Set();for(const _0x5025ef of _0x1a3006){let _0x5b51b1=_0x3cb814?.[_0x254880(0x14e)](_0x5025ef);!_0x5b51b1&&(_0x5b51b1=await _0x1f02a5[_0x254880(0x149)]['getJourney'](_0x5025ef));const _0x291241=_0x3b2710(_0x5b51b1);for(const _0x4502f6 of _0x291241){_0x512a69[_0x254880(0x18a)](_0x4502f6);}}let _0x276f7b=Array['from'](_0x512a69);while(_0x276f7b['length']>0x0){const _0x2ab455=_0x276f7b[_0x254880(0x10a)](_0x337415=>!_0x1a2418[_0x254880(0x14c)](_0x337415));if(_0x2ab455['length']===0x0)break;const _0xeb39b8=await _0x570e15(_0x2ab455,async _0x64c20f=>{const _0x32ac25=_0x254880;_0x1a2418[_0x32ac25(0x18a)](_0x64c20f);const _0x38f6b8=await fetchSegment(_0x1f02a5,_0x433ad8,_0x64c20f,_0x548bc3);if(!_0x38f6b8)return null;return{'segmentId':_0x64c20f,'segment':_0x38f6b8};},0xa),_0x47985b=new Set();for(const _0x2fd0ba of _0xeb39b8){if(!_0x2fd0ba?.[_0x254880(0x1ab)]?.['rule'])continue;const _0x2bdd97=apiRuleToYaml(_0x2fd0ba[_0x254880(0x1ab)][_0x254880(0x190)]);_0x267ccf['set'](_0x2fd0ba[_0x254880(0x13c)],_0x2bdd97);const _0x6df5ab=collectSegmentRefsFromRule(_0x2bdd97);for(const _0x7bfff5 of _0x6df5ab){!_0x1a2418['has'](_0x7bfff5)&&_0x47985b[_0x254880(0x18a)](_0x7bfff5);}}_0x276f7b=Array[_0x254880(0x105)](_0x47985b);}};return{'createYamlContext':_0x3e43d8,'prefetchJourneySegments':_0x38c06b};}export async function executePushSegments(_0x2e0934,_0x7c97a5,_0x4c2aae,_0x1e409a,_0x1fe5bd){const _0x4079ca=a151_0x35cf28,{segmentDefToCreateRequest:_0x22fa38,segmentDefToUpdateRequest:_0x124b2b}=await import(_0x4079ca(0x1b5)),_0x228fa3=_0x4c2aae['folderPathToId'],_0x1ee0be=0x5,_0xb6fbec=async _0x36576c=>{const _0x3df497=_0x4079ca,_0x45b213=_0x36576c[_0x3df497(0x177)]?_0x228fa3[_0x3df497(0x14e)](_0x36576c[_0x3df497(0x177)]):undefined;let _0x3a0048;const _0x26c4d6={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x52daee=_0x36576c['yamlConfig'];if(_0x36576c[_0x3df497(0x1a0)]['rule']){const _0x25de34=createSegmentIdResolver(_0x4c2aae['segmentNameToId'],_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]),_0x230f7e=await resolveRuleSegmentIds(_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x190)],_0x25de34);_0x52daee={..._0x36576c[_0x3df497(0x1a0)],'rule':_0x230f7e};}try{if(_0x36576c[_0x3df497(0x1cb)]){_0x1fe5bd['onProgress']?.({'type':_0x3df497(0x146),'name':_0x36576c[_0x3df497(0x1a0)]['name']});const _0x266a65=_0x22fa38(_0x52daee,_0x45b213),_0x3286b6=await _0x1fe5bd[_0x3df497(0x148)](_0x3df497(0xee)+_0x36576c['yamlConfig'][_0x3df497(0x15b)]+'\x27...',()=>_0x2e0934['segment'][_0x3df497(0xe3)](_0x1e409a['parentId'],_0x266a65));_0x3a0048=_0x3286b6['data']['id'],_0x4c2aae[_0x3df497(0x189)]['set'](_0x36576c['yamlConfig'][_0x3df497(0x15b)],_0x3a0048),_0x26c4d6[_0x3df497(0x1b3)]={'name':_0x36576c['yamlConfig'][_0x3df497(0x15b)],'id':_0x3a0048},_0x1fe5bd[_0x3df497(0x131)]?.({'type':'segment_created','name':_0x36576c[_0x3df497(0x1a0)]['name'],'segmentId':_0x3a0048}),_0x1fe5bd[_0x3df497(0x1e7)]?.(_0x3df497(0x186)+_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]+'\x27'),_0x26c4d6[_0x3df497(0x103)]=0x1;}else{if(_0x36576c[_0x3df497(0x168)]){_0x1fe5bd[_0x3df497(0x131)]?.({'type':'segment_updating','name':_0x36576c['yamlConfig'][_0x3df497(0x15b)]});const _0x5cadb4=_0x124b2b(_0x52daee);_0x45b213!==_0x36576c[_0x3df497(0x173)]?.['segmentFolderId']&&(_0x5cadb4[_0x3df497(0x141)]=_0x45b213?parseInt(_0x45b213,0xa):undefined),await _0x1fe5bd[_0x3df497(0x148)]('Updating\x20segment\x20\x27'+_0x36576c['yamlConfig']['name']+_0x3df497(0x12d),()=>_0x2e0934[_0x3df497(0x1ab)][_0x3df497(0x197)](_0x1e409a[_0x3df497(0xf0)],_0x36576c[_0x3df497(0x173)]['id'],_0x5cadb4)),_0x3a0048=_0x36576c[_0x3df497(0x173)]['id'],_0x1fe5bd[_0x3df497(0x131)]?.({'type':_0x3df497(0x19e),'name':_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]}),_0x1fe5bd[_0x3df497(0x1e7)]?.('Updated\x20segment\x20\x27'+_0x36576c['yamlConfig'][_0x3df497(0x15b)]+'\x27'),_0x26c4d6[_0x3df497(0x178)]=0x1;}else _0x3a0048=_0x36576c['existingSegment']['id'];}}catch(_0x3aaa41){const _0x44138b=isHttp400Error(_0x3aaa41),_0x4b7771=_0x44138b?ErrorCode[_0x3df497(0x121)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x29734e=getErrorMessage(_0x3aaa41);throw new SDKError(_0x4b7771,_0x3df497(0x104)+(_0x36576c[_0x3df497(0x1cb)]?_0x3df497(0x187):_0x3df497(0xe5))+_0x3df497(0x1db)+_0x36576c[_0x3df497(0x169)]+_0x3df497(0x16e)+_0x29734e,_0x3aaa41);}try{const _0x18af35=await syncActivationsForSegment(_0x2e0934,_0x1e409a[_0x3df497(0xf0)],_0x3a0048,_0x36576c['yamlConfig'][_0x3df497(0x15b)],_0x36576c[_0x3df497(0x111)],_0x1fe5bd,_0x36576c[_0x3df497(0x169)]);_0x26c4d6[_0x3df497(0x116)]=_0x18af35;}catch(_0x381139){if(_0x381139 instanceof SDKError)throw _0x381139;throw new SDKError(ErrorCode[_0x3df497(0xfa)],_0x3df497(0x174)+_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]+'\x27\x20from\x20file:\x20'+_0x36576c[_0x3df497(0x169)]+_0x3df497(0x16e)+getErrorMessage(_0x381139),_0x381139);}return _0x26c4d6;},_0x518117=await batchAsync(_0x7c97a5,_0xb6fbec,_0x1ee0be),_0x3f5a1={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x55d653 of _0x518117){_0x3f5a1[_0x4079ca(0x103)]+=_0x55d653[_0x4079ca(0x103)],_0x3f5a1[_0x4079ca(0x178)]+=_0x55d653[_0x4079ca(0x178)],_0x55d653['createdSegmentId']&&_0x3f5a1['createdSegmentIds'][_0x4079ca(0xf5)](_0x55d653[_0x4079ca(0x1b3)][_0x4079ca(0x15b)],_0x55d653[_0x4079ca(0x1b3)]['id']),_0x3f5a1[_0x4079ca(0x116)][_0x4079ca(0x103)]+=_0x55d653['activations']['created'],_0x3f5a1['activations'][_0x4079ca(0x178)]+=_0x55d653[_0x4079ca(0x116)][_0x4079ca(0x178)],_0x3f5a1[_0x4079ca(0x116)][_0x4079ca(0x176)]+=_0x55d653[_0x4079ca(0x116)]['deleted'];}return _0x3f5a1;}async function syncActivationsForSegment(_0x288ea2,_0x3e5c0a,_0x31d7b2,_0x295d50,_0xe4c019,_0xede866,_0x300aa3){const _0x3e35ea=a151_0x35cf28,_0x318981={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2d9b24 of _0xe4c019){try{if(_0x2d9b24['type']==='create'&&_0x2d9b24['validatedRequest'])_0xede866[_0x3e35ea(0x131)]?.({'type':'activation_creating','segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),await _0xede866[_0x3e35ea(0x148)](_0x3e35ea(0x1be)+_0x2d9b24[_0x3e35ea(0x15b)]+_0x3e35ea(0x12d),()=>_0x288ea2[_0x3e35ea(0x1ab)][_0x3e35ea(0x19f)](_0x3e5c0a,_0x31d7b2,_0x2d9b24[_0x3e35ea(0x1cf)])),_0xede866['onProgress']?.({'type':_0x3e35ea(0x1da),'segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),_0xede866[_0x3e35ea(0x1e7)]?.('Created\x20activation\x20\x27'+_0x2d9b24[_0x3e35ea(0x15b)]+'\x27'),_0x318981['created']++;else{if(_0x2d9b24[_0x3e35ea(0x152)]===_0x3e35ea(0xe5)&&_0x2d9b24[_0x3e35ea(0x1cf)]&&_0x2d9b24[_0x3e35ea(0x150)])_0xede866['onProgress']?.({'type':_0x3e35ea(0x1ca),'segmentName':_0x295d50,'activationName':_0x2d9b24['name']}),await _0xede866[_0x3e35ea(0x148)](_0x3e35ea(0x1d1)+_0x2d9b24[_0x3e35ea(0x15b)]+_0x3e35ea(0x12d),()=>_0x288ea2[_0x3e35ea(0x1ab)][_0x3e35ea(0x1b0)](_0x3e5c0a,_0x31d7b2,_0x2d9b24['existingActivation']['id'],_0x2d9b24[_0x3e35ea(0x1cf)])),_0xede866[_0x3e35ea(0x131)]?.({'type':_0x3e35ea(0x1d8),'segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),_0xede866[_0x3e35ea(0x1e7)]?.(_0x3e35ea(0x159)+_0x2d9b24[_0x3e35ea(0x15b)]+'\x27'),_0x318981[_0x3e35ea(0x178)]++;else _0x2d9b24[_0x3e35ea(0x152)]===_0x3e35ea(0x117)&&_0x2d9b24['existingActivation']&&(_0xede866[_0x3e35ea(0x131)]?.({'type':'activation_deleting','segmentName':_0x295d50,'activationName':_0x2d9b24['name']}),await _0xede866[_0x3e35ea(0x148)](_0x3e35ea(0x161)+_0x2d9b24['name']+_0x3e35ea(0x12d),()=>_0x288ea2['segment'][_0x3e35ea(0x1b7)](_0x3e5c0a,_0x31d7b2,_0x2d9b24[_0x3e35ea(0x150)]['id'])),_0xede866[_0x3e35ea(0x131)]?.({'type':_0x3e35ea(0x166),'segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),_0xede866['logDeleted']?.(_0x3e35ea(0x118)+_0x2d9b24['name']+'\x27'),_0x318981[_0x3e35ea(0x176)]++);}}catch(_0x1cf3b5){const _0xc09605=isHttp400Error(_0x1cf3b5),_0x5b4630=_0xc09605?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x3e35ea(0xfa)],_0x3614f7=getErrorMessage(_0x1cf3b5);throw new SDKError(_0x5b4630,_0x3e35ea(0x104)+_0x2d9b24['type']+'\x20activation\x20\x27'+_0x2d9b24[_0x3e35ea(0x15b)]+_0x3e35ea(0x194)+_0x300aa3+_0x3e35ea(0x16e)+_0x3614f7,_0x1cf3b5);}}return _0x318981;}export async function executePushFolders(_0x3fcfee,_0x12bf8d,_0x1e0686,_0x1e41d3,_0x4b30ce){const _0x35c88c=a151_0x35cf28,_0x57ef5c=new Map(_0x1e0686),_0x5bc955=sortFoldersByDepth(_0x12bf8d);for(const _0x2354c8 of _0x5bc955){const _0x4b7a8f=_0x2354c8['split']('/'),_0xb33d27=_0x4b7a8f[_0x4b7a8f[_0x35c88c(0x1e8)]-0x1],_0x3ef5d3=_0x4b7a8f[_0x35c88c(0x1aa)](0x0,-0x1)['join']('/'),_0x3eda0a=_0x57ef5c[_0x35c88c(0x14e)](_0x3ef5d3);_0x4b30ce['onProgress']?.({'type':'folder_creating','folder':_0x2354c8});const _0x220c1c={'name':_0xb33d27,'parentFolderId':_0x3eda0a},_0xe02179=await _0x4b30ce[_0x35c88c(0x148)]('Creating\x20folder\x20\x27'+_0x2354c8+_0x35c88c(0x12d),()=>_0x3fcfee[_0x35c88c(0x1ab)]['createFolder'](_0x1e41d3['parentId'],_0x220c1c));_0x57ef5c[_0x35c88c(0xf5)](_0x2354c8,_0xe02179[_0x35c88c(0x1ec)]['id']),_0x4b30ce['onProgress']?.({'type':_0x35c88c(0x155),'folder':_0x2354c8,'folderId':_0xe02179['data']['id']}),_0x4b30ce[_0x35c88c(0x14d)]?.(_0x35c88c(0x19c)+_0x2354c8+'\x27');}return _0x57ef5c;}export async function executePushSegmentDeletions(_0x1d60b9,_0x2e0c13,_0x10a68c){const _0x14360a=a151_0x35cf28;if(_0x2e0c13[_0x14360a(0x1e8)]===0x0)return 0x0;const {batchAsync:_0x47e120}=await import(_0x14360a(0x11f)),_0xe99f3b=0x5,_0x56e64b=await _0x47e120(_0x2e0c13,async _0x1814b2=>{const _0x259b16=_0x14360a;return _0x10a68c[_0x259b16(0x131)]?.({'type':_0x259b16(0x13a),'name':_0x1814b2[_0x259b16(0x15b)]}),await _0x1d60b9[_0x259b16(0x1ab)]['deleteSegment'](_0x1814b2['id']),_0x10a68c[_0x259b16(0x131)]?.({'type':_0x259b16(0x133),'name':_0x1814b2[_0x259b16(0x15b)]}),_0x10a68c[_0x259b16(0x17c)]?.(_0x259b16(0x1ac)+_0x1814b2[_0x259b16(0x15b)]+'\x27'),0x1;},_0xe99f3b);return _0x56e64b[_0x14360a(0x106)]((_0x1c4688,_0x7f6c4)=>_0x1c4688+_0x7f6c4,0x0);}export async function executePushJourneys(_0x5e52d5,_0x10d542,_0x2c2a93,_0x4b1927,_0x2dc92f){const _0x222c3e=a151_0x35cf28,{journeyDefToRequest:_0x372c16}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x40ded6,yamlRuleToApi:_0x461104,validateSegmentRule:_0x2f89ce}=await import(_0x222c3e(0x1b5)),_0x226047={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x43f3a7=new Map(_0x2c2a93[_0x222c3e(0x189)]),_0x111ede=0x5;for(let _0x41fe09=0x0;_0x41fe09<_0x10d542[_0x222c3e(0x1e8)];_0x41fe09+=_0x111ede){const _0x2ac508=_0x10d542[_0x222c3e(0x1aa)](_0x41fe09,_0x41fe09+_0x111ede),_0x4d224b=await Promise[_0x222c3e(0x156)](_0x2ac508['map'](async _0x566a35=>{const _0x565b5d=_0x222c3e;if(!_0x566a35[_0x565b5d(0x1cb)]&&!_0x566a35[_0x565b5d(0x168)])return{'action':_0x565b5d(0x1d5),'name':_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)],'journeyId':_0x566a35[_0x565b5d(0x1d3)]?.['id']};const _0xe6c583=_0x566a35[_0x565b5d(0x177)]?_0x2c2a93[_0x565b5d(0x130)]['get'](_0x566a35[_0x565b5d(0x177)]):undefined;_0x2dc92f[_0x565b5d(0x131)]?.({'type':_0x566a35[_0x565b5d(0x1cb)]?'journey_creating':_0x565b5d(0x11a),'name':_0x566a35['yamlConfig'][_0x565b5d(0x15b)]});try{const _0x546f5c=await executeSingleJourneyPush(_0x5e52d5,_0x566a35,{..._0x2c2a93,'segmentNameToId':_0x43f3a7},{'parentId':_0x4b1927[_0x565b5d(0xf0)],'rootFolderId':_0x4b1927[_0x565b5d(0x1d4)],'folderId':_0xe6c583,'verbose':_0x4b1927[_0x565b5d(0x1ae)]},_0x2dc92f,{'journeyDefToRequest':_0x372c16,'activationDefToCreateRequest':_0x40ded6,'yamlRuleToApi':_0x461104,'validateSegmentRule':_0x2f89ce});for(const [_0x56460e,_0x48ea8]of _0x546f5c['embeddedSegmentNameToId']){_0x43f3a7[_0x565b5d(0xf5)](_0x56460e,_0x48ea8),_0x226047[_0x565b5d(0x1c5)][_0x565b5d(0xf5)](_0x56460e,_0x48ea8);}if(_0x546f5c[_0x565b5d(0x165)]===_0x565b5d(0x103))_0x2dc92f[_0x565b5d(0x131)]?.({'type':_0x565b5d(0x1d7),'name':_0x566a35['yamlConfig'][_0x565b5d(0x15b)],'journeyId':_0x546f5c['journeyId']}),_0x2dc92f['logSuccess']?.(_0x565b5d(0x115)+_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)]+'\x27'),_0x226047[_0x565b5d(0x103)]++;else _0x546f5c[_0x565b5d(0x165)]===_0x565b5d(0x178)&&(_0x2dc92f['onProgress']?.({'type':'journey_updated','name':_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)]}),_0x2dc92f[_0x565b5d(0x1e7)]?.('Updated\x20journey\x20\x27'+_0x566a35[_0x565b5d(0x1a0)]['name']+'\x27'),_0x226047[_0x565b5d(0x178)]++);return{'action':_0x546f5c['action'],'name':_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)],'journeyId':_0x546f5c[_0x565b5d(0x12a)]};}catch(_0xefe8e5){const _0x2d2825=isHttp400Error(_0xefe8e5),_0x21f309=_0x2d2825?ErrorCode[_0x565b5d(0x144)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4405e8=getErrorMessage(_0xefe8e5);throw new SDKError(_0x21f309,_0x565b5d(0x104)+(_0x566a35[_0x565b5d(0x1cb)]?'create':_0x565b5d(0xe5))+_0x565b5d(0x1a2)+_0x566a35[_0x565b5d(0x169)]+_0x565b5d(0x16e)+_0x4405e8,_0xefe8e5);}}));_0x226047[_0x222c3e(0x1b6)]['push'](..._0x4d224b);}return _0x226047;}async function matchExistingJourneySegments(_0x465a64,_0x23aeb7,_0x4079fb,_0x2de972,_0x33c4b1){const _0xacb9b3=a151_0x35cf28;if(!_0x23aeb7[_0xacb9b3(0x1d3)]||!_0x23aeb7[_0xacb9b3(0x1a0)][_0xacb9b3(0x136)])return;const _0x37ec87=new Map(),_0x508a5e=new Set();for(const _0x36fcea of Object['keys'](_0x23aeb7[_0xacb9b3(0x1a0)][_0xacb9b3(0x136)])){const _0x284a03=generateDeterministicJourneySegmentName(_0x23aeb7[_0xacb9b3(0x1a0)][_0xacb9b3(0x15b)],_0x36fcea);_0x37ec87[_0xacb9b3(0xf5)](_0x284a03,_0x36fcea),_0x508a5e['add'](_0x36fcea);}const _0x4b7c3c=[],_0x3ce6e2=collectSegmentIdsFromJourneyApi(_0x23aeb7[_0xacb9b3(0x1d3)]);for(const _0x32489c of _0x3ce6e2){const _0x31406d=await fetchSegment(_0x465a64,_0x4079fb,_0x32489c,_0x2de972);if(!_0x31406d?.[_0xacb9b3(0x15b)])continue;const _0x316adf=_0x37ec87['get'](_0x31406d[_0xacb9b3(0x15b)]);_0x316adf?(_0x33c4b1[_0xacb9b3(0xf5)](_0x316adf,_0x32489c),_0x508a5e[_0xacb9b3(0x117)](_0x316adf)):_0x4b7c3c[_0xacb9b3(0x19b)]({'id':_0x32489c,'seg':_0x31406d});}if(_0x508a5e[_0xacb9b3(0x180)]>0x0&&_0x4b7c3c[_0xacb9b3(0x1e8)]>0x0){const {localExpandedRuleToNames:_0x549eac}=buildLocalExpandedRuleMappings(_0x23aeb7['yamlConfig']),_0x2bf8f1=new Map();for(const {id:_0x397f95,seg:_0x4d698f}of _0x4b7c3c){if(_0x4d698f[_0xacb9b3(0x190)]){const _0x4d848e=apiRuleToYaml(_0x4d698f['rule']);_0x2bf8f1[_0xacb9b3(0xf5)](_0x397f95,_0x4d848e);}}for(const {id:_0xe55cfb,seg:_0x2fdffb}of _0x4b7c3c){if(!_0x2fdffb[_0xacb9b3(0x190)])continue;const _0x8c2545=_0x2bf8f1[_0xacb9b3(0x14e)](_0xe55cfb);if(!_0x8c2545)continue;const _0x582114=serializeExpandedRule(_0x8c2545,_0x2bf8f1),_0x91e873=_0x549eac[_0xacb9b3(0x14e)](_0x582114);if(_0x91e873){const _0xac968d=_0x91e873[_0xacb9b3(0x163)](_0x4f49c3=>_0x508a5e['has'](_0x4f49c3));_0xac968d&&(_0x33c4b1[_0xacb9b3(0xf5)](_0xac968d,_0xe55cfb),_0x508a5e[_0xacb9b3(0x117)](_0xac968d),logger[_0xacb9b3(0x153)](_0xacb9b3(0x1c0)+_0x2fdffb[_0xacb9b3(0x15b)]+'\x27\x20to\x20local\x20\x27'+_0xac968d+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x9930dc,_0x3a1541,_0x171946,_0x30b6bd,_0x42b394,_0xbedebc){const _0x384465=a151_0x35cf28,{journeyDefToRequest:_0x48c1b6,activationDefToCreateRequest:_0x56719f,yamlRuleToApi:_0x4084a6,validateSegmentRule:_0x1ab6fe}=_0xbedebc,_0x408245=new Map(),_0x1e761c=new Map();recoverSegmentIdsFromPushRecovery(_0x3a1541,_0x408245,_0x171946['segmentNameToId']);const _0x566bf4=new Map(),_0xe6a6f7=new Map(),_0xce4147=new Map();let _0x334663;const _0x21fbb4=async()=>{const _0x31ba89=a151_0xb026;if(_0x334663)return;_0x334663=new Map();if(!_0x3a1541[_0x31ba89(0x1d3)])return;const _0x51e471=await _0x9930dc[_0x31ba89(0x149)][_0x31ba89(0x129)](_0x3a1541['existingJourney']['id']);for(const _0x30a945 of _0x51e471){const _0x476835=journeyActivationStepToYaml(_0x30a945,_0x171946[_0x31ba89(0x1a7)],_0x171946['connectionIdToNameMap']),_0x5084a0=activationSignature(_0x476835);!_0x334663[_0x31ba89(0x14c)](_0x5084a0)&&_0x334663[_0x31ba89(0xf5)](_0x5084a0,_0x30a945['id']),_0x476835[_0x31ba89(0x15b)]&&_0x1e761c[_0x31ba89(0xf5)](_0x476835['name'],_0x30a945['id']);}};await matchExistingJourneySegments(_0x9930dc,_0x3a1541,_0x30b6bd[_0x384465(0xf0)],_0x171946[_0x384465(0x1bb)],_0x171946[_0x384465(0x189)]);const _0x20aa71={'resolveSegmentId':async _0x34a369=>{const _0x8ba902=_0x384465,_0x21e5d4=_0x171946[_0x8ba902(0x189)][_0x8ba902(0x14e)](_0x34a369);if(!_0x21e5d4)throw new SDKError(ErrorCode[_0x8ba902(0x199)],_0x8ba902(0x100)+_0x34a369+_0x8ba902(0x1cc)+_0x3a1541['yamlConfig'][_0x8ba902(0x15b)]+')');return _0x21e5d4;},'resolveEmbeddedSegmentId':async(_0x463137,_0x178394)=>{const _0x29fee1=_0x384465,_0x14cc1d=_0x171946[_0x29fee1(0x189)][_0x29fee1(0x14e)](_0x463137);if(_0x14cc1d)return _0x14cc1d;const _0xe032e=_0x171946[_0x29fee1(0x1bb)]['find'](_0x2c127f=>_0x2c127f[_0x29fee1(0x15b)]===_0x463137);if(_0xe032e)return _0x171946[_0x29fee1(0x189)][_0x29fee1(0xf5)](_0x463137,_0xe032e['id']),_0xe032e['id'];if(_0x3a1541[_0x29fee1(0x1cb)]){const {stageName:_0x38e923,criteriaName:_0x5bf170}=findSegmentCriteriaLocation(_0x3a1541[_0x29fee1(0x1a0)],_0x463137);return _0x1ab6fe(_0x463137,_0x178394['rule']),_0xe6a6f7[_0x29fee1(0xf5)](_0x463137,{'definition':_0x178394,'stageName':_0x38e923,'criteriaName':_0x5bf170}),createPendingSegmentId(_0x463137);}const _0x566329=_0x3a1541[_0x29fee1(0x1d3)]?.['id'];if(!_0x566329)throw new SDKError(ErrorCode[_0x29fee1(0xe7)],_0x29fee1(0x1d9));const _0x127052=_0x566bf4[_0x29fee1(0x14e)](_0x463137);if(_0x127052)return _0x127052;const _0x4a95e8=((async()=>{const _0x76eac1=_0x29fee1;_0x1ab6fe(_0x463137,_0x178394[_0x76eac1(0x190)]);const _0x4cd91f=generateDeterministicJourneySegmentName(_0x3a1541['yamlConfig']['name'],_0x463137),_0x204384=_0x171946['existingSegments'][_0x76eac1(0x163)](_0x263e79=>_0x263e79[_0x76eac1(0x15b)]===_0x4cd91f),_0x213913=createSegmentIdResolver(_0x171946['segmentNameToId'],_0x463137),_0x9656ba=await resolveRuleSegmentIds(_0x178394['rule'],_0x213913);let _0x3a17eb;return _0x204384?(await _0x9930dc[_0x76eac1(0x1ab)][_0x76eac1(0x197)](_0x30b6bd['parentId'],_0x204384['id'],{'description':_0x178394[_0x76eac1(0x12b)]||_0x76eac1(0x1a1)+_0x463137,'rule':_0x4084a6(_0x9656ba),'countPopulation':!![]}),_0x3a17eb=_0x204384['id'],saveSegmentToPushRecovery(_0x3a1541[_0x76eac1(0x169)],_0x3a1541[_0x76eac1(0x1a0)]['name'],_0x463137,{'segmentId':_0x3a17eb,'uniqueServerName':_0x4cd91f,'createdAt':new Date()[_0x76eac1(0x15c)]()})):_0x3a17eb=await createOrRecoverEmbeddedSegment(_0x9930dc,_0x3a1541,{'localName':_0x463137,'uniqueSegmentName':_0x4cd91f,'description':_0x178394[_0x76eac1(0x12b)]||_0x76eac1(0x1a1)+_0x463137,'journeyId':_0x566329,'resolvedRule':_0x9656ba,'parentId':_0x30b6bd[_0x76eac1(0xf0)],'folderId':_0x30b6bd[_0x76eac1(0x1d4)]||''},_0x4084a6),_0x171946['segmentNameToId']['set'](_0x463137,_0x3a17eb),_0x408245[_0x76eac1(0xf5)](_0x463137,_0x3a17eb),_0x3a17eb;})());_0x566bf4['set'](_0x463137,_0x4a95e8);try{return await _0x4a95e8;}finally{_0x566bf4[_0x29fee1(0x117)](_0x463137);}},'resolveActivationId':async _0x30b4c6=>{const _0x14de7c=_0x384465,_0x54eed2=_0x1e761c[_0x14de7c(0x14e)](_0x30b4c6);if(_0x54eed2)return _0x54eed2;if(_0x3a1541['existingJourney']){await _0x21fbb4();const _0x515adc=_0x1e761c['get'](_0x30b4c6);if(_0x515adc)return _0x515adc;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x14de7c(0x134)+_0x30b4c6+_0x14de7c(0x1cc)+_0x3a1541[_0x14de7c(0x1a0)]['name']+_0x14de7c(0x140)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x13e39c,_0x406bf5)=>{const _0x54e874=_0x384465,_0x1deb44=_0x1e761c[_0x54e874(0x14e)](_0x13e39c);if(_0x1deb44)return _0x1deb44;if(_0x3a1541['isNew'])return _0xce4147[_0x54e874(0xf5)](_0x13e39c,_0x406bf5),createPendingActivationId(_0x13e39c);if(_0x3a1541['existingJourney']){await _0x21fbb4();const _0x1a613d=_0x1e761c[_0x54e874(0x14e)](_0x406bf5[_0x54e874(0x15b)]);if(_0x1a613d)return _0x1e761c[_0x54e874(0xf5)](_0x13e39c,_0x1a613d),_0x1a613d;const _0x3fa8b3=activationSignature(_0x406bf5),_0x3c457a=_0x334663?.['get'](_0x3fa8b3);if(_0x3c457a)return _0x1e761c[_0x54e874(0xf5)](_0x13e39c,_0x3c457a),_0x3c457a;const _0x3b67f5=await _0x56719f(_0x406bf5,_0x171946[_0x54e874(0x124)]),_0xbaf6e6={..._0x3b67f5,..._0x406bf5[_0x54e874(0x17b)]!==undefined&&{'runAfterJourneyRefresh':_0x406bf5[_0x54e874(0x17b)]}},_0x15cd5e=await _0x9930dc[_0x54e874(0x149)]['createActivation'](_0x3a1541[_0x54e874(0x1d3)]['id'],_0xbaf6e6);return _0x1e761c[_0x54e874(0xf5)](_0x13e39c,_0x15cd5e['id']),_0x15cd5e['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x54e874(0x1bd));},'resolveJourneyId':async _0x4c3ef2=>{const _0x5596c4=_0x384465;try{return await _0x9930dc['journey'][_0x5596c4(0x151)](_0x30b6bd['parentId'],_0x4c3ef2);}catch(_0x37ad7e){throw new SDKError(ErrorCode[_0x5596c4(0x15a)],_0x5596c4(0xeb)+_0x4c3ef2+_0x5596c4(0x107)+_0x3a1541['yamlConfig'][_0x5596c4(0x15b)]+'\x27)',_0x37ad7e);}},'resolveStageId':async(_0x862226,_0x109d3c)=>{const _0x576c37=_0x384465,_0xb6d6ee=await _0x9930dc[_0x576c37(0x149)][_0x576c37(0x172)](_0x862226),_0x19dd66=_0xb6d6ee['attributes']['journeyStages']['find'](_0xd3c2bf=>_0xd3c2bf[_0x576c37(0x15b)][_0x576c37(0x114)]()===_0x109d3c[_0x576c37(0x114)]());if(!_0x19dd66?.['id'])throw new SDKError(ErrorCode[_0x576c37(0x15a)],'Stage\x20\x27'+_0x109d3c+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xb6d6ee[_0x576c37(0x10f)][_0x576c37(0x179)]||_0xb6d6ee['attributes'][_0x576c37(0x15b)])+'\x27');return _0x19dd66['id'];}},_0x3d550c=await _0x48c1b6(_0x3a1541['yamlConfig'],_0x30b6bd['parentId'],_0x20aa71),_0x110662=_0x30b6bd['folderId']||_0x30b6bd[_0x384465(0x1d4)];_0x110662&&(_0x3d550c[_0x384465(0x182)]={'parentFolder':{'data':{'id':_0x110662,'type':_0x384465(0xe2)}}});if(_0x3a1541['isNew']){if(_0xe6a6f7[_0x384465(0x180)]>0x0||_0xce4147['size']>0x0)return await executeThreeStepJourneyCreate(_0x9930dc,_0x3a1541,_0x3d550c,{'pendingEmbeddedSegments':_0xe6a6f7,'pendingEmbeddedActivations':_0xce4147,'embeddedSegmentNameToId':_0x408245,'journeyActivationNameToId':_0x1e761c},{..._0x30b6bd,'effectiveFolderId':_0x110662},_0x171946,_0x42b394,_0xbedebc);else{ensureJourneyDefaults(_0x3d550c[_0x384465(0x10f)]);const _0x5ec7a7=await _0x9930dc[_0x384465(0x149)][_0x384465(0x187)](_0x3d550c);return deletePushRecovery(_0x3a1541[_0x384465(0x169)]),{'action':'created','journeyId':_0x5ec7a7['id'],'embeddedSegmentNameToId':_0x408245};}}else{if(_0x3a1541[_0x384465(0x168)]&&_0x3a1541['existingJourney']){_0x3d550c['id']=_0x3a1541[_0x384465(0x1d3)]['id'];const _0xf589e1=_0x3d550c[_0x384465(0x10f)];_0x3a1541['existingJourney'][_0x384465(0x10f)]?.[_0x384465(0x179)]&&(_0xf589e1[_0x384465(0x179)]=_0x3a1541[_0x384465(0x1d3)][_0x384465(0x10f)][_0x384465(0x179)]);const _0x598cb0=_0x3a1541[_0x384465(0x1d3)][_0x384465(0x10f)]?.[_0x384465(0x162)];return _0x598cb0&&_0x3d550c[_0x384465(0x10f)][_0x384465(0x162)]&&injectExistingStageIds(_0x3d550c[_0x384465(0x10f)][_0x384465(0x162)],_0x598cb0),ensureJourneyDefaults(_0xf589e1),await _0x9930dc[_0x384465(0x149)][_0x384465(0xe5)](_0x3a1541[_0x384465(0x1d3)]['id'],_0x3d550c),deletePushRecovery(_0x3a1541[_0x384465(0x169)]),{'action':_0x384465(0x178),'journeyId':_0x3a1541['existingJourney']['id'],'embeddedSegmentNameToId':_0x408245};}}return deletePushRecovery(_0x3a1541[_0x384465(0x169)]),{'action':'unchanged','journeyId':_0x3a1541[_0x384465(0x1d3)]?.['id'],'embeddedSegmentNameToId':_0x408245};}function findSegmentCriteriaLocation(_0x25e62e,_0x4346ab){const _0x5d5c0f=a151_0x35cf28,_0x5c7b3e=_0x25e62e[_0x5d5c0f(0x196)]||_0x25e62e[_0x5d5c0f(0x1e2)]?.[0x0]?.['stages']||[];let _0x267e93=_0x5d5c0f(0x1ad),_0x31b1aa=_0x4346ab;const _0x2ff89c=_0x25e62e['goal']||_0x25e62e['journeys']?.[0x0]?.[_0x5d5c0f(0x108)];if(_0x2ff89c?.['segment']===_0x4346ab)return{'stageName':_0x5d5c0f(0x108),'criteriaName':_0x2ff89c[_0x5d5c0f(0x15b)]||_0x4346ab};_0x59162:for(const _0x35c619 of _0x5c7b3e){if(_0x35c619[_0x5d5c0f(0x1e3)]?.[_0x5d5c0f(0x1ab)]===_0x4346ab){_0x267e93=_0x35c619[_0x5d5c0f(0x15b)],_0x31b1aa=_0x35c619['entry_criteria'][_0x5d5c0f(0x15b)]||_0x4346ab;break;}if(_0x35c619[_0x5d5c0f(0x17d)])for(const _0x1ba5bf of _0x35c619['steps']){if(_0x1ba5bf[_0x5d5c0f(0x152)]===_0x5d5c0f(0x1b9)&&_0x1ba5bf[_0x5d5c0f(0xfd)]?.[_0x5d5c0f(0x135)])for(const _0x1946bc of _0x1ba5bf[_0x5d5c0f(0xfd)][_0x5d5c0f(0x135)]){if(_0x1946bc[_0x5d5c0f(0x1ab)]===_0x4346ab){_0x267e93=_0x35c619[_0x5d5c0f(0x15b)],_0x31b1aa=_0x1946bc['name']||_0x4346ab;break _0x59162;}}}}return{'stageName':_0x267e93,'criteriaName':_0x31b1aa};}async function executeThreeStepJourneyCreate(_0x230b48,_0x2de0d8,_0x1509e7,_0x587bf8,_0x54f982,_0x46ff13,_0x1e26f1,_0x4543d0){const _0x2e0aca=a151_0x35cf28,{activationDefToCreateRequest:_0x48a298,yamlRuleToApi:_0x349116}=_0x4543d0,{pendingEmbeddedSegments:_0x509377,pendingEmbeddedActivations:_0x460a9d,embeddedSegmentNameToId:_0xc0b489}=_0x587bf8,_0x1f56ff=JSON[_0x2e0aca(0xfe)](JSON[_0x2e0aca(0x1c3)](_0x1509e7));ensureJourneyDefaults(_0x1f56ff['attributes']),stripPendingIds(_0x1f56ff);const _0x25e204=await _0x230b48[_0x2e0aca(0x149)][_0x2e0aca(0x187)](_0x1f56ff),_0x195a5e=_0x25e204['id'],_0x5a0ccb=new Map();for(const _0x41c2f3 of _0x25e204[_0x2e0aca(0x10f)][_0x2e0aca(0x162)]){_0x5a0ccb[_0x2e0aca(0xf5)](_0x41c2f3['name']['toLowerCase'](),_0x41c2f3['id']);}recoverSegmentIdsFromPushRecovery(_0x2de0d8,_0xc0b489,_0x46ff13[_0x2e0aca(0x189)]);for(const [_0x50e41e,{definition:_0x31a17a}]of _0x509377){if(_0xc0b489[_0x2e0aca(0x14c)](_0x50e41e)){_0x1e26f1[_0x2e0aca(0x131)]?.({'type':_0x2e0aca(0x10d),'journeyName':_0x2de0d8['yamlConfig']['name'],'segmentName':_0x50e41e});continue;}const _0x39cb83=generateDeterministicJourneySegmentName(_0x2de0d8['yamlConfig']['name'],_0x50e41e);_0x1e26f1[_0x2e0aca(0x131)]?.({'type':_0x2e0aca(0x1e0),'journeyName':_0x2de0d8['yamlConfig'][_0x2e0aca(0x15b)],'segmentName':_0x50e41e});const _0x2c1cd6=createSegmentIdResolver(_0x46ff13[_0x2e0aca(0x189)],_0x50e41e),_0x11b7c1=await resolveRuleSegmentIds(_0x31a17a[_0x2e0aca(0x190)],_0x2c1cd6),_0xab8a40=await createOrRecoverEmbeddedSegment(_0x230b48,_0x2de0d8,{'localName':_0x50e41e,'uniqueSegmentName':_0x39cb83,'description':_0x31a17a[_0x2e0aca(0x12b)]||_0x2e0aca(0x1a1)+_0x50e41e,'journeyId':_0x195a5e,'resolvedRule':_0x11b7c1,'parentId':_0x54f982[_0x2e0aca(0xf0)],'folderId':_0x54f982[_0x2e0aca(0xf8)]||''},_0x349116);_0xc0b489[_0x2e0aca(0xf5)](_0x50e41e,_0xab8a40),_0x46ff13[_0x2e0aca(0x189)][_0x2e0aca(0xf5)](_0x50e41e,_0xab8a40),_0x1e26f1[_0x2e0aca(0x131)]?.({'type':'embedded_segment_created','journeyName':_0x2de0d8[_0x2e0aca(0x1a0)][_0x2e0aca(0x15b)],'segmentName':_0x50e41e});}const _0x1cd786=new Map();for(const [_0x109068,_0x1681af]of _0x460a9d){_0x1e26f1[_0x2e0aca(0x131)]?.({'type':_0x2e0aca(0xe4),'journeyName':_0x2de0d8['yamlConfig'][_0x2e0aca(0x15b)],'activationName':_0x109068});const _0x42951e=await _0x48a298(_0x1681af,_0x46ff13[_0x2e0aca(0x124)]),_0x402f17={..._0x42951e,..._0x1681af[_0x2e0aca(0x17b)]!==undefined&&{'runAfterJourneyRefresh':_0x1681af[_0x2e0aca(0x17b)]}},_0x462144=await _0x230b48[_0x2e0aca(0x149)][_0x2e0aca(0x19f)](_0x195a5e,_0x402f17);_0x1cd786[_0x2e0aca(0xf5)](_0x109068,_0x462144['id']),_0x587bf8[_0x2e0aca(0x1a5)]['set'](_0x109068,_0x462144['id']),_0x1e26f1['onProgress']?.({'type':_0x2e0aca(0x139),'journeyName':_0x2de0d8[_0x2e0aca(0x1a0)][_0x2e0aca(0x15b)],'activationName':_0x109068});}const _0x371f4d=JSON[_0x2e0aca(0xfe)](JSON[_0x2e0aca(0x1c3)](_0x1509e7));return _0x371f4d['id']=_0x195a5e,ensureJourneyDefaults(_0x371f4d[_0x2e0aca(0x10f)]),resolvePendingIdsInRequest(_0x371f4d,_0x1509e7,_0x5a0ccb,_0xc0b489,_0x1cd786,_0x1e26f1),await _0x230b48[_0x2e0aca(0x149)]['update'](_0x195a5e,_0x371f4d),deletePushRecovery(_0x2de0d8[_0x2e0aca(0x169)]),{'action':_0x2e0aca(0x103),'journeyId':_0x195a5e,'embeddedSegmentNameToId':_0xc0b489};}export function stripWaitStepPendingIds(_0x4f2cb5){const _0x71238f=a151_0x35cf28,_0x3afd62=_0x4f2cb5[_0x71238f(0x1a9)]&&isPendingSegmentId(_0x4f2cb5[_0x71238f(0x1a9)]),_0x6e98f4=_0x4f2cb5['conditions']?.[_0x71238f(0x1e4)](_0x1543e1=>_0x1543e1[_0x71238f(0x13c)]&&isPendingSegmentId(_0x1543e1[_0x71238f(0x13c)]));(_0x3afd62||_0x6e98f4)&&(_0x4f2cb5[_0x71238f(0x1a6)]='Duration',_0x4f2cb5[_0x71238f(0x1cd)]=0x1,_0x4f2cb5[_0x71238f(0x1e6)]='day',delete _0x4f2cb5[_0x71238f(0x1a9)],delete _0x4f2cb5[_0x71238f(0x198)],delete _0x4f2cb5[_0x71238f(0x109)],delete _0x4f2cb5['conditions']);}export function resolveWaitStepPendingIds(_0x17de2e,_0x5c6877,_0x2f49de,_0xe832cf){const _0x3df8fc=a151_0x35cf28;if(_0x5c6877['conditionSegmentId']&&isPendingSegmentId(_0x5c6877[_0x3df8fc(0x1a9)])){const _0x2ab6c1=_0x2f49de(_0x5c6877[_0x3df8fc(0x1a9)],_0x3df8fc(0xf1)+_0xe832cf+_0x3df8fc(0x1b8));_0x2ab6c1&&(_0x17de2e[_0x3df8fc(0x1a6)]=_0x3df8fc(0x12e),_0x17de2e[_0x3df8fc(0x1a9)]=_0x2ab6c1,delete _0x17de2e['waitStep'],delete _0x17de2e[_0x3df8fc(0x1e6)],_0x5c6877['conditionTimeoutDuration']!==undefined&&(_0x17de2e[_0x3df8fc(0x198)]=_0x5c6877['conditionTimeoutDuration']),_0x5c6877[_0x3df8fc(0x109)]&&(_0x17de2e[_0x3df8fc(0x109)]=_0x5c6877[_0x3df8fc(0x109)]));}if(_0x5c6877[_0x3df8fc(0x143)]){const _0x49bdaa=_0x5c6877[_0x3df8fc(0x143)]['some'](_0x3739fd=>_0x3739fd['segmentId']&&isPendingSegmentId(_0x3739fd[_0x3df8fc(0x13c)]));if(_0x49bdaa){const _0x2acfdb=_0x5c6877[_0x3df8fc(0x143)][_0x3df8fc(0x16b)](_0x42095c=>{const _0x58b33b=_0x3df8fc;if(_0x42095c[_0x58b33b(0x13c)]&&isPendingSegmentId(_0x42095c[_0x58b33b(0x13c)])){const _0xbd7734=_0x2f49de(_0x42095c['segmentId'],_0x58b33b(0xf1)+_0xe832cf+_0x58b33b(0x1b8));return{..._0x42095c,'segmentId':_0xbd7734||_0x42095c[_0x58b33b(0x13c)]};}return{..._0x42095c};});_0x17de2e[_0x3df8fc(0x1a6)]=_0x3df8fc(0x12e),_0x17de2e[_0x3df8fc(0x143)]=_0x2acfdb,delete _0x17de2e[_0x3df8fc(0x1cd)],delete _0x17de2e[_0x3df8fc(0x1e6)],delete _0x17de2e[_0x3df8fc(0x1a9)],delete _0x17de2e[_0x3df8fc(0x198)],delete _0x17de2e[_0x3df8fc(0x109)];}}}function stripPendingIds(_0x2e4b18){const _0x4d82e0=a151_0x35cf28;_0x2e4b18[_0x4d82e0(0x10f)]['goal']?.[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x2e4b18[_0x4d82e0(0x10f)][_0x4d82e0(0x108)][_0x4d82e0(0x13c)])&&delete _0x2e4b18['attributes'][_0x4d82e0(0x108)];for(const _0x22a9d4 of _0x2e4b18[_0x4d82e0(0x10f)][_0x4d82e0(0x162)]||[]){_0x22a9d4[_0x4d82e0(0x13f)]?.[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x22a9d4[_0x4d82e0(0x13f)]['segmentId'])&&delete _0x22a9d4[_0x4d82e0(0x13f)];_0x22a9d4[_0x4d82e0(0xea)]?.[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x22a9d4[_0x4d82e0(0xea)][_0x4d82e0(0x13c)])&&delete _0x22a9d4['milestone'];_0x22a9d4[_0x4d82e0(0x10e)]&&(_0x22a9d4[_0x4d82e0(0x10e)]=_0x22a9d4[_0x4d82e0(0x10e)][_0x4d82e0(0x10a)](_0x6cdf5c=>!_0x6cdf5c['segmentId']||!isPendingSegmentId(_0x6cdf5c[_0x4d82e0(0x13c)])));if(_0x22a9d4['steps'])for(const _0x61656 of Object[_0x4d82e0(0x14b)](_0x22a9d4[_0x4d82e0(0x17d)])){const _0x471f92=_0x22a9d4[_0x4d82e0(0x17d)][_0x61656];_0x471f92[_0x4d82e0(0x152)]===_0x4d82e0(0x101)&&_0x471f92['journeyActivationStepId']&&isPendingActivationId(_0x471f92['journeyActivationStepId'])&&(_0x471f92['journeyActivationStepId']='');if(_0x471f92[_0x4d82e0(0x152)]===_0x4d82e0(0x1d2)&&_0x471f92[_0x4d82e0(0x135)])for(const _0x502038 of _0x471f92['branches']){_0x502038[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x502038[_0x4d82e0(0x13c)])&&(_0x502038[_0x4d82e0(0x13c)]='');}_0x471f92[_0x4d82e0(0x152)]===_0x4d82e0(0x102)&&stripWaitStepPendingIds(_0x471f92);}}}function resolvePendingIdsInRequest(_0xba4aa,_0x2f76a9,_0x9722d0,_0x4222d0,_0x5735a2,_0x177103){const _0x5f1a64=a151_0x35cf28,_0x1446d2=(_0x49ac70,_0x4a5b18)=>{const _0x143a19=a151_0xb026;if(!isPendingSegmentId(_0x49ac70))return _0x49ac70;const _0x58fdf8=extractPendingSegmentName(_0x49ac70),_0x4390d9=_0x4222d0[_0x143a19(0x14e)](_0x58fdf8);return!_0x4390d9&&_0x177103[_0x143a19(0x16a)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x58fdf8+_0x143a19(0xf6)+_0x4a5b18),_0x4390d9;};if(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)]?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)][_0x5f1a64(0x13c)])){const _0x4e9f43=_0x1446d2(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)][_0x5f1a64(0x13c)],_0x5f1a64(0x18e));_0x4e9f43&&(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)]['segmentId']=_0x4e9f43);}for(const _0x27b973 of _0xba4aa[_0x5f1a64(0x10f)]['journeyStages']||[]){const _0x1ddc22=_0x9722d0[_0x5f1a64(0x14e)](_0x27b973[_0x5f1a64(0x15b)]['toLowerCase']());_0x1ddc22&&(_0x27b973['id']=_0x1ddc22);if(_0x27b973[_0x5f1a64(0x13f)]?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x27b973[_0x5f1a64(0x13f)][_0x5f1a64(0x13c)])){const _0x4bc17a=_0x1446d2(_0x27b973[_0x5f1a64(0x13f)][_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973[_0x5f1a64(0x15b)]+_0x5f1a64(0x18f));_0x4bc17a&&(_0x27b973[_0x5f1a64(0x13f)][_0x5f1a64(0x13c)]=_0x4bc17a);}if(_0x27b973[_0x5f1a64(0x10e)])for(const _0x4e2933 of _0x27b973[_0x5f1a64(0x10e)]){if(_0x4e2933[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x4e2933[_0x5f1a64(0x13c)])){const _0x4916ca=_0x1446d2(_0x4e2933[_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973[_0x5f1a64(0x15b)]+_0x5f1a64(0x1a4));_0x4916ca&&(_0x4e2933[_0x5f1a64(0x13c)]=_0x4916ca);}}if(_0x27b973[_0x5f1a64(0xea)]?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x27b973['milestone'][_0x5f1a64(0x13c)])){const _0x47c610=_0x1446d2(_0x27b973['milestone'][_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973[_0x5f1a64(0x15b)]+_0x5f1a64(0x1af));_0x47c610&&(_0x27b973[_0x5f1a64(0xea)][_0x5f1a64(0x13c)]=_0x47c610);}if(_0x27b973['steps']){const _0x338084=_0x16c0d0=>_0x2f76a9[_0x5f1a64(0x10f)]['journeyStages']?.[_0x5f1a64(0x163)](_0x290eb3=>_0x290eb3[_0x5f1a64(0x15b)][_0x5f1a64(0x114)]()===_0x27b973[_0x5f1a64(0x15b)]['toLowerCase']())?.[_0x5f1a64(0x17d)]?.[_0x16c0d0];for(const _0x39b398 of Object[_0x5f1a64(0x14b)](_0x27b973[_0x5f1a64(0x17d)])){const _0x88789d=_0x27b973[_0x5f1a64(0x17d)][_0x39b398],_0x58f07b=_0x338084(_0x39b398);if(_0x88789d[_0x5f1a64(0x152)]==='Activation'&&_0x88789d[_0x5f1a64(0x1b1)]&&(isPendingActivationId(_0x88789d['journeyActivationStepId'])||_0x88789d['journeyActivationStepId']==='')){if(_0x58f07b?.[_0x5f1a64(0x1b1)]&&isPendingActivationId(_0x58f07b[_0x5f1a64(0x1b1)])){const _0x42de87=extractPendingActivationName(_0x58f07b[_0x5f1a64(0x1b1)]),_0x40d631=_0x5735a2[_0x5f1a64(0x14e)](_0x42de87);_0x40d631&&(_0x88789d[_0x5f1a64(0x1b1)]=_0x40d631);}}if(_0x88789d[_0x5f1a64(0x152)]===_0x5f1a64(0x1d2)&&_0x88789d[_0x5f1a64(0x135)]&&_0x58f07b?.['branches'])for(let _0x194fc0=0x0;_0x194fc0<_0x88789d[_0x5f1a64(0x135)][_0x5f1a64(0x1e8)];_0x194fc0++){const _0x1d8ac3=_0x88789d[_0x5f1a64(0x135)][_0x194fc0],_0x1eb473=_0x58f07b[_0x5f1a64(0x135)][_0x194fc0];if(_0x1eb473?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x1eb473[_0x5f1a64(0x13c)])){const _0x5063de=_0x1446d2(_0x1eb473[_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973['name']+_0x5f1a64(0x10c)+(_0x1d8ac3[_0x5f1a64(0x15b)]||_0x194fc0)+'\x27');_0x5063de&&(_0x1d8ac3['segmentId']=_0x5063de);}}_0x88789d[_0x5f1a64(0x152)]===_0x5f1a64(0x102)&&_0x58f07b?.[_0x5f1a64(0x152)]===_0x5f1a64(0x102)&&resolveWaitStepPendingIds(_0x88789d,_0x58f07b,_0x1446d2,_0x27b973[_0x5f1a64(0x15b)]);}}}}
@@ -1 +1 @@
1
- (function(_0x2734c2,_0x167dbf){const _0x4a4d91=a152_0x3cc2,_0x2d7fd9=_0x2734c2();while(!![]){try{const _0x502d19=-parseInt(_0x4a4d91(0x1c8))/0x1*(parseInt(_0x4a4d91(0x1bd))/0x2)+parseInt(_0x4a4d91(0x1c5))/0x3*(parseInt(_0x4a4d91(0x1c2))/0x4)+-parseInt(_0x4a4d91(0x1c6))/0x5+-parseInt(_0x4a4d91(0x1cb))/0x6+-parseInt(_0x4a4d91(0x1c3))/0x7+-parseInt(_0x4a4d91(0x1be))/0x8*(parseInt(_0x4a4d91(0x1c9))/0x9)+parseInt(_0x4a4d91(0x1ca))/0xa;if(_0x502d19===_0x167dbf)break;else _0x2d7fd9['push'](_0x2d7fd9['shift']());}catch(_0x32dfa1){_0x2d7fd9['push'](_0x2d7fd9['shift']());}}}(a152_0x213d,0xd6bfa));function a152_0x3cc2(_0x44f898,_0x5df16a){_0x44f898=_0x44f898-0x1bc;const _0x213dec=a152_0x213d();let _0x3cc229=_0x213dec[_0x44f898];return _0x3cc229;}export function buildFolderIdToPathMap(_0x350ce6){const _0x25d8ef=a152_0x3cc2,_0x404376=new Map(),_0x5dacec=new Map();for(const _0x1554e0 of _0x350ce6){_0x5dacec[_0x25d8ef(0x1bf)](_0x1554e0['id'],_0x1554e0);}const _0x5c0c47=new Set();for(const _0x544e9b of _0x350ce6){!_0x544e9b['parentFolderId']&&_0x5c0c47['add'](_0x544e9b['id']);}function _0x438812(_0xd598a0){const _0x416747=_0x25d8ef;if(_0x404376[_0x416747(0x1c7)](_0xd598a0['id']))return _0x404376[_0x416747(0x1c0)](_0xd598a0['id']);if(_0x5c0c47[_0x416747(0x1c7)](_0xd598a0['id']))return _0x404376[_0x416747(0x1bf)](_0xd598a0['id'],''),'';if(_0xd598a0[_0x416747(0x1c1)]){const _0x1fae12=_0x5dacec[_0x416747(0x1c0)](_0xd598a0[_0x416747(0x1c1)]);if(_0x1fae12){const _0x513802=_0x438812(_0x1fae12),_0x447a82=_0x513802?_0x513802+'/'+_0xd598a0[_0x416747(0x1bc)]:_0xd598a0[_0x416747(0x1bc)];return _0x404376[_0x416747(0x1bf)](_0xd598a0['id'],_0x447a82),_0x447a82;}}const _0x3d307c=_0xd598a0[_0x416747(0x1bc)];return _0x404376['set'](_0xd598a0['id'],_0x3d307c),_0x3d307c;}for(const _0x3b648c of _0x350ce6){_0x438812(_0x3b648c);}return _0x404376;}function a152_0x213d(){const _0x120fe6=['2ToRqFP','8HPAkYh','set','get','parentFolderId','6416ndfRtx','11549804JeOqzb','add','1278pDIHzH','6628520tzgVUk','has','1736332YRGNBN','15507396IbamVU','69745280LwxNjP','2059020ydPjhK','name'];a152_0x213d=function(){return _0x120fe6;};return a152_0x213d();}export function buildFolderPathToIdMap(_0x56deab){const _0x33d0db=a152_0x3cc2,_0x3cb74f=new Map(),_0xfb49fd=new Map();for(const _0x4abe41 of _0x56deab){_0xfb49fd[_0x33d0db(0x1bf)](_0x4abe41['id'],_0x4abe41);}const _0x567217=new Set();for(const _0x3db99c of _0x56deab){!_0x3db99c[_0x33d0db(0x1c1)]&&_0x567217[_0x33d0db(0x1c4)](_0x3db99c['id']);}function _0x25224b(_0x587bde){const _0x4fb783=_0x33d0db;if(_0x567217[_0x4fb783(0x1c7)](_0x587bde['id']))return'';if(_0x587bde[_0x4fb783(0x1c1)]){const _0x56ad04=_0xfb49fd[_0x4fb783(0x1c0)](_0x587bde[_0x4fb783(0x1c1)]);if(_0x56ad04){const _0x3b3c1a=_0x25224b(_0x56ad04);return _0x3b3c1a?_0x3b3c1a+'/'+_0x587bde[_0x4fb783(0x1bc)]:_0x587bde[_0x4fb783(0x1bc)];}}return _0x587bde[_0x4fb783(0x1bc)];}for(const _0x20d0bc of _0x56deab){const _0x503f1c=_0x25224b(_0x20d0bc);_0x3cb74f[_0x33d0db(0x1bf)](_0x503f1c,_0x20d0bc['id']);}return _0x3cb74f;}export function buildFolderMaps(_0x7bad7b){const _0x1142d9=a152_0x3cc2,_0x2553b3=buildFolderIdToPathMap(_0x7bad7b),_0x379d60=new Map();for(const [_0x1a611f,_0x1e5357]of _0x2553b3){_0x379d60[_0x1142d9(0x1bf)](_0x1e5357,_0x1a611f);}return{'idToPath':_0x2553b3,'pathToId':_0x379d60};}export function getFolderPath(_0x302759,_0x1b8c23){const _0x3adef8=a152_0x3cc2;if(!_0x302759)return'';return _0x1b8c23[_0x3adef8(0x1c0)](_0x302759)??'';}
1
+ (function(_0x403b0b,_0x3bc720){const _0x32fd28=a152_0xccbb,_0x84cee=_0x403b0b();while(!![]){try{const _0x1b9fbf=parseInt(_0x32fd28(0xea))/0x1+-parseInt(_0x32fd28(0xf2))/0x2+parseInt(_0x32fd28(0xf1))/0x3+-parseInt(_0x32fd28(0xf6))/0x4*(parseInt(_0x32fd28(0xef))/0x5)+-parseInt(_0x32fd28(0xf3))/0x6+-parseInt(_0x32fd28(0xec))/0x7*(parseInt(_0x32fd28(0xed))/0x8)+-parseInt(_0x32fd28(0xf0))/0x9*(-parseInt(_0x32fd28(0xee))/0xa);if(_0x1b9fbf===_0x3bc720)break;else _0x84cee['push'](_0x84cee['shift']());}catch(_0x56e5e3){_0x84cee['push'](_0x84cee['shift']());}}}(a152_0x519c,0x9071b));function a152_0xccbb(_0x275600,_0x33713e){_0x275600=_0x275600-0xe9;const _0x519c8a=a152_0x519c();let _0xccbb61=_0x519c8a[_0x275600];return _0xccbb61;}export function buildFolderIdToPathMap(_0x3cf89f){const _0x390b33=a152_0xccbb,_0x59dbf3=new Map(),_0x1cde6a=new Map();for(const _0x5d1861 of _0x3cf89f){_0x1cde6a['set'](_0x5d1861['id'],_0x5d1861);}const _0xfc5396=new Set();for(const _0x409f66 of _0x3cf89f){!_0x409f66[_0x390b33(0xf8)]&&_0xfc5396[_0x390b33(0xe9)](_0x409f66['id']);}function _0x561eed(_0xeca2c1){const _0x1d68b5=_0x390b33;if(_0x59dbf3[_0x1d68b5(0xf5)](_0xeca2c1['id']))return _0x59dbf3[_0x1d68b5(0xeb)](_0xeca2c1['id']);if(_0xfc5396['has'](_0xeca2c1['id']))return _0x59dbf3[_0x1d68b5(0xf7)](_0xeca2c1['id'],''),'';if(_0xeca2c1[_0x1d68b5(0xf8)]){const _0x20fb81=_0x1cde6a[_0x1d68b5(0xeb)](_0xeca2c1[_0x1d68b5(0xf8)]);if(_0x20fb81){const _0x48dee9=_0x561eed(_0x20fb81),_0x223700=_0x48dee9?_0x48dee9+'/'+_0xeca2c1['name']:_0xeca2c1[_0x1d68b5(0xf4)];return _0x59dbf3[_0x1d68b5(0xf7)](_0xeca2c1['id'],_0x223700),_0x223700;}}const _0x37ec92=_0xeca2c1[_0x1d68b5(0xf4)];return _0x59dbf3[_0x1d68b5(0xf7)](_0xeca2c1['id'],_0x37ec92),_0x37ec92;}for(const _0x4b4bc1 of _0x3cf89f){_0x561eed(_0x4b4bc1);}return _0x59dbf3;}export function buildFolderPathToIdMap(_0xcc6fcf){const _0x3565d1=a152_0xccbb,_0x546a20=new Map(),_0x1ef776=new Map();for(const _0x262c9c of _0xcc6fcf){_0x1ef776[_0x3565d1(0xf7)](_0x262c9c['id'],_0x262c9c);}const _0x3ff6fa=new Set();for(const _0xd261be of _0xcc6fcf){!_0xd261be[_0x3565d1(0xf8)]&&_0x3ff6fa[_0x3565d1(0xe9)](_0xd261be['id']);}function _0x1786e4(_0x2c0b6f){const _0x3ddc32=_0x3565d1;if(_0x3ff6fa[_0x3ddc32(0xf5)](_0x2c0b6f['id']))return'';if(_0x2c0b6f[_0x3ddc32(0xf8)]){const _0x587f1f=_0x1ef776[_0x3ddc32(0xeb)](_0x2c0b6f[_0x3ddc32(0xf8)]);if(_0x587f1f){const _0x9f06a=_0x1786e4(_0x587f1f);return _0x9f06a?_0x9f06a+'/'+_0x2c0b6f[_0x3ddc32(0xf4)]:_0x2c0b6f[_0x3ddc32(0xf4)];}}return _0x2c0b6f[_0x3ddc32(0xf4)];}for(const _0x3588a5 of _0xcc6fcf){const _0x50e38c=_0x1786e4(_0x3588a5);_0x546a20[_0x3565d1(0xf7)](_0x50e38c,_0x3588a5['id']);}return _0x546a20;}export function buildFolderMaps(_0x9fe40c){const _0x30baea=a152_0xccbb,_0x490c89=buildFolderIdToPathMap(_0x9fe40c),_0xe7a5cb=new Map();for(const [_0x21dbb3,_0x4ab088]of _0x490c89){_0xe7a5cb[_0x30baea(0xf7)](_0x4ab088,_0x21dbb3);}return{'idToPath':_0x490c89,'pathToId':_0xe7a5cb};}function a152_0x519c(){const _0x60c4be=['8wJRtjK','80UfzBxi','5apvzUh','1794501njXBMm','3027570YaKphc','628418ZryMdV','4896456TVwexm','name','has','3402548EMKVBJ','set','parentFolderId','add','374044xcUfeV','get','2840467szlLfq'];a152_0x519c=function(){return _0x60c4be;};return a152_0x519c();}export function getFolderPath(_0x25e6c1,_0x484ed8){const _0x2e6703=a152_0xccbb;if(!_0x25e6c1)return'';return _0x484ed8[_0x2e6703(0xeb)](_0x25e6c1)??'';}
@@ -1 +1 @@
1
- (function(_0x4a980,_0x420614){const _0x144578=a153_0x13f3,_0x4c771d=_0x4a980();while(!![]){try{const _0x33e22a=-parseInt(_0x144578(0x1b6))/0x1*(-parseInt(_0x144578(0x1d4))/0x2)+-parseInt(_0x144578(0x1b8))/0x3*(-parseInt(_0x144578(0x1ad))/0x4)+parseInt(_0x144578(0x1ba))/0x5+-parseInt(_0x144578(0x1b1))/0x6*(parseInt(_0x144578(0x1ca))/0x7)+parseInt(_0x144578(0x1d1))/0x8*(-parseInt(_0x144578(0x1dc))/0x9)+parseInt(_0x144578(0x1c1))/0xa+-parseInt(_0x144578(0x1c2))/0xb;if(_0x33e22a===_0x420614)break;else _0x4c771d['push'](_0x4c771d['shift']());}catch(_0x592554){_0x4c771d['push'](_0x4c771d['shift']());}}}(a153_0x3b73,0xd3619));function a153_0x3b73(){const _0x5d576f=['isAbsolute','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','dirname','root','No\x20tdx.json\x20found\x20for\x20file:\x20','2106710pQDkRb','10413293OcHbtT','segments','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','join','tdx.json','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Cannot\x20split\x20empty\x20path','filter','28tXZrFo','length','trim','Path\x20cannot\x20be\x20empty','substring','startsWith','File\x20not\x20found:\x20','24amOWFW','journey','endsWith','44SJshVu','parent_segment','readFile','exists','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Cannot\x20navigate\x20above\x20root','parse','segment','2841102XglbBH','.yml','38344dtWUAs','Path\x20segment\x20cannot\x20be\x20empty','slice','raw','1746366dVnyrV','.yaml','split','resolve','pop','53255rKeBZu','push','273DsdupT','Relative\x20path\x20cannot\x20be\x20empty','8345755kccmbd'];a153_0x3b73=function(){return _0x5d576f;};return a153_0x3b73();}import a153_0xe8c71d from'path';import{parse as a153_0x393f16}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a153_0x13f3(_0x459a44,_0x510520){_0x459a44=_0x459a44-0x1ad;const _0x3b7351=a153_0x3b73();let _0x13f31f=_0x3b7351[_0x459a44];return _0x13f31f;}export function parsePath(_0x1942dd){const _0x1587f7=a153_0x13f3;if(!_0x1942dd||_0x1942dd[_0x1587f7(0x1cc)]()==='')throw new Error(_0x1587f7(0x1cd));const _0x1d15e1=_0x1942dd[_0x1587f7(0x1cc)]();if(_0x1d15e1==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x1942dd};const _0x2cf417=_0x1d15e1[_0x1587f7(0x1cf)]('/')?_0x1d15e1[_0x1587f7(0x1ce)](0x1):_0x1d15e1,_0x1ef0c0=_0x2cf417[_0x1587f7(0x1b3)]('/')[_0x1587f7(0x1c9)](_0x51ba29=>_0x51ba29!=='');if(_0x1ef0c0[_0x1587f7(0x1cb)]===0x0)throw new Error(_0x1587f7(0x1c7));const _0x1ad689=_0x1d15e1[_0x1587f7(0x1cf)]('/')||!isRelativePathSegment(_0x1ef0c0[0x0]);for(const _0x28afa7 of _0x1ef0c0){validatePathSegment(_0x28afa7);}return{'segments':_0x1ef0c0,'isAbsolute':_0x1ad689,'raw':_0x1942dd};}function isRelativePathSegment(_0x2af54a){return _0x2af54a==='.'||_0x2af54a==='..';}function validatePathSegment(_0x70a82b){const _0x4acbd7=a153_0x13f3;if(_0x70a82b==='')throw new Error(_0x4acbd7(0x1ae));if(_0x70a82b==='.'||_0x70a82b==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x70a82b))throw new Error(_0x4acbd7(0x1bd)+_0x70a82b);if(_0x70a82b!==_0x70a82b[_0x4acbd7(0x1cc)]()){}}export function validatePath(_0xc8f80b){const _0x2617e9=a153_0x13f3;if(_0xc8f80b[_0x2617e9(0x1c3)][_0x2617e9(0x1cb)]===0x0&&!_0xc8f80b[_0x2617e9(0x1bb)])throw new Error(_0x2617e9(0x1b9));if(_0xc8f80b[_0x2617e9(0x1bb)]){if(_0xc8f80b[_0x2617e9(0x1c3)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x5ae488=0x0;for(const _0x706372 of _0xc8f80b['segments']){if(_0x706372==='..'){if(_0x5ae488===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x5ae488--;}else _0x706372!=='.'&&_0x5ae488++;}}}export function joinPaths(_0x4a162f,_0x3cec3f){const _0x1a4a0f=a153_0x13f3;if(!_0x4a162f||_0x4a162f==='/')return _0x3cec3f;if(!_0x3cec3f||_0x3cec3f==='.')return _0x4a162f;if(_0x3cec3f[_0x1a4a0f(0x1cf)]('/'))return _0x3cec3f;const _0x5e2926=parsePath(_0x4a162f),_0x35533c=parsePath(_0x3cec3f),_0x14556d=[..._0x5e2926['segments']];for(const _0xbac63c of _0x35533c[_0x1a4a0f(0x1c3)]){if(_0xbac63c==='.')continue;else{if(_0xbac63c==='..'){if(_0x14556d[_0x1a4a0f(0x1cb)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x14556d[_0x1a4a0f(0x1b5)]();}else _0x14556d['push'](_0xbac63c);}}const _0x26a519=_0x14556d[_0x1a4a0f(0x1c5)]('/');return _0x5e2926[_0x1a4a0f(0x1b0)][_0x1a4a0f(0x1cf)]('/')?'/'+_0x26a519:_0x26a519;}export function normalizePath(_0x308fe6){const _0x4e3f43=a153_0x13f3,_0x289fc7=parsePath(_0x308fe6),_0x19ac06=[];for(const _0x516b5d of _0x289fc7['segments']){if(_0x516b5d==='.')continue;else{if(_0x516b5d==='..'){if(_0x19ac06['length']===0x0){if(_0x289fc7[_0x4e3f43(0x1bb)])throw new Error(_0x4e3f43(0x1d9));_0x19ac06[_0x4e3f43(0x1b7)]('..');}else _0x19ac06[_0x19ac06[_0x4e3f43(0x1cb)]-0x1]==='..'?_0x19ac06['push']('..'):_0x19ac06['pop']();}else _0x19ac06[_0x4e3f43(0x1b7)](_0x516b5d);}}if(_0x19ac06['length']===0x0)return _0x289fc7['isAbsolute']?'/':'.';const _0x5993f8=_0x19ac06[_0x4e3f43(0x1c5)]('/');return _0x289fc7['raw']['startsWith']('/')?'/'+_0x5993f8:_0x5993f8;}export function getParentPath(_0x2b9988){const _0x330136=a153_0x13f3,_0x33e2ea=parsePath(_0x2b9988);if(_0x33e2ea[_0x330136(0x1c3)][_0x330136(0x1cb)]<=0x1)return'/';const _0x357569=_0x33e2ea[_0x330136(0x1c3)][_0x330136(0x1af)](0x0,-0x1)[_0x330136(0x1c5)]('/');return _0x33e2ea['raw']['startsWith']('/')?'/'+_0x357569:_0x357569;}export function getBaseName(_0x66fc69){const _0x4eb24=a153_0x13f3,_0x3ac463=parsePath(_0x66fc69);return _0x3ac463[_0x4eb24(0x1c3)][_0x3ac463[_0x4eb24(0x1c3)][_0x4eb24(0x1cb)]-0x1]||'';}export function isChildPath(_0x4116c1,_0x254a8d){const _0x2d1e8e=a153_0x13f3,_0x24374b=parsePath(_0x4116c1),_0x495379=parsePath(_0x254a8d);if(_0x24374b[_0x2d1e8e(0x1c3)][_0x2d1e8e(0x1cb)]<=_0x495379[_0x2d1e8e(0x1c3)][_0x2d1e8e(0x1cb)])return![];for(let _0x39ae4b=0x0;_0x39ae4b<_0x495379[_0x2d1e8e(0x1c3)][_0x2d1e8e(0x1cb)];_0x39ae4b++){if(_0x24374b['segments'][_0x39ae4b]!==_0x495379[_0x2d1e8e(0x1c3)][_0x39ae4b])return![];}return!![];}export function splitPath(_0x846a22){const _0x1e9e94=a153_0x13f3,_0x593de7=parsePath(_0x846a22);if(_0x593de7['segments']['length']===0x0)throw new Error(_0x1e9e94(0x1c8));if(_0x593de7['segments'][_0x1e9e94(0x1cb)]===0x1)return{'parent':_0x593de7[_0x1e9e94(0x1c3)][0x0]};return{'parent':_0x593de7[_0x1e9e94(0x1c3)][0x0],'child':_0x593de7[_0x1e9e94(0x1c3)][_0x1e9e94(0x1af)](0x1)[_0x1e9e94(0x1c5)]('/')};}export function isYamlFilePath(_0xf30881){const _0x48432e=a153_0x13f3;return _0xf30881['endsWith'](_0x48432e(0x1dd))||_0xf30881[_0x48432e(0x1d3)](_0x48432e(0x1b2));}export async function resolveYamlFilePath(_0x43132f,_0x1fb98e=nodeFileSystem){const _0x411037=a153_0x13f3,_0x2cd830=a153_0xe8c71d[_0x411037(0x1b4)](_0x43132f);if(!await _0x1fb98e[_0x411037(0x1d7)](_0x2cd830))throw new Error(_0x411037(0x1d0)+_0x43132f);let _0x35af09=a153_0xe8c71d['dirname'](_0x2cd830),_0x273cb0=null,_0x52543b=null;const _0x449106=a153_0xe8c71d['parse'](_0x35af09)[_0x411037(0x1bf)];while(_0x35af09!==_0x449106){const _0x1b86c3=a153_0xe8c71d[_0x411037(0x1c5)](_0x35af09,_0x411037(0x1c6));if(await _0x1fb98e[_0x411037(0x1d7)](_0x1b86c3)){_0x273cb0=_0x1b86c3,_0x52543b=_0x35af09;break;}_0x35af09=a153_0xe8c71d[_0x411037(0x1be)](_0x35af09);}if(!_0x273cb0||!_0x52543b)throw new Error(_0x411037(0x1c0)+_0x43132f+'\x0a'+_0x411037(0x1d8));const _0x199f6f=await _0x1fb98e[_0x411037(0x1d6)](_0x273cb0),_0x9ed60a=JSON[_0x411037(0x1da)](_0x199f6f),_0x7e9836=_0x9ed60a[_0x411037(0x1d5)];if(!_0x7e9836)throw new Error(_0x411037(0x1bc));const _0x112f23=await _0x1fb98e[_0x411037(0x1d6)](_0x2cd830),_0x473258=a153_0x393f16(_0x112f23),_0x185d5b=_0x473258['name'];if(!_0x185d5b)throw new Error(_0x411037(0x1c4)+_0x43132f);const _0x45202a=_0x473258['type']===_0x411037(0x1d2)?_0x411037(0x1d2):_0x411037(0x1db),_0x318fa0=a153_0xe8c71d['relative'](_0x52543b,_0x2cd830),_0x9092c=a153_0xe8c71d[_0x411037(0x1be)](_0x318fa0),_0x45386d=_0x9092c==='.'?'':_0x9092c['replace'](/\\/g,'/'),_0x145a35=_0x45386d?_0x7e9836+'/'+_0x45386d+'/'+_0x185d5b:_0x7e9836+'/'+_0x185d5b;return{'parentSegment':_0x7e9836,'segmentName':_0x185d5b,'folderPath':_0x45386d,'fullPath':_0x145a35,'resourceType':_0x45202a,'content':_0x112f23};}
1
+ (function(_0x5aa60e,_0x1a3e1b){const _0xe16c3b=a153_0xad7b,_0x376d84=_0x5aa60e();while(!![]){try{const _0x2cff12=parseInt(_0xe16c3b(0x15b))/0x1+-parseInt(_0xe16c3b(0x155))/0x2*(-parseInt(_0xe16c3b(0x170))/0x3)+parseInt(_0xe16c3b(0x164))/0x4*(parseInt(_0xe16c3b(0x17d))/0x5)+-parseInt(_0xe16c3b(0x17e))/0x6*(-parseInt(_0xe16c3b(0x178))/0x7)+-parseInt(_0xe16c3b(0x15f))/0x8+-parseInt(_0xe16c3b(0x15a))/0x9*(parseInt(_0xe16c3b(0x175))/0xa)+parseInt(_0xe16c3b(0x158))/0xb*(-parseInt(_0xe16c3b(0x181))/0xc);if(_0x2cff12===_0x1a3e1b)break;else _0x376d84['push'](_0x376d84['shift']());}catch(_0x19e2ad){_0x376d84['push'](_0x376d84['shift']());}}}(a153_0x5018,0x40570));import a153_0x13f611 from'path';import{parse as a153_0x337491}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x308d01){const _0x2b5888=a153_0xad7b;if(!_0x308d01||_0x308d01['trim']()==='')throw new Error(_0x2b5888(0x16f));const _0x2c528b=_0x308d01[_0x2b5888(0x179)]();if(_0x2c528b==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x308d01};const _0x502c60=_0x2c528b[_0x2b5888(0x16e)]('/')?_0x2c528b['substring'](0x1):_0x2c528b,_0x231576=_0x502c60['split']('/')[_0x2b5888(0x163)](_0x282dff=>_0x282dff!=='');if(_0x231576[_0x2b5888(0x172)]===0x0)throw new Error(_0x2b5888(0x17b));const _0x39b579=_0x2c528b[_0x2b5888(0x16e)]('/')||!isRelativePathSegment(_0x231576[0x0]);for(const _0x2dc3a7 of _0x231576){validatePathSegment(_0x2dc3a7);}return{'segments':_0x231576,'isAbsolute':_0x39b579,'raw':_0x308d01};}function a153_0xad7b(_0xc13eea,_0x48cdd4){_0xc13eea=_0xc13eea-0x14f;const _0x501898=a153_0x5018();let _0xad7ba3=_0x501898[_0xc13eea];return _0xad7ba3;}function isRelativePathSegment(_0x5b23e3){return _0x5b23e3==='.'||_0x5b23e3==='..';}function validatePathSegment(_0x3edc3e){const _0x468514=a153_0xad7b;if(_0x3edc3e==='')throw new Error(_0x468514(0x162));if(_0x3edc3e==='.'||_0x3edc3e==='..')return;if(/[\x00-\x1F\x7F]/[_0x468514(0x173)](_0x3edc3e))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x3edc3e);if(_0x3edc3e!==_0x3edc3e[_0x468514(0x179)]()){}}export function validatePath(_0x19b07a){const _0x309dfe=a153_0xad7b;if(_0x19b07a['segments'][_0x309dfe(0x172)]===0x0&&!_0x19b07a[_0x309dfe(0x16b)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x19b07a[_0x309dfe(0x16b)]){if(_0x19b07a[_0x309dfe(0x174)][0x0]==='..')throw new Error(_0x309dfe(0x151));let _0x1c45b3=0x0;for(const _0x5b1520 of _0x19b07a[_0x309dfe(0x174)]){if(_0x5b1520==='..'){if(_0x1c45b3===0x0)throw new Error(_0x309dfe(0x154));_0x1c45b3--;}else _0x5b1520!=='.'&&_0x1c45b3++;}}}function a153_0x5018(){const _0x5bc8c6=['Path\x20segment\x20cannot\x20be\x20empty','filter','12MMVGVC','push','slice','dirname','resolve','journey','pop','isAbsolute','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','File\x20not\x20found:\x20','startsWith','Path\x20cannot\x20be\x20empty','690420CcKmWU','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','length','test','segments','30XVKphX','exists','Cannot\x20navigate\x20above\x20root','745563KhSvGR','trim','name','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','readFile','129485smmmdQ','6oweyAX','join','replace','12KaQDox','parent_segment','segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','.yml','Path\x20attempts\x20to\x20navigate\x20above\x20root','4FHBSoC','raw','root','567556gebwEl','relative','679689pWXdEj','32942bXJKPR','No\x20tdx.json\x20found\x20for\x20file:\x20','endsWith','parse','1085816SWOtXf','.yaml','Cannot\x20split\x20empty\x20path'];a153_0x5018=function(){return _0x5bc8c6;};return a153_0x5018();}export function joinPaths(_0xb87fb7,_0x3979c4){const _0x1b7310=a153_0xad7b;if(!_0xb87fb7||_0xb87fb7==='/')return _0x3979c4;if(!_0x3979c4||_0x3979c4==='.')return _0xb87fb7;if(_0x3979c4[_0x1b7310(0x16e)]('/'))return _0x3979c4;const _0x1327a4=parsePath(_0xb87fb7),_0x1854b6=parsePath(_0x3979c4),_0xb1e63d=[..._0x1327a4[_0x1b7310(0x174)]];for(const _0x21a059 of _0x1854b6[_0x1b7310(0x174)]){if(_0x21a059==='.')continue;else{if(_0x21a059==='..'){if(_0xb1e63d[_0x1b7310(0x172)]===0x0)throw new Error(_0x1b7310(0x177));_0xb1e63d[_0x1b7310(0x16a)]();}else _0xb1e63d[_0x1b7310(0x165)](_0x21a059);}}const _0x3b60fa=_0xb1e63d[_0x1b7310(0x17f)]('/');return _0x1327a4[_0x1b7310(0x156)]['startsWith']('/')?'/'+_0x3b60fa:_0x3b60fa;}export function normalizePath(_0x5422ce){const _0x197a51=a153_0xad7b,_0x5422d9=parsePath(_0x5422ce),_0x114c77=[];for(const _0xa6892b of _0x5422d9['segments']){if(_0xa6892b==='.')continue;else{if(_0xa6892b==='..'){if(_0x114c77[_0x197a51(0x172)]===0x0){if(_0x5422d9['isAbsolute'])throw new Error(_0x197a51(0x177));_0x114c77[_0x197a51(0x165)]('..');}else _0x114c77[_0x114c77['length']-0x1]==='..'?_0x114c77[_0x197a51(0x165)]('..'):_0x114c77[_0x197a51(0x16a)]();}else _0x114c77['push'](_0xa6892b);}}if(_0x114c77[_0x197a51(0x172)]===0x0)return _0x5422d9[_0x197a51(0x16b)]?'/':'.';const _0xd4b7b9=_0x114c77[_0x197a51(0x17f)]('/');return _0x5422d9['raw']['startsWith']('/')?'/'+_0xd4b7b9:_0xd4b7b9;}export function getParentPath(_0x4c1f9d){const _0x5de7df=a153_0xad7b,_0x504146=parsePath(_0x4c1f9d);if(_0x504146[_0x5de7df(0x174)][_0x5de7df(0x172)]<=0x1)return'/';const _0x3308e3=_0x504146[_0x5de7df(0x174)][_0x5de7df(0x166)](0x0,-0x1)[_0x5de7df(0x17f)]('/');return _0x504146[_0x5de7df(0x156)]['startsWith']('/')?'/'+_0x3308e3:_0x3308e3;}export function getBaseName(_0x2e258f){const _0x158d8a=a153_0xad7b,_0x562fee=parsePath(_0x2e258f);return _0x562fee[_0x158d8a(0x174)][_0x562fee[_0x158d8a(0x174)][_0x158d8a(0x172)]-0x1]||'';}export function isChildPath(_0xb8cc81,_0x583570){const _0x40e2aa=a153_0xad7b,_0x4baad6=parsePath(_0xb8cc81),_0x5028cc=parsePath(_0x583570);if(_0x4baad6[_0x40e2aa(0x174)][_0x40e2aa(0x172)]<=_0x5028cc[_0x40e2aa(0x174)][_0x40e2aa(0x172)])return![];for(let _0x92d73f=0x0;_0x92d73f<_0x5028cc['segments']['length'];_0x92d73f++){if(_0x4baad6[_0x40e2aa(0x174)][_0x92d73f]!==_0x5028cc['segments'][_0x92d73f])return![];}return!![];}export function splitPath(_0x5164c6){const _0x4192fb=a153_0xad7b,_0x29927f=parsePath(_0x5164c6);if(_0x29927f[_0x4192fb(0x174)]['length']===0x0)throw new Error(_0x4192fb(0x161));if(_0x29927f['segments'][_0x4192fb(0x172)]===0x1)return{'parent':_0x29927f['segments'][0x0]};return{'parent':_0x29927f[_0x4192fb(0x174)][0x0],'child':_0x29927f['segments'][_0x4192fb(0x166)](0x1)[_0x4192fb(0x17f)]('/')};}export function isYamlFilePath(_0x23463e){const _0xf584c8=a153_0xad7b;return _0x23463e[_0xf584c8(0x15d)](_0xf584c8(0x153))||_0x23463e[_0xf584c8(0x15d)](_0xf584c8(0x160));}export async function resolveYamlFilePath(_0x2627f8,_0x15f250=nodeFileSystem){const _0x42ad2b=a153_0xad7b,_0x420238=a153_0x13f611[_0x42ad2b(0x168)](_0x2627f8);if(!await _0x15f250[_0x42ad2b(0x176)](_0x420238))throw new Error(_0x42ad2b(0x16d)+_0x2627f8);let _0x2d7f72=a153_0x13f611[_0x42ad2b(0x167)](_0x420238),_0x3bdd44=null,_0x312131=null;const _0x2b2954=a153_0x13f611[_0x42ad2b(0x15e)](_0x2d7f72)[_0x42ad2b(0x157)];while(_0x2d7f72!==_0x2b2954){const _0x54bdfd=a153_0x13f611[_0x42ad2b(0x17f)](_0x2d7f72,'tdx.json');if(await _0x15f250[_0x42ad2b(0x176)](_0x54bdfd)){_0x3bdd44=_0x54bdfd,_0x312131=_0x2d7f72;break;}_0x2d7f72=a153_0x13f611['dirname'](_0x2d7f72);}if(!_0x3bdd44||!_0x312131)throw new Error(_0x42ad2b(0x15c)+_0x2627f8+'\x0a'+_0x42ad2b(0x16c));const _0x376792=await _0x15f250[_0x42ad2b(0x17c)](_0x3bdd44),_0x49329d=JSON[_0x42ad2b(0x15e)](_0x376792),_0x1825bf=_0x49329d[_0x42ad2b(0x14f)];if(!_0x1825bf)throw new Error(_0x42ad2b(0x152));const _0x32b62a=await _0x15f250['readFile'](_0x420238),_0x3349f3=a153_0x337491(_0x32b62a),_0x43787e=_0x3349f3[_0x42ad2b(0x17a)];if(!_0x43787e)throw new Error(_0x42ad2b(0x171)+_0x2627f8);const _0x23011f=_0x3349f3['type']===_0x42ad2b(0x169)?_0x42ad2b(0x169):_0x42ad2b(0x150),_0x1dc2f5=a153_0x13f611[_0x42ad2b(0x159)](_0x312131,_0x420238),_0x2618f7=a153_0x13f611[_0x42ad2b(0x167)](_0x1dc2f5),_0x5e3685=_0x2618f7==='.'?'':_0x2618f7[_0x42ad2b(0x180)](/\\/g,'/'),_0x2d9357=_0x5e3685?_0x1825bf+'/'+_0x5e3685+'/'+_0x43787e:_0x1825bf+'/'+_0x43787e;return{'parentSegment':_0x1825bf,'segmentName':_0x43787e,'folderPath':_0x5e3685,'fullPath':_0x2d9357,'resourceType':_0x23011f,'content':_0x32b62a};}
@@ -1 +1 @@
1
- function a154_0x49ca(){const _0x111978=['678OBlYOh','9KehIvs','36576760aqeKqA','indexOf','95854bIwHld','4fRdhFj','20839jDBTjQ','1643309SAnNtj','5496515NDRpsM','263328xDttwh','substring','3548799rhuvai'];a154_0x49ca=function(){return _0x111978;};return a154_0x49ca();}(function(_0x33e760,_0xdaf0f3){const _0x564399=a154_0x4303,_0x248e10=_0x33e760();while(!![]){try{const _0x45f99c=-parseInt(_0x564399(0x1d8))/0x1+-parseInt(_0x564399(0x1d5))/0x2*(-parseInt(_0x564399(0x1de))/0x3)+-parseInt(_0x564399(0x1d6))/0x4*(parseInt(_0x564399(0x1d9))/0x5)+-parseInt(_0x564399(0x1dd))/0x6*(-parseInt(_0x564399(0x1d7))/0x7)+-parseInt(_0x564399(0x1da))/0x8+-parseInt(_0x564399(0x1dc))/0x9+parseInt(_0x564399(0x1df))/0xa;if(_0x45f99c===_0xdaf0f3)break;else _0x248e10['push'](_0x248e10['shift']());}catch(_0x13b278){_0x248e10['push'](_0x248e10['shift']());}}}(a154_0x49ca,0xec553));function a154_0x4303(_0x545bca,_0x32abf2){_0x545bca=_0x545bca-0x1d4;const _0x49ca2d=a154_0x49ca();let _0x4303ae=_0x49ca2d[_0x545bca];return _0x4303ae;}export function parseSegmentRef(_0xb0b12b){const _0x29cbef=a154_0x4303,_0x44cda4=_0xb0b12b[_0x29cbef(0x1d4)]('/');if(_0x44cda4===-0x1)return{'parentId':_0xb0b12b};if(_0x44cda4===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xb0b12b+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x285051=_0xb0b12b[_0x29cbef(0x1db)](0x0,_0x44cda4),_0x5401cf=_0xb0b12b['substring'](_0x44cda4+0x1);if(_0x5401cf==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xb0b12b+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x285051,'childId':_0x5401cf};}
1
+ (function(_0x223a9a,_0x48628d){const _0x160a15=a154_0x2c07,_0x23932=_0x223a9a();while(!![]){try{const _0x547c5c=-parseInt(_0x160a15(0xfb))/0x1+parseInt(_0x160a15(0xfe))/0x2*(-parseInt(_0x160a15(0x100))/0x3)+parseInt(_0x160a15(0x107))/0x4+parseInt(_0x160a15(0x101))/0x5+parseInt(_0x160a15(0x102))/0x6*(parseInt(_0x160a15(0x103))/0x7)+parseInt(_0x160a15(0x104))/0x8+parseInt(_0x160a15(0xfc))/0x9;if(_0x547c5c===_0x48628d)break;else _0x23932['push'](_0x23932['shift']());}catch(_0x27d929){_0x23932['push'](_0x23932['shift']());}}}(a154_0x1c6b,0xc6945));function a154_0x2c07(_0x382b40,_0x14faf9){_0x382b40=_0x382b40-0xfb;const _0x1c6b9f=a154_0x1c6b();let _0x2c07a4=_0x1c6b9f[_0x382b40];return _0x2c07a4;}export function parseSegmentRef(_0x181b92){const _0x5dd1af=a154_0x2c07,_0x49fc0c=_0x181b92[_0x5dd1af(0x106)]('/');if(_0x49fc0c===-0x1)return{'parentId':_0x181b92};if(_0x49fc0c===0x0)throw new Error(_0x5dd1af(0x105)+_0x181b92+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x3cd28d=_0x181b92['substring'](0x0,_0x49fc0c),_0x23bca1=_0x181b92[_0x5dd1af(0xff)](_0x49fc0c+0x1);if(_0x23bca1==='')throw new Error(_0x5dd1af(0x105)+_0x181b92+_0x5dd1af(0xfd));return{'parentId':_0x3cd28d,'childId':_0x23bca1};}function a154_0x1c6b(){const _0x22f1a6=['713860BAeETA','3174180OytbVe','14kveBbv','4256112FrDUWg','Invalid\x20segment\x20reference\x20format:\x20','indexOf','252836oEMZCJ','1617303zYHEmG','12271896ivYTkP','.\x20Child\x20name\x20cannot\x20be\x20empty','290jPgYkX','substring','15081shtXzK'];a154_0x1c6b=function(){return _0x22f1a6;};return a154_0x1c6b();}