@treasuredata/tdx 0.16.1 → 0.16.2
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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +19 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/types.d.ts +26 -0
- package/dist/sdk/claude-agent/types.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/query/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a109_0x6c3c6d=a109_0x202e;(function(_0x40bf99,_0x46ce2e){const _0x25bd58=a109_0x202e,_0x3fb0de=_0x40bf99();while(!![]){try{const _0x121fb0=-parseInt(_0x25bd58(0x10e))/0x1*(parseInt(_0x25bd58(0x106))/0x2)+-parseInt(_0x25bd58(0x105))/0x3*(-parseInt(_0x25bd58(0x107))/0x4)+-parseInt(_0x25bd58(0xea))/0x5+-parseInt(_0x25bd58(0xf5))/0x6*(-parseInt(_0x25bd58(0xe7))/0x7)+-parseInt(_0x25bd58(0xec))/0x8+parseInt(_0x25bd58(0x104))/0x9+parseInt(_0x25bd58(0xff))/0xa*(-parseInt(_0x25bd58(0xdf))/0xb);if(_0x121fb0===_0x46ce2e)break;else _0x3fb0de['push'](_0x3fb0de['shift']());}catch(_0x1409a1){_0x3fb0de['push'](_0x3fb0de['shift']());}}}(a109_0xc195,0xf133f));import{TrinoApiClient}from'../client/trino-api-client.js';function a109_0x202e(_0x2dabab,_0x398734){_0x2dabab=_0x2dabab-0xd6;const _0xc19526=a109_0xc195();let _0x202e1c=_0xc19526[_0x2dabab];return _0x202e1c;}import{escapeStringLiteral,buildLikePattern}from'../../utils/string-utils.js';import{SDKError,ErrorCode}from'../errors.js';function a109_0xc195(){const _0x877445=['SELECT\x20*\x20FROM\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','\x0a\x20\x20\x20\x20\x20\x20SELECT\x20schema_name\x20AS\x20database_name\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20','13028085ClCVDG','5249697ZICbOj','127358QMwXwk','4chrQkF','Limit\x20must\x20be\x20a\x20positive\x20number','slice','\x20LIMIT\x20','\x0a\x20\x20AND\x20schema_name\x20LIKE\x20','Provide\x20SQL\x20via\x20argument\x20or\x20use\x20--file\x20option.','\x0aORDER\x20BY\x20database_name\x0aLIMIT\x20','19sfNsXb','\x0a\x20\x20\x20\x20\x20\x20','Database\x20pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','INVALID_ARGUMENT','\x0a\x20\x20AND\x20table_name\x20LIKE\x20','trinoApiClient','\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20ordinal_position\x0a\x20\x20\x20\x20','Provide\x20a\x20valid\x20database\x20name\x20or\x20omit\x20to\x20list\x20tables\x20from\x20all\x20databases.','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','length','11HFifgO','\x0aORDER\x20BY\x20table_name\x0aLIMIT\x20','execute','Table\x20name\x20is\x20required','data','\x0aORDER\x20BY\x20database_name,\x20table_name\x0aLIMIT\x20','Database\x20name\x20is\x20required','logger','1979551FNfGwR','Usage:\x20tdx\x20show\x20<database.table>','executeQuery','3560075oBqmhu','MISSING_ARGUMENT','1602656oYoEli','Provide\x20a\x20positive\x20number\x20for\x20limit\x20(e.g.,\x20100).','showTable','isInteger','\x20ESCAPE\x20\x27\x5c\x27','validateTable','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20schema_name\x20=\x20','describeTable','\x0a\x20\x20\x20\x20','12iETkZY','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22user_*\x22)\x20or\x20omit\x20to\x20list\x20all\x20tables.','Usage:\x20tdx\x20describe\x20<database.table>','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_schema\x20AS\x20database_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20','trim','\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20','SQL\x20query\x20is\x20required','Limit\x20must\x20be\x20a\x20positive\x20integer','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20the\x20pattern\x20to\x20list\x20all\x20databases.','6528350ZSzyCC','\x0a\x20\x20AND\x20table_schema\x20LIKE\x20'];a109_0xc195=function(){return _0x877445;};return a109_0xc195();}import{DEFAULT_LISTING_LIMIT}from'../../core/constants.js';export class QuerySDK{[a109_0x6c3c6d(0xda)];constructor(_0x34d08d){const _0x264ba2=a109_0x6c3c6d;this[_0x264ba2(0xda)]=new TrinoApiClient(_0x34d08d,_0x34d08d[_0x264ba2(0xe6)]);}async[a109_0x6c3c6d(0xe1)](_0x5711c1,_0x2a2f97){const _0x5c2127=a109_0x6c3c6d;if(!_0x5711c1||_0x5711c1[_0x5c2127(0xfa)]()[_0x5c2127(0xde)]===0x0)throw new SDKError(ErrorCode[_0x5c2127(0xeb)],_0x5c2127(0xfc),undefined,{'helpText':_0x5c2127(0x10c)});return await this[_0x5c2127(0xda)][_0x5c2127(0xe9)](_0x5711c1,_0x2a2f97);}async['listDatabases'](_0x55f7f2,_0x251cee=DEFAULT_LISTING_LIMIT){const _0x272e58=a109_0x6c3c6d;if(_0x55f7f2!==undefined&&_0x55f7f2[_0x272e58(0xfa)]()['length']===0x0)throw new SDKError(ErrorCode[_0x272e58(0xd8)],'Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':_0x272e58(0xfe)});if(_0x251cee<=0x0)throw new SDKError(ErrorCode[_0x272e58(0xd8)],_0x272e58(0x108),undefined,{'helpText':_0x272e58(0xed)});let _0x123f6e=_0x272e58(0x103);_0x55f7f2&&(_0x123f6e+=_0x272e58(0x10b)+buildLikePattern(_0x55f7f2)+_0x272e58(0xf0));_0x123f6e+=_0x272e58(0x10d)+_0x251cee;const _0x3ffded=await this[_0x272e58(0xda)]['executeQuery'](_0x123f6e[_0x272e58(0xfa)]());return _0x3ffded[_0x272e58(0xe3)];}async['listTables'](_0x3e6a7c,_0x362550,_0x3caed0,_0x4c224b=DEFAULT_LISTING_LIMIT){const _0x2b4cd9=a109_0x6c3c6d;if(_0x3e6a7c!==undefined&&_0x3e6a7c['trim']()[_0x2b4cd9(0xde)]===0x0)throw new SDKError(ErrorCode[_0x2b4cd9(0xd8)],'Database\x20name\x20cannot\x20be\x20empty\x20or\x20whitespace-only',undefined,{'helpText':_0x2b4cd9(0xdc)});if(_0x362550!==undefined&&_0x362550[_0x2b4cd9(0xfa)]()['length']===0x0)throw new SDKError(ErrorCode[_0x2b4cd9(0xd8)],_0x2b4cd9(0xf8),undefined,{'helpText':_0x2b4cd9(0xf6)});if(_0x3caed0!==undefined&&_0x3caed0[_0x2b4cd9(0xfa)]()[_0x2b4cd9(0xde)]===0x0)throw new SDKError(ErrorCode[_0x2b4cd9(0xd8)],_0x2b4cd9(0xd7),undefined,{'helpText':'Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20to\x20search\x20all\x20databases.'});if(_0x4c224b<=0x0)throw new SDKError(ErrorCode[_0x2b4cd9(0xd8)],'Limit\x20must\x20be\x20a\x20positive\x20number',undefined,{'helpText':_0x2b4cd9(0xed)});let _0x3b7a41;_0x3e6a7c?(_0x3b7a41=_0x2b4cd9(0x102)+escapeStringLiteral(_0x3e6a7c)+_0x2b4cd9(0xd6),_0x362550&&(_0x3b7a41+=_0x2b4cd9(0xd9)+buildLikePattern(_0x362550)+_0x2b4cd9(0xf0)),_0x3b7a41+=_0x2b4cd9(0xe0)+_0x4c224b):(_0x3b7a41=_0x2b4cd9(0xf9),_0x3caed0&&(_0x3b7a41+=_0x2b4cd9(0x100)+buildLikePattern(_0x3caed0)+_0x2b4cd9(0xf0)),_0x362550&&(_0x3b7a41+=_0x2b4cd9(0xd9)+buildLikePattern(_0x362550)+_0x2b4cd9(0xf0)),_0x3b7a41+=_0x2b4cd9(0xe4)+_0x4c224b);const _0xfc403=await this[_0x2b4cd9(0xda)]['executeQuery'](_0x3b7a41['trim']());return _0xfc403[_0x2b4cd9(0xe3)];}async['validateDatabase'](_0x462cf7){const _0x16edab=a109_0x6c3c6d,_0x493551=(_0x16edab(0xf2)+escapeStringLiteral(_0x462cf7)+_0x16edab(0xf4))[_0x16edab(0xfa)](),_0x5ac3d6=await this[_0x16edab(0xda)][_0x16edab(0xe9)](_0x493551);return _0x5ac3d6[_0x16edab(0xe3)][_0x16edab(0xde)]>0x0;}async[a109_0x6c3c6d(0xf1)](_0x1e2d0e,_0x4e2c85){const _0x5809b7=a109_0x6c3c6d,_0x34dd90=(_0x5809b7(0xdd)+escapeStringLiteral(_0x1e2d0e)+_0x5809b7(0xfb)+escapeStringLiteral(_0x4e2c85)+_0x5809b7(0xf4))['trim'](),_0x458c14=await this['trinoApiClient'][_0x5809b7(0xe9)](_0x34dd90);return _0x458c14[_0x5809b7(0xe3)]['length']>0x0;}async[a109_0x6c3c6d(0xf3)](_0x5ea396,_0x24bc63){const _0x43156b=a109_0x6c3c6d;if(!_0x5ea396||_0x5ea396[_0x43156b(0xfa)]()[_0x43156b(0xde)]===0x0)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],'Database\x20name\x20is\x20required',undefined,{'helpText':_0x43156b(0xf7)});if(!_0x24bc63||_0x24bc63[_0x43156b(0xfa)]()['length']===0x0)throw new SDKError(ErrorCode[_0x43156b(0xeb)],'Table\x20name\x20is\x20required',undefined,{'helpText':'Usage:\x20tdx\x20describe\x20<database.table>'});const _0x143af6=('\x0a\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20column_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20data_type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20is_nullable\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.columns\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20'+escapeStringLiteral(_0x5ea396)+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20'+escapeStringLiteral(_0x24bc63)+_0x43156b(0xdb))[_0x43156b(0xfa)](),_0x54768b=await this[_0x43156b(0xda)][_0x43156b(0xe9)](_0x143af6);return _0x54768b[_0x43156b(0xe3)];}async[a109_0x6c3c6d(0xee)](_0x1bd053,_0x48fb86,_0x2c5321=0x28,_0x48afba){const _0x28d6e0=a109_0x6c3c6d;if(!_0x1bd053||_0x1bd053[_0x28d6e0(0xfa)]()[_0x28d6e0(0xde)]===0x0)throw new SDKError(ErrorCode[_0x28d6e0(0xeb)],_0x28d6e0(0xe5),undefined,{'helpText':_0x28d6e0(0xe8)});if(!_0x48fb86||_0x48fb86['trim']()[_0x28d6e0(0xde)]===0x0)throw new SDKError(ErrorCode[_0x28d6e0(0xeb)],_0x28d6e0(0xe2),undefined,{'helpText':_0x28d6e0(0xe8)});if(!Number[_0x28d6e0(0xef)](_0x2c5321)||_0x2c5321<=0x0)throw new SDKError(ErrorCode[_0x28d6e0(0xd8)],_0x28d6e0(0xfd),undefined,{'helpText':'Use\x20--limit\x20<number>\x20to\x20specify\x20row\x20limit\x20(must\x20be\x20positive).'});const _0xde9508=escapeStringLiteral(_0x1bd053)[_0x28d6e0(0x109)](0x1,-0x1)+'.'+escapeStringLiteral(_0x48fb86)['slice'](0x1,-0x1),_0x28d6d7=_0x28d6e0(0x101)+_0xde9508+_0x28d6e0(0x10a)+_0x2c5321,_0x7aa9ff=await this[_0x28d6e0(0xda)][_0x28d6e0(0xe9)](_0x28d6d7,{'catalog':_0x48afba,'schema':_0x1bd053});return _0x7aa9ff;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31a558,_0x43dd52){const _0x5c83d4=a110_0x3bb1,_0x298038=_0x31a558();while(!![]){try{const _0x443cb4=-parseInt(_0x5c83d4(0x11b))/0x1*(-parseInt(_0x5c83d4(0x125))/0x2)+-parseInt(_0x5c83d4(0x114))/0x3+parseInt(_0x5c83d4(0x122))/0x4*(parseInt(_0x5c83d4(0x126))/0x5)+-parseInt(_0x5c83d4(0x11a))/0x6+-parseInt(_0x5c83d4(0x12b))/0x7+parseInt(_0x5c83d4(0x119))/0x8+parseInt(_0x5c83d4(0x115))/0x9*(parseInt(_0x5c83d4(0x127))/0xa);if(_0x443cb4===_0x43dd52)break;else _0x298038['push'](_0x298038['shift']());}catch(_0x5da5bb){_0x298038['push'](_0x298038['shift']());}}}(a110_0xd5b7,0xe88d0));import{readFileSync}from'fs';import{createInterface}from'readline';export function stripSqlComments(_0x188ddc){const _0x2e9727=a110_0x3bb1;let _0x598093=_0x188ddc[_0x2e9727(0x12e)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x598093=_0x598093[_0x2e9727(0x12e)](/--.*$/gm,''),_0x598093['trim']();}function isEscaped(_0x518f8b,_0x26b2db){let _0x37053b=0x0;for(let _0x5ed88e=_0x26b2db-0x1;_0x5ed88e>=0x0&&_0x518f8b[_0x5ed88e]==='\x5c';_0x5ed88e--){_0x37053b++;}return _0x37053b%0x2===0x1;}export function splitSqlStatements(_0xe68b8f){const _0x4156dd=a110_0x3bb1,_0x36cc71=stripSqlComments(_0xe68b8f);if(!_0x36cc71)throw new Error(_0x4156dd(0x120));const _0x558654=[];let _0x315fa5='',_0xa0d15=![],_0x16f5e8=![],_0x47038d=![];for(let _0x472fdd=0x0;_0x472fdd<_0xe68b8f['length'];_0x472fdd++){const _0x1dc910=_0xe68b8f[_0x472fdd];if(_0x1dc910==='\x27'&&!isEscaped(_0xe68b8f,_0x472fdd)&&!_0x16f5e8&&!_0x47038d)_0xa0d15=!_0xa0d15;else{if(_0x1dc910==='\x22'&&!isEscaped(_0xe68b8f,_0x472fdd)&&!_0xa0d15&&!_0x47038d)_0x16f5e8=!_0x16f5e8;else _0x1dc910==='`'&&!isEscaped(_0xe68b8f,_0x472fdd)&&!_0xa0d15&&!_0x16f5e8&&(_0x47038d=!_0x47038d);}if(_0x1dc910===';'&&!_0xa0d15&&!_0x16f5e8&&!_0x47038d){const _0x32c7e5=_0x315fa5[_0x4156dd(0x11e)]();_0x32c7e5&&_0x558654[_0x4156dd(0x124)](_0x32c7e5),_0x315fa5='';}else _0x315fa5+=_0x1dc910;}const _0x3569e5=_0x315fa5[_0x4156dd(0x11e)]();_0x3569e5&&_0x558654[_0x4156dd(0x124)](_0x3569e5);const _0x404ea2=_0x558654['map'](_0x24b6c0=>_0x24b6c0[_0x4156dd(0x11e)]())[_0x4156dd(0x123)](_0x2991a6=>{const _0x27e533=_0x4156dd,_0x48b03b=stripSqlComments(_0x2991a6);return _0x48b03b[_0x27e533(0x12a)]>0x0;});if(_0x404ea2[_0x4156dd(0x12a)]===0x0)throw new Error(_0x4156dd(0x120));return _0x404ea2;}export function readFileContent(_0x15dc54){const _0x551035=a110_0x3bb1;try{return readFileSync(_0x15dc54,'utf-8');}catch(_0x371341){const _0x59cc62=_0x371341['code'];if(_0x59cc62===_0x551035(0x12d))throw new Error(_0x551035(0x11f)+_0x15dc54+_0x551035(0x12c));else{if(_0x59cc62==='EACCES')throw new Error(_0x551035(0x129)+_0x15dc54+'\x27');else throw new Error('Error\x20reading\x20file\x20\x27'+_0x15dc54+'\x27:\x20'+_0x371341[_0x551035(0x116)]);}}}export function readSqlStatementsFromFile(_0x17155e){const _0x921d7=a110_0x3bb1,_0x1bebc1=readFileContent(_0x17155e);try{return splitSqlStatements(_0x1bebc1);}catch(_0x23f83b){throw new Error(_0x921d7(0x11f)+_0x17155e+'\x27\x20'+_0x23f83b[_0x921d7(0x116)][_0x921d7(0x11d)]());}}export async function readStdinContent(){const _0x2d2623=a110_0x3bb1;if(process['stdin']['isTTY'])throw new Error(_0x2d2623(0x118));return new Promise((_0x4d29fe,_0x4adef3)=>{const _0xd278a7=_0x2d2623,_0xb53b3c=[],_0x3e8bb7=createInterface({'input':process[_0xd278a7(0x128)],'terminal':![]});_0x3e8bb7['on'](_0xd278a7(0x12f),_0x453c5d=>{const _0x478b26=_0xd278a7;_0xb53b3c[_0x478b26(0x124)](_0x453c5d);}),_0x3e8bb7['on'](_0xd278a7(0x131),()=>{const _0x4ddaa3=_0xd278a7;_0x4d29fe(_0xb53b3c[_0x4ddaa3(0x121)]('\x0a'));}),_0x3e8bb7['on']('error',_0x57ebab=>{const _0x12a33e=_0xd278a7;_0x3e8bb7[_0x12a33e(0x131)](),_0x4adef3(new Error(_0x12a33e(0x11c)+_0x57ebab['message']));});});}export async function readSqlStatementsFromStdin(){const _0xb664d2=a110_0x3bb1,_0x3b5183=await readStdinContent();try{return splitSqlStatements(_0x3b5183);}catch(_0x51767f){throw new Error(_0xb664d2(0x117)+_0x51767f[_0xb664d2(0x116)][_0xb664d2(0x11d)]());}}export function isSqlFilePath(_0xf2a80c){const _0x3247db=a110_0x3bb1;return/\w\.sql$/[_0x3247db(0x130)](_0xf2a80c);}function a110_0x3bb1(_0x4cb4e9,_0xc17999){_0x4cb4e9=_0x4cb4e9-0x114;const _0xd5b76b=a110_0xd5b7();let _0x3bb1ac=_0xd5b76b[_0x4cb4e9];return _0x3bb1ac;}function a110_0xd5b7(){const _0x523842=['message','stdin\x20','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','3490672YBkazR','2493396ivsEqK','261644TxpgRZ','Error\x20reading\x20from\x20stdin:\x20','toLowerCase','trim','File\x20\x27','Content\x20contains\x20no\x20SQL\x20statements','join','274156uMfUxf','filter','push','8WdetTu','115ONfHFG','330KlAwAo','stdin','Permission\x20denied\x20reading\x20file\x20\x27','length','12795853bbLIsk','\x27\x20not\x20found','ENOENT','replace','line','test','close','2068860YiEVIH','225378YUwXhN'];a110_0xd5b7=function(){return _0x523842;};return a110_0xd5b7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4c5b6f,_0x28bd02){const _0x5b45a5=a111_0x5430,_0x3e4318=_0x4c5b6f();while(!![]){try{const _0x38c1e0=-parseInt(_0x5b45a5(0x179))/0x1*(-parseInt(_0x5b45a5(0x18b))/0x2)+parseInt(_0x5b45a5(0x171))/0x3+parseInt(_0x5b45a5(0x1d1))/0x4*(parseInt(_0x5b45a5(0x1d8))/0x5)+-parseInt(_0x5b45a5(0x170))/0x6+-parseInt(_0x5b45a5(0x1d5))/0x7*(-parseInt(_0x5b45a5(0x1c0))/0x8)+-parseInt(_0x5b45a5(0x162))/0x9+-parseInt(_0x5b45a5(0x1e3))/0xa*(parseInt(_0x5b45a5(0x1c4))/0xb);if(_0x38c1e0===_0x28bd02)break;else _0x3e4318['push'](_0x3e4318['shift']());}catch(_0x2b6f9c){_0x3e4318['push'](_0x3e4318['shift']());}}}(a111_0x1792,0xc472f));import*as a111_0x40a4dd from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x370f57,_0x4e24fb){const _0x299aa9=a111_0x5430,_0x4e9389=_0x370f57[_0x299aa9(0x17e)]&&'type'in _0x370f57[_0x299aa9(0x17e)]&&_0x370f57[_0x299aa9(0x17e)][_0x299aa9(0x1a0)];return{'type':_0x299aa9(0x1ac),'name':_0x370f57['name'],..._0x370f57[_0x299aa9(0x167)]&&{'description':_0x370f57[_0x299aa9(0x167)]},..._0x4e24fb&&{'folder':_0x4e24fb},..._0x4e9389&&{'rule':apiRuleToYaml(_0x370f57[_0x299aa9(0x17e)])},..._0x370f57[_0x299aa9(0x176)]!==undefined&&{'kind':_0x370f57['kind']===0x0?_0x299aa9(0x182):_0x370f57['kind']===0x1?_0x299aa9(0x1b2):_0x299aa9(0x17b)},..._0x370f57['isVisible']!==undefined&&{'visible':_0x370f57['isVisible']}};}export async function segmentResponseToDef(_0x4b95fc,_0x1147c5,_0x1e84ff){const _0x37ee2c=a111_0x5430,_0x4b6249=segmentResponseToDefSync(_0x4b95fc,_0x1e84ff);if(!_0x1147c5||!_0x1147c5[_0x37ee2c(0x18e)])return _0x4b6249;return _0x4b6249[_0x37ee2c(0x17e)]&&(_0x4b6249[_0x37ee2c(0x17e)]=await resolveRuleSegmentRefs(_0x4b6249[_0x37ee2c(0x17e)],_0x1147c5[_0x37ee2c(0x18e)])),_0x4b6249;}export function apiRuleToYaml(_0x5c2ab5){const _0xe5d2d1=a111_0x5430,_0x3af203=(_0x5c2ab5[_0xe5d2d1(0x17c)]||[])[_0xe5d2d1(0x1d4)](apiConditionToYaml);if(_0x3af203['length']===0x1&&!_0x5c2ab5['description']&&'type'in _0x3af203[0x0]&&(_0x3af203[0x0][_0xe5d2d1(0x1a0)]===_0xe5d2d1(0x19a)||_0x3af203[0x0]['type']==='Or')){const _0x4a676b=_0x3af203[0x0];if(_0x4a676b['type']===_0x5c2ab5[_0xe5d2d1(0x1a0)]&&_0x4a676b[_0xe5d2d1(0x17c)])return{'type':_0x5c2ab5[_0xe5d2d1(0x1a0)],'conditions':_0x4a676b[_0xe5d2d1(0x17c)],..._0x4a676b[_0xe5d2d1(0x167)]&&{'description':_0x4a676b['description']}};}return{'type':_0x5c2ab5['type'],'conditions':_0x3af203,..._0x5c2ab5[_0xe5d2d1(0x167)]&&{'description':_0x5c2ab5['description']}};}export async function resolveRuleSegmentRefs(_0x2ce2c7,_0x2371da){const _0x5ac795=a111_0x5430,_0x11c5a3=await Promise[_0x5ac795(0x16b)](_0x2ce2c7[_0x5ac795(0x17c)][_0x5ac795(0x1d4)](_0x4d3564=>resolveConditionSegmentRefs(_0x4d3564,_0x2371da)));return{..._0x2ce2c7,'conditions':_0x11c5a3};}async function resolveConditionSegmentRefs(_0x23de38,_0xb3702d){const _0x390e3a=a111_0x5430;if(_0x390e3a(0x1ac)in _0x23de38&&(_0x23de38[_0x390e3a(0x1a0)]==='include'||_0x23de38['type']==='exclude')){const _0x5b0830=_0x23de38;if(/^\d+$/[_0x390e3a(0x1b1)](_0x5b0830[_0x390e3a(0x1ac)])){const _0x14c833=await _0xb3702d(_0x5b0830[_0x390e3a(0x1ac)]);return{..._0x5b0830,'segment':_0x14c833};}return _0x23de38;}if(_0x390e3a(0x17c)in _0x23de38&&_0x23de38[_0x390e3a(0x17c)]){const _0x4cfcda=_0x23de38,_0x362ee0=await Promise['all'](_0x4cfcda['conditions'][_0x390e3a(0x1d4)](_0x54bfa8=>resolveConditionSegmentRefs(_0x54bfa8,_0xb3702d)));return{..._0x4cfcda,'conditions':_0x362ee0};}if('filter'in _0x23de38&&_0x23de38[_0x390e3a(0x165)]){const _0x3714cd=_0x23de38,_0x278241=await resolveRuleSegmentRefs(_0x3714cd[_0x390e3a(0x165)],_0xb3702d);return{..._0x3714cd,'filter':_0x278241};}return _0x23de38;}export async function resolveRuleSegmentIds(_0x1bb231,_0x559ba1){const _0x2eb928=await Promise['all'](_0x1bb231['conditions']['map'](_0x4f70bd=>resolveConditionSegmentIds(_0x4f70bd,_0x559ba1)));return{..._0x1bb231,'conditions':_0x2eb928};}async function resolveConditionSegmentIds(_0x3700ba,_0x3d2bb7){const _0x6b4966=a111_0x5430;if(_0x6b4966(0x1ac)in _0x3700ba&&(_0x3700ba[_0x6b4966(0x1a0)]===_0x6b4966(0x1d0)||_0x3700ba[_0x6b4966(0x1a0)]==='exclude')){const _0xbe5608=_0x3700ba;if(!/^\d+$/[_0x6b4966(0x1b1)](_0xbe5608[_0x6b4966(0x1ac)])){const _0x53c7b4=await _0x3d2bb7(_0xbe5608[_0x6b4966(0x1ac)]);return{..._0xbe5608,'segment':_0x53c7b4};}return _0x3700ba;}if(_0x6b4966(0x17c)in _0x3700ba&&_0x3700ba[_0x6b4966(0x17c)]){const _0x2ea38a=_0x3700ba,_0x5ece9a=await Promise['all'](_0x2ea38a['conditions'][_0x6b4966(0x1d4)](_0x43aa9b=>resolveConditionSegmentIds(_0x43aa9b,_0x3d2bb7)));return{..._0x2ea38a,'conditions':_0x5ece9a};}if(_0x6b4966(0x165)in _0x3700ba&&_0x3700ba[_0x6b4966(0x165)]){const _0x47048d=_0x3700ba,_0x3a3dfd=await resolveRuleSegmentIds(_0x47048d[_0x6b4966(0x165)],_0x3d2bb7);return{..._0x47048d,'filter':_0x3a3dfd};}return _0x3700ba;}function apiConditionToYaml(_0x375f1d){const _0x58f7ed=a111_0x5430;if(_0x375f1d[_0x58f7ed(0x1a0)]===_0x58f7ed(0x19a)||_0x375f1d['type']==='Or'){if(_0x375f1d[_0x58f7ed(0x17c)]){const _0x2c1bdf=_0x375f1d[_0x58f7ed(0x17c)]['map'](apiConditionToYaml);if(_0x2c1bdf['length']===0x1&&!_0x375f1d[_0x58f7ed(0x167)])return _0x2c1bdf[0x0];return{'type':_0x375f1d[_0x58f7ed(0x1a0)],'conditions':_0x2c1bdf,..._0x375f1d[_0x58f7ed(0x167)]&&{'description':_0x375f1d[_0x58f7ed(0x167)]}};}}if(_0x375f1d[_0x58f7ed(0x1a0)]===_0x58f7ed(0x1dd)&&_0x375f1d[_0x58f7ed(0x1b5)]&&_0x375f1d[_0x58f7ed(0x1b4)]){const _0x32c0f4=_0x375f1d[_0x58f7ed(0x1b5)]['aggregation']?{'type':_0x375f1d[_0x58f7ed(0x1b5)]['aggregation'][_0x58f7ed(0x1a0)],..._0x375f1d[_0x58f7ed(0x1b5)][_0x58f7ed(0x174)][_0x58f7ed(0x1ed)]&&{'groupingColumns':_0x375f1d['leftValue']['aggregation']['groupingColumns']}}:undefined;return{'type':_0x58f7ed(0x1dd),'attribute':_0x375f1d[_0x58f7ed(0x1b5)]['name']||'','operator':apiOperatorToYaml(_0x375f1d['operator']),..._0x375f1d['arrayMatching']&&_0x375f1d['arrayMatching']!==_0x58f7ed(0x1cf)?{'arrayMatching':_0x375f1d[_0x58f7ed(0x169)]}:{},..._0x375f1d[_0x58f7ed(0x1be)]?{'exclude':_0x375f1d[_0x58f7ed(0x1be)]}:{},..._0x32c0f4?{'aggregation':_0x32c0f4}:{},..._0x375f1d[_0x58f7ed(0x1b5)][_0x58f7ed(0x1db)]?{'source':_0x375f1d[_0x58f7ed(0x1b5)][_0x58f7ed(0x1db)][_0x58f7ed(0x1c7)]}:{},..._0x375f1d[_0x58f7ed(0x1b5)][_0x58f7ed(0x165)]?{'filter':apiRuleToYaml(_0x375f1d['leftValue'][_0x58f7ed(0x165)])}:{},..._0x375f1d['limit']!==undefined&&_0x375f1d[_0x58f7ed(0x1b8)]!==null?{'limit':_0x375f1d[_0x58f7ed(0x1b8)]}:{}};}if(_0x375f1d[_0x58f7ed(0x1a0)]==='Reference'&&_0x375f1d['id'])return{'type':_0x375f1d[_0x58f7ed(0x1be)]?_0x58f7ed(0x1be):_0x58f7ed(0x1d0),'segment':_0x375f1d['id']};return{'type':_0x58f7ed(0x19a),'conditions':[]};}function isTemporalOperator(_0x27cf0a){const _0x370c66=a111_0x5430;return _0x27cf0a==='TimeWithinPast'||_0x27cf0a===_0x370c66(0x1a4);}function getEffectiveValue(_0x253594){const _0x1d1766=a111_0x5430,_0x1e5e74=_0x253594[_0x1d1766(0x1d7)];return _0x253594['value']??_0x1e5e74;}function apiOperatorToYaml(_0x7c42c4){const _0x1c1909=a111_0x5430;let _0x18ccd1;if(_0x7c42c4['rightValues']&&_0x7c42c4[_0x1c1909(0x197)][_0x1c1909(0x1e0)]>0x0)_0x18ccd1=_0x7c42c4['rightValues'];else{if(_0x7c42c4[_0x1c1909(0x187)]!==undefined)_0x18ccd1=_0x7c42c4[_0x1c1909(0x187)];else isTemporalOperator(_0x7c42c4[_0x1c1909(0x1a0)])&&_0x7c42c4[_0x1c1909(0x1ab)]!==undefined&&(_0x18ccd1=_0x7c42c4[_0x1c1909(0x1ab)]);}return{'type':mapApiOperatorType(_0x7c42c4[_0x1c1909(0x1a0)]),..._0x7c42c4[_0x1c1909(0x1eb)]&&{'not':_0x7c42c4['not']},..._0x18ccd1!==undefined&&{'value':_0x18ccd1},..._0x7c42c4[_0x1c1909(0x1d3)]&&{'unit':_0x7c42c4[_0x1c1909(0x1d3)]}};}function mapApiOperatorType(_0xde13bf){return _0xde13bf;}export function segmentDefToCreateRequest(_0x707fed,_0x4c553b){const _0x159312=a111_0x5430,_0x1ffc60={'name':_0x707fed[_0x159312(0x1c7)]};return _0x707fed[_0x159312(0x167)]&&(_0x1ffc60['description']=_0x707fed[_0x159312(0x167)]),_0x707fed[_0x159312(0x17e)]&&(_0x1ffc60[_0x159312(0x17e)]=yamlRuleToApi(_0x707fed[_0x159312(0x17e)])),_0x707fed['kind']&&(_0x1ffc60[_0x159312(0x176)]=_0x707fed[_0x159312(0x176)]==='batch'?0x0:_0x707fed[_0x159312(0x176)]===_0x159312(0x1b2)?0x1:0x2),_0x707fed['visible']!==undefined&&(_0x1ffc60[_0x159312(0x1b3)]=_0x707fed['visible']),_0x4c553b&&(_0x1ffc60['segmentFolderId']=_0x4c553b),_0x1ffc60;}export function segmentDefToUpdateRequest(_0x3380b9){const _0x2466a3=a111_0x5430,_0x557573={'name':_0x3380b9[_0x2466a3(0x1c7)]};return _0x3380b9[_0x2466a3(0x167)]!==undefined&&(_0x557573[_0x2466a3(0x167)]=_0x3380b9[_0x2466a3(0x167)]),_0x3380b9[_0x2466a3(0x17e)]&&(_0x557573[_0x2466a3(0x17e)]=yamlRuleToApi(_0x3380b9[_0x2466a3(0x17e)])),_0x3380b9[_0x2466a3(0x176)]&&(_0x557573[_0x2466a3(0x176)]=_0x3380b9[_0x2466a3(0x176)]==='batch'?0x0:_0x3380b9[_0x2466a3(0x176)]===_0x2466a3(0x1b2)?0x1:0x2),_0x557573;}export function yamlRuleToApi(_0x3ea9b4,_0x5a3db1=![]){const _0x365ea1=a111_0x5430,_0xb1735d=_0x3ea9b4[_0x365ea1(0x17c)][_0x365ea1(0x1d4)](yamlConditionToApi);if(_0x5a3db1){const _0x53bf9b=_0xb1735d[_0x365ea1(0x163)](_0x186dc2=>_0x186dc2[_0x365ea1(0x1a0)]==='And'||_0x186dc2[_0x365ea1(0x1a0)]==='Or');if(!_0x53bf9b&&_0xb1735d[_0x365ea1(0x1e0)]>0x0)return{'type':_0x3ea9b4[_0x365ea1(0x1a0)],'conditions':[{'type':'And','description':_0x3ea9b4[_0x365ea1(0x167)]||'','conditions':_0xb1735d}]};}return{'type':_0x3ea9b4[_0x365ea1(0x1a0)],'conditions':_0xb1735d,..._0x3ea9b4[_0x365ea1(0x167)]&&{'description':_0x3ea9b4[_0x365ea1(0x167)]}};}function yamlConditionToApi(_0x3cd8b5){const _0x5dc037=a111_0x5430;if(_0x5dc037(0x1ac)in _0x3cd8b5&&(_0x3cd8b5[_0x5dc037(0x1a0)]===_0x5dc037(0x1d0)||_0x3cd8b5['type']===_0x5dc037(0x1be))){const _0x4399f7=_0x3cd8b5;return{'type':'Reference','id':_0x4399f7[_0x5dc037(0x1ac)],'exclude':_0x4399f7['type']===_0x5dc037(0x1be)};}if(_0x5dc037(0x1a0)in _0x3cd8b5&&(_0x3cd8b5[_0x5dc037(0x1a0)]===_0x5dc037(0x19a)||_0x3cd8b5['type']==='Or')){const _0x48f293=_0x3cd8b5;return{'type':_0x48f293[_0x5dc037(0x1a0)],'conditions':_0x48f293[_0x5dc037(0x17c)][_0x5dc037(0x1d4)](yamlConditionToApi),..._0x48f293[_0x5dc037(0x167)]&&{'description':_0x48f293['description']}};}const _0x243f8b=_0x3cd8b5,_0x4e5037={'type':_0x5dc037(0x1dd),'leftValue':buildLeftValue(_0x243f8b),'operator':yamlOperatorToApi(_0x243f8b[_0x5dc037(0x1b4)]),'exclude':_0x243f8b[_0x5dc037(0x1be)]??![],'arrayMatching':_0x243f8b[_0x5dc037(0x169)]??'any'};return _0x243f8b[_0x5dc037(0x1b8)]!==undefined&&(_0x4e5037[_0x5dc037(0x1b8)]=_0x243f8b[_0x5dc037(0x1b8)]),_0x4e5037;}function buildLeftValue(_0x12aae2){const _0x5f347f=a111_0x5430,_0x4ba9dd={'name':_0x12aae2[_0x5f347f(0x1b0)]};return _0x12aae2['aggregation']&&(_0x4ba9dd[_0x5f347f(0x174)]={'type':_0x12aae2[_0x5f347f(0x174)][_0x5f347f(0x1a0)],..._0x12aae2[_0x5f347f(0x174)][_0x5f347f(0x1ed)]&&{'groupingColumns':_0x12aae2[_0x5f347f(0x174)][_0x5f347f(0x1ed)]}}),_0x12aae2[_0x5f347f(0x1db)]&&(_0x4ba9dd[_0x5f347f(0x1db)]={'name':_0x12aae2[_0x5f347f(0x1db)]}),_0x12aae2[_0x5f347f(0x165)]&&(_0x4ba9dd[_0x5f347f(0x165)]=yamlRuleToApi(_0x12aae2[_0x5f347f(0x165)])),_0x4ba9dd;}function yamlOperatorToApi(_0x2307fc){const _0x53e03a=a111_0x5430,_0x4a21da={'type':mapYamlOperatorType(_0x2307fc[_0x53e03a(0x1a0)]),'not':_0x2307fc['not']??![]},_0x3593e0=getEffectiveValue(_0x2307fc);if(_0x3593e0!==undefined){if(Array[_0x53e03a(0x1c2)](_0x3593e0))_0x4a21da['rightValues']=_0x3593e0;else isTemporalOperator(_0x2307fc[_0x53e03a(0x1a0)])?_0x4a21da[_0x53e03a(0x1ab)]=_0x3593e0:_0x4a21da[_0x53e03a(0x187)]=_0x3593e0;}return _0x2307fc[_0x53e03a(0x1d3)]&&(_0x4a21da['unit']=_0x2307fc[_0x53e03a(0x1d3)]),_0x4a21da;}function mapYamlOperatorType(_0x5e2205){return _0x5e2205;}function a111_0x5430(_0x284984,_0x9f8de8){_0x284984=_0x284984-0x162;const _0x17921f=a111_0x1792();let _0x5430f5=_0x17921f[_0x284984];return _0x5430f5;}export function toYamlString(_0x11b735){const _0x4bc0f6=a111_0x5430,_0x14f2c8=JSON[_0x4bc0f6(0x1b7)](JSON[_0x4bc0f6(0x1bf)](_0x11b735)),_0x5b0fab=a111_0x40a4dd[_0x4bc0f6(0x1bf)](_0x14f2c8,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4bc0f6(0x178)}),_0x25fb05=[_0x4bc0f6(0x17d)];let _0x5a6a3b=_0x5b0fab;for(const _0x18f671 of _0x25fb05){_0x5a6a3b=_0x5a6a3b[_0x4bc0f6(0x1ae)](new RegExp('^('+_0x18f671+')','m'),(_0x5192c4,_0x3a6cd4,_0x699061)=>{if(_0x699061===0x0||_0x5a6a3b[_0x699061-0x1]==='\x0a'&&_0x5a6a3b[_0x699061-0x2]==='\x0a')return _0x3a6cd4;return'\x0a'+_0x3a6cd4;});}return _0x5a6a3b;}export function parseYamlString(_0x1d38eb){const _0x3b94a8=a111_0x5430,_0xaaec35=a111_0x40a4dd[_0x3b94a8(0x1b7)](_0x1d38eb);if(!_0xaaec35['name'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(_0xaaec35['type']&&_0xaaec35['type']!==_0x3b94a8(0x1ac))throw new Error(_0x3b94a8(0x1e4)+_0xaaec35[_0x3b94a8(0x1a0)]);return _0xaaec35;}export function isSegmentYaml(_0x13db3c){const _0x41718d=a111_0x5430;if(typeof _0x13db3c!=='object'||_0x13db3c===null)return![];const _0x40a0b2=_0x13db3c;return _0x40a0b2[_0x41718d(0x1a0)]===_0x41718d(0x1ac)||_0x40a0b2[_0x41718d(0x1a0)]===undefined;}export function generateTemplate(_0x258311='New\x20Segment'){const _0x236cf8=a111_0x5430,_0x42c7a3={'type':_0x236cf8(0x1ac),'name':_0x258311,'description':_0x236cf8(0x180),'rule':{'type':'And','conditions':[{'type':'Value','attribute':_0x236cf8(0x1e8),'operator':{'type':_0x236cf8(0x172),'value':_0x236cf8(0x1ab)}}]}};return toYamlString(_0x42c7a3);}export function segmentToYamlString(_0x3ef93e){const _0x334ec1=a111_0x5430,_0x702bc=JSON['parse'](JSON[_0x334ec1(0x1bf)](_0x3ef93e)),_0xde1cb8=a111_0x40a4dd['stringify'](_0x702bc,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x334ec1(0x178)}),_0x42457c=[_0x334ec1(0x17d),_0x334ec1(0x1e1)];let _0x185e6d=_0xde1cb8;for(const _0x2797dd of _0x42457c){_0x185e6d=_0x185e6d[_0x334ec1(0x1ae)](new RegExp('^('+_0x2797dd+')','m'),(_0x395437,_0x1ed646,_0x360bcc)=>{if(_0x360bcc===0x0||_0x185e6d[_0x360bcc-0x1]==='\x0a'&&_0x185e6d[_0x360bcc-0x2]==='\x0a')return _0x1ed646;return'\x0a'+_0x1ed646;});}return _0x185e6d;}export function parseSegmentYamlFile(_0x47fc77){const _0x29bfba=a111_0x5430,_0x1023c4=a111_0x40a4dd[_0x29bfba(0x1b7)](_0x47fc77);if(!_0x1023c4['name'])throw new Error(_0x29bfba(0x1b9));return _0x1023c4;}export function normalizeChildSegmentYaml(_0x3bd947){const _0x30907f=a111_0x5430;return{'type':_0x30907f(0x1ac),'name':_0x3bd947[_0x30907f(0x1c7)],..._0x3bd947['description']!==undefined&&{'description':_0x3bd947[_0x30907f(0x167)]},..._0x3bd947[_0x30907f(0x19e)]!==undefined&&{'folder':_0x3bd947['folder']},..._0x3bd947[_0x30907f(0x17e)]&&{'rule':normalizeRule(_0x3bd947['rule'])},..._0x3bd947[_0x30907f(0x176)]!==undefined&&{'kind':_0x3bd947['kind']},..._0x3bd947['visible']!==undefined&&{'visible':_0x3bd947[_0x30907f(0x1c5)]},..._0x3bd947[_0x30907f(0x19f)]&&{'activations':_0x3bd947[_0x30907f(0x19f)][_0x30907f(0x1d4)](normalizeActivation)}};}export function normalizeRule(_0x11b2c6){const _0x460017=a111_0x5430;return{'type':_0x11b2c6['type'],'conditions':_0x11b2c6['conditions'][_0x460017(0x1d4)](normalizeCondition),..._0x11b2c6[_0x460017(0x167)]!==undefined&&{'description':_0x11b2c6[_0x460017(0x167)]}};}function normalizeCondition(_0x714333){const _0x4a3715=a111_0x5430;if(_0x4a3715(0x1ac)in _0x714333&&(_0x714333[_0x4a3715(0x1a0)]===_0x4a3715(0x1d0)||_0x714333[_0x4a3715(0x1a0)]===_0x4a3715(0x1be))){const _0x7410db=_0x714333;return{'type':_0x7410db[_0x4a3715(0x1a0)],'segment':_0x7410db['segment']};}if('type'in _0x714333&&(_0x714333['type']===_0x4a3715(0x19a)||_0x714333['type']==='Or')){const _0x20de79=_0x714333;return{'type':_0x20de79[_0x4a3715(0x1a0)],'conditions':_0x20de79[_0x4a3715(0x17c)][_0x4a3715(0x1d4)](normalizeCondition),..._0x20de79[_0x4a3715(0x167)]!==undefined&&{'description':_0x20de79[_0x4a3715(0x167)]}};}const _0x45d56f=_0x714333;return{'type':_0x4a3715(0x1dd),'attribute':_0x45d56f['attribute'],'operator':normalizeOperator(_0x45d56f[_0x4a3715(0x1b4)]),..._0x45d56f[_0x4a3715(0x169)]!==undefined&&{'arrayMatching':_0x45d56f[_0x4a3715(0x169)]},..._0x45d56f['exclude']!==undefined&&{'exclude':_0x45d56f[_0x4a3715(0x1be)]},..._0x45d56f[_0x4a3715(0x174)]!==undefined&&{'aggregation':_0x45d56f['aggregation']},..._0x45d56f['source']!==undefined&&{'source':_0x45d56f[_0x4a3715(0x1db)]},..._0x45d56f[_0x4a3715(0x165)]!==undefined&&{'filter':normalizeRule(_0x45d56f[_0x4a3715(0x165)])},..._0x45d56f[_0x4a3715(0x1b8)]!==undefined&&{'limit':_0x45d56f[_0x4a3715(0x1b8)]}};}function normalizeOperator(_0x4698d8){const _0x33d54b=a111_0x5430,_0x41a9f8=getEffectiveValue(_0x4698d8);return{'type':_0x4698d8[_0x33d54b(0x1a0)],..._0x4698d8[_0x33d54b(0x1eb)]!==undefined&&{'not':_0x4698d8[_0x33d54b(0x1eb)]},..._0x41a9f8!==undefined&&{'value':_0x41a9f8},..._0x4698d8['min']!==undefined&&{'min':_0x4698d8['min']},..._0x4698d8['max']!==undefined&&{'max':_0x4698d8['max']},..._0x4698d8[_0x33d54b(0x1d3)]!==undefined&&{'unit':_0x4698d8[_0x33d54b(0x1d3)]},..._0x4698d8[_0x33d54b(0x1ad)]!==undefined&&{'duration':_0x4698d8['duration']},..._0x4698d8[_0x33d54b(0x194)]!==undefined&&{'from':_0x4698d8['from']}};}function normalizeActivation(_0x14e91f){const _0x7e298b=a111_0x5430;return{'name':_0x14e91f[_0x7e298b(0x1c7)],'connection':_0x14e91f[_0x7e298b(0x186)],..._0x14e91f[_0x7e298b(0x167)]!==undefined&&{'description':_0x14e91f[_0x7e298b(0x167)]},..._0x14e91f[_0x7e298b(0x168)]!==undefined&&{'all_columns':_0x14e91f[_0x7e298b(0x168)]},..._0x14e91f['columns']!==undefined&&{'columns':_0x14e91f[_0x7e298b(0x1e5)]},..._0x14e91f[_0x7e298b(0x1da)]!==undefined&&{'behavior':_0x14e91f['behavior']},..._0x14e91f['schedule']!==undefined&&{'schedule':_0x14e91f[_0x7e298b(0x1df)]},..._0x14e91f[_0x7e298b(0x16f)]!==undefined&&{'notification':_0x14e91f['notification']},..._0x14e91f[_0x7e298b(0x1d9)]!==undefined&&{'connector_config':_0x14e91f[_0x7e298b(0x1d9)]},..._0x14e91f['activation_template_id']!==undefined&&{'activation_template_id':_0x14e91f[_0x7e298b(0x192)]}};}export function activationResponseToDef(_0x299dc4,_0x373ce6,_0x5625f4){const _0x4d1d68=a111_0x5430,_0x41a561=_0x299dc4[_0x4d1d68(0x1a5)]||'',_0x56dcbc=_0x5625f4?.[_0x4d1d68(0x17a)](_0x41a561)??_0x41a561,_0x514bca={'name':_0x299dc4[_0x4d1d68(0x1c7)],'connection':_0x56dcbc};_0x299dc4[_0x4d1d68(0x167)]&&(_0x514bca[_0x4d1d68(0x167)]=_0x299dc4[_0x4d1d68(0x167)]);let _0x53bb72=[];_0x299dc4[_0x4d1d68(0x1e5)]&&_0x299dc4[_0x4d1d68(0x1e5)][_0x4d1d68(0x1e0)]>0x0&&(_0x53bb72=_0x299dc4[_0x4d1d68(0x1e5)][_0x4d1d68(0x165)](_0x46aab0=>_0x46aab0&&_0x46aab0[_0x4d1d68(0x1c7)])[_0x4d1d68(0x1d4)](_0x2df4f0=>{const _0xcb2a80=_0x4d1d68;if(_0x2df4f0[_0xcb2a80(0x1a0)]||_0x2df4f0[_0xcb2a80(0x1c9)])return{'name':_0x2df4f0[_0xcb2a80(0x1c7)],..._0x2df4f0[_0xcb2a80(0x1a0)]&&{'type':_0x2df4f0[_0xcb2a80(0x1a0)]},..._0x2df4f0[_0xcb2a80(0x1c9)]&&{'visibility':_0x2df4f0['visibility']}};return _0x2df4f0['name'];}));_0x53bb72[_0x4d1d68(0x1e0)]>0x0&&(_0x514bca[_0x4d1d68(0x1e5)]=_0x53bb72);_0x299dc4[_0x4d1d68(0x177)]!==undefined&&(_0x299dc4[_0x4d1d68(0x177)]===![]&&_0x53bb72[_0x4d1d68(0x1e0)]===0x0?_0x514bca['all_columns']=!![]:_0x514bca[_0x4d1d68(0x168)]=_0x299dc4[_0x4d1d68(0x177)]);const _0x130fd6={};let _0x541fff=![];_0x299dc4['scheduleType']&&(_0x130fd6[_0x4d1d68(0x1a0)]=_0x299dc4[_0x4d1d68(0x185)],_0x541fff=!![]);_0x299dc4[_0x4d1d68(0x18d)]&&(_0x130fd6[_0x4d1d68(0x1b6)]=_0x299dc4['repeatUnit'],_0x541fff=!![]);_0x299dc4[_0x4d1d68(0x184)]!==undefined&&_0x299dc4[_0x4d1d68(0x184)]!==null&&(_0x130fd6[_0x4d1d68(0x1e7)]=_0x299dc4['repeatFrequency'],_0x541fff=!![]);_0x299dc4[_0x4d1d68(0x16d)]&&_0x299dc4[_0x4d1d68(0x16d)][_0x4d1d68(0x1e0)]>0x0&&(_0x130fd6['repeat_sub_frequency']=_0x299dc4[_0x4d1d68(0x16d)],_0x541fff=!![]);_0x299dc4['startAt']!==undefined&&(_0x130fd6[_0x4d1d68(0x1a2)]=_0x299dc4[_0x4d1d68(0x1f0)],_0x541fff=!![]);_0x299dc4[_0x4d1d68(0x1c6)]!==undefined&&(_0x130fd6[_0x4d1d68(0x16e)]=_0x299dc4[_0x4d1d68(0x1c6)],_0x541fff=!![]);_0x299dc4['timezone']&&(_0x130fd6[_0x4d1d68(0x1a7)]=_0x299dc4[_0x4d1d68(0x1a7)],_0x541fff=!![]);_0x541fff&&(_0x514bca[_0x4d1d68(0x1df)]=_0x130fd6);(_0x299dc4[_0x4d1d68(0x19c)]&&_0x299dc4[_0x4d1d68(0x19c)][_0x4d1d68(0x1e0)]>0x0||_0x299dc4['emailRecipients']&&_0x299dc4[_0x4d1d68(0x181)][_0x4d1d68(0x1e0)]>0x0)&&(_0x514bca[_0x4d1d68(0x16f)]={},_0x299dc4[_0x4d1d68(0x19c)]&&_0x299dc4[_0x4d1d68(0x19c)]['length']>0x0&&(_0x514bca[_0x4d1d68(0x16f)][_0x4d1d68(0x1bd)]=_0x299dc4[_0x4d1d68(0x19c)]),_0x299dc4[_0x4d1d68(0x181)]&&_0x299dc4[_0x4d1d68(0x181)]['length']>0x0&&(_0x514bca[_0x4d1d68(0x16f)][_0x4d1d68(0x1a6)]=_0x299dc4[_0x4d1d68(0x181)][_0x4d1d68(0x1d4)](_0x239cf6=>{const _0x44f8fc=_0x4d1d68,_0x40ff14=_0x373ce6?.[_0x44f8fc(0x17a)](_0x239cf6);return _0x40ff14??String(_0x239cf6);})));_0x299dc4[_0x4d1d68(0x1ec)]&&Object[_0x4d1d68(0x193)](_0x299dc4[_0x4d1d68(0x1ec)])[_0x4d1d68(0x1e0)]>0x0&&(_0x514bca[_0x4d1d68(0x1d9)]=normalizeConnectorConfigForYaml(_0x299dc4[_0x4d1d68(0x1ec)]));_0x299dc4[_0x4d1d68(0x1c1)]&&(_0x514bca[_0x4d1d68(0x192)]=_0x299dc4[_0x4d1d68(0x1c1)]);if(_0x299dc4[_0x4d1d68(0x166)]){const _0x30773f={},_0x5b9d4c=_0x299dc4[_0x4d1d68(0x166)];_0x5b9d4c[_0x4d1d68(0x1e5)]&&_0x5b9d4c['columns'][_0x4d1d68(0x1e0)]>0x0&&(_0x30773f[_0x4d1d68(0x1e5)]=_0x5b9d4c['columns'][_0x4d1d68(0x165)](_0x53dd69=>_0x53dd69&&_0x53dd69['name'])[_0x4d1d68(0x1d4)](_0x3455d5=>({'name':_0x3455d5[_0x4d1d68(0x1c7)],..._0x3455d5[_0x4d1d68(0x1a0)]&&{'type':_0x3455d5[_0x4d1d68(0x1a0)]},..._0x3455d5[_0x4d1d68(0x1c9)]&&{'visibility':_0x3455d5[_0x4d1d68(0x1c9)]}}))),_0x5b9d4c[_0x4d1d68(0x16a)]&&(_0x30773f[_0x4d1d68(0x1de)]=_0x5b9d4c[_0x4d1d68(0x16a)]),_0x5b9d4c['joinRow']!==undefined&&(_0x30773f[_0x4d1d68(0x1ba)]=_0x5b9d4c[_0x4d1d68(0x1ea)]),_0x5b9d4c['joinStrategy']&&(_0x30773f[_0x4d1d68(0x1d6)]=_0x5b9d4c['joinStrategy']),_0x5b9d4c[_0x4d1d68(0x19d)]&&(_0x30773f[_0x4d1d68(0x19d)]=_0x5b9d4c[_0x4d1d68(0x19d)]),_0x5b9d4c[_0x4d1d68(0x1a8)]&&_0x5b9d4c[_0x4d1d68(0x1a8)]['length']>0x0&&(_0x30773f[_0x4d1d68(0x1e2)]=_0x5b9d4c[_0x4d1d68(0x1a8)]),Object[_0x4d1d68(0x193)](_0x30773f)['length']>0x0&&(_0x514bca[_0x4d1d68(0x1da)]=_0x30773f);}return _0x514bca;}export function journeyActivationStepToYaml(_0x25884e,_0x404471,_0x3f5b6e){const _0x1f30ad=a111_0x5430,_0x2e0640=_0x25884e['attributes']['activationParams'],_0x1171c3=_0x2e0640[_0x1f30ad(0x1a5)]||'',_0xd782e=_0x3f5b6e?.['get'](_0x1171c3)??_0x1171c3,_0x4ab030={'name':_0x2e0640[_0x1f30ad(0x1c7)]||'','connection':_0xd782e};_0x2e0640['description']&&(_0x4ab030[_0x1f30ad(0x167)]=_0x2e0640[_0x1f30ad(0x167)]);let _0x65ead2=[];_0x2e0640['columns']&&_0x2e0640[_0x1f30ad(0x1e5)][_0x1f30ad(0x1e0)]>0x0&&(_0x65ead2=_0x2e0640['columns']['filter'](_0x1cbf03=>_0x1cbf03&&_0x1cbf03[_0x1f30ad(0x1c7)])[_0x1f30ad(0x1d4)](_0x2f208f=>{const _0x45f591=_0x1f30ad;if(_0x2f208f[_0x45f591(0x1a0)]||_0x2f208f[_0x45f591(0x1c9)])return{'name':_0x2f208f[_0x45f591(0x1c7)],..._0x2f208f['type']&&{'type':_0x2f208f[_0x45f591(0x1a0)]},..._0x2f208f[_0x45f591(0x1c9)]&&{'visibility':_0x2f208f[_0x45f591(0x1c9)]}};return _0x2f208f[_0x45f591(0x1c7)];}));_0x65ead2[_0x1f30ad(0x1e0)]>0x0&&(_0x4ab030['columns']=_0x65ead2);_0x2e0640['allColumns']!==undefined&&(_0x2e0640['allColumns']===![]&&_0x65ead2[_0x1f30ad(0x1e0)]===0x0?_0x4ab030['all_columns']=!![]:_0x4ab030[_0x1f30ad(0x168)]=_0x2e0640[_0x1f30ad(0x177)]);const _0x52a754={};let _0x26e9b9=![];_0x2e0640[_0x1f30ad(0x185)]&&(_0x52a754[_0x1f30ad(0x1a0)]=_0x2e0640[_0x1f30ad(0x185)],_0x26e9b9=!![]);_0x2e0640[_0x1f30ad(0x18d)]&&(_0x52a754[_0x1f30ad(0x1b6)]=_0x2e0640[_0x1f30ad(0x18d)],_0x26e9b9=!![]);_0x2e0640[_0x1f30ad(0x184)]!==undefined&&_0x2e0640[_0x1f30ad(0x184)]!==null&&(_0x52a754[_0x1f30ad(0x1e7)]=_0x2e0640[_0x1f30ad(0x184)],_0x26e9b9=!![]);_0x2e0640[_0x1f30ad(0x1f0)]!==undefined&&(_0x52a754['start_at']=_0x2e0640[_0x1f30ad(0x1f0)],_0x26e9b9=!![]);_0x2e0640[_0x1f30ad(0x1c6)]!==undefined&&(_0x52a754['end_on']=_0x2e0640['endOn'],_0x26e9b9=!![]);_0x2e0640[_0x1f30ad(0x1a7)]&&(_0x52a754[_0x1f30ad(0x1a7)]=_0x2e0640[_0x1f30ad(0x1a7)],_0x26e9b9=!![]);_0x26e9b9&&(_0x4ab030[_0x1f30ad(0x1df)]=_0x52a754);(_0x2e0640['notifyOn']&&_0x2e0640[_0x1f30ad(0x19c)][_0x1f30ad(0x1e0)]>0x0||_0x2e0640[_0x1f30ad(0x181)]&&_0x2e0640[_0x1f30ad(0x181)][_0x1f30ad(0x1e0)]>0x0)&&(_0x4ab030[_0x1f30ad(0x16f)]={},_0x2e0640[_0x1f30ad(0x19c)]&&_0x2e0640['notifyOn'][_0x1f30ad(0x1e0)]>0x0&&(_0x4ab030[_0x1f30ad(0x16f)][_0x1f30ad(0x1bd)]=_0x2e0640['notifyOn']),_0x2e0640[_0x1f30ad(0x181)]&&_0x2e0640[_0x1f30ad(0x181)][_0x1f30ad(0x1e0)]>0x0&&(_0x4ab030[_0x1f30ad(0x16f)]['email_recipients']=_0x2e0640[_0x1f30ad(0x181)]['map'](_0x58777e=>{const _0x49506b=_0x1f30ad,_0x474d89=_0x404471?.[_0x49506b(0x17a)](_0x58777e);return _0x474d89??String(_0x58777e);})));_0x2e0640['connectorConfig']&&Object[_0x1f30ad(0x193)](_0x2e0640[_0x1f30ad(0x1ec)])[_0x1f30ad(0x1e0)]>0x0&&(_0x4ab030[_0x1f30ad(0x1d9)]=normalizeConnectorConfigForYaml(_0x2e0640[_0x1f30ad(0x1ec)]));_0x2e0640[_0x1f30ad(0x1c1)]&&(_0x4ab030[_0x1f30ad(0x192)]=_0x2e0640[_0x1f30ad(0x1c1)]);if(_0x2e0640[_0x1f30ad(0x166)]){const _0x8eee03={},_0x406b2b=_0x2e0640[_0x1f30ad(0x166)];_0x406b2b[_0x1f30ad(0x1e5)]&&_0x406b2b['columns'][_0x1f30ad(0x1e0)]>0x0&&(_0x8eee03[_0x1f30ad(0x1e5)]=_0x406b2b[_0x1f30ad(0x1e5)][_0x1f30ad(0x165)](_0xd97a19=>_0xd97a19&&_0xd97a19[_0x1f30ad(0x1c7)])[_0x1f30ad(0x1d4)](_0x4c3966=>({'name':_0x4c3966[_0x1f30ad(0x1c7)],..._0x4c3966[_0x1f30ad(0x1a0)]&&{'type':_0x4c3966['type']},..._0x4c3966[_0x1f30ad(0x1c9)]&&{'visibility':_0x4c3966['visibility']}}))),_0x406b2b[_0x1f30ad(0x16a)]&&(_0x8eee03[_0x1f30ad(0x1de)]=_0x406b2b[_0x1f30ad(0x16a)]),_0x406b2b['joinRow']!==undefined&&(_0x8eee03['join_row']=_0x406b2b['joinRow']),_0x406b2b[_0x1f30ad(0x175)]&&(_0x8eee03[_0x1f30ad(0x1d6)]=_0x406b2b[_0x1f30ad(0x175)]),_0x406b2b[_0x1f30ad(0x19d)]&&(_0x8eee03['formatting']=_0x406b2b[_0x1f30ad(0x19d)]),_0x406b2b[_0x1f30ad(0x1a8)]&&_0x406b2b[_0x1f30ad(0x1a8)][_0x1f30ad(0x1e0)]>0x0&&(_0x8eee03[_0x1f30ad(0x1e2)]=_0x406b2b[_0x1f30ad(0x1a8)]),Object[_0x1f30ad(0x193)](_0x8eee03)[_0x1f30ad(0x1e0)]>0x0&&(_0x4ab030[_0x1f30ad(0x1da)]=_0x8eee03);}return _0x4ab030;}export function segmentWithActivationsToYaml(_0x4d65b0,_0x232dbf,_0x51d560,_0x176ef5,_0x31b4b0){const _0x500a3c=a111_0x5430,_0x444a01=segmentResponseToDefSync(_0x4d65b0,_0x51d560);return _0x232dbf['length']>0x0&&(_0x444a01[_0x500a3c(0x19f)]=_0x232dbf['map'](_0x22d59a=>activationResponseToDef(_0x22d59a,_0x176ef5,_0x31b4b0))),_0x444a01;}function normalizeColumn(_0x14e49b){const _0xf96598=a111_0x5430;if(typeof _0x14e49b===_0xf96598(0x1ce))return{'name':_0x14e49b};return{'name':_0x14e49b[_0xf96598(0x1c7)],..._0x14e49b['type']&&{'type':_0x14e49b[_0xf96598(0x1a0)]},..._0x14e49b[_0xf96598(0x1c9)]&&{'visibility':_0x14e49b[_0xf96598(0x1c9)]}};}function a111_0x1792(){const _0x582231=['arrayMatching','behaviorTableName','all','CONNECTOR_INVALID_CONFIG','repeatSubFrequency','end_on','notification','82032vsQtrT','4685817fjPxSp','Equal','add','aggregation','joinStrategy','kind','allColumns','null','403621XWJCao','get','funnel_stage','conditions','rule:','rule','errors','Segment\x20description','emailRecipients','batch','has','repeatFrequency','scheduleType','connection','rightValue','Invalid\x20connector_config\x20for\x20activation\x20\x22','usedNames','emailToIdMap','4rJANYN','repeat_sub_frequency','repeatUnit','resolveSegmentName','\x27:\x20','Please\x20specify\x20a\x20valid\x20attribute\x20name.','__SEGMENT_REF__','activation_template_id','keys','from','JOURNEY_SYNTAX_ERROR','].attribute\x20cannot\x20be\x20empty.\x0a','rightValues','__UNRESOLVED__','Unknown\x20email\x20recipient:\x20','And','CONNECTION_NOT_FOUND','notifyOn','formatting','folder','activations','type','warnings','start_at','code','TimeWithinNext','connectionId','email_recipients','timezone','orderBy','Connector:\x20','push','value','segment','duration','replace','connectionNameToTypeMap','attribute','test','realtime','isVisible','operator','leftValue','repeat_unit','parse','limit','YAML\x20config\x20missing\x20required\x20field:\x20name','join_row','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','sort','notify_on','exclude','stringify','16sjgBMP','activationTemplateId','isArray','connectionNameToIdMap','11gBYFyO','visible','endOn','name','set','visibility','valid','localRuleToName','toLowerCase','ruleHashToName','string','any','include','484QRJulJ','object','unit','map','3870517XBvqas','join_strategy','values','7755wOzVfQ','connector_config','behavior','source','connector_config\x20for\x20activation\x20\x22','Value','behavior_table','schedule','length','activations:','order_by','13297610Nrhvtn','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','columns','localeCompare','repeat_frequency','attribute_name','\x0a\x0aAvailable\x20fields:\x0a','joinRow','not','connectorConfig','groupingColumns','\x22:\x0a','getSchema','startAt','13631634lPizgq','every','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','filter','syndicationBehavior','description','all_columns'];a111_0x1792=function(){return _0x582231;};return a111_0x1792();}export async function activationDefToCreateRequest(_0x576e8c,_0x404019){const _0x2529ec=a111_0x5430,_0x53736c=_0x404019?.[_0x2529ec(0x18a)],_0x5674f1=_0x404019?.[_0x2529ec(0x1c3)],_0x43afa2=_0x576e8c[_0x2529ec(0x186)];let _0x5cd20d;const _0x3690d3=parseInt(_0x43afa2,0xa);if(!isNaN(_0x3690d3)&&String(_0x3690d3)===_0x43afa2)_0x5cd20d=_0x3690d3;else{const _0x1aae12=_0x5674f1?.[_0x2529ec(0x17a)](_0x43afa2);if(_0x1aae12===undefined)throw new SDKError(ErrorCode[_0x2529ec(0x19b)],'Unknown\x20connection:\x20'+_0x43afa2,undefined,{'helpText':_0x2529ec(0x1bb)});_0x5cd20d=_0x1aae12;}const _0x31e999={'name':_0x576e8c['name'],'connectionId':_0x5cd20d};_0x576e8c[_0x2529ec(0x167)]&&(_0x31e999[_0x2529ec(0x167)]=_0x576e8c[_0x2529ec(0x167)]);let _0x402dc4=[];_0x576e8c[_0x2529ec(0x1e5)]&&_0x576e8c[_0x2529ec(0x1e5)][_0x2529ec(0x1e0)]>0x0&&(_0x402dc4=_0x576e8c[_0x2529ec(0x1e5)]['filter'](_0x3e327f=>_0x3e327f!=null)[_0x2529ec(0x1d4)](normalizeColumn));_0x402dc4[_0x2529ec(0x1e0)]>0x0&&(_0x31e999['columns']=_0x402dc4);_0x576e8c['all_columns']!==undefined&&(_0x576e8c[_0x2529ec(0x168)]===![]&&_0x402dc4['length']===0x0?_0x31e999[_0x2529ec(0x177)]=!![]:_0x31e999['allColumns']=_0x576e8c['all_columns']);if(_0x576e8c[_0x2529ec(0x1df)]){const _0x4fbeba=_0x576e8c[_0x2529ec(0x1df)];_0x4fbeba[_0x2529ec(0x1a0)]&&(_0x31e999[_0x2529ec(0x185)]=_0x4fbeba['type']),_0x4fbeba[_0x2529ec(0x1b6)]&&(_0x31e999['repeatUnit']=_0x4fbeba[_0x2529ec(0x1b6)]),_0x4fbeba[_0x2529ec(0x1e7)]!==undefined&&(_0x31e999['repeatFrequency']=_0x4fbeba['repeat_frequency']),_0x4fbeba[_0x2529ec(0x18c)]&&(_0x31e999['repeatSubFrequency']=_0x4fbeba[_0x2529ec(0x18c)]),_0x4fbeba[_0x2529ec(0x1a2)]!==undefined&&(_0x31e999[_0x2529ec(0x1f0)]=_0x4fbeba['start_at']),_0x4fbeba['end_on']!==undefined&&(_0x31e999[_0x2529ec(0x1c6)]=_0x4fbeba[_0x2529ec(0x16e)]),_0x4fbeba['timezone']&&(_0x31e999[_0x2529ec(0x1a7)]=_0x4fbeba['timezone']);}_0x576e8c[_0x2529ec(0x16f)]&&(_0x576e8c[_0x2529ec(0x16f)]['notify_on']&&(_0x31e999['notifyOn']=_0x576e8c[_0x2529ec(0x16f)][_0x2529ec(0x1bd)]),_0x576e8c[_0x2529ec(0x16f)][_0x2529ec(0x1a6)]&&(_0x31e999[_0x2529ec(0x181)]=_0x576e8c[_0x2529ec(0x16f)][_0x2529ec(0x1a6)][_0x2529ec(0x1d4)](_0x168218=>{const _0x350375=_0x2529ec,_0x760df1=Number(_0x168218);if(!isNaN(_0x760df1)&&String(_0x760df1)===_0x168218)return _0x760df1;const _0x36fd21=_0x53736c?.['get'](_0x168218[_0x350375(0x1cc)]());if(_0x36fd21===undefined)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x350375(0x199)+_0x168218+_0x350375(0x164));return _0x36fd21;})));if(_0x576e8c['connector_config']){const _0x25de59=_0x404019?.[_0x2529ec(0x1af)]?.['get'](_0x43afa2);if(_0x25de59&&_0x404019?.[_0x2529ec(0x1ef)])try{const _0x5fd9af=await _0x404019[_0x2529ec(0x1ef)](_0x25de59),_0x378b3b=validateConnectorConfig(_0x576e8c['connector_config'],_0x5fd9af);if(!_0x378b3b[_0x2529ec(0x1ca)])throw new SDKError(ErrorCode[_0x2529ec(0x16c)],_0x2529ec(0x188)+_0x576e8c[_0x2529ec(0x1c7)]+_0x2529ec(0x1ee)+formatValidationErrors(_0x378b3b[_0x2529ec(0x17f)]),undefined,{'helpText':_0x2529ec(0x1a9)+_0x25de59+_0x2529ec(0x1e9)+formatSchemaAsHelp(_0x5fd9af)});if(_0x378b3b[_0x2529ec(0x1a1)][_0x2529ec(0x1e0)]>0x0){const _0x53744d=formatValidationWarnings(_0x378b3b[_0x2529ec(0x1a1)]);console['warn'](_0x2529ec(0x1dc)+_0x576e8c[_0x2529ec(0x1c7)]+_0x2529ec(0x1ee)+_0x53744d);}_0x31e999[_0x2529ec(0x1ec)]=transformConfigToLegacy(_0x576e8c[_0x2529ec(0x1d9)],_0x5fd9af);}catch(_0x5c2a00){if(_0x5c2a00 instanceof SDKError&&_0x5c2a00[_0x2529ec(0x1a3)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x31e999[_0x2529ec(0x1ec)]=_0x576e8c[_0x2529ec(0x1d9)];else throw _0x5c2a00;}else _0x31e999[_0x2529ec(0x1ec)]=_0x576e8c['connector_config'];}_0x576e8c['activation_template_id']!==undefined&&(_0x31e999[_0x2529ec(0x1c1)]=_0x576e8c[_0x2529ec(0x192)]);if(_0x576e8c['behavior']){const _0x4bd555=_0x576e8c['behavior'],_0x46e423={};if(_0x4bd555[_0x2529ec(0x1e5)]&&_0x4bd555['columns'][_0x2529ec(0x1e0)]>0x0){const _0x4acaf2=_0x4bd555[_0x2529ec(0x1e5)]['filter'](_0xf91f8c=>_0xf91f8c&&_0xf91f8c['name']);_0x4acaf2[_0x2529ec(0x1e0)]>0x0&&(_0x46e423[_0x2529ec(0x1e5)]=_0x4acaf2);}_0x4bd555[_0x2529ec(0x1de)]&&(_0x46e423[_0x2529ec(0x16a)]=_0x4bd555[_0x2529ec(0x1de)]),_0x4bd555[_0x2529ec(0x1ba)]!==undefined&&(_0x46e423[_0x2529ec(0x1ea)]=_0x4bd555[_0x2529ec(0x1ba)]),_0x4bd555[_0x2529ec(0x1d6)]&&(_0x46e423['joinStrategy']=_0x4bd555[_0x2529ec(0x1d6)]),_0x4bd555[_0x2529ec(0x19d)]&&(_0x46e423[_0x2529ec(0x19d)]=_0x4bd555[_0x2529ec(0x19d)]),_0x4bd555[_0x2529ec(0x1e2)]&&(_0x46e423[_0x2529ec(0x1a8)]=_0x4bd555[_0x2529ec(0x1e2)]),_0x31e999['syndicationBehavior']=_0x46e423;}return _0x31e999;}export async function activationDefToUpdateRequest(_0x40d34e,_0x44c4bf){return activationDefToCreateRequest(_0x40d34e,_0x44c4bf);}export function deepSortObject(_0x15c3fa){const _0x2ef002=a111_0x5430;if(_0x15c3fa===null||typeof _0x15c3fa!==_0x2ef002(0x1d2))return _0x15c3fa;if(Array[_0x2ef002(0x1c2)](_0x15c3fa))return _0x15c3fa[_0x2ef002(0x1d4)](deepSortObject)[_0x2ef002(0x1bc)]((_0x1041fc,_0x67577b)=>JSON[_0x2ef002(0x1bf)](_0x1041fc)[_0x2ef002(0x1e6)](JSON['stringify'](_0x67577b)));const _0x1044af={};for(const _0x57134c of Object['keys'](_0x15c3fa)[_0x2ef002(0x1bc)]()){_0x1044af[_0x57134c]=deepSortObject(_0x15c3fa[_0x57134c]);}return _0x1044af;}export function serializeRule(_0x36be46){const _0x140959=a111_0x5430;return JSON[_0x140959(0x1bf)](deepSortObject(_0x36be46));}export function normalizeRuleForMatching(_0x348efc){return normalizeConditionsForMatching(_0x348efc);}function normalizeConditionsForMatching(_0x4c7faf){const _0xe304c5=a111_0x5430;if(_0x4c7faf===null||typeof _0x4c7faf!==_0xe304c5(0x1d2))return _0x4c7faf;if(Array[_0xe304c5(0x1c2)](_0x4c7faf))return _0x4c7faf[_0xe304c5(0x1d4)](normalizeConditionsForMatching);const _0x659d37=_0x4c7faf;if((_0x659d37[_0xe304c5(0x1a0)]===_0xe304c5(0x1d0)||_0x659d37[_0xe304c5(0x1a0)]===_0xe304c5(0x1be))&&typeof _0x659d37[_0xe304c5(0x1ac)]===_0xe304c5(0x1ce))return{..._0x659d37,'segment':_0xe304c5(0x191)};const _0xe252cd={};for(const _0x3cc81b of Object[_0xe304c5(0x193)](_0x659d37)){_0xe252cd[_0x3cc81b]=normalizeConditionsForMatching(_0x659d37[_0x3cc81b]);}return _0xe252cd;}export function serializeRuleForMatching(_0x303120){const _0x1fee7f=a111_0x5430;return JSON[_0x1fee7f(0x1bf)](deepSortObject(normalizeRuleForMatching(_0x303120)));}export function expandSegmentReferences(_0x3591a6,_0x1676cc,_0x195c7d=new Set()){return expandConditions(_0x3591a6,_0x1676cc,_0x195c7d);}function expandConditions(_0x4a7e0a,_0x2ac767,_0xa8076b){const _0x2147be=a111_0x5430;if(_0x4a7e0a===null||typeof _0x4a7e0a!=='object')return _0x4a7e0a;if(Array[_0x2147be(0x1c2)](_0x4a7e0a))return _0x4a7e0a[_0x2147be(0x1d4)](_0x13be6b=>expandConditions(_0x13be6b,_0x2ac767,_0xa8076b));const _0x333d8=_0x4a7e0a;if((_0x333d8[_0x2147be(0x1a0)]===_0x2147be(0x1d0)||_0x333d8[_0x2147be(0x1a0)]==='exclude')&&typeof _0x333d8[_0x2147be(0x1ac)]==='string'){const _0x156bea=_0x333d8[_0x2147be(0x1ac)],_0x59b46a=_0x2ac767[_0x2147be(0x17a)](_0x156bea);if(_0x59b46a&&!_0xa8076b[_0x2147be(0x183)](_0x156bea)){const _0xfeb609=new Set(_0xa8076b);_0xfeb609['add'](_0x156bea);const _0x277ab2=expandConditions(_0x59b46a,_0x2ac767,_0xfeb609);return{'type':_0x333d8[_0x2147be(0x1a0)],'expanded_rule':_0x277ab2};}return{'type':_0x333d8[_0x2147be(0x1a0)],'expanded_rule':_0x2147be(0x198)};}const _0x579a8d={};for(const _0x44a27d of Object[_0x2147be(0x193)](_0x333d8)){_0x579a8d[_0x44a27d]=expandConditions(_0x333d8[_0x44a27d],_0x2ac767,_0xa8076b);}return _0x579a8d;}export function serializeExpandedRule(_0x526497,_0x1e289c){const _0x4ced4f=a111_0x5430,_0x516f83=expandSegmentReferences(_0x526497,_0x1e289c);return JSON[_0x4ced4f(0x1bf)](deepSortObject(_0x516f83));}export function createSegmentNameContext(_0x31c6a7){const _0x4e9fed=a111_0x5430,_0x493705=new Set(),_0x40145c=new Map(),_0x30d871=new Map();if(_0x31c6a7)for(const [_0x3dcd75,_0xf0e3e]of Object['entries'](_0x31c6a7)){if(_0xf0e3e['rule']){const _0x1f409a=serializeRule(_0xf0e3e[_0x4e9fed(0x17e)]);_0x30d871[_0x4e9fed(0x1c8)](_0x1f409a,_0x3dcd75),_0x493705[_0x4e9fed(0x173)](_0x3dcd75);}}return{'usedNames':_0x493705,'ruleHashToName':_0x40145c,'localRuleToName':_0x31c6a7?_0x30d871:undefined};}export function resolveSegmentName(_0x4978d1,_0x3874e6,_0x2a0b62,_0x186d5d){const _0xa2fe50=a111_0x5430,_0x7f8aed=serializeRule(_0x3874e6);if(_0x2a0b62[_0xa2fe50(0x1cb)]){const _0x2e4108=_0x2a0b62[_0xa2fe50(0x1cb)]['get'](_0x7f8aed);if(_0x2e4108)return{'name':_0x2e4108,'isDuplicate':![],'isLocalMatch':!![]};}const _0x5d56dd=_0x2a0b62['ruleHashToName']['get'](_0x7f8aed);if(_0x5d56dd)return{'name':_0x5d56dd,'isDuplicate':!![],'isLocalMatch':![]};const _0x4b7a7d=_0x186d5d(_0x4978d1);let _0x413e68=_0x4b7a7d||_0x4978d1,_0x2756f7=_0x413e68,_0x5d7295=0x2;while(_0x2a0b62[_0xa2fe50(0x189)][_0xa2fe50(0x183)](_0x2756f7)){_0x2756f7=_0x413e68+'_'+_0x5d7295,_0x5d7295++;}return _0x2a0b62[_0xa2fe50(0x189)][_0xa2fe50(0x173)](_0x2756f7),_0x2a0b62[_0xa2fe50(0x1cd)]['set'](_0x7f8aed,_0x2756f7),{'name':_0x2756f7,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x20f0a6){const _0x43877b=[],_0x361e5e=_0x35fed0=>{const _0x112471=a111_0x5430;if(!_0x35fed0||typeof _0x35fed0!==_0x112471(0x1d2))return;if(Array[_0x112471(0x1c2)](_0x35fed0)){_0x35fed0['forEach'](_0x361e5e);return;}const _0x55a519=_0x35fed0;(_0x55a519['type']===_0x112471(0x1d0)||_0x55a519['type']===_0x112471(0x1be))&&typeof _0x55a519[_0x112471(0x1ac)]===_0x112471(0x1ce)&&_0x43877b[_0x112471(0x1aa)](_0x55a519[_0x112471(0x1ac)]);for(const _0xc50e88 of Object[_0x112471(0x1d7)](_0x55a519)){_0x361e5e(_0xc50e88);}};return _0x361e5e(_0x20f0a6),_0x43877b;}export function validateSegmentRule(_0x25d538,_0x5e484d){const _0x2ef800=a111_0x5430;if(!_0x5e484d||!_0x5e484d[_0x2ef800(0x17c)])return;for(let _0x13f7db=0x0;_0x13f7db<_0x5e484d[_0x2ef800(0x17c)][_0x2ef800(0x1e0)];_0x13f7db++){const _0x4aa719=_0x5e484d[_0x2ef800(0x17c)][_0x13f7db];if(_0x2ef800(0x1a0)in _0x4aa719&&_0x4aa719[_0x2ef800(0x1a0)]===_0x2ef800(0x1dd)){const _0x412dba=_0x4aa719;if(!_0x412dba[_0x2ef800(0x1b0)]||_0x412dba[_0x2ef800(0x1b0)]==='')throw new SDKError(ErrorCode[_0x2ef800(0x195)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x25d538+_0x2ef800(0x18f)+('conditions['+_0x13f7db+_0x2ef800(0x196))+_0x2ef800(0x190));}}}
|
|
1
|
+
const a111_0x22e1b1=a111_0x3211;(function(_0x44aa72,_0x551fa5){const _0x3243a4=a111_0x3211,_0x34e0d6=_0x44aa72();while(!![]){try{const _0x12146c=parseInt(_0x3243a4(0xcf))/0x1+parseInt(_0x3243a4(0xb3))/0x2*(-parseInt(_0x3243a4(0x11e))/0x3)+parseInt(_0x3243a4(0x10b))/0x4+-parseInt(_0x3243a4(0xfd))/0x5*(parseInt(_0x3243a4(0xf1))/0x6)+parseInt(_0x3243a4(0xe6))/0x7*(-parseInt(_0x3243a4(0x137))/0x8)+-parseInt(_0x3243a4(0xba))/0x9*(parseInt(_0x3243a4(0xe0))/0xa)+parseInt(_0x3243a4(0xab))/0xb*(parseInt(_0x3243a4(0xfb))/0xc);if(_0x12146c===_0x551fa5)break;else _0x34e0d6['push'](_0x34e0d6['shift']());}catch(_0x3d8f46){_0x34e0d6['push'](_0x34e0d6['shift']());}}}(a111_0x1577,0xf014b));import*as a111_0x15b77d from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x1f006d,_0x1f4e42){const _0x4f3a8b=a111_0x3211,_0x4a8b31=_0x1f006d[_0x4f3a8b(0x134)]&&_0x4f3a8b(0x11c)in _0x1f006d[_0x4f3a8b(0x134)]&&_0x1f006d[_0x4f3a8b(0x134)]['type'];return{'type':'segment','name':_0x1f006d[_0x4f3a8b(0xaf)],..._0x1f006d[_0x4f3a8b(0xdf)]&&{'description':_0x1f006d[_0x4f3a8b(0xdf)]},..._0x1f4e42&&{'folder':_0x1f4e42},..._0x4a8b31&&{'rule':apiRuleToYaml(_0x1f006d[_0x4f3a8b(0x134)])},..._0x1f006d[_0x4f3a8b(0x12b)]!==undefined&&{'kind':_0x1f006d['kind']===0x0?'batch':_0x1f006d[_0x4f3a8b(0x12b)]===0x1?_0x4f3a8b(0x112):_0x4f3a8b(0xad)},..._0x1f006d['isVisible']!==undefined&&{'visible':_0x1f006d['isVisible']}};}export async function segmentResponseToDef(_0x4de483,_0x27abd2,_0x58f315){const _0xc9f9ba=a111_0x3211,_0x31590d=segmentResponseToDefSync(_0x4de483,_0x58f315);if(!_0x27abd2||!_0x27abd2[_0xc9f9ba(0xd7)])return _0x31590d;return _0x31590d['rule']&&(_0x31590d['rule']=await resolveRuleSegmentRefs(_0x31590d[_0xc9f9ba(0x134)],_0x27abd2[_0xc9f9ba(0xd7)])),_0x31590d;}export function apiRuleToYaml(_0xf2e09e){const _0x3418f3=a111_0x3211,_0x2a220e=(_0xf2e09e[_0x3418f3(0x119)]||[])[_0x3418f3(0xb0)](apiConditionToYaml);if(_0x2a220e[_0x3418f3(0x105)]===0x1&&!_0xf2e09e[_0x3418f3(0xdf)]&&_0x3418f3(0x11c)in _0x2a220e[0x0]&&(_0x2a220e[0x0][_0x3418f3(0x11c)]===_0x3418f3(0xf6)||_0x2a220e[0x0]['type']==='Or')){const _0x51ae88=_0x2a220e[0x0];if(_0x51ae88[_0x3418f3(0x11c)]===_0xf2e09e[_0x3418f3(0x11c)]&&_0x51ae88[_0x3418f3(0x119)])return{'type':_0xf2e09e['type'],'conditions':_0x51ae88[_0x3418f3(0x119)],..._0x51ae88['description']&&{'description':_0x51ae88[_0x3418f3(0xdf)]}};}return{'type':_0xf2e09e[_0x3418f3(0x11c)],'conditions':_0x2a220e,..._0xf2e09e[_0x3418f3(0xdf)]&&{'description':_0xf2e09e[_0x3418f3(0xdf)]}};}export async function resolveRuleSegmentRefs(_0x3798d6,_0x391a44){const _0x42d104=a111_0x3211,_0xeacbca=await Promise[_0x42d104(0x102)](_0x3798d6[_0x42d104(0x119)][_0x42d104(0xb0)](_0x3bd247=>resolveConditionSegmentRefs(_0x3bd247,_0x391a44)));return{..._0x3798d6,'conditions':_0xeacbca};}async function resolveConditionSegmentRefs(_0x60d067,_0x25bb61){const _0x5d89f4=a111_0x3211;if(_0x5d89f4(0xcb)in _0x60d067&&(_0x60d067[_0x5d89f4(0x11c)]==='include'||_0x60d067['type']===_0x5d89f4(0xe5))){const _0x1fec52=_0x60d067;if(/^\d+$/[_0x5d89f4(0x12a)](_0x1fec52[_0x5d89f4(0xcb)])){const _0xd358fc=await _0x25bb61(_0x1fec52[_0x5d89f4(0xcb)]);return{..._0x1fec52,'segment':_0xd358fc};}return _0x60d067;}if(_0x5d89f4(0x119)in _0x60d067&&_0x60d067[_0x5d89f4(0x119)]){const _0x2ca70e=_0x60d067,_0x590a4d=await Promise[_0x5d89f4(0x102)](_0x2ca70e[_0x5d89f4(0x119)]['map'](_0x2a7728=>resolveConditionSegmentRefs(_0x2a7728,_0x25bb61)));return{..._0x2ca70e,'conditions':_0x590a4d};}if(_0x5d89f4(0xdc)in _0x60d067&&_0x60d067['filter']){const _0x470323=_0x60d067,_0x110b79=await resolveRuleSegmentRefs(_0x470323[_0x5d89f4(0xdc)],_0x25bb61);return{..._0x470323,'filter':_0x110b79};}return _0x60d067;}export async function resolveRuleSegmentIds(_0x42ec39,_0x57f975){const _0xfad8ba=a111_0x3211,_0x3f90bc=await Promise[_0xfad8ba(0x102)](_0x42ec39[_0xfad8ba(0x119)][_0xfad8ba(0xb0)](_0x47ed0e=>resolveConditionSegmentIds(_0x47ed0e,_0x57f975)));return{..._0x42ec39,'conditions':_0x3f90bc};}async function resolveConditionSegmentIds(_0x4d8e25,_0x140554){const _0x56bf28=a111_0x3211;if(_0x56bf28(0xcb)in _0x4d8e25&&(_0x4d8e25[_0x56bf28(0x11c)]===_0x56bf28(0xc3)||_0x4d8e25[_0x56bf28(0x11c)]==='exclude')){const _0x31d81a=_0x4d8e25;if(!/^\d+$/[_0x56bf28(0x12a)](_0x31d81a['segment'])){const _0x48580c=await _0x140554(_0x31d81a[_0x56bf28(0xcb)]);return{..._0x31d81a,'segment':_0x48580c};}return _0x4d8e25;}if(_0x56bf28(0x119)in _0x4d8e25&&_0x4d8e25['conditions']){const _0x53b0b1=_0x4d8e25,_0x101dbc=await Promise[_0x56bf28(0x102)](_0x53b0b1[_0x56bf28(0x119)][_0x56bf28(0xb0)](_0x8b6905=>resolveConditionSegmentIds(_0x8b6905,_0x140554)));return{..._0x53b0b1,'conditions':_0x101dbc};}if(_0x56bf28(0xdc)in _0x4d8e25&&_0x4d8e25[_0x56bf28(0xdc)]){const _0x2046fd=_0x4d8e25,_0x527ccf=await resolveRuleSegmentIds(_0x2046fd[_0x56bf28(0xdc)],_0x140554);return{..._0x2046fd,'filter':_0x527ccf};}return _0x4d8e25;}function apiConditionToYaml(_0x109931){const _0x612320=a111_0x3211;if(_0x109931[_0x612320(0x11c)]===_0x612320(0xf6)||_0x109931[_0x612320(0x11c)]==='Or'){if(_0x109931[_0x612320(0x119)]){const _0x856f27=_0x109931[_0x612320(0x119)][_0x612320(0xb0)](apiConditionToYaml);if(_0x856f27[_0x612320(0x105)]===0x1&&!_0x109931['description'])return _0x856f27[0x0];return{'type':_0x109931[_0x612320(0x11c)],'conditions':_0x856f27,..._0x109931[_0x612320(0xdf)]&&{'description':_0x109931['description']}};}}if(_0x109931['type']===_0x612320(0xc2)&&_0x109931['leftValue']&&_0x109931[_0x612320(0xc9)]){const _0x1f3b90=_0x109931['leftValue']['aggregation']?{'type':_0x109931[_0x612320(0xef)]['aggregation']['type'],..._0x109931['leftValue'][_0x612320(0x101)][_0x612320(0x124)]&&{'groupingColumns':_0x109931[_0x612320(0xef)]['aggregation'][_0x612320(0x124)]}}:undefined;return{'type':_0x612320(0xc2),'attribute':_0x109931[_0x612320(0xef)][_0x612320(0xaf)]||'','operator':apiOperatorToYaml(_0x109931[_0x612320(0xc9)]),..._0x109931[_0x612320(0xc5)]&&_0x109931['arrayMatching']!==_0x612320(0xd5)?{'arrayMatching':_0x109931[_0x612320(0xc5)]}:{},..._0x109931['exclude']?{'exclude':_0x109931['exclude']}:{},..._0x1f3b90?{'aggregation':_0x1f3b90}:{},..._0x109931[_0x612320(0xef)][_0x612320(0xd2)]?{'source':_0x109931['leftValue'][_0x612320(0xd2)]['name']}:{},..._0x109931[_0x612320(0xef)][_0x612320(0xdc)]?{'filter':apiRuleToYaml(_0x109931[_0x612320(0xef)]['filter'])}:{},..._0x109931[_0x612320(0xc6)]!==undefined&&_0x109931['limit']!==null?{'limit':_0x109931['limit']}:{}};}if(_0x109931['type']===_0x612320(0x10c)&&_0x109931['id'])return{'type':_0x109931['exclude']?_0x612320(0xe5):_0x612320(0xc3),'segment':_0x109931['id']};return{'type':_0x612320(0xf6),'conditions':[]};}function isTemporalOperator(_0x5ef823){const _0x5458fd=a111_0x3211;return _0x5ef823===_0x5458fd(0xbb)||_0x5ef823===_0x5458fd(0xa7);}function getEffectiveValue(_0x198003){const _0x1a8716=a111_0x3211,_0x500500=_0x198003[_0x1a8716(0xa5)];return _0x198003[_0x1a8716(0xd8)]??_0x500500;}function apiOperatorToYaml(_0x3caa03){const _0x53a787=a111_0x3211;let _0xc974c8;if(_0x3caa03[_0x53a787(0x111)]&&_0x3caa03['rightValues'][_0x53a787(0x105)]>0x0)_0xc974c8=_0x3caa03[_0x53a787(0x111)];else{if(_0x3caa03[_0x53a787(0x114)]!==undefined)_0xc974c8=_0x3caa03['rightValue'];else isTemporalOperator(_0x3caa03[_0x53a787(0x11c)])&&_0x3caa03[_0x53a787(0xd8)]!==undefined&&(_0xc974c8=_0x3caa03['value']);}return{'type':mapApiOperatorType(_0x3caa03[_0x53a787(0x11c)]),..._0x3caa03['not']&&{'not':_0x3caa03[_0x53a787(0xfc)]},..._0xc974c8!==undefined&&{'value':_0xc974c8},..._0x3caa03[_0x53a787(0xca)]&&{'unit':_0x3caa03[_0x53a787(0xca)]}};}function mapApiOperatorType(_0x221709){return _0x221709;}export function segmentDefToCreateRequest(_0x3afe72,_0x1ef046){const _0x3a35dd=a111_0x3211,_0x122967={'name':_0x3afe72[_0x3a35dd(0xaf)]};return _0x3afe72['description']&&(_0x122967[_0x3a35dd(0xdf)]=_0x3afe72[_0x3a35dd(0xdf)]),_0x3afe72[_0x3a35dd(0x134)]&&(_0x122967[_0x3a35dd(0x134)]=yamlRuleToApi(_0x3afe72['rule'])),_0x3afe72[_0x3a35dd(0x12b)]&&(_0x122967[_0x3a35dd(0x12b)]=_0x3afe72[_0x3a35dd(0x12b)]===_0x3a35dd(0x100)?0x0:_0x3afe72['kind']===_0x3a35dd(0x112)?0x1:0x2),_0x3afe72[_0x3a35dd(0x109)]!==undefined&&(_0x122967['isVisible']=_0x3afe72[_0x3a35dd(0x109)]),_0x1ef046&&(_0x122967[_0x3a35dd(0xdd)]=_0x1ef046),_0x122967;}export function segmentDefToUpdateRequest(_0x4b50dc){const _0x4e0114=a111_0x3211,_0x13b566={'name':_0x4b50dc[_0x4e0114(0xaf)]};return _0x4b50dc['description']!==undefined&&(_0x13b566[_0x4e0114(0xdf)]=_0x4b50dc[_0x4e0114(0xdf)]),_0x4b50dc[_0x4e0114(0x134)]&&(_0x13b566[_0x4e0114(0x134)]=yamlRuleToApi(_0x4b50dc['rule'])),_0x4b50dc[_0x4e0114(0x12b)]&&(_0x13b566[_0x4e0114(0x12b)]=_0x4b50dc[_0x4e0114(0x12b)]===_0x4e0114(0x100)?0x0:_0x4b50dc[_0x4e0114(0x12b)]===_0x4e0114(0x112)?0x1:0x2),_0x13b566;}export function yamlRuleToApi(_0x52750d,_0x1884e1=![]){const _0x3d399a=a111_0x3211,_0x422d16=_0x52750d[_0x3d399a(0x119)][_0x3d399a(0xb0)](yamlConditionToApi);if(_0x1884e1){const _0x235ebe=_0x422d16[_0x3d399a(0x131)](_0x156b4b=>_0x156b4b[_0x3d399a(0x11c)]==='And'||_0x156b4b[_0x3d399a(0x11c)]==='Or');if(!_0x235ebe&&_0x422d16[_0x3d399a(0x105)]>0x0)return{'type':_0x52750d[_0x3d399a(0x11c)],'conditions':[{'type':_0x3d399a(0xf6),'description':_0x52750d[_0x3d399a(0xdf)]||'','conditions':_0x422d16}]};}return{'type':_0x52750d[_0x3d399a(0x11c)],'conditions':_0x422d16,..._0x52750d['description']&&{'description':_0x52750d[_0x3d399a(0xdf)]}};}function yamlConditionToApi(_0x9d5857){const _0x4dc703=a111_0x3211;if('segment'in _0x9d5857&&(_0x9d5857[_0x4dc703(0x11c)]==='include'||_0x9d5857['type']===_0x4dc703(0xe5))){const _0x349146=_0x9d5857;return{'type':_0x4dc703(0x10c),'id':_0x349146[_0x4dc703(0xcb)],'exclude':_0x349146['type']===_0x4dc703(0xe5)};}if(_0x4dc703(0x11c)in _0x9d5857&&(_0x9d5857[_0x4dc703(0x11c)]===_0x4dc703(0xf6)||_0x9d5857['type']==='Or')){const _0x584839=_0x9d5857;return{'type':_0x584839[_0x4dc703(0x11c)],'conditions':_0x584839[_0x4dc703(0x119)]['map'](yamlConditionToApi),..._0x584839[_0x4dc703(0xdf)]&&{'description':_0x584839[_0x4dc703(0xdf)]}};}const _0x7bbe98=_0x9d5857,_0x20ffc1={'type':'Value','leftValue':buildLeftValue(_0x7bbe98),'operator':yamlOperatorToApi(_0x7bbe98[_0x4dc703(0xc9)]),'exclude':_0x7bbe98[_0x4dc703(0xe5)]??![],'arrayMatching':_0x7bbe98[_0x4dc703(0xc5)]??'any'};return _0x7bbe98[_0x4dc703(0xc6)]!==undefined&&(_0x20ffc1[_0x4dc703(0xc6)]=_0x7bbe98[_0x4dc703(0xc6)]),_0x20ffc1;}function buildLeftValue(_0x5a60ea){const _0x4f8e7b=a111_0x3211,_0x52e8bd={'name':_0x5a60ea['attribute']};return _0x5a60ea[_0x4f8e7b(0x101)]&&(_0x52e8bd[_0x4f8e7b(0x101)]={'type':_0x5a60ea[_0x4f8e7b(0x101)]['type'],..._0x5a60ea[_0x4f8e7b(0x101)][_0x4f8e7b(0x124)]&&{'groupingColumns':_0x5a60ea[_0x4f8e7b(0x101)]['groupingColumns']}}),_0x5a60ea[_0x4f8e7b(0xd2)]&&(_0x52e8bd[_0x4f8e7b(0xd2)]={'name':_0x5a60ea[_0x4f8e7b(0xd2)]}),_0x5a60ea['filter']&&(_0x52e8bd['filter']=yamlRuleToApi(_0x5a60ea[_0x4f8e7b(0xdc)])),_0x52e8bd;}function yamlOperatorToApi(_0x3bd075){const _0x118813=a111_0x3211,_0x22f854={'type':mapYamlOperatorType(_0x3bd075[_0x118813(0x11c)]),'not':_0x3bd075[_0x118813(0xfc)]??![]},_0x59fc4a=getEffectiveValue(_0x3bd075);if(_0x59fc4a!==undefined){if(Array[_0x118813(0x125)](_0x59fc4a))_0x22f854[_0x118813(0x111)]=_0x59fc4a;else isTemporalOperator(_0x3bd075[_0x118813(0x11c)])?_0x22f854[_0x118813(0xd8)]=_0x59fc4a:_0x22f854[_0x118813(0x114)]=_0x59fc4a;}return _0x3bd075[_0x118813(0xca)]&&(_0x22f854[_0x118813(0xca)]=_0x3bd075[_0x118813(0xca)]),_0x22f854;}function mapYamlOperatorType(_0x36402f){return _0x36402f;}export function toYamlString(_0xb845f){const _0x114c22=a111_0x3211,_0x48d790=JSON[_0x114c22(0xb5)](JSON['stringify'](_0xb845f)),_0x2788eb=a111_0x15b77d[_0x114c22(0x128)](_0x48d790,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x370399=[_0x114c22(0xf2)];let _0x5d2353=_0x2788eb;for(const _0x310c92 of _0x370399){_0x5d2353=_0x5d2353[_0x114c22(0xbe)](new RegExp('^('+_0x310c92+')','m'),(_0x533b1c,_0x500c1c,_0x699765)=>{if(_0x699765===0x0||_0x5d2353[_0x699765-0x1]==='\x0a'&&_0x5d2353[_0x699765-0x2]==='\x0a')return _0x500c1c;return'\x0a'+_0x500c1c;});}return _0x5d2353;}export function parseYamlString(_0x178fef){const _0x32a630=a111_0x3211,_0x54b91b=a111_0x15b77d[_0x32a630(0xb5)](_0x178fef);if(!_0x54b91b[_0x32a630(0xaf)])throw new Error(_0x32a630(0xb6));if(_0x54b91b[_0x32a630(0x11c)]&&_0x54b91b['type']!=='segment')throw new Error('YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20'+_0x54b91b[_0x32a630(0x11c)]);return _0x54b91b;}export function isSegmentYaml(_0x142181){const _0xb3d036=a111_0x3211;if(typeof _0x142181!==_0xb3d036(0x108)||_0x142181===null)return![];const _0x2c2db8=_0x142181;return _0x2c2db8[_0xb3d036(0x11c)]===_0xb3d036(0xcb)||_0x2c2db8[_0xb3d036(0x11c)]===undefined;}export function generateTemplate(_0xb41918=a111_0x22e1b1(0x121)){const _0x4f9f13=a111_0x22e1b1,_0x347c62={'type':_0x4f9f13(0xcb),'name':_0xb41918,'description':_0x4f9f13(0xbc),'rule':{'type':_0x4f9f13(0xf6),'conditions':[{'type':_0x4f9f13(0xc2),'attribute':_0x4f9f13(0x138),'operator':{'type':_0x4f9f13(0x129),'value':'value'}}]}};return toYamlString(_0x347c62);}export function segmentToYamlString(_0x552104){const _0x5968be=a111_0x22e1b1,_0x30a86f=JSON[_0x5968be(0xb5)](JSON[_0x5968be(0x128)](_0x552104)),_0x149b89=a111_0x15b77d[_0x5968be(0x128)](_0x30a86f,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x231eef=[_0x5968be(0xf2),'activations:'];let _0x2cc048=_0x149b89;for(const _0x2933bd of _0x231eef){_0x2cc048=_0x2cc048['replace'](new RegExp('^('+_0x2933bd+')','m'),(_0x17ce9a,_0x33bc4f,_0x2a7cd9)=>{if(_0x2a7cd9===0x0||_0x2cc048[_0x2a7cd9-0x1]==='\x0a'&&_0x2cc048[_0x2a7cd9-0x2]==='\x0a')return _0x33bc4f;return'\x0a'+_0x33bc4f;});}return _0x2cc048;}export function parseSegmentYamlFile(_0xc67b71){const _0x2e38ad=a111_0x22e1b1,_0x2d7986=a111_0x15b77d[_0x2e38ad(0xb5)](_0xc67b71);if(!_0x2d7986[_0x2e38ad(0xaf)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0x2d7986;}export function normalizeChildSegmentYaml(_0x2d6367){const _0x2e884d=a111_0x22e1b1;return{'type':_0x2e884d(0xcb),'name':_0x2d6367[_0x2e884d(0xaf)],..._0x2d6367[_0x2e884d(0xdf)]!==undefined&&{'description':_0x2d6367['description']},..._0x2d6367[_0x2e884d(0x110)]!==undefined&&{'folder':_0x2d6367['folder']},..._0x2d6367[_0x2e884d(0x134)]&&{'rule':normalizeRule(_0x2d6367['rule'])},..._0x2d6367[_0x2e884d(0x12b)]!==undefined&&{'kind':_0x2d6367[_0x2e884d(0x12b)]},..._0x2d6367[_0x2e884d(0x109)]!==undefined&&{'visible':_0x2d6367['visible']},..._0x2d6367[_0x2e884d(0xc7)]&&{'activations':_0x2d6367['activations'][_0x2e884d(0xb0)](normalizeActivation)}};}export function normalizeRule(_0x42f544){const _0x27d382=a111_0x22e1b1;return{'type':_0x42f544[_0x27d382(0x11c)],'conditions':_0x42f544['conditions']['map'](normalizeCondition),..._0x42f544[_0x27d382(0xdf)]!==undefined&&{'description':_0x42f544[_0x27d382(0xdf)]}};}function normalizeCondition(_0x3bae2f){const _0x4713ca=a111_0x22e1b1;if(_0x4713ca(0xcb)in _0x3bae2f&&(_0x3bae2f['type']===_0x4713ca(0xc3)||_0x3bae2f['type']===_0x4713ca(0xe5))){const _0x2725eb=_0x3bae2f;return{'type':_0x2725eb['type'],'segment':_0x2725eb[_0x4713ca(0xcb)]};}if(_0x4713ca(0x11c)in _0x3bae2f&&(_0x3bae2f[_0x4713ca(0x11c)]===_0x4713ca(0xf6)||_0x3bae2f[_0x4713ca(0x11c)]==='Or')){const _0x1213f6=_0x3bae2f;return{'type':_0x1213f6['type'],'conditions':_0x1213f6['conditions'][_0x4713ca(0xb0)](normalizeCondition),..._0x1213f6[_0x4713ca(0xdf)]!==undefined&&{'description':_0x1213f6[_0x4713ca(0xdf)]}};}const _0x43b208=_0x3bae2f;return{'type':_0x4713ca(0xc2),'attribute':_0x43b208[_0x4713ca(0xfe)],'operator':normalizeOperator(_0x43b208[_0x4713ca(0xc9)]),..._0x43b208['arrayMatching']!==undefined&&{'arrayMatching':_0x43b208[_0x4713ca(0xc5)]},..._0x43b208[_0x4713ca(0xe5)]!==undefined&&{'exclude':_0x43b208[_0x4713ca(0xe5)]},..._0x43b208[_0x4713ca(0x101)]!==undefined&&{'aggregation':_0x43b208['aggregation']},..._0x43b208[_0x4713ca(0xd2)]!==undefined&&{'source':_0x43b208[_0x4713ca(0xd2)]},..._0x43b208[_0x4713ca(0xdc)]!==undefined&&{'filter':normalizeRule(_0x43b208[_0x4713ca(0xdc)])},..._0x43b208[_0x4713ca(0xc6)]!==undefined&&{'limit':_0x43b208[_0x4713ca(0xc6)]}};}function normalizeOperator(_0x487c7c){const _0x2e26f0=a111_0x22e1b1,_0x489563=getEffectiveValue(_0x487c7c);return{'type':_0x487c7c['type'],..._0x487c7c['not']!==undefined&&{'not':_0x487c7c[_0x2e26f0(0xfc)]},..._0x489563!==undefined&&{'value':_0x489563},..._0x487c7c[_0x2e26f0(0x133)]!==undefined&&{'min':_0x487c7c[_0x2e26f0(0x133)]},..._0x487c7c[_0x2e26f0(0xf4)]!==undefined&&{'max':_0x487c7c[_0x2e26f0(0xf4)]},..._0x487c7c[_0x2e26f0(0xca)]!==undefined&&{'unit':_0x487c7c[_0x2e26f0(0xca)]},..._0x487c7c[_0x2e26f0(0xec)]!==undefined&&{'duration':_0x487c7c[_0x2e26f0(0xec)]},..._0x487c7c[_0x2e26f0(0xf3)]!==undefined&&{'from':_0x487c7c[_0x2e26f0(0xf3)]}};}function normalizeActivation(_0x1c54d3){const _0x33e2f0=a111_0x22e1b1;return{'name':_0x1c54d3['name'],'connection':_0x1c54d3[_0x33e2f0(0xbd)],..._0x1c54d3[_0x33e2f0(0xdf)]!==undefined&&{'description':_0x1c54d3['description']},..._0x1c54d3[_0x33e2f0(0x10f)]!==undefined&&{'all_columns':_0x1c54d3['all_columns']},..._0x1c54d3['columns']!==undefined&&{'columns':_0x1c54d3[_0x33e2f0(0xda)]},..._0x1c54d3[_0x33e2f0(0xfa)]!==undefined&&{'behavior':_0x1c54d3['behavior']},..._0x1c54d3[_0x33e2f0(0xc1)]!==undefined&&{'schedule':_0x1c54d3['schedule']},..._0x1c54d3[_0x33e2f0(0xed)]!==undefined&&{'notification':_0x1c54d3[_0x33e2f0(0xed)]},..._0x1c54d3[_0x33e2f0(0xb9)]!==undefined&&{'connector_config':_0x1c54d3[_0x33e2f0(0xb9)]},..._0x1c54d3[_0x33e2f0(0x116)]!==undefined&&{'activation_template_id':_0x1c54d3[_0x33e2f0(0x116)]}};}export function activationResponseToDef(_0x352852,_0x56583c,_0x47a8c0){const _0x28229d=a111_0x22e1b1,_0x5a6d06=_0x352852[_0x28229d(0x104)]||'',_0x59a3bd=_0x47a8c0?.[_0x28229d(0x12e)](_0x5a6d06)??_0x5a6d06,_0x45c1c2={'name':_0x352852[_0x28229d(0xaf)],'connection':_0x59a3bd};_0x352852[_0x28229d(0xdf)]&&(_0x45c1c2[_0x28229d(0xdf)]=_0x352852['description']);let _0xdbcd9b=[];_0x352852[_0x28229d(0xda)]&&_0x352852[_0x28229d(0xda)][_0x28229d(0x105)]>0x0&&(_0xdbcd9b=_0x352852[_0x28229d(0xda)][_0x28229d(0xdc)](_0x27c719=>_0x27c719&&_0x27c719['name'])[_0x28229d(0xb0)](_0xadd7be=>{const _0x53203b=_0x28229d;if(_0xadd7be['type']||_0xadd7be[_0x53203b(0xa9)])return{'name':_0xadd7be[_0x53203b(0xaf)],..._0xadd7be[_0x53203b(0x11c)]&&{'type':_0xadd7be[_0x53203b(0x11c)]},..._0xadd7be[_0x53203b(0xa9)]&&{'visibility':_0xadd7be[_0x53203b(0xa9)]}};return _0xadd7be[_0x53203b(0xaf)];}));_0xdbcd9b[_0x28229d(0x105)]>0x0&&(_0x45c1c2['columns']=_0xdbcd9b);_0x352852[_0x28229d(0xac)]!==undefined&&(_0x352852[_0x28229d(0xac)]===![]&&_0xdbcd9b[_0x28229d(0x105)]===0x0?_0x45c1c2[_0x28229d(0x10f)]=!![]:_0x45c1c2['all_columns']=_0x352852['allColumns']);const _0x1fca78={};let _0xe5e266=![];_0x352852[_0x28229d(0xe3)]&&(_0x1fca78[_0x28229d(0x11c)]=_0x352852[_0x28229d(0xe3)],_0xe5e266=!![]);_0x352852[_0x28229d(0x107)]&&(_0x1fca78[_0x28229d(0x126)]=_0x352852[_0x28229d(0x107)],_0xe5e266=!![]);_0x352852[_0x28229d(0xdb)]!==undefined&&_0x352852['repeatFrequency']!==null&&(_0x1fca78['repeat_frequency']=_0x352852['repeatFrequency'],_0xe5e266=!![]);_0x352852[_0x28229d(0xae)]&&_0x352852[_0x28229d(0xae)][_0x28229d(0x105)]>0x0&&(_0x1fca78[_0x28229d(0xb8)]=_0x352852[_0x28229d(0xae)],_0xe5e266=!![]);_0x352852[_0x28229d(0x11d)]!==undefined&&(_0x1fca78[_0x28229d(0xd4)]=_0x352852['startAt'],_0xe5e266=!![]);_0x352852[_0x28229d(0xee)]!==undefined&&(_0x1fca78[_0x28229d(0xe2)]=_0x352852[_0x28229d(0xee)],_0xe5e266=!![]);_0x352852[_0x28229d(0xf9)]&&(_0x1fca78[_0x28229d(0xf9)]=_0x352852[_0x28229d(0xf9)],_0xe5e266=!![]);_0xe5e266&&(_0x45c1c2[_0x28229d(0xc1)]=_0x1fca78);(_0x352852[_0x28229d(0xa8)]&&_0x352852['notifyOn'][_0x28229d(0x105)]>0x0||_0x352852[_0x28229d(0x135)]&&_0x352852[_0x28229d(0x135)][_0x28229d(0x105)]>0x0)&&(_0x45c1c2[_0x28229d(0xed)]={},_0x352852[_0x28229d(0xa8)]&&_0x352852[_0x28229d(0xa8)][_0x28229d(0x105)]>0x0&&(_0x45c1c2[_0x28229d(0xed)][_0x28229d(0x115)]=_0x352852[_0x28229d(0xa8)]),_0x352852[_0x28229d(0x135)]&&_0x352852['emailRecipients'][_0x28229d(0x105)]>0x0&&(_0x45c1c2['notification'][_0x28229d(0xce)]=_0x352852[_0x28229d(0x135)][_0x28229d(0xb0)](_0x28839e=>{const _0x35c672=_0x56583c?.['get'](_0x28839e);return _0x35c672??String(_0x28839e);})));_0x352852[_0x28229d(0xe7)]&&Object['keys'](_0x352852[_0x28229d(0xe7)])[_0x28229d(0x105)]>0x0&&(_0x45c1c2[_0x28229d(0xb9)]=normalizeConnectorConfigForYaml(_0x352852['connectorConfig']));_0x352852[_0x28229d(0xe8)]&&(_0x45c1c2[_0x28229d(0x116)]=_0x352852['activationTemplateId']);if(_0x352852['syndicationBehavior']){const _0x10cb87={},_0x3313d7=_0x352852[_0x28229d(0x136)];_0x3313d7[_0x28229d(0xda)]&&_0x3313d7[_0x28229d(0xda)][_0x28229d(0x105)]>0x0&&(_0x10cb87[_0x28229d(0xda)]=_0x3313d7[_0x28229d(0xda)]['filter'](_0x1e4ca1=>_0x1e4ca1&&_0x1e4ca1[_0x28229d(0xaf)])[_0x28229d(0xb0)](_0x52a10f=>({'name':_0x52a10f['name'],..._0x52a10f[_0x28229d(0x11c)]&&{'type':_0x52a10f[_0x28229d(0x11c)]},..._0x52a10f[_0x28229d(0xa9)]&&{'visibility':_0x52a10f[_0x28229d(0xa9)]}}))),_0x3313d7[_0x28229d(0xea)]&&(_0x10cb87[_0x28229d(0xf7)]=_0x3313d7[_0x28229d(0xea)]),_0x3313d7[_0x28229d(0x122)]!==undefined&&(_0x10cb87[_0x28229d(0xc8)]=_0x3313d7[_0x28229d(0x122)]),_0x3313d7['joinStrategy']&&(_0x10cb87[_0x28229d(0x123)]=_0x3313d7['joinStrategy']),_0x3313d7[_0x28229d(0x118)]&&(_0x10cb87['formatting']=_0x3313d7['formatting']),_0x3313d7[_0x28229d(0x11a)]&&_0x3313d7[_0x28229d(0x11a)]['length']>0x0&&(_0x10cb87['order_by']=_0x3313d7[_0x28229d(0x11a)]),Object[_0x28229d(0xa6)](_0x10cb87)[_0x28229d(0x105)]>0x0&&(_0x45c1c2['behavior']=_0x10cb87);}return _0x45c1c2;}export function journeyActivationStepToYaml(_0x4324df,_0x573889,_0x3cf6f9){const _0x2c9c98=a111_0x22e1b1,_0x121218=_0x4324df[_0x2c9c98(0x12f)][_0x2c9c98(0xf5)],_0xdb868f=_0x121218[_0x2c9c98(0x104)]||'',_0x56bb7c=_0x3cf6f9?.[_0x2c9c98(0x12e)](_0xdb868f)??_0xdb868f,_0x1f3414={'name':_0x121218[_0x2c9c98(0xaf)]||'','connection':_0x56bb7c};_0x121218[_0x2c9c98(0xdf)]&&(_0x1f3414['description']=_0x121218['description']);let _0x223a70=[];_0x121218[_0x2c9c98(0xda)]&&_0x121218[_0x2c9c98(0xda)][_0x2c9c98(0x105)]>0x0&&(_0x223a70=_0x121218['columns'][_0x2c9c98(0xdc)](_0x315abb=>_0x315abb&&_0x315abb['name'])['map'](_0x6acb6b=>{const _0x5be2ad=_0x2c9c98;if(_0x6acb6b[_0x5be2ad(0x11c)]||_0x6acb6b[_0x5be2ad(0xa9)])return{'name':_0x6acb6b[_0x5be2ad(0xaf)],..._0x6acb6b[_0x5be2ad(0x11c)]&&{'type':_0x6acb6b[_0x5be2ad(0x11c)]},..._0x6acb6b[_0x5be2ad(0xa9)]&&{'visibility':_0x6acb6b[_0x5be2ad(0xa9)]}};return _0x6acb6b[_0x5be2ad(0xaf)];}));_0x223a70[_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xda)]=_0x223a70);_0x121218[_0x2c9c98(0xac)]!==undefined&&(_0x121218[_0x2c9c98(0xac)]===![]&&_0x223a70['length']===0x0?_0x1f3414[_0x2c9c98(0x10f)]=!![]:_0x1f3414[_0x2c9c98(0x10f)]=_0x121218[_0x2c9c98(0xac)]);const _0x2d2f76={};let _0x45ac63=![];_0x121218[_0x2c9c98(0xe3)]&&(_0x2d2f76[_0x2c9c98(0x11c)]=_0x121218[_0x2c9c98(0xe3)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0x107)]&&(_0x2d2f76['repeat_unit']=_0x121218[_0x2c9c98(0x107)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0xdb)]!==undefined&&_0x121218[_0x2c9c98(0xdb)]!==null&&(_0x2d2f76['repeat_frequency']=_0x121218[_0x2c9c98(0xdb)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0x11d)]!==undefined&&(_0x2d2f76[_0x2c9c98(0xd4)]=_0x121218[_0x2c9c98(0x11d)],_0x45ac63=!![]);_0x121218['endOn']!==undefined&&(_0x2d2f76[_0x2c9c98(0xe2)]=_0x121218[_0x2c9c98(0xee)],_0x45ac63=!![]);_0x121218[_0x2c9c98(0xf9)]&&(_0x2d2f76[_0x2c9c98(0xf9)]=_0x121218[_0x2c9c98(0xf9)],_0x45ac63=!![]);_0x45ac63&&(_0x1f3414[_0x2c9c98(0xc1)]=_0x2d2f76);(_0x121218[_0x2c9c98(0xa8)]&&_0x121218[_0x2c9c98(0xa8)][_0x2c9c98(0x105)]>0x0||_0x121218[_0x2c9c98(0x135)]&&_0x121218[_0x2c9c98(0x135)]['length']>0x0)&&(_0x1f3414[_0x2c9c98(0xed)]={},_0x121218[_0x2c9c98(0xa8)]&&_0x121218[_0x2c9c98(0xa8)][_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xed)][_0x2c9c98(0x115)]=_0x121218[_0x2c9c98(0xa8)]),_0x121218[_0x2c9c98(0x135)]&&_0x121218[_0x2c9c98(0x135)][_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xed)][_0x2c9c98(0xce)]=_0x121218[_0x2c9c98(0x135)][_0x2c9c98(0xb0)](_0x3c7484=>{const _0x3b9d64=_0x2c9c98,_0x1b3f48=_0x573889?.[_0x3b9d64(0x12e)](_0x3c7484);return _0x1b3f48??String(_0x3c7484);})));_0x121218[_0x2c9c98(0xe7)]&&Object[_0x2c9c98(0xa6)](_0x121218[_0x2c9c98(0xe7)])[_0x2c9c98(0x105)]>0x0&&(_0x1f3414['connector_config']=normalizeConnectorConfigForYaml(_0x121218['connectorConfig']));_0x121218['activationTemplateId']&&(_0x1f3414['activation_template_id']=_0x121218['activationTemplateId']);if(_0x121218['syndicationBehavior']){const _0x1579b4={},_0x50c464=_0x121218[_0x2c9c98(0x136)];_0x50c464['columns']&&_0x50c464[_0x2c9c98(0xda)]['length']>0x0&&(_0x1579b4[_0x2c9c98(0xda)]=_0x50c464[_0x2c9c98(0xda)][_0x2c9c98(0xdc)](_0x4c338f=>_0x4c338f&&_0x4c338f['name'])[_0x2c9c98(0xb0)](_0x45894b=>({'name':_0x45894b['name'],..._0x45894b[_0x2c9c98(0x11c)]&&{'type':_0x45894b[_0x2c9c98(0x11c)]},..._0x45894b['visibility']&&{'visibility':_0x45894b[_0x2c9c98(0xa9)]}}))),_0x50c464[_0x2c9c98(0xea)]&&(_0x1579b4['behavior_table']=_0x50c464[_0x2c9c98(0xea)]),_0x50c464[_0x2c9c98(0x122)]!==undefined&&(_0x1579b4['join_row']=_0x50c464[_0x2c9c98(0x122)]),_0x50c464[_0x2c9c98(0xd1)]&&(_0x1579b4[_0x2c9c98(0x123)]=_0x50c464[_0x2c9c98(0xd1)]),_0x50c464[_0x2c9c98(0x118)]&&(_0x1579b4['formatting']=_0x50c464[_0x2c9c98(0x118)]),_0x50c464['orderBy']&&_0x50c464['orderBy'][_0x2c9c98(0x105)]>0x0&&(_0x1579b4[_0x2c9c98(0xf0)]=_0x50c464['orderBy']),Object[_0x2c9c98(0xa6)](_0x1579b4)[_0x2c9c98(0x105)]>0x0&&(_0x1f3414[_0x2c9c98(0xfa)]=_0x1579b4);}return _0x1f3414;}export function segmentWithActivationsToYaml(_0x74c4ad,_0x216663,_0x3c2021,_0x1f747d,_0x586c6c){const _0x5e85b5=a111_0x22e1b1,_0x46f347=segmentResponseToDefSync(_0x74c4ad,_0x3c2021);return _0x216663[_0x5e85b5(0x105)]>0x0&&(_0x46f347[_0x5e85b5(0xc7)]=_0x216663[_0x5e85b5(0xb0)](_0x29849e=>activationResponseToDef(_0x29849e,_0x1f747d,_0x586c6c))),_0x46f347;}function normalizeColumn(_0x58ed5c){const _0x18ccdf=a111_0x22e1b1;if(typeof _0x58ed5c===_0x18ccdf(0xeb))return{'name':_0x58ed5c};return{'name':_0x58ed5c[_0x18ccdf(0xaf)],..._0x58ed5c[_0x18ccdf(0x11c)]&&{'type':_0x58ed5c[_0x18ccdf(0x11c)]},..._0x58ed5c[_0x18ccdf(0xa9)]&&{'visibility':_0x58ed5c[_0x18ccdf(0xa9)]}};}export async function activationDefToCreateRequest(_0x10a304,_0x5132fe){const _0x22873f=a111_0x22e1b1,_0x509405=_0x5132fe?.[_0x22873f(0xbf)],_0xd5a64b=_0x5132fe?.[_0x22873f(0x12d)],_0x3712a7=_0x10a304['connection'];let _0x24297f;const _0x2aa180=parseInt(_0x3712a7,0xa);if(!isNaN(_0x2aa180)&&String(_0x2aa180)===_0x3712a7)_0x24297f=_0x2aa180;else{const _0x80499a=_0xd5a64b?.['get'](_0x3712a7);if(_0x80499a===undefined)throw new SDKError(ErrorCode[_0x22873f(0xff)],_0x22873f(0xb1)+_0x3712a7,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x24297f=_0x80499a;}const _0x3fba6d={'name':_0x10a304[_0x22873f(0xaf)],'connectionId':_0x24297f};_0x10a304['description']&&(_0x3fba6d[_0x22873f(0xdf)]=_0x10a304['description']);let _0x73a94c=[];_0x10a304[_0x22873f(0xda)]&&_0x10a304[_0x22873f(0xda)][_0x22873f(0x105)]>0x0&&(_0x73a94c=_0x10a304[_0x22873f(0xda)][_0x22873f(0xdc)](_0x53ca37=>_0x53ca37!=null)[_0x22873f(0xb0)](normalizeColumn));_0x73a94c['length']>0x0&&(_0x3fba6d[_0x22873f(0xda)]=_0x73a94c);_0x10a304['all_columns']!==undefined&&(_0x10a304[_0x22873f(0x10f)]===![]&&_0x73a94c[_0x22873f(0x105)]===0x0?_0x3fba6d[_0x22873f(0xac)]=!![]:_0x3fba6d[_0x22873f(0xac)]=_0x10a304[_0x22873f(0x10f)]);if(_0x10a304[_0x22873f(0xc1)]){const _0x9b5b5f=_0x10a304[_0x22873f(0xc1)];_0x9b5b5f[_0x22873f(0x11c)]&&(_0x3fba6d[_0x22873f(0xe3)]=_0x9b5b5f[_0x22873f(0x11c)]),_0x9b5b5f['repeat_unit']&&(_0x3fba6d[_0x22873f(0x107)]=_0x9b5b5f[_0x22873f(0x126)]),_0x9b5b5f[_0x22873f(0xb4)]!==undefined&&(_0x3fba6d[_0x22873f(0xdb)]=_0x9b5b5f['repeat_frequency']),_0x9b5b5f[_0x22873f(0xb8)]&&(_0x3fba6d[_0x22873f(0xae)]=_0x9b5b5f[_0x22873f(0xb8)]),_0x9b5b5f['start_at']!==undefined&&(_0x3fba6d[_0x22873f(0x11d)]=_0x9b5b5f[_0x22873f(0xd4)]),_0x9b5b5f[_0x22873f(0xe2)]!==undefined&&(_0x3fba6d[_0x22873f(0xee)]=_0x9b5b5f[_0x22873f(0xe2)]),_0x9b5b5f['timezone']&&(_0x3fba6d[_0x22873f(0xf9)]=_0x9b5b5f[_0x22873f(0xf9)]);}_0x10a304[_0x22873f(0xed)]&&(_0x10a304['notification'][_0x22873f(0x115)]&&(_0x3fba6d[_0x22873f(0xa8)]=_0x10a304[_0x22873f(0xed)][_0x22873f(0x115)]),_0x10a304['notification']['email_recipients']&&(_0x3fba6d[_0x22873f(0x135)]=_0x10a304['notification']['email_recipients']['map'](_0x492c5e=>{const _0x2165c1=_0x22873f,_0x24de4d=Number(_0x492c5e);if(!isNaN(_0x24de4d)&&String(_0x24de4d)===_0x492c5e)return _0x24de4d;const _0x43ef21=_0x509405?.['get'](_0x492c5e[_0x2165c1(0xd0)]());if(_0x43ef21===undefined)throw new SDKError(ErrorCode[_0x2165c1(0xb2)],_0x2165c1(0x120)+_0x492c5e+_0x2165c1(0xe1));return _0x43ef21;})));if(_0x10a304[_0x22873f(0xb9)]){const _0x1a2040=_0x5132fe?.['connectionNameToTypeMap']?.['get'](_0x3712a7);if(_0x1a2040&&_0x5132fe?.[_0x22873f(0xcd)])try{const _0xefacaa=await _0x5132fe[_0x22873f(0xcd)](_0x1a2040),_0xd2df3e=validateConnectorConfig(_0x10a304[_0x22873f(0xb9)],_0xefacaa);if(!_0xd2df3e[_0x22873f(0xaa)])throw new SDKError(ErrorCode[_0x22873f(0x12c)],_0x22873f(0x11f)+_0x10a304['name']+_0x22873f(0x106)+formatValidationErrors(_0xd2df3e[_0x22873f(0xd6)]),undefined,{'helpText':_0x22873f(0xde)+_0x1a2040+_0x22873f(0xd9)+formatSchemaAsHelp(_0xefacaa)});if(_0xd2df3e['warnings'][_0x22873f(0x105)]>0x0){const _0x34c31=formatValidationWarnings(_0xd2df3e[_0x22873f(0x127)]);console[_0x22873f(0xd3)](_0x22873f(0x10d)+_0x10a304[_0x22873f(0xaf)]+_0x22873f(0x106)+_0x34c31);}_0x3fba6d['connectorConfig']=transformConfigToLegacy(_0x10a304['connector_config'],_0xefacaa);}catch(_0x673e6f){if(_0x673e6f instanceof SDKError&&_0x673e6f['code']===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x3fba6d[_0x22873f(0xe7)]=_0x10a304[_0x22873f(0xb9)];else throw _0x673e6f;}else _0x3fba6d[_0x22873f(0xe7)]=_0x10a304[_0x22873f(0xb9)];}_0x10a304[_0x22873f(0x116)]!==undefined&&(_0x3fba6d['activationTemplateId']=_0x10a304['activation_template_id']);if(_0x10a304['behavior']){const _0x4e3370=_0x10a304[_0x22873f(0xfa)],_0x5ab42c={};if(_0x4e3370[_0x22873f(0xda)]&&_0x4e3370[_0x22873f(0xda)][_0x22873f(0x105)]>0x0){const _0x426130=_0x4e3370['columns'][_0x22873f(0xdc)](_0xe3543f=>_0xe3543f&&_0xe3543f[_0x22873f(0xaf)]);_0x426130[_0x22873f(0x105)]>0x0&&(_0x5ab42c[_0x22873f(0xda)]=_0x426130);}_0x4e3370['behavior_table']&&(_0x5ab42c['behaviorTableName']=_0x4e3370['behavior_table']),_0x4e3370[_0x22873f(0xc8)]!==undefined&&(_0x5ab42c['joinRow']=_0x4e3370[_0x22873f(0xc8)]),_0x4e3370['join_strategy']&&(_0x5ab42c[_0x22873f(0xd1)]=_0x4e3370['join_strategy']),_0x4e3370[_0x22873f(0x118)]&&(_0x5ab42c[_0x22873f(0x118)]=_0x4e3370[_0x22873f(0x118)]),_0x4e3370['order_by']&&(_0x5ab42c[_0x22873f(0x11a)]=_0x4e3370[_0x22873f(0xf0)]),_0x3fba6d[_0x22873f(0x136)]=_0x5ab42c;}return _0x3fba6d;}export async function activationDefToUpdateRequest(_0x2459ad,_0x3a272d){return activationDefToCreateRequest(_0x2459ad,_0x3a272d);}export function deepSortObject(_0x538fb2){const _0x2dc6f1=a111_0x22e1b1;if(_0x538fb2===null||typeof _0x538fb2!=='object')return _0x538fb2;if(Array[_0x2dc6f1(0x125)](_0x538fb2))return _0x538fb2['map'](deepSortObject)[_0x2dc6f1(0x10a)]((_0x4ffa3f,_0x4a4c4c)=>JSON['stringify'](_0x4ffa3f)[_0x2dc6f1(0xf8)](JSON[_0x2dc6f1(0x128)](_0x4a4c4c)));const _0x1e4dfc={};for(const _0x336b0a of Object[_0x2dc6f1(0xa6)](_0x538fb2)[_0x2dc6f1(0x10a)]()){_0x1e4dfc[_0x336b0a]=deepSortObject(_0x538fb2[_0x336b0a]);}return _0x1e4dfc;}function a111_0x3211(_0x3ef1fc,_0x1262ee){_0x3ef1fc=_0x3ef1fc-0xa5;const _0x1577aa=a111_0x1577();let _0x321192=_0x1577aa[_0x3ef1fc];return _0x321192;}export function serializeRule(_0x32a1b0){const _0x12eb6f=a111_0x22e1b1;return JSON[_0x12eb6f(0x128)](deepSortObject(_0x32a1b0));}export function normalizeRuleForMatching(_0x116c09){return normalizeConditionsForMatching(_0x116c09);}function normalizeConditionsForMatching(_0x35e0b9){const _0x287e53=a111_0x22e1b1;if(_0x35e0b9===null||typeof _0x35e0b9!==_0x287e53(0x108))return _0x35e0b9;if(Array['isArray'](_0x35e0b9))return _0x35e0b9[_0x287e53(0xb0)](normalizeConditionsForMatching);const _0x34e193=_0x35e0b9;if((_0x34e193[_0x287e53(0x11c)]===_0x287e53(0xc3)||_0x34e193[_0x287e53(0x11c)]===_0x287e53(0xe5))&&typeof _0x34e193[_0x287e53(0xcb)]==='string')return{..._0x34e193,'segment':_0x287e53(0xb7)};const _0x3bbc55={};for(const _0x55f8c0 of Object[_0x287e53(0xa6)](_0x34e193)){_0x3bbc55[_0x55f8c0]=normalizeConditionsForMatching(_0x34e193[_0x55f8c0]);}return _0x3bbc55;}export function serializeRuleForMatching(_0x1348fc){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x1348fc)));}export function expandSegmentReferences(_0x368fa1,_0x45c676,_0x1fde60=new Set()){return expandConditions(_0x368fa1,_0x45c676,_0x1fde60);}function expandConditions(_0x16ff6a,_0x19ec55,_0x484ac3){const _0x17c41a=a111_0x22e1b1;if(_0x16ff6a===null||typeof _0x16ff6a!==_0x17c41a(0x108))return _0x16ff6a;if(Array[_0x17c41a(0x125)](_0x16ff6a))return _0x16ff6a[_0x17c41a(0xb0)](_0x471a28=>expandConditions(_0x471a28,_0x19ec55,_0x484ac3));const _0x4abe99=_0x16ff6a;if((_0x4abe99[_0x17c41a(0x11c)]===_0x17c41a(0xc3)||_0x4abe99['type']===_0x17c41a(0xe5))&&typeof _0x4abe99['segment']===_0x17c41a(0xeb)){const _0x1a20eb=_0x4abe99[_0x17c41a(0xcb)],_0x5079f2=_0x19ec55[_0x17c41a(0x12e)](_0x1a20eb);if(_0x5079f2&&!_0x484ac3[_0x17c41a(0x117)](_0x1a20eb)){const _0x436e4c=new Set(_0x484ac3);_0x436e4c[_0x17c41a(0xe4)](_0x1a20eb);const _0x5235c6=expandConditions(_0x5079f2,_0x19ec55,_0x436e4c);return{'type':_0x4abe99['type'],'expanded_rule':_0x5235c6};}return{'type':_0x4abe99[_0x17c41a(0x11c)],'expanded_rule':'__UNRESOLVED__'};}const _0x1c15e4={};for(const _0x3fed0c of Object[_0x17c41a(0xa6)](_0x4abe99)){_0x1c15e4[_0x3fed0c]=expandConditions(_0x4abe99[_0x3fed0c],_0x19ec55,_0x484ac3);}return _0x1c15e4;}export function serializeExpandedRule(_0x21f437,_0x51e1bd){const _0x3cea71=a111_0x22e1b1,_0x1cbe5e=expandSegmentReferences(_0x21f437,_0x51e1bd);return JSON[_0x3cea71(0x128)](deepSortObject(_0x1cbe5e));}export function createSegmentNameContext(_0x4a3299){const _0x302774=a111_0x22e1b1,_0x2e3462=new Set(),_0x2fa4be=new Map(),_0x5c4097=new Map();if(_0x4a3299)for(const [_0x35bbf2,_0x4cd8c7]of Object[_0x302774(0x103)](_0x4a3299)){if(_0x4cd8c7[_0x302774(0x134)]){const _0x4c7a7d=serializeRule(_0x4cd8c7['rule']);_0x5c4097[_0x302774(0xc4)](_0x4c7a7d,_0x35bbf2),_0x2e3462[_0x302774(0xe4)](_0x35bbf2);}}return{'usedNames':_0x2e3462,'ruleHashToName':_0x2fa4be,'localRuleToName':_0x4a3299?_0x5c4097:undefined};}export function resolveSegmentName(_0x3dc2b1,_0x1b646f,_0x3cb730,_0x53bf1f){const _0x3916aa=a111_0x22e1b1,_0x2635a7=serializeRule(_0x1b646f);if(_0x3cb730[_0x3916aa(0x113)]){const _0x1e3efa=_0x3cb730[_0x3916aa(0x113)][_0x3916aa(0x12e)](_0x2635a7);if(_0x1e3efa)return{'name':_0x1e3efa,'isDuplicate':![],'isLocalMatch':!![]};}const _0x532e13=_0x3cb730[_0x3916aa(0x11b)][_0x3916aa(0x12e)](_0x2635a7);if(_0x532e13)return{'name':_0x532e13,'isDuplicate':!![],'isLocalMatch':![]};const _0x20a19d=_0x53bf1f(_0x3dc2b1);let _0x3a6187=_0x20a19d||_0x3dc2b1,_0x48aa39=_0x3a6187,_0x44e983=0x2;while(_0x3cb730['usedNames'][_0x3916aa(0x117)](_0x48aa39)){_0x48aa39=_0x3a6187+'_'+_0x44e983,_0x44e983++;}return _0x3cb730['usedNames'][_0x3916aa(0xe4)](_0x48aa39),_0x3cb730[_0x3916aa(0x11b)][_0x3916aa(0xc4)](_0x2635a7,_0x48aa39),{'name':_0x48aa39,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x362b47){const _0x30e477=[],_0x39abeb=_0x2f80cc=>{const _0x58e8e7=a111_0x3211;if(!_0x2f80cc||typeof _0x2f80cc!==_0x58e8e7(0x108))return;if(Array[_0x58e8e7(0x125)](_0x2f80cc)){_0x2f80cc['forEach'](_0x39abeb);return;}const _0x47ebbe=_0x2f80cc;(_0x47ebbe[_0x58e8e7(0x11c)]===_0x58e8e7(0xc3)||_0x47ebbe[_0x58e8e7(0x11c)]===_0x58e8e7(0xe5))&&typeof _0x47ebbe[_0x58e8e7(0xcb)]===_0x58e8e7(0xeb)&&_0x30e477[_0x58e8e7(0x130)](_0x47ebbe[_0x58e8e7(0xcb)]);for(const _0x5abef3 of Object['values'](_0x47ebbe)){_0x39abeb(_0x5abef3);}};return _0x39abeb(_0x362b47),_0x30e477;}export function validateSegmentRule(_0x3b1fc5,_0x17ca48){const _0x3dbfc1=a111_0x22e1b1;if(!_0x17ca48||!_0x17ca48[_0x3dbfc1(0x119)])return;for(let _0x3ab880=0x0;_0x3ab880<_0x17ca48['conditions'][_0x3dbfc1(0x105)];_0x3ab880++){const _0x34c8c6=_0x17ca48[_0x3dbfc1(0x119)][_0x3ab880];if(_0x3dbfc1(0x11c)in _0x34c8c6&&_0x34c8c6['type']===_0x3dbfc1(0xc2)){const _0x232116=_0x34c8c6;if(!_0x232116[_0x3dbfc1(0xfe)]||_0x232116['attribute']==='')throw new SDKError(ErrorCode[_0x3dbfc1(0x10e)],'Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27'+_0x3b1fc5+_0x3dbfc1(0xc0)+(_0x3dbfc1(0xcc)+_0x3ab880+_0x3dbfc1(0x132))+_0x3dbfc1(0xe9));}}}function a111_0x1577(){const _0x13f7c5=['90621YUWMRj','TimeWithinPast','Segment\x20description','connection','replace','emailToIdMap','\x27:\x20','schedule','Value','include','set','arrayMatching','limit','activations','join_row','operator','unit','segment','conditions[','getSchema','email_recipients','985824VEhxwO','toLowerCase','joinStrategy','source','warn','start_at','any','errors','resolveSegmentName','value','\x0a\x0aAvailable\x20fields:\x0a','columns','repeatFrequency','filter','segmentFolderId','Connector:\x20','description','540djIbAd','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','end_on','scheduleType','add','exclude','2362563zaReMC','connectorConfig','activationTemplateId','Please\x20specify\x20a\x20valid\x20attribute\x20name.','behaviorTableName','string','duration','notification','endOn','leftValue','order_by','474hTLYcu','rule:','from','max','activationParams','And','behavior_table','localeCompare','timezone','behavior','12vSftZa','not','57065RZFbzv','attribute','CONNECTION_NOT_FOUND','batch','aggregation','all','entries','connectionId','length','\x22:\x0a','repeatUnit','object','visible','sort','5210524DMetHj','Reference','connector_config\x20for\x20activation\x20\x22','JOURNEY_SYNTAX_ERROR','all_columns','folder','rightValues','realtime','localRuleToName','rightValue','notify_on','activation_template_id','has','formatting','conditions','orderBy','ruleHashToName','type','startAt','111pgqSnO','Invalid\x20connector_config\x20for\x20activation\x20\x22','Unknown\x20email\x20recipient:\x20','New\x20Segment','joinRow','join_strategy','groupingColumns','isArray','repeat_unit','warnings','stringify','Equal','test','kind','CONNECTOR_INVALID_CONFIG','connectionNameToIdMap','get','attributes','push','every','].attribute\x20cannot\x20be\x20empty.\x0a','min','rule','emailRecipients','syndicationBehavior','16qDUVwd','attribute_name','values','keys','TimeWithinNext','notifyOn','visibility','valid','20760575DtYLiR','allColumns','funnel_stage','repeatSubFrequency','name','map','Unknown\x20connection:\x20','INVALID_ARGUMENT','57948wDaeJe','repeat_frequency','parse','YAML\x20config\x20missing\x20required\x20field:\x20name','__SEGMENT_REF__','repeat_sub_frequency','connector_config'];a111_0x1577=function(){return _0x13f7c5;};return a111_0x1577();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x31c323,_0x1fdf6d){const _0x47ebab=a112_0xc70b,_0x2c3bff=_0x31c323();while(!![]){try{const _0x46599f=-parseInt(_0x47ebab(0x1d5))/0x1*(-parseInt(_0x47ebab(0x1de))/0x2)+-parseInt(_0x47ebab(0x1cd))/0x3+-parseInt(_0x47ebab(0x1bc))/0x4+-parseInt(_0x47ebab(0x1d4))/0x5*(parseInt(_0x47ebab(0x1af))/0x6)+parseInt(_0x47ebab(0x1cc))/0x7*(parseInt(_0x47ebab(0x1e3))/0x8)+-parseInt(_0x47ebab(0x1e2))/0x9*(parseInt(_0x47ebab(0x1b3))/0xa)+parseInt(_0x47ebab(0x1d3))/0xb;if(_0x46599f===_0x1fdf6d)break;else _0x2c3bff['push'](_0x2c3bff['shift']());}catch(_0x195884){_0x2c3bff['push'](_0x2c3bff['shift']());}}}(a112_0x492e,0x65eff));import a112_0x23ed9b from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a112_0x492e(){const _0x5e432b=['Fetching\x20schema...','query','5163921LWkAJC','5848zTBkdd','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','varchar','execute','84RlLSeK','error','length','groupingName','10WiNhWO','displayName','behavior','key','set','Unknown','cyan','tableName','verbose','2029824HBVeYJ','Behaviors','name','entries','attribute','get','source','extra','setJobId','fields','startsWith','Schema\x20query:\x0a','YES','map','SELECT\x20*\x20FROM\x20(\x0a','column_name','3857RJXKSc','740439lfzweE','parentTableName','parentColumn','\x20\x20\x20\x20','behaviorName','column_type','17935863BkyTuu','193885XbIQgP','255137QBeRSl','size','replace','sort','dim','localeCompare','type','null','bold','2cwlrqm','push'];a112_0x492e=function(){return _0x5e432b;};return a112_0x492e();}export function buildSchemaResult(_0x1b2d7a){const _0x3083ad=a112_0xc70b,_0x56fe90=_0x1b2d7a['columns'][_0x3083ad(0x1c9)](_0xbb283a=>({'column_name':_0xbb283a['name'],'column_type':_0xbb283a[_0x3083ad(0x1db)],'null':_0x3083ad(0x1c8),'key':null,'default':null,'extra':null}));return{..._0x1b2d7a,'columns':[{'name':_0x3083ad(0x1cb),'type':_0x3083ad(0x1ad)},{'name':_0x3083ad(0x1d2),'type':'varchar'},{'name':_0x3083ad(0x1dc),'type':_0x3083ad(0x1ad)},{'name':_0x3083ad(0x1b6),'type':_0x3083ad(0x1ad)},{'name':'default','type':_0x3083ad(0x1ad)},{'name':_0x3083ad(0x1c3),'type':'varchar'}],'data':_0x56fe90};}function a112_0xc70b(_0x241093,_0xf44841){_0x241093=_0x241093-0x1ac;const _0x492e84=a112_0x492e();let _0xc70b63=_0x492e84[_0x241093];return _0xc70b63;}export async function executeSchemaQuery(_0x106df3,_0x5832f7,_0x37a86e){const _0x5b55d3=a112_0xc70b,_0xfdbaaf=_0x106df3['trim']()[_0x5b55d3(0x1d7)](/;+$/,''),_0x115079=_0x5b55d3(0x1ca)+_0xfdbaaf+_0x5b55d3(0x1ac);_0x37a86e[_0x5b55d3(0x1bb)]&&console[_0x5b55d3(0x1b0)](_0x5b55d3(0x1c7)+_0x115079);const _0x486db7=await withProgressSpinner(_0x5b55d3(0x1e0),async _0xa49398=>{const _0x183efd=_0x5b55d3,_0x248ebd=await _0x5832f7[_0x183efd(0x1e1)][_0x183efd(0x1ae)](_0x115079,{'catalog':'td','schema':'information_schema','onJobId':_0x18f9d3=>{const _0x3460d4=_0x183efd;_0xa49398[_0x3460d4(0x1c4)](_0x18f9d3);}});return _0x248ebd;},{'verbose':_0x37a86e[_0x5b55d3(0x1bb)]});return buildSchemaResult(_0x486db7['data']);}export function displayFieldsHumanReadable(_0x35541d,_0x3c275f){const _0x50751d=a112_0xc70b,_0xd5b2c6=_0x35541d['filter'](_0x183e2f=>_0x183e2f['source']===_0x50751d(0x1c0)),_0x2729cc=_0x35541d['filter'](_0x5e7b4f=>_0x5e7b4f[_0x50751d(0x1c2)]===_0x50751d(0x1b5)),_0x27642d=new Map();for(const _0x161334 of _0xd5b2c6){const _0x2a97c2=_0x161334[_0x50751d(0x1b2)]||_0x161334[_0x50751d(0x1ce)]||_0x50751d(0x1b8),_0x40834b=_0x27642d[_0x50751d(0x1c1)](_0x2a97c2);_0x40834b?_0x40834b['fields'][_0x50751d(0x1df)](_0x161334):_0x27642d[_0x50751d(0x1b7)](_0x2a97c2,{'displayName':_0x2a97c2,'tableName':_0x161334['parentTableName'],'fields':[_0x161334]});}const _0x24970d=new Map();for(const _0x562a9f of _0x2729cc){const _0x2c8f2d=_0x562a9f[_0x50751d(0x1d1)]||_0x50751d(0x1b8),_0xa73348=_0x24970d[_0x50751d(0x1c1)](_0x2c8f2d)||[];_0xa73348[_0x50751d(0x1df)](_0x562a9f),_0x24970d[_0x50751d(0x1b7)](_0x2c8f2d,_0xa73348);}console[_0x50751d(0x1b0)]('\x0a'+a112_0x23ed9b[_0x50751d(0x1dd)](_0x3c275f));if(_0x27642d[_0x50751d(0x1d6)]>0x0){console[_0x50751d(0x1b0)]('\x0a'+a112_0x23ed9b[_0x50751d(0x1d9)]('Attributes'));const _0x565621=[..._0x27642d[_0x50751d(0x1bf)]()]['sort']((_0x1df54c,_0x53eba3)=>_0x1df54c[0x0][_0x50751d(0x1da)](_0x53eba3[0x0]));for(const [,_0x3e7c7d]of _0x565621){const _0x1021e3=_0x3e7c7d[_0x50751d(0x1ba)]&&_0x3e7c7d[_0x50751d(0x1ba)]!==_0x3e7c7d['displayName']?'\x20'+a112_0x23ed9b['dim']('('+_0x3e7c7d[_0x50751d(0x1ba)]+')'):'';console['error']('\x20\x20'+a112_0x23ed9b['bold'](_0x3e7c7d[_0x50751d(0x1b4)])+_0x1021e3);const _0x752320=[..._0x3e7c7d[_0x50751d(0x1c5)]][_0x50751d(0x1d8)]((_0x1569fb,_0x47dd6c)=>_0x1569fb[_0x50751d(0x1be)][_0x50751d(0x1da)](_0x47dd6c['name']));for(const _0x3d6ea4 of _0x752320){const _0x5084b3=_0x3d6ea4[_0x50751d(0x1cf)]&&_0x3d6ea4[_0x50751d(0x1cf)]!==_0x3d6ea4[_0x50751d(0x1be)]?'\x20'+a112_0x23ed9b[_0x50751d(0x1d9)]('('+_0x3d6ea4[_0x50751d(0x1cf)]+')'):'';console[_0x50751d(0x1b0)](_0x50751d(0x1d0)+_0x3d6ea4[_0x50751d(0x1be)]+_0x5084b3+':\x20'+a112_0x23ed9b['cyan'](_0x3d6ea4[_0x50751d(0x1db)]));}}}if(_0x24970d['size']>0x0){console['error']('\x0a'+a112_0x23ed9b[_0x50751d(0x1d9)](_0x50751d(0x1bd)));const _0x224594=[..._0x24970d[_0x50751d(0x1bf)]()][_0x50751d(0x1d8)]((_0x48dfcf,_0x440b68)=>_0x48dfcf[0x0][_0x50751d(0x1da)](_0x440b68[0x0]));for(const [_0x1110cc,_0x2013ce]of _0x224594){const _0x151c40=_0x2013ce[0x0],_0x192b9a=_0x151c40?.[_0x50751d(0x1ce)]||'';console[_0x50751d(0x1b0)]('\x20\x20'+a112_0x23ed9b['bold'](_0x1110cc)+(_0x192b9a?'\x20'+a112_0x23ed9b[_0x50751d(0x1d9)]('('+_0x192b9a+')'):''));const _0x1eb4c8=[..._0x2013ce][_0x50751d(0x1d8)]((_0x4d6260,_0x446561)=>_0x4d6260[_0x50751d(0x1be)][_0x50751d(0x1da)](_0x446561[_0x50751d(0x1be)]));for(const _0x49de93 of _0x1eb4c8){const _0x3f85b2=_0x49de93[_0x50751d(0x1be)][_0x50751d(0x1c6)](_0x1110cc+'.')?_0x49de93[_0x50751d(0x1be)]['slice'](_0x1110cc[_0x50751d(0x1b1)]+0x1):_0x49de93['name'],_0x5450a4=_0x49de93[_0x50751d(0x1cf)]&&_0x49de93[_0x50751d(0x1cf)]!==_0x3f85b2?'\x20'+a112_0x23ed9b['dim']('('+_0x49de93[_0x50751d(0x1cf)]+')'):'';console[_0x50751d(0x1b0)]('\x20\x20\x20\x20'+_0x3f85b2+_0x5450a4+':\x20'+a112_0x23ed9b[_0x50751d(0x1b9)](_0x49de93[_0x50751d(0x1db)]));}}}console[_0x50751d(0x1b0)]('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x223dc9,_0x1c7d62){const _0x424d37=a113_0x4dc4,_0x3c43d7=_0x223dc9();while(!![]){try{const _0xb568b6=-parseInt(_0x424d37(0x70))/0x1*(parseInt(_0x424d37(0x68))/0x2)+-parseInt(_0x424d37(0x76))/0x3*(-parseInt(_0x424d37(0x6c))/0x4)+-parseInt(_0x424d37(0x7b))/0x5+-parseInt(_0x424d37(0x6e))/0x6+-parseInt(_0x424d37(0x71))/0x7*(-parseInt(_0x424d37(0x78))/0x8)+parseInt(_0x424d37(0x6a))/0x9*(-parseInt(_0x424d37(0x77))/0xa)+parseInt(_0x424d37(0x74))/0xb*(parseInt(_0x424d37(0x79))/0xc);if(_0xb568b6===_0x1c7d62)break;else _0x3c43d7['push'](_0x3c43d7['shift']());}catch(_0xab4139){_0x3c43d7['push'](_0x3c43d7['shift']());}}}(a113_0x3ad5,0x2ba7f));function a113_0x3ad5(){const _0x215642=['348tfvUoX','relative','1674610cqUMCp','name','dirname','25036fGXoJJ','isFile','9xVnDqr','join','8etflzi','endsWith','1922304oMSMvO','.yml','1QNkNWz','14xYVQGk','toLowerCase','map','207196HSEBSF','.yaml','382662KVkrWf','1189910LZSmWy','657112pVLNut'];a113_0x3ad5=function(){return _0x215642;};return a113_0x3ad5();}import{readdirSync,statSync}from'fs';function a113_0x4dc4(_0x3d64c1,_0x32bfab){_0x3d64c1=_0x3d64c1-0x66;const _0x3ad52e=a113_0x3ad5();let _0x4dc44d=_0x3ad52e[_0x3d64c1];return _0x4dc44d;}import a113_0x348da1 from'path';export function findYamlFiles(_0x155658){const _0x3349ff=[];function _0x22ae44(_0x1bc251){const _0x40bb5e=a113_0x4dc4,_0x4e2eb2=readdirSync(_0x1bc251,{'withFileTypes':!![]});for(const _0x63a663 of _0x4e2eb2){const _0x545562=a113_0x348da1[_0x40bb5e(0x6b)](_0x1bc251,_0x63a663[_0x40bb5e(0x66)]);if(_0x63a663['isDirectory']())_0x22ae44(_0x545562);else(_0x63a663[_0x40bb5e(0x66)][_0x40bb5e(0x6d)](_0x40bb5e(0x6f))||_0x63a663['name'][_0x40bb5e(0x6d)]('.yaml'))&&_0x3349ff['push'](_0x545562);}}return _0x22ae44(_0x155658),_0x3349ff;}export function discoverYamlFiles(_0xc781a7){const _0x188e54=a113_0x4dc4,_0x42187f=findYamlFiles(_0xc781a7);return _0x42187f[_0x188e54(0x73)](_0x3ac19f=>{const _0x264125=_0x188e54,_0x397fbb=a113_0x348da1[_0x264125(0x7a)](_0xc781a7,_0x3ac19f),_0x1d1168=a113_0x348da1[_0x264125(0x67)](_0x397fbb);return{'absolutePath':_0x3ac19f,'relativePath':_0x397fbb,'folderPath':_0x1d1168==='.'?'':_0x1d1168};});}export function isYamlFile(_0xd80f65){const _0x27f08d=a113_0x4dc4;try{const _0x143041=statSync(_0xd80f65);if(!_0x143041[_0x27f08d(0x69)]())return![];const _0x5a10bf=a113_0x348da1['extname'](_0xd80f65)[_0x27f08d(0x72)]();return _0x5a10bf===_0x27f08d(0x6f)||_0x5a10bf===_0x27f08d(0x75);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2cdfae,_0x36b397){const _0x590677=a114_0x2ea3,_0x2109e6=_0x2cdfae();while(!![]){try{const _0x48359e=parseInt(_0x590677(0xd0))/0x1+-parseInt(_0x590677(0x9c))/0x2+-parseInt(_0x590677(0xd9))/0x3+-parseInt(_0x590677(0xb6))/0x4*(parseInt(_0x590677(0xa2))/0x5)+parseInt(_0x590677(0xa7))/0x6*(-parseInt(_0x590677(0xbb))/0x7)+parseInt(_0x590677(0xea))/0x8+-parseInt(_0x590677(0xcb))/0x9*(-parseInt(_0x590677(0xd1))/0xa);if(_0x48359e===_0x36b397)break;else _0x2109e6['push'](_0x2109e6['shift']());}catch(_0x3e6427){_0x2109e6['push'](_0x2109e6['shift']());}}}(a114_0x269b,0xc6ced));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x44cf25){const _0x5f496c=a114_0x2ea3;return _0x44cf25[_0x5f496c(0xc2)]()['replace'](/\s+/g,'_')[_0x5f496c(0xab)](/[^a-z0-9_]/g,'')[_0x5f496c(0xab)](/_+/g,'_')[_0x5f496c(0xab)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x529912){const _0x1345b5=a114_0x2ea3,_0x81bad2=_0x529912[_0x1345b5(0xc8)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x81bad2){const _0x272bfe=_0x81bad2[0x1][_0x1345b5(0xc2)](),_0x231cbe=_0x81bad2[0x2],_0x2d74bb=_0x231cbe[_0x1345b5(0xab)](/-/g,'')['slice'](0x0,0x4)[_0x1345b5(0xc2)]();return _0x272bfe+'_'+_0x2d74bb;}const _0x171203=_0x529912[_0x1345b5(0xc8)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x171203){const _0x2da67a=_0x171203[0x1],_0x36d295=_0x171203[0x2][_0x1345b5(0xc2)](),_0x5b00f5=_0x2da67a['replace'](/-/g,'')[_0x1345b5(0xe4)](0x0,0x4)['toLowerCase']();return _0x36d295+'_'+_0x5b00f5;}return undefined;}function stableStringify(_0x32e354){const _0x30e195=a114_0x2ea3;if(Array[_0x30e195(0xa3)](_0x32e354))return'['+_0x32e354[_0x30e195(0xe2)](_0x47af7b=>stableStringify(_0x47af7b))[_0x30e195(0xb7)](',')+']';if(_0x32e354&&typeof _0x32e354===_0x30e195(0xc1)){const _0x2959aa=_0x32e354,_0x5137c8=Object[_0x30e195(0xa5)](_0x2959aa)['sort'](),_0x1d4f5e=_0x5137c8[_0x30e195(0xe2)](_0x183c22=>'\x22'+_0x183c22+'\x22:'+stableStringify(_0x2959aa[_0x183c22]));return'{'+_0x1d4f5e[_0x30e195(0xb7)](',')+'}';}const _0x2033f3=JSON[_0x30e195(0xc4)](_0x32e354);return _0x2033f3===undefined?_0x30e195(0xc0):_0x2033f3;}export function consolidateActivationsByContent(_0xc657c5){const _0x3c82bf=a114_0x2ea3,_0x570392={},_0x5727ee=new Map(),_0x20f590=new Map();for(const _0x594a52 of _0xc657c5){if(!_0x594a52)continue;for(const [_0x40d2f1,_0x53c480]of Object[_0x3c82bf(0xa9)](_0x594a52)){const _0x24098b={'connection':_0x53c480[_0x3c82bf(0xdc)],..._0x53c480[_0x3c82bf(0xaa)]!==undefined&&{'all_columns':_0x53c480['all_columns']},..._0x53c480[_0x3c82bf(0xa0)]!==undefined&&{'columns':_0x53c480['columns']},..._0x53c480[_0x3c82bf(0xc6)]!==undefined&&{'behavior':_0x53c480[_0x3c82bf(0xc6)]},..._0x53c480[_0x3c82bf(0xd8)]!==undefined&&{'schedule':_0x53c480[_0x3c82bf(0xd8)]},..._0x53c480[_0x3c82bf(0x9f)]!==undefined&&{'notification':_0x53c480['notification']},..._0x53c480[_0x3c82bf(0xd4)]!==undefined&&{'connector_config':_0x53c480[_0x3c82bf(0xd4)]},..._0x53c480[_0x3c82bf(0xb2)]!==undefined&&{'activation_template_id':_0x53c480[_0x3c82bf(0xb2)]}},_0x585b8e=stableStringify(_0x24098b),_0x2f6076=_0x20f590['get'](_0x585b8e);_0x2f6076?_0x5727ee[_0x3c82bf(0xcf)](_0x40d2f1,_0x2f6076):(_0x570392[_0x40d2f1]=_0x53c480,_0x5727ee[_0x3c82bf(0xcf)](_0x40d2f1,_0x40d2f1),_0x20f590[_0x3c82bf(0xcf)](_0x585b8e,_0x40d2f1));}}return{'merged':_0x570392,'nameMapping':_0x5727ee};}export function updateActivationReferences(_0x5e0918,_0x5c823d){const _0x566799=a114_0x2ea3;if(!_0x5e0918)return;for(const _0x215a2a of _0x5e0918){if(!_0x215a2a[_0x566799(0xd7)])continue;for(const _0x70a4da of _0x215a2a['steps']){if(_0x70a4da[_0x566799(0xda)]===_0x566799(0xc7)&&_0x70a4da['with']?.[_0x566799(0xc7)]){const _0x744346=_0x5c823d[_0x566799(0xc9)](_0x70a4da[_0x566799(0xd6)][_0x566799(0xc7)]);_0x744346&&_0x744346!==_0x70a4da[_0x566799(0xd6)][_0x566799(0xc7)]&&(_0x70a4da['with'][_0x566799(0xc7)]=_0x744346);}}}}export function consolidateSegmentsByContent(_0x9e8543,_0x38e3dd){const _0x19741c=a114_0x2ea3,_0xe6bc6e={},_0x4ca1f8=new Map(),_0x1ecc9d=new Map();for(const _0x37b4a6 of _0x9e8543){if(!_0x37b4a6)continue;for(const [_0x541bf6,_0x14098d]of Object[_0x19741c(0xa9)](_0x37b4a6)){if(!_0x14098d['rule']){_0xe6bc6e[_0x541bf6]=_0x14098d,_0x4ca1f8[_0x19741c(0xcf)](_0x541bf6,_0x541bf6);continue;}const _0x1a0fdd=_0x14098d[_0x19741c(0xce)]&&_0x14098d[_0x19741c(0xce)][_0x19741c(0xe6)]()?_0x14098d[_0x19741c(0xce)]:undefined,_0x3bd379=JSON['stringify']({'description':_0x1a0fdd,'rule':deepSortObject(_0x14098d[_0x19741c(0xb8)])}),_0x26c01d=_0x1ecc9d[_0x19741c(0xc9)](_0x3bd379);if(_0x26c01d){const _0x47bca4={..._0x14098d[_0x19741c(0xce)]!==undefined&&{'description':_0x14098d['description']},'rule':_0x14098d[_0x19741c(0xb8)]?deepSortObject(_0x14098d['rule']):_0x14098d['rule']};if(_0x541bf6<_0x26c01d){_0xe6bc6e[_0x541bf6]=_0x47bca4,delete _0xe6bc6e[_0x26c01d];for(const [_0x5f2685,_0x22b929]of _0x4ca1f8[_0x19741c(0xa9)]()){_0x22b929===_0x26c01d&&_0x4ca1f8['set'](_0x5f2685,_0x541bf6);}_0x4ca1f8[_0x19741c(0xcf)](_0x541bf6,_0x541bf6),_0x1ecc9d['set'](_0x3bd379,_0x541bf6);}else _0xe6bc6e[_0x26c01d]=_0x47bca4,_0x4ca1f8[_0x19741c(0xcf)](_0x541bf6,_0x26c01d);}else{let _0x3dbb29=_0x541bf6;if(_0x38e3dd){const _0xbc0a61=_0x38e3dd['get'](_0x3bd379);_0xbc0a61&&_0xbc0a61[_0x19741c(0xde)]>0x0&&(_0x3dbb29=_0xbc0a61['slice']()[_0x19741c(0xe9)]()[0x0]);}const _0x35c886={..._0x14098d[_0x19741c(0xce)]!==undefined&&{'description':_0x14098d['description']},'rule':_0x14098d['rule']?deepSortObject(_0x14098d[_0x19741c(0xb8)]):_0x14098d[_0x19741c(0xb8)]};_0xe6bc6e[_0x3dbb29]=_0x35c886,_0x4ca1f8[_0x19741c(0xcf)](_0x541bf6,_0x3dbb29),_0x1ecc9d[_0x19741c(0xcf)](_0x3bd379,_0x3dbb29);}}}return{'merged':_0xe6bc6e,'nameMapping':_0x4ca1f8};}export function updateSegmentReferences(_0xee563f,_0x2adc19){const _0x192a80=a114_0x2ea3;if(!_0xee563f)return;for(const _0x1138a4 of _0xee563f){if(_0x1138a4[_0x192a80(0xe5)]?.[_0x192a80(0xdb)]){const _0x217975=_0x2adc19[_0x192a80(0xc9)](_0x1138a4[_0x192a80(0xe5)]['segment']);_0x217975&&(_0x1138a4[_0x192a80(0xe5)][_0x192a80(0xdb)]=_0x217975);}if(_0x1138a4[_0x192a80(0xd7)])for(const _0x3a2d77 of _0x1138a4[_0x192a80(0xd7)]){if(_0x3a2d77[_0x192a80(0xda)]===_0x192a80(0xb5)&&_0x3a2d77['with']?.['branches'])for(const _0x279216 of _0x3a2d77['with']['branches']){if(_0x279216[_0x192a80(0xdb)]){const _0x5b697e=_0x2adc19[_0x192a80(0xc9)](_0x279216[_0x192a80(0xdb)]);_0x5b697e&&(_0x279216['segment']=_0x5b697e);}}}}}export function updateSegmentRefsInSegments(_0x173f8a,_0x29c90f){const _0x42ce00=a114_0x2ea3;for(const _0x1d387c of Object['values'](_0x173f8a)){_0x1d387c[_0x42ce00(0xb8)]&&updateSegmentRefsInRule(_0x1d387c[_0x42ce00(0xb8)],_0x29c90f);}}function updateSegmentRefsInRule(_0x2a9966,_0x1471ce){const _0x575673=a114_0x2ea3;if(_0x2a9966===null||typeof _0x2a9966!==_0x575673(0xc1))return;if(Array[_0x575673(0xa3)](_0x2a9966)){for(const _0xed17b of _0x2a9966){updateSegmentRefsInRule(_0xed17b,_0x1471ce);}return;}const _0x5071bf=_0x2a9966;if((_0x5071bf[_0x575673(0xda)]===_0x575673(0xc3)||_0x5071bf[_0x575673(0xda)]===_0x575673(0xba))&&typeof _0x5071bf[_0x575673(0xdb)]===_0x575673(0xcc)){const _0x14fa01=_0x1471ce[_0x575673(0xc9)](_0x5071bf[_0x575673(0xdb)]);_0x14fa01&&(_0x5071bf[_0x575673(0xdb)]=_0x14fa01);}if(_0x5071bf[_0x575673(0xae)]&&Array['isArray'](_0x5071bf['conditions']))for(const _0x2c531c of _0x5071bf[_0x575673(0xae)]){updateSegmentRefsInRule(_0x2c531c,_0x1471ce);}}export function buildJourneysArray(_0xcc1e4a){const _0x337a5b=a114_0x2ea3,_0x18aad9=Math[_0x337a5b(0xd5)](..._0xcc1e4a[_0x337a5b(0xe2)](_0x27c760=>_0x27c760[_0x337a5b(0xcd)]['versionNumber']||0x0));return _0xcc1e4a[_0x337a5b(0xe2)](_0x23c7b2=>{const _0xb893d6=_0x337a5b,_0x401ca8=(_0x23c7b2[_0xb893d6(0xcd)]['versionNumber']||0x0)===_0x18aad9,_0x559d58=_0x23c7b2[_0xb893d6(0xad)][_0xb893d6(0xdf)]?.[0x0],_0x5b826b={'version':_0x559d58?.['version']||_0x23c7b2['yaml'][_0xb893d6(0xe7)]||_0x23c7b2['item'][_0xb893d6(0x9e)],'state':_0x23c7b2[_0xb893d6(0xcd)][_0xb893d6(0xa6)]===_0xb893d6(0xa4)?_0xb893d6(0xa4):_0xb893d6(0xca),'stages':_0x559d58?.[_0xb893d6(0xaf)]||_0x23c7b2[_0xb893d6(0xad)]['stages']||[],'id':_0x559d58?.['id']||_0x23c7b2['yaml']['id'],'version_number':_0x559d58?.[_0xb893d6(0xd3)]||_0x23c7b2[_0xb893d6(0xad)][_0xb893d6(0xd3)]};return _0x401ca8&&(_0x5b826b[_0xb893d6(0xd2)]=!![]),_0x5b826b;});}export function buildMergedJourneyDef(_0x3b966b,_0x449857){const _0x11fca3=a114_0x2ea3,_0x4fa1f8=_0x3b966b[0x0]['yaml'],_0x29038f=buildJourneysArray(_0x3b966b),{merged:_0x531352,nameMapping:_0x5330fd}=consolidateSegmentsByContent(_0x3b966b[_0x11fca3(0xe2)](_0x1f375b=>_0x1f375b[_0x11fca3(0xad)][_0x11fca3(0xbd)]),_0x449857);updateSegmentRefsInSegments(_0x531352,_0x5330fd);const _0x1db402=Array['from'](_0x5330fd['entries']())[_0x11fca3(0xb4)](([_0xfd42c2,_0x1f10cc])=>_0xfd42c2!==_0x1f10cc&&_0xfd42c2['startsWith'](_0x11fca3(0xe5)));let _0x162d41=_0x531352,_0x1f6832=new Map();if(_0x1db402){const _0x15ff89=consolidateSegmentsByContent([_0x531352],_0x449857);_0x162d41=_0x15ff89['merged'],_0x1f6832=_0x15ff89['nameMapping'];}const _0x22e748=new Map(_0x5330fd);for(const [_0x176b7c,_0x597c54]of _0x1f6832[_0x11fca3(0xa9)]()){_0x22e748[_0x11fca3(0xcf)](_0x176b7c,_0x597c54);}for(const [_0x5953f0,_0x504ae4]of _0x22e748[_0x11fca3(0xa9)]()){let _0x38afb7=_0x504ae4,_0x133ab5=0x0;while(_0x22e748[_0x11fca3(0xbc)](_0x38afb7)&&_0x22e748[_0x11fca3(0xc9)](_0x38afb7)!==_0x38afb7&&_0x133ab5<MAX_MAPPING_CHAIN_DEPTH){_0x38afb7=_0x22e748[_0x11fca3(0xc9)](_0x38afb7),_0x133ab5++;}_0x38afb7!==_0x504ae4&&_0x22e748[_0x11fca3(0xcf)](_0x5953f0,_0x38afb7);}for(const _0x579311 of _0x29038f){updateSegmentReferences(_0x579311[_0x11fca3(0xaf)],_0x22e748);}const {merged:_0x26cedf,nameMapping:_0x2dfe65}=consolidateActivationsByContent(_0x3b966b[_0x11fca3(0xe2)](_0xe52bc0=>_0xe52bc0['yaml'][_0x11fca3(0xe3)]));for(const _0x49f395 of _0x29038f){updateActivationReferences(_0x49f395[_0x11fca3(0xaf)],_0x2dfe65);}let _0x3289ea=_0x4fa1f8[_0x11fca3(0xeb)];if(_0x3289ea?.[_0x11fca3(0xdb)]){const _0x5abc5d=_0x22e748['get'](_0x3289ea['segment']);_0x5abc5d&&(_0x3289ea={..._0x3289ea,'segment':_0x5abc5d});}for(const _0x1350ef of _0x29038f){if(_0x1350ef[_0x11fca3(0xeb)]?.['segment']){const _0x8b0238=_0x22e748[_0x11fca3(0xc9)](_0x1350ef['goal'][_0x11fca3(0xdb)]);_0x8b0238&&(_0x1350ef[_0x11fca3(0xeb)]={..._0x1350ef[_0x11fca3(0xeb)],'segment':_0x8b0238});}}return{'type':_0x11fca3(0xdd),'name':_0x4fa1f8[_0x11fca3(0x9e)],'description':_0x4fa1f8['description'],'goal':_0x3289ea,'reentry':_0x4fa1f8[_0x11fca3(0xb9)],'segments':Object[_0x11fca3(0xa5)](_0x162d41)[_0x11fca3(0xde)]>0x0?_0x162d41:undefined,'activations':Object['keys'](_0x26cedf)[_0x11fca3(0xde)]>0x0?_0x26cedf:undefined,'journeys':_0x29038f,'bundle_id':_0x4fa1f8['bundle_id'],'bundle_name':_0x4fa1f8['bundle_name']};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x498ffa,_0x126323,_0x468110,_0x2085ca){const _0x26eb33=a114_0x2ea3,_0x94f1cc=_0x498ffa+':'+_0x126323,_0xf7f83c=_0x468110[_0x26eb33(0xc9)](_0x94f1cc);if(_0xf7f83c)return _0xf7f83c;const _0x401085=await _0x2085ca(_0x498ffa),_0x596714=_0x401085[_0x26eb33(0xc5)]['journeyBundleName']||_0x401085[_0x26eb33(0xc5)][_0x26eb33(0x9e)],_0x23cfd0=_0x401085[_0x26eb33(0xc5)][_0x26eb33(0xe8)]['find'](_0x25f641=>String(_0x25f641['id'])===String(_0x126323)),_0x4817b2=_0x23cfd0?.['name']||_0x126323,_0x41a5ca={'journeyName':_0x596714,'stageName':_0x4817b2};return _0x468110[_0x26eb33(0xcf)](_0x94f1cc,_0x41a5ca),_0x41a5ca;}export function formatApiJourneyName(_0x2fa49f,_0x2bcf52){return _0x2bcf52+'\x20('+_0x2fa49f+')';}function a114_0x269b(){const _0x16f943=['schedule','3237702vOToEl','type','segment','connection','journey','length','journeys','.yml','.yaml','map','activations','slice','entry_criteria','trim','version','journeyStages','sort','6779984DXApGo','goal','430734dunZCi','index','name','notification','columns','endsWith','495vrGfPT','isArray','launched','keys','state','19674cYtOwx','exit_criteria','entries','all_columns','replace','milestone','yaml','conditions','stages','condition','push','activation_template_id','versions','some','decision_point','62932ZAkwhm','join','rule','reentry','exclude','2555toCOtL','has','segments','wait','branches','null','object','toLowerCase','include','stringify','attributes','behavior','activation','match','get','draft','3969OPvvOe','string','item','description','set','1247665WxZnsQ','62770EeUSsl','latest','version_number','connector_config','max','with','steps'];a114_0x269b=function(){return _0x16f943;};return a114_0x269b();}export function isLocalJourneyRef(_0x396502){const _0x2fa9a6=a114_0x2ea3;return _0x396502[_0x2fa9a6(0xa1)](_0x2fa9a6(0xe0))||_0x396502[_0x2fa9a6(0xa1)](_0x2fa9a6(0xe1));}export function buildLocalRuleToNameMapping(_0x58bd4e){const _0x282bde=a114_0x2ea3,_0x5e67d0=new Map();if(!_0x58bd4e)return _0x5e67d0;for(const [_0x2af038,_0x18294e]of Object[_0x282bde(0xa9)](_0x58bd4e)){if(_0x18294e[_0x282bde(0xb8)]){const _0x35a4cf=serializeRule(_0x18294e[_0x282bde(0xb8)]),_0x498a94=_0x5e67d0[_0x282bde(0xc9)](_0x35a4cf)||[];_0x498a94[_0x282bde(0xb1)](_0x2af038),_0x5e67d0[_0x282bde(0xcf)](_0x35a4cf,_0x498a94);}}return _0x5e67d0;}function a114_0x2ea3(_0x4b22ef,_0x32a8a1){_0x4b22ef=_0x4b22ef-0x9c;const _0x269bc8=a114_0x269b();let _0x2ea356=_0x269bc8[_0x4b22ef];return _0x2ea356;}export function buildLocalRuleToNameMappingFromJourney(_0x4970db){const _0x409e73=a114_0x2ea3,_0x59ca4c=_0x4970db['segments'];if(!_0x59ca4c)return new Map();const _0x4192cd=collectSegmentUsageCounts(_0x4970db),_0x272bf5=new Map();let _0x496629=0x0;for(const [_0x302b4,_0x1a3902]of Object[_0x409e73(0xa9)](_0x59ca4c)){if(!_0x1a3902['rule']){_0x496629++;continue;}const _0x4aedee=serializeRule(_0x1a3902[_0x409e73(0xb8)]),_0xafdd5d=_0x272bf5[_0x409e73(0xc9)](_0x4aedee)||[];_0xafdd5d[_0x409e73(0xb1)]({'name':_0x302b4,'index':_0x496629}),_0x272bf5[_0x409e73(0xcf)](_0x4aedee,_0xafdd5d),_0x496629++;}const _0x15b31f=new Map();for(const [_0x182b48,_0x20376c]of _0x272bf5){const _0x2fe346=_0x20376c[_0x409e73(0xe4)]()[_0x409e73(0xe9)]((_0x3c56a5,_0x577ce9)=>{const _0x500a97=_0x409e73,_0x2b4b85=_0x4192cd[_0x500a97(0xc9)](_0x3c56a5[_0x500a97(0x9e)])||0x0,_0x6dd3c2=_0x4192cd[_0x500a97(0xc9)](_0x577ce9['name'])||0x0;if(_0x2b4b85!==_0x6dd3c2)return _0x6dd3c2-_0x2b4b85;return _0x3c56a5['index']-_0x577ce9[_0x500a97(0x9d)];})[_0x409e73(0xe2)](_0x555de9=>_0x555de9[_0x409e73(0x9e)]);_0x15b31f[_0x409e73(0xcf)](_0x182b48,_0x2fe346);}return _0x15b31f;}export function collectSegmentUsageCounts(_0x2fbb59){const _0x2e01f8=a114_0x2ea3,_0x1f68e2=new Map(),_0x567038=_0xa4edd5=>{const _0x3e93c8=a114_0x2ea3;if(!_0xa4edd5)return;_0x1f68e2[_0x3e93c8(0xcf)](_0xa4edd5,(_0x1f68e2[_0x3e93c8(0xc9)](_0xa4edd5)||0x0)+0x1);},_0x65d843=_0x994cf9=>{const _0x50ef28=a114_0x2ea3;for(const _0x314b75 of _0x994cf9){_0x567038(_0x314b75[_0x50ef28(0xe5)]?.[_0x50ef28(0xdb)]);if(_0x314b75[_0x50ef28(0xa8)])for(const _0x4c8517 of _0x314b75[_0x50ef28(0xa8)]){_0x567038(_0x4c8517[_0x50ef28(0xdb)]);}_0x567038(_0x314b75[_0x50ef28(0xac)]?.[_0x50ef28(0xdb)]);if(_0x314b75[_0x50ef28(0xd7)])for(const _0x2e769f of _0x314b75[_0x50ef28(0xd7)]){if(_0x2e769f['type']==='decision_point')for(const _0x5f5cc5 of _0x2e769f[_0x50ef28(0xd6)][_0x50ef28(0xbf)]){_0x567038(_0x5f5cc5[_0x50ef28(0xdb)]);}else _0x2e769f[_0x50ef28(0xda)]===_0x50ef28(0xbe)&&_0x567038(_0x2e769f[_0x50ef28(0xd6)][_0x50ef28(0xb0)]?.[_0x50ef28(0xdb)]);}}};_0x567038(_0x2fbb59[_0x2e01f8(0xeb)]?.[_0x2e01f8(0xdb)]);if(_0x2fbb59[_0x2e01f8(0xdf)])for(const _0x3593dc of _0x2fbb59['journeys']){_0x567038(_0x3593dc[_0x2e01f8(0xeb)]?.['segment']),_0x65d843(_0x3593dc['stages']);}_0x2fbb59[_0x2e01f8(0xaf)]&&_0x65d843(_0x2fbb59[_0x2e01f8(0xaf)]);if(_0x2fbb59[_0x2e01f8(0xb3)])for(const _0x977ff9 of _0x2fbb59[_0x2e01f8(0xb3)]){_0x65d843(_0x977ff9[_0x2e01f8(0xaf)]);}return _0x1f68e2;}
|
|
1
|
+
(function(_0x27e6d6,_0x195d69){const _0x390d28=a114_0x5d40,_0xe3e0fd=_0x27e6d6();while(!![]){try{const _0xee892f=-parseInt(_0x390d28(0xe8))/0x1*(-parseInt(_0x390d28(0xcb))/0x2)+parseInt(_0x390d28(0xc7))/0x3*(parseInt(_0x390d28(0xe0))/0x4)+-parseInt(_0x390d28(0xe2))/0x5+parseInt(_0x390d28(0xe6))/0x6*(-parseInt(_0x390d28(0xef))/0x7)+-parseInt(_0x390d28(0xf6))/0x8+parseInt(_0x390d28(0xf0))/0x9+parseInt(_0x390d28(0xcf))/0xa;if(_0xee892f===_0x195d69)break;else _0xe3e0fd['push'](_0xe3e0fd['shift']());}catch(_0x401d4b){_0xe3e0fd['push'](_0xe3e0fd['shift']());}}}(a114_0x563f,0x768c5));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;function a114_0x563f(){const _0x545a1f=['some','values','3955896SJBZZm','stages','push','steps','connection','keys','yaml','rule','all_columns','version_number','versionNumber','endsWith','segment','index','connector_config','set','activation','match','.yml','journeyStages','conditions','version','map','journey','include','isArray','wait','stringify','reentry','replace','with','length','60xsmCrJ','schedule','attributes','decision_point','524996cNgUFX','segments','activation_template_id','type','564830xVymaF','bundle_name','trim','join','get','state','startsWith','branches','goal','max','item','slice','object','toLowerCase','find','entry_criteria','sort','112108cgLzjo','null','4000155eSKblj','journeys','latest','string','12RtzvEZ','nameMapping','3qKYnYl','versions','launched','condition','name','entries','merged','436716KnlElr','4503150YXYRhS','exclude','description','behavior'];a114_0x563f=function(){return _0x545a1f;};return a114_0x563f();}export function sanitizeYamlKey(_0x178920){const _0x13e111=a114_0x5d40;return _0x178920[_0x13e111(0xdc)]()[_0x13e111(0xc4)](/\s+/g,'_')[_0x13e111(0xc4)](/[^a-z0-9_]/g,'')[_0x13e111(0xc4)](/_+/g,'_')[_0x13e111(0xc4)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x24e2fe){const _0x560a98=a114_0x5d40,_0x3d5749=_0x24e2fe[_0x560a98(0xb8)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x3d5749){const _0x41ee47=_0x3d5749[0x1][_0x560a98(0xdc)](),_0x36b510=_0x3d5749[0x2],_0x142f8a=_0x36b510['replace'](/-/g,'')['slice'](0x0,0x4)[_0x560a98(0xdc)]();return _0x41ee47+'_'+_0x142f8a;}const _0x22bfac=_0x24e2fe[_0x560a98(0xb8)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x22bfac){const _0xd72d5e=_0x22bfac[0x1],_0x527e93=_0x22bfac[0x2][_0x560a98(0xdc)](),_0x65e632=_0xd72d5e['replace'](/-/g,'')[_0x560a98(0xda)](0x0,0x4)[_0x560a98(0xdc)]();return _0x527e93+'_'+_0x65e632;}return undefined;}function stableStringify(_0x2a5dd1){const _0x4ef883=a114_0x5d40;if(Array[_0x4ef883(0xc0)](_0x2a5dd1))return'['+_0x2a5dd1['map'](_0x33bc7d=>stableStringify(_0x33bc7d))[_0x4ef883(0xd2)](',')+']';if(_0x2a5dd1&&typeof _0x2a5dd1===_0x4ef883(0xdb)){const _0x459cc9=_0x2a5dd1,_0xfc418=Object['keys'](_0x459cc9)[_0x4ef883(0xdf)](),_0x2bb423=_0xfc418[_0x4ef883(0xbd)](_0x2e234d=>'\x22'+_0x2e234d+'\x22:'+stableStringify(_0x459cc9[_0x2e234d]));return'{'+_0x2bb423['join'](',')+'}';}const _0x2fb25a=JSON[_0x4ef883(0xc2)](_0x2a5dd1);return _0x2fb25a===undefined?_0x4ef883(0xe1):_0x2fb25a;}export function consolidateActivationsByContent(_0x330f93){const _0x5d80e3=a114_0x5d40,_0x36fc9d={},_0x416565=new Map(),_0x3a4af2=new Map();for(const _0xb91455 of _0x330f93){if(!_0xb91455)continue;for(const [_0x4f52a2,_0x1f3949]of Object[_0x5d80e3(0xed)](_0xb91455)){const _0x42a2c4={'connection':_0x1f3949[_0x5d80e3(0xfa)],..._0x1f3949[_0x5d80e3(0xaf)]!==undefined&&{'all_columns':_0x1f3949['all_columns']},..._0x1f3949['columns']!==undefined&&{'columns':_0x1f3949['columns']},..._0x1f3949[_0x5d80e3(0xf3)]!==undefined&&{'behavior':_0x1f3949[_0x5d80e3(0xf3)]},..._0x1f3949[_0x5d80e3(0xc8)]!==undefined&&{'schedule':_0x1f3949[_0x5d80e3(0xc8)]},..._0x1f3949['notification']!==undefined&&{'notification':_0x1f3949['notification']},..._0x1f3949[_0x5d80e3(0xb5)]!==undefined&&{'connector_config':_0x1f3949[_0x5d80e3(0xb5)]},..._0x1f3949['activation_template_id']!==undefined&&{'activation_template_id':_0x1f3949[_0x5d80e3(0xcd)]}},_0x43437d=stableStringify(_0x42a2c4),_0x4da9d2=_0x3a4af2[_0x5d80e3(0xd3)](_0x43437d);_0x4da9d2?_0x416565[_0x5d80e3(0xb6)](_0x4f52a2,_0x4da9d2):(_0x36fc9d[_0x4f52a2]=_0x1f3949,_0x416565[_0x5d80e3(0xb6)](_0x4f52a2,_0x4f52a2),_0x3a4af2[_0x5d80e3(0xb6)](_0x43437d,_0x4f52a2));}}return{'merged':_0x36fc9d,'nameMapping':_0x416565};}export function updateActivationReferences(_0x7f9af4,_0x5a774b){const _0x29bb9b=a114_0x5d40;if(!_0x7f9af4)return;for(const _0x16085c of _0x7f9af4){if(!_0x16085c[_0x29bb9b(0xf9)])continue;for(const _0x4de7e2 of _0x16085c['steps']){if(_0x4de7e2[_0x29bb9b(0xce)]===_0x29bb9b(0xb7)&&_0x4de7e2[_0x29bb9b(0xc5)]?.['activation']){const _0x51e595=_0x5a774b[_0x29bb9b(0xd3)](_0x4de7e2[_0x29bb9b(0xc5)]['activation']);_0x51e595&&_0x51e595!==_0x4de7e2['with'][_0x29bb9b(0xb7)]&&(_0x4de7e2[_0x29bb9b(0xc5)][_0x29bb9b(0xb7)]=_0x51e595);}}}}export function consolidateSegmentsByContent(_0x3beaab,_0x2b403a){const _0x2032d3=a114_0x5d40,_0x587807={},_0x27b548=new Map(),_0x8405d0=new Map();for(const _0x4aab0f of _0x3beaab){if(!_0x4aab0f)continue;for(const [_0x560ac4,_0x3aef7a]of Object[_0x2032d3(0xed)](_0x4aab0f)){if(!_0x3aef7a['rule']){_0x587807[_0x560ac4]=_0x3aef7a,_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x560ac4);continue;}const _0x3efa63=_0x3aef7a[_0x2032d3(0xf2)]&&_0x3aef7a[_0x2032d3(0xf2)][_0x2032d3(0xd1)]()?_0x3aef7a[_0x2032d3(0xf2)]:undefined,_0x20df2b=JSON[_0x2032d3(0xc2)]({'description':_0x3efa63,'rule':deepSortObject(_0x3aef7a[_0x2032d3(0xfd)])}),_0x3edf6e=_0x8405d0[_0x2032d3(0xd3)](_0x20df2b);if(_0x3edf6e){const _0xc6c3e9={..._0x3aef7a['description']!==undefined&&{'description':_0x3aef7a[_0x2032d3(0xf2)]},'rule':_0x3aef7a[_0x2032d3(0xfd)]?deepSortObject(_0x3aef7a[_0x2032d3(0xfd)]):_0x3aef7a[_0x2032d3(0xfd)]};if(_0x560ac4<_0x3edf6e){_0x587807[_0x560ac4]=_0xc6c3e9,delete _0x587807[_0x3edf6e];for(const [_0x3a1a5d,_0x1656a8]of _0x27b548[_0x2032d3(0xed)]()){_0x1656a8===_0x3edf6e&&_0x27b548[_0x2032d3(0xb6)](_0x3a1a5d,_0x560ac4);}_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x560ac4),_0x8405d0[_0x2032d3(0xb6)](_0x20df2b,_0x560ac4);}else _0x587807[_0x3edf6e]=_0xc6c3e9,_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x3edf6e);}else{let _0x23e163=_0x560ac4;if(_0x2b403a){const _0x2864fa=_0x2b403a[_0x2032d3(0xd3)](_0x20df2b);_0x2864fa&&_0x2864fa[_0x2032d3(0xc6)]>0x0&&(_0x23e163=_0x2864fa[_0x2032d3(0xda)]()[_0x2032d3(0xdf)]()[0x0]);}const _0x4f6c02={..._0x3aef7a['description']!==undefined&&{'description':_0x3aef7a['description']},'rule':_0x3aef7a[_0x2032d3(0xfd)]?deepSortObject(_0x3aef7a['rule']):_0x3aef7a['rule']};_0x587807[_0x23e163]=_0x4f6c02,_0x27b548[_0x2032d3(0xb6)](_0x560ac4,_0x23e163),_0x8405d0[_0x2032d3(0xb6)](_0x20df2b,_0x23e163);}}}return{'merged':_0x587807,'nameMapping':_0x27b548};}export function updateSegmentReferences(_0x1637a6,_0x4fe10e){const _0x55de36=a114_0x5d40;if(!_0x1637a6)return;for(const _0x424736 of _0x1637a6){if(_0x424736[_0x55de36(0xde)]?.[_0x55de36(0xb3)]){const _0x44cf62=_0x4fe10e['get'](_0x424736[_0x55de36(0xde)][_0x55de36(0xb3)]);_0x44cf62&&(_0x424736[_0x55de36(0xde)][_0x55de36(0xb3)]=_0x44cf62);}if(_0x424736[_0x55de36(0xf9)])for(const _0x407a93 of _0x424736['steps']){if(_0x407a93[_0x55de36(0xce)]===_0x55de36(0xca)&&_0x407a93[_0x55de36(0xc5)]?.[_0x55de36(0xd6)])for(const _0x58c8fd of _0x407a93[_0x55de36(0xc5)][_0x55de36(0xd6)]){if(_0x58c8fd[_0x55de36(0xb3)]){const _0x4b0d27=_0x4fe10e['get'](_0x58c8fd[_0x55de36(0xb3)]);_0x4b0d27&&(_0x58c8fd[_0x55de36(0xb3)]=_0x4b0d27);}}}}}export function updateSegmentRefsInSegments(_0x5edb31,_0x2b4ec0){const _0xb3b64e=a114_0x5d40;for(const _0x3ac278 of Object[_0xb3b64e(0xf5)](_0x5edb31)){_0x3ac278[_0xb3b64e(0xfd)]&&updateSegmentRefsInRule(_0x3ac278['rule'],_0x2b4ec0);}}function updateSegmentRefsInRule(_0x49dcf6,_0x59722f){const _0x8dde0b=a114_0x5d40;if(_0x49dcf6===null||typeof _0x49dcf6!==_0x8dde0b(0xdb))return;if(Array[_0x8dde0b(0xc0)](_0x49dcf6)){for(const _0x9ce996 of _0x49dcf6){updateSegmentRefsInRule(_0x9ce996,_0x59722f);}return;}const _0x16c82b=_0x49dcf6;if((_0x16c82b[_0x8dde0b(0xce)]===_0x8dde0b(0xbf)||_0x16c82b['type']===_0x8dde0b(0xf1))&&typeof _0x16c82b[_0x8dde0b(0xb3)]===_0x8dde0b(0xe5)){const _0x27d1d8=_0x59722f[_0x8dde0b(0xd3)](_0x16c82b[_0x8dde0b(0xb3)]);_0x27d1d8&&(_0x16c82b['segment']=_0x27d1d8);}if(_0x16c82b[_0x8dde0b(0xbb)]&&Array[_0x8dde0b(0xc0)](_0x16c82b[_0x8dde0b(0xbb)]))for(const _0x323be5 of _0x16c82b['conditions']){updateSegmentRefsInRule(_0x323be5,_0x59722f);}}export function buildJourneysArray(_0x1dd668){const _0x56a4d4=a114_0x5d40,_0x5d8362=Math[_0x56a4d4(0xd8)](..._0x1dd668[_0x56a4d4(0xbd)](_0x5bcc85=>_0x5bcc85[_0x56a4d4(0xd9)][_0x56a4d4(0xb1)]||0x0));return _0x1dd668[_0x56a4d4(0xbd)](_0x4f4398=>{const _0x37441c=_0x56a4d4,_0x26abcd=(_0x4f4398[_0x37441c(0xd9)][_0x37441c(0xb1)]||0x0)===_0x5d8362,_0x4f8e20=_0x4f4398[_0x37441c(0xfc)]['journeys']?.[0x0],_0x370f13={'version':_0x4f8e20?.['version']||_0x4f4398[_0x37441c(0xfc)][_0x37441c(0xbc)]||_0x4f4398[_0x37441c(0xd9)][_0x37441c(0xec)],'state':_0x4f4398['item'][_0x37441c(0xd4)]===_0x37441c(0xea)?_0x37441c(0xea):'draft','stages':_0x4f8e20?.[_0x37441c(0xf7)]||_0x4f4398[_0x37441c(0xfc)][_0x37441c(0xf7)]||[],'id':_0x4f8e20?.['id']||_0x4f4398[_0x37441c(0xfc)]['id'],'version_number':_0x4f8e20?.[_0x37441c(0xb0)]||_0x4f4398[_0x37441c(0xfc)][_0x37441c(0xb0)]};return _0x26abcd&&(_0x370f13[_0x37441c(0xe4)]=!![]),_0x370f13;});}export function buildMergedJourneyDef(_0x249ee9,_0x193ec8){const _0x1fa72c=a114_0x5d40,_0x5daed6=_0x249ee9[0x0][_0x1fa72c(0xfc)],_0x1ae5e8=buildJourneysArray(_0x249ee9),{merged:_0x2b46be,nameMapping:_0x4d0ce6}=consolidateSegmentsByContent(_0x249ee9['map'](_0x42593c=>_0x42593c[_0x1fa72c(0xfc)][_0x1fa72c(0xcc)]),_0x193ec8);updateSegmentRefsInSegments(_0x2b46be,_0x4d0ce6);const _0x1778f4=Array['from'](_0x4d0ce6[_0x1fa72c(0xed)]())[_0x1fa72c(0xf4)](([_0x3df0c9,_0x2e4d78])=>_0x3df0c9!==_0x2e4d78&&_0x3df0c9[_0x1fa72c(0xd5)](_0x1fa72c(0xde)));let _0x59ac62=_0x2b46be,_0x381cd=new Map();if(_0x1778f4){const _0x5b47de=consolidateSegmentsByContent([_0x2b46be],_0x193ec8);_0x59ac62=_0x5b47de[_0x1fa72c(0xee)],_0x381cd=_0x5b47de[_0x1fa72c(0xe7)];}const _0x395c2b=new Map(_0x4d0ce6);for(const [_0x5e5b8c,_0x2faaa9]of _0x381cd['entries']()){_0x395c2b['set'](_0x5e5b8c,_0x2faaa9);}for(const [_0x5ca217,_0x5f09f0]of _0x395c2b[_0x1fa72c(0xed)]()){let _0x1abe7b=_0x5f09f0,_0x1bf64d=0x0;while(_0x395c2b['has'](_0x1abe7b)&&_0x395c2b[_0x1fa72c(0xd3)](_0x1abe7b)!==_0x1abe7b&&_0x1bf64d<MAX_MAPPING_CHAIN_DEPTH){_0x1abe7b=_0x395c2b[_0x1fa72c(0xd3)](_0x1abe7b),_0x1bf64d++;}_0x1abe7b!==_0x5f09f0&&_0x395c2b[_0x1fa72c(0xb6)](_0x5ca217,_0x1abe7b);}for(const _0x31f87f of _0x1ae5e8){updateSegmentReferences(_0x31f87f['stages'],_0x395c2b);}const {merged:_0x27bc7b,nameMapping:_0x2f9596}=consolidateActivationsByContent(_0x249ee9[_0x1fa72c(0xbd)](_0xb0a62c=>_0xb0a62c['yaml']['activations']));for(const _0x3a0a72 of _0x1ae5e8){updateActivationReferences(_0x3a0a72[_0x1fa72c(0xf7)],_0x2f9596);}let _0x3ba1d7=_0x5daed6[_0x1fa72c(0xd7)];if(_0x3ba1d7?.['segment']){const _0x1c772c=_0x395c2b[_0x1fa72c(0xd3)](_0x3ba1d7['segment']);_0x1c772c&&(_0x3ba1d7={..._0x3ba1d7,'segment':_0x1c772c});}for(const _0x7b7053 of _0x1ae5e8){if(_0x7b7053[_0x1fa72c(0xd7)]?.[_0x1fa72c(0xb3)]){const _0x4f6300=_0x395c2b[_0x1fa72c(0xd3)](_0x7b7053[_0x1fa72c(0xd7)]['segment']);_0x4f6300&&(_0x7b7053[_0x1fa72c(0xd7)]={..._0x7b7053['goal'],'segment':_0x4f6300});}}return{'type':_0x1fa72c(0xbe),'name':_0x5daed6[_0x1fa72c(0xec)],'description':_0x5daed6[_0x1fa72c(0xf2)],'goal':_0x3ba1d7,'reentry':_0x5daed6[_0x1fa72c(0xc3)],'segments':Object[_0x1fa72c(0xfb)](_0x59ac62)[_0x1fa72c(0xc6)]>0x0?_0x59ac62:undefined,'activations':Object[_0x1fa72c(0xfb)](_0x27bc7b)[_0x1fa72c(0xc6)]>0x0?_0x27bc7b:undefined,'journeys':_0x1ae5e8,'bundle_id':_0x5daed6['bundle_id'],'bundle_name':_0x5daed6[_0x1fa72c(0xd0)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x582345,_0x45379f,_0x537f59,_0x18dd4c){const _0x56fc4d=a114_0x5d40,_0x3b60ae=_0x582345+':'+_0x45379f,_0x27173e=_0x537f59[_0x56fc4d(0xd3)](_0x3b60ae);if(_0x27173e)return _0x27173e;const _0xce0de9=await _0x18dd4c(_0x582345),_0x5a40cc=_0xce0de9[_0x56fc4d(0xc9)]['journeyBundleName']||_0xce0de9[_0x56fc4d(0xc9)][_0x56fc4d(0xec)],_0x81d9a5=_0xce0de9[_0x56fc4d(0xc9)][_0x56fc4d(0xba)][_0x56fc4d(0xdd)](_0x3a27e2=>String(_0x3a27e2['id'])===String(_0x45379f)),_0x371a6a=_0x81d9a5?.[_0x56fc4d(0xec)]||_0x45379f,_0x1f6dc7={'journeyName':_0x5a40cc,'stageName':_0x371a6a};return _0x537f59['set'](_0x3b60ae,_0x1f6dc7),_0x1f6dc7;}function a114_0x5d40(_0x1e7efa,_0x58e345){_0x1e7efa=_0x1e7efa-0xaf;const _0x563f84=a114_0x563f();let _0x5d4009=_0x563f84[_0x1e7efa];return _0x5d4009;}export function formatApiJourneyName(_0x5244b6,_0x5bf94b){return _0x5bf94b+'\x20('+_0x5244b6+')';}export function isLocalJourneyRef(_0x2f0648){const _0x58d9f3=a114_0x5d40;return _0x2f0648[_0x58d9f3(0xb2)](_0x58d9f3(0xb9))||_0x2f0648[_0x58d9f3(0xb2)]('.yaml');}export function buildLocalRuleToNameMapping(_0x2824e0){const _0xc03463=a114_0x5d40,_0x532719=new Map();if(!_0x2824e0)return _0x532719;for(const [_0x327d9f,_0x5dc04e]of Object[_0xc03463(0xed)](_0x2824e0)){if(_0x5dc04e[_0xc03463(0xfd)]){const _0x1919fc=serializeRule(_0x5dc04e[_0xc03463(0xfd)]),_0x4ee47c=_0x532719[_0xc03463(0xd3)](_0x1919fc)||[];_0x4ee47c[_0xc03463(0xf8)](_0x327d9f),_0x532719[_0xc03463(0xb6)](_0x1919fc,_0x4ee47c);}}return _0x532719;}export function buildLocalRuleToNameMappingFromJourney(_0x56338b){const _0x3c6901=a114_0x5d40,_0xa9ac54=_0x56338b[_0x3c6901(0xcc)];if(!_0xa9ac54)return new Map();const _0x5dc0ff=collectSegmentUsageCounts(_0x56338b),_0x2ed044=new Map();let _0x234614=0x0;for(const [_0x449a5b,_0x5ecfc1]of Object[_0x3c6901(0xed)](_0xa9ac54)){if(!_0x5ecfc1[_0x3c6901(0xfd)]){_0x234614++;continue;}const _0x41dfbe=serializeRule(_0x5ecfc1[_0x3c6901(0xfd)]),_0xe0289f=_0x2ed044['get'](_0x41dfbe)||[];_0xe0289f[_0x3c6901(0xf8)]({'name':_0x449a5b,'index':_0x234614}),_0x2ed044[_0x3c6901(0xb6)](_0x41dfbe,_0xe0289f),_0x234614++;}const _0x38cc00=new Map();for(const [_0x1ed14f,_0x46eddb]of _0x2ed044){const _0x20f6db=_0x46eddb[_0x3c6901(0xda)]()[_0x3c6901(0xdf)]((_0x5a1eb0,_0x1cafa1)=>{const _0x5a5624=_0x3c6901,_0x10ba8b=_0x5dc0ff['get'](_0x5a1eb0[_0x5a5624(0xec)])||0x0,_0x937d20=_0x5dc0ff[_0x5a5624(0xd3)](_0x1cafa1[_0x5a5624(0xec)])||0x0;if(_0x10ba8b!==_0x937d20)return _0x937d20-_0x10ba8b;return _0x5a1eb0['index']-_0x1cafa1[_0x5a5624(0xb4)];})[_0x3c6901(0xbd)](_0x6561ab=>_0x6561ab[_0x3c6901(0xec)]);_0x38cc00[_0x3c6901(0xb6)](_0x1ed14f,_0x20f6db);}return _0x38cc00;}export function collectSegmentUsageCounts(_0x2be83a){const _0x240e79=a114_0x5d40,_0x1f8a0c=new Map(),_0x1e8d46=_0x3b5e25=>{const _0x32dd96=a114_0x5d40;if(!_0x3b5e25)return;_0x1f8a0c['set'](_0x3b5e25,(_0x1f8a0c[_0x32dd96(0xd3)](_0x3b5e25)||0x0)+0x1);},_0x2191e7=_0x557fe6=>{const _0x24b1d5=a114_0x5d40;for(const _0x5f3c86 of _0x557fe6){_0x1e8d46(_0x5f3c86['entry_criteria']?.[_0x24b1d5(0xb3)]);if(_0x5f3c86['exit_criteria'])for(const _0x318e4e of _0x5f3c86['exit_criteria']){_0x1e8d46(_0x318e4e[_0x24b1d5(0xb3)]);}_0x1e8d46(_0x5f3c86['milestone']?.[_0x24b1d5(0xb3)]);if(_0x5f3c86[_0x24b1d5(0xf9)])for(const _0x4161b9 of _0x5f3c86[_0x24b1d5(0xf9)]){if(_0x4161b9[_0x24b1d5(0xce)]===_0x24b1d5(0xca))for(const _0x80553b of _0x4161b9['with'][_0x24b1d5(0xd6)]){_0x1e8d46(_0x80553b[_0x24b1d5(0xb3)]);}else _0x4161b9[_0x24b1d5(0xce)]===_0x24b1d5(0xc1)&&_0x1e8d46(_0x4161b9['with'][_0x24b1d5(0xeb)]?.[_0x24b1d5(0xb3)]);}}};_0x1e8d46(_0x2be83a[_0x240e79(0xd7)]?.['segment']);if(_0x2be83a[_0x240e79(0xe3)])for(const _0x25f237 of _0x2be83a[_0x240e79(0xe3)]){_0x1e8d46(_0x25f237[_0x240e79(0xd7)]?.[_0x240e79(0xb3)]),_0x2191e7(_0x25f237[_0x240e79(0xf7)]);}_0x2be83a[_0x240e79(0xf7)]&&_0x2191e7(_0x2be83a[_0x240e79(0xf7)]);if(_0x2be83a[_0x240e79(0xe9)])for(const _0x305064 of _0x2be83a[_0x240e79(0xe9)]){_0x2191e7(_0x305064[_0x240e79(0xf7)]);}return _0x1f8a0c;}
|