@iai-lib/any-chat-widget 0.1.0-alpha.34 → 0.1.0-alpha.35
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/any-chat-widget.es.js +68 -63
- package/dist/any-chat-widget.umd.js +14 -14
- package/package.json +3 -3
|
@@ -14,7 +14,7 @@ var vr = Object.defineProperty, br = (s, e, t) => e in s ? vr(s, e, { enumerable
|
|
|
14
14
|
if (e.has(s))
|
|
15
15
|
throw TypeError("Cannot add the same private member more than once");
|
|
16
16
|
e instanceof WeakSet ? e.add(s) : e.set(s, t);
|
|
17
|
-
},
|
|
17
|
+
}, _s = (s, e, t) => (wr(s, e, "access private method"), t);
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2019 Google LLC
|
|
@@ -49,7 +49,7 @@ const xr = (s) => new Ai(typeof s == "string" ? s : s + "", void 0, Ms), St = (s
|
|
|
49
49
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
50
50
|
})(i) + s[r + 1], s[0]);
|
|
51
51
|
return new Ai(t, s, Ms);
|
|
52
|
-
},
|
|
52
|
+
}, _r = (s, e) => {
|
|
53
53
|
if (Is)
|
|
54
54
|
s.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
55
55
|
else
|
|
@@ -68,7 +68,7 @@ const xr = (s) => new Ai(typeof s == "string" ? s : s + "", void 0, Ms), St = (s
|
|
|
68
68
|
* Copyright 2017 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
70
|
*/
|
|
71
|
-
const { is:
|
|
71
|
+
const { is: kr, defineProperty: $r, getOwnPropertyDescriptor: Tr, getOwnPropertyNames: Sr, getOwnPropertySymbols: Er, getPrototypeOf: Cr } = Object, zt = globalThis, ei = zt.trustedTypes, Ar = ei ? ei.emptyScript : "", ti = zt.reactiveElementPolyfillSupport, qt = (s, e) => s, Pn = { toAttribute(s, e) {
|
|
72
72
|
switch (e) {
|
|
73
73
|
case Boolean:
|
|
74
74
|
s = s ? Ar : null;
|
|
@@ -96,7 +96,7 @@ const { is: _r, defineProperty: $r, getOwnPropertyDescriptor: Tr, getOwnProperty
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
return t;
|
|
99
|
-
} }, Rs = (s, e) => !
|
|
99
|
+
} }, Rs = (s, e) => !kr(s, e), ni = { attribute: !0, type: String, converter: Pn, reflect: !1, hasChanged: Rs };
|
|
100
100
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), zt.litPropertyMetadata ?? (zt.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
101
101
|
class Pt extends HTMLElement {
|
|
102
102
|
static addInitializer(e) {
|
|
@@ -192,7 +192,7 @@ class Pt extends HTMLElement {
|
|
|
192
192
|
}
|
|
193
193
|
createRenderRoot() {
|
|
194
194
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
195
|
-
return
|
|
195
|
+
return _r(e, this.constructor.elementStyles), e;
|
|
196
196
|
}
|
|
197
197
|
connectedCallback() {
|
|
198
198
|
var e;
|
|
@@ -1177,14 +1177,14 @@ var W;
|
|
|
1177
1177
|
}
|
|
1178
1178
|
s.joinValues = n, s.jsonStringifyReplacer = (i, r) => typeof r == "bigint" ? r.toString() : r;
|
|
1179
1179
|
})(W || (W = {}));
|
|
1180
|
-
var
|
|
1180
|
+
var ks;
|
|
1181
1181
|
(function(s) {
|
|
1182
1182
|
s.mergeShapes = (e, t) => ({
|
|
1183
1183
|
...e,
|
|
1184
1184
|
...t
|
|
1185
1185
|
// second overwrites first
|
|
1186
1186
|
});
|
|
1187
|
-
})(
|
|
1187
|
+
})(ks || (ks = {}));
|
|
1188
1188
|
const v = W.arrayToEnum([
|
|
1189
1189
|
"string",
|
|
1190
1190
|
"nan",
|
|
@@ -1584,7 +1584,7 @@ class Z {
|
|
|
1584
1584
|
return Fe.create(this, this._def);
|
|
1585
1585
|
}
|
|
1586
1586
|
nullable() {
|
|
1587
|
-
return
|
|
1587
|
+
return _t.create(this, this._def);
|
|
1588
1588
|
}
|
|
1589
1589
|
nullish() {
|
|
1590
1590
|
return this.nullable().optional();
|
|
@@ -2555,7 +2555,7 @@ function Nt(s) {
|
|
|
2555
2555
|
return s instanceof Se ? new Se({
|
|
2556
2556
|
...s._def,
|
|
2557
2557
|
type: Nt(s.element)
|
|
2558
|
-
}) : s instanceof Fe ? Fe.create(Nt(s.unwrap())) : s instanceof
|
|
2558
|
+
}) : s instanceof Fe ? Fe.create(Nt(s.unwrap())) : s instanceof _t ? _t.create(Nt(s.unwrap())) : s instanceof je ? je.create(s.items.map((e) => Nt(e))) : s;
|
|
2559
2559
|
}
|
|
2560
2560
|
class te extends Z {
|
|
2561
2561
|
constructor() {
|
|
@@ -3587,7 +3587,7 @@ Fe.create = (s, e) => new Fe({
|
|
|
3587
3587
|
typeName: O.ZodOptional,
|
|
3588
3588
|
...D(e)
|
|
3589
3589
|
});
|
|
3590
|
-
class
|
|
3590
|
+
class _t extends Z {
|
|
3591
3591
|
_parse(e) {
|
|
3592
3592
|
return this._getType(e) === v.null ? ge(null) : this._def.innerType._parse(e);
|
|
3593
3593
|
}
|
|
@@ -3595,7 +3595,7 @@ class kt extends Z {
|
|
|
3595
3595
|
return this._def.innerType;
|
|
3596
3596
|
}
|
|
3597
3597
|
}
|
|
3598
|
-
|
|
3598
|
+
_t.create = (s, e) => new _t({
|
|
3599
3599
|
innerType: s,
|
|
3600
3600
|
typeName: O.ZodNullable,
|
|
3601
3601
|
...D(e)
|
|
@@ -3760,7 +3760,7 @@ var O;
|
|
|
3760
3760
|
})(O || (O = {}));
|
|
3761
3761
|
const fa = (s, e = {
|
|
3762
3762
|
message: `Input not instance of ${s.name}`
|
|
3763
|
-
}) => Ji((t) => t instanceof s, e), Qi = $e.create, Yi = nt.create, ma = Vn.create, ga = st.create, Gi = on.create, ya = wt.create, va = Hn.create, ba = ln.create, wa = cn.create, xa = Zt.create,
|
|
3763
|
+
}) => Ji((t) => t instanceof s, e), Qi = $e.create, Yi = nt.create, ma = Vn.create, ga = st.create, Gi = on.create, ya = wt.create, va = Hn.create, ba = ln.create, wa = cn.create, xa = Zt.create, _a = yt.create, ka = Ve.create, $a = Bn.create, Ta = Se.create, Sa = te.create, Ea = te.strictCreate, Ca = dn.create, Aa = rs.create, Oa = un.create, Ia = je.create, Ma = hn.create, Ra = Wn.create, Pa = xt.create, Na = jt.create, ja = pn.create, za = fn.create, Da = it.create, Za = mn.create, La = Lt.create, bi = Ee.create, Ua = Fe.create, Ha = _t.create, Ba = Ee.createWithPreprocess, Wa = xn.create, Fa = () => Qi().optional(), Va = () => Yi().optional(), Ka = () => Gi().optional(), qa = {
|
|
3764
3764
|
string: (s) => $e.create({ ...s, coerce: !0 }),
|
|
3765
3765
|
number: (s) => nt.create({ ...s, coerce: !0 }),
|
|
3766
3766
|
boolean: (s) => on.create({
|
|
@@ -3790,7 +3790,7 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
3790
3790
|
return W;
|
|
3791
3791
|
},
|
|
3792
3792
|
get objectUtil() {
|
|
3793
|
-
return
|
|
3793
|
+
return ks;
|
|
3794
3794
|
},
|
|
3795
3795
|
ZodParsedType: v,
|
|
3796
3796
|
getParsedType: tt,
|
|
@@ -3825,7 +3825,7 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
3825
3825
|
ZodEffects: Ee,
|
|
3826
3826
|
ZodTransformer: Ee,
|
|
3827
3827
|
ZodOptional: Fe,
|
|
3828
|
-
ZodNullable:
|
|
3828
|
+
ZodNullable: _t,
|
|
3829
3829
|
ZodDefault: gn,
|
|
3830
3830
|
ZodCatch: Fn,
|
|
3831
3831
|
ZodNaN: Vn,
|
|
@@ -3857,7 +3857,7 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
3857
3857
|
map: Ra,
|
|
3858
3858
|
nan: ma,
|
|
3859
3859
|
nativeEnum: Za,
|
|
3860
|
-
never:
|
|
3860
|
+
never: ka,
|
|
3861
3861
|
null: wa,
|
|
3862
3862
|
nullable: Ha,
|
|
3863
3863
|
number: Yi,
|
|
@@ -3878,7 +3878,7 @@ var _ = /* @__PURE__ */ Object.freeze({
|
|
|
3878
3878
|
tuple: Ia,
|
|
3879
3879
|
undefined: ba,
|
|
3880
3880
|
union: Ca,
|
|
3881
|
-
unknown:
|
|
3881
|
+
unknown: _a,
|
|
3882
3882
|
void: $a,
|
|
3883
3883
|
NEVER: Ja,
|
|
3884
3884
|
ZodIssueCode: f,
|
|
@@ -3893,6 +3893,7 @@ const as = _.object({
|
|
|
3893
3893
|
welcomeMessage: _.string().default("Hello! How can I help you today?"),
|
|
3894
3894
|
inactivityWarningMessage: _.string().default("Are you still there? The chat will end soon if we don't hear from you."),
|
|
3895
3895
|
chatEndedMessage: _.string().default("The chat has ended. Please restart the chat to continue."),
|
|
3896
|
+
resetEndedChatOnLoad: _.boolean().default(!1),
|
|
3896
3897
|
initialReplyMessage: _.string().nullable().default(null),
|
|
3897
3898
|
disclaimerMessage: _.string().nullable().default(null),
|
|
3898
3899
|
disclaimerPopover: _.object({
|
|
@@ -3953,12 +3954,12 @@ const as = _.object({
|
|
|
3953
3954
|
).default({})
|
|
3954
3955
|
}).default({})
|
|
3955
3956
|
});
|
|
3956
|
-
var Qa = Object.defineProperty, Ya = Object.getOwnPropertyDescriptor,
|
|
3957
|
+
var Qa = Object.defineProperty, Ya = Object.getOwnPropertyDescriptor, _n = (s, e, t, n) => {
|
|
3957
3958
|
for (var i = n > 1 ? void 0 : n ? Ya(e, t) : e, r = s.length - 1, a; r >= 0; r--)
|
|
3958
3959
|
(a = s[r]) && (i = (n ? a(e, t, i) : a(i)) || i);
|
|
3959
3960
|
return n && i && Qa(e, t, i), i;
|
|
3960
3961
|
};
|
|
3961
|
-
let
|
|
3962
|
+
let kt = class extends be {
|
|
3962
3963
|
constructor() {
|
|
3963
3964
|
super(...arguments), this.isOpen = !1, this.onResizeHandler = () => {
|
|
3964
3965
|
this.isOpen && window.innerWidth < 768 ? Jr(this) : gi(this);
|
|
@@ -4028,22 +4029,22 @@ let _t = class extends be {
|
|
|
4028
4029
|
this.isOpen = !this.isOpen, this.onResizeHandler();
|
|
4029
4030
|
}
|
|
4030
4031
|
};
|
|
4031
|
-
|
|
4032
|
-
|
|
4032
|
+
kt.styles = [qe];
|
|
4033
|
+
_n([
|
|
4033
4034
|
ne({ type: Object })
|
|
4034
|
-
],
|
|
4035
|
-
|
|
4035
|
+
], kt.prototype, "options", 2);
|
|
4036
|
+
_n([
|
|
4036
4037
|
Et()
|
|
4037
|
-
],
|
|
4038
|
-
|
|
4038
|
+
], kt.prototype, "isOpen", 2);
|
|
4039
|
+
_n([
|
|
4039
4040
|
es("iai-chat")
|
|
4040
|
-
],
|
|
4041
|
-
|
|
4041
|
+
], kt.prototype, "chatWindow", 2);
|
|
4042
|
+
_n([
|
|
4042
4043
|
Ds.debounce(250)
|
|
4043
|
-
],
|
|
4044
|
-
|
|
4044
|
+
], kt.prototype, "onResizeHandler", 2);
|
|
4045
|
+
kt = _n([
|
|
4045
4046
|
Ke("iai-chat-popup")
|
|
4046
|
-
],
|
|
4047
|
+
], kt);
|
|
4047
4048
|
const os = "https://api-dev.ai.inhabit.work";
|
|
4048
4049
|
async function Ga(s, e = {}) {
|
|
4049
4050
|
return (await fetch(`${os}/threads`, {
|
|
@@ -4129,6 +4130,7 @@ class so {
|
|
|
4129
4130
|
}, this._assistantId = e, this.options = {
|
|
4130
4131
|
params: {},
|
|
4131
4132
|
simulateDelays: !1,
|
|
4133
|
+
resetEndedChatOnLoad: !1,
|
|
4132
4134
|
historyKey: "main",
|
|
4133
4135
|
...t
|
|
4134
4136
|
}, this._emitter = no(), this.on = this._emitter.on.bind(this._emitter), this.off = this._emitter.off.bind(this._emitter), t.events && Object.entries(t.events).forEach(([n, i]) => {
|
|
@@ -4146,7 +4148,9 @@ class so {
|
|
|
4146
4148
|
const o = this.storageGet("inputDisabled");
|
|
4147
4149
|
o && this.setInputDisabled(o, !0);
|
|
4148
4150
|
const l = this.storageGet("lastActivity");
|
|
4149
|
-
l && setTimeout(() => this.keepAlive(l, !0), 0),
|
|
4151
|
+
l && setTimeout(() => this.keepAlive(l, !0), 0), setTimeout(() => {
|
|
4152
|
+
this.chatEnded && this.options.resetEndedChatOnLoad && this.reset();
|
|
4153
|
+
}, 0), window.addEventListener("storage", this.onStorageEvent);
|
|
4150
4154
|
}
|
|
4151
4155
|
}
|
|
4152
4156
|
onMessageHistoryStorageEvent(e) {
|
|
@@ -4762,7 +4766,7 @@ function Q(s, e) {
|
|
|
4762
4766
|
};
|
|
4763
4767
|
return n;
|
|
4764
4768
|
}
|
|
4765
|
-
function
|
|
4769
|
+
function _i(s) {
|
|
4766
4770
|
try {
|
|
4767
4771
|
s = encodeURI(s).replace(/%25/g, "%");
|
|
4768
4772
|
} catch {
|
|
@@ -4771,7 +4775,7 @@ function ki(s) {
|
|
|
4771
4775
|
return s;
|
|
4772
4776
|
}
|
|
4773
4777
|
const Yt = { exec: () => null };
|
|
4774
|
-
function
|
|
4778
|
+
function ki(s, e) {
|
|
4775
4779
|
const t = s.replace(/\|/g, (r, a, o) => {
|
|
4776
4780
|
let l = !1, d = a;
|
|
4777
4781
|
for (; --d >= 0 && o[d] === "\\"; )
|
|
@@ -5034,7 +5038,7 @@ class qn {
|
|
|
5034
5038
|
const t = this.rules.block.table.exec(e);
|
|
5035
5039
|
if (!t || !/[:|]/.test(t[2]))
|
|
5036
5040
|
return;
|
|
5037
|
-
const n =
|
|
5041
|
+
const n = ki(t[1]), i = t[2].replace(/^\||\| *$/g, "").split("|"), r = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
|
|
5038
5042
|
`) : [], a = {
|
|
5039
5043
|
type: "table",
|
|
5040
5044
|
raw: t[0],
|
|
@@ -5051,7 +5055,7 @@ class qn {
|
|
|
5051
5055
|
tokens: this.lexer.inline(o)
|
|
5052
5056
|
});
|
|
5053
5057
|
for (const o of r)
|
|
5054
|
-
a.rows.push(
|
|
5058
|
+
a.rows.push(ki(o, a.header.length).map((l) => ({
|
|
5055
5059
|
text: l,
|
|
5056
5060
|
tokens: this.lexer.inline(l)
|
|
5057
5061
|
})));
|
|
@@ -5286,24 +5290,24 @@ class qn {
|
|
|
5286
5290
|
}
|
|
5287
5291
|
}
|
|
5288
5292
|
}
|
|
5289
|
-
const bo = /^(?: *(?:\n|$))+/, wo = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, xo = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
5293
|
+
const bo = /^(?: *(?:\n|$))+/, wo = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, xo = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, kn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _o = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sr = /(?:[*+-]|\d{1,9}[.)])/, ir = Q(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, sr).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), Ls = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ko = /^[^\n]+/, Us = /(?!\s*\])(?:\\.|[^\[\]\\])+/, $o = Q(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", Us).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), To = Q(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, sr).getRegex(), ls = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Hs = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, So = Q("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", Hs).replace("tag", ls).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), rr = Q(Ls).replace("hr", kn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ls).getRegex(), Eo = Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", rr).getRegex(), Bs = {
|
|
5290
5294
|
blockquote: Eo,
|
|
5291
5295
|
code: wo,
|
|
5292
5296
|
def: $o,
|
|
5293
5297
|
fences: xo,
|
|
5294
|
-
heading:
|
|
5295
|
-
hr:
|
|
5298
|
+
heading: _o,
|
|
5299
|
+
hr: kn,
|
|
5296
5300
|
html: So,
|
|
5297
5301
|
lheading: ir,
|
|
5298
5302
|
list: To,
|
|
5299
5303
|
newline: bo,
|
|
5300
5304
|
paragraph: rr,
|
|
5301
5305
|
table: Yt,
|
|
5302
|
-
text:
|
|
5303
|
-
}, Ti = Q("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",
|
|
5306
|
+
text: ko
|
|
5307
|
+
}, Ti = Q("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", kn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ls).getRegex(), Co = {
|
|
5304
5308
|
...Bs,
|
|
5305
5309
|
table: Ti,
|
|
5306
|
-
paragraph: Q(Ls).replace("hr",
|
|
5310
|
+
paragraph: Q(Ls).replace("hr", kn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Ti).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", ls).getRegex()
|
|
5307
5311
|
}, Ao = {
|
|
5308
5312
|
...Bs,
|
|
5309
5313
|
html: Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Hs).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
@@ -5312,7 +5316,7 @@ const bo = /^(?: *(?:\n|$))+/, wo = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, xo =
|
|
|
5312
5316
|
fences: Yt,
|
|
5313
5317
|
// fences not supported
|
|
5314
5318
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
5315
|
-
paragraph: Q(Ls).replace("hr",
|
|
5319
|
+
paragraph: Q(Ls).replace("hr", kn).replace("heading", ` *#{1,6} *[^
|
|
5316
5320
|
]`).replace("lheading", ir).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
5317
5321
|
}, ar = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Oo = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, or = /^( {2,}|\\)\n(?!\s*$)/, Io = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, $n = "\\p{P}\\p{S}", Mo = Q(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, $n).getRegex(), Ro = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, Po = Q(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, $n).getRegex(), No = Q("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, $n).getRegex(), jo = Q("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, $n).getRegex(), zo = Q(/\\([punct])/, "gu").replace(/punct/g, $n).getRegex(), Do = Q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Zo = Q(Hs).replace("(?:-->|$)", "-->").getRegex(), Lo = Q("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Zo).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Jn = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Uo = Q(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", Jn).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), lr = Q(/^!?\[(label)\]\[(ref)\]/).replace("label", Jn).replace("ref", Us).getRegex(), cr = Q(/^!?\[(ref)\](?:\[\])?/).replace("ref", Us).getRegex(), Ho = Q("reflink|nolink(?!\\()", "g").replace("reflink", lr).replace("nolink", cr).getRegex(), Ws = {
|
|
5318
5322
|
_backpedal: Yt,
|
|
@@ -5659,7 +5663,7 @@ ${e}</tr>
|
|
|
5659
5663
|
return `<del>${e}</del>`;
|
|
5660
5664
|
}
|
|
5661
5665
|
link(e, t, n) {
|
|
5662
|
-
const i =
|
|
5666
|
+
const i = _i(e);
|
|
5663
5667
|
if (i === null)
|
|
5664
5668
|
return n;
|
|
5665
5669
|
e = i;
|
|
@@ -5667,7 +5671,7 @@ ${e}</tr>
|
|
|
5667
5671
|
return t && (r += ' title="' + t + '"'), r += ">" + n + "</a>", r;
|
|
5668
5672
|
}
|
|
5669
5673
|
image(e, t, n) {
|
|
5670
|
-
const i =
|
|
5674
|
+
const i = _i(e);
|
|
5671
5675
|
if (i === null)
|
|
5672
5676
|
return n;
|
|
5673
5677
|
e = i;
|
|
@@ -5930,7 +5934,7 @@ X(Gt, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
|
5930
5934
|
var Mn, As, Os, Si;
|
|
5931
5935
|
class dr {
|
|
5932
5936
|
constructor(...e) {
|
|
5933
|
-
Ys(this, Mn), Ys(this, Os), X(this, "defaults", Zs()), X(this, "options", this.setOptions), X(this, "parse",
|
|
5937
|
+
Ys(this, Mn), Ys(this, Os), X(this, "defaults", Zs()), X(this, "options", this.setOptions), X(this, "parse", _s(this, Mn, As).call(this, Me.lex, Re.parse)), X(this, "parseInline", _s(this, Mn, As).call(this, Me.lexInline, Re.parseInline)), X(this, "Parser", Re), X(this, "Renderer", vn), X(this, "TextRenderer", Fs), X(this, "Lexer", Me), X(this, "Tokenizer", qn), X(this, "Hooks", Gt), this.use(...e);
|
|
5934
5938
|
}
|
|
5935
5939
|
/**
|
|
5936
5940
|
* Run callback for every token
|
|
@@ -6059,7 +6063,7 @@ Mn = /* @__PURE__ */ new WeakSet(), As = function(s, e) {
|
|
|
6059
6063
|
return (t, n) => {
|
|
6060
6064
|
const i = { ...n }, r = { ...this.defaults, ...i };
|
|
6061
6065
|
this.defaults.async === !0 && i.async === !1 && (r.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), r.async = !0);
|
|
6062
|
-
const a =
|
|
6066
|
+
const a = _s(this, Os, Si).call(this, !!r.silent, !!r.async);
|
|
6063
6067
|
if (typeof t > "u" || t === null)
|
|
6064
6068
|
return a(new Error("marked(): input parameter is undefined or null"));
|
|
6065
6069
|
if (typeof t != "string")
|
|
@@ -6181,7 +6185,8 @@ let ye = class extends be {
|
|
|
6181
6185
|
params: e,
|
|
6182
6186
|
simulateDelays: t.simulateDelays,
|
|
6183
6187
|
historyKey: t.historyKey,
|
|
6184
|
-
initialReplyMessage: t.initialReplyMessage
|
|
6188
|
+
initialReplyMessage: t.initialReplyMessage,
|
|
6189
|
+
resetEndedChatOnLoad: t.resetEndedChatOnLoad
|
|
6185
6190
|
})), this.updateMessages(Rt(this, et).messages), this.showTyping = Rt(this, et).isTyping, this.disableInput = Rt(this, et).inputDisabled, this.chatManager.on("functionCall", ({ id: n, name: i, params: r }) => {
|
|
6186
6191
|
const a = this.cleanOptions.handlers.functionCalls[i];
|
|
6187
6192
|
if (!a) {
|
|
@@ -6596,7 +6601,7 @@ var hr = { exports: {} };
|
|
|
6596
6601
|
q("Height"), q("Width"), P(k, V, "init");
|
|
6597
6602
|
}
|
|
6598
6603
|
function L() {
|
|
6599
|
-
var k =
|
|
6604
|
+
var k = ke.slice(l).split(":"), z = k[1] ? parseInt(k[1], 10) : 0, Y = c[k[0]] && c[k[0]].iframe, G = getComputedStyle(Y);
|
|
6600
6605
|
return {
|
|
6601
6606
|
iframe: Y,
|
|
6602
6607
|
id: k[0],
|
|
@@ -6649,14 +6654,14 @@ var hr = { exports: {} };
|
|
|
6649
6654
|
return !0;
|
|
6650
6655
|
}
|
|
6651
6656
|
function lt() {
|
|
6652
|
-
return o === ("" +
|
|
6657
|
+
return o === ("" + ke).slice(0, l) && ke.slice(l).split(":")[0] in c;
|
|
6653
6658
|
}
|
|
6654
6659
|
function Ze() {
|
|
6655
6660
|
var k = V.type in { true: 1, false: 1, undefined: 1 };
|
|
6656
6661
|
return k && j(M, "Ignoring init message from meta parent page"), k;
|
|
6657
6662
|
}
|
|
6658
6663
|
function Le(k) {
|
|
6659
|
-
return
|
|
6664
|
+
return ke.slice(ke.indexOf(":") + a + k);
|
|
6660
6665
|
}
|
|
6661
6666
|
function Ge(k) {
|
|
6662
6667
|
j(
|
|
@@ -6776,7 +6781,7 @@ var hr = { exports: {} };
|
|
|
6776
6781
|
var G = k.split("#")[1] || "", de = decodeURIComponent(G), me = document.getElementById(de) || document.getElementsByName(de)[0];
|
|
6777
6782
|
me ? z() : window.top === window.self ? j(M, "In page link #" + G + " not found") : Y();
|
|
6778
6783
|
}
|
|
6779
|
-
function
|
|
6784
|
+
function _e(k) {
|
|
6780
6785
|
var z = {};
|
|
6781
6786
|
if (Number(V.width) === 0 && Number(V.height) === 0) {
|
|
6782
6787
|
var Y = Le(9).split(":");
|
|
@@ -6810,11 +6815,11 @@ var hr = { exports: {} };
|
|
|
6810
6815
|
break;
|
|
6811
6816
|
}
|
|
6812
6817
|
case "mouseenter": {
|
|
6813
|
-
|
|
6818
|
+
_e("onMouseEnter");
|
|
6814
6819
|
break;
|
|
6815
6820
|
}
|
|
6816
6821
|
case "mouseleave": {
|
|
6817
|
-
|
|
6822
|
+
_e("onMouseLeave");
|
|
6818
6823
|
break;
|
|
6819
6824
|
}
|
|
6820
6825
|
case "autoResize": {
|
|
@@ -6861,7 +6866,7 @@ var hr = { exports: {} };
|
|
|
6861
6866
|
function ms(k) {
|
|
6862
6867
|
var z = !0;
|
|
6863
6868
|
return c[k] || (z = !1, fe(
|
|
6864
|
-
V.type + " No settings for " + k + ". Message was: " +
|
|
6869
|
+
V.type + " No settings for " + k + ". Message was: " + ke
|
|
6865
6870
|
)), z;
|
|
6866
6871
|
}
|
|
6867
6872
|
function gs() {
|
|
@@ -6876,8 +6881,8 @@ var hr = { exports: {} };
|
|
|
6876
6881
|
function ys() {
|
|
6877
6882
|
c[M] && (c[M].firstRun = !1);
|
|
6878
6883
|
}
|
|
6879
|
-
var
|
|
6880
|
-
|
|
6884
|
+
var ke = h.data, V = {}, M = null;
|
|
6885
|
+
ke === "[iFrameResizerChild]Ready" ? gs() : lt() ? (V = L(), M = V.id, c[M] && (c[M].loaded = !0), !Ze() && ms(M) && (j(M, "Received: " + ke), ps() && Ie() && fs())) : Wt(M, "Ignored: " + ke);
|
|
6881
6886
|
}
|
|
6882
6887
|
function H(h, x, L) {
|
|
6883
6888
|
var E = null, U = null;
|
|
@@ -6997,8 +7002,8 @@ var hr = { exports: {} };
|
|
|
6997
7002
|
function se(h, x) {
|
|
6998
7003
|
function L() {
|
|
6999
7004
|
function A(he) {
|
|
7000
|
-
var
|
|
7001
|
-
|
|
7005
|
+
var _e = c[C][he];
|
|
7006
|
+
_e !== 1 / 0 && _e !== 0 && (h.style[he] = ee(_e) ? _e + "px" : _e, j(C, "Set " + he + " = " + h.style[he]));
|
|
7002
7007
|
}
|
|
7003
7008
|
function le(he) {
|
|
7004
7009
|
if (c[C]["min" + he] > c[C]["max" + he])
|
|
@@ -7086,8 +7091,8 @@ var hr = { exports: {} };
|
|
|
7086
7091
|
var fs = new ct(function(ms) {
|
|
7087
7092
|
ms.forEach(function(gs) {
|
|
7088
7093
|
var ys = Array.prototype.slice.call(gs.removedNodes);
|
|
7089
|
-
ys.forEach(function(
|
|
7090
|
-
|
|
7094
|
+
ys.forEach(function(ke) {
|
|
7095
|
+
ke === h && It(h);
|
|
7091
7096
|
});
|
|
7092
7097
|
});
|
|
7093
7098
|
});
|
|
@@ -7096,8 +7101,8 @@ var hr = { exports: {} };
|
|
|
7096
7101
|
});
|
|
7097
7102
|
}
|
|
7098
7103
|
}
|
|
7099
|
-
var
|
|
7100
|
-
|
|
7104
|
+
var _e = F();
|
|
7105
|
+
_e && he(_e), ie(h, "load", le), S("init", A, h, e, !0);
|
|
7101
7106
|
}
|
|
7102
7107
|
function Ge(A) {
|
|
7103
7108
|
if (typeof A != "object")
|
|
@@ -8096,7 +8101,7 @@ function yr(s, e) {
|
|
|
8096
8101
|
};
|
|
8097
8102
|
s.cleanOptions.config.disclaimerMessage = "You are chatting with a live agent", s.addEventListener("iai-chat-send-user-message", t), s.addEventListener("iai-chat-reset", i), s.addEventListener("iai-chat-destroy", n);
|
|
8098
8103
|
}
|
|
8099
|
-
class
|
|
8104
|
+
class kl {
|
|
8100
8105
|
constructor(e, t) {
|
|
8101
8106
|
const n = as.parse({
|
|
8102
8107
|
assistantId: "7e59c8c1-a4ff-40f1-9a68-86ea294a4e75",
|
|
@@ -8120,5 +8125,5 @@ class _l {
|
|
|
8120
8125
|
}
|
|
8121
8126
|
}
|
|
8122
8127
|
export {
|
|
8123
|
-
|
|
8128
|
+
kl as AnyChatWidget
|
|
8124
8129
|
};
|