@bymos/agentkit-sdk 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRoot as an } from "preact/compat/client";
2
- import { createElement as Bt, useCallback as sn, useEffect as le, useMemo as kr, useRef as oe, useState as ce } from "preact/compat";
2
+ import { createElement as Bt, useCallback as sn, useEffect as te, useMemo as kr, useRef as le, useState as ce } from "preact/compat";
3
3
  import { Fragment as de, jsx as d, jsxs as v } from "preact/jsx-runtime";
4
4
  var M;
5
5
  (function(e) {
@@ -99,7 +99,7 @@ var y = M.arrayToEnum([
99
99
  "invalid_intersection_types",
100
100
  "not_multiple_of",
101
101
  "not_finite"
102
- ]), te = class br extends Error {
102
+ ]), re = class br extends Error {
103
103
  get errors() {
104
104
  return this.issues;
105
105
  }
@@ -157,7 +157,7 @@ var y = M.arrayToEnum([
157
157
  return this.flatten();
158
158
  }
159
159
  };
160
- te.create = (e) => new te(e);
160
+ re.create = (e) => new re(e);
161
161
  var Ze = (e, t) => {
162
162
  let r;
163
163
  switch (e.code) {
@@ -297,7 +297,7 @@ var Y = class yr {
297
297
  value: n
298
298
  };
299
299
  }
300
- }, S = Object.freeze({ status: "aborted" }), je = (e) => ({
300
+ }, S = Object.freeze({ status: "aborted" }), Re = (e) => ({
301
301
  status: "dirty",
302
302
  value: e
303
303
  }), D = (e) => ({
@@ -307,7 +307,7 @@ var Y = class yr {
307
307
  (function(e) {
308
308
  e.errToObj = (t) => typeof t == "string" ? { message: t } : t || {}, e.toString = (t) => typeof t == "string" ? t : t?.message;
309
309
  })(w || (w = {}));
310
- var re = class {
310
+ var ne = class {
311
311
  constructor(e, t, r, n) {
312
312
  this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = n;
313
313
  }
@@ -324,7 +324,7 @@ var re = class {
324
324
  success: !1,
325
325
  get error() {
326
326
  if (this._error) return this._error;
327
- const r = new te(e.common.issues);
327
+ const r = new re(e.common.issues);
328
328
  return this._error = r, this._error;
329
329
  }
330
330
  };
@@ -603,7 +603,7 @@ function Nn(e, t) {
603
603
  function Tn(e, t) {
604
604
  return !!((t === "v4" || !t) && kn.test(e) || (t === "v6" || !t) && yn.test(e));
605
605
  }
606
- var Ke = class Re extends E {
606
+ var Ke = class je extends E {
607
607
  _parse(t) {
608
608
  if (this._def.coerce && (t.data = String(t.data)), this._getType(t) !== y.string) {
609
609
  const a = this._getOrReturnCtx(t);
@@ -770,7 +770,7 @@ var Ke = class Re extends E {
770
770
  });
771
771
  }
772
772
  _addCheck(t) {
773
- return new Re({
773
+ return new je({
774
774
  ...this._def,
775
775
  checks: [...this._def.checks, t]
776
776
  });
@@ -945,19 +945,19 @@ var Ke = class Re extends E {
945
945
  return this.min(1, w.errToObj(t));
946
946
  }
947
947
  trim() {
948
- return new Re({
948
+ return new je({
949
949
  ...this._def,
950
950
  checks: [...this._def.checks, { kind: "trim" }]
951
951
  });
952
952
  }
953
953
  toLowerCase() {
954
- return new Re({
954
+ return new je({
955
955
  ...this._def,
956
956
  checks: [...this._def.checks, { kind: "toLowerCase" }]
957
957
  });
958
958
  }
959
959
  toUpperCase() {
960
- return new Re({
960
+ return new je({
961
961
  ...this._def,
962
962
  checks: [...this._def.checks, { kind: "toUpperCase" }]
963
963
  });
@@ -1557,8 +1557,8 @@ var Le = class Ye extends E {
1557
1557
  inclusive: !0,
1558
1558
  exact: !1,
1559
1559
  message: a.maxLength.message
1560
- }), n.dirty()), r.common.async) return Promise.all([...r.data].map((s, l) => a.type._parseAsync(new re(r, s, r.path, l)))).then((s) => Y.mergeArray(n, s));
1561
- const i = [...r.data].map((s, l) => a.type._parseSync(new re(r, s, r.path, l)));
1560
+ }), n.dirty()), r.common.async) return Promise.all([...r.data].map((s, l) => a.type._parseAsync(new ne(r, s, r.path, l)))).then((s) => Y.mergeArray(n, s));
1561
+ const i = [...r.data].map((s, l) => a.type._parseSync(new ne(r, s, r.path, l)));
1562
1562
  return Y.mergeArray(n, i);
1563
1563
  }
1564
1564
  get element() {
@@ -1651,7 +1651,7 @@ var q = class Q extends E {
1651
1651
  status: "valid",
1652
1652
  value: o
1653
1653
  },
1654
- value: c._parse(new re(n, u, n.path, o)),
1654
+ value: c._parse(new ne(n, u, n.path, o)),
1655
1655
  alwaysSet: o in n.data
1656
1656
  });
1657
1657
  }
@@ -1683,7 +1683,7 @@ var q = class Q extends E {
1683
1683
  status: "valid",
1684
1684
  value: c
1685
1685
  },
1686
- value: o._parse(new re(n, u, n.path, c)),
1686
+ value: o._parse(new ne(n, u, n.path, c)),
1687
1687
  alwaysSet: c in n.data
1688
1688
  });
1689
1689
  }
@@ -1830,7 +1830,7 @@ var tt = class extends E {
1830
1830
  for (const s of a) if (s.result.status === "valid") return s.result;
1831
1831
  for (const s of a) if (s.result.status === "dirty")
1832
1832
  return t.common.issues.push(...s.ctx.common.issues), s.result;
1833
- const i = a.map((s) => new te(s.ctx.common.issues));
1833
+ const i = a.map((s) => new re(s.ctx.common.issues));
1834
1834
  return k(t, {
1835
1835
  code: f.invalid_union,
1836
1836
  unionErrors: i
@@ -1878,7 +1878,7 @@ var tt = class extends E {
1878
1878
  }
1879
1879
  if (a)
1880
1880
  return t.common.issues.push(...a.ctx.common.issues), a.result;
1881
- const s = i.map((l) => new te(l));
1881
+ const s = i.map((l) => new re(l));
1882
1882
  return k(t, {
1883
1883
  code: f.invalid_union,
1884
1884
  unionErrors: s
@@ -1894,7 +1894,7 @@ tt.create = (e, t) => new tt({
1894
1894
  typeName: C.ZodUnion,
1895
1895
  ...T(t)
1896
1896
  });
1897
- var ie = (e) => e instanceof nt ? ie(e.schema) : e instanceof he ? ie(e.innerType()) : e instanceof at ? [e.value] : e instanceof dt ? e.options : e instanceof it ? M.objectValues(e.enum) : e instanceof st ? ie(e._def.innerType) : e instanceof qe ? [void 0] : e instanceof et ? [null] : e instanceof ue ? [void 0, ...ie(e.unwrap())] : e instanceof be ? [null, ...ie(e.unwrap())] : e instanceof Nr || e instanceof lt ? ie(e.unwrap()) : e instanceof ot ? ie(e._def.innerType) : [], An = class Sr extends E {
1897
+ var se = (e) => e instanceof nt ? se(e.schema) : e instanceof he ? se(e.innerType()) : e instanceof at ? [e.value] : e instanceof dt ? e.options : e instanceof it ? M.objectValues(e.enum) : e instanceof st ? se(e._def.innerType) : e instanceof qe ? [void 0] : e instanceof et ? [null] : e instanceof ue ? [void 0, ...se(e.unwrap())] : e instanceof be ? [null, ...se(e.unwrap())] : e instanceof Nr || e instanceof lt ? se(e.unwrap()) : e instanceof ot ? se(e._def.innerType) : [], An = class Sr extends E {
1898
1898
  _parse(t) {
1899
1899
  const { ctx: r } = this._processInputParams(t);
1900
1900
  if (r.parsedType !== y.object)
@@ -1930,7 +1930,7 @@ var ie = (e) => e instanceof nt ? ie(e.schema) : e instanceof he ? ie(e.innerTyp
1930
1930
  static create(t, r, n) {
1931
1931
  const a = /* @__PURE__ */ new Map();
1932
1932
  for (const i of r) {
1933
- const s = ie(i.shape[t]);
1933
+ const s = se(i.shape[t]);
1934
1934
  if (!s.length) throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
1935
1935
  for (const l of s) {
1936
1936
  if (a.has(l)) throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);
@@ -2044,7 +2044,7 @@ var ke = class Cr extends E {
2044
2044
  }), r.dirty());
2045
2045
  const a = [...n.data].map((i, s) => {
2046
2046
  const l = this._def.items[s] || this._def.rest;
2047
- return l ? l._parse(new re(n, i, n.path, s)) : null;
2047
+ return l ? l._parse(new ne(n, i, n.path, s)) : null;
2048
2048
  }).filter((i) => !!i);
2049
2049
  return n.common.async ? Promise.all(a).then((i) => Y.mergeArray(r, i)) : Y.mergeArray(r, a);
2050
2050
  }
@@ -2084,8 +2084,8 @@ var En = class Lt extends E {
2084
2084
  }), S;
2085
2085
  const a = [], i = this._def.keyType, s = this._def.valueType;
2086
2086
  for (const l in n.data) a.push({
2087
- key: i._parse(new re(n, l, n.path, l)),
2088
- value: s._parse(new re(n, n.data[l], n.path, l)),
2087
+ key: i._parse(new ne(n, l, n.path, l)),
2088
+ value: s._parse(new ne(n, n.data[l], n.path, l)),
2089
2089
  alwaysSet: l in n.data
2090
2090
  });
2091
2091
  return n.common.async ? Y.mergeObjectAsync(r, a) : Y.mergeObjectSync(r, a);
@@ -2122,8 +2122,8 @@ var En = class Lt extends E {
2122
2122
  received: r.parsedType
2123
2123
  }), S;
2124
2124
  const n = this._def.keyType, a = this._def.valueType, i = [...r.data.entries()].map(([s, l], o) => ({
2125
- key: n._parse(new re(r, s, r.path, [o, "key"])),
2126
- value: a._parse(new re(r, l, r.path, [o, "value"]))
2125
+ key: n._parse(new ne(r, s, r.path, [o, "key"])),
2126
+ value: a._parse(new ne(r, l, r.path, [o, "value"]))
2127
2127
  }));
2128
2128
  if (r.common.async) {
2129
2129
  const s = /* @__PURE__ */ new Map();
@@ -2195,7 +2195,7 @@ var Et = class Mt extends E {
2195
2195
  value: c
2196
2196
  };
2197
2197
  }
2198
- const l = [...n.data.values()].map((o, c) => i._parse(new re(n, o, n.path, c)));
2198
+ const l = [...n.data.values()].map((o, c) => i._parse(new ne(n, o, n.path, c)));
2199
2199
  return n.common.async ? Promise.all(l).then((o) => s(o)) : s(l);
2200
2200
  }
2201
2201
  min(t, r) {
@@ -2278,7 +2278,7 @@ var Mn = class Xe extends E {
2278
2278
  if (this._def.returns instanceof Oe) {
2279
2279
  const l = this;
2280
2280
  return D(async function(...o) {
2281
- const c = new te([]), u = await l._def.args.parseAsync(o, i).catch((p) => {
2281
+ const c = new re([]), u = await l._def.args.parseAsync(o, i).catch((p) => {
2282
2282
  throw c.addIssue(n(o, p)), c;
2283
2283
  }), h = await Reflect.apply(s, this, u);
2284
2284
  return await l._def.returns._def.type.parseAsync(h, i).catch((p) => {
@@ -2289,9 +2289,9 @@ var Mn = class Xe extends E {
2289
2289
  const l = this;
2290
2290
  return D(function(...o) {
2291
2291
  const c = l._def.args.safeParse(o, i);
2292
- if (!c.success) throw new te([n(o, c.error)]);
2292
+ if (!c.success) throw new re([n(o, c.error)]);
2293
2293
  const u = Reflect.apply(s, this, c.data), h = l._def.returns.safeParse(u, i);
2294
- if (!h.success) throw new te([a(u, h.error)]);
2294
+ if (!h.success) throw new re([a(u, h.error)]);
2295
2295
  return h.data;
2296
2296
  });
2297
2297
  }
@@ -2377,7 +2377,7 @@ function Ir(e, t) {
2377
2377
  ...T(t)
2378
2378
  });
2379
2379
  }
2380
- var dt = class jt extends E {
2380
+ var dt = class Rt extends E {
2381
2381
  _parse(t) {
2382
2382
  if (typeof t.data != "string") {
2383
2383
  const r = this._getOrReturnCtx(t), n = this._def.values;
@@ -2416,13 +2416,13 @@ var dt = class jt extends E {
2416
2416
  return t;
2417
2417
  }
2418
2418
  extract(t, r = this._def) {
2419
- return jt.create(t, {
2419
+ return Rt.create(t, {
2420
2420
  ...this._def,
2421
2421
  ...r
2422
2422
  });
2423
2423
  }
2424
2424
  exclude(t, r = this._def) {
2425
- return jt.create(this.options.filter((n) => !t.includes(n)), {
2425
+ return Rt.create(this.options.filter((n) => !t.includes(n)), {
2426
2426
  ...this._def,
2427
2427
  ...r
2428
2428
  });
@@ -2505,7 +2505,7 @@ var he = class extends E {
2505
2505
  path: r.path,
2506
2506
  parent: r
2507
2507
  });
2508
- return l.status === "aborted" ? S : l.status === "dirty" || t.value === "dirty" ? je(l.value) : l;
2508
+ return l.status === "aborted" ? S : l.status === "dirty" || t.value === "dirty" ? Re(l.value) : l;
2509
2509
  });
2510
2510
  {
2511
2511
  if (t.value === "aborted") return S;
@@ -2514,7 +2514,7 @@ var he = class extends E {
2514
2514
  path: r.path,
2515
2515
  parent: r
2516
2516
  });
2517
- return s.status === "aborted" ? S : s.status === "dirty" || t.value === "dirty" ? je(s.value) : s;
2517
+ return s.status === "aborted" ? S : s.status === "dirty" || t.value === "dirty" ? Re(s.value) : s;
2518
2518
  }
2519
2519
  }
2520
2520
  if (n.type === "refinement") {
@@ -2645,7 +2645,7 @@ var ot = class extends E {
2645
2645
  status: "valid",
2646
2646
  value: a.status === "valid" ? a.value : this._def.catchValue({
2647
2647
  get error() {
2648
- return new te(r.common.issues);
2648
+ return new re(r.common.issues);
2649
2649
  },
2650
2650
  input: r.data
2651
2651
  })
@@ -2653,7 +2653,7 @@ var ot = class extends E {
2653
2653
  status: "valid",
2654
2654
  value: n.status === "valid" ? n.value : this._def.catchValue({
2655
2655
  get error() {
2656
- return new te(r.common.issues);
2656
+ return new re(r.common.issues);
2657
2657
  },
2658
2658
  input: r.data
2659
2659
  })
@@ -2669,7 +2669,7 @@ ot.create = (e, t) => new ot({
2669
2669
  catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
2670
2670
  ...T(t)
2671
2671
  });
2672
- var Rt = class extends E {
2672
+ var jt = class extends E {
2673
2673
  _parse(e) {
2674
2674
  if (this._getType(e) !== y.nan) {
2675
2675
  const t = this._getOrReturnCtx(e);
@@ -2685,7 +2685,7 @@ var Rt = class extends E {
2685
2685
  };
2686
2686
  }
2687
2687
  };
2688
- Rt.create = (e) => new Rt({
2688
+ jt.create = (e) => new jt({
2689
2689
  typeName: C.ZodNaN,
2690
2690
  ...T(e)
2691
2691
  });
@@ -2711,7 +2711,7 @@ var Nr = class extends E {
2711
2711
  path: n.path,
2712
2712
  parent: n
2713
2713
  });
2714
- return i.status === "aborted" ? S : i.status === "dirty" ? (r.dirty(), je(i.value)) : this._def.out._parseAsync({
2714
+ return i.status === "aborted" ? S : i.status === "dirty" ? (r.dirty(), Re(i.value)) : this._def.out._parseAsync({
2715
2715
  data: i.value,
2716
2716
  path: n.path,
2717
2717
  parent: n
@@ -2758,7 +2758,7 @@ var eo = { object: q.lazycreate }, C;
2758
2758
  (function(e) {
2759
2759
  e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
2760
2760
  })(C || (C = {}));
2761
- var P = Ke.create, to = bt.create, ro = Rt.create, no = _t.create, ft = wt.create, ao = St.create, io = Ct.create, so = qe.create, oo = et.create, lo = It.create, jn = Ie.create, co = ge.create, uo = Nt.create, ho = Le.create, Ft = q.create, fo = q.strictCreate, po = tt.create, mo = An.create, go = rt.create, vo = ke.create, Rn = En.create, ko = At.create, bo = Et.create, yo = Mn.create, _o = nt.create, xo = at.create, Ar = dt.create, wo = it.create, So = Oe.create, Co = he.create, Io = ue.create, No = be.create, To = he.createWithPreprocess, Lo = Tr.create, Zn = Ft({
2761
+ var P = Ke.create, to = bt.create, ro = jt.create, no = _t.create, ft = wt.create, ao = St.create, io = Ct.create, so = qe.create, oo = et.create, lo = It.create, Rn = Ie.create, co = ge.create, uo = Nt.create, ho = Le.create, Ft = q.create, fo = q.strictCreate, po = tt.create, mo = An.create, go = rt.create, vo = ke.create, jn = En.create, ko = At.create, bo = Et.create, yo = Mn.create, _o = nt.create, xo = at.create, Ar = dt.create, wo = it.create, So = Oe.create, Co = he.create, Io = ue.create, No = be.create, To = he.createWithPreprocess, Lo = Tr.create, Zn = Ft({
2762
2762
  mode: Ar([
2763
2763
  "light",
2764
2764
  "dark",
@@ -2789,7 +2789,7 @@ var P = Ke.create, to = bt.create, ro = Rt.create, no = _t.create, ft = wt.creat
2789
2789
  streaming: ft().optional(),
2790
2790
  preview: ft().optional(),
2791
2791
  skipServerConfigFetch: ft().optional(),
2792
- metadata: Rn(jn()).optional(),
2792
+ metadata: jn(Rn()).optional(),
2793
2793
  theme: Zn.optional()
2794
2794
  }), Pn = Er.omit({
2795
2795
  agentId: !0,
@@ -2871,7 +2871,7 @@ var Zt = function() {
2871
2871
  return t;
2872
2872
  }, Zt.apply(this, arguments);
2873
2873
  };
2874
- function ne(e, t, r, n) {
2874
+ function ae(e, t, r, n) {
2875
2875
  function a(i) {
2876
2876
  return i instanceof r ? i : new r(function(s) {
2877
2877
  s(i);
@@ -2898,7 +2898,7 @@ function ne(e, t, r, n) {
2898
2898
  c((n = n.apply(e, t || [])).next());
2899
2899
  });
2900
2900
  }
2901
- function ae(e, t) {
2901
+ function ie(e, t) {
2902
2902
  var r = {
2903
2903
  label: 0,
2904
2904
  sent: function() {
@@ -2969,12 +2969,12 @@ function ae(e, t) {
2969
2969
  };
2970
2970
  }
2971
2971
  }
2972
- function jr(e, t, r) {
2972
+ function Rr(e, t, r) {
2973
2973
  if (r || arguments.length === 2)
2974
2974
  for (var n = 0, a = t.length, i; n < a; n++) (i || !(n in t)) && (i || (i = Array.prototype.slice.call(t, 0, n)), i[n] = t[n]);
2975
2975
  return e.concat(i || Array.prototype.slice.call(t));
2976
2976
  }
2977
- var Rr = "4.6.2";
2977
+ var jr = "4.6.2";
2978
2978
  function ct(e, t) {
2979
2979
  return new Promise(function(r) {
2980
2980
  return setTimeout(r, e, t);
@@ -3013,9 +3013,9 @@ function Jt(e, t) {
3013
3013
  }
3014
3014
  }
3015
3015
  function Qt(e, t, r) {
3016
- return r === void 0 && (r = 16), ne(this, void 0, void 0, function() {
3016
+ return r === void 0 && (r = 16), ae(this, void 0, void 0, function() {
3017
3017
  var n, a, i, s;
3018
- return ae(this, function(l) {
3018
+ return ie(this, function(l) {
3019
3019
  switch (l.label) {
3020
3020
  case 0:
3021
3021
  n = Array(e.length), a = Date.now(), i = 0, l.label = 1;
@@ -3048,7 +3048,7 @@ function Wt(e) {
3048
3048
  function K(e) {
3049
3049
  return parseFloat(e);
3050
3050
  }
3051
- function se(e, t) {
3051
+ function oe(e, t) {
3052
3052
  return typeof e == "number" && isNaN(e) ? t : e;
3053
3053
  }
3054
3054
  function z(e) {
@@ -3226,9 +3226,9 @@ function qn(e, t, r, n) {
3226
3226
  return Kn(e[s], t);
3227
3227
  }, n));
3228
3228
  return function() {
3229
- return ne(this, void 0, void 0, function() {
3229
+ return ae(this, void 0, void 0, function() {
3230
3230
  var l, o, c, u, h;
3231
- return ae(this, function(p) {
3231
+ return ie(this, function(p) {
3232
3232
  switch (p.label) {
3233
3233
  case 0:
3234
3234
  return [4, i];
@@ -3459,9 +3459,9 @@ function er(e) {
3459
3459
  }
3460
3460
  function Vr(e, t, r) {
3461
3461
  var n, a, i;
3462
- return r === void 0 && (r = 50), ne(this, void 0, void 0, function() {
3462
+ return r === void 0 && (r = 50), ae(this, void 0, void 0, function() {
3463
3463
  var s, l;
3464
- return ae(this, function(o) {
3464
+ return ie(this, function(o) {
3465
3465
  switch (o.label) {
3466
3466
  case 0:
3467
3467
  s = document, o.label = 1;
@@ -3601,12 +3601,12 @@ function ba() {
3601
3601
  var e = this;
3602
3602
  return Vr(function(t, r) {
3603
3603
  var n = r.document;
3604
- return ne(e, void 0, void 0, function() {
3604
+ return ae(e, void 0, void 0, function() {
3605
3605
  var a, i, s, l, o, c, u, h, p, g, m, b;
3606
- return ae(this, function(_) {
3606
+ return ie(this, function(_) {
3607
3607
  for (a = n.body, a.style.fontSize = ka, i = n.createElement("div"), i.style.setProperty("visibility", "hidden", "important"), s = {}, l = {}, o = function(x) {
3608
- var L = n.createElement("span"), R = L.style;
3609
- return R.position = "absolute", R.top = "0", R.left = "0", R.fontFamily = x, L.textContent = va, i.appendChild(L), L;
3608
+ var L = n.createElement("span"), j = L.style;
3609
+ return j.position = "absolute", j.top = "0", j.left = "0", j.fontFamily = x, L.textContent = va, i.appendChild(L), L;
3610
3610
  }, c = function(x, L) {
3611
3611
  return o("'".concat(x, "',").concat(L));
3612
3612
  }, u = function() {
@@ -3616,14 +3616,14 @@ function ba() {
3616
3616
  x[V] = xe.map(function(N) {
3617
3617
  return c(V, N);
3618
3618
  });
3619
- }, R = 0, F = tr; R < F.length; R++) {
3620
- var U = F[R];
3619
+ }, j = 0, F = tr; j < F.length; j++) {
3620
+ var U = F[j];
3621
3621
  L(U);
3622
3622
  }
3623
3623
  return x;
3624
3624
  }, p = function(x) {
3625
- return xe.some(function(L, R) {
3626
- return x[R].offsetWidth !== s[L] || x[R].offsetHeight !== l[L];
3625
+ return xe.some(function(L, j) {
3626
+ return x[j].offsetWidth !== s[L] || x[j].offsetHeight !== l[L];
3627
3627
  });
3628
3628
  }, g = u(), m = h(), a.appendChild(i), b = 0; b < xe.length; b++)
3629
3629
  s[xe[b]] = g[b].offsetWidth, l[xe[b]] = g[b].offsetHeight;
@@ -3746,11 +3746,11 @@ function Ma() {
3746
3746
  }
3747
3747
  return t;
3748
3748
  }
3749
- function ja() {
3749
+ function Ra() {
3750
3750
  return window.screen.colorDepth;
3751
3751
  }
3752
- function Ra() {
3753
- return se(K(navigator.deviceMemory), void 0);
3752
+ function ja() {
3753
+ return oe(K(navigator.deviceMemory), void 0);
3754
3754
  }
3755
3755
  function Za() {
3756
3756
  if (!(ee() && We() && Ve()))
@@ -3758,7 +3758,7 @@ function Za() {
3758
3758
  }
3759
3759
  function Oa() {
3760
3760
  var e = screen, t = function(n) {
3761
- return se(Wt(n), null);
3761
+ return oe(Wt(n), null);
3762
3762
  }, r = [t(e.width), t(e.height)];
3763
3763
  return r.sort().reverse(), r;
3764
3764
  }
@@ -3775,12 +3775,12 @@ function Va() {
3775
3775
  function Wa() {
3776
3776
  var e = this;
3777
3777
  return Va(), function() {
3778
- return ne(e, void 0, void 0, function() {
3778
+ return ae(e, void 0, void 0, function() {
3779
3779
  var t;
3780
- return ae(this, function(r) {
3780
+ return ie(this, function(r) {
3781
3781
  switch (r.label) {
3782
3782
  case 0:
3783
- return t = Ot(), Pt(t) ? Je ? [2, jr([], Je, !0)] : ia() ? [4, sa()] : [3, 2] : [3, 2];
3783
+ return t = Ot(), Pt(t) ? Je ? [2, Rr([], Je, !0)] : ia() ? [4, sa()] : [3, 2] : [3, 2];
3784
3784
  case 1:
3785
3785
  r.sent(), t = Ot(), r.label = 2;
3786
3786
  case 2:
@@ -3797,9 +3797,9 @@ function $a() {
3797
3797
  };
3798
3798
  var t = Wa();
3799
3799
  return function() {
3800
- return ne(e, void 0, void 0, function() {
3800
+ return ae(e, void 0, void 0, function() {
3801
3801
  var r, n;
3802
- return ae(this, function(a) {
3802
+ return ie(this, function(a) {
3803
3803
  switch (a.label) {
3804
3804
  case 0:
3805
3805
  return [4, t()];
@@ -3820,10 +3820,10 @@ function $a() {
3820
3820
  function Ot() {
3821
3821
  var e = screen;
3822
3822
  return [
3823
- se(K(e.availTop), null),
3824
- se(K(e.width) - K(e.availWidth) - se(K(e.availLeft), 0), null),
3825
- se(K(e.height) - K(e.availHeight) - se(K(e.availTop), 0), null),
3826
- se(K(e.availLeft), null)
3823
+ oe(K(e.availTop), null),
3824
+ oe(K(e.width) - K(e.availWidth) - oe(K(e.availLeft), 0), null),
3825
+ oe(K(e.height) - K(e.availHeight) - oe(K(e.availTop), 0), null),
3826
+ oe(K(e.availLeft), null)
3827
3827
  ];
3828
3828
  }
3829
3829
  function Pt(e) {
@@ -3831,7 +3831,7 @@ function Pt(e) {
3831
3831
  return !0;
3832
3832
  }
3833
3833
  function za() {
3834
- return se(Wt(navigator.hardwareConcurrency), void 0);
3834
+ return oe(Wt(navigator.hardwareConcurrency), void 0);
3835
3835
  }
3836
3836
  function Da() {
3837
3837
  var e, t = (e = window.Intl) === null || e === void 0 ? void 0 : e.DateTimeFormat;
@@ -4205,9 +4205,9 @@ function ei() {
4205
4205
  }
4206
4206
  function ti(e) {
4207
4207
  var t = (e === void 0 ? {} : e).debug;
4208
- return ne(this, void 0, void 0, function() {
4208
+ return ae(this, void 0, void 0, function() {
4209
4209
  var r, n, a, i, s, l;
4210
- return ae(this, function(o) {
4210
+ return ie(this, function(o) {
4211
4211
  switch (o.label) {
4212
4212
  case 0:
4213
4213
  return ri() ? (r = ei(), n = Object.keys(r), a = (l = []).concat.apply(l, n.map(function(c) {
@@ -4229,9 +4229,9 @@ function ri() {
4229
4229
  }
4230
4230
  function ni(e) {
4231
4231
  var t;
4232
- return ne(this, void 0, void 0, function() {
4232
+ return ae(this, void 0, void 0, function() {
4233
4233
  var r, n, a, i, o, s, l, o;
4234
- return ae(this, function(c) {
4234
+ return ie(this, function(c) {
4235
4235
  switch (c.label) {
4236
4236
  case 0:
4237
4237
  for (r = document, n = r.createElement("div"), a = new Array(e.length), i = {}, rr(n), o = 0; o < e.length; ++o)
@@ -4329,28 +4329,28 @@ function fi() {
4329
4329
  function or(e) {
4330
4330
  return matchMedia("(dynamic-range: ".concat(e, ")")).matches;
4331
4331
  }
4332
- var j = Math, $ = function() {
4332
+ var R = Math, $ = function() {
4333
4333
  return 0;
4334
4334
  };
4335
4335
  function pi() {
4336
- var e = j.acos || $, t = j.acosh || $, r = j.asin || $, n = j.asinh || $, a = j.atanh || $, i = j.atan || $, s = j.sin || $, l = j.sinh || $, o = j.cos || $, c = j.cosh || $, u = j.tan || $, h = j.tanh || $, p = j.exp || $, g = j.expm1 || $, m = j.log1p || $, b = function(I) {
4337
- return j.pow(j.PI, I);
4336
+ var e = R.acos || $, t = R.acosh || $, r = R.asin || $, n = R.asinh || $, a = R.atanh || $, i = R.atan || $, s = R.sin || $, l = R.sinh || $, o = R.cos || $, c = R.cosh || $, u = R.tan || $, h = R.tanh || $, p = R.exp || $, g = R.expm1 || $, m = R.log1p || $, b = function(I) {
4337
+ return R.pow(R.PI, I);
4338
4338
  }, _ = function(I) {
4339
- return j.log(I + j.sqrt(I * I - 1));
4339
+ return R.log(I + R.sqrt(I * I - 1));
4340
4340
  }, x = function(I) {
4341
- return j.log(I + j.sqrt(I * I + 1));
4341
+ return R.log(I + R.sqrt(I * I + 1));
4342
4342
  }, L = function(I) {
4343
- return j.log((1 + I) / (1 - I)) / 2;
4344
- }, R = function(I) {
4345
- return j.exp(I) - 1 / j.exp(I) / 2;
4343
+ return R.log((1 + I) / (1 - I)) / 2;
4344
+ }, j = function(I) {
4345
+ return R.exp(I) - 1 / R.exp(I) / 2;
4346
4346
  }, F = function(I) {
4347
- return (j.exp(I) + 1 / j.exp(I)) / 2;
4347
+ return (R.exp(I) + 1 / R.exp(I)) / 2;
4348
4348
  }, U = function(I) {
4349
- return j.exp(I) - 1;
4349
+ return R.exp(I) - 1;
4350
4350
  }, V = function(I) {
4351
- return (j.exp(2 * I) - 1) / (j.exp(2 * I) + 1);
4351
+ return (R.exp(2 * I) - 1) / (R.exp(2 * I) + 1);
4352
4352
  }, N = function(I) {
4353
- return j.log(1 + I);
4353
+ return R.log(1 + I);
4354
4354
  };
4355
4355
  return {
4356
4356
  acos: e(0.12312423423423424),
@@ -4364,7 +4364,7 @@ function pi() {
4364
4364
  atan: i(0.5),
4365
4365
  sin: s(-1e300),
4366
4366
  sinh: l(1),
4367
- sinhPf: R(1),
4367
+ sinhPf: j(1),
4368
4368
  cos: o(10.000000000123),
4369
4369
  cosh: c(1),
4370
4370
  coshPf: F(1),
@@ -4411,7 +4411,7 @@ function vi(e, t) {
4411
4411
  var a = n.document, i = a.body, s = i.style;
4412
4412
  s.width = "".concat(t, "px"), s.webkitTextSizeAdjust = s.textSizeAdjust = "none", Fe() ? i.style.zoom = "".concat(1 / n.devicePixelRatio) : ee() && (i.style.zoom = "reset");
4413
4413
  var l = a.createElement("div");
4414
- return l.textContent = jr([], Array(t / 20 << 0), !0).map(function() {
4414
+ return l.textContent = Rr([], Array(t / 20 << 0), !0).map(function() {
4415
4415
  return "word";
4416
4416
  }).join(" "), i.appendChild(l), e(a, i);
4417
4417
  }, '<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');
@@ -4570,9 +4570,9 @@ function Ai(e) {
4570
4570
  var _ = b[m], x = r[_];
4571
4571
  l.push("".concat(_, "=").concat(x).concat(Si.has(x) ? "=".concat(r.getParameter(x)) : ""));
4572
4572
  }
4573
- if (n) for (var L = 0, R = n; L < R.length; L++) {
4574
- var F = R[L];
4575
- if (!(F === zr && Ur() || F === Ti && ji())) {
4573
+ if (n) for (var L = 0, j = n; L < j.length; L++) {
4574
+ var F = j[L];
4575
+ if (!(F === zr && Ur() || F === Ti && Ri())) {
4576
4576
  var U = r.getExtension(F);
4577
4577
  if (!U) {
4578
4578
  i.push(F);
@@ -4631,13 +4631,13 @@ function Mi(e) {
4631
4631
  function Ur() {
4632
4632
  return Fr();
4633
4633
  }
4634
- function ji() {
4634
+ function Ri() {
4635
4635
  return Fe() || ee();
4636
4636
  }
4637
4637
  function Br(e) {
4638
4638
  return typeof e.getParameter == "function";
4639
4639
  }
4640
- function Ri() {
4640
+ function ji() {
4641
4641
  if (!(zt() || ee())) return -2;
4642
4642
  if (!window.AudioContext) return -1;
4643
4643
  var e = new AudioContext().baseLatency;
@@ -4659,8 +4659,8 @@ var Oi = {
4659
4659
  canvas: _a,
4660
4660
  osCpu: Ea,
4661
4661
  languages: Ma,
4662
- colorDepth: ja,
4663
- deviceMemory: Ra,
4662
+ colorDepth: Ra,
4663
+ deviceMemory: ja,
4664
4664
  screenResolution: Za,
4665
4665
  hardwareConcurrency: za,
4666
4666
  timezone: Da,
@@ -4688,7 +4688,7 @@ var Oi = {
4688
4688
  architecture: bi,
4689
4689
  applePay: yi,
4690
4690
  privateClickMeasurement: wi,
4691
- audioBaseLatency: Ri,
4691
+ audioBaseLatency: ji,
4692
4692
  dateTimeLocale: Zi,
4693
4693
  webGlBasics: Li,
4694
4694
  webGlExtensions: Ai
@@ -4739,7 +4739,7 @@ function Ui(e) {
4739
4739
  },
4740
4740
  confidence: Vi(e),
4741
4741
  components: e,
4742
- version: Rr
4742
+ version: jr
4743
4743
  };
4744
4744
  }
4745
4745
  function Bi(e) {
@@ -4748,9 +4748,9 @@ function Bi(e) {
4748
4748
  function Gi(e, t) {
4749
4749
  var r = Date.now();
4750
4750
  return { get: function(n) {
4751
- return ne(this, void 0, void 0, function() {
4751
+ return ae(this, void 0, void 0, function() {
4752
4752
  var a, i, s;
4753
- return ae(this, function(l) {
4753
+ return ie(this, function(l) {
4754
4754
  switch (l.label) {
4755
4755
  case 0:
4756
4756
  return a = Date.now(), [4, e()];
@@ -4765,15 +4765,15 @@ function Hi() {
4765
4765
  if (!(window.__fpjs_d_m || Math.random() >= 1e-3))
4766
4766
  try {
4767
4767
  var e = new XMLHttpRequest();
4768
- e.open("get", "https://m1.openfpcdn.io/fingerprintjs/v".concat(Rr, "/npm-monitoring"), !0), e.send();
4768
+ e.open("get", "https://m1.openfpcdn.io/fingerprintjs/v".concat(jr, "/npm-monitoring"), !0), e.send();
4769
4769
  } catch {
4770
4770
  }
4771
4771
  }
4772
4772
  function Yi(e) {
4773
4773
  var t;
4774
- return e === void 0 && (e = {}), ne(this, void 0, void 0, function() {
4774
+ return e === void 0 && (e = {}), ae(this, void 0, void 0, function() {
4775
4775
  var r, n, a;
4776
- return ae(this, function(i) {
4776
+ return ie(this, function(i) {
4777
4777
  switch (i.label) {
4778
4778
  case 0:
4779
4779
  return (!((t = e.monitoring) !== null && t !== void 0) || t) && Hi(), r = e.delayFallback, n = e.debug, [4, Bi(r)];
@@ -5674,7 +5674,7 @@ function Eo(e, t, r, n) {
5674
5674
  function Mo(e) {
5675
5675
  e ? Ne.get(e)?.destroy() : (Ne.forEach((t) => t.destroy()), Ne.clear());
5676
5676
  }
5677
- function jo() {
5677
+ function Ro() {
5678
5678
  return Array.from(Ne.keys());
5679
5679
  }
5680
5680
  function gs(e) {
@@ -7464,6 +7464,64 @@ var ks = `
7464
7464
  opacity: 0.75;
7465
7465
  letter-spacing: -0.01em;
7466
7466
  }
7467
+
7468
+ /* ── Mobile: full-viewport panel ─────────────────────────────── */
7469
+ @media (max-width: 639px) {
7470
+ @keyframes ak-panel-in-mobile {
7471
+ from { opacity: 0; transform: translateY(32px); }
7472
+ to { opacity: 1; transform: translateY(0); }
7473
+ }
7474
+
7475
+ /* The shadow host (data-agentkit-widget) sits inside the outer fixed container.
7476
+ Give it its own fixed position so it fills the viewport independently,
7477
+ bypassing the outer container's bottom/right offsets. */
7478
+ :host([data-open]) {
7479
+ position: fixed;
7480
+ top: 0;
7481
+ left: 0;
7482
+ right: 0;
7483
+ bottom: 0;
7484
+ z-index: 2147483647;
7485
+ pointer-events: none;
7486
+ }
7487
+
7488
+ :host([data-open]) .ak-floating {
7489
+ width: 100%;
7490
+ height: 100%;
7491
+ align-items: stretch;
7492
+ gap: 0;
7493
+ }
7494
+
7495
+ :host([data-open]) .ak-shell-wrap {
7496
+ flex: 1;
7497
+ min-height: 0;
7498
+ width: 100%;
7499
+ align-items: stretch;
7500
+ }
7501
+
7502
+ :host([data-open]) .ak-shell--floating {
7503
+ width: 100%;
7504
+ flex: 1;
7505
+ height: auto;
7506
+ border-radius: 0;
7507
+ box-shadow: none;
7508
+ border-left: none;
7509
+ border-right: none;
7510
+ border-top: none;
7511
+ }
7512
+
7513
+ :host([data-open]) .ak-launcher {
7514
+ display: none;
7515
+ }
7516
+
7517
+ :host([data-open]) .ak-shell-enter {
7518
+ animation: ak-panel-in-mobile 0.22s ease-out;
7519
+ }
7520
+
7521
+ :host([data-open]) .ak-branding {
7522
+ display: none;
7523
+ }
7524
+ }
7467
7525
  `;
7468
7526
  function bs() {
7469
7527
  return /* @__PURE__ */ v("svg", {
@@ -7867,7 +7925,7 @@ function Me({ src: e, alt: t, overlayCount: r = 0, onClick: n }) {
7867
7925
  }
7868
7926
  function ur({ images: e, index: t, onClose: r, onIndexChange: n }) {
7869
7927
  const a = t !== null, i = a && t !== null ? Math.min(Math.max(0, t), e.length - 1) : 0, s = a ? e[i] : null;
7870
- return le(() => {
7928
+ return te(() => {
7871
7929
  if (!a) return;
7872
7930
  const l = (o) => {
7873
7931
  o.key === "Escape" ? (o.stopPropagation(), r()) : o.key === "ArrowLeft" && e.length > 1 ? (o.preventDefault(), n((i - 1 + e.length) % e.length)) : o.key === "ArrowRight" && e.length > 1 && (o.preventDefault(), n((i + 1) % e.length));
@@ -8306,7 +8364,7 @@ function As({ message: e, thinkingViewable: t = !1 }) {
8306
8364
  b ? "ak-message__bubble--md" : "",
8307
8365
  m ? "ak-message__bubble--has-image" : "",
8308
8366
  _ ? "ak-message__bubble--operator" : ""
8309
- ].filter(Boolean).join(" "), R = _ ? e.senderDisplay?.trim() || "Operator" : null, F = R ? R.charAt(0).toUpperCase() : "", U = /* @__PURE__ */ v(de, { children: [/* @__PURE__ */ v("div", {
8367
+ ].filter(Boolean).join(" "), j = _ ? e.senderDisplay?.trim() || "Operator" : null, F = j ? j.charAt(0).toUpperCase() : "", U = /* @__PURE__ */ v(de, { children: [/* @__PURE__ */ v("div", {
8310
8368
  className: L,
8311
8369
  children: [
8312
8370
  p && /* @__PURE__ */ d(dr, {
@@ -8379,7 +8437,7 @@ function As({ message: e, thinkingViewable: t = !1 }) {
8379
8437
  children: F
8380
8438
  }), /* @__PURE__ */ d("span", {
8381
8439
  className: "ak-message__operator-name",
8382
- children: R
8440
+ children: j
8383
8441
  })]
8384
8442
  }),
8385
8443
  V && U,
@@ -8439,9 +8497,9 @@ function Ms(e, t) {
8439
8497
  }
8440
8498
  return r;
8441
8499
  }
8442
- function js({ messages: e, isLoading: t, thinkingViewable: r, operatorFallbackLabel: n = "Operator" }) {
8443
- const a = oe(null), i = oe(null), s = oe(!0), l = kr(() => Ms(e, n), [e, n]);
8444
- return le(() => {
8500
+ function Rs({ messages: e, isLoading: t, thinkingViewable: r, operatorFallbackLabel: n = "Operator" }) {
8501
+ const a = le(null), i = le(null), s = le(!0), l = kr(() => Ms(e, n), [e, n]);
8502
+ return te(() => {
8445
8503
  if (!(a.current?.parentElement ?? a.current)) return;
8446
8504
  const o = (h) => {
8447
8505
  s.current = h.scrollHeight - h.scrollTop - h.clientHeight < 120;
@@ -8451,9 +8509,9 @@ function js({ messages: e, isLoading: t, thinkingViewable: r, operatorFallbackLa
8451
8509
  if (!c) return;
8452
8510
  const u = () => o(c);
8453
8511
  return c.addEventListener("scroll", u, { passive: !0 }), () => c.removeEventListener("scroll", u);
8454
- }, []), le(() => {
8512
+ }, []), te(() => {
8455
8513
  e[e.length - 1]?.role === "user" && (s.current = !0), s.current && i.current?.scrollIntoView({ behavior: "smooth" });
8456
- }, [e]), le(() => {
8514
+ }, [e]), te(() => {
8457
8515
  s.current && i.current?.scrollIntoView({ behavior: "smooth" });
8458
8516
  }, [
8459
8517
  t,
@@ -8482,7 +8540,7 @@ function js({ messages: e, isLoading: t, thinkingViewable: r, operatorFallbackLa
8482
8540
  ]
8483
8541
  });
8484
8542
  }
8485
- function Rs() {
8543
+ function js() {
8486
8544
  return /* @__PURE__ */ v("svg", {
8487
8545
  width: "30",
8488
8546
  height: "30",
@@ -8544,7 +8602,7 @@ function Zs({ title: e, description: t, greeting: r, avatarUrl: n }) {
8544
8602
  }) : /* @__PURE__ */ d("span", {
8545
8603
  className: "ak-empty-state__bot-icon",
8546
8604
  "aria-hidden": "true",
8547
- children: /* @__PURE__ */ d(Rs, {})
8605
+ children: /* @__PURE__ */ d(js, {})
8548
8606
  })
8549
8607
  }),
8550
8608
  /* @__PURE__ */ d("p", {
@@ -8689,10 +8747,10 @@ function zs(e) {
8689
8747
  return Qr.includes(e.type);
8690
8748
  }
8691
8749
  function Ds({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…", privacyPolicyUrl: n, termsOfServiceUrl: a, photoSendingEnabled: i = !1, fileUploadEnabled: s = !1, attachmentMaxCount: l = 5, attachmentMaxFileSizeMb: o = 1 }) {
8692
- const [c, u] = ce(""), [h, p] = ce([]), [g, m] = ce(/* @__PURE__ */ new Map()), [b, _] = ce(!1), x = oe(null), L = oe(null), R = oe(null), F = oe(null), U = oe(null), V = i || s, N = kr(() => o * 1024 * 1024, [o]);
8693
- le(() => () => {
8750
+ const [c, u] = ce(""), [h, p] = ce([]), [g, m] = ce(/* @__PURE__ */ new Map()), [b, _] = ce(!1), x = le(null), L = le(null), j = le(null), F = le(null), U = le(null), V = i || s, N = kr(() => o * 1024 * 1024, [o]);
8751
+ te(() => () => {
8694
8752
  g.forEach((A) => URL.revokeObjectURL(A));
8695
- }, []), le(() => {
8753
+ }, []), te(() => {
8696
8754
  t || x.current?.focus();
8697
8755
  }, [t]);
8698
8756
  const I = sn((A) => {
@@ -8700,14 +8758,14 @@ function Ds({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
8700
8758
  const O = A.composedPath ? A.composedPath() : [], J = !!F.current && O.includes(F.current), W = !!U.current && O.includes(U.current);
8701
8759
  !J && !W && _(!1);
8702
8760
  }, [b]);
8703
- le(() => {
8761
+ te(() => {
8704
8762
  if (b)
8705
8763
  return document.addEventListener("click", I), () => document.removeEventListener("click", I);
8706
- }, [b, I]), le(() => {
8764
+ }, [b, I]), te(() => {
8707
8765
  V || _(!1);
8708
8766
  }, [V]);
8709
8767
  function fe() {
8710
- g.forEach((A) => URL.revokeObjectURL(A)), m(/* @__PURE__ */ new Map()), p([]), L.current && (L.current.value = ""), R.current && (R.current.value = "");
8768
+ g.forEach((A) => URL.revokeObjectURL(A)), m(/* @__PURE__ */ new Map()), p([]), L.current && (L.current.value = ""), j.current && (j.current.value = "");
8711
8769
  }
8712
8770
  function Ae(A) {
8713
8771
  p((O) => {
@@ -8777,7 +8835,7 @@ function Ds({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
8777
8835
  _(!1), L.current?.click();
8778
8836
  }
8779
8837
  function tn() {
8780
- _(!1), R.current?.click();
8838
+ _(!1), j.current?.click();
8781
8839
  }
8782
8840
  const rn = !t && (!!c.trim() || h.length > 0);
8783
8841
  return /* @__PURE__ */ v("div", {
@@ -8864,7 +8922,7 @@ function Ds({ onSend: e, disabled: t = !1, placeholder: r = "Type a message…",
8864
8922
  "aria-label": "Attach images"
8865
8923
  }),
8866
8924
  s && /* @__PURE__ */ d("input", {
8867
- ref: R,
8925
+ ref: j,
8868
8926
  type: "file",
8869
8927
  multiple: !0,
8870
8928
  accept: Vs,
@@ -9061,7 +9119,7 @@ function gr({ config: e, messages: t, isLoading: r, error: n, isInline: a, initS
9061
9119
  avatarUrl: e.avatarUrl,
9062
9120
  onClose: l.onClose,
9063
9121
  onReset: i === "ready" ? l.onReset : void 0,
9064
- hideClose: !0
9122
+ hideClose: a
9065
9123
  }),
9066
9124
  i === "validating" && /* @__PURE__ */ d("div", {
9067
9125
  className: "ak-init-status",
@@ -9084,7 +9142,7 @@ function gr({ config: e, messages: t, isLoading: r, error: n, isInline: a, initS
9084
9142
  description: e.description ?? e.subtitle,
9085
9143
  greeting: e.greeting,
9086
9144
  avatarUrl: e.avatarUrl
9087
- }) : /* @__PURE__ */ d(js, {
9145
+ }) : /* @__PURE__ */ d(Rs, {
9088
9146
  messages: t,
9089
9147
  isLoading: r,
9090
9148
  thinkingViewable: e.thinkingViewable
@@ -9149,13 +9207,17 @@ function Js({ isOpen: e, onClick: t, avatarUrl: r, ariaLabel: n = "Toggle chat"
9149
9207
  });
9150
9208
  }
9151
9209
  function vr({ config: e, state: t, callbacks: r }) {
9152
- const n = e.mode === "inline", a = oe(null);
9153
- return le(() => {
9210
+ const n = e.mode === "inline", a = le(null);
9211
+ return te(() => {
9154
9212
  const i = a.current?.getRootNode()?.host;
9155
9213
  if (!i) return;
9156
9214
  const s = vs(e.theme.mode);
9157
9215
  i.setAttribute("data-theme", s);
9158
- }, [e.theme.mode]), n ? /* @__PURE__ */ d("div", {
9216
+ }, [e.theme.mode]), te(() => {
9217
+ if (n) return;
9218
+ const i = a.current?.getRootNode()?.host;
9219
+ i && (t.isOpen ? i.setAttribute("data-open", "") : i.removeAttribute("data-open"));
9220
+ }, [n, t.isOpen]), n ? /* @__PURE__ */ d("div", {
9159
9221
  ref: a,
9160
9222
  className: "ak-inline",
9161
9223
  children: /* @__PURE__ */ d(gr, {
@@ -9187,7 +9249,7 @@ function vr({ config: e, state: t, callbacks: r }) {
9187
9249
  })]
9188
9250
  });
9189
9251
  }
9190
- var Ro = (e, t, r, n) => {
9252
+ var jo = (e, t, r, n) => {
9191
9253
  const a = an(e);
9192
9254
  return a.render(Bt(vr, {
9193
9255
  config: t,
@@ -9220,7 +9282,7 @@ export {
9220
9282
  xs as Header,
9221
9283
  Js as Launcher,
9222
9284
  As as MessageBubble,
9223
- js as MessageList,
9285
+ Rs as MessageList,
9224
9286
  Es as TypingIndicator,
9225
9287
  vr as WidgetApp,
9226
9288
  as as WidgetClient,
@@ -9235,12 +9297,12 @@ export {
9235
9297
  ns as getSessionId,
9236
9298
  Ao as init,
9237
9299
  ls as injectStyles,
9238
- jo as listWidgets,
9300
+ Ro as listWidgets,
9239
9301
  Eo as mount,
9240
9302
  Vt as normalizeConfig,
9241
9303
  hs as prepareInlineContainer,
9242
9304
  cs as removeShadowHost,
9243
- Ro as renderWidget,
9305
+ jo as renderWidget,
9244
9306
  vs as resolveThemeMode,
9245
9307
  He as setSessionId,
9246
9308
  qi as streamChat,