@treasuredata/tdx 2026.3.26 → 2026.3.27

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 (205) 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/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.d.ts.map +1 -1
  65. package/dist/core/oauth.js +1 -1
  66. package/dist/core/oauth.js.map +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/client/cdp-api-client.js +1 -1
  92. package/dist/sdk/client/delivery-api-client.js +1 -1
  93. package/dist/sdk/client/endpoints.js +1 -1
  94. package/dist/sdk/client/engage-api-client.js +1 -1
  95. package/dist/sdk/client/http-client.js +1 -1
  96. package/dist/sdk/client/llm-api-client.js +1 -1
  97. package/dist/sdk/client/oauth-refresh.js +1 -1
  98. package/dist/sdk/client/rate-limiter.js +1 -1
  99. package/dist/sdk/client/td-api-client.js +1 -1
  100. package/dist/sdk/client/trino-api-client.js +1 -1
  101. package/dist/sdk/client/workflow-client.js +1 -1
  102. package/dist/sdk/connection-validator.js +1 -1
  103. package/dist/sdk/connection.js +1 -1
  104. package/dist/sdk/delivery.js +1 -1
  105. package/dist/sdk/engage/campaign-pull.js +1 -1
  106. package/dist/sdk/engage/campaign-push.js +1 -1
  107. package/dist/sdk/engage/campaign-validator.js +1 -1
  108. package/dist/sdk/engage/campaign-yaml.js +1 -1
  109. package/dist/sdk/engage/template-pull.js +1 -1
  110. package/dist/sdk/engage/template-push.js +1 -1
  111. package/dist/sdk/engage/template-validator.js +1 -1
  112. package/dist/sdk/engage/template-yaml.js +1 -1
  113. package/dist/sdk/engage/types/campaign-def.js +1 -1
  114. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  115. package/dist/sdk/engage/types/template-schema.js +1 -1
  116. package/dist/sdk/engage.js +1 -1
  117. package/dist/sdk/errors.js +1 -1
  118. package/dist/sdk/index.js +1 -1
  119. package/dist/sdk/io/index.js +1 -1
  120. package/dist/sdk/io/node-filesystem.js +1 -1
  121. package/dist/sdk/job.js +1 -1
  122. package/dist/sdk/journey.js +1 -1
  123. package/dist/sdk/llm/chat-cache.js +1 -1
  124. package/dist/sdk/llm/index.js +1 -1
  125. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  126. package/dist/sdk/llm/model-factors.js +1 -1
  127. package/dist/sdk/personalization.js +1 -1
  128. package/dist/sdk/policy.js +1 -1
  129. package/dist/sdk/query/index.js +1 -1
  130. package/dist/sdk/query/sql-parser.js +1 -1
  131. package/dist/sdk/realtime.js +1 -1
  132. package/dist/sdk/schedule.js +1 -1
  133. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  134. package/dist/sdk/segment/fields-display.js +1 -1
  135. package/dist/sdk/segment/file-discovery.js +1 -1
  136. package/dist/sdk/segment/journey-utils.js +1 -1
  137. package/dist/sdk/segment/journey-validator.js +1 -1
  138. package/dist/sdk/segment/journey-yaml.js +1 -1
  139. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  140. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/pull-workflow.js +1 -1
  142. package/dist/sdk/segment/push-recovery.js +1 -1
  143. package/dist/sdk/segment/push-workflow.js +1 -1
  144. package/dist/sdk/segment/resolution-context.js +1 -1
  145. package/dist/sdk/segment/segment-path-parser.js +1 -1
  146. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  147. package/dist/sdk/segment/segment-validator.js +1 -1
  148. package/dist/sdk/segment/target-resolution.js +1 -1
  149. package/dist/sdk/segment/tdx-config.js +1 -1
  150. package/dist/sdk/segment/types/activation-schema.js +1 -1
  151. package/dist/sdk/segment/types/journey-def.js +1 -1
  152. package/dist/sdk/segment/types/journey-schema.js +1 -1
  153. package/dist/sdk/segment/types/segment-def.js +1 -1
  154. package/dist/sdk/segment/types/segment-schema.js +1 -1
  155. package/dist/sdk/segment/validate-files.js +1 -1
  156. package/dist/sdk/segment/yaml-validator.js +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/types/index.js +1 -1
  159. package/dist/sdk/types/progress.js +1 -1
  160. package/dist/sdk/user.js +1 -1
  161. package/dist/sdk/util/format-detector.js +1 -1
  162. package/dist/sdk/util/formatters.js +1 -1
  163. package/dist/sdk/util/index.js +1 -1
  164. package/dist/sdk/util/paginate.js +1 -1
  165. package/dist/sdk/util/tree-formatter.js +1 -1
  166. package/dist/sdk/workflow/archive-validation.js +1 -1
  167. package/dist/sdk/workflow/clone-workflow.js +1 -1
  168. package/dist/sdk/workflow/index.js +1 -1
  169. package/dist/sdk/workflow/pull-workflow.js +1 -1
  170. package/dist/sdk/workflow/push-workflow.js +1 -1
  171. package/dist/sdk/workflow/tdx-config.js +1 -1
  172. package/dist/sdk/workflow/workflow-utils.js +1 -1
  173. package/dist/test-utils/command-runner.js +1 -1
  174. package/dist/test-utils/factories.js +1 -1
  175. package/dist/test-utils/fixtures.js +1 -1
  176. package/dist/test-utils/http-mock.js +1 -1
  177. package/dist/test-utils/index.js +1 -1
  178. package/dist/utils/async.js +1 -1
  179. package/dist/utils/colors.js +1 -1
  180. package/dist/utils/diff.js +1 -1
  181. package/dist/utils/file-permissions.js +1 -1
  182. package/dist/utils/file-reader.js +1 -1
  183. package/dist/utils/github-releases.js +1 -1
  184. package/dist/utils/global-cache.js +1 -1
  185. package/dist/utils/json-loader.js +1 -1
  186. package/dist/utils/local-cache.js +1 -1
  187. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  188. package/dist/utils/logger/formatters/index.js +1 -1
  189. package/dist/utils/logger/handlers/console-handler.js +1 -1
  190. package/dist/utils/logger/handlers/file-handler.js +1 -1
  191. package/dist/utils/logger/handlers/index.js +1 -1
  192. package/dist/utils/logger/handlers/null-handler.js +1 -1
  193. package/dist/utils/logger/index.js +1 -1
  194. package/dist/utils/logger/logger.js +1 -1
  195. package/dist/utils/logger/types.js +1 -1
  196. package/dist/utils/option-validation.js +1 -1
  197. package/dist/utils/process.js +1 -1
  198. package/dist/utils/prompt.js +1 -1
  199. package/dist/utils/spinner.js +1 -1
  200. package/dist/utils/sse-parser.js +1 -1
  201. package/dist/utils/string-utils.js +1 -1
  202. package/dist/utils/table-ref-parser.js +1 -1
  203. package/dist/utils/tdx-logger.js +1 -1
  204. package/dist/utils/version-check.js +1 -1
  205. package/package.json +1 -1
@@ -1 +1 @@
1
- const a103_0x1cac8f=a103_0x1cdc;(function(_0x1b586c,_0x15ff4c){const _0x217b82=a103_0x1cdc,_0x57ff44=_0x1b586c();while(!![]){try{const _0x21f357=-parseInt(_0x217b82(0x1bd))/0x1+-parseInt(_0x217b82(0x1b9))/0x2*(-parseInt(_0x217b82(0x1bf))/0x3)+-parseInt(_0x217b82(0x1c0))/0x4+-parseInt(_0x217b82(0x1c3))/0x5+-parseInt(_0x217b82(0x1b2))/0x6*(parseInt(_0x217b82(0x1c6))/0x7)+parseInt(_0x217b82(0x1b4))/0x8+parseInt(_0x217b82(0x1be))/0x9;if(_0x21f357===_0x15ff4c)break;else _0x57ff44['push'](_0x57ff44['shift']());}catch(_0x3a9543){_0x57ff44['push'](_0x57ff44['shift']());}}}(a103_0x4359,0x364d4));import a103_0x353ef6 from'path';import{existsSync,readFileSync}from'fs';function a103_0x1cdc(_0x320ce4,_0x33678b){_0x320ce4=_0x320ce4-0x1ae;const _0x4359a9=a103_0x4359();let _0x1cdc8c=_0x4359a9[_0x320ce4];return _0x1cdc8c;}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeCampaignFileName,campaignToDef,toYamlString,normalizeDef}from'./campaign-yaml.js';import{createEngageTdxConfigContent}from'../segment/tdx-config.js';import{buildFolderIdToPathMap}from'../segment/resolution-context.js';const CAMPAIGNS_DIR=a103_0x1cac8f(0x1cc),API_PAGE_LIMIT=0x64;export async function pullCampaigns(_0x20872c,_0x46601a,_0x34466a={}){const _0x406c49=a103_0x1cac8f,{engage:_0x3decfb}=_0x20872c;_0x34466a[_0x406c49(0x1b8)]?.[_0x406c49(0x1c7)](_0x406c49(0x1d1));const _0x117269=await _0x3decfb[_0x406c49(0x1d0)](_0x46601a),_0x3dfb75=_0x117269[_0x406c49(0x1d4)],_0x4508b2=_0x117269['id'],_0x5916af=_0x34466a[_0x406c49(0x1bb)]||a103_0x353ef6[_0x406c49(0x1ca)](process[_0x406c49(0x1cf)](),CAMPAIGNS_DIR,sanitizeCampaignFileName(_0x3dfb75));_0x34466a[_0x406c49(0x1b8)]?.[_0x406c49(0x1c7)]('Fetching\x20campaigns...');const _0xedb38f=await listAllCampaigns(_0x3decfb,{'workspaceId':_0x4508b2,'type':_0x34466a[_0x406c49(0x1c4)],'progress':_0x34466a['progress']});let _0x33f2bf=_0xedb38f;_0x34466a[_0x406c49(0x1c1)]&&(_0x33f2bf=_0x33f2bf[_0x406c49(0x1d3)](_0xb30cd7=>_0xb30cd7['name']===_0x34466a[_0x406c49(0x1c1)]));const _0x545322=[];let _0xaf5e43=0x0;const _0x3d88f8=new Map();for(const _0x48ca96 of _0x33f2bf){_0xaf5e43++,_0x34466a[_0x406c49(0x1b8)]?.[_0x406c49(0x1c7)]('Processing\x20campaign\x20'+_0xaf5e43+'/'+_0x33f2bf['length']+':\x20'+_0x48ca96[_0x406c49(0x1d4)]);const _0x365fff=await _0x3decfb[_0x406c49(0x1b5)](_0x48ca96['id']);let _0x1f5fa2;_0x20872c[_0x406c49(0x1ce)]&&_0x365fff['attributes'][_0x406c49(0x1b3)]&&_0x365fff[_0x406c49(0x1ba)][_0x406c49(0x1d2)]&&(_0x1f5fa2=await resolveSegmentFolderPath(_0x20872c[_0x406c49(0x1ce)],_0x365fff[_0x406c49(0x1ba)][_0x406c49(0x1b3)],_0x365fff[_0x406c49(0x1ba)][_0x406c49(0x1d2)],_0x3d88f8));const {def:_0x4ea43c,htmlContent:_0x29f572,plaintextContent:_0x32f6d4}=campaignToDef(_0x365fff,{'workspaceName':_0x3dfb75,'segmentFolderPath':_0x1f5fa2}),_0x59c7dd=normalizeDef(_0x4ea43c),_0x442df8=sanitizeCampaignFileName(_0x59c7dd[_0x406c49(0x1d4)]),_0x510792=toYamlString(_0x59c7dd);_0x545322[_0x406c49(0x1ae)](prepareFile(_0x5916af,_0x442df8+'.yaml',_0x510792)),_0x29f572&&_0x545322[_0x406c49(0x1ae)](prepareFile(_0x5916af,_0x442df8+'.html',_0x29f572)),_0x32f6d4&&_0x545322[_0x406c49(0x1ae)](prepareFile(_0x5916af,_0x442df8+'.txt',_0x32f6d4));}const _0x4a8191=createEngageTdxConfigContent(_0x3dfb75);_0x545322['push'](prepareFile(_0x5916af,_0x406c49(0x1af),_0x4a8191));const _0x4a6e00=_0x545322[_0x406c49(0x1d3)](_0x1fcd5d=>_0x1fcd5d[_0x406c49(0x1b1)])[_0x406c49(0x1d5)],_0x107a19=_0x545322[_0x406c49(0x1d3)](_0x14beb4=>!_0x14beb4[_0x406c49(0x1b1)]&&_0x14beb4[_0x406c49(0x1c8)])[_0x406c49(0x1d5)],_0x2ce619=_0x545322[_0x406c49(0x1d3)](_0x3bde18=>!_0x3bde18[_0x406c49(0x1b1)]&&!_0x3bde18[_0x406c49(0x1c8)])[_0x406c49(0x1d5)];return{'workspaceName':_0x3dfb75,'workspaceId':_0x4508b2,'targetDir':_0x5916af,'files':_0x545322,'counts':{'campaigns':_0x33f2bf['length']},'newFiles':_0x4a6e00,'changedFiles':_0x107a19,'unchangedFiles':_0x2ce619};}function prepareFile(_0x631b69,_0x2bc02e,_0x284d5a){const _0x59d31a=a103_0x1cac8f,_0x4c5b4f=a103_0x353ef6[_0x59d31a(0x1ca)](_0x631b69,_0x2bc02e),_0x1761e2=!existsSync(_0x4c5b4f);let _0xb63fd9=_0x1761e2,_0x899bdf;if(!_0x1761e2){const _0xdf64bd=readFileSync(_0x4c5b4f,'utf-8'),_0x4a565b=generateDiff(_0xdf64bd,_0x284d5a);_0xb63fd9=hasChanges(_0x4a565b),_0xb63fd9&&(_0x899bdf=formatDiffWithColors(_0x4a565b));}return{'relativePath':_0x2bc02e,'absolutePath':_0x4c5b4f,'content':_0x284d5a,'isNew':_0x1761e2,'hasChanges':_0xb63fd9,'diff':_0x899bdf};}async function listAllCampaigns(_0x58f91d,_0x4f9b69){const _0x42d513=a103_0x1cac8f,_0x103c1e=[];let _0x44bf08=0x0;while(!![]){const _0x248fa7=await _0x58f91d[_0x42d513(0x1cd)]({'workspaceId':_0x4f9b69[_0x42d513(0x1b0)],'type':_0x4f9b69[_0x42d513(0x1b6)],'limit':API_PAGE_LIMIT,'offset':_0x44bf08});_0x103c1e[_0x42d513(0x1ae)](..._0x248fa7);if(_0x248fa7[_0x42d513(0x1d5)]<API_PAGE_LIMIT)break;_0x44bf08+=API_PAGE_LIMIT,_0x4f9b69[_0x42d513(0x1b8)]?.['update'](_0x42d513(0x1c9)+_0x103c1e[_0x42d513(0x1d5)]+'\x20so\x20far)...');}return _0x103c1e;}async function resolveSegmentFolderPath(_0x19f084,_0x43137f,_0x1310a7,_0x4d2dec){const _0x25c164=a103_0x1cac8f;try{let _0x2839fd=_0x4d2dec[_0x25c164(0x1b7)](_0x43137f);if(!_0x2839fd){const _0x22c069=await _0x19f084[_0x25c164(0x1cb)](_0x43137f);_0x2839fd=buildFolderIdToPathMap(_0x22c069),_0x4d2dec[_0x25c164(0x1c2)](_0x43137f,_0x2839fd);}const _0x5d3030=await _0x19f084[_0x25c164(0x1c5)](_0x43137f,_0x1310a7);if(!_0x5d3030[_0x25c164(0x1bc)])return undefined;return _0x2839fd[_0x25c164(0x1b7)](_0x5d3030['segmentFolderId'])||undefined;}catch{return undefined;}}function a103_0x4359(){const _0x2f1536=['1010744kRJkuy','campaignName','set','244280GQveIa','campaignType','getSegment','256249xXebhS','update','hasChanges','Fetching\x20campaigns\x20(','join','listFolders','campaigns','listCampaigns','segment','cwd','getWorkspace','Resolving\x20workspace...','segmentId','filter','name','length','push','tdx.json','workspaceId','isNew','66asklWG','audienceId','2000456okUWhp','getCampaignFull','type','get','progress','122284MSPrBF','attributes','targetDir','segmentFolderId','380057TqBGVk','8959473DXRSlk','3aBYyXl'];a103_0x4359=function(){return _0x2f1536;};return a103_0x4359();}
1
+ (function(_0x191d18,_0x3e38aa){const _0xf1bf3d=a103_0x3b28,_0x380e1c=_0x191d18();while(!![]){try{const _0x1c8ba7=parseInt(_0xf1bf3d(0x1af))/0x1+-parseInt(_0xf1bf3d(0x1c6))/0x2+parseInt(_0xf1bf3d(0x1bc))/0x3*(parseInt(_0xf1bf3d(0x1ab))/0x4)+parseInt(_0xf1bf3d(0x1a6))/0x5*(parseInt(_0xf1bf3d(0x1b5))/0x6)+parseInt(_0xf1bf3d(0x1b1))/0x7+-parseInt(_0xf1bf3d(0x1ca))/0x8*(parseInt(_0xf1bf3d(0x1bb))/0x9)+-parseInt(_0xf1bf3d(0x1aa))/0xa;if(_0x1c8ba7===_0x3e38aa)break;else _0x380e1c['push'](_0x380e1c['shift']());}catch(_0x309ec4){_0x380e1c['push'](_0x380e1c['shift']());}}}(a103_0x55e8,0xa885f));import a103_0x3ae1c9 from'path';function a103_0x3b28(_0x264ef5,_0x3b59d0){_0x264ef5=_0x264ef5-0x1a6;const _0x55e899=a103_0x55e8();let _0x3b2838=_0x55e899[_0x264ef5];return _0x3b2838;}import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a103_0x55e8(){const _0x205dae=['workspaceId','push','segmentId','hasChanges','join','1158134IwGidk','\x20so\x20far)...','utf-8','filter','1991664hwAwbb','Resolving\x20workspace...','type','audienceId','get','5719855gijXjL','Fetching\x20campaigns...','name','tdx.json','16367220vnwXlY','436TEmSZP','progress','attributes','getWorkspace','106466ApRAzk','campaignName','9545312MaWqFo','targetDir','length','isNew','6qEFCwv','.html','getCampaignFull','.txt','listCampaigns','segment','18xYjsWd','21741xXJSAr','segmentFolderId','Processing\x20campaign\x20','update','campaignType'];a103_0x55e8=function(){return _0x205dae;};return a103_0x55e8();}import{sanitizeCampaignFileName,campaignToDef,toYamlString,normalizeDef}from'./campaign-yaml.js';import{createEngageTdxConfigContent}from'../segment/tdx-config.js';import{buildFolderIdToPathMap}from'../segment/resolution-context.js';const CAMPAIGNS_DIR='campaigns',API_PAGE_LIMIT=0x64;export async function pullCampaigns(_0x231c70,_0x5e3b1e,_0x59ff05={}){const _0x16ddcf=a103_0x3b28,{engage:_0x477588}=_0x231c70;_0x59ff05[_0x16ddcf(0x1ac)]?.['update'](_0x16ddcf(0x1cb));const _0x383e9c=await _0x477588[_0x16ddcf(0x1ae)](_0x5e3b1e),_0x15b90e=_0x383e9c[_0x16ddcf(0x1a8)],_0x3dd511=_0x383e9c['id'],_0x2721c7=_0x59ff05[_0x16ddcf(0x1b2)]||a103_0x3ae1c9[_0x16ddcf(0x1c5)](process['cwd'](),CAMPAIGNS_DIR,sanitizeCampaignFileName(_0x15b90e));_0x59ff05[_0x16ddcf(0x1ac)]?.['update'](_0x16ddcf(0x1a7));const _0x287b1e=await listAllCampaigns(_0x477588,{'workspaceId':_0x3dd511,'type':_0x59ff05[_0x16ddcf(0x1c0)],'progress':_0x59ff05[_0x16ddcf(0x1ac)]});let _0x40caa1=_0x287b1e;_0x59ff05[_0x16ddcf(0x1b0)]&&(_0x40caa1=_0x40caa1[_0x16ddcf(0x1c9)](_0x46d3ff=>_0x46d3ff['name']===_0x59ff05['campaignName']));const _0x5dcc43=[];let _0x45a860=0x0;const _0x51c1b7=new Map();for(const _0x10ff7d of _0x40caa1){_0x45a860++,_0x59ff05[_0x16ddcf(0x1ac)]?.[_0x16ddcf(0x1bf)](_0x16ddcf(0x1be)+_0x45a860+'/'+_0x40caa1[_0x16ddcf(0x1b3)]+':\x20'+_0x10ff7d[_0x16ddcf(0x1a8)]);const _0x4f95f7=await _0x477588[_0x16ddcf(0x1b7)](_0x10ff7d['id']);let _0x587ad0;_0x231c70[_0x16ddcf(0x1ba)]&&_0x4f95f7[_0x16ddcf(0x1ad)][_0x16ddcf(0x1cd)]&&_0x4f95f7[_0x16ddcf(0x1ad)][_0x16ddcf(0x1c3)]&&(_0x587ad0=await resolveSegmentFolderPath(_0x231c70['segment'],_0x4f95f7['attributes']['audienceId'],_0x4f95f7[_0x16ddcf(0x1ad)][_0x16ddcf(0x1c3)],_0x51c1b7));const {def:_0x550faa,htmlContent:_0x2289ee,plaintextContent:_0x46b0dc}=campaignToDef(_0x4f95f7,{'workspaceName':_0x15b90e,'segmentFolderPath':_0x587ad0}),_0x9ed9e5=normalizeDef(_0x550faa),_0x59d422=sanitizeCampaignFileName(_0x9ed9e5[_0x16ddcf(0x1a8)]),_0x14adad=toYamlString(_0x9ed9e5);_0x5dcc43[_0x16ddcf(0x1c2)](prepareFile(_0x2721c7,_0x59d422+'.yaml',_0x14adad)),_0x2289ee&&_0x5dcc43[_0x16ddcf(0x1c2)](prepareFile(_0x2721c7,_0x59d422+_0x16ddcf(0x1b6),_0x2289ee)),_0x46b0dc&&_0x5dcc43[_0x16ddcf(0x1c2)](prepareFile(_0x2721c7,_0x59d422+_0x16ddcf(0x1b8),_0x46b0dc));}const _0x4ec3de=createEngageTdxConfigContent(_0x15b90e);_0x5dcc43['push'](prepareFile(_0x2721c7,_0x16ddcf(0x1a9),_0x4ec3de));const _0x1ca562=_0x5dcc43[_0x16ddcf(0x1c9)](_0x135251=>_0x135251[_0x16ddcf(0x1b4)])['length'],_0x4d7605=_0x5dcc43[_0x16ddcf(0x1c9)](_0x301c73=>!_0x301c73[_0x16ddcf(0x1b4)]&&_0x301c73['hasChanges'])[_0x16ddcf(0x1b3)],_0x336f8a=_0x5dcc43[_0x16ddcf(0x1c9)](_0x2d72c2=>!_0x2d72c2['isNew']&&!_0x2d72c2[_0x16ddcf(0x1c4)])[_0x16ddcf(0x1b3)];return{'workspaceName':_0x15b90e,'workspaceId':_0x3dd511,'targetDir':_0x2721c7,'files':_0x5dcc43,'counts':{'campaigns':_0x40caa1[_0x16ddcf(0x1b3)]},'newFiles':_0x1ca562,'changedFiles':_0x4d7605,'unchangedFiles':_0x336f8a};}function prepareFile(_0x3d6834,_0x3e380d,_0x5aeaf4){const _0x24e936=a103_0x3b28,_0x57de68=a103_0x3ae1c9[_0x24e936(0x1c5)](_0x3d6834,_0x3e380d),_0x2844e2=!existsSync(_0x57de68);let _0x34cb6a=_0x2844e2,_0x516b48;if(!_0x2844e2){const _0x4fcf90=readFileSync(_0x57de68,_0x24e936(0x1c8)),_0x132081=generateDiff(_0x4fcf90,_0x5aeaf4);_0x34cb6a=hasChanges(_0x132081),_0x34cb6a&&(_0x516b48=formatDiffWithColors(_0x132081));}return{'relativePath':_0x3e380d,'absolutePath':_0x57de68,'content':_0x5aeaf4,'isNew':_0x2844e2,'hasChanges':_0x34cb6a,'diff':_0x516b48};}async function listAllCampaigns(_0x5d05be,_0x46d976){const _0x1a89ad=a103_0x3b28,_0x58748a=[];let _0x8ccc3f=0x0;while(!![]){const _0x1aa17f=await _0x5d05be[_0x1a89ad(0x1b9)]({'workspaceId':_0x46d976[_0x1a89ad(0x1c1)],'type':_0x46d976[_0x1a89ad(0x1cc)],'limit':API_PAGE_LIMIT,'offset':_0x8ccc3f});_0x58748a[_0x1a89ad(0x1c2)](..._0x1aa17f);if(_0x1aa17f['length']<API_PAGE_LIMIT)break;_0x8ccc3f+=API_PAGE_LIMIT,_0x46d976[_0x1a89ad(0x1ac)]?.['update']('Fetching\x20campaigns\x20('+_0x58748a[_0x1a89ad(0x1b3)]+_0x1a89ad(0x1c7));}return _0x58748a;}async function resolveSegmentFolderPath(_0x436626,_0x8db443,_0x21d285,_0x54feeb){const _0x73eca0=a103_0x3b28;try{let _0x216928=_0x54feeb[_0x73eca0(0x1ce)](_0x8db443);if(!_0x216928){const _0x24cc43=await _0x436626['listFolders'](_0x8db443);_0x216928=buildFolderIdToPathMap(_0x24cc43),_0x54feeb['set'](_0x8db443,_0x216928);}const _0x3bb9fd=await _0x436626['getSegment'](_0x8db443,_0x21d285);if(!_0x3bb9fd[_0x73eca0(0x1bd)])return undefined;return _0x216928[_0x73eca0(0x1ce)](_0x3bb9fd[_0x73eca0(0x1bd)])||undefined;}catch{return undefined;}}
@@ -1 +1 @@
1
- (function(_0x57f699,_0x1b7b0e){const _0x58b2a1=a104_0x4b5b,_0x41b610=_0x57f699();while(!![]){try{const _0x2cca44=-parseInt(_0x58b2a1(0x1f1))/0x1*(-parseInt(_0x58b2a1(0x1f0))/0x2)+parseInt(_0x58b2a1(0x1dc))/0x3+-parseInt(_0x58b2a1(0x1d4))/0x4*(-parseInt(_0x58b2a1(0x1ee))/0x5)+parseInt(_0x58b2a1(0x1ce))/0x6*(parseInt(_0x58b2a1(0x1df))/0x7)+-parseInt(_0x58b2a1(0x1d9))/0x8+parseInt(_0x58b2a1(0x1d1))/0x9*(parseInt(_0x58b2a1(0x1d5))/0xa)+-parseInt(_0x58b2a1(0x1e1))/0xb;if(_0x2cca44===_0x1b7b0e)break;else _0x41b610['push'](_0x41b610['shift']());}catch(_0x5e92f4){_0x41b610['push'](_0x41b610['shift']());}}}(a104_0x1e1b,0xc0ba7));function a104_0x4b5b(_0x32e141,_0x4c8ce6){_0x32e141=_0x32e141-0x1ca;const _0x1e1b57=a104_0x1e1b();let _0x4b5bd9=_0x1e1b57[_0x32e141];return _0x4b5bd9;}import a104_0x42dfc5 from'path';import{readFileSync}from'fs';import{parseYamlString,defToCreateInput,defToUpdateInput}from'./campaign-yaml.js';import{findYamlFiles}from'../segment/file-discovery.js';export function discoverCampaignFiles(_0x45281f){const _0x5e1d3b=a104_0x4b5b,_0x20d3ea=findYamlFiles(_0x45281f);return _0x20d3ea[_0x5e1d3b(0x1ef)](_0x488376=>{const _0x205b0d=_0x5e1d3b;try{const _0xd97ab2=readFileSync(_0x488376,_0x205b0d(0x1e7)),_0x3d38d3=parseYamlString(_0xd97ab2);return _0x3d38d3[_0x205b0d(0x1ed)]===_0x205b0d(0x1e8);}catch{return![];}});}export function parseCampaignFile(_0x2b52ce,_0x1240d6){const _0x1245a0=a104_0x4b5b,_0x16ebd8=readFileSync(_0x2b52ce,_0x1245a0(0x1e7)),_0xd261b7=parseYamlString(_0x16ebd8),_0xd45d79=a104_0x42dfc5['relative'](_0x1240d6,_0x2b52ce),_0x25cc1f=a104_0x42dfc5['dirname'](_0x2b52ce);return{'yamlPath':_0x2b52ce,'relativePath':_0xd45d79,'def':_0xd261b7,'dir':_0x25cc1f};}export async function preparePush(_0x496965,_0x250470,_0x42b218,_0x4f361e={}){const _0x1554b2=a104_0x4b5b,{engage:_0x469572}=_0x496965;_0x4f361e[_0x1554b2(0x1f7)]?.['update'](_0x1554b2(0x1d6));const _0x5ce752=await listAllCampaigns(_0x469572,_0x42b218),_0x209978=new Map();for(const _0x1c9c8b of _0x5ce752){_0x209978[_0x1554b2(0x1dd)](_0x1c9c8b[_0x1554b2(0x1d2)],_0x1c9c8b);}const _0x2261fe=[];for(const _0x54acdb of _0x250470){const _0x4475f7=_0x209978[_0x1554b2(0x1cf)](_0x54acdb[_0x1554b2(0x1cb)][_0x1554b2(0x1d2)]);_0x2261fe[_0x1554b2(0x1f3)]({'def':_0x54acdb[_0x1554b2(0x1cb)],'fileDir':_0x54acdb[_0x1554b2(0x1f5)],'action':_0x4475f7?_0x1554b2(0x1d8):_0x1554b2(0x1e4),'existingId':_0x4475f7?.['id']});}return _0x2261fe;}function a104_0x1e1b(){const _0xd1e4f3=['listCampaigns','updateCampaign','updated','created','type','66335KEetCF','filter','4vGqvEV','660883oeAfxV','updateInput','push','length','dir','createCampaign','progress','createInput','def','segmentId','results','405636aYWLpN','get','Resolving\x20references\x20','36WdmqeI','name','resolvePathToResource','272vQHsHw','859790SbHehK','Fetching\x20existing\x20campaigns...','message','update','7853088MwkpYm','action','join','4581153dPBbXZ','set','parentName','84ACZSjB','errors','34486210UGmFvj','dryRun','resolveWorkspaceId','create','existingId','resolveTemplateId','utf-8','campaign'];a104_0x1e1b=function(){return _0xd1e4f3;};return a104_0x1e1b();}export async function resolveAndBuildInputs(_0x5e3052,_0x1a5311,_0x2c82d8,_0x21a9ac={}){const _0x5d5ca5=a104_0x4b5b;for(let _0x4aef5a=0x0;_0x4aef5a<_0x1a5311[_0x5d5ca5(0x1f4)];_0x4aef5a++){const _0x41acab=_0x1a5311[_0x4aef5a];_0x21a9ac['progress']?.[_0x5d5ca5(0x1d8)](_0x5d5ca5(0x1d0)+(_0x4aef5a+0x1)+'/'+_0x1a5311['length']+':\x20'+_0x41acab[_0x5d5ca5(0x1cb)]['name']);const _0x12cdbd=createResolveContext(_0x5e3052,_0x2c82d8,_0x41acab['fileDir']);_0x41acab[_0x5d5ca5(0x1da)]===_0x5d5ca5(0x1e4)?(_0x41acab[_0x5d5ca5(0x1ca)]=await defToCreateInput(_0x41acab[_0x5d5ca5(0x1cb)],_0x12cdbd),!_0x41acab['createInput']['workspaceId']&&(_0x41acab[_0x5d5ca5(0x1ca)]['workspaceId']=_0x2c82d8)):_0x41acab['updateInput']=await defToUpdateInput(_0x41acab['def'],_0x12cdbd);}}export async function executePush(_0x4fe39c,_0x3bf3f8,_0x418ca8={}){const _0x3acbff=a104_0x4b5b,_0x2e7ce1={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x418ca8[_0x3acbff(0x1e2)]){for(const _0x279cb1 of _0x3bf3f8){_0x279cb1[_0x3acbff(0x1da)]==='create'?(_0x2e7ce1['results']['push']({'name':_0x279cb1[_0x3acbff(0x1cb)][_0x3acbff(0x1d2)],'action':_0x3acbff(0x1ec)}),_0x2e7ce1[_0x3acbff(0x1ec)]++):(_0x2e7ce1['results'][_0x3acbff(0x1f3)]({'name':_0x279cb1[_0x3acbff(0x1cb)][_0x3acbff(0x1d2)],'action':_0x3acbff(0x1eb)}),_0x2e7ce1[_0x3acbff(0x1eb)]++);}return _0x2e7ce1;}const {engage:_0x68ae5b}=_0x4fe39c;for(let _0xe31159=0x0;_0xe31159<_0x3bf3f8[_0x3acbff(0x1f4)];_0xe31159++){const _0x6faa1e=_0x3bf3f8[_0xe31159];_0x418ca8[_0x3acbff(0x1f7)]?.[_0x3acbff(0x1d8)]('Pushing\x20'+(_0xe31159+0x1)+'/'+_0x3bf3f8['length']+':\x20'+_0x6faa1e[_0x3acbff(0x1cb)][_0x3acbff(0x1d2)]);try{if(_0x6faa1e['action']===_0x3acbff(0x1e4)&&_0x6faa1e[_0x3acbff(0x1ca)]){const _0x7fa7db=await _0x68ae5b[_0x3acbff(0x1f6)](_0x6faa1e[_0x3acbff(0x1ca)]);_0x2e7ce1['results']['push']({'name':_0x6faa1e['def'][_0x3acbff(0x1d2)],'action':_0x3acbff(0x1ec),'campaignId':_0x7fa7db['id']}),_0x2e7ce1[_0x3acbff(0x1ec)]++;}else{if(_0x6faa1e[_0x3acbff(0x1da)]===_0x3acbff(0x1d8)&&_0x6faa1e[_0x3acbff(0x1f2)]&&_0x6faa1e[_0x3acbff(0x1e5)]){const _0xb2220f=await _0x68ae5b[_0x3acbff(0x1ea)](_0x6faa1e[_0x3acbff(0x1e5)],_0x6faa1e[_0x3acbff(0x1f2)]);_0x2e7ce1[_0x3acbff(0x1cd)][_0x3acbff(0x1f3)]({'name':_0x6faa1e['def']['name'],'action':_0x3acbff(0x1eb),'campaignId':_0xb2220f['id']}),_0x2e7ce1['updated']++;}}}catch(_0x48c845){const _0x3e03a3=_0x48c845 instanceof Error?_0x48c845[_0x3acbff(0x1d7)]:String(_0x48c845);_0x2e7ce1[_0x3acbff(0x1e0)][_0x3acbff(0x1f3)]({'name':_0x6faa1e[_0x3acbff(0x1cb)][_0x3acbff(0x1d2)],'error':_0x3e03a3});}}return _0x2e7ce1;}function createResolveContext(_0x40337a,_0x23ae44,_0x383029){return{'resolveWorkspaceId':async _0x26b303=>{const _0x1cc134=a104_0x4b5b;return await _0x40337a['engage'][_0x1cc134(0x1e3)](_0x26b303);},'resolveTemplateId':async(_0x4ad113,_0x435506)=>{const _0x2d54cb=a104_0x4b5b;return await _0x40337a['engage'][_0x2d54cb(0x1e6)](_0x4ad113,_0x435506??_0x23ae44);},'resolveSegmentPath':async _0x4b9c7f=>{const _0x3e16bb=a104_0x4b5b,_0x24159e=await _0x40337a['segment'][_0x3e16bb(0x1d3)](_0x4b9c7f);return{'audienceId':_0x24159e['parentId'],'audienceName':_0x24159e[_0x3e16bb(0x1de)],'segmentId':_0x24159e[_0x3e16bb(0x1cc)],'segmentName':_0x24159e['segmentName']};},'readFile':async _0x4fb3c1=>{const _0x3ec32b=a104_0x4b5b,_0x75625a=a104_0x42dfc5[_0x3ec32b(0x1db)](_0x383029,_0x4fb3c1);return readFileSync(_0x75625a,_0x3ec32b(0x1e7));}};}const API_PAGE_LIMIT=0x64;async function listAllCampaigns(_0x3644c5,_0x1293e5){const _0x2cd91b=a104_0x4b5b,_0x38ef15=[];let _0x36098d=0x0;while(!![]){const _0x1e4136=await _0x3644c5[_0x2cd91b(0x1e9)]({'workspaceId':_0x1293e5,'limit':API_PAGE_LIMIT,'offset':_0x36098d});_0x38ef15['push'](..._0x1e4136);if(_0x1e4136[_0x2cd91b(0x1f4)]<API_PAGE_LIMIT)break;_0x36098d+=API_PAGE_LIMIT;}return _0x38ef15;}
1
+ (function(_0x525d1d,_0x845b2e){const _0x3aaf09=a104_0x1a09,_0x28b1a1=_0x525d1d();while(!![]){try{const _0xfac4ee=parseInt(_0x3aaf09(0x141))/0x1*(-parseInt(_0x3aaf09(0x13d))/0x2)+-parseInt(_0x3aaf09(0x163))/0x3+-parseInt(_0x3aaf09(0x15d))/0x4*(parseInt(_0x3aaf09(0x142))/0x5)+parseInt(_0x3aaf09(0x15e))/0x6*(parseInt(_0x3aaf09(0x167))/0x7)+parseInt(_0x3aaf09(0x144))/0x8+-parseInt(_0x3aaf09(0x160))/0x9*(parseInt(_0x3aaf09(0x159))/0xa)+parseInt(_0x3aaf09(0x143))/0xb;if(_0xfac4ee===_0x845b2e)break;else _0x28b1a1['push'](_0x28b1a1['shift']());}catch(_0x462cb5){_0x28b1a1['push'](_0x28b1a1['shift']());}}}(a104_0x1b7c,0xb2071));import a104_0x46d68e from'path';import{readFileSync}from'fs';import{parseYamlString,defToCreateInput,defToUpdateInput}from'./campaign-yaml.js';import{findYamlFiles}from'../segment/file-discovery.js';export function discoverCampaignFiles(_0x483d0d){const _0x16f174=a104_0x1a09,_0x441870=findYamlFiles(_0x483d0d);return _0x441870[_0x16f174(0x14f)](_0x1cd997=>{const _0x1e2f21=_0x16f174;try{const _0x25e7cf=readFileSync(_0x1cd997,_0x1e2f21(0x146)),_0x72e7ae=parseYamlString(_0x25e7cf);return _0x72e7ae[_0x1e2f21(0x151)]===_0x1e2f21(0x14c);}catch{return![];}});}export function parseCampaignFile(_0x415615,_0xbb0e93){const _0x287b2a=a104_0x1a09,_0x5c148a=readFileSync(_0x415615,_0x287b2a(0x146)),_0xef3769=parseYamlString(_0x5c148a),_0x1f137a=a104_0x46d68e[_0x287b2a(0x169)](_0xbb0e93,_0x415615),_0x2e4595=a104_0x46d68e[_0x287b2a(0x153)](_0x415615);return{'yamlPath':_0x415615,'relativePath':_0x1f137a,'def':_0xef3769,'dir':_0x2e4595};}export async function preparePush(_0x1c2054,_0x293dac,_0x5b3393,_0x27c0e4={}){const _0x1def67=a104_0x1a09,{engage:_0x167ef7}=_0x1c2054;_0x27c0e4[_0x1def67(0x155)]?.[_0x1def67(0x15f)](_0x1def67(0x161));const _0x379676=await listAllCampaigns(_0x167ef7,_0x5b3393),_0xe4496e=new Map();for(const _0x100e22 of _0x379676){_0xe4496e[_0x1def67(0x145)](_0x100e22[_0x1def67(0x165)],_0x100e22);}const _0x5b1f53=[];for(const _0x2cf616 of _0x293dac){const _0x33ef59=_0xe4496e[_0x1def67(0x15a)](_0x2cf616['def'][_0x1def67(0x165)]);_0x5b1f53[_0x1def67(0x149)]({'def':_0x2cf616[_0x1def67(0x13f)],'fileDir':_0x2cf616[_0x1def67(0x14e)],'action':_0x33ef59?'update':'create','existingId':_0x33ef59?.['id']});}return _0x5b1f53;}export async function resolveAndBuildInputs(_0x925757,_0x42c03b,_0x1840ba,_0x4b6a8e={}){const _0x19917c=a104_0x1a09;for(let _0x58135d=0x0;_0x58135d<_0x42c03b[_0x19917c(0x150)];_0x58135d++){const _0x438e59=_0x42c03b[_0x58135d];_0x4b6a8e['progress']?.[_0x19917c(0x15f)]('Resolving\x20references\x20'+(_0x58135d+0x1)+'/'+_0x42c03b[_0x19917c(0x150)]+':\x20'+_0x438e59[_0x19917c(0x13f)][_0x19917c(0x165)]);const _0x12b9a5=createResolveContext(_0x925757,_0x1840ba,_0x438e59[_0x19917c(0x15c)]);_0x438e59[_0x19917c(0x13e)]==='create'?(_0x438e59[_0x19917c(0x148)]=await defToCreateInput(_0x438e59[_0x19917c(0x13f)],_0x12b9a5),!_0x438e59[_0x19917c(0x148)][_0x19917c(0x16b)]&&(_0x438e59[_0x19917c(0x148)]['workspaceId']=_0x1840ba)):_0x438e59[_0x19917c(0x152)]=await defToUpdateInput(_0x438e59[_0x19917c(0x13f)],_0x12b9a5);}}export async function executePush(_0x20a491,_0x578763,_0x3b9a71={}){const _0x24f435=a104_0x1a09,_0x11aa17={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x3b9a71['dryRun']){for(const _0x8fabac of _0x578763){_0x8fabac[_0x24f435(0x13e)]===_0x24f435(0x164)?(_0x11aa17[_0x24f435(0x14a)][_0x24f435(0x149)]({'name':_0x8fabac[_0x24f435(0x13f)][_0x24f435(0x165)],'action':'created'}),_0x11aa17['created']++):(_0x11aa17[_0x24f435(0x14a)][_0x24f435(0x149)]({'name':_0x8fabac[_0x24f435(0x13f)][_0x24f435(0x165)],'action':_0x24f435(0x14b)}),_0x11aa17['updated']++);}return _0x11aa17;}const {engage:_0xed8f84}=_0x20a491;for(let _0xc5d0fd=0x0;_0xc5d0fd<_0x578763[_0x24f435(0x150)];_0xc5d0fd++){const _0x4bf909=_0x578763[_0xc5d0fd];_0x3b9a71['progress']?.['update'](_0x24f435(0x157)+(_0xc5d0fd+0x1)+'/'+_0x578763[_0x24f435(0x150)]+':\x20'+_0x4bf909['def'][_0x24f435(0x165)]);try{if(_0x4bf909['action']===_0x24f435(0x164)&&_0x4bf909['createInput']){const _0x8ad262=await _0xed8f84['createCampaign'](_0x4bf909[_0x24f435(0x148)]);_0x11aa17[_0x24f435(0x14a)][_0x24f435(0x149)]({'name':_0x4bf909[_0x24f435(0x13f)][_0x24f435(0x165)],'action':'created','campaignId':_0x8ad262['id']}),_0x11aa17['created']++;}else{if(_0x4bf909['action']==='update'&&_0x4bf909[_0x24f435(0x152)]&&_0x4bf909[_0x24f435(0x14d)]){const _0x20a299=await _0xed8f84[_0x24f435(0x16a)](_0x4bf909[_0x24f435(0x14d)],_0x4bf909[_0x24f435(0x152)]);_0x11aa17[_0x24f435(0x14a)][_0x24f435(0x149)]({'name':_0x4bf909[_0x24f435(0x13f)]['name'],'action':_0x24f435(0x14b),'campaignId':_0x20a299['id']}),_0x11aa17[_0x24f435(0x14b)]++;}}}catch(_0x98e41e){const _0x57b408=_0x98e41e instanceof Error?_0x98e41e['message']:String(_0x98e41e);_0x11aa17['errors'][_0x24f435(0x149)]({'name':_0x4bf909[_0x24f435(0x13f)][_0x24f435(0x165)],'error':_0x57b408});}}return _0x11aa17;}function a104_0x1a09(_0x376dd0,_0x30884f){_0x376dd0=_0x376dd0-0x13d;const _0x1b7c58=a104_0x1b7c();let _0x1a091a=_0x1b7c58[_0x376dd0];return _0x1a091a;}function createResolveContext(_0x24723b,_0x41e364,_0xb7bc16){return{'resolveWorkspaceId':async _0x41f5d8=>{const _0x525e20=a104_0x1a09;return await _0x24723b[_0x525e20(0x147)]['resolveWorkspaceId'](_0x41f5d8);},'resolveTemplateId':async(_0x39d272,_0x40302d)=>{const _0x5abe83=a104_0x1a09;return await _0x24723b[_0x5abe83(0x147)][_0x5abe83(0x166)](_0x39d272,_0x40302d??_0x41e364);},'resolveSegmentPath':async _0x295548=>{const _0x69752a=a104_0x1a09,_0x5277b5=await _0x24723b[_0x69752a(0x15b)][_0x69752a(0x162)](_0x295548);return{'audienceId':_0x5277b5[_0x69752a(0x140)],'audienceName':_0x5277b5[_0x69752a(0x158)],'segmentId':_0x5277b5[_0x69752a(0x154)],'segmentName':_0x5277b5[_0x69752a(0x168)]};},'readFile':async _0x365e6c=>{const _0x35f432=a104_0x1a09,_0x33305f=a104_0x46d68e[_0x35f432(0x156)](_0xb7bc16,_0x365e6c);return readFileSync(_0x33305f,_0x35f432(0x146));}};}const API_PAGE_LIMIT=0x64;function a104_0x1b7c(){const _0x1effd1=['resolveTemplateId','167797ZGEvSi','segmentName','relative','updateCampaign','workspaceId','listCampaigns','177990rAbcFU','action','def','parentId','8hkLZAO','65gwpvJD','8495751sEDPKs','6605600uKZBlF','set','utf-8','engage','createInput','push','results','updated','campaign','existingId','dir','filter','length','type','updateInput','dirname','segmentId','progress','join','Pushing\x20','parentName','169870mSLwxq','get','segment','fileDir','71788mTtdup','294eVgqND','update','9kPKKHZ','Fetching\x20existing\x20campaigns...','resolvePathToResource','3243483lYRJtj','create','name'];a104_0x1b7c=function(){return _0x1effd1;};return a104_0x1b7c();}async function listAllCampaigns(_0x256ceb,_0x3a36f1){const _0x3a8aa7=a104_0x1a09,_0x259318=[];let _0x4cca9c=0x0;while(!![]){const _0x9a05ff=await _0x256ceb[_0x3a8aa7(0x16c)]({'workspaceId':_0x3a36f1,'limit':API_PAGE_LIMIT,'offset':_0x4cca9c});_0x259318['push'](..._0x9a05ff);if(_0x9a05ff[_0x3a8aa7(0x150)]<API_PAGE_LIMIT)break;_0x4cca9c+=API_PAGE_LIMIT;}return _0x259318;}
@@ -1 +1 @@
1
- (function(_0x3f9f65,_0x2cecbc){const _0x253225=a105_0x4084,_0x1d01cf=_0x3f9f65();while(!![]){try{const _0x1bffb9=parseInt(_0x253225(0x1f7))/0x1+parseInt(_0x253225(0x1fd))/0x2+parseInt(_0x253225(0x1da))/0x3*(-parseInt(_0x253225(0x1d8))/0x4)+parseInt(_0x253225(0x1e8))/0x5*(-parseInt(_0x253225(0x1d0))/0x6)+parseInt(_0x253225(0x1f3))/0x7*(-parseInt(_0x253225(0x1fc))/0x8)+parseInt(_0x253225(0x1fe))/0x9*(parseInt(_0x253225(0x1d9))/0xa)+parseInt(_0x253225(0x1de))/0xb;if(_0x1bffb9===_0x2cecbc)break;else _0x1d01cf['push'](_0x1d01cf['shift']());}catch(_0x189036){_0x1d01cf['push'](_0x1d01cf['shift']());}}}(a105_0x4652,0x2ebbf));import{CampaignDefSchema}from'./types/campaign-def.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';export function validateCampaignDef(_0x3ddaf5,_0x136b72={}){const _0x3ac654=a105_0x4084,_0x21f186=CampaignDefSchema[_0x3ac654(0x1e9)](_0x3ddaf5);if(_0x21f186[_0x3ac654(0x1d2)]){const _0x4d0806=runSemanticChecks(_0x21f186[_0x3ac654(0x1e0)],_0x136b72),_0x2773aa=_0x4d0806[_0x3ac654(0x1e1)](_0x236e5a=>_0x236e5a[_0x3ac654(0x1e6)]===_0x3ac654(0x1eb)),_0x1c2775=_0x4d0806['filter'](_0x3477db=>_0x3477db[_0x3ac654(0x1e6)]===_0x3ac654(0x205));return{'valid':_0x2773aa[_0x3ac654(0x1cf)]===0x0,'errors':_0x2773aa,'warnings':_0x1c2775};}return zodErrorsToValidationResult(_0x21f186[_0x3ac654(0x1eb)],_0x136b72);}function zodErrorsToValidationResult(_0xdf1063,_0x4cf4b1){const _0x17c3c8=a105_0x4084,_0x2be318=_0xdf1063['issues'][_0x17c3c8(0x200)](_0x5a0201=>{const _0x57c0da=_0x17c3c8,_0x2ab82d=formatZodPath(_0x5a0201['path']),_0x229002=mapZodIssueToCode(_0x5a0201,_0x2ab82d),_0x1ad2b0=getLocationFromPath(_0x4cf4b1[_0x57c0da(0x1fa)],_0x4cf4b1[_0x57c0da(0x202)],_0x5a0201[_0x57c0da(0x1f4)]['map'](_0x5609f2=>typeof _0x5609f2==='symbol'?String(_0x5609f2):_0x5609f2));return{'level':_0x57c0da(0x1eb),'path':_0x2ab82d,'code':_0x229002,'message':_0x5a0201[_0x57c0da(0x203)],..._0x1ad2b0&&{'location':_0x1ad2b0}};});return{'valid':![],'errors':_0x2be318,'warnings':[]};}function a105_0x4652(){const _0x2e2d40=['data','filter','Email\x20campaign\x20has\x20a\x20push\x20section\x20but\x20no\x20email\x20section','CAMPAIGN_MISSING_HTML_FILE','audience','email','level','CAMPAIGN_INVALID_CONNECTOR','310GhIATr','safeParse','CAMPAIGN_INVALID_REF','error','email.sender_id','startsWith','template','CAMPAIGN_CONTENT_MISMATCH','CAMPAIGN_MISSING_CONTENT','type','value','57064rVYsJn','path','campaign_type','sender_id','197246SxSAqS','email.template','Push\x20campaign\x20has\x20an\x20email\x20section\x20but\x20no\x20push\x20section','document','CAMPAIGN_MISSING_NAME','136DerVal','155306BeYPMM','18KCoMdf','name','map','html_file','source','message','push','warning','ref:','length','30486vQWHKR','CAMPAIGN_MISSING_TEMPLATE','success','email.html_file','segment','CAMPAIGN_SCHEMA_ERROR','Push\x20campaign\x20requires\x20a\x20push\x20section','Email\x20campaign\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','409924hbggzg','1658990QinNMC','6bgIcAO','CAMPAIGN_INVALID_TYPE','\x20must\x20use\x20ref:\x20prefix\x20(e.g.,\x20ref:Name)\x20—\x20got\x20\x22','Email\x20campaign\x20requires\x20email.sender_id\x20for\x20launch\x20—\x20sender\x20profile\x20UUID\x20from\x20delivery-api','2676234qJrfKK','connector'];a105_0x4652=function(){return _0x2e2d40;};return a105_0x4652();}function a105_0x4084(_0xcab353,_0x569b55){_0xcab353=_0xcab353-0x1cf;const _0x465278=a105_0x4652();let _0x40843f=_0x465278[_0xcab353];return _0x40843f;}function mapZodIssueToCode(_0x4b399e,_0x3646f4){const _0x3a0f80=a105_0x4084;if(_0x3646f4===_0x3a0f80(0x1ff))return _0x3a0f80(0x1fb);if(_0x3646f4===_0x3a0f80(0x1f1))return _0x3a0f80(0x1db);if(_0x3646f4[_0x3a0f80(0x1ed)](_0x3a0f80(0x1df)))return _0x3a0f80(0x1e7);return _0x3a0f80(0x1d5);}function runSemanticChecks(_0x5199c4,_0x1b7933){const _0x34aa22=a105_0x4084,_0x14a15e=[];_0x5199c4['campaign_type']===_0x34aa22(0x1e5)&&!_0x5199c4[_0x34aa22(0x1e5)]&&_0x14a15e['push']({'level':_0x34aa22(0x1eb),'path':_0x34aa22(0x1e5),'code':_0x34aa22(0x1f0),'message':'Email\x20campaign\x20requires\x20an\x20email\x20section','location':getLocationFromPath(_0x1b7933['document'],_0x1b7933[_0x34aa22(0x202)],['campaign_type'])});_0x5199c4['campaign_type']==='push'&&!_0x5199c4[_0x34aa22(0x204)]&&_0x14a15e[_0x34aa22(0x204)]({'level':_0x34aa22(0x1eb),'path':_0x34aa22(0x204),'code':'CAMPAIGN_MISSING_CONTENT','message':_0x34aa22(0x1d6),'location':getLocationFromPath(_0x1b7933[_0x34aa22(0x1fa)],_0x1b7933['source'],[_0x34aa22(0x1f5)])});_0x5199c4['campaign_type']==='email'&&_0x5199c4[_0x34aa22(0x1e5)]&&!_0x5199c4[_0x34aa22(0x1e5)][_0x34aa22(0x201)]&&_0x14a15e[_0x34aa22(0x204)]({'level':_0x34aa22(0x1eb),'path':_0x34aa22(0x1d3),'code':_0x34aa22(0x1e3),'message':_0x34aa22(0x1d7),'location':getLocationFromPath(_0x1b7933[_0x34aa22(0x1fa)],_0x1b7933[_0x34aa22(0x202)],[_0x34aa22(0x1e5)])});_0x5199c4['campaign_type']===_0x34aa22(0x1e5)&&_0x5199c4[_0x34aa22(0x1e5)]&&!_0x5199c4['email'][_0x34aa22(0x1ee)]&&_0x14a15e[_0x34aa22(0x204)]({'level':_0x34aa22(0x1eb),'path':_0x34aa22(0x1f8),'code':_0x34aa22(0x1d1),'message':'Email\x20campaign\x20requires\x20email.template\x20—\x20use\x20ref:Template_Name\x20to\x20reference\x20an\x20existing\x20template','location':getLocationFromPath(_0x1b7933[_0x34aa22(0x1fa)],_0x1b7933['source'],[_0x34aa22(0x1e5)])});_0x5199c4['campaign_type']==='email'&&_0x5199c4[_0x34aa22(0x1e5)]&&!_0x5199c4['email'][_0x34aa22(0x1f6)]&&_0x14a15e[_0x34aa22(0x204)]({'level':_0x34aa22(0x205),'path':_0x34aa22(0x1ec),'code':'CAMPAIGN_MISSING_SENDER_ID','message':_0x34aa22(0x1dd),'location':getLocationFromPath(_0x1b7933[_0x34aa22(0x1fa)],_0x1b7933['source'],[_0x34aa22(0x1e5)])});const _0x3ac5ba=[{'path':_0x34aa22(0x1f8),'value':_0x5199c4['email']?.[_0x34aa22(0x1ee)],'yamlPath':[_0x34aa22(0x1e5),_0x34aa22(0x1ee)]},{'path':_0x34aa22(0x1e4),'value':_0x5199c4['audience'],'yamlPath':['audience']},{'path':_0x34aa22(0x1d4),'value':_0x5199c4[_0x34aa22(0x1d4)],'yamlPath':[_0x34aa22(0x1d4)]}];for(const _0x4ae265 of _0x3ac5ba){_0x4ae265[_0x34aa22(0x1f2)]&&!_0x4ae265[_0x34aa22(0x1f2)][_0x34aa22(0x1ed)](_0x34aa22(0x206))&&_0x14a15e[_0x34aa22(0x204)]({'level':_0x34aa22(0x1eb),'path':_0x4ae265['path'],'code':_0x34aa22(0x1ea),'message':_0x4ae265[_0x34aa22(0x1f4)]+_0x34aa22(0x1dc)+_0x4ae265[_0x34aa22(0x1f2)]+'\x22','location':getLocationFromPath(_0x1b7933['document'],_0x1b7933[_0x34aa22(0x202)],_0x4ae265['yamlPath'])});}return _0x5199c4['campaign_type']===_0x34aa22(0x1e5)&&_0x5199c4[_0x34aa22(0x204)]&&!_0x5199c4[_0x34aa22(0x1e5)]&&_0x14a15e[_0x34aa22(0x204)]({'level':'warning','path':_0x34aa22(0x204),'code':_0x34aa22(0x1ef),'message':_0x34aa22(0x1e2),'location':getLocationFromPath(_0x1b7933[_0x34aa22(0x1fa)],_0x1b7933[_0x34aa22(0x202)],[_0x34aa22(0x204)])}),_0x5199c4['campaign_type']===_0x34aa22(0x204)&&_0x5199c4[_0x34aa22(0x1e5)]&&!_0x5199c4['push']&&_0x14a15e[_0x34aa22(0x204)]({'level':_0x34aa22(0x205),'path':_0x34aa22(0x1e5),'code':'CAMPAIGN_CONTENT_MISMATCH','message':_0x34aa22(0x1f9),'location':getLocationFromPath(_0x1b7933['document'],_0x1b7933[_0x34aa22(0x202)],[_0x34aa22(0x1e5)])}),_0x14a15e;}
1
+ (function(_0x4ff026,_0x3c9c7c){const _0x4ad0f4=a105_0x2d31,_0x5deb0c=_0x4ff026();while(!![]){try{const _0x5384b0=-parseInt(_0x4ad0f4(0x136))/0x1*(parseInt(_0x4ad0f4(0x119))/0x2)+-parseInt(_0x4ad0f4(0x140))/0x3+-parseInt(_0x4ad0f4(0x121))/0x4+parseInt(_0x4ad0f4(0x11f))/0x5*(parseInt(_0x4ad0f4(0x127))/0x6)+parseInt(_0x4ad0f4(0x11a))/0x7+-parseInt(_0x4ad0f4(0x129))/0x8+parseInt(_0x4ad0f4(0x123))/0x9;if(_0x5384b0===_0x3c9c7c)break;else _0x5deb0c['push'](_0x5deb0c['shift']());}catch(_0x367a5a){_0x5deb0c['push'](_0x5deb0c['shift']());}}}(a105_0x487c,0x35980));import{CampaignDefSchema}from'./types/campaign-def.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';function a105_0x487c(){const _0x41a375=['1qtJckM','error','Email\x20campaign\x20has\x20a\x20push\x20section\x20but\x20no\x20email\x20section','CAMPAIGN_SCHEMA_ERROR','Push\x20campaign\x20has\x20an\x20email\x20section\x20but\x20no\x20push\x20section','message','warning','source','Email\x20campaign\x20requires\x20email.template\x20—\x20use\x20ref:Template_Name\x20to\x20reference\x20an\x20existing\x20template','path','1234809aCRkWz','segment','connector','template','audience','filter','name','CAMPAIGN_INVALID_CONNECTOR','email.template','CAMPAIGN_MISSING_CONTENT','204818qiHNel','681807ntSUvr','Email\x20campaign\x20requires\x20email.sender_id\x20for\x20launch\x20—\x20sender\x20profile\x20UUID\x20from\x20delivery-api','email','yamlPath','\x20must\x20use\x20ref:\x20prefix\x20(e.g.,\x20ref:Name)\x20—\x20got\x20\x22','562165HvXKDz','Push\x20campaign\x20requires\x20a\x20push\x20section','21996YsCZpr','level','2964501pjRzIt','Email\x20campaign\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','type','CAMPAIGN_CONTENT_MISMATCH','18CrePoG','Email\x20campaign\x20requires\x20an\x20email\x20section','200464YdctUY','campaign_type','startsWith','CAMPAIGN_MISSING_SENDER_ID','value','email.html_file','symbol','CAMPAIGN_INVALID_REF','document','issues','sender_id','push','CAMPAIGN_INVALID_TYPE'];a105_0x487c=function(){return _0x41a375;};return a105_0x487c();}export function validateCampaignDef(_0x339454,_0x4ed51b={}){const _0x2ce86c=a105_0x2d31,_0x40b7a8=CampaignDefSchema['safeParse'](_0x339454);if(_0x40b7a8['success']){const _0x2ba29c=runSemanticChecks(_0x40b7a8['data'],_0x4ed51b),_0x36c69f=_0x2ba29c[_0x2ce86c(0x145)](_0x20aa0c=>_0x20aa0c[_0x2ce86c(0x122)]===_0x2ce86c(0x137)),_0x39ab01=_0x2ba29c[_0x2ce86c(0x145)](_0x2a4dd1=>_0x2a4dd1[_0x2ce86c(0x122)]==='warning');return{'valid':_0x36c69f['length']===0x0,'errors':_0x36c69f,'warnings':_0x39ab01};}return zodErrorsToValidationResult(_0x40b7a8[_0x2ce86c(0x137)],_0x4ed51b);}function a105_0x2d31(_0x2bdc06,_0x1d827d){_0x2bdc06=_0x2bdc06-0x116;const _0x487cdf=a105_0x487c();let _0x2d310b=_0x487cdf[_0x2bdc06];return _0x2d310b;}function zodErrorsToValidationResult(_0x269260,_0x4fcf20){const _0x15fe6e=a105_0x2d31,_0x47a8a9=_0x269260[_0x15fe6e(0x132)]['map'](_0x1a30a2=>{const _0x23067d=_0x15fe6e,_0x33f5cf=formatZodPath(_0x1a30a2['path']),_0x59803b=mapZodIssueToCode(_0x1a30a2,_0x33f5cf),_0x143e68=getLocationFromPath(_0x4fcf20[_0x23067d(0x131)],_0x4fcf20[_0x23067d(0x13d)],_0x1a30a2[_0x23067d(0x13f)]['map'](_0x160122=>typeof _0x160122===_0x23067d(0x12f)?String(_0x160122):_0x160122));return{'level':_0x23067d(0x137),'path':_0x33f5cf,'code':_0x59803b,'message':_0x1a30a2[_0x23067d(0x13b)],..._0x143e68&&{'location':_0x143e68}};});return{'valid':![],'errors':_0x47a8a9,'warnings':[]};}function mapZodIssueToCode(_0x51f157,_0x44bca4){const _0x5a132f=a105_0x2d31;if(_0x44bca4===_0x5a132f(0x146))return'CAMPAIGN_MISSING_NAME';if(_0x44bca4===_0x5a132f(0x125))return _0x5a132f(0x135);if(_0x44bca4[_0x5a132f(0x12b)](_0x5a132f(0x142)))return _0x5a132f(0x116);return _0x5a132f(0x139);}function runSemanticChecks(_0x82f245,_0x5580ba){const _0x575e3d=a105_0x2d31,_0x5cdb96=[];_0x82f245[_0x575e3d(0x12a)]===_0x575e3d(0x11c)&&!_0x82f245[_0x575e3d(0x11c)]&&_0x5cdb96[_0x575e3d(0x134)]({'level':_0x575e3d(0x137),'path':_0x575e3d(0x11c),'code':_0x575e3d(0x118),'message':_0x575e3d(0x128),'location':getLocationFromPath(_0x5580ba[_0x575e3d(0x131)],_0x5580ba[_0x575e3d(0x13d)],[_0x575e3d(0x12a)])});_0x82f245[_0x575e3d(0x12a)]===_0x575e3d(0x134)&&!_0x82f245[_0x575e3d(0x134)]&&_0x5cdb96[_0x575e3d(0x134)]({'level':_0x575e3d(0x137),'path':_0x575e3d(0x134),'code':_0x575e3d(0x118),'message':_0x575e3d(0x120),'location':getLocationFromPath(_0x5580ba['document'],_0x5580ba[_0x575e3d(0x13d)],[_0x575e3d(0x12a)])});_0x82f245[_0x575e3d(0x12a)]===_0x575e3d(0x11c)&&_0x82f245[_0x575e3d(0x11c)]&&!_0x82f245[_0x575e3d(0x11c)]['html_file']&&_0x5cdb96[_0x575e3d(0x134)]({'level':'error','path':_0x575e3d(0x12e),'code':'CAMPAIGN_MISSING_HTML_FILE','message':_0x575e3d(0x124),'location':getLocationFromPath(_0x5580ba[_0x575e3d(0x131)],_0x5580ba[_0x575e3d(0x13d)],['email'])});_0x82f245[_0x575e3d(0x12a)]===_0x575e3d(0x11c)&&_0x82f245[_0x575e3d(0x11c)]&&!_0x82f245[_0x575e3d(0x11c)][_0x575e3d(0x143)]&&_0x5cdb96['push']({'level':_0x575e3d(0x137),'path':_0x575e3d(0x117),'code':'CAMPAIGN_MISSING_TEMPLATE','message':_0x575e3d(0x13e),'location':getLocationFromPath(_0x5580ba[_0x575e3d(0x131)],_0x5580ba[_0x575e3d(0x13d)],[_0x575e3d(0x11c)])});_0x82f245['campaign_type']==='email'&&_0x82f245[_0x575e3d(0x11c)]&&!_0x82f245['email'][_0x575e3d(0x133)]&&_0x5cdb96[_0x575e3d(0x134)]({'level':'warning','path':'email.sender_id','code':_0x575e3d(0x12c),'message':_0x575e3d(0x11b),'location':getLocationFromPath(_0x5580ba['document'],_0x5580ba[_0x575e3d(0x13d)],['email'])});const _0x4b1fe6=[{'path':_0x575e3d(0x117),'value':_0x82f245['email']?.[_0x575e3d(0x143)],'yamlPath':[_0x575e3d(0x11c),_0x575e3d(0x143)]},{'path':_0x575e3d(0x144),'value':_0x82f245[_0x575e3d(0x144)],'yamlPath':['audience']},{'path':_0x575e3d(0x141),'value':_0x82f245[_0x575e3d(0x141)],'yamlPath':[_0x575e3d(0x141)]}];for(const _0x43b08e of _0x4b1fe6){_0x43b08e[_0x575e3d(0x12d)]&&!_0x43b08e['value'][_0x575e3d(0x12b)]('ref:')&&_0x5cdb96[_0x575e3d(0x134)]({'level':_0x575e3d(0x137),'path':_0x43b08e[_0x575e3d(0x13f)],'code':_0x575e3d(0x130),'message':_0x43b08e[_0x575e3d(0x13f)]+_0x575e3d(0x11e)+_0x43b08e[_0x575e3d(0x12d)]+'\x22','location':getLocationFromPath(_0x5580ba[_0x575e3d(0x131)],_0x5580ba['source'],_0x43b08e[_0x575e3d(0x11d)])});}return _0x82f245['campaign_type']===_0x575e3d(0x11c)&&_0x82f245['push']&&!_0x82f245[_0x575e3d(0x11c)]&&_0x5cdb96[_0x575e3d(0x134)]({'level':_0x575e3d(0x13c),'path':_0x575e3d(0x134),'code':_0x575e3d(0x126),'message':_0x575e3d(0x138),'location':getLocationFromPath(_0x5580ba[_0x575e3d(0x131)],_0x5580ba[_0x575e3d(0x13d)],[_0x575e3d(0x134)])}),_0x82f245['campaign_type']===_0x575e3d(0x134)&&_0x82f245[_0x575e3d(0x11c)]&&!_0x82f245[_0x575e3d(0x134)]&&_0x5cdb96[_0x575e3d(0x134)]({'level':_0x575e3d(0x13c),'path':_0x575e3d(0x11c),'code':_0x575e3d(0x126),'message':_0x575e3d(0x13a),'location':getLocationFromPath(_0x5580ba['document'],_0x5580ba[_0x575e3d(0x13d)],[_0x575e3d(0x11c)])}),_0x5cdb96;}
@@ -1 +1 @@
1
- const a106_0x3ca8c0=a106_0x412b;function a106_0x1b42(){const _0x4977f7=['connector','htmlTemplate','utmSource','some','segment','displayName','startsWith','activationActionsEnabled','utmMarketingTactic','on_click_behavior_url','defaultValue','templateVariables','source_platform','utm:','notifications','email','utm','resolveTemplateId','push_type','resolveSegmentPath','resolveWorkspaceId','column','segmentId','workspace','sourceEmailTemplateName','connector:','.html','.txt','description','subject','emailSenderId','connectorConfig','audienceId','activation:','audience','readFile','title','startAt','1210zBTRcS','allColumns','default_value','name','schedule:','all_columns','split','source','marketing_tactic','toLowerCase','trimStart','24058914VkXHyk','onClickBehavior','segmentName','events','workflowName','variables','campaign_type','slice','connectionId','map','pushType','campaign','1520202nwFMNa','push','emailRecipients','on_click_behavior','enableUtmTracking','imageUrl','workspaceId','workspaceName','timezone','1256560LCyglW','keys','activation','start_at','onClickBehaviorUrl','29625CwHYIX','27198wRuKTz','workflow_project','template','plaintext_file','parse','previewValue','preview_value','utmSourcePlatform','audienceName','plaintextTemplate','message','utmId','7nbBBUi','schedule','email:','html_file','columns','replace','utmMedium','display_name','null','medium','utmCampaign','join','220450kamjjj','image_url','utmParameters','enabled','sender_id','push:','6vqnrFZ','pushContent','emailContent','76yrbOcL','notifyOn','workflowProjectName','audience:','segmentFolderPath','10510086XxjGIA','stringify','recipients','ref:','length'];a106_0x1b42=function(){return _0x4977f7;};return a106_0x1b42();}(function(_0x58c9b4,_0x2b1c29){const _0x2aefcf=a106_0x412b,_0x2b34dc=_0x58c9b4();while(!![]){try{const _0x2d66ca=-parseInt(_0x2aefcf(0x1cf))/0x1+-parseInt(_0x2aefcf(0x1c1))/0x2*(-parseInt(_0x2aefcf(0x1ee))/0x3)+parseInt(_0x2aefcf(0x1f1))/0x4*(-parseInt(_0x2aefcf(0x1e8))/0x5)+-parseInt(_0x2aefcf(0x17f))/0x6*(parseInt(_0x2aefcf(0x1dc))/0x7)+parseInt(_0x2aefcf(0x1ca))/0x8+-parseInt(_0x2aefcf(0x1d0))/0x9*(parseInt(_0x2aefcf(0x1aa))/0xa)+parseInt(_0x2aefcf(0x1b5))/0xb;if(_0x2d66ca===_0x2b1c29)break;else _0x2b34dc['push'](_0x2b34dc['shift']());}catch(_0x536a54){_0x2b34dc['push'](_0x2b34dc['shift']());}}}(a106_0x1b42,0xd6c98));import*as a106_0xde9fa4 from'yaml';function a106_0x412b(_0x456770,_0xfb5cfe){_0x456770=_0x456770-0x17b;const _0x1b42ff=a106_0x1b42();let _0x412b09=_0x1b42ff[_0x456770];return _0x412b09;}import{safeParseYaml}from'../segment/yaml-validator.js';import{CampaignDefSchema}from'./types/campaign-def.js';const REF_PREFIX=a106_0x3ca8c0(0x182);function toRef(_0x3d6898){return''+REF_PREFIX+_0x3d6898;}function isRef(_0x4d2e48){return _0x4d2e48['startsWith'](REF_PREFIX);}function parseRef(_0x254d0d){const _0x233aab=a106_0x3ca8c0;if(!isRef(_0x254d0d))return _0x254d0d;return _0x254d0d[_0x233aab(0x1bc)](REF_PREFIX[_0x233aab(0x183)]);}export function campaignToDef(_0x2a5eb6,_0x1b9b84){const _0x62dcd4=a106_0x3ca8c0,_0x5acbee=_0x2a5eb6['attributes'],_0x6f10ed=sanitizeCampaignFileName(_0x5acbee[_0x62dcd4(0x1ad)]),_0x288691={'type':_0x62dcd4(0x1c0),'name':_0x5acbee[_0x62dcd4(0x1ad)],'campaign_type':_0x5acbee['campaignType'],..._0x5acbee['description']&&{'description':_0x5acbee['description']},..._0x1b9b84[_0x62dcd4(0x1c8)]&&{'workspace':_0x1b9b84[_0x62dcd4(0x1c8)]}};_0x5acbee[_0x62dcd4(0x1d8)]&&(_0x288691[_0x62dcd4(0x1a6)]=toRef(_0x5acbee[_0x62dcd4(0x1d8)]));if(_0x5acbee[_0x62dcd4(0x1b7)]){const _0x2e1bbe=_0x1b9b84[_0x62dcd4(0x17e)]?_0x1b9b84[_0x62dcd4(0x17e)]+'/'+_0x5acbee[_0x62dcd4(0x1b7)]:_0x5acbee[_0x62dcd4(0x1b7)];_0x288691['segment']=toRef(_0x2e1bbe);}let _0x590770,_0x205fb7;if(_0x5acbee['emailContent']){const _0x2d33f5={};_0x5acbee['emailContent']['sourceEmailTemplateName']&&(_0x2d33f5[_0x62dcd4(0x1d2)]=toRef(_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x19c)])),_0x5acbee['emailContent']['subjectTemplate']&&(_0x2d33f5[_0x62dcd4(0x1a1)]=_0x5acbee[_0x62dcd4(0x1f0)]['subjectTemplate']),_0x5acbee['emailContent'][_0x62dcd4(0x1a2)]&&(_0x2d33f5[_0x62dcd4(0x1ec)]=_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x1a2)]),_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x185)]&&(_0x2d33f5['html_file']=_0x6f10ed+_0x62dcd4(0x19e),_0x590770=_0x5acbee['emailContent'][_0x62dcd4(0x185)]),_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x1d9)]&&(_0x2d33f5[_0x62dcd4(0x1d3)]=_0x6f10ed+_0x62dcd4(0x19f),_0x205fb7=_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x1d9)]),_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x18f)]&&_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x18f)][_0x62dcd4(0x183)]>0x0&&(_0x2d33f5[_0x62dcd4(0x1ba)]=_0x5acbee[_0x62dcd4(0x1f0)][_0x62dcd4(0x18f)]['map'](templateVariableToYaml)),Object[_0x62dcd4(0x1cb)](_0x2d33f5)[_0x62dcd4(0x183)]>0x0&&(_0x288691[_0x62dcd4(0x193)]=_0x2d33f5);}if(_0x5acbee[_0x62dcd4(0x1ef)]){const _0x37fc15=pushContentToYaml(_0x5acbee[_0x62dcd4(0x1ef)]);Object[_0x62dcd4(0x1cb)](_0x37fc15)['length']>0x0&&(_0x288691[_0x62dcd4(0x1c2)]=_0x37fc15);}if(_0x5acbee[_0x62dcd4(0x1a9)]||_0x5acbee[_0x62dcd4(0x1c9)]){const _0x47eb20={};if(_0x5acbee[_0x62dcd4(0x1a9)])_0x47eb20['start_at']=_0x5acbee[_0x62dcd4(0x1a9)];if(_0x5acbee[_0x62dcd4(0x1c9)])_0x47eb20[_0x62dcd4(0x1c9)]=_0x5acbee[_0x62dcd4(0x1c9)];_0x288691[_0x62dcd4(0x1dd)]=_0x47eb20;}const _0x38bacf=connectorToYaml(_0x5acbee);_0x38bacf&&(_0x288691['connector']=_0x38bacf);const _0x4839ec=activationSettingsToYaml(_0x5acbee);_0x4839ec&&(_0x288691['activation']=_0x4839ec);_0x5acbee['enableUtmTracking']&&_0x5acbee[_0x62dcd4(0x1ea)]&&(_0x288691[_0x62dcd4(0x194)]=utmToYaml(_0x5acbee[_0x62dcd4(0x1ea)],_0x5acbee[_0x62dcd4(0x1c5)]));if(_0x5acbee[_0x62dcd4(0x17b)]&&_0x5acbee[_0x62dcd4(0x17b)]['length']>0x0||_0x5acbee[_0x62dcd4(0x1c3)]&&_0x5acbee[_0x62dcd4(0x1c3)][_0x62dcd4(0x183)]>0x0){const _0x487191={};if(_0x5acbee[_0x62dcd4(0x17b)]&&_0x5acbee[_0x62dcd4(0x17b)][_0x62dcd4(0x183)]>0x0)_0x487191[_0x62dcd4(0x1b8)]=_0x5acbee[_0x62dcd4(0x17b)];if(_0x5acbee[_0x62dcd4(0x1c3)]&&_0x5acbee['emailRecipients']['length']>0x0)_0x487191[_0x62dcd4(0x181)]=_0x5acbee[_0x62dcd4(0x1c3)];_0x288691['notifications']=_0x487191;}return{'def':_0x288691,'htmlContent':_0x590770,'plaintextContent':_0x205fb7};}export async function defToCreateInput(_0x2e1a3c,_0x28c44a){const _0x4852f1=a106_0x3ca8c0,_0x415dca={'name':_0x2e1a3c[_0x4852f1(0x1ad)],'campaignType':_0x2e1a3c[_0x4852f1(0x1bb)]};_0x2e1a3c[_0x4852f1(0x19b)]&&(_0x415dca['workspaceId']=await _0x28c44a[_0x4852f1(0x198)](_0x2e1a3c[_0x4852f1(0x19b)]));_0x2e1a3c['description']&&(_0x415dca['description']=_0x2e1a3c['description']);await resolveSegmentRefs(_0x2e1a3c,_0x415dca,_0x28c44a);_0x2e1a3c[_0x4852f1(0x193)]&&(_0x415dca[_0x4852f1(0x1f0)]=await emailDefToApi(_0x2e1a3c[_0x4852f1(0x193)],_0x415dca[_0x4852f1(0x1c7)],_0x28c44a));_0x2e1a3c['push']&&(_0x415dca['pushContent']=pushDefToApi(_0x2e1a3c[_0x4852f1(0x1c2)]));_0x2e1a3c[_0x4852f1(0x184)]&&(_0x415dca[_0x4852f1(0x1a3)]=connectorDefToApi(_0x2e1a3c['connector']),_0x2e1a3c[_0x4852f1(0x184)][_0x4852f1(0x1af)]!==undefined&&(_0x415dca['allColumns']=_0x2e1a3c[_0x4852f1(0x184)][_0x4852f1(0x1af)]),_0x2e1a3c['connector']['columns']&&(_0x415dca['columns']=_0x2e1a3c[_0x4852f1(0x184)]['columns'][_0x4852f1(0x1be)](_0x1f1c4f=>({'column':_0x1f1c4f['column'],'source':{'column':_0x1f1c4f[_0x4852f1(0x1b1)]}}))));if(_0x2e1a3c[_0x4852f1(0x1dd)]){if(_0x2e1a3c['schedule'][_0x4852f1(0x1cd)])_0x415dca[_0x4852f1(0x1a9)]=_0x2e1a3c[_0x4852f1(0x1dd)][_0x4852f1(0x1cd)];if(_0x2e1a3c[_0x4852f1(0x1dd)]['timezone'])_0x415dca[_0x4852f1(0x1c9)]=_0x2e1a3c['schedule']['timezone'];}return _0x2e1a3c[_0x4852f1(0x194)]&&(_0x415dca['enableUtmTracking']=_0x2e1a3c[_0x4852f1(0x194)][_0x4852f1(0x1eb)]??![]),_0x415dca;}export async function defToUpdateInput(_0x34de79,_0x53b71e){const _0x446176=a106_0x3ca8c0,_0x161e8d={};if(_0x34de79['name'])_0x161e8d[_0x446176(0x1ad)]=_0x34de79[_0x446176(0x1ad)];if(_0x34de79[_0x446176(0x1a0)]!==undefined)_0x161e8d[_0x446176(0x1a0)]=_0x34de79[_0x446176(0x1a0)];await resolveSegmentRefs(_0x34de79,_0x161e8d,_0x53b71e);if(_0x34de79['email']){const _0x239db3=_0x34de79[_0x446176(0x19b)]?await _0x53b71e[_0x446176(0x198)](_0x34de79['workspace']):undefined;_0x161e8d[_0x446176(0x1f0)]=await emailDefToApi(_0x34de79[_0x446176(0x193)],_0x239db3,_0x53b71e);}_0x34de79[_0x446176(0x1c2)]&&(_0x161e8d[_0x446176(0x1ef)]=pushDefToApi(_0x34de79[_0x446176(0x1c2)]));_0x34de79[_0x446176(0x184)]&&(_0x161e8d[_0x446176(0x1a3)]=connectorDefToApi(_0x34de79[_0x446176(0x184)]),_0x34de79[_0x446176(0x184)][_0x446176(0x1af)]!==undefined&&(_0x161e8d[_0x446176(0x1ab)]=_0x34de79[_0x446176(0x184)][_0x446176(0x1af)]),_0x34de79[_0x446176(0x184)][_0x446176(0x1e0)]&&(_0x161e8d[_0x446176(0x1e0)]=_0x34de79['connector'][_0x446176(0x1e0)][_0x446176(0x1be)](_0x5610fd=>({'column':_0x5610fd['column'],'source':{'column':_0x5610fd[_0x446176(0x1b1)]}}))));if(_0x34de79[_0x446176(0x1dd)]){if(_0x34de79[_0x446176(0x1dd)]['start_at'])_0x161e8d[_0x446176(0x1a9)]=_0x34de79[_0x446176(0x1dd)][_0x446176(0x1cd)];if(_0x34de79['schedule'][_0x446176(0x1c9)])_0x161e8d[_0x446176(0x1c9)]=_0x34de79[_0x446176(0x1dd)]['timezone'];}return _0x34de79[_0x446176(0x194)]&&(_0x161e8d[_0x446176(0x1c5)]=_0x34de79[_0x446176(0x194)]['enabled']??![]),_0x161e8d;}export function toYamlString(_0x492b3c){const _0x203c99=a106_0x3ca8c0,_0x460057=JSON[_0x203c99(0x1d4)](JSON[_0x203c99(0x180)](_0x492b3c)),_0x247a46=a106_0xde9fa4[_0x203c99(0x180)](_0x460057,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x203c99(0x1e4)}),_0x5ade2a=[_0x203c99(0x17d),_0x203c99(0x1de),_0x203c99(0x1ed),_0x203c99(0x1ae),_0x203c99(0x19d),_0x203c99(0x1a5),_0x203c99(0x191),'notifications:'],_0x1e0d68=_0x247a46[_0x203c99(0x1b0)]('\x0a'),_0x210883=[];for(let _0x3ca8dc=0x0;_0x3ca8dc<_0x1e0d68['length'];_0x3ca8dc++){const _0x2567ed=_0x1e0d68[_0x3ca8dc][_0x203c99(0x1b4)]();_0x3ca8dc>0x0&&_0x5ade2a[_0x203c99(0x187)](_0x4d4fe0=>_0x2567ed[_0x203c99(0x18a)](_0x4d4fe0))&&_0x210883['length']>0x0&&_0x210883[_0x210883[_0x203c99(0x183)]-0x1]!==''&&_0x210883[_0x203c99(0x1c2)](''),_0x210883[_0x203c99(0x1c2)](_0x1e0d68[_0x3ca8dc]);}return _0x210883[_0x203c99(0x1e7)]('\x0a');}export function parseYamlString(_0x28b4f7){return safeParseYaml(_0x28b4f7,CampaignDefSchema);}export function normalizeDef(_0x4705ed){const _0x24cf0d=a106_0x3ca8c0;return{'type':_0x24cf0d(0x1c0),'name':_0x4705ed[_0x24cf0d(0x1ad)],'campaign_type':_0x4705ed[_0x24cf0d(0x1bb)],..._0x4705ed[_0x24cf0d(0x1a0)]!==undefined&&{'description':_0x4705ed['description']},..._0x4705ed[_0x24cf0d(0x19b)]!==undefined&&{'workspace':_0x4705ed[_0x24cf0d(0x19b)]},..._0x4705ed['audience']!==undefined&&{'audience':_0x4705ed[_0x24cf0d(0x1a6)]},..._0x4705ed['segment']!==undefined&&{'segment':_0x4705ed[_0x24cf0d(0x188)]},..._0x4705ed[_0x24cf0d(0x193)]&&{'email':normalizeEmailDef(_0x4705ed['email'])},..._0x4705ed[_0x24cf0d(0x1c2)]&&{'push':normalizePushDef(_0x4705ed[_0x24cf0d(0x1c2)])},..._0x4705ed[_0x24cf0d(0x1dd)]&&{'schedule':normalizeScheduleDef(_0x4705ed[_0x24cf0d(0x1dd)])},..._0x4705ed['connector']&&{'connector':normalizeConnectorDef(_0x4705ed['connector'])},..._0x4705ed[_0x24cf0d(0x1cc)]&&{'activation':normalizeActivationDef(_0x4705ed['activation'])},..._0x4705ed[_0x24cf0d(0x194)]&&{'utm':normalizeUtmDef(_0x4705ed[_0x24cf0d(0x194)])},..._0x4705ed[_0x24cf0d(0x192)]&&{'notifications':normalizeNotificationsDef(_0x4705ed['notifications'])}};}function templateVariableToYaml(_0x30dd7a){const _0x286bab=a106_0x3ca8c0;return{'name':_0x30dd7a[_0x286bab(0x1ad)],..._0x30dd7a['displayName']&&{'display_name':_0x30dd7a[_0x286bab(0x189)]},..._0x30dd7a[_0x286bab(0x1d5)]&&{'preview_value':_0x30dd7a['previewValue']},..._0x30dd7a[_0x286bab(0x18e)]&&{'default_value':_0x30dd7a[_0x286bab(0x18e)]}};}function pushContentToYaml(_0x410c62){const _0x21c910=a106_0x3ca8c0;return{..._0x410c62[_0x21c910(0x1a8)]&&{'title':_0x410c62[_0x21c910(0x1a8)]},..._0x410c62['message']&&{'message':_0x410c62[_0x21c910(0x1da)]},..._0x410c62[_0x21c910(0x1bf)]&&{'push_type':_0x410c62[_0x21c910(0x1bf)]},..._0x410c62['imageUrl']&&{'image_url':_0x410c62[_0x21c910(0x1c6)]},..._0x410c62[_0x21c910(0x1b6)]&&{'on_click_behavior':_0x410c62['onClickBehavior']},..._0x410c62[_0x21c910(0x1ce)]&&{'on_click_behavior_url':_0x410c62['onClickBehaviorUrl']}};}function connectorToYaml(_0x4c1db2){const _0x33c3fc=a106_0x3ca8c0,_0x1854aa=_0x4c1db2[_0x33c3fc(0x1bd)],_0x29ee64=_0x4c1db2['columns']&&_0x4c1db2['columns'][_0x33c3fc(0x183)]>0x0;if(!_0x1854aa&&!_0x29ee64&&!_0x4c1db2[_0x33c3fc(0x1ab)])return undefined;const _0x1710c6={};return _0x4c1db2[_0x33c3fc(0x1ab)]!==undefined&&(_0x1710c6['all_columns']=_0x4c1db2[_0x33c3fc(0x1ab)]),_0x4c1db2[_0x33c3fc(0x1e0)]&&_0x4c1db2[_0x33c3fc(0x1e0)][_0x33c3fc(0x183)]>0x0&&(_0x1710c6[_0x33c3fc(0x1e0)]=_0x4c1db2['columns'][_0x33c3fc(0x1be)](columnMappingToYaml)),_0x1710c6;}function columnMappingToYaml(_0x525dd2){const _0x25f18d=a106_0x3ca8c0;return{'column':_0x525dd2[_0x25f18d(0x199)],'source':_0x525dd2[_0x25f18d(0x1b1)][_0x25f18d(0x199)]};}function activationSettingsToYaml(_0x13ce5b){const _0x224661=a106_0x3ca8c0;if(!_0x13ce5b[_0x224661(0x18b)]&&!_0x13ce5b[_0x224661(0x17c)]&&!_0x13ce5b[_0x224661(0x1b9)])return undefined;return{..._0x13ce5b[_0x224661(0x18b)]!==undefined&&{'enabled':_0x13ce5b[_0x224661(0x18b)]},..._0x13ce5b[_0x224661(0x17c)]&&{'workflow_project':_0x13ce5b[_0x224661(0x17c)]},..._0x13ce5b[_0x224661(0x1b9)]&&{'workflow_name':_0x13ce5b['workflowName']}};}function utmToYaml(_0xe857f7,_0x4d6360){const _0x4d479a=a106_0x3ca8c0;return{'enabled':_0x4d6360,..._0xe857f7[_0x4d479a(0x1db)]&&{'id':_0xe857f7[_0x4d479a(0x1db)]},..._0xe857f7[_0x4d479a(0x1e2)]&&{'medium':_0xe857f7['utmMedium']},..._0xe857f7[_0x4d479a(0x186)]&&{'source':_0xe857f7['utmSource']},..._0xe857f7[_0x4d479a(0x1d7)]&&{'source_platform':_0xe857f7['utmSourcePlatform']},..._0xe857f7['utmCampaign']&&{'campaign':_0xe857f7[_0x4d479a(0x1e6)]},..._0xe857f7[_0x4d479a(0x18c)]&&{'marketing_tactic':_0xe857f7[_0x4d479a(0x18c)]}};}async function resolveSegmentRefs(_0x1a9771,_0x29f894,_0x36d7c8){const _0x4823c2=a106_0x3ca8c0;if(_0x1a9771[_0x4823c2(0x1a6)]){const _0x16e70e=parseRef(_0x1a9771[_0x4823c2(0x1a6)]),_0xff4cc7=_0x1a9771['segment']?parseRef(_0x1a9771[_0x4823c2(0x188)]):undefined,_0x176b63=_0xff4cc7?_0x16e70e+'/'+_0xff4cc7:_0x16e70e,_0x25f320=await _0x36d7c8[_0x4823c2(0x197)](_0x176b63);_0x29f894[_0x4823c2(0x1a4)]=_0x25f320['audienceId'],_0x29f894[_0x4823c2(0x1d8)]=_0x25f320['audienceName'],_0x25f320[_0x4823c2(0x19a)]&&(_0x29f894[_0x4823c2(0x19a)]=_0x25f320[_0x4823c2(0x19a)],_0x29f894['segmentName']=_0x25f320[_0x4823c2(0x1b7)]);}}async function emailDefToApi(_0x13c44b,_0x3b9bdc,_0x2c8ae3){const _0x439aaa=a106_0x3ca8c0;let _0x25e7a6='',_0x488235;if(_0x13c44b[_0x439aaa(0x1d2)]){const _0x5c57f2=parseRef(_0x13c44b[_0x439aaa(0x1d2)]),_0x564eb6=await _0x2c8ae3[_0x439aaa(0x195)](_0x5c57f2,_0x3b9bdc);_0x25e7a6=_0x564eb6['id'],_0x488235=_0x564eb6[_0x439aaa(0x1ad)];}let _0x18d5a0;_0x13c44b[_0x439aaa(0x1df)]&&(_0x18d5a0=await _0x2c8ae3[_0x439aaa(0x1a7)](_0x13c44b[_0x439aaa(0x1df)]));let _0xf90db8;return _0x13c44b['plaintext_file']&&(_0xf90db8=await _0x2c8ae3[_0x439aaa(0x1a7)](_0x13c44b[_0x439aaa(0x1d3)])),{'sourceEmailTemplateId':_0x25e7a6,..._0x488235&&{'sourceEmailTemplateName':_0x488235},..._0x13c44b[_0x439aaa(0x1a1)]&&{'subjectTemplate':_0x13c44b[_0x439aaa(0x1a1)]},..._0x18d5a0&&{'htmlTemplate':_0x18d5a0},..._0xf90db8&&{'plaintextTemplate':_0xf90db8},..._0x13c44b[_0x439aaa(0x1ec)]&&{'emailSenderId':_0x13c44b[_0x439aaa(0x1ec)]}};}function pushDefToApi(_0x1143bb){const _0x2c90c3=a106_0x3ca8c0;return{..._0x1143bb[_0x2c90c3(0x1a8)]&&{'title':_0x1143bb[_0x2c90c3(0x1a8)]},..._0x1143bb[_0x2c90c3(0x1da)]&&{'message':_0x1143bb['message']},..._0x1143bb[_0x2c90c3(0x196)]&&{'pushType':_0x1143bb[_0x2c90c3(0x196)]},..._0x1143bb[_0x2c90c3(0x1e9)]&&{'imageUrl':_0x1143bb[_0x2c90c3(0x1e9)]},..._0x1143bb[_0x2c90c3(0x1c4)]&&{'onClickBehavior':_0x1143bb[_0x2c90c3(0x1c4)]},..._0x1143bb['on_click_behavior_url']&&{'onClickBehaviorUrl':_0x1143bb[_0x2c90c3(0x18d)]}};}function connectorDefToApi(_0x3cacff){return{};}function normalizeEmailDef(_0x14c8e6){const _0xea6bbf=a106_0x3ca8c0;return{..._0x14c8e6[_0xea6bbf(0x1d2)]!==undefined&&{'template':_0x14c8e6['template']},..._0x14c8e6['subject']!==undefined&&{'subject':_0x14c8e6[_0xea6bbf(0x1a1)]},..._0x14c8e6[_0xea6bbf(0x1df)]!==undefined&&{'html_file':_0x14c8e6[_0xea6bbf(0x1df)]},..._0x14c8e6[_0xea6bbf(0x1d3)]!==undefined&&{'plaintext_file':_0x14c8e6[_0xea6bbf(0x1d3)]},..._0x14c8e6['sender_id']!==undefined&&{'sender_id':_0x14c8e6[_0xea6bbf(0x1ec)]},..._0x14c8e6[_0xea6bbf(0x1ba)]&&{'variables':_0x14c8e6[_0xea6bbf(0x1ba)][_0xea6bbf(0x1be)](_0x122f31=>({'name':_0x122f31[_0xea6bbf(0x1ad)],..._0x122f31[_0xea6bbf(0x1e3)]!==undefined&&{'display_name':_0x122f31[_0xea6bbf(0x1e3)]},..._0x122f31[_0xea6bbf(0x1d6)]!==undefined&&{'preview_value':_0x122f31[_0xea6bbf(0x1d6)]},..._0x122f31[_0xea6bbf(0x1ac)]!==undefined&&{'default_value':_0x122f31['default_value']}}))}};}function normalizePushDef(_0x21c730){const _0x286fda=a106_0x3ca8c0;return{..._0x21c730[_0x286fda(0x1a8)]!==undefined&&{'title':_0x21c730[_0x286fda(0x1a8)]},..._0x21c730[_0x286fda(0x1da)]!==undefined&&{'message':_0x21c730[_0x286fda(0x1da)]},..._0x21c730['push_type']!==undefined&&{'push_type':_0x21c730[_0x286fda(0x196)]},..._0x21c730[_0x286fda(0x1e9)]!==undefined&&{'image_url':_0x21c730[_0x286fda(0x1e9)]},..._0x21c730[_0x286fda(0x1c4)]!==undefined&&{'on_click_behavior':_0x21c730[_0x286fda(0x1c4)]},..._0x21c730[_0x286fda(0x18d)]!==undefined&&{'on_click_behavior_url':_0x21c730[_0x286fda(0x18d)]}};}function normalizeScheduleDef(_0x5e176f){const _0x21b9d9=a106_0x3ca8c0;return{..._0x5e176f[_0x21b9d9(0x1cd)]!==undefined&&{'start_at':_0x5e176f[_0x21b9d9(0x1cd)]},..._0x5e176f['timezone']!==undefined&&{'timezone':_0x5e176f[_0x21b9d9(0x1c9)]}};}function normalizeConnectorDef(_0x53240){const _0x2629bc=a106_0x3ca8c0;return{..._0x53240[_0x2629bc(0x1af)]!==undefined&&{'all_columns':_0x53240['all_columns']},..._0x53240[_0x2629bc(0x1e0)]&&{'columns':_0x53240[_0x2629bc(0x1e0)][_0x2629bc(0x1be)](_0x205986=>({'column':_0x205986[_0x2629bc(0x199)],'source':_0x205986[_0x2629bc(0x1b1)]}))}};}function normalizeActivationDef(_0x335172){const _0x1f5af4=a106_0x3ca8c0;return{..._0x335172['enabled']!==undefined&&{'enabled':_0x335172[_0x1f5af4(0x1eb)]},..._0x335172['workflow_project']!==undefined&&{'workflow_project':_0x335172[_0x1f5af4(0x1d1)]},..._0x335172['workflow_name']!==undefined&&{'workflow_name':_0x335172['workflow_name']}};}function normalizeUtmDef(_0x216bd8){const _0x26387f=a106_0x3ca8c0;return{..._0x216bd8[_0x26387f(0x1eb)]!==undefined&&{'enabled':_0x216bd8[_0x26387f(0x1eb)]},..._0x216bd8['id']!==undefined&&{'id':_0x216bd8['id']},..._0x216bd8[_0x26387f(0x1e5)]!==undefined&&{'medium':_0x216bd8['medium']},..._0x216bd8[_0x26387f(0x1b1)]!==undefined&&{'source':_0x216bd8[_0x26387f(0x1b1)]},..._0x216bd8['source_platform']!==undefined&&{'source_platform':_0x216bd8[_0x26387f(0x190)]},..._0x216bd8['campaign']!==undefined&&{'campaign':_0x216bd8[_0x26387f(0x1c0)]},..._0x216bd8[_0x26387f(0x1b2)]!==undefined&&{'marketing_tactic':_0x216bd8['marketing_tactic']}};}function normalizeNotificationsDef(_0x2cea9c){const _0x1b3be8=a106_0x3ca8c0;return{..._0x2cea9c['events']&&{'events':[..._0x2cea9c[_0x1b3be8(0x1b8)]]},..._0x2cea9c[_0x1b3be8(0x181)]&&{'recipients':[..._0x2cea9c['recipients']]}};}export function sanitizeCampaignFileName(_0x1e63f5){const _0x3caa3e=a106_0x3ca8c0;return _0x1e63f5[_0x3caa3e(0x1b3)]()['replace'](/[/\\:*?"<>|]/g,'-')[_0x3caa3e(0x1e1)](/\s+/g,'-')[_0x3caa3e(0x1e1)](/-+/g,'-')['replace'](/^-|-$/g,'');}
1
+ const a106_0x59bad3=a106_0xb2f2;(function(_0x4f6f29,_0xd154d2){const _0x1bc141=a106_0xb2f2,_0x326fde=_0x4f6f29();while(!![]){try{const _0x2f0334=parseInt(_0x1bc141(0x252))/0x1+-parseInt(_0x1bc141(0x201))/0x2*(parseInt(_0x1bc141(0x25d))/0x3)+-parseInt(_0x1bc141(0x1fe))/0x4+parseInt(_0x1bc141(0x228))/0x5*(parseInt(_0x1bc141(0x23f))/0x6)+parseInt(_0x1bc141(0x230))/0x7+parseInt(_0x1bc141(0x211))/0x8+parseInt(_0x1bc141(0x212))/0x9;if(_0x2f0334===_0xd154d2)break;else _0x326fde['push'](_0x326fde['shift']());}catch(_0x563011){_0x326fde['push'](_0x326fde['shift']());}}}(a106_0x302b,0xaa3e1));import*as a106_0x46f932 from'yaml';import{safeParseYaml}from'../segment/yaml-validator.js';import{CampaignDefSchema}from'./types/campaign-def.js';const REF_PREFIX=a106_0x59bad3(0x241);function toRef(_0x3abe53){return''+REF_PREFIX+_0x3abe53;}function isRef(_0x32176d){const _0x4b282b=a106_0x59bad3;return _0x32176d[_0x4b282b(0x21d)](REF_PREFIX);}function parseRef(_0x52951f){if(!isRef(_0x52951f))return _0x52951f;return _0x52951f['slice'](REF_PREFIX['length']);}export function campaignToDef(_0x3555e3,_0x43fd8e){const _0x39ae59=a106_0x59bad3,_0x295b38=_0x3555e3[_0x39ae59(0x220)],_0x29b397=sanitizeCampaignFileName(_0x295b38['name']),_0x5ec408={'type':_0x39ae59(0x256),'name':_0x295b38['name'],'campaign_type':_0x295b38['campaignType'],..._0x295b38[_0x39ae59(0x234)]&&{'description':_0x295b38['description']},..._0x43fd8e[_0x39ae59(0x257)]&&{'workspace':_0x43fd8e[_0x39ae59(0x257)]}};_0x295b38[_0x39ae59(0x223)]&&(_0x5ec408[_0x39ae59(0x210)]=toRef(_0x295b38[_0x39ae59(0x223)]));if(_0x295b38['segmentName']){const _0x1381ef=_0x43fd8e[_0x39ae59(0x25a)]?_0x43fd8e['segmentFolderPath']+'/'+_0x295b38[_0x39ae59(0x215)]:_0x295b38['segmentName'];_0x5ec408[_0x39ae59(0x260)]=toRef(_0x1381ef);}let _0xb79630,_0xb8cfa6;if(_0x295b38[_0x39ae59(0x239)]){const _0x45c3cc={};_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x205)]&&(_0x45c3cc[_0x39ae59(0x219)]=toRef(_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x205)])),_0x295b38['emailContent'][_0x39ae59(0x207)]&&(_0x45c3cc[_0x39ae59(0x232)]=_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x207)]),_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x23a)]&&(_0x45c3cc[_0x39ae59(0x238)]=_0x295b38['emailContent'][_0x39ae59(0x23a)]),_0x295b38['emailContent']['htmlTemplate']&&(_0x45c3cc[_0x39ae59(0x22a)]=_0x29b397+_0x39ae59(0x248),_0xb79630=_0x295b38['emailContent']['htmlTemplate']),_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x1ff)]&&(_0x45c3cc[_0x39ae59(0x1f8)]=_0x29b397+_0x39ae59(0x24d),_0xb8cfa6=_0x295b38['emailContent'][_0x39ae59(0x1ff)]),_0x295b38['emailContent'][_0x39ae59(0x20b)]&&_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x20b)]['length']>0x0&&(_0x45c3cc['variables']=_0x295b38[_0x39ae59(0x239)][_0x39ae59(0x20b)][_0x39ae59(0x1f2)](templateVariableToYaml)),Object[_0x39ae59(0x21b)](_0x45c3cc)['length']>0x0&&(_0x5ec408[_0x39ae59(0x224)]=_0x45c3cc);}if(_0x295b38['pushContent']){const _0x4572fe=pushContentToYaml(_0x295b38[_0x39ae59(0x23c)]);Object[_0x39ae59(0x21b)](_0x4572fe)[_0x39ae59(0x206)]>0x0&&(_0x5ec408[_0x39ae59(0x213)]=_0x4572fe);}if(_0x295b38['startAt']||_0x295b38['timezone']){const _0x20e667={};if(_0x295b38[_0x39ae59(0x216)])_0x20e667[_0x39ae59(0x21a)]=_0x295b38['startAt'];if(_0x295b38['timezone'])_0x20e667['timezone']=_0x295b38[_0x39ae59(0x1f3)];_0x5ec408['schedule']=_0x20e667;}const _0x469ec1=connectorToYaml(_0x295b38);_0x469ec1&&(_0x5ec408['connector']=_0x469ec1);const _0x3a30cd=activationSettingsToYaml(_0x295b38);_0x3a30cd&&(_0x5ec408[_0x39ae59(0x1fb)]=_0x3a30cd);_0x295b38[_0x39ae59(0x225)]&&_0x295b38[_0x39ae59(0x23d)]&&(_0x5ec408[_0x39ae59(0x21f)]=utmToYaml(_0x295b38['utmParameters'],_0x295b38['enableUtmTracking']));if(_0x295b38[_0x39ae59(0x22f)]&&_0x295b38[_0x39ae59(0x22f)][_0x39ae59(0x206)]>0x0||_0x295b38[_0x39ae59(0x203)]&&_0x295b38['emailRecipients'][_0x39ae59(0x206)]>0x0){const _0x37af3a={};if(_0x295b38['notifyOn']&&_0x295b38['notifyOn'][_0x39ae59(0x206)]>0x0)_0x37af3a[_0x39ae59(0x221)]=_0x295b38['notifyOn'];if(_0x295b38[_0x39ae59(0x203)]&&_0x295b38[_0x39ae59(0x203)][_0x39ae59(0x206)]>0x0)_0x37af3a[_0x39ae59(0x200)]=_0x295b38[_0x39ae59(0x203)];_0x5ec408['notifications']=_0x37af3a;}return{'def':_0x5ec408,'htmlContent':_0xb79630,'plaintextContent':_0xb8cfa6};}export async function defToCreateInput(_0x23f036,_0x26b6a9){const _0x1f00d9=a106_0x59bad3,_0x3aaa64={'name':_0x23f036[_0x1f00d9(0x204)],'campaignType':_0x23f036[_0x1f00d9(0x25f)]};_0x23f036[_0x1f00d9(0x22d)]&&(_0x3aaa64[_0x1f00d9(0x1f4)]=await _0x26b6a9[_0x1f00d9(0x21c)](_0x23f036['workspace']));_0x23f036[_0x1f00d9(0x234)]&&(_0x3aaa64[_0x1f00d9(0x234)]=_0x23f036[_0x1f00d9(0x234)]);await resolveSegmentRefs(_0x23f036,_0x3aaa64,_0x26b6a9);_0x23f036[_0x1f00d9(0x224)]&&(_0x3aaa64[_0x1f00d9(0x239)]=await emailDefToApi(_0x23f036['email'],_0x3aaa64[_0x1f00d9(0x1f4)],_0x26b6a9));_0x23f036['push']&&(_0x3aaa64[_0x1f00d9(0x23c)]=pushDefToApi(_0x23f036[_0x1f00d9(0x213)]));_0x23f036[_0x1f00d9(0x246)]&&(_0x3aaa64[_0x1f00d9(0x24c)]=connectorDefToApi(_0x23f036[_0x1f00d9(0x246)]),_0x23f036[_0x1f00d9(0x246)][_0x1f00d9(0x261)]!==undefined&&(_0x3aaa64['allColumns']=_0x23f036[_0x1f00d9(0x246)][_0x1f00d9(0x261)]),_0x23f036[_0x1f00d9(0x246)][_0x1f00d9(0x22e)]&&(_0x3aaa64[_0x1f00d9(0x22e)]=_0x23f036['connector'][_0x1f00d9(0x22e)][_0x1f00d9(0x1f2)](_0x2e4b62=>({'column':_0x2e4b62[_0x1f00d9(0x226)],'source':{'column':_0x2e4b62[_0x1f00d9(0x24f)]}}))));if(_0x23f036[_0x1f00d9(0x243)]){if(_0x23f036[_0x1f00d9(0x243)][_0x1f00d9(0x21a)])_0x3aaa64[_0x1f00d9(0x216)]=_0x23f036[_0x1f00d9(0x243)][_0x1f00d9(0x21a)];if(_0x23f036[_0x1f00d9(0x243)]['timezone'])_0x3aaa64['timezone']=_0x23f036[_0x1f00d9(0x243)]['timezone'];}return _0x23f036[_0x1f00d9(0x21f)]&&(_0x3aaa64[_0x1f00d9(0x225)]=_0x23f036[_0x1f00d9(0x21f)][_0x1f00d9(0x259)]??![]),_0x3aaa64;}export async function defToUpdateInput(_0x191b49,_0x17516b){const _0x395afc=a106_0x59bad3,_0x26aed0={};if(_0x191b49['name'])_0x26aed0[_0x395afc(0x204)]=_0x191b49['name'];if(_0x191b49[_0x395afc(0x234)]!==undefined)_0x26aed0['description']=_0x191b49['description'];await resolveSegmentRefs(_0x191b49,_0x26aed0,_0x17516b);if(_0x191b49['email']){const _0x231d39=_0x191b49[_0x395afc(0x22d)]?await _0x17516b[_0x395afc(0x21c)](_0x191b49[_0x395afc(0x22d)]):undefined;_0x26aed0[_0x395afc(0x239)]=await emailDefToApi(_0x191b49[_0x395afc(0x224)],_0x231d39,_0x17516b);}_0x191b49[_0x395afc(0x213)]&&(_0x26aed0[_0x395afc(0x23c)]=pushDefToApi(_0x191b49[_0x395afc(0x213)]));_0x191b49[_0x395afc(0x246)]&&(_0x26aed0[_0x395afc(0x24c)]=connectorDefToApi(_0x191b49['connector']),_0x191b49['connector']['all_columns']!==undefined&&(_0x26aed0[_0x395afc(0x244)]=_0x191b49[_0x395afc(0x246)][_0x395afc(0x261)]),_0x191b49[_0x395afc(0x246)][_0x395afc(0x22e)]&&(_0x26aed0['columns']=_0x191b49['connector'][_0x395afc(0x22e)]['map'](_0x241bb2=>({'column':_0x241bb2[_0x395afc(0x226)],'source':{'column':_0x241bb2[_0x395afc(0x24f)]}}))));if(_0x191b49[_0x395afc(0x243)]){if(_0x191b49[_0x395afc(0x243)]['start_at'])_0x26aed0[_0x395afc(0x216)]=_0x191b49[_0x395afc(0x243)][_0x395afc(0x21a)];if(_0x191b49[_0x395afc(0x243)][_0x395afc(0x1f3)])_0x26aed0['timezone']=_0x191b49[_0x395afc(0x243)][_0x395afc(0x1f3)];}return _0x191b49[_0x395afc(0x21f)]&&(_0x26aed0[_0x395afc(0x225)]=_0x191b49[_0x395afc(0x21f)][_0x395afc(0x259)]??![]),_0x26aed0;}export function toYamlString(_0x4cd7e7){const _0x42faf8=a106_0x59bad3,_0x47d5f1=JSON[_0x42faf8(0x253)](JSON[_0x42faf8(0x20a)](_0x4cd7e7)),_0x44be67=a106_0x46f932[_0x42faf8(0x20a)](_0x47d5f1,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x42faf8(0x254)}),_0x54b89d=[_0x42faf8(0x229),'email:',_0x42faf8(0x214),_0x42faf8(0x1fc),_0x42faf8(0x255),_0x42faf8(0x258),_0x42faf8(0x251),_0x42faf8(0x240)],_0x5a37ff=_0x44be67[_0x42faf8(0x237)]('\x0a'),_0x55bb7e=[];for(let _0xbfaa6f=0x0;_0xbfaa6f<_0x5a37ff[_0x42faf8(0x206)];_0xbfaa6f++){const _0x7c297c=_0x5a37ff[_0xbfaa6f][_0x42faf8(0x209)]();_0xbfaa6f>0x0&&_0x54b89d['some'](_0x2444ac=>_0x7c297c['startsWith'](_0x2444ac))&&_0x55bb7e[_0x42faf8(0x206)]>0x0&&_0x55bb7e[_0x55bb7e[_0x42faf8(0x206)]-0x1]!==''&&_0x55bb7e[_0x42faf8(0x213)](''),_0x55bb7e[_0x42faf8(0x213)](_0x5a37ff[_0xbfaa6f]);}return _0x55bb7e[_0x42faf8(0x227)]('\x0a');}export function parseYamlString(_0x35ee4c){return safeParseYaml(_0x35ee4c,CampaignDefSchema);}export function normalizeDef(_0x573e37){const _0x39b600=a106_0x59bad3;return{'type':'campaign','name':_0x573e37['name'],'campaign_type':_0x573e37[_0x39b600(0x25f)],..._0x573e37[_0x39b600(0x234)]!==undefined&&{'description':_0x573e37[_0x39b600(0x234)]},..._0x573e37[_0x39b600(0x22d)]!==undefined&&{'workspace':_0x573e37[_0x39b600(0x22d)]},..._0x573e37[_0x39b600(0x210)]!==undefined&&{'audience':_0x573e37['audience']},..._0x573e37['segment']!==undefined&&{'segment':_0x573e37[_0x39b600(0x260)]},..._0x573e37['email']&&{'email':normalizeEmailDef(_0x573e37[_0x39b600(0x224)])},..._0x573e37['push']&&{'push':normalizePushDef(_0x573e37['push'])},..._0x573e37[_0x39b600(0x243)]&&{'schedule':normalizeScheduleDef(_0x573e37[_0x39b600(0x243)])},..._0x573e37[_0x39b600(0x246)]&&{'connector':normalizeConnectorDef(_0x573e37['connector'])},..._0x573e37['activation']&&{'activation':normalizeActivationDef(_0x573e37['activation'])},..._0x573e37[_0x39b600(0x21f)]&&{'utm':normalizeUtmDef(_0x573e37['utm'])},..._0x573e37[_0x39b600(0x22b)]&&{'notifications':normalizeNotificationsDef(_0x573e37['notifications'])}};}function templateVariableToYaml(_0x4e8f6e){const _0x428b39=a106_0x59bad3;return{'name':_0x4e8f6e[_0x428b39(0x204)],..._0x4e8f6e['displayName']&&{'display_name':_0x4e8f6e['displayName']},..._0x4e8f6e['previewValue']&&{'preview_value':_0x4e8f6e['previewValue']},..._0x4e8f6e[_0x428b39(0x24e)]&&{'default_value':_0x4e8f6e['defaultValue']}};}function a106_0x302b(){const _0x45e559=['emailContent','emailSenderId','preview_value','pushContent','utmParameters','activationActionsEnabled','367722sMZgac','notifications:','ref:','on_click_behavior','schedule','allColumns','segmentId','connector','utmSourcePlatform','.html','push_type','image_url','message','connectorConfig','.txt','defaultValue','source','onClickBehavior','utm:','619109csfJRP','parse','null','connector:','campaign','workspaceName','activation:','enabled','segmentFolderPath','utmMedium','utmCampaign','9249TMEWlb','title','campaign_type','segment','all_columns','map','timezone','workspaceId','source_platform','display_name','imageUrl','plaintext_file','marketing_tactic','workflowName','activation','schedule:','pushType','3443860EnxYCj','plaintextTemplate','recipients','814IwkFnj','workflowProjectName','emailRecipients','name','sourceEmailTemplateName','length','subjectTemplate','replace','trimStart','stringify','templateVariables','readFile','utmId','workflow_name','utmSource','audience','6109952lpPIfr','370800QkYheM','push','push:','segmentName','startAt','workflow_project','default_value','template','start_at','keys','resolveWorkspaceId','startsWith','toLowerCase','utm','attributes','events','on_click_behavior_url','audienceName','email','enableUtmTracking','column','join','65uyPzPh','audience:','html_file','notifications','variables','workspace','columns','notifyOn','4145925HTIJcE','utmMarketingTactic','subject','audienceId','description','resolveSegmentPath','resolveTemplateId','split','sender_id'];a106_0x302b=function(){return _0x45e559;};return a106_0x302b();}function pushContentToYaml(_0x362f9d){const _0x1c25f3=a106_0x59bad3;return{..._0x362f9d[_0x1c25f3(0x25e)]&&{'title':_0x362f9d[_0x1c25f3(0x25e)]},..._0x362f9d[_0x1c25f3(0x24b)]&&{'message':_0x362f9d['message']},..._0x362f9d['pushType']&&{'push_type':_0x362f9d[_0x1c25f3(0x1fd)]},..._0x362f9d[_0x1c25f3(0x1f7)]&&{'image_url':_0x362f9d[_0x1c25f3(0x1f7)]},..._0x362f9d['onClickBehavior']&&{'on_click_behavior':_0x362f9d[_0x1c25f3(0x250)]},..._0x362f9d['onClickBehaviorUrl']&&{'on_click_behavior_url':_0x362f9d['onClickBehaviorUrl']}};}function connectorToYaml(_0x3baeb3){const _0xb392c6=a106_0x59bad3,_0x249763=_0x3baeb3['connectionId'],_0x34d1a9=_0x3baeb3['columns']&&_0x3baeb3[_0xb392c6(0x22e)][_0xb392c6(0x206)]>0x0;if(!_0x249763&&!_0x34d1a9&&!_0x3baeb3[_0xb392c6(0x244)])return undefined;const _0x51d855={};return _0x3baeb3['allColumns']!==undefined&&(_0x51d855[_0xb392c6(0x261)]=_0x3baeb3[_0xb392c6(0x244)]),_0x3baeb3[_0xb392c6(0x22e)]&&_0x3baeb3['columns']['length']>0x0&&(_0x51d855[_0xb392c6(0x22e)]=_0x3baeb3['columns'][_0xb392c6(0x1f2)](columnMappingToYaml)),_0x51d855;}function columnMappingToYaml(_0x16e096){const _0xf08683=a106_0x59bad3;return{'column':_0x16e096[_0xf08683(0x226)],'source':_0x16e096[_0xf08683(0x24f)]['column']};}function activationSettingsToYaml(_0x5f1a0b){const _0x2ddae8=a106_0x59bad3;if(!_0x5f1a0b['activationActionsEnabled']&&!_0x5f1a0b[_0x2ddae8(0x202)]&&!_0x5f1a0b[_0x2ddae8(0x1fa)])return undefined;return{..._0x5f1a0b['activationActionsEnabled']!==undefined&&{'enabled':_0x5f1a0b[_0x2ddae8(0x23e)]},..._0x5f1a0b[_0x2ddae8(0x202)]&&{'workflow_project':_0x5f1a0b[_0x2ddae8(0x202)]},..._0x5f1a0b[_0x2ddae8(0x1fa)]&&{'workflow_name':_0x5f1a0b[_0x2ddae8(0x1fa)]}};}function utmToYaml(_0x821cf,_0xf4ff6c){const _0x1810da=a106_0x59bad3;return{'enabled':_0xf4ff6c,..._0x821cf[_0x1810da(0x20d)]&&{'id':_0x821cf['utmId']},..._0x821cf[_0x1810da(0x25b)]&&{'medium':_0x821cf['utmMedium']},..._0x821cf[_0x1810da(0x20f)]&&{'source':_0x821cf[_0x1810da(0x20f)]},..._0x821cf[_0x1810da(0x247)]&&{'source_platform':_0x821cf[_0x1810da(0x247)]},..._0x821cf[_0x1810da(0x25c)]&&{'campaign':_0x821cf[_0x1810da(0x25c)]},..._0x821cf[_0x1810da(0x231)]&&{'marketing_tactic':_0x821cf[_0x1810da(0x231)]}};}function a106_0xb2f2(_0x3824da,_0x4c02d7){_0x3824da=_0x3824da-0x1f2;const _0x302bc1=a106_0x302b();let _0xb2f2d5=_0x302bc1[_0x3824da];return _0xb2f2d5;}async function resolveSegmentRefs(_0x228eae,_0x4af9b6,_0x4a7096){const _0x41fbc5=a106_0x59bad3;if(_0x228eae[_0x41fbc5(0x210)]){const _0x552688=parseRef(_0x228eae[_0x41fbc5(0x210)]),_0x3e230c=_0x228eae[_0x41fbc5(0x260)]?parseRef(_0x228eae['segment']):undefined,_0x2d675a=_0x3e230c?_0x552688+'/'+_0x3e230c:_0x552688,_0x2619fa=await _0x4a7096[_0x41fbc5(0x235)](_0x2d675a);_0x4af9b6['audienceId']=_0x2619fa[_0x41fbc5(0x233)],_0x4af9b6['audienceName']=_0x2619fa['audienceName'],_0x2619fa[_0x41fbc5(0x245)]&&(_0x4af9b6[_0x41fbc5(0x245)]=_0x2619fa[_0x41fbc5(0x245)],_0x4af9b6['segmentName']=_0x2619fa[_0x41fbc5(0x215)]);}}async function emailDefToApi(_0x1712b1,_0x509c98,_0x489b8a){const _0x5230c8=a106_0x59bad3;let _0x45c800='',_0x546a50;if(_0x1712b1[_0x5230c8(0x219)]){const _0x4a62d1=parseRef(_0x1712b1['template']),_0x5c9008=await _0x489b8a[_0x5230c8(0x236)](_0x4a62d1,_0x509c98);_0x45c800=_0x5c9008['id'],_0x546a50=_0x5c9008[_0x5230c8(0x204)];}let _0x506787;_0x1712b1[_0x5230c8(0x22a)]&&(_0x506787=await _0x489b8a[_0x5230c8(0x20c)](_0x1712b1[_0x5230c8(0x22a)]));let _0x17a4fd;return _0x1712b1['plaintext_file']&&(_0x17a4fd=await _0x489b8a[_0x5230c8(0x20c)](_0x1712b1['plaintext_file'])),{'sourceEmailTemplateId':_0x45c800,..._0x546a50&&{'sourceEmailTemplateName':_0x546a50},..._0x1712b1[_0x5230c8(0x232)]&&{'subjectTemplate':_0x1712b1[_0x5230c8(0x232)]},..._0x506787&&{'htmlTemplate':_0x506787},..._0x17a4fd&&{'plaintextTemplate':_0x17a4fd},..._0x1712b1['sender_id']&&{'emailSenderId':_0x1712b1[_0x5230c8(0x238)]}};}function pushDefToApi(_0xc4db24){const _0x41bf9f=a106_0x59bad3;return{..._0xc4db24['title']&&{'title':_0xc4db24[_0x41bf9f(0x25e)]},..._0xc4db24[_0x41bf9f(0x24b)]&&{'message':_0xc4db24[_0x41bf9f(0x24b)]},..._0xc4db24[_0x41bf9f(0x249)]&&{'pushType':_0xc4db24[_0x41bf9f(0x249)]},..._0xc4db24[_0x41bf9f(0x24a)]&&{'imageUrl':_0xc4db24[_0x41bf9f(0x24a)]},..._0xc4db24[_0x41bf9f(0x242)]&&{'onClickBehavior':_0xc4db24[_0x41bf9f(0x242)]},..._0xc4db24[_0x41bf9f(0x222)]&&{'onClickBehaviorUrl':_0xc4db24[_0x41bf9f(0x222)]}};}function connectorDefToApi(_0x1a8e28){return{};}function normalizeEmailDef(_0x2c5dc0){const _0x4ef1b4=a106_0x59bad3;return{..._0x2c5dc0[_0x4ef1b4(0x219)]!==undefined&&{'template':_0x2c5dc0[_0x4ef1b4(0x219)]},..._0x2c5dc0['subject']!==undefined&&{'subject':_0x2c5dc0['subject']},..._0x2c5dc0[_0x4ef1b4(0x22a)]!==undefined&&{'html_file':_0x2c5dc0[_0x4ef1b4(0x22a)]},..._0x2c5dc0[_0x4ef1b4(0x1f8)]!==undefined&&{'plaintext_file':_0x2c5dc0[_0x4ef1b4(0x1f8)]},..._0x2c5dc0[_0x4ef1b4(0x238)]!==undefined&&{'sender_id':_0x2c5dc0['sender_id']},..._0x2c5dc0['variables']&&{'variables':_0x2c5dc0[_0x4ef1b4(0x22c)]['map'](_0x348331=>({'name':_0x348331['name'],..._0x348331[_0x4ef1b4(0x1f6)]!==undefined&&{'display_name':_0x348331[_0x4ef1b4(0x1f6)]},..._0x348331[_0x4ef1b4(0x23b)]!==undefined&&{'preview_value':_0x348331['preview_value']},..._0x348331[_0x4ef1b4(0x218)]!==undefined&&{'default_value':_0x348331[_0x4ef1b4(0x218)]}}))}};}function normalizePushDef(_0x3c3585){const _0x1770f3=a106_0x59bad3;return{..._0x3c3585[_0x1770f3(0x25e)]!==undefined&&{'title':_0x3c3585[_0x1770f3(0x25e)]},..._0x3c3585[_0x1770f3(0x24b)]!==undefined&&{'message':_0x3c3585[_0x1770f3(0x24b)]},..._0x3c3585[_0x1770f3(0x249)]!==undefined&&{'push_type':_0x3c3585[_0x1770f3(0x249)]},..._0x3c3585[_0x1770f3(0x24a)]!==undefined&&{'image_url':_0x3c3585['image_url']},..._0x3c3585[_0x1770f3(0x242)]!==undefined&&{'on_click_behavior':_0x3c3585[_0x1770f3(0x242)]},..._0x3c3585[_0x1770f3(0x222)]!==undefined&&{'on_click_behavior_url':_0x3c3585[_0x1770f3(0x222)]}};}function normalizeScheduleDef(_0x2f9631){const _0x3151ae=a106_0x59bad3;return{..._0x2f9631[_0x3151ae(0x21a)]!==undefined&&{'start_at':_0x2f9631[_0x3151ae(0x21a)]},..._0x2f9631[_0x3151ae(0x1f3)]!==undefined&&{'timezone':_0x2f9631[_0x3151ae(0x1f3)]}};}function normalizeConnectorDef(_0x2213d9){const _0x1c9d3c=a106_0x59bad3;return{..._0x2213d9['all_columns']!==undefined&&{'all_columns':_0x2213d9['all_columns']},..._0x2213d9['columns']&&{'columns':_0x2213d9[_0x1c9d3c(0x22e)]['map'](_0x491530=>({'column':_0x491530[_0x1c9d3c(0x226)],'source':_0x491530[_0x1c9d3c(0x24f)]}))}};}function normalizeActivationDef(_0x51f21d){const _0x5cf5b0=a106_0x59bad3;return{..._0x51f21d[_0x5cf5b0(0x259)]!==undefined&&{'enabled':_0x51f21d[_0x5cf5b0(0x259)]},..._0x51f21d[_0x5cf5b0(0x217)]!==undefined&&{'workflow_project':_0x51f21d[_0x5cf5b0(0x217)]},..._0x51f21d[_0x5cf5b0(0x20e)]!==undefined&&{'workflow_name':_0x51f21d[_0x5cf5b0(0x20e)]}};}function normalizeUtmDef(_0x3dc789){const _0x241aee=a106_0x59bad3;return{..._0x3dc789[_0x241aee(0x259)]!==undefined&&{'enabled':_0x3dc789[_0x241aee(0x259)]},..._0x3dc789['id']!==undefined&&{'id':_0x3dc789['id']},..._0x3dc789['medium']!==undefined&&{'medium':_0x3dc789['medium']},..._0x3dc789[_0x241aee(0x24f)]!==undefined&&{'source':_0x3dc789['source']},..._0x3dc789[_0x241aee(0x1f5)]!==undefined&&{'source_platform':_0x3dc789[_0x241aee(0x1f5)]},..._0x3dc789['campaign']!==undefined&&{'campaign':_0x3dc789[_0x241aee(0x256)]},..._0x3dc789[_0x241aee(0x1f9)]!==undefined&&{'marketing_tactic':_0x3dc789['marketing_tactic']}};}function normalizeNotificationsDef(_0x30e9da){const _0x4f9749=a106_0x59bad3;return{..._0x30e9da[_0x4f9749(0x221)]&&{'events':[..._0x30e9da[_0x4f9749(0x221)]]},..._0x30e9da[_0x4f9749(0x200)]&&{'recipients':[..._0x30e9da[_0x4f9749(0x200)]]}};}export function sanitizeCampaignFileName(_0x3a5da0){const _0x2ae471=a106_0x59bad3;return _0x3a5da0[_0x2ae471(0x21e)]()['replace'](/[/\\:*?"<>|]/g,'-')[_0x2ae471(0x208)](/\s+/g,'-')[_0x2ae471(0x208)](/-+/g,'-')[_0x2ae471(0x208)](/^-|-$/g,'');}
@@ -1 +1 @@
1
- const a107_0x1af1e0=a107_0x579e;(function(_0x31ef12,_0x5dddac){const _0xdcb2f=a107_0x579e,_0x70c63b=_0x31ef12();while(!![]){try{const _0x36350f=parseInt(_0xdcb2f(0xdf))/0x1*(parseInt(_0xdcb2f(0xde))/0x2)+-parseInt(_0xdcb2f(0xed))/0x3+parseInt(_0xdcb2f(0xd9))/0x4+parseInt(_0xdcb2f(0xdc))/0x5+-parseInt(_0xdcb2f(0xe4))/0x6*(parseInt(_0xdcb2f(0xe9))/0x7)+-parseInt(_0xdcb2f(0xef))/0x8*(-parseInt(_0xdcb2f(0xf0))/0x9)+-parseInt(_0xdcb2f(0xf2))/0xa;if(_0x36350f===_0x5dddac)break;else _0x70c63b['push'](_0x70c63b['shift']());}catch(_0xc2e336){_0x70c63b['push'](_0x70c63b['shift']());}}}(a107_0x347a,0x26243));function a107_0x347a(){const _0x3ca8ec=['getTemplateFull','getWorkspace','name','Fetching\x20templates\x20(','170432tOzPie','length','hasChanges','1139930nsbdWD','Fetching\x20templates...','4FINBVb','71401Czlmsl','push','workspaceId','.html','targetDir','40518xwkMem','tdx.json','join','Processing\x20template\x20','update','63LYoKZj','progress','templateName','isNew','341958pugSHq','templates','24KFCXPM','460008ycpgWJ','utf-8','2357420VagpLy','Resolving\x20workspace...','filter'];a107_0x347a=function(){return _0x3ca8ec;};return a107_0x347a();}import a107_0x53893c from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeTemplateFileName,templateToDef,toYamlString,normalizeDef}from'./template-yaml.js';import{createEngageTdxConfigContent}from'../segment/tdx-config.js';const TEMPLATES_DIR=a107_0x1af1e0(0xee),API_PAGE_LIMIT=0x64;export async function pullTemplates(_0x304714,_0x192a84,_0x11e3fe={}){const _0x49d680=a107_0x1af1e0,{engage:_0x3491ff}=_0x304714;_0x11e3fe[_0x49d680(0xea)]?.[_0x49d680(0xe8)](_0x49d680(0xd3));const _0x53a6c7=await _0x3491ff[_0x49d680(0xd6)](_0x192a84),_0x105cd1=_0x53a6c7[_0x49d680(0xd7)],_0x5ce6a7=_0x53a6c7['id'],_0x313f66=_0x11e3fe[_0x49d680(0xe3)]||a107_0x53893c[_0x49d680(0xe6)](process['cwd'](),TEMPLATES_DIR,sanitizeTemplateFileName(_0x105cd1));_0x11e3fe[_0x49d680(0xea)]?.[_0x49d680(0xe8)](_0x49d680(0xdd));const _0x3ef328=await listAllTemplates(_0x3491ff,{'workspaceId':_0x5ce6a7,'progress':_0x11e3fe[_0x49d680(0xea)]});let _0x4d07ed=_0x3ef328;_0x11e3fe[_0x49d680(0xeb)]&&(_0x4d07ed=_0x4d07ed[_0x49d680(0xd4)](_0x4ca5d3=>_0x4ca5d3[_0x49d680(0xd7)]===_0x11e3fe['templateName']));const _0x57320f=[];let _0x3545ef=0x0;for(const _0x8de2f4 of _0x4d07ed){_0x3545ef++,_0x11e3fe[_0x49d680(0xea)]?.[_0x49d680(0xe8)](_0x49d680(0xe7)+_0x3545ef+'/'+_0x4d07ed[_0x49d680(0xda)]+':\x20'+_0x8de2f4[_0x49d680(0xd7)]);const _0xd44a35=await _0x3491ff[_0x49d680(0xd5)](_0x8de2f4['id']),{def:_0x151678,htmlContent:_0x5e2426,plaintextContent:_0x9fa047}=templateToDef(_0xd44a35,{'workspaceName':_0x105cd1}),_0x2b71c4=normalizeDef(_0x151678),_0x4cb159=sanitizeTemplateFileName(_0x2b71c4[_0x49d680(0xd7)]),_0x1b3c5c=toYamlString(_0x2b71c4);_0x57320f[_0x49d680(0xe0)](prepareFile(_0x313f66,_0x4cb159+'.yaml',_0x1b3c5c)),_0x5e2426&&_0x57320f[_0x49d680(0xe0)](prepareFile(_0x313f66,_0x4cb159+_0x49d680(0xe2),_0x5e2426)),_0x9fa047&&_0x57320f[_0x49d680(0xe0)](prepareFile(_0x313f66,_0x4cb159+'.txt',_0x9fa047));}const _0x13f04d=createEngageTdxConfigContent(_0x105cd1);_0x57320f['push'](prepareFile(_0x313f66,_0x49d680(0xe5),_0x13f04d));const _0xfb5ac0=_0x57320f[_0x49d680(0xd4)](_0x1479ab=>_0x1479ab['isNew'])['length'],_0x1fcdd8=_0x57320f['filter'](_0x9d5162=>!_0x9d5162['isNew']&&_0x9d5162['hasChanges'])[_0x49d680(0xda)],_0x21d6c6=_0x57320f[_0x49d680(0xd4)](_0x3cab2b=>!_0x3cab2b[_0x49d680(0xec)]&&!_0x3cab2b[_0x49d680(0xdb)])[_0x49d680(0xda)];return{'workspaceName':_0x105cd1,'workspaceId':_0x5ce6a7,'targetDir':_0x313f66,'files':_0x57320f,'counts':{'templates':_0x4d07ed[_0x49d680(0xda)]},'newFiles':_0xfb5ac0,'changedFiles':_0x1fcdd8,'unchangedFiles':_0x21d6c6};}function prepareFile(_0x53a7e4,_0x1b4661,_0x3329af){const _0x2294bc=a107_0x1af1e0,_0x107162=a107_0x53893c[_0x2294bc(0xe6)](_0x53a7e4,_0x1b4661),_0x1e9f2f=!existsSync(_0x107162);let _0x364a21=_0x1e9f2f,_0x44e571;if(!_0x1e9f2f){const _0x29d721=readFileSync(_0x107162,_0x2294bc(0xf1)),_0x1bfd05=generateDiff(_0x29d721,_0x3329af);_0x364a21=hasChanges(_0x1bfd05),_0x364a21&&(_0x44e571=formatDiffWithColors(_0x1bfd05));}return{'relativePath':_0x1b4661,'absolutePath':_0x107162,'content':_0x3329af,'isNew':_0x1e9f2f,'hasChanges':_0x364a21,'diff':_0x44e571};}function a107_0x579e(_0x1a8812,_0x28149d){_0x1a8812=_0x1a8812-0xd3;const _0x347ac4=a107_0x347a();let _0x579ea8=_0x347ac4[_0x1a8812];return _0x579ea8;}export async function listAllTemplates(_0x49b120,_0x38689d){const _0x475b3f=a107_0x1af1e0,_0x8c6509=[];let _0x2db9b8=0x0;while(!![]){const _0x34398d=await _0x49b120['listTemplates']({'workspaceId':_0x38689d[_0x475b3f(0xe1)],'limit':API_PAGE_LIMIT,'offset':_0x2db9b8});_0x8c6509[_0x475b3f(0xe0)](..._0x34398d);if(_0x34398d['length']<API_PAGE_LIMIT)break;_0x2db9b8+=API_PAGE_LIMIT,_0x38689d[_0x475b3f(0xea)]?.[_0x475b3f(0xe8)](_0x475b3f(0xd8)+_0x8c6509['length']+'\x20so\x20far)...');}return _0x8c6509;}
1
+ (function(_0x462575,_0x34da15){const _0x201dea=a107_0x5597,_0xea7e05=_0x462575();while(!![]){try{const _0x595362=-parseInt(_0x201dea(0x139))/0x1*(parseInt(_0x201dea(0x135))/0x2)+-parseInt(_0x201dea(0x124))/0x3*(-parseInt(_0x201dea(0x144))/0x4)+parseInt(_0x201dea(0x133))/0x5+parseInt(_0x201dea(0x126))/0x6+parseInt(_0x201dea(0x127))/0x7*(parseInt(_0x201dea(0x131))/0x8)+parseInt(_0x201dea(0x132))/0x9*(-parseInt(_0x201dea(0x136))/0xa)+-parseInt(_0x201dea(0x137))/0xb;if(_0x595362===_0x34da15)break;else _0xea7e05['push'](_0xea7e05['shift']());}catch(_0x5db332){_0xea7e05['push'](_0xea7e05['shift']());}}}(a107_0x48e6,0xb1147));import a107_0x368675 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeTemplateFileName,templateToDef,toYamlString,normalizeDef}from'./template-yaml.js';import{createEngageTdxConfigContent}from'../segment/tdx-config.js';const TEMPLATES_DIR='templates',API_PAGE_LIMIT=0x64;function a107_0x5597(_0x5d9903,_0x25aecb){_0x5d9903=_0x5d9903-0x123;const _0x48e625=a107_0x48e6();let _0x5597f7=_0x48e625[_0x5d9903];return _0x5597f7;}export async function pullTemplates(_0x951767,_0x554007,_0x2764fb={}){const _0x3906c4=a107_0x5597,{engage:_0x4dabf6}=_0x951767;_0x2764fb['progress']?.['update'](_0x3906c4(0x141));const _0xcfccf9=await _0x4dabf6['getWorkspace'](_0x554007),_0x48fda9=_0xcfccf9[_0x3906c4(0x129)],_0x43bff3=_0xcfccf9['id'],_0x23c3c8=_0x2764fb[_0x3906c4(0x12b)]||a107_0x368675[_0x3906c4(0x12a)](process['cwd'](),TEMPLATES_DIR,sanitizeTemplateFileName(_0x48fda9));_0x2764fb[_0x3906c4(0x143)]?.['update'](_0x3906c4(0x138));const _0x1d466c=await listAllTemplates(_0x4dabf6,{'workspaceId':_0x43bff3,'progress':_0x2764fb[_0x3906c4(0x143)]});let _0x12f60d=_0x1d466c;_0x2764fb[_0x3906c4(0x12c)]&&(_0x12f60d=_0x12f60d['filter'](_0x3ec585=>_0x3ec585['name']===_0x2764fb[_0x3906c4(0x12c)]));const _0x157d41=[];let _0x4d4d4d=0x0;for(const _0x482b81 of _0x12f60d){_0x4d4d4d++,_0x2764fb[_0x3906c4(0x143)]?.[_0x3906c4(0x13c)](_0x3906c4(0x12e)+_0x4d4d4d+'/'+_0x12f60d[_0x3906c4(0x13d)]+':\x20'+_0x482b81['name']);const _0x1340a9=await _0x4dabf6[_0x3906c4(0x13b)](_0x482b81['id']),{def:_0x4216ca,htmlContent:_0x4e79a0,plaintextContent:_0x293557}=templateToDef(_0x1340a9,{'workspaceName':_0x48fda9}),_0x3bb13f=normalizeDef(_0x4216ca),_0x519ecf=sanitizeTemplateFileName(_0x3bb13f['name']),_0x13ed36=toYamlString(_0x3bb13f);_0x157d41[_0x3906c4(0x123)](prepareFile(_0x23c3c8,_0x519ecf+_0x3906c4(0x125),_0x13ed36)),_0x4e79a0&&_0x157d41[_0x3906c4(0x123)](prepareFile(_0x23c3c8,_0x519ecf+_0x3906c4(0x128),_0x4e79a0)),_0x293557&&_0x157d41[_0x3906c4(0x123)](prepareFile(_0x23c3c8,_0x519ecf+'.txt',_0x293557));}const _0x214003=createEngageTdxConfigContent(_0x48fda9);_0x157d41[_0x3906c4(0x123)](prepareFile(_0x23c3c8,_0x3906c4(0x13a),_0x214003));const _0xc88fdf=_0x157d41[_0x3906c4(0x13e)](_0x22e0a8=>_0x22e0a8[_0x3906c4(0x130)])[_0x3906c4(0x13d)],_0x2bb3a0=_0x157d41['filter'](_0x274f17=>!_0x274f17[_0x3906c4(0x130)]&&_0x274f17[_0x3906c4(0x12f)])['length'],_0x45fa0e=_0x157d41[_0x3906c4(0x13e)](_0x484b1b=>!_0x484b1b['isNew']&&!_0x484b1b[_0x3906c4(0x12f)])[_0x3906c4(0x13d)];return{'workspaceName':_0x48fda9,'workspaceId':_0x43bff3,'targetDir':_0x23c3c8,'files':_0x157d41,'counts':{'templates':_0x12f60d[_0x3906c4(0x13d)]},'newFiles':_0xc88fdf,'changedFiles':_0x2bb3a0,'unchangedFiles':_0x45fa0e};}function prepareFile(_0x5893a0,_0x2b2ed4,_0x19eb20){const _0xc45590=a107_0x5597,_0x44dcaf=a107_0x368675[_0xc45590(0x12a)](_0x5893a0,_0x2b2ed4),_0x4d8351=!existsSync(_0x44dcaf);let _0x344463=_0x4d8351,_0x2e4555;if(!_0x4d8351){const _0x1fe51c=readFileSync(_0x44dcaf,_0xc45590(0x13f)),_0x4ca1c9=generateDiff(_0x1fe51c,_0x19eb20);_0x344463=hasChanges(_0x4ca1c9),_0x344463&&(_0x2e4555=formatDiffWithColors(_0x4ca1c9));}return{'relativePath':_0x2b2ed4,'absolutePath':_0x44dcaf,'content':_0x19eb20,'isNew':_0x4d8351,'hasChanges':_0x344463,'diff':_0x2e4555};}export async function listAllTemplates(_0x5ac80d,_0x2d4806){const _0x85c26a=a107_0x5597,_0xf648dd=[];let _0x50b9fb=0x0;while(!![]){const _0xadf6c3=await _0x5ac80d[_0x85c26a(0x140)]({'workspaceId':_0x2d4806[_0x85c26a(0x142)],'limit':API_PAGE_LIMIT,'offset':_0x50b9fb});_0xf648dd[_0x85c26a(0x123)](..._0xadf6c3);if(_0xadf6c3[_0x85c26a(0x13d)]<API_PAGE_LIMIT)break;_0x50b9fb+=API_PAGE_LIMIT,_0x2d4806[_0x85c26a(0x143)]?.[_0x85c26a(0x13c)](_0x85c26a(0x12d)+_0xf648dd[_0x85c26a(0x13d)]+_0x85c26a(0x134));}return _0xf648dd;}function a107_0x48e6(){const _0x405115=['181OdyhkB','tdx.json','getTemplateFull','update','length','filter','utf-8','listTemplates','Resolving\x20workspace...','workspaceId','progress','52CjGcSh','push','103173PiZslC','.yaml','3621330PuaOmz','9181298nHAecc','.html','name','join','targetDir','templateName','Fetching\x20templates\x20(','Processing\x20template\x20','hasChanges','isNew','8tjQGjw','7155rKJgKY','6902690iGIcns','\x20so\x20far)...','3788RzCoUs','8280CZlxRh','22180367XdAROU','Fetching\x20templates...'];a107_0x48e6=function(){return _0x405115;};return a107_0x48e6();}
@@ -1 +1 @@
1
- (function(_0x14259c,_0x4a4b45){const _0x441539=a108_0x7546,_0x21f03e=_0x14259c();while(!![]){try{const _0xd02bcc=parseInt(_0x441539(0x1ce))/0x1*(parseInt(_0x441539(0x1d1))/0x2)+-parseInt(_0x441539(0x1c7))/0x3+parseInt(_0x441539(0x1e9))/0x4+-parseInt(_0x441539(0x1d5))/0x5+parseInt(_0x441539(0x1cd))/0x6+parseInt(_0x441539(0x1d7))/0x7*(parseInt(_0x441539(0x1e5))/0x8)+parseInt(_0x441539(0x1cb))/0x9*(-parseInt(_0x441539(0x1e3))/0xa);if(_0xd02bcc===_0x4a4b45)break;else _0x21f03e['push'](_0x21f03e['shift']());}catch(_0x1d279c){_0x21f03e['push'](_0x21f03e['shift']());}}}(a108_0x1b1b,0x22c86));function a108_0x1b1b(){const _0x3f659e=['32vbrmkv','resolveWorkspaceId','updateTemplate','created','961384LnlXbP','length','join','relative','createTemplate','utf-8','workspaceId','603606nuoGok','progress','Fetching\x20existing\x20templates...','results','550413mYcjBd','template','1012482rZiljf','2ZQTFOJ','push','action','2694wuxnSw','get','updateInput','type','1350530sKEXTQ','existingId','460509akewLB','createInput','dirname','engage','updated','Pushing\x20','create','name','update','dir','message','fileDir','10EKIOAN','def'];a108_0x1b1b=function(){return _0x3f659e;};return a108_0x1b1b();}import a108_0x37fc07 from'path';import{readFileSync}from'fs';import{parseYamlString,defToCreateInput,defToUpdateInput}from'./template-yaml.js';import{findYamlFiles}from'../segment/file-discovery.js';import{listAllTemplates}from'./template-pull.js';export function discoverAndParseTemplateFiles(_0x4bb5f4){const _0x352e1d=a108_0x7546,_0x44dc03=findYamlFiles(_0x4bb5f4),_0x347809=[];for(const _0x100f69 of _0x44dc03){try{const _0x104023=readFileSync(_0x100f69,_0x352e1d(0x1c5)),_0x15ff28=parseYamlString(_0x104023);_0x15ff28[_0x352e1d(0x1d4)]===_0x352e1d(0x1cc)&&_0x347809[_0x352e1d(0x1cf)]({'yamlPath':_0x100f69,'relativePath':a108_0x37fc07[_0x352e1d(0x1c3)](_0x4bb5f4,_0x100f69),'def':_0x15ff28,'dir':a108_0x37fc07['dirname'](_0x100f69)});}catch{}}return _0x347809;}export function parseTemplateFile(_0x749f2c,_0x2c0197){const _0x2d843e=a108_0x7546,_0x3011b8=readFileSync(_0x749f2c,_0x2d843e(0x1c5)),_0x268efd=parseYamlString(_0x3011b8),_0x5bd0a4=a108_0x37fc07[_0x2d843e(0x1c3)](_0x2c0197,_0x749f2c),_0x3ff04b=a108_0x37fc07[_0x2d843e(0x1d9)](_0x749f2c);return{'yamlPath':_0x749f2c,'relativePath':_0x5bd0a4,'def':_0x268efd,'dir':_0x3ff04b};}export async function preparePush(_0x57acb7,_0x2b13d1,_0x571dac,_0x437ad6={}){const _0x23236b=a108_0x7546,{engage:_0xfdcc28}=_0x57acb7;_0x437ad6[_0x23236b(0x1c8)]?.[_0x23236b(0x1df)](_0x23236b(0x1c9));const _0x48107f=await listAllTemplates(_0xfdcc28,{'workspaceId':_0x571dac}),_0x1e7e63=new Map();for(const _0x34de1c of _0x48107f){_0x1e7e63['set'](_0x34de1c[_0x23236b(0x1de)],_0x34de1c);}const _0xd5b960=[];for(const _0x35685e of _0x2b13d1){const _0x5d4f28=_0x1e7e63[_0x23236b(0x1d2)](_0x35685e[_0x23236b(0x1e4)][_0x23236b(0x1de)]);_0xd5b960[_0x23236b(0x1cf)]({'def':_0x35685e[_0x23236b(0x1e4)],'fileDir':_0x35685e[_0x23236b(0x1e0)],'action':_0x5d4f28?_0x23236b(0x1df):_0x23236b(0x1dd),'existingId':_0x5d4f28?.['id']});}return _0xd5b960;}export async function resolveAndBuildInputs(_0x250c5f,_0x538d14,_0x4184b9,_0x386eac={}){const _0x1806ae=a108_0x7546;for(let _0x3bc5cd=0x0;_0x3bc5cd<_0x538d14[_0x1806ae(0x1c1)];_0x3bc5cd++){const _0x28ae5c=_0x538d14[_0x3bc5cd];_0x386eac[_0x1806ae(0x1c8)]?.[_0x1806ae(0x1df)]('Resolving\x20references\x20'+(_0x3bc5cd+0x1)+'/'+_0x538d14[_0x1806ae(0x1c1)]+':\x20'+_0x28ae5c[_0x1806ae(0x1e4)][_0x1806ae(0x1de)]);const _0x5f4b0d=createResolveContext(_0x250c5f,_0x4184b9,_0x28ae5c[_0x1806ae(0x1e2)]);_0x28ae5c[_0x1806ae(0x1d0)]===_0x1806ae(0x1dd)?(_0x28ae5c[_0x1806ae(0x1d8)]=await defToCreateInput(_0x28ae5c[_0x1806ae(0x1e4)],_0x5f4b0d),!_0x28ae5c[_0x1806ae(0x1d8)][_0x1806ae(0x1c6)]&&(_0x28ae5c[_0x1806ae(0x1d8)][_0x1806ae(0x1c6)]=_0x4184b9)):_0x28ae5c[_0x1806ae(0x1d3)]=await defToUpdateInput(_0x28ae5c[_0x1806ae(0x1e4)],_0x5f4b0d);}}function a108_0x7546(_0x227c0f,_0x284f48){_0x227c0f=_0x227c0f-0x1c1;const _0x1b1b51=a108_0x1b1b();let _0x7546a1=_0x1b1b51[_0x227c0f];return _0x7546a1;}export async function executePush(_0x2b486c,_0x60822a,_0x256bb7={}){const _0xfe3e7f=a108_0x7546,_0x2af363={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x256bb7['dryRun']){for(const _0x5920c5 of _0x60822a){_0x5920c5[_0xfe3e7f(0x1d0)]==='create'?(_0x2af363[_0xfe3e7f(0x1ca)][_0xfe3e7f(0x1cf)]({'name':_0x5920c5[_0xfe3e7f(0x1e4)][_0xfe3e7f(0x1de)],'action':'created'}),_0x2af363[_0xfe3e7f(0x1e8)]++):(_0x2af363['results'][_0xfe3e7f(0x1cf)]({'name':_0x5920c5[_0xfe3e7f(0x1e4)][_0xfe3e7f(0x1de)],'action':_0xfe3e7f(0x1db)}),_0x2af363[_0xfe3e7f(0x1db)]++);}return _0x2af363;}const {engage:_0x3e881d}=_0x2b486c;for(let _0x4d493d=0x0;_0x4d493d<_0x60822a['length'];_0x4d493d++){const _0x297edf=_0x60822a[_0x4d493d];_0x256bb7['progress']?.[_0xfe3e7f(0x1df)](_0xfe3e7f(0x1dc)+(_0x4d493d+0x1)+'/'+_0x60822a[_0xfe3e7f(0x1c1)]+':\x20'+_0x297edf['def'][_0xfe3e7f(0x1de)]);try{if(_0x297edf[_0xfe3e7f(0x1d0)]===_0xfe3e7f(0x1dd)&&_0x297edf[_0xfe3e7f(0x1d8)]){const _0x5644c5=await _0x3e881d[_0xfe3e7f(0x1c4)](_0x297edf[_0xfe3e7f(0x1d8)]);_0x2af363[_0xfe3e7f(0x1ca)]['push']({'name':_0x297edf[_0xfe3e7f(0x1e4)][_0xfe3e7f(0x1de)],'action':_0xfe3e7f(0x1e8),'templateId':_0x5644c5['id']}),_0x2af363['created']++;}else{if(_0x297edf[_0xfe3e7f(0x1d0)]===_0xfe3e7f(0x1df)&&_0x297edf[_0xfe3e7f(0x1d3)]&&_0x297edf[_0xfe3e7f(0x1d6)]){const _0x4d37c1=await _0x3e881d[_0xfe3e7f(0x1e7)](_0x297edf[_0xfe3e7f(0x1d6)],_0x297edf[_0xfe3e7f(0x1d3)]);_0x2af363['results'][_0xfe3e7f(0x1cf)]({'name':_0x297edf[_0xfe3e7f(0x1e4)][_0xfe3e7f(0x1de)],'action':_0xfe3e7f(0x1db),'templateId':_0x4d37c1['id']}),_0x2af363[_0xfe3e7f(0x1db)]++;}}}catch(_0x7e8354){const _0x2b6ba0=_0x7e8354 instanceof Error?_0x7e8354[_0xfe3e7f(0x1e1)]:String(_0x7e8354);_0x2af363['errors']['push']({'name':_0x297edf[_0xfe3e7f(0x1e4)][_0xfe3e7f(0x1de)],'error':_0x2b6ba0});}}return _0x2af363;}function createResolveContext(_0x2940c7,_0x51c5ef,_0x3a877e){return{'resolveWorkspaceId':async _0x50cd47=>{const _0x82a11d=a108_0x7546;return await _0x2940c7[_0x82a11d(0x1da)][_0x82a11d(0x1e6)](_0x50cd47);},'readFile':async _0x259b3c=>{const _0x1fe2c3=a108_0x7546,_0x5f2da9=a108_0x37fc07[_0x1fe2c3(0x1c2)](_0x3a877e,_0x259b3c);return readFileSync(_0x5f2da9,'utf-8');}};}
1
+ (function(_0x30cf0a,_0x3917e3){const _0x48d624=a108_0x4468,_0x5ea5d7=_0x30cf0a();while(!![]){try{const _0x11a211=parseInt(_0x48d624(0xa9))/0x1*(parseInt(_0x48d624(0x9b))/0x2)+parseInt(_0x48d624(0xb5))/0x3*(-parseInt(_0x48d624(0x94))/0x4)+parseInt(_0x48d624(0xb9))/0x5*(parseInt(_0x48d624(0xab))/0x6)+-parseInt(_0x48d624(0xbb))/0x7+-parseInt(_0x48d624(0xaa))/0x8*(-parseInt(_0x48d624(0x9d))/0x9)+parseInt(_0x48d624(0x9e))/0xa+-parseInt(_0x48d624(0xad))/0xb;if(_0x11a211===_0x3917e3)break;else _0x5ea5d7['push'](_0x5ea5d7['shift']());}catch(_0x2a91ba){_0x5ea5d7['push'](_0x5ea5d7['shift']());}}}(a108_0x49b2,0x63785));import a108_0x3aef39 from'path';function a108_0x4468(_0x48a5c8,_0x1c83f5){_0x48a5c8=_0x48a5c8-0x93;const _0x49b264=a108_0x49b2();let _0x44689b=_0x49b264[_0x48a5c8];return _0x44689b;}import{readFileSync}from'fs';import{parseYamlString,defToCreateInput,defToUpdateInput}from'./template-yaml.js';import{findYamlFiles}from'../segment/file-discovery.js';import{listAllTemplates}from'./template-pull.js';export function discoverAndParseTemplateFiles(_0x4e594c){const _0x51124a=a108_0x4468,_0x4eccf2=findYamlFiles(_0x4e594c),_0x2749cb=[];for(const _0x95365d of _0x4eccf2){try{const _0x5738bb=readFileSync(_0x95365d,_0x51124a(0x98)),_0x435612=parseYamlString(_0x5738bb);_0x435612[_0x51124a(0x9f)]==='template'&&_0x2749cb[_0x51124a(0xaf)]({'yamlPath':_0x95365d,'relativePath':a108_0x3aef39[_0x51124a(0xa5)](_0x4e594c,_0x95365d),'def':_0x435612,'dir':a108_0x3aef39[_0x51124a(0xa7)](_0x95365d)});}catch{}}return _0x2749cb;}function a108_0x49b2(){const _0x3fb074=['dirname','def','60493RoUNFY','8lzOBmY','6eSyiAT','errors','7479703ljWBVA','results','push','created','name','fileDir','resolveWorkspaceId','workspaceId','921hStCtq','updateInput','set','create','2592985DadxPv','progress','1081360MUUGUI','createInput','createTemplate','6628yQHKfC','engage','action','join','utf-8','updated','get','14NDgEcH','length','2641887BJjmup','5149900DlbACa','type','Fetching\x20existing\x20templates...','update','Resolving\x20references\x20','existingId','dryRun','relative','updateTemplate'];a108_0x49b2=function(){return _0x3fb074;};return a108_0x49b2();}export function parseTemplateFile(_0x5274a4,_0x430cac){const _0x13f187=a108_0x4468,_0x4e1cc8=readFileSync(_0x5274a4,_0x13f187(0x98)),_0x1222b2=parseYamlString(_0x4e1cc8),_0x42ec68=a108_0x3aef39['relative'](_0x430cac,_0x5274a4),_0x57c675=a108_0x3aef39[_0x13f187(0xa7)](_0x5274a4);return{'yamlPath':_0x5274a4,'relativePath':_0x42ec68,'def':_0x1222b2,'dir':_0x57c675};}export async function preparePush(_0x4438dd,_0x406d61,_0x405c17,_0x4d4f38={}){const _0x5e6298=a108_0x4468,{engage:_0x50b27e}=_0x4438dd;_0x4d4f38[_0x5e6298(0xba)]?.[_0x5e6298(0xa1)](_0x5e6298(0xa0));const _0x44c989=await listAllTemplates(_0x50b27e,{'workspaceId':_0x405c17}),_0x28cf0f=new Map();for(const _0x551dc9 of _0x44c989){_0x28cf0f[_0x5e6298(0xb7)](_0x551dc9['name'],_0x551dc9);}const _0x32e867=[];for(const _0x5261eb of _0x406d61){const _0x422d77=_0x28cf0f[_0x5e6298(0x9a)](_0x5261eb[_0x5e6298(0xa8)][_0x5e6298(0xb1)]);_0x32e867[_0x5e6298(0xaf)]({'def':_0x5261eb[_0x5e6298(0xa8)],'fileDir':_0x5261eb['dir'],'action':_0x422d77?_0x5e6298(0xa1):_0x5e6298(0xb8),'existingId':_0x422d77?.['id']});}return _0x32e867;}export async function resolveAndBuildInputs(_0x41f48e,_0x283d01,_0x3f6dbf,_0x28572f={}){const _0x40e7d9=a108_0x4468;for(let _0x3c8847=0x0;_0x3c8847<_0x283d01[_0x40e7d9(0x9c)];_0x3c8847++){const _0x5b3fe1=_0x283d01[_0x3c8847];_0x28572f[_0x40e7d9(0xba)]?.[_0x40e7d9(0xa1)](_0x40e7d9(0xa2)+(_0x3c8847+0x1)+'/'+_0x283d01[_0x40e7d9(0x9c)]+':\x20'+_0x5b3fe1['def'][_0x40e7d9(0xb1)]);const _0x673c98=createResolveContext(_0x41f48e,_0x3f6dbf,_0x5b3fe1[_0x40e7d9(0xb2)]);_0x5b3fe1[_0x40e7d9(0x96)]===_0x40e7d9(0xb8)?(_0x5b3fe1['createInput']=await defToCreateInput(_0x5b3fe1['def'],_0x673c98),!_0x5b3fe1[_0x40e7d9(0xbc)][_0x40e7d9(0xb4)]&&(_0x5b3fe1[_0x40e7d9(0xbc)][_0x40e7d9(0xb4)]=_0x3f6dbf)):_0x5b3fe1[_0x40e7d9(0xb6)]=await defToUpdateInput(_0x5b3fe1[_0x40e7d9(0xa8)],_0x673c98);}}export async function executePush(_0x158a71,_0x2cb967,_0x59fc8a={}){const _0x3b9bed=a108_0x4468,_0x4c11af={'results':[],'created':0x0,'updated':0x0,'unchanged':0x0,'errors':[]};if(_0x59fc8a[_0x3b9bed(0xa4)]){for(const _0x5823fb of _0x2cb967){_0x5823fb[_0x3b9bed(0x96)]===_0x3b9bed(0xb8)?(_0x4c11af['results'][_0x3b9bed(0xaf)]({'name':_0x5823fb[_0x3b9bed(0xa8)][_0x3b9bed(0xb1)],'action':'created'}),_0x4c11af[_0x3b9bed(0xb0)]++):(_0x4c11af['results'][_0x3b9bed(0xaf)]({'name':_0x5823fb[_0x3b9bed(0xa8)]['name'],'action':_0x3b9bed(0x99)}),_0x4c11af[_0x3b9bed(0x99)]++);}return _0x4c11af;}const {engage:_0x141a91}=_0x158a71;for(let _0x5eee57=0x0;_0x5eee57<_0x2cb967['length'];_0x5eee57++){const _0x24e27b=_0x2cb967[_0x5eee57];_0x59fc8a[_0x3b9bed(0xba)]?.['update']('Pushing\x20'+(_0x5eee57+0x1)+'/'+_0x2cb967[_0x3b9bed(0x9c)]+':\x20'+_0x24e27b[_0x3b9bed(0xa8)][_0x3b9bed(0xb1)]);try{if(_0x24e27b[_0x3b9bed(0x96)]===_0x3b9bed(0xb8)&&_0x24e27b[_0x3b9bed(0xbc)]){const _0x1ba618=await _0x141a91[_0x3b9bed(0x93)](_0x24e27b[_0x3b9bed(0xbc)]);_0x4c11af['results'][_0x3b9bed(0xaf)]({'name':_0x24e27b[_0x3b9bed(0xa8)][_0x3b9bed(0xb1)],'action':_0x3b9bed(0xb0),'templateId':_0x1ba618['id']}),_0x4c11af[_0x3b9bed(0xb0)]++;}else{if(_0x24e27b[_0x3b9bed(0x96)]===_0x3b9bed(0xa1)&&_0x24e27b[_0x3b9bed(0xb6)]&&_0x24e27b[_0x3b9bed(0xa3)]){const _0x57d6ec=await _0x141a91[_0x3b9bed(0xa6)](_0x24e27b[_0x3b9bed(0xa3)],_0x24e27b[_0x3b9bed(0xb6)]);_0x4c11af[_0x3b9bed(0xae)][_0x3b9bed(0xaf)]({'name':_0x24e27b[_0x3b9bed(0xa8)][_0x3b9bed(0xb1)],'action':_0x3b9bed(0x99),'templateId':_0x57d6ec['id']}),_0x4c11af[_0x3b9bed(0x99)]++;}}}catch(_0x14a8d2){const _0x59a5af=_0x14a8d2 instanceof Error?_0x14a8d2['message']:String(_0x14a8d2);_0x4c11af[_0x3b9bed(0xac)][_0x3b9bed(0xaf)]({'name':_0x24e27b[_0x3b9bed(0xa8)][_0x3b9bed(0xb1)],'error':_0x59a5af});}}return _0x4c11af;}function createResolveContext(_0x20ce5e,_0x1af42c,_0x3cd42e){return{'resolveWorkspaceId':async _0xd8a6a3=>{const _0x32fe4a=a108_0x4468;return await _0x20ce5e[_0x32fe4a(0x95)][_0x32fe4a(0xb3)](_0xd8a6a3);},'readFile':async _0x313c7c=>{const _0x4a85f9=a108_0x4468,_0x282a98=a108_0x3aef39[_0x4a85f9(0x97)](_0x3cd42e,_0x313c7c);return readFileSync(_0x282a98,_0x4a85f9(0x98));}};}
@@ -1 +1 @@
1
- (function(_0xbc4a3a,_0x3deac0){const _0x49e0df=a109_0x3a82,_0x2ae9c8=_0xbc4a3a();while(!![]){try{const _0xaa6d9=-parseInt(_0x49e0df(0xf7))/0x1*(parseInt(_0x49e0df(0xf3))/0x2)+parseInt(_0x49e0df(0xed))/0x3+-parseInt(_0x49e0df(0xdd))/0x4*(parseInt(_0x49e0df(0xdc))/0x5)+parseInt(_0x49e0df(0xee))/0x6+-parseInt(_0x49e0df(0xf9))/0x7+-parseInt(_0x49e0df(0xe5))/0x8+-parseInt(_0x49e0df(0xf5))/0x9*(-parseInt(_0x49e0df(0xd2))/0xa);if(_0xaa6d9===_0x3deac0)break;else _0x2ae9c8['push'](_0x2ae9c8['shift']());}catch(_0x65fd1a){_0x2ae9c8['push'](_0x2ae9c8['shift']());}}}(a109_0x554d,0xbcb6b));import{TemplateDefSchema}from'./types/template-schema.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';function a109_0x3a82(_0x49bcc4,_0x5a548b){_0x49bcc4=_0x49bcc4-0xd1;const _0x554d0b=a109_0x554d();let _0x3a8221=_0x554d0b[_0x49bcc4];return _0x3a8221;}export function validateTemplateDef(_0x38adf6,_0x51caca={}){const _0x52614f=a109_0x3a82,_0x1e74c2=TemplateDefSchema[_0x52614f(0xe3)](_0x38adf6);if(_0x1e74c2['success']){const _0x28457e=runSemanticChecks(_0x1e74c2[_0x52614f(0xe6)],_0x51caca),_0x5343cb=_0x28457e['filter'](_0x64976f=>_0x64976f[_0x52614f(0xeb)]===_0x52614f(0xd1)),_0x38ac2e=_0x28457e['filter'](_0xc1db94=>_0xc1db94[_0x52614f(0xeb)]===_0x52614f(0xd3));return{'valid':_0x5343cb[_0x52614f(0xd4)]===0x0,'errors':_0x5343cb,'warnings':_0x38ac2e};}return zodErrorsToValidationResult(_0x1e74c2[_0x52614f(0xd1)],_0x51caca);}function a109_0x554d(){const _0x58e039=['message','subject','workspace','TEMPLATE_MISSING_NAME','startsWith','push','TEMPLATE_MISSING_SUBJECT','1187410FqhAhS','8egHpDj','path','html_file','issues','Variable\x20name\x20\x22','No\x20workspace\x20specified\x20—\x20template\x20will\x20use\x20workspace\x20from\x20context\x20or\x20CLI\x20option','safeParse','Template\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','11097840fkBOnU','data','symbol','TEMPLATE_INVALID_VARIABLES','TEMPLATE_INVALID_TYPE','test','level','variables','3445560HEeOna','3929748MPifxj','].name','TEMPLATE_MISSING_HTML_FILE','document','type','1469886dOOzxh','source','36dzboHk','TEMPLATE_MISSING_WORKSPACE','2AfIHTH','name','1522465uEXVvY','map','error','6297670kTHjIB','warning','length'];a109_0x554d=function(){return _0x58e039;};return a109_0x554d();}function zodErrorsToValidationResult(_0x284544,_0x5e6561){const _0x5ec67f=a109_0x3a82,_0x14b7a9=_0x284544[_0x5ec67f(0xe0)][_0x5ec67f(0xfa)](_0x1df390=>{const _0x34ff08=_0x5ec67f,_0x23b85d=formatZodPath(_0x1df390[_0x34ff08(0xde)]),_0x5918f1=mapZodIssueToCode(_0x1df390,_0x23b85d),_0x3cf5d4=getLocationFromPath(_0x5e6561[_0x34ff08(0xf1)],_0x5e6561['source'],_0x1df390[_0x34ff08(0xde)][_0x34ff08(0xfa)](_0x23ec92=>typeof _0x23ec92===_0x34ff08(0xe7)?String(_0x23ec92):_0x23ec92));return{'level':_0x34ff08(0xd1),'path':_0x23b85d,'code':_0x5918f1,'message':_0x1df390[_0x34ff08(0xd5)],..._0x3cf5d4&&{'location':_0x3cf5d4}};});return{'valid':![],'errors':_0x14b7a9,'warnings':[]};}function mapZodIssueToCode(_0x50ab12,_0x210e5d){const _0x1182bb=a109_0x3a82;if(_0x210e5d==='name')return _0x1182bb(0xd8);if(_0x210e5d===_0x1182bb(0xf2))return _0x1182bb(0xe9);if(_0x210e5d===_0x1182bb(0xec)||_0x210e5d[_0x1182bb(0xd9)](_0x1182bb(0xec)))return _0x1182bb(0xe8);return'TEMPLATE_SCHEMA_ERROR';}function runSemanticChecks(_0x36bf41,_0x125500){const _0x5ea091=a109_0x3a82,_0x6be3c2=[];!_0x36bf41[_0x5ea091(0xdf)]&&_0x6be3c2[_0x5ea091(0xda)]({'level':_0x5ea091(0xd1),'path':_0x5ea091(0xdf),'code':_0x5ea091(0xf0),'message':_0x5ea091(0xe4),'location':getLocationFromPath(_0x125500[_0x5ea091(0xf1)],_0x125500[_0x5ea091(0xf4)],[_0x5ea091(0xf8)])});!_0x36bf41[_0x5ea091(0xd6)]&&_0x6be3c2[_0x5ea091(0xda)]({'level':_0x5ea091(0xd1),'path':_0x5ea091(0xd6),'code':_0x5ea091(0xdb),'message':'Template\x20requires\x20subject\x20—\x20email\x20subject\x20line\x20template','location':getLocationFromPath(_0x125500[_0x5ea091(0xf1)],_0x125500['source'],[_0x5ea091(0xf8)])});!_0x36bf41[_0x5ea091(0xd7)]&&_0x6be3c2[_0x5ea091(0xda)]({'level':_0x5ea091(0xd3),'path':'workspace','code':_0x5ea091(0xf6),'message':_0x5ea091(0xe2),'location':getLocationFromPath(_0x125500[_0x5ea091(0xf1)],_0x125500[_0x5ea091(0xf4)],['name'])});for(let _0x529438=0x0;_0x529438<_0x36bf41[_0x5ea091(0xec)]['length'];_0x529438++){const _0x64132e=_0x36bf41[_0x5ea091(0xec)][_0x529438];/\s/[_0x5ea091(0xea)](_0x64132e[_0x5ea091(0xf8)])&&_0x6be3c2[_0x5ea091(0xda)]({'level':'error','path':'variables['+_0x529438+_0x5ea091(0xef),'code':'TEMPLATE_INVALID_VARIABLE_NAME','message':_0x5ea091(0xe1)+_0x64132e['name']+'\x22\x20must\x20not\x20contain\x20whitespace','location':getLocationFromPath(_0x125500[_0x5ea091(0xf1)],_0x125500[_0x5ea091(0xf4)],[_0x5ea091(0xec),_0x529438,'name'])});}return _0x6be3c2;}
1
+ function a109_0x20f9(_0x274444,_0x5a7046){_0x274444=_0x274444-0x1c3;const _0x369d1b=a109_0x369d();let _0x20f9c8=_0x369d1b[_0x274444];return _0x20f9c8;}(function(_0x279805,_0x55e16c){const _0x19cf1e=a109_0x20f9,_0x30eea0=_0x279805();while(!![]){try{const _0x32b8f2=-parseInt(_0x19cf1e(0x1e0))/0x1*(-parseInt(_0x19cf1e(0x1e3))/0x2)+-parseInt(_0x19cf1e(0x1d3))/0x3*(parseInt(_0x19cf1e(0x1dc))/0x4)+parseInt(_0x19cf1e(0x1ce))/0x5+parseInt(_0x19cf1e(0x1e1))/0x6+parseInt(_0x19cf1e(0x1ec))/0x7+-parseInt(_0x19cf1e(0x1db))/0x8*(-parseInt(_0x19cf1e(0x1d4))/0x9)+-parseInt(_0x19cf1e(0x1d0))/0xa;if(_0x32b8f2===_0x55e16c)break;else _0x30eea0['push'](_0x30eea0['shift']());}catch(_0x33d7b7){_0x30eea0['push'](_0x30eea0['shift']());}}}(a109_0x369d,0x9fde5));import{TemplateDefSchema}from'./types/template-schema.js';import{formatZodPath,getLocationFromPath}from'../segment/yaml-validator.js';export function validateTemplateDef(_0xb9b81,_0x477d7e={}){const _0xf8ffbe=a109_0x20f9,_0x16e1d3=TemplateDefSchema['safeParse'](_0xb9b81);if(_0x16e1d3[_0xf8ffbe(0x1cb)]){const _0x2a3903=runSemanticChecks(_0x16e1d3[_0xf8ffbe(0x1dd)],_0x477d7e),_0x334444=_0x2a3903[_0xf8ffbe(0x1d5)](_0x5aafdf=>_0x5aafdf[_0xf8ffbe(0x1eb)]===_0xf8ffbe(0x1d7)),_0x2a941b=_0x2a3903[_0xf8ffbe(0x1d5)](_0xedab48=>_0xedab48[_0xf8ffbe(0x1eb)]===_0xf8ffbe(0x1e9));return{'valid':_0x334444['length']===0x0,'errors':_0x334444,'warnings':_0x2a941b};}return zodErrorsToValidationResult(_0x16e1d3[_0xf8ffbe(0x1d7)],_0x477d7e);}function a109_0x369d(){const _0x11ceae=['Variable\x20name\x20\x22','1597636XQoduy','path','test','TEMPLATE_INVALID_TYPE','].name','TEMPLATE_SCHEMA_ERROR','warning','Template\x20requires\x20html_file\x20—\x20path\x20to\x20the\x20HTML\x20file\x20for\x20email\x20content','level','1382171OfKNfR','variables','length','\x22\x20must\x20not\x20contain\x20whitespace','document','TEMPLATE_INVALID_VARIABLE_NAME','TEMPLATE_MISSING_WORKSPACE','issues','html_file','success','TEMPLATE_MISSING_SUBJECT','workspace','5502920QKDpJQ','source','24980270aloWCe','message','subject','162tTmYpS','243eWnTOA','filter','No\x20workspace\x20specified\x20—\x20template\x20will\x20use\x20workspace\x20from\x20context\x20or\x20CLI\x20option','error','startsWith','name','map','312824xYpnDm','72840rYgQbU','data','symbol','push','1mwmHLv','5901312RNxLwB'];a109_0x369d=function(){return _0x11ceae;};return a109_0x369d();}function zodErrorsToValidationResult(_0x12a2c5,_0x3d262d){const _0x18a942=a109_0x20f9,_0x585d4a=_0x12a2c5[_0x18a942(0x1c9)][_0x18a942(0x1da)](_0x91b94d=>{const _0x2f03e7=_0x18a942,_0x5cef04=formatZodPath(_0x91b94d[_0x2f03e7(0x1e4)]),_0x9ee78e=mapZodIssueToCode(_0x91b94d,_0x5cef04),_0x341cb8=getLocationFromPath(_0x3d262d[_0x2f03e7(0x1c6)],_0x3d262d[_0x2f03e7(0x1cf)],_0x91b94d[_0x2f03e7(0x1e4)][_0x2f03e7(0x1da)](_0x4af9e7=>typeof _0x4af9e7===_0x2f03e7(0x1de)?String(_0x4af9e7):_0x4af9e7));return{'level':'error','path':_0x5cef04,'code':_0x9ee78e,'message':_0x91b94d[_0x2f03e7(0x1d1)],..._0x341cb8&&{'location':_0x341cb8}};});return{'valid':![],'errors':_0x585d4a,'warnings':[]};}function mapZodIssueToCode(_0x21f1ec,_0x41c578){const _0x286a44=a109_0x20f9;if(_0x41c578===_0x286a44(0x1d9))return'TEMPLATE_MISSING_NAME';if(_0x41c578==='type')return _0x286a44(0x1e6);if(_0x41c578===_0x286a44(0x1c3)||_0x41c578[_0x286a44(0x1d8)](_0x286a44(0x1c3)))return'TEMPLATE_INVALID_VARIABLES';return _0x286a44(0x1e8);}function runSemanticChecks(_0x463b8f,_0x531389){const _0x258553=a109_0x20f9,_0x3a71e6=[];!_0x463b8f[_0x258553(0x1ca)]&&_0x3a71e6[_0x258553(0x1df)]({'level':_0x258553(0x1d7),'path':_0x258553(0x1ca),'code':'TEMPLATE_MISSING_HTML_FILE','message':_0x258553(0x1ea),'location':getLocationFromPath(_0x531389[_0x258553(0x1c6)],_0x531389[_0x258553(0x1cf)],[_0x258553(0x1d9)])});!_0x463b8f[_0x258553(0x1d2)]&&_0x3a71e6[_0x258553(0x1df)]({'level':_0x258553(0x1d7),'path':_0x258553(0x1d2),'code':_0x258553(0x1cc),'message':'Template\x20requires\x20subject\x20—\x20email\x20subject\x20line\x20template','location':getLocationFromPath(_0x531389[_0x258553(0x1c6)],_0x531389[_0x258553(0x1cf)],[_0x258553(0x1d9)])});!_0x463b8f[_0x258553(0x1cd)]&&_0x3a71e6['push']({'level':'warning','path':_0x258553(0x1cd),'code':_0x258553(0x1c8),'message':_0x258553(0x1d6),'location':getLocationFromPath(_0x531389[_0x258553(0x1c6)],_0x531389['source'],['name'])});for(let _0x1d13be=0x0;_0x1d13be<_0x463b8f[_0x258553(0x1c3)][_0x258553(0x1c4)];_0x1d13be++){const _0x3ccac9=_0x463b8f['variables'][_0x1d13be];/\s/[_0x258553(0x1e5)](_0x3ccac9[_0x258553(0x1d9)])&&_0x3a71e6['push']({'level':_0x258553(0x1d7),'path':'variables['+_0x1d13be+_0x258553(0x1e7),'code':_0x258553(0x1c7),'message':_0x258553(0x1e2)+_0x3ccac9[_0x258553(0x1d9)]+_0x258553(0x1c5),'location':getLocationFromPath(_0x531389[_0x258553(0x1c6)],_0x531389[_0x258553(0x1cf)],[_0x258553(0x1c3),_0x1d13be,_0x258553(0x1d9)])});}return _0x3a71e6;}
@@ -1 +1 @@
1
- (function(_0x4b3b57,_0xf7eb94){const _0x8d1746=a110_0x51d6,_0x35b1b0=_0x4b3b57();while(!![]){try{const _0x5da8b7=parseInt(_0x8d1746(0x8a))/0x1*(parseInt(_0x8d1746(0x90))/0x2)+parseInt(_0x8d1746(0xa1))/0x3*(parseInt(_0x8d1746(0x9f))/0x4)+-parseInt(_0x8d1746(0x7e))/0x5*(-parseInt(_0x8d1746(0xa9))/0x6)+-parseInt(_0x8d1746(0xa7))/0x7+parseInt(_0x8d1746(0x7f))/0x8*(parseInt(_0x8d1746(0x97))/0x9)+parseInt(_0x8d1746(0x9d))/0xa+parseInt(_0x8d1746(0x7d))/0xb*(-parseInt(_0x8d1746(0x9e))/0xc);if(_0x5da8b7===_0xf7eb94)break;else _0x35b1b0['push'](_0x35b1b0['shift']());}catch(_0x2a2cd4){_0x35b1b0['push'](_0x35b1b0['shift']());}}}(a110_0x4e3f,0x783f8));import*as a110_0x6149f from'yaml';import{safeParseYaml}from'../segment/yaml-validator.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{TemplateDefSchema}from'./types/template-schema.js';function a110_0x4e3f(){const _0x10a13c=['stringify','default_value','editorType','html_file','name','templateVariables','some','map','readFile','13cfvIyd','push','display_name','join','workspaceId','resolveWorkspaceId','76418KUhEoZ','plaintext_file','defaultValue','preview_value','template','plaintextTemplate','variables','6410439hPEinv','parse','subjectTemplate','htmlTemplate','previewValue','startsWith','5248910AtIZMD','23174796quMzMh','16XoQBAg','null','134808yMLnrN','workspace','workspaceName','variables:','length','subject','1267749WHMhfb','trimStart','2334DBlrYM','.html','.txt','11BcGNiw','8885AfhXxK','8cVwYUL','editor_type'];a110_0x4e3f=function(){return _0x10a13c;};return a110_0x4e3f();}export function templateToDef(_0x4345f1,_0x4d24bf){const _0x4f22ce=a110_0x51d6,_0x2f05fc=_0x4345f1['attributes'],_0x3b7efb=sanitizeTemplateFileName(_0x2f05fc[_0x4f22ce(0x85)]);let _0x41e837,_0x27be0c,_0x1eb9da,_0x1f893c;_0x2f05fc['htmlTemplate']&&(_0x1eb9da=_0x3b7efb+_0x4f22ce(0xaa),_0x41e837=_0x2f05fc[_0x4f22ce(0x9a)]);_0x2f05fc[_0x4f22ce(0x95)]&&(_0x1f893c=_0x3b7efb+_0x4f22ce(0x7c),_0x27be0c=_0x2f05fc[_0x4f22ce(0x95)]);const _0xabae43=_0x2f05fc['templateVariables']&&_0x2f05fc['templateVariables'][_0x4f22ce(0xa5)]>0x0,_0x5414ab={'type':'template','name':_0x2f05fc[_0x4f22ce(0x85)],..._0x2f05fc[_0x4f22ce(0x99)]&&{'subject':_0x2f05fc[_0x4f22ce(0x99)]},..._0x4d24bf[_0x4f22ce(0xa3)]&&{'workspace':_0x4d24bf[_0x4f22ce(0xa3)]},..._0x2f05fc[_0x4f22ce(0x83)]&&{'editor_type':_0x2f05fc[_0x4f22ce(0x83)]},..._0x1eb9da&&{'html_file':_0x1eb9da},..._0x1f893c&&{'plaintext_file':_0x1f893c},'variables':_0xabae43?_0x2f05fc['templateVariables']['map'](templateVariableToYaml):[]};return{'def':_0x5414ab,'htmlContent':_0x41e837,'plaintextContent':_0x27be0c};}export async function defToCreateInput(_0x10b45f,_0x15b671){const _0x55e271=a110_0x51d6,_0x23dedc={'name':_0x10b45f[_0x55e271(0x85)],'subjectTemplate':_0x10b45f[_0x55e271(0xa6)]??'','htmlTemplate':''};return _0x10b45f['workspace']&&(_0x23dedc[_0x55e271(0x8e)]=await _0x15b671[_0x55e271(0x8f)](_0x10b45f[_0x55e271(0xa2)])),_0x10b45f[_0x55e271(0x80)]&&(_0x23dedc[_0x55e271(0x83)]=_0x10b45f[_0x55e271(0x80)]),_0x10b45f['html_file']&&(_0x23dedc[_0x55e271(0x9a)]=await _0x15b671[_0x55e271(0x89)](_0x10b45f['html_file'])),_0x10b45f[_0x55e271(0x91)]&&(_0x23dedc[_0x55e271(0x95)]=await _0x15b671[_0x55e271(0x89)](_0x10b45f[_0x55e271(0x91)])),_0x10b45f['variables'][_0x55e271(0xa5)]>0x0&&(_0x23dedc['templateVariables']=_0x10b45f[_0x55e271(0x96)][_0x55e271(0x88)](variableDefToApi)),_0x23dedc;}function a110_0x51d6(_0x27e09b,_0x585b06){_0x27e09b=_0x27e09b-0x7c;const _0x4e3f3f=a110_0x4e3f();let _0x51d662=_0x4e3f3f[_0x27e09b];return _0x51d662;}export async function defToUpdateInput(_0x437f31,_0x1cb3bb){const _0x2a8739=a110_0x51d6,_0x53e420={};if(_0x437f31['name'])_0x53e420[_0x2a8739(0x85)]=_0x437f31[_0x2a8739(0x85)];if(_0x437f31[_0x2a8739(0xa6)])_0x53e420[_0x2a8739(0x99)]=_0x437f31['subject'];return _0x437f31[_0x2a8739(0x84)]&&(_0x53e420[_0x2a8739(0x9a)]=await _0x1cb3bb[_0x2a8739(0x89)](_0x437f31[_0x2a8739(0x84)])),_0x437f31[_0x2a8739(0x91)]&&(_0x53e420['plaintextTemplate']=await _0x1cb3bb['readFile'](_0x437f31[_0x2a8739(0x91)])),_0x437f31[_0x2a8739(0x96)][_0x2a8739(0xa5)]>0x0&&(_0x53e420[_0x2a8739(0x86)]=_0x437f31[_0x2a8739(0x96)]['map'](variableDefToApi)),_0x53e420;}export function toYamlString(_0x5cdcfc){const _0x213762=a110_0x51d6,_0x37f978=JSON[_0x213762(0x98)](JSON[_0x213762(0x81)](_0x5cdcfc)),_0x1a4ef1=a110_0x6149f['stringify'](_0x37f978,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x213762(0xa0)}),_0x31307c=[_0x213762(0xa4)],_0x4857c8=_0x1a4ef1['split']('\x0a'),_0x1e5765=[];for(let _0x461c84=0x0;_0x461c84<_0x4857c8['length'];_0x461c84++){const _0x4a8635=_0x4857c8[_0x461c84][_0x213762(0xa8)]();_0x461c84>0x0&&_0x31307c[_0x213762(0x87)](_0x5cbb44=>_0x4a8635[_0x213762(0x9c)](_0x5cbb44))&&_0x1e5765[_0x213762(0xa5)]>0x0&&_0x1e5765[_0x1e5765[_0x213762(0xa5)]-0x1]!==''&&_0x1e5765[_0x213762(0x8b)](''),_0x1e5765[_0x213762(0x8b)](_0x4857c8[_0x461c84]);}return _0x1e5765[_0x213762(0x8d)]('\x0a');}export function parseYamlString(_0x30b8e0){return safeParseYaml(_0x30b8e0,TemplateDefSchema);}export function normalizeDef(_0x3e7daa){const _0x33e084=a110_0x51d6;return{'type':_0x33e084(0x94),'name':_0x3e7daa[_0x33e084(0x85)],..._0x3e7daa[_0x33e084(0xa6)]!==undefined&&{'subject':_0x3e7daa[_0x33e084(0xa6)]},..._0x3e7daa['workspace']!==undefined&&{'workspace':_0x3e7daa['workspace']},..._0x3e7daa[_0x33e084(0x80)]!==undefined&&{'editor_type':_0x3e7daa[_0x33e084(0x80)]},..._0x3e7daa['html_file']!==undefined&&{'html_file':_0x3e7daa[_0x33e084(0x84)]},..._0x3e7daa[_0x33e084(0x91)]!==undefined&&{'plaintext_file':_0x3e7daa['plaintext_file']},'variables':_0x3e7daa[_0x33e084(0x96)][_0x33e084(0xa5)]>0x0?_0x3e7daa[_0x33e084(0x96)]['map'](_0x346acc=>({'name':_0x346acc['name'],'display_name':_0x346acc[_0x33e084(0x8c)],'preview_value':_0x346acc[_0x33e084(0x93)],..._0x346acc[_0x33e084(0x82)]!==undefined&&{'default_value':_0x346acc[_0x33e084(0x82)]}})):[]};}function variableDefToApi(_0x113c72){const _0x30ad6d=a110_0x51d6;return{'name':_0x113c72['name'],'displayName':_0x113c72[_0x30ad6d(0x8c)],'previewValue':_0x113c72[_0x30ad6d(0x93)],..._0x113c72['default_value']!==undefined&&{'defaultValue':_0x113c72[_0x30ad6d(0x82)]}};}function templateVariableToYaml(_0x318fb9){const _0x4f42a3=a110_0x51d6;return{'name':_0x318fb9[_0x4f42a3(0x85)],'display_name':_0x318fb9['displayName'],'preview_value':_0x318fb9[_0x4f42a3(0x9b)],..._0x318fb9[_0x4f42a3(0x92)]!==undefined&&{'default_value':_0x318fb9[_0x4f42a3(0x92)]}};}export const sanitizeTemplateFileName=sanitizeFileName;
1
+ (function(_0xe48ce5,_0x574994){const _0x5d34b8=a110_0x2209,_0x4e0405=_0xe48ce5();while(!![]){try{const _0x5b790d=-parseInt(_0x5d34b8(0x15b))/0x1*(parseInt(_0x5d34b8(0x166))/0x2)+parseInt(_0x5d34b8(0x185))/0x3*(parseInt(_0x5d34b8(0x17d))/0x4)+parseInt(_0x5d34b8(0x15d))/0x5*(parseInt(_0x5d34b8(0x180))/0x6)+parseInt(_0x5d34b8(0x163))/0x7+-parseInt(_0x5d34b8(0x17c))/0x8*(-parseInt(_0x5d34b8(0x160))/0x9)+-parseInt(_0x5d34b8(0x175))/0xa*(-parseInt(_0x5d34b8(0x16b))/0xb)+parseInt(_0x5d34b8(0x17f))/0xc*(-parseInt(_0x5d34b8(0x15e))/0xd);if(_0x5b790d===_0x574994)break;else _0x4e0405['push'](_0x4e0405['shift']());}catch(_0x1d6047){_0x4e0405['push'](_0x4e0405['shift']());}}}(a110_0x13ec,0x862ed));import*as a110_0x269411 from'yaml';function a110_0x2209(_0x591235,_0x1b3e96){_0x591235=_0x591235-0x15b;const _0x13ec2c=a110_0x13ec();let _0x220987=_0x13ec2c[_0x591235];return _0x220987;}import{safeParseYaml}from'../segment/yaml-validator.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{TemplateDefSchema}from'./types/template-schema.js';export function templateToDef(_0x20827a,_0x36f87a){const _0x2622e4=a110_0x2209,_0x5c4506=_0x20827a[_0x2622e4(0x187)],_0x5d8b59=sanitizeTemplateFileName(_0x5c4506[_0x2622e4(0x170)]);let _0x36ef30,_0x5842e1,_0x61a6da,_0x432de4;_0x5c4506['htmlTemplate']&&(_0x61a6da=_0x5d8b59+_0x2622e4(0x16d),_0x36ef30=_0x5c4506['htmlTemplate']);_0x5c4506[_0x2622e4(0x161)]&&(_0x432de4=_0x5d8b59+'.txt',_0x5842e1=_0x5c4506[_0x2622e4(0x161)]);const _0x7041e3=_0x5c4506[_0x2622e4(0x17b)]&&_0x5c4506['templateVariables']['length']>0x0,_0x439797={'type':_0x2622e4(0x182),'name':_0x5c4506[_0x2622e4(0x170)],..._0x5c4506[_0x2622e4(0x184)]&&{'subject':_0x5c4506[_0x2622e4(0x184)]},..._0x36f87a[_0x2622e4(0x186)]&&{'workspace':_0x36f87a[_0x2622e4(0x186)]},..._0x5c4506['editorType']&&{'editor_type':_0x5c4506[_0x2622e4(0x169)]},..._0x61a6da&&{'html_file':_0x61a6da},..._0x432de4&&{'plaintext_file':_0x432de4},'variables':_0x7041e3?_0x5c4506[_0x2622e4(0x17b)][_0x2622e4(0x173)](templateVariableToYaml):[]};return{'def':_0x439797,'htmlContent':_0x36ef30,'plaintextContent':_0x5842e1};}export async function defToCreateInput(_0x1824b5,_0x1b6528){const _0x283c24=a110_0x2209,_0x204a33={'name':_0x1824b5[_0x283c24(0x170)],'subjectTemplate':_0x1824b5['subject']??'','htmlTemplate':''};return _0x1824b5['workspace']&&(_0x204a33['workspaceId']=await _0x1b6528[_0x283c24(0x172)](_0x1824b5[_0x283c24(0x177)])),_0x1824b5[_0x283c24(0x167)]&&(_0x204a33[_0x283c24(0x169)]=_0x1824b5[_0x283c24(0x167)]),_0x1824b5[_0x283c24(0x16a)]&&(_0x204a33[_0x283c24(0x181)]=await _0x1b6528[_0x283c24(0x183)](_0x1824b5[_0x283c24(0x16a)])),_0x1824b5[_0x283c24(0x16e)]&&(_0x204a33['plaintextTemplate']=await _0x1b6528['readFile'](_0x1824b5[_0x283c24(0x16e)])),_0x1824b5[_0x283c24(0x17e)][_0x283c24(0x168)]>0x0&&(_0x204a33[_0x283c24(0x17b)]=_0x1824b5['variables'][_0x283c24(0x173)](variableDefToApi)),_0x204a33;}export async function defToUpdateInput(_0x5aa4ae,_0x2b8b93){const _0xcf2785=a110_0x2209,_0x1a5603={};if(_0x5aa4ae[_0xcf2785(0x170)])_0x1a5603[_0xcf2785(0x170)]=_0x5aa4ae[_0xcf2785(0x170)];if(_0x5aa4ae[_0xcf2785(0x165)])_0x1a5603[_0xcf2785(0x184)]=_0x5aa4ae[_0xcf2785(0x165)];return _0x5aa4ae['html_file']&&(_0x1a5603[_0xcf2785(0x181)]=await _0x2b8b93[_0xcf2785(0x183)](_0x5aa4ae[_0xcf2785(0x16a)])),_0x5aa4ae[_0xcf2785(0x16e)]&&(_0x1a5603['plaintextTemplate']=await _0x2b8b93[_0xcf2785(0x183)](_0x5aa4ae['plaintext_file'])),_0x5aa4ae[_0xcf2785(0x17e)][_0xcf2785(0x168)]>0x0&&(_0x1a5603[_0xcf2785(0x17b)]=_0x5aa4ae[_0xcf2785(0x17e)]['map'](variableDefToApi)),_0x1a5603;}export function toYamlString(_0x580a8d){const _0xcd8bb8=a110_0x2209,_0x30ec50=JSON[_0xcd8bb8(0x164)](JSON['stringify'](_0x580a8d)),_0x151fe3=a110_0x269411['stringify'](_0x30ec50,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xcd8bb8(0x171)}),_0x24abb7=['variables:'],_0x77a978=_0x151fe3[_0xcd8bb8(0x176)]('\x0a'),_0x10855a=[];for(let _0x491d21=0x0;_0x491d21<_0x77a978['length'];_0x491d21++){const _0x394787=_0x77a978[_0x491d21][_0xcd8bb8(0x16f)]();_0x491d21>0x0&&_0x24abb7[_0xcd8bb8(0x162)](_0x3c195e=>_0x394787[_0xcd8bb8(0x16c)](_0x3c195e))&&_0x10855a[_0xcd8bb8(0x168)]>0x0&&_0x10855a[_0x10855a['length']-0x1]!==''&&_0x10855a[_0xcd8bb8(0x174)](''),_0x10855a[_0xcd8bb8(0x174)](_0x77a978[_0x491d21]);}return _0x10855a['join']('\x0a');}export function parseYamlString(_0x52095a){return safeParseYaml(_0x52095a,TemplateDefSchema);}export function normalizeDef(_0x1af5d3){const _0x3298fc=a110_0x2209;return{'type':'template','name':_0x1af5d3['name'],..._0x1af5d3[_0x3298fc(0x165)]!==undefined&&{'subject':_0x1af5d3['subject']},..._0x1af5d3[_0x3298fc(0x177)]!==undefined&&{'workspace':_0x1af5d3['workspace']},..._0x1af5d3[_0x3298fc(0x167)]!==undefined&&{'editor_type':_0x1af5d3['editor_type']},..._0x1af5d3[_0x3298fc(0x16a)]!==undefined&&{'html_file':_0x1af5d3[_0x3298fc(0x16a)]},..._0x1af5d3[_0x3298fc(0x16e)]!==undefined&&{'plaintext_file':_0x1af5d3[_0x3298fc(0x16e)]},'variables':_0x1af5d3[_0x3298fc(0x17e)][_0x3298fc(0x168)]>0x0?_0x1af5d3['variables']['map'](_0x4db575=>({'name':_0x4db575['name'],'display_name':_0x4db575[_0x3298fc(0x15c)],'preview_value':_0x4db575[_0x3298fc(0x179)],..._0x4db575[_0x3298fc(0x15f)]!==undefined&&{'default_value':_0x4db575[_0x3298fc(0x15f)]}})):[]};}function variableDefToApi(_0x410bb8){const _0x22e5a5=a110_0x2209;return{'name':_0x410bb8[_0x22e5a5(0x170)],'displayName':_0x410bb8[_0x22e5a5(0x15c)],'previewValue':_0x410bb8[_0x22e5a5(0x179)],..._0x410bb8['default_value']!==undefined&&{'defaultValue':_0x410bb8[_0x22e5a5(0x15f)]}};}function templateVariableToYaml(_0x46d277){const _0x3a22a0=a110_0x2209;return{'name':_0x46d277[_0x3a22a0(0x170)],'display_name':_0x46d277[_0x3a22a0(0x17a)],'preview_value':_0x46d277['previewValue'],..._0x46d277[_0x3a22a0(0x178)]!==undefined&&{'default_value':_0x46d277['defaultValue']}};}function a110_0x13ec(){const _0x5de102=['12vuAHma','variables','24rQEnxk','6yzHnkC','htmlTemplate','template','readFile','subjectTemplate','210579bnIbbt','workspaceName','attributes','473273PgOCNm','display_name','3070315RktpDn','3066583FIXSmn','default_value','9SmFvTL','plaintextTemplate','some','412699fnvsaO','parse','subject','4EOxLsI','editor_type','length','editorType','html_file','311399YcfnFG','startsWith','.html','plaintext_file','trimStart','name','null','resolveWorkspaceId','map','push','70YXpYDd','split','workspace','defaultValue','preview_value','displayName','templateVariables','7089432fxAwFF'];a110_0x13ec=function(){return _0x5de102;};return a110_0x13ec();}export const sanitizeTemplateFileName=sanitizeFileName;
@@ -1 +1 @@
1
- function a111_0x21ed(_0x4ba78e,_0x4ee8ee){_0x4ba78e=_0x4ba78e-0x8d;var _0x5b9b8d=a111_0x5b9b();var _0x21ed92=_0x5b9b8d[_0x4ba78e];return _0x21ed92;}function a111_0x5b9b(){var _0xc7715a=['9gqDqmQ','8939710ykBqSe','1280764yjtkRn','1104660yPNMkO','10PgREKK','2140EQwoaS','225809LzItRB','13788vtwZvX','4338040BqhoHF','6814493uXZHCm'];a111_0x5b9b=function(){return _0xc7715a;};return a111_0x5b9b();}(function(_0x11ef00,_0x2dceb8){var _0x26a07c=a111_0x21ed,_0x4aee7b=_0x11ef00();while(!![]){try{var _0x47c0d7=parseInt(_0x26a07c(0x8d))/0x1*(parseInt(_0x26a07c(0x95))/0x2)+-parseInt(_0x26a07c(0x94))/0x3+parseInt(_0x26a07c(0x93))/0x4+parseInt(_0x26a07c(0x96))/0x5*(parseInt(_0x26a07c(0x8e))/0x6)+-parseInt(_0x26a07c(0x90))/0x7+parseInt(_0x26a07c(0x8f))/0x8+parseInt(_0x26a07c(0x91))/0x9*(-parseInt(_0x26a07c(0x92))/0xa);if(_0x47c0d7===_0x2dceb8)break;else _0x4aee7b['push'](_0x4aee7b['shift']());}catch(_0x3bab99){_0x4aee7b['push'](_0x4aee7b['shift']());}}}(a111_0x5b9b,0xb4811));export{CampaignDefSchema,EmailDefSchema,PushContentDefSchema,ScheduleDefSchema,ColumnMappingDefSchema,ConnectorDefSchema,ActivationSettingsDefSchema,UtmDefSchema,NotificationsDefSchema,TemplateVariableDefSchema}from'./campaign-schema.js';
1
+ function a111_0x170a(_0x5372f8,_0x17fd1c){_0x5372f8=_0x5372f8-0xbd;var _0x3f791e=a111_0x3f79();var _0x170a22=_0x3f791e[_0x5372f8];return _0x170a22;}function a111_0x3f79(){var _0x9a74a0=['1237784HdEFFR','72PwoXBD','1848448AtYOLK','956699uYLEZT','897379auLNNG','22103397kHdCne','7824450aBFpRc','1724895luxArI','3rRikUX'];a111_0x3f79=function(){return _0x9a74a0;};return a111_0x3f79();}(function(_0x181ae1,_0x39b2c7){var _0x5c527c=a111_0x170a,_0x2867a1=_0x181ae1();while(!![]){try{var _0x258930=parseInt(_0x5c527c(0xc3))/0x1+-parseInt(_0x5c527c(0xc2))/0x2+-parseInt(_0x5c527c(0xbf))/0x3*(-parseInt(_0x5c527c(0xc0))/0x4)+parseInt(_0x5c527c(0xbe))/0x5+parseInt(_0x5c527c(0xbd))/0x6+parseInt(_0x5c527c(0xc4))/0x7*(parseInt(_0x5c527c(0xc1))/0x8)+-parseInt(_0x5c527c(0xc5))/0x9;if(_0x258930===_0x39b2c7)break;else _0x2867a1['push'](_0x2867a1['shift']());}catch(_0x2177c4){_0x2867a1['push'](_0x2867a1['shift']());}}}(a111_0x3f79,0xa82af));export{CampaignDefSchema,EmailDefSchema,PushContentDefSchema,ScheduleDefSchema,ColumnMappingDefSchema,ConnectorDefSchema,ActivationSettingsDefSchema,UtmDefSchema,NotificationsDefSchema,TemplateVariableDefSchema}from'./campaign-schema.js';
@@ -1 +1 @@
1
- const a112_0x43a698=a112_0x481c;(function(_0x453209,_0x496393){const _0x141ca1=a112_0x481c,_0x462199=_0x453209();while(!![]){try{const _0x375375=parseInt(_0x141ca1(0x102))/0x1*(-parseInt(_0x141ca1(0x106))/0x2)+parseInt(_0x141ca1(0x10c))/0x3*(parseInt(_0x141ca1(0xff))/0x4)+-parseInt(_0x141ca1(0xf7))/0x5+-parseInt(_0x141ca1(0xfb))/0x6*(-parseInt(_0x141ca1(0xfd))/0x7)+-parseInt(_0x141ca1(0x109))/0x8*(-parseInt(_0x141ca1(0xfc))/0x9)+-parseInt(_0x141ca1(0x104))/0xa*(-parseInt(_0x141ca1(0x107))/0xb)+parseInt(_0x141ca1(0xfa))/0xc;if(_0x375375===_0x496393)break;else _0x462199['push'](_0x462199['shift']());}catch(_0x5888a0){_0x462199['push'](_0x462199['shift']());}}}(a112_0x3b99,0xa5770));import{z}from'zod';function a112_0x481c(_0x7a812a,_0x2d20cb){_0x7a812a=_0x7a812a-0xf6;const _0x3b99b6=a112_0x3b99();let _0x481cb4=_0x3b99b6[_0x7a812a];return _0x481cb4;}export const TemplateVariableDefSchema=z[a112_0x43a698(0x108)]({'name':z[a112_0x43a698(0xf6)](),'display_name':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'preview_value':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'default_value':z['string']()['optional']()});export const EmailDefSchema=z['object']({'template':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'subject':z['string']()[a112_0x43a698(0x10d)](),'html_file':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'plaintext_file':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'sender_id':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'variables':z[a112_0x43a698(0xfe)](TemplateVariableDefSchema)['optional']()});export const PushContentDefSchema=z[a112_0x43a698(0x108)]({'title':z[a112_0x43a698(0xf6)]()['optional'](),'message':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'push_type':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'image_url':z['string']()[a112_0x43a698(0x10d)](),'on_click_behavior':z['string']()[a112_0x43a698(0x10d)](),'on_click_behavior_url':z[a112_0x43a698(0xf6)]()['optional']()});export const ScheduleDefSchema=z['object']({'start_at':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'timezone':z[a112_0x43a698(0xf6)]()['optional']()});export const ColumnMappingDefSchema=z[a112_0x43a698(0x108)]({'column':z[a112_0x43a698(0xf6)](),'source':z[a112_0x43a698(0xf6)]()});export const ConnectorDefSchema=z[a112_0x43a698(0x108)]({'all_columns':z[a112_0x43a698(0x100)]()[a112_0x43a698(0x10d)](),'columns':z[a112_0x43a698(0xfe)](ColumnMappingDefSchema)[a112_0x43a698(0x10d)]()});export const ActivationSettingsDefSchema=z[a112_0x43a698(0x108)]({'enabled':z[a112_0x43a698(0x100)]()[a112_0x43a698(0x10d)](),'workflow_project':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'workflow_name':z[a112_0x43a698(0xf6)]()['optional']()});export const UtmDefSchema=z['object']({'enabled':z[a112_0x43a698(0x100)]()[a112_0x43a698(0x10d)](),'id':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'medium':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'source':z['string']()['optional'](),'source_platform':z[a112_0x43a698(0xf6)]()['optional'](),'campaign':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'marketing_tactic':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)]()});export const NotificationsDefSchema=z[a112_0x43a698(0x108)]({'events':z['array'](z[a112_0x43a698(0xf6)]())['optional'](),'recipients':z[a112_0x43a698(0xfe)](z['number']())[a112_0x43a698(0x10d)]()});function a112_0x3b99(){const _0x4939d9=['literal','159IvAMou','optional','string','6249555caEyCJ','push','campaign','6420468yZVlgO','165516MOsuVW','1202661XZXsmj','154kulGOK','array','88268VyoJwj','boolean','email','1aHPmJg','Campaign\x20name\x20is\x20required','2576580VFUUhQ','min','2580860evVAgJ','33JJFMCZ','object','8LQyBZO','default'];a112_0x3b99=function(){return _0x4939d9;};return a112_0x3b99();}export const CampaignDefSchema=z[a112_0x43a698(0x108)]({'type':z[a112_0x43a698(0x10b)]('campaign')[a112_0x43a698(0x10a)](a112_0x43a698(0xf9)),'name':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x105)](0x1,a112_0x43a698(0x103)),'campaign_type':z['enum']([a112_0x43a698(0x101),a112_0x43a698(0xf8)]),'description':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'workspace':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'audience':z[a112_0x43a698(0xf6)]()[a112_0x43a698(0x10d)](),'segment':z[a112_0x43a698(0xf6)]()['optional'](),'email':EmailDefSchema[a112_0x43a698(0x10d)](),'push':PushContentDefSchema[a112_0x43a698(0x10d)](),'schedule':ScheduleDefSchema['optional'](),'connector':ConnectorDefSchema[a112_0x43a698(0x10d)](),'activation':ActivationSettingsDefSchema[a112_0x43a698(0x10d)](),'utm':UtmDefSchema[a112_0x43a698(0x10d)](),'notifications':NotificationsDefSchema[a112_0x43a698(0x10d)]()});
1
+ const a112_0x31ce63=a112_0x53d4;(function(_0x240992,_0x420231){const _0x1c92e8=a112_0x53d4,_0x1e76f3=_0x240992();while(!![]){try{const _0x3a329a=-parseInt(_0x1c92e8(0xbd))/0x1*(parseInt(_0x1c92e8(0xc0))/0x2)+-parseInt(_0x1c92e8(0xbb))/0x3*(-parseInt(_0x1c92e8(0xc1))/0x4)+parseInt(_0x1c92e8(0xc4))/0x5+parseInt(_0x1c92e8(0xc2))/0x6*(-parseInt(_0x1c92e8(0xb6))/0x7)+-parseInt(_0x1c92e8(0xb8))/0x8+-parseInt(_0x1c92e8(0xb7))/0x9+parseInt(_0x1c92e8(0xbc))/0xa*(parseInt(_0x1c92e8(0xc7))/0xb);if(_0x3a329a===_0x420231)break;else _0x1e76f3['push'](_0x1e76f3['shift']());}catch(_0x568842){_0x1e76f3['push'](_0x1e76f3['shift']());}}}(a112_0xc77c,0xe1373));import{z}from'zod';export const TemplateVariableDefSchema=z[a112_0x31ce63(0xb9)]({'name':z['string'](),'display_name':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'preview_value':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'default_value':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)]()});export const EmailDefSchema=z[a112_0x31ce63(0xb9)]({'template':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'subject':z['string']()[a112_0x31ce63(0xcc)](),'html_file':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'plaintext_file':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'sender_id':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'variables':z[a112_0x31ce63(0xc9)](TemplateVariableDefSchema)['optional']()});export const PushContentDefSchema=z['object']({'title':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'message':z[a112_0x31ce63(0xc6)]()['optional'](),'push_type':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'image_url':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'on_click_behavior':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'on_click_behavior_url':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)]()});export const ScheduleDefSchema=z[a112_0x31ce63(0xb9)]({'start_at':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'timezone':z[a112_0x31ce63(0xc6)]()['optional']()});export const ColumnMappingDefSchema=z[a112_0x31ce63(0xb9)]({'column':z['string'](),'source':z[a112_0x31ce63(0xc6)]()});function a112_0xc77c(){const _0x2c5fe1=['array','push','min','optional','number','1505snTKyr','15894360vMscmP','9908792VoGDbH','object','default','20571skzyVE','530hUfhfc','870707MtwYDA','email','enum','4urZEsd','656lhIZwS','33678mVhMIa','boolean','1284545uuhLDB','Campaign\x20name\x20is\x20required','string','1140238eUnNMu','campaign'];a112_0xc77c=function(){return _0x2c5fe1;};return a112_0xc77c();}export const ConnectorDefSchema=z[a112_0x31ce63(0xb9)]({'all_columns':z[a112_0x31ce63(0xc3)]()['optional'](),'columns':z[a112_0x31ce63(0xc9)](ColumnMappingDefSchema)[a112_0x31ce63(0xcc)]()});function a112_0x53d4(_0x598718,_0x2b2b4c){_0x598718=_0x598718-0xb6;const _0xc77c2d=a112_0xc77c();let _0x53d47c=_0xc77c2d[_0x598718];return _0x53d47c;}export const ActivationSettingsDefSchema=z[a112_0x31ce63(0xb9)]({'enabled':z['boolean']()[a112_0x31ce63(0xcc)](),'workflow_project':z[a112_0x31ce63(0xc6)]()['optional'](),'workflow_name':z['string']()[a112_0x31ce63(0xcc)]()});export const UtmDefSchema=z['object']({'enabled':z[a112_0x31ce63(0xc3)]()['optional'](),'id':z[a112_0x31ce63(0xc6)]()['optional'](),'medium':z['string']()[a112_0x31ce63(0xcc)](),'source':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'source_platform':z['string']()[a112_0x31ce63(0xcc)](),'campaign':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'marketing_tactic':z[a112_0x31ce63(0xc6)]()['optional']()});export const NotificationsDefSchema=z[a112_0x31ce63(0xb9)]({'events':z[a112_0x31ce63(0xc9)](z[a112_0x31ce63(0xc6)]())[a112_0x31ce63(0xcc)](),'recipients':z['array'](z[a112_0x31ce63(0xcd)]())[a112_0x31ce63(0xcc)]()});export const CampaignDefSchema=z[a112_0x31ce63(0xb9)]({'type':z['literal'](a112_0x31ce63(0xc8))[a112_0x31ce63(0xba)](a112_0x31ce63(0xc8)),'name':z['string']()[a112_0x31ce63(0xcb)](0x1,a112_0x31ce63(0xc5)),'campaign_type':z[a112_0x31ce63(0xbf)]([a112_0x31ce63(0xbe),a112_0x31ce63(0xca)]),'description':z['string']()[a112_0x31ce63(0xcc)](),'workspace':z[a112_0x31ce63(0xc6)]()['optional'](),'audience':z['string']()[a112_0x31ce63(0xcc)](),'segment':z[a112_0x31ce63(0xc6)]()[a112_0x31ce63(0xcc)](),'email':EmailDefSchema['optional'](),'push':PushContentDefSchema['optional'](),'schedule':ScheduleDefSchema[a112_0x31ce63(0xcc)](),'connector':ConnectorDefSchema[a112_0x31ce63(0xcc)](),'activation':ActivationSettingsDefSchema[a112_0x31ce63(0xcc)](),'utm':UtmDefSchema[a112_0x31ce63(0xcc)](),'notifications':NotificationsDefSchema[a112_0x31ce63(0xcc)]()});
@@ -1 +1 @@
1
- const a113_0x9e58d=a113_0x21b8;function a113_0x21b8(_0x5b0f41,_0x4b304e){_0x5b0f41=_0x5b0f41-0xf0;const _0x1cf797=a113_0x1cf7();let _0x21b82d=_0x1cf797[_0x5b0f41];return _0x21b82d;}(function(_0x411524,_0x32958c){const _0x63ac14=a113_0x21b8,_0x22ebde=_0x411524();while(!![]){try{const _0x584421=-parseInt(_0x63ac14(0xf2))/0x1*(-parseInt(_0x63ac14(0xfe))/0x2)+parseInt(_0x63ac14(0x103))/0x3*(parseInt(_0x63ac14(0xf6))/0x4)+parseInt(_0x63ac14(0x102))/0x5*(-parseInt(_0x63ac14(0xf1))/0x6)+parseInt(_0x63ac14(0xfb))/0x7+-parseInt(_0x63ac14(0xfc))/0x8+-parseInt(_0x63ac14(0xf7))/0x9+-parseInt(_0x63ac14(0xff))/0xa*(-parseInt(_0x63ac14(0xf4))/0xb);if(_0x584421===_0x32958c)break;else _0x22ebde['push'](_0x22ebde['shift']());}catch(_0x4df466){_0x22ebde['push'](_0x22ebde['shift']());}}}(a113_0x1cf7,0xceeb7));function a113_0x1cf7(){const _0x1048f6=['template','optional','6692700bvOGfH','4932984siNdfR','default','1091824YeFXdS','1520RVEDFS','Variable\x20display_name\x20is\x20required','min','1618015WsJGED','247086PNCFbq','object','12WCsHWB','1YhwePc','array','34441xYTcaU','Variable\x20name\x20is\x20required','28wcXBES','3987774ljOVOW','string'];a113_0x1cf7=function(){return _0x1048f6;};return a113_0x1cf7();}import{z}from'zod';export const TemplateVariableDefSchema=z[a113_0x9e58d(0xf0)]({'name':z[a113_0x9e58d(0xf8)]()[a113_0x9e58d(0x101)](0x1,a113_0x9e58d(0xf5)),'display_name':z[a113_0x9e58d(0xf8)]()[a113_0x9e58d(0x101)](0x1,a113_0x9e58d(0x100)),'preview_value':z[a113_0x9e58d(0xf8)]()[a113_0x9e58d(0x101)](0x1,'Variable\x20preview_value\x20is\x20required'),'default_value':z[a113_0x9e58d(0xf8)]()[a113_0x9e58d(0xfa)]()});export const TemplateDefSchema=z[a113_0x9e58d(0xf0)]({'type':z['literal'](a113_0x9e58d(0xf9))[a113_0x9e58d(0xfd)](a113_0x9e58d(0xf9)),'name':z[a113_0x9e58d(0xf8)]()[a113_0x9e58d(0x101)](0x1,'Template\x20name\x20is\x20required'),'subject':z[a113_0x9e58d(0xf8)]()[a113_0x9e58d(0xfa)](),'html_file':z[a113_0x9e58d(0xf8)]()[a113_0x9e58d(0xfa)](),'plaintext_file':z['string']()[a113_0x9e58d(0xfa)](),'workspace':z[a113_0x9e58d(0xf8)]()['optional'](),'editor_type':z[a113_0x9e58d(0xf8)]()['optional'](),'variables':z[a113_0x9e58d(0xf3)](TemplateVariableDefSchema)[a113_0x9e58d(0xfd)]([])});
1
+ const a113_0x5a1be6=a113_0x5553;(function(_0x59a375,_0x57c5f0){const _0x4862c9=a113_0x5553,_0xc582dc=_0x59a375();while(!![]){try{const _0x1d8a3f=parseInt(_0x4862c9(0xbe))/0x1*(parseInt(_0x4862c9(0xc5))/0x2)+-parseInt(_0x4862c9(0xba))/0x3*(-parseInt(_0x4862c9(0xbb))/0x4)+parseInt(_0x4862c9(0xb2))/0x5+-parseInt(_0x4862c9(0xb5))/0x6*(-parseInt(_0x4862c9(0xc4))/0x7)+parseInt(_0x4862c9(0xb7))/0x8*(-parseInt(_0x4862c9(0xc0))/0x9)+-parseInt(_0x4862c9(0xc7))/0xa*(-parseInt(_0x4862c9(0xbc))/0xb)+-parseInt(_0x4862c9(0xb9))/0xc;if(_0x1d8a3f===_0x57c5f0)break;else _0xc582dc['push'](_0xc582dc['shift']());}catch(_0x4e0ffa){_0xc582dc['push'](_0xc582dc['shift']());}}}(a113_0x3ae3,0x443c8));import{z}from'zod';function a113_0x5553(_0x1c5ecd,_0xc6c5a5){_0x1c5ecd=_0x1c5ecd-0xb2;const _0x3ae3a8=a113_0x3ae3();let _0x5553bc=_0x3ae3a8[_0x1c5ecd];return _0x5553bc;}function a113_0x3ae3(){const _0x3d5c65=['optional','string','Variable\x20name\x20is\x20required','228102AkyXXz','10duBXPO','default','14170woYnyP','1042435rTwxMg','min','Template\x20name\x20is\x20required','84dyUqSv','Variable\x20preview_value\x20is\x20required','70096rYPbNi','template','7162260dncezW','234UlTGWg','3812smerue','1331FPJAzS','Variable\x20display_name\x20is\x20required','7193IkxRqC','object','72fkvkuS'];a113_0x3ae3=function(){return _0x3d5c65;};return a113_0x3ae3();}export const TemplateVariableDefSchema=z[a113_0x5a1be6(0xbf)]({'name':z[a113_0x5a1be6(0xc2)]()[a113_0x5a1be6(0xb3)](0x1,a113_0x5a1be6(0xc3)),'display_name':z[a113_0x5a1be6(0xc2)]()['min'](0x1,a113_0x5a1be6(0xbd)),'preview_value':z['string']()['min'](0x1,a113_0x5a1be6(0xb6)),'default_value':z[a113_0x5a1be6(0xc2)]()[a113_0x5a1be6(0xc1)]()});export const TemplateDefSchema=z['object']({'type':z['literal'](a113_0x5a1be6(0xb8))['default'](a113_0x5a1be6(0xb8)),'name':z[a113_0x5a1be6(0xc2)]()[a113_0x5a1be6(0xb3)](0x1,a113_0x5a1be6(0xb4)),'subject':z[a113_0x5a1be6(0xc2)]()['optional'](),'html_file':z[a113_0x5a1be6(0xc2)]()['optional'](),'plaintext_file':z[a113_0x5a1be6(0xc2)]()['optional'](),'workspace':z[a113_0x5a1be6(0xc2)]()[a113_0x5a1be6(0xc1)](),'editor_type':z[a113_0x5a1be6(0xc2)]()[a113_0x5a1be6(0xc1)](),'variables':z['array'](TemplateVariableDefSchema)[a113_0x5a1be6(0xc6)]([])});