@carbon/ai-chat 0.1.1-alpha5 → 0.1.1-react17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.js +933 -55468
- package/dist/Carousel.js +1 -5705
- package/dist/Chat.js +1 -8339
- package/dist/GenesysMessengerServiceDesk.js +1 -579
- package/dist/HumanAgentServiceImpl.js +1 -1122
- package/dist/NiceDFOServiceDesk.js +2 -2097
- package/dist/PDFViewerContainer.js +2 -27439
- package/dist/SFServiceDesk.js +1 -1012
- package/dist/ServiceDeskImpl.js +1 -72
- package/dist/ZendeskServiceDesk.js +1 -649
- package/dist/_commonjsHelpers.js +1 -33
- package/dist/_node-resolve_empty.js +1 -25
- package/dist/agentActions.js +1 -187
- package/dist/aiChatEntry.js +1 -28
- package/dist/aiChatEntry2.js +4 -7022
- package/dist/anonymousUserIDStorage.js +2 -250
- package/dist/ar-dz.js +1 -55
- package/dist/ar-kw.js +1 -55
- package/dist/ar-ly.js +1 -55
- package/dist/ar-ma.js +1 -55
- package/dist/ar-sa.js +1 -55
- package/dist/ar-tn.js +1 -55
- package/dist/ar.js +1 -55
- package/dist/ar2.js +1 -470
- package/dist/cs.js +1 -55
- package/dist/cs2.js +1 -470
- package/dist/de-at.js +1 -55
- package/dist/de-ch.js +1 -55
- package/dist/de.js +1 -55
- package/dist/de2.js +1 -470
- package/dist/domUtils.js +2 -820
- package/dist/en-au.js +1 -55
- package/dist/en-ca.js +1 -55
- package/dist/en-gb.js +1 -55
- package/dist/en-ie.js +1 -55
- package/dist/en-il.js +1 -55
- package/dist/en-nz.js +1 -55
- package/dist/es-do.js +1 -55
- package/dist/es-us.js +1 -55
- package/dist/es.js +1 -55
- package/dist/es2.js +1 -470
- package/dist/export.js +1 -25
- package/dist/export.legacy.js +1 -25
- package/dist/fontUtils.js +1 -1036
- package/dist/fr-ca.js +1 -55
- package/dist/fr-ch.js +1 -55
- package/dist/fr.js +1 -55
- package/dist/fr2.js +1 -470
- package/dist/humanAgentUtils.js +1 -1393
- package/dist/it-ch.js +1 -55
- package/dist/it.js +1 -55
- package/dist/it2.js +1 -470
- package/dist/ja.js +1 -55
- package/dist/ja2.js +1 -470
- package/dist/jstz.min.js +1 -41
- package/dist/ko.js +1 -55
- package/dist/ko2.js +1 -470
- package/dist/messageUtils.js +1 -1338
- package/dist/mockServiceDesk.js +1 -851
- package/dist/moduleFederationPluginUtils.js +2 -5852
- package/dist/nl.js +1 -55
- package/dist/nl2.js +1 -470
- package/dist/pt-br.js +1 -55
- package/dist/pt-br2.js +1 -470
- package/dist/pt.js +1 -55
- package/dist/render.js +1 -88
- package/dist/web-components/cds-aichat-container/index.js +3 -3
- package/dist/web-components/cds-aichat-container/index.js.map +1 -1
- package/dist/web-components/cds-aichat-custom-element/index.js +2 -2
- package/dist/web-components/cds-aichat-custom-element/index.js.map +1 -1
- package/dist/zh-cn.js +1 -55
- package/dist/zh-tw.js +1 -55
- package/dist/zh-tw2.js +1 -470
- package/dist/zh.js +1 -470
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/tslib/tslib.es6.js","../../../../../../../../../../internal-packages/types/apiTypes.ts","../../../../../../../../../../internal-packages/types/PublicConfig.ts","../../../../../../../../../../internal-packages/shared/types/AppState.ts","../../../../../../../../../../internal-packages/types/ChatInstance.ts","../../../../../../../../../../internal-packages/shared/utils/constants.ts","../../../../../../../../../../internal-packages/shared/utils/lang/promiseUtils.ts","../../../../../../../../../../internal-packages/shared/utils/miscUtils.ts","../../../../../node_modules/http-status-codes/build/es/status-codes.js","../../../../../../../../../../internal-packages/orchestrate/types/orchestratePublicConfig.ts","../../../../../../../../../../internal-packages/shared/types/IBMConfig.ts","../../../../../node_modules/lodash-es/eq.js","../../../../../node_modules/lodash-es/_assocIndexOf.js","../../../../../node_modules/lodash-es/_listCacheDelete.js","../../../../../node_modules/lodash-es/_ListCache.js","../../../../../node_modules/lodash-es/_listCacheClear.js","../../../../../node_modules/lodash-es/_listCacheGet.js","../../../../../node_modules/lodash-es/_listCacheHas.js","../../../../../node_modules/lodash-es/_listCacheSet.js","../../../../../node_modules/lodash-es/_freeGlobal.js","../../../../../node_modules/lodash-es/_root.js","../../../../../node_modules/lodash-es/_Symbol.js","../../../../../node_modules/lodash-es/_getRawTag.js","../../../../../node_modules/lodash-es/_objectToString.js","../../../../../node_modules/lodash-es/_baseGetTag.js","../../../../../node_modules/lodash-es/isObject.js","../../../../../node_modules/lodash-es/isFunction.js","../../../../../node_modules/lodash-es/_coreJsData.js","../../../../../node_modules/lodash-es/_isMasked.js","../../../../../node_modules/lodash-es/_toSource.js","../../../../../node_modules/lodash-es/_baseIsNative.js","../../../../../node_modules/lodash-es/_getNative.js","../../../../../node_modules/lodash-es/_getValue.js","../../../../../node_modules/lodash-es/_Map.js","../../../../../node_modules/lodash-es/_nativeCreate.js","../../../../../node_modules/lodash-es/_hashGet.js","../../../../../node_modules/lodash-es/_hashHas.js","../../../../../node_modules/lodash-es/_Hash.js","../../../../../node_modules/lodash-es/_getMapData.js","../../../../../node_modules/lodash-es/_isKeyable.js","../../../../../node_modules/lodash-es/_MapCache.js","../../../../../node_modules/lodash-es/_hashClear.js","../../../../../node_modules/lodash-es/_hashDelete.js","../../../../../node_modules/lodash-es/_hashSet.js","../../../../../node_modules/lodash-es/_mapCacheClear.js","../../../../../node_modules/lodash-es/_mapCacheDelete.js","../../../../../node_modules/lodash-es/_mapCacheGet.js","../../../../../node_modules/lodash-es/_mapCacheHas.js","../../../../../node_modules/lodash-es/_mapCacheSet.js","../../../../../node_modules/lodash-es/_Stack.js","../../../../../node_modules/lodash-es/_stackClear.js","../../../../../node_modules/lodash-es/_stackDelete.js","../../../../../node_modules/lodash-es/_stackGet.js","../../../../../node_modules/lodash-es/_stackHas.js","../../../../../node_modules/lodash-es/_stackSet.js","../../../../../node_modules/lodash-es/_defineProperty.js","../../../../../node_modules/lodash-es/_baseAssignValue.js","../../../../../node_modules/lodash-es/_assignMergeValue.js","../../../../../node_modules/lodash-es/_baseFor.js","../../../../../node_modules/lodash-es/_createBaseFor.js","../../../../../node_modules/lodash-es/_cloneBuffer.js","../../../../../node_modules/lodash-es/_Uint8Array.js","../../../../../node_modules/lodash-es/_cloneArrayBuffer.js","../../../../../node_modules/lodash-es/_cloneTypedArray.js","../../../../../node_modules/lodash-es/_copyArray.js","../../../../../node_modules/lodash-es/_baseCreate.js","../../../../../node_modules/lodash-es/_overArg.js","../../../../../node_modules/lodash-es/_getPrototype.js","../../../../../node_modules/lodash-es/_isPrototype.js","../../../../../node_modules/lodash-es/_initCloneObject.js","../../../../../node_modules/lodash-es/isObjectLike.js","../../../../../node_modules/lodash-es/_baseIsArguments.js","../../../../../node_modules/lodash-es/isArguments.js","../../../../../node_modules/lodash-es/isArray.js","../../../../../node_modules/lodash-es/isLength.js","../../../../../node_modules/lodash-es/isArrayLike.js","../../../../../node_modules/lodash-es/isBuffer.js","../../../../../node_modules/lodash-es/stubFalse.js","../../../../../node_modules/lodash-es/isPlainObject.js","../../../../../node_modules/lodash-es/_baseIsTypedArray.js","../../../../../node_modules/lodash-es/_baseUnary.js","../../../../../node_modules/lodash-es/_nodeUtil.js","../../../../../node_modules/lodash-es/isTypedArray.js","../../../../../node_modules/lodash-es/_safeGet.js","../../../../../node_modules/lodash-es/_assignValue.js","../../../../../node_modules/lodash-es/_copyObject.js","../../../../../node_modules/lodash-es/_isIndex.js","../../../../../node_modules/lodash-es/_arrayLikeKeys.js","../../../../../node_modules/lodash-es/_baseTimes.js","../../../../../node_modules/lodash-es/_baseKeysIn.js","../../../../../node_modules/lodash-es/_nativeKeysIn.js","../../../../../node_modules/lodash-es/keysIn.js","../../../../../node_modules/lodash-es/_baseMergeDeep.js","../../../../../node_modules/lodash-es/isArrayLikeObject.js","../../../../../node_modules/lodash-es/toPlainObject.js","../../../../../node_modules/lodash-es/_baseMerge.js","../../../../../node_modules/lodash-es/identity.js","../../../../../node_modules/lodash-es/_overRest.js","../../../../../node_modules/lodash-es/_baseSetToString.js","../../../../../node_modules/lodash-es/constant.js","../../../../../node_modules/lodash-es/_shortOut.js","../../../../../node_modules/lodash-es/_setToString.js","../../../../../node_modules/lodash-es/_baseRest.js","../../../../../node_modules/lodash-es/_apply.js","../../../../../node_modules/lodash-es/_createAssigner.js","../../../../../node_modules/lodash-es/_isIterateeCall.js","../../../../../node_modules/lodash-es/merge.js","../../../../../internal-packages/shared/environmentVariables.js","../../../../../../../../../../internal-packages/shared/services/doWithRetry.ts","../../../../../../../../../../internal-packages/shared/utils/sharedConfigUtils.ts","../../../../../../../../../../internal-packages/shared/services/NamespaceService.ts","../../../../../../../../../../internal-packages/shared/types/carbonTypes.ts","../../../../../../../../../../internal-packages/shared/types/LauncherConfig.ts","../../../../../node_modules/lodash-es/_SetCache.js","../../../../../node_modules/lodash-es/_arraySome.js","../../../../../node_modules/lodash-es/_setCacheAdd.js","../../../../../node_modules/lodash-es/_setCacheHas.js","../../../../../node_modules/lodash-es/_equalArrays.js","../../../../../node_modules/lodash-es/_cacheHas.js","../../../../../node_modules/lodash-es/_mapToArray.js","../../../../../node_modules/lodash-es/_setToArray.js","../../../../../node_modules/lodash-es/_equalByTag.js","../../../../../node_modules/lodash-es/_arrayPush.js","../../../../../node_modules/lodash-es/_baseGetAllKeys.js","../../../../../node_modules/lodash-es/stubArray.js","../../../../../node_modules/lodash-es/_getSymbols.js","../../../../../node_modules/lodash-es/_arrayFilter.js","../../../../../node_modules/lodash-es/_nativeKeys.js","../../../../../node_modules/lodash-es/_baseKeys.js","../../../../../node_modules/lodash-es/keys.js","../../../../../node_modules/lodash-es/_getAllKeys.js","../../../../../node_modules/lodash-es/_equalObjects.js","../../../../../node_modules/lodash-es/_DataView.js","../../../../../node_modules/lodash-es/_Promise.js","../../../../../node_modules/lodash-es/_Set.js","../../../../../node_modules/lodash-es/_WeakMap.js","../../../../../node_modules/lodash-es/_getTag.js","../../../../../node_modules/lodash-es/_baseIsEqualDeep.js","../../../../../node_modules/lodash-es/_baseIsEqual.js","../../../../../node_modules/lodash-es/isEqual.js","../../../../../node_modules/lodash-es/mergeWith.js","../../../../../../../../../../internal-packages/shared/utils/customizers.ts","../../../../../../../../../../internal-packages/shared/utils/lang/objectUtils.ts","../../../../../../../../../../internal-packages/shared/utils/versionUtils.ts","../../../../../../../../../../internal-packages/shared/store/reducerUtils.ts","../../../../../../../../../../internal-packages/types/HomeScreenConfig.ts","../../../../../node_modules/lodash-es/isEmpty.js","../../../../../../../../../../internal-packages/shared/utils/homeScreenUtils.ts","../../../../../node_modules/jwt-decode/build/esm/index.js","../../../../../../../../../../internal-packages/shared/utils/identityUtils.ts","../../../../../node_modules/uuid/dist/esm-browser/rng.js","../../../../../node_modules/uuid/dist/esm-browser/stringify.js","../../../../../node_modules/uuid/dist/esm-browser/native.js","../../../../../../../../../../internal-packages/shared/utils/lang/UUIDType.ts","../../../../../node_modules/uuid/dist/esm-browser/v4.js","../../../../../../../../../../internal-packages/shared/utils/lang/uuid.ts","../../../../../../../../../../internal-packages/assistant/regions.ts","../../../../../../../../../../internal-packages/shared/utils/config.ts","../../../../../../../../../../internal-packages/shared/chatEntryImports.ts","../../../../../../../../../../internal-packages/shared/hooks/useOnMount.tsx","../../../../../node_modules/lodash-es/_getSymbolsIn.js","../../../../../node_modules/lodash-es/_getAllKeysIn.js","../../../../../node_modules/lodash-es/_initCloneArray.js","../../../../../node_modules/lodash-es/_cloneRegExp.js","../../../../../node_modules/lodash-es/_cloneSymbol.js","../../../../../node_modules/lodash-es/_initCloneByTag.js","../../../../../node_modules/lodash-es/_cloneDataView.js","../../../../../node_modules/lodash-es/isMap.js","../../../../../node_modules/lodash-es/_baseIsMap.js","../../../../../node_modules/lodash-es/isSet.js","../../../../../node_modules/lodash-es/_baseIsSet.js","../../../../../node_modules/lodash-es/_baseClone.js","../../../../../node_modules/lodash-es/_copySymbolsIn.js","../../../../../node_modules/lodash-es/_baseAssignIn.js","../../../../../node_modules/lodash-es/_copySymbols.js","../../../../../node_modules/lodash-es/_baseAssign.js","../../../../../node_modules/lodash-es/_arrayEach.js","../../../../../node_modules/lodash-es/cloneDeep.js","../../../../../../../../../../internal-packages/shared/chatEntryFunctions.ts","../../../../../../../../src/chat/utils/utils.ts","../../../../../../../../src/chat/react/components/UserDefinedResponsePortalsContainer.tsx","../../../../../../../../src/chat/react/components/AppContainer.tsx","../../../../../../../../src/chat/web-components/decorators/customElement.ts","../../../../../../../../src/chat/web-components/components/cds-aichat-internal.tsx","../../../../../../../../src/chat/web-components/components/cds-aichat-container-light.ts","../../../../../../../../../../submodules/wa-fd-types-public/wa-types-chat.ts","../../../../../../../../src/web-components/cds-aichat-container.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { TagType } from './carbonTypes';\n\n/**\n * Constants for the Carbon FileStatus type because they weren't kind enough to include their own enum.\n */\nexport enum FileStatusValue {\n COMPLETE = 'complete',\n EDIT = 'edit',\n UPLOADING = 'uploading',\n SUCCESS = 'success',\n}\n\n/**\n * An interface that represents a file to upload and it's current upload status.\n */\nexport interface FileUpload {\n /**\n * A unique ID for the file.\n */\n id: string;\n\n /**\n * The file to upload.\n */\n file: File;\n\n /**\n * The current upload status.\n */\n status: FileStatusValue;\n\n /**\n * Indicates if the file contains an error or failed to upload.\n */\n isError?: boolean;\n\n /**\n * If the file failed to upload, this is an optional error message to display.\n */\n errorMessage?: string;\n}\n\n/**\n * Whether a particular web chat view is visible or not.\n */\nexport interface ViewState {\n /**\n * Whether the launcher is visible or not.\n */\n launcher: boolean;\n\n /**\n * Whether the main window is visible or not.\n */\n mainWindow: boolean;\n\n /**\n * Whether a tour is visible or not.\n */\n tour: boolean;\n}\n\n/**\n * A record of a notification to be shown in the UI.\n */\nexport interface NotificationMessage {\n kind: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';\n\n /**\n * The title to show in the message.\n */\n title: string;\n\n /**\n * The message to show.\n */\n message: string;\n\n /**\n * An optional action button that a user can click. If there is an action button, we will not auto dismiss.\n */\n actionButtonLabel?: string;\n\n /**\n * The group id that associates notifications together. This can be used to remove the notification later.\n */\n groupID?: string;\n\n /**\n * The callback called when someone clicks on the action button.\n */\n onActionButtonClick?: () => void;\n\n /**\n * The callback called when someone clicks on the close button.\n */\n onCloseButtonClick?: () => void;\n}\n\nexport interface NotificationStateObject {\n /**\n * The id of the notification object in state to help identify notifications to manipulate.\n */\n id: string;\n\n /**\n * The provided notification message to render in chat.\n */\n notification: NotificationMessage;\n}\n\n/**\n * A language pack represent the set of display strings for a particular language.\n */\nexport interface LanguagePack {\n // TODO: Do we publish the actual keys?\n [key: string]: string;\n}\n\n/**\n * The different views that can be shown by web chat.\n */\nexport enum ViewType {\n /**\n * The launcher view is used to open the main window or tour.\n */\n LAUNCHER = 'launcher',\n\n /**\n * The main window view is used to ask WA questions and converse with an agent, as well as many other things. The\n * string value is kept camel case to align with the viewState mainWindow property, both of which are used by the\n * {@link ChatActions.changeView} function.\n */\n MAIN_WINDOW = 'mainWindow',\n\n /**\n * The tour view is used to guide the end user through a task.\n */\n TOUR = 'tour',\n}\n\n/**\n * The different variations of the launcher that can exist.\n */\nexport enum LauncherType {\n /**\n * The launcher that expands to a \"complex\" variation on desktop.\n */\n DESKTOP = 'desktop',\n\n /**\n * The launcher that expands to an \"extended\" variation on mobile.\n */\n MOBILE = 'mobile',\n}\n\n/**\n * This manager handles fetching an instance for manipulating the custom panel.\n */\nexport interface CustomPanels {\n /**\n * Gets a custom panel instance.\n */\n getPanel: () => CustomPanelInstance;\n}\n\n/**\n * The custom panel instance for controlling and manipulating a custom panel in web chat.\n */\nexport interface CustomPanelInstance {\n /**\n * The custom panel hostElement.\n */\n hostElement: HTMLDivElement;\n\n /**\n * Opens the custom panel.\n *\n * @param options Custom panel options.\n */\n open: (options?: CustomPanelConfigOptions) => void;\n\n /**\n * Closes the custom panel.\n */\n close: () => void;\n}\n\n/**\n * Describes general config options for a web chat panel. These options are also part of the\n * {@link BasePanelComponentProps}, except the options here are also shared with {@link CustomPanelConfigOptions}.\n *\n * Any options specific to either the BasePanelComponent or CustomPanelConfigOptions should be added to the respective\n * interface.\n */\nexport interface BasePanelConfigOptions {\n /**\n * The panel title which is left blank by default.\n */\n title?: string;\n\n /**\n * Indicates if the close button in the custom panel should be hidden.\n */\n hideCloseButton?: boolean;\n\n /**\n * Indicates if the close-and-restart (X) button in the custom panel should be hidden. This value only applies if\n * the close-and-restart button is enabled.\n */\n hideCloseAndRestartButton?: boolean;\n\n /**\n * Indicates if the panel header should be hidden.\n */\n hidePanelHeader?: boolean;\n\n /**\n * Indicates if the back button in the custom panel should be hidden.\n */\n hideBackButton?: boolean;\n\n /**\n * This callback is called when the close button is clicked. This is called even if {@link disableDefaultCloseAction}\n * is set to true.\n */\n onClickClose?: () => void;\n\n /**\n * This callback is called when the close-and-restart button is clicked. This is called even if {@link disableDefaultCloseAction}\n * is set to true.\n */\n onClickCloseAndRestart?: () => void;\n\n /**\n * Called when the restart button is clicked.\n */\n onClickRestart?: () => void;\n\n /**\n * This callback is called when the back button is clicked.\n */\n onClickBack?: () => void;\n}\n\n/**\n * Options that change how the custom panel looks.\n */\nexport interface CustomPanelConfigOptions extends BasePanelConfigOptions {\n /**\n * Determines if the panel open/close animation should be turned off.\n */\n disableAnimation?: boolean;\n\n /**\n * Disables the default action that is taken when the close or close-and-restart buttons are clicked. The default\n * action closes web chat and disabling this will cause the button to not do anything. You can override the button\n * behavior by using the {@link onClickClose} or {@link onClickCloseAndRestart} callback.\n */\n disableDefaultCloseAction?: boolean;\n}\n\n/**\n * A single menu option.\n */\nexport interface CustomMenuOption {\n /**\n * The text to display for the menu option.\n */\n text: string;\n\n /**\n * The callback handler to call when the option is selected.\n */\n handler: () => void;\n}\n\n// TODO: Move out of public.\n/**\n * This represents the callback function that is called when an input field wants to determine if any completions\n * should be displayed. This function is called every time the text in an input field changes. It is passed the text\n * in the input field and the position of the cursor in the field.\n *\n * This function should return the list of completions that should be displayed to the user or null if no\n * completions should be displayed.\n */\nexport type OnGetCompletions = (inputText: string, cursorPosition: number) => Promise<InputCompletionResult>;\n\n// TODO: Move out of public.\n/**\n * This represents the callback that is called when a completion is selected from a completions popup on an input\n * field. It is passed the completion that was selected which will one of the same object instances returned from the\n * {@link OnGetCompletions} function.\n */\nexport type OnCompletionSelected = (completion: InputCompletion) => void;\n\n// TODO: Move out of public.\nexport interface InputCompletionResult {\n /**\n * The character position where the completion target begins.\n */\n completionStart: number;\n\n /**\n * The character position where the completion target ends.\n */\n completionEnd: number;\n\n /**\n * This list of possible completions.\n */\n completions: InputCompletion[];\n}\n\n// TODO: Move out of public.\nexport interface InputCompletion {\n /**\n * The display text for the completion.\n */\n label: string;\n\n /**\n * The value to replace the completion target with.\n */\n targetValue: string;\n\n /**\n * An object that describes the tag to render beside the mention option.\n */\n tag?: {\n /**\n * The tag text.\n */\n label: string;\n\n /**\n * The tag color.\n */\n type: TagType;\n };\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport type { ChatInstance } from './ChatInstance';\nimport type { ServiceDesk, ServiceDeskFactoryParameters, ServiceDeskPublicConfig } from './serviceDeskTypes';\n\n/**\n * This file contains the definition for the public application configuration operations that are provided by the\n * host page.\n */\n\nexport interface PublicConfig {\n /**\n * The callback function that is called by the loadWatsonAssistantChat script once it is loaded. This is optional;\n * to use web chat without this requires using the \"window.loadWatsonAssistantChat\" function instead.\n */\n onLoad?: (instance: ChatInstance) => void;\n\n /**\n * This is a one-off listener for errors. This value may be provided in the initial page config as a hook for\n * customers to listen for errors. We use this instead of a normal event bus handler because this function can be\n * defined and called before the event bus has been created which allows it to be used in loadWatsonAssistantChat.\n */\n onError?: (data: OnErrorData) => void;\n\n /**\n * An optional element the page can use as a custom in to which to render the widget.\n */\n element?: Element;\n\n /**\n * Render the chat launcher element used to open and close the chat window. If you elect to not show our built in\n * chat launcher, you will be responsible for firing the launcher:toggle, launcher:open or launcher:close events\n * from your own chat launcher. Or, you can use options.openChatByDefault to just have the chat interface be open\n * at initialization.\n */\n showLauncher?: boolean;\n\n /**\n * By default, the chat window will be rendered in a \"closed\" state.\n */\n openChatByDefault?: boolean;\n\n /**\n * Beta version of disclaimer screen. No tooling for this.\n */\n disclaimer?: DisclaimerPublicConfig;\n\n /**\n * This value is only used when a custom element is being used to render the widget. By default, a number of\n * enhancements to the widget are activated on mobile devices which can interfere with a custom element. This\n * value can be used to disable those enhancements while using a custom element.\n */\n disableCustomElementMobileEnhancements?: boolean;\n\n /**\n * Add a bunch of noisy console.log messages!\n */\n debug?: boolean;\n\n themeConfig?: ThemeConfig;\n\n /**\n * A nonce value to set on restricted elements to allow them to satisfy a Content-Security-Policy. If a website is\n * using a Content-Security-Policy along with a nonce to whitelist which style and script elements are allowed,\n * the site can provide this nonce value here which will then be added to the dynamic script and style tags\n * generated by the widget which will allow them to run.\n */\n cspNonce?: string;\n\n /**\n * This is a factory for producing custom implementations of service desks. If this value is set, then this will\n * be used to create an instance of a {@link ServiceDesk} when the user attempts to connect to an agent.\n */\n serviceDeskFactory?: (parameters: ServiceDeskFactoryParameters) => Promise<ServiceDesk>;\n\n /**\n * Agent app is a mode of web chat used in service desk UIs to show the chat history to the agent. Setting this flag\n * will adjust the way web chat renders and behaves, e.g. with no input field, opens by default, etc\n */\n agentAppConfig?: AgentAppConfig;\n\n /**\n * Any public config to apply to service desks.\n */\n serviceDesk?: ServiceDeskPublicConfig;\n\n /**\n * If the web chat should grab focus if the web chat is open on page load. This applies to session history open\n * states as well as openByChatByDefault. This should be set to false if the web chat is embedded in the tooling, for\n * instance.\n */\n shouldTakeFocusIfOpensAutomatically?: boolean;\n\n /**\n * An optional namespace that can be added to the web chat that must be 30 characters or under. This value is\n * intended to enable multiple instances of the web chat to be used on the same page. The namespace for this web\n * chat. This value is used to generate a value to append to anything unique (id, session keys, etc) to allow\n * multiple web chats on the same page.\n *\n * Note: this value is used in the aria region label for the web chat. This means this value will be read out loud\n * by users using a screen reader.\n */\n namespace?: string;\n\n /**\n * Indicates if a focus trap should be enabled when the web chat is open.\n */\n enableFocusTrap?: boolean;\n\n /**\n * The configuration that defines how web chat responds to link page requests (where there's a link reference in the\n * URL).\n */\n pageLinkConfig?: PageLinkConfig;\n\n /**\n * If true, disables functionality in web chat that changes the window title.\n */\n disableWindowTitleChanges?: boolean;\n\n /**\n * Indicates if web chat should sanitize HTML from a user or from the assistant.\n */\n shouldSanitizeHTML?: boolean;\n\n /**\n * Indicates if the internal web chat PDF viewer should be disabled. If true, web chat will present links to PDFs\n * as actual links that will open in the user's web browser using the browser's native viewer instead of the web chat\n * viewer.\n */\n disablePDFViewer?: boolean;\n\n /**\n * A config object to modify tours.\n */\n tourConfig?: {\n /**\n * Indicates if the minimize button should be hidden.\n */\n hideMinimizeButton?: boolean;\n\n /**\n * Indicates if the chat button should be hidden.\n */\n hideChatButton?: boolean;\n };\n\n /**\n * Configuration to control how streaming works.\n */\n streaming?: {\n /**\n * Indicates if streaming is disabled or not. Streaming is disabled by default but can be enabled through this\n * configuration or tooling. When streaming is enabled, the assistant may return a text/event-stream response for a\n * message request.\n */\n disabled?: boolean;\n };\n\n /**\n * Extra config for controlling the behavior of the header.\n */\n headerConfig?: HeaderConfig;\n\n /**\n * The config object for changing web chat's layout.\n */\n layout?: LayoutConfig;\n\n /**\n * Config options for controlling messaging.\n */\n messaging?: PublicConfigMessaging;\n}\n\nexport enum MinimizeButtonIconType {\n /**\n * This shows an \"X\" icon.\n */\n CLOSE = 'close',\n\n /**\n * This shows a \"-\" icon.\n */\n MINIMIZE = 'minimize',\n\n /**\n * This shows an icon that indicates that the web chat can be collapsed into a side panel.\n */\n SIDE_PANEL_LEFT = 'side-panel-left',\n\n /**\n * This shows an icon that indicates that the web chat can be collapsed into a side panel.\n */\n SIDE_PANEL_RIGHT = 'side-panel-right',\n}\n\nexport interface HeaderConfig {\n /**\n * Indicates the icon to use for the close button in the header.\n */\n minimizeButtonIconType?: MinimizeButtonIconType;\n\n /**\n * Hide the ability to minimize the web chat.\n */\n hideMinimizeButton?: boolean;\n\n /**\n * If true, shows the restart conversation button in the header of home screen and main chat.\n */\n showRestartButton?: boolean;\n\n /**\n * Indicates if the close and restart (X) button should be rendered.\n *\n */\n showCloseAndRestartButton?: boolean;\n}\n\n/**\n * When web chat is being used as the view for the human agent.\n */\nexport interface AgentAppConfig {\n /**\n * Sets chat to be in \"agent app\" mode. This means no user input is allowed and an \"auth_code\" will be included in the\n * request to fetch the conversation history.\n */\n is_on: boolean;\n\n /**\n * The auth_code passed from the connect_to_agent response type used to authenticate the session. This can be used to\n * embed a web chat into an agent application as an iframe and load the conversation history for the agent to see.\n */\n auth_code?: string;\n}\n\n/**\n * The configuration that defines how web chat responds to link page requests (where there's a link reference in the\n * URL).\n */\nexport interface PageLinkConfig {\n /**\n * The configuration for all the link IDs. The keys are the link IDs and the values are the configurations\n * specific to each link ID.\n */\n linkIDs: Record<string, PageLinkIDConfig>;\n}\n\n/**\n * The link configuration for a specific link ID.\n */\nexport interface PageLinkIDConfig {\n /**\n * The text of the utterance that will be sent to the assistant when the page is loaded and the given link ID is\n * found.\n */\n text: string;\n}\n\n/**\n * The launcher extended config that controls when certain animations should happen.\n */\nexport interface LauncherExtendedConfig {\n /**\n * The amount of time to wait before extending the launcher.\n */\n time_to_expand: number;\n\n /**\n * The amount of time to wait before reducing the extended launcher.\n */\n time_to_reduce?: number;\n}\n\nexport enum ClosePanelIconDirection {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport interface ClosePanelButtonConfig {\n /**\n * Indicates if the close panel button should be visible in the header.\n */\n is_on?: boolean;\n\n /**\n * Indicates the direction the icon should be facing.\n */\n closeIconDirection?: ClosePanelIconDirection;\n}\n\nexport interface LayoutConfig {\n /**\n * Indicates if the web chat widget should keep its border and box-shadow.\n */\n showFrame?: boolean;\n}\n\n/**\n * Config options for controlling messaging.\n */\nexport interface PublicConfigMessaging {\n /**\n * Indicates if web chat should make a request for the welcome message when a new conversation begins. If this is\n * true, then web chat will start with an empty conversation.\n */\n skipWelcome?: boolean;\n\n /**\n * Changes the timeout used by the message service when making message calls. The timeout is in seconds. The\n * default is 40 seconds. After this time, an error will be shown in the client and an Abort signal will be sent\n * to customSendMessage.\n */\n messageTimeoutSecs?: number;\n\n /**\n * Indicates if the context from the previous response should be copied on the next request. This is true by default.\n */\n copyPreviousContextOnRequest?: boolean;\n}\n\nexport interface DisclaimerPublicConfig {\n /**\n * If the disclaimer is turned on.\n */\n isOn: boolean;\n\n /**\n * HTML content to show in disclaimer.\n */\n disclaimerHTML: string;\n}\n\n/**\n * A string identifying what Carbon Theme we should base UI variables off of. Defaults to 'g10'. See\n * https://carbondesignsystem.com/guidelines/color/tokens.\n */\nexport enum CarbonTheme {\n WHITE = 'white',\n G10 = 'g10',\n G90 = 'g90',\n G100 = 'g100',\n}\n\n/**\n * The types of corners web chat can have.\n */\nexport enum CornersType {\n ROUND = 'round',\n SQUARE = 'square',\n}\n\n/**\n * The different categories of errors that the system can record. These values are published for end user consumption.\n */\nexport enum OnErrorType {\n /**\n * Indicates an error loading the remote init config.\n */\n INITIAL_CONFIG = 'INITIAL_CONFIG',\n\n /**\n * Indicates an error loading the main config.\n */\n OPEN_CONFIG = 'OPEN_CONFIG',\n\n /**\n * Indicates an error sending a message to the assistant. This error is only generated after all retries have\n * failed and the system has given up.\n */\n MESSAGE_COMMUNICATION = 'MESSAGE_COMMUNICATION',\n\n /**\n * This indicates an error in one of the React components that occurs as part of rendering the UI.\n */\n RENDER = 'RENDER',\n\n /**\n * This indicates an error with the identity token.\n */\n IDENTITY_TOKEN = 'IDENTITY_TOKEN',\n\n /**\n * This indicates an error with the MCSP identity token.\n */\n MCSP_IDENTITY_TOKEN = 'MCSP_IDENTITY_TOKEN',\n\n /**\n * This indicates a known error with the configuration for the integration or assistant. The only current case\n * is when the web chat receives a connect_to_agent response and no service desk has been configured. These are\n * generally user errors.\n */\n INTEGRATION_ERROR = 'INTEGRATION_ERROR',\n\n /**\n * The agent in the service desk waited too long to pick up the request and the session has expired so history cannot\n * be fetched.\n */\n AGENT_APP_EXPIRED_SESSION = 'AGENT_APP_EXPIRED_SESSION',\n\n /**\n * This indicates that some error occurred while trying to hydrate web chat. This will prevent web chat from\n * functioning.\n */\n HYDRATION = 'HYDRATION',\n\n /**\n * Indicates that an attempt to load the preview link was made but security was enabled.\n */\n PREVIEW_LINK_SECURITY = 'PREVIEW_LINK_SECURITY',\n}\n\n/**\n * The possible reasons that loading the web chat may fail.\n */\nexport enum CatastrophicErrorType {\n /**\n * Indicates it failed for some other reason.\n */\n FAILED = 'FAILED',\n\n /**\n * Indicates it failed because there was no skill attached to the assistant.\n */\n NO_SKILL = 'NO_SKILL',\n\n /**\n * Indicates it failed because the welcome node was throttled by the service.\n */\n THROTTLED = 'THROTTLED',\n\n /**\n * The agent in the service desk waited too long to pick up the request and the session has expired so history cannot\n * be fetched.\n */\n AGENT_APP_EXPIRED_SESSION = 'AGENT_APP_EXPIRED_SESSION',\n}\n\nexport interface OnErrorData {\n /**\n * The type of error that occurred.\n */\n errorType: OnErrorType;\n\n /**\n * A message associated with the error.\n */\n message: string;\n\n /**\n * A possible error code associated with this error. The meaning of this value may vary based on the error type.\n */\n errorCode?: number;\n\n /**\n * An optional transaction ID to associate with the error.\n */\n transactionID?: string;\n\n /**\n * An extra blob of data associated with the error. This may be a stack trace for thrown errors.\n */\n otherData?: unknown;\n\n /**\n * If the error is of the severity that requires a whole restart of web chat.\n */\n catastrophicErrorType?: CatastrophicErrorType;\n}\n\nexport interface ThemeConfig {\n /**\n * A string identifying what Carbon Theme we should base UI variables off of. Defaults to 'g10'. See\n * https://carbondesignsystem.com/guidelines/color/tokens.\n */\n carbonTheme?: CarbonTheme;\n\n /**\n * This flag is used to disable web chat's rounded corners.\n */\n corners?: CornersType;\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport type { TrackEventProps } from 'internal-packages/shared/services/TrackService';\nimport type { SuggestionListItem } from 'internal-packages/shared/utils/alternateSuggestionsUtils';\nimport type { CornersType } from 'internal-packages/shared/utils/constants';\nimport {\n type CustomPanelConfigOptions,\n type FileUpload,\n NotificationStateObject,\n type ViewState,\n ViewType,\n} from 'internal-packages/types/apiTypes';\nimport type { FileUploadCapabilities } from 'internal-packages/types/ChatInstance';\nimport { CatastrophicErrorType } from 'internal-packages/types/PublicConfig';\nimport type {\n ConversationalSearchItemCitation,\n EventInputData,\n GenericItem,\n IFrameItem,\n MessageResponse,\n SearchResult,\n SearchResultItem,\n} from 'submodules/wa-fd-types-public/wa-types';\n\nimport type { AlternateSuggestionsConfig } from './AlternateSuggestionsConfig';\nimport type { AppConfig } from './AppConfig';\nimport type { BrandingConfig } from './BrandingConfig';\nimport type { CarbonTheme } from './carbonTypes';\nimport type { CustomMenuOption } from './CustomMenuOptions';\nimport EnumMap from './EnumMap';\nimport type { FeatureName } from './FeatureName';\nimport type { HomeScreenConfig, HomeScreenStarterButton, HomeScreenState } from './HomeScreenConfig';\nimport type { AgentAvailability } from './HumanAgentAssistTypes';\nimport type { EnglishLanguagePack, LanguagePack } from './LanguagePack';\nimport type { LauncherConfig } from './LauncherConfig';\nimport type { LocalMessageItem } from './LocalMessageItem';\nimport ObjectMap from './ObjectMap';\nimport { PersistedAgentState } from './PersistedAgentState';\nimport type { LayoutConfig } from './PublicConfig';\nimport type { PersistedTourState, TourState } from './TourState';\nimport type { Message } from './watsonAssistantAPITypes';\n\n/**\n * This contains the definitions for the redux application state.\n */\n\n/**\n * The list of messages used by web chat. These are in their own section for easy ability to restart.\n */\ninterface AppStateMessages {\n /**\n * This is the global map/registry of all the local message items by their IDs. This includes messages from\n * the bot as well as messages with a human agent. The order of the messages is controlled by the array of\n * local message IDs contained in {@link ChatMessagesState}.\n */\n allMessageItemsByID: ObjectMap<LocalMessageItem>;\n\n /**\n * This is the global map/registry of all full messages (as opposed to the local message items) in the system by their\n * message IDs. This includes messages with a human agent. The order of the messages is controlled by the array of\n * local message IDs contained in {@link ChatMessagesState}.\n */\n allMessagesByID: ObjectMap<Message>;\n\n /**\n * The state of messages when the user is interacting with the bot/assistant.\n */\n botMessageState: ChatMessagesState;\n}\n\ninterface AppState extends AppStateMessages {\n /**\n * The state of the input area when the user is interacting with a bot (not a human agent).\n */\n botInputState: InputState;\n\n /**\n * The current state for the human agent system.\n */\n agentState: AgentState;\n\n /**\n * Whether we have hydrated web chat. This means we have loaded session history if it exists as well as the\n * welcome node (if appropriate).\n */\n isHydrated: boolean;\n\n /**\n * The name visible on the header bar. Also used in logs and other messages. This value is first populated via config.\n */\n botName: string;\n\n /**\n * An override for specifically just the title in the header bar. Useful if you don't want to always show the name of\n * the assistant in the title bar, but want to keep it in the message. Also useful if you want the title of your chat\n * and the name of your assistant to be different values.\n */\n headerDisplayName: string;\n\n /**\n * The avatar visible on the header bar. This value (image url) is first populated via config.\n */\n botAvatarURL: string;\n\n /**\n * The source of the launcher avatar image.\n */\n launcherAvatarURL: string;\n\n /**\n * The current CSS variables added as overrides. We store this because as we live update we merge with the previous\n * value. If there are no overrides this can be undefined.\n */\n cssVariableOverrides: ObjectMap<string>;\n\n /**\n * The external configuration for the chat widget that includes the public config provided by the host page as well\n * as the remote config provided by the tooling.\n */\n config: AppConfig;\n\n /**\n * The config above gets manipulated by some reducers (particularly the updateCSSVariables action). Store the original\n * config in case we ever need to refer back to the non manipulated version.\n */\n originalConfig: AppConfig;\n\n /**\n * The language pack currently in use by the widget. This may be different from the language pack provided in the\n * original public config if it has been updated since. If no pack was provided in the public config, this value\n * will be set by the locale and is updated if the locale is changed.\n */\n languagePack: LanguagePack;\n\n /**\n * The locale currently in use by the widget. This may be different from the locale provided in the original\n * public config if it has been updated since. If this value is updated, the language pack will be updated as well\n * as long as one was not originally provided in the public config.\n */\n locale: string;\n\n /**\n * v3.2.1 and earlier: IBM Cloud user email domain who most recently edited and saved the public config in tooling.\n * after v3.2.1: IBM Cloud Account owner email domain associated with the user's widget.\n */\n accountOwnerDomain: string;\n\n /**\n * after v3.2.1: IBM Cloud user email domain who most recently edited and saved the config in tooling.\n */\n recentEditorDomain: string;\n\n /**\n * An ID to uniquely identify the user. This can be used for GDPR purposes to delete the user's data on request.\n * This may be null if the user is not known. This may be different from the ID provided in the original public\n * config if it has been updated since. This value is only permitted to be updated if the previous value was null.\n * It cannot be updated from one userID to a different userID.\n */\n userID: string;\n\n /**\n * An ARIA message to be announced to the user. This will be announced whenever the message text changes.\n */\n announceMessage?: AnnounceMessage;\n\n /**\n * This is the overall bucket used to contain pending logging/tracking events for the system.\n */\n pendingLogs: PendingLogs;\n\n /**\n * A signed JWT value used to authorize and authenticate a given user.\n */\n identityToken: string;\n\n /**\n * The state of the alternate suggestions for the bot.\n */\n alternateSuggestionsState: AlternateSuggestionsState;\n\n /**\n * Indicates if the messages list should suspend its detection of scroll events on the messages list. The message\n * list uses a scroll listener to determine if the user has anchored the list to the bottom so that we can always\n * stay at the bottom. However, there are a number of cases where scrolling can occur automatically when the list\n * resizes that are not the result of the user scrolling. We want to ignore these scroll events.\n */\n suspendScrollDetection: boolean;\n\n /**\n * Active config for home screen derived from combining remote and local config.\n */\n homeScreenConfig: HomeScreenConfig;\n\n /**\n * Any items stored here is also persisted to sessionStorage IF sessionHistory is turned on. We rehydrate the redux\n * store with this information. Examples of things we store include if the web chat is open and if you have an active\n * conversation with an agent.\n */\n persistedToBrowserStorage: PersistedToBrowserStorageState;\n\n /**\n * A map with features as the key and booleans as the value. Used to conditionally display non-production features.\n */\n featureSet: EnumMap<FeatureName>;\n\n /**\n * The current enum value for the width of the chat. Used to drive responsive design and to swap components out\n * in different view sizes as needed.\n */\n chatWidthBreakpoint: ChatWidthBreakpoint;\n\n /**\n * The current width of the chat in pixels.\n */\n chatWidth: number;\n\n /**\n * The current height of the chat in pixels.\n */\n chatHeight: number;\n\n /**\n * Has thrown an error that web chat can not recover from.\n */\n catastrophicErrorType?: CatastrophicErrorType;\n\n /**\n * The state of web chat branding.\n */\n brandingState: BrandingState;\n\n /**\n * The state of the web chat launcher.\n */\n launcher: LauncherState;\n\n /**\n * The state of the iframe panel.\n */\n iFramePanelState: IFramePanelState;\n\n /**\n * The state of the conversational search citation panel.\n */\n viewSourcePanelState: ViewSourcePanelState;\n\n /**\n * Indicates if the app has been destroyed and should no longer be rendered.\n */\n isDestroyed: boolean;\n\n /**\n * The custom panel state.\n */\n customPanelState: CustomPanelState;\n\n /**\n * The state of the panel surfaced by response types, either with or without user input.\n */\n responsePanelState: MessagePanelState;\n\n /**\n * Indicates if the view is currently changing. This means that a fireViewChangeEventsAndChangeView function is\n * currently running and waiting to be resolved. This is used to stop these functions, and the events within them from\n * firing on top of each other.\n */\n viewChanging: boolean;\n\n /**\n * Indicates that Chat.ts has finished firing actions.changeView(). This signifies to the launcher and\n * other components that they may now begin their animations if they're visible.\n */\n initialViewChangeComplete: boolean;\n\n /**\n * Before web chat is loaded, the initial view state is set to everything closed (which reflects the reality of the\n * page as web chat is loading). This property is the view state we want web chat to try to get to after it is loaded.\n * If a previous session already exists, then this target will be set to the previous view state so we get back to\n * where we were. If there is no session, this will be set to a default that is based on the current web chat\n * config and page context (such as considering if openChatByDefault is set). After web chat is loaded, this value is\n * no longer used.\n */\n targetViewState: ViewState;\n\n /**\n * All the currently configured custom menu options.\n */\n customMenuOptions: CustomMenuOption[];\n\n /**\n * The non-persisted state for tours.\n */\n tourState: TourState;\n\n /**\n * Indicates if we should display a transparent background covering the non-header area of the main window.\n */\n showNonHeaderBackgroundCover: boolean;\n\n /**\n * Indicates if the browser page is visible. This uses the Page Visibility API which needs to be taken with a\n * grain of salt. A visibility change only occurs if the page moves in or out of being 100% visible. This occurs\n * when you switch tabs within the same window or if you minimize/maximize a window. If you switch to a different\n * window, this window changes visibility only if the entire window is covered.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n */\n isBrowserPageVisible: boolean;\n\n /**\n * Which carbon theme to use and whether the AI theme is enabled.\n */\n theme: ThemeState;\n\n /**\n * Whether streaming is enabled.\n */\n streaming: StreamingState;\n\n /**\n * If we're in AWS or a {@link PublicConfig.orchestratePrivateHostURL} is defined, then we should include the\n * Orchestrate mfe.\n */\n loadOrchestrateMFEs: boolean;\n\n layout: LayoutConfig;\n\n /**\n * The current state of notifications.\n */\n notifications: NotificationStateObject[];\n}\n\n/**\n * The state of the input area where the user types messages.\n */\ninterface InputState extends FileUploadCapabilities {\n /**\n * Indicates if the input field is configured to be visible. This is only interpreted as the custom setting defined\n * by the host page if it turns off the field. The value of this may be overridden if the user is connected to an\n * agent where the field will automatically become visible and then hidden again when the agent chat has ended.\n */\n fieldVisible: boolean;\n\n /**\n * Indicates if the input field should be made readonly.\n */\n isReadonly: boolean;\n\n /**\n * The current set of file attachments selected to be uploaded.\n */\n files: FileUpload[];\n}\n\n/**\n * Items stored by integrationID AND userID in sessionStorage.\n */\ninterface PersistedChatState {\n /**\n * The version of the web chat that this data is persisted for. If there are any breaking changes to the\n * application state and a user reloads and gets a new version of the widget, bad things might happen so we'll\n * just invalidate the persisted storage if we ever attempt to load an old version on web chat startup.\n */\n version: string;\n\n /**\n * The active watsonx Assistant sessionID.\n */\n sessionID: string;\n\n /**\n * Seconds from epoch when the session started.\n */\n sessionStartedTimestamp: number;\n\n /**\n * Maps the count of instance.updateHistoryUserDefined(), per messageID, for the length of a session.\n */\n updateHistoryUserDefinedCount: ObjectMap<number>;\n\n /**\n * Map of if a disclaimer has been accepted on a given window.hostname value.\n */\n disclaimersAccepted: ObjectMap<boolean>;\n\n /**\n * State of home screen.\n */\n homeScreenState: HomeScreenState;\n\n /**\n * If the user has received a message beyond the welcome node. We use this to mark if the chat has been interacted\n * with.\n */\n hasSentNonWelcomeMessage: boolean;\n\n /**\n * The persisted state for suggestions.\n */\n suggestionsPersistedState: AlternateSuggestionsPersistedState;\n\n /**\n * The persisted state for tours.\n */\n persistedTourState: PersistedTourState;\n\n /**\n * The persisted state for agents.\n */\n agentState: PersistedAgentState;\n}\n\n/**\n * Items stored by integrationID in sessionStorage.\n */\ninterface PersistedLauncherState {\n /**\n * Indicates if this state was loaded from browser session storage or if was created as part of a new session.\n */\n wasLoadedFromBrowser: boolean;\n\n /**\n * The version of the web chat that this data is persisted for. If there are any breaking changes to the\n * application state and a user reloads and gets a new version of the widget, bad things might happen so we'll\n * just invalidate the persisted storage if we ever attempt to load an old version on web chat startup.\n */\n version: string;\n\n /**\n * Indicates which of the web chat views are visible and which are hidden.\n */\n viewState: ViewState;\n\n /**\n * Indicates if there is currently an active tour. If there is then clicking on the launcher should open the tour\n * view.\n */\n activeTour: boolean;\n\n /**\n * Indicates if we should show an unread indicator on the launcher. This is a custom flag that is set by\n * {@link ChatActions.updateBotUnreadIndicatorVisibility} and will display an empty circle on\n * the launcher. This setting is overridden if there are any unread human agent messages in which case a circle\n * with a number is displayed.\n */\n showUnreadIndicator: boolean;\n\n /**\n * Indicates if the mobile launcher should be in the extended state.\n */\n mobileLauncherIsExtended: boolean;\n\n /**\n * Determines if the mobile launcher already played the extended animation and was reduced.\n */\n mobileLauncherWasReduced: boolean;\n\n /**\n * Determines if the mobile launcher previously played the bounce animation and should no longer be able to.\n */\n mobileLauncherDisableBounce: boolean;\n\n /**\n * Indicates the desktop launcher is in its expanded state.\n */\n desktopLauncherIsExpanded: boolean;\n\n /**\n * Indicates the desktop launcher has been minimized.\n */\n desktopLauncherWasMinimized: boolean;\n\n /**\n * The bounce turn the user is currently on in the sequence of bounces so that user doesn't start over in the\n * sequence. A turn is a full set of animations that are displayed when a bounce occurs and each turn of a bounce is\n * when a different bounce occurs at a different point in time. This is used for both the desktop and mobile launcher.\n */\n bounceTurn: number;\n\n /**\n * If the user has received a message beyond the welcome node. We use this to mark if the chat has been interacted\n * with. Note that this is a duplicate of the property on {@link PersistedChatState.hasSentNonWelcomeMessage}. It\n * is duplicated here so that this information may be available before hydration and before the user is known.\n * Note that this property reflects only the last user and should only be used when an approximate value is\n * acceptable.\n */\n hasSentNonWelcomeMessage: boolean;\n}\n\n/**\n * State shared with the sessionStorage so that as the user navigates the chat stays in the same UI state. This is in\n * addition to the data that the session history store.\n */\ninterface PersistedToBrowserStorageState {\n /**\n * Things stored that are related to the user profile. These are not accessible until the web chat has been opened!\n */\n chatState: PersistedChatState;\n\n /**\n * Things stored that are not related to the user profile. These should only be things that are not sensitive like\n * \"is the web chat open\".\n */\n launcherState: PersistedLauncherState;\n}\n\n/**\n * The state information for a specific instance of a chat panel that contains a list of messages.\n */\ninterface ChatMessagesState {\n /**\n * An array of local message item ids to correctly store the order of messages.\n */\n localMessageIDs: string[];\n\n /**\n * An array of message ids to correctly store the order of messages.\n */\n messageIDs: string[];\n\n /**\n * Counter that indicates if the other party (not the user) is typing and that a typing indicator should be displayed.\n * If \"0\" then we do not show typing indicator.\n */\n isTypingCounter: number;\n\n /**\n * Counter that indicates if the loading bar should be displayed.\n * If \"0\" then we do not show loading indicator.\n */\n isLoadingCounter: number;\n\n /**\n * Indicates if the scrollable area of the widget is anchored to the bottom such that if any changes in the scroll\n * panel size occur, the panel will automatically be scrolled back to the bottom. The anchor is enabled whenever\n * a scroll event occurs that brings the panel to the bottom. It also starts anchored as the panel is initially empty.\n */\n isScrollAnchored: boolean;\n}\n\n/**\n * This piece of state contains information about any connection to a human agent system.\n */\ninterface AgentState {\n /**\n * Indicates that we are currently attempting to connect the user to an agent.\n */\n isConnecting: boolean;\n\n /**\n * Indicates that we are currently attempting to re-connect the user to an agent. This occurs when web chat is\n * initially loaded and the user was previously connected to an agent.\n */\n isReconnecting: boolean;\n\n /**\n * Information about the waiting status for the user before being connected to an agent. This can contain\n * information about the time to wait or the position in a queue. If this is null, no specific wait information is\n * available.\n */\n availability?: AgentAvailability;\n\n /**\n * Indicates the number of messages from an agent that are unread by a user. This is only indicated if the user is\n * on the bot view. All agent messages are marked as read if the user switches to the agent view. This count does\n * not include \"agent joined\" messages.\n */\n numUnreadMessages: number;\n\n /**\n * Indicates if there is currently a file upload in progress.\n */\n fileUploadInProgress: boolean;\n\n /**\n * The ID of the locale message that was used to start the current conversation with an agent.\n */\n activeLocalMessageID?: string;\n\n /**\n * Indicates if the modal for displaying a screen sharing requests should be shown.\n */\n showScreenShareRequest: boolean;\n\n /**\n * Indicates if the user is currently sharing their screen.\n */\n isScreenSharing: boolean;\n\n /**\n * Indicates if the agent is typing.\n */\n isAgentTyping: boolean;\n\n /**\n * The state of the input field while connecting or connected to an agent.\n */\n inputState: InputState;\n}\n\n/**\n * The state that controls how the agent interaction appears to the user.\n */\ninterface AgentDisplayState {\n /**\n * Indicates if the user should see that they are connecting or connected to an agent.\n */\n isConnectingOrConnected: boolean;\n\n /**\n * Indicates if the input field should be disabled.\n */\n disableInput: boolean;\n\n /**\n * The language pack key to show for the placeholder text in the input field (if the default should be overridden).\n */\n inputPlaceholderKey: keyof EnglishLanguagePack;\n\n /**\n * Indicates if the agent is typing.\n */\n isAgentTyping: boolean;\n}\n\n/**\n * This interface represents a piece of text that can be translated using a language pack. A piece of code that\n * needs to display a string from the language pack can specify the ID/Key of the message from the language pack and\n * optionally any parameters that need to be passed to the message formatter that are used inside the string. This\n * also allows a form where the text has already been translated and can be used as-is.\n */\ninterface AnnounceMessage {\n /**\n * If the text is just specified as text that's already been calculated, that text can just be set here.\n */\n messageText?: string;\n\n /**\n * If the text is defined by a message id that corresponds to one of the messages in our language pack, that\n * message id can be specified here. The message text will be formatted using this message id.\n */\n messageID?: keyof EnglishLanguagePack;\n\n /**\n * If the text is defined by a message id that corresponds to one of the messages in our language pack, any\n * optional parameters that are necessary for formatting the message with the given id are specified here.\n */\n messageValues?: Record<string, any>;\n}\n\n/**\n * The different available widths of a web chat.\n */\nenum ChatWidthBreakpoint {\n // < 360px\n NARROW = 'narrow',\n // >= 360px\n STANDARD = 'standard',\n // > 672 + 16 + 16px\n WIDE = 'wide',\n}\n\n/**\n * The possible states of the suggestions options panel.\n */\nenum AlternateSuggestionsPanelState {\n /**\n * The panel is closed.\n */\n CLOSED = 1,\n\n /**\n * The panel is half open in the \"strike\" state.\n */\n OPEN_STRIKE = 2,\n\n /**\n * The panel is fully open.\n */\n OPEN_FULL = 3,\n}\n\n/**\n * This interface is used to represent the current state of the alternate suggestions feature in the application\n * including the button as well as the list of items visible in the open panel.\n *\n * The pieces of this that need to be saved in browser storage are located in {@link\n * AlternateSuggestionsPersistedState}.\n */\ninterface AlternateSuggestionsState {\n /**\n * The current config state for alternate suggestions.\n */\n config: AlternateSuggestionsConfig;\n\n /**\n * This is the related {@link MessageResponse} that was the source of the current set of alternate responses.\n */\n sourceResponse?: MessageResponse;\n\n /**\n * Indicates if the alternate suggestions button should be visible.\n */\n showButton: boolean;\n\n /**\n * Indicates if the panel may be displayed in the collapsed state (where it only shows alternate responses and the\n * contact option).\n */\n allowCollapse: boolean;\n\n /**\n * Indicates if the \"alternate responses\" panel is open. This panel will always display the alternate responses\n * present on the last message in the list.\n */\n panelState: AlternateSuggestionsPanelState;\n\n /**\n * This list of alternate responses to display in the alternate suggestions panel when it is open. This may also\n * include the contact option in the case of the strike panel.\n */\n suggestionListItems?: SuggestionListItem[];\n\n /**\n * Indicates if the section for displaying search results should be shown in the suggestions panel.\n */\n showSearchSection: boolean;\n\n /**\n * The search result item to display.\n */\n searchResults?: SearchResultItem;\n\n /**\n * Indicates if the search results are currently being queried. This value is set by the reducer and the\n * {@link createHandleAlternateSuggestions} subscriber listens for it and triggers the actual query.\n */\n searchResultsLoading?: boolean;\n\n /**\n * When a search result is in progress or has already happened, this will be the search text that was searched for.\n */\n searchResultsText?: string;\n\n /**\n * The \"connect to an agent\"/contact item that should be displayed (only if it's to be displayed in its own section).\n */\n contactItem?: SuggestionListItem;\n\n /**\n * The list of home screen starters to display in the alternate suggestions panel when it is open.\n */\n starters?: HomeScreenStarterButton[];\n}\n\n/**\n * This interface contains the pieces of suggestions state that are persisted in the browser session storage.\n */\ninterface AlternateSuggestionsPersistedState {\n /**\n * The number of consecutive times the bot has failed to understand the user (we hit the anything else node).\n */\n numStrikes: number;\n\n /**\n * The index of the current suggestion item that the user most recently selected from the suggestion list. This\n * value is reset each time the suggestion list is changed. A value of -1 indicates that no value has been\n * selected. Which section this value applies to, depends on the value of {@link #selectedSection}.\n */\n selectedIndex: number;\n\n /**\n * Indicates which section contains the most recently selected item.\n */\n selectedSection: AlternateSuggestionsSection;\n}\n\nenum AlternateSuggestionsSection {\n /**\n * Indicates the display of the alternate responses.\n */\n ALTERNATE_RESPONSES = 1,\n\n /**\n * The other contact option section. This is the section that includes the \"connect to agent\" option.\n */\n CONTACT_OPTIONS = 2,\n\n /**\n * The section that contains the home screen starters.\n */\n STARTERS = 3,\n}\n\ninterface BrandingState {\n /**\n * The current config state of branding.\n */\n config: BrandingConfig;\n\n /**\n * Determines if the branding overlay should be visible.\n */\n isOpen: boolean;\n\n /**\n * Determines if the banner should be shown.\n */\n showBanner: boolean;\n}\n\n/**\n * The launcher config.\n */\ninterface LauncherState {\n /**\n * The current config state of launcher.\n */\n config: LauncherConfig;\n}\n\n/**\n * This is the overall bucket used to contain pending logging/tracking events for the system.\n */\ninterface PendingLogs {\n /**\n * A set of events that we want to send to Amplitude for tracking purposes.\n */\n trackEvents: TrackEventProps[];\n\n /**\n * The array of messages that are to be sent to the bot as event messages.\n */\n eventMessages: EventInputData[];\n}\n\ninterface IFramePanelState {\n /**\n * Indicates if the iframe panel is open.\n */\n isOpen: boolean;\n\n /**\n * The iframe message item with the content to load.\n */\n messageItem: IFrameItem;\n}\n\ninterface ViewSourcePanelState {\n /**\n * Indicates if the conversational search citation panel is open.\n */\n isOpen: boolean;\n\n /**\n * A citation either from ConversationalSearch or from legacy (non-conversational) search. Confusingly,\n * {@link ConversationalSearchItem} contains it's own search_result array. Those searchResults are not the\n * searchResults that will be used for this citation prop here. Instead only legacy search will supply a searchResult\n * item for the citation and this will come from the {@link SearchResultItem} in either the results, primary_results,\n * or additional_results arrays. ConversationalSearch will supply a ConversationalSearchItemCitation for this prop, as\n * well as a searchResult prop lower down. This search_result is from the ConversationalSearchItem that corresponds to\n * this specific citation.\n */\n citationItem: ConversationalSearchItemCitation | SearchResult;\n\n /**\n * If the citation is for a {@link ConversationalSearchItem} then the ExpandToPanelCard should show a search result in\n * the panel because it has extra text and detail that could be valuable to the user.\n */\n relatedSearchResult?: SearchResult;\n}\n\ninterface CustomPanelState {\n /**\n * Determines if the custom panel should be open.\n */\n isOpen: boolean;\n\n /**\n * The id of the panel that is currently in focus.\n */\n panelID: string;\n\n /**\n * Config options for the custom panels.\n */\n options: CustomPanelConfigOptions;\n}\n\ninterface MessagePanelState<T extends GenericItem = GenericItem> {\n /**\n * Determines if the show panel is open.\n */\n isOpen: boolean;\n\n /**\n * The local message item that contains panel content to display.\n */\n localMessageItem: LocalMessageItem<T>;\n\n /**\n * Indicates if this message is part the most recent message response that allows for input. This will allow the panel\n * to reflect the state of the chat, such as disabling buttons that shouldn't be accessible anymore.\n */\n isMessageForInput: boolean;\n}\n\n/**\n * The theme state.\n */\ninterface ThemeState {\n /**\n * Indicates if the carbon for AI theme is enabled.\n */\n useAITheme: boolean;\n\n /**\n * A string identifying what Carbon Theme we should base UI variables off of. Defaults to 'g10'. See\n * https://carbondesignsystem.com/guidelines/color/tokens.\n */\n carbonTheme: CarbonTheme;\n\n /**\n * This flag is used to disable web chat's rounded corners.\n */\n corners: CornersType;\n}\n\n/**\n * The streaming state.\n */\ninterface StreamingState {\n /**\n * Whether streaming is enabled.\n */\n enabled: boolean;\n}\n\nexport {\n AlternateSuggestionsPersistedState,\n AppStateMessages,\n AppState,\n PersistedToBrowserStorageState,\n AgentDisplayState,\n AgentState,\n ChatMessagesState,\n AnnounceMessage,\n ViewState,\n ViewType,\n CatastrophicErrorType,\n AlternateSuggestionsState,\n PersistedChatState,\n PersistedLauncherState,\n BrandingState,\n LauncherState,\n AlternateSuggestionsPanelState,\n IFramePanelState,\n ViewSourcePanelState,\n AlternateSuggestionsSection,\n CustomPanelConfigOptions,\n CustomPanelState,\n InputState,\n FileUpload,\n MessagePanelState,\n ChatWidthBreakpoint,\n ThemeState,\n StreamingState,\n FileUploadCapabilities,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport 'submodules/wa-fd-types-public/wa-types-chat-extensions';\n\nimport { IntlShape } from 'react-intl';\nimport { MessageRequest } from 'submodules/wa-fd-types-public/wa-types-chat';\nimport { DeepPartial } from 'ts-essentials';\n\nimport {\n CustomMenuOption,\n CustomPanels,\n LanguagePack,\n LauncherType,\n NotificationMessage,\n OnCompletionSelected,\n OnGetCompletions,\n ViewState,\n ViewType,\n} from './apiTypes';\nimport { BusEvent, BusEventType } from './eventBusTypes';\nimport { HomeScreenConfig } from './HomeScreenConfig';\n\n/**\n * The interface represents the API contract with the chat widget and contains all the public methods and properties\n * that can be used with web chat.\n */\nexport interface ChatInstance extends EventHandlers, ChatActions {\n /**\n * This function will be called customer code after 'loadWatsonAssistantChat' has been called and after any login or\n * subscription operations have been performed that are required before the user's history can be loaded and the\n * widget rendered. When called, this will load the history and then render the widget.\n */\n render: () => Promise<ChatInstance>;\n\n /**\n * Destroy the chat widget and return initial content to the DOM.\n */\n destroy: () => void;\n\n /**\n * Returns the version number of code the widget is running.\n */\n getWidgetVersion: () => string;\n\n /**\n * Returns state information of the web chat that could be useful.\n */\n getState: () => PublicWebChatState;\n\n /**\n * Returns an instance of the intl object that is used for generating translated text. Note that the object\n * returned from this function changes each time the locale or language pack is changed.\n */\n getIntl: () => IntlShape;\n}\n\n/**\n * This is the state made available by calling getState. This is a public method that returns immutable values.\n */\nexport interface PublicWebChatState {\n /**\n * Is the web chat currently in an open state.\n */\n isWebChatOpen: boolean;\n\n /**\n * Is the web chat currently connected with a human agent.\n */\n isConnectedWithHumanAgent: boolean;\n\n /**\n * Indicates if web chat has requested to be connected to a human agent but an agent has not yet joined the\n * conversation.\n */\n isConnectingWithHumanAgent: boolean;\n\n /**\n * Is the home screen open.\n */\n isHomeScreenOpen: boolean;\n\n /**\n * Indicates if debugging is enabled.\n */\n isDebugEnabled: boolean;\n\n /**\n * Has the user sent a message that isn't requesting the welcome node.\n */\n hasUserSentMessage: boolean;\n\n /**\n * Whether there is an active tour currently.\n */\n isTourActive: boolean;\n\n /**\n * The current viewState of the web chat.\n */\n viewState: ViewState;\n\n /**\n * State regarding service desks.\n */\n serviceDesk: PublicWebChatServiceDeskState;\n}\n\nexport interface PublicWebChatServiceDeskState {\n /**\n * Is the web chat currently connected with a human agent.\n */\n isConnected: boolean;\n\n /**\n * Indicates if web chat has requested to be connected to a human agent but an agent has not yet joined the\n * conversation.\n */\n isConnecting: boolean;\n\n /**\n * Indicates if a conversation with a human agent has been suspended.\n */\n isSuspended: boolean;\n}\n\n/**\n * This is a subset of the public interface that is managed by the event bus that is used for registering and\n * unregistering event listeners on the bus.\n */\nexport interface EventHandlers {\n /**\n * Adds the given event handler as a listener for events of the given type.\n *\n * @param handlers The handler or handlers along with the event type to start listening for events.\n * @returns The instance for method chaining.\n */\n on: (handlers: TypeAndHandler | TypeAndHandler[]) => EventHandlers;\n\n /**\n * Removes an event listener that was previously added via {@link on} or {@link once}.\n *\n * @param handlers The handler or handlers along with the event type to stop listening for events.\n * @returns The instance for method chaining.\n */\n off: (handlers: TypeAndHandler | TypeAndHandler[]) => EventHandlers;\n\n /**\n * Adds the given event handler as a listener for events of the given type. After the first event is handled, this\n * handler will automatically be removed.\n *\n * @param handlers The handler or handlers along with the event type to start listening for an event.\n * @returns The instance for method chaining.\n */\n once: (handlers: TypeAndHandler | TypeAndHandler[]) => EventHandlers;\n}\n\n/**\n * The type of handler for event bus events. This function may return a Promise in which case, the bus will await\n * the result and the loop will block until the Promise is resolved.\n */\nexport type EventBusHandler<T extends BusEvent = BusEvent> = (event: T, instance: ChatInstance) => unknown;\n\n/**\n * The type of the object that is passed to the event bus functions (e.g. \"on\") when registering a handler.\n */\nexport interface TypeAndHandler {\n /**\n * The type of event this handler is for.\n */\n type: BusEventType;\n\n /**\n * The handler for events of this type.\n */\n handler: EventBusHandler;\n}\n\n/**\n * This is a subset of the public interface that provides methods that can be used by the user to control the widget\n * and have it perform certain actions.\n */\nexport interface ChatActions {\n /**\n * This function can be called when another component wishes this component to gain focus. It is up to the\n * component to decide where focus belongs. This may return true or false to indicate if a suitable focus location\n * was found.\n */\n requestFocus: () => boolean | void;\n\n /**\n * Sends the given message to the assistant on the remote server. This will result in a \"pre:send\" and \"send\" event\n * being fired on the event bus. The returned promise will resolve once a response has received and processed and\n * both the \"pre:receive\" and \"receive\" events have fired. It will reject when too many errors have occurred and\n * the system gives up retrying.\n *\n * @param message The message to send.\n * @param options Options for the message sent.\n */\n send: (message: MessageRequest | string, options?: SendOptions) => Promise<void>;\n\n /**\n * Updates the current locale. This will override the default values of the language pack. You can use\n * {@link getLocale} to identify the current locale if you need to make an update based on the user's locale.\n */\n updateLocale: (newLocale: string) => Promise<void>;\n\n /**\n * Updates the current language pack using the values from the provided language pack. This language pack does\n * not need to be complete; only the strings contained in it will be updated. Any strings that are missing will be\n * ignored and the current values will remain unchanged. You can use {@link getLocale} to identify the current\n * locale if you need to make an update based on the user's locale.\n */\n updateLanguagePack: (newPack: DeepPartial<LanguagePack>) => void;\n\n /**\n * Returns the current locale in use by the widget. This may not match the locale that was provided in the\n * original public configuration if that value was invalid or if the locale has been changed since then.\n *\n * @returns A string containing the language and possibly a region code. Example values include: 'en' and 'en-us'.\n */\n getLocale: () => string;\n\n /**\n * Clears the current state and removes all references to the current session. Does not start a new session unless a\n * new message is subsequently sent.\n */\n destroySession: () => Promise<void>;\n\n /**\n * If the messageID provided is the id of a response then save the data provided within history.user_defined so it can\n * be used to repopulate a message upon reload/page change with session history.\n */\n updateHistoryUserDefined: (messageID: string, data: unknown) => Promise<void>;\n\n /**\n * This updates the map that can be used to override the values for CSS variables in the application. Each key of the\n * map is the name of a variable (without the \"--cds-chat-\" prefix) and the value is whatever the value of\n * the variable should be set at. This function may only be called if publicConfig.__ibm__.allowPrivateMethods has\n * been set. The values in the provided map will be merged with any variables that may already be defined in\n * the public config which allows this function to update only the specific variables desired.\n *\n * @param publicVars A map of CSS variables. Each key of the map is the name of a variable (without the\n * \"--cds-chat-\" prefix) and the value is whatever the value of the variable should be set at.\n */\n updateCSSVariables: (publicVars: Record<string, string>) => void;\n\n /**\n * Fire the view:pre:change and view:change events and change the view of the web chat. If a {@link ViewType} is\n * provided then that view will become visible and the rest will be hidden. If a {@link ViewState} is provided that\n * includes all of the views then all of the views will be changed accordingly. If a partial {@link ViewState} is\n * provided then only the views provided will be changed.\n */\n changeView: (newView: ViewType | ViewState) => Promise<void>;\n\n /**\n * Returns elements that Deb can write content to. This object is indirectly exposed to Deb using a proxy returned\n * from {@link createWriteableElementsProxy}.\n */\n writeableElements: WriteableElements;\n\n /**\n * The elements of web chat that need to be exposed for customers to manipulate. Unlike writeable elements, these\n * elements have existing content\n */\n elements: InstanceElements;\n\n /**\n * Methods provided to developers to interact with the tour feature.\n */\n tours: ChatInstanceTours;\n\n /**\n * Allow being able to set the input field to be invisible on assistant facing (not agent) views. Helpful for when\n * you want to force input into a button, etc.\n */\n updateAssistantInputFieldVisibility: (isVisible: boolean) => void;\n\n /**\n * Changes the state of web chat to allow or disallow input. This includes the input field as well as inputs like\n * buttons and dropdowns.\n */\n updateInputIsDisabled: (isDisabled: boolean) => void;\n\n /**\n * Updates the visibility of the custom unread indicator that appears on the launcher. This indicator appears as a\n * small empty circle on the launcher. If there are any unread messages from a human agent, this indicator will be\n * shown with a number regardless of the custom setting of this flag.\n */\n updateBotUnreadIndicatorVisibility: (isVisible: boolean) => void;\n\n /**\n * Updates the currently active homeScreenConfig. Currently only used in tooling to show live updates when editing web\n * chat configuration.\n */\n updateHomeScreenConfig: (homeScreenConfig: HomeScreenConfig) => void;\n\n /**\n * Scrolls to the (original) message with the given ID. Since there may be multiple message items in a given\n * message, this will scroll the first message to the top of the message window.\n *\n * @param messageID The (original) message ID to scroll to.\n * @param animate Whether or not the scroll should be animated. Defaults to true.\n */\n scrollToMessage: (messageID: string, animate?: boolean) => void;\n\n /**\n * Set the greeting message text for the launcher. Optionally specify which launcher, desktop or mobile, that the\n * greeting message is being set for.\n */\n updateLauncherGreetingMessage: (\n greetingMessage: string,\n launcherType?: LauncherType.DESKTOP | LauncherType.MOBILE,\n ) => void;\n\n /**\n * Control when the greeting message should appear. The default time is 0s which will cause it to appear immediately.\n * Optionally specify which launcher, desktop or mobile, that the time should be set for.\n */\n showLauncherGreetingMessage: (time: number, launcherType?: LauncherType.DESKTOP | LauncherType.MOBILE) => void;\n\n /**\n * An instance of the custom panel with methods to manipulate the behavior of the custom panels.\n */\n customPanels: CustomPanels;\n\n /**\n * Updates the custom menu options.\n */\n updateCustomMenuOptions: (options: CustomMenuOption[]) => void;\n\n /**\n * Restarts the conversation with the assistant. This does not make any changes to a conversation with a human agent.\n * This will clear all the current assistant messages from the main bot view and cancel any outstanding\n * messages. This will also clear the current assistant session which will force a new session to start on the\n * next message.\n */\n restartConversation: () => Promise<void>;\n\n /**\n * Initiates a {@link Chat#doAutoScroll} on the currently visible chat panel.\n */\n doAutoScroll: () => void;\n\n /**\n * Ends the conversation with a human agent. This does not request confirmation from the user first. If the user\n * is not connected or connecting to a human agent, this function has no effect. You can determine if the user is\n * connected or connecting by calling {@link ChatInstance.getState}. Note that this function\n * returns a Promise that only resolves when the conversation has ended. This includes after the\n * {@link BusEventType.AGENT_PRE_END_CHAT} and {@link BusEventType.AGENT_END_CHAT} events have been fired and\n * resolved.\n */\n agentEndConversation: () => Promise<void>;\n\n /**\n * Either increases or decreases the internal counter that indicates whether the \"bot is typing\" indicator is\n * shown. If the count is greater than zero, then the indicator is shown. Values of \"increase\" or \"decrease\" will\n * increase or decrease the value. Any other value with log an error. Currently, this is the same as the loading\n * indicator.\n */\n updateIsTypingCounter: (direction: IncreaseOrDecrease) => void;\n\n /**\n * Either increases or decreases the internal counter that indicates whether the \"bot is loading\" indicator is\n * shown. If the count is greater than zero, then the indicator is shown. Values of \"increase\" or \"decrease\" will\n * increase or decrease the value. Any other value with log an error. Currently, this is the same as the typing\n * indicator.\n */\n updateIsLoadingCounter: (direction: string) => void;\n\n /**\n * Updates the title of the bot panel. This value defaults to the bot name with the AI theme turned off and defaults\n * to nothing when the AI theme is turned on.\n */\n updateMainHeaderTitle: (title?: null | string) => void;\n\n /**\n * Add a system level notification to the list of system notifications.\n * @deprecated\n */\n addNotification: (notification: NotificationMessage) => void;\n\n /**\n * The state of notifications in the chat.\n */\n notifications: ChatInstanceNotifications;\n\n /**\n * Actions that are related to a service desk integration.\n */\n serviceDesk: ChatInstanceServiceDeskActions;\n}\n\nexport type IncreaseOrDecrease = 'increase' | 'decrease';\n\n/**\n * This interface represents the options for when a MessageRequest is sent to the server with the send method.\n */\nexport interface SendOptions {\n /**\n * If you want to send a message to the API, but NOT have it show up in the UI, set this to true. The \"pre:send\"\n * and \"send\" events will still be fired but the message will not be added to the local message list displayed in\n * the UI. Note that the response message will still be added.\n */\n silent?: boolean;\n\n /**\n * Indicates if the forced pause displayed with the response should be skipped. By default, web chat will insert a\n * pause to produce a delay of 2 seconds after the response has been received. This is to give the bot a more\n * natural, conversational feeling to it.\n */\n skipPause?: boolean;\n}\n\n/**\n * An object of elements we expose to developers to write to. Currently, this only encompasses above the welcome node,\n * but may grow to include portions of home page, etc.\n */\nexport type WriteableElements = Record<WriteableElementName, HTMLElement>;\n\nexport enum WriteableElementName {\n /**\n * An element that appears in the AI theme only and is shown beneath the title and description in the AI tooltip\n * content.\n */\n AI_TOOLTIP_AFTER_DESCRIPTION_ELEMENT = 'aiTooltipAfterDescriptionElement',\n\n /**\n * An element that appears in the main message body directly above the welcome node.\n */\n WELCOME_NODE_BEFORE_ELEMENT = 'welcomeNodeBeforeElement',\n\n /**\n * An element that appears in the header on a new line. Only visible while talking to the bot.\n */\n HEADER_BOTTOM_ELEMENT = 'headerBottomElement',\n\n /**\n * An element that appears after the messages area and before the input area.\n */\n BEFORE_INPUT_ELEMENT = 'beforeInputElement',\n\n /**\n * An element that appears above the input field on the home screen.\n */\n HOME_SCREEN_BEFORE_INPUT_ELEMENT = 'homeScreenBeforeInputElement',\n\n /**\n * An element that appears on the home screen after the conversation starters.\n */\n HOME_SCREEN_AFTER_STARTERS_ELEMENT = 'homeScreenAfterStartersElement',\n\n /**\n * An element that appears on the home screen above the welcome message and conversation starters.\n */\n HOME_SCREEN_HEADER_BOTTOM_ELEMENT = 'homeScreenHeaderBottomElement',\n}\n\n/**\n * The interface represents the elements that web chat provides access to.\n */\nexport interface InstanceElements {\n /**\n * Returns the element that represents the main window.\n */\n getMainWindow: () => HasAddRemoveClassName;\n\n /**\n * Returns the element that represents the input field (text area) on the main message area.\n */\n getMessageInput: () => InstanceInputElement;\n\n /**\n * Returns the element that represents the input field (text area) on the home screen.\n */\n getHomeScreenInput: () => InstanceInputElement;\n}\n\n/**\n * The different input fields (text areas) in the application.\n */\nexport enum InputFieldType {\n /**\n * The main input field on the message list.\n */\n MESSAGE = 'message',\n\n /**\n * The input field on the home screen.\n */\n HOME_SCREEN = 'homeScreen',\n}\n\n/**\n * Represents one of the input elements that web chat provides access to custom code.\n */\nexport interface InstanceInputElement {\n /**\n * The raw HTML element for the element.\n */\n getHTMLElement: () => HTMLTextAreaElement;\n\n /**\n * Sets the current text value inside the input.\n */\n setValue: (value: string) => void;\n\n /**\n * Enables or disables the handling of the enter key by the input field.\n */\n setEnableEnterKey: (isEnabled: boolean) => void;\n\n /**\n * Adds a listener that will fire whenever the value in the input field is changed. This fires immediately like an\n * \"input\" event and not only when focus is lost like a \"change\".\n */\n addChangeListener: (listener: ChangeFunction) => void;\n\n /**\n * Removes a change listener that was previously added.\n */\n removeChangeListener: (listener: ChangeFunction) => void;\n\n /**\n * Sets the callback listener that is called before input is sent. This is called before the input field is\n * cleared after that send occurs.\n *\n * @param onBeforeSend The callback to call before the input is sent. The return value of this function will be passed\n * to the subsequent \"pre:send\" and \"send\" events that get fired with the actual message request.\n */\n setOnBeforeSend: (onBeforeSend: () => unknown) => void;\n\n /**\n * Sets the callback to call to fetch a list of matching completions for entered text. This function is called\n * whenever the input in the input field is changed. This function may be asynchronous but it will be called again\n * if the user changes the input before the previous call is complete. In that case, the previous call is ignored.\n *\n * Also note that additional actions taken by the user (such as moving the cursor position) will cancel\n * completions resulting in any outstanding asynchronous calls being ignored.\n */\n setOnGetCompletions: (onGetCompletions: OnGetCompletions) => void;\n\n /**\n * Sets the callback that is called when a completion is selected from the completions popup.\n */\n setOnCompletionSelected: (onCompletionSelected: OnCompletionSelected) => void;\n}\n\n/**\n * Methods provided to developers to interact with the tour feature.\n */\nexport interface ChatInstanceTours {\n /**\n * Sends the given message to the backend with the skipTourCard option set to true. When a tour response is received,\n * this method automatically starts the tour and skips the tour card. If a response other than a tour is received,\n * then an error is logged.\n */\n startTour: (message: string) => void;\n\n /**\n * Clears all tour data, closes the tour, and switches to the launcher.\n */\n endTour: () => void;\n\n /**\n * Moves forward one step in the tour.\n */\n goToNextStep: () => void;\n\n /**\n * Looks for the provided stepId string within the tour step items. If a step with a matching step_id is found then\n * moves to that step within the tour.\n */\n goToStep: (stepId: string) => void;\n}\n\nexport interface ChatInstanceNotifications {\n /**\n * Add a system level notification to the list of system notifications.\n */\n addNotification: (notification: NotificationMessage) => void;\n\n /**\n * Remove a system level notification from the list of system notifications.\n */\n removeNotifications: (groupID: string) => void;\n\n /**\n * Remove all system level notifications from the list of system notifications.\n */\n removeAllNotifications: () => void;\n}\n\nexport type ChangeFunction = (text: string) => void;\n\n/**\n * Represents an item that can add or remove class names.\n */\nexport interface HasAddRemoveClassName {\n /**\n * Adds the given class name to the element.\n */\n addClassName(name: string): void;\n\n /**\n * Removes the given class name from the element.\n */\n removeClassName(name: string): void;\n}\n\nexport interface FileUploadCapabilities {\n /**\n * Indicates that file uploads may be performed by the user.\n */\n allowFileUploads: boolean;\n\n /**\n * If file uploads are allowed, this indicates if more than one file may be selected at a time. The default is false.\n */\n allowMultipleFileUploads: boolean;\n\n /**\n * If file uploads are allowed, this is the set a file types that are allowed. This is filled into the \"accept\"\n * field for the file input element.\n */\n allowedFileUploadTypes: string;\n}\n\nexport interface ChatInstanceServiceDeskActions {\n /**\n * Ends the conversation with a human agent. This does not request confirmation from the user first. If the user\n * is not connected or connecting to a human agent, this function has no effect. You can determine if the user is\n * connected or connecting by calling {@link ChatInstance.getState}. Note that this function\n * returns a Promise that only resolves when the conversation has ended. This includes after the\n * {@link BusEventType.AGENT_PRE_END_CHAT} and {@link BusEventType.AGENT_END_CHAT} events have been fired and\n * resolved.\n */\n endConversation: () => Promise<void>;\n\n /**\n * Sets the suspended state for an agent conversation. A conversation can be suspended or un-suspended only if the\n * user is currently connecting or connected to an agent. If a conversation is suspended, then messages from the user\n * will no longer be routed to the service desk and incoming messages from the service desk will not be displayed. In\n * addition, the current connection status with an agent will not be shown.\n */\n updateIsSuspended: (isSuspended: boolean) => Promise<void>;\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { FileStatusValue } from 'internal-packages/types/apiTypes';\nimport { type IncreaseOrDecrease, WriteableElementName } from 'internal-packages/types/ChatInstance';\nimport { CornersType } from 'internal-packages/types/PublicConfig';\n\nconst HEADER_ACCEPT = 'accept';\nconst HEADER_CONTENT_TYPE = 'content-type';\nconst HEADER_AUTHORIZATION = 'authorization';\n\n// The mime type for JSON.\nconst MIME_JSON = 'application/json';\n\n// The mime type for text streaming.\nconst MIME_STREAM = 'text/event-stream';\n\nconst MIME_JSON_STREAM = `${MIME_JSON}, ${MIME_STREAM}`;\n\n// Prefix used to distinguish console logs omitted from our code\nconst WA_CONSOLE_PREFIX = '[Chat]';\n\n// This is a header respected by the IBM stack for tracking requests as they move from service to service. By default,\n// Cerberus will add a transaction id x-request-id to the response which could be used for tracking. However,\n// if we set one here we can reference it when debugging and downstream services can search in their logs for this\n// value.\nconst API_DEBUGGING_HEADER_NAME = 'X-Global-Transaction-ID';\n\n// Header identifying requests are coming from a web chat embedded as an agent app. We use this to know we need to check\n// for an auth code bearer token (instead of JWT security, for instance).\nconst AGENT_APP_HEADER_NAME = 'x-watson-is-agent-app';\n\n// The right-to-left mark character string which mixes the direction of a string.\n// For more info on right-to-left mark: https://www.w3.org/TR/WCAG20-TECHS/H34.html\nconst RIGHT_TO_LEFT_MARK = String.fromCharCode(0x200f);\n\nconst ENGLISH_US_DATE_FORMAT = 'mm/dd/yyyy';\n\n// The timeout, in milliseconds, to wait for a response type to load content.\nconst RESPONSE_TYPE_TIMEOUT_MS = 10000;\n\n// These are custom panel ids.\nconst DEFAULT_CUSTOM_PANEL_ID = 'wac-default-panel';\n\n// The version of the integrations server API that web chat is using. Note, this version does not necessarily match\n// the version of the store API that is being used. The integrations server does a mapping from this version to the\n// store version. Integrations version \"2023-09-15\" corresponds to Store version \"2023-06-15\".\nconst INTEGRATIONS_VERSION = '2023-09-15';\n\nconst WINDOW_WARNING =\n 'The window related events and methods have been deprecated and will be disabled in the next' +\n ' major release of web chat. Please update your code to use the view change events and methods. See' +\n ' https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-events#windowviewmigration for more' +\n ' information.';\n\nconst CUSTOM_RESPONSE_WARNING =\n 'The customResponse event has been renamed to userDefinedResponse. The existing event will continue to function' +\n ' but is deprecated and will be removed in a future release.';\n\n// The piece of a region code that includes we're running in AWS.\nconst AWS_REGION_FRAGMENT = 'aws';\n\n// The piece of a region code that includes we're running WXO on IBM Cloud.\nconst WXO_CLOUD_REGION_FRAGMENT = 'wxo';\n\n// A noop function to do nothing in order to satisfy a conditional statement.\nconst NOOP = () => {};\n\n/**\n * This function serves as a placeholder in places where a functional value is required, but not expected to be\n * fired. In the event that it is, it will throw an error, letting you know it shouldn't be.\n */\nfunction THROW_ERROR() {\n throw Error('Not implemented.');\n}\n\n/**\n * The brand color types configurable for web chat.\n */\nenum BrandColorKind {\n PRIMARY = 'primary',\n ACCENT = 'accent',\n}\n\n// Max width for which we show a carousel.\nconst CAROUSEL_MAX_WIDTH = 455;\n\n// Max width we allow non-carousel citations to be full width. We are trying to avoid having skinny citations just\n// sitting alone on a row and being stacked so we allow them to grow full width until we get to a size where we can\n// show more than one on a line.\nconst FULL_WIDTH_CITATION_MAX_WIDTH = 580;\n\nconst TEST_CITATION_TEXT_SHOULD_EXPAND =\n 'Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text.';\n\n// When we auto-scroll to a message, we want to scroll a bit more than necessary because messages have a lot of\n// padding on the top that we want to cut off when scrolling. This is the extra amount we scroll by. There's 28px of\n// padding above the message and we want to cut that down to just 8 so we scroll an extra 20px (28 - 8).\nconst AUTO_SCROLL_EXTRA = 28 - 8;\n\nconst LIGHT_THEMES = ['white', 'g10'];\n\nlet isJest = false;\ntry {\n // \"process\" is undefined when not in a jest environment, but I don't know how to check its value without the code\n // throwing a \"not defined\" error.\n if (process?.env.JEST_WORKER_ID) {\n isJest = true;\n }\n} catch (error) {\n // Ignore\n}\n\nconst IS_JEST = isJest;\n\n// How much to throttle auto scrolling. When we are in test mode, we set this to zero.\nconst AUTO_SCROLL_THROTTLE_TIMEOUT: number = IS_JEST ? 0 : 100;\n\nexport {\n AUTO_SCROLL_THROTTLE_TIMEOUT,\n MIME_JSON,\n MIME_STREAM,\n MIME_JSON_STREAM,\n WA_CONSOLE_PREFIX,\n API_DEBUGGING_HEADER_NAME,\n AGENT_APP_HEADER_NAME,\n RIGHT_TO_LEFT_MARK,\n ENGLISH_US_DATE_FORMAT,\n RESPONSE_TYPE_TIMEOUT_MS,\n DEFAULT_CUSTOM_PANEL_ID,\n INTEGRATIONS_VERSION,\n NOOP,\n WriteableElementName,\n FileStatusValue,\n THROW_ERROR,\n WINDOW_WARNING,\n CUSTOM_RESPONSE_WARNING,\n BrandColorKind,\n HEADER_ACCEPT,\n HEADER_CONTENT_TYPE,\n HEADER_AUTHORIZATION,\n AWS_REGION_FRAGMENT,\n CornersType,\n IncreaseOrDecrease,\n CAROUSEL_MAX_WIDTH,\n FULL_WIDTH_CITATION_MAX_WIDTH,\n WXO_CLOUD_REGION_FRAGMENT,\n TEST_CITATION_TEXT_SHOULD_EXPAND,\n AUTO_SCROLL_EXTRA,\n LIGHT_THEMES,\n IS_JEST,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Miscellaneous utils for dealing with promises.\n */\n\n/**\n * This is an async function that will simply wait for the given amount of time.\n *\n * @param milliseconds The amount of time in milliseconds to wait.\n */\nasync function sleep(milliseconds: number) {\n await new Promise(resolve => {\n setTimeout(resolve, milliseconds);\n });\n}\n\n/**\n * This function returns a Promise that will be resolved if the provided Promise has resolved within the duration\n * specified. Otherwise the promise will be rejected.\n *\n * @param promise The Promise which will be resolved or timed out.\n * @param duration The duration of the timeout in milliseconds.\n * @param errorMessage An optional message to display.\n */\nfunction resolveOrTimeout<T>(promise: Promise<T>, duration: number, errorMessage?: string): Promise<T> {\n // Create a promise that rejects in <ms> milliseconds\n const timeout = new Promise<T>((resolve, reject) => {\n setTimeout(() => {\n const message = errorMessage || `The operation timed out after ${duration}ms`;\n reject(message);\n }, duration);\n });\n\n // Returns a race between the timeout and the original in promise\n return Promise.race([promise, timeout]);\n}\n\nexport { sleep, resolveOrTimeout };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Miscellaneous utilities that don't fit anywhere else.\n */\n\nimport { AppConfig } from 'internal-packages/shared/types/AppConfig';\nimport { CatastrophicErrorType, FileUpload } from 'internal-packages/shared/types/AppState';\nimport { OnErrorData, OnErrorType } from 'internal-packages/shared/types/OnErrorData';\nimport { ErrorInfo } from 'react';\n\nimport { FileStatusValue, WA_CONSOLE_PREFIX } from './constants';\nimport { resolveOrTimeout } from './lang/promiseUtils';\n\n/**\n * All the alphabetic characters. This is used to decide what characters to return in our hash function.\n */\nconst CHARACTERS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n/**\n * A global flag to indicate if we want to show debug messages in the browser console. This is generally set from\n * {@link PublicConfig.debug}.\n */\nlet enableDebugLog = false;\n\n/**\n * A global flag to indicate if we want to show stack trace debug messages in the browser console. This is generally set\n * from {@link PublicConfig.debugStackTraces}.\n */\nlet enableDebugStackTracesLog = false;\n\n/**\n * This is a no-op function that's for the purpose of verifying at build time that a given item matches a given\n * type. To use, pass the item as the \"item\" parameter and pass the type as the \"TItemType\" type parameter. Since\n * this is incurring a runtime call for what is really a build-time check, this function should be used sparingly.\n */\nfunction assertType<TItemType>(item: TItemType): TItemType {\n return item;\n}\n\n/**\n * A simple utility to send a message to the console log but only id debug logging is enabled.\n */\nfunction debugLog(message: string, ...args: any[]) {\n if (enableDebugLog) {\n console.log(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n }\n}\n\n/**\n * A simple utility to send a message to the console log but only if debug stack traces logging is enabled.\n */\nfunction debugStackTrace(message: string, ...args: any[]) {\n if (enableDebugStackTracesLog) {\n const stack = new Error(\n 'This is not an error; it is a stack trace used for debugging purposes. It is enabled by the \"debugStackTraces: true\" configuration option.',\n );\n debugLog(message, stack, ...args);\n } else {\n debugLog(message, ...args);\n }\n}\n\n/**\n * A simple utility to send an error message to the console log.\n */\nfunction consoleError(message: string, ...args: any[]) {\n console.error(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send an error message to the console log.\n */\nfunction consoleLog(message: string, ...args: any[]) {\n console.log(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send a message to the console log.\n */\nfunction consoleInfo(message: string, ...args: any[]) {\n console.info(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send a message to the console log.\n */\nfunction consoleDebug(message: string, ...args: any[]) {\n console.debug(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send an warning message to the console log.\n */\nfunction consoleWarn(message: string, ...args: any[]) {\n console.warn(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * Sets a global flag to indicate if we want to show debug messages in the browser console. This is generally set from\n * {@link PublicConfig.debug}.\n */\nfunction setEnableDebugLog(debug: boolean) {\n enableDebugLog = debug;\n}\n\n/**\n * Sets a global flag to indicate if we want to show debug stack trace messages in the browser console. This is\n * generally set from {@link PublicConfig.debugStackTraces}.\n */\nfunction setEnableDebugStackTracesLog(debug: boolean) {\n enableDebugStackTracesLog = debug;\n}\n\n/**\n * Indicates if the global flag to indicate if we want to show debug messages in the browser console is enabled.\n */\nfunction isEnableDebugLog() {\n return enableDebugLog;\n}\n\n/**\n * Safely returns the text from the given fetch response or undefined if there is an error.\n */\nasync function safeFetchText(response: Response): Promise<string> {\n try {\n if (response) {\n return await response.text();\n }\n } catch (error) {\n consoleError('Error getting fetch text', error);\n }\n return undefined;\n}\n\n/**\n * Safely returns the text from the given fetch response or undefined if there is an error. This will also impose a\n * timeout on getting the text\n */\nasync function safeFetchTextWithTimeout(response: Response): Promise<string> {\n try {\n if (response) {\n return resolveOrTimeout(response.text(), 2000, 'Getting response text');\n }\n } catch (error) {\n consoleError('Error getting fetch text', error);\n }\n return undefined;\n}\n\n/**\n * Safely returns the json from the given fetch response or undefined if there is an error.\n */\nasync function safeFetchJSON(response: Response): Promise<any> {\n try {\n if (response) {\n return await response.json();\n }\n } catch (error) {\n consoleError('Error getting fetch json', error);\n }\n return undefined;\n}\n\n/**\n * Produces a hash of the given string using an implementation of djb2. This value may be negative. Note that this is\n * not a cryptographically secure hash and should not be used for security related items.\n *\n * @see http://www.cse.yorku.ca/~oz/hash.html\n */\nfunction djb2Hash(value: string): number {\n let index = value.length;\n let hash = 5381;\n\n while (index) {\n // eslint-disable-next-line no-bitwise\n hash = (hash * 33) ^ value.charCodeAt(--index);\n }\n\n return hash;\n}\n\n/**\n * Converts the given number in a sequence of alphabetic letters.\n */\nfunction toLetters(value: number): string {\n let result = '';\n\n while (value) {\n const charValue = value % CHARACTERS.length;\n const char = CHARACTERS.charAt(charValue);\n result += char;\n value = Math.floor(value / CHARACTERS.length);\n }\n\n return result;\n}\n\n/**\n * Produces a hash of the given string using an implementation of djb2 and converts it to alphabetic letters. Note that\n * this is not a cryptographically secure hash and should not be used for security related items.\n */\nfunction hashString(value: string): string {\n // Convert the given value into a string that's a hash.\n const letters = toLetters(Math.abs(djb2Hash(value)));\n\n // Convert any occurrences of \"ad\" (case-insensitive) into \"a_\". Apparently some ad blockers look for this\n // combination and can block classnames that have these characters in them.\n return letters.replace(/(a)(d)/gi, '$1_');\n}\n\n/**\n * Returns a {@link OnErrorData} that represents an error that occurred while rendering a component.\n */\nfunction createDidCatchErrorData(\n component: string,\n error: Error,\n errorInfo: ErrorInfo,\n isCatastrophicError?: boolean,\n): OnErrorData {\n return {\n errorType: OnErrorType.RENDER,\n message: `${component}.componentDidCatch`,\n otherData: {\n error,\n errorInfo,\n },\n catastrophicErrorType: isCatastrophicError ? CatastrophicErrorType.FAILED : null,\n };\n}\n\n/**\n * This function will calculate and return the necessary top padding percentage value that will help render a media\n * player with a responsive aspect ratio.\n */\nfunction getResponsiveElementPaddingValue(baseHeight = 180) {\n return `${100 / (320 / baseHeight)}%`;\n}\n\n/**\n * Indicates if the given file is valid for uploading. The file must still be in the edit step and it must not\n * contain an error.\n */\nfunction isValidForUpload(upload: FileUpload) {\n return upload.status === FileStatusValue.EDIT && !upload.isError;\n}\n\n/**\n * Calls the given onError function.\n */\nfunction callOnError(onError: (data: OnErrorData) => void, data: OnErrorData) {\n if (onError) {\n try {\n onError(data);\n } catch (error) {\n consoleError('Error calling onError', error);\n }\n }\n}\n\nfunction getBotName(useAITheme: boolean, config: AppConfig) {\n let botName;\n if (useAITheme) {\n botName = 'AI';\n } else {\n botName =\n config.public.__ibm__?.botNameOverride ||\n config.remote.initConfig.botName ||\n (config.asCarbonChat ? 'watsonx' : 'watsonx Assistant');\n }\n\n return botName;\n}\n\nexport {\n assertType,\n debugLog,\n consoleError,\n consoleInfo,\n consoleWarn,\n setEnableDebugLog,\n setEnableDebugStackTracesLog,\n safeFetchText,\n safeFetchJSON,\n hashString,\n toLetters,\n djb2Hash,\n createDidCatchErrorData,\n consoleDebug,\n consoleLog,\n isEnableDebugLog,\n debugStackTrace,\n getResponsiveElementPaddingValue,\n isValidForUpload,\n safeFetchTextWithTimeout,\n callOnError,\n getBotName,\n};\n","// Generated file. Do not edit\nexport var StatusCodes;\n(function (StatusCodes) {\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1\n *\n * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.\n */\n StatusCodes[StatusCodes[\"CONTINUE\"] = 100] = \"CONTINUE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2\n *\n * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.\n */\n StatusCodes[StatusCodes[\"SWITCHING_PROTOCOLS\"] = 101] = \"SWITCHING_PROTOCOLS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1\n *\n * This code indicates that the server has received and is processing the request, but no response is available yet.\n */\n StatusCodes[StatusCodes[\"PROCESSING\"] = 102] = \"PROCESSING\";\n /**\n * Official Documentation @ https://www.rfc-editor.org/rfc/rfc8297#page-3\n *\n * This code indicates to the client that the server is likely to send a final response with the header fields included in the informational response.\n */\n StatusCodes[StatusCodes[\"EARLY_HINTS\"] = 103] = \"EARLY_HINTS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1\n *\n * The request has succeeded. The meaning of a success varies depending on the HTTP method:\n * GET: The resource has been fetched and is transmitted in the message body.\n * HEAD: The entity headers are in the message body.\n * POST: The resource describing the result of the action is transmitted in the message body.\n * TRACE: The message body contains the request message as received by the server\n */\n StatusCodes[StatusCodes[\"OK\"] = 200] = \"OK\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2\n *\n * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.\n */\n StatusCodes[StatusCodes[\"CREATED\"] = 201] = \"CREATED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3\n *\n * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.\n */\n StatusCodes[StatusCodes[\"ACCEPTED\"] = 202] = \"ACCEPTED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4\n *\n * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.\n */\n StatusCodes[StatusCodes[\"NON_AUTHORITATIVE_INFORMATION\"] = 203] = \"NON_AUTHORITATIVE_INFORMATION\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5\n *\n * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.\n */\n StatusCodes[StatusCodes[\"NO_CONTENT\"] = 204] = \"NO_CONTENT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6\n *\n * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.\n */\n StatusCodes[StatusCodes[\"RESET_CONTENT\"] = 205] = \"RESET_CONTENT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1\n *\n * This response code is used because of range header sent by the client to separate download into multiple streams.\n */\n StatusCodes[StatusCodes[\"PARTIAL_CONTENT\"] = 206] = \"PARTIAL_CONTENT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2\n *\n * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.\n */\n StatusCodes[StatusCodes[\"MULTI_STATUS\"] = 207] = \"MULTI_STATUS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1\n *\n * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.\n */\n StatusCodes[StatusCodes[\"MULTIPLE_CHOICES\"] = 300] = \"MULTIPLE_CHOICES\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2\n *\n * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.\n */\n StatusCodes[StatusCodes[\"MOVED_PERMANENTLY\"] = 301] = \"MOVED_PERMANENTLY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3\n *\n * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.\n */\n StatusCodes[StatusCodes[\"MOVED_TEMPORARILY\"] = 302] = \"MOVED_TEMPORARILY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4\n *\n * Server sent this response to directing client to get requested resource to another URI with an GET request.\n */\n StatusCodes[StatusCodes[\"SEE_OTHER\"] = 303] = \"SEE_OTHER\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1\n *\n * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.\n */\n StatusCodes[StatusCodes[\"NOT_MODIFIED\"] = 304] = \"NOT_MODIFIED\";\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6\n *\n * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.\n */\n StatusCodes[StatusCodes[\"USE_PROXY\"] = 305] = \"USE_PROXY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7\n *\n * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n StatusCodes[StatusCodes[\"TEMPORARY_REDIRECT\"] = 307] = \"TEMPORARY_REDIRECT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3\n *\n * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n StatusCodes[StatusCodes[\"PERMANENT_REDIRECT\"] = 308] = \"PERMANENT_REDIRECT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1\n *\n * This response means that server could not understand the request due to invalid syntax.\n */\n StatusCodes[StatusCodes[\"BAD_REQUEST\"] = 400] = \"BAD_REQUEST\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1\n *\n * Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response.\n */\n StatusCodes[StatusCodes[\"UNAUTHORIZED\"] = 401] = \"UNAUTHORIZED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2\n *\n * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.\n */\n StatusCodes[StatusCodes[\"PAYMENT_REQUIRED\"] = 402] = \"PAYMENT_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3\n *\n * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.\n */\n StatusCodes[StatusCodes[\"FORBIDDEN\"] = 403] = \"FORBIDDEN\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4\n *\n * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.\n */\n StatusCodes[StatusCodes[\"NOT_FOUND\"] = 404] = \"NOT_FOUND\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5\n *\n * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.\n */\n StatusCodes[StatusCodes[\"METHOD_NOT_ALLOWED\"] = 405] = \"METHOD_NOT_ALLOWED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6\n *\n * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.\n */\n StatusCodes[StatusCodes[\"NOT_ACCEPTABLE\"] = 406] = \"NOT_ACCEPTABLE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2\n *\n * This is similar to 401 but authentication is needed to be done by a proxy.\n */\n StatusCodes[StatusCodes[\"PROXY_AUTHENTICATION_REQUIRED\"] = 407] = \"PROXY_AUTHENTICATION_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7\n *\n * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.\n */\n StatusCodes[StatusCodes[\"REQUEST_TIMEOUT\"] = 408] = \"REQUEST_TIMEOUT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8\n *\n * This response is sent when a request conflicts with the current state of the server.\n */\n StatusCodes[StatusCodes[\"CONFLICT\"] = 409] = \"CONFLICT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9\n *\n * This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for \"limited-time, promotional services\". APIs should not feel compelled to indicate resources that have been deleted with this status code.\n */\n StatusCodes[StatusCodes[\"GONE\"] = 410] = \"GONE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10\n *\n * The server rejected the request because the Content-Length header field is not defined and the server requires it.\n */\n StatusCodes[StatusCodes[\"LENGTH_REQUIRED\"] = 411] = \"LENGTH_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2\n *\n * The client has indicated preconditions in its headers which the server does not meet.\n */\n StatusCodes[StatusCodes[\"PRECONDITION_FAILED\"] = 412] = \"PRECONDITION_FAILED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11\n *\n * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.\n */\n StatusCodes[StatusCodes[\"REQUEST_TOO_LONG\"] = 413] = \"REQUEST_TOO_LONG\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12\n *\n * The URI requested by the client is longer than the server is willing to interpret.\n */\n StatusCodes[StatusCodes[\"REQUEST_URI_TOO_LONG\"] = 414] = \"REQUEST_URI_TOO_LONG\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13\n *\n * The media format of the requested data is not supported by the server, so the server is rejecting the request.\n */\n StatusCodes[StatusCodes[\"UNSUPPORTED_MEDIA_TYPE\"] = 415] = \"UNSUPPORTED_MEDIA_TYPE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4\n *\n * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.\n */\n StatusCodes[StatusCodes[\"REQUESTED_RANGE_NOT_SATISFIABLE\"] = 416] = \"REQUESTED_RANGE_NOT_SATISFIABLE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14\n *\n * This response code means the expectation indicated by the Expect request header field can't be met by the server.\n */\n StatusCodes[StatusCodes[\"EXPECTATION_FAILED\"] = 417] = \"EXPECTATION_FAILED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2\n *\n * Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout.\n */\n StatusCodes[StatusCodes[\"IM_A_TEAPOT\"] = 418] = \"IM_A_TEAPOT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.\n */\n StatusCodes[StatusCodes[\"INSUFFICIENT_SPACE_ON_RESOURCE\"] = 419] = \"INSUFFICIENT_SPACE_ON_RESOURCE\";\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt\n *\n * A deprecated response used by the Spring Framework when a method has failed.\n */\n StatusCodes[StatusCodes[\"METHOD_FAILURE\"] = 420] = \"METHOD_FAILURE\";\n /**\n * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2\n *\n * Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI.\n */\n StatusCodes[StatusCodes[\"MISDIRECTED_REQUEST\"] = 421] = \"MISDIRECTED_REQUEST\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3\n *\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n StatusCodes[StatusCodes[\"UNPROCESSABLE_ENTITY\"] = 422] = \"UNPROCESSABLE_ENTITY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4\n *\n * The resource that is being accessed is locked.\n */\n StatusCodes[StatusCodes[\"LOCKED\"] = 423] = \"LOCKED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5\n *\n * The request failed due to failure of a previous request.\n */\n StatusCodes[StatusCodes[\"FAILED_DEPENDENCY\"] = 424] = \"FAILED_DEPENDENCY\";\n /**\n * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15\n *\n * The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.\n */\n StatusCodes[StatusCodes[\"UPGRADE_REQUIRED\"] = 426] = \"UPGRADE_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3\n *\n * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.\n */\n StatusCodes[StatusCodes[\"PRECONDITION_REQUIRED\"] = 428] = \"PRECONDITION_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4\n *\n * The user has sent too many requests in a given amount of time (\"rate limiting\").\n */\n StatusCodes[StatusCodes[\"TOO_MANY_REQUESTS\"] = 429] = \"TOO_MANY_REQUESTS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5\n *\n * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.\n */\n StatusCodes[StatusCodes[\"REQUEST_HEADER_FIELDS_TOO_LARGE\"] = 431] = \"REQUEST_HEADER_FIELDS_TOO_LARGE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7725\n *\n * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.\n */\n StatusCodes[StatusCodes[\"UNAVAILABLE_FOR_LEGAL_REASONS\"] = 451] = \"UNAVAILABLE_FOR_LEGAL_REASONS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1\n *\n * The server encountered an unexpected condition that prevented it from fulfilling the request.\n */\n StatusCodes[StatusCodes[\"INTERNAL_SERVER_ERROR\"] = 500] = \"INTERNAL_SERVER_ERROR\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2\n *\n * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.\n */\n StatusCodes[StatusCodes[\"NOT_IMPLEMENTED\"] = 501] = \"NOT_IMPLEMENTED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3\n *\n * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.\n */\n StatusCodes[StatusCodes[\"BAD_GATEWAY\"] = 502] = \"BAD_GATEWAY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4\n *\n * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.\n */\n StatusCodes[StatusCodes[\"SERVICE_UNAVAILABLE\"] = 503] = \"SERVICE_UNAVAILABLE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5\n *\n * This error response is given when the server is acting as a gateway and cannot get a response in time.\n */\n StatusCodes[StatusCodes[\"GATEWAY_TIMEOUT\"] = 504] = \"GATEWAY_TIMEOUT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6\n *\n * The HTTP version used in the request is not supported by the server.\n */\n StatusCodes[StatusCodes[\"HTTP_VERSION_NOT_SUPPORTED\"] = 505] = \"HTTP_VERSION_NOT_SUPPORTED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.\n */\n StatusCodes[StatusCodes[\"INSUFFICIENT_STORAGE\"] = 507] = \"INSUFFICIENT_STORAGE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6\n *\n * The 511 status code indicates that the client needs to authenticate to gain network access.\n */\n StatusCodes[StatusCodes[\"NETWORK_AUTHENTICATION_REQUIRED\"] = 511] = \"NETWORK_AUTHENTICATION_REQUIRED\";\n})(StatusCodes || (StatusCodes = {}));\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { ChatInstanceMessaging, CustomSendMessageOptions } from 'internal-packages/types/messaging';\nimport { MessageRequest } from 'submodules/wa-fd-types-public/wa-types-chat';\nimport { HistoryItem } from 'submodules/wa-fd-types-public/wa-types-chat-extensions';\n\ndeclare module 'internal-packages/types/ChatInstance' {\n export interface ChatActions {\n /**\n * Messaging actions for a chat instance.\n */\n messaging: ChatInstanceMessaging;\n }\n}\n\ndeclare module 'internal-packages/types/PublicConfig' {\n export interface PublicConfig {\n /**\n * In a cloud private deployment (CPD) the customer may have an instance of Orchestrate deployed as well as an\n * instance of Assistant. In order for the Orchestrate form code within web chat to connect with its deployment we\n * need to pass the form code a url value for where it's deployment is located. Web chat will get this url value\n * from tooling who is both setting it within the web chat previews, and specifying it on web chat's embed tab.\n * Tooling is getting this value from an environment variable that is set by Assistant the first time tooling is\n * opened from Orchestrate. If Assistant is opened directly, not through Orchestrate, then we will not have a value\n * for this url and will not be able to create a form. This is a known issue that effects tooling functionality as\n * well.\n */\n orchestratePrivateHostURL?: string;\n\n /**\n * Configuration items specific to the functionality for watsonx Orchestrate.\n */\n wxo?: WXOConfig;\n }\n\n export interface PublicConfigMessaging {\n /**\n * A callback for web chat to use to send messages to the assistant. When this is provided, this will be used as\n * an alternative for its built-in message service. Note that this is not used for human agent communication\n * (except for the event messages to update history).\n *\n * Web chat will queue up any additional user messages until the Promise from a previous call to customSendMessage\n * has resolved. This does not include event messages. If the Promise rejects, an error indicator will be\n * displayed next to the user's message.\n *\n * If the request takes longer than PublicConfigMessaging.messageTimeoutSecs than the AbortSignal will be sent.\n */\n customSendMessage?: (\n request: MessageRequest,\n requestOptions: CustomSendMessageOptions,\n instance: ChatInstance,\n ) => Promise<void> | void;\n\n /**\n * This is a callback function that is used by web chat to retrieve history data for populating the web chat. If\n * this function is defined, it will be used instead of any other mechanism for fetching history.\n */\n customLoadHistory?: (instance: ChatInstance) => Promise<HistoryItem[]>;\n }\n}\n\nexport interface WXOConfig {\n /**\n * Returns a list of all the assistants that a user may communicate with.\n *\n * @deprecated\n */\n getAssistantList?: () => Promise<WXOAssistantOption[]>;\n\n /**\n * Returns a list of all the mentions that a user may communicate with.\n */\n getMentionList?: () => Promise<WXOMentionOption[]>;\n}\n\nexport interface WXOAssistantOption {\n /**\n * The name of the assistant (with no \"@\" in it).\n */\n assistantName: string;\n\n /**\n * A unique identifier of the assistant.\n */\n assistantID: string;\n}\n\nexport enum WXOMentionType {\n APP = 'app',\n ASSISTANT = 'assistant',\n}\n\nexport interface WXOMentionOption {\n /**\n * The id of the mention option.\n */\n id: string;\n\n /**\n * The name of the mention option (with no \"@\" in it).\n */\n name: string;\n\n /**\n * The categorical type of the mention option.\n */\n type: WXOMentionType;\n}\n\n// A completion option of either a mention option or assistant option for backwards compatibility.\nexport type WXOCompletionOption = WXOMentionOption | WXOAssistantOption;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { LanguagePack } from 'internal-packages/types/apiTypes';\nimport { HomeScreenConfig } from 'internal-packages/types/HomeScreenConfig';\nimport { LauncherExtendedConfig, PublicConfig } from 'internal-packages/types/PublicConfig';\nimport { HistoryNote } from 'submodules/wa-fd-types-public/history-types';\nimport { DeepPartial } from 'ts-essentials';\n\nimport type { UICustomizationEventType } from './eventBusTypes';\nimport { Fetch } from './Fetch';\nimport { RemoteInitConfig, RemoteMainConfig } from './RemoteConfig';\n\nexport interface IBMConfig {\n /**\n * Allow individual features to be enabled by feature name.\n */\n enableFeatures?: Record<string, boolean>;\n\n /**\n * The version of fetch for web to use. This allows for a mock fetch to be installed.\n */\n fetch?: Fetch;\n\n /**\n * Pass in a title that will override botName in config.remote. This is so we can give Purina a name until naming\n * your bot is available in the tooling.\n */\n botNameOverride?: string;\n\n /**\n * Pass in an image url that will override botAvatarURL in config.remote. This is so we can give customers an avatar\n * until adding an avatar is available in the tooling.\n */\n botAvatarURLOverride?: string;\n\n /**\n * The full URL to use to send messages to watsonx Assistant. If an integration ID is required, it will need to be\n * included in this URL.\n */\n customMessageURL?: string;\n\n /**\n * The full URL to use to load the initial config information for the chat widget. This is used when the widget\n * is initially loaded on a page and before it is opened. If an integration ID is required, it will need to be\n * included in this URL.\n */\n customInitConfigURL?: string;\n\n /**\n * The full URL to use to load config information for the chat widget. This is used when the widget is opened and\n * additional config information beyond the init config is needed. If an integration ID is required, it will need\n * to be included in this URL.\n */\n customConfigURL?: string;\n\n /**\n * The prefix for the URL to use to load history information for the chat widget. If an integration ID is required,\n * it will need to be included in this URL. The session ID will be appended to this URL when the history is requested.\n */\n customHistoryPrefix?: string;\n\n /**\n * Additional headers to include on message calls to the assistant.\n */\n messageHeaders?: Record<string, string>;\n\n /**\n * This is a callback function that is used by web chat to retrieve history data for populating the web chat. If\n * this function is defined, it will be used instead of any other mechanism for fetching history.\n *\n * @see PublicConfigMessaging.customLoadHistory\n * @deprecated\n */\n customLoadHistory?: (\n sessionID: string,\n regionHostname: string,\n publicConfig: PublicConfig,\n ) => Promise<{ notes: HistoryNote[] }>;\n\n /**\n * The version of the chat widget to use. This value may specify \"latest\" or it may specify a partial version such\n * as \"1.5\" (which would cover anything that is \"1.5.x\". If no matching version is found, an error will be logged\n * and the latest version will be used.\n *\n * @see PublicConfig.clientVersion for more information.\n * @deprecated\n */\n versionToUse?: string;\n\n /**\n * For web chats that are used in tooling this indicates where in tooling it is being used.\n */\n toolingType?: ToolingType;\n\n /**\n * Indicates if web chat should be put into a readonly mode. This means that the input field will be hidden and no\n * buttons or other interactive elements that may appear in messages will be interactive. This will also disable\n * the home screen as well as suggestions.\n */\n isReadonly?: boolean;\n\n /**\n * Indicates if the widget should use the mock service desk if one is not already defined by the remote config.\n */\n allowMockServiceDesk?: boolean;\n\n /**\n * Add a bunch of noisy amplitude track object console.log messages!\n */\n logTrackObjects?: boolean;\n\n /**\n * Makes some private IBM internal methods available on the external interface. Currently, these are mostly used for\n * live theming in the tooling.\n */\n allowPrivateMethods?: boolean;\n\n /**\n * Indicates if Amplitude tracking should be enabled.\n */\n isTrackingEnabled?: boolean;\n\n /**\n * An object with strings in the format of the .json files in languages. See languages/README.md for more details.\n * This setting will replace all of the strings normally provided by default based on your options.locale. It must\n * contain a full set of strings since this is a replacement and not a merge. This value may get copied into the\n * current application state where it can be updated after the application has started.\n */\n languagePack?: LanguagePack;\n\n /**\n * This is a map that can be used to override the values for CSS variables in the application. Each key of the map\n * is the name of a variable (without the \"--cds-chat-\" prefix) and the value is whatever the value of\n * the variable should be set at. There are two similar maps located in the remote and public config that\n * perform the same function. Any individual value present in the public config will override the same value if it\n * is present in the remote config. Keys in the remote config with an empty string value are ignored.\n */\n cssVariables?: Record<string, string>;\n\n /**\n * Locale to use for UI strings and date string formatting. See languages/README.md for available locales. If not\n * provided, this will be auto-detected by browser preference. Defaults to English US (en) if not provided or\n * detected language is not an accepted language. This value may get copied into the current application state\n * where it can be updated after the application has started.\n */\n locale?: string;\n\n /**\n * Home screen configuration.\n */\n homeScreenConfig?: HomeScreenConfig;\n\n /**\n * Indicates if the welcome node should be skipped when the web chat is hydrating.\n *\n * @deprecated Use {@link PublicConfigMessaging.skipWelcome}.\n */\n skipWelcome?: boolean;\n\n /**\n * Skips the loading of the remote init and main configs from the server. An empty config will be used instead.\n *\n * @deprecated Use {@link PublicConfigMessaging.skipConfig}.\n */\n skipConfig?: boolean;\n\n /**\n * Provides a mechanism for overriding the init config that is received from the server. This property should not\n * be made public outside our development team.\n *\n * @deprecated Use {@link ServersConfig.initConfig}.\n */\n overrideRemoteInitConfig?: DeepPartial<RemoteInitConfig>;\n\n /**\n * Provides a mechanism for overriding the main config that is received from the server. This property should not\n * be made public outside our development team.\n *\n * @deprecated Use {@link ServersConfig.mainConfig}.\n */\n overrideRemoteMainConfig?: DeepPartial<RemoteMainConfig>;\n\n /**\n * An array of the UI customization events that should be enabled and will be fired.\n */\n enableUICustomEvents?: UICustomizationEventType[];\n\n /**\n * Disables the scrolling behavior that occurs when web chat is opened and session history is loaded.\n */\n disableInitialScroll?: boolean;\n\n /**\n * Determines if the minimize button should render an x icon (x) instead of the subtract icon (-).\n *\n * @deprecated Use {@link PublicConfig.headerConfig}.\n */\n useCloseIcon?: boolean;\n\n /**\n * This tells web chat how to handle CTA cards.\n */\n connectToAgentBehavior?: ConnectToAgentBehaviorType;\n\n /**\n * Used to override the IS_MOBILE flag in order to render the extended launcher in desktop.\n */\n renderExtendedLauncher?: boolean;\n\n /**\n * The config object that controls the launcher extended animations.\n */\n launcherExtendedConfig?: LauncherExtendedConfig;\n\n /**\n * This flag is used to show a preview of the launcher within tooling. If desktop is set then the\n * launcherDesktopContainer will render and if mobile is set then the launcherMobileContainer will render. Both\n * versions will render without their complex initial animations or subtle subsequent page load animations, instead\n * they will just appear so tanya can see what her title string will look like within the launcher. The launchers will\n * also be disabled when this property is enabled.\n */\n launcherToolingPreview?: LauncherToolingPreviewType.DESKTOP | LauncherToolingPreviewType.MOBILE;\n\n /**\n * This flag is used to disable web chat's rounded corners. Web chat exists in places within tooling as a preview\n * which depend on web chat having sharp corners, so this flag exists to let tooling devs temporarily resolve visual\n * issues.\n */\n disableRoundCorners?: boolean;\n\n /**\n * If set, this will export the instance of web chat as a window property using the value of this property.\n */\n exportInstance?: string;\n\n /**\n * Disables the message service so that it does not send messages to the assistant.\n */\n disableMessageService?: boolean;\n\n /**\n * Changes the timeout used by the message service when making message calls to watsonx Assistant. The timeout is\n * in seconds. The default is 40 seconds.\n */\n messageTimeoutSecs?: number;\n\n /**\n * Changes web chat to use shadow dom mode. This will mean no #WACContainer.WACContainer or ids of any kind. It will\n * mean that any CSS for user_defined response types must be injected into the response and not the parent page.\n */\n useShadowRoot?: boolean;\n\n /**\n * Indicates if the entry script should load the exact version of web chat specified in clientVersion. By default, the\n * entry script will load that same version that it was built with but for named branches, we may want to use a\n * different version.\n */\n useExactVersion?: boolean;\n}\n\n/**\n * Web chat is used in a bunch of different places in tooling for different reasons. This enum is meant to represent\n * each of those and will help us identify and control the behavior in each of the different places.\n */\nexport enum ToolingType {\n /**\n * This represents the web chat previews that are displayed within the web chat integration settings pages.\n */\n WEB_CHAT_SETTINGS = 'web-chat-settings',\n\n /**\n * This the web chat that appears on the page where you get the preview link but it is not the actual preview link\n * itself. In the old IA this web chat is the preview link integration. In the new IA, this web chat is the draft\n * web chat integration.\n */\n ASSISTANT_PREVIEW = 'assistant-preview',\n\n /**\n * This is the web chat used by on the preview share link page.\n */\n PREVIEW_LINK = 'preview-link',\n\n /**\n * This is the web chat used for preview when authoring actions.\n */\n ACTIONS = 'actions',\n\n /**\n * This is the web chat used for preview of a search skill.\n */\n SEARCH = 'search',\n\n /**\n * This is the web chat used for displaying the conversation history from the logs on the analytics pages.\n */\n ANALYTICS = 'analytics',\n}\n\n/**\n * When the user gets a \"connect_to_agent\" response the normal behavior is to show a \"Connect to agent\" card.\n * However, this only works if a service desk has been configured. In some tooling places that use web chat there is\n * no service desk configuration. This enum represents the different ways the web chat can respond to a CTA.\n */\nexport enum ConnectToAgentBehaviorType {\n /**\n * This is the default behavior and it will cause an error message to be shown to the user when there is no\n * service desk configured. This error is targeted at the end user.\n */\n ERROR_MISSING = 'error',\n\n /**\n * This behavior is the same as the preview case except that it also displays a warning targeted for the authoring\n * user instead of the end user. This is to help her understand that she is missing some configuration.\n */\n WARN_MISSING = 'warning',\n\n /**\n * This indicates that the CTA card should be displayed in a disabled state if there is no service desk configured.\n */\n PREVIEW = 'preview',\n}\n\nexport enum LauncherToolingPreviewType {\n DESKTOP = 'desktop',\n MOBILE = 'mobile',\n}\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/* eslint-disable prefer-destructuring */\n// We don't want to do destructuring on process.env so webpack/rollup can do its replacements.\n\n// Webpack/rollup will replace any \"process.env.*\" values below that it recognizes at compile time with their corresponding\n// values at that time.\n\nconst VERSION = process.env.VERSION;\n\n// This is the hostname to bind to in the local development mode. This can be used if you want to make the server\n// accessible to external application that cannot directly access \"localhost\".\nconst LOCAL_BIND_HOST = process.env.LOCAL_BIND_HOST;\n\n// PRODUCTION ENV VARIABLES\n// These env variables are used in production (as well as development)\n\n// CDN location of JS. Usually we set this to localhost:9346 while developing. In preview link we use the value. In\n// Loader we infer from set region.\nconst WWX_CDN_ENDPOINT = process.env.WWX_CDN_ENDPOINT;\n\n// Amplitude API Key for environment.\n// Defaulted to test API key.\nconst AMPLITUDE_API_KEY = process.env.AMPLITUDE_API_KEY;\n\n// DEVELOPMENT ENV VARIABLES for new npm run dev:new\n// These env variables are used in development and should not be set in production.\n\n// Source maps used during local development.\nconst SOURCE_MAPS_TYPE = process.env.SOURCE_MAPS_TYPE;\n\n// DEVELOPMENT ENV VARIABLES for legacy npm run dev.\n// These env variables are used in development and should not be set in production.\n\n// We use this in development to tell webpack dev server where to load external CSS and JS for example page.\nconst CHAT_RESOURCE_ENDPOINT = process.env.CHAT_RESOURCE_ENDPOINT;\n\n// We use this in development to tell webpack dev server with integration instance id to target instead of doing it in\n// the url. Region is also injected in Loader in watch mode.\nconst DEFAULT_INTEGRATION_INSTANCE_ID = process.env.DEFAULT_INTEGRATION_INSTANCE_ID;\nconst DEFAULT_INTEGRATION_SUBSCRIPTION_ID = process.env.DEFAULT_INTEGRATION_SUBSCRIPTION_ID;\nconst BOT_AVATAR_URL_OVERRIDE = process.env.BOT_AVATAR_URL_OVERRIDE;\nconst DEFAULT_REGION = process.env.DEFAULT_REGION;\n// eslint-disable-next-line prefer-destructuring\nconst DEFAULT_SERVICE_INSTANCE_ID = process.env.DEFAULT_SERVICE_INSTANCE_ID;\n\n// Specify where to fetch the integration config. This is normally left unset and is inferred from region.\nconst CUSTOM_CONFIG_URL = process.env.CUSTOM_CONFIG_URL;\nconst CUSTOM_INIT_CONFIG_URL = process.env.CUSTOM_INIT_CONFIG_URL;\n\n// Specify where to fetch history. This is normally left unset and is inferred from region.\nconst CUSTOM_HISTORY_PREFIX = process.env.CUSTOM_HISTORY_PREFIX;\n\n// Specify where to post messages. This is normally left unset and is inferred from region.\nconst CUSTOM_MESSAGE_URL = process.env.CUSTOM_MESSAGE_URL;\n\n// Specify where the wxo mfe is hosted. This is normally left unset and is inferred from WWX_CDN_ENDPOINT.\nconst WXO_ENDPOINT = process.env.WXO_ENDPOINT;\n\nconst ALLOW_MOCK_SERVICE_DESK = process.env.ALLOW_MOCK_SERVICE_DESK;\n\nconst LOG_TRACK_OBJECTS = process.env.LOG_TRACK_OBJECTS;\n\nconst IS_TRACKING_ENABLED = process.env.IS_TRACKING_ENABLED;\n\nconst NODE_ENV = process.env.NODE_ENV;\n\nexport {\n VERSION,\n LOCAL_BIND_HOST,\n WWX_CDN_ENDPOINT,\n AMPLITUDE_API_KEY,\n SOURCE_MAPS_TYPE,\n CHAT_RESOURCE_ENDPOINT,\n DEFAULT_INTEGRATION_INSTANCE_ID,\n DEFAULT_INTEGRATION_SUBSCRIPTION_ID,\n BOT_AVATAR_URL_OVERRIDE,\n DEFAULT_REGION,\n DEFAULT_SERVICE_INSTANCE_ID,\n CUSTOM_CONFIG_URL,\n CUSTOM_INIT_CONFIG_URL,\n CUSTOM_HISTORY_PREFIX,\n CUSTOM_MESSAGE_URL,\n WXO_ENDPOINT,\n ALLOW_MOCK_SERVICE_DESK,\n LOG_TRACK_OBJECTS,\n IS_TRACKING_ENABLED,\n NODE_ENV,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { resolveOrTimeout, sleep } from '../utils/lang/promiseUtils';\nimport { consoleError } from '../utils/miscUtils';\n\n/**\n * This type represents the function that is passed to the doWithRetry function that will execute the operation.\n *\n * @param attemptNumber The number of the attempt that is being performed. The first value starts at 1.\n */\ntype RetryFunction<T> = (attemptNumber: number) => Promise<T>;\n\n/**\n * The default set of response codes allowed by a fetch call.\n */\nconst DEFAULT_ALLOWED_RESPONSES: Set<number> = new Set([200]);\n\n/**\n * Performs the requested operation and executes a retry if it fails. The number of retries and the delays between\n * each attempt are governed by the given array of delay times. A call is considered a failure if it throws an error\n * (returns a rejected Promise).\n *\n * @param retryFunction The function to call for each attempt. If this function returns, if will be considered a success\n * and the returned value will be returned from this function. If the function throws an error (or rejects the\n * Promise), that will be considered a failure and the function will be retried.\n * @param delayTimes The delays in milliseconds to wait after every failed attempt. This function will make one\n * attempt more than what's in the array since there will be no delay after the final attempt if it fails.\n * @param operationTitle A label to use in the console output to describe this operation for debugging purposes.\n * @returns Returns the result from the last successful executor attempt.\n * @throws If all the attempts fail and the retries give up, this will throw the last error that was thrown by the\n * retry function.\n */\nasync function doWithRetry<T>(\n retryFunction: RetryFunction<T>,\n delayTimes: number[],\n operationTitle: string,\n): Promise<T> {\n let attemptNumber = 1;\n while (attemptNumber - 1 <= delayTimes.length) {\n try {\n // eslint-disable-next-line no-await-in-loop\n const result = await retryFunction(attemptNumber);\n return result;\n } catch (error) {\n if (attemptNumber - 1 === delayTimes.length) {\n // This was the last attempt, so just output the error message and continue.\n const message = `The operation \"${operationTitle}\" failed after ${attemptNumber} attempts and will not be retried.`;\n consoleError(message, error);\n throw error;\n } else {\n // The operation failed and a retry is available, so output an error and then sleep for the desired amount\n // of time.\n const delayTime = delayTimes[attemptNumber - 1];\n\n consoleError(\n `The operation \"${operationTitle}\" failed after ${attemptNumber} attempts will be retried in ${delayTime}ms.`,\n error,\n );\n\n // eslint-disable-next-line no-await-in-loop\n await sleep(delayTime);\n }\n }\n\n attemptNumber++;\n }\n\n // This condition shouldn't actually happen.\n throw new Error(`Unexpected retry state for operation \"${operationTitle}\".`);\n}\n\n/**\n * Executes a {@link doWithRetry} with the additional condition that it must complete within the given timeout or\n * the call will fail.\n *\n * @param retryFunction The function to call for each attempt. If this function returns, if will be considered a success\n * and the returned value will be returned from this function. If the function throws an error (or rejects the\n * Promise), that will be considered a failure and the function will be retried.\n * @param delayTimes The delays in milliseconds to wait after every failed attempt. This function will make one\n * attempt more than what's in the array since there will be no delay after the final attempt if it fails.\n * @param operationTitle A label to use in the console output to describe this operation for debugging purposes.\n * @param timeoutMs The amount of time in milliseconds to wait before a timeout occurs.\n * @returns Returns the result from the last successful executor attempt.\n * @throws If all the attempts fail and the retries give up or if the timeout occurs, this will throw an error.\n */\nasync function doWithRetryWithTimeout<T>(\n retryFunction: RetryFunction<T>,\n delayTimes: number[],\n operationTitle: string,\n timeoutMs: number,\n) {\n return resolveOrTimeout(doWithRetry(retryFunction, delayTimes, operationTitle), timeoutMs);\n}\n\n/**\n * A simple utility function that will wrap a call to fetch that will throw an error is the result is not one of the\n * expected status codes (200 by default).\n *\n * @param responsePromise The response promise to wait for and then check the status code.\n * @param allowedCodes The set of allowed response codes that will not result in an error being thrown.\n */\nasync function throwOnStatus(\n responsePromise: Promise<Response>,\n allowedCodes: Set<number> = DEFAULT_ALLOWED_RESPONSES,\n): Promise<Response> {\n const response = await responsePromise;\n if (!allowedCodes.has(response.status)) {\n throw new Error(`Status code error ${response.status}`);\n }\n\n return responsePromise;\n}\n\nexport { doWithRetry, doWithRetryWithTimeout, throwOnStatus };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Pre-populate global web chat config. This is stored on window to make sure that if there are multiple web chats\n * loaded on a page in the same or different ways, that they are forced to use the same version of web chat and use\n * unique namespaces. Note that these object are read and set by multiple versions of web chat.\n *\n * watsonAssistantChatSharedConfig should not contain breaking changes.\n */\nfunction ensureChatBrowserWindowConfigExists() {\n window.watsonAssistantChatSharedConfig = window.watsonAssistantChatSharedConfig || {};\n window.watsonAssistantChatSharedConfig.namespaces = window.watsonAssistantChatSharedConfig.namespaces || [];\n window.watsonAssistantChatSharedConfig.loadScriptPromises =\n window.watsonAssistantChatSharedConfig.loadScriptPromises || {};\n}\n\nfunction getSharedConfig() {\n return window.watsonAssistantChatSharedConfig;\n}\n\nfunction setRequestedSharedConfigVersion(requestedVersion: string) {\n window.watsonAssistantChatSharedConfig.requestedVersion = requestedVersion;\n}\n\nexport { ensureChatBrowserWindowConfigExists, getSharedConfig, setRequestedSharedConfigVersion };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { consoleError, djb2Hash } from '../utils/miscUtils';\nimport { ensureChatBrowserWindowConfigExists, getSharedConfig } from '../utils/sharedConfigUtils';\n\nclass NamespaceService {\n /**\n * The full provided namespace name.\n */\n public readonly originalName: string;\n\n /**\n * The namespace stripped of characters not safe to use in an attribute name in HTML. This is an empty string if\n * originalName is equal to the default.\n */\n public readonly attributeSafe: string;\n\n /**\n * The attribute safe namespace prepended by `--` to be used as a suffix on attributes like ID or class.\n * This is an empty string if originalName is equal by default.\n */\n public readonly suffix: string;\n\n constructor(namespace?: string) {\n this.originalName = namespace;\n this.attributeSafe = getAttributeSafe(namespace);\n this.suffix = getSuffix(namespace);\n }\n\n /**\n * Remove a current namespace when the chat is destroyed.\n */\n remove() {\n removeNamespace(this.originalName);\n }\n}\n\n/**\n * From a given namespace, generate a unique token safe to be used as an attribute or as part of one.\n * If no namespace provided, returns an empty string.\n */\nfunction getAttributeSafe(namespace?: string) {\n const computedName = computeNamespaceName(namespace);\n return computedName?.length ? `ns${djb2Hash(computedName)}` : '';\n}\n\n/**\n * From a given namespace, generate a unique token safe to be used as a suffix to a classname or attribute.\n * If no namespace provided, returns an empty string.\n */\nfunction getSuffix(namespace?: string) {\n const computedName = computeNamespaceName(namespace);\n return computedName?.length ? `--${getAttributeSafe(namespace)}` : '';\n}\n\n/**\n * Given a namespace, trims and returns. If no namespace provided, returns an empty string.\n */\nfunction computeNamespaceName(namespace?: string) {\n return namespace ? namespace.trim() : '';\n}\n\n/**\n * Validates if a namespace is already in use.\n */\nfunction validateNamespace(namespace?: string, andAdd?: boolean) {\n ensureChatBrowserWindowConfigExists();\n const computedNamespace = computeNamespaceName(namespace);\n const sharedConfig = getSharedConfig();\n if (sharedConfig.namespaces.includes(computedNamespace)) {\n const namespaceForError = computedNamespace || 'No namespace provided';\n consoleError(`You have multiple web chats attempting to use the same namespace. (${namespaceForError})`);\n } else if (andAdd) {\n addNamespace(namespace);\n }\n}\n\n/**\n * Adds a namespace to the array of namespaces in use.\n */\nfunction addNamespace(namespace?: string) {\n ensureChatBrowserWindowConfigExists();\n const computedNamespace = computeNamespaceName(namespace);\n const { namespaces } = getSharedConfig();\n namespaces.push(computedNamespace);\n}\n\n/**\n * Removes a namespace from the array of namespaces in use.\n */\nfunction removeNamespace(namespace?: string) {\n ensureChatBrowserWindowConfigExists();\n const computedNamespace = computeNamespaceName(namespace);\n const { namespaces } = getSharedConfig();\n const namespaceIndexToRemove = namespaces.indexOf(computedNamespace);\n if (namespaceIndexToRemove !== -1) {\n namespaces.splice(namespaceIndexToRemove, 1);\n }\n}\n\nexport {\n NamespaceService,\n validateNamespace,\n addNamespace,\n removeNamespace,\n getSuffix,\n getAttributeSafe,\n computeNamespaceName,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { CarbonTheme } from 'internal-packages/types/PublicConfig';\n\nimport { HasClassName } from './HasClassName';\n\nenum CarbonThemeClassNames {\n WHITE = 'cds--white',\n G10 = 'cds--g10',\n G90 = 'cds--g90',\n G100 = 'cds--g100',\n}\n\nenum ButtonKindEnum {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DANGER = 'danger',\n GHOST = 'ghost',\n DANGER_PRIMARY = 'danger--primary',\n DANGER_GHOST = 'danger--ghost',\n DANGER_TERTIARY = 'danger--tertiary',\n TERTIARY = 'tertiary',\n}\n\nenum ButtonSizeEnum {\n SMALL = 'sm',\n MEDIUM = 'md',\n LARGE = 'lg',\n XLARGE = 'xl',\n XXLARGE = '2xl',\n}\n\nenum ButtonTooltipAlignmentEnum {\n START = 'start',\n CENTER = 'center',\n END = 'end',\n}\n\ninterface AiSkeletonTextProps extends HasClassName {\n /**\n * Generates skeleton text at a larger size.\n */\n heading?: boolean;\n\n /**\n * The number of lines shown if paragraph is true.\n */\n lineCount?: number;\n\n /**\n * Set this to true to generate multiple lines of text.\n */\n paragraph?: boolean;\n\n /**\n * Width (in px or %) of single line of text or max-width of paragraph lines.\n */\n width?: string;\n}\n\ninterface SkeletonTextProps extends HasClassName {\n /**\n * Generates skeleton text at a larger size.\n */\n heading?: boolean;\n\n /**\n * The number of lines shown if paragraph is true.\n */\n lineCount?: number;\n\n /**\n * Set this to true to generate multiple lines of text.\n */\n paragraph?: boolean;\n\n /**\n * Width (in px or %) of single line of text or max-width of paragraph lines.\n */\n width?: string;\n}\n\nexport { CarbonTheme, CarbonThemeClassNames, ButtonKindEnum, ButtonSizeEnum, SkeletonTextProps, AiSkeletonTextProps };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Configuration for the launcher.\n */\ninterface LauncherConfig {\n /**\n * Properties specific to the mobile launcher.\n */\n mobile: LauncherDeviceConfig;\n\n /**\n * Properties specific to the desktop launcher.\n */\n desktop: LauncherDeviceConfig;\n}\n\ninterface LauncherDeviceConfig {\n /**\n * The title that will be used by the expanded state of the launcher. If nothing is set in the config then a default\n * translated string will be used.\n */\n title: string;\n\n /**\n * The amount of time to wait before extending the launcher. If nothing is set then the default time of\n * 15s will be used.\n */\n time_to_expand: number;\n\n /**\n * Whether a new time_to_expand value has been set or not.\n */\n new_expand_time: boolean;\n\n /**\n * The amount of time to wait before reducing the extended launcher (This is only relevant to the mobile launcher\n * even though it exists within both configs).\n */\n time_to_reduce?: number;\n\n /**\n * Define the type of notification that is appearing.\n */\n notification_type: NotificationType;\n}\n\n// In the future we may want different types of notification messages, for example one of them will be a\n// text_notification. We're doing this to align with BED's notification schema.\nenum NotificationType {\n TEXT_NOTIFICATION = 'text_notification',\n}\n\n// The array of timeouts that will dictate the amount of intervals the bounce animation should play for the launcher.\nconst BOUNCING_ANIMATION_TIMEOUTS = [15000, 60000];\n\n// The amount of time until the entrance animation is automatically triggered for either launcher.\nconst TIME_TO_ENTRANCE_ANIMATION_START = 15000;\n\nexport {\n LauncherConfig,\n LauncherDeviceConfig,\n NotificationType,\n BOUNCING_ANIMATION_TIMEOUTS,\n TIME_TO_ENTRANCE_ANIMATION_START,\n};\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nexport default mergeWith;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * This file contains customizer functions for lodash utility functions that accept them.\n */\n\n/**\n * Returns the new array value which will replace the current value since we don't want both values to get merged.\n */\nfunction replaceCurrentArrayValue(currentValue: any, newValue: any) {\n if (Array.isArray(newValue)) {\n return newValue;\n }\n // Let the method itself handle merging non-array values.\n return undefined;\n}\n\nexport { replaceCurrentArrayValue };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport ObjectMap from 'internal-packages/shared/types/ObjectMap';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport merge from 'lodash-es/merge';\nimport mergeWith from 'lodash-es/mergeWith';\nimport reduce from 'lodash-es/reduce';\n\nimport { replaceCurrentArrayValue } from '../customizers';\n\n/* eslint-disable no-restricted-syntax */\n\n/**\n * Indicates if the given object contains any properties.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isEmptyObject(object: object) {\n // This is more efficient than using Object.keys because it will stop at the first property.\n for (const property in object) {\n if (Object.prototype.hasOwnProperty.call(object, property)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Receives an object with nested properties and flattens it to an object with no nesting.\n * Nested keys are joint by '-' as a delimiter\n * For example:\n * { test: { 'test1': 'testvalue' } } -> { 'test-test1': 'testvalue' }\n * For arrays:\n * { 'test': [ 'a', 'b', 'c' ] } -> { 'test-0': 'a', 'test-1': 'b', 'test-2', 'c' }\n *\n * @param object The object that needs flattening.\n * @param path (Optional) The stored accumulated path.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction flattenObjectKeys(object: object, path: string[] = []): object {\n if (!path) {\n path = [];\n }\n if (isPlainObject(object) || Array.isArray(object)) {\n return reduce(object, (cum, next, key) => merge(cum, flattenObjectKeys(next, [...path, key])), {});\n }\n return { [path.join('-')]: object };\n}\n\n/**\n * Takes an array of strings and add them to an ObjectMap as property names/keys with the given value set as the value\n * for each for.\n *\n * For example: fillObjectMap(['key1', 'key2']) => { key1: true, key2: true }\n *\n * @param keys The names of the properties/keys to add to the map.\n * @param value The value to set as the value for each property/key.\n */\nfunction fillObjectMap<T>(keys: string[], value: T = true as any): ObjectMap<T> {\n const objectMap: ObjectMap<any> = {};\n keys.forEach((item: string) => {\n objectMap[item] = value;\n });\n return objectMap;\n}\n\n/**\n * Merges the provided objects but does not merge arrays. Any new arrays found will overwrite a previous array.\n */\nfunction mergeNoArrays(...objects: Parameters<typeof mergeWith>) {\n return mergeWith(...objects, replaceCurrentArrayValue);\n}\n\n/**\n * Recursively deep freezes an object.\n */\nfunction deepFreeze(object: any) {\n Object.freeze(object);\n\n Object.getOwnPropertyNames(object).forEach(prop => {\n if (\n Object.prototype.hasOwnProperty.call(object, prop) &&\n object[prop] !== null &&\n (typeof object[prop] === 'object' || typeof object[prop] === 'function') &&\n !Object.isFrozen(object[prop])\n ) {\n deepFreeze(object[prop]);\n }\n });\n\n return object;\n}\n\nexport { isEmptyObject, flattenObjectKeys, fillObjectMap, mergeNoArrays, deepFreeze };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { compareVersions } from 'compare-versions';\nimport { PublicConfig } from 'internal-packages/shared/types/PublicConfig';\n\nimport { VERSION } from '../environmentVariables.js';\nimport {\n ensureChatBrowserWindowConfigExists,\n getSharedConfig,\n setRequestedSharedConfigVersion,\n} from './sharedConfigUtils';\n\n/**\n * Used to indicate when the latest version should be used.\n */\nconst LATEST_VERSION = 'latest';\n\n/**\n * Returns the version we should be using for requests. If we want to use a random named version for development purposes,\n * we must set __ibm__?.useExactVersion to true.\n *\n * @param publicConfig public config object\n */\nfunction getVersionLoaded(publicConfig: PublicConfig) {\n return publicConfig.__ibm__?.useExactVersion ? publicConfig.clientVersion : VERSION;\n}\n\n/**\n * Returns the appropriate version that matches the given requested version from the possible array of versions.\n *\n * @param desiredVersion This is the desired version to look for. For the latest version, this can simply be \"latest\".\n * For specific versions, this can be either an exact match or the beginning of a version if the latest major or\n * minor version is desired. For example, \"1.2\" will return the latest patch version under \"1.2\". A value of \"2\"\n * will return the latest minor version for major version 2.\n * @param availableVersions The list of available versions to choose from. This array will be sorted by this function.\n */\nfunction findMatchingVersion(desiredVersion: string, availableVersions: string[]): string | null {\n if (!desiredVersion) {\n return null;\n }\n\n // Sort the array by version in descending order.\n availableVersions.sort((version1, version2) => -compareVersions(version1, version2));\n\n // Add a \".\" to make sure we get a whole version.\n const desiredVersionPrefix = `${desiredVersion}.`;\n\n // Find the first version that is either an exact match or that starts with the desired prefix.\n const foundVersion =\n desiredVersion === LATEST_VERSION\n ? availableVersions[0]\n : availableVersions.find(value => value === desiredVersion || value.startsWith(desiredVersionPrefix));\n\n return foundVersion;\n}\n\n/**\n * Checks to see if another version of web chat has been loaded on the page already. If so, returns true.\n */\nfunction isConflictingVersion(publicConfig: PublicConfig) {\n ensureChatBrowserWindowConfigExists();\n const versionToLoad = publicConfig.clientVersion || VERSION;\n const { requestedVersion } = getSharedConfig();\n if (!requestedVersion) {\n setRequestedSharedConfigVersion(versionToLoad);\n } else if (requestedVersion !== versionToLoad) {\n return true;\n }\n return false;\n}\n\nexport { VERSION, LATEST_VERSION, findMatchingVersion, isConflictingVersion, getVersionLoaded };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport {\n AgentState,\n AlternateSuggestionsPanelState,\n AlternateSuggestionsState,\n AnnounceMessage,\n AppState,\n AppStateMessages,\n BrandingState,\n ChatMessagesState,\n CustomPanelConfigOptions,\n CustomPanelState,\n IFramePanelState,\n InputState,\n LauncherState,\n MessagePanelState,\n PersistedToBrowserStorageState,\n StreamingState,\n ThemeState,\n ViewSourcePanelState,\n ViewState,\n} from 'internal-packages/shared/types/AppState';\nimport { CarbonTheme } from 'internal-packages/shared/types/carbonTypes';\nimport { NotificationType, TIME_TO_ENTRANCE_ANIMATION_START } from 'internal-packages/shared/types/LauncherConfig';\nimport { LayoutConfig } from 'internal-packages/shared/types/PublicConfig';\nimport { StreamingConfig } from 'internal-packages/shared/types/StreamingConfig';\nimport { ThemeConfig } from 'internal-packages/shared/types/ThemeConfig';\nimport { TourState } from 'internal-packages/shared/types/TourState';\nimport isEqual from 'lodash-es/isEqual';\nimport { EventInputData } from 'submodules/wa-fd-types-public/wa-types';\n\nimport { CornersType, DEFAULT_CUSTOM_PANEL_ID } from '../utils/constants';\nimport { deepFreeze } from '../utils/lang/objectUtils';\nimport { VERSION } from '../utils/versionUtils';\n\n/**\n * Miscellaneous utilities to help in reducers.\n */\n\nconst DEFAULT_LAUNCHER: LauncherState = {\n config: {\n mobile: {\n title: '',\n time_to_expand: TIME_TO_ENTRANCE_ANIMATION_START,\n new_expand_time: false,\n time_to_reduce: 10000,\n notification_type: NotificationType.TEXT_NOTIFICATION,\n },\n desktop: {\n title: '',\n new_expand_time: false,\n time_to_expand: TIME_TO_ENTRANCE_ANIMATION_START,\n notification_type: NotificationType.TEXT_NOTIFICATION,\n },\n },\n};\ndeepFreeze(DEFAULT_LAUNCHER);\n\nconst DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS: CustomPanelConfigOptions = {\n title: null,\n hideBackButton: false,\n hidePanelHeader: false,\n disableAnimation: false,\n};\ndeepFreeze(DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS);\n\nconst DEFAULT_CUSTOM_PANEL_STATE: CustomPanelState = {\n isOpen: false,\n panelID: DEFAULT_CUSTOM_PANEL_ID,\n options: DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS,\n};\ndeepFreeze(DEFAULT_CUSTOM_PANEL_STATE);\n\nconst DEFAULT_IFRAME_PANEL_STATE: IFramePanelState = {\n isOpen: false,\n messageItem: null,\n};\ndeepFreeze(DEFAULT_IFRAME_PANEL_STATE);\n\nconst DEFAULT_CITATION_PANEL_STATE: ViewSourcePanelState = {\n isOpen: false,\n citationItem: null,\n relatedSearchResult: null,\n};\ndeepFreeze(DEFAULT_CITATION_PANEL_STATE);\n\nconst DEFAULT_BRANDING_STATE: BrandingState = {\n config: {\n is_on: false,\n },\n isOpen: false,\n showBanner: true,\n};\ndeepFreeze(DEFAULT_BRANDING_STATE);\n\nconst DEFAULT_TOUR_STATE: TourState = {\n activeTourStepItems: null,\n};\ndeepFreeze(DEFAULT_TOUR_STATE);\n\nconst DEFAULT_MESSAGE_PANEL_STATE: MessagePanelState<any> = {\n isOpen: false,\n localMessageItem: null,\n isMessageForInput: false,\n};\n\ndeepFreeze(DEFAULT_MESSAGE_PANEL_STATE);\n\nconst DEFAULT_ALTERNATE_SUGGESTIONS_STATE: AlternateSuggestionsState = {\n showButton: false,\n allowCollapse: false,\n panelState: AlternateSuggestionsPanelState.CLOSED,\n config: {\n is_on: false,\n },\n contactItem: null,\n starters: null,\n suggestionListItems: null,\n showSearchSection: false,\n searchResults: null,\n searchResultsLoading: false,\n searchResultsText: null,\n};\ndeepFreeze(DEFAULT_ALTERNATE_SUGGESTIONS_STATE);\n\nconst VIEW_STATE_ALL_CLOSED: ViewState = {\n launcher: false,\n mainWindow: false,\n tour: false,\n};\ndeepFreeze(VIEW_STATE_ALL_CLOSED);\n\nconst VIEW_STATE_LAUNCHER_OPEN: ViewState = {\n launcher: true,\n mainWindow: false,\n tour: false,\n};\ndeepFreeze(VIEW_STATE_LAUNCHER_OPEN);\n\nconst VIEW_STATE_MAIN_WINDOW_OPEN: ViewState = {\n mainWindow: true,\n launcher: false,\n tour: false,\n};\ndeepFreeze(VIEW_STATE_MAIN_WINDOW_OPEN);\n\nconst VIEW_STATE_TOUR_OPEN: ViewState = {\n tour: true,\n mainWindow: false,\n launcher: false,\n};\ndeepFreeze(VIEW_STATE_TOUR_OPEN);\n\nconst DEFAULT_PERSISTED_TO_BROWSER: PersistedToBrowserStorageState = {\n chatState: {\n version: VERSION,\n sessionID: null,\n sessionStartedTimestamp: null,\n updateHistoryUserDefinedCount: {},\n disclaimersAccepted: {},\n homeScreenState: {\n isHomeScreenOpen: false,\n showBackToBot: false,\n },\n hasSentNonWelcomeMessage: false,\n suggestionsPersistedState: {\n numStrikes: 0,\n selectedIndex: -1,\n selectedSection: null,\n },\n persistedTourState: {\n activeTourID: null,\n activeTourCurrentStepIndex: null,\n },\n agentState: {\n isConnected: false,\n isSuspended: false,\n agentProfiles: {},\n },\n },\n launcherState: {\n wasLoadedFromBrowser: false,\n version: VERSION,\n viewState: VIEW_STATE_ALL_CLOSED,\n activeTour: false,\n showUnreadIndicator: false,\n mobileLauncherIsExtended: false,\n mobileLauncherWasReduced: false,\n mobileLauncherDisableBounce: false,\n desktopLauncherIsExpanded: false,\n desktopLauncherWasMinimized: false,\n bounceTurn: 1,\n hasSentNonWelcomeMessage: false,\n },\n};\ndeepFreeze(DEFAULT_PERSISTED_TO_BROWSER);\n\nconst DEFAULT_CHAT_MESSAGES_STATE: ChatMessagesState = {\n localMessageIDs: [],\n messageIDs: [],\n isTypingCounter: 0,\n isLoadingCounter: 0,\n isScrollAnchored: false,\n};\ndeepFreeze(DEFAULT_CHAT_MESSAGES_STATE);\n\nconst DEFAULT_MESSAGE_STATE: AppStateMessages = {\n allMessageItemsByID: {},\n allMessagesByID: {},\n botMessageState: {\n ...DEFAULT_CHAT_MESSAGES_STATE,\n },\n};\ndeepFreeze(DEFAULT_MESSAGE_STATE);\n\nconst DEFAULT_INPUT_STATE = (): InputState => ({\n fieldVisible: true,\n isReadonly: false,\n files: [],\n allowFileUploads: false,\n allowMultipleFileUploads: false,\n allowedFileUploadTypes: null,\n});\n\nconst DEFAULT_AGENT_STATE: AgentState = {\n isConnecting: false,\n isReconnecting: false,\n numUnreadMessages: 0,\n fileUploadInProgress: false,\n showScreenShareRequest: false,\n isScreenSharing: false,\n isAgentTyping: false,\n inputState: DEFAULT_INPUT_STATE(),\n};\ndeepFreeze(DEFAULT_AGENT_STATE);\n\nconst DEFAULT_THEME_STATE: ThemeState = {\n carbonTheme: CarbonTheme.G10,\n useAITheme: false,\n corners: CornersType.ROUND,\n};\ndeepFreeze(DEFAULT_THEME_STATE);\n\n// Could be used to set the default for the remote config. However, the above default state value is used when first\n// setting the theme object in doCreateStore. That object in store should be used to get an up-to-date value for whether\n// the theme state is enabled instead of the remote config.\nconst DEFAULT_THEME_CONFIG: ThemeConfig = {\n carbon_theme: CarbonTheme.G10,\n use_ai_theme: false,\n};\ndeepFreeze(DEFAULT_THEME_CONFIG);\n\nconst DEFAULT_STREAMING_STATE: StreamingState = {\n enabled: false,\n};\ndeepFreeze(DEFAULT_STREAMING_STATE);\n\n// Could be used to set the default for the remote config. However, the above default state value is used when first\n// setting the streaming object in doCreateStore. That object in store should be used to get an up-to-date value for\n// whether streaming is enabled instead of the remote config.\nconst DEFAULT_STREAMING_CONFIG: StreamingConfig = {\n is_on: false,\n};\ndeepFreeze(DEFAULT_STREAMING_CONFIG);\n\nconst DEFAULT_LAYOUT_STATE: LayoutConfig = {\n showFrame: true,\n hasContentMaxWidth: false,\n};\ndeepFreeze(DEFAULT_LAYOUT_STATE);\n\nfunction calcAnnouncementForBrandingPanel(previousState: AppState, newIsPanelOpen: boolean): AnnounceMessage {\n if (previousState.brandingState.isOpen === newIsPanelOpen) {\n // No change in the panel state so return the current announcement.\n return previousState.announceMessage;\n }\n\n return {\n messageID: newIsPanelOpen\n ? 'general_ariaAnnounceOpenedInformationOverlay'\n : 'general_ariaAnnounceClosedInformationOverlay',\n };\n}\n\n/**\n * Determines the {@link AnnounceMessage} to show based on a potential change in the visibility of the widget. If the\n * widget is either opened or closed, an announcement should be made and this will set that announcement. If the state\n * of the widget hasn't changed, this will return the current announcement unchanged.\n *\n * @param previousState The previous state of the application.\n * @param newViewState Indicates the widgets new view state.\n */\nfunction calcAnnouncementForWidgetOpen(previousState: AppState, newViewState: ViewState): AnnounceMessage {\n if (isEqual(previousState.persistedToBrowserStorage.launcherState.viewState, newViewState)) {\n // No change in the view state so return the current announcement.\n return previousState.announceMessage;\n }\n\n // The view has changed so show the appropriate message.\n // TODO TOUR: I18N. This will need to be updated before ga. For now the announcement only cares if the main window is\n // opened. If the tour is opened, the announcement will be that the window is closed.\n return {\n messageID: newViewState.mainWindow ? 'window_ariaWindowOpened' : 'window_ariaWindowClosed',\n };\n}\n\n/**\n * Returns a new state that has the {@link ChatMessagesState} modified for the given chat type with the new properties.\n * If the chat state is for a thread, then the thread that is currently being viewed will be modified.\n */\nfunction applyBotMessageState(state: AppState, newState: Partial<ChatMessagesState>): AppState {\n return {\n ...state,\n botMessageState: {\n ...state.botMessageState,\n ...newState,\n },\n };\n}\n\nfunction handleViewStateChange(state: AppState, viewState: ViewState): AppState {\n // If the main window is opened and the page is visible, mark any unread messages as read.\n let { agentState } = state;\n let { showUnreadIndicator } = state.persistedToBrowserStorage.launcherState;\n if (viewState.mainWindow && state.isBrowserPageVisible) {\n if (agentState.numUnreadMessages !== 0) {\n agentState = {\n ...agentState,\n numUnreadMessages: 0,\n };\n }\n showUnreadIndicator = false;\n }\n\n return {\n ...state,\n announceMessage: calcAnnouncementForWidgetOpen(state, viewState),\n agentState,\n persistedToBrowserStorage: {\n ...state.persistedToBrowserStorage,\n launcherState: {\n ...state.persistedToBrowserStorage.launcherState,\n viewState,\n showUnreadIndicator,\n },\n },\n };\n}\n\n/**\n * Adds the given message as an event message to the pending logs queue.\n */\nfunction addEventMessage(message: EventInputData, state: AppState): AppState {\n return {\n ...state,\n pendingLogs: {\n ...state.pendingLogs,\n eventMessages: [...state.pendingLogs.eventMessages, message],\n },\n };\n}\n\nfunction setHomeScreenOpenState(state: AppState, isOpen: boolean, showBackToBot?: boolean): AppState {\n if (showBackToBot === undefined) {\n showBackToBot = state.persistedToBrowserStorage.chatState.homeScreenState.showBackToBot;\n }\n return {\n ...state,\n persistedToBrowserStorage: {\n ...state.persistedToBrowserStorage,\n chatState: {\n ...state.persistedToBrowserStorage.chatState,\n homeScreenState: {\n ...state.persistedToBrowserStorage.chatState.homeScreenState,\n isHomeScreenOpen: isOpen,\n showBackToBot,\n },\n },\n },\n };\n}\n\n/**\n * Returns the current (old) object if it is equal to another new object. Otherwise, the new object will be\n * returned. This will perform a deep equal of the given objects.\n *\n * This function is useful for optimizing out changes to parts of an object graph where object identity is normally\n * use for comparisons and where an unnecessary change in an object may produce unnecessary processing.\n */\nfunction keepIfEqual<T>(oldObject: T, newObject: T): T {\n return oldObject === newObject || isEqual(oldObject, newObject) ? oldObject : newObject;\n}\n\nexport {\n DEFAULT_AGENT_STATE,\n DEFAULT_MESSAGE_STATE,\n DEFAULT_CHAT_MESSAGES_STATE,\n DEFAULT_ALTERNATE_SUGGESTIONS_STATE,\n DEFAULT_PERSISTED_TO_BROWSER,\n VIEW_STATE_ALL_CLOSED,\n VIEW_STATE_MAIN_WINDOW_OPEN,\n VIEW_STATE_LAUNCHER_OPEN,\n VIEW_STATE_TOUR_OPEN,\n DEFAULT_BRANDING_STATE,\n DEFAULT_IFRAME_PANEL_STATE,\n DEFAULT_CITATION_PANEL_STATE,\n DEFAULT_CUSTOM_PANEL_STATE,\n DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS,\n DEFAULT_LAUNCHER,\n DEFAULT_TOUR_STATE,\n DEFAULT_MESSAGE_PANEL_STATE,\n DEFAULT_THEME_STATE,\n DEFAULT_THEME_CONFIG,\n DEFAULT_STREAMING_STATE,\n DEFAULT_STREAMING_CONFIG,\n DEFAULT_LAYOUT_STATE,\n DEFAULT_INPUT_STATE,\n calcAnnouncementForBrandingPanel,\n calcAnnouncementForWidgetOpen,\n setHomeScreenOpenState,\n applyBotMessageState,\n addEventMessage,\n keepIfEqual,\n handleViewStateChange,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The types of home screen backgrounds supported.\n */\nenum HomeScreenBackgroundType {\n NONE = 'none', // The home screen background is the same color as the chat background.\n SOLID = 'solid', // All solid color for home screen.\n TOP_CORNER_OUT = 'top_corner_out', // A top corner outward gradient color.\n BOTTOM_UP = 'bottom_up', // A bottom up gradient color.\n}\n\n/**\n * A conversation starter button on the home screen. Currently, only label is provided by tooling.\n */\ninterface HomeScreenStarterButton {\n /**\n * The display label of the button. This is also the value that is sent as the user's utterance to the assistant\n * when the button is clicked.\n */\n label: string;\n\n /**\n * Indicates if the button was previously clicked and should be displayed as selected.\n */\n isSelected?: boolean;\n}\n\n/**\n * Starter buttons that appear on home screen.\n */\ninterface HomeScreenStarterButtons {\n is_on?: boolean;\n buttons?: HomeScreenStarterButton[];\n}\n\n/**\n * Configuration for the optional home screen that appears before the bot chat window.\n */\ninterface HomeScreenConfig {\n /**\n * If the home page is turned on via config or remote config.\n */\n is_on?: boolean;\n\n /**\n * The greeting to show to the user to prompt them to start a conversation.\n */\n greeting?: string;\n\n /**\n * Optional conversation starter utterances that are displayed as buttons.\n */\n starters?: HomeScreenStarterButtons;\n\n /**\n * An image url that will override the bot avatar displayed in home screen.\n */\n bot_avatar_url?: string;\n\n /**\n * Do not show the greeting, starters, or avatar url.\n */\n custom_content_only?: boolean;\n\n /**\n * The type of home screen background to render.\n */\n background?: HomeScreenBackgroundType;\n}\n\n/**\n * Current state of home screen (currently, limited to if it is open or closed).\n */\ninterface HomeScreenState {\n /**\n * Indicates if the home screen is currently open.\n */\n isHomeScreenOpen: boolean;\n\n /**\n * Indicates if the home screen should display a \"return to bot\" button. This button is displayed when the user\n * has clicked the \"back to home\" button from the bot.\n */\n showBackToBot: boolean;\n}\n\nexport {\n HomeScreenConfig,\n HomeScreenStarterButtons,\n HomeScreenState,\n HomeScreenStarterButton,\n HomeScreenBackgroundType,\n};\n","import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { HomeScreenBackgroundType, HomeScreenConfig } from 'internal-packages/shared/types/HomeScreenConfig';\nimport isEmpty from 'lodash-es/isEmpty';\nimport merge from 'lodash-es/merge';\n\nconst DEFAULT_HOME_SCREEN_CONFIG = { is_on: false };\n\nfunction mergeHomeScreenConfig(publicHomeScreenConfig: HomeScreenConfig, remoteHomeScreenConfig: HomeScreenConfig) {\n // Merge together the remote config and the public config. When merging make sure the public config overrides the\n // remote config. If neither config are set then use the default home screen config that sets home screen to disabled.\n return merge(\n {},\n convertHomeScreenConfigToBackgroundIfBackgroundGradient(remoteHomeScreenConfig),\n convertHomeScreenConfigToBackgroundIfBackgroundGradient(publicHomeScreenConfig),\n );\n}\n\n/**\n * Returns a copy of the given config but converts any background_gradient object to the background prop if the\n * background prop is not set. This is required in order to keep track of the intended background setting in one place,\n * otherwise it's quite difficult to tell which setting should be used if both are set. This can be removed once the\n * deprecated background_gradient property is removed.\n */\nfunction convertHomeScreenConfigToBackgroundIfBackgroundGradient(config: HomeScreenConfig): HomeScreenConfig {\n let newHomeScreenConfig = config;\n if (config && !config.background) {\n // If there is a config and the config is not setting a background property then we may need to set one. If the new\n // config is setting a background then we rely on that value and ignore the background_gradient. If the new config\n // is not setting a background or background_gradient then the home screen component will default to background type\n // \"none\".\n if (!isEmpty(config.background_gradient)) {\n // If the config is using the background_gradient object then we should update background to match the\n // background_gradient settings. We do this because \"background\" is what we rely on within the home screen\n // component.\n let background;\n if (config.background_gradient.is_on) {\n if (config.background_gradient?.gradient_direction === HomeScreenBackgroundType.BOTTOM_UP) {\n background = HomeScreenBackgroundType.BOTTOM_UP;\n } else {\n // We allow deb to leave gradient_direction undefined when setting is_on to true. The expectation is that we\n // will default to top corner out gradient.\n background = HomeScreenBackgroundType.TOP_CORNER_OUT;\n }\n } else {\n // If the background_gradient config has been intentionally set to is_on false then we should not show a\n // background.\n background = HomeScreenBackgroundType.NONE;\n }\n\n // Add the background to the home screen config.\n newHomeScreenConfig = {\n ...newHomeScreenConfig,\n background,\n };\n }\n }\n\n return newHomeScreenConfig;\n}\n\n/**\n * Returns a copy of the given config, but removes any starters that are empty.\n */\nfunction withoutEmptyStarters(config: HomeScreenConfig): HomeScreenConfig {\n let newConfig = config;\n if (config?.starters?.buttons?.length) {\n newConfig = {\n ...config,\n starters: {\n ...config.starters,\n buttons: config.starters.buttons.filter(button => Boolean(button.label?.trim())),\n },\n };\n if (!newConfig?.starters?.buttons?.length) {\n // If we end up with no starters, then turn them off.\n newConfig.starters.is_on = false;\n }\n }\n\n return newConfig;\n}\n\nexport {\n DEFAULT_HOME_SCREEN_CONFIG,\n mergeHomeScreenConfig,\n withoutEmptyStarters,\n convertHomeScreenConfigToBackgroundIfBackgroundGradient,\n};\n","export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { StatusCodes } from 'http-status-codes';\nimport { CatastrophicErrorType } from 'internal-packages/shared/types/AppState';\nimport { BusEventIdentityExpired, BusEventType } from 'internal-packages/shared/types/eventBusTypes';\nimport { JWT } from 'internal-packages/shared/types/JWT';\nimport { OnErrorData, OnErrorType } from 'internal-packages/shared/types/OnErrorData';\nimport { jwtDecode } from 'jwt-decode';\n\nimport { ServiceManager } from '../services/ServiceManager';\nimport { WA_CONSOLE_PREFIX } from './constants';\nimport { resolveOrTimeout } from './lang/promiseUtils';\nimport { callOnError, consoleInfo } from './miscUtils';\n\n// The text that is returned that indicated the JWT token has expired.\nconst JWT_MALFORMED_TEXT = 'token provided is malformed';\nconst JWT_BAD_FORMAT = 'Authorization header provided but does not follow JWT format';\nconst JWT_EXPIRED_TEXT = 'token expired';\n\n// Amount of time we wait before giving up on identity being updated.\nconst IDENTITY_EXPIRED_TIMEOUT = 30000;\n\n// The private key used on the testing site for signing JWTs.\nconst TEST_JWT_YOUR_PRIVATE_SIGNING_KEY = `-----BEGIN PRIVATE KEY-----\nMIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDP0r2bW39iEFC6\nLdE/ycvqTiL6q1fqy/IPmZ0TZCXd+BTtCZnUo6x+F4GYakANEP8zcMernUWwILVa\nvMy9Yt5arHiht0WM6c+PR9v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JMA1DKo\nk10u+l+jdDuwtZRP9qOKvogGic/Rg+vcLOk0aoYsqN2q8033w/tA6muWX0/qi9WY\nRLvDv+fcj7EPxoQqpgenQB0Xe/G5eIiJfTD4yOfjMg9nR/+y4JE7qZ/mab8lvGNW\nHAU5Y8A8wHFmtfI0h41EBhA10scDHRM/13CPxyQynN9ZgnKuUZVnTqQ7dbZb2ZML\n7YVM8bCmNrO8wQx8f0NE9WEicdHiK9q/aVPxBGkhAoIBAHxQGwtZbVfbVW8FqZSH\n9lBw8KBXi5gA6DSVNwYpq4+YyakPymkB2BZ/I6wtq/KMX9xD1zfxK3OqbK+kyRNo\nI2FsopjsO5eINSCvwRJlctLXLxGwKFajjtSz1OA+68i0fixk9Cs50txJFHrvnnD1\njrJbzdEsioF7fE9G9r7Y5yWNihzsOsYAvHRxjPcLK/Fr7PSsXIP0cPUcEMrIRoII\nayYYynKy2y1+PPSWfd12Zn33zIgqyvHqe+2Lf7fJgKY2Jt3SI+heX+6fyb3Ed/af\nA193/a2ibcNSVDHvYB9UsvqN2x6jcZOpY7NgtycBNTsvTl+KVpU4crnM91cUMMvb\n9qECggEBAKWBINpCAnwI9feDr0I9aaEt7VoE3AIyL4rKkLX2xonBvpD0YOf7Um2u\n73LRzeumnyeYCRMJZq+yabkK/MbgJgwzwckat/GxmoNsMn0VZxQW9v3IVi1D3EcW\nIfxTVgOROnTXq24yTLX8wRngQ8WQ2xAFSbdZsey8G25kvl4odIkaQHOnrc3Sp4bH\n4Vs8EWMkr8NubGsSOuarFE6uZj+PM0FkgG6Vyns9UNXJkvTYIXLAxNeO1u4z7DtL\nh3bkPgd6auiTw1tUbR7F6QEklevemLudBPAsZoJR/0fMhQYwUOiBw0H60r3kRkaF\nnISy2FO++GWheN9T1JIY6OqkeoJcDvY=\n-----END PRIVATE KEY-----`; // pragma: whitelist secret\n\n// The private key used on the testing site for verifying JWTs.\nconst TEST_JWT_YOUR_PUBLIC_VERIFYING_KEY = `-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAz9K9m1t/YhBQui3RP8nL\n6k4i+qtX6svyD5mdE2Ql3fgU7QmZ1KOsfheBmGpADRD/M3DHq51FsCC1WrzMvWLe\nWqx4obdFjOnPj0fb91+cH0UFVAlH18Q22JZhZhYFluV01XYRIyUUrwcMlPsdKplB\n6QJdVBDZJEEUfFoDMeuX5BE8T5ma7+kaFOLSSwUYBh14Fa0ZaMFpDDU2AwslQs7s\nY6QEZeAB9h0OKC5l8+pBSHa+SIzex+2rLSF97jYU5cfLxGAhvrQMDwm+zrKt6vlR\nWIAbiJ9Yac0DSqBOs2vZZQZRCG01J7TLFyoKBJQVdAQXcAy1aUqi0x3rOwVWnSN3\nZLfHHYv8wh96zvEE+Lt5DWsbFOuL5wJFZRvahVjvWhIexE0lmrSGIRK0OypDsvdO\nSo/w1K/ZsDXWz5GkpK/1XAEdZfi0Z/TkjAXYyK4pmpp59Di1lsnOzNA6qODv5i97\nIfALBq/iqwoU728/xpqIlb2YZftWQfWHZipBqYcKaFJ+JMjKfacRZM2buevy20+X\nPUH4jDBO3wtXtmY1GQdDLb5XpAowJmBu/MRQWgpkp+j/lI0JcWOqirVb/CGfS7U5\nA0Dy8486rNsiKtrkb9I2YxTBieVQOXlrnJXVCiiIOEOtAf1rLXhSj+o+ry6beNE/\nMb1i2jpD/JPOQ+O0EYEka0kCAwEAAQ==\n-----END PUBLIC KEY-----`; // pragma: whitelist secret\n\n// The IBM provided public key used for encrypting JWT payloads.\nconst TEST_IBM_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxO0SzyZYZPsai7Z1DUeF\n6llFqoTVo6R1stYsG19mnRIJu/0/q5j4ZyfAFpI/coi8MZuPNytKA4BzRe6voLTF\nkyg1qDbi+Y+ch4iHyBDGkRSwgS8EzgDkQ0mkCE4U3nR0iVigNhbHVmbEMTVgtsFS\noDBd2Rtpr/kuaGdfjDOePyuDTquCzk6cx3Fq4eyiakFpJDRR11FfE6LYlzf32Bn9\nTag3XDX1ePFkEk5hgA8izwjDmMZ75NYaI5zE1rlNCsc0XsPE8tnn7Cn1+QuLHDXh\nwG/1SRqUaQJ4L758KblVBYFmJhiBHKY/AsUHUDjsNaseEEkT0iwBreAY4nv6dmFi\nxwIDAQAB\n-----END PUBLIC KEY-----`; // pragma: whitelist secret\n\n/**\n * Given a status code and text, decide if an error is the result of an expired or invalid JWT.\n */\nfunction isJWTError(statusCode: number, isSecurityEnabled: boolean, resultText?: string) {\n return (\n (statusCode === StatusCodes.FORBIDDEN && isSecurityEnabled) ||\n (statusCode === StatusCodes.BAD_REQUEST && resultText?.includes(JWT_MALFORMED_TEXT)) ||\n (statusCode === StatusCodes.BAD_REQUEST && resultText?.includes(JWT_BAD_FORMAT)) ||\n (statusCode === StatusCodes.UNAUTHORIZED && resultText?.includes(JWT_EXPIRED_TEXT))\n );\n}\n\n/**\n * Checks if JWT passed as identityToken is valid.\n */\nfunction assertJWTValid(jwt: JWT) {\n if (!jwt.sub) {\n throw new Error(`${WA_CONSOLE_PREFIX}: The \"sub\" claim is required in your identityToken.`);\n }\n if (!jwt.exp) {\n consoleInfo('It is recommended you set your JWT to expire with an exp claim.');\n }\n}\n\n/**\n * This should be called when it is detected that the user's identity token has expired. It will request a new\n * identity token from the host page and update the stored value when a new one is received. If the request times out\n * this function will throw an error.\n *\n * @param serviceManager The instance of the serviceManager for this web chat.\n * @param catastrophicErrorType If the identity token fails when loading the main config, the web chat cannot load.\n */\nasync function getNewIdentityToken(serviceManager: ServiceManager, catastrophicErrorType?: CatastrophicErrorType) {\n const identityExpiredMessage: BusEventIdentityExpired = {\n type: BusEventType.IDENTITY_EXPIRED,\n identityToken: null,\n };\n\n try {\n await resolveOrTimeout(\n serviceManager.eventBus.fire(identityExpiredMessage, serviceManager.instance),\n IDENTITY_EXPIRED_TIMEOUT,\n );\n } catch (error) {\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n message: `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but an error was thrown by a handler.`,\n catastrophicErrorType,\n otherData: error,\n });\n throw error;\n }\n\n if (!identityExpiredMessage.identityToken || typeof identityExpiredMessage.identityToken !== 'string') {\n let message;\n if (!identityExpiredMessage.identityToken) {\n message = `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but no token was set by a handler.`;\n } else {\n message = `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but the handler returned a non-string token.`;\n }\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n message,\n catastrophicErrorType,\n });\n throw new Error(message);\n }\n\n try {\n serviceManager.actions.updateIdentityToken(identityExpiredMessage.identityToken);\n } catch (error) {\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n message: `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but an error was thrown.`,\n catastrophicErrorType,\n otherData: error,\n });\n throw error;\n }\n}\n\n/**\n * This should be called when we want to get a new identity token if it's going to expire soon. For now, we have\n * hard-coded \"soon\" to mean 10 seconds. If it will expire, it will request a new identity token from the host page\n * and update the stored value when a new one is received. If the request times out this function will throw an error.\n *\n * @param serviceManager The instance of the serviceManager for this web chat.\n * @param catastrophicErrorType If the identity token fails when loading the main config, the web chat cannot load.\n */\nconst getNewIdentityTokenIfExpiring = async (\n serviceManager: ServiceManager,\n catastrophicErrorType?: CatastrophicErrorType,\n) => {\n const currentToken = serviceManager.store.getState().identityToken;\n const decodedToken = doDecodeJWT(currentToken, console.error);\n if (decodedToken.exp) {\n const expiration = new Date(decodedToken.exp * 1000);\n // If the token is going to expire in the next 10 seconds, then get a new one now.\n const timeRemaining = expiration.getTime() - Date.now();\n if (timeRemaining < 10000) {\n await getNewIdentityToken(serviceManager, catastrophicErrorType);\n }\n } else {\n await getNewIdentityToken(serviceManager, catastrophicErrorType);\n }\n};\n\n/**\n * Decodes the given string provided by the customer as a JWT along with some error handling.\n */\nfunction doDecodeJWT(jwtString: string, onError: (data: OnErrorData) => void) {\n let jwt: JWT;\n try {\n jwt = jwtDecode(jwtString);\n assertJWTValid(jwt);\n } catch (error) {\n callOnError(onError, {\n errorType: OnErrorType.IDENTITY_TOKEN,\n message: `The provided JWT (identity token) is not valid.`,\n otherData: error,\n });\n throw error;\n }\n\n return jwt;\n}\n\nexport {\n doDecodeJWT,\n getNewIdentityToken,\n getNewIdentityTokenIfExpiring,\n isJWTError,\n assertJWTValid,\n JWT_MALFORMED_TEXT,\n JWT_EXPIRED_TEXT,\n TEST_JWT_YOUR_PRIVATE_SIGNING_KEY,\n TEST_JWT_YOUR_PUBLIC_VERIFYING_KEY,\n TEST_IBM_PUBLIC_KEY,\n};\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The different types of things we can generate UUIDs for. Our test cases generate sequential IDs instead of random\n * UUIDs to produce deterministic IDs that can be hardcoded in tests and snapshots. To minimize the disruption that\n * changes in these IDs can cause (like if a new ID gets inserted), we divide IDs by type where each type gets its own\n * sequence. The type is set in the highest segment of the sequential IDs that are generated. This enum is only used\n * for testing purposes and has no impact on production code. If you change the values of any of these items, it\n * might break test cases that have IDs hardcoded in them.\n */\nenum UUIDType {\n MISCELLANEOUS = 1,\n LOCAL_MESSAGE = 2,\n MESSAGE = 3,\n USER = 6,\n DEVICE_ID = 8,\n FILE = 9,\n}\n\nexport { UUIDType };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { v4 as originalUUID } from 'uuid';\n\nimport { UUIDType } from './UUIDType';\n\n/**\n * The function generates a new v4 UUID. This function is here to provide a nicer mechanism for mocking UUIDs in\n * test cases.\n *\n * @param type This is the \"type\" of the UUID that is being generated. This is only used by the mock UUID generator\n * for test cases. Each \"type\" will get it's own set of IDs that don't overlap with other types.\n */\nfunction uuid(type?: UUIDType) {\n return originalUUID();\n}\n\n/**\n * This function needs to be here so we can override in our mock. If we try to call this function as it exists in\n * the mock, it seems that jest doesn't properly call this on the right module.\n */\nfunction resetUUIDs() {}\n\nexport { uuid, UUIDType, resetUUIDs };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { PublicConfig } from './types/assistantPublicConfig';\n\n/**\n * Used in loadWAC to determine the right route for the public configs, the /message endpoint, and the history endpoint\n * to use. It has been moved to loadWac so that once watsonplatform.net is deprecated this is the only file that needs\n * to be changed and any version after the initial moving of this mapping will still work.\n */\nexport const REGION_MAP: Record<string, string> = {\n // WXA on IBM Cloud\n dev: 'integrations.us-south.assistant.dev.watson.appdomain.cloud',\n staging: 'integrations.us-south.assistant.test.watson.appdomain.cloud',\n 'us-south': 'integrations.us-south.assistant.watson.appdomain.cloud',\n 'us-east': 'integrations.us-east.assistant.watson.appdomain.cloud',\n 'jp-tok': 'integrations.jp-tok.assistant.watson.appdomain.cloud',\n 'au-syd': 'integrations.au-syd.assistant.watson.appdomain.cloud',\n 'eu-gb': 'integrations.eu-gb.assistant.watson.appdomain.cloud',\n 'eu-de': 'integrations.eu-de.assistant.watson.appdomain.cloud',\n 'kr-seo': 'integrations.kr-seo.assistant.watson.appdomain.cloud',\n // WXO on AWS\n 'aws-dev': 'integrations.aws-us-east-1.assistant.dev.watson.appdomain.cloud',\n 'aws-staging': 'integrations.aws-us-east-1.assistant.test.watson.appdomain.cloud',\n 'aws-us-east-1': 'integrations.aws-us-east-1.assistant.watson.appdomain.cloud',\n 'aws-preprod': 'integrations.aws-us-east-1.assistant.preprod.watson.appdomain.cloud',\n 'aws-eu-central-1': 'integrations.aws-eu-central-1.assistant.watson.appdomain.cloud',\n // WXO on IBM Cloud\n 'wxo-dev': 'integrations.us-south.assistant-builder.dev.watson.appdomain.cloud',\n 'wxo-staging': 'integrations.us-south.assistant-builder.test.watson.appdomain.cloud',\n 'wxo-us-south': 'integrations.us-south.assistant-builder.watson.appdomain.cloud',\n};\n\n/**\n * Gets the region hostname for calls to the integrations server.\n *\n * @param publicConfig The public config object.\n */\nexport function getRegionHostname(publicConfig: PublicConfig) {\n return REGION_MAP[publicConfig.region as string];\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { StatusCodes } from 'http-status-codes';\nimport { CatastrophicErrorType } from 'internal-packages/shared/types/AppState';\nimport { Fetch } from 'internal-packages/shared/types/Fetch';\nimport { OnErrorData, OnErrorType } from 'internal-packages/shared/types/OnErrorData';\nimport { ConnectToAgentBehaviorType, PublicConfig, ToolingType } from 'internal-packages/shared/types/PublicConfig';\nimport { RemoteInitConfig, RemoteMainConfig } from 'internal-packages/shared/types/RemoteConfig';\nimport merge from 'lodash-es/merge';\nimport { PartialPublicConfig } from 'test/util/commonTestConstants.js';\nimport { DeepPartial } from 'ts-essentials';\n\nimport { WWX_CDN_ENDPOINT, WXO_ENDPOINT } from '../environmentVariables.js';\nimport { doWithRetry } from '../services/doWithRetry';\nimport { validateNamespace } from '../services/NamespaceService';\nimport { ServiceManager } from '../services/ServiceManager';\nimport { DEFAULT_ALTERNATE_SUGGESTIONS_STATE, DEFAULT_BRANDING_STATE, DEFAULT_LAUNCHER } from '../store/reducerUtils';\nimport { API_DEBUGGING_HEADER_NAME, INTEGRATIONS_VERSION, WA_CONSOLE_PREFIX } from './constants';\nimport { DEFAULT_HOME_SCREEN_CONFIG } from './homeScreenUtils';\nimport { getNewIdentityToken, isJWTError } from './identityUtils';\nimport { isValidUUID } from './lang/stringUtils';\nimport { uuid, UUIDType } from './lang/uuid';\nimport { consoleError, safeFetchText, safeFetchTextWithTimeout } from './miscUtils';\nimport { getRegionHostname, REGION_MAP } from './regions';\nimport { getVersionLoaded, isConflictingVersion } from './versionUtils';\n\nconst DEFAULT_PUBLIC_CONFIG: PartialPublicConfig = {\n openChatByDefault: false,\n showLauncher: true,\n shouldTakeFocusIfOpensAutomatically: true,\n agentAppConfig: {\n is_on: false,\n },\n servers: {},\n serviceDesk: {},\n messaging: {\n copyPreviousContextOnRequest: true,\n },\n __ibm__: {\n isTrackingEnabled: true,\n logTrackObjects: false,\n connectToAgentBehavior: ConnectToAgentBehaviorType.ERROR_MISSING,\n enableFeatures: {},\n },\n wxo: {},\n};\n\nconst DEFAULT_REMOTE_INIT_CONFIG: DeepPartial<RemoteInitConfig> = {\n home_screen: DEFAULT_HOME_SCREEN_CONFIG,\n alternate_suggestions: DEFAULT_ALTERNATE_SUGGESTIONS_STATE.config,\n branding_config: DEFAULT_BRANDING_STATE.config,\n launcher_config: DEFAULT_LAUNCHER.config,\n};\n\nconst AGENT_APP_DEFAULT_PUBLIC_CONFIG: PartialPublicConfig = {\n headerConfig: {\n hideMinimizeButton: true,\n },\n openChatByDefault: true,\n showLauncher: false,\n disableCustomElementMobileEnhancements: true,\n disclaimer: {\n isOn: false,\n },\n __ibm__: {\n isReadonly: true,\n },\n};\n\nconst AGENT_APP_DEFAULT_REMOTE_INIT_CONFIG: DeepPartial<RemoteInitConfig> = {\n alternate_suggestions: {\n is_on: false,\n },\n home_screen: {\n is_on: false,\n },\n // When using agent app, we use auth tokens instead.\n authorization: {\n is_on: false,\n },\n};\n\nconst AGENT_APP_SLUG = 'agentapp';\nconst CHAT_SLUG = 'chat';\n\n/**\n * Examines the given public config and throws an error message if there are errors with it.\n */\nfunction validateConfig(publicConfig: PublicConfig, asCarbonChat?: boolean) {\n const { integrationID, region, namespace, __ibm__ = DEFAULT_PUBLIC_CONFIG.__ibm__, messaging } = publicConfig;\n\n // If the user provides a custom URL, then we don't need to validate the other config properties.\n if (asCarbonChat) {\n if (!messaging?.customSendMessage) {\n throw new Error(`${WA_CONSOLE_PREFIX} You must set messaging.customSendMessage in your configuration object.`);\n }\n } else {\n if (!__ibm__.customMessageURL && !messaging?.customSendMessage) {\n if (!isValidUUID(integrationID)) {\n throw new Error(`${WA_CONSOLE_PREFIX} The value of integrationID \"${integrationID}\" is not a valid ID.`);\n }\n if (!region) {\n throw new Error(`${WA_CONSOLE_PREFIX} You failed to provide a region in your config object.`);\n }\n if (!REGION_MAP[region]) {\n throw new Error(\n `${WA_CONSOLE_PREFIX} The region \"${region}\" you provided in your config object is not a valid region.`,\n );\n }\n }\n if (isConflictingVersion(publicConfig)) {\n throw new Error(`${WA_CONSOLE_PREFIX} You cannot load web chats of different versions on the same page.`);\n }\n }\n\n validateNamespace(namespace, true);\n}\n\n/**\n * Gets the base url for config and post url.\n *\n * @param publicConfig The public config object.\n */\nfunction getBaseURL(publicConfig: PublicConfig) {\n const regionHostname = getRegionHostname(publicConfig);\n const prefix = publicConfig.servers?.assistantURLPrefix || `https://${regionHostname}`;\n return `${prefix}/${publicConfig.subscriptionID || 'public'}`;\n}\n\n/**\n * Gets the CPD base url for config, message, and history urls. IntegrationID added since CDN is the only place that\n * doesn't need it, so its handled differently\n *\n * @param publicConfig The public config object.\n * @param agentAppOverride If true, we call the agentapp channel instead of the chat channel.\n */\nfunction getCPDBaseChatURL(publicConfig: PublicConfig, agentAppOverride?: boolean) {\n let cpdURL = null;\n if (publicConfig.cloudPrivateHostURL) {\n const integrationSlug = agentAppOverride ? AGENT_APP_SLUG : CHAT_SLUG;\n // Make sure the host url ends with a trailing slash.\n cpdURL = `${publicConfig.cloudPrivateHostURL.replace(/\\/?$/, '/')}v1/${integrationSlug}/${\n publicConfig.integrationID\n }`;\n }\n return cpdURL;\n}\n\n/**\n * Given a config object, either returns the cloudPrivateHostURL used in CP4D or the url for the CDN provided in the\n * environment.\n *\n * @param publicConfig The public config object.\n */\nfunction getCDNURL(publicConfig?: PublicConfig) {\n if (publicConfig?.cloudPrivateHostURL) {\n // If we are in CPD we are using the cloudPrivateHostURL with /static/webchat appended.\n // Make sure the host url ends with a trailing slash.\n return `${publicConfig.cloudPrivateHostURL.replace(/\\/?$/, '/')}static/webchat`;\n }\n if (publicConfig?.servers?.webChatScriptPrefix) {\n return publicConfig?.servers?.webChatScriptPrefix;\n }\n // If no overrides, use the cdn endpoint provided in the environment on build.\n return WWX_CDN_ENDPOINT;\n}\n\n/**\n * Given a config object, either returns the WXO_ENDPOINT override or a location of the remoteEntry file for the\n * wxo mfe.\n *\n * @param publicConfig The public config object.\n */\nfunction getWXOUrl(publicConfig?: PublicConfig) {\n const versionLoaded = getVersionLoaded(publicConfig);\n const cdnEndpoint = getCDNURL(publicConfig);\n const baseURL = `${cdnEndpoint}/versions/${versionLoaded}`;\n return WXO_ENDPOINT || `${baseURL}/wxo-mfe/remoteEntry.js`;\n}\n\n/**\n * Given a config object, returns the URL to the config endpoint used for getting widget configuration. This URL\n * will have the integration ID added to it if necessary and if no custom URL was specified.\n *\n * @param publicConfig The public config object.\n * @param initConfig Indicates if we want the URL for the main config or the \"init\" config (the \"init\" config is\n * loaded immediately when the page is loaded).\n */\nfunction getConfigURL(publicConfig: PublicConfig, initConfig: boolean) {\n // First check for a custom config url.\n const customURL = initConfig ? publicConfig.__ibm__?.customInitConfigURL : publicConfig.__ibm__?.customConfigURL;\n if (customURL) {\n // If the public config specifies a custom URL, then return it as-is.\n return customURL;\n }\n\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then return it with /config appended as well as ?type=init if the init config\n // was requested.\n return `${cpdBaseURL}/config${initConfig ? '?type=init' : ''}`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n const configTypeParam = initConfig ? '?type=init' : '';\n\n // If the agent app config is to be fetched, it should be done through the /agentapp channel. This also fixes\n // security holes through mix-match channel APIs.\n // For more info: https://github.ibm.com/watson-engagement-advisor/wea-backlog/issues/48720\n if (publicConfig.agentAppConfig?.is_on) {\n return `${baseURL}/agentapp/${publicConfig.integrationID}/config${configTypeParam}`;\n }\n\n return `${baseURL}/chat/${publicConfig.integrationID}/config${configTypeParam}`;\n}\n\n/**\n * Given a config object, returns the URL to the message endpoint used for sending messages. This URL will have the\n * integration ID added to it if necessary and if no custom URL was specified.\n */\nfunction getMessageURL(publicConfig: PublicConfig) {\n // First check for a custom message url.\n if (publicConfig.__ibm__?.customMessageURL) {\n // If the config specifies a custom URL, then return it as-is.\n return publicConfig.__ibm__.customMessageURL;\n }\n\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then return it with /message appended.\n return `${cpdBaseURL}/message`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n return `${baseURL}/chat/${publicConfig.integrationID}/message`;\n}\n\n/**\n * Given a config object, returns the URL to the message endpoint used for sending messages. This URL will have the\n * integration ID added to it if necessary and if no custom URL was specified.\n */\nfunction getSessionURL(publicConfig: PublicConfig, sessionID: string) {\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then use it as the base of the url.\n return `${cpdBaseURL}/sessions/${sessionID}?version=${INTEGRATIONS_VERSION}`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n return `${baseURL}/chat/${publicConfig.integrationID}/sessions/${sessionID}?version=${INTEGRATIONS_VERSION}`;\n}\n\n/**\n * Returns the prefix for the endpoint used to make calls to Amplitude.\n */\nfunction getAnalyticsPath(publicConfig: PublicConfig) {\n const prefix = publicConfig.servers?.assistantURLPrefix || `https://${getRegionHostname(publicConfig)}`;\n return `${prefix}/analytics`;\n}\n\n/**\n * Given a config object, returns the URL to the history endpoint used for loading historical messages. This URL will\n * have the integration ID and session ID added to it if necessary and if no custom URL was specified.\n *\n * @param publicConfig The public config object.\n * @param sessionID The ID of the session to return the history of.\n */\nfunction getHistoryURL(publicConfig: PublicConfig, sessionID: string) {\n // First check for a custom history url.\n if (publicConfig.__ibm__?.customHistoryPrefix) {\n // If the config specifies a custom URL, then return it as-is with the session ID added.\n return `${publicConfig.__ibm__.customHistoryPrefix}/${sessionID}/notes?version=${INTEGRATIONS_VERSION}`;\n }\n\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig, publicConfig.agentAppConfig?.is_on);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then return it with /config appended as well as ?type=init if the\n // init config was requested.\n return `${cpdBaseURL}/channel_conversations/${sessionID}/notes?version=${INTEGRATIONS_VERSION}`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n\n // If we are calling history in the context of the agentApp, we use the generic 'agentapp' integration instead of\n // 'chat'.\n const integrationSlug = publicConfig.agentAppConfig?.is_on ? AGENT_APP_SLUG : CHAT_SLUG;\n\n return `${baseURL}/${integrationSlug}/${publicConfig.integrationID}/channel_conversations/${sessionID}/notes?version=${INTEGRATIONS_VERSION}`;\n}\n\n/**\n * Fetches configuration data for the widget. This function can also return a JWTError to be handled.\n *\n * @param configUrl URL to fetch config data for widget.\n * @param fetch The fetch function to use.\n * @param isSecurityEnabled Indicates if web chat security is enabled.\n * @param fetchParameters Fetch call parameters.\n */\nasync function doConfigFetch(\n configUrl: string,\n fetch: Fetch,\n isSecurityEnabled: boolean,\n fetchParameters?: RequestInit,\n): Promise<Response> {\n const result = await fetch(configUrl, fetchParameters);\n\n if (!result.ok) {\n // If too many requests were made we want to end the retry cycle when this function is used in doWithRetry.\n if (result.status === StatusCodes.TOO_MANY_REQUESTS) {\n return null;\n }\n\n const responseText = await safeFetchText(result);\n if (isJWTError(result.status, isSecurityEnabled, responseText)) {\n return result;\n }\n\n throw result;\n }\n\n return result;\n}\n\n/**\n * Loads the initial configuration data for the widget from the integrations server. The call is not authenticated\n * with the customer's JWT.\n */\nasync function getRemoteInitConfig(\n publicConfig: PublicConfig,\n onError: (data: OnErrorData) => void,\n fetch: Fetch,\n): Promise<RemoteInitConfig> {\n if (publicConfig.servers?.skipConfig) {\n return { botName: 'watsonx Assistant' } as any;\n }\n\n const url = getConfigURL(publicConfig, true);\n\n let fetchParameters: RequestInit;\n\n let result: Response;\n try {\n result = await doWithRetry(\n // The remote init config is not protected by web chat security so we pass in false.\n () => doConfigFetch(url, fetch, false, fetchParameters),\n [100, 1000, 2000, 5000],\n 'fetch init config',\n );\n } catch (error) {\n if (onError) {\n onError({\n errorType: OnErrorType.INITIAL_CONFIG,\n message: 'The init configuration data could not be loaded.',\n errorCode: (error as Response)?.status || undefined,\n otherData: await safeFetchTextWithTimeout(error as Response),\n });\n throw new Error(`${WA_CONSOLE_PREFIX} The init configuration data could not be loaded.`);\n }\n }\n\n if (!result) {\n throw new Error(`${WA_CONSOLE_PREFIX} The init configuration data could not be loaded.`);\n }\n\n const text = await safeFetchText(result);\n\n // If the result is not okay, it must be a JWT error because any other kind of errors are handled in doConfigFetch\n // which would result in that function throwing an error instead of returning a result.\n if (!result.ok) {\n const error = `The configuration for integrationID \"${publicConfig.integrationID}\" requires a valid identityToken. The chat widget will not be displayed.`;\n if (onError) {\n onError({\n errorType: OnErrorType.INITIAL_CONFIG,\n message: 'The init configuration data could not be loaded (JWT retry).',\n errorCode: result.status || undefined,\n otherData: text,\n });\n }\n consoleError(error);\n throw new Error(`${WA_CONSOLE_PREFIX} ${error}`);\n }\n\n const initConfig: RemoteInitConfig = text ? JSON.parse(text) : {};\n\n initConfig.botName = initConfig.botName || 'watsonx Assistant';\n\n if (publicConfig.__ibm__?.toolingType === ToolingType.PREVIEW_LINK && initConfig.authorization?.is_on) {\n if (onError) {\n onError({\n errorType: OnErrorType.PREVIEW_LINK_SECURITY,\n message: 'Web chat security is enabled which is not supported by the preview link.',\n });\n }\n throw new Error(`${WA_CONSOLE_PREFIX} Web chat security is enabled which is not supported by the preview link.`);\n }\n\n return initConfig;\n}\n\n/**\n * Loads the main configuration data for the widget from the integrations server. The call is authenticated with the\n * customer's JWT if one is required.\n */\nasync function getRemoteMainConfig(serviceManager: ServiceManager, allowJWTRetry = true): Promise<RemoteMainConfig> {\n const state = serviceManager.store.getState();\n const { config } = state;\n let { identityToken } = state;\n const publicConfig = config.public;\n const isSecurityEnabled = config.remote.initConfig.authorization?.is_on;\n\n // Some integrations will not have this set in the remote config. If they do not, we won't grab the new id token\n // until the request to main config fails. If folks are complaining about the extra request, they can just flip\n // the toggle for security off and back on to get the correct remote config shape. We also ignore this condition\n // in tooling where we bypass the security setting using a custom endpoint.\n if (!identityToken && isSecurityEnabled && !publicConfig.__ibm__?.toolingType) {\n await getNewIdentityToken(serviceManager, CatastrophicErrorType.FAILED);\n identityToken = serviceManager.store.getState().identityToken;\n }\n\n const url = getConfigURL(publicConfig, false);\n\n // If an identityToken is set, at it to the headers so that our call to /config does not get rejected.\n let fetchParameters: RequestInit;\n let transactionID;\n\n if (identityToken) {\n transactionID = uuid(UUIDType.MISCELLANEOUS);\n fetchParameters = {\n headers: {\n authorization: `Bearer ${identityToken}`,\n [API_DEBUGGING_HEADER_NAME]: transactionID,\n },\n };\n }\n\n let result;\n try {\n result = await doWithRetry(\n // The remote init config is not protected by web chat security so we pass in false.\n () => doConfigFetch(url, serviceManager.fetch, isSecurityEnabled, fetchParameters),\n [100, 1000, 2000, 5000],\n 'fetch main config',\n );\n } catch (error) {\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.OPEN_CONFIG,\n catastrophicErrorType: CatastrophicErrorType.FAILED,\n message: 'The main configuration data could not be loaded.',\n errorCode: (error as Response)?.status || undefined,\n otherData: await safeFetchTextWithTimeout(error as Response),\n transactionID,\n });\n throw new Error(`${WA_CONSOLE_PREFIX} The main configuration data could not be loaded.`);\n }\n\n // If the result is not okay, it must be a JWT error because any other kind of errors are handled in doConfigFetch\n // which would result in that function throwing an error instead of returning a result.\n if (result && !result.ok) {\n if (allowJWTRetry) {\n // Get a new token and then recursively call this method with allowJWTRetry set to false. You get one chance!\n await getNewIdentityToken(serviceManager, CatastrophicErrorType.FAILED);\n return getRemoteMainConfig(serviceManager, false);\n }\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n catastrophicErrorType: CatastrophicErrorType.FAILED,\n message: `A valid identity token is required to communicate with the integration.`,\n errorCode: result.status,\n otherData: await safeFetchTextWithTimeout(result),\n transactionID,\n });\n throw new Error();\n }\n\n if (!result) {\n throw new Error(`${WA_CONSOLE_PREFIX} The main configuration data could not be loaded.`);\n }\n\n // At the moment, this call returns the old complete configuration data but we only want the service desk and\n // assistant data.\n const resultJSON = await result.json();\n const mainConfig: RemoteMainConfig = merge(\n {\n service_desk: resultJSON.service_desk?.config,\n assistant: resultJSON.assistant,\n },\n publicConfig.servers?.mainConfig,\n );\n return mainConfig;\n}\n\nexport {\n validateConfig,\n DEFAULT_PUBLIC_CONFIG,\n DEFAULT_REMOTE_INIT_CONFIG,\n AGENT_APP_DEFAULT_PUBLIC_CONFIG,\n AGENT_APP_DEFAULT_REMOTE_INIT_CONFIG,\n getAnalyticsPath,\n getConfigURL,\n getCDNURL,\n getWXOUrl,\n getMessageURL,\n getHistoryURL,\n doConfigFetch,\n getRemoteInitConfig,\n getRemoteMainConfig,\n getSessionURL,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { PublicConfig, ServiceDeskFactoryParameters } from 'internal-packages/shared/types/PublicConfig';\n\nimport { RenderFunctionType } from './ChatInterface';\nimport { CreateHumanAgentServiceFunction } from './services/haa/HumanAgentService';\nimport { ServiceDesk } from './services/haa/serviceDesk/ServiceDesk';\nimport { getCDNURL } from './utils/config';\nimport { WA_CONSOLE_PREFIX } from './utils/constants';\nimport { consoleError } from './utils/miscUtils';\nimport { getVersionLoaded } from './utils/versionUtils';\n\n/**\n * In this file we manage our dynamic imports for the entry of web chat. See https://webpack.js.org/guides/code-splitting/#dynamic-imports.\n */\n\nasync function importChat() {\n try {\n const { default: Chat } = await import(/* webpackChunkName: \"Chat\" */ './Chat');\n return Chat;\n } catch (error) {\n consoleError('The web chat library could not be loaded.', error);\n throw new Error(`${WA_CONSOLE_PREFIX} The web chat library could not be loaded.`);\n }\n}\n\nasync function loadRender(): Promise<RenderFunctionType> {\n const { render } = await import(/* webpackChunkName: \"render\" */ './render');\n return render;\n}\n\nasync function loadHAA(): Promise<CreateHumanAgentServiceFunction> {\n const { createService } = await import(/* webpackChunkName: \"haa\" */ './services/haa/HumanAgentServiceImpl');\n return createService;\n}\n\n/**\n * Utility function to create a new mock service desk using code splitting to avoid including this code in the main\n * bundle.\n */\nasync function createMockServiceDesk(parameters: ServiceDeskFactoryParameters): Promise<ServiceDesk> {\n const { MockServiceDesk } = await import(\n /* webpackChunkName: \"mock-sd\" */ './services/haa/serviceDesk/mock/mockServiceDesk'\n );\n return new MockServiceDesk(parameters);\n}\n\nasync function loadStylesWithReset() {\n const { default: styles } = await import(/* webpackChunkName: \"styles-reset\" */ './styles/export.legacy.scss');\n return styles;\n}\n\nasync function loadStyles() {\n const { default: styles } = await import(/* webpackChunkName: \"styles\" */ './styles/export.scss');\n return styles;\n}\n\nasync function loadFontFace(publicConfig: PublicConfig) {\n const { getFontFace } = await import(/* webpackChunkName: \"font-styles\" */ './utils/fontUtils');\n const versionLoaded = getVersionLoaded(publicConfig);\n const cdnEndpoint = getCDNURL(publicConfig);\n const baseURL = `${cdnEndpoint}/versions/${versionLoaded}`;\n return getFontFace(baseURL);\n}\n\nexport { loadRender, loadHAA, createMockServiceDesk, loadStyles, loadStylesWithReset, importChat, loadFontFace };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * This hooks runs once when a component is first mounted. It's main purpose is to hide the eslint warning without\n * risking someone using the callback with values that could change after mounting.\n */\n\nimport React, { EffectCallback, useEffect } from 'react';\n\nconst useOnMount = (callback: EffectCallback) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(callback, []);\n};\n\nexport { useOnMount };\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { AdditionalChatParameters } from 'internal-packages/shared/types/AdditionalChatParameters';\nimport { ChatInstance } from 'internal-packages/shared/types/ChatInstance';\nimport { Fetch } from 'internal-packages/shared/types/Fetch';\nimport { PublicConfig } from 'internal-packages/shared/types/PublicConfig';\nimport cloneDeep from 'lodash-es/cloneDeep';\nimport merge from 'lodash-es/merge';\n\nimport { ChatInterface, ConstructableChatInterface, RenderFunctionType } from './ChatInterface';\nimport { getCDNURL, getRemoteInitConfig, validateConfig } from './utils/config';\nimport { getRealFetch } from './utils/fetch';\nimport { assertType, consoleDebug, consoleError, consoleWarn } from './utils/miscUtils';\nimport { resolvablePromise } from './utils/resolvablePromise';\nimport { getSharedConfig } from './utils/sharedConfigUtils';\nimport { getVersionLoaded, VERSION } from './utils/versionUtils';\n\n// Set Carbon Chat defaults.\n\nconst CARBON_DEFAULT_PUBLIC_CONFIG: Partial<PublicConfig> = {\n themeConfig: {\n // Carbon Chat only supports AI Theme\n useAITheme: true,\n },\n servers: {\n // Carbon Chat doesn't call an external location for config.\n skipConfig: true,\n },\n __ibm__: {\n // No amplitude stuff in Carbon Chat.\n isTrackingEnabled: false,\n useShadowRoot: true,\n },\n};\n\ntype ChatConstructorPromise = (publicConfig?: PublicConfig) => Promise<ConstructableChatInterface>;\n\nlet chatConstructorPromise: ChatConstructorPromise;\n\n/**\n * Populates window.loadWatsonAssistantChat and imports Chat. The method to import is different in\n * development vs production. In development, we just use a dynamic import statement. In production, we must embed a script\n * tag that returns a promise containing the Chat class. This is because of the Module Federation Plugin. We need to wrap the code the includes\n * shared resources with remote Plugins in the entry file. To do this, we have to have a dynamic import statement as the first line\n * of code to allow webpack to take over. Unfortunately, because of versioning, we need to do some processing before we can load in\n * Chat. In development, this doesn't matter because everything is served in one giant chunk. In production, it means\n * our initial load script and the script with Chat need to be different entry points.\n *\n */\nfunction doEntry(passedChatConstructorPromise: ChatConstructorPromise) {\n chatConstructorPromise = passedChatConstructorPromise;\n const publicConfig: PublicConfig = window.watsonAssistantChatOptions;\n applySessionOverrides(publicConfig);\n\n const debug = publicConfig?.debug;\n if (debug) {\n consoleDebug('[WatsonAssistantChatEntry] Starting.');\n }\n\n if (!publicConfig) {\n if (debug) {\n consoleDebug('[WatsonAssistantChatEntry] No window.watsonAssistantChatOptions found.');\n }\n } else if (publicConfig.onLoad) {\n if (debug) {\n consoleDebug('[WatsonAssistantChatEntry] Using publicConfig.onLoad.');\n }\n loadWatsonAssistantChatWithOnLoad();\n } else if (debug) {\n consoleWarn('[WatsonAssistantChatEntry] No onLoad found in public config.');\n }\n\n (window as any).loadWatsonAssistantChat = loadWatsonAssistantChat;\n}\n\n/**\n * Looks in session storage to see if there is an object that can be used to override the page's public\n * configuration. Useful for debugging and test without having access to modifying the source page.\n */\nfunction applySessionOverrides(publicConfig: PublicConfig) {\n try {\n if (publicConfig) {\n const override = window.sessionStorage?.getItem('IBM_WAC_CONFIG_OVERRIDE');\n if (override) {\n const overrideObject: Partial<PublicConfig> = JSON.parse(override);\n consoleWarn('Applying local config override', overrideObject);\n merge(publicConfig, overrideObject);\n }\n }\n } catch (error) {\n consoleError('Error trying to apply session overrides', error);\n }\n}\n\n/**\n * Creates a new web chat instance.\n */\nasync function loadWatsonAssistantChat(publicConfig: PublicConfig): Promise<ChatInstance> {\n applySessionOverrides(publicConfig);\n if (publicConfig?.debug) {\n consoleDebug('[WatsonAssistantChatEntry] Called loadWatsonAssistantChat()', publicConfig);\n }\n const widget = await instantiateWidget(publicConfig, getRealFetch(), chatConstructorPromise);\n return startWidget(widget);\n}\n\n/**\n * This function is called when the page public config supplies an appropriate config object with an \"onLoad\"\n * function on it.\n */\nfunction loadWatsonAssistantChatWithOnLoad() {\n const publicConfig: PublicConfig = window.watsonAssistantChatOptions;\n\n if (publicConfig?.debug) {\n consoleDebug('[WatsonAssistantChatEntry] Called loadWatsonAssistantChatWithOnLoad', publicConfig);\n }\n const pageOnLoad = publicConfig.onLoad;\n\n instantiateWidget(publicConfig, getRealFetch(), chatConstructorPromise)\n .then(widget => startWidget(widget))\n .then(pageOnLoad);\n}\n\n/**\n * Create new web chat instance.\n *\n * @param pagePublicConfig The public config options object that came from the page.\n * @param fetch The instance of the fetch function to use to make network calls.\n * @param chatConstructorPromise A promise that resolves with the WatsonAssistantChat class. This can either be a\n * script tab with some onload handlers, or could be an import() statement. Because of our use of MFEs, we are\n * currently limited to the former.\n * @param asCarbonChat Lets us know we are in generic \"carbon chat\" mode.\n * @param renderOverride Function to pass into Chat class to call instead of render function.\n * @returns Promise object that resolves with your new instance. See [./instance.md](./instance.md).\n */\nasync function instantiateWidget(\n pagePublicConfig: PublicConfig,\n fetch: Fetch,\n chatConstructorPromise: ChatConstructorPromise,\n asCarbonChat?: boolean,\n renderOverride?: Promise<RenderFunctionType>,\n localInstall?: boolean,\n) {\n const loadStartTime = Date.now();\n\n let config = cloneDeep(pagePublicConfig);\n\n if (config?.debug) {\n consoleDebug('[ChatEntry] Called instantiateWidget', config);\n }\n\n if (document.location.protocol !== 'https:') {\n consoleWarn('Your page is not running with \"https\"; your data will not be sent securely.');\n }\n\n // Set carbon chat defaults\n if (asCarbonChat) {\n const carbonConfig = cloneDeep(CARBON_DEFAULT_PUBLIC_CONFIG);\n // If the Carbon Chat is using their own setup for history rather than customLoadHistory,\n // we make sure to skip loading history the native way.\n if (!config.messaging?.customLoadHistory) {\n carbonConfig.servers = carbonConfig.servers || {};\n carbonConfig.servers.skipHistory = true;\n }\n\n config = merge(config, carbonConfig);\n }\n\n validateConfig(config, asCarbonChat);\n\n // Extract the extra properties from the page config we don't want to put in to the redux store.\n const { element, onLoad, onError, ...publicConfig } = config;\n\n assertType<PublicConfig>(publicConfig);\n\n if (publicConfig.__ibm__?.skipConfig) {\n consoleWarn(`IBM skipConfig is deprecated. Use servers.skipConfig.`);\n publicConfig.servers = publicConfig.servers || {};\n publicConfig.servers.skipConfig = true;\n }\n\n if (publicConfig.__ibm__?.overrideRemoteInitConfig) {\n consoleWarn(`IBM overrideRemoteInitConfig is deprecated. Use servers.initConfig.`);\n publicConfig.servers = publicConfig.servers || {};\n publicConfig.servers.initConfig = publicConfig.__ibm__.overrideRemoteInitConfig;\n }\n\n const [remoteInitConfig, Chat] = await Promise.all([\n // Get the initial config object from the integrations server.\n asCarbonChat ? Promise.resolve({}) : getRemoteInitConfig(publicConfig, onError, fetch),\n // Load web chat client side code\n chatConstructorPromise(publicConfig),\n ]);\n\n const additionalChatParameters: AdditionalChatParameters = {\n loadVersion: asCarbonChat ? 'WatsonAssistantChatEntry' : 'CarbonChatEntry',\n onError,\n fetch,\n loadStartTime,\n asCarbonChat,\n renderOverride,\n localInstall,\n };\n\n return new Chat(publicConfig, remoteInitConfig, element, additionalChatParameters);\n}\n\n/**\n * Starts the widget and returns the chat instance.\n */\nfunction startWidget(widget: ChatInterface): Promise<ChatInstance> {\n return new Promise((resolve, reject) => {\n const start = function startWAC() {\n widget.start().then(resolve, reject);\n };\n // If web chat is injected into the head instead of the body, its *possible* web chat could start running before DOM is ready.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', start);\n } else {\n start();\n }\n });\n}\n\n/**\n * This function returns a promise with the constructor function for Chat.\n *\n * It does so by keeping a map in the shared config on window of versions that are trying to be loaded and stores a\n * resolvablePromise there. Chat.ts will then resolve the promise after it loads.\n */\nasync function getChatConstructorPromiseFromScript(publicConfig: PublicConfig): Promise<ConstructableChatInterface> {\n const versionLoaded = getVersionLoaded(publicConfig);\n const { loadScriptPromises } = getSharedConfig();\n // If we already have a promise for this version, just return it and don't start over.\n // Rather then using versionLoaded we need to use the actual version number. This is because of custom named versions.\n // When this promise is resolved, it happens before the contructor is called so it has no way of knowning if its a\n // named or regular version. Internally, we will have to watch for loading a named version and a regular version on\n // the same page if the version in package.json is the same. This isn't a customer facing issue and not something that\n // we would ever likely come across either.\n if (loadScriptPromises[VERSION]) {\n return loadScriptPromises[VERSION];\n }\n loadScriptPromises[VERSION] = resolvablePromise<ConstructableChatInterface>();\n return new Promise((resolve, reject) => {\n const cdnEndpoint = getCDNURL(publicConfig);\n const baseURL = `${cdnEndpoint}/versions/${versionLoaded}`;\n const wacScriptElement = document.createElement('script');\n wacScriptElement.onload = async () => {\n // Of note, we use VERSION and not versionLoaded here. This is because we don't have access to that value in\n // WatsonAssistantChat.ts until the constructor is called. Chicken and egg. So we go by the \"real\" version\n // understanding there might be edge case bugs running a named development branch version and a real version\n // that have the same VERSION in package.json at the same time. This is an internal problem.\n const WatsonAssistantChat = await loadScriptPromises[VERSION];\n resolve(WatsonAssistantChat);\n };\n wacScriptElement.onerror = error => {\n reject(error);\n };\n wacScriptElement.src = `${baseURL}/chat.js`;\n document.head.appendChild(wacScriptElement);\n });\n}\n\nexport { doEntry, instantiateWidget, applySessionOverrides, startWidget, getChatConstructorPromiseFromScript };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { instantiateWidget, startWidget } from 'internal-packages/shared/chatEntryFunctions';\nimport { importChat } from 'internal-packages/shared/chatEntryImports';\nimport { RenderFunctionType } from 'internal-packages/shared/ChatInterface';\nimport type { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { BusEventType, type BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport { Dispatch, MutableRefObject, SetStateAction } from 'react';\n\nimport { ManagedWebChat } from '../types/types';\n\ninterface LoadChatArgs {\n managedWebChatRef: MutableRefObject<ManagedWebChat>;\n managedWebChat: ManagedWebChat;\n renderOverride: RenderFunctionType;\n setInstance: (instance: ChatInstance) => void;\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n setUserDefinedResponseEvents: Dispatch<SetStateAction<BusEventUserDefinedResponse[]>>;\n}\n\n/**\n * Destroys an instance of web chat and marks it destroyed.\n */\nasync function destroyWebChat(managedWebChat: ManagedWebChat, setInstance: (instance: ChatInstance) => void) {\n if (managedWebChat) {\n if (managedWebChat.instance) {\n await new Promise<void>(resolve => {\n managedWebChat.instance.destroy();\n // Some cloak and daggers because destroy isn't an async function and just fires off some events.\n setTimeout(() => {\n resolve();\n });\n });\n }\n managedWebChat.shouldDestroy = true;\n managedWebChat.instance = null;\n }\n setInstance(null);\n}\n\n/**\n * Adds a \"userDefinedResponse\" event listener to the given web chat instance that will use the given set function\n * to add new events to the list.\n */\nfunction addUserDefinedResponseHandler(\n webChatInstance: ChatInstance,\n setUserDefinedResponseEvents: Dispatch<SetStateAction<BusEventUserDefinedResponse[]>>,\n) {\n // This handler will fire each time a user defined response occurs and we will update our state by appending the\n // event to the end of our events list. We have to make sure to create a new array in order to trigger a re-render.\n function userDefinedResponseHandler(event: BusEventUserDefinedResponse) {\n setUserDefinedResponseEvents(eventsArray => eventsArray.concat(event));\n }\n\n // Also make sure to clear the list if a restart occurs.\n function restartHandler() {\n setUserDefinedResponseEvents([]);\n }\n\n webChatInstance.on({ type: BusEventType.USER_DEFINED_RESPONSE, handler: userDefinedResponseHandler });\n webChatInstance.on({ type: BusEventType.RESTART_CONVERSATION, handler: restartHandler });\n}\n\nasync function loadChat({\n managedWebChatRef,\n managedWebChat,\n renderOverride,\n setInstance,\n onBeforeRender,\n onAfterRender,\n setUserDefinedResponseEvents,\n}: LoadChatArgs) {\n // Each time the web chat config settings change (or this component is mounted), we need to destroy any previous\n // web chat and create a new web chat.\n\n // First look at the old ref and destroy it if its supposed to be destroyed.\n await destroyWebChat(managedWebChatRef.current, setInstance);\n\n // Update the ref to the new managedWebChat.\n managedWebChatRef.current = managedWebChat;\n\n // Just double check that the new one also isn't supposed to be destroyed.\n if (managedWebChat.shouldDestroy) {\n await destroyWebChat(managedWebChat, setInstance);\n return;\n }\n\n // Create web chat here.\n const widget = await instantiateWidget(\n managedWebChat.config,\n undefined, // No need to pass in a fetch since its bring your own backend.\n importChat,\n true,\n Promise.resolve(renderOverride),\n true,\n );\n\n const instance = await startWidget(widget);\n\n addUserDefinedResponseHandler(instance, setUserDefinedResponseEvents);\n\n onBeforeRender?.(instance);\n await instance.render();\n onAfterRender?.(instance);\n\n setInstance(instance);\n managedWebChat.instance = instance;\n\n if (managedWebChat.shouldDestroy) {\n await destroyWebChat(managedWebChat, setInstance);\n }\n}\n\nexport { loadChat, destroyWebChat };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport React, { ReactNode } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { RenderUserDefinedResponse } from '../../types/publicTypes';\n\ninterface UserDefinedResponsePortalsContainer {\n /**\n * The instance of a web chat that this component will register listeners on.\n */\n chatInstance: ChatInstance;\n\n /**\n * The function that this component will use to request the actual React content to display for each user defined\n * response.\n */\n renderResponse: RenderUserDefinedResponse;\n\n /**\n * The list of events that were fired that contain all the responses to render.\n */\n userDefinedResponseEvents: BusEventUserDefinedResponse[];\n}\n\n/**\n * This is a utility component that is used to manage all the user defined responses that are rendered by web chat.\n * When a user defined response message is received by web chat, it will fire a \"userDefinedResponse\" event that\n * provides an HTML element to which your application can attach user defined content. React portals are a mechanism\n * that allows you to render a component in your React application but attach that component to the HTML element\n * that was provided by web chat.\n *\n * This component will render a portal for each user defined response. The contents of that portal will be\n * determined by calling the provided \"renderResponse\" render prop.\n */\nfunction UserDefinedResponsePortalsContainer({\n chatInstance,\n renderResponse,\n userDefinedResponseEvents,\n}: UserDefinedResponsePortalsContainer) {\n // All we need to do to enable the React portals is to render each portal somewhere in your application (it\n // doesn't really matter where).\n return (\n <>\n {userDefinedResponseEvents.map(function mapEvent(event, index) {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <UserDefinedResponseComponentPortal key={index} hostElement={event.data.element}>\n {renderResponse(event, chatInstance)}\n </UserDefinedResponseComponentPortal>\n );\n })}\n </>\n );\n}\n\n/**\n * This is the component that will attach a React portal to the given host element. The host element is the element\n * provided by web chat where your user defined response will be displayed in the DOM. This portal will attach any React\n * children passed to it under this component so you can render the response using your own React application. Those\n * children will be rendered under the given element where it lives in the DOM.\n */\nfunction UserDefinedResponseComponentPortal({\n hostElement,\n children,\n}: {\n hostElement: HTMLElement;\n children: ReactNode;\n}) {\n return ReactDOM.createPortal(children, hostElement);\n}\n\nconst UserDefinedResponsePortalsContainerExport = React.memo(UserDefinedResponsePortalsContainer);\nexport { UserDefinedResponsePortalsContainerExport as UserDefinedResponsePortalsContainer };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * This component actually loads the Chat class and renders the Chat.\n *\n * It handles writing Portals for user_defined response types as well and teardown and build activities.\n */\n\nimport { loadStyles } from 'internal-packages/shared/chatEntryImports';\nimport { RenderFunctionArgs } from 'internal-packages/shared/ChatInterface';\nimport { useOnMount } from 'internal-packages/shared/hooks/useOnMount';\nimport type { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { type BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport type { PublicConfig } from 'internal-packages/types/PublicConfig';\nimport React, { lazy, Suspense, useEffect, useRef, useState } from 'react';\n\nimport { ChatContainerProps } from '../../types/publicTypes';\nimport { ManagedWebChat } from '../../types/types';\nimport { destroyWebChat, loadChat } from '../../utils/utils';\nimport { UserDefinedResponsePortalsContainer } from './UserDefinedResponsePortalsContainer';\n\nconst App = lazy(() => import('internal-packages/shared/containers/App'));\n\ninterface AppContainerProps extends ChatContainerProps {\n /**\n * The element the web chat is hosted in. Included main window, tours and launcher.\n */\n container: HTMLElement;\n}\n\nfunction AppContainer({\n config,\n onBeforeRender,\n onAfterRender,\n renderUserDefinedResponse,\n container,\n}: AppContainerProps) {\n // A state value that contains the current instance of web chat.\n const [instance, setInstance] = useState<ChatInstance>(null);\n const [renderProps, setRenderProps] = useState<RenderFunctionArgs>(null);\n const [applicationStyles, setApplicationStyles] = useState<string>(null);\n\n // This state will be used to record all the user defined response events that are fired from the widget. These\n // events contain the HTML elements that we will attach our portals to as well as the messages that we wish to\n // render in the message.\n const [userDefinedResponseEvents, setUserDefinedResponseEvents] = useState<BusEventUserDefinedResponse[]>([]);\n\n // The most recent web chat that was load by this component.\n const managedWebChatRef = useRef<ManagedWebChat>(null);\n\n // The previous web chat config.\n const previousConfigRef = useRef<PublicConfig>(null);\n\n async function onMount() {\n const applicationStyles = await loadStyles();\n // For the npm package, we currently assume Carbon fonts are loaded on the page already.\n // This might have to change if we allow white labeling some day.\n setApplicationStyles(applicationStyles);\n }\n\n useOnMount(() => {\n onMount();\n });\n\n useEffect(() => {\n const previousConfig = previousConfigRef.current;\n previousConfigRef.current = config;\n\n async function renderOverride({ serviceManager }: RenderFunctionArgs) {\n serviceManager.container = container;\n setRenderProps({\n serviceManager,\n });\n\n if (serviceManager.customHostElement) {\n // Set container to grow to size of provided element. We don't do this sooner because \"body\" might be set to\n // display: flex;\n container.setAttribute('style', 'width:100% !important; height:100% !important');\n } else {\n // We want to make sure it doesn't interfere with the body by covering anything up so we'll set it to a 0 size.\n // The child elements use position: fixed along with a size that break out of the container.\n container.setAttribute('style', 'width:0 !important; height:0 !important');\n }\n }\n\n if (previousConfig !== config) {\n // We'll use this managed object to keep track of the web chat instance we are creating for this effect.\n const managedWebChat: ManagedWebChat = {\n instance: null,\n shouldDestroy: false,\n config,\n };\n\n loadChat({\n managedWebChatRef,\n managedWebChat,\n renderOverride,\n setInstance,\n onBeforeRender,\n onAfterRender,\n setUserDefinedResponseEvents,\n });\n\n return () => {\n destroyWebChat(managedWebChat, setInstance);\n previousConfigRef.current = null;\n };\n }\n\n return undefined;\n }, [config, container, onAfterRender, onBeforeRender]);\n\n if (instance && renderProps && applicationStyles) {\n return (\n <>\n <Suspense fallback={<div />}>\n <App\n serviceManager={renderProps.serviceManager}\n hostElement={renderProps.serviceManager.customHostElement}\n applicationStyles={applicationStyles}\n />\n\n {renderUserDefinedResponse && (\n <UserDefinedResponsePortalsContainer\n chatInstance={instance}\n renderResponse={renderUserDefinedResponse}\n userDefinedResponseEvents={userDefinedResponseEvents}\n />\n )}\n </Suspense>\n </>\n );\n }\n\n return null;\n}\n\nexport { AppContainer };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\nexport declare type Constructor<T> = {\n new (...args: any[]): T;\n};\nexport interface ClassDescriptor {\n kind: 'class';\n elements: ClassElement[];\n finisher?: <T>(clazz: Constructor<T>) => void | Constructor<T>;\n}\nexport interface ClassElement {\n kind: 'field' | 'method';\n key: PropertyKey;\n placement: 'static' | 'prototype' | 'own';\n // eslint-disable-next-line @typescript-eslint/ban-types\n initializer?: Function;\n extras?: ClassElement[];\n finisher?: <T>(clazz: Constructor<T>) => void | Constructor<T>;\n descriptor?: PropertyDescriptor;\n}\n\n/**\n * Allow for custom element classes with private constructors\n */\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nconst legacyCustomElement = (tagName: string, clazz: CustomElementClass) => {\n try {\n customElements.define(tagName, clazz as CustomElementConstructor);\n } catch (error) {\n // console.warn(`Attempting to re-define ${tagName}`);\n }\n // Cast as any because TS doesn't recognize the return type as being a\n // subtype of the decorated class when clazz is typed as\n // `Constructor<HTMLElement>` for some reason.\n // `Constructor<HTMLElement>` is helpful to make sure the decorator is\n // applied to elements however.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return clazz as any;\n};\n\nconst standardCustomElement = (tagName: string, descriptor: ClassDescriptor) => {\n const { kind, elements } = descriptor;\n return {\n kind,\n elements,\n // This callback is called once the class is otherwise fully defined\n finisher(clazz: Constructor<HTMLElement>) {\n try {\n customElements.define(tagName, clazz);\n } catch (error) {\n // console.warn(`Attempting to re-define ${tagName}`);\n }\n },\n };\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```js\n * @carbonElement('my-element')\n * class MyElement extends LitElement {\n * render() {\n * return html``;\n * }\n * }\n * ```\n *\n * @param tagName The tag name of the custom element to define.\n */\nexport const carbonElement = (tagName: string) => (classOrDescriptor: CustomElementClass | ClassDescriptor) =>\n typeof classOrDescriptor === 'function'\n ? legacyCustomElement(tagName, classOrDescriptor)\n : standardCustomElement(tagName, classOrDescriptor as ClassDescriptor);\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/* eslint-disable react/no-deprecated */\n\n/**\n * This component is mostly a pass-through. Its takes any properties passed into the ChatContainer\n * custom element and then renders the React web chat application while passing in properties.\n */\n\nimport { consoleError } from 'internal-packages/shared/utils/miscUtils';\nimport { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { AppContainer } from '../../react/components/AppContainer';\nimport { ChatInstance } from '../../types/chatInstance';\nimport { PublicConfig } from '../../types/chatPublicConfig';\nimport { RenderUserDefinedResponse } from '../../types/publicTypes';\nimport { carbonElement } from '../decorators/customElement';\n\n@carbonElement('cds-aichat-internal')\nclass ChatContainerInternal extends LitElement {\n /**\n * The config to use to load web chat. Note that the \"onLoad\" property is overridden by this component. If you\n * need to perform any actions after web chat been loaded, use the \"onBeforeRender\" or \"onAfterRender\" props.\n */\n @property({ type: Object })\n config: PublicConfig;\n\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onBeforeRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onAfterRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * ReactDOM.render and createRoot can't be used together in the same application.\n * Web chat detects if ReactDOM is React 18 or React 17, but they could be using React 18 in React 17 mode.\n */\n @property()\n forceReact17Mode: boolean;\n\n /**\n * If this is being wrapped by React, we can handle React Portals for people.\n */\n @property()\n renderUserDefinedResponse: RenderUserDefinedResponse;\n\n // Prevent Lit from managing the shadow DOM, we will use it manually\n protected createRenderRoot() {\n return this.attachShadow({ mode: 'open' });\n }\n\n firstUpdated() {\n // Render the React component with any updated properties if necessary\n const style = document.createElement('style');\n style.textContent = `\n cds-aichat-internal {\n display: block;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n ${this.config?.element ? '' : 'z-index: var(--cds-chat-BASE-z-index);'}\n }\n .cwx-react-app {\n height: 100%;\n width: 100%;\n }\n `;\n this.appendChild(style);\n this._renderReactApp();\n }\n\n updated(changedProperties: Map<string, any>) {\n // Render the React component with any updated properties if necessary\n if (changedProperties.has('config')) {\n this._renderReactApp();\n }\n }\n\n /**\n * Track if a previous React 18 root was already created so we don't create a memory leak on re-renders.\n */\n private _root: any;\n\n private async _renderReactApp() {\n const previousContainer: HTMLElement = this.shadowRoot.querySelector('.cwx-react-app');\n previousContainer?.remove();\n const container = document.createElement('div');\n container.classList.add('cwx-react-app');\n this.shadowRoot.appendChild(container);\n if ('createRoot' in ReactDOM && !this.forceReact17Mode) {\n // Make sure we only have one root.\n if (this._root) {\n this._root.unmount();\n }\n try {\n const { createRoot } = await import('react-dom/client');\n this._root = createRoot(container);\n this._root.render(\n <AppContainer\n config={this.config}\n renderUserDefinedResponse={this.renderUserDefinedResponse}\n onBeforeRender={this.onBeforeRender}\n onAfterRender={this.onAfterRender}\n container={container}\n />,\n );\n } catch {\n // No react-dom/client.\n consoleError('Unable to render React client.');\n }\n } else {\n // Fallback to ReactDOM.render for React 17 and earlier\n ReactDOM.render(\n <AppContainer\n config={this.config}\n renderUserDefinedResponse={this.renderUserDefinedResponse}\n onBeforeRender={this.onBeforeRender}\n onAfterRender={this.onAfterRender}\n container={container}\n />,\n container,\n );\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cds-aichat-internal': ChatContainerInternal;\n }\n}\n\nexport default ChatContainerInternal;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The ChatContainer is a light dom custom element. This is the direct export used for people using the web component\n * version of the web chat outside of a custom element. Is it also used by the React ChatContainer. It is responsible\n * for managing creating of slots to be fed into the ShadowDOM based cds-aichat-internal web component.\n *\n * Because the full chat is rendered inside the ShadowDOM, we need to give people an approach for styling their custom\n * content without resorting to figuring out build steps to inject the styles into the component itself. This component\n * works by dynamically injecting a named slot element for each user_defined event it receives.\n */\n\nimport './cds-aichat-internal';\n\nimport { WriteableElementName } from 'internal-packages/types/ChatInstance';\nimport { BusEventType, BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport { html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { ChatInstance } from '../../types/chatInstance';\nimport { PublicConfig } from '../../types/chatPublicConfig';\nimport { RenderUserDefinedResponse } from '../../types/publicTypes';\nimport { carbonElement } from '../decorators/customElement';\n\ninterface Slot {\n /**\n * The element itself.\n */\n element: HTMLElement;\n}\n\n/**\n * Constructed class functionality for the MarkdownText custom element\n */\n\n@carbonElement('cds-aichat-container-light')\nclass ChatContainerLight extends LitElement {\n /**\n * The config to use to load web chat. Note that the \"onLoad\" property is overridden by this component. If you\n * need to perform any actions after web chat been loaded, use the \"onBeforeRender\" or \"onAfterRender\" props.\n */\n @property({ type: Object })\n config: PublicConfig;\n\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onBeforeRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onAfterRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * ReactDOM.render and createRoot can't be used together in the same application.\n * Web chat detects if ReactDOM is React 18 or React 17, but they could be using React 18 in React 17 mode.\n */\n @property()\n forceReact17Mode: boolean;\n\n /**\n * If this is being wrapped by React, we can handle React Portals for people.\n */\n @property()\n renderUserDefinedResponse: RenderUserDefinedResponse;\n\n /**\n * The existing array of slots for all user_defined components.\n */\n @state()\n _userDefinedSlots: Slot[] = [];\n\n /**\n * The existing array of slots for all user_defined components.\n */\n @state()\n _writeableElementSlots: Slot[] = [];\n\n /**\n * The chat instance.\n */\n @state()\n _instance: ChatInstance;\n\n /**\n * Adds the slot attribute to the element for the user_defined response type and then injects it into the component by\n * updating this._slots;\n */\n _userDefinedHandler = (event: BusEventUserDefinedResponse) => {\n const { element } = event.data;\n this._userDefinedSlots = [...this._userDefinedSlots, { element }];\n };\n\n _onBeforeRenderOverride = (instance: ChatInstance) => {\n if (instance) {\n this._instance = instance;\n this._instance.on({ type: BusEventType.USER_DEFINED_RESPONSE, handler: this._userDefinedHandler });\n this._addWriteableElementSlots();\n this.onBeforeRender?.(instance);\n }\n };\n\n _addWriteableElementSlots() {\n const writeableElementSlots: Slot[] = [{ element: this._instance.customPanels.getPanel().hostElement }];\n Object.keys(this._instance.writeableElements).forEach(writeableElementKey => {\n const element = this._instance.writeableElements[writeableElementKey as WriteableElementName];\n element.setAttribute('slot', writeableElementKey);\n writeableElementSlots.push({ element });\n });\n this._writeableElementSlots = writeableElementSlots;\n }\n\n protected createRenderRoot() {\n // Force us into \"light dom\".\n return this;\n }\n\n render() {\n return html`<cds-aichat-internal\n .config=${this.config}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this._onBeforeRenderOverride}\n .renderUserDefinedResponse=${this.renderUserDefinedResponse}\n .forceReact17Mode=${this.forceReact17Mode}\n >\n ${this._writeableElementSlots.map(item => html`${item.element}`)}\n ${this._userDefinedSlots.map(item => html`${item.element}`)}\n </cds-aichat-internal>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cds-aichat-container-light': ChatContainerLight;\n }\n}\n\nexport default ChatContainerLight;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/* eslint-disable @typescript-eslint/no-empty-interface */\n\n/**\n * This file contains the generic types for the API between a general chat widget and a chat back-end. It is\n * intended to provide base types for a standalone widget and should not contain any imports of other types.\n */\n\nimport { DeepPartial } from 'ts-essentials';\n\n/**\n * This is the main interface that represents a request from a user sent to a back-end.\n */\ninterface MessageRequest<TInputType extends BaseMessageInput = MessageInput> {\n /**\n * The input data to the back-end to make in this request.\n */\n input: TInputType;\n\n /**\n * Optional context which is added from external resources.\n */\n context?: MessageContext;\n}\n\n/**\n * The set of possible message input types in a request.\n */\nenum MessageInputType {\n /**\n * Represents a simple text message.\n */\n TEXT = 'text',\n\n /**\n * Represents an event message that can be used to send control, updates, or action information to the back-end.\n */\n EVENT = 'event',\n}\n\ninterface BaseMessageInput {\n /**\n * The type of user input.\n */\n message_type?: MessageInputType;\n}\n\n/**\n * Base interface for an event message that can be used to send control, updates, or action information to the back-end.\n */\ninterface EventInput<TEventInputType = EventInputData> extends BaseMessageInput {\n /**\n * Event messages have this as their input type.\n */\n message_type: MessageInputType.EVENT;\n\n /**\n * The type of the event.\n */\n event: TEventInputType;\n}\n\n/**\n * Input for an event. The name of the event is mandatory. Additional fields depend on the event.\n *\n * @template TNameType The type of the name property for the event. This can just be a string or it can be a\n * specific string in order to create type safety ensuring each event has the right name (e.g. \"typeof MY_EVENT_NAME\").\n */\ninterface EventInputData<TNameType extends string = string> {\n /**\n * The name of the event.\n */\n name: TNameType;\n}\n\n/**\n * The default interface for message input that is sent to a back-end in a message request. This represents basic text\n * input.\n */\ninterface MessageInput extends BaseMessageInput {\n /**\n * The text of the user input to send to the back-end.\n */\n text?: string;\n}\n\n/**\n * This interface represents the main response content that is received by a client from a back-end. It is generally\n * in response to a previous message request.\n */\ninterface MessageResponse<TGenericType = GenericItem[]> {\n /**\n * The output from the back-end to be rendered or processed by the client.\n */\n output: MessageOutput<TGenericType>;\n\n /**\n * The context information returned by the back-end.\n */\n context?: MessageContext;\n}\n\n/**\n * The output context for a message response from a back-end.\n */\ninterface MessageOutput<TGenericType = GenericItem[]> {\n /**\n * Responses intended to be processed by a generic channel. This will be an array of message response items.\n */\n generic?: TGenericType;\n}\n\n/**\n * Contextual information gathered by the service.\n */\ninterface MessageContext {\n /**\n * Global context.\n */\n global?: MessageGlobalContext;\n\n /**\n * Contains the context data for a message. The context data is divided into object for different skills that may\n * be involved with the message.\n */\n skills?: {\n /**\n * The context associated with each skill. Note that \"main skill\" and \"actions skill\" are reserved skill names\n * and should not be used outside of watsonx Assistant or watsonx Orchestrate.\n */\n [skill_name: string]: MessageSkillContext;\n };\n\n // integrations.chat.browser_info\n}\n\ninterface MessageGlobalContext {\n /**\n * Global system context\n */\n system?: MessageSystemContext;\n}\n\ninterface MessageSystemContext {\n /**\n * The current timezone of the client.\n */\n timezone?: string; // E.g.: \"Europe/Budapest\".\n\n /**\n * The current system locale. Example: \"en-US\".\n */\n locale?: string;\n}\n\n/**\n * The base interface for the content of a message context. The content of this will vary by which skill is involved\n * in the message.\n */\ninterface MessageSkillContext {}\n\n/**\n * The set of possible message types in a response from IBM watsonx Assistant.\n */\nenum MessageResponseTypes {\n /**\n * Represents a basic text response. The given text may contain rich content such as markdown.\n */\n TEXT = 'text',\n\n /**\n * A response that requests the user choose an option from a list. The list of options may be presented as a list\n * of buttons or it may be from a drop-down.\n */\n OPTION = 'option',\n\n /**\n * Indicates that the conversation should be escalated to a human agent and offers that opportunity to the user.\n */\n CONNECT_TO_AGENT = 'connect_to_agent',\n\n /**\n * Displays an image to the user.\n */\n IMAGE = 'image',\n\n /**\n * Indicates that the chat should display a pause at this point in the conversation before displaying additional\n * items.\n */\n PAUSE = 'pause',\n\n /**\n * A user defined response will be displayed according to custom logic in the client.\n */\n USER_DEFINED = 'user_defined',\n\n /**\n * Displays the contents of an iframe to the user.\n */\n IFRAME = 'iframe',\n\n /**\n * Displays a video to the user using a video player.\n */\n VIDEO = 'video',\n\n /**\n * Displays an audio clip to the user using an audio player.\n */\n AUDIO = 'audio',\n\n /**\n * Asks the user to provide a date. This may result in a date picker being presented to the user.\n */\n DATE = 'date',\n\n /**\n * Displays a table of data to the user.\n */\n TABLE = 'table',\n\n /**\n * Displays a general error message to the user and include developer info to be logged and to debug.\n */\n INLINE_ERROR = 'inline_error',\n}\n\n/**\n * The basic class for items returned from a back-end as part of a message response. These are the items contained\n * in the {@link MessageOutput.generic} array.\n */\ninterface GenericItem<TUserDefinedType = Record<string, unknown>> {\n /**\n * The response type of this message item.\n */\n response_type: MessageResponseTypes;\n\n /**\n * Metadata used identify a generic item within the context of a stream in order to correlate any updates meant\n * for a specific item.\n */\n streaming_metadata?: ItemStreamingMetadata;\n\n /**\n * An optional buckets of additional user defined properties for this item.\n */\n user_defined?: TUserDefinedType;\n}\n\n/**\n * A user defined item returned in a message response from a back-end.\n */\ninterface UserDefinedItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {}\n\n/**\n * A text item returned in a message response from a back-end.\n */\ninterface TextItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The text of the response.\n */\n text?: string;\n\n /**\n * The optional formatting for the text response.\n */\n format?: {\n /**\n * If this is true, it means we are not going to get `<br />` to manage spacing and should add margin/padding\n * to elements as required with CSS.\n */\n use_padding?: boolean;\n };\n}\n\n/**\n * A \"connect to agent\" item returned in a message response from a back-end. This is used when the back-end\n * indicates that a user's conversation should be escalated to a human agent.\n */\ninterface ConnectToAgentItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * A message to be sent to the human agent who will be taking over the conversation.\n */\n message_to_human_agent?: string;\n\n /**\n * Contains the message to be rendered if there are agents available.\n */\n agent_available?: {\n message: string;\n };\n\n /**\n * Contains the message to be rendered if there are no agents available.\n */\n agent_unavailable?: {\n message: string;\n };\n\n /**\n * When a conversation is escalated to an agent additional information is needed to fullfill the request. This\n * additional information typically is added by the channel integration and cannot be deduced from the dialog\n * itself.\n */\n transfer_info?: ConnectToAgentItemTransferInfo;\n}\n\n/**\n * Additional information as part of a {@link ConnectToAgentItem} that may be need to perform a transfer to an agent.\n */\ninterface ConnectToAgentItemTransferInfo {\n /**\n * A key used by the service desk to securely load the session history.\n */\n session_history_key?: string;\n\n /**\n * Each service desk may require different information to start the connection. It can be account details or\n * security information. This is a bucket of all the service desk specific properties.\n */\n additional_data?: {\n [key: string]: string;\n };\n\n /**\n * An initial set of message items to send to the agent.\n */\n summary_message_to_agent?: TextItem[];\n}\n\n/**\n * A pause item returned in a message response from a back-end. This indicates that the client should pause before\n * displaying additional response items.\n */\ninterface PauseItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * How long to pause, in milliseconds.\n */\n time?: number;\n\n /**\n * Whether to display an \"is typing\" indicator during the pause.\n */\n typing?: boolean;\n}\n\n/**\n * An option item returned in a message response from a back-end. This response type is used when displaying a list\n * of options to the user. How the options are displayed is up to the client but is often displayed in either a\n * drop-down or as a list of buttons.\n */\ninterface OptionItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * An array of objects describing the options from which the user can choose.\n */\n options: Option[];\n\n /**\n * An optional title to be shown alongside the options.\n */\n title?: string;\n\n /**\n * An optional description to be shown alongside the options.\n */\n description?: string;\n\n /**\n * The preferred type of control to display.\n */\n preference?: OptionItemPreference;\n}\n\n/**\n * The set of possible response preferences for an options response.\n */\nenum OptionItemPreference {\n /**\n * Indicates the options should be displayed as a drop-down.\n */\n DROPDOWN = 'dropdown',\n\n /**\n * Indicates the options should be displayed as buttons.\n */\n BUTTON = 'button',\n}\n\n/**\n * Represents an individual option that is part of an \"options\" response.\n */\ninterface Option {\n /**\n * The user-facing label for the option or disambiguation suggestion. This label is taken from the user_label property\n * of the corresponding dialog node.\n */\n label: string;\n\n value: {\n /**\n * An input object that should be sent back to the assistant when this option is chosen by a user.\n */\n input: MessageInput;\n };\n}\n\ninterface IFrameItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The source URL to an embeddable page\n */\n source: string;\n\n /**\n * The preview image of the source URL. This property is unfurled from the source URL at runtime. It is used when\n * IFrameItemDisplayOption is set to 'panel' for the preview card to open the panel.\n */\n image_url?: string;\n\n /**\n * The title of the source URL. This property is unfurled from the source URL at runtime. It is used when\n * IFrameItemDisplayOption is set to 'panel' for the preview card to open the panel.\n */\n title?: string;\n\n /**\n * The description of the source URL. This property is unfurled from the source URL at runtime. It is used when\n * IFrameItemDisplayOption is set to 'panel' for the preview card to open the panel.\n */\n description?: string;\n\n /**\n * How the iframe should be displayed.\n */\n display?: IFrameItemDisplayOption;\n}\n\n/**\n * Dimension information for displaying a media item.\n */\ninterface MediaItemDimensions {\n /**\n * This property's value is used to calculate a responsive height for web chat's media player so that its aspect\n * ratio is the same between different screen widths. This is set to a reasonable default depending on the response type\n * and other details like what service you are pulling the content from (e.g. Youtube or SoundCloud).\n */\n base_height?: number;\n}\n\n/**\n * The different ways an iframe item may be displayed.\n */\nenum IFrameItemDisplayOption {\n /**\n * The iframe is displayed inline in the main message list.\n */\n INLINE = 'inline',\n\n /**\n * The iframe is displayed in a separate panel after showing a card in the main message list.\n */\n PANEL = 'panel',\n}\n\n/**\n * A reusable media object that may need to display a title and description with an alt_text to label the item for\n * accessibility purposes. This is used by the Audio, Video and Image response types.\n */\ninterface MediaItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The url pointing to a media source, whether audio, video, or image.\n * \n * For video this can be a file like an .mp4 or a YouTube, Facebook, Vimeo, Twitch, Streamable, Wistia, or Vidyard url.\n * \n * For audio this can be a file like an .mp3 or a SoundCloud or Mixcloud url.\n */\n source: string;\n\n /**\n * The title for the item.\n */\n title?: string;\n\n /**\n * The description for the item.\n */\n description?: string;\n\n /**\n * The alt text for labeling the item. Screen readers will announce this text when the user's virtual cursor\n * is focused on the item.\n */\n alt_text?: string;\n\n /**\n * Settings that control the dimensions for the media item.\n */\n dimensions?: MediaItemDimensions;\n}\n\n/**\n * Citations for text generated by an AI to provide the user with relevant source information and context.\n */\ninterface ConversationalSearchItemCitation {\n /**\n * Optional url of the citation. May not be a valid URL.\n */\n url?: string;\n\n /**\n * Optional explanation text for the citation.\n */\n text?: string;\n\n /**\n * Optional title of the citation URL.\n */\n title?: string;\n\n /**\n * Optional zero index based integer indicating where in `text` the citation starts from.\n */\n range_start?: number;\n\n /**\n * Optional zero index based integer indicating where in `text`` the citation ends at. Exclusive.\n * So the word \"hi\", would have the range_start of 0 and range_end of 2.\n */\n range_end?: number;\n\n /**\n * A number corresponding to the index of the matching search result. This can be used to gather extra info about a\n * specific citation from the matching search result.\n */\n search_result_idx?: number;\n}\n\n/**\n * A text response generated by AI with an optional list of citations for where the information came from.\n */\ninterface ConversationalSearchItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The returned conversational text. Any HTML/Markdown will be ignored.\n */\n text: string;\n\n /**\n * A title to display above the citation list, default set to \"How do we know?\".\n */\n citations_title: string;\n\n /**\n * A string to explain that these results are generated, default set to \"Accuracy of generated answers may vary.\".\n */\n disclaimer: string;\n\n /**\n * Citations are used to connect specific text within a conversational search response with the relevant documents\n * returned by the backend.\n */\n citations?: ConversationalSearchItemCitation[];\n}\n\n/**\n * An inline error response generated by a conversational skill provider with a user-friendly text and developer debug info.\n */\ninterface InlineErrorItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * Some end user friendly text describing the error and what they should do next.\n * \n * If no specific text is passed, the client is responsible for fallback generic error message text.\n */\n text?: string;\n\n /**\n * Relevant debug info intended to be passed on to developers.\n * \n * This information should not include anything sensitive that might reveal details about our back-end environment that should not be public.\n */\n debug?: {\n /**\n * The error code of any underlying error, despite the service returning 200.\n */\n statusCode?: number;\n\n /**\n * Developer-friendly error text.\n */\n text?: string;\n\n /**\n * Any additional key-value pairs for debugging.\n */\n info?: Record<string, unknown>;\n };\n}\n\n/**\n * The image response type definition. This is currently the same as {@link MediaItem}.\n */\ntype ImageItem = MediaItem;\n\n/**\n * The video response type definition for future reuse. This is currently the same as {@link MediaItem}.\n */\ntype VideoItem = MediaItem;\n\n/**\n * The audio response type definition for future reuse. This is currently the same as {@link MediaItem}.\n */\ntype AudioItem = MediaItem;\n\n/**\n * This is the response item that represents a request for a date which should prompt the client to use a date picker or\n * similar control to provide a date. There are currently no additional properties of the response.\n */\ntype DateItem = GenericItem;\n\ntype TableItemCell = string | number;\n\n/**\n * A table item returned in a message response from a back-end. This response type is used when displaying a table of data to the user.\n * The content of the table is up to the client and is authored using json.\n */\ninterface TableItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * Optional title for the table.\n */\n title?: string;\n\n /**\n * Optional description of the table.\n */\n description?: string;\n\n /**\n * The array of headers for the table.\n */\n headers: TableItemCell[];\n\n /**\n * The array of row objects for the table.\n */\n rows: TableItemRow[];\n}\n\ntype TableItemRowExpandableSectionItem = TextItem | ImageItem | VideoItem | AudioItem | IFrameItem | UserDefinedItem;\n\ninterface TableItemRow {\n /**\n * Data for a specific cell.\n */\n cells: TableItemCell[];\n\n /**\n * A section that can expand beneath each row which contains an array of items exactly like the message api's output.generic array.\n */\n expandable_section?: TableItemRowExpandableSectionItem[];\n}\n\n/**\n * Additional metadata associated with a specific message item (response type) inside of a message response.\n */\ninterface ItemStreamingMetadata {\n /**\n * An identifier for this item within the full message response. This ID is used to correlate a partial or\n * complete item chunk with other chunks that represent the same item. This ID is only unique for a given message\n * response.\n */\n id: string;\n}\n\ninterface Chunk {\n /**\n * Additional metadata associated with the stream.\n */\n streaming_metadata?: {\n /**\n * The ID of the complete message response object. This ID will be the ID of the full message that is received\n * in the final chunk of the stream.\n */\n response_id: string;\n };\n}\n\n/**\n * The interface for a chunk that represents a partial update (or first time chunk) to a message item.\n */\ninterface PartialItemChunk extends Chunk {\n /**\n * The partial details of the item. The client will decide what rules to follow for merging this in with any\n * existing data for the same item (which is identified using the {@link ItemStreamingMetadata.id} property).\n */\n partial_item: DeepPartial<GenericItem>;\n}\n\n/**\n * The interface for a chunk that represents a complete update to a message item. The item provided here should have\n * all the data necessary to render the item including any data that was previously received from partial chunks.\n * This chunk may contain corrections to previous chunks.\n */\ninterface CompleteItemChunk extends Chunk {\n complete_item: GenericItem;\n}\n\n/**\n * The interface for a chunk that represents the entire completed message response. The response provided here\n * should have all the data necessary to render the response including any data that was previously received from item\n * chunks. This final response may contain corrections to previous chunks.\n *\n * The ID of the message should match the ID that was previously provided by {@link PartialItemChunk.streaming_metadata.id}.\n */\ninterface FinalResponseChunk {\n final_response: MessageResponse;\n}\n\ntype StreamChunk = PartialItemChunk | CompleteItemChunk | FinalResponseChunk;\n\n/**\n * Profile information about a specific agent that can be used to display information to the user. This may\n * represent a human agent or a virtual/bot agent.\n */\nexport interface AgentProfile {\n /**\n * A unique identifier for this agent.\n */\n id: string;\n\n /**\n * The visible name for the agent. Can be the full name or just a first name.\n */\n nickname: string;\n\n /**\n * An url pointing to an avatar for the agent.\n */\n profile_picture_url?: string;\n}\n\nexport {\n AudioItem,\n BaseMessageInput,\n Chunk,\n CompleteItemChunk,\n ConnectToAgentItem,\n ConnectToAgentItemTransferInfo,\n ConversationalSearchItem,\n ConversationalSearchItemCitation,\n DateItem,\n EventInput,\n EventInputData,\n FinalResponseChunk,\n GenericItem,\n IFrameItem,\n IFrameItemDisplayOption,\n ImageItem,\n ItemStreamingMetadata,\n MediaItem,\n MediaItemDimensions,\n MessageContext,\n MessageGlobalContext,\n MessageInput,\n MessageInputType,\n MessageOutput,\n MessageRequest,\n MessageResponse,\n MessageResponseTypes,\n MessageSkillContext,\n MessageSystemContext,\n Option,\n OptionItem,\n OptionItemPreference,\n PartialItemChunk,\n PauseItem,\n StreamChunk,\n TableItem,\n TableItemCell,\n TableItemRow,\n TableItemRowExpandableSectionItem,\n TextItem,\n UserDefinedItem,\n VideoItem,\n InlineErrorItem,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The ChatContainer is a light dom custom element. It just is a wrapper for ChatContainerLight\n * to hide props that are meant only for the React component.\n */\n\nimport '../chat/web-components/components/cds-aichat-container-light';\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport {\n AgentAppConfig,\n AudioItem,\n BaseMessageInput,\n BusEventAgentAreAnyAgentsOnline,\n BusEventAgentEndChat,\n BusEventAgentPreEndChat,\n BusEventAgentPreReceive,\n BusEventAgentPreSend,\n BusEventAgentPreSessionHistory,\n BusEventAgentPreStartChat,\n BusEventAgentReceive,\n BusEventAgentSend,\n BusEventChatReady,\n BusEventChunkUserDefinedResponse,\n BusEventClosePanelButtonClicked,\n BusEventCustomPanelClose,\n BusEventCustomPanelOpen,\n BusEventCustomPanelPreClose,\n BusEventCustomPanelPreOpen,\n BusEventGenesysMessengerAuthError,\n BusEventGenesysMessengerAuthProvider,\n BusEventGenesysMessengerGetAuthCode,\n BusEventGenesysMessengerLoggedOut,\n BusEventGenesysMessengerReauthenticate,\n BusEventHistoryBegin,\n BusEventHistoryEnd,\n BusEventMessageItemCustom,\n BusEventNiceDFOGetAuthCode,\n BusEventPreReceive,\n BusEventPreReset,\n BusEventPreSend,\n BusEventReceive,\n BusEventReset,\n BusEventSend,\n BusEventTourEnd,\n BusEventTourStart,\n BusEventTourStep,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n BusEventViewPreChange,\n CarbonTheme,\n ChatInstance,\n Chunk,\n CompleteItemChunk,\n ConnectToAgentItem,\n ConversationalSearchItem,\n ConversationalSearchItemCitation,\n CornersType,\n CustomSendMessageOptions,\n DateItem,\n DisclaimerPublicConfig,\n EventInput,\n EventInputData,\n FinalResponseChunk,\n GenericItem,\n HeaderConfig,\n HistoryItem,\n IFrameItem,\n IFrameItemDisplayOption,\n ImageItem,\n ItemStreamingMetadata,\n LayoutConfig,\n MediaItem,\n MediaItemDimensions,\n MessageContext,\n MessageGlobalContext,\n MessageHistory,\n MessageInput,\n MessageInputType,\n MessageOutput,\n MessageRequest,\n MessageResponse,\n MessageResponseTypes,\n MessageSkillContext,\n MinimizeButtonIconType,\n OnErrorData,\n Option,\n OptionItem,\n OptionItemPreference,\n PageLinkConfig,\n PageLinkIDConfig,\n PartialItemChunk,\n PauseItem,\n PublicConfig,\n PublicConfigMessaging,\n StreamChunk,\n TextItem,\n ThemeConfig,\n UpdateHistoryEvent,\n UserDefinedItem,\n VideoItem,\n ViewState,\n ViewType,\n} from '../aiChatTypes';\nimport { carbonElement } from '../chat/web-components/decorators/customElement';\n\n/**\n * cds-aichat-container class\n */\n@carbonElement('cds-aichat-container')\nclass ChatContainer extends LitElement {\n /**\n * The config to use to load web chat. Note that the \"onLoad\" property is overridden by this component. If you\n * need to perform any actions after web chat been loaded, use the \"onBeforeRender\" or \"onAfterRender\" props.\n */\n @property({ type: Object })\n config: PublicConfig;\n\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onBeforeRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onAfterRender: (instance: ChatInstance) => Promise<void> | void;\n\n protected createRenderRoot() {\n // Force us into \"light dom\".\n return this;\n }\n\n /**\n * Renders the template while passing in class functionality\n */\n render() {\n return html`<cds-aichat-container-light\n .config=${this.config}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this.onBeforeRender}\n />`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cds-aichat-container': ChatContainer;\n }\n}\n\nexport {\n AgentAppConfig,\n AudioItem,\n BaseMessageInput,\n BusEventAgentAreAnyAgentsOnline,\n BusEventAgentEndChat,\n BusEventAgentPreEndChat,\n BusEventAgentPreReceive,\n BusEventAgentPreSend,\n BusEventAgentPreSessionHistory,\n BusEventAgentPreStartChat,\n BusEventAgentReceive,\n BusEventAgentSend,\n BusEventChatReady,\n BusEventChunkUserDefinedResponse,\n BusEventClosePanelButtonClicked,\n BusEventCustomPanelClose,\n BusEventCustomPanelOpen,\n BusEventCustomPanelPreClose,\n BusEventCustomPanelPreOpen,\n BusEventGenesysMessengerAuthError,\n BusEventGenesysMessengerAuthProvider,\n BusEventGenesysMessengerGetAuthCode,\n BusEventGenesysMessengerLoggedOut,\n BusEventGenesysMessengerReauthenticate,\n BusEventHistoryBegin,\n BusEventHistoryEnd,\n BusEventMessageItemCustom,\n BusEventNiceDFOGetAuthCode,\n BusEventPreReceive,\n BusEventPreReset,\n BusEventPreSend,\n BusEventReceive,\n BusEventReset,\n BusEventSend,\n BusEventTourEnd,\n BusEventTourStart,\n BusEventTourStep,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n BusEventViewPreChange,\n CarbonTheme,\n ChatInstance,\n Chunk,\n CompleteItemChunk,\n ConnectToAgentItem,\n ConversationalSearchItem,\n ConversationalSearchItemCitation,\n CornersType,\n CustomSendMessageOptions,\n DateItem,\n DisclaimerPublicConfig,\n EventInput,\n EventInputData,\n FinalResponseChunk,\n GenericItem,\n HeaderConfig,\n HistoryItem,\n IFrameItem,\n IFrameItemDisplayOption,\n ImageItem,\n ItemStreamingMetadata,\n LayoutConfig,\n MediaItem,\n MediaItemDimensions,\n MessageContext,\n MessageGlobalContext,\n MessageHistory,\n MessageInput,\n MessageInputType,\n MessageOutput,\n MessageRequest,\n MessageResponse,\n MessageResponseTypes,\n MessageSkillContext,\n MinimizeButtonIconType,\n OnErrorData,\n Option,\n OptionItem,\n OptionItemPreference,\n PageLinkConfig,\n PageLinkIDConfig,\n PartialItemChunk,\n PauseItem,\n PublicConfig,\n PublicConfigMessaging,\n StreamChunk,\n TextItem,\n ThemeConfig,\n UpdateHistoryEvent,\n UserDefinedItem,\n VideoItem,\n ViewState,\n ViewType,\n ChatContainer,\n};\n\nexport default ChatContainer;\n"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","FileStatusValue","ViewType","LauncherType","MinimizeButtonIconType","ClosePanelIconDirection","CarbonTheme","CornersType","OnErrorType","CatastrophicErrorType","ChatWidthBreakpoint","AlternateSuggestionsPanelState","AlternateSuggestionsSection","WriteableElementName","InputFieldType","SuppressedError","HEADER_ACCEPT","HEADER_CONTENT_TYPE","HEADER_AUTHORIZATION","MIME_JSON","MIME_STREAM","MIME_JSON_STREAM","WA_CONSOLE_PREFIX","API_DEBUGGING_HEADER_NAME","AGENT_APP_HEADER_NAME","RIGHT_TO_LEFT_MARK","String","fromCharCode","ENGLISH_US_DATE_FORMAT","RESPONSE_TYPE_TIMEOUT_MS","DEFAULT_CUSTOM_PANEL_ID","INTEGRATIONS_VERSION","WINDOW_WARNING","CUSTOM_RESPONSE_WARNING","AWS_REGION_FRAGMENT","WXO_CLOUD_REGION_FRAGMENT","THROW_ERROR","Error","BrandColorKind","CAROUSEL_MAX_WIDTH","FULL_WIDTH_CITATION_MAX_WIDTH","AUTO_SCROLL_EXTRA","LIGHT_THEMES","isJest","process","env","JEST_WORKER_ID","error","IS_JEST","AUTO_SCROLL_THROTTLE_TIMEOUT","async","sleep","milliseconds","Promise","resolve","setTimeout","resolveOrTimeout","promise","duration","errorMessage","timeout","reject","race","enableDebugLog","enableDebugStackTracesLog","assertType","item","debugLog","message","args","console","log","debugStackTrace","consoleError","consoleLog","consoleDebug","debug","consoleWarn","warn","setEnableDebugLog","setEnableDebugStackTracesLog","isEnableDebugLog","safeFetchText","response","text","safeFetchTextWithTimeout","safeFetchJSON","json","createDidCatchErrorData","component","errorInfo","isCatastrophicError","errorType","RENDER","otherData","catastrophicErrorType","FAILED","getResponsiveElementPaddingValue","baseHeight","isValidForUpload","upload","status","EDIT","isError","callOnError","onError","data","getBotName","useAITheme","config","botName","public","__ibm__","botNameOverride","remote","initConfig","asCarbonChat","StatusCodes","WXOMentionType","ToolingType","ConnectToAgentBehaviorType","LauncherToolingPreviewType","eq","value","other","assocIndexOf","array","splice","Array","prototype","ListCache","entries","index","this","clear","entry","set","__data__","size","pop","call","get","undefined","has","push","freeGlobal","global","freeSelf","self","root","Function","Symbol","objectProto","hasOwnProperty","nativeObjectToString","toString","symToStringTag","toStringTag","nullTag","undefinedTag","baseGetTag","isOwn","tag","unmasked","e","result","getRawTag","objectToString","isObject","type","asyncTag","funcTag","genTag","proxyTag","isFunction","uid","coreJsData","maskSrcKey","exec","keys","IE_PROTO","funcToString","toSource","func","reIsHostCtor","funcProto","reIsNative","RegExp","replace","baseIsNative","test","getNative","object","getValue","Map","nativeCreate","Hash","getMapData","map","MapCache","hash","string","Stack","pairs","LARGE_ARRAY_SIZE","baseAssignValue","configurable","enumerable","writable","assignMergeValue","baseFor","iteratee","keysFunc","iterable","props","freeExports","exports","nodeType","freeModule","module","Buffer","allocUnsafe","cloneBuffer","buffer","isDeep","slice","constructor","copy","Uint8Array","cloneArrayBuffer","arrayBuffer","byteLength","cloneTypedArray","typedArray","byteOffset","copyArray","source","objectCreate","create","baseCreate","proto","overArg","transform","arg","getPrototype","getPrototypeOf","isPrototype","Ctor","initCloneObject","isObjectLike","baseIsArguments","propertyIsEnumerable","isArguments","isArray","MAX_SAFE_INTEGER","isLength","isArrayLike","isBuffer","objectTag","objectCtorString","typedArrayTags","baseUnary","freeProcess","nodeUtil","types","require","binding","nodeIsTypedArray","isTypedArray","safeGet","assignValue","objValue","copyObject","customizer","isNew","newValue","reIsUint","isIndex","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","n","baseTimes","baseKeysIn","nativeKeysIn","isProto","keysIn","baseMergeDeep","srcIndex","mergeFunc","stack","srcValue","stacked","isCommon","isTyped","isPlainObject","toPlainObject","baseMerge","identity","nativeMax","Math","max","baseSetToString","nativeNow","Date","now","count","lastCalled","setToString","stamp","remaining","apply","baseRest","start","otherArgs","thisArg","overRest","createAssigner","assigner","sources","guard","isIterateeCall","merge","VERSION","WWX_CDN_ENDPOINT","AMPLITUDE_API_KEY","NODE_ENV","DEFAULT_ALLOWED_RESPONSES","Set","doWithRetry","retryFunction","delayTimes","operationTitle","attemptNumber","delayTime","doWithRetryWithTimeout","timeoutMs","throwOnStatus","responsePromise","allowedCodes","ensureChatBrowserWindowConfigExists","window","watsonAssistantChatSharedConfig","namespaces","loadScriptPromises","getSharedConfig","NamespaceService","namespace","originalName","attributeSafe","getAttributeSafe","suffix","computedName","computeNamespaceName","getSuffix","remove","computedNamespace","namespaceIndexToRemove","indexOf","removeNamespace","charCodeAt","djb2Hash","trim","validateNamespace","andAdd","includes","addNamespace","CarbonThemeClassNames","ButtonKindEnum","ButtonSizeEnum","ButtonTooltipAlignmentEnum","NotificationType","BOUNCING_ANIMATION_TIMEOUTS","SetCache","values","add","arraySome","predicate","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","bitmask","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","mapToArray","forEach","setToArray","boolTag","dateTag","errorTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","symbolProto","symbolValueOf","valueOf","arrayPush","offset","baseGetAllKeys","symbolsFunc","stubArray","nativeGetSymbols","getOwnPropertySymbols","getSymbols","resIndex","arrayFilter","symbol","nativeKeys","baseKeys","getAllKeys","DataView","WeakMap","promiseTag","weakMapTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ArrayBuffer","ctorString","argsTag","arrayTag","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","name","convert","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","objLength","objStacked","skipCtor","objCtor","othCtor","equalObjects","baseIsEqual","isEqual","mergeWith","replaceCurrentArrayValue","currentValue","isEmptyObject","property","mergeNoArrays","objects","deepFreeze","freeze","getOwnPropertyNames","prop","isFrozen","getVersionLoaded","publicConfig","useExactVersion","clientVersion","DEFAULT_LAUNCHER","mobile","title","time_to_expand","new_expand_time","time_to_reduce","notification_type","TEXT_NOTIFICATION","desktop","DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS","hideBackButton","hidePanelHeader","disableAnimation","DEFAULT_CUSTOM_PANEL_STATE","isOpen","panelID","options","DEFAULT_IFRAME_PANEL_STATE","messageItem","DEFAULT_CITATION_PANEL_STATE","citationItem","relatedSearchResult","DEFAULT_BRANDING_STATE","is_on","showBanner","DEFAULT_TOUR_STATE","activeTourStepItems","DEFAULT_MESSAGE_PANEL_STATE","localMessageItem","isMessageForInput","DEFAULT_ALTERNATE_SUGGESTIONS_STATE","showButton","allowCollapse","panelState","CLOSED","contactItem","starters","suggestionListItems","showSearchSection","searchResults","searchResultsLoading","searchResultsText","VIEW_STATE_ALL_CLOSED","launcher","mainWindow","tour","VIEW_STATE_LAUNCHER_OPEN","VIEW_STATE_MAIN_WINDOW_OPEN","DEFAULT_PERSISTED_TO_BROWSER","chatState","version","sessionID","sessionStartedTimestamp","updateHistoryUserDefinedCount","disclaimersAccepted","homeScreenState","isHomeScreenOpen","showBackToBot","hasSentNonWelcomeMessage","suggestionsPersistedState","numStrikes","selectedIndex","selectedSection","persistedTourState","activeTourID","activeTourCurrentStepIndex","agentState","isConnected","isSuspended","agentProfiles","launcherState","wasLoadedFromBrowser","viewState","activeTour","showUnreadIndicator","mobileLauncherIsExtended","mobileLauncherWasReduced","mobileLauncherDisableBounce","desktopLauncherIsExpanded","desktopLauncherWasMinimized","bounceTurn","DEFAULT_CHAT_MESSAGES_STATE","localMessageIDs","messageIDs","isTypingCounter","isLoadingCounter","isScrollAnchored","DEFAULT_MESSAGE_STATE","allMessageItemsByID","allMessagesByID","botMessageState","DEFAULT_INPUT_STATE","fieldVisible","isReadonly","files","allowFileUploads","allowMultipleFileUploads","allowedFileUploadTypes","DEFAULT_AGENT_STATE","isConnecting","isReconnecting","numUnreadMessages","fileUploadInProgress","showScreenShareRequest","isScreenSharing","isAgentTyping","inputState","DEFAULT_THEME_STATE","carbonTheme","G10","corners","ROUND","carbon_theme","use_ai_theme","DEFAULT_STREAMING_STATE","enabled","DEFAULT_LAYOUT_STATE","showFrame","hasContentMaxWidth","calcAnnouncementForBrandingPanel","previousState","newIsPanelOpen","brandingState","announceMessage","messageID","applyBotMessageState","state","newState","handleViewStateChange","persistedToBrowserStorage","isBrowserPageVisible","newViewState","addEventMessage","pendingLogs","eventMessages","setHomeScreenOpenState","keepIfEqual","oldObject","newObject","HomeScreenBackgroundType","mergeHomeScreenConfig","publicHomeScreenConfig","remoteHomeScreenConfig","convertHomeScreenConfigToBackgroundIfBackgroundGradient","newHomeScreenConfig","background","isEmpty","background_gradient","gradient_direction","BOTTOM_UP","TOP_CORNER_OUT","NONE","withoutEmptyStarters","newConfig","buttons","filter","button","Boolean","label","InvalidTokenError","base64UrlDecode","str","output","decodeURIComponent","atob","m","p","code","toUpperCase","b64DecodeUnicode","err","JWT_MALFORMED_TEXT","JWT_BAD_FORMAT","JWT_EXPIRED_TEXT","IDENTITY_EXPIRED_TIMEOUT","isJWTError","statusCode","isSecurityEnabled","resultText","FORBIDDEN","BAD_REQUEST","UNAUTHORIZED","assertJWTValid","jwt","sub","exp","info","consoleInfo","getNewIdentityToken","serviceManager","identityExpiredMessage","identityToken","eventBus","fire","instance","actions","errorOccurred","IDENTITY_TOKEN","updateIdentityToken","getNewIdentityTokenIfExpiring","decodedToken","doDecodeJWT","store","getState","getTime","jwtString","token","pos","header","part","split","decoded","JSON","parse","jwtDecode","getRandomValues","rnds8","rng","crypto","bind","byteToHex","UUIDType","native","randomUUID","v4","buf","rnds","random","arr","unsafeStringify","uuid","originalUUID","REGION_MAP","dev","staging","getRegionHostname","region","DEFAULT_PUBLIC_CONFIG","openChatByDefault","showLauncher","shouldTakeFocusIfOpensAutomatically","agentAppConfig","servers","serviceDesk","messaging","copyPreviousContextOnRequest","isTrackingEnabled","logTrackObjects","connectToAgentBehavior","ERROR_MISSING","enableFeatures","wxo","DEFAULT_REMOTE_INIT_CONFIG","home_screen","alternate_suggestions","branding_config","launcher_config","AGENT_APP_DEFAULT_PUBLIC_CONFIG","headerConfig","hideMinimizeButton","disableCustomElementMobileEnhancements","disclaimer","isOn","AGENT_APP_DEFAULT_REMOTE_INIT_CONFIG","authorization","AGENT_APP_SLUG","CHAT_SLUG","getBaseURL","regionHostname","assistantURLPrefix","subscriptionID","getCPDBaseChatURL","agentAppOverride","cpdURL","cloudPrivateHostURL","integrationSlug","integrationID","getCDNURL","webChatScriptPrefix","getWXOUrl","versionLoaded","getConfigURL","customURL","customInitConfigURL","customConfigURL","cpdBaseURL","baseURL","configTypeParam","getMessageURL","customMessageURL","getSessionURL","getAnalyticsPath","getHistoryURL","customHistoryPrefix","doConfigFetch","configUrl","fetch","fetchParameters","ok","TOO_MANY_REQUESTS","responseText","getRemoteMainConfig","allowJWTRetry","toolingType","url","transactionID","MISCELLANEOUS","headers","OPEN_CONFIG","errorCode","resultJSON","service_desk","assistant","mainConfig","importChat","default","Chat","import","loadRender","render","loadHAA","createService","createMockServiceDesk","parameters","MockServiceDesk","loadStylesWithReset","styles","loadStyles","loadFontFace","getFontFace","useOnMount","callback","useEffect","getSymbolsIn","getAllKeysIn","reFlags","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","initCloneByTag","regexp","dataView","cloneDataView","lastIndex","nodeIsMap","isMap","nodeIsSet","isSet","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","cloneableTags","baseClone","isFlat","isFull","input","initCloneArray","isFunc","copySymbolsIn","baseAssignIn","copySymbols","baseAssign","subValue","arrayEach","cloneDeep","CARBON_DEFAULT_PUBLIC_CONFIG","themeConfig","skipConfig","useShadowRoot","instantiateWidget","pagePublicConfig","chatConstructorPromise","renderOverride","localInstall","loadStartTime","document","location","protocol","carbonConfig","customLoadHistory","skipHistory","customSendMessage","validateConfig","element","onLoad","overrideRemoteInitConfig","remoteInitConfig","all","loadVersion","destroyWebChat","managedWebChat","setInstance","destroy","shouldDestroy","loadChat","managedWebChatRef","onBeforeRender","onAfterRender","setUserDefinedResponseEvents","current","widget","then","readyState","addEventListener","startWidget","webChatInstance","on","handler","event","eventsArray","concat","addUserDefinedResponseHandler","UserDefinedResponseComponentPortal","hostElement","children","ReactDOM","createPortal","UserDefinedResponsePortalsContainerExport","React","memo","chatInstance","renderResponse","userDefinedResponseEvents","createElement","Fragment","App","lazy","h","AppContainer","renderUserDefinedResponse","container","useState","renderProps","setRenderProps","applicationStyles","setApplicationStyles","useRef","previousConfigRef","onMount","previousConfig","customHostElement","setAttribute","Suspense","fallback","UserDefinedResponsePortalsContainer","carbonElement","tagName","classOrDescriptor","clazz","customElements","define","legacyCustomElement","descriptor","kind","elements","finisher","standardCustomElement","ChatContainerInternal","LitElement","createRenderRoot","attachShadow","mode","firstUpdated","style","textContent","appendChild","_renderReactApp","updated","changedProperties","previousContainer","shadowRoot","querySelector","classList","forceReact17Mode","_root","unmount","createRoot","ChatContainerLight","_userDefinedSlots","_writeableElementSlots","_userDefinedHandler","_onBeforeRenderOverride","_instance","_addWriteableElementSlots","writeableElementSlots","customPanels","getPanel","writeableElements","writeableElementKey","html","MessageInputType","MessageResponseTypes","OptionItemPreference","IFrameItemDisplayOption","ChatContainer","ChatContainer$1"],"mappings":"mNAsDO,SAASA,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,EACrH,GAAuB,iBAAZQ,SAAoD,mBAArBA,QAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAIU,EAAIb,EAAWO,OAAS,EAAGM,GAAK,EAAGA,KAAST,EAAIJ,EAAWa,MAAIL,GAAKH,EAAI,EAAID,EAAEI,GAAKH,EAAI,EAAID,EAAEH,EAAQC,EAAKM,GAAKJ,EAAEH,EAAQC,KAASM,GAChJ,OAAOH,EAAI,GAAKG,GAAKC,OAAOK,eAAeb,EAAQC,EAAKM,GAAIA,CAChE,KCvCYO,EAqHAC,EAsBAC,EC6BAC,EAoGAC,EA+DAC,EAUAC,EAQAC,EA4DAC,EC8OPC,EAYAC,EAgHAC,ECvWOC,EA6DAC,EJ9KsC,mBAApBC,iBAAiCA,gBC3S/D,SAAYd,GACVA,EAAA,SAAA,WACAA,EAAA,KAAA,OACAA,EAAA,UAAA,YACAA,EAAA,QAAA,SACD,CALD,CAAYA,IAAAA,EAKX,CAAA,IAgHD,SAAYC,GAIVA,EAAA,SAAA,WAOAA,EAAA,YAAA,aAKAA,EAAA,KAAA,MACD,CAjBD,CAAYA,IAAAA,EAiBX,CAAA,IAKD,SAAYC,GAIVA,EAAA,QAAA,UAKAA,EAAA,OAAA,QACD,CAVD,CAAYA,IAAAA,EAUX,CAAA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KAAA,OAKAA,EAAA,MAAA,OACD,CAVD,CAAKA,KAAAA,GAUJ,CAAA,IA8HD,SAAKC,GAIHA,EAAA,KAAA,OAMAA,EAAA,OAAA,SAKAA,EAAA,iBAAA,mBAKAA,EAAA,MAAA,QAMAA,EAAA,MAAA,QAKAA,EAAA,aAAA,eAKAA,EAAA,OAAA,SAKAA,EAAA,MAAA,QAKAA,EAAA,MAAA,QAKAA,EAAA,KAAA,OAKAA,EAAA,MAAA,QAKAA,EAAA,aAAA,cACD,CA9DD,CAAKA,KAAAA,GA8DJ,CAAA,IAuJD,SAAKC,GAIHA,EAAA,SAAA,WAKAA,EAAA,OAAA,QACD,CAVD,CAAKA,KAAAA,GAUJ,CAAA,IAiED,SAAKC,GAIHA,EAAA,OAAA,SAKAA,EAAA,MAAA,OACD,CAVD,CAAKA,KAAAA,GAUJ,CAAA,IC7VD,IAAMC,GAAN,cAA4BpC,EAsBhB,gBAAAC,GAER,OAAO9yB,IACR,CAKD,MAAA4pB,GACE,OAAOgL,CAAI;gBACC50B,KAAKxB;uBACEwB,KAAKgvB;wBACJhvB,KAAK+uB;OAE1B,GA9BDn4B,EAAA,CADCqe,EAAS,CAAE7S,KAAM9K,UACG29B,GAAAr1B,UAAA,cAAA,GAOrBhJ,EAAA,CADCqe,KACgEggB,GAAAr1B,UAAA,sBAAA,GAOjEhJ,EAAA,CADCqe,KAC+DggB,GAAAr1B,UAAA,qBAAA,GApB5Dq1B,GAAar+B,EAAA,CADlBo7B,GAAc,yBACTiD,IA+IN,IAAAC,GAAeD","x_google_ignoreList":[0,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,146,148,150,151,152,154,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/tslib/tslib.es6.js","../../../../../../../../../../internal-packages/types/apiTypes.ts","../../../../../../../../../../internal-packages/types/PublicConfig.ts","../../../../../../../../../../internal-packages/shared/types/AppState.ts","../../../../../../../../../../internal-packages/types/ChatInstance.ts","../../../../../../../../../../internal-packages/shared/utils/constants.ts","../../../../../../../../../../internal-packages/shared/utils/lang/promiseUtils.ts","../../../../../../../../../../internal-packages/shared/utils/miscUtils.ts","../../../../../node_modules/http-status-codes/build/es/status-codes.js","../../../../../../../../../../internal-packages/orchestrate/types/orchestratePublicConfig.ts","../../../../../../../../../../internal-packages/shared/types/IBMConfig.ts","../../../../../node_modules/lodash-es/eq.js","../../../../../node_modules/lodash-es/_assocIndexOf.js","../../../../../node_modules/lodash-es/_listCacheDelete.js","../../../../../node_modules/lodash-es/_ListCache.js","../../../../../node_modules/lodash-es/_listCacheClear.js","../../../../../node_modules/lodash-es/_listCacheGet.js","../../../../../node_modules/lodash-es/_listCacheHas.js","../../../../../node_modules/lodash-es/_listCacheSet.js","../../../../../node_modules/lodash-es/_freeGlobal.js","../../../../../node_modules/lodash-es/_root.js","../../../../../node_modules/lodash-es/_Symbol.js","../../../../../node_modules/lodash-es/_getRawTag.js","../../../../../node_modules/lodash-es/_objectToString.js","../../../../../node_modules/lodash-es/_baseGetTag.js","../../../../../node_modules/lodash-es/isObject.js","../../../../../node_modules/lodash-es/isFunction.js","../../../../../node_modules/lodash-es/_coreJsData.js","../../../../../node_modules/lodash-es/_isMasked.js","../../../../../node_modules/lodash-es/_toSource.js","../../../../../node_modules/lodash-es/_baseIsNative.js","../../../../../node_modules/lodash-es/_getNative.js","../../../../../node_modules/lodash-es/_getValue.js","../../../../../node_modules/lodash-es/_Map.js","../../../../../node_modules/lodash-es/_nativeCreate.js","../../../../../node_modules/lodash-es/_hashGet.js","../../../../../node_modules/lodash-es/_hashHas.js","../../../../../node_modules/lodash-es/_Hash.js","../../../../../node_modules/lodash-es/_getMapData.js","../../../../../node_modules/lodash-es/_isKeyable.js","../../../../../node_modules/lodash-es/_MapCache.js","../../../../../node_modules/lodash-es/_hashClear.js","../../../../../node_modules/lodash-es/_hashDelete.js","../../../../../node_modules/lodash-es/_hashSet.js","../../../../../node_modules/lodash-es/_mapCacheClear.js","../../../../../node_modules/lodash-es/_mapCacheDelete.js","../../../../../node_modules/lodash-es/_mapCacheGet.js","../../../../../node_modules/lodash-es/_mapCacheHas.js","../../../../../node_modules/lodash-es/_mapCacheSet.js","../../../../../node_modules/lodash-es/_Stack.js","../../../../../node_modules/lodash-es/_stackClear.js","../../../../../node_modules/lodash-es/_stackDelete.js","../../../../../node_modules/lodash-es/_stackGet.js","../../../../../node_modules/lodash-es/_stackHas.js","../../../../../node_modules/lodash-es/_stackSet.js","../../../../../node_modules/lodash-es/_defineProperty.js","../../../../../node_modules/lodash-es/_baseAssignValue.js","../../../../../node_modules/lodash-es/_assignMergeValue.js","../../../../../node_modules/lodash-es/_baseFor.js","../../../../../node_modules/lodash-es/_createBaseFor.js","../../../../../node_modules/lodash-es/_cloneBuffer.js","../../../../../node_modules/lodash-es/_Uint8Array.js","../../../../../node_modules/lodash-es/_cloneArrayBuffer.js","../../../../../node_modules/lodash-es/_cloneTypedArray.js","../../../../../node_modules/lodash-es/_copyArray.js","../../../../../node_modules/lodash-es/_baseCreate.js","../../../../../node_modules/lodash-es/_overArg.js","../../../../../node_modules/lodash-es/_getPrototype.js","../../../../../node_modules/lodash-es/_isPrototype.js","../../../../../node_modules/lodash-es/_initCloneObject.js","../../../../../node_modules/lodash-es/isObjectLike.js","../../../../../node_modules/lodash-es/_baseIsArguments.js","../../../../../node_modules/lodash-es/isArguments.js","../../../../../node_modules/lodash-es/isArray.js","../../../../../node_modules/lodash-es/isLength.js","../../../../../node_modules/lodash-es/isArrayLike.js","../../../../../node_modules/lodash-es/isBuffer.js","../../../../../node_modules/lodash-es/stubFalse.js","../../../../../node_modules/lodash-es/isPlainObject.js","../../../../../node_modules/lodash-es/_baseIsTypedArray.js","../../../../../node_modules/lodash-es/_baseUnary.js","../../../../../node_modules/lodash-es/_nodeUtil.js","../../../../../node_modules/lodash-es/isTypedArray.js","../../../../../node_modules/lodash-es/_safeGet.js","../../../../../node_modules/lodash-es/_assignValue.js","../../../../../node_modules/lodash-es/_copyObject.js","../../../../../node_modules/lodash-es/_isIndex.js","../../../../../node_modules/lodash-es/_arrayLikeKeys.js","../../../../../node_modules/lodash-es/_baseTimes.js","../../../../../node_modules/lodash-es/_baseKeysIn.js","../../../../../node_modules/lodash-es/_nativeKeysIn.js","../../../../../node_modules/lodash-es/keysIn.js","../../../../../node_modules/lodash-es/_baseMergeDeep.js","../../../../../node_modules/lodash-es/isArrayLikeObject.js","../../../../../node_modules/lodash-es/toPlainObject.js","../../../../../node_modules/lodash-es/_baseMerge.js","../../../../../node_modules/lodash-es/identity.js","../../../../../node_modules/lodash-es/_overRest.js","../../../../../node_modules/lodash-es/_baseSetToString.js","../../../../../node_modules/lodash-es/constant.js","../../../../../node_modules/lodash-es/_shortOut.js","../../../../../node_modules/lodash-es/_setToString.js","../../../../../node_modules/lodash-es/_baseRest.js","../../../../../node_modules/lodash-es/_apply.js","../../../../../node_modules/lodash-es/_createAssigner.js","../../../../../node_modules/lodash-es/_isIterateeCall.js","../../../../../node_modules/lodash-es/merge.js","../../../../../internal-packages/shared/environmentVariables.js","../../../../../../../../../../internal-packages/shared/services/doWithRetry.ts","../../../../../../../../../../internal-packages/shared/utils/sharedConfigUtils.ts","../../../../../../../../../../internal-packages/shared/services/NamespaceService.ts","../../../../../../../../../../internal-packages/shared/types/carbonTypes.ts","../../../../../../../../../../internal-packages/shared/types/LauncherConfig.ts","../../../../../node_modules/lodash-es/_SetCache.js","../../../../../node_modules/lodash-es/_arraySome.js","../../../../../node_modules/lodash-es/_setCacheAdd.js","../../../../../node_modules/lodash-es/_setCacheHas.js","../../../../../node_modules/lodash-es/_equalArrays.js","../../../../../node_modules/lodash-es/_cacheHas.js","../../../../../node_modules/lodash-es/_mapToArray.js","../../../../../node_modules/lodash-es/_setToArray.js","../../../../../node_modules/lodash-es/_equalByTag.js","../../../../../node_modules/lodash-es/_arrayPush.js","../../../../../node_modules/lodash-es/_baseGetAllKeys.js","../../../../../node_modules/lodash-es/stubArray.js","../../../../../node_modules/lodash-es/_getSymbols.js","../../../../../node_modules/lodash-es/_arrayFilter.js","../../../../../node_modules/lodash-es/_nativeKeys.js","../../../../../node_modules/lodash-es/_baseKeys.js","../../../../../node_modules/lodash-es/keys.js","../../../../../node_modules/lodash-es/_getAllKeys.js","../../../../../node_modules/lodash-es/_equalObjects.js","../../../../../node_modules/lodash-es/_DataView.js","../../../../../node_modules/lodash-es/_Promise.js","../../../../../node_modules/lodash-es/_Set.js","../../../../../node_modules/lodash-es/_WeakMap.js","../../../../../node_modules/lodash-es/_getTag.js","../../../../../node_modules/lodash-es/_baseIsEqualDeep.js","../../../../../node_modules/lodash-es/_baseIsEqual.js","../../../../../node_modules/lodash-es/isEqual.js","../../../../../node_modules/lodash-es/mergeWith.js","../../../../../../../../../../internal-packages/shared/utils/customizers.ts","../../../../../../../../../../internal-packages/shared/utils/lang/objectUtils.ts","../../../../../../../../../../internal-packages/shared/utils/versionUtils.ts","../../../../../../../../../../internal-packages/shared/store/reducerUtils.ts","../../../../../../../../../../internal-packages/types/HomeScreenConfig.ts","../../../../../node_modules/lodash-es/isEmpty.js","../../../../../../../../../../internal-packages/shared/utils/homeScreenUtils.ts","../../../../../node_modules/jwt-decode/build/esm/index.js","../../../../../../../../../../internal-packages/shared/utils/identityUtils.ts","../../../../../node_modules/uuid/dist/esm-browser/rng.js","../../../../../node_modules/uuid/dist/esm-browser/stringify.js","../../../../../node_modules/uuid/dist/esm-browser/native.js","../../../../../../../../../../internal-packages/shared/utils/lang/UUIDType.ts","../../../../../node_modules/uuid/dist/esm-browser/v4.js","../../../../../../../../../../internal-packages/shared/utils/lang/uuid.ts","../../../../../../../../../../internal-packages/assistant/regions.ts","../../../../../../../../../../internal-packages/shared/utils/config.ts","../../../../../../../../../../internal-packages/shared/chatEntryImports.ts","../../../../../../../../../../internal-packages/shared/hooks/useOnMount.tsx","../../../../../node_modules/lodash-es/_getSymbolsIn.js","../../../../../node_modules/lodash-es/_getAllKeysIn.js","../../../../../node_modules/lodash-es/_initCloneArray.js","../../../../../node_modules/lodash-es/_cloneRegExp.js","../../../../../node_modules/lodash-es/_cloneSymbol.js","../../../../../node_modules/lodash-es/_initCloneByTag.js","../../../../../node_modules/lodash-es/_cloneDataView.js","../../../../../node_modules/lodash-es/isMap.js","../../../../../node_modules/lodash-es/_baseIsMap.js","../../../../../node_modules/lodash-es/isSet.js","../../../../../node_modules/lodash-es/_baseIsSet.js","../../../../../node_modules/lodash-es/_baseClone.js","../../../../../node_modules/lodash-es/_copySymbolsIn.js","../../../../../node_modules/lodash-es/_baseAssignIn.js","../../../../../node_modules/lodash-es/_copySymbols.js","../../../../../node_modules/lodash-es/_baseAssign.js","../../../../../node_modules/lodash-es/_arrayEach.js","../../../../../node_modules/lodash-es/cloneDeep.js","../../../../../../../../../../internal-packages/shared/chatEntryFunctions.ts","../../../../../../../../src/chat/utils/utils.ts","../../../../../../../../src/chat/react/components/UserDefinedResponsePortalsContainer.tsx","../../../../../../../../src/chat/react/components/AppContainer.tsx","../../../../../../../../src/chat/web-components/decorators/customElement.ts","../../../../../../../../src/chat/web-components/components/cds-aichat-internal.tsx","../../../../../../../../src/chat/web-components/components/cds-aichat-container-light.ts","../../../../../../../../../../submodules/wa-fd-types-public/wa-types-chat.ts","../../../../../../../../src/web-components/cds-aichat-container.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n};\r\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { TagType } from './carbonTypes';\n\n/**\n * Constants for the Carbon FileStatus type because they weren't kind enough to include their own enum.\n */\nexport enum FileStatusValue {\n COMPLETE = 'complete',\n EDIT = 'edit',\n UPLOADING = 'uploading',\n SUCCESS = 'success',\n}\n\n/**\n * An interface that represents a file to upload and it's current upload status.\n */\nexport interface FileUpload {\n /**\n * A unique ID for the file.\n */\n id: string;\n\n /**\n * The file to upload.\n */\n file: File;\n\n /**\n * The current upload status.\n */\n status: FileStatusValue;\n\n /**\n * Indicates if the file contains an error or failed to upload.\n */\n isError?: boolean;\n\n /**\n * If the file failed to upload, this is an optional error message to display.\n */\n errorMessage?: string;\n}\n\n/**\n * Whether a particular web chat view is visible or not.\n */\nexport interface ViewState {\n /**\n * Whether the launcher is visible or not.\n */\n launcher: boolean;\n\n /**\n * Whether the main window is visible or not.\n */\n mainWindow: boolean;\n\n /**\n * Whether a tour is visible or not.\n */\n tour: boolean;\n}\n\n/**\n * A record of a notification to be shown in the UI.\n */\nexport interface NotificationMessage {\n kind: 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';\n\n /**\n * The title to show in the message.\n */\n title: string;\n\n /**\n * The message to show.\n */\n message: string;\n\n /**\n * An optional action button that a user can click. If there is an action button, we will not auto dismiss.\n */\n actionButtonLabel?: string;\n\n /**\n * The group id that associates notifications together. This can be used to remove the notification later.\n */\n groupID?: string;\n\n /**\n * The callback called when someone clicks on the action button.\n */\n onActionButtonClick?: () => void;\n\n /**\n * The callback called when someone clicks on the close button.\n */\n onCloseButtonClick?: () => void;\n}\n\nexport interface NotificationStateObject {\n /**\n * The id of the notification object in state to help identify notifications to manipulate.\n */\n id: string;\n\n /**\n * The provided notification message to render in chat.\n */\n notification: NotificationMessage;\n}\n\n/**\n * A language pack represent the set of display strings for a particular language.\n */\nexport interface LanguagePack {\n // TODO: Do we publish the actual keys?\n [key: string]: string;\n}\n\n/**\n * The different views that can be shown by web chat.\n */\nexport enum ViewType {\n /**\n * The launcher view is used to open the main window or tour.\n */\n LAUNCHER = 'launcher',\n\n /**\n * The main window view is used to ask WA questions and converse with an agent, as well as many other things. The\n * string value is kept camel case to align with the viewState mainWindow property, both of which are used by the\n * {@link ChatActions.changeView} function.\n */\n MAIN_WINDOW = 'mainWindow',\n\n /**\n * The tour view is used to guide the end user through a task.\n */\n TOUR = 'tour',\n}\n\n/**\n * The different variations of the launcher that can exist.\n */\nexport enum LauncherType {\n /**\n * The launcher that expands to a \"complex\" variation on desktop.\n */\n DESKTOP = 'desktop',\n\n /**\n * The launcher that expands to an \"extended\" variation on mobile.\n */\n MOBILE = 'mobile',\n}\n\n/**\n * This manager handles fetching an instance for manipulating the custom panel.\n */\nexport interface CustomPanels {\n /**\n * Gets a custom panel instance.\n */\n getPanel: () => CustomPanelInstance;\n}\n\n/**\n * The custom panel instance for controlling and manipulating a custom panel in web chat.\n */\nexport interface CustomPanelInstance {\n /**\n * The custom panel hostElement.\n */\n hostElement: HTMLDivElement;\n\n /**\n * Opens the custom panel.\n *\n * @param options Custom panel options.\n */\n open: (options?: CustomPanelConfigOptions) => void;\n\n /**\n * Closes the custom panel.\n */\n close: () => void;\n}\n\n/**\n * Describes general config options for a web chat panel. These options are also part of the\n * {@link BasePanelComponentProps}, except the options here are also shared with {@link CustomPanelConfigOptions}.\n *\n * Any options specific to either the BasePanelComponent or CustomPanelConfigOptions should be added to the respective\n * interface.\n */\nexport interface BasePanelConfigOptions {\n /**\n * The panel title which is left blank by default.\n */\n title?: string;\n\n /**\n * Indicates if the close button in the custom panel should be hidden.\n */\n hideCloseButton?: boolean;\n\n /**\n * Indicates if the close-and-restart (X) button in the custom panel should be hidden. This value only applies if\n * the close-and-restart button is enabled.\n */\n hideCloseAndRestartButton?: boolean;\n\n /**\n * Indicates if the panel header should be hidden.\n */\n hidePanelHeader?: boolean;\n\n /**\n * Indicates if the back button in the custom panel should be hidden.\n */\n hideBackButton?: boolean;\n\n /**\n * This callback is called when the close button is clicked. This is called even if {@link disableDefaultCloseAction}\n * is set to true.\n */\n onClickClose?: () => void;\n\n /**\n * This callback is called when the close-and-restart button is clicked. This is called even if {@link disableDefaultCloseAction}\n * is set to true.\n */\n onClickCloseAndRestart?: () => void;\n\n /**\n * Called when the restart button is clicked.\n */\n onClickRestart?: () => void;\n\n /**\n * This callback is called when the back button is clicked.\n */\n onClickBack?: () => void;\n}\n\n/**\n * Options that change how the custom panel looks.\n */\nexport interface CustomPanelConfigOptions extends BasePanelConfigOptions {\n /**\n * Determines if the panel open/close animation should be turned off.\n */\n disableAnimation?: boolean;\n\n /**\n * Disables the default action that is taken when the close or close-and-restart buttons are clicked. The default\n * action closes web chat and disabling this will cause the button to not do anything. You can override the button\n * behavior by using the {@link onClickClose} or {@link onClickCloseAndRestart} callback.\n */\n disableDefaultCloseAction?: boolean;\n}\n\n/**\n * A single menu option.\n */\nexport interface CustomMenuOption {\n /**\n * The text to display for the menu option.\n */\n text: string;\n\n /**\n * The callback handler to call when the option is selected.\n */\n handler: () => void;\n}\n\n// TODO: Move out of public.\n/**\n * This represents the callback function that is called when an input field wants to determine if any completions\n * should be displayed. This function is called every time the text in an input field changes. It is passed the text\n * in the input field and the position of the cursor in the field.\n *\n * This function should return the list of completions that should be displayed to the user or null if no\n * completions should be displayed.\n */\nexport type OnGetCompletions = (inputText: string, cursorPosition: number) => Promise<InputCompletionResult>;\n\n// TODO: Move out of public.\n/**\n * This represents the callback that is called when a completion is selected from a completions popup on an input\n * field. It is passed the completion that was selected which will one of the same object instances returned from the\n * {@link OnGetCompletions} function.\n */\nexport type OnCompletionSelected = (completion: InputCompletion) => void;\n\n// TODO: Move out of public.\nexport interface InputCompletionResult {\n /**\n * The character position where the completion target begins.\n */\n completionStart: number;\n\n /**\n * The character position where the completion target ends.\n */\n completionEnd: number;\n\n /**\n * This list of possible completions.\n */\n completions: InputCompletion[];\n}\n\n// TODO: Move out of public.\nexport interface InputCompletion {\n /**\n * The display text for the completion.\n */\n label: string;\n\n /**\n * The value to replace the completion target with.\n */\n targetValue: string;\n\n /**\n * An object that describes the tag to render beside the mention option.\n */\n tag?: {\n /**\n * The tag text.\n */\n label: string;\n\n /**\n * The tag color.\n */\n type: TagType;\n };\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport type { ChatInstance } from './ChatInstance';\nimport type { ServiceDesk, ServiceDeskFactoryParameters, ServiceDeskPublicConfig } from './serviceDeskTypes';\n\n/**\n * This file contains the definition for the public application configuration operations that are provided by the\n * host page.\n */\n\nexport interface PublicConfig {\n /**\n * The callback function that is called by the loadWatsonAssistantChat script once it is loaded. This is optional;\n * to use web chat without this requires using the \"window.loadWatsonAssistantChat\" function instead.\n */\n onLoad?: (instance: ChatInstance) => void;\n\n /**\n * This is a one-off listener for errors. This value may be provided in the initial page config as a hook for\n * customers to listen for errors. We use this instead of a normal event bus handler because this function can be\n * defined and called before the event bus has been created which allows it to be used in loadWatsonAssistantChat.\n */\n onError?: (data: OnErrorData) => void;\n\n /**\n * An optional element the page can use as a custom in to which to render the widget.\n */\n element?: Element;\n\n /**\n * Render the chat launcher element used to open and close the chat window. If you elect to not show our built in\n * chat launcher, you will be responsible for firing the launcher:toggle, launcher:open or launcher:close events\n * from your own chat launcher. Or, you can use options.openChatByDefault to just have the chat interface be open\n * at initialization.\n */\n showLauncher?: boolean;\n\n /**\n * By default, the chat window will be rendered in a \"closed\" state.\n */\n openChatByDefault?: boolean;\n\n /**\n * Beta version of disclaimer screen. No tooling for this.\n */\n disclaimer?: DisclaimerPublicConfig;\n\n /**\n * This value is only used when a custom element is being used to render the widget. By default, a number of\n * enhancements to the widget are activated on mobile devices which can interfere with a custom element. This\n * value can be used to disable those enhancements while using a custom element.\n */\n disableCustomElementMobileEnhancements?: boolean;\n\n /**\n * Add a bunch of noisy console.log messages!\n */\n debug?: boolean;\n\n themeConfig?: ThemeConfig;\n\n /**\n * A nonce value to set on restricted elements to allow them to satisfy a Content-Security-Policy. If a website is\n * using a Content-Security-Policy along with a nonce to whitelist which style and script elements are allowed,\n * the site can provide this nonce value here which will then be added to the dynamic script and style tags\n * generated by the widget which will allow them to run.\n */\n cspNonce?: string;\n\n /**\n * This is a factory for producing custom implementations of service desks. If this value is set, then this will\n * be used to create an instance of a {@link ServiceDesk} when the user attempts to connect to an agent.\n */\n serviceDeskFactory?: (parameters: ServiceDeskFactoryParameters) => Promise<ServiceDesk>;\n\n /**\n * Agent app is a mode of web chat used in service desk UIs to show the chat history to the agent. Setting this flag\n * will adjust the way web chat renders and behaves, e.g. with no input field, opens by default, etc\n */\n agentAppConfig?: AgentAppConfig;\n\n /**\n * Any public config to apply to service desks.\n */\n serviceDesk?: ServiceDeskPublicConfig;\n\n /**\n * If the web chat should grab focus if the web chat is open on page load. This applies to session history open\n * states as well as openByChatByDefault. This should be set to false if the web chat is embedded in the tooling, for\n * instance.\n */\n shouldTakeFocusIfOpensAutomatically?: boolean;\n\n /**\n * An optional namespace that can be added to the web chat that must be 30 characters or under. This value is\n * intended to enable multiple instances of the web chat to be used on the same page. The namespace for this web\n * chat. This value is used to generate a value to append to anything unique (id, session keys, etc) to allow\n * multiple web chats on the same page.\n *\n * Note: this value is used in the aria region label for the web chat. This means this value will be read out loud\n * by users using a screen reader.\n */\n namespace?: string;\n\n /**\n * Indicates if a focus trap should be enabled when the web chat is open.\n */\n enableFocusTrap?: boolean;\n\n /**\n * The configuration that defines how web chat responds to link page requests (where there's a link reference in the\n * URL).\n */\n pageLinkConfig?: PageLinkConfig;\n\n /**\n * If true, disables functionality in web chat that changes the window title.\n */\n disableWindowTitleChanges?: boolean;\n\n /**\n * Indicates if web chat should sanitize HTML from a user or from the assistant.\n */\n shouldSanitizeHTML?: boolean;\n\n /**\n * Indicates if the internal web chat PDF viewer should be disabled. If true, web chat will present links to PDFs\n * as actual links that will open in the user's web browser using the browser's native viewer instead of the web chat\n * viewer.\n */\n disablePDFViewer?: boolean;\n\n /**\n * A config object to modify tours.\n */\n tourConfig?: {\n /**\n * Indicates if the minimize button should be hidden.\n */\n hideMinimizeButton?: boolean;\n\n /**\n * Indicates if the chat button should be hidden.\n */\n hideChatButton?: boolean;\n };\n\n /**\n * Configuration to control how streaming works.\n */\n streaming?: {\n /**\n * Indicates if streaming is disabled or not. Streaming is disabled by default but can be enabled through this\n * configuration or tooling. When streaming is enabled, the assistant may return a text/event-stream response for a\n * message request.\n */\n disabled?: boolean;\n };\n\n /**\n * Extra config for controlling the behavior of the header.\n */\n headerConfig?: HeaderConfig;\n\n /**\n * The config object for changing web chat's layout.\n */\n layout?: LayoutConfig;\n\n /**\n * Config options for controlling messaging.\n */\n messaging?: PublicConfigMessaging;\n}\n\nexport enum MinimizeButtonIconType {\n /**\n * This shows an \"X\" icon.\n */\n CLOSE = 'close',\n\n /**\n * This shows a \"-\" icon.\n */\n MINIMIZE = 'minimize',\n\n /**\n * This shows an icon that indicates that the web chat can be collapsed into a side panel.\n */\n SIDE_PANEL_LEFT = 'side-panel-left',\n\n /**\n * This shows an icon that indicates that the web chat can be collapsed into a side panel.\n */\n SIDE_PANEL_RIGHT = 'side-panel-right',\n}\n\nexport interface HeaderConfig {\n /**\n * Indicates the icon to use for the close button in the header.\n */\n minimizeButtonIconType?: MinimizeButtonIconType;\n\n /**\n * Hide the ability to minimize the web chat.\n */\n hideMinimizeButton?: boolean;\n\n /**\n * If true, shows the restart conversation button in the header of home screen and main chat.\n */\n showRestartButton?: boolean;\n\n /**\n * Indicates if the close and restart (X) button should be rendered.\n *\n */\n showCloseAndRestartButton?: boolean;\n}\n\n/**\n * When web chat is being used as the view for the human agent.\n */\nexport interface AgentAppConfig {\n /**\n * Sets chat to be in \"agent app\" mode. This means no user input is allowed and an \"auth_code\" will be included in the\n * request to fetch the conversation history.\n */\n is_on: boolean;\n\n /**\n * The auth_code passed from the connect_to_agent response type used to authenticate the session. This can be used to\n * embed a web chat into an agent application as an iframe and load the conversation history for the agent to see.\n */\n auth_code?: string;\n}\n\n/**\n * The configuration that defines how web chat responds to link page requests (where there's a link reference in the\n * URL).\n */\nexport interface PageLinkConfig {\n /**\n * The configuration for all the link IDs. The keys are the link IDs and the values are the configurations\n * specific to each link ID.\n */\n linkIDs: Record<string, PageLinkIDConfig>;\n}\n\n/**\n * The link configuration for a specific link ID.\n */\nexport interface PageLinkIDConfig {\n /**\n * The text of the utterance that will be sent to the assistant when the page is loaded and the given link ID is\n * found.\n */\n text: string;\n}\n\n/**\n * The launcher extended config that controls when certain animations should happen.\n */\nexport interface LauncherExtendedConfig {\n /**\n * The amount of time to wait before extending the launcher.\n */\n time_to_expand: number;\n\n /**\n * The amount of time to wait before reducing the extended launcher.\n */\n time_to_reduce?: number;\n}\n\nexport enum ClosePanelIconDirection {\n LEFT = 'left',\n RIGHT = 'right',\n}\n\nexport interface ClosePanelButtonConfig {\n /**\n * Indicates if the close panel button should be visible in the header.\n */\n is_on?: boolean;\n\n /**\n * Indicates the direction the icon should be facing.\n */\n closeIconDirection?: ClosePanelIconDirection;\n}\n\nexport interface LayoutConfig {\n /**\n * Indicates if the web chat widget should keep its border and box-shadow.\n */\n showFrame?: boolean;\n}\n\n/**\n * Config options for controlling messaging.\n */\nexport interface PublicConfigMessaging {\n /**\n * Indicates if web chat should make a request for the welcome message when a new conversation begins. If this is\n * true, then web chat will start with an empty conversation.\n */\n skipWelcome?: boolean;\n\n /**\n * Changes the timeout used by the message service when making message calls. The timeout is in seconds. The\n * default is 40 seconds. After this time, an error will be shown in the client and an Abort signal will be sent\n * to customSendMessage.\n */\n messageTimeoutSecs?: number;\n\n /**\n * Indicates if the context from the previous response should be copied on the next request. This is true by default.\n */\n copyPreviousContextOnRequest?: boolean;\n}\n\nexport interface DisclaimerPublicConfig {\n /**\n * If the disclaimer is turned on.\n */\n isOn: boolean;\n\n /**\n * HTML content to show in disclaimer.\n */\n disclaimerHTML: string;\n}\n\n/**\n * A string identifying what Carbon Theme we should base UI variables off of. Defaults to 'g10'. See\n * https://carbondesignsystem.com/guidelines/color/tokens.\n */\nexport enum CarbonTheme {\n WHITE = 'white',\n G10 = 'g10',\n G90 = 'g90',\n G100 = 'g100',\n}\n\n/**\n * The types of corners web chat can have.\n */\nexport enum CornersType {\n ROUND = 'round',\n SQUARE = 'square',\n}\n\n/**\n * The different categories of errors that the system can record. These values are published for end user consumption.\n */\nexport enum OnErrorType {\n /**\n * Indicates an error loading the remote init config.\n */\n INITIAL_CONFIG = 'INITIAL_CONFIG',\n\n /**\n * Indicates an error loading the main config.\n */\n OPEN_CONFIG = 'OPEN_CONFIG',\n\n /**\n * Indicates an error sending a message to the assistant. This error is only generated after all retries have\n * failed and the system has given up.\n */\n MESSAGE_COMMUNICATION = 'MESSAGE_COMMUNICATION',\n\n /**\n * This indicates an error in one of the React components that occurs as part of rendering the UI.\n */\n RENDER = 'RENDER',\n\n /**\n * This indicates an error with the identity token.\n */\n IDENTITY_TOKEN = 'IDENTITY_TOKEN',\n\n /**\n * This indicates an error with the MCSP identity token.\n */\n MCSP_IDENTITY_TOKEN = 'MCSP_IDENTITY_TOKEN',\n\n /**\n * This indicates a known error with the configuration for the integration or assistant. The only current case\n * is when the web chat receives a connect_to_agent response and no service desk has been configured. These are\n * generally user errors.\n */\n INTEGRATION_ERROR = 'INTEGRATION_ERROR',\n\n /**\n * The agent in the service desk waited too long to pick up the request and the session has expired so history cannot\n * be fetched.\n */\n AGENT_APP_EXPIRED_SESSION = 'AGENT_APP_EXPIRED_SESSION',\n\n /**\n * This indicates that some error occurred while trying to hydrate web chat. This will prevent web chat from\n * functioning.\n */\n HYDRATION = 'HYDRATION',\n\n /**\n * Indicates that an attempt to load the preview link was made but security was enabled.\n */\n PREVIEW_LINK_SECURITY = 'PREVIEW_LINK_SECURITY',\n}\n\n/**\n * The possible reasons that loading the web chat may fail.\n */\nexport enum CatastrophicErrorType {\n /**\n * Indicates it failed for some other reason.\n */\n FAILED = 'FAILED',\n\n /**\n * Indicates it failed because there was no skill attached to the assistant.\n */\n NO_SKILL = 'NO_SKILL',\n\n /**\n * Indicates it failed because the welcome node was throttled by the service.\n */\n THROTTLED = 'THROTTLED',\n\n /**\n * The agent in the service desk waited too long to pick up the request and the session has expired so history cannot\n * be fetched.\n */\n AGENT_APP_EXPIRED_SESSION = 'AGENT_APP_EXPIRED_SESSION',\n}\n\nexport interface OnErrorData {\n /**\n * The type of error that occurred.\n */\n errorType: OnErrorType;\n\n /**\n * A message associated with the error.\n */\n message: string;\n\n /**\n * A possible error code associated with this error. The meaning of this value may vary based on the error type.\n */\n errorCode?: number;\n\n /**\n * An optional transaction ID to associate with the error.\n */\n transactionID?: string;\n\n /**\n * An extra blob of data associated with the error. This may be a stack trace for thrown errors.\n */\n otherData?: unknown;\n\n /**\n * If the error is of the severity that requires a whole restart of web chat.\n */\n catastrophicErrorType?: CatastrophicErrorType;\n}\n\nexport interface ThemeConfig {\n /**\n * A string identifying what Carbon Theme we should base UI variables off of. Defaults to 'g10'. See\n * https://carbondesignsystem.com/guidelines/color/tokens.\n */\n carbonTheme?: CarbonTheme;\n\n /**\n * This flag is used to disable web chat's rounded corners.\n */\n corners?: CornersType;\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport type { TrackEventProps } from 'internal-packages/shared/services/TrackService';\nimport type { SuggestionListItem } from 'internal-packages/shared/utils/alternateSuggestionsUtils';\nimport type { CornersType } from 'internal-packages/shared/utils/constants';\nimport {\n type CustomPanelConfigOptions,\n type FileUpload,\n NotificationStateObject,\n type ViewState,\n ViewType,\n} from 'internal-packages/types/apiTypes';\nimport type { FileUploadCapabilities } from 'internal-packages/types/ChatInstance';\nimport { CatastrophicErrorType } from 'internal-packages/types/PublicConfig';\nimport type {\n ConversationalSearchItemCitation,\n EventInputData,\n GenericItem,\n IFrameItem,\n MessageResponse,\n SearchResult,\n SearchResultItem,\n} from 'submodules/wa-fd-types-public/wa-types';\n\nimport type { AlternateSuggestionsConfig } from './AlternateSuggestionsConfig';\nimport type { AppConfig } from './AppConfig';\nimport type { BrandingConfig } from './BrandingConfig';\nimport type { CarbonTheme } from './carbonTypes';\nimport type { CustomMenuOption } from './CustomMenuOptions';\nimport EnumMap from './EnumMap';\nimport type { FeatureName } from './FeatureName';\nimport type { HomeScreenConfig, HomeScreenStarterButton, HomeScreenState } from './HomeScreenConfig';\nimport type { AgentAvailability } from './HumanAgentAssistTypes';\nimport type { EnglishLanguagePack, LanguagePack } from './LanguagePack';\nimport type { LauncherConfig } from './LauncherConfig';\nimport type { LocalMessageItem } from './LocalMessageItem';\nimport ObjectMap from './ObjectMap';\nimport { PersistedAgentState } from './PersistedAgentState';\nimport type { LayoutConfig } from './PublicConfig';\nimport type { PersistedTourState, TourState } from './TourState';\nimport type { Message } from './watsonAssistantAPITypes';\n\n/**\n * This contains the definitions for the redux application state.\n */\n\n/**\n * The list of messages used by web chat. These are in their own section for easy ability to restart.\n */\ninterface AppStateMessages {\n /**\n * This is the global map/registry of all the local message items by their IDs. This includes messages from\n * the bot as well as messages with a human agent. The order of the messages is controlled by the array of\n * local message IDs contained in {@link ChatMessagesState}.\n */\n allMessageItemsByID: ObjectMap<LocalMessageItem>;\n\n /**\n * This is the global map/registry of all full messages (as opposed to the local message items) in the system by their\n * message IDs. This includes messages with a human agent. The order of the messages is controlled by the array of\n * local message IDs contained in {@link ChatMessagesState}.\n */\n allMessagesByID: ObjectMap<Message>;\n\n /**\n * The state of messages when the user is interacting with the bot/assistant.\n */\n botMessageState: ChatMessagesState;\n}\n\ninterface AppState extends AppStateMessages {\n /**\n * The state of the input area when the user is interacting with a bot (not a human agent).\n */\n botInputState: InputState;\n\n /**\n * The current state for the human agent system.\n */\n agentState: AgentState;\n\n /**\n * Whether we have hydrated web chat. This means we have loaded session history if it exists as well as the\n * welcome node (if appropriate).\n */\n isHydrated: boolean;\n\n /**\n * The name visible on the header bar. Also used in logs and other messages. This value is first populated via config.\n */\n botName: string;\n\n /**\n * An override for specifically just the title in the header bar. Useful if you don't want to always show the name of\n * the assistant in the title bar, but want to keep it in the message. Also useful if you want the title of your chat\n * and the name of your assistant to be different values.\n */\n headerDisplayName: string;\n\n /**\n * The avatar visible on the header bar. This value (image url) is first populated via config.\n */\n botAvatarURL: string;\n\n /**\n * The source of the launcher avatar image.\n */\n launcherAvatarURL: string;\n\n /**\n * The current CSS variables added as overrides. We store this because as we live update we merge with the previous\n * value. If there are no overrides this can be undefined.\n */\n cssVariableOverrides: ObjectMap<string>;\n\n /**\n * The external configuration for the chat widget that includes the public config provided by the host page as well\n * as the remote config provided by the tooling.\n */\n config: AppConfig;\n\n /**\n * The config above gets manipulated by some reducers (particularly the updateCSSVariables action). Store the original\n * config in case we ever need to refer back to the non manipulated version.\n */\n originalConfig: AppConfig;\n\n /**\n * The language pack currently in use by the widget. This may be different from the language pack provided in the\n * original public config if it has been updated since. If no pack was provided in the public config, this value\n * will be set by the locale and is updated if the locale is changed.\n */\n languagePack: LanguagePack;\n\n /**\n * The locale currently in use by the widget. This may be different from the locale provided in the original\n * public config if it has been updated since. If this value is updated, the language pack will be updated as well\n * as long as one was not originally provided in the public config.\n */\n locale: string;\n\n /**\n * v3.2.1 and earlier: IBM Cloud user email domain who most recently edited and saved the public config in tooling.\n * after v3.2.1: IBM Cloud Account owner email domain associated with the user's widget.\n */\n accountOwnerDomain: string;\n\n /**\n * after v3.2.1: IBM Cloud user email domain who most recently edited and saved the config in tooling.\n */\n recentEditorDomain: string;\n\n /**\n * An ID to uniquely identify the user. This can be used for GDPR purposes to delete the user's data on request.\n * This may be null if the user is not known. This may be different from the ID provided in the original public\n * config if it has been updated since. This value is only permitted to be updated if the previous value was null.\n * It cannot be updated from one userID to a different userID.\n */\n userID: string;\n\n /**\n * An ARIA message to be announced to the user. This will be announced whenever the message text changes.\n */\n announceMessage?: AnnounceMessage;\n\n /**\n * This is the overall bucket used to contain pending logging/tracking events for the system.\n */\n pendingLogs: PendingLogs;\n\n /**\n * A signed JWT value used to authorize and authenticate a given user.\n */\n identityToken: string;\n\n /**\n * The state of the alternate suggestions for the bot.\n */\n alternateSuggestionsState: AlternateSuggestionsState;\n\n /**\n * Indicates if the messages list should suspend its detection of scroll events on the messages list. The message\n * list uses a scroll listener to determine if the user has anchored the list to the bottom so that we can always\n * stay at the bottom. However, there are a number of cases where scrolling can occur automatically when the list\n * resizes that are not the result of the user scrolling. We want to ignore these scroll events.\n */\n suspendScrollDetection: boolean;\n\n /**\n * Active config for home screen derived from combining remote and local config.\n */\n homeScreenConfig: HomeScreenConfig;\n\n /**\n * Any items stored here is also persisted to sessionStorage IF sessionHistory is turned on. We rehydrate the redux\n * store with this information. Examples of things we store include if the web chat is open and if you have an active\n * conversation with an agent.\n */\n persistedToBrowserStorage: PersistedToBrowserStorageState;\n\n /**\n * A map with features as the key and booleans as the value. Used to conditionally display non-production features.\n */\n featureSet: EnumMap<FeatureName>;\n\n /**\n * The current enum value for the width of the chat. Used to drive responsive design and to swap components out\n * in different view sizes as needed.\n */\n chatWidthBreakpoint: ChatWidthBreakpoint;\n\n /**\n * The current width of the chat in pixels.\n */\n chatWidth: number;\n\n /**\n * The current height of the chat in pixels.\n */\n chatHeight: number;\n\n /**\n * Has thrown an error that web chat can not recover from.\n */\n catastrophicErrorType?: CatastrophicErrorType;\n\n /**\n * The state of web chat branding.\n */\n brandingState: BrandingState;\n\n /**\n * The state of the web chat launcher.\n */\n launcher: LauncherState;\n\n /**\n * The state of the iframe panel.\n */\n iFramePanelState: IFramePanelState;\n\n /**\n * The state of the conversational search citation panel.\n */\n viewSourcePanelState: ViewSourcePanelState;\n\n /**\n * Indicates if the app has been destroyed and should no longer be rendered.\n */\n isDestroyed: boolean;\n\n /**\n * The custom panel state.\n */\n customPanelState: CustomPanelState;\n\n /**\n * The state of the panel surfaced by response types, either with or without user input.\n */\n responsePanelState: MessagePanelState;\n\n /**\n * Indicates if the view is currently changing. This means that a fireViewChangeEventsAndChangeView function is\n * currently running and waiting to be resolved. This is used to stop these functions, and the events within them from\n * firing on top of each other.\n */\n viewChanging: boolean;\n\n /**\n * Indicates that Chat.ts has finished firing actions.changeView(). This signifies to the launcher and\n * other components that they may now begin their animations if they're visible.\n */\n initialViewChangeComplete: boolean;\n\n /**\n * Before web chat is loaded, the initial view state is set to everything closed (which reflects the reality of the\n * page as web chat is loading). This property is the view state we want web chat to try to get to after it is loaded.\n * If a previous session already exists, then this target will be set to the previous view state so we get back to\n * where we were. If there is no session, this will be set to a default that is based on the current web chat\n * config and page context (such as considering if openChatByDefault is set). After web chat is loaded, this value is\n * no longer used.\n */\n targetViewState: ViewState;\n\n /**\n * All the currently configured custom menu options.\n */\n customMenuOptions: CustomMenuOption[];\n\n /**\n * The non-persisted state for tours.\n */\n tourState: TourState;\n\n /**\n * Indicates if we should display a transparent background covering the non-header area of the main window.\n */\n showNonHeaderBackgroundCover: boolean;\n\n /**\n * Indicates if the browser page is visible. This uses the Page Visibility API which needs to be taken with a\n * grain of salt. A visibility change only occurs if the page moves in or out of being 100% visible. This occurs\n * when you switch tabs within the same window or if you minimize/maximize a window. If you switch to a different\n * window, this window changes visibility only if the entire window is covered.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n */\n isBrowserPageVisible: boolean;\n\n /**\n * Which carbon theme to use and whether the AI theme is enabled.\n */\n theme: ThemeState;\n\n /**\n * Whether streaming is enabled.\n */\n streaming: StreamingState;\n\n /**\n * If we're in AWS or a {@link PublicConfig.orchestratePrivateHostURL} is defined, then we should include the\n * Orchestrate mfe.\n */\n loadOrchestrateMFEs: boolean;\n\n layout: LayoutConfig;\n\n /**\n * The current state of notifications.\n */\n notifications: NotificationStateObject[];\n}\n\n/**\n * The state of the input area where the user types messages.\n */\ninterface InputState extends FileUploadCapabilities {\n /**\n * Indicates if the input field is configured to be visible. This is only interpreted as the custom setting defined\n * by the host page if it turns off the field. The value of this may be overridden if the user is connected to an\n * agent where the field will automatically become visible and then hidden again when the agent chat has ended.\n */\n fieldVisible: boolean;\n\n /**\n * Indicates if the input field should be made readonly.\n */\n isReadonly: boolean;\n\n /**\n * The current set of file attachments selected to be uploaded.\n */\n files: FileUpload[];\n}\n\n/**\n * Items stored by integrationID AND userID in sessionStorage.\n */\ninterface PersistedChatState {\n /**\n * The version of the web chat that this data is persisted for. If there are any breaking changes to the\n * application state and a user reloads and gets a new version of the widget, bad things might happen so we'll\n * just invalidate the persisted storage if we ever attempt to load an old version on web chat startup.\n */\n version: string;\n\n /**\n * The active watsonx Assistant sessionID.\n */\n sessionID: string;\n\n /**\n * Seconds from epoch when the session started.\n */\n sessionStartedTimestamp: number;\n\n /**\n * Maps the count of instance.updateHistoryUserDefined(), per messageID, for the length of a session.\n */\n updateHistoryUserDefinedCount: ObjectMap<number>;\n\n /**\n * Map of if a disclaimer has been accepted on a given window.hostname value.\n */\n disclaimersAccepted: ObjectMap<boolean>;\n\n /**\n * State of home screen.\n */\n homeScreenState: HomeScreenState;\n\n /**\n * If the user has received a message beyond the welcome node. We use this to mark if the chat has been interacted\n * with.\n */\n hasSentNonWelcomeMessage: boolean;\n\n /**\n * The persisted state for suggestions.\n */\n suggestionsPersistedState: AlternateSuggestionsPersistedState;\n\n /**\n * The persisted state for tours.\n */\n persistedTourState: PersistedTourState;\n\n /**\n * The persisted state for agents.\n */\n agentState: PersistedAgentState;\n}\n\n/**\n * Items stored by integrationID in sessionStorage.\n */\ninterface PersistedLauncherState {\n /**\n * Indicates if this state was loaded from browser session storage or if was created as part of a new session.\n */\n wasLoadedFromBrowser: boolean;\n\n /**\n * The version of the web chat that this data is persisted for. If there are any breaking changes to the\n * application state and a user reloads and gets a new version of the widget, bad things might happen so we'll\n * just invalidate the persisted storage if we ever attempt to load an old version on web chat startup.\n */\n version: string;\n\n /**\n * Indicates which of the web chat views are visible and which are hidden.\n */\n viewState: ViewState;\n\n /**\n * Indicates if there is currently an active tour. If there is then clicking on the launcher should open the tour\n * view.\n */\n activeTour: boolean;\n\n /**\n * Indicates if we should show an unread indicator on the launcher. This is a custom flag that is set by\n * {@link ChatActions.updateBotUnreadIndicatorVisibility} and will display an empty circle on\n * the launcher. This setting is overridden if there are any unread human agent messages in which case a circle\n * with a number is displayed.\n */\n showUnreadIndicator: boolean;\n\n /**\n * Indicates if the mobile launcher should be in the extended state.\n */\n mobileLauncherIsExtended: boolean;\n\n /**\n * Determines if the mobile launcher already played the extended animation and was reduced.\n */\n mobileLauncherWasReduced: boolean;\n\n /**\n * Determines if the mobile launcher previously played the bounce animation and should no longer be able to.\n */\n mobileLauncherDisableBounce: boolean;\n\n /**\n * Indicates the desktop launcher is in its expanded state.\n */\n desktopLauncherIsExpanded: boolean;\n\n /**\n * Indicates the desktop launcher has been minimized.\n */\n desktopLauncherWasMinimized: boolean;\n\n /**\n * The bounce turn the user is currently on in the sequence of bounces so that user doesn't start over in the\n * sequence. A turn is a full set of animations that are displayed when a bounce occurs and each turn of a bounce is\n * when a different bounce occurs at a different point in time. This is used for both the desktop and mobile launcher.\n */\n bounceTurn: number;\n\n /**\n * If the user has received a message beyond the welcome node. We use this to mark if the chat has been interacted\n * with. Note that this is a duplicate of the property on {@link PersistedChatState.hasSentNonWelcomeMessage}. It\n * is duplicated here so that this information may be available before hydration and before the user is known.\n * Note that this property reflects only the last user and should only be used when an approximate value is\n * acceptable.\n */\n hasSentNonWelcomeMessage: boolean;\n}\n\n/**\n * State shared with the sessionStorage so that as the user navigates the chat stays in the same UI state. This is in\n * addition to the data that the session history store.\n */\ninterface PersistedToBrowserStorageState {\n /**\n * Things stored that are related to the user profile. These are not accessible until the web chat has been opened!\n */\n chatState: PersistedChatState;\n\n /**\n * Things stored that are not related to the user profile. These should only be things that are not sensitive like\n * \"is the web chat open\".\n */\n launcherState: PersistedLauncherState;\n}\n\n/**\n * The state information for a specific instance of a chat panel that contains a list of messages.\n */\ninterface ChatMessagesState {\n /**\n * An array of local message item ids to correctly store the order of messages.\n */\n localMessageIDs: string[];\n\n /**\n * An array of message ids to correctly store the order of messages.\n */\n messageIDs: string[];\n\n /**\n * Counter that indicates if the other party (not the user) is typing and that a typing indicator should be displayed.\n * If \"0\" then we do not show typing indicator.\n */\n isTypingCounter: number;\n\n /**\n * Counter that indicates if the loading bar should be displayed.\n * If \"0\" then we do not show loading indicator.\n */\n isLoadingCounter: number;\n\n /**\n * Indicates if the scrollable area of the widget is anchored to the bottom such that if any changes in the scroll\n * panel size occur, the panel will automatically be scrolled back to the bottom. The anchor is enabled whenever\n * a scroll event occurs that brings the panel to the bottom. It also starts anchored as the panel is initially empty.\n */\n isScrollAnchored: boolean;\n}\n\n/**\n * This piece of state contains information about any connection to a human agent system.\n */\ninterface AgentState {\n /**\n * Indicates that we are currently attempting to connect the user to an agent.\n */\n isConnecting: boolean;\n\n /**\n * Indicates that we are currently attempting to re-connect the user to an agent. This occurs when web chat is\n * initially loaded and the user was previously connected to an agent.\n */\n isReconnecting: boolean;\n\n /**\n * Information about the waiting status for the user before being connected to an agent. This can contain\n * information about the time to wait or the position in a queue. If this is null, no specific wait information is\n * available.\n */\n availability?: AgentAvailability;\n\n /**\n * Indicates the number of messages from an agent that are unread by a user. This is only indicated if the user is\n * on the bot view. All agent messages are marked as read if the user switches to the agent view. This count does\n * not include \"agent joined\" messages.\n */\n numUnreadMessages: number;\n\n /**\n * Indicates if there is currently a file upload in progress.\n */\n fileUploadInProgress: boolean;\n\n /**\n * The ID of the locale message that was used to start the current conversation with an agent.\n */\n activeLocalMessageID?: string;\n\n /**\n * Indicates if the modal for displaying a screen sharing requests should be shown.\n */\n showScreenShareRequest: boolean;\n\n /**\n * Indicates if the user is currently sharing their screen.\n */\n isScreenSharing: boolean;\n\n /**\n * Indicates if the agent is typing.\n */\n isAgentTyping: boolean;\n\n /**\n * The state of the input field while connecting or connected to an agent.\n */\n inputState: InputState;\n}\n\n/**\n * The state that controls how the agent interaction appears to the user.\n */\ninterface AgentDisplayState {\n /**\n * Indicates if the user should see that they are connecting or connected to an agent.\n */\n isConnectingOrConnected: boolean;\n\n /**\n * Indicates if the input field should be disabled.\n */\n disableInput: boolean;\n\n /**\n * The language pack key to show for the placeholder text in the input field (if the default should be overridden).\n */\n inputPlaceholderKey: keyof EnglishLanguagePack;\n\n /**\n * Indicates if the agent is typing.\n */\n isAgentTyping: boolean;\n}\n\n/**\n * This interface represents a piece of text that can be translated using a language pack. A piece of code that\n * needs to display a string from the language pack can specify the ID/Key of the message from the language pack and\n * optionally any parameters that need to be passed to the message formatter that are used inside the string. This\n * also allows a form where the text has already been translated and can be used as-is.\n */\ninterface AnnounceMessage {\n /**\n * If the text is just specified as text that's already been calculated, that text can just be set here.\n */\n messageText?: string;\n\n /**\n * If the text is defined by a message id that corresponds to one of the messages in our language pack, that\n * message id can be specified here. The message text will be formatted using this message id.\n */\n messageID?: keyof EnglishLanguagePack;\n\n /**\n * If the text is defined by a message id that corresponds to one of the messages in our language pack, any\n * optional parameters that are necessary for formatting the message with the given id are specified here.\n */\n messageValues?: Record<string, any>;\n}\n\n/**\n * The different available widths of a web chat.\n */\nenum ChatWidthBreakpoint {\n // < 360px\n NARROW = 'narrow',\n // >= 360px\n STANDARD = 'standard',\n // > 672 + 16 + 16px\n WIDE = 'wide',\n}\n\n/**\n * The possible states of the suggestions options panel.\n */\nenum AlternateSuggestionsPanelState {\n /**\n * The panel is closed.\n */\n CLOSED = 1,\n\n /**\n * The panel is half open in the \"strike\" state.\n */\n OPEN_STRIKE = 2,\n\n /**\n * The panel is fully open.\n */\n OPEN_FULL = 3,\n}\n\n/**\n * This interface is used to represent the current state of the alternate suggestions feature in the application\n * including the button as well as the list of items visible in the open panel.\n *\n * The pieces of this that need to be saved in browser storage are located in {@link\n * AlternateSuggestionsPersistedState}.\n */\ninterface AlternateSuggestionsState {\n /**\n * The current config state for alternate suggestions.\n */\n config: AlternateSuggestionsConfig;\n\n /**\n * This is the related {@link MessageResponse} that was the source of the current set of alternate responses.\n */\n sourceResponse?: MessageResponse;\n\n /**\n * Indicates if the alternate suggestions button should be visible.\n */\n showButton: boolean;\n\n /**\n * Indicates if the panel may be displayed in the collapsed state (where it only shows alternate responses and the\n * contact option).\n */\n allowCollapse: boolean;\n\n /**\n * Indicates if the \"alternate responses\" panel is open. This panel will always display the alternate responses\n * present on the last message in the list.\n */\n panelState: AlternateSuggestionsPanelState;\n\n /**\n * This list of alternate responses to display in the alternate suggestions panel when it is open. This may also\n * include the contact option in the case of the strike panel.\n */\n suggestionListItems?: SuggestionListItem[];\n\n /**\n * Indicates if the section for displaying search results should be shown in the suggestions panel.\n */\n showSearchSection: boolean;\n\n /**\n * The search result item to display.\n */\n searchResults?: SearchResultItem;\n\n /**\n * Indicates if the search results are currently being queried. This value is set by the reducer and the\n * {@link createHandleAlternateSuggestions} subscriber listens for it and triggers the actual query.\n */\n searchResultsLoading?: boolean;\n\n /**\n * When a search result is in progress or has already happened, this will be the search text that was searched for.\n */\n searchResultsText?: string;\n\n /**\n * The \"connect to an agent\"/contact item that should be displayed (only if it's to be displayed in its own section).\n */\n contactItem?: SuggestionListItem;\n\n /**\n * The list of home screen starters to display in the alternate suggestions panel when it is open.\n */\n starters?: HomeScreenStarterButton[];\n}\n\n/**\n * This interface contains the pieces of suggestions state that are persisted in the browser session storage.\n */\ninterface AlternateSuggestionsPersistedState {\n /**\n * The number of consecutive times the bot has failed to understand the user (we hit the anything else node).\n */\n numStrikes: number;\n\n /**\n * The index of the current suggestion item that the user most recently selected from the suggestion list. This\n * value is reset each time the suggestion list is changed. A value of -1 indicates that no value has been\n * selected. Which section this value applies to, depends on the value of {@link #selectedSection}.\n */\n selectedIndex: number;\n\n /**\n * Indicates which section contains the most recently selected item.\n */\n selectedSection: AlternateSuggestionsSection;\n}\n\nenum AlternateSuggestionsSection {\n /**\n * Indicates the display of the alternate responses.\n */\n ALTERNATE_RESPONSES = 1,\n\n /**\n * The other contact option section. This is the section that includes the \"connect to agent\" option.\n */\n CONTACT_OPTIONS = 2,\n\n /**\n * The section that contains the home screen starters.\n */\n STARTERS = 3,\n}\n\ninterface BrandingState {\n /**\n * The current config state of branding.\n */\n config: BrandingConfig;\n\n /**\n * Determines if the branding overlay should be visible.\n */\n isOpen: boolean;\n\n /**\n * Determines if the banner should be shown.\n */\n showBanner: boolean;\n}\n\n/**\n * The launcher config.\n */\ninterface LauncherState {\n /**\n * The current config state of launcher.\n */\n config: LauncherConfig;\n}\n\n/**\n * This is the overall bucket used to contain pending logging/tracking events for the system.\n */\ninterface PendingLogs {\n /**\n * A set of events that we want to send to Amplitude for tracking purposes.\n */\n trackEvents: TrackEventProps[];\n\n /**\n * The array of messages that are to be sent to the bot as event messages.\n */\n eventMessages: EventInputData[];\n}\n\ninterface IFramePanelState {\n /**\n * Indicates if the iframe panel is open.\n */\n isOpen: boolean;\n\n /**\n * The iframe message item with the content to load.\n */\n messageItem: IFrameItem;\n}\n\ninterface ViewSourcePanelState {\n /**\n * Indicates if the conversational search citation panel is open.\n */\n isOpen: boolean;\n\n /**\n * A citation either from ConversationalSearch or from legacy (non-conversational) search. Confusingly,\n * {@link ConversationalSearchItem} contains it's own search_result array. Those searchResults are not the\n * searchResults that will be used for this citation prop here. Instead only legacy search will supply a searchResult\n * item for the citation and this will come from the {@link SearchResultItem} in either the results, primary_results,\n * or additional_results arrays. ConversationalSearch will supply a ConversationalSearchItemCitation for this prop, as\n * well as a searchResult prop lower down. This search_result is from the ConversationalSearchItem that corresponds to\n * this specific citation.\n */\n citationItem: ConversationalSearchItemCitation | SearchResult;\n\n /**\n * If the citation is for a {@link ConversationalSearchItem} then the ExpandToPanelCard should show a search result in\n * the panel because it has extra text and detail that could be valuable to the user.\n */\n relatedSearchResult?: SearchResult;\n}\n\ninterface CustomPanelState {\n /**\n * Determines if the custom panel should be open.\n */\n isOpen: boolean;\n\n /**\n * The id of the panel that is currently in focus.\n */\n panelID: string;\n\n /**\n * Config options for the custom panels.\n */\n options: CustomPanelConfigOptions;\n}\n\ninterface MessagePanelState<T extends GenericItem = GenericItem> {\n /**\n * Determines if the show panel is open.\n */\n isOpen: boolean;\n\n /**\n * The local message item that contains panel content to display.\n */\n localMessageItem: LocalMessageItem<T>;\n\n /**\n * Indicates if this message is part the most recent message response that allows for input. This will allow the panel\n * to reflect the state of the chat, such as disabling buttons that shouldn't be accessible anymore.\n */\n isMessageForInput: boolean;\n}\n\n/**\n * The theme state.\n */\ninterface ThemeState {\n /**\n * Indicates if the carbon for AI theme is enabled.\n */\n useAITheme: boolean;\n\n /**\n * A string identifying what Carbon Theme we should base UI variables off of. Defaults to 'g10'. See\n * https://carbondesignsystem.com/guidelines/color/tokens.\n */\n carbonTheme: CarbonTheme;\n\n /**\n * This flag is used to disable web chat's rounded corners.\n */\n corners: CornersType;\n}\n\n/**\n * The streaming state.\n */\ninterface StreamingState {\n /**\n * Whether streaming is enabled.\n */\n enabled: boolean;\n}\n\nexport {\n AlternateSuggestionsPersistedState,\n AppStateMessages,\n AppState,\n PersistedToBrowserStorageState,\n AgentDisplayState,\n AgentState,\n ChatMessagesState,\n AnnounceMessage,\n ViewState,\n ViewType,\n CatastrophicErrorType,\n AlternateSuggestionsState,\n PersistedChatState,\n PersistedLauncherState,\n BrandingState,\n LauncherState,\n AlternateSuggestionsPanelState,\n IFramePanelState,\n ViewSourcePanelState,\n AlternateSuggestionsSection,\n CustomPanelConfigOptions,\n CustomPanelState,\n InputState,\n FileUpload,\n MessagePanelState,\n ChatWidthBreakpoint,\n ThemeState,\n StreamingState,\n FileUploadCapabilities,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport 'submodules/wa-fd-types-public/wa-types-chat-extensions';\n\nimport { IntlShape } from 'react-intl';\nimport { MessageRequest } from 'submodules/wa-fd-types-public/wa-types-chat';\nimport { DeepPartial } from 'ts-essentials';\n\nimport {\n CustomMenuOption,\n CustomPanels,\n LanguagePack,\n LauncherType,\n NotificationMessage,\n OnCompletionSelected,\n OnGetCompletions,\n ViewState,\n ViewType,\n} from './apiTypes';\nimport { BusEvent, BusEventType } from './eventBusTypes';\nimport { HomeScreenConfig } from './HomeScreenConfig';\n\n/**\n * The interface represents the API contract with the chat widget and contains all the public methods and properties\n * that can be used with web chat.\n */\nexport interface ChatInstance extends EventHandlers, ChatActions {\n /**\n * This function will be called customer code after 'loadWatsonAssistantChat' has been called and after any login or\n * subscription operations have been performed that are required before the user's history can be loaded and the\n * widget rendered. When called, this will load the history and then render the widget.\n */\n render: () => Promise<ChatInstance>;\n\n /**\n * Destroy the chat widget and return initial content to the DOM.\n */\n destroy: () => void;\n\n /**\n * Returns the version number of code the widget is running.\n */\n getWidgetVersion: () => string;\n\n /**\n * Returns state information of the web chat that could be useful.\n */\n getState: () => PublicWebChatState;\n\n /**\n * Returns an instance of the intl object that is used for generating translated text. Note that the object\n * returned from this function changes each time the locale or language pack is changed.\n */\n getIntl: () => IntlShape;\n}\n\n/**\n * This is the state made available by calling getState. This is a public method that returns immutable values.\n */\nexport interface PublicWebChatState {\n /**\n * Is the web chat currently in an open state.\n */\n isWebChatOpen: boolean;\n\n /**\n * Is the web chat currently connected with a human agent.\n */\n isConnectedWithHumanAgent: boolean;\n\n /**\n * Indicates if web chat has requested to be connected to a human agent but an agent has not yet joined the\n * conversation.\n */\n isConnectingWithHumanAgent: boolean;\n\n /**\n * Is the home screen open.\n */\n isHomeScreenOpen: boolean;\n\n /**\n * Indicates if debugging is enabled.\n */\n isDebugEnabled: boolean;\n\n /**\n * Has the user sent a message that isn't requesting the welcome node.\n */\n hasUserSentMessage: boolean;\n\n /**\n * Whether there is an active tour currently.\n */\n isTourActive: boolean;\n\n /**\n * The current viewState of the web chat.\n */\n viewState: ViewState;\n\n /**\n * State regarding service desks.\n */\n serviceDesk: PublicWebChatServiceDeskState;\n}\n\nexport interface PublicWebChatServiceDeskState {\n /**\n * Is the web chat currently connected with a human agent.\n */\n isConnected: boolean;\n\n /**\n * Indicates if web chat has requested to be connected to a human agent but an agent has not yet joined the\n * conversation.\n */\n isConnecting: boolean;\n\n /**\n * Indicates if a conversation with a human agent has been suspended.\n */\n isSuspended: boolean;\n}\n\n/**\n * This is a subset of the public interface that is managed by the event bus that is used for registering and\n * unregistering event listeners on the bus.\n */\nexport interface EventHandlers {\n /**\n * Adds the given event handler as a listener for events of the given type.\n *\n * @param handlers The handler or handlers along with the event type to start listening for events.\n * @returns The instance for method chaining.\n */\n on: (handlers: TypeAndHandler | TypeAndHandler[]) => EventHandlers;\n\n /**\n * Removes an event listener that was previously added via {@link on} or {@link once}.\n *\n * @param handlers The handler or handlers along with the event type to stop listening for events.\n * @returns The instance for method chaining.\n */\n off: (handlers: TypeAndHandler | TypeAndHandler[]) => EventHandlers;\n\n /**\n * Adds the given event handler as a listener for events of the given type. After the first event is handled, this\n * handler will automatically be removed.\n *\n * @param handlers The handler or handlers along with the event type to start listening for an event.\n * @returns The instance for method chaining.\n */\n once: (handlers: TypeAndHandler | TypeAndHandler[]) => EventHandlers;\n}\n\n/**\n * The type of handler for event bus events. This function may return a Promise in which case, the bus will await\n * the result and the loop will block until the Promise is resolved.\n */\nexport type EventBusHandler<T extends BusEvent = BusEvent> = (event: T, instance: ChatInstance) => unknown;\n\n/**\n * The type of the object that is passed to the event bus functions (e.g. \"on\") when registering a handler.\n */\nexport interface TypeAndHandler {\n /**\n * The type of event this handler is for.\n */\n type: BusEventType;\n\n /**\n * The handler for events of this type.\n */\n handler: EventBusHandler;\n}\n\n/**\n * This is a subset of the public interface that provides methods that can be used by the user to control the widget\n * and have it perform certain actions.\n */\nexport interface ChatActions {\n /**\n * This function can be called when another component wishes this component to gain focus. It is up to the\n * component to decide where focus belongs. This may return true or false to indicate if a suitable focus location\n * was found.\n */\n requestFocus: () => boolean | void;\n\n /**\n * Sends the given message to the assistant on the remote server. This will result in a \"pre:send\" and \"send\" event\n * being fired on the event bus. The returned promise will resolve once a response has received and processed and\n * both the \"pre:receive\" and \"receive\" events have fired. It will reject when too many errors have occurred and\n * the system gives up retrying.\n *\n * @param message The message to send.\n * @param options Options for the message sent.\n */\n send: (message: MessageRequest | string, options?: SendOptions) => Promise<void>;\n\n /**\n * Updates the current locale. This will override the default values of the language pack. You can use\n * {@link getLocale} to identify the current locale if you need to make an update based on the user's locale.\n */\n updateLocale: (newLocale: string) => Promise<void>;\n\n /**\n * Updates the current language pack using the values from the provided language pack. This language pack does\n * not need to be complete; only the strings contained in it will be updated. Any strings that are missing will be\n * ignored and the current values will remain unchanged. You can use {@link getLocale} to identify the current\n * locale if you need to make an update based on the user's locale.\n */\n updateLanguagePack: (newPack: DeepPartial<LanguagePack>) => void;\n\n /**\n * Returns the current locale in use by the widget. This may not match the locale that was provided in the\n * original public configuration if that value was invalid or if the locale has been changed since then.\n *\n * @returns A string containing the language and possibly a region code. Example values include: 'en' and 'en-us'.\n */\n getLocale: () => string;\n\n /**\n * Clears the current state and removes all references to the current session. Does not start a new session unless a\n * new message is subsequently sent.\n */\n destroySession: () => Promise<void>;\n\n /**\n * If the messageID provided is the id of a response then save the data provided within history.user_defined so it can\n * be used to repopulate a message upon reload/page change with session history.\n */\n updateHistoryUserDefined: (messageID: string, data: unknown) => Promise<void>;\n\n /**\n * This updates the map that can be used to override the values for CSS variables in the application. Each key of the\n * map is the name of a variable (without the \"--cds-chat-\" prefix) and the value is whatever the value of\n * the variable should be set at. This function may only be called if publicConfig.__ibm__.allowPrivateMethods has\n * been set. The values in the provided map will be merged with any variables that may already be defined in\n * the public config which allows this function to update only the specific variables desired.\n *\n * @param publicVars A map of CSS variables. Each key of the map is the name of a variable (without the\n * \"--cds-chat-\" prefix) and the value is whatever the value of the variable should be set at.\n */\n updateCSSVariables: (publicVars: Record<string, string>) => void;\n\n /**\n * Fire the view:pre:change and view:change events and change the view of the web chat. If a {@link ViewType} is\n * provided then that view will become visible and the rest will be hidden. If a {@link ViewState} is provided that\n * includes all of the views then all of the views will be changed accordingly. If a partial {@link ViewState} is\n * provided then only the views provided will be changed.\n */\n changeView: (newView: ViewType | ViewState) => Promise<void>;\n\n /**\n * Returns elements that Deb can write content to. This object is indirectly exposed to Deb using a proxy returned\n * from {@link createWriteableElementsProxy}.\n */\n writeableElements: WriteableElements;\n\n /**\n * The elements of web chat that need to be exposed for customers to manipulate. Unlike writeable elements, these\n * elements have existing content\n */\n elements: InstanceElements;\n\n /**\n * Methods provided to developers to interact with the tour feature.\n */\n tours: ChatInstanceTours;\n\n /**\n * Allow being able to set the input field to be invisible on assistant facing (not agent) views. Helpful for when\n * you want to force input into a button, etc.\n */\n updateAssistantInputFieldVisibility: (isVisible: boolean) => void;\n\n /**\n * Changes the state of web chat to allow or disallow input. This includes the input field as well as inputs like\n * buttons and dropdowns.\n */\n updateInputIsDisabled: (isDisabled: boolean) => void;\n\n /**\n * Updates the visibility of the custom unread indicator that appears on the launcher. This indicator appears as a\n * small empty circle on the launcher. If there are any unread messages from a human agent, this indicator will be\n * shown with a number regardless of the custom setting of this flag.\n */\n updateBotUnreadIndicatorVisibility: (isVisible: boolean) => void;\n\n /**\n * Updates the currently active homeScreenConfig. Currently only used in tooling to show live updates when editing web\n * chat configuration.\n */\n updateHomeScreenConfig: (homeScreenConfig: HomeScreenConfig) => void;\n\n /**\n * Scrolls to the (original) message with the given ID. Since there may be multiple message items in a given\n * message, this will scroll the first message to the top of the message window.\n *\n * @param messageID The (original) message ID to scroll to.\n * @param animate Whether or not the scroll should be animated. Defaults to true.\n */\n scrollToMessage: (messageID: string, animate?: boolean) => void;\n\n /**\n * Set the greeting message text for the launcher. Optionally specify which launcher, desktop or mobile, that the\n * greeting message is being set for.\n */\n updateLauncherGreetingMessage: (\n greetingMessage: string,\n launcherType?: LauncherType.DESKTOP | LauncherType.MOBILE,\n ) => void;\n\n /**\n * Control when the greeting message should appear. The default time is 0s which will cause it to appear immediately.\n * Optionally specify which launcher, desktop or mobile, that the time should be set for.\n */\n showLauncherGreetingMessage: (time: number, launcherType?: LauncherType.DESKTOP | LauncherType.MOBILE) => void;\n\n /**\n * An instance of the custom panel with methods to manipulate the behavior of the custom panels.\n */\n customPanels: CustomPanels;\n\n /**\n * Updates the custom menu options.\n */\n updateCustomMenuOptions: (options: CustomMenuOption[]) => void;\n\n /**\n * Restarts the conversation with the assistant. This does not make any changes to a conversation with a human agent.\n * This will clear all the current assistant messages from the main bot view and cancel any outstanding\n * messages. This will also clear the current assistant session which will force a new session to start on the\n * next message.\n */\n restartConversation: () => Promise<void>;\n\n /**\n * Initiates a {@link Chat#doAutoScroll} on the currently visible chat panel.\n */\n doAutoScroll: () => void;\n\n /**\n * Ends the conversation with a human agent. This does not request confirmation from the user first. If the user\n * is not connected or connecting to a human agent, this function has no effect. You can determine if the user is\n * connected or connecting by calling {@link ChatInstance.getState}. Note that this function\n * returns a Promise that only resolves when the conversation has ended. This includes after the\n * {@link BusEventType.AGENT_PRE_END_CHAT} and {@link BusEventType.AGENT_END_CHAT} events have been fired and\n * resolved.\n */\n agentEndConversation: () => Promise<void>;\n\n /**\n * Either increases or decreases the internal counter that indicates whether the \"bot is typing\" indicator is\n * shown. If the count is greater than zero, then the indicator is shown. Values of \"increase\" or \"decrease\" will\n * increase or decrease the value. Any other value with log an error. Currently, this is the same as the loading\n * indicator.\n */\n updateIsTypingCounter: (direction: IncreaseOrDecrease) => void;\n\n /**\n * Either increases or decreases the internal counter that indicates whether the \"bot is loading\" indicator is\n * shown. If the count is greater than zero, then the indicator is shown. Values of \"increase\" or \"decrease\" will\n * increase or decrease the value. Any other value with log an error. Currently, this is the same as the typing\n * indicator.\n */\n updateIsLoadingCounter: (direction: string) => void;\n\n /**\n * Updates the title of the bot panel. This value defaults to the bot name with the AI theme turned off and defaults\n * to nothing when the AI theme is turned on.\n */\n updateMainHeaderTitle: (title?: null | string) => void;\n\n /**\n * Add a system level notification to the list of system notifications.\n * @deprecated\n */\n addNotification: (notification: NotificationMessage) => void;\n\n /**\n * The state of notifications in the chat.\n */\n notifications: ChatInstanceNotifications;\n\n /**\n * Actions that are related to a service desk integration.\n */\n serviceDesk: ChatInstanceServiceDeskActions;\n}\n\nexport type IncreaseOrDecrease = 'increase' | 'decrease';\n\n/**\n * This interface represents the options for when a MessageRequest is sent to the server with the send method.\n */\nexport interface SendOptions {\n /**\n * If you want to send a message to the API, but NOT have it show up in the UI, set this to true. The \"pre:send\"\n * and \"send\" events will still be fired but the message will not be added to the local message list displayed in\n * the UI. Note that the response message will still be added.\n */\n silent?: boolean;\n\n /**\n * Indicates if the forced pause displayed with the response should be skipped. By default, web chat will insert a\n * pause to produce a delay of 2 seconds after the response has been received. This is to give the bot a more\n * natural, conversational feeling to it.\n */\n skipPause?: boolean;\n}\n\n/**\n * An object of elements we expose to developers to write to. Currently, this only encompasses above the welcome node,\n * but may grow to include portions of home page, etc.\n */\nexport type WriteableElements = Record<WriteableElementName, HTMLElement>;\n\nexport enum WriteableElementName {\n /**\n * An element that appears in the AI theme only and is shown beneath the title and description in the AI tooltip\n * content.\n */\n AI_TOOLTIP_AFTER_DESCRIPTION_ELEMENT = 'aiTooltipAfterDescriptionElement',\n\n /**\n * An element that appears in the main message body directly above the welcome node.\n */\n WELCOME_NODE_BEFORE_ELEMENT = 'welcomeNodeBeforeElement',\n\n /**\n * An element that appears in the header on a new line. Only visible while talking to the bot.\n */\n HEADER_BOTTOM_ELEMENT = 'headerBottomElement',\n\n /**\n * An element that appears after the messages area and before the input area.\n */\n BEFORE_INPUT_ELEMENT = 'beforeInputElement',\n\n /**\n * An element that appears above the input field on the home screen.\n */\n HOME_SCREEN_BEFORE_INPUT_ELEMENT = 'homeScreenBeforeInputElement',\n\n /**\n * An element that appears on the home screen after the conversation starters.\n */\n HOME_SCREEN_AFTER_STARTERS_ELEMENT = 'homeScreenAfterStartersElement',\n\n /**\n * An element that appears on the home screen above the welcome message and conversation starters.\n */\n HOME_SCREEN_HEADER_BOTTOM_ELEMENT = 'homeScreenHeaderBottomElement',\n}\n\n/**\n * The interface represents the elements that web chat provides access to.\n */\nexport interface InstanceElements {\n /**\n * Returns the element that represents the main window.\n */\n getMainWindow: () => HasAddRemoveClassName;\n\n /**\n * Returns the element that represents the input field (text area) on the main message area.\n */\n getMessageInput: () => InstanceInputElement;\n\n /**\n * Returns the element that represents the input field (text area) on the home screen.\n */\n getHomeScreenInput: () => InstanceInputElement;\n}\n\n/**\n * The different input fields (text areas) in the application.\n */\nexport enum InputFieldType {\n /**\n * The main input field on the message list.\n */\n MESSAGE = 'message',\n\n /**\n * The input field on the home screen.\n */\n HOME_SCREEN = 'homeScreen',\n}\n\n/**\n * Represents one of the input elements that web chat provides access to custom code.\n */\nexport interface InstanceInputElement {\n /**\n * The raw HTML element for the element.\n */\n getHTMLElement: () => HTMLTextAreaElement;\n\n /**\n * Sets the current text value inside the input.\n */\n setValue: (value: string) => void;\n\n /**\n * Enables or disables the handling of the enter key by the input field.\n */\n setEnableEnterKey: (isEnabled: boolean) => void;\n\n /**\n * Adds a listener that will fire whenever the value in the input field is changed. This fires immediately like an\n * \"input\" event and not only when focus is lost like a \"change\".\n */\n addChangeListener: (listener: ChangeFunction) => void;\n\n /**\n * Removes a change listener that was previously added.\n */\n removeChangeListener: (listener: ChangeFunction) => void;\n\n /**\n * Sets the callback listener that is called before input is sent. This is called before the input field is\n * cleared after that send occurs.\n *\n * @param onBeforeSend The callback to call before the input is sent. The return value of this function will be passed\n * to the subsequent \"pre:send\" and \"send\" events that get fired with the actual message request.\n */\n setOnBeforeSend: (onBeforeSend: () => unknown) => void;\n\n /**\n * Sets the callback to call to fetch a list of matching completions for entered text. This function is called\n * whenever the input in the input field is changed. This function may be asynchronous but it will be called again\n * if the user changes the input before the previous call is complete. In that case, the previous call is ignored.\n *\n * Also note that additional actions taken by the user (such as moving the cursor position) will cancel\n * completions resulting in any outstanding asynchronous calls being ignored.\n */\n setOnGetCompletions: (onGetCompletions: OnGetCompletions) => void;\n\n /**\n * Sets the callback that is called when a completion is selected from the completions popup.\n */\n setOnCompletionSelected: (onCompletionSelected: OnCompletionSelected) => void;\n}\n\n/**\n * Methods provided to developers to interact with the tour feature.\n */\nexport interface ChatInstanceTours {\n /**\n * Sends the given message to the backend with the skipTourCard option set to true. When a tour response is received,\n * this method automatically starts the tour and skips the tour card. If a response other than a tour is received,\n * then an error is logged.\n */\n startTour: (message: string) => void;\n\n /**\n * Clears all tour data, closes the tour, and switches to the launcher.\n */\n endTour: () => void;\n\n /**\n * Moves forward one step in the tour.\n */\n goToNextStep: () => void;\n\n /**\n * Looks for the provided stepId string within the tour step items. If a step with a matching step_id is found then\n * moves to that step within the tour.\n */\n goToStep: (stepId: string) => void;\n}\n\nexport interface ChatInstanceNotifications {\n /**\n * Add a system level notification to the list of system notifications.\n */\n addNotification: (notification: NotificationMessage) => void;\n\n /**\n * Remove a system level notification from the list of system notifications.\n */\n removeNotifications: (groupID: string) => void;\n\n /**\n * Remove all system level notifications from the list of system notifications.\n */\n removeAllNotifications: () => void;\n}\n\nexport type ChangeFunction = (text: string) => void;\n\n/**\n * Represents an item that can add or remove class names.\n */\nexport interface HasAddRemoveClassName {\n /**\n * Adds the given class name to the element.\n */\n addClassName(name: string): void;\n\n /**\n * Removes the given class name from the element.\n */\n removeClassName(name: string): void;\n}\n\nexport interface FileUploadCapabilities {\n /**\n * Indicates that file uploads may be performed by the user.\n */\n allowFileUploads: boolean;\n\n /**\n * If file uploads are allowed, this indicates if more than one file may be selected at a time. The default is false.\n */\n allowMultipleFileUploads: boolean;\n\n /**\n * If file uploads are allowed, this is the set a file types that are allowed. This is filled into the \"accept\"\n * field for the file input element.\n */\n allowedFileUploadTypes: string;\n}\n\nexport interface ChatInstanceServiceDeskActions {\n /**\n * Ends the conversation with a human agent. This does not request confirmation from the user first. If the user\n * is not connected or connecting to a human agent, this function has no effect. You can determine if the user is\n * connected or connecting by calling {@link ChatInstance.getState}. Note that this function\n * returns a Promise that only resolves when the conversation has ended. This includes after the\n * {@link BusEventType.AGENT_PRE_END_CHAT} and {@link BusEventType.AGENT_END_CHAT} events have been fired and\n * resolved.\n */\n endConversation: () => Promise<void>;\n\n /**\n * Sets the suspended state for an agent conversation. A conversation can be suspended or un-suspended only if the\n * user is currently connecting or connected to an agent. If a conversation is suspended, then messages from the user\n * will no longer be routed to the service desk and incoming messages from the service desk will not be displayed. In\n * addition, the current connection status with an agent will not be shown.\n */\n updateIsSuspended: (isSuspended: boolean) => Promise<void>;\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { FileStatusValue } from 'internal-packages/types/apiTypes';\nimport { type IncreaseOrDecrease, WriteableElementName } from 'internal-packages/types/ChatInstance';\nimport { CornersType } from 'internal-packages/types/PublicConfig';\n\nconst HEADER_ACCEPT = 'accept';\nconst HEADER_CONTENT_TYPE = 'content-type';\nconst HEADER_AUTHORIZATION = 'authorization';\n\n// The mime type for JSON.\nconst MIME_JSON = 'application/json';\n\n// The mime type for text streaming.\nconst MIME_STREAM = 'text/event-stream';\n\nconst MIME_JSON_STREAM = `${MIME_JSON}, ${MIME_STREAM}`;\n\n// Prefix used to distinguish console logs omitted from our code\nconst WA_CONSOLE_PREFIX = '[Chat]';\n\n// This is a header respected by the IBM stack for tracking requests as they move from service to service. By default,\n// Cerberus will add a transaction id x-request-id to the response which could be used for tracking. However,\n// if we set one here we can reference it when debugging and downstream services can search in their logs for this\n// value.\nconst API_DEBUGGING_HEADER_NAME = 'X-Global-Transaction-ID';\n\n// Header identifying requests are coming from a web chat embedded as an agent app. We use this to know we need to check\n// for an auth code bearer token (instead of JWT security, for instance).\nconst AGENT_APP_HEADER_NAME = 'x-watson-is-agent-app';\n\n// The right-to-left mark character string which mixes the direction of a string.\n// For more info on right-to-left mark: https://www.w3.org/TR/WCAG20-TECHS/H34.html\nconst RIGHT_TO_LEFT_MARK = String.fromCharCode(0x200f);\n\nconst ENGLISH_US_DATE_FORMAT = 'mm/dd/yyyy';\n\n// The timeout, in milliseconds, to wait for a response type to load content.\nconst RESPONSE_TYPE_TIMEOUT_MS = 10000;\n\n// These are custom panel ids.\nconst DEFAULT_CUSTOM_PANEL_ID = 'wac-default-panel';\n\n// The version of the integrations server API that web chat is using. Note, this version does not necessarily match\n// the version of the store API that is being used. The integrations server does a mapping from this version to the\n// store version. Integrations version \"2023-09-15\" corresponds to Store version \"2023-06-15\".\nconst INTEGRATIONS_VERSION = '2023-09-15';\n\nconst WINDOW_WARNING =\n 'The window related events and methods have been deprecated and will be disabled in the next' +\n ' major release of web chat. Please update your code to use the view change events and methods. See' +\n ' https://web-chat.global.assistant.watson.cloud.ibm.com/docs.html?to=api-events#windowviewmigration for more' +\n ' information.';\n\nconst CUSTOM_RESPONSE_WARNING =\n 'The customResponse event has been renamed to userDefinedResponse. The existing event will continue to function' +\n ' but is deprecated and will be removed in a future release.';\n\n// The piece of a region code that includes we're running in AWS.\nconst AWS_REGION_FRAGMENT = 'aws';\n\n// The piece of a region code that includes we're running WXO on IBM Cloud.\nconst WXO_CLOUD_REGION_FRAGMENT = 'wxo';\n\n// A noop function to do nothing in order to satisfy a conditional statement.\nconst NOOP = () => {};\n\n/**\n * This function serves as a placeholder in places where a functional value is required, but not expected to be\n * fired. In the event that it is, it will throw an error, letting you know it shouldn't be.\n */\nfunction THROW_ERROR() {\n throw Error('Not implemented.');\n}\n\n/**\n * The brand color types configurable for web chat.\n */\nenum BrandColorKind {\n PRIMARY = 'primary',\n ACCENT = 'accent',\n}\n\n// Max width for which we show a carousel.\nconst CAROUSEL_MAX_WIDTH = 455;\n\n// Max width we allow non-carousel citations to be full width. We are trying to avoid having skinny citations just\n// sitting alone on a row and being stacked so we allow them to grow full width until we get to a size where we can\n// show more than one on a line.\nconst FULL_WIDTH_CITATION_MAX_WIDTH = 580;\n\nconst TEST_CITATION_TEXT_SHOULD_EXPAND =\n 'Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text. Citation text 2 with a lot of text.';\n\n// When we auto-scroll to a message, we want to scroll a bit more than necessary because messages have a lot of\n// padding on the top that we want to cut off when scrolling. This is the extra amount we scroll by. There's 28px of\n// padding above the message and we want to cut that down to just 8 so we scroll an extra 20px (28 - 8).\nconst AUTO_SCROLL_EXTRA = 28 - 8;\n\nconst LIGHT_THEMES = ['white', 'g10'];\n\nlet isJest = false;\ntry {\n // \"process\" is undefined when not in a jest environment, but I don't know how to check its value without the code\n // throwing a \"not defined\" error.\n if (process?.env.JEST_WORKER_ID) {\n isJest = true;\n }\n} catch (error) {\n // Ignore\n}\n\nconst IS_JEST = isJest;\n\n// How much to throttle auto scrolling. When we are in test mode, we set this to zero.\nconst AUTO_SCROLL_THROTTLE_TIMEOUT: number = IS_JEST ? 0 : 100;\n\nexport {\n AUTO_SCROLL_THROTTLE_TIMEOUT,\n MIME_JSON,\n MIME_STREAM,\n MIME_JSON_STREAM,\n WA_CONSOLE_PREFIX,\n API_DEBUGGING_HEADER_NAME,\n AGENT_APP_HEADER_NAME,\n RIGHT_TO_LEFT_MARK,\n ENGLISH_US_DATE_FORMAT,\n RESPONSE_TYPE_TIMEOUT_MS,\n DEFAULT_CUSTOM_PANEL_ID,\n INTEGRATIONS_VERSION,\n NOOP,\n WriteableElementName,\n FileStatusValue,\n THROW_ERROR,\n WINDOW_WARNING,\n CUSTOM_RESPONSE_WARNING,\n BrandColorKind,\n HEADER_ACCEPT,\n HEADER_CONTENT_TYPE,\n HEADER_AUTHORIZATION,\n AWS_REGION_FRAGMENT,\n CornersType,\n IncreaseOrDecrease,\n CAROUSEL_MAX_WIDTH,\n FULL_WIDTH_CITATION_MAX_WIDTH,\n WXO_CLOUD_REGION_FRAGMENT,\n TEST_CITATION_TEXT_SHOULD_EXPAND,\n AUTO_SCROLL_EXTRA,\n LIGHT_THEMES,\n IS_JEST,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Miscellaneous utils for dealing with promises.\n */\n\n/**\n * This is an async function that will simply wait for the given amount of time.\n *\n * @param milliseconds The amount of time in milliseconds to wait.\n */\nasync function sleep(milliseconds: number) {\n await new Promise(resolve => {\n setTimeout(resolve, milliseconds);\n });\n}\n\n/**\n * This function returns a Promise that will be resolved if the provided Promise has resolved within the duration\n * specified. Otherwise the promise will be rejected.\n *\n * @param promise The Promise which will be resolved or timed out.\n * @param duration The duration of the timeout in milliseconds.\n * @param errorMessage An optional message to display.\n */\nfunction resolveOrTimeout<T>(promise: Promise<T>, duration: number, errorMessage?: string): Promise<T> {\n // Create a promise that rejects in <ms> milliseconds\n const timeout = new Promise<T>((resolve, reject) => {\n setTimeout(() => {\n const message = errorMessage || `The operation timed out after ${duration}ms`;\n reject(message);\n }, duration);\n });\n\n // Returns a race between the timeout and the original in promise\n return Promise.race([promise, timeout]);\n}\n\nexport { sleep, resolveOrTimeout };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Miscellaneous utilities that don't fit anywhere else.\n */\n\nimport { AppConfig } from 'internal-packages/shared/types/AppConfig';\nimport { CatastrophicErrorType, FileUpload } from 'internal-packages/shared/types/AppState';\nimport { OnErrorData, OnErrorType } from 'internal-packages/shared/types/OnErrorData';\nimport { ErrorInfo } from 'react';\n\nimport { FileStatusValue, WA_CONSOLE_PREFIX } from './constants';\nimport { resolveOrTimeout } from './lang/promiseUtils';\n\n/**\n * All the alphabetic characters. This is used to decide what characters to return in our hash function.\n */\nconst CHARACTERS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n/**\n * A global flag to indicate if we want to show debug messages in the browser console. This is generally set from\n * {@link PublicConfig.debug}.\n */\nlet enableDebugLog = false;\n\n/**\n * A global flag to indicate if we want to show stack trace debug messages in the browser console. This is generally set\n * from {@link PublicConfig.debugStackTraces}.\n */\nlet enableDebugStackTracesLog = false;\n\n/**\n * This is a no-op function that's for the purpose of verifying at build time that a given item matches a given\n * type. To use, pass the item as the \"item\" parameter and pass the type as the \"TItemType\" type parameter. Since\n * this is incurring a runtime call for what is really a build-time check, this function should be used sparingly.\n */\nfunction assertType<TItemType>(item: TItemType): TItemType {\n return item;\n}\n\n/**\n * A simple utility to send a message to the console log but only id debug logging is enabled.\n */\nfunction debugLog(message: string, ...args: any[]) {\n if (enableDebugLog) {\n console.log(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n }\n}\n\n/**\n * A simple utility to send a message to the console log but only if debug stack traces logging is enabled.\n */\nfunction debugStackTrace(message: string, ...args: any[]) {\n if (enableDebugStackTracesLog) {\n const stack = new Error(\n 'This is not an error; it is a stack trace used for debugging purposes. It is enabled by the \"debugStackTraces: true\" configuration option.',\n );\n debugLog(message, stack, ...args);\n } else {\n debugLog(message, ...args);\n }\n}\n\n/**\n * A simple utility to send an error message to the console log.\n */\nfunction consoleError(message: string, ...args: any[]) {\n console.error(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send an error message to the console log.\n */\nfunction consoleLog(message: string, ...args: any[]) {\n console.log(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send a message to the console log.\n */\nfunction consoleInfo(message: string, ...args: any[]) {\n console.info(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send a message to the console log.\n */\nfunction consoleDebug(message: string, ...args: any[]) {\n console.debug(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * A simple utility to send an warning message to the console log.\n */\nfunction consoleWarn(message: string, ...args: any[]) {\n console.warn(`${WA_CONSOLE_PREFIX} ${message}`, ...args);\n}\n\n/**\n * Sets a global flag to indicate if we want to show debug messages in the browser console. This is generally set from\n * {@link PublicConfig.debug}.\n */\nfunction setEnableDebugLog(debug: boolean) {\n enableDebugLog = debug;\n}\n\n/**\n * Sets a global flag to indicate if we want to show debug stack trace messages in the browser console. This is\n * generally set from {@link PublicConfig.debugStackTraces}.\n */\nfunction setEnableDebugStackTracesLog(debug: boolean) {\n enableDebugStackTracesLog = debug;\n}\n\n/**\n * Indicates if the global flag to indicate if we want to show debug messages in the browser console is enabled.\n */\nfunction isEnableDebugLog() {\n return enableDebugLog;\n}\n\n/**\n * Safely returns the text from the given fetch response or undefined if there is an error.\n */\nasync function safeFetchText(response: Response): Promise<string> {\n try {\n if (response) {\n return await response.text();\n }\n } catch (error) {\n consoleError('Error getting fetch text', error);\n }\n return undefined;\n}\n\n/**\n * Safely returns the text from the given fetch response or undefined if there is an error. This will also impose a\n * timeout on getting the text\n */\nasync function safeFetchTextWithTimeout(response: Response): Promise<string> {\n try {\n if (response) {\n return resolveOrTimeout(response.text(), 2000, 'Getting response text');\n }\n } catch (error) {\n consoleError('Error getting fetch text', error);\n }\n return undefined;\n}\n\n/**\n * Safely returns the json from the given fetch response or undefined if there is an error.\n */\nasync function safeFetchJSON(response: Response): Promise<any> {\n try {\n if (response) {\n return await response.json();\n }\n } catch (error) {\n consoleError('Error getting fetch json', error);\n }\n return undefined;\n}\n\n/**\n * Produces a hash of the given string using an implementation of djb2. This value may be negative. Note that this is\n * not a cryptographically secure hash and should not be used for security related items.\n *\n * @see http://www.cse.yorku.ca/~oz/hash.html\n */\nfunction djb2Hash(value: string): number {\n let index = value.length;\n let hash = 5381;\n\n while (index) {\n // eslint-disable-next-line no-bitwise\n hash = (hash * 33) ^ value.charCodeAt(--index);\n }\n\n return hash;\n}\n\n/**\n * Converts the given number in a sequence of alphabetic letters.\n */\nfunction toLetters(value: number): string {\n let result = '';\n\n while (value) {\n const charValue = value % CHARACTERS.length;\n const char = CHARACTERS.charAt(charValue);\n result += char;\n value = Math.floor(value / CHARACTERS.length);\n }\n\n return result;\n}\n\n/**\n * Produces a hash of the given string using an implementation of djb2 and converts it to alphabetic letters. Note that\n * this is not a cryptographically secure hash and should not be used for security related items.\n */\nfunction hashString(value: string): string {\n // Convert the given value into a string that's a hash.\n const letters = toLetters(Math.abs(djb2Hash(value)));\n\n // Convert any occurrences of \"ad\" (case-insensitive) into \"a_\". Apparently some ad blockers look for this\n // combination and can block classnames that have these characters in them.\n return letters.replace(/(a)(d)/gi, '$1_');\n}\n\n/**\n * Returns a {@link OnErrorData} that represents an error that occurred while rendering a component.\n */\nfunction createDidCatchErrorData(\n component: string,\n error: Error,\n errorInfo: ErrorInfo,\n isCatastrophicError?: boolean,\n): OnErrorData {\n return {\n errorType: OnErrorType.RENDER,\n message: `${component}.componentDidCatch`,\n otherData: {\n error,\n errorInfo,\n },\n catastrophicErrorType: isCatastrophicError ? CatastrophicErrorType.FAILED : null,\n };\n}\n\n/**\n * This function will calculate and return the necessary top padding percentage value that will help render a media\n * player with a responsive aspect ratio.\n */\nfunction getResponsiveElementPaddingValue(baseHeight = 180) {\n return `${100 / (320 / baseHeight)}%`;\n}\n\n/**\n * Indicates if the given file is valid for uploading. The file must still be in the edit step and it must not\n * contain an error.\n */\nfunction isValidForUpload(upload: FileUpload) {\n return upload.status === FileStatusValue.EDIT && !upload.isError;\n}\n\n/**\n * Calls the given onError function.\n */\nfunction callOnError(onError: (data: OnErrorData) => void, data: OnErrorData) {\n if (onError) {\n try {\n onError(data);\n } catch (error) {\n consoleError('Error calling onError', error);\n }\n }\n}\n\nfunction getBotName(useAITheme: boolean, config: AppConfig) {\n let botName;\n if (useAITheme) {\n botName = 'AI';\n } else {\n botName =\n config.public.__ibm__?.botNameOverride ||\n config.remote.initConfig.botName ||\n (config.asCarbonChat ? 'watsonx' : 'watsonx Assistant');\n }\n\n return botName;\n}\n\nexport {\n assertType,\n debugLog,\n consoleError,\n consoleInfo,\n consoleWarn,\n setEnableDebugLog,\n setEnableDebugStackTracesLog,\n safeFetchText,\n safeFetchJSON,\n hashString,\n toLetters,\n djb2Hash,\n createDidCatchErrorData,\n consoleDebug,\n consoleLog,\n isEnableDebugLog,\n debugStackTrace,\n getResponsiveElementPaddingValue,\n isValidForUpload,\n safeFetchTextWithTimeout,\n callOnError,\n getBotName,\n};\n","// Generated file. Do not edit\nexport var StatusCodes;\n(function (StatusCodes) {\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.1\n *\n * This interim response indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.\n */\n StatusCodes[StatusCodes[\"CONTINUE\"] = 100] = \"CONTINUE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.2.2\n *\n * This code is sent in response to an Upgrade request header by the client, and indicates the protocol the server is switching too.\n */\n StatusCodes[StatusCodes[\"SWITCHING_PROTOCOLS\"] = 101] = \"SWITCHING_PROTOCOLS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.1\n *\n * This code indicates that the server has received and is processing the request, but no response is available yet.\n */\n StatusCodes[StatusCodes[\"PROCESSING\"] = 102] = \"PROCESSING\";\n /**\n * Official Documentation @ https://www.rfc-editor.org/rfc/rfc8297#page-3\n *\n * This code indicates to the client that the server is likely to send a final response with the header fields included in the informational response.\n */\n StatusCodes[StatusCodes[\"EARLY_HINTS\"] = 103] = \"EARLY_HINTS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.1\n *\n * The request has succeeded. The meaning of a success varies depending on the HTTP method:\n * GET: The resource has been fetched and is transmitted in the message body.\n * HEAD: The entity headers are in the message body.\n * POST: The resource describing the result of the action is transmitted in the message body.\n * TRACE: The message body contains the request message as received by the server\n */\n StatusCodes[StatusCodes[\"OK\"] = 200] = \"OK\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.2\n *\n * The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request.\n */\n StatusCodes[StatusCodes[\"CREATED\"] = 201] = \"CREATED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.3\n *\n * The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing.\n */\n StatusCodes[StatusCodes[\"ACCEPTED\"] = 202] = \"ACCEPTED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.4\n *\n * This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response.\n */\n StatusCodes[StatusCodes[\"NON_AUTHORITATIVE_INFORMATION\"] = 203] = \"NON_AUTHORITATIVE_INFORMATION\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.5\n *\n * There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones.\n */\n StatusCodes[StatusCodes[\"NO_CONTENT\"] = 204] = \"NO_CONTENT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.3.6\n *\n * This response code is sent after accomplishing request to tell user agent reset document view which sent this request.\n */\n StatusCodes[StatusCodes[\"RESET_CONTENT\"] = 205] = \"RESET_CONTENT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.1\n *\n * This response code is used because of range header sent by the client to separate download into multiple streams.\n */\n StatusCodes[StatusCodes[\"PARTIAL_CONTENT\"] = 206] = \"PARTIAL_CONTENT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.2\n *\n * A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate.\n */\n StatusCodes[StatusCodes[\"MULTI_STATUS\"] = 207] = \"MULTI_STATUS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.1\n *\n * The request has more than one possible responses. User-agent or user should choose one of them. There is no standardized way to choose one of the responses.\n */\n StatusCodes[StatusCodes[\"MULTIPLE_CHOICES\"] = 300] = \"MULTIPLE_CHOICES\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.2\n *\n * This response code means that URI of requested resource has been changed. Probably, new URI would be given in the response.\n */\n StatusCodes[StatusCodes[\"MOVED_PERMANENTLY\"] = 301] = \"MOVED_PERMANENTLY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.3\n *\n * This response code means that URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.\n */\n StatusCodes[StatusCodes[\"MOVED_TEMPORARILY\"] = 302] = \"MOVED_TEMPORARILY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.4\n *\n * Server sent this response to directing client to get requested resource to another URI with an GET request.\n */\n StatusCodes[StatusCodes[\"SEE_OTHER\"] = 303] = \"SEE_OTHER\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.1\n *\n * This is used for caching purposes. It is telling to client that response has not been modified. So, client can continue to use same cached version of response.\n */\n StatusCodes[StatusCodes[\"NOT_MODIFIED\"] = 304] = \"NOT_MODIFIED\";\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.6\n *\n * Was defined in a previous version of the HTTP specification to indicate that a requested response must be accessed by a proxy. It has been deprecated due to security concerns regarding in-band configuration of a proxy.\n */\n StatusCodes[StatusCodes[\"USE_PROXY\"] = 305] = \"USE_PROXY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.4.7\n *\n * Server sent this response to directing client to get requested resource to another URI with same method that used prior request. This has the same semantic than the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n StatusCodes[StatusCodes[\"TEMPORARY_REDIRECT\"] = 307] = \"TEMPORARY_REDIRECT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7538#section-3\n *\n * This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.\n */\n StatusCodes[StatusCodes[\"PERMANENT_REDIRECT\"] = 308] = \"PERMANENT_REDIRECT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.1\n *\n * This response means that server could not understand the request due to invalid syntax.\n */\n StatusCodes[StatusCodes[\"BAD_REQUEST\"] = 400] = \"BAD_REQUEST\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.1\n *\n * Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response.\n */\n StatusCodes[StatusCodes[\"UNAUTHORIZED\"] = 401] = \"UNAUTHORIZED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.2\n *\n * This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems however this is not used currently.\n */\n StatusCodes[StatusCodes[\"PAYMENT_REQUIRED\"] = 402] = \"PAYMENT_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.3\n *\n * The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike 401, the client's identity is known to the server.\n */\n StatusCodes[StatusCodes[\"FORBIDDEN\"] = 403] = \"FORBIDDEN\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.4\n *\n * The server can not find requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 to hide the existence of a resource from an unauthorized client. This response code is probably the most famous one due to its frequent occurence on the web.\n */\n StatusCodes[StatusCodes[\"NOT_FOUND\"] = 404] = \"NOT_FOUND\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.5\n *\n * The request method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.\n */\n StatusCodes[StatusCodes[\"METHOD_NOT_ALLOWED\"] = 405] = \"METHOD_NOT_ALLOWED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.6\n *\n * This response is sent when the web server, after performing server-driven content negotiation, doesn't find any content following the criteria given by the user agent.\n */\n StatusCodes[StatusCodes[\"NOT_ACCEPTABLE\"] = 406] = \"NOT_ACCEPTABLE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7235#section-3.2\n *\n * This is similar to 401 but authentication is needed to be done by a proxy.\n */\n StatusCodes[StatusCodes[\"PROXY_AUTHENTICATION_REQUIRED\"] = 407] = \"PROXY_AUTHENTICATION_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.7\n *\n * This response is sent on an idle connection by some servers, even without any previous request by the client. It means that the server would like to shut down this unused connection. This response is used much more since some browsers, like Chrome, Firefox 27+, or IE9, use HTTP pre-connection mechanisms to speed up surfing. Also note that some servers merely shut down the connection without sending this message.\n */\n StatusCodes[StatusCodes[\"REQUEST_TIMEOUT\"] = 408] = \"REQUEST_TIMEOUT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.8\n *\n * This response is sent when a request conflicts with the current state of the server.\n */\n StatusCodes[StatusCodes[\"CONFLICT\"] = 409] = \"CONFLICT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.9\n *\n * This response would be sent when the requested content has been permenantly deleted from server, with no forwarding address. Clients are expected to remove their caches and links to the resource. The HTTP specification intends this status code to be used for \"limited-time, promotional services\". APIs should not feel compelled to indicate resources that have been deleted with this status code.\n */\n StatusCodes[StatusCodes[\"GONE\"] = 410] = \"GONE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.10\n *\n * The server rejected the request because the Content-Length header field is not defined and the server requires it.\n */\n StatusCodes[StatusCodes[\"LENGTH_REQUIRED\"] = 411] = \"LENGTH_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7232#section-4.2\n *\n * The client has indicated preconditions in its headers which the server does not meet.\n */\n StatusCodes[StatusCodes[\"PRECONDITION_FAILED\"] = 412] = \"PRECONDITION_FAILED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.11\n *\n * Request entity is larger than limits defined by server; the server might close the connection or return an Retry-After header field.\n */\n StatusCodes[StatusCodes[\"REQUEST_TOO_LONG\"] = 413] = \"REQUEST_TOO_LONG\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.12\n *\n * The URI requested by the client is longer than the server is willing to interpret.\n */\n StatusCodes[StatusCodes[\"REQUEST_URI_TOO_LONG\"] = 414] = \"REQUEST_URI_TOO_LONG\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.13\n *\n * The media format of the requested data is not supported by the server, so the server is rejecting the request.\n */\n StatusCodes[StatusCodes[\"UNSUPPORTED_MEDIA_TYPE\"] = 415] = \"UNSUPPORTED_MEDIA_TYPE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7233#section-4.4\n *\n * The range specified by the Range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target URI's data.\n */\n StatusCodes[StatusCodes[\"REQUESTED_RANGE_NOT_SATISFIABLE\"] = 416] = \"REQUESTED_RANGE_NOT_SATISFIABLE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.5.14\n *\n * This response code means the expectation indicated by the Expect request header field can't be met by the server.\n */\n StatusCodes[StatusCodes[\"EXPECTATION_FAILED\"] = 417] = \"EXPECTATION_FAILED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2324#section-2.3.2\n *\n * Any attempt to brew coffee with a teapot should result in the error code \"418 I'm a teapot\". The resulting entity body MAY be short and stout.\n */\n StatusCodes[StatusCodes[\"IM_A_TEAPOT\"] = 418] = \"IM_A_TEAPOT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The 507 (Insufficient Storage) status code means the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. This condition is considered to be temporary. If the request which received this status code was the result of a user action, the request MUST NOT be repeated until it is requested by a separate user action.\n */\n StatusCodes[StatusCodes[\"INSUFFICIENT_SPACE_ON_RESOURCE\"] = 419] = \"INSUFFICIENT_SPACE_ON_RESOURCE\";\n /**\n * @deprecated\n * Official Documentation @ https://tools.ietf.org/rfcdiff?difftype=--hwdiff&url2=draft-ietf-webdav-protocol-06.txt\n *\n * A deprecated response used by the Spring Framework when a method has failed.\n */\n StatusCodes[StatusCodes[\"METHOD_FAILURE\"] = 420] = \"METHOD_FAILURE\";\n /**\n * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7540#section-9.1.2\n *\n * Defined in the specification of HTTP/2 to indicate that a server is not able to produce a response for the combination of scheme and authority that are included in the request URI.\n */\n StatusCodes[StatusCodes[\"MISDIRECTED_REQUEST\"] = 421] = \"MISDIRECTED_REQUEST\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.3\n *\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n StatusCodes[StatusCodes[\"UNPROCESSABLE_ENTITY\"] = 422] = \"UNPROCESSABLE_ENTITY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.4\n *\n * The resource that is being accessed is locked.\n */\n StatusCodes[StatusCodes[\"LOCKED\"] = 423] = \"LOCKED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.5\n *\n * The request failed due to failure of a previous request.\n */\n StatusCodes[StatusCodes[\"FAILED_DEPENDENCY\"] = 424] = \"FAILED_DEPENDENCY\";\n /**\n * Official Documentation @ https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.15\n *\n * The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.\n */\n StatusCodes[StatusCodes[\"UPGRADE_REQUIRED\"] = 426] = \"UPGRADE_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-3\n *\n * The origin server requires the request to be conditional. Intended to prevent the 'lost update' problem, where a client GETs a resource's state, modifies it, and PUTs it back to the server, when meanwhile a third party has modified the state on the server, leading to a conflict.\n */\n StatusCodes[StatusCodes[\"PRECONDITION_REQUIRED\"] = 428] = \"PRECONDITION_REQUIRED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-4\n *\n * The user has sent too many requests in a given amount of time (\"rate limiting\").\n */\n StatusCodes[StatusCodes[\"TOO_MANY_REQUESTS\"] = 429] = \"TOO_MANY_REQUESTS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-5\n *\n * The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.\n */\n StatusCodes[StatusCodes[\"REQUEST_HEADER_FIELDS_TOO_LARGE\"] = 431] = \"REQUEST_HEADER_FIELDS_TOO_LARGE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7725\n *\n * The user-agent requested a resource that cannot legally be provided, such as a web page censored by a government.\n */\n StatusCodes[StatusCodes[\"UNAVAILABLE_FOR_LEGAL_REASONS\"] = 451] = \"UNAVAILABLE_FOR_LEGAL_REASONS\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.1\n *\n * The server encountered an unexpected condition that prevented it from fulfilling the request.\n */\n StatusCodes[StatusCodes[\"INTERNAL_SERVER_ERROR\"] = 500] = \"INTERNAL_SERVER_ERROR\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.2\n *\n * The request method is not supported by the server and cannot be handled. The only methods that servers are required to support (and therefore that must not return this code) are GET and HEAD.\n */\n StatusCodes[StatusCodes[\"NOT_IMPLEMENTED\"] = 501] = \"NOT_IMPLEMENTED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.3\n *\n * This error response means that the server, while working as a gateway to get a response needed to handle the request, got an invalid response.\n */\n StatusCodes[StatusCodes[\"BAD_GATEWAY\"] = 502] = \"BAD_GATEWAY\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.4\n *\n * The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. Note that together with this response, a user-friendly page explaining the problem should be sent. This responses should be used for temporary conditions and the Retry-After: HTTP header should, if possible, contain the estimated time before the recovery of the service. The webmaster must also take care about the caching-related headers that are sent along with this response, as these temporary condition responses should usually not be cached.\n */\n StatusCodes[StatusCodes[\"SERVICE_UNAVAILABLE\"] = 503] = \"SERVICE_UNAVAILABLE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.5\n *\n * This error response is given when the server is acting as a gateway and cannot get a response in time.\n */\n StatusCodes[StatusCodes[\"GATEWAY_TIMEOUT\"] = 504] = \"GATEWAY_TIMEOUT\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc7231#section-6.6.6\n *\n * The HTTP version used in the request is not supported by the server.\n */\n StatusCodes[StatusCodes[\"HTTP_VERSION_NOT_SUPPORTED\"] = 505] = \"HTTP_VERSION_NOT_SUPPORTED\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc2518#section-10.6\n *\n * The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process.\n */\n StatusCodes[StatusCodes[\"INSUFFICIENT_STORAGE\"] = 507] = \"INSUFFICIENT_STORAGE\";\n /**\n * Official Documentation @ https://tools.ietf.org/html/rfc6585#section-6\n *\n * The 511 status code indicates that the client needs to authenticate to gain network access.\n */\n StatusCodes[StatusCodes[\"NETWORK_AUTHENTICATION_REQUIRED\"] = 511] = \"NETWORK_AUTHENTICATION_REQUIRED\";\n})(StatusCodes || (StatusCodes = {}));\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { ChatInstanceMessaging, CustomSendMessageOptions } from 'internal-packages/types/messaging';\nimport { MessageRequest } from 'submodules/wa-fd-types-public/wa-types-chat';\nimport { HistoryItem } from 'submodules/wa-fd-types-public/wa-types-chat-extensions';\n\ndeclare module 'internal-packages/types/ChatInstance' {\n export interface ChatActions {\n /**\n * Messaging actions for a chat instance.\n */\n messaging: ChatInstanceMessaging;\n }\n}\n\ndeclare module 'internal-packages/types/PublicConfig' {\n export interface PublicConfig {\n /**\n * In a cloud private deployment (CPD) the customer may have an instance of Orchestrate deployed as well as an\n * instance of Assistant. In order for the Orchestrate form code within web chat to connect with its deployment we\n * need to pass the form code a url value for where it's deployment is located. Web chat will get this url value\n * from tooling who is both setting it within the web chat previews, and specifying it on web chat's embed tab.\n * Tooling is getting this value from an environment variable that is set by Assistant the first time tooling is\n * opened from Orchestrate. If Assistant is opened directly, not through Orchestrate, then we will not have a value\n * for this url and will not be able to create a form. This is a known issue that effects tooling functionality as\n * well.\n */\n orchestratePrivateHostURL?: string;\n\n /**\n * Configuration items specific to the functionality for watsonx Orchestrate.\n */\n wxo?: WXOConfig;\n }\n\n export interface PublicConfigMessaging {\n /**\n * A callback for web chat to use to send messages to the assistant. When this is provided, this will be used as\n * an alternative for its built-in message service. Note that this is not used for human agent communication\n * (except for the event messages to update history).\n *\n * Web chat will queue up any additional user messages until the Promise from a previous call to customSendMessage\n * has resolved. This does not include event messages. If the Promise rejects, an error indicator will be\n * displayed next to the user's message.\n *\n * If the request takes longer than PublicConfigMessaging.messageTimeoutSecs than the AbortSignal will be sent.\n */\n customSendMessage?: (\n request: MessageRequest,\n requestOptions: CustomSendMessageOptions,\n instance: ChatInstance,\n ) => Promise<void> | void;\n\n /**\n * This is a callback function that is used by web chat to retrieve history data for populating the web chat. If\n * this function is defined, it will be used instead of any other mechanism for fetching history.\n */\n customLoadHistory?: (instance: ChatInstance) => Promise<HistoryItem[]>;\n }\n}\n\nexport interface WXOConfig {\n /**\n * Returns a list of all the assistants that a user may communicate with.\n *\n * @deprecated\n */\n getAssistantList?: () => Promise<WXOAssistantOption[]>;\n\n /**\n * Returns a list of all the mentions that a user may communicate with.\n */\n getMentionList?: () => Promise<WXOMentionOption[]>;\n}\n\nexport interface WXOAssistantOption {\n /**\n * The name of the assistant (with no \"@\" in it).\n */\n assistantName: string;\n\n /**\n * A unique identifier of the assistant.\n */\n assistantID: string;\n}\n\nexport enum WXOMentionType {\n APP = 'app',\n ASSISTANT = 'assistant',\n}\n\nexport interface WXOMentionOption {\n /**\n * The id of the mention option.\n */\n id: string;\n\n /**\n * The name of the mention option (with no \"@\" in it).\n */\n name: string;\n\n /**\n * The categorical type of the mention option.\n */\n type: WXOMentionType;\n}\n\n// A completion option of either a mention option or assistant option for backwards compatibility.\nexport type WXOCompletionOption = WXOMentionOption | WXOAssistantOption;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { LanguagePack } from 'internal-packages/types/apiTypes';\nimport { HomeScreenConfig } from 'internal-packages/types/HomeScreenConfig';\nimport { LauncherExtendedConfig, PublicConfig } from 'internal-packages/types/PublicConfig';\nimport { HistoryNote } from 'submodules/wa-fd-types-public/history-types';\nimport { DeepPartial } from 'ts-essentials';\n\nimport type { UICustomizationEventType } from './eventBusTypes';\nimport { Fetch } from './Fetch';\nimport { RemoteInitConfig, RemoteMainConfig } from './RemoteConfig';\n\nexport interface IBMConfig {\n /**\n * Allow individual features to be enabled by feature name.\n */\n enableFeatures?: Record<string, boolean>;\n\n /**\n * The version of fetch for web to use. This allows for a mock fetch to be installed.\n */\n fetch?: Fetch;\n\n /**\n * Pass in a title that will override botName in config.remote. This is so we can give Purina a name until naming\n * your bot is available in the tooling.\n */\n botNameOverride?: string;\n\n /**\n * Pass in an image url that will override botAvatarURL in config.remote. This is so we can give customers an avatar\n * until adding an avatar is available in the tooling.\n */\n botAvatarURLOverride?: string;\n\n /**\n * The full URL to use to send messages to watsonx Assistant. If an integration ID is required, it will need to be\n * included in this URL.\n */\n customMessageURL?: string;\n\n /**\n * The full URL to use to load the initial config information for the chat widget. This is used when the widget\n * is initially loaded on a page and before it is opened. If an integration ID is required, it will need to be\n * included in this URL.\n */\n customInitConfigURL?: string;\n\n /**\n * The full URL to use to load config information for the chat widget. This is used when the widget is opened and\n * additional config information beyond the init config is needed. If an integration ID is required, it will need\n * to be included in this URL.\n */\n customConfigURL?: string;\n\n /**\n * The prefix for the URL to use to load history information for the chat widget. If an integration ID is required,\n * it will need to be included in this URL. The session ID will be appended to this URL when the history is requested.\n */\n customHistoryPrefix?: string;\n\n /**\n * Additional headers to include on message calls to the assistant.\n */\n messageHeaders?: Record<string, string>;\n\n /**\n * This is a callback function that is used by web chat to retrieve history data for populating the web chat. If\n * this function is defined, it will be used instead of any other mechanism for fetching history.\n *\n * @see PublicConfigMessaging.customLoadHistory\n * @deprecated\n */\n customLoadHistory?: (\n sessionID: string,\n regionHostname: string,\n publicConfig: PublicConfig,\n ) => Promise<{ notes: HistoryNote[] }>;\n\n /**\n * The version of the chat widget to use. This value may specify \"latest\" or it may specify a partial version such\n * as \"1.5\" (which would cover anything that is \"1.5.x\". If no matching version is found, an error will be logged\n * and the latest version will be used.\n *\n * @see PublicConfig.clientVersion for more information.\n * @deprecated\n */\n versionToUse?: string;\n\n /**\n * For web chats that are used in tooling this indicates where in tooling it is being used.\n */\n toolingType?: ToolingType;\n\n /**\n * Indicates if web chat should be put into a readonly mode. This means that the input field will be hidden and no\n * buttons or other interactive elements that may appear in messages will be interactive. This will also disable\n * the home screen as well as suggestions.\n */\n isReadonly?: boolean;\n\n /**\n * Indicates if the widget should use the mock service desk if one is not already defined by the remote config.\n */\n allowMockServiceDesk?: boolean;\n\n /**\n * Add a bunch of noisy amplitude track object console.log messages!\n */\n logTrackObjects?: boolean;\n\n /**\n * Makes some private IBM internal methods available on the external interface. Currently, these are mostly used for\n * live theming in the tooling.\n */\n allowPrivateMethods?: boolean;\n\n /**\n * Indicates if Amplitude tracking should be enabled.\n */\n isTrackingEnabled?: boolean;\n\n /**\n * An object with strings in the format of the .json files in languages. See languages/README.md for more details.\n * This setting will replace all of the strings normally provided by default based on your options.locale. It must\n * contain a full set of strings since this is a replacement and not a merge. This value may get copied into the\n * current application state where it can be updated after the application has started.\n */\n languagePack?: LanguagePack;\n\n /**\n * This is a map that can be used to override the values for CSS variables in the application. Each key of the map\n * is the name of a variable (without the \"--cds-chat-\" prefix) and the value is whatever the value of\n * the variable should be set at. There are two similar maps located in the remote and public config that\n * perform the same function. Any individual value present in the public config will override the same value if it\n * is present in the remote config. Keys in the remote config with an empty string value are ignored.\n */\n cssVariables?: Record<string, string>;\n\n /**\n * Locale to use for UI strings and date string formatting. See languages/README.md for available locales. If not\n * provided, this will be auto-detected by browser preference. Defaults to English US (en) if not provided or\n * detected language is not an accepted language. This value may get copied into the current application state\n * where it can be updated after the application has started.\n */\n locale?: string;\n\n /**\n * Home screen configuration.\n */\n homeScreenConfig?: HomeScreenConfig;\n\n /**\n * Indicates if the welcome node should be skipped when the web chat is hydrating.\n *\n * @deprecated Use {@link PublicConfigMessaging.skipWelcome}.\n */\n skipWelcome?: boolean;\n\n /**\n * Skips the loading of the remote init and main configs from the server. An empty config will be used instead.\n *\n * @deprecated Use {@link PublicConfigMessaging.skipConfig}.\n */\n skipConfig?: boolean;\n\n /**\n * Provides a mechanism for overriding the init config that is received from the server. This property should not\n * be made public outside our development team.\n *\n * @deprecated Use {@link ServersConfig.initConfig}.\n */\n overrideRemoteInitConfig?: DeepPartial<RemoteInitConfig>;\n\n /**\n * Provides a mechanism for overriding the main config that is received from the server. This property should not\n * be made public outside our development team.\n *\n * @deprecated Use {@link ServersConfig.mainConfig}.\n */\n overrideRemoteMainConfig?: DeepPartial<RemoteMainConfig>;\n\n /**\n * An array of the UI customization events that should be enabled and will be fired.\n */\n enableUICustomEvents?: UICustomizationEventType[];\n\n /**\n * Disables the scrolling behavior that occurs when web chat is opened and session history is loaded.\n */\n disableInitialScroll?: boolean;\n\n /**\n * Determines if the minimize button should render an x icon (x) instead of the subtract icon (-).\n *\n * @deprecated Use {@link PublicConfig.headerConfig}.\n */\n useCloseIcon?: boolean;\n\n /**\n * This tells web chat how to handle CTA cards.\n */\n connectToAgentBehavior?: ConnectToAgentBehaviorType;\n\n /**\n * Used to override the IS_MOBILE flag in order to render the extended launcher in desktop.\n */\n renderExtendedLauncher?: boolean;\n\n /**\n * The config object that controls the launcher extended animations.\n */\n launcherExtendedConfig?: LauncherExtendedConfig;\n\n /**\n * This flag is used to show a preview of the launcher within tooling. If desktop is set then the\n * launcherDesktopContainer will render and if mobile is set then the launcherMobileContainer will render. Both\n * versions will render without their complex initial animations or subtle subsequent page load animations, instead\n * they will just appear so tanya can see what her title string will look like within the launcher. The launchers will\n * also be disabled when this property is enabled.\n */\n launcherToolingPreview?: LauncherToolingPreviewType.DESKTOP | LauncherToolingPreviewType.MOBILE;\n\n /**\n * This flag is used to disable web chat's rounded corners. Web chat exists in places within tooling as a preview\n * which depend on web chat having sharp corners, so this flag exists to let tooling devs temporarily resolve visual\n * issues.\n */\n disableRoundCorners?: boolean;\n\n /**\n * If set, this will export the instance of web chat as a window property using the value of this property.\n */\n exportInstance?: string;\n\n /**\n * Disables the message service so that it does not send messages to the assistant.\n */\n disableMessageService?: boolean;\n\n /**\n * Changes the timeout used by the message service when making message calls to watsonx Assistant. The timeout is\n * in seconds. The default is 40 seconds.\n */\n messageTimeoutSecs?: number;\n\n /**\n * Changes web chat to use shadow dom mode. This will mean no #WACContainer.WACContainer or ids of any kind. It will\n * mean that any CSS for user_defined response types must be injected into the response and not the parent page.\n */\n useShadowRoot?: boolean;\n\n /**\n * Indicates if the entry script should load the exact version of web chat specified in clientVersion. By default, the\n * entry script will load that same version that it was built with but for named branches, we may want to use a\n * different version.\n */\n useExactVersion?: boolean;\n}\n\n/**\n * Web chat is used in a bunch of different places in tooling for different reasons. This enum is meant to represent\n * each of those and will help us identify and control the behavior in each of the different places.\n */\nexport enum ToolingType {\n /**\n * This represents the web chat previews that are displayed within the web chat integration settings pages.\n */\n WEB_CHAT_SETTINGS = 'web-chat-settings',\n\n /**\n * This the web chat that appears on the page where you get the preview link but it is not the actual preview link\n * itself. In the old IA this web chat is the preview link integration. In the new IA, this web chat is the draft\n * web chat integration.\n */\n ASSISTANT_PREVIEW = 'assistant-preview',\n\n /**\n * This is the web chat used by on the preview share link page.\n */\n PREVIEW_LINK = 'preview-link',\n\n /**\n * This is the web chat used for preview when authoring actions.\n */\n ACTIONS = 'actions',\n\n /**\n * This is the web chat used for preview of a search skill.\n */\n SEARCH = 'search',\n\n /**\n * This is the web chat used for displaying the conversation history from the logs on the analytics pages.\n */\n ANALYTICS = 'analytics',\n}\n\n/**\n * When the user gets a \"connect_to_agent\" response the normal behavior is to show a \"Connect to agent\" card.\n * However, this only works if a service desk has been configured. In some tooling places that use web chat there is\n * no service desk configuration. This enum represents the different ways the web chat can respond to a CTA.\n */\nexport enum ConnectToAgentBehaviorType {\n /**\n * This is the default behavior and it will cause an error message to be shown to the user when there is no\n * service desk configured. This error is targeted at the end user.\n */\n ERROR_MISSING = 'error',\n\n /**\n * This behavior is the same as the preview case except that it also displays a warning targeted for the authoring\n * user instead of the end user. This is to help her understand that she is missing some configuration.\n */\n WARN_MISSING = 'warning',\n\n /**\n * This indicates that the CTA card should be displayed in a disabled state if there is no service desk configured.\n */\n PREVIEW = 'preview',\n}\n\nexport enum LauncherToolingPreviewType {\n DESKTOP = 'desktop',\n MOBILE = 'mobile',\n}\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/* eslint-disable prefer-destructuring */\n// We don't want to do destructuring on process.env so webpack/rollup can do its replacements.\n\n// Webpack/rollup will replace any \"process.env.*\" values below that it recognizes at compile time with their corresponding\n// values at that time.\n\nconst VERSION = process.env.VERSION;\n\n// This is the hostname to bind to in the local development mode. This can be used if you want to make the server\n// accessible to external application that cannot directly access \"localhost\".\nconst LOCAL_BIND_HOST = process.env.LOCAL_BIND_HOST;\n\n// PRODUCTION ENV VARIABLES\n// These env variables are used in production (as well as development)\n\n// CDN location of JS. Usually we set this to localhost:9346 while developing. In preview link we use the value. In\n// Loader we infer from set region.\nconst WWX_CDN_ENDPOINT = process.env.WWX_CDN_ENDPOINT;\n\n// Amplitude API Key for environment.\n// Defaulted to test API key.\nconst AMPLITUDE_API_KEY = process.env.AMPLITUDE_API_KEY;\n\n// DEVELOPMENT ENV VARIABLES for new npm run dev:new\n// These env variables are used in development and should not be set in production.\n\n// Source maps used during local development.\nconst SOURCE_MAPS_TYPE = process.env.SOURCE_MAPS_TYPE;\n\n// DEVELOPMENT ENV VARIABLES for legacy npm run dev.\n// These env variables are used in development and should not be set in production.\n\n// We use this in development to tell webpack dev server where to load external CSS and JS for example page.\nconst CHAT_RESOURCE_ENDPOINT = process.env.CHAT_RESOURCE_ENDPOINT;\n\n// We use this in development to tell webpack dev server with integration instance id to target instead of doing it in\n// the url. Region is also injected in Loader in watch mode.\nconst DEFAULT_INTEGRATION_INSTANCE_ID = process.env.DEFAULT_INTEGRATION_INSTANCE_ID;\nconst DEFAULT_INTEGRATION_SUBSCRIPTION_ID = process.env.DEFAULT_INTEGRATION_SUBSCRIPTION_ID;\nconst BOT_AVATAR_URL_OVERRIDE = process.env.BOT_AVATAR_URL_OVERRIDE;\nconst DEFAULT_REGION = process.env.DEFAULT_REGION;\n// eslint-disable-next-line prefer-destructuring\nconst DEFAULT_SERVICE_INSTANCE_ID = process.env.DEFAULT_SERVICE_INSTANCE_ID;\n\n// Specify where to fetch the integration config. This is normally left unset and is inferred from region.\nconst CUSTOM_CONFIG_URL = process.env.CUSTOM_CONFIG_URL;\nconst CUSTOM_INIT_CONFIG_URL = process.env.CUSTOM_INIT_CONFIG_URL;\n\n// Specify where to fetch history. This is normally left unset and is inferred from region.\nconst CUSTOM_HISTORY_PREFIX = process.env.CUSTOM_HISTORY_PREFIX;\n\n// Specify where to post messages. This is normally left unset and is inferred from region.\nconst CUSTOM_MESSAGE_URL = process.env.CUSTOM_MESSAGE_URL;\n\n// Specify where the wxo mfe is hosted. This is normally left unset and is inferred from WWX_CDN_ENDPOINT.\nconst WXO_ENDPOINT = process.env.WXO_ENDPOINT;\n\nconst ALLOW_MOCK_SERVICE_DESK = process.env.ALLOW_MOCK_SERVICE_DESK;\n\nconst LOG_TRACK_OBJECTS = process.env.LOG_TRACK_OBJECTS;\n\nconst IS_TRACKING_ENABLED = process.env.IS_TRACKING_ENABLED;\n\nconst NODE_ENV = process.env.NODE_ENV;\n\nexport {\n VERSION,\n LOCAL_BIND_HOST,\n WWX_CDN_ENDPOINT,\n AMPLITUDE_API_KEY,\n SOURCE_MAPS_TYPE,\n CHAT_RESOURCE_ENDPOINT,\n DEFAULT_INTEGRATION_INSTANCE_ID,\n DEFAULT_INTEGRATION_SUBSCRIPTION_ID,\n BOT_AVATAR_URL_OVERRIDE,\n DEFAULT_REGION,\n DEFAULT_SERVICE_INSTANCE_ID,\n CUSTOM_CONFIG_URL,\n CUSTOM_INIT_CONFIG_URL,\n CUSTOM_HISTORY_PREFIX,\n CUSTOM_MESSAGE_URL,\n WXO_ENDPOINT,\n ALLOW_MOCK_SERVICE_DESK,\n LOG_TRACK_OBJECTS,\n IS_TRACKING_ENABLED,\n NODE_ENV,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { resolveOrTimeout, sleep } from '../utils/lang/promiseUtils';\nimport { consoleError } from '../utils/miscUtils';\n\n/**\n * This type represents the function that is passed to the doWithRetry function that will execute the operation.\n *\n * @param attemptNumber The number of the attempt that is being performed. The first value starts at 1.\n */\ntype RetryFunction<T> = (attemptNumber: number) => Promise<T>;\n\n/**\n * The default set of response codes allowed by a fetch call.\n */\nconst DEFAULT_ALLOWED_RESPONSES: Set<number> = new Set([200]);\n\n/**\n * Performs the requested operation and executes a retry if it fails. The number of retries and the delays between\n * each attempt are governed by the given array of delay times. A call is considered a failure if it throws an error\n * (returns a rejected Promise).\n *\n * @param retryFunction The function to call for each attempt. If this function returns, if will be considered a success\n * and the returned value will be returned from this function. If the function throws an error (or rejects the\n * Promise), that will be considered a failure and the function will be retried.\n * @param delayTimes The delays in milliseconds to wait after every failed attempt. This function will make one\n * attempt more than what's in the array since there will be no delay after the final attempt if it fails.\n * @param operationTitle A label to use in the console output to describe this operation for debugging purposes.\n * @returns Returns the result from the last successful executor attempt.\n * @throws If all the attempts fail and the retries give up, this will throw the last error that was thrown by the\n * retry function.\n */\nasync function doWithRetry<T>(\n retryFunction: RetryFunction<T>,\n delayTimes: number[],\n operationTitle: string,\n): Promise<T> {\n let attemptNumber = 1;\n while (attemptNumber - 1 <= delayTimes.length) {\n try {\n // eslint-disable-next-line no-await-in-loop\n const result = await retryFunction(attemptNumber);\n return result;\n } catch (error) {\n if (attemptNumber - 1 === delayTimes.length) {\n // This was the last attempt, so just output the error message and continue.\n const message = `The operation \"${operationTitle}\" failed after ${attemptNumber} attempts and will not be retried.`;\n consoleError(message, error);\n throw error;\n } else {\n // The operation failed and a retry is available, so output an error and then sleep for the desired amount\n // of time.\n const delayTime = delayTimes[attemptNumber - 1];\n\n consoleError(\n `The operation \"${operationTitle}\" failed after ${attemptNumber} attempts will be retried in ${delayTime}ms.`,\n error,\n );\n\n // eslint-disable-next-line no-await-in-loop\n await sleep(delayTime);\n }\n }\n\n attemptNumber++;\n }\n\n // This condition shouldn't actually happen.\n throw new Error(`Unexpected retry state for operation \"${operationTitle}\".`);\n}\n\n/**\n * Executes a {@link doWithRetry} with the additional condition that it must complete within the given timeout or\n * the call will fail.\n *\n * @param retryFunction The function to call for each attempt. If this function returns, if will be considered a success\n * and the returned value will be returned from this function. If the function throws an error (or rejects the\n * Promise), that will be considered a failure and the function will be retried.\n * @param delayTimes The delays in milliseconds to wait after every failed attempt. This function will make one\n * attempt more than what's in the array since there will be no delay after the final attempt if it fails.\n * @param operationTitle A label to use in the console output to describe this operation for debugging purposes.\n * @param timeoutMs The amount of time in milliseconds to wait before a timeout occurs.\n * @returns Returns the result from the last successful executor attempt.\n * @throws If all the attempts fail and the retries give up or if the timeout occurs, this will throw an error.\n */\nasync function doWithRetryWithTimeout<T>(\n retryFunction: RetryFunction<T>,\n delayTimes: number[],\n operationTitle: string,\n timeoutMs: number,\n) {\n return resolveOrTimeout(doWithRetry(retryFunction, delayTimes, operationTitle), timeoutMs);\n}\n\n/**\n * A simple utility function that will wrap a call to fetch that will throw an error is the result is not one of the\n * expected status codes (200 by default).\n *\n * @param responsePromise The response promise to wait for and then check the status code.\n * @param allowedCodes The set of allowed response codes that will not result in an error being thrown.\n */\nasync function throwOnStatus(\n responsePromise: Promise<Response>,\n allowedCodes: Set<number> = DEFAULT_ALLOWED_RESPONSES,\n): Promise<Response> {\n const response = await responsePromise;\n if (!allowedCodes.has(response.status)) {\n throw new Error(`Status code error ${response.status}`);\n }\n\n return responsePromise;\n}\n\nexport { doWithRetry, doWithRetryWithTimeout, throwOnStatus };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Pre-populate global web chat config. This is stored on window to make sure that if there are multiple web chats\n * loaded on a page in the same or different ways, that they are forced to use the same version of web chat and use\n * unique namespaces. Note that these object are read and set by multiple versions of web chat.\n *\n * watsonAssistantChatSharedConfig should not contain breaking changes.\n */\nfunction ensureChatBrowserWindowConfigExists() {\n window.watsonAssistantChatSharedConfig = window.watsonAssistantChatSharedConfig || {};\n window.watsonAssistantChatSharedConfig.namespaces = window.watsonAssistantChatSharedConfig.namespaces || [];\n window.watsonAssistantChatSharedConfig.loadScriptPromises =\n window.watsonAssistantChatSharedConfig.loadScriptPromises || {};\n}\n\nfunction getSharedConfig() {\n return window.watsonAssistantChatSharedConfig;\n}\n\nfunction setRequestedSharedConfigVersion(requestedVersion: string) {\n window.watsonAssistantChatSharedConfig.requestedVersion = requestedVersion;\n}\n\nexport { ensureChatBrowserWindowConfigExists, getSharedConfig, setRequestedSharedConfigVersion };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { consoleError, djb2Hash } from '../utils/miscUtils';\nimport { ensureChatBrowserWindowConfigExists, getSharedConfig } from '../utils/sharedConfigUtils';\n\nclass NamespaceService {\n /**\n * The full provided namespace name.\n */\n public readonly originalName: string;\n\n /**\n * The namespace stripped of characters not safe to use in an attribute name in HTML. This is an empty string if\n * originalName is equal to the default.\n */\n public readonly attributeSafe: string;\n\n /**\n * The attribute safe namespace prepended by `--` to be used as a suffix on attributes like ID or class.\n * This is an empty string if originalName is equal by default.\n */\n public readonly suffix: string;\n\n constructor(namespace?: string) {\n this.originalName = namespace;\n this.attributeSafe = getAttributeSafe(namespace);\n this.suffix = getSuffix(namespace);\n }\n\n /**\n * Remove a current namespace when the chat is destroyed.\n */\n remove() {\n removeNamespace(this.originalName);\n }\n}\n\n/**\n * From a given namespace, generate a unique token safe to be used as an attribute or as part of one.\n * If no namespace provided, returns an empty string.\n */\nfunction getAttributeSafe(namespace?: string) {\n const computedName = computeNamespaceName(namespace);\n return computedName?.length ? `ns${djb2Hash(computedName)}` : '';\n}\n\n/**\n * From a given namespace, generate a unique token safe to be used as a suffix to a classname or attribute.\n * If no namespace provided, returns an empty string.\n */\nfunction getSuffix(namespace?: string) {\n const computedName = computeNamespaceName(namespace);\n return computedName?.length ? `--${getAttributeSafe(namespace)}` : '';\n}\n\n/**\n * Given a namespace, trims and returns. If no namespace provided, returns an empty string.\n */\nfunction computeNamespaceName(namespace?: string) {\n return namespace ? namespace.trim() : '';\n}\n\n/**\n * Validates if a namespace is already in use.\n */\nfunction validateNamespace(namespace?: string, andAdd?: boolean) {\n ensureChatBrowserWindowConfigExists();\n const computedNamespace = computeNamespaceName(namespace);\n const sharedConfig = getSharedConfig();\n if (sharedConfig.namespaces.includes(computedNamespace)) {\n const namespaceForError = computedNamespace || 'No namespace provided';\n consoleError(`You have multiple web chats attempting to use the same namespace. (${namespaceForError})`);\n } else if (andAdd) {\n addNamespace(namespace);\n }\n}\n\n/**\n * Adds a namespace to the array of namespaces in use.\n */\nfunction addNamespace(namespace?: string) {\n ensureChatBrowserWindowConfigExists();\n const computedNamespace = computeNamespaceName(namespace);\n const { namespaces } = getSharedConfig();\n namespaces.push(computedNamespace);\n}\n\n/**\n * Removes a namespace from the array of namespaces in use.\n */\nfunction removeNamespace(namespace?: string) {\n ensureChatBrowserWindowConfigExists();\n const computedNamespace = computeNamespaceName(namespace);\n const { namespaces } = getSharedConfig();\n const namespaceIndexToRemove = namespaces.indexOf(computedNamespace);\n if (namespaceIndexToRemove !== -1) {\n namespaces.splice(namespaceIndexToRemove, 1);\n }\n}\n\nexport {\n NamespaceService,\n validateNamespace,\n addNamespace,\n removeNamespace,\n getSuffix,\n getAttributeSafe,\n computeNamespaceName,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { CarbonTheme } from 'internal-packages/types/PublicConfig';\n\nimport { HasClassName } from './HasClassName';\n\nenum CarbonThemeClassNames {\n WHITE = 'cds--white',\n G10 = 'cds--g10',\n G90 = 'cds--g90',\n G100 = 'cds--g100',\n}\n\nenum ButtonKindEnum {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DANGER = 'danger',\n GHOST = 'ghost',\n DANGER_PRIMARY = 'danger--primary',\n DANGER_GHOST = 'danger--ghost',\n DANGER_TERTIARY = 'danger--tertiary',\n TERTIARY = 'tertiary',\n}\n\nenum ButtonSizeEnum {\n SMALL = 'sm',\n MEDIUM = 'md',\n LARGE = 'lg',\n XLARGE = 'xl',\n XXLARGE = '2xl',\n}\n\nenum ButtonTooltipAlignmentEnum {\n START = 'start',\n CENTER = 'center',\n END = 'end',\n}\n\ninterface AiSkeletonTextProps extends HasClassName {\n /**\n * Generates skeleton text at a larger size.\n */\n heading?: boolean;\n\n /**\n * The number of lines shown if paragraph is true.\n */\n lineCount?: number;\n\n /**\n * Set this to true to generate multiple lines of text.\n */\n paragraph?: boolean;\n\n /**\n * Width (in px or %) of single line of text or max-width of paragraph lines.\n */\n width?: string;\n}\n\ninterface SkeletonTextProps extends HasClassName {\n /**\n * Generates skeleton text at a larger size.\n */\n heading?: boolean;\n\n /**\n * The number of lines shown if paragraph is true.\n */\n lineCount?: number;\n\n /**\n * Set this to true to generate multiple lines of text.\n */\n paragraph?: boolean;\n\n /**\n * Width (in px or %) of single line of text or max-width of paragraph lines.\n */\n width?: string;\n}\n\nexport { CarbonTheme, CarbonThemeClassNames, ButtonKindEnum, ButtonSizeEnum, SkeletonTextProps, AiSkeletonTextProps };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * Configuration for the launcher.\n */\ninterface LauncherConfig {\n /**\n * Properties specific to the mobile launcher.\n */\n mobile: LauncherDeviceConfig;\n\n /**\n * Properties specific to the desktop launcher.\n */\n desktop: LauncherDeviceConfig;\n}\n\ninterface LauncherDeviceConfig {\n /**\n * The title that will be used by the expanded state of the launcher. If nothing is set in the config then a default\n * translated string will be used.\n */\n title: string;\n\n /**\n * The amount of time to wait before extending the launcher. If nothing is set then the default time of\n * 15s will be used.\n */\n time_to_expand: number;\n\n /**\n * Whether a new time_to_expand value has been set or not.\n */\n new_expand_time: boolean;\n\n /**\n * The amount of time to wait before reducing the extended launcher (This is only relevant to the mobile launcher\n * even though it exists within both configs).\n */\n time_to_reduce?: number;\n\n /**\n * Define the type of notification that is appearing.\n */\n notification_type: NotificationType;\n}\n\n// In the future we may want different types of notification messages, for example one of them will be a\n// text_notification. We're doing this to align with BED's notification schema.\nenum NotificationType {\n TEXT_NOTIFICATION = 'text_notification',\n}\n\n// The array of timeouts that will dictate the amount of intervals the bounce animation should play for the launcher.\nconst BOUNCING_ANIMATION_TIMEOUTS = [15000, 60000];\n\n// The amount of time until the entrance animation is automatically triggered for either launcher.\nconst TIME_TO_ENTRANCE_ANIMATION_START = 15000;\n\nexport {\n LauncherConfig,\n LauncherDeviceConfig,\n NotificationType,\n BOUNCING_ANIMATION_TIMEOUTS,\n TIME_TO_ENTRANCE_ANIMATION_START,\n};\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nexport default mergeWith;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * This file contains customizer functions for lodash utility functions that accept them.\n */\n\n/**\n * Returns the new array value which will replace the current value since we don't want both values to get merged.\n */\nfunction replaceCurrentArrayValue(currentValue: any, newValue: any) {\n if (Array.isArray(newValue)) {\n return newValue;\n }\n // Let the method itself handle merging non-array values.\n return undefined;\n}\n\nexport { replaceCurrentArrayValue };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport ObjectMap from 'internal-packages/shared/types/ObjectMap';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport merge from 'lodash-es/merge';\nimport mergeWith from 'lodash-es/mergeWith';\nimport reduce from 'lodash-es/reduce';\n\nimport { replaceCurrentArrayValue } from '../customizers';\n\n/* eslint-disable no-restricted-syntax */\n\n/**\n * Indicates if the given object contains any properties.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isEmptyObject(object: object) {\n // This is more efficient than using Object.keys because it will stop at the first property.\n for (const property in object) {\n if (Object.prototype.hasOwnProperty.call(object, property)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Receives an object with nested properties and flattens it to an object with no nesting.\n * Nested keys are joint by '-' as a delimiter\n * For example:\n * { test: { 'test1': 'testvalue' } } -> { 'test-test1': 'testvalue' }\n * For arrays:\n * { 'test': [ 'a', 'b', 'c' ] } -> { 'test-0': 'a', 'test-1': 'b', 'test-2', 'c' }\n *\n * @param object The object that needs flattening.\n * @param path (Optional) The stored accumulated path.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction flattenObjectKeys(object: object, path: string[] = []): object {\n if (!path) {\n path = [];\n }\n if (isPlainObject(object) || Array.isArray(object)) {\n return reduce(object, (cum, next, key) => merge(cum, flattenObjectKeys(next, [...path, key])), {});\n }\n return { [path.join('-')]: object };\n}\n\n/**\n * Takes an array of strings and add them to an ObjectMap as property names/keys with the given value set as the value\n * for each for.\n *\n * For example: fillObjectMap(['key1', 'key2']) => { key1: true, key2: true }\n *\n * @param keys The names of the properties/keys to add to the map.\n * @param value The value to set as the value for each property/key.\n */\nfunction fillObjectMap<T>(keys: string[], value: T = true as any): ObjectMap<T> {\n const objectMap: ObjectMap<any> = {};\n keys.forEach((item: string) => {\n objectMap[item] = value;\n });\n return objectMap;\n}\n\n/**\n * Merges the provided objects but does not merge arrays. Any new arrays found will overwrite a previous array.\n */\nfunction mergeNoArrays(...objects: Parameters<typeof mergeWith>) {\n return mergeWith(...objects, replaceCurrentArrayValue);\n}\n\n/**\n * Recursively deep freezes an object.\n */\nfunction deepFreeze(object: any) {\n Object.freeze(object);\n\n Object.getOwnPropertyNames(object).forEach(prop => {\n if (\n Object.prototype.hasOwnProperty.call(object, prop) &&\n object[prop] !== null &&\n (typeof object[prop] === 'object' || typeof object[prop] === 'function') &&\n !Object.isFrozen(object[prop])\n ) {\n deepFreeze(object[prop]);\n }\n });\n\n return object;\n}\n\nexport { isEmptyObject, flattenObjectKeys, fillObjectMap, mergeNoArrays, deepFreeze };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { compareVersions } from 'compare-versions';\nimport { PublicConfig } from 'internal-packages/shared/types/PublicConfig';\n\nimport { VERSION } from '../environmentVariables.js';\nimport {\n ensureChatBrowserWindowConfigExists,\n getSharedConfig,\n setRequestedSharedConfigVersion,\n} from './sharedConfigUtils';\n\n/**\n * Used to indicate when the latest version should be used.\n */\nconst LATEST_VERSION = 'latest';\n\n/**\n * Returns the version we should be using for requests. If we want to use a random named version for development purposes,\n * we must set __ibm__?.useExactVersion to true.\n *\n * @param publicConfig public config object\n */\nfunction getVersionLoaded(publicConfig: PublicConfig) {\n return publicConfig.__ibm__?.useExactVersion ? publicConfig.clientVersion : VERSION;\n}\n\n/**\n * Returns the appropriate version that matches the given requested version from the possible array of versions.\n *\n * @param desiredVersion This is the desired version to look for. For the latest version, this can simply be \"latest\".\n * For specific versions, this can be either an exact match or the beginning of a version if the latest major or\n * minor version is desired. For example, \"1.2\" will return the latest patch version under \"1.2\". A value of \"2\"\n * will return the latest minor version for major version 2.\n * @param availableVersions The list of available versions to choose from. This array will be sorted by this function.\n */\nfunction findMatchingVersion(desiredVersion: string, availableVersions: string[]): string | null {\n if (!desiredVersion) {\n return null;\n }\n\n // Sort the array by version in descending order.\n availableVersions.sort((version1, version2) => -compareVersions(version1, version2));\n\n // Add a \".\" to make sure we get a whole version.\n const desiredVersionPrefix = `${desiredVersion}.`;\n\n // Find the first version that is either an exact match or that starts with the desired prefix.\n const foundVersion =\n desiredVersion === LATEST_VERSION\n ? availableVersions[0]\n : availableVersions.find(value => value === desiredVersion || value.startsWith(desiredVersionPrefix));\n\n return foundVersion;\n}\n\n/**\n * Checks to see if another version of web chat has been loaded on the page already. If so, returns true.\n */\nfunction isConflictingVersion(publicConfig: PublicConfig) {\n ensureChatBrowserWindowConfigExists();\n const versionToLoad = publicConfig.clientVersion || VERSION;\n const { requestedVersion } = getSharedConfig();\n if (!requestedVersion) {\n setRequestedSharedConfigVersion(versionToLoad);\n } else if (requestedVersion !== versionToLoad) {\n return true;\n }\n return false;\n}\n\nexport { VERSION, LATEST_VERSION, findMatchingVersion, isConflictingVersion, getVersionLoaded };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2019, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport {\n AgentState,\n AlternateSuggestionsPanelState,\n AlternateSuggestionsState,\n AnnounceMessage,\n AppState,\n AppStateMessages,\n BrandingState,\n ChatMessagesState,\n CustomPanelConfigOptions,\n CustomPanelState,\n IFramePanelState,\n InputState,\n LauncherState,\n MessagePanelState,\n PersistedToBrowserStorageState,\n StreamingState,\n ThemeState,\n ViewSourcePanelState,\n ViewState,\n} from 'internal-packages/shared/types/AppState';\nimport { CarbonTheme } from 'internal-packages/shared/types/carbonTypes';\nimport { NotificationType, TIME_TO_ENTRANCE_ANIMATION_START } from 'internal-packages/shared/types/LauncherConfig';\nimport { LayoutConfig } from 'internal-packages/shared/types/PublicConfig';\nimport { StreamingConfig } from 'internal-packages/shared/types/StreamingConfig';\nimport { ThemeConfig } from 'internal-packages/shared/types/ThemeConfig';\nimport { TourState } from 'internal-packages/shared/types/TourState';\nimport isEqual from 'lodash-es/isEqual';\nimport { EventInputData } from 'submodules/wa-fd-types-public/wa-types';\n\nimport { CornersType, DEFAULT_CUSTOM_PANEL_ID } from '../utils/constants';\nimport { deepFreeze } from '../utils/lang/objectUtils';\nimport { VERSION } from '../utils/versionUtils';\n\n/**\n * Miscellaneous utilities to help in reducers.\n */\n\nconst DEFAULT_LAUNCHER: LauncherState = {\n config: {\n mobile: {\n title: '',\n time_to_expand: TIME_TO_ENTRANCE_ANIMATION_START,\n new_expand_time: false,\n time_to_reduce: 10000,\n notification_type: NotificationType.TEXT_NOTIFICATION,\n },\n desktop: {\n title: '',\n new_expand_time: false,\n time_to_expand: TIME_TO_ENTRANCE_ANIMATION_START,\n notification_type: NotificationType.TEXT_NOTIFICATION,\n },\n },\n};\ndeepFreeze(DEFAULT_LAUNCHER);\n\nconst DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS: CustomPanelConfigOptions = {\n title: null,\n hideBackButton: false,\n hidePanelHeader: false,\n disableAnimation: false,\n};\ndeepFreeze(DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS);\n\nconst DEFAULT_CUSTOM_PANEL_STATE: CustomPanelState = {\n isOpen: false,\n panelID: DEFAULT_CUSTOM_PANEL_ID,\n options: DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS,\n};\ndeepFreeze(DEFAULT_CUSTOM_PANEL_STATE);\n\nconst DEFAULT_IFRAME_PANEL_STATE: IFramePanelState = {\n isOpen: false,\n messageItem: null,\n};\ndeepFreeze(DEFAULT_IFRAME_PANEL_STATE);\n\nconst DEFAULT_CITATION_PANEL_STATE: ViewSourcePanelState = {\n isOpen: false,\n citationItem: null,\n relatedSearchResult: null,\n};\ndeepFreeze(DEFAULT_CITATION_PANEL_STATE);\n\nconst DEFAULT_BRANDING_STATE: BrandingState = {\n config: {\n is_on: false,\n },\n isOpen: false,\n showBanner: true,\n};\ndeepFreeze(DEFAULT_BRANDING_STATE);\n\nconst DEFAULT_TOUR_STATE: TourState = {\n activeTourStepItems: null,\n};\ndeepFreeze(DEFAULT_TOUR_STATE);\n\nconst DEFAULT_MESSAGE_PANEL_STATE: MessagePanelState<any> = {\n isOpen: false,\n localMessageItem: null,\n isMessageForInput: false,\n};\n\ndeepFreeze(DEFAULT_MESSAGE_PANEL_STATE);\n\nconst DEFAULT_ALTERNATE_SUGGESTIONS_STATE: AlternateSuggestionsState = {\n showButton: false,\n allowCollapse: false,\n panelState: AlternateSuggestionsPanelState.CLOSED,\n config: {\n is_on: false,\n },\n contactItem: null,\n starters: null,\n suggestionListItems: null,\n showSearchSection: false,\n searchResults: null,\n searchResultsLoading: false,\n searchResultsText: null,\n};\ndeepFreeze(DEFAULT_ALTERNATE_SUGGESTIONS_STATE);\n\nconst VIEW_STATE_ALL_CLOSED: ViewState = {\n launcher: false,\n mainWindow: false,\n tour: false,\n};\ndeepFreeze(VIEW_STATE_ALL_CLOSED);\n\nconst VIEW_STATE_LAUNCHER_OPEN: ViewState = {\n launcher: true,\n mainWindow: false,\n tour: false,\n};\ndeepFreeze(VIEW_STATE_LAUNCHER_OPEN);\n\nconst VIEW_STATE_MAIN_WINDOW_OPEN: ViewState = {\n mainWindow: true,\n launcher: false,\n tour: false,\n};\ndeepFreeze(VIEW_STATE_MAIN_WINDOW_OPEN);\n\nconst VIEW_STATE_TOUR_OPEN: ViewState = {\n tour: true,\n mainWindow: false,\n launcher: false,\n};\ndeepFreeze(VIEW_STATE_TOUR_OPEN);\n\nconst DEFAULT_PERSISTED_TO_BROWSER: PersistedToBrowserStorageState = {\n chatState: {\n version: VERSION,\n sessionID: null,\n sessionStartedTimestamp: null,\n updateHistoryUserDefinedCount: {},\n disclaimersAccepted: {},\n homeScreenState: {\n isHomeScreenOpen: false,\n showBackToBot: false,\n },\n hasSentNonWelcomeMessage: false,\n suggestionsPersistedState: {\n numStrikes: 0,\n selectedIndex: -1,\n selectedSection: null,\n },\n persistedTourState: {\n activeTourID: null,\n activeTourCurrentStepIndex: null,\n },\n agentState: {\n isConnected: false,\n isSuspended: false,\n agentProfiles: {},\n },\n },\n launcherState: {\n wasLoadedFromBrowser: false,\n version: VERSION,\n viewState: VIEW_STATE_ALL_CLOSED,\n activeTour: false,\n showUnreadIndicator: false,\n mobileLauncherIsExtended: false,\n mobileLauncherWasReduced: false,\n mobileLauncherDisableBounce: false,\n desktopLauncherIsExpanded: false,\n desktopLauncherWasMinimized: false,\n bounceTurn: 1,\n hasSentNonWelcomeMessage: false,\n },\n};\ndeepFreeze(DEFAULT_PERSISTED_TO_BROWSER);\n\nconst DEFAULT_CHAT_MESSAGES_STATE: ChatMessagesState = {\n localMessageIDs: [],\n messageIDs: [],\n isTypingCounter: 0,\n isLoadingCounter: 0,\n isScrollAnchored: false,\n};\ndeepFreeze(DEFAULT_CHAT_MESSAGES_STATE);\n\nconst DEFAULT_MESSAGE_STATE: AppStateMessages = {\n allMessageItemsByID: {},\n allMessagesByID: {},\n botMessageState: {\n ...DEFAULT_CHAT_MESSAGES_STATE,\n },\n};\ndeepFreeze(DEFAULT_MESSAGE_STATE);\n\nconst DEFAULT_INPUT_STATE = (): InputState => ({\n fieldVisible: true,\n isReadonly: false,\n files: [],\n allowFileUploads: false,\n allowMultipleFileUploads: false,\n allowedFileUploadTypes: null,\n});\n\nconst DEFAULT_AGENT_STATE: AgentState = {\n isConnecting: false,\n isReconnecting: false,\n numUnreadMessages: 0,\n fileUploadInProgress: false,\n showScreenShareRequest: false,\n isScreenSharing: false,\n isAgentTyping: false,\n inputState: DEFAULT_INPUT_STATE(),\n};\ndeepFreeze(DEFAULT_AGENT_STATE);\n\nconst DEFAULT_THEME_STATE: ThemeState = {\n carbonTheme: CarbonTheme.G10,\n useAITheme: false,\n corners: CornersType.ROUND,\n};\ndeepFreeze(DEFAULT_THEME_STATE);\n\n// Could be used to set the default for the remote config. However, the above default state value is used when first\n// setting the theme object in doCreateStore. That object in store should be used to get an up-to-date value for whether\n// the theme state is enabled instead of the remote config.\nconst DEFAULT_THEME_CONFIG: ThemeConfig = {\n carbon_theme: CarbonTheme.G10,\n use_ai_theme: false,\n};\ndeepFreeze(DEFAULT_THEME_CONFIG);\n\nconst DEFAULT_STREAMING_STATE: StreamingState = {\n enabled: false,\n};\ndeepFreeze(DEFAULT_STREAMING_STATE);\n\n// Could be used to set the default for the remote config. However, the above default state value is used when first\n// setting the streaming object in doCreateStore. That object in store should be used to get an up-to-date value for\n// whether streaming is enabled instead of the remote config.\nconst DEFAULT_STREAMING_CONFIG: StreamingConfig = {\n is_on: false,\n};\ndeepFreeze(DEFAULT_STREAMING_CONFIG);\n\nconst DEFAULT_LAYOUT_STATE: LayoutConfig = {\n showFrame: true,\n hasContentMaxWidth: false,\n};\ndeepFreeze(DEFAULT_LAYOUT_STATE);\n\nfunction calcAnnouncementForBrandingPanel(previousState: AppState, newIsPanelOpen: boolean): AnnounceMessage {\n if (previousState.brandingState.isOpen === newIsPanelOpen) {\n // No change in the panel state so return the current announcement.\n return previousState.announceMessage;\n }\n\n return {\n messageID: newIsPanelOpen\n ? 'general_ariaAnnounceOpenedInformationOverlay'\n : 'general_ariaAnnounceClosedInformationOverlay',\n };\n}\n\n/**\n * Determines the {@link AnnounceMessage} to show based on a potential change in the visibility of the widget. If the\n * widget is either opened or closed, an announcement should be made and this will set that announcement. If the state\n * of the widget hasn't changed, this will return the current announcement unchanged.\n *\n * @param previousState The previous state of the application.\n * @param newViewState Indicates the widgets new view state.\n */\nfunction calcAnnouncementForWidgetOpen(previousState: AppState, newViewState: ViewState): AnnounceMessage {\n if (isEqual(previousState.persistedToBrowserStorage.launcherState.viewState, newViewState)) {\n // No change in the view state so return the current announcement.\n return previousState.announceMessage;\n }\n\n // The view has changed so show the appropriate message.\n // TODO TOUR: I18N. This will need to be updated before ga. For now the announcement only cares if the main window is\n // opened. If the tour is opened, the announcement will be that the window is closed.\n return {\n messageID: newViewState.mainWindow ? 'window_ariaWindowOpened' : 'window_ariaWindowClosed',\n };\n}\n\n/**\n * Returns a new state that has the {@link ChatMessagesState} modified for the given chat type with the new properties.\n * If the chat state is for a thread, then the thread that is currently being viewed will be modified.\n */\nfunction applyBotMessageState(state: AppState, newState: Partial<ChatMessagesState>): AppState {\n return {\n ...state,\n botMessageState: {\n ...state.botMessageState,\n ...newState,\n },\n };\n}\n\nfunction handleViewStateChange(state: AppState, viewState: ViewState): AppState {\n // If the main window is opened and the page is visible, mark any unread messages as read.\n let { agentState } = state;\n let { showUnreadIndicator } = state.persistedToBrowserStorage.launcherState;\n if (viewState.mainWindow && state.isBrowserPageVisible) {\n if (agentState.numUnreadMessages !== 0) {\n agentState = {\n ...agentState,\n numUnreadMessages: 0,\n };\n }\n showUnreadIndicator = false;\n }\n\n return {\n ...state,\n announceMessage: calcAnnouncementForWidgetOpen(state, viewState),\n agentState,\n persistedToBrowserStorage: {\n ...state.persistedToBrowserStorage,\n launcherState: {\n ...state.persistedToBrowserStorage.launcherState,\n viewState,\n showUnreadIndicator,\n },\n },\n };\n}\n\n/**\n * Adds the given message as an event message to the pending logs queue.\n */\nfunction addEventMessage(message: EventInputData, state: AppState): AppState {\n return {\n ...state,\n pendingLogs: {\n ...state.pendingLogs,\n eventMessages: [...state.pendingLogs.eventMessages, message],\n },\n };\n}\n\nfunction setHomeScreenOpenState(state: AppState, isOpen: boolean, showBackToBot?: boolean): AppState {\n if (showBackToBot === undefined) {\n showBackToBot = state.persistedToBrowserStorage.chatState.homeScreenState.showBackToBot;\n }\n return {\n ...state,\n persistedToBrowserStorage: {\n ...state.persistedToBrowserStorage,\n chatState: {\n ...state.persistedToBrowserStorage.chatState,\n homeScreenState: {\n ...state.persistedToBrowserStorage.chatState.homeScreenState,\n isHomeScreenOpen: isOpen,\n showBackToBot,\n },\n },\n },\n };\n}\n\n/**\n * Returns the current (old) object if it is equal to another new object. Otherwise, the new object will be\n * returned. This will perform a deep equal of the given objects.\n *\n * This function is useful for optimizing out changes to parts of an object graph where object identity is normally\n * use for comparisons and where an unnecessary change in an object may produce unnecessary processing.\n */\nfunction keepIfEqual<T>(oldObject: T, newObject: T): T {\n return oldObject === newObject || isEqual(oldObject, newObject) ? oldObject : newObject;\n}\n\nexport {\n DEFAULT_AGENT_STATE,\n DEFAULT_MESSAGE_STATE,\n DEFAULT_CHAT_MESSAGES_STATE,\n DEFAULT_ALTERNATE_SUGGESTIONS_STATE,\n DEFAULT_PERSISTED_TO_BROWSER,\n VIEW_STATE_ALL_CLOSED,\n VIEW_STATE_MAIN_WINDOW_OPEN,\n VIEW_STATE_LAUNCHER_OPEN,\n VIEW_STATE_TOUR_OPEN,\n DEFAULT_BRANDING_STATE,\n DEFAULT_IFRAME_PANEL_STATE,\n DEFAULT_CITATION_PANEL_STATE,\n DEFAULT_CUSTOM_PANEL_STATE,\n DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS,\n DEFAULT_LAUNCHER,\n DEFAULT_TOUR_STATE,\n DEFAULT_MESSAGE_PANEL_STATE,\n DEFAULT_THEME_STATE,\n DEFAULT_THEME_CONFIG,\n DEFAULT_STREAMING_STATE,\n DEFAULT_STREAMING_CONFIG,\n DEFAULT_LAYOUT_STATE,\n DEFAULT_INPUT_STATE,\n calcAnnouncementForBrandingPanel,\n calcAnnouncementForWidgetOpen,\n setHomeScreenOpenState,\n applyBotMessageState,\n addEventMessage,\n keepIfEqual,\n handleViewStateChange,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The types of home screen backgrounds supported.\n */\nenum HomeScreenBackgroundType {\n NONE = 'none', // The home screen background is the same color as the chat background.\n SOLID = 'solid', // All solid color for home screen.\n TOP_CORNER_OUT = 'top_corner_out', // A top corner outward gradient color.\n BOTTOM_UP = 'bottom_up', // A bottom up gradient color.\n}\n\n/**\n * A conversation starter button on the home screen. Currently, only label is provided by tooling.\n */\ninterface HomeScreenStarterButton {\n /**\n * The display label of the button. This is also the value that is sent as the user's utterance to the assistant\n * when the button is clicked.\n */\n label: string;\n\n /**\n * Indicates if the button was previously clicked and should be displayed as selected.\n */\n isSelected?: boolean;\n}\n\n/**\n * Starter buttons that appear on home screen.\n */\ninterface HomeScreenStarterButtons {\n is_on?: boolean;\n buttons?: HomeScreenStarterButton[];\n}\n\n/**\n * Configuration for the optional home screen that appears before the bot chat window.\n */\ninterface HomeScreenConfig {\n /**\n * If the home page is turned on via config or remote config.\n */\n is_on?: boolean;\n\n /**\n * The greeting to show to the user to prompt them to start a conversation.\n */\n greeting?: string;\n\n /**\n * Optional conversation starter utterances that are displayed as buttons.\n */\n starters?: HomeScreenStarterButtons;\n\n /**\n * An image url that will override the bot avatar displayed in home screen.\n */\n bot_avatar_url?: string;\n\n /**\n * Do not show the greeting, starters, or avatar url.\n */\n custom_content_only?: boolean;\n\n /**\n * The type of home screen background to render.\n */\n background?: HomeScreenBackgroundType;\n}\n\n/**\n * Current state of home screen (currently, limited to if it is open or closed).\n */\ninterface HomeScreenState {\n /**\n * Indicates if the home screen is currently open.\n */\n isHomeScreenOpen: boolean;\n\n /**\n * Indicates if the home screen should display a \"return to bot\" button. This button is displayed when the user\n * has clicked the \"back to home\" button from the bot.\n */\n showBackToBot: boolean;\n}\n\nexport {\n HomeScreenConfig,\n HomeScreenStarterButtons,\n HomeScreenState,\n HomeScreenStarterButton,\n HomeScreenBackgroundType,\n};\n","import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { HomeScreenBackgroundType, HomeScreenConfig } from 'internal-packages/shared/types/HomeScreenConfig';\nimport isEmpty from 'lodash-es/isEmpty';\nimport merge from 'lodash-es/merge';\n\nconst DEFAULT_HOME_SCREEN_CONFIG = { is_on: false };\n\nfunction mergeHomeScreenConfig(publicHomeScreenConfig: HomeScreenConfig, remoteHomeScreenConfig: HomeScreenConfig) {\n // Merge together the remote config and the public config. When merging make sure the public config overrides the\n // remote config. If neither config are set then use the default home screen config that sets home screen to disabled.\n return merge(\n {},\n convertHomeScreenConfigToBackgroundIfBackgroundGradient(remoteHomeScreenConfig),\n convertHomeScreenConfigToBackgroundIfBackgroundGradient(publicHomeScreenConfig),\n );\n}\n\n/**\n * Returns a copy of the given config but converts any background_gradient object to the background prop if the\n * background prop is not set. This is required in order to keep track of the intended background setting in one place,\n * otherwise it's quite difficult to tell which setting should be used if both are set. This can be removed once the\n * deprecated background_gradient property is removed.\n */\nfunction convertHomeScreenConfigToBackgroundIfBackgroundGradient(config: HomeScreenConfig): HomeScreenConfig {\n let newHomeScreenConfig = config;\n if (config && !config.background) {\n // If there is a config and the config is not setting a background property then we may need to set one. If the new\n // config is setting a background then we rely on that value and ignore the background_gradient. If the new config\n // is not setting a background or background_gradient then the home screen component will default to background type\n // \"none\".\n if (!isEmpty(config.background_gradient)) {\n // If the config is using the background_gradient object then we should update background to match the\n // background_gradient settings. We do this because \"background\" is what we rely on within the home screen\n // component.\n let background;\n if (config.background_gradient.is_on) {\n if (config.background_gradient?.gradient_direction === HomeScreenBackgroundType.BOTTOM_UP) {\n background = HomeScreenBackgroundType.BOTTOM_UP;\n } else {\n // We allow deb to leave gradient_direction undefined when setting is_on to true. The expectation is that we\n // will default to top corner out gradient.\n background = HomeScreenBackgroundType.TOP_CORNER_OUT;\n }\n } else {\n // If the background_gradient config has been intentionally set to is_on false then we should not show a\n // background.\n background = HomeScreenBackgroundType.NONE;\n }\n\n // Add the background to the home screen config.\n newHomeScreenConfig = {\n ...newHomeScreenConfig,\n background,\n };\n }\n }\n\n return newHomeScreenConfig;\n}\n\n/**\n * Returns a copy of the given config, but removes any starters that are empty.\n */\nfunction withoutEmptyStarters(config: HomeScreenConfig): HomeScreenConfig {\n let newConfig = config;\n if (config?.starters?.buttons?.length) {\n newConfig = {\n ...config,\n starters: {\n ...config.starters,\n buttons: config.starters.buttons.filter(button => Boolean(button.label?.trim())),\n },\n };\n if (!newConfig?.starters?.buttons?.length) {\n // If we end up with no starters, then turn them off.\n newConfig.starters.is_on = false;\n }\n }\n\n return newConfig;\n}\n\nexport {\n DEFAULT_HOME_SCREEN_CONFIG,\n mergeHomeScreenConfig,\n withoutEmptyStarters,\n convertHomeScreenConfigToBackgroundIfBackgroundGradient,\n};\n","export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { StatusCodes } from 'http-status-codes';\nimport { CatastrophicErrorType } from 'internal-packages/shared/types/AppState';\nimport { BusEventIdentityExpired, BusEventType } from 'internal-packages/shared/types/eventBusTypes';\nimport { JWT } from 'internal-packages/shared/types/JWT';\nimport { OnErrorData, OnErrorType } from 'internal-packages/shared/types/OnErrorData';\nimport { jwtDecode } from 'jwt-decode';\n\nimport { ServiceManager } from '../services/ServiceManager';\nimport { WA_CONSOLE_PREFIX } from './constants';\nimport { resolveOrTimeout } from './lang/promiseUtils';\nimport { callOnError, consoleInfo } from './miscUtils';\n\n// The text that is returned that indicated the JWT token has expired.\nconst JWT_MALFORMED_TEXT = 'token provided is malformed';\nconst JWT_BAD_FORMAT = 'Authorization header provided but does not follow JWT format';\nconst JWT_EXPIRED_TEXT = 'token expired';\n\n// Amount of time we wait before giving up on identity being updated.\nconst IDENTITY_EXPIRED_TIMEOUT = 30000;\n\n// The private key used on the testing site for signing JWTs.\nconst TEST_JWT_YOUR_PRIVATE_SIGNING_KEY = `-----BEGIN PRIVATE KEY-----\nMIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDP0r2bW39iEFC6\nLdE/ycvqTiL6q1fqy/IPmZ0TZCXd+BTtCZnUo6x+F4GYakANEP8zcMernUWwILVa\nvMy9Yt5arHiht0WM6c+PR9v3X5wfRQVUCUfXxDbYlmFmFgWW5XTVdhEjJRSvBwyU\n+x0qmUHpAl1UENkkQRR8WgMx65fkETxPmZrv6RoU4tJLBRgGHXgVrRlowWkMNTYD\nCyVCzuxjpARl4AH2HQ4oLmXz6kFIdr5IjN7H7astIX3uNhTlx8vEYCG+tAwPCb7O\nsq3q+VFYgBuIn1hpzQNKoE6za9llBlEIbTUntMsXKgoElBV0BBdwDLVpSqLTHes7\nBVadI3dkt8cdi/zCH3rO8QT4u3kNaxsU64vnAkVlG9qFWO9aEh7ETSWatIYhErQ7\nKkOy905Kj/DUr9mwNdbPkaSkr/VcAR1l+LRn9OSMBdjIrimamnn0OLWWyc7M0Dqo\n4O/mL3sh8AsGr+KrChTvbz/GmoiVvZhl+1ZB9YdmKkGphwpoUn4kyMp9pxFkzZu5\n6/LbT5c9QfiMME7fC1e2ZjUZB0MtvlekCjAmYG78xFBaCmSn6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12Zn33zIgqyvHqe+2Lf7fJgKY2Jt3SI+heX+6fyb3Ed/af\nA193/a2ibcNSVDHvYB9UsvqN2x6jcZOpY7NgtycBNTsvTl+KVpU4crnM91cUMMvb\n9qECggEBAKWBINpCAnwI9feDr0I9aaEt7VoE3AIyL4rKkLX2xonBvpD0YOf7Um2u\n73LRzeumnyeYCRMJZq+yabkK/MbgJgwzwckat/GxmoNsMn0VZxQW9v3IVi1D3EcW\nIfxTVgOROnTXq24yTLX8wRngQ8WQ2xAFSbdZsey8G25kvl4odIkaQHOnrc3Sp4bH\n4Vs8EWMkr8NubGsSOuarFE6uZj+PM0FkgG6Vyns9UNXJkvTYIXLAxNeO1u4z7DtL\nh3bkPgd6auiTw1tUbR7F6QEklevemLudBPAsZoJR/0fMhQYwUOiBw0H60r3kRkaF\nnISy2FO++GWheN9T1JIY6OqkeoJcDvY=\n-----END PRIVATE KEY-----`; // pragma: whitelist secret\n\n// The private key used on the testing site for verifying JWTs.\nconst TEST_JWT_YOUR_PUBLIC_VERIFYING_KEY = `-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAz9K9m1t/YhBQui3RP8nL\n6k4i+qtX6svyD5mdE2Ql3fgU7QmZ1KOsfheBmGpADRD/M3DHq51FsCC1WrzMvWLe\nWqx4obdFjOnPj0fb91+cH0UFVAlH18Q22JZhZhYFluV01XYRIyUUrwcMlPsdKplB\n6QJdVBDZJEEUfFoDMeuX5BE8T5ma7+kaFOLSSwUYBh14Fa0ZaMFpDDU2AwslQs7s\nY6QEZeAB9h0OKC5l8+pBSHa+SIzex+2rLSF97jYU5cfLxGAhvrQMDwm+zrKt6vlR\nWIAbiJ9Yac0DSqBOs2vZZQZRCG01J7TLFyoKBJQVdAQXcAy1aUqi0x3rOwVWnSN3\nZLfHHYv8wh96zvEE+Lt5DWsbFOuL5wJFZRvahVjvWhIexE0lmrSGIRK0OypDsvdO\nSo/w1K/ZsDXWz5GkpK/1XAEdZfi0Z/TkjAXYyK4pmpp59Di1lsnOzNA6qODv5i97\nIfALBq/iqwoU728/xpqIlb2YZftWQfWHZipBqYcKaFJ+JMjKfacRZM2buevy20+X\nPUH4jDBO3wtXtmY1GQdDLb5XpAowJmBu/MRQWgpkp+j/lI0JcWOqirVb/CGfS7U5\nA0Dy8486rNsiKtrkb9I2YxTBieVQOXlrnJXVCiiIOEOtAf1rLXhSj+o+ry6beNE/\nMb1i2jpD/JPOQ+O0EYEka0kCAwEAAQ==\n-----END PUBLIC KEY-----`; // pragma: whitelist secret\n\n// The IBM provided public key used for encrypting JWT payloads.\nconst TEST_IBM_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxO0SzyZYZPsai7Z1DUeF\n6llFqoTVo6R1stYsG19mnRIJu/0/q5j4ZyfAFpI/coi8MZuPNytKA4BzRe6voLTF\nkyg1qDbi+Y+ch4iHyBDGkRSwgS8EzgDkQ0mkCE4U3nR0iVigNhbHVmbEMTVgtsFS\noDBd2Rtpr/kuaGdfjDOePyuDTquCzk6cx3Fq4eyiakFpJDRR11FfE6LYlzf32Bn9\nTag3XDX1ePFkEk5hgA8izwjDmMZ75NYaI5zE1rlNCsc0XsPE8tnn7Cn1+QuLHDXh\nwG/1SRqUaQJ4L758KblVBYFmJhiBHKY/AsUHUDjsNaseEEkT0iwBreAY4nv6dmFi\nxwIDAQAB\n-----END PUBLIC KEY-----`; // pragma: whitelist secret\n\n/**\n * Given a status code and text, decide if an error is the result of an expired or invalid JWT.\n */\nfunction isJWTError(statusCode: number, isSecurityEnabled: boolean, resultText?: string) {\n return (\n (statusCode === StatusCodes.FORBIDDEN && isSecurityEnabled) ||\n (statusCode === StatusCodes.BAD_REQUEST && resultText?.includes(JWT_MALFORMED_TEXT)) ||\n (statusCode === StatusCodes.BAD_REQUEST && resultText?.includes(JWT_BAD_FORMAT)) ||\n (statusCode === StatusCodes.UNAUTHORIZED && resultText?.includes(JWT_EXPIRED_TEXT))\n );\n}\n\n/**\n * Checks if JWT passed as identityToken is valid.\n */\nfunction assertJWTValid(jwt: JWT) {\n if (!jwt.sub) {\n throw new Error(`${WA_CONSOLE_PREFIX}: The \"sub\" claim is required in your identityToken.`);\n }\n if (!jwt.exp) {\n consoleInfo('It is recommended you set your JWT to expire with an exp claim.');\n }\n}\n\n/**\n * This should be called when it is detected that the user's identity token has expired. It will request a new\n * identity token from the host page and update the stored value when a new one is received. If the request times out\n * this function will throw an error.\n *\n * @param serviceManager The instance of the serviceManager for this web chat.\n * @param catastrophicErrorType If the identity token fails when loading the main config, the web chat cannot load.\n */\nasync function getNewIdentityToken(serviceManager: ServiceManager, catastrophicErrorType?: CatastrophicErrorType) {\n const identityExpiredMessage: BusEventIdentityExpired = {\n type: BusEventType.IDENTITY_EXPIRED,\n identityToken: null,\n };\n\n try {\n await resolveOrTimeout(\n serviceManager.eventBus.fire(identityExpiredMessage, serviceManager.instance),\n IDENTITY_EXPIRED_TIMEOUT,\n );\n } catch (error) {\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n message: `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but an error was thrown by a handler.`,\n catastrophicErrorType,\n otherData: error,\n });\n throw error;\n }\n\n if (!identityExpiredMessage.identityToken || typeof identityExpiredMessage.identityToken !== 'string') {\n let message;\n if (!identityExpiredMessage.identityToken) {\n message = `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but no token was set by a handler.`;\n } else {\n message = `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but the handler returned a non-string token.`;\n }\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n message,\n catastrophicErrorType,\n });\n throw new Error(message);\n }\n\n try {\n serviceManager.actions.updateIdentityToken(identityExpiredMessage.identityToken);\n } catch (error) {\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n message: `A request for a new identity token was made using the ${BusEventType.IDENTITY_EXPIRED} event but an error was thrown.`,\n catastrophicErrorType,\n otherData: error,\n });\n throw error;\n }\n}\n\n/**\n * This should be called when we want to get a new identity token if it's going to expire soon. For now, we have\n * hard-coded \"soon\" to mean 10 seconds. If it will expire, it will request a new identity token from the host page\n * and update the stored value when a new one is received. If the request times out this function will throw an error.\n *\n * @param serviceManager The instance of the serviceManager for this web chat.\n * @param catastrophicErrorType If the identity token fails when loading the main config, the web chat cannot load.\n */\nconst getNewIdentityTokenIfExpiring = async (\n serviceManager: ServiceManager,\n catastrophicErrorType?: CatastrophicErrorType,\n) => {\n const currentToken = serviceManager.store.getState().identityToken;\n const decodedToken = doDecodeJWT(currentToken, console.error);\n if (decodedToken.exp) {\n const expiration = new Date(decodedToken.exp * 1000);\n // If the token is going to expire in the next 10 seconds, then get a new one now.\n const timeRemaining = expiration.getTime() - Date.now();\n if (timeRemaining < 10000) {\n await getNewIdentityToken(serviceManager, catastrophicErrorType);\n }\n } else {\n await getNewIdentityToken(serviceManager, catastrophicErrorType);\n }\n};\n\n/**\n * Decodes the given string provided by the customer as a JWT along with some error handling.\n */\nfunction doDecodeJWT(jwtString: string, onError: (data: OnErrorData) => void) {\n let jwt: JWT;\n try {\n jwt = jwtDecode(jwtString);\n assertJWTValid(jwt);\n } catch (error) {\n callOnError(onError, {\n errorType: OnErrorType.IDENTITY_TOKEN,\n message: `The provided JWT (identity token) is not valid.`,\n otherData: error,\n });\n throw error;\n }\n\n return jwt;\n}\n\nexport {\n doDecodeJWT,\n getNewIdentityToken,\n getNewIdentityTokenIfExpiring,\n isJWTError,\n assertJWTValid,\n JWT_MALFORMED_TEXT,\n JWT_EXPIRED_TEXT,\n TEST_JWT_YOUR_PRIVATE_SIGNING_KEY,\n TEST_JWT_YOUR_PUBLIC_VERIFYING_KEY,\n TEST_IBM_PUBLIC_KEY,\n};\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The different types of things we can generate UUIDs for. Our test cases generate sequential IDs instead of random\n * UUIDs to produce deterministic IDs that can be hardcoded in tests and snapshots. To minimize the disruption that\n * changes in these IDs can cause (like if a new ID gets inserted), we divide IDs by type where each type gets its own\n * sequence. The type is set in the highest segment of the sequential IDs that are generated. This enum is only used\n * for testing purposes and has no impact on production code. If you change the values of any of these items, it\n * might break test cases that have IDs hardcoded in them.\n */\nenum UUIDType {\n MISCELLANEOUS = 1,\n LOCAL_MESSAGE = 2,\n MESSAGE = 3,\n USER = 6,\n DEVICE_ID = 8,\n FILE = 9,\n}\n\nexport { UUIDType };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { v4 as originalUUID } from 'uuid';\n\nimport { UUIDType } from './UUIDType';\n\n/**\n * The function generates a new v4 UUID. This function is here to provide a nicer mechanism for mocking UUIDs in\n * test cases.\n *\n * @param type This is the \"type\" of the UUID that is being generated. This is only used by the mock UUID generator\n * for test cases. Each \"type\" will get it's own set of IDs that don't overlap with other types.\n */\nfunction uuid(type?: UUIDType) {\n return originalUUID();\n}\n\n/**\n * This function needs to be here so we can override in our mock. If we try to call this function as it exists in\n * the mock, it seems that jest doesn't properly call this on the right module.\n */\nfunction resetUUIDs() {}\n\nexport { uuid, UUIDType, resetUUIDs };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { PublicConfig } from './types/assistantPublicConfig';\n\n/**\n * Used in loadWAC to determine the right route for the public configs, the /message endpoint, and the history endpoint\n * to use. It has been moved to loadWac so that once watsonplatform.net is deprecated this is the only file that needs\n * to be changed and any version after the initial moving of this mapping will still work.\n */\nexport const REGION_MAP: Record<string, string> = {\n // WXA on IBM Cloud\n dev: 'integrations.us-south.assistant.dev.watson.appdomain.cloud',\n staging: 'integrations.us-south.assistant.test.watson.appdomain.cloud',\n 'us-south': 'integrations.us-south.assistant.watson.appdomain.cloud',\n 'us-east': 'integrations.us-east.assistant.watson.appdomain.cloud',\n 'jp-tok': 'integrations.jp-tok.assistant.watson.appdomain.cloud',\n 'au-syd': 'integrations.au-syd.assistant.watson.appdomain.cloud',\n 'eu-gb': 'integrations.eu-gb.assistant.watson.appdomain.cloud',\n 'eu-de': 'integrations.eu-de.assistant.watson.appdomain.cloud',\n 'kr-seo': 'integrations.kr-seo.assistant.watson.appdomain.cloud',\n // WXO on AWS\n 'aws-dev': 'integrations.aws-us-east-1.assistant.dev.watson.appdomain.cloud',\n 'aws-staging': 'integrations.aws-us-east-1.assistant.test.watson.appdomain.cloud',\n 'aws-us-east-1': 'integrations.aws-us-east-1.assistant.watson.appdomain.cloud',\n 'aws-preprod': 'integrations.aws-us-east-1.assistant.preprod.watson.appdomain.cloud',\n 'aws-eu-central-1': 'integrations.aws-eu-central-1.assistant.watson.appdomain.cloud',\n // WXO on IBM Cloud\n 'wxo-dev': 'integrations.us-south.assistant-builder.dev.watson.appdomain.cloud',\n 'wxo-staging': 'integrations.us-south.assistant-builder.test.watson.appdomain.cloud',\n 'wxo-us-south': 'integrations.us-south.assistant-builder.watson.appdomain.cloud',\n};\n\n/**\n * Gets the region hostname for calls to the integrations server.\n *\n * @param publicConfig The public config object.\n */\nexport function getRegionHostname(publicConfig: PublicConfig) {\n return REGION_MAP[publicConfig.region as string];\n}\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2020, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { StatusCodes } from 'http-status-codes';\nimport { CatastrophicErrorType } from 'internal-packages/shared/types/AppState';\nimport { Fetch } from 'internal-packages/shared/types/Fetch';\nimport { OnErrorData, OnErrorType } from 'internal-packages/shared/types/OnErrorData';\nimport { ConnectToAgentBehaviorType, PublicConfig, ToolingType } from 'internal-packages/shared/types/PublicConfig';\nimport { RemoteInitConfig, RemoteMainConfig } from 'internal-packages/shared/types/RemoteConfig';\nimport merge from 'lodash-es/merge';\nimport { PartialPublicConfig } from 'test/util/commonTestConstants.js';\nimport { DeepPartial } from 'ts-essentials';\n\nimport { WWX_CDN_ENDPOINT, WXO_ENDPOINT } from '../environmentVariables.js';\nimport { doWithRetry } from '../services/doWithRetry';\nimport { validateNamespace } from '../services/NamespaceService';\nimport { ServiceManager } from '../services/ServiceManager';\nimport { DEFAULT_ALTERNATE_SUGGESTIONS_STATE, DEFAULT_BRANDING_STATE, DEFAULT_LAUNCHER } from '../store/reducerUtils';\nimport { API_DEBUGGING_HEADER_NAME, INTEGRATIONS_VERSION, WA_CONSOLE_PREFIX } from './constants';\nimport { DEFAULT_HOME_SCREEN_CONFIG } from './homeScreenUtils';\nimport { getNewIdentityToken, isJWTError } from './identityUtils';\nimport { isValidUUID } from './lang/stringUtils';\nimport { uuid, UUIDType } from './lang/uuid';\nimport { consoleError, safeFetchText, safeFetchTextWithTimeout } from './miscUtils';\nimport { getRegionHostname, REGION_MAP } from './regions';\nimport { getVersionLoaded, isConflictingVersion } from './versionUtils';\n\nconst DEFAULT_PUBLIC_CONFIG: PartialPublicConfig = {\n openChatByDefault: false,\n showLauncher: true,\n shouldTakeFocusIfOpensAutomatically: true,\n agentAppConfig: {\n is_on: false,\n },\n servers: {},\n serviceDesk: {},\n messaging: {\n copyPreviousContextOnRequest: true,\n },\n __ibm__: {\n isTrackingEnabled: true,\n logTrackObjects: false,\n connectToAgentBehavior: ConnectToAgentBehaviorType.ERROR_MISSING,\n enableFeatures: {},\n },\n wxo: {},\n};\n\nconst DEFAULT_REMOTE_INIT_CONFIG: DeepPartial<RemoteInitConfig> = {\n home_screen: DEFAULT_HOME_SCREEN_CONFIG,\n alternate_suggestions: DEFAULT_ALTERNATE_SUGGESTIONS_STATE.config,\n branding_config: DEFAULT_BRANDING_STATE.config,\n launcher_config: DEFAULT_LAUNCHER.config,\n};\n\nconst AGENT_APP_DEFAULT_PUBLIC_CONFIG: PartialPublicConfig = {\n headerConfig: {\n hideMinimizeButton: true,\n },\n openChatByDefault: true,\n showLauncher: false,\n disableCustomElementMobileEnhancements: true,\n disclaimer: {\n isOn: false,\n },\n __ibm__: {\n isReadonly: true,\n },\n};\n\nconst AGENT_APP_DEFAULT_REMOTE_INIT_CONFIG: DeepPartial<RemoteInitConfig> = {\n alternate_suggestions: {\n is_on: false,\n },\n home_screen: {\n is_on: false,\n },\n // When using agent app, we use auth tokens instead.\n authorization: {\n is_on: false,\n },\n};\n\nconst AGENT_APP_SLUG = 'agentapp';\nconst CHAT_SLUG = 'chat';\n\n/**\n * Examines the given public config and throws an error message if there are errors with it.\n */\nfunction validateConfig(publicConfig: PublicConfig, asCarbonChat?: boolean) {\n const { integrationID, region, namespace, __ibm__ = DEFAULT_PUBLIC_CONFIG.__ibm__, messaging } = publicConfig;\n\n // If the user provides a custom URL, then we don't need to validate the other config properties.\n if (asCarbonChat) {\n if (!messaging?.customSendMessage) {\n throw new Error(`${WA_CONSOLE_PREFIX} You must set messaging.customSendMessage in your configuration object.`);\n }\n } else {\n if (!__ibm__.customMessageURL && !messaging?.customSendMessage) {\n if (!isValidUUID(integrationID)) {\n throw new Error(`${WA_CONSOLE_PREFIX} The value of integrationID \"${integrationID}\" is not a valid ID.`);\n }\n if (!region) {\n throw new Error(`${WA_CONSOLE_PREFIX} You failed to provide a region in your config object.`);\n }\n if (!REGION_MAP[region]) {\n throw new Error(\n `${WA_CONSOLE_PREFIX} The region \"${region}\" you provided in your config object is not a valid region.`,\n );\n }\n }\n if (isConflictingVersion(publicConfig)) {\n throw new Error(`${WA_CONSOLE_PREFIX} You cannot load web chats of different versions on the same page.`);\n }\n }\n\n validateNamespace(namespace, true);\n}\n\n/**\n * Gets the base url for config and post url.\n *\n * @param publicConfig The public config object.\n */\nfunction getBaseURL(publicConfig: PublicConfig) {\n const regionHostname = getRegionHostname(publicConfig);\n const prefix = publicConfig.servers?.assistantURLPrefix || `https://${regionHostname}`;\n return `${prefix}/${publicConfig.subscriptionID || 'public'}`;\n}\n\n/**\n * Gets the CPD base url for config, message, and history urls. IntegrationID added since CDN is the only place that\n * doesn't need it, so its handled differently\n *\n * @param publicConfig The public config object.\n * @param agentAppOverride If true, we call the agentapp channel instead of the chat channel.\n */\nfunction getCPDBaseChatURL(publicConfig: PublicConfig, agentAppOverride?: boolean) {\n let cpdURL = null;\n if (publicConfig.cloudPrivateHostURL) {\n const integrationSlug = agentAppOverride ? AGENT_APP_SLUG : CHAT_SLUG;\n // Make sure the host url ends with a trailing slash.\n cpdURL = `${publicConfig.cloudPrivateHostURL.replace(/\\/?$/, '/')}v1/${integrationSlug}/${\n publicConfig.integrationID\n }`;\n }\n return cpdURL;\n}\n\n/**\n * Given a config object, either returns the cloudPrivateHostURL used in CP4D or the url for the CDN provided in the\n * environment.\n *\n * @param publicConfig The public config object.\n */\nfunction getCDNURL(publicConfig?: PublicConfig) {\n if (publicConfig?.cloudPrivateHostURL) {\n // If we are in CPD we are using the cloudPrivateHostURL with /static/webchat appended.\n // Make sure the host url ends with a trailing slash.\n return `${publicConfig.cloudPrivateHostURL.replace(/\\/?$/, '/')}static/webchat`;\n }\n if (publicConfig?.servers?.webChatScriptPrefix) {\n return publicConfig?.servers?.webChatScriptPrefix;\n }\n // If no overrides, use the cdn endpoint provided in the environment on build.\n return WWX_CDN_ENDPOINT;\n}\n\n/**\n * Given a config object, either returns the WXO_ENDPOINT override or a location of the remoteEntry file for the\n * wxo mfe.\n *\n * @param publicConfig The public config object.\n */\nfunction getWXOUrl(publicConfig?: PublicConfig) {\n const versionLoaded = getVersionLoaded(publicConfig);\n const cdnEndpoint = getCDNURL(publicConfig);\n const baseURL = `${cdnEndpoint}/versions/${versionLoaded}`;\n return WXO_ENDPOINT || `${baseURL}/wxo-mfe/remoteEntry.js`;\n}\n\n/**\n * Given a config object, returns the URL to the config endpoint used for getting widget configuration. This URL\n * will have the integration ID added to it if necessary and if no custom URL was specified.\n *\n * @param publicConfig The public config object.\n * @param initConfig Indicates if we want the URL for the main config or the \"init\" config (the \"init\" config is\n * loaded immediately when the page is loaded).\n */\nfunction getConfigURL(publicConfig: PublicConfig, initConfig: boolean) {\n // First check for a custom config url.\n const customURL = initConfig ? publicConfig.__ibm__?.customInitConfigURL : publicConfig.__ibm__?.customConfigURL;\n if (customURL) {\n // If the public config specifies a custom URL, then return it as-is.\n return customURL;\n }\n\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then return it with /config appended as well as ?type=init if the init config\n // was requested.\n return `${cpdBaseURL}/config${initConfig ? '?type=init' : ''}`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n const configTypeParam = initConfig ? '?type=init' : '';\n\n // If the agent app config is to be fetched, it should be done through the /agentapp channel. This also fixes\n // security holes through mix-match channel APIs.\n // For more info: https://github.ibm.com/watson-engagement-advisor/wea-backlog/issues/48720\n if (publicConfig.agentAppConfig?.is_on) {\n return `${baseURL}/agentapp/${publicConfig.integrationID}/config${configTypeParam}`;\n }\n\n return `${baseURL}/chat/${publicConfig.integrationID}/config${configTypeParam}`;\n}\n\n/**\n * Given a config object, returns the URL to the message endpoint used for sending messages. This URL will have the\n * integration ID added to it if necessary and if no custom URL was specified.\n */\nfunction getMessageURL(publicConfig: PublicConfig) {\n // First check for a custom message url.\n if (publicConfig.__ibm__?.customMessageURL) {\n // If the config specifies a custom URL, then return it as-is.\n return publicConfig.__ibm__.customMessageURL;\n }\n\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then return it with /message appended.\n return `${cpdBaseURL}/message`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n return `${baseURL}/chat/${publicConfig.integrationID}/message`;\n}\n\n/**\n * Given a config object, returns the URL to the message endpoint used for sending messages. This URL will have the\n * integration ID added to it if necessary and if no custom URL was specified.\n */\nfunction getSessionURL(publicConfig: PublicConfig, sessionID: string) {\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then use it as the base of the url.\n return `${cpdBaseURL}/sessions/${sessionID}?version=${INTEGRATIONS_VERSION}`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n return `${baseURL}/chat/${publicConfig.integrationID}/sessions/${sessionID}?version=${INTEGRATIONS_VERSION}`;\n}\n\n/**\n * Returns the prefix for the endpoint used to make calls to Amplitude.\n */\nfunction getAnalyticsPath(publicConfig: PublicConfig) {\n const prefix = publicConfig.servers?.assistantURLPrefix || `https://${getRegionHostname(publicConfig)}`;\n return `${prefix}/analytics`;\n}\n\n/**\n * Given a config object, returns the URL to the history endpoint used for loading historical messages. This URL will\n * have the integration ID and session ID added to it if necessary and if no custom URL was specified.\n *\n * @param publicConfig The public config object.\n * @param sessionID The ID of the session to return the history of.\n */\nfunction getHistoryURL(publicConfig: PublicConfig, sessionID: string) {\n // First check for a custom history url.\n if (publicConfig.__ibm__?.customHistoryPrefix) {\n // If the config specifies a custom URL, then return it as-is with the session ID added.\n return `${publicConfig.__ibm__.customHistoryPrefix}/${sessionID}/notes?version=${INTEGRATIONS_VERSION}`;\n }\n\n // Next, check if we're in cp4d and should use a cp4d url.\n const cpdBaseURL = getCPDBaseChatURL(publicConfig, publicConfig.agentAppConfig?.is_on);\n if (cpdBaseURL) {\n // If the public config specifies a cpd URL, then return it with /config appended as well as ?type=init if the\n // init config was requested.\n return `${cpdBaseURL}/channel_conversations/${sessionID}/notes?version=${INTEGRATIONS_VERSION}`;\n }\n\n const baseURL = getBaseURL(publicConfig);\n\n // If we are calling history in the context of the agentApp, we use the generic 'agentapp' integration instead of\n // 'chat'.\n const integrationSlug = publicConfig.agentAppConfig?.is_on ? AGENT_APP_SLUG : CHAT_SLUG;\n\n return `${baseURL}/${integrationSlug}/${publicConfig.integrationID}/channel_conversations/${sessionID}/notes?version=${INTEGRATIONS_VERSION}`;\n}\n\n/**\n * Fetches configuration data for the widget. This function can also return a JWTError to be handled.\n *\n * @param configUrl URL to fetch config data for widget.\n * @param fetch The fetch function to use.\n * @param isSecurityEnabled Indicates if web chat security is enabled.\n * @param fetchParameters Fetch call parameters.\n */\nasync function doConfigFetch(\n configUrl: string,\n fetch: Fetch,\n isSecurityEnabled: boolean,\n fetchParameters?: RequestInit,\n): Promise<Response> {\n const result = await fetch(configUrl, fetchParameters);\n\n if (!result.ok) {\n // If too many requests were made we want to end the retry cycle when this function is used in doWithRetry.\n if (result.status === StatusCodes.TOO_MANY_REQUESTS) {\n return null;\n }\n\n const responseText = await safeFetchText(result);\n if (isJWTError(result.status, isSecurityEnabled, responseText)) {\n return result;\n }\n\n throw result;\n }\n\n return result;\n}\n\n/**\n * Loads the initial configuration data for the widget from the integrations server. The call is not authenticated\n * with the customer's JWT.\n */\nasync function getRemoteInitConfig(\n publicConfig: PublicConfig,\n onError: (data: OnErrorData) => void,\n fetch: Fetch,\n): Promise<RemoteInitConfig> {\n if (publicConfig.servers?.skipConfig) {\n return { botName: 'watsonx Assistant' } as any;\n }\n\n const url = getConfigURL(publicConfig, true);\n\n let fetchParameters: RequestInit;\n\n let result: Response;\n try {\n result = await doWithRetry(\n // The remote init config is not protected by web chat security so we pass in false.\n () => doConfigFetch(url, fetch, false, fetchParameters),\n [100, 1000, 2000, 5000],\n 'fetch init config',\n );\n } catch (error) {\n if (onError) {\n onError({\n errorType: OnErrorType.INITIAL_CONFIG,\n message: 'The init configuration data could not be loaded.',\n errorCode: (error as Response)?.status || undefined,\n otherData: await safeFetchTextWithTimeout(error as Response),\n });\n throw new Error(`${WA_CONSOLE_PREFIX} The init configuration data could not be loaded.`);\n }\n }\n\n if (!result) {\n throw new Error(`${WA_CONSOLE_PREFIX} The init configuration data could not be loaded.`);\n }\n\n const text = await safeFetchText(result);\n\n // If the result is not okay, it must be a JWT error because any other kind of errors are handled in doConfigFetch\n // which would result in that function throwing an error instead of returning a result.\n if (!result.ok) {\n const error = `The configuration for integrationID \"${publicConfig.integrationID}\" requires a valid identityToken. The chat widget will not be displayed.`;\n if (onError) {\n onError({\n errorType: OnErrorType.INITIAL_CONFIG,\n message: 'The init configuration data could not be loaded (JWT retry).',\n errorCode: result.status || undefined,\n otherData: text,\n });\n }\n consoleError(error);\n throw new Error(`${WA_CONSOLE_PREFIX} ${error}`);\n }\n\n const initConfig: RemoteInitConfig = text ? JSON.parse(text) : {};\n\n initConfig.botName = initConfig.botName || 'watsonx Assistant';\n\n if (publicConfig.__ibm__?.toolingType === ToolingType.PREVIEW_LINK && initConfig.authorization?.is_on) {\n if (onError) {\n onError({\n errorType: OnErrorType.PREVIEW_LINK_SECURITY,\n message: 'Web chat security is enabled which is not supported by the preview link.',\n });\n }\n throw new Error(`${WA_CONSOLE_PREFIX} Web chat security is enabled which is not supported by the preview link.`);\n }\n\n return initConfig;\n}\n\n/**\n * Loads the main configuration data for the widget from the integrations server. The call is authenticated with the\n * customer's JWT if one is required.\n */\nasync function getRemoteMainConfig(serviceManager: ServiceManager, allowJWTRetry = true): Promise<RemoteMainConfig> {\n const state = serviceManager.store.getState();\n const { config } = state;\n let { identityToken } = state;\n const publicConfig = config.public;\n const isSecurityEnabled = config.remote.initConfig.authorization?.is_on;\n\n // Some integrations will not have this set in the remote config. If they do not, we won't grab the new id token\n // until the request to main config fails. If folks are complaining about the extra request, they can just flip\n // the toggle for security off and back on to get the correct remote config shape. We also ignore this condition\n // in tooling where we bypass the security setting using a custom endpoint.\n if (!identityToken && isSecurityEnabled && !publicConfig.__ibm__?.toolingType) {\n await getNewIdentityToken(serviceManager, CatastrophicErrorType.FAILED);\n identityToken = serviceManager.store.getState().identityToken;\n }\n\n const url = getConfigURL(publicConfig, false);\n\n // If an identityToken is set, at it to the headers so that our call to /config does not get rejected.\n let fetchParameters: RequestInit;\n let transactionID;\n\n if (identityToken) {\n transactionID = uuid(UUIDType.MISCELLANEOUS);\n fetchParameters = {\n headers: {\n authorization: `Bearer ${identityToken}`,\n [API_DEBUGGING_HEADER_NAME]: transactionID,\n },\n };\n }\n\n let result;\n try {\n result = await doWithRetry(\n // The remote init config is not protected by web chat security so we pass in false.\n () => doConfigFetch(url, serviceManager.fetch, isSecurityEnabled, fetchParameters),\n [100, 1000, 2000, 5000],\n 'fetch main config',\n );\n } catch (error) {\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.OPEN_CONFIG,\n catastrophicErrorType: CatastrophicErrorType.FAILED,\n message: 'The main configuration data could not be loaded.',\n errorCode: (error as Response)?.status || undefined,\n otherData: await safeFetchTextWithTimeout(error as Response),\n transactionID,\n });\n throw new Error(`${WA_CONSOLE_PREFIX} The main configuration data could not be loaded.`);\n }\n\n // If the result is not okay, it must be a JWT error because any other kind of errors are handled in doConfigFetch\n // which would result in that function throwing an error instead of returning a result.\n if (result && !result.ok) {\n if (allowJWTRetry) {\n // Get a new token and then recursively call this method with allowJWTRetry set to false. You get one chance!\n await getNewIdentityToken(serviceManager, CatastrophicErrorType.FAILED);\n return getRemoteMainConfig(serviceManager, false);\n }\n serviceManager.actions.errorOccurred({\n errorType: OnErrorType.IDENTITY_TOKEN,\n catastrophicErrorType: CatastrophicErrorType.FAILED,\n message: `A valid identity token is required to communicate with the integration.`,\n errorCode: result.status,\n otherData: await safeFetchTextWithTimeout(result),\n transactionID,\n });\n throw new Error();\n }\n\n if (!result) {\n throw new Error(`${WA_CONSOLE_PREFIX} The main configuration data could not be loaded.`);\n }\n\n // At the moment, this call returns the old complete configuration data but we only want the service desk and\n // assistant data.\n const resultJSON = await result.json();\n const mainConfig: RemoteMainConfig = merge(\n {\n service_desk: resultJSON.service_desk?.config,\n assistant: resultJSON.assistant,\n },\n publicConfig.servers?.mainConfig,\n );\n return mainConfig;\n}\n\nexport {\n validateConfig,\n DEFAULT_PUBLIC_CONFIG,\n DEFAULT_REMOTE_INIT_CONFIG,\n AGENT_APP_DEFAULT_PUBLIC_CONFIG,\n AGENT_APP_DEFAULT_REMOTE_INIT_CONFIG,\n getAnalyticsPath,\n getConfigURL,\n getCDNURL,\n getWXOUrl,\n getMessageURL,\n getHistoryURL,\n doConfigFetch,\n getRemoteInitConfig,\n getRemoteMainConfig,\n getSessionURL,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { PublicConfig, ServiceDeskFactoryParameters } from 'internal-packages/shared/types/PublicConfig';\n\nimport { RenderFunctionType } from './ChatInterface';\nimport { CreateHumanAgentServiceFunction } from './services/haa/HumanAgentService';\nimport { ServiceDesk } from './services/haa/serviceDesk/ServiceDesk';\nimport { getCDNURL } from './utils/config';\nimport { WA_CONSOLE_PREFIX } from './utils/constants';\nimport { consoleError } from './utils/miscUtils';\nimport { getVersionLoaded } from './utils/versionUtils';\n\n/**\n * In this file we manage our dynamic imports for the entry of web chat. See https://webpack.js.org/guides/code-splitting/#dynamic-imports.\n */\n\nasync function importChat() {\n try {\n const { default: Chat } = await import(/* webpackChunkName: \"Chat\" */ './Chat');\n return Chat;\n } catch (error) {\n consoleError('The web chat library could not be loaded.', error);\n throw new Error(`${WA_CONSOLE_PREFIX} The web chat library could not be loaded.`);\n }\n}\n\nasync function loadRender(): Promise<RenderFunctionType> {\n const { render } = await import(/* webpackChunkName: \"render\" */ './render');\n return render;\n}\n\nasync function loadHAA(): Promise<CreateHumanAgentServiceFunction> {\n const { createService } = await import(/* webpackChunkName: \"haa\" */ './services/haa/HumanAgentServiceImpl');\n return createService;\n}\n\n/**\n * Utility function to create a new mock service desk using code splitting to avoid including this code in the main\n * bundle.\n */\nasync function createMockServiceDesk(parameters: ServiceDeskFactoryParameters): Promise<ServiceDesk> {\n const { MockServiceDesk } = await import(\n /* webpackChunkName: \"mock-sd\" */ './services/haa/serviceDesk/mock/mockServiceDesk'\n );\n return new MockServiceDesk(parameters);\n}\n\nasync function loadStylesWithReset() {\n const { default: styles } = await import(/* webpackChunkName: \"styles-reset\" */ './styles/export.legacy.scss');\n return styles;\n}\n\nasync function loadStyles() {\n const { default: styles } = await import(/* webpackChunkName: \"styles\" */ './styles/export.scss');\n return styles;\n}\n\nasync function loadFontFace(publicConfig: PublicConfig) {\n const { getFontFace } = await import(/* webpackChunkName: \"font-styles\" */ './utils/fontUtils');\n const versionLoaded = getVersionLoaded(publicConfig);\n const cdnEndpoint = getCDNURL(publicConfig);\n const baseURL = `${cdnEndpoint}/versions/${versionLoaded}`;\n return getFontFace(baseURL);\n}\n\nexport { loadRender, loadHAA, createMockServiceDesk, loadStyles, loadStylesWithReset, importChat, loadFontFace };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2023\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * This hooks runs once when a component is first mounted. It's main purpose is to hide the eslint warning without\n * risking someone using the callback with values that could change after mounting.\n */\n\nimport React, { EffectCallback, useEffect } from 'react';\n\nconst useOnMount = (callback: EffectCallback) => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(callback, []);\n};\n\nexport { useOnMount };\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2021, 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { AdditionalChatParameters } from 'internal-packages/shared/types/AdditionalChatParameters';\nimport { ChatInstance } from 'internal-packages/shared/types/ChatInstance';\nimport { Fetch } from 'internal-packages/shared/types/Fetch';\nimport { PublicConfig } from 'internal-packages/shared/types/PublicConfig';\nimport cloneDeep from 'lodash-es/cloneDeep';\nimport merge from 'lodash-es/merge';\n\nimport { ChatInterface, ConstructableChatInterface, RenderFunctionType } from './ChatInterface';\nimport { getCDNURL, getRemoteInitConfig, validateConfig } from './utils/config';\nimport { getRealFetch } from './utils/fetch';\nimport { assertType, consoleDebug, consoleError, consoleWarn } from './utils/miscUtils';\nimport { resolvablePromise } from './utils/resolvablePromise';\nimport { getSharedConfig } from './utils/sharedConfigUtils';\nimport { getVersionLoaded, VERSION } from './utils/versionUtils';\n\n// Set Carbon Chat defaults.\n\nconst CARBON_DEFAULT_PUBLIC_CONFIG: Partial<PublicConfig> = {\n themeConfig: {\n // Carbon Chat only supports AI Theme\n useAITheme: true,\n },\n servers: {\n // Carbon Chat doesn't call an external location for config.\n skipConfig: true,\n },\n __ibm__: {\n // No amplitude stuff in Carbon Chat.\n isTrackingEnabled: false,\n useShadowRoot: true,\n },\n};\n\ntype ChatConstructorPromise = (publicConfig?: PublicConfig) => Promise<ConstructableChatInterface>;\n\nlet chatConstructorPromise: ChatConstructorPromise;\n\n/**\n * Populates window.loadWatsonAssistantChat and imports Chat. The method to import is different in\n * development vs production. In development, we just use a dynamic import statement. In production, we must embed a script\n * tag that returns a promise containing the Chat class. This is because of the Module Federation Plugin. We need to wrap the code the includes\n * shared resources with remote Plugins in the entry file. To do this, we have to have a dynamic import statement as the first line\n * of code to allow webpack to take over. Unfortunately, because of versioning, we need to do some processing before we can load in\n * Chat. In development, this doesn't matter because everything is served in one giant chunk. In production, it means\n * our initial load script and the script with Chat need to be different entry points.\n *\n */\nfunction doEntry(passedChatConstructorPromise: ChatConstructorPromise) {\n chatConstructorPromise = passedChatConstructorPromise;\n const publicConfig: PublicConfig = window.watsonAssistantChatOptions;\n applySessionOverrides(publicConfig);\n\n const debug = publicConfig?.debug;\n if (debug) {\n consoleDebug('[WatsonAssistantChatEntry] Starting.');\n }\n\n if (!publicConfig) {\n if (debug) {\n consoleDebug('[WatsonAssistantChatEntry] No window.watsonAssistantChatOptions found.');\n }\n } else if (publicConfig.onLoad) {\n if (debug) {\n consoleDebug('[WatsonAssistantChatEntry] Using publicConfig.onLoad.');\n }\n loadWatsonAssistantChatWithOnLoad();\n } else if (debug) {\n consoleWarn('[WatsonAssistantChatEntry] No onLoad found in public config.');\n }\n\n (window as any).loadWatsonAssistantChat = loadWatsonAssistantChat;\n}\n\n/**\n * Looks in session storage to see if there is an object that can be used to override the page's public\n * configuration. Useful for debugging and test without having access to modifying the source page.\n */\nfunction applySessionOverrides(publicConfig: PublicConfig) {\n try {\n if (publicConfig) {\n const override = window.sessionStorage?.getItem('IBM_WAC_CONFIG_OVERRIDE');\n if (override) {\n const overrideObject: Partial<PublicConfig> = JSON.parse(override);\n consoleWarn('Applying local config override', overrideObject);\n merge(publicConfig, overrideObject);\n }\n }\n } catch (error) {\n consoleError('Error trying to apply session overrides', error);\n }\n}\n\n/**\n * Creates a new web chat instance.\n */\nasync function loadWatsonAssistantChat(publicConfig: PublicConfig): Promise<ChatInstance> {\n applySessionOverrides(publicConfig);\n if (publicConfig?.debug) {\n consoleDebug('[WatsonAssistantChatEntry] Called loadWatsonAssistantChat()', publicConfig);\n }\n const widget = await instantiateWidget(publicConfig, getRealFetch(), chatConstructorPromise);\n return startWidget(widget);\n}\n\n/**\n * This function is called when the page public config supplies an appropriate config object with an \"onLoad\"\n * function on it.\n */\nfunction loadWatsonAssistantChatWithOnLoad() {\n const publicConfig: PublicConfig = window.watsonAssistantChatOptions;\n\n if (publicConfig?.debug) {\n consoleDebug('[WatsonAssistantChatEntry] Called loadWatsonAssistantChatWithOnLoad', publicConfig);\n }\n const pageOnLoad = publicConfig.onLoad;\n\n instantiateWidget(publicConfig, getRealFetch(), chatConstructorPromise)\n .then(widget => startWidget(widget))\n .then(pageOnLoad);\n}\n\n/**\n * Create new web chat instance.\n *\n * @param pagePublicConfig The public config options object that came from the page.\n * @param fetch The instance of the fetch function to use to make network calls.\n * @param chatConstructorPromise A promise that resolves with the WatsonAssistantChat class. This can either be a\n * script tab with some onload handlers, or could be an import() statement. Because of our use of MFEs, we are\n * currently limited to the former.\n * @param asCarbonChat Lets us know we are in generic \"carbon chat\" mode.\n * @param renderOverride Function to pass into Chat class to call instead of render function.\n * @returns Promise object that resolves with your new instance. See [./instance.md](./instance.md).\n */\nasync function instantiateWidget(\n pagePublicConfig: PublicConfig,\n fetch: Fetch,\n chatConstructorPromise: ChatConstructorPromise,\n asCarbonChat?: boolean,\n renderOverride?: Promise<RenderFunctionType>,\n localInstall?: boolean,\n) {\n const loadStartTime = Date.now();\n\n let config = cloneDeep(pagePublicConfig);\n\n if (config?.debug) {\n consoleDebug('[ChatEntry] Called instantiateWidget', config);\n }\n\n if (document.location.protocol !== 'https:') {\n consoleWarn('Your page is not running with \"https\"; your data will not be sent securely.');\n }\n\n // Set carbon chat defaults\n if (asCarbonChat) {\n const carbonConfig = cloneDeep(CARBON_DEFAULT_PUBLIC_CONFIG);\n // If the Carbon Chat is using their own setup for history rather than customLoadHistory,\n // we make sure to skip loading history the native way.\n if (!config.messaging?.customLoadHistory) {\n carbonConfig.servers = carbonConfig.servers || {};\n carbonConfig.servers.skipHistory = true;\n }\n\n config = merge(config, carbonConfig);\n }\n\n validateConfig(config, asCarbonChat);\n\n // Extract the extra properties from the page config we don't want to put in to the redux store.\n const { element, onLoad, onError, ...publicConfig } = config;\n\n assertType<PublicConfig>(publicConfig);\n\n if (publicConfig.__ibm__?.skipConfig) {\n consoleWarn(`IBM skipConfig is deprecated. Use servers.skipConfig.`);\n publicConfig.servers = publicConfig.servers || {};\n publicConfig.servers.skipConfig = true;\n }\n\n if (publicConfig.__ibm__?.overrideRemoteInitConfig) {\n consoleWarn(`IBM overrideRemoteInitConfig is deprecated. Use servers.initConfig.`);\n publicConfig.servers = publicConfig.servers || {};\n publicConfig.servers.initConfig = publicConfig.__ibm__.overrideRemoteInitConfig;\n }\n\n const [remoteInitConfig, Chat] = await Promise.all([\n // Get the initial config object from the integrations server.\n asCarbonChat ? Promise.resolve({}) : getRemoteInitConfig(publicConfig, onError, fetch),\n // Load web chat client side code\n chatConstructorPromise(publicConfig),\n ]);\n\n const additionalChatParameters: AdditionalChatParameters = {\n loadVersion: asCarbonChat ? 'WatsonAssistantChatEntry' : 'CarbonChatEntry',\n onError,\n fetch,\n loadStartTime,\n asCarbonChat,\n renderOverride,\n localInstall,\n };\n\n return new Chat(publicConfig, remoteInitConfig, element, additionalChatParameters);\n}\n\n/**\n * Starts the widget and returns the chat instance.\n */\nfunction startWidget(widget: ChatInterface): Promise<ChatInstance> {\n return new Promise((resolve, reject) => {\n const start = function startWAC() {\n widget.start().then(resolve, reject);\n };\n // If web chat is injected into the head instead of the body, its *possible* web chat could start running before DOM is ready.\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', start);\n } else {\n start();\n }\n });\n}\n\n/**\n * This function returns a promise with the constructor function for Chat.\n *\n * It does so by keeping a map in the shared config on window of versions that are trying to be loaded and stores a\n * resolvablePromise there. Chat.ts will then resolve the promise after it loads.\n */\nasync function getChatConstructorPromiseFromScript(publicConfig: PublicConfig): Promise<ConstructableChatInterface> {\n const versionLoaded = getVersionLoaded(publicConfig);\n const { loadScriptPromises } = getSharedConfig();\n // If we already have a promise for this version, just return it and don't start over.\n // Rather then using versionLoaded we need to use the actual version number. This is because of custom named versions.\n // When this promise is resolved, it happens before the contructor is called so it has no way of knowning if its a\n // named or regular version. Internally, we will have to watch for loading a named version and a regular version on\n // the same page if the version in package.json is the same. This isn't a customer facing issue and not something that\n // we would ever likely come across either.\n if (loadScriptPromises[VERSION]) {\n return loadScriptPromises[VERSION];\n }\n loadScriptPromises[VERSION] = resolvablePromise<ConstructableChatInterface>();\n return new Promise((resolve, reject) => {\n const cdnEndpoint = getCDNURL(publicConfig);\n const baseURL = `${cdnEndpoint}/versions/${versionLoaded}`;\n const wacScriptElement = document.createElement('script');\n wacScriptElement.onload = async () => {\n // Of note, we use VERSION and not versionLoaded here. This is because we don't have access to that value in\n // WatsonAssistantChat.ts until the constructor is called. Chicken and egg. So we go by the \"real\" version\n // understanding there might be edge case bugs running a named development branch version and a real version\n // that have the same VERSION in package.json at the same time. This is an internal problem.\n const WatsonAssistantChat = await loadScriptPromises[VERSION];\n resolve(WatsonAssistantChat);\n };\n wacScriptElement.onerror = error => {\n reject(error);\n };\n wacScriptElement.src = `${baseURL}/chat.js`;\n document.head.appendChild(wacScriptElement);\n });\n}\n\nexport { doEntry, instantiateWidget, applySessionOverrides, startWidget, getChatConstructorPromiseFromScript };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { instantiateWidget, startWidget } from 'internal-packages/shared/chatEntryFunctions';\nimport { importChat } from 'internal-packages/shared/chatEntryImports';\nimport { RenderFunctionType } from 'internal-packages/shared/ChatInterface';\nimport type { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { BusEventType, type BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport { Dispatch, MutableRefObject, SetStateAction } from 'react';\n\nimport { ManagedWebChat } from '../types/types';\n\ninterface LoadChatArgs {\n managedWebChatRef: MutableRefObject<ManagedWebChat>;\n managedWebChat: ManagedWebChat;\n renderOverride: RenderFunctionType;\n setInstance: (instance: ChatInstance) => void;\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n setUserDefinedResponseEvents: Dispatch<SetStateAction<BusEventUserDefinedResponse[]>>;\n}\n\n/**\n * Destroys an instance of web chat and marks it destroyed.\n */\nasync function destroyWebChat(managedWebChat: ManagedWebChat, setInstance: (instance: ChatInstance) => void) {\n if (managedWebChat) {\n if (managedWebChat.instance) {\n await new Promise<void>(resolve => {\n managedWebChat.instance.destroy();\n // Some cloak and daggers because destroy isn't an async function and just fires off some events.\n setTimeout(() => {\n resolve();\n });\n });\n }\n managedWebChat.shouldDestroy = true;\n managedWebChat.instance = null;\n }\n setInstance(null);\n}\n\n/**\n * Adds a \"userDefinedResponse\" event listener to the given web chat instance that will use the given set function\n * to add new events to the list.\n */\nfunction addUserDefinedResponseHandler(\n webChatInstance: ChatInstance,\n setUserDefinedResponseEvents: Dispatch<SetStateAction<BusEventUserDefinedResponse[]>>,\n) {\n // This handler will fire each time a user defined response occurs and we will update our state by appending the\n // event to the end of our events list. We have to make sure to create a new array in order to trigger a re-render.\n function userDefinedResponseHandler(event: BusEventUserDefinedResponse) {\n setUserDefinedResponseEvents(eventsArray => eventsArray.concat(event));\n }\n\n // Also make sure to clear the list if a restart occurs.\n function restartHandler() {\n setUserDefinedResponseEvents([]);\n }\n\n webChatInstance.on({ type: BusEventType.USER_DEFINED_RESPONSE, handler: userDefinedResponseHandler });\n webChatInstance.on({ type: BusEventType.RESTART_CONVERSATION, handler: restartHandler });\n}\n\nasync function loadChat({\n managedWebChatRef,\n managedWebChat,\n renderOverride,\n setInstance,\n onBeforeRender,\n onAfterRender,\n setUserDefinedResponseEvents,\n}: LoadChatArgs) {\n // Each time the web chat config settings change (or this component is mounted), we need to destroy any previous\n // web chat and create a new web chat.\n\n // First look at the old ref and destroy it if its supposed to be destroyed.\n await destroyWebChat(managedWebChatRef.current, setInstance);\n\n // Update the ref to the new managedWebChat.\n managedWebChatRef.current = managedWebChat;\n\n // Just double check that the new one also isn't supposed to be destroyed.\n if (managedWebChat.shouldDestroy) {\n await destroyWebChat(managedWebChat, setInstance);\n return;\n }\n\n // Create web chat here.\n const widget = await instantiateWidget(\n managedWebChat.config,\n undefined, // No need to pass in a fetch since its bring your own backend.\n importChat,\n true,\n Promise.resolve(renderOverride),\n true,\n );\n\n const instance = await startWidget(widget);\n\n addUserDefinedResponseHandler(instance, setUserDefinedResponseEvents);\n\n onBeforeRender?.(instance);\n await instance.render();\n onAfterRender?.(instance);\n\n setInstance(instance);\n managedWebChat.instance = instance;\n\n if (managedWebChat.shouldDestroy) {\n await destroyWebChat(managedWebChat, setInstance);\n }\n}\n\nexport { loadChat, destroyWebChat };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\nimport { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport React, { ReactNode } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { RenderUserDefinedResponse } from '../../types/publicTypes';\n\ninterface UserDefinedResponsePortalsContainer {\n /**\n * The instance of a web chat that this component will register listeners on.\n */\n chatInstance: ChatInstance;\n\n /**\n * The function that this component will use to request the actual React content to display for each user defined\n * response.\n */\n renderResponse: RenderUserDefinedResponse;\n\n /**\n * The list of events that were fired that contain all the responses to render.\n */\n userDefinedResponseEvents: BusEventUserDefinedResponse[];\n}\n\n/**\n * This is a utility component that is used to manage all the user defined responses that are rendered by web chat.\n * When a user defined response message is received by web chat, it will fire a \"userDefinedResponse\" event that\n * provides an HTML element to which your application can attach user defined content. React portals are a mechanism\n * that allows you to render a component in your React application but attach that component to the HTML element\n * that was provided by web chat.\n *\n * This component will render a portal for each user defined response. The contents of that portal will be\n * determined by calling the provided \"renderResponse\" render prop.\n */\nfunction UserDefinedResponsePortalsContainer({\n chatInstance,\n renderResponse,\n userDefinedResponseEvents,\n}: UserDefinedResponsePortalsContainer) {\n // All we need to do to enable the React portals is to render each portal somewhere in your application (it\n // doesn't really matter where).\n return (\n <>\n {userDefinedResponseEvents.map(function mapEvent(event, index) {\n return (\n // eslint-disable-next-line react/no-array-index-key\n <UserDefinedResponseComponentPortal key={index} hostElement={event.data.element}>\n {renderResponse(event, chatInstance)}\n </UserDefinedResponseComponentPortal>\n );\n })}\n </>\n );\n}\n\n/**\n * This is the component that will attach a React portal to the given host element. The host element is the element\n * provided by web chat where your user defined response will be displayed in the DOM. This portal will attach any React\n * children passed to it under this component so you can render the response using your own React application. Those\n * children will be rendered under the given element where it lives in the DOM.\n */\nfunction UserDefinedResponseComponentPortal({\n hostElement,\n children,\n}: {\n hostElement: HTMLElement;\n children: ReactNode;\n}) {\n return ReactDOM.createPortal(children, hostElement);\n}\n\nconst UserDefinedResponsePortalsContainerExport = React.memo(UserDefinedResponsePortalsContainer);\nexport { UserDefinedResponsePortalsContainerExport as UserDefinedResponsePortalsContainer };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * This component actually loads the Chat class and renders the Chat.\n *\n * It handles writing Portals for user_defined response types as well and teardown and build activities.\n */\n\nimport { loadStyles } from 'internal-packages/shared/chatEntryImports';\nimport { RenderFunctionArgs } from 'internal-packages/shared/ChatInterface';\nimport { useOnMount } from 'internal-packages/shared/hooks/useOnMount';\nimport type { ChatInstance } from 'internal-packages/types/ChatInstance';\nimport { type BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport type { PublicConfig } from 'internal-packages/types/PublicConfig';\nimport React, { lazy, Suspense, useEffect, useRef, useState } from 'react';\n\nimport { ChatContainerProps } from '../../types/publicTypes';\nimport { ManagedWebChat } from '../../types/types';\nimport { destroyWebChat, loadChat } from '../../utils/utils';\nimport { UserDefinedResponsePortalsContainer } from './UserDefinedResponsePortalsContainer';\n\nconst App = lazy(() => import('internal-packages/shared/containers/App'));\n\ninterface AppContainerProps extends ChatContainerProps {\n /**\n * The element the web chat is hosted in. Included main window, tours and launcher.\n */\n container: HTMLElement;\n}\n\nfunction AppContainer({\n config,\n onBeforeRender,\n onAfterRender,\n renderUserDefinedResponse,\n container,\n}: AppContainerProps) {\n // A state value that contains the current instance of web chat.\n const [instance, setInstance] = useState<ChatInstance>(null);\n const [renderProps, setRenderProps] = useState<RenderFunctionArgs>(null);\n const [applicationStyles, setApplicationStyles] = useState<string>(null);\n\n // This state will be used to record all the user defined response events that are fired from the widget. These\n // events contain the HTML elements that we will attach our portals to as well as the messages that we wish to\n // render in the message.\n const [userDefinedResponseEvents, setUserDefinedResponseEvents] = useState<BusEventUserDefinedResponse[]>([]);\n\n // The most recent web chat that was load by this component.\n const managedWebChatRef = useRef<ManagedWebChat>(null);\n\n // The previous web chat config.\n const previousConfigRef = useRef<PublicConfig>(null);\n\n async function onMount() {\n const applicationStyles = await loadStyles();\n // For the npm package, we currently assume Carbon fonts are loaded on the page already.\n // This might have to change if we allow white labeling some day.\n setApplicationStyles(applicationStyles);\n }\n\n useOnMount(() => {\n onMount();\n });\n\n useEffect(() => {\n const previousConfig = previousConfigRef.current;\n previousConfigRef.current = config;\n\n async function renderOverride({ serviceManager }: RenderFunctionArgs) {\n serviceManager.container = container;\n setRenderProps({\n serviceManager,\n });\n\n if (serviceManager.customHostElement) {\n // Set container to grow to size of provided element. We don't do this sooner because \"body\" might be set to\n // display: flex;\n container.setAttribute('style', 'width:100% !important; height:100% !important');\n } else {\n // We want to make sure it doesn't interfere with the body by covering anything up so we'll set it to a 0 size.\n // The child elements use position: fixed along with a size that break out of the container.\n container.setAttribute('style', 'width:0 !important; height:0 !important');\n }\n }\n\n if (previousConfig !== config) {\n // We'll use this managed object to keep track of the web chat instance we are creating for this effect.\n const managedWebChat: ManagedWebChat = {\n instance: null,\n shouldDestroy: false,\n config,\n };\n\n loadChat({\n managedWebChatRef,\n managedWebChat,\n renderOverride,\n setInstance,\n onBeforeRender,\n onAfterRender,\n setUserDefinedResponseEvents,\n });\n\n return () => {\n destroyWebChat(managedWebChat, setInstance);\n previousConfigRef.current = null;\n };\n }\n\n return undefined;\n }, [config, container, onAfterRender, onBeforeRender]);\n\n if (instance && renderProps && applicationStyles) {\n return (\n <>\n <Suspense fallback={<div />}>\n <App\n serviceManager={renderProps.serviceManager}\n hostElement={renderProps.serviceManager.customHostElement}\n applicationStyles={applicationStyles}\n />\n\n {renderUserDefinedResponse && (\n <UserDefinedResponsePortalsContainer\n chatInstance={instance}\n renderResponse={renderUserDefinedResponse}\n userDefinedResponseEvents={userDefinedResponseEvents}\n />\n )}\n </Suspense>\n </>\n );\n }\n\n return null;\n}\n\nexport { AppContainer };\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/*\n * IMPORTANT: For compatibility with tsickle and the Closure JS compiler, all\n * property decorators (but not class decorators) in this file that have\n * an @ExportDecoratedItems annotation must be defined as a regular function,\n * not an arrow function.\n */\nexport declare type Constructor<T> = {\n new (...args: any[]): T;\n};\nexport interface ClassDescriptor {\n kind: 'class';\n elements: ClassElement[];\n finisher?: <T>(clazz: Constructor<T>) => void | Constructor<T>;\n}\nexport interface ClassElement {\n kind: 'field' | 'method';\n key: PropertyKey;\n placement: 'static' | 'prototype' | 'own';\n // eslint-disable-next-line @typescript-eslint/ban-types\n initializer?: Function;\n extras?: ClassElement[];\n finisher?: <T>(clazz: Constructor<T>) => void | Constructor<T>;\n descriptor?: PropertyDescriptor;\n}\n\n/**\n * Allow for custom element classes with private constructors\n */\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nconst legacyCustomElement = (tagName: string, clazz: CustomElementClass) => {\n try {\n customElements.define(tagName, clazz as CustomElementConstructor);\n } catch (error) {\n // console.warn(`Attempting to re-define ${tagName}`);\n }\n // Cast as any because TS doesn't recognize the return type as being a\n // subtype of the decorated class when clazz is typed as\n // `Constructor<HTMLElement>` for some reason.\n // `Constructor<HTMLElement>` is helpful to make sure the decorator is\n // applied to elements however.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return clazz as any;\n};\n\nconst standardCustomElement = (tagName: string, descriptor: ClassDescriptor) => {\n const { kind, elements } = descriptor;\n return {\n kind,\n elements,\n // This callback is called once the class is otherwise fully defined\n finisher(clazz: Constructor<HTMLElement>) {\n try {\n customElements.define(tagName, clazz);\n } catch (error) {\n // console.warn(`Attempting to re-define ${tagName}`);\n }\n },\n };\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```js\n * @carbonElement('my-element')\n * class MyElement extends LitElement {\n * render() {\n * return html``;\n * }\n * }\n * ```\n *\n * @param tagName The tag name of the custom element to define.\n */\nexport const carbonElement = (tagName: string) => (classOrDescriptor: CustomElementClass | ClassDescriptor) =>\n typeof classOrDescriptor === 'function'\n ? legacyCustomElement(tagName, classOrDescriptor)\n : standardCustomElement(tagName, classOrDescriptor as ClassDescriptor);\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/* eslint-disable react/no-deprecated */\n\n/**\n * This component is mostly a pass-through. Its takes any properties passed into the ChatContainer\n * custom element and then renders the React web chat application while passing in properties.\n */\n\nimport { consoleError } from 'internal-packages/shared/utils/miscUtils';\nimport { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { AppContainer } from '../../react/components/AppContainer';\nimport { ChatInstance } from '../../types/chatInstance';\nimport { PublicConfig } from '../../types/chatPublicConfig';\nimport { RenderUserDefinedResponse } from '../../types/publicTypes';\nimport { carbonElement } from '../decorators/customElement';\n\n@carbonElement('cds-aichat-internal')\nclass ChatContainerInternal extends LitElement {\n /**\n * The config to use to load web chat. Note that the \"onLoad\" property is overridden by this component. If you\n * need to perform any actions after web chat been loaded, use the \"onBeforeRender\" or \"onAfterRender\" props.\n */\n @property({ type: Object })\n config: PublicConfig;\n\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onBeforeRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onAfterRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * ReactDOM.render and createRoot can't be used together in the same application.\n * Web chat detects if ReactDOM is React 18 or React 17, but they could be using React 18 in React 17 mode.\n */\n @property()\n forceReact17Mode: boolean;\n\n /**\n * If this is being wrapped by React, we can handle React Portals for people.\n */\n @property()\n renderUserDefinedResponse: RenderUserDefinedResponse;\n\n // Prevent Lit from managing the shadow DOM, we will use it manually\n protected createRenderRoot() {\n return this.attachShadow({ mode: 'open' });\n }\n\n firstUpdated() {\n // Render the React component with any updated properties if necessary\n const style = document.createElement('style');\n style.textContent = `\n cds-aichat-internal {\n display: block;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n ${this.config?.element ? '' : 'z-index: var(--cds-chat-BASE-z-index);'}\n }\n .cwx-react-app {\n height: 100%;\n width: 100%;\n }\n `;\n this.appendChild(style);\n this._renderReactApp();\n }\n\n updated(changedProperties: Map<string, any>) {\n // Render the React component with any updated properties if necessary\n if (changedProperties.has('config')) {\n this._renderReactApp();\n }\n }\n\n /**\n * Track if a previous React 18 root was already created so we don't create a memory leak on re-renders.\n */\n private _root: any;\n\n private async _renderReactApp() {\n const previousContainer: HTMLElement = this.shadowRoot.querySelector('.cwx-react-app');\n previousContainer?.remove();\n const container = document.createElement('div');\n container.classList.add('cwx-react-app');\n this.shadowRoot.appendChild(container);\n if ('createRoot' in ReactDOM && !this.forceReact17Mode) {\n // Make sure we only have one root.\n if (this._root) {\n this._root.unmount();\n }\n try {\n const { createRoot } = await import('react-dom/client');\n this._root = createRoot(container);\n this._root.render(\n <AppContainer\n config={this.config}\n renderUserDefinedResponse={this.renderUserDefinedResponse}\n onBeforeRender={this.onBeforeRender}\n onAfterRender={this.onAfterRender}\n container={container}\n />,\n );\n } catch {\n // No react-dom/client.\n consoleError(\n 'Unable to render React client. If you are running an application using React 18, but you have not updated to using createRoot, please include the \"forceReact17Mode\" prop.',\n );\n }\n } else {\n // Fallback to ReactDOM.render for React 17 and earlier\n ReactDOM.render(\n <AppContainer\n config={this.config}\n renderUserDefinedResponse={this.renderUserDefinedResponse}\n onBeforeRender={this.onBeforeRender}\n onAfterRender={this.onAfterRender}\n container={container}\n />,\n container,\n );\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cds-aichat-internal': ChatContainerInternal;\n }\n}\n\nexport default ChatContainerInternal;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The ChatContainer is a light dom custom element. This is the direct export used for people using the web component\n * version of the web chat outside of a custom element. Is it also used by the React ChatContainer. It is responsible\n * for managing creating of slots to be fed into the ShadowDOM based cds-aichat-internal web component.\n *\n * Because the full chat is rendered inside the ShadowDOM, we need to give people an approach for styling their custom\n * content without resorting to figuring out build steps to inject the styles into the component itself. This component\n * works by dynamically injecting a named slot element for each user_defined event it receives.\n */\n\nimport './cds-aichat-internal';\n\nimport { WriteableElementName } from 'internal-packages/types/ChatInstance';\nimport { BusEventType, BusEventUserDefinedResponse } from 'internal-packages/types/eventBusTypes';\nimport { html, LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\n\nimport { ChatInstance } from '../../types/chatInstance';\nimport { PublicConfig } from '../../types/chatPublicConfig';\nimport { RenderUserDefinedResponse } from '../../types/publicTypes';\nimport { carbonElement } from '../decorators/customElement';\n\ninterface Slot {\n /**\n * The element itself.\n */\n element: HTMLElement;\n}\n\n/**\n * Constructed class functionality for the MarkdownText custom element\n */\n\n@carbonElement('cds-aichat-container-light')\nclass ChatContainerLight extends LitElement {\n /**\n * The config to use to load web chat. Note that the \"onLoad\" property is overridden by this component. If you\n * need to perform any actions after web chat been loaded, use the \"onBeforeRender\" or \"onAfterRender\" props.\n */\n @property({ type: Object })\n config: PublicConfig;\n\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onBeforeRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onAfterRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * ReactDOM.render and createRoot can't be used together in the same application.\n * Web chat detects if ReactDOM is React 18 or React 17, but they could be using React 18 in React 17 mode.\n */\n @property()\n forceReact17Mode: boolean;\n\n /**\n * If this is being wrapped by React, we can handle React Portals for people.\n */\n @property()\n renderUserDefinedResponse: RenderUserDefinedResponse;\n\n /**\n * The existing array of slots for all user_defined components.\n */\n @state()\n _userDefinedSlots: Slot[] = [];\n\n /**\n * The existing array of slots for all user_defined components.\n */\n @state()\n _writeableElementSlots: Slot[] = [];\n\n /**\n * The chat instance.\n */\n @state()\n _instance: ChatInstance;\n\n /**\n * Adds the slot attribute to the element for the user_defined response type and then injects it into the component by\n * updating this._slots;\n */\n _userDefinedHandler = (event: BusEventUserDefinedResponse) => {\n const { element } = event.data;\n this._userDefinedSlots = [...this._userDefinedSlots, { element }];\n };\n\n _onBeforeRenderOverride = (instance: ChatInstance) => {\n if (instance) {\n this._instance = instance;\n this._instance.on({ type: BusEventType.USER_DEFINED_RESPONSE, handler: this._userDefinedHandler });\n this._addWriteableElementSlots();\n this.onBeforeRender?.(instance);\n }\n };\n\n _addWriteableElementSlots() {\n const writeableElementSlots: Slot[] = [{ element: this._instance.customPanels.getPanel().hostElement }];\n Object.keys(this._instance.writeableElements).forEach(writeableElementKey => {\n const element = this._instance.writeableElements[writeableElementKey as WriteableElementName];\n element.setAttribute('slot', writeableElementKey);\n writeableElementSlots.push({ element });\n });\n this._writeableElementSlots = writeableElementSlots;\n }\n\n protected createRenderRoot() {\n // Force us into \"light dom\".\n return this;\n }\n\n render() {\n return html`<cds-aichat-internal\n .config=${this.config}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this._onBeforeRenderOverride}\n .renderUserDefinedResponse=${this.renderUserDefinedResponse}\n .forceReact17Mode=${this.forceReact17Mode}\n >\n ${this._writeableElementSlots.map(item => html`${item.element}`)}\n ${this._userDefinedSlots.map(item => html`${item.element}`)}\n </cds-aichat-internal>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cds-aichat-container-light': ChatContainerLight;\n }\n}\n\nexport default ChatContainerLight;\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/* eslint-disable @typescript-eslint/no-empty-interface */\n\n/**\n * This file contains the generic types for the API between a general chat widget and a chat back-end. It is\n * intended to provide base types for a standalone widget and should not contain any imports of other types.\n */\n\nimport { DeepPartial } from 'ts-essentials';\n\n/**\n * This is the main interface that represents a request from a user sent to a back-end.\n */\ninterface MessageRequest<TInputType extends BaseMessageInput = MessageInput> {\n /**\n * The input data to the back-end to make in this request.\n */\n input: TInputType;\n\n /**\n * Optional context which is added from external resources.\n */\n context?: MessageContext;\n}\n\n/**\n * The set of possible message input types in a request.\n */\nenum MessageInputType {\n /**\n * Represents a simple text message.\n */\n TEXT = 'text',\n\n /**\n * Represents an event message that can be used to send control, updates, or action information to the back-end.\n */\n EVENT = 'event',\n}\n\ninterface BaseMessageInput {\n /**\n * The type of user input.\n */\n message_type?: MessageInputType;\n}\n\n/**\n * Base interface for an event message that can be used to send control, updates, or action information to the back-end.\n */\ninterface EventInput<TEventInputType = EventInputData> extends BaseMessageInput {\n /**\n * Event messages have this as their input type.\n */\n message_type: MessageInputType.EVENT;\n\n /**\n * The type of the event.\n */\n event: TEventInputType;\n}\n\n/**\n * Input for an event. The name of the event is mandatory. Additional fields depend on the event.\n *\n * @template TNameType The type of the name property for the event. This can just be a string or it can be a\n * specific string in order to create type safety ensuring each event has the right name (e.g. \"typeof MY_EVENT_NAME\").\n */\ninterface EventInputData<TNameType extends string = string> {\n /**\n * The name of the event.\n */\n name: TNameType;\n}\n\n/**\n * The default interface for message input that is sent to a back-end in a message request. This represents basic text\n * input.\n */\ninterface MessageInput extends BaseMessageInput {\n /**\n * The text of the user input to send to the back-end.\n */\n text?: string;\n}\n\n/**\n * This interface represents the main response content that is received by a client from a back-end. It is generally\n * in response to a previous message request.\n */\ninterface MessageResponse<TGenericType = GenericItem[]> {\n /**\n * The output from the back-end to be rendered or processed by the client.\n */\n output: MessageOutput<TGenericType>;\n\n /**\n * The context information returned by the back-end.\n */\n context?: MessageContext;\n}\n\n/**\n * The output context for a message response from a back-end.\n */\ninterface MessageOutput<TGenericType = GenericItem[]> {\n /**\n * Responses intended to be processed by a generic channel. This will be an array of message response items.\n */\n generic?: TGenericType;\n}\n\n/**\n * Contextual information gathered by the service.\n */\ninterface MessageContext {\n /**\n * Global context.\n */\n global?: MessageGlobalContext;\n\n /**\n * Contains the context data for a message. The context data is divided into object for different skills that may\n * be involved with the message.\n */\n skills?: {\n /**\n * The context associated with each skill. Note that \"main skill\" and \"actions skill\" are reserved skill names\n * and should not be used outside of watsonx Assistant or watsonx Orchestrate.\n */\n [skill_name: string]: MessageSkillContext;\n };\n\n // integrations.chat.browser_info\n}\n\ninterface MessageGlobalContext {\n /**\n * Global system context\n */\n system?: MessageSystemContext;\n}\n\ninterface MessageSystemContext {\n /**\n * The current timezone of the client.\n */\n timezone?: string; // E.g.: \"Europe/Budapest\".\n\n /**\n * The current system locale. Example: \"en-US\".\n */\n locale?: string;\n}\n\n/**\n * The base interface for the content of a message context. The content of this will vary by which skill is involved\n * in the message.\n */\ninterface MessageSkillContext {}\n\n/**\n * The set of possible message types in a response from IBM watsonx Assistant.\n */\nenum MessageResponseTypes {\n /**\n * Represents a basic text response. The given text may contain rich content such as markdown.\n */\n TEXT = 'text',\n\n /**\n * A response that requests the user choose an option from a list. The list of options may be presented as a list\n * of buttons or it may be from a drop-down.\n */\n OPTION = 'option',\n\n /**\n * Indicates that the conversation should be escalated to a human agent and offers that opportunity to the user.\n */\n CONNECT_TO_AGENT = 'connect_to_agent',\n\n /**\n * Displays an image to the user.\n */\n IMAGE = 'image',\n\n /**\n * Indicates that the chat should display a pause at this point in the conversation before displaying additional\n * items.\n */\n PAUSE = 'pause',\n\n /**\n * A user defined response will be displayed according to custom logic in the client.\n */\n USER_DEFINED = 'user_defined',\n\n /**\n * Displays the contents of an iframe to the user.\n */\n IFRAME = 'iframe',\n\n /**\n * Displays a video to the user using a video player.\n */\n VIDEO = 'video',\n\n /**\n * Displays an audio clip to the user using an audio player.\n */\n AUDIO = 'audio',\n\n /**\n * Asks the user to provide a date. This may result in a date picker being presented to the user.\n */\n DATE = 'date',\n\n /**\n * Displays a table of data to the user.\n */\n TABLE = 'table',\n\n /**\n * Displays a general error message to the user and include developer info to be logged and to debug.\n */\n INLINE_ERROR = 'inline_error',\n}\n\n/**\n * The basic class for items returned from a back-end as part of a message response. These are the items contained\n * in the {@link MessageOutput.generic} array.\n */\ninterface GenericItem<TUserDefinedType = Record<string, unknown>> {\n /**\n * The response type of this message item.\n */\n response_type: MessageResponseTypes;\n\n /**\n * Metadata used identify a generic item within the context of a stream in order to correlate any updates meant\n * for a specific item.\n */\n streaming_metadata?: ItemStreamingMetadata;\n\n /**\n * An optional buckets of additional user defined properties for this item.\n */\n user_defined?: TUserDefinedType;\n}\n\n/**\n * A user defined item returned in a message response from a back-end.\n */\ninterface UserDefinedItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {}\n\n/**\n * A text item returned in a message response from a back-end.\n */\ninterface TextItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The text of the response.\n */\n text?: string;\n\n /**\n * The optional formatting for the text response.\n */\n format?: {\n /**\n * If this is true, it means we are not going to get `<br />` to manage spacing and should add margin/padding\n * to elements as required with CSS.\n */\n use_padding?: boolean;\n };\n}\n\n/**\n * A \"connect to agent\" item returned in a message response from a back-end. This is used when the back-end\n * indicates that a user's conversation should be escalated to a human agent.\n */\ninterface ConnectToAgentItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * A message to be sent to the human agent who will be taking over the conversation.\n */\n message_to_human_agent?: string;\n\n /**\n * Contains the message to be rendered if there are agents available.\n */\n agent_available?: {\n message: string;\n };\n\n /**\n * Contains the message to be rendered if there are no agents available.\n */\n agent_unavailable?: {\n message: string;\n };\n\n /**\n * When a conversation is escalated to an agent additional information is needed to fullfill the request. This\n * additional information typically is added by the channel integration and cannot be deduced from the dialog\n * itself.\n */\n transfer_info?: ConnectToAgentItemTransferInfo;\n}\n\n/**\n * Additional information as part of a {@link ConnectToAgentItem} that may be need to perform a transfer to an agent.\n */\ninterface ConnectToAgentItemTransferInfo {\n /**\n * A key used by the service desk to securely load the session history.\n */\n session_history_key?: string;\n\n /**\n * Each service desk may require different information to start the connection. It can be account details or\n * security information. This is a bucket of all the service desk specific properties.\n */\n additional_data?: {\n [key: string]: string;\n };\n\n /**\n * An initial set of message items to send to the agent.\n */\n summary_message_to_agent?: TextItem[];\n}\n\n/**\n * A pause item returned in a message response from a back-end. This indicates that the client should pause before\n * displaying additional response items.\n */\ninterface PauseItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * How long to pause, in milliseconds.\n */\n time?: number;\n\n /**\n * Whether to display an \"is typing\" indicator during the pause.\n */\n typing?: boolean;\n}\n\n/**\n * An option item returned in a message response from a back-end. This response type is used when displaying a list\n * of options to the user. How the options are displayed is up to the client but is often displayed in either a\n * drop-down or as a list of buttons.\n */\ninterface OptionItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * An array of objects describing the options from which the user can choose.\n */\n options: Option[];\n\n /**\n * An optional title to be shown alongside the options.\n */\n title?: string;\n\n /**\n * An optional description to be shown alongside the options.\n */\n description?: string;\n\n /**\n * The preferred type of control to display.\n */\n preference?: OptionItemPreference;\n}\n\n/**\n * The set of possible response preferences for an options response.\n */\nenum OptionItemPreference {\n /**\n * Indicates the options should be displayed as a drop-down.\n */\n DROPDOWN = 'dropdown',\n\n /**\n * Indicates the options should be displayed as buttons.\n */\n BUTTON = 'button',\n}\n\n/**\n * Represents an individual option that is part of an \"options\" response.\n */\ninterface Option {\n /**\n * The user-facing label for the option or disambiguation suggestion. This label is taken from the user_label property\n * of the corresponding dialog node.\n */\n label: string;\n\n value: {\n /**\n * An input object that should be sent back to the assistant when this option is chosen by a user.\n */\n input: MessageInput;\n };\n}\n\ninterface IFrameItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The source URL to an embeddable page\n */\n source: string;\n\n /**\n * The preview image of the source URL. This property is unfurled from the source URL at runtime. It is used when\n * IFrameItemDisplayOption is set to 'panel' for the preview card to open the panel.\n */\n image_url?: string;\n\n /**\n * The title of the source URL. This property is unfurled from the source URL at runtime. It is used when\n * IFrameItemDisplayOption is set to 'panel' for the preview card to open the panel.\n */\n title?: string;\n\n /**\n * The description of the source URL. This property is unfurled from the source URL at runtime. It is used when\n * IFrameItemDisplayOption is set to 'panel' for the preview card to open the panel.\n */\n description?: string;\n\n /**\n * How the iframe should be displayed.\n */\n display?: IFrameItemDisplayOption;\n}\n\n/**\n * Dimension information for displaying a media item.\n */\ninterface MediaItemDimensions {\n /**\n * This property's value is used to calculate a responsive height for web chat's media player so that its aspect\n * ratio is the same between different screen widths. This is set to a reasonable default depending on the response type\n * and other details like what service you are pulling the content from (e.g. Youtube or SoundCloud).\n */\n base_height?: number;\n}\n\n/**\n * The different ways an iframe item may be displayed.\n */\nenum IFrameItemDisplayOption {\n /**\n * The iframe is displayed inline in the main message list.\n */\n INLINE = 'inline',\n\n /**\n * The iframe is displayed in a separate panel after showing a card in the main message list.\n */\n PANEL = 'panel',\n}\n\n/**\n * A reusable media object that may need to display a title and description with an alt_text to label the item for\n * accessibility purposes. This is used by the Audio, Video and Image response types.\n */\ninterface MediaItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The url pointing to a media source, whether audio, video, or image.\n * \n * For video this can be a file like an .mp4 or a YouTube, Facebook, Vimeo, Twitch, Streamable, Wistia, or Vidyard url.\n * \n * For audio this can be a file like an .mp3 or a SoundCloud or Mixcloud url.\n */\n source: string;\n\n /**\n * The title for the item.\n */\n title?: string;\n\n /**\n * The description for the item.\n */\n description?: string;\n\n /**\n * The alt text for labeling the item. Screen readers will announce this text when the user's virtual cursor\n * is focused on the item.\n */\n alt_text?: string;\n\n /**\n * Settings that control the dimensions for the media item.\n */\n dimensions?: MediaItemDimensions;\n}\n\n/**\n * Citations for text generated by an AI to provide the user with relevant source information and context.\n */\ninterface ConversationalSearchItemCitation {\n /**\n * Optional url of the citation. May not be a valid URL.\n */\n url?: string;\n\n /**\n * Optional explanation text for the citation.\n */\n text?: string;\n\n /**\n * Optional title of the citation URL.\n */\n title?: string;\n\n /**\n * Optional zero index based integer indicating where in `text` the citation starts from.\n */\n range_start?: number;\n\n /**\n * Optional zero index based integer indicating where in `text`` the citation ends at. Exclusive.\n * So the word \"hi\", would have the range_start of 0 and range_end of 2.\n */\n range_end?: number;\n\n /**\n * A number corresponding to the index of the matching search result. This can be used to gather extra info about a\n * specific citation from the matching search result.\n */\n search_result_idx?: number;\n}\n\n/**\n * A text response generated by AI with an optional list of citations for where the information came from.\n */\ninterface ConversationalSearchItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * The returned conversational text. Any HTML/Markdown will be ignored.\n */\n text: string;\n\n /**\n * A title to display above the citation list, default set to \"How do we know?\".\n */\n citations_title: string;\n\n /**\n * A string to explain that these results are generated, default set to \"Accuracy of generated answers may vary.\".\n */\n disclaimer: string;\n\n /**\n * Citations are used to connect specific text within a conversational search response with the relevant documents\n * returned by the backend.\n */\n citations?: ConversationalSearchItemCitation[];\n}\n\n/**\n * An inline error response generated by a conversational skill provider with a user-friendly text and developer debug info.\n */\ninterface InlineErrorItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * Some end user friendly text describing the error and what they should do next.\n * \n * If no specific text is passed, the client is responsible for fallback generic error message text.\n */\n text?: string;\n\n /**\n * Relevant debug info intended to be passed on to developers.\n * \n * This information should not include anything sensitive that might reveal details about our back-end environment that should not be public.\n */\n debug?: {\n /**\n * The error code of any underlying error, despite the service returning 200.\n */\n statusCode?: number;\n\n /**\n * Developer-friendly error text.\n */\n text?: string;\n\n /**\n * Any additional key-value pairs for debugging.\n */\n info?: Record<string, unknown>;\n };\n}\n\n/**\n * The image response type definition. This is currently the same as {@link MediaItem}.\n */\ntype ImageItem = MediaItem;\n\n/**\n * The video response type definition for future reuse. This is currently the same as {@link MediaItem}.\n */\ntype VideoItem = MediaItem;\n\n/**\n * The audio response type definition for future reuse. This is currently the same as {@link MediaItem}.\n */\ntype AudioItem = MediaItem;\n\n/**\n * This is the response item that represents a request for a date which should prompt the client to use a date picker or\n * similar control to provide a date. There are currently no additional properties of the response.\n */\ntype DateItem = GenericItem;\n\ntype TableItemCell = string | number;\n\n/**\n * A table item returned in a message response from a back-end. This response type is used when displaying a table of data to the user.\n * The content of the table is up to the client and is authored using json.\n */\ninterface TableItem<TUserDefinedType = Record<string, unknown>> extends GenericItem<TUserDefinedType> {\n /**\n * Optional title for the table.\n */\n title?: string;\n\n /**\n * Optional description of the table.\n */\n description?: string;\n\n /**\n * The array of headers for the table.\n */\n headers: TableItemCell[];\n\n /**\n * The array of row objects for the table.\n */\n rows: TableItemRow[];\n}\n\ntype TableItemRowExpandableSectionItem = TextItem | ImageItem | VideoItem | AudioItem | IFrameItem | UserDefinedItem;\n\ninterface TableItemRow {\n /**\n * Data for a specific cell.\n */\n cells: TableItemCell[];\n\n /**\n * A section that can expand beneath each row which contains an array of items exactly like the message api's output.generic array.\n */\n expandable_section?: TableItemRowExpandableSectionItem[];\n}\n\n/**\n * Additional metadata associated with a specific message item (response type) inside of a message response.\n */\ninterface ItemStreamingMetadata {\n /**\n * An identifier for this item within the full message response. This ID is used to correlate a partial or\n * complete item chunk with other chunks that represent the same item. This ID is only unique for a given message\n * response.\n */\n id: string;\n}\n\ninterface Chunk {\n /**\n * Additional metadata associated with the stream.\n */\n streaming_metadata?: {\n /**\n * The ID of the complete message response object. This ID will be the ID of the full message that is received\n * in the final chunk of the stream.\n */\n response_id: string;\n };\n}\n\n/**\n * The interface for a chunk that represents a partial update (or first time chunk) to a message item.\n */\ninterface PartialItemChunk extends Chunk {\n /**\n * The partial details of the item. The client will decide what rules to follow for merging this in with any\n * existing data for the same item (which is identified using the {@link ItemStreamingMetadata.id} property).\n */\n partial_item: DeepPartial<GenericItem>;\n}\n\n/**\n * The interface for a chunk that represents a complete update to a message item. The item provided here should have\n * all the data necessary to render the item including any data that was previously received from partial chunks.\n * This chunk may contain corrections to previous chunks.\n */\ninterface CompleteItemChunk extends Chunk {\n complete_item: GenericItem;\n}\n\n/**\n * The interface for a chunk that represents the entire completed message response. The response provided here\n * should have all the data necessary to render the response including any data that was previously received from item\n * chunks. This final response may contain corrections to previous chunks.\n *\n * The ID of the message should match the ID that was previously provided by {@link PartialItemChunk.streaming_metadata.id}.\n */\ninterface FinalResponseChunk {\n final_response: MessageResponse;\n}\n\ntype StreamChunk = PartialItemChunk | CompleteItemChunk | FinalResponseChunk;\n\n/**\n * Profile information about a specific agent that can be used to display information to the user. This may\n * represent a human agent or a virtual/bot agent.\n */\nexport interface AgentProfile {\n /**\n * A unique identifier for this agent.\n */\n id: string;\n\n /**\n * The visible name for the agent. Can be the full name or just a first name.\n */\n nickname: string;\n\n /**\n * An url pointing to an avatar for the agent.\n */\n profile_picture_url?: string;\n}\n\nexport {\n AudioItem,\n BaseMessageInput,\n Chunk,\n CompleteItemChunk,\n ConnectToAgentItem,\n ConnectToAgentItemTransferInfo,\n ConversationalSearchItem,\n ConversationalSearchItemCitation,\n DateItem,\n EventInput,\n EventInputData,\n FinalResponseChunk,\n GenericItem,\n IFrameItem,\n IFrameItemDisplayOption,\n ImageItem,\n ItemStreamingMetadata,\n MediaItem,\n MediaItemDimensions,\n MessageContext,\n MessageGlobalContext,\n MessageInput,\n MessageInputType,\n MessageOutput,\n MessageRequest,\n MessageResponse,\n MessageResponseTypes,\n MessageSkillContext,\n MessageSystemContext,\n Option,\n OptionItem,\n OptionItemPreference,\n PartialItemChunk,\n PauseItem,\n StreamChunk,\n TableItem,\n TableItemCell,\n TableItemRow,\n TableItemRowExpandableSectionItem,\n TextItem,\n UserDefinedItem,\n VideoItem,\n InlineErrorItem,\n};\n","/**\n *\n * IBM Confidential\n *\n * (C) Copyright IBM Corp. 2024\n *\n * The source code for this program is not published or otherwise\n * divested of its trade secrets, irrespective of what has been\n * deposited with the U. S. Copyright Office\n *\n * US Government Users Restricted Rights - Use, duplication or\n * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n *\n */\n\n/**\n * The ChatContainer is a light dom custom element. It just is a wrapper for ChatContainerLight\n * to hide props that are meant only for the React component.\n */\n\nimport '../chat/web-components/components/cds-aichat-container-light';\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport {\n AgentAppConfig,\n AudioItem,\n BaseMessageInput,\n BusEventAgentAreAnyAgentsOnline,\n BusEventAgentEndChat,\n BusEventAgentPreEndChat,\n BusEventAgentPreReceive,\n BusEventAgentPreSend,\n BusEventAgentPreSessionHistory,\n BusEventAgentPreStartChat,\n BusEventAgentReceive,\n BusEventAgentSend,\n BusEventChatReady,\n BusEventChunkUserDefinedResponse,\n BusEventClosePanelButtonClicked,\n BusEventCustomPanelClose,\n BusEventCustomPanelOpen,\n BusEventCustomPanelPreClose,\n BusEventCustomPanelPreOpen,\n BusEventGenesysMessengerAuthError,\n BusEventGenesysMessengerAuthProvider,\n BusEventGenesysMessengerGetAuthCode,\n BusEventGenesysMessengerLoggedOut,\n BusEventGenesysMessengerReauthenticate,\n BusEventHistoryBegin,\n BusEventHistoryEnd,\n BusEventMessageItemCustom,\n BusEventNiceDFOGetAuthCode,\n BusEventPreReceive,\n BusEventPreReset,\n BusEventPreSend,\n BusEventReceive,\n BusEventReset,\n BusEventSend,\n BusEventTourEnd,\n BusEventTourStart,\n BusEventTourStep,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n BusEventViewPreChange,\n CarbonTheme,\n ChatInstance,\n Chunk,\n CompleteItemChunk,\n ConnectToAgentItem,\n ConversationalSearchItem,\n ConversationalSearchItemCitation,\n CornersType,\n CustomSendMessageOptions,\n DateItem,\n DisclaimerPublicConfig,\n EventInput,\n EventInputData,\n FinalResponseChunk,\n GenericItem,\n HeaderConfig,\n HistoryItem,\n IFrameItem,\n IFrameItemDisplayOption,\n ImageItem,\n ItemStreamingMetadata,\n LayoutConfig,\n MediaItem,\n MediaItemDimensions,\n MessageContext,\n MessageGlobalContext,\n MessageHistory,\n MessageInput,\n MessageInputType,\n MessageOutput,\n MessageRequest,\n MessageResponse,\n MessageResponseTypes,\n MessageSkillContext,\n MinimizeButtonIconType,\n OnErrorData,\n Option,\n OptionItem,\n OptionItemPreference,\n PageLinkConfig,\n PageLinkIDConfig,\n PartialItemChunk,\n PauseItem,\n PublicConfig,\n PublicConfigMessaging,\n StreamChunk,\n TextItem,\n ThemeConfig,\n UpdateHistoryEvent,\n UserDefinedItem,\n VideoItem,\n ViewState,\n ViewType,\n} from '../aiChatTypes';\nimport { carbonElement } from '../chat/web-components/decorators/customElement';\n\n/**\n * cds-aichat-container class\n */\n@carbonElement('cds-aichat-container')\nclass ChatContainer extends LitElement {\n /**\n * The config to use to load web chat. Note that the \"onLoad\" property is overridden by this component. If you\n * need to perform any actions after web chat been loaded, use the \"onBeforeRender\" or \"onAfterRender\" props.\n */\n @property({ type: Object })\n config: PublicConfig;\n\n /**\n * This function is called before the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onBeforeRender: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of web chat is called. This function can return a Promise\n * which will cause web chat to wait for it before rendering.\n */\n @property()\n onAfterRender: (instance: ChatInstance) => Promise<void> | void;\n\n protected createRenderRoot() {\n // Force us into \"light dom\".\n return this;\n }\n\n /**\n * Renders the template while passing in class functionality\n */\n render() {\n return html`<cds-aichat-container-light\n .config=${this.config}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this.onBeforeRender}\n />`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'cds-aichat-container': ChatContainer;\n }\n}\n\nexport {\n AgentAppConfig,\n AudioItem,\n BaseMessageInput,\n BusEventAgentAreAnyAgentsOnline,\n BusEventAgentEndChat,\n BusEventAgentPreEndChat,\n BusEventAgentPreReceive,\n BusEventAgentPreSend,\n BusEventAgentPreSessionHistory,\n BusEventAgentPreStartChat,\n BusEventAgentReceive,\n BusEventAgentSend,\n BusEventChatReady,\n BusEventChunkUserDefinedResponse,\n BusEventClosePanelButtonClicked,\n BusEventCustomPanelClose,\n BusEventCustomPanelOpen,\n BusEventCustomPanelPreClose,\n BusEventCustomPanelPreOpen,\n BusEventGenesysMessengerAuthError,\n BusEventGenesysMessengerAuthProvider,\n BusEventGenesysMessengerGetAuthCode,\n BusEventGenesysMessengerLoggedOut,\n BusEventGenesysMessengerReauthenticate,\n BusEventHistoryBegin,\n BusEventHistoryEnd,\n BusEventMessageItemCustom,\n BusEventNiceDFOGetAuthCode,\n BusEventPreReceive,\n BusEventPreReset,\n BusEventPreSend,\n BusEventReceive,\n BusEventReset,\n BusEventSend,\n BusEventTourEnd,\n BusEventTourStart,\n BusEventTourStep,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n BusEventViewPreChange,\n CarbonTheme,\n ChatInstance,\n Chunk,\n CompleteItemChunk,\n ConnectToAgentItem,\n ConversationalSearchItem,\n ConversationalSearchItemCitation,\n CornersType,\n CustomSendMessageOptions,\n DateItem,\n DisclaimerPublicConfig,\n EventInput,\n EventInputData,\n FinalResponseChunk,\n GenericItem,\n HeaderConfig,\n HistoryItem,\n IFrameItem,\n IFrameItemDisplayOption,\n ImageItem,\n ItemStreamingMetadata,\n LayoutConfig,\n MediaItem,\n MediaItemDimensions,\n MessageContext,\n MessageGlobalContext,\n MessageHistory,\n MessageInput,\n MessageInputType,\n MessageOutput,\n MessageRequest,\n MessageResponse,\n MessageResponseTypes,\n MessageSkillContext,\n MinimizeButtonIconType,\n OnErrorData,\n Option,\n OptionItem,\n OptionItemPreference,\n PageLinkConfig,\n PageLinkIDConfig,\n PartialItemChunk,\n PauseItem,\n PublicConfig,\n PublicConfigMessaging,\n StreamChunk,\n TextItem,\n ThemeConfig,\n UpdateHistoryEvent,\n UserDefinedItem,\n VideoItem,\n ViewState,\n ViewType,\n ChatContainer,\n};\n\nexport default ChatContainer;\n"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","FileStatusValue","ViewType","LauncherType","MinimizeButtonIconType","ClosePanelIconDirection","CarbonTheme","CornersType","OnErrorType","CatastrophicErrorType","ChatWidthBreakpoint","AlternateSuggestionsPanelState","AlternateSuggestionsSection","WriteableElementName","InputFieldType","SuppressedError","HEADER_ACCEPT","HEADER_CONTENT_TYPE","HEADER_AUTHORIZATION","MIME_JSON","MIME_STREAM","MIME_JSON_STREAM","WA_CONSOLE_PREFIX","API_DEBUGGING_HEADER_NAME","AGENT_APP_HEADER_NAME","RIGHT_TO_LEFT_MARK","String","fromCharCode","ENGLISH_US_DATE_FORMAT","RESPONSE_TYPE_TIMEOUT_MS","DEFAULT_CUSTOM_PANEL_ID","INTEGRATIONS_VERSION","WINDOW_WARNING","CUSTOM_RESPONSE_WARNING","AWS_REGION_FRAGMENT","WXO_CLOUD_REGION_FRAGMENT","THROW_ERROR","Error","BrandColorKind","CAROUSEL_MAX_WIDTH","FULL_WIDTH_CITATION_MAX_WIDTH","AUTO_SCROLL_EXTRA","LIGHT_THEMES","isJest","process","env","JEST_WORKER_ID","error","IS_JEST","AUTO_SCROLL_THROTTLE_TIMEOUT","async","sleep","milliseconds","Promise","resolve","setTimeout","resolveOrTimeout","promise","duration","errorMessage","timeout","reject","race","enableDebugLog","enableDebugStackTracesLog","assertType","item","debugLog","message","args","console","log","debugStackTrace","consoleError","consoleLog","consoleDebug","debug","consoleWarn","warn","setEnableDebugLog","setEnableDebugStackTracesLog","isEnableDebugLog","safeFetchText","response","text","safeFetchTextWithTimeout","safeFetchJSON","json","createDidCatchErrorData","component","errorInfo","isCatastrophicError","errorType","RENDER","otherData","catastrophicErrorType","FAILED","getResponsiveElementPaddingValue","baseHeight","isValidForUpload","upload","status","EDIT","isError","callOnError","onError","data","getBotName","useAITheme","config","botName","public","__ibm__","botNameOverride","remote","initConfig","asCarbonChat","StatusCodes","WXOMentionType","ToolingType","ConnectToAgentBehaviorType","LauncherToolingPreviewType","eq","value","other","assocIndexOf","array","splice","Array","prototype","ListCache","entries","index","this","clear","entry","set","__data__","size","pop","call","get","undefined","has","push","freeGlobal","global","freeSelf","self","root","Function","Symbol","objectProto","hasOwnProperty","nativeObjectToString","toString","symToStringTag","toStringTag","nullTag","undefinedTag","baseGetTag","isOwn","tag","unmasked","e","result","getRawTag","objectToString","isObject","type","asyncTag","funcTag","genTag","proxyTag","isFunction","uid","coreJsData","maskSrcKey","exec","keys","IE_PROTO","funcToString","toSource","func","reIsHostCtor","funcProto","reIsNative","RegExp","replace","baseIsNative","test","getNative","object","getValue","Map","nativeCreate","Hash","getMapData","map","MapCache","hash","string","Stack","pairs","LARGE_ARRAY_SIZE","baseAssignValue","configurable","enumerable","writable","assignMergeValue","baseFor","iteratee","keysFunc","iterable","props","freeExports","exports","nodeType","freeModule","module","Buffer","allocUnsafe","cloneBuffer","buffer","isDeep","slice","constructor","copy","Uint8Array","cloneArrayBuffer","arrayBuffer","byteLength","cloneTypedArray","typedArray","byteOffset","copyArray","source","objectCreate","create","baseCreate","proto","overArg","transform","arg","getPrototype","getPrototypeOf","isPrototype","Ctor","initCloneObject","isObjectLike","baseIsArguments","propertyIsEnumerable","isArguments","isArray","MAX_SAFE_INTEGER","isLength","isArrayLike","isBuffer","objectTag","objectCtorString","typedArrayTags","baseUnary","freeProcess","nodeUtil","types","require","binding","nodeIsTypedArray","isTypedArray","safeGet","assignValue","objValue","copyObject","customizer","isNew","newValue","reIsUint","isIndex","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","n","baseTimes","baseKeysIn","nativeKeysIn","isProto","keysIn","baseMergeDeep","srcIndex","mergeFunc","stack","srcValue","stacked","isCommon","isTyped","isPlainObject","toPlainObject","baseMerge","identity","nativeMax","Math","max","baseSetToString","nativeNow","Date","now","count","lastCalled","setToString","stamp","remaining","apply","baseRest","start","otherArgs","thisArg","overRest","createAssigner","assigner","sources","guard","isIterateeCall","merge","VERSION","WWX_CDN_ENDPOINT","AMPLITUDE_API_KEY","NODE_ENV","DEFAULT_ALLOWED_RESPONSES","Set","doWithRetry","retryFunction","delayTimes","operationTitle","attemptNumber","delayTime","doWithRetryWithTimeout","timeoutMs","throwOnStatus","responsePromise","allowedCodes","ensureChatBrowserWindowConfigExists","window","watsonAssistantChatSharedConfig","namespaces","loadScriptPromises","getSharedConfig","NamespaceService","namespace","originalName","attributeSafe","getAttributeSafe","suffix","computedName","computeNamespaceName","getSuffix","remove","computedNamespace","namespaceIndexToRemove","indexOf","removeNamespace","charCodeAt","djb2Hash","trim","validateNamespace","andAdd","includes","addNamespace","CarbonThemeClassNames","ButtonKindEnum","ButtonSizeEnum","ButtonTooltipAlignmentEnum","NotificationType","BOUNCING_ANIMATION_TIMEOUTS","SetCache","values","add","arraySome","predicate","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","bitmask","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","mapToArray","forEach","setToArray","boolTag","dateTag","errorTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","symbolProto","symbolValueOf","valueOf","arrayPush","offset","baseGetAllKeys","symbolsFunc","stubArray","nativeGetSymbols","getOwnPropertySymbols","getSymbols","resIndex","arrayFilter","symbol","nativeKeys","baseKeys","getAllKeys","DataView","WeakMap","promiseTag","weakMapTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ArrayBuffer","ctorString","argsTag","arrayTag","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","name","convert","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","objLength","objStacked","skipCtor","objCtor","othCtor","equalObjects","baseIsEqual","isEqual","mergeWith","replaceCurrentArrayValue","currentValue","isEmptyObject","property","mergeNoArrays","objects","deepFreeze","freeze","getOwnPropertyNames","prop","isFrozen","getVersionLoaded","publicConfig","useExactVersion","clientVersion","DEFAULT_LAUNCHER","mobile","title","time_to_expand","new_expand_time","time_to_reduce","notification_type","TEXT_NOTIFICATION","desktop","DEFAULT_CUSTOM_PANEL_CONFIG_OPTIONS","hideBackButton","hidePanelHeader","disableAnimation","DEFAULT_CUSTOM_PANEL_STATE","isOpen","panelID","options","DEFAULT_IFRAME_PANEL_STATE","messageItem","DEFAULT_CITATION_PANEL_STATE","citationItem","relatedSearchResult","DEFAULT_BRANDING_STATE","is_on","showBanner","DEFAULT_TOUR_STATE","activeTourStepItems","DEFAULT_MESSAGE_PANEL_STATE","localMessageItem","isMessageForInput","DEFAULT_ALTERNATE_SUGGESTIONS_STATE","showButton","allowCollapse","panelState","CLOSED","contactItem","starters","suggestionListItems","showSearchSection","searchResults","searchResultsLoading","searchResultsText","VIEW_STATE_ALL_CLOSED","launcher","mainWindow","tour","VIEW_STATE_LAUNCHER_OPEN","VIEW_STATE_MAIN_WINDOW_OPEN","DEFAULT_PERSISTED_TO_BROWSER","chatState","version","sessionID","sessionStartedTimestamp","updateHistoryUserDefinedCount","disclaimersAccepted","homeScreenState","isHomeScreenOpen","showBackToBot","hasSentNonWelcomeMessage","suggestionsPersistedState","numStrikes","selectedIndex","selectedSection","persistedTourState","activeTourID","activeTourCurrentStepIndex","agentState","isConnected","isSuspended","agentProfiles","launcherState","wasLoadedFromBrowser","viewState","activeTour","showUnreadIndicator","mobileLauncherIsExtended","mobileLauncherWasReduced","mobileLauncherDisableBounce","desktopLauncherIsExpanded","desktopLauncherWasMinimized","bounceTurn","DEFAULT_CHAT_MESSAGES_STATE","localMessageIDs","messageIDs","isTypingCounter","isLoadingCounter","isScrollAnchored","DEFAULT_MESSAGE_STATE","allMessageItemsByID","allMessagesByID","botMessageState","DEFAULT_INPUT_STATE","fieldVisible","isReadonly","files","allowFileUploads","allowMultipleFileUploads","allowedFileUploadTypes","DEFAULT_AGENT_STATE","isConnecting","isReconnecting","numUnreadMessages","fileUploadInProgress","showScreenShareRequest","isScreenSharing","isAgentTyping","inputState","DEFAULT_THEME_STATE","carbonTheme","G10","corners","ROUND","carbon_theme","use_ai_theme","DEFAULT_STREAMING_STATE","enabled","DEFAULT_LAYOUT_STATE","showFrame","hasContentMaxWidth","calcAnnouncementForBrandingPanel","previousState","newIsPanelOpen","brandingState","announceMessage","messageID","applyBotMessageState","state","newState","handleViewStateChange","persistedToBrowserStorage","isBrowserPageVisible","newViewState","addEventMessage","pendingLogs","eventMessages","setHomeScreenOpenState","keepIfEqual","oldObject","newObject","HomeScreenBackgroundType","mergeHomeScreenConfig","publicHomeScreenConfig","remoteHomeScreenConfig","convertHomeScreenConfigToBackgroundIfBackgroundGradient","newHomeScreenConfig","background","isEmpty","background_gradient","gradient_direction","BOTTOM_UP","TOP_CORNER_OUT","NONE","withoutEmptyStarters","newConfig","buttons","filter","button","Boolean","label","InvalidTokenError","base64UrlDecode","str","output","decodeURIComponent","atob","m","p","code","toUpperCase","b64DecodeUnicode","err","JWT_MALFORMED_TEXT","JWT_BAD_FORMAT","JWT_EXPIRED_TEXT","IDENTITY_EXPIRED_TIMEOUT","isJWTError","statusCode","isSecurityEnabled","resultText","FORBIDDEN","BAD_REQUEST","UNAUTHORIZED","assertJWTValid","jwt","sub","exp","info","consoleInfo","getNewIdentityToken","serviceManager","identityExpiredMessage","identityToken","eventBus","fire","instance","actions","errorOccurred","IDENTITY_TOKEN","updateIdentityToken","getNewIdentityTokenIfExpiring","decodedToken","doDecodeJWT","store","getState","getTime","jwtString","token","pos","header","part","split","decoded","JSON","parse","jwtDecode","getRandomValues","rnds8","rng","crypto","bind","byteToHex","UUIDType","native","randomUUID","v4","buf","rnds","random","arr","unsafeStringify","uuid","originalUUID","REGION_MAP","dev","staging","getRegionHostname","region","DEFAULT_PUBLIC_CONFIG","openChatByDefault","showLauncher","shouldTakeFocusIfOpensAutomatically","agentAppConfig","servers","serviceDesk","messaging","copyPreviousContextOnRequest","isTrackingEnabled","logTrackObjects","connectToAgentBehavior","ERROR_MISSING","enableFeatures","wxo","DEFAULT_REMOTE_INIT_CONFIG","home_screen","alternate_suggestions","branding_config","launcher_config","AGENT_APP_DEFAULT_PUBLIC_CONFIG","headerConfig","hideMinimizeButton","disableCustomElementMobileEnhancements","disclaimer","isOn","AGENT_APP_DEFAULT_REMOTE_INIT_CONFIG","authorization","AGENT_APP_SLUG","CHAT_SLUG","getBaseURL","regionHostname","assistantURLPrefix","subscriptionID","getCPDBaseChatURL","agentAppOverride","cpdURL","cloudPrivateHostURL","integrationSlug","integrationID","getCDNURL","webChatScriptPrefix","getWXOUrl","versionLoaded","getConfigURL","customURL","customInitConfigURL","customConfigURL","cpdBaseURL","baseURL","configTypeParam","getMessageURL","customMessageURL","getSessionURL","getAnalyticsPath","getHistoryURL","customHistoryPrefix","doConfigFetch","configUrl","fetch","fetchParameters","ok","TOO_MANY_REQUESTS","responseText","getRemoteMainConfig","allowJWTRetry","toolingType","url","transactionID","MISCELLANEOUS","headers","OPEN_CONFIG","errorCode","resultJSON","service_desk","assistant","mainConfig","importChat","default","Chat","import","loadRender","render","loadHAA","createService","createMockServiceDesk","parameters","MockServiceDesk","loadStylesWithReset","styles","loadStyles","loadFontFace","getFontFace","useOnMount","callback","useEffect","getSymbolsIn","getAllKeysIn","reFlags","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","initCloneByTag","regexp","dataView","cloneDataView","lastIndex","nodeIsMap","isMap","nodeIsSet","isSet","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","cloneableTags","baseClone","isFlat","isFull","input","initCloneArray","isFunc","copySymbolsIn","baseAssignIn","copySymbols","baseAssign","subValue","arrayEach","cloneDeep","CARBON_DEFAULT_PUBLIC_CONFIG","themeConfig","skipConfig","useShadowRoot","instantiateWidget","pagePublicConfig","chatConstructorPromise","renderOverride","localInstall","loadStartTime","document","location","protocol","carbonConfig","customLoadHistory","skipHistory","customSendMessage","validateConfig","element","onLoad","overrideRemoteInitConfig","remoteInitConfig","all","loadVersion","destroyWebChat","managedWebChat","setInstance","destroy","shouldDestroy","loadChat","managedWebChatRef","onBeforeRender","onAfterRender","setUserDefinedResponseEvents","current","widget","then","readyState","addEventListener","startWidget","webChatInstance","on","handler","event","eventsArray","concat","addUserDefinedResponseHandler","UserDefinedResponseComponentPortal","hostElement","children","ReactDOM","createPortal","UserDefinedResponsePortalsContainerExport","React","memo","chatInstance","renderResponse","userDefinedResponseEvents","createElement","Fragment","App","lazy","h","AppContainer","renderUserDefinedResponse","container","useState","renderProps","setRenderProps","applicationStyles","setApplicationStyles","useRef","previousConfigRef","onMount","previousConfig","customHostElement","setAttribute","Suspense","fallback","UserDefinedResponsePortalsContainer","carbonElement","tagName","classOrDescriptor","clazz","customElements","define","legacyCustomElement","descriptor","kind","elements","finisher","standardCustomElement","ChatContainerInternal","LitElement","createRenderRoot","attachShadow","mode","firstUpdated","style","textContent","appendChild","_renderReactApp","updated","changedProperties","previousContainer","shadowRoot","querySelector","classList","forceReact17Mode","_root","unmount","createRoot","ChatContainerLight","_userDefinedSlots","_writeableElementSlots","_userDefinedHandler","_onBeforeRenderOverride","_instance","_addWriteableElementSlots","writeableElementSlots","customPanels","getPanel","writeableElements","writeableElementKey","html","MessageInputType","MessageResponseTypes","OptionItemPreference","IFrameItemDisplayOption","ChatContainer","ChatContainer$1"],"mappings":"mNAsDO,SAASA,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,EACrH,GAAuB,iBAAZQ,SAAoD,mBAArBA,QAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,QAC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,CAAKA,KAAAA,GAUJ,CAAA,IC7VD,IAAMC,GAAN,cAA4BpC,EAsBhB,gBAAAC,GAER,OAAO9yB,IACR,CAKD,MAAA4pB,GACE,OAAOgL,CAAI;gBACC50B,KAAKxB;uBACEwB,KAAKgvB;wBACJhvB,KAAK+uB;OAE1B,GA9BDn4B,EAAA,CADCqe,EAAS,CAAE7S,KAAM9K,UACG29B,GAAAr1B,UAAA,cAAA,GAOrBhJ,EAAA,CADCqe,KACgEggB,GAAAr1B,UAAA,sBAAA,GAOjEhJ,EAAA,CADCqe,KAC+DggB,GAAAr1B,UAAA,qBAAA,GApB5Dq1B,GAAar+B,EAAA,CADlBo7B,GAAc,yBACTiD,IA+IN,IAAAC,GAAeD","x_google_ignoreList":[0,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,146,148,150,151,152,154,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177]}
|