site-operator-react 0.1.4 → 0.1.10
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/README.md +12 -2
- package/dist/index.d.ts +23 -3
- package/dist/site-operator-react.es.js +105 -99
- package/dist/site-operator-react.umd.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,10 +24,20 @@ function App() {
|
|
|
24
24
|
<div className="App">
|
|
25
25
|
<AgentChat
|
|
26
26
|
backendUrl="http://localhost:8001/ag_ui"
|
|
27
|
+
conversationUrl="http://localhost:8003"
|
|
27
28
|
appName="My React App"
|
|
28
29
|
agentAvatar="/avatar.png"
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
header={{
|
|
31
|
+
title: "Mi Asistente",
|
|
32
|
+
hide: false
|
|
33
|
+
}}
|
|
34
|
+
composer={{
|
|
35
|
+
disclaimer: "Agent puede cometer errores. Verifica la información importante",
|
|
36
|
+
placeholder: "Enviar un mensaje a Agent"
|
|
37
|
+
}}
|
|
38
|
+
thread={{
|
|
39
|
+
emptyText: "¿Cómo puedo ayudarte hoy?"
|
|
40
|
+
}}
|
|
31
41
|
/>
|
|
32
42
|
</div>
|
|
33
43
|
);
|
package/dist/index.d.ts
CHANGED
|
@@ -8,24 +8,44 @@ export declare const AgentChat: default_2.FC<AgentChatProps>;
|
|
|
8
8
|
|
|
9
9
|
export declare interface AgentChatProps {
|
|
10
10
|
backendUrl?: string;
|
|
11
|
+
conversationUrl?: string;
|
|
11
12
|
appName?: string;
|
|
12
13
|
agentAvatar?: string;
|
|
13
|
-
disclaimer?: string;
|
|
14
|
-
emptyText?: string;
|
|
15
14
|
inspector?: boolean;
|
|
16
15
|
interceptor?: boolean;
|
|
17
|
-
appContext?: AgentState;
|
|
18
16
|
className?: string;
|
|
17
|
+
composer?: ComposerProps;
|
|
18
|
+
thread?: ThreadViewProps;
|
|
19
|
+
header?: HeaderProps;
|
|
20
|
+
context?: ContextProps;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export { AgentState }
|
|
22
24
|
|
|
25
|
+
export declare interface ComposerProps {
|
|
26
|
+
disclaimer?: string;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare interface ContextProps {
|
|
31
|
+
appContext?: AgentState;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare interface HeaderProps {
|
|
35
|
+
title?: string;
|
|
36
|
+
hide?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
23
39
|
export { NavGraph }
|
|
24
40
|
|
|
25
41
|
export { NavNode }
|
|
26
42
|
|
|
27
43
|
export { PortalSpec }
|
|
28
44
|
|
|
45
|
+
export declare interface ThreadViewProps {
|
|
46
|
+
emptyText?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
29
49
|
/**
|
|
30
50
|
* A hook to register a Chat Portal specification for the agent.
|
|
31
51
|
* This allows the agent to navigate and control the host application.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ee, { useRef as re, useEffect as M } from "react";
|
|
2
2
|
import { chatPortalService as te } from "site-operator";
|
|
3
|
-
var
|
|
3
|
+
var A = { exports: {} }, p = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
6
|
* react-jsx-runtime.production.js
|
|
@@ -12,27 +12,27 @@ var p = { exports: {} }, _ = {};
|
|
|
12
12
|
*/
|
|
13
13
|
var F;
|
|
14
14
|
function ne() {
|
|
15
|
-
if (F) return
|
|
15
|
+
if (F) return p;
|
|
16
16
|
F = 1;
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
if (u !== void 0 && (
|
|
17
|
+
var l = Symbol.for("react.transitional.element"), E = Symbol.for("react.fragment");
|
|
18
|
+
function f(d, o, u) {
|
|
19
|
+
var m = null;
|
|
20
|
+
if (u !== void 0 && (m = "" + u), o.key !== void 0 && (m = "" + o.key), "key" in o) {
|
|
21
21
|
u = {};
|
|
22
|
-
for (var
|
|
23
|
-
|
|
22
|
+
for (var s in o)
|
|
23
|
+
s !== "key" && (u[s] = o[s]);
|
|
24
24
|
} else u = o;
|
|
25
25
|
return o = u.ref, {
|
|
26
|
-
$$typeof:
|
|
27
|
-
type:
|
|
28
|
-
key:
|
|
26
|
+
$$typeof: l,
|
|
27
|
+
type: d,
|
|
28
|
+
key: m,
|
|
29
29
|
ref: o !== void 0 ? o : null,
|
|
30
30
|
props: u
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return p.Fragment = E, p.jsx = f, p.jsxs = f, p;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var b = {};
|
|
36
36
|
/**
|
|
37
37
|
* @license React
|
|
38
38
|
* react-jsx-runtime.development.js
|
|
@@ -45,13 +45,13 @@ var R = {};
|
|
|
45
45
|
var D;
|
|
46
46
|
function ae() {
|
|
47
47
|
return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
48
|
-
function
|
|
48
|
+
function l(e) {
|
|
49
49
|
if (e == null) return null;
|
|
50
50
|
if (typeof e == "function")
|
|
51
51
|
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
52
52
|
if (typeof e == "string") return e;
|
|
53
53
|
switch (e) {
|
|
54
|
-
case
|
|
54
|
+
case O:
|
|
55
55
|
return "Fragment";
|
|
56
56
|
case q:
|
|
57
57
|
return "Profiler";
|
|
@@ -78,22 +78,22 @@ function ae() {
|
|
|
78
78
|
var r = e.render;
|
|
79
79
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
80
|
case B:
|
|
81
|
-
return r = e.displayName || null, r !== null ? r :
|
|
82
|
-
case
|
|
81
|
+
return r = e.displayName || null, r !== null ? r : l(e.type) || "Memo";
|
|
82
|
+
case P:
|
|
83
83
|
r = e._payload, e = e._init;
|
|
84
84
|
try {
|
|
85
|
-
return
|
|
85
|
+
return l(e(r));
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function E(e) {
|
|
92
92
|
return "" + e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function f(e) {
|
|
95
95
|
try {
|
|
96
|
-
|
|
96
|
+
E(e);
|
|
97
97
|
var r = !1;
|
|
98
98
|
} catch {
|
|
99
99
|
r = !0;
|
|
@@ -105,37 +105,37 @@ function ae() {
|
|
|
105
105
|
r,
|
|
106
106
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
107
|
n
|
|
108
|
-
),
|
|
108
|
+
), E(e);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
if (e ===
|
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
111
|
+
function d(e) {
|
|
112
|
+
if (e === O) return "<>";
|
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === P)
|
|
114
114
|
return "<...>";
|
|
115
115
|
try {
|
|
116
|
-
var r =
|
|
116
|
+
var r = l(e);
|
|
117
117
|
return r ? "<" + r + ">" : "<...>";
|
|
118
118
|
} catch {
|
|
119
119
|
return "<...>";
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
function o() {
|
|
123
|
-
var e =
|
|
123
|
+
var e = S.A;
|
|
124
124
|
return e === null ? null : e.getOwner();
|
|
125
125
|
}
|
|
126
126
|
function u() {
|
|
127
127
|
return Error("react-stack-top-frame");
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
129
|
+
function m(e) {
|
|
130
|
+
if (h.call(e, "key")) {
|
|
131
131
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
132
132
|
if (r && r.isReactWarning) return !1;
|
|
133
133
|
}
|
|
134
134
|
return e.key !== void 0;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function s(e, r) {
|
|
137
137
|
function t() {
|
|
138
|
-
|
|
138
|
+
C || (C = !0, console.error(
|
|
139
139
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
140
|
r
|
|
141
141
|
));
|
|
@@ -145,13 +145,13 @@ function ae() {
|
|
|
145
145
|
configurable: !0
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
var e =
|
|
150
|
-
return
|
|
148
|
+
function R() {
|
|
149
|
+
var e = l(this.type);
|
|
150
|
+
return N[e] || (N[e] = !0, console.error(
|
|
151
151
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
152
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function c(e, r, t, n, k, g) {
|
|
155
155
|
var a = t.ref;
|
|
156
156
|
return e = {
|
|
157
157
|
$$typeof: x,
|
|
@@ -161,7 +161,7 @@ function ae() {
|
|
|
161
161
|
_owner: n
|
|
162
162
|
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
163
163
|
enumerable: !1,
|
|
164
|
-
get:
|
|
164
|
+
get: R
|
|
165
165
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
166
166
|
configurable: !1,
|
|
167
167
|
enumerable: !1,
|
|
@@ -176,33 +176,33 @@ function ae() {
|
|
|
176
176
|
configurable: !1,
|
|
177
177
|
enumerable: !1,
|
|
178
178
|
writable: !0,
|
|
179
|
-
value:
|
|
179
|
+
value: k
|
|
180
180
|
}), Object.defineProperty(e, "_debugTask", {
|
|
181
181
|
configurable: !1,
|
|
182
182
|
enumerable: !1,
|
|
183
183
|
writable: !0,
|
|
184
|
-
value:
|
|
184
|
+
value: g
|
|
185
185
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function i(e, r, t, n, k, g) {
|
|
188
188
|
var a = r.children;
|
|
189
189
|
if (a !== void 0)
|
|
190
190
|
if (n)
|
|
191
191
|
if (Q(a)) {
|
|
192
192
|
for (n = 0; n < a.length; n++)
|
|
193
|
-
|
|
193
|
+
_(a[n]);
|
|
194
194
|
Object.freeze && Object.freeze(a);
|
|
195
195
|
} else
|
|
196
196
|
console.error(
|
|
197
197
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
198
|
);
|
|
199
|
-
else
|
|
200
|
-
if (
|
|
201
|
-
a =
|
|
202
|
-
var
|
|
199
|
+
else _(a);
|
|
200
|
+
if (h.call(r, "key")) {
|
|
201
|
+
a = l(e);
|
|
202
|
+
var v = Object.keys(r).filter(function(K) {
|
|
203
203
|
return K !== "key";
|
|
204
204
|
});
|
|
205
|
-
n = 0 <
|
|
205
|
+
n = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
207
|
let props = %s;
|
|
208
208
|
<%s {...props} />
|
|
@@ -211,108 +211,114 @@ React keys must be passed directly to JSX without using spread:
|
|
|
211
211
|
<%s key={someKey} {...props} />`,
|
|
212
212
|
n,
|
|
213
213
|
a,
|
|
214
|
-
|
|
214
|
+
v,
|
|
215
215
|
a
|
|
216
216
|
), I[a + n] = !0);
|
|
217
217
|
}
|
|
218
|
-
if (a = null, t !== void 0 && (
|
|
218
|
+
if (a = null, t !== void 0 && (f(t), a = "" + t), m(r) && (f(r.key), a = "" + r.key), "key" in r) {
|
|
219
219
|
t = {};
|
|
220
|
-
for (var
|
|
221
|
-
|
|
220
|
+
for (var w in r)
|
|
221
|
+
w !== "key" && (t[w] = r[w]);
|
|
222
222
|
} else t = r;
|
|
223
|
-
return a &&
|
|
223
|
+
return a && s(
|
|
224
224
|
t,
|
|
225
225
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
226
|
-
),
|
|
226
|
+
), c(
|
|
227
227
|
e,
|
|
228
228
|
a,
|
|
229
229
|
t,
|
|
230
230
|
o(),
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
k,
|
|
232
|
+
g
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
235
|
+
function _(e) {
|
|
236
|
+
j(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === P && (e._payload.status === "fulfilled" ? j(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function j(e) {
|
|
239
239
|
return typeof e == "object" && e !== null && e.$$typeof === x;
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var T = ee, x = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), V = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), S = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, h = Object.prototype.hasOwnProperty, Q = Array.isArray, y = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
T = {
|
|
245
245
|
react_stack_bottom_frame: function(e) {
|
|
246
246
|
return e();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
249
|
+
var C, N = {}, Y = T.react_stack_bottom_frame.bind(
|
|
250
|
+
T,
|
|
251
251
|
u
|
|
252
|
-
)(), $ =
|
|
253
|
-
|
|
254
|
-
var n = 1e4 >
|
|
255
|
-
return
|
|
252
|
+
)(), $ = y(d(u)), I = {};
|
|
253
|
+
b.Fragment = O, b.jsx = function(e, r, t) {
|
|
254
|
+
var n = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return i(
|
|
256
256
|
e,
|
|
257
257
|
r,
|
|
258
258
|
t,
|
|
259
259
|
!1,
|
|
260
260
|
n ? Error("react-stack-top-frame") : Y,
|
|
261
|
-
n ?
|
|
261
|
+
n ? y(d(e)) : $
|
|
262
262
|
);
|
|
263
|
-
},
|
|
264
|
-
var n = 1e4 >
|
|
265
|
-
return
|
|
263
|
+
}, b.jsxs = function(e, r, t) {
|
|
264
|
+
var n = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return i(
|
|
266
266
|
e,
|
|
267
267
|
r,
|
|
268
268
|
t,
|
|
269
269
|
!0,
|
|
270
270
|
n ? Error("react-stack-top-frame") : Y,
|
|
271
|
-
n ?
|
|
271
|
+
n ? y(d(e)) : $
|
|
272
272
|
);
|
|
273
273
|
};
|
|
274
|
-
})()),
|
|
274
|
+
})()), b;
|
|
275
275
|
}
|
|
276
276
|
var L;
|
|
277
277
|
function oe() {
|
|
278
|
-
return L || (L = 1, process.env.NODE_ENV === "production" ?
|
|
278
|
+
return L || (L = 1, process.env.NODE_ENV === "production" ? A.exports = ne() : A.exports = ae()), A.exports;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
const
|
|
282
|
-
backendUrl:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
280
|
+
var le = oe();
|
|
281
|
+
const ie = ({
|
|
282
|
+
backendUrl: l,
|
|
283
|
+
conversationUrl: E,
|
|
284
|
+
appName: f,
|
|
285
|
+
agentAvatar: d,
|
|
286
|
+
inspector: o,
|
|
287
|
+
interceptor: u,
|
|
288
|
+
className: m,
|
|
289
|
+
composer: s,
|
|
290
|
+
thread: R,
|
|
291
|
+
header: c,
|
|
292
|
+
context: i
|
|
291
293
|
}) => {
|
|
292
|
-
const
|
|
294
|
+
const _ = re(null);
|
|
293
295
|
return M(() => {
|
|
294
|
-
|
|
295
|
-
}, [
|
|
296
|
+
_.current && (i != null && i.appContext) && _.current.setAppContext(i.appContext);
|
|
297
|
+
}, [i == null ? void 0 : i.appContext]), /* @__PURE__ */ le.jsx(
|
|
296
298
|
"agent-chat",
|
|
297
299
|
{
|
|
298
|
-
ref:
|
|
299
|
-
"backend-url":
|
|
300
|
-
"
|
|
301
|
-
"
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
300
|
+
ref: _,
|
|
301
|
+
"backend-url": l,
|
|
302
|
+
"conversation-url": E,
|
|
303
|
+
"app-name": f,
|
|
304
|
+
"agent-avatar": d,
|
|
305
|
+
disclaimer: s == null ? void 0 : s.disclaimer,
|
|
306
|
+
placeholder: s == null ? void 0 : s.placeholder,
|
|
307
|
+
"empty-text": R == null ? void 0 : R.emptyText,
|
|
308
|
+
"header-title": c == null ? void 0 : c.title,
|
|
309
|
+
"hide-header": c == null ? void 0 : c.hide,
|
|
310
|
+
inspector: o ? "true" : void 0,
|
|
311
|
+
interceptor: u ? !0 : void 0,
|
|
312
|
+
class: m
|
|
307
313
|
}
|
|
308
314
|
);
|
|
309
315
|
};
|
|
310
|
-
function
|
|
316
|
+
function ce(l) {
|
|
311
317
|
M(() => {
|
|
312
|
-
te.registerPortal(
|
|
313
|
-
}, [
|
|
318
|
+
te.registerPortal(l);
|
|
319
|
+
}, [l]);
|
|
314
320
|
}
|
|
315
321
|
export {
|
|
316
|
-
|
|
317
|
-
|
|
322
|
+
ie as AgentChat,
|
|
323
|
+
ce as useChatPortal
|
|
318
324
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(c,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("site-operator")):typeof define=="function"&&define.amd?define(["exports","react","site-operator"],f):(c=typeof globalThis<"u"?globalThis:c||self,f(c.SiteOperatorReact={},c.React,c.SiteOperator))})(this,(function(c,f,$){"use strict";var O={exports:{}},b={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var x;function J(){if(x)return b;x=1;var u=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function E(m,o,s){var _=null;if(s!==void 0&&(_=""+s),o.key!==void 0&&(_=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:u,type:m,key:_,ref:o!==void 0?o:null,props:s}}return b.Fragment=p,b.jsx=E,b.jsxs=E,b}var T={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var C;function V(){return C||(C=1,process.env.NODE_ENV!=="production"&&(function(){function u(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case Z:return"Profiler";case H:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case B:return"Portal";case K:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:u(e.type)||"Memo";case y:r=e._payload,e=e._init;try{return u(e(r))}catch{}}return null}function p(e){return""+e}function E(e){try{p(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),p(e)}}function m(e){if(e===P)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===y)return"<...>";try{var r=u(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function o(){var e=g.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function _(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function l(e,r){function t(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function k(){var e=u(this.type);return M[e]||(M[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function d(e,r,t,n,A,w){var a=t.ref;return e={$$typeof:I,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:k}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:w}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function i(e,r,t,n,A,w){var a=r.children;if(a!==void 0)if(n)if(ue(a)){for(n=0;n<a.length;n++)R(a[n]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else R(a);if(F.call(r,"key")){a=u(e);var v=Object.keys(r).filter(function(se){return se!=="key"});n=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",U[a+n]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,n,a,
|
|
22
|
+
<%s key={someKey} {...props} />`,n,a,v,a),U[a+n]=!0)}if(a=null,t!==void 0&&(E(t),a=""+t),_(r)&&(E(r.key),a=""+r.key),"key"in r){t={};for(var h in r)h!=="key"&&(t[h]=r[h])}else t=r;return a&&l(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),d(e,a,t,o(),A,w)}function R(e){Y(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===y&&(e._payload.status==="fulfilled"?Y(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function Y(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}var S=f,I=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),g=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,ue=Array.isArray,j=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(e){return e()}};var D,M={},L=S.react_stack_bottom_frame.bind(S,s)(),W=j(m(s)),U={};T.Fragment=P,T.jsx=function(e,r,t){var n=1e4>g.recentlyCreatedOwnerStacks++;return i(e,r,t,!1,n?Error("react-stack-top-frame"):L,n?j(m(e)):W)},T.jsxs=function(e,r,t){var n=1e4>g.recentlyCreatedOwnerStacks++;return i(e,r,t,!0,n?Error("react-stack-top-frame"):L,n?j(m(e)):W)}})()),T}var N;function z(){return N||(N=1,process.env.NODE_ENV==="production"?O.exports=J():O.exports=V()),O.exports}var q=z();const G=({backendUrl:u,conversationUrl:p,appName:E,agentAvatar:m,inspector:o,interceptor:s,className:_,composer:l,thread:k,header:d,context:i})=>{const R=f.useRef(null);return f.useEffect(()=>{R.current&&(i!=null&&i.appContext)&&R.current.setAppContext(i.appContext)},[i==null?void 0:i.appContext]),q.jsx("agent-chat",{ref:R,"backend-url":u,"conversation-url":p,"app-name":E,"agent-avatar":m,disclaimer:l==null?void 0:l.disclaimer,placeholder:l==null?void 0:l.placeholder,"empty-text":k==null?void 0:k.emptyText,"header-title":d==null?void 0:d.title,"hide-header":d==null?void 0:d.hide,inspector:o?"true":void 0,interceptor:s?!0:void 0,class:_})};function X(u){f.useEffect(()=>{$.chatPortalService.registerPortal(u)},[u])}c.AgentChat=G,c.useChatPortal=X,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
|