react-instantsearch 7.30.0 → 7.31.0
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/cjs/components/AutocompleteSearch.js +4 -1
- package/dist/cjs/components/ChatMessageLoader.js +16 -0
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/widgets/Autocomplete.js +19 -11
- package/dist/cjs/widgets/Chat.js +3 -3
- package/dist/es/components/AutocompleteSearch.d.ts +4 -1
- package/dist/es/components/AutocompleteSearch.js +4 -1
- package/dist/es/components/ChatMessageLoader.d.ts +1 -0
- package/dist/es/components/ChatMessageLoader.js +8 -0
- package/dist/es/components/index.d.ts +1 -0
- package/dist/es/components/index.js +1 -0
- package/dist/es/index.js +1 -0
- package/dist/es/widgets/Autocomplete.js +19 -11
- package/dist/es/widgets/Chat.d.ts +1 -1
- package/dist/es/widgets/Chat.js +3 -3
- package/dist/umd/ReactInstantSearch.js +320 -104
- package/dist/umd/ReactInstantSearch.min.js +3 -3
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! React InstantSearch 7.
|
|
1
|
+
/*! React InstantSearch 7.31.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
26
26
|
|
|
27
|
-
var version$2 = '7.
|
|
27
|
+
var version$2 = '7.31.0';
|
|
28
28
|
|
|
29
29
|
function _define_property(obj, key, value) {
|
|
30
30
|
if (key in obj) {
|
|
@@ -1507,6 +1507,12 @@
|
|
|
1507
1507
|
* This doesn't contain any beta/hidden features.
|
|
1508
1508
|
* @private
|
|
1509
1509
|
*/ SearchParameters.PARAMETERS = Object.keys(new SearchParameters());
|
|
1510
|
+
// Returns a finite number or null. Used to reject Infinity/-Infinity from parseFloat.
|
|
1511
|
+
function parseFiniteFloat(value) {
|
|
1512
|
+
var n = parseFloat(value);
|
|
1513
|
+
// global isFinite is safe here: n is always a number type (no string coercion risk)
|
|
1514
|
+
return isFinite(n) ? n : null;
|
|
1515
|
+
}
|
|
1510
1516
|
/**
|
|
1511
1517
|
* @private
|
|
1512
1518
|
* @param {object} partialState full or part of a state
|
|
@@ -1532,8 +1538,18 @@
|
|
|
1532
1538
|
var value = partialState[k];
|
|
1533
1539
|
if (typeof value === 'string') {
|
|
1534
1540
|
var parsedValue = parseFloat(value);
|
|
1535
|
-
|
|
1536
|
-
|
|
1541
|
+
if (isNaN(parsedValue)) {
|
|
1542
|
+
// originally an unparseable string like "all", keep NaN
|
|
1543
|
+
numbers[k] = value;
|
|
1544
|
+
} else if (!isFinite(parsedValue)) {
|
|
1545
|
+
// Infinity/-Infinity — convert to null
|
|
1546
|
+
numbers[k] = null;
|
|
1547
|
+
} else {
|
|
1548
|
+
numbers[k] = parsedValue;
|
|
1549
|
+
}
|
|
1550
|
+
} else if (typeof value === 'number' && !isFinite(value)) {
|
|
1551
|
+
// Already-numeric Infinity — convert to null
|
|
1552
|
+
numbers[k] = null;
|
|
1537
1553
|
}
|
|
1538
1554
|
});
|
|
1539
1555
|
// there's two formats of insideBoundingBox, we need to parse
|
|
@@ -1542,7 +1558,13 @@
|
|
|
1542
1558
|
numbers.insideBoundingBox = partialState.insideBoundingBox.map(function(geoRect) {
|
|
1543
1559
|
if (Array.isArray(geoRect)) {
|
|
1544
1560
|
return geoRect.map(function(value) {
|
|
1545
|
-
|
|
1561
|
+
if (typeof value === 'string') {
|
|
1562
|
+
return parseFiniteFloat(value);
|
|
1563
|
+
}
|
|
1564
|
+
if (typeof value === 'number' && !isFinite(value)) {
|
|
1565
|
+
return null;
|
|
1566
|
+
}
|
|
1567
|
+
return value;
|
|
1546
1568
|
});
|
|
1547
1569
|
}
|
|
1548
1570
|
return geoRect;
|
|
@@ -1559,12 +1581,17 @@
|
|
|
1559
1581
|
if (Array.isArray(v)) {
|
|
1560
1582
|
return v.map(function(vPrime) {
|
|
1561
1583
|
if (typeof vPrime === 'string') {
|
|
1562
|
-
return
|
|
1584
|
+
return parseFiniteFloat(vPrime);
|
|
1585
|
+
}
|
|
1586
|
+
if (typeof vPrime === 'number' && !isFinite(vPrime)) {
|
|
1587
|
+
return null;
|
|
1563
1588
|
}
|
|
1564
1589
|
return vPrime;
|
|
1565
1590
|
});
|
|
1566
1591
|
} else if (typeof v === 'string') {
|
|
1567
|
-
return
|
|
1592
|
+
return parseFiniteFloat(v);
|
|
1593
|
+
} else if (typeof v === 'number' && !isFinite(v)) {
|
|
1594
|
+
return null;
|
|
1568
1595
|
}
|
|
1569
1596
|
return v;
|
|
1570
1597
|
});
|
|
@@ -3892,7 +3919,7 @@
|
|
|
3892
3919
|
function requireVersion() {
|
|
3893
3920
|
if (hasRequiredVersion) return version$1;
|
|
3894
3921
|
hasRequiredVersion = 1;
|
|
3895
|
-
version$1 = '3.28.
|
|
3922
|
+
version$1 = '3.28.2';
|
|
3896
3923
|
return version$1;
|
|
3897
3924
|
}
|
|
3898
3925
|
|
|
@@ -9684,7 +9711,7 @@
|
|
|
9684
9711
|
};
|
|
9685
9712
|
}
|
|
9686
9713
|
|
|
9687
|
-
var version = '4.
|
|
9714
|
+
var version = '4.95.0';
|
|
9688
9715
|
|
|
9689
9716
|
function hydrateSearchClient(client, results) {
|
|
9690
9717
|
if (!results) {
|
|
@@ -10990,6 +11017,25 @@
|
|
|
10990
11017
|
return bindEventForHits;
|
|
10991
11018
|
}
|
|
10992
11019
|
|
|
11020
|
+
function addQueryID(hits, queryID) {
|
|
11021
|
+
if (!queryID) {
|
|
11022
|
+
return hits;
|
|
11023
|
+
}
|
|
11024
|
+
return hits.map(function(hit) {
|
|
11025
|
+
return _object_spread_props(_object_spread({}, hit), {
|
|
11026
|
+
__queryID: queryID
|
|
11027
|
+
});
|
|
11028
|
+
});
|
|
11029
|
+
}
|
|
11030
|
+
|
|
11031
|
+
function addAbsolutePosition(hits, page, hitsPerPage) {
|
|
11032
|
+
return hits.map(function(hit, idx) {
|
|
11033
|
+
return _object_spread_props(_object_spread({}, hit), {
|
|
11034
|
+
__position: hitsPerPage * page + idx + 1
|
|
11035
|
+
});
|
|
11036
|
+
});
|
|
11037
|
+
}
|
|
11038
|
+
|
|
10993
11039
|
var withUsage$p = createDocumentationMessageGenerator({
|
|
10994
11040
|
name: 'autocomplete',
|
|
10995
11041
|
connector: true
|
|
@@ -11036,7 +11082,7 @@
|
|
|
11036
11082
|
}
|
|
11037
11083
|
var sendEventMap = {};
|
|
11038
11084
|
var indices = scopedResults.map(function(scopedResult) {
|
|
11039
|
-
var _scopedResult_results
|
|
11085
|
+
var _scopedResult_results;
|
|
11040
11086
|
// We need to escape the hits because highlighting
|
|
11041
11087
|
// exposes HTML tags to the end-user.
|
|
11042
11088
|
if (scopedResult.results) {
|
|
@@ -11047,10 +11093,11 @@
|
|
|
11047
11093
|
helper: scopedResult.helper,
|
|
11048
11094
|
widgetType: _this.$$type
|
|
11049
11095
|
});
|
|
11096
|
+
var hits = scopedResult.results ? addQueryID(addAbsolutePosition(scopedResult.results.hits, scopedResult.results.page, scopedResult.results.hitsPerPage), scopedResult.results.queryID) : [];
|
|
11050
11097
|
return {
|
|
11051
11098
|
indexId: scopedResult.indexId,
|
|
11052
11099
|
indexName: ((_scopedResult_results = scopedResult.results) === null || _scopedResult_results === void 0 ? void 0 : _scopedResult_results.index) || '',
|
|
11053
|
-
hits:
|
|
11100
|
+
hits: hits,
|
|
11054
11101
|
results: scopedResult.results || {}
|
|
11055
11102
|
};
|
|
11056
11103
|
});
|
|
@@ -11453,12 +11500,81 @@
|
|
|
11453
11500
|
return Promise.resolve(value);
|
|
11454
11501
|
}
|
|
11455
11502
|
|
|
11503
|
+
var tryParseJson = function tryParseJson(value) {
|
|
11504
|
+
try {
|
|
11505
|
+
return JSON.parse(value);
|
|
11506
|
+
} catch (unused) {
|
|
11507
|
+
return undefined;
|
|
11508
|
+
}
|
|
11509
|
+
};
|
|
11510
|
+
var repairPartialJson = function repairPartialJson(value) {
|
|
11511
|
+
var repaired = value.trim();
|
|
11512
|
+
if (!repaired) {
|
|
11513
|
+
return repaired;
|
|
11514
|
+
}
|
|
11515
|
+
var inString = false;
|
|
11516
|
+
var isEscaped = false;
|
|
11517
|
+
var stack = [];
|
|
11518
|
+
for(var index = 0; index < repaired.length; index++){
|
|
11519
|
+
var char = repaired[index];
|
|
11520
|
+
if (inString) {
|
|
11521
|
+
if (isEscaped) {
|
|
11522
|
+
isEscaped = false;
|
|
11523
|
+
} else if (char === '\\') {
|
|
11524
|
+
isEscaped = true;
|
|
11525
|
+
} else if (char === '"') {
|
|
11526
|
+
inString = false;
|
|
11527
|
+
}
|
|
11528
|
+
continue;
|
|
11529
|
+
}
|
|
11530
|
+
if (char === '"') {
|
|
11531
|
+
inString = true;
|
|
11532
|
+
continue;
|
|
11533
|
+
}
|
|
11534
|
+
if (char === '{' || char === '[') {
|
|
11535
|
+
stack.push(char);
|
|
11536
|
+
continue;
|
|
11537
|
+
}
|
|
11538
|
+
if (char === '}' && stack[stack.length - 1] === '{') {
|
|
11539
|
+
stack.pop();
|
|
11540
|
+
continue;
|
|
11541
|
+
}
|
|
11542
|
+
if (char === ']' && stack[stack.length - 1] === '[') {
|
|
11543
|
+
stack.pop();
|
|
11544
|
+
}
|
|
11545
|
+
}
|
|
11546
|
+
if (inString && !isEscaped) {
|
|
11547
|
+
repaired += '"';
|
|
11548
|
+
}
|
|
11549
|
+
repaired = repaired.replace(RegExp(",\\s*$", "u"), '');
|
|
11550
|
+
if (stack.length > 0) {
|
|
11551
|
+
repaired += stack.reverse().map(function(opening) {
|
|
11552
|
+
return opening === '{' ? '}' : ']';
|
|
11553
|
+
}).join('');
|
|
11554
|
+
}
|
|
11555
|
+
return repaired.replace(RegExp(",\\s*([}\\]])", "gu"), '$1');
|
|
11556
|
+
};
|
|
11557
|
+
var parseToolInputDelta = function parseToolInputDelta(accumulatedRawInput, fallbackInput) {
|
|
11558
|
+
var normalized = accumulatedRawInput.trim();
|
|
11559
|
+
if (!normalized) {
|
|
11560
|
+
return fallbackInput;
|
|
11561
|
+
}
|
|
11562
|
+
var directParsed = tryParseJson(normalized);
|
|
11563
|
+
if (directParsed !== undefined) {
|
|
11564
|
+
return directParsed;
|
|
11565
|
+
}
|
|
11566
|
+
var repairedParsed = tryParseJson(repairPartialJson(normalized));
|
|
11567
|
+
if (repairedParsed !== undefined) {
|
|
11568
|
+
return repairedParsed;
|
|
11569
|
+
}
|
|
11570
|
+
return fallbackInput;
|
|
11571
|
+
};
|
|
11456
11572
|
/**
|
|
11457
11573
|
* Abstract base class for chat implementations.
|
|
11458
11574
|
*/ var AbstractChat = /*#__PURE__*/ function() {
|
|
11459
11575
|
function AbstractChat(param) {
|
|
11460
11576
|
var _this = this;
|
|
11461
|
-
var _param_generateId = param.generateId, generateId$1 = _param_generateId === void 0 ? generateId : _param_generateId, _param_id = param.id, id = _param_id === void 0 ? generateId$1() : _param_id, transport = param.transport, state = param.state, onError = param.onError, onToolCall = param.onToolCall, onFinish = param.onFinish, onData = param.onData, sendAutomaticallyWhen = param.sendAutomaticallyWhen;
|
|
11577
|
+
var _param_generateId = param.generateId, generateId$1 = _param_generateId === void 0 ? generateId : _param_generateId, _param_id = param.id, id = _param_id === void 0 ? generateId$1() : _param_id, transport = param.transport, state = param.state, onError = param.onError, onToolCall = param.onToolCall, onFinish = param.onFinish, onData = param.onData, sendAutomaticallyWhen = param.sendAutomaticallyWhen, shouldRepairToolInput = param.shouldRepairToolInput;
|
|
11462
11578
|
var _this1 = this;
|
|
11463
11579
|
_class_call_check(this, AbstractChat);
|
|
11464
11580
|
_define_property(this, "id", void 0);
|
|
@@ -11470,6 +11586,7 @@
|
|
|
11470
11586
|
_define_property(this, "onFinish", void 0);
|
|
11471
11587
|
_define_property(this, "onData", void 0);
|
|
11472
11588
|
_define_property(this, "sendAutomaticallyWhen", void 0);
|
|
11589
|
+
_define_property(this, "shouldRepairToolInput", void 0);
|
|
11473
11590
|
_define_property(this, "activeResponse", null);
|
|
11474
11591
|
_define_property(this, "jobExecutor", new SerialJobExecutor());
|
|
11475
11592
|
/**
|
|
@@ -11679,6 +11796,7 @@
|
|
|
11679
11796
|
this.onFinish = onFinish;
|
|
11680
11797
|
this.onData = onData;
|
|
11681
11798
|
this.sendAutomaticallyWhen = sendAutomaticallyWhen;
|
|
11799
|
+
this.shouldRepairToolInput = shouldRepairToolInput;
|
|
11682
11800
|
}
|
|
11683
11801
|
_create_class(AbstractChat, [
|
|
11684
11802
|
{
|
|
@@ -11781,6 +11899,7 @@
|
|
|
11781
11899
|
// Track current text/reasoning part state
|
|
11782
11900
|
var currentTextPartId;
|
|
11783
11901
|
var currentReasoningPartId;
|
|
11902
|
+
var toolRawInputByCallId = {};
|
|
11784
11903
|
// Promise chain for handling tool calls that return promises
|
|
11785
11904
|
var pendingToolCall = Promise.resolve();
|
|
11786
11905
|
return new Promise(function(resolve) {
|
|
@@ -11919,11 +12038,14 @@
|
|
|
11919
12038
|
case 'tool-input-start':
|
|
11920
12039
|
{
|
|
11921
12040
|
if (!currentMessage) break;
|
|
12041
|
+
var initialRawInput = typeof chunk.input === 'string' ? chunk.input : chunk.input !== undefined ? JSON.stringify(chunk.input) : '';
|
|
12042
|
+
toolRawInputByCallId[chunk.toolCallId] = initialRawInput;
|
|
11922
12043
|
var toolPart = {
|
|
11923
12044
|
type: "tool-".concat(chunk.toolName),
|
|
11924
12045
|
toolCallId: chunk.toolCallId,
|
|
11925
12046
|
state: 'input-streaming',
|
|
11926
12047
|
input: chunk.input,
|
|
12048
|
+
rawInput: initialRawInput || undefined,
|
|
11927
12049
|
providerExecuted: chunk.providerExecuted
|
|
11928
12050
|
};
|
|
11929
12051
|
currentMessage = _object_spread_props(_object_spread({}, currentMessage), {
|
|
@@ -11936,11 +12058,47 @@
|
|
|
11936
12058
|
}
|
|
11937
12059
|
case 'tool-input-delta':
|
|
11938
12060
|
{
|
|
12061
|
+
var _ref, _ref1, _chunk_toolName, _ref2;
|
|
12062
|
+
var _existingPart_type, _this_shouldRepairToolInput, _this1;
|
|
12063
|
+
if (!currentMessage) break;
|
|
12064
|
+
var toolIndex = currentMessage.parts.findIndex(function(p) {
|
|
12065
|
+
return 'toolCallId' in p && p.toolCallId === chunk.toolCallId;
|
|
12066
|
+
});
|
|
12067
|
+
var existingPart = toolIndex >= 0 ? currentMessage.parts[toolIndex] : null;
|
|
12068
|
+
var previousRawInput = (_ref = (_ref1 = existingPart === null || existingPart === void 0 ? void 0 : existingPart.rawInput) !== null && _ref1 !== void 0 ? _ref1 : toolRawInputByCallId[chunk.toolCallId]) !== null && _ref !== void 0 ? _ref : '';
|
|
12069
|
+
var nextRawInput = "".concat(previousRawInput).concat(chunk.inputTextDelta);
|
|
12070
|
+
toolRawInputByCallId[chunk.toolCallId] = nextRawInput;
|
|
12071
|
+
var toolName = (_chunk_toolName = chunk.toolName) !== null && _chunk_toolName !== void 0 ? _chunk_toolName : existingPart === null || existingPart === void 0 ? void 0 : (_existingPart_type = existingPart.type) === null || _existingPart_type === void 0 ? void 0 : _existingPart_type.replace('tool-', '');
|
|
12072
|
+
var shouldRepair = toolName ? (_ref2 = (_this_shouldRepairToolInput = (_this1 = _this).shouldRepairToolInput) === null || _this_shouldRepairToolInput === void 0 ? void 0 : _this_shouldRepairToolInput.call(_this1, toolName)) !== null && _ref2 !== void 0 ? _ref2 : true : true;
|
|
12073
|
+
var parsedInput = shouldRepair ? parseToolInputDelta(nextRawInput, existingPart === null || existingPart === void 0 ? void 0 : existingPart.input) : existingPart === null || existingPart === void 0 ? void 0 : existingPart.input;
|
|
12074
|
+
var nextToolPart = _object_spread_props(_object_spread({}, existingPart !== null && existingPart !== void 0 ? existingPart : {
|
|
12075
|
+
type: "tool-".concat(chunk.toolName),
|
|
12076
|
+
toolCallId: chunk.toolCallId
|
|
12077
|
+
}), {
|
|
12078
|
+
state: 'input-streaming',
|
|
12079
|
+
input: parsedInput,
|
|
12080
|
+
rawInput: nextRawInput
|
|
12081
|
+
});
|
|
12082
|
+
if (toolIndex >= 0) {
|
|
12083
|
+
var updatedParts4 = _to_consumable_array(currentMessage.parts);
|
|
12084
|
+
updatedParts4[toolIndex] = nextToolPart;
|
|
12085
|
+
currentMessage = _object_spread_props(_object_spread({}, currentMessage), {
|
|
12086
|
+
parts: updatedParts4
|
|
12087
|
+
});
|
|
12088
|
+
} else {
|
|
12089
|
+
currentMessage = _object_spread_props(_object_spread({}, currentMessage), {
|
|
12090
|
+
parts: _to_consumable_array(currentMessage.parts).concat([
|
|
12091
|
+
nextToolPart
|
|
12092
|
+
])
|
|
12093
|
+
});
|
|
12094
|
+
}
|
|
12095
|
+
_this.state.replaceMessage(currentMessageIndex, currentMessage);
|
|
11939
12096
|
break;
|
|
11940
12097
|
}
|
|
11941
12098
|
case 'tool-input-available':
|
|
11942
12099
|
{
|
|
11943
12100
|
if (!currentMessage) break;
|
|
12101
|
+
delete toolRawInputByCallId[chunk.toolCallId];
|
|
11944
12102
|
// Find existing tool part or create new one
|
|
11945
12103
|
var existingIndex = currentMessage.parts.findIndex(function(p) {
|
|
11946
12104
|
return 'toolCallId' in p && p.toolCallId === chunk.toolCallId;
|
|
@@ -11954,10 +12112,10 @@
|
|
|
11954
12112
|
providerExecuted: chunk.providerExecuted
|
|
11955
12113
|
};
|
|
11956
12114
|
if (existingIndex >= 0) {
|
|
11957
|
-
var
|
|
11958
|
-
|
|
12115
|
+
var updatedParts5 = _to_consumable_array(currentMessage.parts);
|
|
12116
|
+
updatedParts5[existingIndex] = toolPart1;
|
|
11959
12117
|
currentMessage = _object_spread_props(_object_spread({}, currentMessage), {
|
|
11960
|
-
parts:
|
|
12118
|
+
parts: updatedParts5
|
|
11961
12119
|
});
|
|
11962
12120
|
} else {
|
|
11963
12121
|
currentMessage = _object_spread_props(_object_spread({}, currentMessage), {
|
|
@@ -11974,7 +12132,8 @@
|
|
|
11974
12132
|
toolCall: {
|
|
11975
12133
|
toolName: chunk.toolName,
|
|
11976
12134
|
toolCallId: chunk.toolCallId,
|
|
11977
|
-
input: chunk.input
|
|
12135
|
+
input: chunk.input,
|
|
12136
|
+
dynamic: 'dynamic' in chunk ? chunk.dynamic : undefined
|
|
11978
12137
|
}
|
|
11979
12138
|
});
|
|
11980
12139
|
if (result && typeof result.then === 'function') {
|
|
@@ -11988,20 +12147,21 @@
|
|
|
11988
12147
|
case 'tool-output-available':
|
|
11989
12148
|
{
|
|
11990
12149
|
if (!currentMessage) break;
|
|
11991
|
-
var
|
|
12150
|
+
var toolIndex1 = currentMessage.parts.findIndex(function(p) {
|
|
11992
12151
|
return 'toolCallId' in p && p.toolCallId === chunk.toolCallId;
|
|
11993
12152
|
});
|
|
11994
|
-
if (
|
|
11995
|
-
|
|
11996
|
-
var
|
|
11997
|
-
|
|
12153
|
+
if (toolIndex1 >= 0) {
|
|
12154
|
+
delete toolRawInputByCallId[chunk.toolCallId];
|
|
12155
|
+
var updatedParts6 = _to_consumable_array(currentMessage.parts);
|
|
12156
|
+
var existingPart1 = updatedParts6[toolIndex1];
|
|
12157
|
+
updatedParts6[toolIndex1] = _object_spread_props(_object_spread({}, existingPart1), {
|
|
11998
12158
|
state: 'output-available',
|
|
11999
12159
|
output: chunk.output,
|
|
12000
12160
|
callProviderMetadata: chunk.callProviderMetadata,
|
|
12001
12161
|
preliminary: chunk.preliminary
|
|
12002
12162
|
});
|
|
12003
12163
|
currentMessage = _object_spread_props(_object_spread({}, currentMessage), {
|
|
12004
|
-
parts:
|
|
12164
|
+
parts: updatedParts6
|
|
12005
12165
|
});
|
|
12006
12166
|
_this.state.replaceMessage(currentMessageIndex, currentMessage);
|
|
12007
12167
|
}
|
|
@@ -12010,21 +12170,22 @@
|
|
|
12010
12170
|
case 'tool-error':
|
|
12011
12171
|
{
|
|
12012
12172
|
if (!currentMessage) break;
|
|
12013
|
-
var
|
|
12173
|
+
var toolIndex2 = currentMessage.parts.findIndex(function(p) {
|
|
12014
12174
|
return 'toolCallId' in p && p.toolCallId === chunk.toolCallId;
|
|
12015
12175
|
});
|
|
12016
|
-
if (
|
|
12176
|
+
if (toolIndex2 >= 0) {
|
|
12017
12177
|
var _chunk_input;
|
|
12018
|
-
|
|
12019
|
-
var
|
|
12020
|
-
|
|
12178
|
+
delete toolRawInputByCallId[chunk.toolCallId];
|
|
12179
|
+
var updatedParts7 = _to_consumable_array(currentMessage.parts);
|
|
12180
|
+
var existingPart2 = updatedParts7[toolIndex2];
|
|
12181
|
+
updatedParts7[toolIndex2] = _object_spread_props(_object_spread({}, existingPart2), {
|
|
12021
12182
|
state: 'output-error',
|
|
12022
12183
|
errorText: chunk.errorText,
|
|
12023
|
-
input: (_chunk_input = chunk.input) !== null && _chunk_input !== void 0 ? _chunk_input :
|
|
12184
|
+
input: (_chunk_input = chunk.input) !== null && _chunk_input !== void 0 ? _chunk_input : existingPart2.input,
|
|
12024
12185
|
callProviderMetadata: chunk.callProviderMetadata
|
|
12025
12186
|
});
|
|
12026
12187
|
currentMessage = _object_spread_props(_object_spread({}, currentMessage), {
|
|
12027
|
-
parts:
|
|
12188
|
+
parts: updatedParts7
|
|
12028
12189
|
});
|
|
12029
12190
|
_this.state.replaceMessage(currentMessageIndex, currentMessage);
|
|
12030
12191
|
}
|
|
@@ -12941,6 +13102,14 @@
|
|
|
12941
13102
|
return new Chat$1(_object_spread_props(_object_spread({}, options), {
|
|
12942
13103
|
transport: transport,
|
|
12943
13104
|
sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
|
|
13105
|
+
shouldRepairToolInput: function shouldRepairToolInput(toolName) {
|
|
13106
|
+
var tool = tools[toolName];
|
|
13107
|
+
if (!tool && toolName.startsWith("".concat(SearchIndexToolType$1, "_"))) {
|
|
13108
|
+
tool = tools[SearchIndexToolType$1];
|
|
13109
|
+
}
|
|
13110
|
+
if (!tool) return true;
|
|
13111
|
+
return Boolean(tool.streamInput);
|
|
13112
|
+
},
|
|
12944
13113
|
onToolCall: function onToolCall(param) {
|
|
12945
13114
|
var toolCall = param.toolCall;
|
|
12946
13115
|
var tool = tools[toolCall.toolName];
|
|
@@ -13475,25 +13644,6 @@
|
|
|
13475
13644
|
return useConnector(connectCurrentRefinements, props, additionalWidgetProperties);
|
|
13476
13645
|
}
|
|
13477
13646
|
|
|
13478
|
-
function addAbsolutePosition(hits, page, hitsPerPage) {
|
|
13479
|
-
return hits.map(function(hit, idx) {
|
|
13480
|
-
return _object_spread_props(_object_spread({}, hit), {
|
|
13481
|
-
__position: hitsPerPage * page + idx + 1
|
|
13482
|
-
});
|
|
13483
|
-
});
|
|
13484
|
-
}
|
|
13485
|
-
|
|
13486
|
-
function addQueryID(hits, queryID) {
|
|
13487
|
-
if (!queryID) {
|
|
13488
|
-
return hits;
|
|
13489
|
-
}
|
|
13490
|
-
return hits.map(function(hit) {
|
|
13491
|
-
return _object_spread_props(_object_spread({}, hit), {
|
|
13492
|
-
__queryID: queryID
|
|
13493
|
-
});
|
|
13494
|
-
});
|
|
13495
|
-
}
|
|
13496
|
-
|
|
13497
13647
|
var withUsage$k = createDocumentationMessageGenerator({
|
|
13498
13648
|
name: 'frequently-bought-together',
|
|
13499
13649
|
connector: true
|
|
@@ -17498,37 +17648,13 @@
|
|
|
17498
17648
|
};
|
|
17499
17649
|
}
|
|
17500
17650
|
|
|
17501
|
-
function createButtonComponent(param) {
|
|
17502
|
-
var createElement = param.createElement;
|
|
17503
|
-
return function Button(userProps) {
|
|
17504
|
-
var _userProps_variant = userProps.variant, variant = _userProps_variant === void 0 ? 'primary' : _userProps_variant, _userProps_size = userProps.size, size = _userProps_size === void 0 ? 'md' : _userProps_size, _userProps_iconOnly = userProps.iconOnly, iconOnly = _userProps_iconOnly === void 0 ? false : _userProps_iconOnly, className = userProps.className, children = userProps.children, props = _object_without_properties(userProps, [
|
|
17505
|
-
"variant",
|
|
17506
|
-
"size",
|
|
17507
|
-
"iconOnly",
|
|
17508
|
-
"className",
|
|
17509
|
-
"children"
|
|
17510
|
-
]);
|
|
17511
|
-
return /*#__PURE__*/ createElement("button", _object_spread({
|
|
17512
|
-
type: "button",
|
|
17513
|
-
className: cx('ais-Button', "ais-Button--".concat(variant), "ais-Button--".concat(size), iconOnly && 'ais-Button--icon-only', className)
|
|
17514
|
-
}, props), children);
|
|
17515
|
-
};
|
|
17516
|
-
}
|
|
17517
|
-
|
|
17518
17651
|
function createAutocompleteDetachedFormContainerComponent(param) {
|
|
17519
17652
|
var createElement = param.createElement;
|
|
17520
|
-
var Button = createButtonComponent({
|
|
17521
|
-
createElement: createElement
|
|
17522
|
-
});
|
|
17523
17653
|
return function AutocompleteDetachedFormContainer(userProps) {
|
|
17524
|
-
var children = userProps.children, _userProps_classNames = userProps.classNames, classNames = _userProps_classNames === void 0 ? {} : _userProps_classNames
|
|
17654
|
+
var children = userProps.children, _userProps_classNames = userProps.classNames, classNames = _userProps_classNames === void 0 ? {} : _userProps_classNames;
|
|
17525
17655
|
return /*#__PURE__*/ createElement("div", {
|
|
17526
17656
|
className: cx('ais-AutocompleteDetachedFormContainer', classNames.detachedFormContainer)
|
|
17527
|
-
}, children
|
|
17528
|
-
variant: "ghost",
|
|
17529
|
-
className: cx('ais-AutocompleteDetachedCancelButton', classNames.detachedCancelButton),
|
|
17530
|
-
onClick: onCancel
|
|
17531
|
-
}, translations.detachedCancelButtonText));
|
|
17657
|
+
}, children);
|
|
17532
17658
|
};
|
|
17533
17659
|
}
|
|
17534
17660
|
|
|
@@ -17661,6 +17787,16 @@
|
|
|
17661
17787
|
d: "M16.041 15.856c-0.034 0.026-0.067 0.055-0.099 0.087s-0.060 0.064-0.087 0.099c-1.258 1.213-2.969 1.958-4.855 1.958-1.933 0-3.682-0.782-4.95-2.050s-2.050-3.017-2.050-4.95 0.782-3.682 2.050-4.95 3.017-2.050 4.95-2.050 3.682 0.782 4.95 2.050 2.050 3.017 2.050 4.95c0 1.886-0.745 3.597-1.959 4.856zM21.707 20.293l-3.675-3.675c1.231-1.54 1.968-3.493 1.968-5.618 0-2.485-1.008-4.736-2.636-6.364s-3.879-2.636-6.364-2.636-4.736 1.008-6.364 2.636-2.636 3.879-2.636 6.364 1.008 4.736 2.636 6.364 3.879 2.636 6.364 2.636c2.125 0 4.078-0.737 5.618-1.968l3.675 3.675c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414z"
|
|
17662
17788
|
}));
|
|
17663
17789
|
}
|
|
17790
|
+
function BackIcon(param) {
|
|
17791
|
+
var createElement = param.createElement;
|
|
17792
|
+
return /*#__PURE__*/ createElement("svg", {
|
|
17793
|
+
className: "ais-AutocompleteBackIcon",
|
|
17794
|
+
viewBox: "0 0 24 24",
|
|
17795
|
+
fill: "currentColor"
|
|
17796
|
+
}, /*#__PURE__*/ createElement("path", {
|
|
17797
|
+
d: "M9.828 11H21a1 1 0 110 2H9.828l3.586 3.586a1 1 0 01-1.414 1.414l-5.3-5.3a1 1 0 010-1.414l5.3-5.3a1 1 0 111.414 1.414L9.828 11z"
|
|
17798
|
+
}));
|
|
17799
|
+
}
|
|
17664
17800
|
|
|
17665
17801
|
function createAutocompleteDetachedSearchButtonComponent(param) {
|
|
17666
17802
|
var createElement = param.createElement;
|
|
@@ -17704,7 +17840,7 @@
|
|
|
17704
17840
|
function createAutocompleteIndexComponent(param) {
|
|
17705
17841
|
var createElement = param.createElement;
|
|
17706
17842
|
return function AutocompleteIndex(userProps) {
|
|
17707
|
-
var items = userProps.items, HeaderComponent = userProps.HeaderComponent, ItemComponent = userProps.ItemComponent, NoResultsComponent = userProps.NoResultsComponent, getItemProps = userProps.getItemProps, _userProps_classNames = userProps.classNames, classNames = _userProps_classNames === void 0 ? {} : _userProps_classNames;
|
|
17843
|
+
var items = userProps.items, HeaderComponent = userProps.HeaderComponent, ItemComponent = userProps.ItemComponent, NoResultsComponent = userProps.NoResultsComponent, getItemProps = userProps.getItemProps, sendEvent = userProps.sendEvent, _userProps_classNames = userProps.classNames, classNames = _userProps_classNames === void 0 ? {} : _userProps_classNames;
|
|
17708
17844
|
if (items.length === 0 && !NoResultsComponent) {
|
|
17709
17845
|
return null;
|
|
17710
17846
|
}
|
|
@@ -17727,7 +17863,13 @@
|
|
|
17727
17863
|
return /*#__PURE__*/ createElement("li", _object_spread_props(_object_spread({
|
|
17728
17864
|
key: "".concat(itemProps.id, ":").concat(item.objectID)
|
|
17729
17865
|
}, itemProps), {
|
|
17730
|
-
className: cx('ais-AutocompleteIndexItem', classNames.item, className)
|
|
17866
|
+
className: cx('ais-AutocompleteIndexItem', classNames.item, className),
|
|
17867
|
+
onClick: function onClick() {
|
|
17868
|
+
sendEvent === null || sendEvent === void 0 ? void 0 : sendEvent('click:internal', item, 'Hit Clicked');
|
|
17869
|
+
},
|
|
17870
|
+
onAuxClick: function onAuxClick() {
|
|
17871
|
+
sendEvent === null || sendEvent === void 0 ? void 0 : sendEvent('click:internal', item, 'Hit Clicked');
|
|
17872
|
+
}
|
|
17731
17873
|
}), /*#__PURE__*/ createElement(ItemComponent, {
|
|
17732
17874
|
item: item,
|
|
17733
17875
|
onSelect: onSelect,
|
|
@@ -18118,7 +18260,9 @@
|
|
|
18118
18260
|
function createAutocompleteSearchComponent(param) {
|
|
18119
18261
|
var createElement = param.createElement;
|
|
18120
18262
|
return function AutocompleteSearch(userProps) {
|
|
18121
|
-
var inputProps = userProps.inputProps, onClear = userProps.onClear, query = userProps.query, isSearchStalled = userProps.isSearchStalled, onAiModeClick = userProps.onAiModeClick;
|
|
18263
|
+
var inputProps = userProps.inputProps, onClear = userProps.onClear, query = userProps.query, isSearchStalled = userProps.isSearchStalled, onCancel = userProps.onCancel, isDetached = userProps.isDetached, submitTitle = userProps.submitTitle, onAiModeClick = userProps.onAiModeClick;
|
|
18264
|
+
var isBackButton = Boolean(isDetached && onCancel);
|
|
18265
|
+
var resolvedCancelTitle = submitTitle !== null && submitTitle !== void 0 ? submitTitle : 'Close';
|
|
18122
18266
|
var inputRef = inputProps.ref;
|
|
18123
18267
|
return /*#__PURE__*/ createElement("form", {
|
|
18124
18268
|
className: "ais-AutocompleteForm",
|
|
@@ -18126,7 +18270,7 @@
|
|
|
18126
18270
|
noValidate: true,
|
|
18127
18271
|
role: "search",
|
|
18128
18272
|
onSubmit: function onSubmit(e) {
|
|
18129
|
-
|
|
18273
|
+
e.preventDefault();
|
|
18130
18274
|
},
|
|
18131
18275
|
onReset: function onReset() {
|
|
18132
18276
|
var _inputRef_current;
|
|
@@ -18134,11 +18278,20 @@
|
|
|
18134
18278
|
}
|
|
18135
18279
|
}, /*#__PURE__*/ createElement("div", {
|
|
18136
18280
|
className: "ais-AutocompleteInputWrapperPrefix"
|
|
18137
|
-
}, /*#__PURE__*/ createElement("
|
|
18281
|
+
}, isBackButton && /*#__PURE__*/ createElement("button", {
|
|
18282
|
+
className: "ais-AutocompleteBackButton",
|
|
18283
|
+
type: "button",
|
|
18284
|
+
title: resolvedCancelTitle,
|
|
18285
|
+
onClick: onCancel,
|
|
18286
|
+
hidden: isSearchStalled
|
|
18287
|
+
}, /*#__PURE__*/ createElement(BackIcon, {
|
|
18288
|
+
createElement: createElement
|
|
18289
|
+
})), /*#__PURE__*/ createElement("label", {
|
|
18138
18290
|
className: "ais-AutocompleteLabel",
|
|
18139
18291
|
"aria-label": "Submit",
|
|
18140
18292
|
htmlFor: inputProps.id,
|
|
18141
|
-
id: "".concat(inputProps.id, "-label")
|
|
18293
|
+
id: "".concat(inputProps.id, "-label"),
|
|
18294
|
+
hidden: isBackButton || undefined
|
|
18142
18295
|
}, /*#__PURE__*/ createElement("button", {
|
|
18143
18296
|
className: "ais-AutocompleteSubmitButton",
|
|
18144
18297
|
type: "submit",
|
|
@@ -18640,6 +18793,23 @@
|
|
|
18640
18793
|
};
|
|
18641
18794
|
}
|
|
18642
18795
|
|
|
18796
|
+
function createButtonComponent(param) {
|
|
18797
|
+
var createElement = param.createElement;
|
|
18798
|
+
return function Button(userProps) {
|
|
18799
|
+
var _userProps_variant = userProps.variant, variant = _userProps_variant === void 0 ? 'primary' : _userProps_variant, _userProps_size = userProps.size, size = _userProps_size === void 0 ? 'md' : _userProps_size, _userProps_iconOnly = userProps.iconOnly, iconOnly = _userProps_iconOnly === void 0 ? false : _userProps_iconOnly, className = userProps.className, children = userProps.children, props = _object_without_properties(userProps, [
|
|
18800
|
+
"variant",
|
|
18801
|
+
"size",
|
|
18802
|
+
"iconOnly",
|
|
18803
|
+
"className",
|
|
18804
|
+
"children"
|
|
18805
|
+
]);
|
|
18806
|
+
return /*#__PURE__*/ createElement("button", _object_spread({
|
|
18807
|
+
type: "button",
|
|
18808
|
+
className: cx('ais-Button', "ais-Button--".concat(variant), "ais-Button--".concat(size), iconOnly && 'ais-Button--icon-only', className)
|
|
18809
|
+
}, props), children);
|
|
18810
|
+
};
|
|
18811
|
+
}
|
|
18812
|
+
|
|
18643
18813
|
function createDefaultItemComponent(param) {
|
|
18644
18814
|
var createElement = param.createElement, Fragment = param.Fragment;
|
|
18645
18815
|
return function DefaultItem(userProps) {
|
|
@@ -18889,6 +19059,10 @@
|
|
|
18889
19059
|
};
|
|
18890
19060
|
}
|
|
18891
19061
|
|
|
19062
|
+
function startsWith(str, prefix) {
|
|
19063
|
+
return str.slice(0, prefix.length) === prefix;
|
|
19064
|
+
}
|
|
19065
|
+
|
|
18892
19066
|
var getTextContent = function getTextContent(message) {
|
|
18893
19067
|
return message.parts.map(function(part) {
|
|
18894
19068
|
return 'text' in part ? part.text : '';
|
|
@@ -18900,13 +19074,24 @@
|
|
|
18900
19074
|
var isPartText = function isPartText(part) {
|
|
18901
19075
|
return part.type === 'text';
|
|
18902
19076
|
};
|
|
19077
|
+
var isPartTool = function isPartTool(part) {
|
|
19078
|
+
return startsWith(part.type, 'tool-');
|
|
19079
|
+
};
|
|
19080
|
+
var findTool = function findTool(partType, tools) {
|
|
19081
|
+
var toolName = partType.replace('tool-', '');
|
|
19082
|
+
var tool = tools[toolName];
|
|
19083
|
+
if (!tool) {
|
|
19084
|
+
var _Object_entries_find;
|
|
19085
|
+
tool = (_Object_entries_find = Object.entries(tools).find(function(param) {
|
|
19086
|
+
var _param = _sliced_to_array(param, 1), key = _param[0];
|
|
19087
|
+
return startsWith(toolName, "".concat(key, "_"));
|
|
19088
|
+
})) === null || _Object_entries_find === void 0 ? void 0 : _Object_entries_find[1];
|
|
19089
|
+
}
|
|
19090
|
+
return tool;
|
|
19091
|
+
};
|
|
18903
19092
|
|
|
18904
19093
|
function n(){return n=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}return e},n.apply(this,arguments)}const o=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,n)=>(e[n.toLowerCase()]=n,e),{class:"className",for:"htmlFor"}),a={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},c=["style","script","pre"],i=["src","href","data","formAction","srcDoc","action"],u=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,l=/\n{2,}$/,s=/^(\s*>[\s\S]*?)(?=\n\n|$)/,f=/^ *> ?/gm,_=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,d=/^ {2,}\n/,p=/^(?:([-*_])( *\1){2,}) *(?:\n *)+\n/,y=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,h=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,g=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,m=/^(?:\n *)*\n/,k=/\r\n?/g,x=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,q=/^\[\^([^\]]+)]/,v=/\f/g,b=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,$=/^\s*?\[(x|\s)\]/,S=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,z=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,E=/^([^\n]+)\n *(=|-)\2{2,} *\n/,A=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,R=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,B=/^<!--[\s\S]*?(?:-->)/,L=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,O=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,j=/^\{.*\}$/,C=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,I=/^<([^ >]+[:@\/][^ >]+)>/,T=/-([a-z])?/gi,M=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,w=/^[^\n]+(?: \n|\n{2,})/,D=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,F=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,P=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Z=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,N=/\t/g,G=/(^ *\||\| *$)/g,U=/^ *:-+: *$/,V=/^ *:-+ *$/,H=/^ *-+: *$/,Q=e=>`(?=[\\s\\S]+?\\1${e?"\\1":""})`,W="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",J=RegExp(`^([*_])\\1${Q(1)}${W}\\1\\1(?!\\1)`),K=RegExp(`^([*_])${Q(0)}${W}\\1(?!\\1)`),X=RegExp(`^(==)${Q(0)}${W}\\1`),Y=RegExp(`^(~~)${Q(0)}${W}\\1`),ee=/^(:[a-zA-Z0-9-_]+:)/,ne=/^\\([^0-9A-Za-z\s])/,re=/\\([^0-9A-Za-z\s])/g,te=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,oe=/^\n+/,ae=/^([ \t]*)/,ce=/(?:^|\n)( *)$/,ie="(?:\\d+\\.)",ue="(?:[*+-])";function le(e){return "( *)("+(1===e?ie:ue)+") +"}const se=le(1),fe=le(2);function _e(e){return RegExp("^"+(1===e?se:fe))}const de=_e(1),pe=_e(2);function ye(e){return RegExp("^"+(1===e?se:fe)+"[^\\n]*(?:\\n(?!\\1"+(1===e?ie:ue)+" )[^\\n]*)*(\\n|$)","gm")}const he=ye(1),ge=ye(2);function me(e){const n=1===e?ie:ue;return RegExp("^( *)("+n+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+n+" (?!"+n+" ))\\n*|\\s*\\n*$)")}const ke=me(1),xe=me(2);function qe(e,n){const r=1===n,t=r?ke:xe,o=r?he:ge,a=r?de:pe;return {t:e=>a.test(e),o:je(function(e,n){const r=ce.exec(n.prevCapture);return r&&(n.list||!n.inline&&!n.simple)?t.exec(e=r[1]+e):null}),i:1,u(e,n,t){const c=r?+e[2]:void 0,i=e[0].replace(l,"\n").match(o);let u=!1;return {items:i.map(function(e,r){const o=a.exec(e)[0].length,c=RegExp("^ {1,"+o+"}","gm"),l=e.replace(c,"").replace(a,""),s=r===i.length-1,f=-1!==l.indexOf("\n\n")||s&&u;u=f;const _=t.inline,d=t.list;let p;t.list=!0,f?(t.inline=!1,p=Se(l)+"\n\n"):(t.inline=!0,p=Se(l));const y=n(p,t);return t.inline=_,t.list=d,y}),ordered:r,start:c}},l:(n,r,t)=>e(n.ordered?"ol":"ul",{key:t.key,start:"20"===n.type?n.start:void 0},n.items.map(function(n,o){return e("li",{key:o},r(n,t))}))}}const ve=RegExp("^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),be=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;function $e(e){return "string"==typeof e}function Se(e){let n=e.length;for(;n>0&&e[n-1]<=" ";)n--;return e.slice(0,n)}function ze(e,n){return e.startsWith(n)}function Ee(e,n,r){if(Array.isArray(r)){for(let n=0;n<r.length;n++)if(ze(e,r[n]))return !0;return !1}return r(e,n)}function Ae(e){return e.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function Re(e){return H.test(e)?"right":U.test(e)?"center":V.test(e)?"left":null}function Be(e,n,r,t){const o=r.inTable;r.inTable=!0;let a=[[]],c="";function i(){if(!c)return;const e=a[a.length-1];e.push.apply(e,n(c,r)),c="";}return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((e,n,r)=>{"|"===e.trim()&&(i(),t)?0!==n&&n!==r.length-1&&a.push([]):c+=e;}),i(),r.inTable=o,a}function Le(e,n,r){r.inline=!0;const t=e[2]?e[2].replace(G,"").split("|").map(Re):[],o=e[3]?function(e,n,r){return e.trim().split("\n").map(function(e){return Be(e,n,r,!0)})}(e[3],n,r):[],a=Be(e[1],n,r,!!o.length);return r.inline=!1,o.length?{align:t,cells:o,header:a,type:"25"}:{children:a,type:"21"}}function Oe(e,n){return null==e.align[n]?{}:{textAlign:e.align[n]}}function je(e){return e.inline=1,e}function Ce(e){return je(function(n,r){return r.inline?e.exec(n):null})}function Ie(e){return je(function(n,r){return r.inline||r.simple?e.exec(n):null})}function Te(e){return function(n,r){return r.inline||r.simple?null:e.exec(n)}}function Me(e){return je(function(n){return e.exec(n)})}const we=/(javascript|vbscript|data(?!:image)):/i;function De(e){try{const n=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(we.test(n))return null}catch(e){return null}return e}function Fe(e){return e?e.replace(re,"$1"):e}function Pe(e,n,r){const t=r.inline||!1,o=r.simple||!1;r.inline=!0,r.simple=!0;const a=e(n,r);return r.inline=t,r.simple=o,a}function Ze(e,n,r){const t=r.inline||!1,o=r.simple||!1;r.inline=!1,r.simple=!0;const a=e(n,r);return r.inline=t,r.simple=o,a}function Ne(e,n,r){const t=r.inline||!1;r.inline=!1;const o=e(n,r);return r.inline=t,o}const Ge=(e,n,r)=>({children:Pe(n,e[2],r)});function Ue(){return {}}function Ve(){return null}function He(...e){return e.filter(Boolean).join(" ")}function Qe(e,n,r){let t=e;const o=n.split(".");for(;o.length&&(t=t[o[0]],void 0!==t);)o.shift();return t||r}function We(r="",t={}){t.overrides=t.overrides||{},t.namedCodesToUnicode=t.namedCodesToUnicode?n({},a,t.namedCodesToUnicode):a;const l=t.slugify||Ae,G=t.sanitizer||De,U=t.createElement||React__namespace.createElement,V=[s,y,h,t.enforceAtxHeadings?z:S,E,M,ke,xe],H=[...V,w,A,B,O];function Q(e,n){for(let r=0;r<e.length;r++)if(e[r].test(n))return !0;return !1}function W(e,r,...o){const a=Qe(t.overrides,e+".props",{});return U(function(e,n){const r=Qe(n,e);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Qe(n,e+".component",e):e}(e,t.overrides),n({},r,a,{className:He(null==r?void 0:r.className,a.className)||void 0}),...o)}function re(e){e=e.replace(b,"");let n=!1;t.forceInline?n=!0:t.forceBlock||(n=!1===Z.test(e));const r=fe(se(n?e:Se(e).replace(oe,"")+"\n\n",{inline:n}));for(;$e(r[r.length-1])&&!r[r.length-1].trim();)r.pop();if(null===t.wrapper)return r;const o=t.wrapper||(n?"span":"div");let a;if(r.length>1||t.forceWrapper)a=r;else {if(1===r.length)return a=r[0],"string"==typeof a?W("span",{key:"outer"},a):a;a=null;}return U(o,{key:"outer"},a)}function ce(e,n){if(!n||!n.trim())return null;const r=n.match(u);return r?r.reduce(function(n,r){const t=r.indexOf("=");if(-1!==t){const a=function(e){return -1!==e.indexOf("-")&&null===e.match(L)&&(e=e.replace(T,function(e,n){return n.toUpperCase()})),e}(r.slice(0,t)).trim(),c=function(e){const n=e[0];return ('"'===n||"'"===n)&&e.length>=2&&e[e.length-1]===n?e.slice(1,-1):e}(r.slice(t+1).trim()),u=o[a]||a;if("ref"===u)return n;const l=n[u]=function(e,n,r,t){return "style"===n?function(e){const n=[];let r="",t=!1,o=!1,a="";if(!e)return n;for(let c=0;c<e.length;c++){const i=e[c];if('"'!==i&&"'"!==i||t||(o?i===a&&(o=!1,a=""):(o=!0,a=i)),"("===i&&r.endsWith("url")?t=!0:")"===i&&t&&(t=!1),";"!==i||o||t)r+=i;else {const e=r.trim();if(e){const r=e.indexOf(":");if(r>0){const t=e.slice(0,r).trim(),o=e.slice(r+1).trim();n.push([t,o]);}}r="";}}const c=r.trim();if(c){const e=c.indexOf(":");if(e>0){const r=c.slice(0,e).trim(),t=c.slice(e+1).trim();n.push([r,t]);}}return n}(r).reduce(function(n,[r,o]){return n[r.replace(/(-[a-z])/g,e=>e[1].toUpperCase())]=t(o,e,r),n},{}):-1!==i.indexOf(n)?t(Fe(r),e,n):(r.match(j)&&(r=Fe(r.slice(1,r.length-1))),"true"===r||"false"!==r&&r)}(e,a,c,G);"string"==typeof l&&(A.test(l)||O.test(l))&&(n[u]=re(l.trim()));}else "style"!==r&&(n[o[r]||r]=!0);return n},{}):null}const ie=[],ue={},le={0:{t:[">"],o:Te(s),i:1,u(e,n,r){const[,t,o]=e[0].replace(f,"").match(_);return {alert:t,children:n(o,r)}},l(e,n,r){const t={key:r.key};return e.alert&&(t.className="markdown-alert-"+l(e.alert.toLowerCase(),Ae),e.children.unshift({attrs:{},children:[{type:"27",text:e.alert}],noInnerParse:!0,type:"11",tag:"header"})),W("blockquote",t,n(e.children,r))}},1:{t:[" "],o:Me(d),i:1,u:Ue,l:(e,n,r)=>W("br",{key:r.key})},2:{t:["--","__","**","- ","* ","_ "],o:Te(p),i:1,u:Ue,l:(e,n,r)=>W("hr",{key:r.key})},3:{t:[" "],o:Te(h),i:0,u:e=>({lang:void 0,text:Fe(Se(e[0].replace(/^ {4}/gm,"")))}),l:(e,r,t)=>W("pre",{key:t.key},W("code",n({},e.attrs,{className:e.lang?"lang-"+e.lang:""}),e.text))},4:{t:["```","~~~"],o:Te(y),i:0,u:e=>({attrs:ce("code",e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"})},5:{t:["`"],o:Ie(g),i:3,u:e=>({text:Fe(e[2])}),l:(e,n,r)=>W("code",{key:r.key},e.text)},6:{t:["[^"],o:Te(x),i:0,u:e=>(ie.push({footnote:e[2],identifier:e[1]}),{}),l:Ve},7:{t:["[^"],o:Ce(q),i:1,u:e=>({target:"#"+l(e[1],Ae),text:e[1]}),l:(e,n,r)=>W("a",{key:r.key,href:G(e.target,"a","href")},W("sup",{key:r.key},e.text))},8:{t:["[ ]","[x]"],o:Ce($),i:1,u:e=>({completed:"x"===e[1].toLowerCase()}),l:(e,n,r)=>W("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})},9:{t:["#"],o:Te(t.enforceAtxHeadings?z:S),i:1,u:(e,n,r)=>({children:Pe(n,e[2],r),id:l(e[2],Ae),level:e[1].length}),l:(e,n,r)=>W("h"+e.level,{id:e.id,key:r.key},n(e.children,r))},10:{t:e=>{const n=e.indexOf("\n");return n>0&&n<e.length-1&&("="===e[n+1]||"-"===e[n+1])},o:Te(E),i:0,u:(e,n,r)=>({children:Pe(n,e[1],r),level:"="===e[2]?1:2,type:"9"})},11:{t:["<"],o:Me(A),i:1,u(e,n,r){const[,t]=e[3].match(ae),o=RegExp("^"+t,"gm"),a=e[3].replace(o,""),i=Q(H,a)?Ne:Pe,u=e[1].toLowerCase(),l=-1!==c.indexOf(u),s=(l?u:e[1]).trim(),f={attrs:ce(s,e[2]),noInnerParse:l,tag:s};if(r.inAnchor=r.inAnchor||"a"===u,l)f.text=e[3];else {const e=r.inHTML;r.inHTML=!0,f.children=i(n,a,r),r.inHTML=e;}return r.inAnchor=!1,f},l:(e,r,t)=>W(e.tag,n({key:t.key},e.attrs),e.text||(e.children?r(e.children,t):""))},13:{t:["<"],o:Me(O),i:1,u(e){const n=e[1].trim();return {attrs:ce(n,e[2]||""),tag:n}},l:(e,r,t)=>W(e.tag,n({},e.attrs,{key:t.key}))},12:{t:["\x3c!--"],o:Me(B),i:1,u:()=>({}),l:Ve},14:{t:["!["],o:Ie(be),i:1,u:e=>({alt:Fe(e[1]),target:Fe(e[2]),title:Fe(e[3])}),l:(e,n,r)=>W("img",{key:r.key,alt:e.alt||void 0,title:e.title||void 0,src:G(e.target,"img","src")})},15:{t:["["],o:Ce(ve),i:3,u:(e,n,r)=>({children:Ze(n,e[1],r),target:Fe(e[2]),title:Fe(e[3])}),l:(e,n,r)=>W("a",{key:r.key,href:G(e.target,"a","href"),title:e.title},n(e.children,r))},16:{t:["<"],o:Ce(I),i:0,u(e){let n=e[1],r=!1;return -1!==n.indexOf("@")&&-1===n.indexOf("//")&&(r=!0,n=n.replace("mailto:","")),{children:[{text:n,type:"27"}],target:r?"mailto:"+n:n,type:"15"}}},17:{t:(e,n)=>!n.inAnchor&&!t.disableAutoLink&&(ze(e,"http://")||ze(e,"https://")),o:Ce(C),i:0,u:e=>({children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"})},20:qe(W,1),33:qe(W,2),19:{t:["\n"],o:Te(m),i:3,u:Ue,l:()=>"\n"},21:{o:je(function(e,n){if(n.inline||n.simple||n.inHTML&&-1===e.indexOf("\n\n")&&-1===n.prevCapture.indexOf("\n\n"))return null;let r="",t=0;for(;;){const n=e.indexOf("\n",t),o=e.slice(t,-1===n?void 0:n+1);if(Q(V,o))break;if(r+=o,-1===n||!o.trim())break;t=n+1;}const o=Se(r);return ""===o?null:[r,,o]}),i:3,u:Ge,l:(e,n,r)=>W("p",{key:r.key},n(e.children,r))},22:{t:["["],o:Ce(D),i:0,u:e=>(ue[e[1]]={target:e[2],title:e[4]},{}),l:Ve},23:{t:["!["],o:Ie(F),i:0,u:e=>({alt:e[1]?Fe(e[1]):void 0,ref:e[2]}),l:(e,n,r)=>ue[e.ref]?W("img",{key:r.key,alt:e.alt,src:G(ue[e.ref].target,"img","src"),title:ue[e.ref].title}):null},24:{t:e=>"["===e[0]&&-1===e.indexOf("]("),o:Ce(P),i:0,u:(e,n,r)=>({children:n(e[1],r),fallbackChildren:e[0],ref:e[2]}),l:(e,n,r)=>ue[e.ref]?W("a",{key:r.key,href:G(ue[e.ref].target,"a","href"),title:ue[e.ref].title},n(e.children,r)):W("span",{key:r.key},e.fallbackChildren)},25:{t:["|"],o:Te(M),i:1,u:Le,l(e,n,r){const t=e;return W("table",{key:r.key},W("thead",null,W("tr",null,t.header.map(function(e,o){return W("th",{key:o,style:Oe(t,o)},n(e,r))}))),W("tbody",null,t.cells.map(function(e,o){return W("tr",{key:o},e.map(function(e,o){return W("td",{key:o,style:Oe(t,o)},n(e,r))}))})))}},27:{o:je(function(e,n){let r;return ze(e,":")&&(r=ee.exec(e)),r||te.exec(e)}),i:4,u(e){const n=e[0];return {text:-1===n.indexOf("&")?n:n.replace(R,(e,n)=>t.namedCodesToUnicode[n]||e)}},l:e=>e.text},28:{t:["**","__"],o:Ie(J),i:2,u:(e,n,r)=>({children:n(e[2],r)}),l:(e,n,r)=>W("strong",{key:r.key},n(e.children,r))},29:{t:e=>{const n=e[0];return ("*"===n||"_"===n)&&e[1]!==n},o:Ie(K),i:3,u:(e,n,r)=>({children:n(e[2],r)}),l:(e,n,r)=>W("em",{key:r.key},n(e.children,r))},30:{t:["\\"],o:Ie(ne),i:1,u:e=>({text:e[1],type:"27"})},31:{t:["=="],o:Ie(X),i:3,u:Ge,l:(e,n,r)=>W("mark",{key:r.key},n(e.children,r))},32:{t:["~~"],o:Ie(Y),i:3,u:Ge,l:(e,n,r)=>W("del",{key:r.key},n(e.children,r))}};!0===t.disableParsingRawHTML&&(delete le[11],delete le[13]);const se=function(e){var n=Object.keys(e);function r(t,o){var a=[];if(o.prevCapture=o.prevCapture||"",t.trim())for(;t;)for(var c=0;c<n.length;){var i=n[c],u=e[i];if(!u.t||Ee(t,o,u.t)){var l=u.o(t,o);if(l&&l[0]){t=t.substring(l[0].length);var s=u.u(l,r,o);o.prevCapture+=l[0],s.type||(s.type=i),a.push(s);break}c++;}else c++;}return o.prevCapture="",a}return n.sort(function(n,r){return e[n].i-e[r].i||(n<r?-1:1)}),function(e,n){return r(function(e){return e.replace(k,"\n").replace(v,"").replace(N," ")}(e),n)}}(le),fe=function(e,n){return function r(t,o={}){if(Array.isArray(t)){const e=o.key,n=[];let a=!1;for(let e=0;e<t.length;e++){o.key=e;const c=r(t[e],o),i=$e(c);i&&a?n[n.length-1]+=c:null!==c&&n.push(c),a=i;}return o.key=e,n}return function(r,t,o){const a=e[r.type].l;return n?n(()=>a(r,t,o),r,t,o):a(r,t,o)}(t,r,o)}}(le,t.renderRule),_e=re(r);return ie.length?W("div",null,_e,W("footer",{key:"footer"},ie.map(function(e){return W("div",{id:l(e.identifier,Ae),key:e.identifier},e.identifier,fe(se(e.footnote,{inline:!0})))}))):_e}
|
|
18905
19094
|
|
|
18906
|
-
function startsWith(str, prefix) {
|
|
18907
|
-
return str.slice(0, prefix.length) === prefix;
|
|
18908
|
-
}
|
|
18909
|
-
|
|
18910
19095
|
// Keep in sync with packages/instantsearch.js/src/lib/chat/index.ts
|
|
18911
19096
|
var SearchIndexToolType = 'algolia_search_index';
|
|
18912
19097
|
function createChatMessageComponent(param) {
|
|
@@ -18982,6 +19167,9 @@
|
|
|
18982
19167
|
toolCallId: toolMessage.toolCallId
|
|
18983
19168
|
});
|
|
18984
19169
|
};
|
|
19170
|
+
if (toolMessage.state === 'input-streaming' && !tool.streamInput) {
|
|
19171
|
+
return null;
|
|
19172
|
+
}
|
|
18985
19173
|
if (!ToolLayoutComponent) {
|
|
18986
19174
|
return null;
|
|
18987
19175
|
}
|
|
@@ -19091,7 +19279,7 @@
|
|
|
19091
19279
|
"translations"
|
|
19092
19280
|
]);
|
|
19093
19281
|
var translations = _object_spread({
|
|
19094
|
-
loaderText: '
|
|
19282
|
+
loaderText: ''
|
|
19095
19283
|
}, userTranslations);
|
|
19096
19284
|
return /*#__PURE__*/ createElement("article", _object_spread({
|
|
19097
19285
|
className: "ais-ChatMessageLoader ais-ChatMessage ais-ChatMessage--left ais-ChatMessage--subtle"
|
|
@@ -19294,10 +19482,7 @@
|
|
|
19294
19482
|
};
|
|
19295
19483
|
var lastMessage = messages[messages.length - 1];
|
|
19296
19484
|
var lastPart = lastMessage === null || lastMessage === void 0 ? void 0 : (_lastMessage_parts = lastMessage.parts) === null || _lastMessage_parts === void 0 ? void 0 : _lastMessage_parts[lastMessage.parts.length - 1];
|
|
19297
|
-
var
|
|
19298
|
-
var isStreamingWithNoContent = status === 'streaming' && !lastPart;
|
|
19299
|
-
var isStreamingNonTextContent = status === 'streaming' && lastPart && !isPartText(lastPart);
|
|
19300
|
-
var showLoader = isWaitingForResponse || isStreamingWithNoContent || isStreamingNonTextContent;
|
|
19485
|
+
var showLoader = getShowLoader(status, lastPart, tools);
|
|
19301
19486
|
var showEmpty = messages.length === 0 && !showLoader && !isClearing && status !== 'error';
|
|
19302
19487
|
var DefaultMessage = MessageComponent || DefaultMessageComponent;
|
|
19303
19488
|
var DefaultLoader = LoaderComponent || DefaultLoaderComponent;
|
|
@@ -19361,6 +19546,21 @@
|
|
|
19361
19546
|
})));
|
|
19362
19547
|
};
|
|
19363
19548
|
}
|
|
19549
|
+
var getShowLoader = function getShowLoader(status, lastPart, tools) {
|
|
19550
|
+
if (status !== 'submitted' && status !== 'streaming') return false;
|
|
19551
|
+
if (status === 'submitted') return true;
|
|
19552
|
+
if (!lastPart) return true;
|
|
19553
|
+
if (isPartText(lastPart)) return false;
|
|
19554
|
+
if (isPartTool(lastPart)) {
|
|
19555
|
+
if (lastPart.state === 'output-available') return false;
|
|
19556
|
+
if (lastPart.state === 'input-streaming') {
|
|
19557
|
+
var tool = findTool(lastPart.type, tools);
|
|
19558
|
+
return !(tool === null || tool === void 0 ? void 0 : tool.streamInput);
|
|
19559
|
+
}
|
|
19560
|
+
return true;
|
|
19561
|
+
}
|
|
19562
|
+
return true;
|
|
19563
|
+
};
|
|
19364
19564
|
|
|
19365
19565
|
function createChatOverlayLayoutComponent(param) {
|
|
19366
19566
|
var createElement = param.createElement;
|
|
@@ -20895,7 +21095,7 @@
|
|
|
20895
21095
|
Fragment: React.Fragment
|
|
20896
21096
|
});
|
|
20897
21097
|
function AutocompleteSearch(param) {
|
|
20898
|
-
var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onAiModeClick = param.onAiModeClick;
|
|
21098
|
+
var inputProps = param.inputProps, clearQuery = param.clearQuery, onQueryChange = param.onQueryChange, query = param.query, isSearchStalled = param.isSearchStalled, onCancel = param.onCancel, isDetached = param.isDetached, submitTitle = param.submitTitle, onAiModeClick = param.onAiModeClick;
|
|
20899
21099
|
return /*#__PURE__*/ React.createElement(AutocompleteSearchComponent, {
|
|
20900
21100
|
inputProps: _object_spread_props(_object_spread({}, inputProps), {
|
|
20901
21101
|
onChange: function onChange(event) {
|
|
@@ -20906,6 +21106,9 @@
|
|
|
20906
21106
|
onClear: clearQuery,
|
|
20907
21107
|
query: query,
|
|
20908
21108
|
isSearchStalled: isSearchStalled,
|
|
21109
|
+
onCancel: onCancel,
|
|
21110
|
+
isDetached: isDetached,
|
|
21111
|
+
submitTitle: submitTitle,
|
|
20909
21112
|
onAiModeClick: onAiModeClick
|
|
20910
21113
|
});
|
|
20911
21114
|
}
|
|
@@ -21492,7 +21695,7 @@
|
|
|
21492
21695
|
});
|
|
21493
21696
|
}
|
|
21494
21697
|
indicesForPanel.forEach(function(param) {
|
|
21495
|
-
var indexId = param.indexId, indexName = param.indexName, hits = param.hits;
|
|
21698
|
+
var indexId = param.indexId, indexName = param.indexName, hits = param.hits, sendEvent = param.sendEvent;
|
|
21496
21699
|
var elementId = indexName;
|
|
21497
21700
|
if (indexName === (showQuerySuggestions === null || showQuerySuggestions === void 0 ? void 0 : showQuerySuggestions.indexName)) {
|
|
21498
21701
|
elementId = 'suggestions';
|
|
@@ -21518,9 +21721,14 @@
|
|
|
21518
21721
|
});
|
|
21519
21722
|
}),
|
|
21520
21723
|
getItemProps: getItemProps,
|
|
21724
|
+
sendEvent: sendEvent,
|
|
21521
21725
|
classNames: currentIndexConfig.classNames
|
|
21522
21726
|
});
|
|
21523
21727
|
});
|
|
21728
|
+
var handleCancel = function handleCancel() {
|
|
21729
|
+
setIsModalOpen(false);
|
|
21730
|
+
setIsOpen(false);
|
|
21731
|
+
};
|
|
21524
21732
|
var searchBoxContent = /*#__PURE__*/ React.createElement(AutocompleteSearch, {
|
|
21525
21733
|
inputProps: getInputProps(),
|
|
21526
21734
|
clearQuery: function clearQuery() {
|
|
@@ -21532,7 +21740,18 @@
|
|
|
21532
21740
|
},
|
|
21533
21741
|
query: resolvedQuery,
|
|
21534
21742
|
isSearchStalled: isSearchStalled,
|
|
21743
|
+
onCancel: function onCancel() {
|
|
21744
|
+
if (isDetached) {
|
|
21745
|
+
handleCancel();
|
|
21746
|
+
}
|
|
21747
|
+
},
|
|
21748
|
+
isDetached: isDetached,
|
|
21749
|
+
submitTitle: isDetached ? translations.detachedCancelButtonText : undefined,
|
|
21535
21750
|
onAiModeClick: aiMode ? function() {
|
|
21751
|
+
setIsOpen(false);
|
|
21752
|
+
if (isDetached) {
|
|
21753
|
+
setIsModalOpen(false);
|
|
21754
|
+
}
|
|
21536
21755
|
if (chatRenderState) {
|
|
21537
21756
|
var _chatRenderState_setOpen;
|
|
21538
21757
|
(_chatRenderState_setOpen = chatRenderState.setOpen) === null || _chatRenderState_setOpen === void 0 ? void 0 : _chatRenderState_setOpen.call(chatRenderState, true);
|
|
@@ -21576,19 +21795,11 @@
|
|
|
21576
21795
|
translations: translations
|
|
21577
21796
|
}), isModalOpen && /*#__PURE__*/ React.createElement(AutocompleteDetachedOverlay, {
|
|
21578
21797
|
classNames: classNames,
|
|
21579
|
-
onClose:
|
|
21580
|
-
setIsModalOpen(false);
|
|
21581
|
-
setIsOpen(false);
|
|
21582
|
-
}
|
|
21798
|
+
onClose: handleCancel
|
|
21583
21799
|
}, /*#__PURE__*/ React.createElement(AutocompleteDetachedContainer, {
|
|
21584
21800
|
classNames: detachedContainerClassNames
|
|
21585
21801
|
}, /*#__PURE__*/ React.createElement(AutocompleteDetachedFormContainer, {
|
|
21586
|
-
classNames: classNames
|
|
21587
|
-
onCancel: function onCancel() {
|
|
21588
|
-
setIsModalOpen(false);
|
|
21589
|
-
setIsOpen(false);
|
|
21590
|
-
},
|
|
21591
|
-
translations: translations
|
|
21802
|
+
classNames: classNames
|
|
21592
21803
|
}, searchBoxContent), panelContent)));
|
|
21593
21804
|
}
|
|
21594
21805
|
// Normal (non-detached) rendering
|
|
@@ -21726,6 +21937,10 @@
|
|
|
21726
21937
|
return /*#__PURE__*/ React.createElement(CarouselUiComponent, _object_spread({}, carouselRefs, props));
|
|
21727
21938
|
}
|
|
21728
21939
|
|
|
21940
|
+
var ChatMessageLoader = createChatMessageLoaderComponent({
|
|
21941
|
+
createElement: React.createElement
|
|
21942
|
+
});
|
|
21943
|
+
|
|
21729
21944
|
var ChatOverlayLayout = createChatOverlayLayoutComponent({
|
|
21730
21945
|
createElement: React.createElement,
|
|
21731
21946
|
Fragment: React.Fragment
|
|
@@ -21849,7 +22064,7 @@
|
|
|
21849
22064
|
var _ref = [
|
|
21850
22065
|
_0,
|
|
21851
22066
|
_1
|
|
21852
|
-
], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), userTools = _ref2.tools, toggleButtonProps = _ref2.toggleButtonProps, headerProps = _ref2.headerProps, messagesProps = _ref2.messagesProps, promptProps = _ref2.promptProps, itemComponent = _ref2.itemComponent, layoutComponent = _ref2.layoutComponent, toggleButtonComponent = _ref2.toggleButtonComponent, toggleButtonIconComponent = _ref2.toggleButtonIconComponent, headerComponent = _ref2.headerComponent, headerTitleIconComponent = _ref2.headerTitleIconComponent, headerCloseIconComponent = _ref2.headerCloseIconComponent, headerMinimizeIconComponent = _ref2.headerMinimizeIconComponent, headerMaximizeIconComponent = _ref2.headerMaximizeIconComponent,
|
|
22067
|
+
], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), userTools = _ref2.tools, toggleButtonProps = _ref2.toggleButtonProps, headerProps = _ref2.headerProps, messagesProps = _ref2.messagesProps, promptProps = _ref2.promptProps, itemComponent = _ref2.itemComponent, layoutComponent = _ref2.layoutComponent, toggleButtonComponent = _ref2.toggleButtonComponent, toggleButtonIconComponent = _ref2.toggleButtonIconComponent, headerComponent = _ref2.headerComponent, headerTitleIconComponent = _ref2.headerTitleIconComponent, headerCloseIconComponent = _ref2.headerCloseIconComponent, headerMinimizeIconComponent = _ref2.headerMinimizeIconComponent, headerMaximizeIconComponent = _ref2.headerMaximizeIconComponent, loaderComponent = _ref2.loaderComponent, messagesErrorComponent = _ref2.messagesErrorComponent, promptComponent = _ref2.promptComponent, promptHeaderComponent = _ref2.promptHeaderComponent, promptFooterComponent = _ref2.promptFooterComponent, assistantMessageLeadingComponent = _ref2.assistantMessageLeadingComponent, assistantMessageFooterComponent = _ref2.assistantMessageFooterComponent, userMessageLeadingComponent = _ref2.userMessageLeadingComponent, userMessageFooterComponent = _ref2.userMessageFooterComponent, emptyComponent = _ref2.emptyComponent, actionsComponent = _ref2.actionsComponent, suggestionsComponent = _ref2.suggestionsComponent, classNames = _ref2.classNames, _ref_translations = _ref2.translations, translations = _ref_translations === void 0 ? {} : _ref_translations, title = _ref2.title, getSearchPageURL = _ref2.getSearchPageURL, props = _object_without_properties(_ref2, [
|
|
21853
22068
|
"tools",
|
|
21854
22069
|
"toggleButtonProps",
|
|
21855
22070
|
"headerProps",
|
|
@@ -21864,7 +22079,7 @@
|
|
|
21864
22079
|
"headerCloseIconComponent",
|
|
21865
22080
|
"headerMinimizeIconComponent",
|
|
21866
22081
|
"headerMaximizeIconComponent",
|
|
21867
|
-
"
|
|
22082
|
+
"loaderComponent",
|
|
21868
22083
|
"messagesErrorComponent",
|
|
21869
22084
|
"promptComponent",
|
|
21870
22085
|
"promptHeaderComponent",
|
|
@@ -21986,7 +22201,7 @@
|
|
|
21986
22201
|
scrollRef: scrollRef,
|
|
21987
22202
|
contentRef: contentRef,
|
|
21988
22203
|
onScrollToBottom: scrollToBottom,
|
|
21989
|
-
loaderComponent:
|
|
22204
|
+
loaderComponent: loaderComponent,
|
|
21990
22205
|
errorComponent: messagesErrorComponent,
|
|
21991
22206
|
emptyComponent: emptyComponent,
|
|
21992
22207
|
actionsComponent: actionsComponent,
|
|
@@ -23808,6 +24023,7 @@
|
|
|
23808
24023
|
exports.Chat = Chat;
|
|
23809
24024
|
exports.ChatGreeting = ChatGreeting;
|
|
23810
24025
|
exports.ChatInlineLayout = ChatInlineLayout;
|
|
24026
|
+
exports.ChatMessageLoader = ChatMessageLoader;
|
|
23811
24027
|
exports.ChatOverlayLayout = ChatOverlayLayout;
|
|
23812
24028
|
exports.ChatSidePanelLayout = ChatSidePanelLayout;
|
|
23813
24029
|
exports.ClearRefinements = ClearRefinements;
|