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QAAQa,QAC9C,EACAkI,iBAAiB,MC5IPwB,GAA0BC,GACtC,IAAIC,MACH,CAAC,EACD,CACCxQ,GAAAA,CAAIyQ,EAAGC,GACN,GAAgB,iCAAZA,EACH,OAAO,WACN,MAAM,MAACzF,GAASsF,EAChB,IAAKtF,EAAO,MAAM,IAAItG,MAAM,gCAAgC,QAAAgM,EAAAlS,UAAAC,OAFlDkS,EAAW,IAAAjH,MAAAgH,GAAAE,EAAA,EAAAA,EAAAF,EAAAE,IAAXD,EAAWC,GAAApS,UAAAoS,GAGrBzE,GAA6BpN,MAAM,KAAM,CAACiM,KAAU2F,GACrD,CAEF,ICpBUE,GAAsC,qBAU5C,SAASC,GAAgCR,GAC/C,MAAO,KAAM,CACZS,UAAWV,GAAuBC,IAEpC,C","sources":["webpack:///@babel/runtime/7.24.8/helpers/extends.js","webpack:///@babel/runtime/7.24.8/helpers/objectWithoutPropertiesLoose.js","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///@devsnc/library-intent-channel/src/intentLibraryGlobals.js","webpack:///@devsnc/library-intent-channel/src/generator/generatorRegistry.js","webpack:///@devsnc/library-intent-channel/src/constants.js","webpack:///@devsnc/library-intent-channel/src/mediator/mediatorUtils.js","webpack:///@devsnc/library-intent-channel/src/mediator/registry.js","webpack:///@devsnc/library-intent-channel/src/mediator/mediatorResult.js","webpack:///@devsnc/library-intent-channel/src/messageProcessor.js","webpack:///@devsnc/library-intent-channel/src/mediator/createHandler.js","webpack:///@devsnc/library-intent-channel/src/generator/handlers/routingMediatorHandler.js","webpack:///@devsnc/library-intent-channel/src/generator/handlers/localHandler.js","webpack:///@devsnc/library-intent-channel/src/generator/handlers/sessionStorageHandler.js","webpack:///@devsnc/library-intent-channel/src/translator/translatorRegistry.js","webpack:///@devsnc/library-intent-channel/src/generator/generatorChain.js","webpack:///@devsnc/library-intent-channel/src/translator/handlers/routingMediatorHandler.js","webpack:///@devsnc/library-intent-channel/src/translator/handlers/localHandler.js","webpack:///@devsnc/library-intent-channel/src/translator/handlers/sessionStorageHandler.js","webpack:///@devsnc/library-intent-channel/src/translator/translatorChain.js","webpack:///@devsnc/library-intent-channel/src/sessionStorage/activeTranslatorService.js","webpack:///@devsnc/library-intent-channel/src/sessionStorage/sessionStorageDispatcher.js","webpack:///@devsnc/library-intent-channel/src/sessionStorage/sessionStorageUtils.js","webpack:///@devsnc/library-intent-channel/src/runtime.js","webpack:///@devsnc/library-intent-channel/src/pubsub/pubsubService.js","webpack:///@devsnc/library-intent-channel/src/generator/generatorService.js","webpack:///@devsnc/library-intent-channel/src/translator/translatorService.js","webpack:///external module \"/uxasset/externals/@servicenow/ui-core/index.jsdbx\"","webpack:///@devsnc/library-intent-channel/src/pubsub/getPubsubActionHandlers.js","webpack:///@devsnc/library-intent-channel/src/generator/intent-generator-behavior.js","webpack:///@devsnc/library-intent-channel/src/mediator/mediatorService.js","webpack:///@devsnc/library-intent-channel/src/mediator/behaviors/intent-mediator-behavior.js","webpack:///@devsnc/library-intent-channel/src/mediator/behaviors/intent-routing-mediator-behavior.js","webpack:///@devsnc/library-intent-channel/src/translator/intent-translator-behavior.js","webpack:///@devsnc/library-intent-channel/src/clientScript/getNowAssistApiWrapper.js","webpack:///@devsnc/library-intent-channel/src/clientScript/getIntentChannelClientScriptApi.js"],"sourcesContent":["function _extends() {\n  return (module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {\n    for (var e = 1; e < arguments.length; e++) {\n      var t = arguments[e];\n      for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n    }\n    return n;\n  }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _extends.apply(null, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _objectWithoutPropertiesLoose(r, e) {\n  if (null == r) return {};\n  var t = {};\n  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n    if (e.includes(n)) continue;\n    t[n] = r[n];\n  }\n  return t;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/**\n * Global key for attaching intent library runtime to the window object\n */\nconst GLOBAL_KEY = 'uxfIntentLibrary';\n\n/**\n * Global singleton runtime instance attached to `window`.\n * Contains initialized translator and generator chains.\n * Ensures messaging chains and event listeners are registered only once.\n */\nexport const intentLibraryGlobals = (() => {\n\ttry {\n\t\t// Try to access window.top\n\t\treturn (window.top[GLOBAL_KEY] ||= {});\n\t} catch (e) {\n\t\t// If accessing window.top fails (due to cross-origin restrictions),\n\t\t// fall back to using the current window\n\t\tconst globals = (window[GLOBAL_KEY] ||= {});\n\t\tglobals.useCrossOriginSafePath = true;\n\t\treturn globals;\n\t}\n})();\n","import {intentLibraryGlobals} from '../intentLibraryGlobals.js';\n\nconst GENERATOR_MAP = 'generators';\n\nif (!intentLibraryGlobals[GENERATOR_MAP]) {\n\tintentLibraryGlobals[GENERATOR_MAP] = {};\n}\n\n/**\n * Retrieves the default generator on the page, for fallback when generatorIds are not passed through meta.\n * @returns {GeneratorObject | undefined}\n */\nexport const getDefaultGenerator = () => {\n\tconst generators = Object.values(intentLibraryGlobals[GENERATOR_MAP]);\n\tif (generators.length === 0) {\n\t\tconsole.warn('No registered generators found.');\n\t\treturn;\n\t}\n\n\treturn Object.values(generators).find((generator) => generator.isDefault);\n};\n\n/**\n * Registers a generator as the default generator.\n * @param {string} id\n * @param {GeneratorObject} value\n * @param {boolean} receiveAllContexts - If true, this generator will receive context updates from all translators\n */\nexport const registerDefaultGenerator = (\n\tid,\n\tvalue,\n\treceiveAllContexts = false\n) => {\n\tif (!id) {\n\t\tconsole.error('id param is required to set the default generator.');\n\t\treturn;\n\t}\n\tif (!value) {\n\t\tconsole.error('value param is required to set the default generator.');\n\t\treturn;\n\t}\n\tif (getDefaultGenerator() !== undefined) {\n\t\tconst currentDefaultGenerator = Object.entries(\n\t\t\tintentLibraryGlobals[GENERATOR_MAP]\n\t\t).find(([, generator]) => generator.isDefault);\n\n\t\tconst defaultGeneratorId = currentDefaultGenerator?.[0];\n\n\t\tconsole.error(\n\t\t\t`Generator Registration Rejected - Default generator already set to \"${defaultGeneratorId}\". Cannot override with \"${id}\".` +\n\t\t\t\t`Check if \"${defaultGeneratorId}\" was registered as the default generator intentionally, or use the generatorVersion.V2 option on your behavior to bypass default assignment.`\n\t\t);\n\t\treturn;\n\t}\n\tintentLibraryGlobals[GENERATOR_MAP][id] = {\n\t\t...value,\n\t\tisDefault: true,\n\t\treceiveAllContexts\n\t};\n};\n\n/**\n * Retrieves a generator by ID.\n * @param {string} id\n * @returns {GeneratorObject | undefined}\n */\nexport const getGeneratorById = (id) => {\n\tif (!id) {\n\t\t// TODO - Remove this warning once all generators are updated to use the new generator registry.\n\t\tconsole.warn(\n\t\t\t'No generator ID provided to getGeneratorById(); falling back to default generator.'\n\t\t);\n\t\treturn getDefaultGenerator();\n\t}\n\treturn intentLibraryGlobals[GENERATOR_MAP][id];\n};\n\n/**\n * Returns the full map of registered generators.\n * @returns {Record<string, GeneratorObject>}\n */\nexport const getGenerators = () => intentLibraryGlobals[GENERATOR_MAP];\n\n/**\n * Returns all generators that are marked to receive all contexts.\n * @returns {Array<GeneratorObject>}\n */\nexport const getAllContextGenerators = () =>\n\tObject.values(intentLibraryGlobals[GENERATOR_MAP]).filter(\n\t\t(generator) => generator.receiveAllContexts === true\n\t);\n\n/**\n * Registers a generator by ID.\n * @param {string} id\n * @param {GeneratorObject} value\n * @param {boolean} receiveAllContexts - If true, this generator will receive context updates from all translators\n */\nexport const registerGeneratorById = (\n\tid,\n\tvalue,\n\treceiveAllContexts = false\n) => {\n\tif (!id) {\n\t\tconsole.error('id param is required to register the generator.');\n\t\treturn;\n\t}\n\tif (!value) {\n\t\tconsole.error('value param is required to register the generator.');\n\t\treturn;\n\t}\n\tintentLibraryGlobals[GENERATOR_MAP][id] = {\n\t\t...value,\n\t\treceiveAllContexts\n\t};\n};\n\n/**\n * Removes a generator by ID.\n * @param {string} id\n */\nexport const deleteGeneratorById = (id) => {\n\tif (!id) {\n\t\tconsole.error('id param is required to delete the generator.');\n\t\treturn;\n\t}\n\tdelete intentLibraryGlobals[GENERATOR_MAP][id];\n};\n","/**\n * @file constants.js\n * @description Contains all shared constants and action strings used throughout the library-intent-channel runtime.\n */\n\n/**\n * @public\n *\n * Enum of intent-related action types dispatched between generator and translator components.\n */\nexport const intentActions = {\n\tINTENT_RECEIVED: 'LIBRARY-INTENT-CHANNEL#INTENT_RECEIVED',\n\tUPDATE_CONTEXT: 'LIBRARY-INTENT-CHANNEL#UPDATE_CONTEXT',\n\tCONTEXT_RECEIVED: 'LIBRARY-INTENT-CHANNEL#CONTEXT_RECEIVED',\n\tREGISTER_TRANSLATOR: 'LIBRARY-INTENT-CHANNEL#REGISTER_TRANSLATOR',\n\tREMOVE_TRANSLATOR: 'LIBRARY-INTENT-CHANNEL#REMOVE_TRANSLATOR',\n\tSEND_INTENT: 'LIBRARY-INTENT-CHANNEL#SEND_INTENT',\n\tSEND_INTENT_BY_TRANSLATOR_CONTEXT_ID:\n\t\t'LIBRARY-INTENT-CHANNEL#SEND_INTENT_BY_TRANSLATOR_CONTEXT_ID',\n\tSET_ACTIVE_CONTEXT: 'LIBRARY-INTENT-CHANNEL#SET_ACTIVE_CONTEXT',\n\tUNSET_ACTIVE_CONTEXT: 'LIBRARY-INTENT-CHANNEL#UNSET_ACTIVE_CONTEXT',\n\tSEND_INTENT_FEEDBACK: 'LIBRARY-INTENT-CHANNEL#SEND_INTENT_FEEDBACK',\n\tCREATE_CONVERSATION_WITH_SKILL:\n\t\t'LIBRARY-INTENT-CHANNEL#CREATE_CONVERSATION_WITH_SKILL',\n\tSEND_SYSTEM_MESSAGE: 'LIBRARY-INTENT-CHANNEL#SEND_SYSTEM_MESSAGE',\n\tINTENT_FEEDBACK_RECEIVED: 'LIBRARY-INTENT-CHANNEL#INTENT_FEEDBACK_RECEIVED',\n\tCONVERSATION_WITH_SKILL_REQUESTED:\n\t\t'LIBRARY-INTENT-CHANNEL#CONVERSATION_WITH_SKILL_REQUESTED',\n\tSYSTEM_MESSAGE_RECEIVED: 'LIBRARY-INTENT-CHANNEL#SYSTEM_MESSAGE_RECEIVED',\n\tBROADCAST_TOPIC_REQUESTED: 'LIBRARY-INTENT-CHANNEL#BROADCAST_TOPIC_REQUESTED',\n\tBROADCAST_TOPIC_RECEIVED: 'LIBRARY-INTENT-CHANNEL#BROADCAST_TOPIC_RECEIVED',\n\tSUBSCRIBE_TO_TOPIC: 'LIBRARY-INTENT-CHANNEL#SUBSCRIBE_TO_TOPIC',\n\tUNSUBSCRIBE_FROM_TOPIC: 'LIBRARY-INTENT-CHANNEL#UNSUBSCRIBE_FROM_TOPIC'\n};\n\n/**\n * @module systemMessageTypes\n *\n * Message types used in system messages.\n */\nexport const systemMessageTypes = {\n\tTRANSLATOR_REMOVED: 'TRANSLATOR_REMOVED'\n};\n\n/**\n * @module intentLocalStorageKeys\n *\n * Keys used to read/write intent-related messages via sessionStorage or localStorage.\n *\n * @type {Object<string, string>}\n */\nexport const intentLocalStorageKeys = {\n\tsendIntent: 'sn_library_intent.send_intent',\n\tupdateContext: 'sn_library_intent.update_context',\n\tactiveTranslatorKey: 'sn_library_intent.active_translator',\n\tsendIntentFeedback: 'sn_library_intent.send_intent_feedback',\n\trequestConversationWithSkill:\n\t\t'sn_library_intent.request_conversation_with_skill',\n\tsendSystemMessage: 'sn_library_intent.send_system_message'\n};\n\n/**\n * Message types used when processing translator-side messaging chains.\n */\nexport const TranslatorMessageType = {\n\tsendIntent: 'sendIntent'\n};\n\n/**\n * Message types used when processing generator-side messaging chains.\n */\nexport const GeneratorMessageType = {\n\tsendContext: 'sendContext',\n\tsendSystemMessage: 'sendSystemMessage',\n\tsendIntentFeedback: 'sendIntentFeedback',\n\trequestConversationWithSkill: 'requestConversationWithSkill'\n};\n\n/**\n * Special delimiter used to separate translator types in compound strings.\n * For example, this is used to encode multiple translator identifiers.\n */\nexport const TRANSLATOR_TYPE_INTENT_DELIMITER = '!#!#!';\n\n/**\n * Generator version identifiers used to manage coexistence between the original singleton-generator architecture\n * and the modern multi-generator model.\n *\n * - `LEGACY` (1): Applies when no `generatorVersion` is provided.\n *   Reflects the original architecture where generator behavior assumed a single generator per page.\n *   When the originating generator cannot be determined (e.g., due to missing metadata in manual dispatch),\n *   the system falls back to a `defaultGenerator` to preserve routing behavior through COR handlers.\n *\n * - `V2` (2): Required for all new generators.\n *   Indicates that the generator is designed to safely coexist with legacy singleton generators\n *   in multi-generator environments without interfering with their expected behavior.\n */\nexport const generatorVersions = {\n\tLEGACY: 1,\n\tV2: 2\n};\n\nexport const targetTypes = {\n\tTRANSLATOR: 'translator',\n\tGENERATOR: 'generator'\n};\n","/**\n * @file registryUtils.js\n * @description Shared utility methods and keys for accessing the mediator registry on the global window context.\n */\n\n/**\n * Keys used to store the mediator registry on the global window object.\n * @type {Object}\n */\nexport const WindowKey = {\n\tmediatorRegistry: '__LIBRARY_INTENT_CHANNEL__mediatorRegistry'\n};\n\n/**\n * Keys used internally within the registry object to store mediator metadata.\n * @typedef {Object} RegistryKeyMap\n * @property {'mediatorKey'} mediatorKey - Key used for storing the mediator identifier.\n * @property {'mediatorHandler'} mediatorHandler - Key used for storing the mediator dispatch handler.\n */\n\n/**\n * @type {RegistryKeyMap}\n */\nexport const RegistryKey = {\n\tmediatorKey: 'mediatorKey',\n\tmediatorHandler: 'mediatorHandler'\n};\n\n/**\n * Enum representing how a mediator handler should affect message flow.\n *\n * - `continue`: Let the message proceed to the next handler in the chain.\n * - `terminate`: Stop further processing.\n * - `undefined`: Fallback/no-op (treated as `continue` by default).\n *\n * @readonly\n * @type {{ default: undefined, continue: 'continue', terminate: 'terminate' }}\n */\nexport const MediatorResultHandlerAction = /** @type {const} */ ({\n\tdefault: undefined,\n\tcontinue: 'continue',\n\tterminate: 'terminate'\n});\n\n/**\n * Determines whether the current window is the top-level window.\n * Used to ensure mediators are only registered at the root context.\n *\n * @returns {boolean} True if running in the top window; false otherwise.\n */\nexport function isTopWindow() {\n\treturn window.self === window.top;\n}\n\n/**\n * Safely returns the top-level window if accessible, or the current window if access is restricted (e.g. cross-origin).\n * Used to access the shared mediator registry across iframes or windows.\n *\n * @param {Window} [win=window] - Optional window context to resolve from.\n * @returns {Window} A safe reference to the appropriate window context.\n */\nexport function getRegistryWindow(win = window) {\n\ttry {\n\t\tconst topWin = win.top;\n\t\tvoid topWin[WindowKey.mediatorRegistry]; // access test for security\n\t\treturn topWin;\n\t} catch {\n\t\treturn win.self;\n\t}\n}\n","/**\n * @file registry.js\n * @description Singleton registry for storing mediator keys and handlers across window contexts.\n */\n\nimport {\n\tWindowKey,\n\tRegistryKey,\n\tisTopWindow,\n\tgetRegistryWindow\n} from './mediatorUtils';\n\nlet _instance = null;\n\n/**\n * MediatorRegistry stores a single mediator key/handler and supports global access via window.\n */\nexport class MediatorRegistry {\n\t#registry = {\n\t\t[RegistryKey.mediatorKey]: null,\n\t\t[RegistryKey.mediatorHandler]: null\n\t};\n\n\t/**\n\t * Returns a global instance of the MediatorRegistry.\n\t * Ensures only one mediator is allowed per top-level window context.\n\t * @returns {MediatorRegistry}\n\t */\n\tstatic getInstance() {\n\t\tconst registryWindow = getRegistryWindow();\n\t\tif (!_instance) {\n\t\t\t_instance = registryWindow[WindowKey.mediatorRegistry] ||=\n\t\t\t\tnew MediatorRegistry();\n\t\t}\n\t\treturn _instance;\n\t}\n\n\t/** @returns {string|null} */\n\tget mediatorKey() {\n\t\treturn this.#registry[RegistryKey.mediatorKey];\n\t}\n\n\t/** @returns {Function|null} */\n\tget mediatorHandler() {\n\t\treturn this.#registry[RegistryKey.mediatorHandler];\n\t}\n\n\t/** @returns {boolean} */\n\thasMediator() {\n\t\treturn !!this.mediatorKey;\n\t}\n\n\t/**\n\t * Registers a mediator handler.\n\t * @param {string} key\n\t * @param {Function} handler\n\t */\n\tsetMediator(key, handler) {\n\t\tif (this.hasMediator()) {\n\t\t\tthrow new Error('Another mediator is already registered');\n\t\t}\n\t\tif (!key) throw new Error('Mediator key is required');\n\t\tif (typeof handler !== 'function')\n\t\t\tthrow new Error('Mediator handler must be a function');\n\t\tif (!isTopWindow())\n\t\t\tthrow new Error('Mediators can only be registered in window.top');\n\n\t\tif (handler.constructor.name === 'AsyncFunction') {\n\t\t\tconsole.warn('Mediator handler should be synchronous');\n\t\t}\n\n\t\tthis.#registry[RegistryKey.mediatorKey] = key;\n\t\tthis.#registry[RegistryKey.mediatorHandler] = handler;\n\t}\n\n\t/**\n\t * Unsets the mediator by key.\n\t * @param {string} key\n\t */\n\tunsetMediator(key) {\n\t\tif (this.mediatorKey !== key) {\n\t\t\tthrow new Error('Mediator is not registered');\n\t\t}\n\t\tthis.#registry[RegistryKey.mediatorKey] = null;\n\t\tthis.#registry[RegistryKey.mediatorHandler] = null;\n\t}\n\n\t/**\n\t * Invokes the mediator handler if registered.\n\t * @param {string} action\n\t * @param {any} args\n\t * @returns {any}\n\t */\n\tinvoke(action, args) {\n\t\treturn this.hasMediator()\n\t\t\t? this.mediatorHandler(action, args) ?? args\n\t\t\t: args;\n\t}\n}\n\nexport const __testing = {\n\t...(process.env.NODE_ENV === 'test' && {\n\t\tresetMediatorRegistry() {\n\t\t\tconst registryWindow = getRegistryWindow();\n\t\t\tdelete registryWindow[WindowKey.mediatorRegistry];\n\t\t\t_instance = null;\n\t\t}\n\t})\n};\n","/**\n * @file mediatorResult.js\n * @description Utility for controlling whether mediator-based message processing should continue or terminate.\n */\n\n/**\n * @public\n *\n * Wrapper for controlling mediator result flow in a messaging chain.\n */\nexport class MediatorResult {\n\t/**\n\t * Determines whether the message processing should continue.\n\t * @param {*} result\n\t * @returns {boolean}\n\t */\n\tstatic isContinue(result) {\n\t\treturn !MediatorResult.isTerminate(result);\n\t}\n\n\t/**\n\t * Determines whether the message processing should terminate early.\n\t * @param {*} result\n\t * @returns {boolean}\n\t */\n\tstatic isTerminate(result) {\n\t\treturn result?.handlerAction === 'terminate';\n\t}\n\n\t/**\n\t * Signals the message chain to continue with optional updated metadata.\n\t * @param {object} [meta]\n\t * @returns {{ handlerAction: 'continue', meta: object }} Result directive\n\t */\n\tstatic continue(meta) {\n\t\treturn {\n\t\t\thandlerAction: 'continue',\n\t\t\tmeta\n\t\t};\n\t}\n\n\t/**\n\t * Signals the message chain to terminate and skip further handlers.\n\t * @returns {{ handlerAction: 'terminate' }} Result directive\n\t */\n\tstatic terminate() {\n\t\treturn {\n\t\t\thandlerAction: 'terminate'\n\t\t};\n\t}\n}\n","/**\n * @file messageProcessor.js\n * @description Implements a generic chain-of-responsibility processor for translator and generator message pipelines.\n * Each handler is invoked in order until one terminates the chain or all complete.\n */\n\n/**\n * Result object for message processing. Used by handler functions to control flow.\n */\nexport class MessageProcessorResult {\n\t/**\n\t * Returns `true` if the result indicates continuation of the message chain.\n\t * @param {any} result\n\t * @returns {boolean}\n\t */\n\tstatic isContinue(result) {\n\t\treturn typeof result === 'object';\n\t}\n\n\t/**\n\t * Returns `true` if the result indicates termination of the message chain.\n\t * @param {any} result\n\t * @returns {boolean}\n\t */\n\tstatic isTerminate(result) {\n\t\treturn !MessageProcessorResult.isContinue(result);\n\t}\n\n\t/**\n\t * Creates a result object indicating the chain should continue.\n\t * Optionally augments the meta object passed to subsequent handlers.\n\t *\n\t * @param {Object} [meta={}] - Updated metadata to pass forward.\n\t * @returns {{ meta: Object }}\n\t */\n\tstatic continue(meta = {}) {\n\t\treturn {meta};\n\t}\n\n\t/**\n\t * Creates a result indicating the message chain should terminate immediately.\n\t *\n\t * @returns {undefined}\n\t */\n\tstatic terminate() {\n\t\treturn;\n\t}\n}\n\n/**\n * Creates a message processor function that runs a chain of handlers for a given message type.\n *\n * Each handler is responsible for one message type (e.g., `sendIntent`) and must return either:\n * - `MessageProcessorResult.continue(meta)` to pass updated metadata to the next handler.\n * - `undefined` (or anything else) to terminate the chain early.\n *\n * @param {Array<Object<string, Function>>} processorHandlers - Array of message handler maps (e.g., from local/session/mediator).\n * @returns {Function} A function that takes the following parameters:\n *   - `type` (`string`): The type of the action.\n *   - `payload` (`Object`): The data payload.\n *   - `meta` (`Object`): Metadata related to the action.\n */\nexport const createMessageProcessor =\n\t(processorHandlers) => (type, payload, meta) => {\n\t\tlet handlerMeta = {...meta};\n\n\t\tfor (const processorHandler of processorHandlers) {\n\t\t\tconst typeHandler = processorHandler[type];\n\t\t\tif (!typeHandler) {\n\t\t\t\tthrow new Error(`MessageProcessor::No handler found for type: ${type}`);\n\t\t\t}\n\n\t\t\t// Prevent mutation of original payload\n\t\t\tconst handlerPayload = {...payload};\n\t\t\tconst result = typeHandler(handlerPayload, handlerMeta);\n\n\t\t\tif (MessageProcessorResult.isContinue(result)) {\n\t\t\t\thandlerMeta = {\n\t\t\t\t\t...handlerMeta,\n\t\t\t\t\t...result?.meta\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Terminate chain\n\t\t\tbreak;\n\t\t}\n\t};\n","/**\n * @file createHandler.js\n * @description Factory to create mediator-aware message handlers for message chains.\n */\n\nimport {MediatorRegistry} from './registry';\nimport {MediatorResult} from './mediatorResult';\nimport {MessageProcessorResult} from '../messageProcessor';\n\n/**\n * Creates a handler that checks for a mediator override.\n * Used as a message chain handler in generator/translator chains.\n *\n * @param {string} type - Action or message type to route through the mediator.\n * @returns {Function}\n */\nexport function createMessageTypeMediatorHandler(type) {\n\treturn (payload, meta) => {\n\t\tconst result = MediatorRegistry.getInstance().invoke(type, payload, meta);\n\t\treturn MediatorResult.isTerminate(result)\n\t\t\t? MessageProcessorResult.terminate()\n\t\t\t: MessageProcessorResult.continue(result?.meta);\n\t};\n}\n","/**\n * @file routingMediatorHandler.js\n * @description Forwards actions to the registered mediator.\n */\n\nimport {GeneratorMessageType} from '../../constants';\nimport {createMessageTypeMediatorHandler} from '../../mediator/createHandler';\n\nexport const routingMediatorHandler = {\n\t/**\n\t * Forwards CONTEXT_RECEIVED through the mediator.\n\t */\n\t[GeneratorMessageType.sendContext]: createMessageTypeMediatorHandler(\n\t\tGeneratorMessageType.sendContext\n\t),\n\n\t/**\n\t * Forwards SYSTEM_MESSAGE_RECEIVED through the mediator.\n\t */\n\t[GeneratorMessageType.sendSystemMessage]: createMessageTypeMediatorHandler(\n\t\tGeneratorMessageType.sendSystemMessage\n\t),\n\n\t/**\n\t * Forwards INTENT_FEEDBACK_RECEIVED through the mediator.\n\t */\n\t[GeneratorMessageType.sendIntentFeedback]: createMessageTypeMediatorHandler(\n\t\tGeneratorMessageType.sendIntentFeedback\n\t),\n\n\t/**\n\t * Forwards CONVERSATION_WITH_SKILL_REQUESTED through the mediator.\n\t */\n\t[GeneratorMessageType.requestConversationWithSkill]:\n\t\tcreateMessageTypeMediatorHandler(\n\t\t\tGeneratorMessageType.requestConversationWithSkill\n\t\t)\n};\n","/**\n * @file localHandler.js\n * @description Handles local delivery of messages directly to the generator component.\n */\n\nimport {GeneratorMessageType, intentActions} from '../../constants';\nimport {intentLibraryGlobals} from '../../intentLibraryGlobals';\nimport {MessageProcessorResult} from '../../messageProcessor';\n\nconst {\n\tCONTEXT_RECEIVED,\n\tSYSTEM_MESSAGE_RECEIVED,\n\tINTENT_FEEDBACK_RECEIVED,\n\tCONVERSATION_WITH_SKILL_REQUESTED\n} = intentActions;\n\nconst canHandle = (generator) => !!generator;\n\nexport const localHandler = {\n\t/**\n\t * Dispatches a CONTEXT_RECEIVED action to the specified generator.\n\t *\n\t * @param {SendContextDispatchPayload} payload - Contains the generator instance as well as translator id and context info.\n\t * @param {GeneratorDispatchMeta} meta - Additional metadata used during dispatch.\n\t */\n\t[GeneratorMessageType.sendContext](payload, meta) {\n\t\tconst {translatorId, context, generator} = payload;\n\t\tconst {activeTranslatorId, applyActiveTranslatorCheck = true} = meta;\n\n\t\tif (\n\t\t\t!translatorId ||\n\t\t\t(applyActiveTranslatorCheck && activeTranslatorId !== translatorId)\n\t\t) {\n\t\t\tconsole.warn(\n\t\t\t\t'Generator Local Handler: sendContext message processing terminated.'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif (!canHandle(generator)) return MessageProcessorResult.continue();\n\n\t\tgenerator.dispatch(CONTEXT_RECEIVED, {\n\t\t\tcontext,\n\t\t\ttranslatorId\n\t\t});\n\n\t\tif (intentLibraryGlobals.useCrossOriginSafePath) {\n\t\t\treturn MessageProcessorResult.continue();\n\t\t}\n\t},\n\n\t/**\n\t * Dispatches a `SYSTEM_MESSAGE_RECEIVED` action to the specified generator.\n\t *\n\t * @param {SendSystemMessageDispatchPayload} payload - Contains the generator instance as well as translator id and message info.\n\t * @param {GeneratorDispatchMeta} meta - Additional metadata used during dispatch.\n\t */\n\t[GeneratorMessageType.sendSystemMessage](payload, meta) {\n\t\tconst {translatorId, generator, message} = payload;\n\t\tconst {activeTranslatorId, applyActiveTranslatorCheck = true} = meta;\n\n\t\tif (applyActiveTranslatorCheck && translatorId !== activeTranslatorId) {\n\t\t\treturn;\n\t\t}\n\t\tif (!canHandle(generator)) return MessageProcessorResult.continue();\n\n\t\tgenerator.dispatch(SYSTEM_MESSAGE_RECEIVED, {\n\t\t\tmessage,\n\t\t\ttranslatorId\n\t\t});\n\t},\n\n\t/**\n\t * Dispatches an `INTENT_FEEDBACK_RECEIVED` action to the specified generator.\n\t *\n\t * @param {SendIntentFeedbackDispatchPayload} payload - Contains the generator instance, translator id, original intent, and intent feedback status and message.\n\t */\n\t[GeneratorMessageType.sendIntentFeedback](payload) {\n\t\tconst {translatorId, generator, originalIntent, status, message} = payload;\n\n\t\tif (!canHandle(generator)) return MessageProcessorResult.continue();\n\n\t\tgenerator.dispatch(INTENT_FEEDBACK_RECEIVED, {\n\t\t\toriginalIntent,\n\t\t\tstatus,\n\t\t\tmessage,\n\t\t\ttranslatorId\n\t\t});\n\t},\n\n\t/**\n\t * Dispatches a `CONVERSATION_WITH_SKILL_REQUESTED` action to the specified generator.\n\t *\n\t * @param {RequestConversationWithSkillPayload} payload - Contains the generator instance, translator id, and skill request details.\n\t * @param {GeneratorDispatchMeta} meta - Additional metadata used during dispatch.\n\t */\n\t[GeneratorMessageType.requestConversationWithSkill](payload, meta) {\n\t\tconst {translatorId, generator, skillId, params} = payload;\n\t\tconst {activeTranslatorId, applyActiveTranslatorCheck = true} = meta;\n\n\t\tif (applyActiveTranslatorCheck && translatorId !== activeTranslatorId) {\n\t\t\treturn;\n\t\t}\n\t\tif (!canHandle(generator)) return MessageProcessorResult.continue();\n\n\t\tgenerator.dispatch(CONVERSATION_WITH_SKILL_REQUESTED, {\n\t\t\tskillId,\n\t\t\ttranslatorId,\n\t\t\tparams\n\t\t});\n\t}\n};\n","/**\n * @file sessionStorageHandler.js\n * @description Persists messages into sessionStorage for cross-context messaging.\n */\n\nimport {GeneratorMessageType, intentLocalStorageKeys} from '../../constants';\nimport {appendToSessionStorage} from '../../sessionStorage/sessionStorageUtils';\n\n/**\n * Handles messages by persisting them to sessionStorage.\n *\n * @type {Record<string, function(Object, Object): void>}\n */\nexport const sessionStorageHandler = {\n\t/**\n\t * Persists updateContext data to sessionStorage.\n\t *\n\t * @param {SendContextPayload} payload\n\t * @param {GeneratorDispatchMeta} meta\n\t */\n\t[GeneratorMessageType.sendContext](payload, meta) {\n\t\tconst {translatorId, context} = payload;\n\t\tconst {fromSessionStorage} = meta;\n\n\t\tif (fromSessionStorage) {\n\t\t\t// do not persist messages from session storage\n\t\t\treturn;\n\t\t}\n\n\t\tsessionStorage.setItem(\n\t\t\tintentLocalStorageKeys.updateContext,\n\t\t\tJSON.stringify({\n\t\t\t\ttranslatorId,\n\t\t\t\tcontext,\n\t\t\t\tmeta\n\t\t\t})\n\t\t);\n\t},\n\n\t/**\n\t * Persists sendSystemMessage data to sessionStorage.\n\t *\n\t * @param {SendSystemMessagePayload} payload\n\t * @param {GeneratorDispatchMeta} meta\n\t */\n\t[GeneratorMessageType.sendSystemMessage](payload, meta) {\n\t\tconst {translatorId, message} = payload;\n\t\tconst {fromSessionStorage} = meta;\n\n\t\tif (fromSessionStorage) {\n\t\t\t// do not persist messages from session storage\n\t\t\treturn;\n\t\t}\n\n\t\tsessionStorage.setItem(\n\t\t\tintentLocalStorageKeys.sendSystemMessage,\n\t\t\tJSON.stringify({\n\t\t\t\ttranslatorId,\n\t\t\t\tmessage,\n\t\t\t\tmeta\n\t\t\t})\n\t\t);\n\t},\n\n\t/**\n\t * Appends sendIntentFeedback to existing sendIntentFeedback data in sessionStorage.\n\t *\n\t * @param {SendIntentFeedbackPayload} payload\n\t * @param {GeneratorDispatchMeta} meta\n\t */\n\t[GeneratorMessageType.sendIntentFeedback](payload, meta) {\n\t\tconst {translatorId, originalIntent, status, message} = payload;\n\t\tconst {fromSessionStorage} = meta;\n\n\t\tif (fromSessionStorage) {\n\t\t\t// do not persist messages from session storage\n\t\t\treturn;\n\t\t}\n\n\t\tconst values = appendToSessionStorage(\n\t\t\tintentLocalStorageKeys.sendIntentFeedback,\n\t\t\t{\n\t\t\t\ttranslatorId,\n\t\t\t\toriginalIntent,\n\t\t\t\tstatus,\n\t\t\t\tmessage,\n\t\t\t\tmeta\n\t\t\t}\n\t\t);\n\n\t\tsessionStorage.setItem(intentLocalStorageKeys.sendIntentFeedback, values);\n\t},\n\n\t/**\n\t * Persists requestConversationWithSkill data to sessionStorage.\n\t *\n\t * @param {RequestConversationWithSkillPayload} payload\n\t * @param {GeneratorDispatchMeta} meta\n\t */\n\t[GeneratorMessageType.requestConversationWithSkill](payload, meta) {\n\t\tconst {translatorId, skillId, params} = payload;\n\t\tconst {fromSessionStorage} = meta;\n\n\t\tif (fromSessionStorage) {\n\t\t\t// do not persist messages from session storage\n\t\t\treturn;\n\t\t}\n\n\t\tsessionStorage.setItem(\n\t\t\tintentLocalStorageKeys.requestConversationWithSkill,\n\t\t\tJSON.stringify({\n\t\t\t\ttranslatorId,\n\t\t\t\tskillId,\n\t\t\t\tparams,\n\t\t\t\tmeta\n\t\t\t})\n\t\t);\n\t}\n};\n","import {intentLibraryGlobals} from '../intentLibraryGlobals.js';\n\nconst TRANSLATOR_MAP = 'translators';\n\n// Initialize global translator registry if not already set\nif (!intentLibraryGlobals[TRANSLATOR_MAP]) {\n\tintentLibraryGlobals[TRANSLATOR_MAP] = {};\n}\n\n/**\n * Retrieves a registered translator by its id.\n *\n * @param {string} id - The translator id.\n * @returns {TranslatorObject | undefined}\n */\nexport const getTranslatorById = (id) =>\n\tintentLibraryGlobals[TRANSLATOR_MAP][id];\n\n/**\n * Retrieves the full map of all registered translators.\n *\n * @returns {Record<string, TranslatorObject>}\n */\nexport const getTranslators = () => intentLibraryGlobals[TRANSLATOR_MAP];\n\n/**\n * Registers or updates a translator in the global registry.\n *\n * @param {string} id - The translator id.\n * @param {TranslatorObject} value - The translator object to store.\n */\nexport const registerTranslatorById = (id, value) => {\n\tintentLibraryGlobals[TRANSLATOR_MAP][id] = value;\n};\n\n/**\n * Removes a translator from the global registry by id.\n *\n * @param {string} id - The translator id to delete.\n */\nexport const deleteTranslatorById = (id) => {\n\tdelete intentLibraryGlobals[TRANSLATOR_MAP][id];\n};\n","/**\n * @file generatorChain.js\n * @description Initializes the generator message processing chain using the chain-of-responsibility pattern.\n */\n\nimport {routingMediatorHandler} from './handlers/routingMediatorHandler';\nimport {localHandler} from './handlers/localHandler';\nimport {sessionStorageHandler} from './handlers/sessionStorageHandler';\nimport {GeneratorMessageType} from '../constants';\nimport {createMessageProcessor} from '../messageProcessor';\nimport {intentLibraryGlobals} from '../intentLibraryGlobals';\nimport {getTranslators} from '../translator/translatorRegistry';\nimport {getAllContextGenerators} from '../generator/generatorRegistry';\n\n/**\n * Creates a chain processor for generator-side messages.\n * Uses the Chain-of-Responsibility pattern to process messages through different handlers.\n *\n * @param {TranslatorRegistry} translators - A registry of all translators.\n * @returns {GeneratorChain} The created generator chain with message processing methods.\n */\nconst createGeneratorChain = (translators) => {\n\tconst processMessage = createMessageProcessor([\n\t\troutingMediatorHandler,\n\t\tlocalHandler,\n\t\tsessionStorageHandler\n\t]);\n\n\treturn {\n\t\t/**\n\t\t * Delegates a `sendContext` generator message to the chain of handlers for processing.\n\t\t *\n\t\t * @param {string} translatorId - The id of the translator sending the context.\n\t\t * @param {GeneratorObject} generator - The generator instance associated with the translator.\n\t\t * @param {string} activeTranslatorId - The id of the currently active translator.\n\t\t * @param {TranslatorContext} [context] - Optional explicit context to send; if omitted, falls back to the translator's existing context.\n\t\t * @param {GeneratorDispatchMeta} [meta={}] - Optional metadata to send with the message, such as the source of the dispatch.\n\t\t */\n\t\tprocessSendContext(\n\t\t\ttranslatorId,\n\t\t\tgenerator,\n\t\t\tactiveTranslatorId,\n\t\t\tcontext,\n\t\t\tmeta = {}\n\t\t) {\n\t\t\tconst messageContext =\n\t\t\t\tcontext ?? translators[translatorId]?.context ?? null;\n\n\t\t\tprocessMessage(\n\t\t\t\tGeneratorMessageType.sendContext,\n\t\t\t\t{\n\t\t\t\t\ttranslatorId,\n\t\t\t\t\tcontext: messageContext,\n\t\t\t\t\tgenerator,\n\t\t\t\t\ttranslators\n\t\t\t\t},\n\t\t\t\t{...meta, activeTranslatorId}\n\t\t\t);\n\n\t\t\t// Also send to all generators with receiveAllContexts flag\n\t\t\tconst allContextGenerators = getAllContextGenerators();\n\n\t\t\tif (allContextGenerators.length > 0) {\n\t\t\t\tallContextGenerators.forEach((allContextGenerator) => {\n\t\t\t\t\t// Skip if this is the same generator we just sent to\n\t\t\t\t\tif (allContextGenerator === generator) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tprocessMessage(\n\t\t\t\t\t\tGeneratorMessageType.sendContext,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttranslatorId,\n\t\t\t\t\t\t\tcontext: messageContext,\n\t\t\t\t\t\t\tgenerator: allContextGenerator,\n\t\t\t\t\t\t\ttranslators\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{...meta, activeTranslatorId}\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delegates a `sendSystemMessage` generator message to the chain of handlers for processing.\n\t\t *\n\t\t * @param {string} translatorId - The id of the translator.\n\t\t * @param {GeneratorObject} generator - The generator to send the system message to.\n\t\t * @param {*} message - The system message to send.\n\t\t * @param {string} activeTranslatorId - The active translator id.\n\t\t * @param {GeneratorDispatchMeta} [meta] - Optional metadata for the system message.\n\t\t */\n\t\tprocessSendSystemMessage(\n\t\t\ttranslatorId,\n\t\t\tgenerator,\n\t\t\tmessage,\n\t\t\tactiveTranslatorId,\n\t\t\tmeta = {}\n\t\t) {\n\t\t\tprocessMessage(\n\t\t\t\tGeneratorMessageType.sendSystemMessage,\n\t\t\t\t{translatorId, generator, message},\n\t\t\t\t{...meta, activeTranslatorId}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Delegates a `sendIntentFeedback` generator message to the chain of handlers for processing.\n\t\t *\n\t\t * @param {string} translatorId - The id of the translator.\n\t\t * @param {GeneratorObject} generator - The generator to send the intent feedback to.\n\t\t * @param {*} originalIntent - The original intent message.\n\t\t * @param {*} status - The status of the intent.\n\t\t * @param {*} message - The feedback message.\n\t\t * @param {GeneratorDispatchMeta} [meta] - Optional metadata for the feedback.\n\t\t */\n\t\tprocessSendIntentFeedback(\n\t\t\ttranslatorId,\n\t\t\tgenerator,\n\t\t\toriginalIntent,\n\t\t\tstatus,\n\t\t\tmessage,\n\t\t\tmeta = {}\n\t\t) {\n\t\t\tprocessMessage(\n\t\t\t\tGeneratorMessageType.sendIntentFeedback,\n\t\t\t\t{\n\t\t\t\t\ttranslatorId,\n\t\t\t\t\tgenerator,\n\t\t\t\t\toriginalIntent,\n\t\t\t\t\tstatus,\n\t\t\t\t\tmessage\n\t\t\t\t},\n\t\t\t\t{...meta}\n\t\t\t);\n\t\t},\n\n\t\t/**\n\t\t * Delegates a `requestConversationWithSkill` generator message to the chain of handlers for processing.\n\t\t *\n\t\t * @param {string} translatorId - The id of the translator.\n\t\t * @param {GeneratorObject} generator - The generator to send the conversation request to.\n\t\t * @param {string} skillId - The skill ID to request a conversation with.\n\t\t * @param {object} params - The parameters for the skill conversation.\n\t\t * @param {string} activeTranslatorId - The active translator id.\n\t\t * @param {GeneratorDispatchMeta} [meta] - Optional metadata for the conversation request.\n\t\t */\n\t\tprocessRequestConversationWithSkill(\n\t\t\ttranslatorId,\n\t\t\tgenerator,\n\t\t\tskillId,\n\t\t\tparams,\n\t\t\tactiveTranslatorId,\n\t\t\tmeta = {}\n\t\t) {\n\t\t\tprocessMessage(\n\t\t\t\tGeneratorMessageType.requestConversationWithSkill,\n\t\t\t\t{translatorId, generator, skillId, params},\n\t\t\t\t{...meta, activeTranslatorId}\n\t\t\t);\n\t\t}\n\t};\n};\n\nif (!intentLibraryGlobals?.generatorChain) {\n\tintentLibraryGlobals.generatorChain = createGeneratorChain(getTranslators());\n}\n\n/**\n * Global generator messaging chain.\n * Routes feedback, context, and system messages to the appropriate generator handlers.\n * @type {GeneratorChain}\n */\nexport const {generatorChain} = intentLibraryGlobals;\n","/**\n * @file routingMediatorHandler.js\n * @description Forwards actions to a registered mediator.\n */\n\nimport {createMessageTypeMediatorHandler} from '../../mediator/createHandler';\nimport {TranslatorMessageType} from '../../constants';\n\nexport const routingMediatorHandler = {\n\t/**\n\t * Forwards SEND_INTENT to the mediator if one is registered.\n\t */\n\t[TranslatorMessageType.sendIntent]: createMessageTypeMediatorHandler(\n\t\tTranslatorMessageType.sendIntent\n\t)\n};\n","/**\n * @file localHandler.js\n * @description Handles local delivery of messages directly to the translator component.\n */\n\nimport {intentActions, TranslatorMessageType} from '../../constants';\nimport {MessageProcessorResult} from '../../messageProcessor';\n\nconst {INTENT_RECEIVED} = intentActions;\n\nconst canHandle = (translatorId, translators) =>\n\ttranslatorId && translators[translatorId];\n\nexport const localHandler = {\n\t/**\n\t * Dispatches a INTENT_RECEIVED to the specified translator if conditions are met.\n\t *\n\t * @param {SendIntentPayload} payload\n\t * @param {TranslatorDispatchMeta} meta\n\t * @returns {object|undefined}\n\t */\n\t[TranslatorMessageType.sendIntent](payload, meta) {\n\t\tconst {translatorId, intentPayload, translators, generatorForFeedback} =\n\t\t\tpayload;\n\n\t\tconst {activeTranslatorId, applyActiveTranslatorCheck = true} = meta;\n\n\t\tif (!canHandle(translatorId, translators)) {\n\t\t\treturn MessageProcessorResult.continue();\n\t\t}\n\n\t\tif (applyActiveTranslatorCheck && activeTranslatorId !== translatorId) {\n\t\t\treturn;\n\t\t}\n\n\t\ttranslators[translatorId].dispatch(\n\t\t\tINTENT_RECEIVED,\n\t\t\t{\n\t\t\t\tintent: intentPayload\n\t\t\t},\n\t\t\t{\n\t\t\t\t...meta,\n\t\t\t\tgeneratorForFeedback\n\t\t\t}\n\t\t);\n\t}\n};\n","/**\n * @file sessionStorageHandler.js\n * @description Persists messages into sessionStorage for cross-context delivery to translators.\n */\n\nimport {TranslatorMessageType, intentLocalStorageKeys} from '../../constants';\n\nimport {appendToSessionStorage} from '../../sessionStorage/sessionStorageUtils';\n\nconst canHandle = (translatorId) => !!translatorId;\n\nexport const sessionStorageHandler = {\n\t/**\n\t * Stores the intent in sessionStorage.\n\t *\n\t * @param {SendIntentPayload} payload\n\t * @param {TranslatorDispatchMeta} meta\n\t */\n\t[TranslatorMessageType.sendIntent](payload, meta) {\n\t\tconst {translatorId, intentPayload} = payload;\n\t\tconst {fromSessionStorage} = meta;\n\n\t\tif (!canHandle(translatorId)) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'Unable to send intent to translator because translatorId is undefined.'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tif (fromSessionStorage) {\n\t\t\t// Don't re-persist messages already dispatched from sessionStorage\n\t\t\treturn;\n\t\t}\n\n\t\tconst key = `${intentLocalStorageKeys.sendIntent}/${translatorId}`;\n\t\tconst values = appendToSessionStorage(key, {\n\t\t\ttranslatorId,\n\t\t\tintentPayload,\n\t\t\tmeta\n\t\t});\n\n\t\tsessionStorage.setItem(key, values);\n\t}\n};\n","/**\n * @file translatorChain.js\n * @description Defines the TranslatorChain, responsible for processing messages using a chain-of-responsibility pattern.\n */\n\nimport {routingMediatorHandler} from './handlers/routingMediatorHandler';\nimport {localHandler} from './handlers/localHandler';\nimport {sessionStorageHandler} from './handlers/sessionStorageHandler';\nimport {TranslatorMessageType} from '../constants';\nimport {createMessageProcessor} from '../messageProcessor';\nimport {intentLibraryGlobals} from '../intentLibraryGlobals.js';\nimport {getTranslators} from './translatorRegistry.js';\n\n/**\n * Creates a chain processor for translator-side messages.\n * Uses the Chain-of-Responsibility pattern to process messages through different handlers.\n *\n * @param {Record<string, TranslatorObject>} translators - A registry of all registered translators.\n * @returns {TranslatorChain} The created translator chain with message processing methods.\n */\nconst createTranslatorChain = (translators) => {\n\tconst processMessage = createMessageProcessor([\n\t\troutingMediatorHandler,\n\t\tlocalHandler,\n\t\tsessionStorageHandler\n\t]);\n\n\treturn {\n\t\t/**\n\t\t * Delegates a `sendIntent` translator message to the chain of handlers for processing.\n\t\t *\n\t\t * @param {string} translatorId - The id of the translator to use.\n\t\t * @param {Object} intentPayload - The payload to send with the intent.\n\t\t * @param {string} activeTranslatorId - The id of the active translator.\n\t\t * @param {GeneratorObject} generatorForFeedback - The generator instance which sent the intent.\n\t\t * @param {object} [meta={}] - Optional metadata to include with the message.\n\t\t */\n\t\tprocessSendIntent(\n\t\t\ttranslatorId,\n\t\t\tintentPayload,\n\t\t\tactiveTranslatorId,\n\t\t\tgeneratorForFeedback,\n\t\t\tmeta = {}\n\t\t) {\n\t\t\tprocessMessage(\n\t\t\t\tTranslatorMessageType.sendIntent,\n\t\t\t\t{translatorId, intentPayload, translators, generatorForFeedback},\n\t\t\t\t{...meta, activeTranslatorId}\n\t\t\t);\n\t\t}\n\t};\n};\n\nif (!intentLibraryGlobals.translatorChain) {\n\tintentLibraryGlobals.translatorChain = createTranslatorChain(\n\t\tgetTranslators()\n\t);\n}\n\n/**\n * Global translator messaging chain.\n * Routes intent messages to the appropriate translator handlers.\n * @type {TranslatorChain}\n */\nexport const {translatorChain} = intentLibraryGlobals;\n","import {intentLocalStorageKeys} from '../constants';\n\n/**\n * Retrieves the currently active translator Id from sessionStorage.\n * @returns {string|null}\n */\nexport const getCurrentActiveTranslatorId = () =>\n\tsessionStorage.getItem(intentLocalStorageKeys.activeTranslatorKey);\n\n/**\n * Removes the active translator Id from session storage.\n */\nexport const clearActiveTranslatorId = () =>\n\tsessionStorage.removeItem(intentLocalStorageKeys.activeTranslatorKey);\n\n/**\n * Sets the active translator id in sessionStorage.\n * @param {string} translatorId\n */\nexport const setCurrentActiveTranslatorId = (translatorId) =>\n\tsessionStorage.setItem(\n\t\tintentLocalStorageKeys.activeTranslatorKey,\n\t\ttranslatorId\n\t);\n\n/**\n * Unsets the active translator id if it matches the given value.\n * @param {string} translatorId\n * @returns {boolean}\n */\nexport const unsetCurrentActiveTranslatorId = (translatorId) => {\n\tif (getCurrentActiveTranslatorId() === translatorId) {\n\t\tclearActiveTranslatorId();\n\t\treturn true;\n\t}\n\treturn false;\n};\n","import {getGeneratorById} from '../generator/generatorRegistry';\n\nimport {generatorChain} from '../generator/generatorChain';\nimport {translatorChain} from '../translator/translatorChain';\nimport {intentLocalStorageKeys} from '../constants';\nimport {getCurrentActiveTranslatorId} from './activeTranslatorService';\n\n/**\n * Generic processor for sessionStorage keys and message dispatchers.\n *\n * @param {string} storageKey The key in sessionStorage to retrieve the data from.\n * @param {Function} handler A function that processes the payload and metadata.\n * The handler takes two arguments:\n *   - `payload` (`Object`): The data object to be processed.\n *   - `meta` (`Object`): The metadata related to the payload, including `fromSessionStorage: true`.\n */\nconst sendDataFromStorage = (storageKey, generatorId, handler) => {\n\tif (!getGeneratorById(generatorId)) return;\n\n\tconst jsonString = sessionStorage.getItem(storageKey);\n\tif (!jsonString) return;\n\n\ttry {\n\t\tlet values = JSON.parse(jsonString);\n\t\tif (!Array.isArray(values)) values = [values];\n\n\t\tvalues.forEach((value) => {\n\t\t\tconst {meta, ...payload} = value;\n\t\t\tconst sessionMeta = {\n\t\t\t\t...meta,\n\t\t\t\tfromSessionStorage: true\n\t\t\t};\n\t\t\thandler(payload, sessionMeta);\n\t\t});\n\t} catch {\n\t\tconsole.warn('sessionStorageDispatcher: Failed to parse JSON.');\n\t}\n\n\tsessionStorage.removeItem(storageKey);\n};\n\n/**\n * Routes SEND_INTENT_FEEDBACK to the generator chain.\n * @param {string} generatorId - The ID of the generator to send the feedback to.\n */\nexport const sendIntentFeedbackFromStorage = (generatorId) => {\n\tsendDataFromStorage(\n\t\tintentLocalStorageKeys.sendIntentFeedback,\n\t\tgeneratorId,\n\t\t(payload, meta) => {\n\t\t\tgeneratorChain.processSendIntentFeedback(\n\t\t\t\tpayload.translatorId,\n\t\t\t\tgetGeneratorById(generatorId),\n\t\t\t\tpayload.originalIntent,\n\t\t\t\tpayload.status,\n\t\t\t\tpayload.message,\n\t\t\t\tmeta\n\t\t\t);\n\t\t}\n\t);\n};\n\n/**\n * Routes SEND_CONTEXT to the generator chain.\n * @param {string} generatorId - The ID of the generator to send the context to.\n */\nexport const updateContextFromStorage = (generatorId) => {\n\tsendDataFromStorage(\n\t\tintentLocalStorageKeys.updateContext,\n\t\tgeneratorId,\n\t\t(payload, meta) => {\n\t\t\tgeneratorChain.processSendContext(\n\t\t\t\tpayload.translatorId,\n\t\t\t\tgetGeneratorById(generatorId),\n\t\t\t\tgetCurrentActiveTranslatorId(),\n\t\t\t\tpayload.context,\n\t\t\t\tmeta\n\t\t\t);\n\t\t}\n\t);\n};\n\n/**\n * Routes SEND_SYSTEM_MESSAGE to the generator chain.\n */\nexport const sendSystemMessageFromStorage = (generatorId) => {\n\tsendDataFromStorage(\n\t\tintentLocalStorageKeys.sendSystemMessage,\n\t\tgeneratorId,\n\t\t(payload, meta) => {\n\t\t\tgeneratorChain.processSendSystemMessage(\n\t\t\t\tpayload.translatorId,\n\t\t\t\tgetGeneratorById(generatorId),\n\t\t\t\tpayload.message,\n\t\t\t\tgetCurrentActiveTranslatorId(),\n\t\t\t\tmeta\n\t\t\t);\n\t\t}\n\t);\n};\n\n/**\n * Routes REQUEST_CONVERSATION_WITH_SKILL to the generator chain.\n * @param {string} generatorId - The ID of the generator to send the request to.\n */\nexport const requestConversationWithSkillFromStorage = (generatorId) => {\n\tsendDataFromStorage(\n\t\tintentLocalStorageKeys.requestConversationWithSkill,\n\t\tgeneratorId,\n\t\t(payload, meta) => {\n\t\t\tgeneratorChain.processRequestConversationWithSkill(\n\t\t\t\tpayload.translatorId,\n\t\t\t\tgetGeneratorById(generatorId),\n\t\t\t\tpayload.skillId,\n\t\t\t\tpayload.params,\n\t\t\t\tgetCurrentActiveTranslatorId(),\n\t\t\t\tmeta\n\t\t\t);\n\t\t}\n\t);\n};\n\n/**\n * Processes stored intents from the sessionStorage `sendIntent/*` keys.\n * @param {string} translatorId\n * @param {*} intentPayload\n * @param {string} originatingGeneratorId\n * @param {*} meta\n */\nexport const sendIntentFromStorage = (\n\ttranslatorId,\n\tintentPayload,\n\toriginatingGeneratorId,\n\tmeta\n) => {\n\tif (!meta?.fromSessionStorage) {\n\t\tthrow new Error('Message must be tagged as fromSessionStorage');\n\t}\n\n\ttranslatorChain.processSendIntent(\n\t\ttranslatorId,\n\t\tintentPayload,\n\t\tgetCurrentActiveTranslatorId(),\n\t\toriginatingGeneratorId,\n\t\tmeta\n\t);\n};\n","import {\n\tupdateContextFromStorage,\n\tsendSystemMessageFromStorage,\n\tsendIntentFeedbackFromStorage,\n\trequestConversationWithSkillFromStorage,\n\tsendIntentFromStorage\n} from './sessionStorageDispatcher';\n\nimport {getTranslatorById} from '../translator/translatorRegistry';\nimport {intentLocalStorageKeys} from '../constants';\nimport {getGeneratorById} from '../generator/generatorRegistry';\n\n/**\n * Appends a new value to an array stored in sessionStorage under the given key.\n * Automatically recovers from corrupt or missing data.\n *\n * @param {string} key\n * @param {*} value\n * @returns {string} - The updated JSON string\n */\nexport const appendToSessionStorage = (key, value) => {\n\tconst prevValue = sessionStorage.getItem(key);\n\tlet values = [];\n\n\tif (prevValue) {\n\t\ttry {\n\t\t\tvalues = JSON.parse(prevValue);\n\t\t} catch {\n\t\t\tvalues = [];\n\t\t}\n\t}\n\n\tif (!Array.isArray(values)) values = [values];\n\n\tvalues.push(value);\n\treturn JSON.stringify(values);\n};\n\n/**\n * Global window event listener for storage events.\n * Routes messages from other browser contexts (e.g., iframes, tabs) to the runtime dispatcher.\n *\n * @param {StorageEvent} e\n */\nexport const handleStorageEvent = (e) => {\n\tconst {key} = e;\n\n\tif (key === intentLocalStorageKeys.updateContext) {\n\t\tupdateContextFromStorage();\n\t} else if (key === intentLocalStorageKeys.sendSystemMessage) {\n\t\tsendSystemMessageFromStorage();\n\t} else if (key === intentLocalStorageKeys.sendIntentFeedback) {\n\t\tsendIntentFeedbackFromStorage();\n\t} else if (key === intentLocalStorageKeys.requestConversationWithSkill) {\n\t\trequestConversationWithSkillFromStorage();\n\t} else if (key?.startsWith(`${intentLocalStorageKeys.sendIntent}/`)) {\n\t\tconst translatorId = key.replace(\n\t\t\t`${intentLocalStorageKeys.sendIntent}/`,\n\t\t\t''\n\t\t);\n\t\tif (translatorId && getTranslatorById(translatorId)) {\n\t\t\ttry {\n\t\t\t\tlet values = JSON.parse(sessionStorage.getItem(key));\n\t\t\t\tif (!Array.isArray(values)) values = [values];\n\n\t\t\t\tvalues.forEach((value) => {\n\t\t\t\t\tconst meta = {\n\t\t\t\t\t\t...value.meta,\n\t\t\t\t\t\tfromSessionStorage: true\n\t\t\t\t\t};\n\t\t\t\t\tsendIntentFromStorage(\n\t\t\t\t\t\ttranslatorId,\n\t\t\t\t\t\tvalue.intentPayload,\n\t\t\t\t\t\tgetGeneratorById(value.originatingGeneratorId),\n\t\t\t\t\t\tmeta\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t} catch {\n\t\t\t\tconsole.warn('Storage event: Skipped malformed sendIntent data');\n\t\t\t}\n\t\t\tsessionStorage.removeItem(key);\n\t\t}\n\t}\n};\n","/**\n * @file runtime.js\n * @description Entry point for the library-intent-channel.\n * Initializes and exports a global singleton runtime, containing the generator and translator chains.\n * Also registers global event listeners for communication across browser contexts.\n */\n\nimport {handleStorageEvent} from './sessionStorage/sessionStorageUtils';\nimport {clearActiveTranslatorId} from './sessionStorage/activeTranslatorService';\nimport {MediatorRegistry} from './mediator/registry';\n\n/**\n * Initializes the messaging runtime globally.\n * Safe to call multiple times (no-op after first call).\n * Registers:\n * - `beforeunload` event for clearing active translator state\n * - `storage` event for sessionStorage message dispatching\n * - Instantiates the mediator registry\n *\n * @internal\n */\nexport function initializeIntentLibrary() {\n\twindow.addEventListener('beforeunload', clearActiveTranslatorId);\n\twindow.addEventListener('storage', handleStorageEvent);\n\n\t// Ensure the mediator registry is initialized\n\tMediatorRegistry.getInstance();\n}\n","import {intentLibraryGlobals} from '../intentLibraryGlobals';\nimport {intentActions, targetTypes} from '../constants';\n\nconst {BROADCAST_TOPIC_RECEIVED} = intentActions;\n\nif (!intentLibraryGlobals?.topicSubscribers) {\n\tintentLibraryGlobals.topicSubscribers = {\n\t\tgenerator: new Map(),\n\t\ttranslator: new Map()\n\t};\n}\n\nconst {topicSubscribers} = intentLibraryGlobals;\n\n/**\n * Subscribe to a broadcast topic for a specific target type.\n *\n * @param {string} nowId - The unique identifier for the target.\n * @param {string} targetType - The type of the target (e.g., 'generator', 'translator').\n * @param {string} topic - The topic to subscribe to.\n * @param {function} dispatch - The function to call when the topic is broadcasted.\n */\nexport function subscribeToTopic(nowId, targetType, topic, dispatch) {\n\tif (!nowId) {\n\t\tconsole.error('nowId is required to subscribe to a topic');\n\t\treturn;\n\t}\n\tif (!targetType || !Object.values(targetTypes).includes(targetType)) {\n\t\tconsole.error(\n\t\t\t'targetType is required and must be either \"generator\" or \"translator\"'\n\t\t);\n\t\treturn;\n\t}\n\tif (!topic) {\n\t\tconsole.error('topic is required to subscribe to a topic');\n\t\treturn;\n\t}\n\tif (!dispatch || typeof dispatch !== 'function') {\n\t\tconsole.error('dispatch is required and must be a function');\n\t\treturn;\n\t}\n\n\tconst targetMap = topicSubscribers[targetType];\n\n\tif (!targetMap.has(topic)) {\n\t\ttargetMap.set(topic, new Map());\n\t}\n\n\ttargetMap.get(topic).set(nowId, dispatch);\n}\n\n/**\n * Subscribe to multiple broadcast topics for a specific target type.\n *\n * @param {string} nowId - The unique identifier for the target.\n * @param {TargetType} targetType - The type of the target (e.g., 'generator', 'translator').\n * @param {Array<String>} topics - An array of topics to subscribe to.\n * @param {Function} dispatch - The function to call when the topic is broadcasted.\n */\nexport function subscribeToTopics(nowId, targetType, topics, dispatch) {\n\tif (!topics || topics.length === 0 || !Array.isArray(topics)) {\n\t\tconsole.error('topics is required and must be a non-empty array');\n\t\treturn;\n\t}\n\n\ttopics.forEach(({topic}) => {\n\t\tsubscribeToTopic(nowId, targetType, topic, dispatch);\n\t});\n}\n\n/**\n * Unsubscribe from a broadcast topic.\n */\nexport function unsubscribeFromTopic(nowId, targetType, topic) {\n\tconst targetMap = topicSubscribers[targetType];\n\tconst topicMap = targetMap.get(topic);\n\n\tif (!topicMap) {\n\t\treturn;\n\t}\n\n\ttopicMap.delete(nowId);\n\n\tif (topicMap.size === 0) {\n\t\ttargetMap.delete(topic);\n\t}\n}\n\nexport function unsubscribeFromAllTopics(nowId, targetType) {\n\tconst targetMap = topicSubscribers[targetType];\n\n\tfor (const [topic, topicMap] of targetMap.entries()) {\n\t\ttopicMap.delete(nowId);\n\n\t\tif (topicMap.size === 0) {\n\t\t\ttargetMap.delete(topic);\n\t\t}\n\t}\n}\n\nexport function broadcastTopic(targetType, topic, data) {\n\tconst targets = topicSubscribers[targetType].get(topic) || [];\n\tif (targets.size === 0) {\n\t\tconsole.warn(`No subscribers for topic: ${topic}`);\n\t\treturn;\n\t}\n\n\ttargets.forEach((dispatch) => {\n\t\tif (typeof dispatch === 'function') {\n\t\t\tdispatch(BROADCAST_TOPIC_RECEIVED, {targetType, topic, data});\n\t\t}\n\t});\n}\n","/**\n * @file generatorService.js\n * @description Generator-side service responsible for routing messages to the generator chain.\n */\n\nimport {generatorVersions, targetTypes} from '../constants';\n\nimport {\n\tgetGeneratorById,\n\tregisterGeneratorById,\n\tregisterDefaultGenerator,\n\tdeleteGeneratorById,\n\tgetDefaultGenerator\n} from './generatorRegistry';\n\nimport {getCurrentActiveTranslatorId} from '../sessionStorage/activeTranslatorService';\nimport {\n\tupdateContextFromStorage,\n\trequestConversationWithSkillFromStorage,\n\tsendSystemMessageFromStorage\n} from '../sessionStorage/sessionStorageDispatcher';\n\nimport {generatorChain} from './generatorChain';\n\nimport {\n\tunsubscribeFromAllTopics,\n\tsubscribeToTopics\n} from '../pubsub/pubsubService';\n\n/**\n * Sends a system message to the generator.\n *\n * @param {string} translatorId - The translator sending the message.\n * @param {*} message - The system message to deliver.\n * @param {string} generatorId - The ID of the generator to send the message to.\n */\nexport const sendSystemMessage = (translatorId, message, generatorId) => {\n\tgeneratorChain.processSendSystemMessage(\n\t\ttranslatorId,\n\t\tgetGeneratorById(generatorId),\n\t\tmessage,\n\t\tgetCurrentActiveTranslatorId()\n\t);\n};\n\n/**\n * Requests a conversation with a skill via the generator.\n *\n * @param {string} translatorId - The id of the translator initiating the request.\n * @param {string} skillId - The skill identifier.\n * @param {Object} params - Additional parameters for the request.\n * @param {string} generatorId - The ID of the generator to send the request to.\n */\nexport const requestConversationWithSkill = (\n\ttranslatorId,\n\tskillId,\n\tparams,\n\tgeneratorId\n) => {\n\tgeneratorChain.processRequestConversationWithSkill(\n\t\ttranslatorId,\n\t\tgetGeneratorById(generatorId),\n\t\tskillId,\n\t\tparams,\n\t\tgetCurrentActiveTranslatorId()\n\t);\n};\n\n/**\n * @public\n *\n * Removes the currently registered generator instance.\n */\nexport const removeGenerator = (id) => {\n\tif (!id) {\n\t\tconsole.error('id param is required to remove the generator.');\n\t\treturn;\n\t}\n\n\tdeleteGeneratorById(id);\n\tunsubscribeFromAllTopics(id, targetTypes.GENERATOR);\n};\n\n/**\n * Sends a translator's context to the generator.\n *\n * @param {string} translatorId - The id of the translator whose context should be sent.\n * @param {string} generatorId - The ID of the generator to send the context to.\n */\nexport const sendContextToGenerator = (translatorId, generatorId) => {\n\tgeneratorChain.processSendContext(\n\t\ttranslatorId,\n\t\tgetGeneratorById(generatorId),\n\t\tgetCurrentActiveTranslatorId()\n\t);\n};\n\n/**\n * @public\n *\n * Registers a generator with the runtime.\n *\n * @param {string} id - The unique generator ID.\n * @param {Function} dispatch - Function to handle generator-side dispatches.\n * @param {GeneratorRegistrationPayload} payload - Registration payload used to provide optional metadata.\n *   @param {Object} payload.options - Optional configuration options.\n *   @param {string} [payload.options.generatorVersion] - The generator version.\n *   @param {boolean} [payload.options.receiveAllContexts] - If true, this generator will receive context updates from all translators,\n *                                                          even if it's not the most recently registered generator.\n *   @param {Array<string>} [payload.options.subscribedTopics] - Array of pubsub topics to subscribe to.\n */\nexport const registerGenerator = (id, dispatch, payload) => {\n\tconst receiveAllContexts = payload?.options?.receiveAllContexts === true;\n\tif (payload?.options?.generatorVersion === generatorVersions.V2) {\n\t\tregisterGeneratorById(id, {dispatch}, receiveAllContexts);\n\t} else {\n\t\tregisterDefaultGenerator(id, {dispatch}, receiveAllContexts);\n\t}\n\n\tif (window !== window.top) {\n\t\twindow.addEventListener('unload', () => {\n\t\t\tremoveGenerator(id);\n\t\t});\n\t}\n\n\t// Subscribe to topics if provided in payload options\n\tconst subscribedTopics = payload?.options?.subscribedTopics;\n\n\tif (subscribedTopics) {\n\t\tsubscribeToTopics(id, targetTypes.GENERATOR, subscribedTopics, dispatch);\n\t}\n\n\tconst activeTranslatorId = getCurrentActiveTranslatorId();\n\n\tif (!activeTranslatorId) {\n\t\treturn;\n\t}\n\n\tsendContextToGenerator(activeTranslatorId, id);\n\tupdateContextFromStorage(id);\n\trequestConversationWithSkillFromStorage(id);\n\tsendSystemMessageFromStorage(id);\n};\n\n/**\n * Sends intent feedback to the generator.\n *\n * @param {string} translatorId - The id of the translator that sent the intent feedback.\n * @param {*} intentPayload - The original intent.\n * @param {*} status - Status of the response.\n * @param {*} message - Response message.\n * @param {GeneratorObject} generator - The generator to send the intent feedback to.\n */\nexport const sendIntentFeedback = (\n\ttranslatorId,\n\tintentPayload,\n\tstatus,\n\tmessage,\n\tgenerator\n) => {\n\tgenerator = generator ?? getDefaultGenerator();\n\n\tgeneratorChain.processSendIntentFeedback(\n\t\ttranslatorId,\n\t\tgenerator,\n\t\tintentPayload,\n\t\tstatus,\n\t\tmessage\n\t);\n};\n","/**\n * @file translatorService.js\n * @description Translator-side service responsible for routing messages to the translator chain.\n */\n\nimport {\n\tgetTranslatorById,\n\tgetTranslators,\n\tregisterTranslatorById,\n\tdeleteTranslatorById\n} from './translatorRegistry';\n\nimport {\n\tgetCurrentActiveTranslatorId,\n\tsetCurrentActiveTranslatorId,\n\tclearActiveTranslatorId\n} from '../sessionStorage/activeTranslatorService';\n\nimport {\n\tsendContextToGenerator,\n\tsendSystemMessage\n} from '../generator/generatorService';\nimport {\n\tgetGeneratorById,\n\tgetDefaultGenerator\n} from '../generator/generatorRegistry';\nimport {translatorChain} from './translatorChain';\nimport {intentActions, targetTypes, systemMessageTypes} from '../constants';\nimport {\n\tunsubscribeFromAllTopics,\n\tsubscribeToTopics\n} from '../pubsub/pubsubService';\n\nconst {INTENT_RECEIVED} = intentActions;\n\n// Map to hold context updates that arrive before translator registration\n// This handles the race condition where UPDATE_CONTEXT is dispatched from\n// getTranslatorBehavior before COMPONENT_CONNECTED occurs\n// NOTE: If similar race conditions emerge with other operations in the future,\n// consider generalizing this pattern with operation types.\nconst pendingContextUpdates = new Map();\n\n/**\n * @public\n *\n * Sends an intent to a specific translator via the messaging chain.\n *\n * @param {string} translatorId - The id of the translator to send to.\n * @param {*} intentPayload - The intent object to send.\n * @param {string} originatingGeneratorId - The ID of the generator sending the intent.\n */\nexport const sendIntent = (\n\ttranslatorId,\n\tintentPayload,\n\toriginatingGeneratorId\n) => {\n\tconst generatorForFeedback = originatingGeneratorId\n\t\t? getGeneratorById(originatingGeneratorId)\n\t\t: getDefaultGenerator();\n\n\tif (!generatorForFeedback) {\n\t\tconsole.warn(\n\t\t\t'No originating generator ID provided to sendIntent(), and no default generator found.'\n\t\t);\n\t\treturn;\n\t}\n\n\ttranslatorChain.processSendIntent(\n\t\ttranslatorId,\n\t\tintentPayload,\n\t\tgetCurrentActiveTranslatorId(),\n\t\tgeneratorForFeedback\n\t);\n};\n\n/**\n * @public\n *\n * Sends an intent to a translator whose context ID matches the one provided in the payload.\n *\n * @param {SendIntentByContextPayload} payload\n */\nexport const sendIntentByTranslatorContextId = (payload) => {\n\tif (!payload?.translatorContextId) {\n\t\tconsole.error(\n\t\t\t'translatorContextId is required to send intent to a translator.'\n\t\t);\n\t\treturn;\n\t}\n\n\t// TODO - Move this into the translatorChain & update the handlers. It needs to support iframes!\n\n\tconst translators = getTranslators();\n\tfor (const translator in translators) {\n\t\tif (\n\t\t\ttranslators[translator]?.translatorContextId ===\n\t\t\tpayload.translatorContextId\n\t\t) {\n\t\t\ttranslators[translator].dispatch(INTENT_RECEIVED, {\n\t\t\t\tintent: payload.intent\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t}\n};\n\n/**\n * @public\n *\n * Updates the context for the given translator and notifies a generator.\n * If the translator doesn't exist yet, queues the context update until registration.\n *\n * @param {string} translatorId\n * @param {TranslatorContext} context\n * @param {string} targetGeneratorId - The ID of the generator to send the context to.\n */\nexport const updateContext = (translatorId, context, targetGeneratorId) => {\n\tconst translator = getTranslatorById(translatorId);\n\n\tif (translator) {\n\t\ttranslator.context = context;\n\t\tsendContextToGenerator(translatorId, targetGeneratorId);\n\t} else {\n\t\t// Translator hasn't been registered yet. Queue the context update\n\t\t// to be applied when registerTranslator is called.\n\t\tpendingContextUpdates.set(translatorId, {\n\t\t\tcontext,\n\t\t\ttargetGeneratorId\n\t\t});\n\t}\n};\n\n/**\n * @public\n *\n * Removes the given translator and clears the active translator id if it was active.\n *\n * @param {string} translatorId\n */\nexport const removeTranslator = (translatorId) => {\n\tsendSystemMessage(translatorId, {\n\t\ttype: systemMessageTypes.TRANSLATOR_REMOVED\n\t});\n\tif (getCurrentActiveTranslatorId() === translatorId) {\n\t\tclearActiveTranslatorId();\n\t}\n\tdeleteTranslatorById(translatorId);\n\tunsubscribeFromAllTopics(translatorId, targetTypes.TRANSLATOR);\n\t// Clean up any pending context updates to prevent memory leaks\n\tpendingContextUpdates.delete(translatorId);\n};\n\n/**\n * @public\n *\n * Registers a translator in memory and optionally sets it as active.\n *\n * @param {string} translatorId - Unique id for the translator.\n * @param {Function} callback - Dispatch function to handle actions.\n * @param {TranslatorContext|null} context - Optional translator context.\n * @param {TranslatorRegistrationPayload} payload - Registration payload used to provide optional metadata.\n */\nexport const registerTranslator = (\n\ttranslatorId,\n\tcallback,\n\tcontext = null,\n\tpayload\n) => {\n\tif (window !== window.top) {\n\t\twindow.addEventListener('unload', () => {\n\t\t\tremoveTranslator(translatorId);\n\t\t});\n\t}\n\n\tconst value = payload?.options?.translatorContextId\n\t\t? {\n\t\t\t\tdispatch: callback,\n\t\t\t\ttranslatorContextId: payload.options.translatorContextId\n\t\t  }\n\t\t: {dispatch: callback};\n\n\tregisterTranslatorById(translatorId, value);\n\n\tif (!getCurrentActiveTranslatorId()) {\n\t\tsetCurrentActiveTranslatorId(translatorId);\n\t\tupdateContext(translatorId, context);\n\t}\n\n\t// Subscribe to topics if provided in payload options\n\tconst subscribedTopics = payload?.options?.subscribedTopics;\n\n\tif (subscribedTopics) {\n\t\tsubscribeToTopics(\n\t\t\ttranslatorId,\n\t\t\ttargetTypes.TRANSLATOR,\n\t\t\tsubscribedTopics,\n\t\t\tcallback\n\t\t);\n\t}\n\n\t// Check if there's a pending context update for this translator\n\tconst pendingContextUpdate = pendingContextUpdates.get(translatorId);\n\tconst translator = getTranslatorById(translatorId);\n\n\tif (pendingContextUpdate && translator) {\n\t\ttranslator.context = pendingContextUpdate.context;\n\t\tsendContextToGenerator(\n\t\t\ttranslatorId,\n\t\t\tpendingContextUpdate.targetGeneratorId\n\t\t);\n\t\tpendingContextUpdates.delete(translatorId);\n\t}\n};\n","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"actionTypes\"]: () => {\n\t\t\t\t\tconst cjsModule = __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__.default && __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__.__esModule\n\t\t\t\t\tif (cjsModule && 'actionTypes' === 'default') {\n\t\t\t\t\t\treturn __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"] && __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"][\"default\"] ? __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"][\"default\"] : __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"];\n\t\t\t\t\t} else if (cjsModule)  {\n\t\t\t\t\t\treturn __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"].actionTypes;\n\t\t\t\t\t} else if ('actionTypes' === 'default') {\n\t\t\t\t\t\treturn __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"] ? (__WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"][\"default\"] ? __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"][\"default\"] : __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"]) : __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__;\n\t\t\t\t\t}\n\t\t\t\t\treturn __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__.actionTypes || __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"] && __WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__[\"default\"].actionTypes;\n\t\t\t\t} });","import {\n\tsubscribeToTopic,\n\tunsubscribeFromTopic,\n\tbroadcastTopic\n} from './pubsubService';\n\nimport {intentActions} from '../constants';\n\nconst {SUBSCRIBE_TO_TOPIC, UNSUBSCRIBE_FROM_TOPIC, BROADCAST_TOPIC_REQUESTED} =\n\tintentActions;\n\nexport const getPubsubActionHandlers = (targetType) => {\n\tif (!targetType) {\n\t\tthrow new Error('Target type is required for pubsub action handlers');\n\t}\n\tif (targetType !== 'generator' && targetType !== 'translator') {\n\t\tthrow new Error(\n\t\t\t'Invalid target type. Must be \"generator\" or \"translator\".'\n\t\t);\n\t}\n\n\treturn {\n\t\t[SUBSCRIBE_TO_TOPIC]: {\n\t\t\teffect({host, action, dispatch}) {\n\t\t\t\tconst {nowId} = host;\n\n\t\t\t\tif (!action.payload?.topic) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Missing 'topic' in ${SUBSCRIBE_TO_TOPIC} action payload. nowId: ${nowId}`\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsubscribeToTopic(nowId, targetType, action.payload.topic, dispatch);\n\t\t\t}\n\t\t},\n\n\t\t[UNSUBSCRIBE_FROM_TOPIC]: {\n\t\t\teffect({host, action}) {\n\t\t\t\tconst {nowId} = host;\n\n\t\t\t\tif (!action.payload?.topic) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Missing 'topic' in ${UNSUBSCRIBE_FROM_TOPIC} action payload. nowId: ${nowId}`\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tunsubscribeFromTopic(nowId, targetType, action.payload.topic);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Broadcasts a topic to all targets of a given type.\n\t\t * @param {{ action: { payload: { targetType: string, topic: string, data: any }}}} context\n\t\t */\n\t\t[BROADCAST_TOPIC_REQUESTED]: {\n\t\t\teffect({host, action}) {\n\t\t\t\tconst {nowId} = host;\n\n\t\t\t\tif (!action.payload?.topic) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Missing 'topic' in ${BROADCAST_TOPIC_REQUESTED} action payload. nowId: ${nowId}`\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!action.payload?.targetType) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t`Missing 'targetType' in ${BROADCAST_TOPIC_REQUESTED} action payload. nowId: ${nowId}`\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tbroadcastTopic(\n\t\t\t\t\t\taction.payload.targetType,\n\t\t\t\t\t\taction.payload.topic,\n\t\t\t\t\t\taction.payload?.data\n\t\t\t\t\t);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error(`Error broadcasting topic. nowId: ${nowId}`, error);\n\t\t\t\t}\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t}\n\t};\n};\n","/**\n * @file intent-generator-behavior.js\n * @description Behavior module for generator components. Handles generator registration\n * and sending intents.\n */\n\nimport {registerGenerator, removeGenerator} from './generatorService';\nimport {\n\tsendIntent,\n\tsendIntentByTranslatorContextId\n} from '../translator/translatorService';\nimport {actionTypes} from '@servicenow/ui-core';\nimport {intentActions, targetTypes} from '../constants';\nimport {getPubsubActionHandlers} from '../pubsub/getPubsubActionHandlers';\n\nconst {COMPONENT_CONNECTED, COMPONENT_DISCONNECTED} = actionTypes;\n\nconst {SEND_INTENT, SEND_INTENT_BY_TRANSLATOR_CONTEXT_ID} = intentActions;\n\n/**\n * @public\n *\n * Behavior definition for generator components.\n * Handles lifecycle registration and sending intents.\n *\n * @type {Object}\n */\nexport const intentGeneratorBehavior = {\n\tname: 'intentGenerator',\n\n\tactionHandlers: {\n\t\t...getPubsubActionHandlers(targetTypes.GENERATOR),\n\n\t\t/**\n\t\t * Registers the generator when the component is connected.\n\t\t *\n\t\t * @param {{ host: { nowId: string }, dispatch: Function }} context\n\t\t */\n\t\t[COMPONENT_CONNECTED]({host, action, dispatch}) {\n\t\t\tconst {nowId} = host;\n\n\t\t\tregisterGenerator(nowId, dispatch, action.payload);\n\t\t},\n\n\t\t/**\n\t\t * Removes the generator when the component is disconnected.\n\t\t */\n\t\t[COMPONENT_DISCONNECTED]({host}) {\n\t\t\tconst {nowId} = host;\n\n\t\t\tremoveGenerator(nowId);\n\t\t},\n\n\t\t/**\n\t\t * Forwards a SEND_INTENT action to the translator service.\n\t\t *\n\t\t * @param {{ action: { payload: { translatorId: string, intent: * } } }} context\n\t\t */\n\t\t[SEND_INTENT]: {\n\t\t\teffect({host, action}) {\n\t\t\t\tconst {nowId} = host;\n\n\t\t\t\tif (!action.payload?.translatorId) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`IntentGeneratorBehavior: ${SEND_INTENT} action is missing translatorId.`\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!action.payload?.intent) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`IntentGeneratorBehavior: ${SEND_INTENT} action is missing intent.`\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsendIntent(action.payload?.translatorId, action.payload?.intent, nowId);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Forwards an intent to the appropriate translator using contextId routing.\n\t\t *\n\t\t * @param {{ action: { payload: SendIntentByContextPayload } }} context\n\t\t */\n\t\t[SEND_INTENT_BY_TRANSLATOR_CONTEXT_ID]: {\n\t\t\teffect({action}) {\n\t\t\t\tsendIntentByTranslatorContextId(action.payload);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t}\n\t}\n};\n","/**\n * @file mediatorService.js\n * @description Service for managing the mediator registry and active translator routing logic.\n */\n\nimport {getTranslatorById} from '../translator/translatorRegistry';\nimport {sendContextToGenerator} from '../generator/generatorService';\nimport {\n\tsetCurrentActiveTranslatorId,\n\tunsetCurrentActiveTranslatorId,\n\tgetCurrentActiveTranslatorId\n} from '../sessionStorage/activeTranslatorService';\nimport {MediatorRegistry} from './registry';\n\n/**\n * @public\n *\n * Registers a new mediator handler using the given id.\n *\n * @param {string} id - The identifier for the mediator.\n * @param {Function} handler - Function responsible for handling routed actions.\n * @throws {Error} If a mediator is already registered or arguments are invalid.\n */\nexport const registerMediator = (id, handler) => {\n\tMediatorRegistry.getInstance().setMediator(id, handler);\n};\n\n/**\n * @public\n *\n * Unregisters an existing mediator by its id.\n *\n * @param {string} id - The identifier of the mediator to remove.\n * @throws {Error} If no matching mediator is registered.\n */\nexport const removeMediator = (id) => {\n\tMediatorRegistry.getInstance().unsetMediator(id);\n};\n\n/**\n * @public\n *\n * Sets the provided translator as the active translator for the current session.\n * Also forwards the associated context to the generator.\n *\n * @param {string} translatorId - Translator to activate.\n */\nexport const setActiveTranslator = (translatorId) => {\n\tif (\n\t\tgetTranslatorById(translatorId) &&\n\t\tgetCurrentActiveTranslatorId() !== translatorId\n\t) {\n\t\tsetCurrentActiveTranslatorId(translatorId);\n\t\tsendContextToGenerator(translatorId);\n\t}\n};\n\n/**\n * @public\n *\n * Unsets the currently active translator if the id matches.\n * Clears and forwards an empty context to the generator.\n *\n * @param {string} translatorId - Translator to deactivate.\n */\nexport const unsetActiveTranslator = (translatorId) => {\n\tif (getTranslatorById(translatorId)) {\n\t\tif (unsetCurrentActiveTranslatorId(translatorId)) {\n\t\t\tsendContextToGenerator('');\n\t\t}\n\t}\n};\n","/**\n * @file intent-mediator-behavior.js\n * @description Behavior for managing active translator context within the mediator.\n */\nimport {setActiveTranslator, unsetActiveTranslator} from '../mediatorService';\nimport {intentActions} from '../../constants';\n\nconst {SET_ACTIVE_CONTEXT, UNSET_ACTIVE_CONTEXT} = intentActions;\n\n/**\n * @public\n *\n * UI Core behavior for intent mediator components.\n * Provides handlers for setting/unsetting the active translator context.\n */\nexport const intentMediatorBehavior = {\n\tname: 'intentMediator',\n\n\t/**\n\t * @type {ActionHandlers}\n\t */\n\tactionHandlers: {\n\t\t/**\n\t\t * Sets the given translator as the active one.\n\t\t * @param {ActiveContextActionPayload} param0\n\t\t */\n\t\t[SET_ACTIVE_CONTEXT]: {\n\t\t\teffect({action}) {\n\t\t\t\tsetActiveTranslator(action.payload.translatorId);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Unsets the active translator if the translator id matches.\n\t\t * @param {ActiveContextActionPayload} param0\n\t\t */\n\t\t[UNSET_ACTIVE_CONTEXT]: {\n\t\t\teffect({action}) {\n\t\t\t\tunsetActiveTranslator(action.payload.translatorId);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t}\n\t}\n};\n","/**\n * @file intent-routing-mediator-behavior.js\n * @description Behavior that registers and unregisters mediator handlers\n * for routing intents based on component lifecycle and dispatched actions.\n */\n\nimport {actionTypes} from '@servicenow/ui-core';\nconst {COMPONENT_DISCONNECTED} = actionTypes;\n\nimport {registerMediator, removeMediator} from '../mediatorService';\n\n/**\n * Action type dispatched to register a mediator handler.\n * @type {string}\n */\nexport const REGISTER_MEDIATOR = 'REGISTER_MEDIATOR';\n\n/**\n * Action type dispatched to unregister a mediator handler.\n * @type {string}\n */\nexport const UNREGISTER_MEDIATOR = 'UNREGISTER_MEDIATOR';\n\n/**\n * @public\n *\n * A behavior that handles intent mediator registration and lifecycle cleanup.\n * @type {object}\n */\nexport const intentRoutingMediatorBehavior = {\n\tname: 'intentRoutingMediatorBehavior',\n\n\t/**\n\t * Action handlers for registering and removing mediators.\n\t */\n\tactionHandlers: {\n\t\t/**\n\t\t * Registers a mediator handler for the given component.\n\t\t * Expects an action payload containing `{ mediatorHandler }`.\n\t\t */\n\t\t[REGISTER_MEDIATOR]: {\n\t\t\teffect({host, action}) {\n\t\t\t\tconst {mediatorHandler} = action.payload;\n\t\t\t\tif (!mediatorHandler) {\n\t\t\t\t\tthrow new Error('Mediator handler is required');\n\t\t\t\t}\n\t\t\t\tregisterMediator(host.nowId, mediatorHandler);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Unregisters the mediator for the given component.\n\t\t */\n\t\t[UNREGISTER_MEDIATOR]: {\n\t\t\teffect({host}) {\n\t\t\t\tremoveMediator(host.nowId);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Automatically unregisters the mediator when the component is disconnected.\n\t\t */\n\t\t[COMPONENT_DISCONNECTED]: {\n\t\t\teffect({host}) {\n\t\t\t\ttry {\n\t\t\t\t\tremoveMediator(host.nowId);\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// Swallowing the exception to avoid disrupting disconnection flow\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n","/**\n * @file translatorBehavior.js\n * @description Behavior module for translator components. Handles translator registration,\n * context updates, intent feedback, skill-based conversations, and system message forwarding.\n */\n\nimport {\n\tupdateContext,\n\tregisterTranslator,\n\tremoveTranslator\n} from './translatorService';\n\nimport {\n\tsendIntentFeedback,\n\tsendSystemMessage,\n\trequestConversationWithSkill\n} from '../generator/generatorService';\n\nimport {actionTypes} from '@servicenow/ui-core';\nimport {intentActions, targetTypes} from '../constants';\n\nimport {getPubsubActionHandlers} from '../pubsub/getPubsubActionHandlers';\n\nconst {COMPONENT_CONNECTED, COMPONENT_DISCONNECTED} = actionTypes;\nconst {\n\tUPDATE_CONTEXT,\n\tREGISTER_TRANSLATOR,\n\tREMOVE_TRANSLATOR,\n\tSEND_INTENT_FEEDBACK,\n\tCREATE_CONVERSATION_WITH_SKILL,\n\tSEND_SYSTEM_MESSAGE\n} = intentActions;\n\n/**\n * @public\n *\n * Behavior definition that enables a component to act as an intent translator.\n * Handles lifecycle registration, context updates, intent feedback, system messages,\n * and requests to initiate skill-based conversations.\n */\nexport const intentTranslatorBehavior = {\n\tname: 'intentTranslator',\n\n\tactionHandlers: {\n\t\t...getPubsubActionHandlers(targetTypes.TRANSLATOR),\n\n\t\t/**\n\t\t * Automatically registers the translator when the component is connected.\n\t\t * Skips registration if `disableAutomaticallyRegistering` is true in the options.\n\t\t *\n\t\t * @param {{ host: any, dispatch: Function, action: { payload: { options: { disableAutomaticallyRegistering: boolean } } } }} context\n\t\t */\n\t\t[COMPONENT_CONNECTED]({host, dispatch, action}) {\n\t\t\tif (action.payload.options?.disableAutomaticallyRegistering) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tregisterTranslator(host.nowId, dispatch, null, action.payload);\n\t\t},\n\n\t\t/**\n\t\t * Automatically removes the translator when the component disconnects.\n\t\t *\n\t\t * @param {{ host: any }} context\n\t\t */\n\t\t[COMPONENT_DISCONNECTED]({host}) {\n\t\t\tconst {nowId} = host;\n\n\t\t\tremoveTranslator(nowId);\n\t\t},\n\n\t\t/**\n\t\t * Updates the context associated with the current translator.\n\t\t *\n\t\t * @param {{ host: any, action: { payload: { context: any } } }} context\n\t\t */\n\t\t[UPDATE_CONTEXT]: {\n\t\t\teffect({host, action}) {\n\t\t\t\tconst {nowId} = host;\n\t\t\t\tconst {payload} = action;\n\n\t\t\t\tupdateContext(nowId, payload.context, payload.targetGeneratorId);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Manually registers the translator with optional context and configuration payload.\n\t\t *\n\t\t * @param {{ host: any, dispatch: Function, action: { payload: any } }} context\n\t\t */\n\t\t[REGISTER_TRANSLATOR]: {\n\t\t\teffect({host, dispatch, action}) {\n\t\t\t\tregisterTranslator(\n\t\t\t\t\thost.nowId,\n\t\t\t\t\tdispatch,\n\t\t\t\t\taction.payload.context,\n\t\t\t\t\taction.payload\n\t\t\t\t);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Unregisters the translator from the system.\n\t\t *\n\t\t * @param {{ host: any }} context\n\t\t */\n\t\t[REMOVE_TRANSLATOR]: {\n\t\t\teffect({host}) {\n\t\t\t\tremoveTranslator(host.nowId);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Sends intent feedback (status, message, originalIntent) from the translator to the generator.\n\t\t *\n\t\t * @param {{ host: any, action: { payload: { originalIntent: any, status: any, message: any } } }} context\n\t\t */\n\t\t[SEND_INTENT_FEEDBACK]: {\n\t\t\teffect({host, action}) {\n\t\t\t\tconst {payload, meta} = action;\n\t\t\t\tconst {originalIntent, status, message} = payload;\n\n\t\t\t\tsendIntentFeedback(\n\t\t\t\t\thost.nowId,\n\t\t\t\t\toriginalIntent,\n\t\t\t\t\tstatus,\n\t\t\t\t\tmessage,\n\t\t\t\t\tmeta.generatorForFeedback\n\t\t\t\t);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Initiates a conversation with a specific skill on behalf of the translator.\n\t\t *\n\t\t * @param {{ host: any, action: { payload: { skillId: string, params: Object } } }} context\n\t\t */\n\t\t[CREATE_CONVERSATION_WITH_SKILL]: {\n\t\t\teffect({host, action}) {\n\t\t\t\trequestConversationWithSkill(\n\t\t\t\t\thost.nowId,\n\t\t\t\t\taction.payload.skillId,\n\t\t\t\t\taction.payload.params\n\t\t\t\t);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t},\n\n\t\t/**\n\t\t * Sends a system message from the translator to the generator.\n\t\t *\n\t\t * @param {{ host: any, action: { payload: { message: any } } }} context\n\t\t */\n\t\t[SEND_SYSTEM_MESSAGE]: {\n\t\t\teffect({host, action}) {\n\t\t\t\tsendSystemMessage(host.nowId, action.payload.message);\n\t\t\t},\n\t\t\tstopPropagation: true\n\t\t}\n\t}\n};\n","/**\n * @file getNowAssistApiWrapper.js\n * @description Exposes runtime-safe APIs for Now Assist interactions scoped to the current translator component.\n */\n\nimport {requestConversationWithSkill} from '../generator/generatorService';\n\n/**\n * Creates a proxy-based API wrapper for Now Assist functionality.\n * Currently supports:\n *   - `requestConversationWithSkill(skillId, params)`\n *\n * This wrapper ensures the `translatorId` (nowId) is bound automatically based on the hosting macroponent.\n *\n * @param {{ nowId: string }} macroponentProperties - The macroponent properties object (e.g., host).\n * @returns {object} A proxy object exposing supported Now Assist APIs.\n *\n * @example\n * const nowAssistApi = getNowAssistApiWrapper({ nowId: 'translator1' });\n * nowAssistApi.requestConversationWithSkill('mySkillId', { topic: 'Reset password' });\n */\nexport const getNowAssistApiWrapper = (macroponentProperties) =>\n\tnew Proxy(\n\t\t{},\n\t\t{\n\t\t\tget(_, apiName) {\n\t\t\t\tif (apiName === 'requestConversationWithSkill') {\n\t\t\t\t\treturn (...fnArguments) => {\n\t\t\t\t\t\tconst {nowId} = macroponentProperties;\n\t\t\t\t\t\tif (!nowId) throw new Error(`Unable to find translator id`);\n\t\t\t\t\t\trequestConversationWithSkill.apply(null, [nowId, ...fnArguments]);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n","/**\n * @file getIntentChannelClientScriptApi.js\n * @description Exposes the public client script API for the intent channel, used in macroponents.\n */\n\nimport {getNowAssistApiWrapper} from './getNowAssistApiWrapper';\n\n/**\n * @public\n *\n * The name of the intent channel package.\n * @type {string}\n */\nexport const LIBRARY_INTENT_CHANNEL_PACKAGE_NAME = 'sn_uxf.uiIntentLib';\n\n/**\n * @public\n *\n * Returns a function that exposes the public client script API for intent-related capabilities.\n *\n * @param {object} macroponentProperties - The properties passed to the macroponent.\n * @returns {function(): { nowAssist: object }} A factory function that returns the client script API.\n */\nexport function getIntentChannelClientScriptApi(macroponentProperties) {\n\treturn () => ({\n\t\tnowAssist: getNowAssistApiWrapper(macroponentProperties)\n\t});\n}\n"],"names":["_extends","module","exports","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","__esModule","apply","includes","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","d","a","definition","key","o","defineProperty","enumerable","get","obj","prop","prototype","GLOBAL_KEY","intentLibraryGlobals","_window$top","window","top","_window","globals","useCrossOriginSafePath","GENERATOR_MAP","getDefaultGenerator","generators","values","find","generator","isDefault","console","warn","getGeneratorById","id","intentActions","INTENT_RECEIVED","UPDATE_CONTEXT","CONTEXT_RECEIVED","REGISTER_TRANSLATOR","REMOVE_TRANSLATOR","SEND_INTENT","SEND_INTENT_BY_TRANSLATOR_CONTEXT_ID","SET_ACTIVE_CONTEXT","UNSET_ACTIVE_CONTEXT","SEND_INTENT_FEEDBACK","CREATE_CONVERSATION_WITH_SKILL","SEND_SYSTEM_MESSAGE","INTENT_FEEDBACK_RECEIVED","CONVERSATION_WITH_SKILL_REQUESTED","SYSTEM_MESSAGE_RECEIVED","BROADCAST_TOPIC_REQUESTED","BROADCAST_TOPIC_RECEIVED","SUBSCRIBE_TO_TOPIC","UNSUBSCRIBE_FROM_TOPIC","systemMessageTypes","intentLocalStorageKeys","TranslatorMessageType","GeneratorMessageType","generatorVersions","LEGACY","V2","targetTypes","TRANSLATOR","GENERATOR","WindowKey","RegistryKey","_instance","_registry","WeakMap","MediatorRegistry","constructor","_classPrivateFieldInitSpec","getInstance","registryWindow","win","topWin","self","getRegistryWindow","_WindowKey$mediatorRe","mediatorKey","_classPrivateFieldGet","this","mediatorHandler","hasMediator","setMediator","handler","Error","name","unsetMediator","invoke","action","args","_this$mediatorHandler","process","MediatorResult","isContinue","result","isTerminate","handlerAction","continue","meta","terminate","MessageProcessorResult","createMessageProcessor","processorHandlers","type","payload","handlerMeta","processorHandler","typeHandler","createMessageTypeMediatorHandler","routingMediatorHandler","canHandle","localHandler","translatorId","context","activeTranslatorId","applyActiveTranslatorCheck","dispatch","message","originalIntent","status","skillId","params","sessionStorageHandler","fromSessionStorage","sessionStorage","setItem","JSON","stringify","appendToSessionStorage","TRANSLATOR_MAP","getTranslatorById","getTranslators","createGeneratorChain","translators","processMessage","processSendContext","_ref","_translators$translat","messageContext","allContextGenerators","filter","receiveAllContexts","forEach","allContextGenerator","processSendSystemMessage","processSendIntentFeedback","processRequestConversationWithSkill","generatorChain","intentPayload","generatorForFeedback","intent","processSendIntent","createTranslatorChain","translatorChain","getCurrentActiveTranslatorId","getItem","clearActiveTranslatorId","removeItem","setCurrentActiveTranslatorId","sendDataFromStorage","storageKey","generatorId","jsonString","parse","Array","isArray","value","_objectWithoutPropertiesLoose","_excluded","sessionMeta","updateContextFromStorage","sendSystemMessageFromStorage","requestConversationWithSkillFromStorage","prevValue","push","handleStorageEvent","startsWith","replace","sendIntentFromStorage","originatingGeneratorId","initializeIntentLibrary","addEventListener","Map","translator","topicSubscribers","subscribeToTopic","nowId","targetType","topic","error","targetMap","has","set","subscribeToTopics","topics","unsubscribeFromTopic","topicMap","delete","size","unsubscribeFromAllTopics","entries","broadcastTopic","data","targets","sendSystemMessage","requestConversationWithSkill","removeGenerator","deleteGeneratorById","sendContextToGenerator","registerGenerator","_payload$options","_payload$options2","_payload$options3","options","generatorVersion","registerGeneratorById","currentDefaultGenerator","defaultGeneratorId","registerDefaultGenerator","subscribedTopics","pendingContextUpdates","sendIntent","sendIntentByTranslatorContextId","translatorContextId","updateContext","targetGeneratorId","removeTranslator","registerTranslator","callback","registerTranslatorById","pendingContextUpdate","y","x","cjsModule","__WEBPACK_EXTERNAL_MODULE__uxasset_externals_servicenow_ui_core_index_jsdbx_65e0859f__","default","actionTypes","getPubsubActionHandlers","effect","_action$payload","host","_ref2","_action$payload2","_ref3","_action$payload3","_action$payload4","_action$payload5","stopPropagation","COMPONENT_CONNECTED","COMPONENT_DISCONNECTED","intentGeneratorBehavior","actionHandlers","_ref4","registerMediator","removeMediator","setActiveTranslator","unsetActiveTranslator","unsetCurrentActiveTranslatorId","intentMediatorBehavior","REGISTER_MEDIATOR","UNREGISTER_MEDIATOR","intentRoutingMediatorBehavior","intentTranslatorBehavior","_action$payload$optio","disableAutomaticallyRegistering","_ref5","_ref6","sendIntentFeedback","_generator","_ref7","_ref8","getNowAssistApiWrapper","macroponentProperties","Proxy","_","apiName","_len","fnArguments","_key","LIBRARY_INTENT_CHANNEL_PACKAGE_NAME","getIntentChannelClientScriptApi","nowAssist"]}