bariweb-widget 0.1.10 → 0.1.13
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/bariweb.iife.js +176 -116
- package/dist/bariweb.js +623 -445
- package/package.json +1 -1
package/dist/bariweb.js
CHANGED
|
@@ -744,34 +744,34 @@ var w = class extends HTMLElement {
|
|
|
744
744
|
w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[x("elementProperties")] = /* @__PURE__ */ new Map(), w[x("finalized")] = /* @__PURE__ */ new Map(), Ee?.({ ReactiveElement: w }), (b.reactiveElementVersions ??= []).push("2.1.2");
|
|
745
745
|
//#endregion
|
|
746
746
|
//#region node_modules/lit-html/lit-html.js
|
|
747
|
-
var T = globalThis, Oe = (e) => e, E = T.trustedTypes, ke = E ? E.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Ae = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, je = "?" + D, Me = `<${je}>`, O = document, k = () => O.createComment(""), A = (e) => e === null || typeof e != "object" && typeof e != "function", j = Array.isArray, Ne = (e) => j(e) || typeof e?.[Symbol.iterator] == "function", M = "[ \n\f\r]", N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Pe = /-->/g, Fe = />/g, P = RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), Ie = /'/g, Le = /"/g,
|
|
747
|
+
var T = globalThis, Oe = (e) => e, E = T.trustedTypes, ke = E ? E.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Ae = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, je = "?" + D, Me = `<${je}>`, O = document, k = () => O.createComment(""), A = (e) => e === null || typeof e != "object" && typeof e != "function", j = Array.isArray, Ne = (e) => j(e) || typeof e?.[Symbol.iterator] == "function", M = "[ \n\f\r]", N = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Pe = /-->/g, Fe = />/g, P = RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), Ie = /'/g, Le = /"/g, F = /^(?:script|style|textarea|title)$/i, I = ((e) => (t, ...n) => ({
|
|
748
748
|
_$litType$: e,
|
|
749
749
|
strings: t,
|
|
750
750
|
values: n
|
|
751
|
-
}))(1),
|
|
752
|
-
function
|
|
751
|
+
}))(1), L = Symbol.for("lit-noChange"), R = Symbol.for("lit-nothing"), Re = /* @__PURE__ */ new WeakMap(), z = O.createTreeWalker(O, 129);
|
|
752
|
+
function ze(e, t) {
|
|
753
753
|
if (!j(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
754
754
|
return ke === void 0 ? t : ke.createHTML(t);
|
|
755
755
|
}
|
|
756
|
-
var
|
|
756
|
+
var Be = (e, t) => {
|
|
757
757
|
let n = e.length - 1, r = [], i, a = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = N;
|
|
758
758
|
for (let t = 0; t < n; t++) {
|
|
759
759
|
let n = e[t], s, c, l = -1, u = 0;
|
|
760
|
-
for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === N ? c[1] === "!--" ? o = Pe : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = P) : (
|
|
760
|
+
for (; u < n.length && (o.lastIndex = u, c = o.exec(n), c !== null);) u = o.lastIndex, o === N ? c[1] === "!--" ? o = Pe : c[1] === void 0 ? c[2] === void 0 ? c[3] !== void 0 && (o = P) : (F.test(c[2]) && (i = RegExp("</" + c[2], "g")), o = P) : o = Fe : o === P ? c[0] === ">" ? (o = i ?? N, l = -1) : c[1] === void 0 ? l = -2 : (l = o.lastIndex - c[2].length, s = c[1], o = c[3] === void 0 ? P : c[3] === "\"" ? Le : Ie) : o === Le || o === Ie ? o = P : o === Pe || o === Fe ? o = N : (o = P, i = void 0);
|
|
761
761
|
let d = o === P && e[t + 1].startsWith("/>") ? " " : "";
|
|
762
762
|
a += o === N ? n + Me : l >= 0 ? (r.push(s), n.slice(0, l) + Ae + n.slice(l) + D + d) : n + D + (l === -2 ? t : d);
|
|
763
763
|
}
|
|
764
|
-
return [
|
|
765
|
-
},
|
|
764
|
+
return [ze(e, a + (e[n] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
765
|
+
}, B = class e {
|
|
766
766
|
constructor({ strings: t, _$litType$: n }, r) {
|
|
767
767
|
let i;
|
|
768
768
|
this.parts = [];
|
|
769
|
-
let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] =
|
|
770
|
-
if (this.el = e.createElement(l, r),
|
|
769
|
+
let a = 0, o = 0, s = t.length - 1, c = this.parts, [l, u] = Be(t, n);
|
|
770
|
+
if (this.el = e.createElement(l, r), z.currentNode = this.el.content, n === 2 || n === 3) {
|
|
771
771
|
let e = this.el.content.firstChild;
|
|
772
772
|
e.replaceWith(...e.childNodes);
|
|
773
773
|
}
|
|
774
|
-
for (; (i =
|
|
774
|
+
for (; (i = z.nextNode()) !== null && c.length < s;) {
|
|
775
775
|
if (i.nodeType === 1) {
|
|
776
776
|
if (i.hasAttributes()) for (let e of i.getAttributeNames()) if (e.endsWith(Ae)) {
|
|
777
777
|
let t = u[o++], n = i.getAttribute(e).split(D), r = /([.?@])?(.*)/.exec(t);
|
|
@@ -780,17 +780,17 @@ var Ve = (e, t) => {
|
|
|
780
780
|
index: a,
|
|
781
781
|
name: r[2],
|
|
782
782
|
strings: n,
|
|
783
|
-
ctor: r[1] === "." ?
|
|
783
|
+
ctor: r[1] === "." ? He : r[1] === "?" ? Ue : r[1] === "@" ? We : U
|
|
784
784
|
}), i.removeAttribute(e);
|
|
785
785
|
} else e.startsWith(D) && (c.push({
|
|
786
786
|
type: 6,
|
|
787
787
|
index: a
|
|
788
788
|
}), i.removeAttribute(e));
|
|
789
|
-
if (
|
|
789
|
+
if (F.test(i.tagName)) {
|
|
790
790
|
let e = i.textContent.split(D), t = e.length - 1;
|
|
791
791
|
if (t > 0) {
|
|
792
792
|
i.textContent = E ? E.emptyScript : "";
|
|
793
|
-
for (let n = 0; n < t; n++) i.append(e[n], k()),
|
|
793
|
+
for (let n = 0; n < t; n++) i.append(e[n], k()), z.nextNode(), c.push({
|
|
794
794
|
type: 2,
|
|
795
795
|
index: ++a
|
|
796
796
|
});
|
|
@@ -816,12 +816,12 @@ var Ve = (e, t) => {
|
|
|
816
816
|
return n.innerHTML = e, n;
|
|
817
817
|
}
|
|
818
818
|
};
|
|
819
|
-
function
|
|
820
|
-
if (t ===
|
|
819
|
+
function V(e, t, n = e, r) {
|
|
820
|
+
if (t === L) return t;
|
|
821
821
|
let i = r === void 0 ? n._$Cl : n._$Co?.[r], a = A(t) ? void 0 : t._$litDirective$;
|
|
822
|
-
return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t =
|
|
822
|
+
return i?.constructor !== a && (i?._$AO?.(!1), a === void 0 ? i = void 0 : (i = new a(e), i._$AT(e, n, r)), r === void 0 ? n._$Cl = i : (n._$Co ??= [])[r] = i), i !== void 0 && (t = V(e, i._$AS(e, t.values), i, r)), t;
|
|
823
823
|
}
|
|
824
|
-
var
|
|
824
|
+
var Ve = class {
|
|
825
825
|
constructor(e, t) {
|
|
826
826
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
827
827
|
}
|
|
@@ -833,27 +833,27 @@ var He = class {
|
|
|
833
833
|
}
|
|
834
834
|
u(e) {
|
|
835
835
|
let { el: { content: t }, parts: n } = this._$AD, r = (e?.creationScope ?? O).importNode(t, !0);
|
|
836
|
-
|
|
837
|
-
let i =
|
|
836
|
+
z.currentNode = r;
|
|
837
|
+
let i = z.nextNode(), a = 0, o = 0, s = n[0];
|
|
838
838
|
for (; s !== void 0;) {
|
|
839
839
|
if (a === s.index) {
|
|
840
840
|
let t;
|
|
841
|
-
s.type === 2 ? t = new
|
|
841
|
+
s.type === 2 ? t = new H(i, i.nextSibling, this, e) : s.type === 1 ? t = new s.ctor(i, s.name, s.strings, this, e) : s.type === 6 && (t = new Ge(i, this, e)), this._$AV.push(t), s = n[++o];
|
|
842
842
|
}
|
|
843
|
-
a !== s?.index && (i =
|
|
843
|
+
a !== s?.index && (i = z.nextNode(), a++);
|
|
844
844
|
}
|
|
845
|
-
return
|
|
845
|
+
return z.currentNode = O, r;
|
|
846
846
|
}
|
|
847
847
|
p(e) {
|
|
848
848
|
let t = 0;
|
|
849
849
|
for (let n of this._$AV) n !== void 0 && (n.strings === void 0 ? n._$AI(e[t]) : (n._$AI(e, n, t), t += n.strings.length - 2)), t++;
|
|
850
850
|
}
|
|
851
|
-
},
|
|
851
|
+
}, H = class e {
|
|
852
852
|
get _$AU() {
|
|
853
853
|
return this._$AM?._$AU ?? this._$Cv;
|
|
854
854
|
}
|
|
855
855
|
constructor(e, t, n, r) {
|
|
856
|
-
this.type = 2, this._$AH =
|
|
856
|
+
this.type = 2, this._$AH = R, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = n, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
857
857
|
}
|
|
858
858
|
get parentNode() {
|
|
859
859
|
let e = this._$AA.parentNode, t = this._$AM;
|
|
@@ -866,7 +866,7 @@ var He = class {
|
|
|
866
866
|
return this._$AB;
|
|
867
867
|
}
|
|
868
868
|
_$AI(e, t = this) {
|
|
869
|
-
e =
|
|
869
|
+
e = V(this, e, t), A(e) ? e === R || e == null || e === "" ? (this._$AH !== R && this._$AR(), this._$AH = R) : e !== this._$AH && e !== L && this._(e) : e._$litType$ === void 0 ? e.nodeType === void 0 ? Ne(e) ? this.k(e) : this._(e) : this.T(e) : this.$(e);
|
|
870
870
|
}
|
|
871
871
|
O(e) {
|
|
872
872
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -875,19 +875,19 @@ var He = class {
|
|
|
875
875
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
876
876
|
}
|
|
877
877
|
_(e) {
|
|
878
|
-
this._$AH !==
|
|
878
|
+
this._$AH !== R && A(this._$AH) ? this._$AA.nextSibling.data = e : this.T(O.createTextNode(e)), this._$AH = e;
|
|
879
879
|
}
|
|
880
880
|
$(e) {
|
|
881
|
-
let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el =
|
|
881
|
+
let { values: t, _$litType$: n } = e, r = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = B.createElement(ze(n.h, n.h[0]), this.options)), n);
|
|
882
882
|
if (this._$AH?._$AD === r) this._$AH.p(t);
|
|
883
883
|
else {
|
|
884
|
-
let e = new
|
|
884
|
+
let e = new Ve(r, this), n = e.u(this.options);
|
|
885
885
|
e.p(t), this.T(n), this._$AH = e;
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
_$AC(e) {
|
|
889
|
-
let t =
|
|
890
|
-
return t === void 0 &&
|
|
889
|
+
let t = Re.get(e.strings);
|
|
890
|
+
return t === void 0 && Re.set(e.strings, t = new B(e)), t;
|
|
891
891
|
}
|
|
892
892
|
k(t) {
|
|
893
893
|
j(this._$AH) || (this._$AH = [], this._$AR());
|
|
@@ -904,7 +904,7 @@ var He = class {
|
|
|
904
904
|
setConnected(e) {
|
|
905
905
|
this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e));
|
|
906
906
|
}
|
|
907
|
-
},
|
|
907
|
+
}, U = class {
|
|
908
908
|
get tagName() {
|
|
909
909
|
return this.element.tagName;
|
|
910
910
|
}
|
|
@@ -912,47 +912,47 @@ var He = class {
|
|
|
912
912
|
return this._$AM._$AU;
|
|
913
913
|
}
|
|
914
914
|
constructor(e, t, n, r, i) {
|
|
915
|
-
this.type = 1, this._$AH =
|
|
915
|
+
this.type = 1, this._$AH = R, this._$AN = void 0, this.element = e, this.name = t, this._$AM = r, this.options = i, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(/* @__PURE__ */ new String()), this.strings = n) : this._$AH = R;
|
|
916
916
|
}
|
|
917
917
|
_$AI(e, t = this, n, r) {
|
|
918
918
|
let i = this.strings, a = !1;
|
|
919
|
-
if (i === void 0) e =
|
|
919
|
+
if (i === void 0) e = V(this, e, t, 0), a = !A(e) || e !== this._$AH && e !== L, a && (this._$AH = e);
|
|
920
920
|
else {
|
|
921
921
|
let r = e, o, s;
|
|
922
|
-
for (e = i[0], o = 0; o < i.length - 1; o++) s =
|
|
922
|
+
for (e = i[0], o = 0; o < i.length - 1; o++) s = V(this, r[n + o], t, o), s === L && (s = this._$AH[o]), a ||= !A(s) || s !== this._$AH[o], s === R ? e = R : e !== R && (e += (s ?? "") + i[o + 1]), this._$AH[o] = s;
|
|
923
923
|
}
|
|
924
924
|
a && !r && this.j(e);
|
|
925
925
|
}
|
|
926
926
|
j(e) {
|
|
927
|
-
e ===
|
|
927
|
+
e === R ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
928
928
|
}
|
|
929
|
-
},
|
|
929
|
+
}, He = class extends U {
|
|
930
930
|
constructor() {
|
|
931
931
|
super(...arguments), this.type = 3;
|
|
932
932
|
}
|
|
933
933
|
j(e) {
|
|
934
|
-
this.element[this.name] = e ===
|
|
934
|
+
this.element[this.name] = e === R ? void 0 : e;
|
|
935
935
|
}
|
|
936
|
-
},
|
|
936
|
+
}, Ue = class extends U {
|
|
937
937
|
constructor() {
|
|
938
938
|
super(...arguments), this.type = 4;
|
|
939
939
|
}
|
|
940
940
|
j(e) {
|
|
941
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
941
|
+
this.element.toggleAttribute(this.name, !!e && e !== R);
|
|
942
942
|
}
|
|
943
|
-
},
|
|
943
|
+
}, We = class extends U {
|
|
944
944
|
constructor(e, t, n, r, i) {
|
|
945
945
|
super(e, t, n, r, i), this.type = 5;
|
|
946
946
|
}
|
|
947
947
|
_$AI(e, t = this) {
|
|
948
|
-
if ((e =
|
|
949
|
-
let n = this._$AH, r = e ===
|
|
948
|
+
if ((e = V(this, e, t, 0) ?? R) === L) return;
|
|
949
|
+
let n = this._$AH, r = e === R && n !== R || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive, i = e !== R && (n === R || r);
|
|
950
950
|
r && this.element.removeEventListener(this.name, this, n), i && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
951
951
|
}
|
|
952
952
|
handleEvent(e) {
|
|
953
953
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e);
|
|
954
954
|
}
|
|
955
|
-
},
|
|
955
|
+
}, Ge = class {
|
|
956
956
|
constructor(e, t, n) {
|
|
957
957
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = n;
|
|
958
958
|
}
|
|
@@ -960,18 +960,18 @@ var He = class {
|
|
|
960
960
|
return this._$AM._$AU;
|
|
961
961
|
}
|
|
962
962
|
_$AI(e) {
|
|
963
|
-
|
|
963
|
+
V(this, e);
|
|
964
964
|
}
|
|
965
|
-
},
|
|
966
|
-
|
|
967
|
-
var
|
|
965
|
+
}, Ke = T.litHtmlPolyfillSupport;
|
|
966
|
+
Ke?.(B, H), (T.litHtmlVersions ??= []).push("3.3.2");
|
|
967
|
+
var qe = (e, t, n) => {
|
|
968
968
|
let r = n?.renderBefore ?? t, i = r._$litPart$;
|
|
969
969
|
if (i === void 0) {
|
|
970
970
|
let e = n?.renderBefore ?? null;
|
|
971
|
-
r._$litPart$ = i = new
|
|
971
|
+
r._$litPart$ = i = new H(t.insertBefore(k(), e), e, void 0, n ?? {});
|
|
972
972
|
}
|
|
973
973
|
return i._$AI(e), i;
|
|
974
|
-
},
|
|
974
|
+
}, W = globalThis, G = class extends w {
|
|
975
975
|
constructor() {
|
|
976
976
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
977
977
|
}
|
|
@@ -981,7 +981,7 @@ var Je = (e, t, n) => {
|
|
|
981
981
|
}
|
|
982
982
|
update(e) {
|
|
983
983
|
let t = this.render();
|
|
984
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
984
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = qe(t, this.renderRoot, this.renderOptions);
|
|
985
985
|
}
|
|
986
986
|
connectedCallback() {
|
|
987
987
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -990,25 +990,25 @@ var Je = (e, t, n) => {
|
|
|
990
990
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
991
991
|
}
|
|
992
992
|
render() {
|
|
993
|
-
return
|
|
993
|
+
return L;
|
|
994
994
|
}
|
|
995
995
|
};
|
|
996
|
-
|
|
997
|
-
var
|
|
998
|
-
|
|
996
|
+
G._$litElement$ = !0, G.finalized = !0, W.litElementHydrateSupport?.({ LitElement: G });
|
|
997
|
+
var Je = W.litElementPolyfillSupport;
|
|
998
|
+
Je?.({ LitElement: G }), (W.litElementVersions ??= []).push("4.2.2");
|
|
999
999
|
//#endregion
|
|
1000
1000
|
//#region node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
1001
|
-
var
|
|
1001
|
+
var Ye = (e) => (t, n) => {
|
|
1002
1002
|
n === void 0 ? customElements.define(e, t) : n.addInitializer(() => {
|
|
1003
1003
|
customElements.define(e, t);
|
|
1004
1004
|
});
|
|
1005
|
-
},
|
|
1005
|
+
}, Xe = {
|
|
1006
1006
|
attribute: !0,
|
|
1007
1007
|
type: String,
|
|
1008
1008
|
converter: S,
|
|
1009
1009
|
reflect: !1,
|
|
1010
1010
|
hasChanged: C
|
|
1011
|
-
},
|
|
1011
|
+
}, Ze = (e = Xe, t, n) => {
|
|
1012
1012
|
let { kind: r, metadata: i } = n, a = globalThis.litPropertyMetadata.get(i);
|
|
1013
1013
|
if (a === void 0 && globalThis.litPropertyMetadata.set(i, a = /* @__PURE__ */ new Map()), r === "setter" && ((e = Object.create(e)).wrapped = !0), a.set(n.name, e), r === "accessor") {
|
|
1014
1014
|
let { name: r } = n;
|
|
@@ -1031,16 +1031,16 @@ var Xe = (e) => (t, n) => {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
throw Error("Unsupported decorator location: " + r);
|
|
1033
1033
|
};
|
|
1034
|
-
function
|
|
1035
|
-
return (t, n) => typeof n == "object" ?
|
|
1034
|
+
function Qe(e) {
|
|
1035
|
+
return (t, n) => typeof n == "object" ? Ze(e, t, n) : ((e, t, n) => {
|
|
1036
1036
|
let r = t.hasOwnProperty(n);
|
|
1037
1037
|
return t.constructor.createProperty(n, e), r ? Object.getOwnPropertyDescriptor(t, n) : void 0;
|
|
1038
1038
|
})(e, t, n);
|
|
1039
1039
|
}
|
|
1040
1040
|
//#endregion
|
|
1041
1041
|
//#region node_modules/@lit/reactive-element/decorators/state.js
|
|
1042
|
-
function
|
|
1043
|
-
return
|
|
1042
|
+
function K(e) {
|
|
1043
|
+
return Qe({
|
|
1044
1044
|
...e,
|
|
1045
1045
|
state: !0,
|
|
1046
1046
|
attribute: !1
|
|
@@ -1048,10 +1048,10 @@ function G(e) {
|
|
|
1048
1048
|
}
|
|
1049
1049
|
//#endregion
|
|
1050
1050
|
//#region node_modules/@lit/reactive-element/decorators/base.js
|
|
1051
|
-
var
|
|
1051
|
+
var $e = (e, t, n) => (n.configurable = !0, n.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, n), n);
|
|
1052
1052
|
//#endregion
|
|
1053
1053
|
//#region node_modules/@lit/reactive-element/decorators/query.js
|
|
1054
|
-
function
|
|
1054
|
+
function et(e, t) {
|
|
1055
1055
|
return (n, r, i) => {
|
|
1056
1056
|
let a = (t) => t.renderRoot?.querySelector(e) ?? null;
|
|
1057
1057
|
if (t) {
|
|
@@ -1066,29 +1066,29 @@ function tt(e, t) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
};
|
|
1068
1068
|
})();
|
|
1069
|
-
return
|
|
1069
|
+
return $e(n, r, { get() {
|
|
1070
1070
|
let n = e.call(this);
|
|
1071
1071
|
return n === void 0 && (n = a(this), (n !== null || this.hasUpdated) && t.call(this, n)), n;
|
|
1072
1072
|
} });
|
|
1073
1073
|
}
|
|
1074
|
-
return
|
|
1074
|
+
return $e(n, r, { get() {
|
|
1075
1075
|
return a(this);
|
|
1076
1076
|
} });
|
|
1077
1077
|
};
|
|
1078
1078
|
}
|
|
1079
1079
|
//#endregion
|
|
1080
1080
|
//#region node_modules/lit-html/directive.js
|
|
1081
|
-
var
|
|
1081
|
+
var tt = {
|
|
1082
1082
|
ATTRIBUTE: 1,
|
|
1083
1083
|
CHILD: 2,
|
|
1084
1084
|
PROPERTY: 3,
|
|
1085
1085
|
BOOLEAN_ATTRIBUTE: 4,
|
|
1086
1086
|
EVENT: 5,
|
|
1087
1087
|
ELEMENT: 6
|
|
1088
|
-
},
|
|
1088
|
+
}, nt = (e) => (...t) => ({
|
|
1089
1089
|
_$litDirective$: e,
|
|
1090
1090
|
values: t
|
|
1091
|
-
}),
|
|
1091
|
+
}), rt = class {
|
|
1092
1092
|
constructor(e) {}
|
|
1093
1093
|
get _$AU() {
|
|
1094
1094
|
return this._$AM._$AU;
|
|
@@ -1102,13 +1102,13 @@ var nt = {
|
|
|
1102
1102
|
update(e, t) {
|
|
1103
1103
|
return this.render(...t);
|
|
1104
1104
|
}
|
|
1105
|
-
},
|
|
1105
|
+
}, q = class extends rt {
|
|
1106
1106
|
constructor(e) {
|
|
1107
|
-
if (super(e), this.it =
|
|
1107
|
+
if (super(e), this.it = R, e.type !== tt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
1108
1108
|
}
|
|
1109
1109
|
render(e) {
|
|
1110
|
-
if (e ===
|
|
1111
|
-
if (e ===
|
|
1110
|
+
if (e === R || e == null) return this._t = void 0, this.it = e;
|
|
1111
|
+
if (e === L) return e;
|
|
1112
1112
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
1113
1113
|
if (e === this.it) return this._t;
|
|
1114
1114
|
this.it = e;
|
|
@@ -1120,8 +1120,8 @@ var nt = {
|
|
|
1120
1120
|
};
|
|
1121
1121
|
}
|
|
1122
1122
|
};
|
|
1123
|
-
|
|
1124
|
-
var
|
|
1123
|
+
q.directiveName = "unsafeHTML", q.resultType = 1;
|
|
1124
|
+
var it = nt(q), J = (e) => I`${it(`
|
|
1125
1125
|
<svg
|
|
1126
1126
|
viewBox="0 0 24 24"
|
|
1127
1127
|
fill="none"
|
|
@@ -1132,29 +1132,39 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1132
1132
|
>
|
|
1133
1133
|
${e}
|
|
1134
1134
|
</svg>
|
|
1135
|
-
`)}`,
|
|
1136
|
-
accessibility:
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1135
|
+
`)}`, Y = {
|
|
1136
|
+
accessibility: J("<circle cx=\"12\" cy=\"4.5\" r=\"2\"/><path d=\"M4 9.5h16\"/><path d=\"M12 6.5v6\"/><path d=\"M9.5 20.5 12 12.5l2.5 8\"/>"),
|
|
1137
|
+
chat: J("<path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\"/>"),
|
|
1138
|
+
settings: J("<path d=\"M10.325 4.317a1.724 1.724 0 0 1 3.35 0 1.724 1.724 0 0 0 2.573 1.066 1.724 1.724 0 0 1 2.305 2.305 1.724 1.724 0 0 0 1.066 2.573 1.724 1.724 0 0 1 0 3.35 1.724 1.724 0 0 0-1.066 2.573 1.724 1.724 0 0 1-2.305 2.305 1.724 1.724 0 0 0-2.573 1.066 1.724 1.724 0 0 1-3.35 0 1.724 1.724 0 0 0-2.573-1.066 1.724 1.724 0 0 1-2.305-2.305 1.724 1.724 0 0 0-1.066-2.573 1.724 1.724 0 0 1 0-3.35 1.724 1.724 0 0 0 1.066-2.573 1.724 1.724 0 0 1 2.305-2.305 1.724 1.724 0 0 0 2.573-1.066z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>"),
|
|
1139
|
+
mic: J("<path d=\"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z\"/><path d=\"M19 10v2a7 7 0 0 1-14 0v-2\"/><line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"23\"/><line x1=\"8\" y1=\"23\" x2=\"16\" y2=\"23\"/>"),
|
|
1140
|
+
volumeOn: J("<polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><path d=\"M15.54 8.46a5 5 0 0 1 0 7.07\"/><path d=\"M19.07 4.93a10 10 0 0 1 0 14.14\"/>"),
|
|
1141
|
+
volumeOff: J("<polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><line x1=\"23\" y1=\"9\" x2=\"17\" y2=\"15\"/><line x1=\"17\" y1=\"9\" x2=\"23\" y2=\"15\"/>"),
|
|
1142
|
+
shield: J("<path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"/>"),
|
|
1143
|
+
close: J("<path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/>"),
|
|
1144
|
+
languages: J("<path d=\"m5 8 6 6\"/><path d=\"m4 14 6-6 2-3\"/><path d=\"M2 5h12\"/><path d=\"M7 2h1\"/><path d=\"m22 22-5-10-5 10\"/><path d=\"M14 18h6\"/>"),
|
|
1145
|
+
profiles: J("<path d=\"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\"/><circle cx=\"12\" cy=\"7\" r=\"4\"/>"),
|
|
1146
|
+
textSize: J("<polyline points=\"4 7 4 4 20 4 20 7\"/><line x1=\"9\" y1=\"20\" x2=\"15\" y2=\"20\"/><line x1=\"12\" y1=\"4\" x2=\"12\" y2=\"20\"/>"),
|
|
1147
|
+
contrast: J("<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 18a6 6 0 0 0 0-12v12z\"/>"),
|
|
1148
|
+
grayscale: J("<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 2v20\"/><path d=\"M12 18a6 6 0 0 0 0-12\"/><path d=\"M12 14a2 2 0 0 0 0-4\"/>"),
|
|
1149
|
+
cursor: J("<path d=\"M4 3l7 17 2.2-6.2L20 11 4 3z\"/>"),
|
|
1150
|
+
screenReader: J("<polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\"/><path d=\"M15.54 8.46a5 5 0 0 1 0 7.07\"/><path d=\"M19.07 4.93a10 10 0 0 1 0 14.14\"/>"),
|
|
1151
|
+
visualImpair: J("<path d=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/>"),
|
|
1152
|
+
seizureSafe: J("<path d=\"M13 2L3 14h9l-1 8 10-12h-9l1-8z\"/>"),
|
|
1153
|
+
cognitive: J("<path d=\"M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 4.44-2.54z\"/><path d=\"M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-4.44-2.54z\"/>"),
|
|
1154
|
+
info: J("<circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M12 16v-4\"/><path d=\"M12 8h.01\"/>"),
|
|
1155
|
+
check: J("<path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"/><polyline points=\"22 4 12 14.01 9 11.01\"/>"),
|
|
1156
|
+
chevronDown: J("<path d=\"m6 9 6 6 6-6\"/>"),
|
|
1157
|
+
sun: J("<circle cx=\"12\" cy=\"12\" r=\"4\"/><path d=\"M12 2v2\"/><path d=\"M12 20v2\"/><path d=\"m4.93 4.93 1.41 1.41\"/><path d=\"m17.66 17.66 1.41 1.41\"/><path d=\"M2 12h2\"/><path d=\"M20 12h2\"/><path d=\"m6.34 17.66-1.41 1.41\"/><path d=\"m19.07 4.93-1.41 1.41\"/>"),
|
|
1158
|
+
moon: J("<path d=\"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z\"/>"),
|
|
1159
|
+
droplet: J("<path d=\"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5s-3 3.5-3 5.5a7 7 0 0 0 7 7z\"/>"),
|
|
1160
|
+
refresh: J("<path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\"/><path d=\"M21 3v5h-5\"/><path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\"/><path d=\"M3 21v-5h5\"/>"),
|
|
1161
|
+
send: J("<line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"13\"/><polygon points=\"22 2 15 22 11 13 2 9 22 2\"/>"),
|
|
1162
|
+
code: J("<polyline points=\"16 18 22 12 16 6\"/><polyline points=\"8 6 2 12 8 18\"/>"),
|
|
1163
|
+
palette: J("<circle cx=\"13.5\" cy=\"6.5\" r=\".5\"/><circle cx=\"17.5\" cy=\"10.5\" r=\".5\"/><circle cx=\"8.5\" cy=\"7.5\" r=\".5\"/><circle cx=\"6.5\" cy=\"12.5\" r=\".5\"/><path d=\"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.92 0 1.76-.74 1.76-1.67 0-.42-.15-.81-.42-1.15-.28-.33-.45-.78-.45-1.26 0-.93.74-1.67 1.67-1.67h1.91c2.97 0 5.53-2.56 5.53-5.53C22 6.5 17.5 2 12 2z\"/>"),
|
|
1164
|
+
link: J("<path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"/>"),
|
|
1165
|
+
type: J("<polyline points=\"4 7 4 4 20 4 20 7\"/><line x1=\"9\" y1=\"20\" x2=\"15\" y2=\"20\"/><line x1=\"12\" y1=\"4\" x2=\"12\" y2=\"20\"/>"),
|
|
1166
|
+
mouse: J("<path d=\"M15 6v6a3 3 0 0 1-6 0V6a3 3 0 0 1 6 0z\"/><rect x=\"6\" y=\"2\" width=\"12\" height=\"20\" rx=\"6\"/>")
|
|
1167
|
+
}, at = he`
|
|
1158
1168
|
:host {
|
|
1159
1169
|
display: block;
|
|
1160
1170
|
pointer-events: none;
|
|
@@ -1325,6 +1335,7 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1325
1335
|
color: var(--bw-primary-fg);
|
|
1326
1336
|
box-shadow: none;
|
|
1327
1337
|
}
|
|
1338
|
+
.bw-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
|
|
1328
1339
|
.bw-tab[active] svg { color: var(--bw-primary-fg); }
|
|
1329
1340
|
|
|
1330
1341
|
/* ─── Content area ─── */
|
|
@@ -1762,6 +1773,51 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1762
1773
|
gap: 8px;
|
|
1763
1774
|
}
|
|
1764
1775
|
|
|
1776
|
+
.lang-row-icon {
|
|
1777
|
+
width: 16px;
|
|
1778
|
+
height: 16px;
|
|
1779
|
+
display: inline-flex;
|
|
1780
|
+
align-items: center;
|
|
1781
|
+
justify-content: center;
|
|
1782
|
+
flex-shrink: 0;
|
|
1783
|
+
}
|
|
1784
|
+
.lang-row-icon svg {
|
|
1785
|
+
width: 16px;
|
|
1786
|
+
height: 16px;
|
|
1787
|
+
display: block;
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
.settings-actions {
|
|
1791
|
+
margin: 0 14px 14px;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
.reset-settings-btn {
|
|
1795
|
+
width: 100%;
|
|
1796
|
+
min-height: 44px;
|
|
1797
|
+
padding: 10px 14px;
|
|
1798
|
+
border-radius: var(--bw-radius-sm);
|
|
1799
|
+
border: 1.5px solid var(--bw-border);
|
|
1800
|
+
background: var(--bw-bg);
|
|
1801
|
+
color: var(--bw-fg);
|
|
1802
|
+
font-size: 13px;
|
|
1803
|
+
font-weight: 600;
|
|
1804
|
+
cursor: pointer;
|
|
1805
|
+
display: inline-flex;
|
|
1806
|
+
align-items: center;
|
|
1807
|
+
justify-content: center;
|
|
1808
|
+
gap: 8px;
|
|
1809
|
+
transition: all 0.18s;
|
|
1810
|
+
}
|
|
1811
|
+
.reset-settings-btn:hover {
|
|
1812
|
+
border-color: #ef4444;
|
|
1813
|
+
color: #ef4444;
|
|
1814
|
+
background: #fef2f2;
|
|
1815
|
+
}
|
|
1816
|
+
.reset-settings-btn svg {
|
|
1817
|
+
width: 16px;
|
|
1818
|
+
height: 16px;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1765
1821
|
.trigger svg {
|
|
1766
1822
|
width: 28px;
|
|
1767
1823
|
height: 28px;
|
|
@@ -1809,7 +1865,8 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1809
1865
|
}
|
|
1810
1866
|
@keyframes adminFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
|
|
1811
1867
|
|
|
1812
|
-
.admin-overlay .admin-icon {
|
|
1868
|
+
.admin-overlay .admin-icon { margin-bottom: 12px; color: var(--bw-primary); }
|
|
1869
|
+
.admin-overlay .admin-icon svg { width: 32px; height: 32px; }
|
|
1813
1870
|
.admin-overlay h4 { font-size: 17px; font-weight: 700; margin: 0 0 6px; color: var(--bw-fg); }
|
|
1814
1871
|
.admin-overlay p { font-size: 13px; color: var(--bw-fg-muted); margin: 0 0 20px; }
|
|
1815
1872
|
.admin-overlay input {
|
|
@@ -1840,7 +1897,7 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1840
1897
|
}
|
|
1841
1898
|
.auth-error { color: #ef4444; font-size: 12px; margin: 0 0 12px; }
|
|
1842
1899
|
.admin-status { color: #059669; font-size: 14px; font-weight: 600; margin: 0 0 16px; }
|
|
1843
|
-
`,
|
|
1900
|
+
`, ot = "bw-a11y-settings-v2", X = {
|
|
1844
1901
|
monochrome: !1,
|
|
1845
1902
|
darkHighContrast: !1,
|
|
1846
1903
|
brightHighContrast: !1,
|
|
@@ -1860,19 +1917,19 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1860
1917
|
cursorMagnifier: !1,
|
|
1861
1918
|
animationsDisabled: !1,
|
|
1862
1919
|
linkHighlight: !1
|
|
1863
|
-
},
|
|
1920
|
+
}, st = class {
|
|
1864
1921
|
constructor(e) {
|
|
1865
|
-
this.settings = { ...
|
|
1922
|
+
this.settings = { ...X }, (this.host = e).addController(this), this._loadSettings();
|
|
1866
1923
|
}
|
|
1867
1924
|
hostConnected() {
|
|
1868
1925
|
this._applySettings();
|
|
1869
1926
|
}
|
|
1870
1927
|
_loadSettings() {
|
|
1871
|
-
let e = localStorage.getItem(
|
|
1928
|
+
let e = localStorage.getItem(ot);
|
|
1872
1929
|
if (e) try {
|
|
1873
1930
|
let t = JSON.parse(e);
|
|
1874
1931
|
this.settings = {
|
|
1875
|
-
...
|
|
1932
|
+
...X,
|
|
1876
1933
|
...t
|
|
1877
1934
|
};
|
|
1878
1935
|
} catch (e) {
|
|
@@ -1880,7 +1937,7 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1880
1937
|
}
|
|
1881
1938
|
}
|
|
1882
1939
|
_saveSettings() {
|
|
1883
|
-
localStorage.setItem(
|
|
1940
|
+
localStorage.setItem(ot, JSON.stringify(this.settings)), this._applySettings(), this.host.requestUpdate();
|
|
1884
1941
|
}
|
|
1885
1942
|
_ensureGlobalStyles() {
|
|
1886
1943
|
let e = "bw-global-a11y-styles", t = document.getElementById(e);
|
|
@@ -1963,9 +2020,9 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
1963
2020
|
this.settings.linkHighlight = !this.settings.linkHighlight, this._saveSettings();
|
|
1964
2021
|
}
|
|
1965
2022
|
reset() {
|
|
1966
|
-
this.settings = { ...
|
|
2023
|
+
this.settings = { ...X }, this._saveSettings();
|
|
1967
2024
|
}
|
|
1968
|
-
},
|
|
2025
|
+
}, ct = "http://localhost:8000", lt = class {
|
|
1969
2026
|
constructor(e) {
|
|
1970
2027
|
this.isFixing = !1, this.simplifyEnabled = !1, this.autoA11yEnabled = !1, this._onParagraphKeydown = (e) => {
|
|
1971
2028
|
if (this.simplifyEnabled && (e.key === "Enter" || e.key === " ") && e.target instanceof HTMLElement) {
|
|
@@ -2058,7 +2115,7 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
2058
2115
|
console.log(`BariWeb AI: Found ${e.length} broken elements. Processing...`);
|
|
2059
2116
|
let t = window.BariwebConfig?.clientId || "";
|
|
2060
2117
|
for (let n = 0; n < e.length; n += 10) {
|
|
2061
|
-
let r = e.slice(n, n + 10), i = await fetch(`${
|
|
2118
|
+
let r = e.slice(n, n + 10), i = await fetch(`${ct}/v1/widget/a11y/fix`, {
|
|
2062
2119
|
method: "POST",
|
|
2063
2120
|
headers: {
|
|
2064
2121
|
"Content-Type": "application/json",
|
|
@@ -2109,7 +2166,7 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
2109
2166
|
i.remove(), e.style.outline = a, e.style.backgroundColor = o;
|
|
2110
2167
|
});
|
|
2111
2168
|
try {
|
|
2112
|
-
let e = window.BariwebConfig?.clientId || "", t = await fetch(`${
|
|
2169
|
+
let e = window.BariwebConfig?.clientId || "", t = await fetch(`${ct}/v1/widget/a11y/simplify`, {
|
|
2113
2170
|
method: "POST",
|
|
2114
2171
|
headers: {
|
|
2115
2172
|
"Content-Type": "application/json",
|
|
@@ -2126,9 +2183,11 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
2126
2183
|
console.error("BariWeb AI: Simplify failed", e), i.classList.remove("bw-ai-tooltip-loading"), i.querySelector(".bw-ai-tooltip-content").innerHTML = "<span style=\"color:#ef4444; font-size:13px;\">Ошибка создания упрощенного текста. Попробуйте еще раз.</span>", i.focus();
|
|
2127
2184
|
}
|
|
2128
2185
|
}
|
|
2129
|
-
},
|
|
2186
|
+
}, ut = "bw-tts-enabled-v1", dt = class {
|
|
2130
2187
|
constructor() {
|
|
2131
|
-
this.enabled = !0, this.enabled = this.loadEnabled()
|
|
2188
|
+
this.enabled = !0, this.enabled = this.loadEnabled(), "speechSynthesis" in window && (window.speechSynthesis.getVoices(), window.speechSynthesis.onvoiceschanged = () => {
|
|
2189
|
+
window.speechSynthesis.getVoices();
|
|
2190
|
+
});
|
|
2132
2191
|
}
|
|
2133
2192
|
isEnabled() {
|
|
2134
2193
|
return this.enabled;
|
|
@@ -2136,7 +2195,7 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
2136
2195
|
setEnabled(e) {
|
|
2137
2196
|
this.enabled = e;
|
|
2138
2197
|
try {
|
|
2139
|
-
localStorage.setItem(
|
|
2198
|
+
localStorage.setItem(ut, e ? "1" : "0");
|
|
2140
2199
|
} catch {}
|
|
2141
2200
|
e || this.stop();
|
|
2142
2201
|
}
|
|
@@ -2147,26 +2206,25 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
2147
2206
|
if (!this.enabled || !("speechSynthesis" in window)) return;
|
|
2148
2207
|
let t = (e || "").trim();
|
|
2149
2208
|
if (t) try {
|
|
2150
|
-
window.speechSynthesis.cancel();
|
|
2209
|
+
window.speechSynthesis.resume(), window.speechSynthesis.cancel();
|
|
2151
2210
|
let e = new SpeechSynthesisUtterance(t), n = this.detectLanguage(t);
|
|
2152
2211
|
e.lang = n;
|
|
2153
2212
|
let r = this.pickVoice(n);
|
|
2154
|
-
r && (e.voice = r), e.rate = 1, e.pitch = 1, window.speechSynthesis.speak(e);
|
|
2213
|
+
r && (e.voice = r), e.rate = 1, e.pitch = 1, e.volume = 1, window.speechSynthesis.speak(e);
|
|
2155
2214
|
} catch (e) {
|
|
2156
2215
|
console.warn("TTS speak failed", e);
|
|
2157
2216
|
}
|
|
2158
2217
|
}
|
|
2159
2218
|
loadEnabled() {
|
|
2160
2219
|
try {
|
|
2161
|
-
let e = localStorage.getItem(
|
|
2220
|
+
let e = localStorage.getItem(ut);
|
|
2162
2221
|
return e === null ? !0 : e !== "0";
|
|
2163
2222
|
} catch {
|
|
2164
2223
|
return !0;
|
|
2165
2224
|
}
|
|
2166
2225
|
}
|
|
2167
2226
|
detectLanguage(e) {
|
|
2168
|
-
|
|
2169
|
-
return /[әіңғүұқөһ]/i.test(t) ? "kk-KZ" : /[а-яё]/i.test(t) ? "ru-RU" : /[a-z]/i.test(t) ? "en-US" : "ru-RU";
|
|
2227
|
+
return /[\u04D8\u04D9\u0492\u0493\u04AE\u04AF\u049A\u049B\u04E8\u04E9\u04BA\u04BB\u0406\u0456\u04A2\u04A3]/u.test(e) ? "kk-KZ" : /[\u0400-\u04FF]/u.test(e) ? "ru-RU" : /[a-z]/i.test(e) ? "en-US" : "ru-RU";
|
|
2170
2228
|
}
|
|
2171
2229
|
pickVoice(e) {
|
|
2172
2230
|
if (!("speechSynthesis" in window)) return null;
|
|
@@ -2175,8 +2233,8 @@ var at = rt(K), q = (e) => F`${at(`
|
|
|
2175
2233
|
let n = e.split("-")[0].toLowerCase();
|
|
2176
2234
|
return t.find((t) => t.lang.toLowerCase() === e.toLowerCase()) || t.find((e) => e.lang.toLowerCase().startsWith(n)) || t[0] || null;
|
|
2177
2235
|
}
|
|
2178
|
-
},
|
|
2179
|
-
function
|
|
2236
|
+
}, Z = "http://localhost:8000", ft = 5, pt = [/(submit|отправить|оплатить|сгенерировать|сохранить|перевести|подтвердит|купить|удалить|delete|pay|purchase|buy|send|transfer|confirm|place.?order|checkout|remove|drop|unsubscribe|sign.?out|выйти|уволить)/i];
|
|
2237
|
+
function mt(e) {
|
|
2180
2238
|
if (e.type !== "click_element" || !e.element_id) return !1;
|
|
2181
2239
|
let t = document.getElementById(e.element_id);
|
|
2182
2240
|
if (!t) return !1;
|
|
@@ -2188,16 +2246,19 @@ function ht(e) {
|
|
|
2188
2246
|
t.getAttribute("name") || "",
|
|
2189
2247
|
t.getAttribute("value") || ""
|
|
2190
2248
|
].join(" ");
|
|
2191
|
-
return
|
|
2249
|
+
return pt.some((e) => e.test(n));
|
|
2192
2250
|
}
|
|
2193
|
-
var
|
|
2251
|
+
var ht = class {
|
|
2194
2252
|
constructor(e) {
|
|
2195
|
-
this.messages = [], this.isLoading = !1, this.error = null, this._tts = new
|
|
2253
|
+
this.messages = [], this.isLoading = !1, this.error = null, this._tts = new dt(), this._voiceMode = !1, this.pendingConfirmation = null, (this.host = e).addController(this), this._loadMessages();
|
|
2196
2254
|
}
|
|
2197
2255
|
hostConnected() {}
|
|
2198
2256
|
hostDisconnected() {
|
|
2199
2257
|
this._tts.stop();
|
|
2200
2258
|
}
|
|
2259
|
+
_shouldSpeak() {
|
|
2260
|
+
return this._voiceMode || this._tts.isEnabled();
|
|
2261
|
+
}
|
|
2201
2262
|
_loadMessages() {
|
|
2202
2263
|
try {
|
|
2203
2264
|
let e = sessionStorage.getItem("bw-chat-history");
|
|
@@ -2330,7 +2391,7 @@ var gt = class {
|
|
|
2330
2391
|
async _callAPI(t) {
|
|
2331
2392
|
let { page_text: n, elements: r, page_url: i } = this.gatherContext(), a = e(), o = this.host.clientId || window.__BARIWEB_CLIENT_ID__ || "", s = null;
|
|
2332
2393
|
try {
|
|
2333
|
-
let e = await fetch(`${
|
|
2394
|
+
let e = await fetch(`${Z}/v1/training/match-screen`, {
|
|
2334
2395
|
method: "POST",
|
|
2335
2396
|
headers: {
|
|
2336
2397
|
"Content-Type": "application/json",
|
|
@@ -2345,7 +2406,7 @@ var gt = class {
|
|
|
2345
2406
|
} catch (e) {
|
|
2346
2407
|
console.warn("Failed to match screen fingerprint", e);
|
|
2347
2408
|
}
|
|
2348
|
-
let c = await fetch(`${
|
|
2409
|
+
let c = await fetch(`${Z}/v1/chat`, {
|
|
2349
2410
|
method: "POST",
|
|
2350
2411
|
headers: {
|
|
2351
2412
|
"Content-Type": "application/json",
|
|
@@ -2393,11 +2454,11 @@ var gt = class {
|
|
|
2393
2454
|
}], this._saveMessages()), this.host.requestUpdate();
|
|
2394
2455
|
let r = e, i = 0;
|
|
2395
2456
|
try {
|
|
2396
|
-
for (; i <
|
|
2457
|
+
for (; i < ft;) {
|
|
2397
2458
|
i++;
|
|
2398
2459
|
let e = await this._callAPI(r), t = e.text;
|
|
2399
2460
|
if (e.action) {
|
|
2400
|
-
if (
|
|
2461
|
+
if (mt(e.action)) {
|
|
2401
2462
|
let t = document.getElementById(e.action.element_id || "")?.textContent?.trim() || e.action.element_id || "кнопку";
|
|
2402
2463
|
this.pendingConfirmation = {
|
|
2403
2464
|
text: `${e.text}\n\n⚠️ Нажать «${t}»?`,
|
|
@@ -2408,7 +2469,7 @@ var gt = class {
|
|
|
2408
2469
|
role: "assistant",
|
|
2409
2470
|
text: `${e.text}\n\n🛑 **Подтвердите действие:** нажать «${t}»?`,
|
|
2410
2471
|
timestamp: Date.now()
|
|
2411
|
-
}], this._saveMessages(), this.
|
|
2472
|
+
}], this._saveMessages(), this._shouldSpeak() && this._tts.speak(e.text), this.isLoading = !1, this.host.requestUpdate();
|
|
2412
2473
|
return;
|
|
2413
2474
|
}
|
|
2414
2475
|
let n = this.gatherContext().page_text, { result: a, causesNavigation: o } = this.executeAction(e.action);
|
|
@@ -2417,7 +2478,7 @@ var gt = class {
|
|
|
2417
2478
|
role: "assistant",
|
|
2418
2479
|
text: "🔄 Анализирую...",
|
|
2419
2480
|
timestamp: Date.now()
|
|
2420
|
-
}], this._saveMessages(), this.
|
|
2481
|
+
}], this._saveMessages(), this._shouldSpeak() && this._tts.speak("Анализирую..."), this.host.requestUpdate(), await this._waitForDom(800), r = "Страница обновилась. Продолжай задачу, прочитай DOM.";
|
|
2421
2482
|
continue;
|
|
2422
2483
|
}
|
|
2423
2484
|
if (t = `${e.text}\n${a}`, o) {
|
|
@@ -2425,7 +2486,7 @@ var gt = class {
|
|
|
2425
2486
|
role: "assistant",
|
|
2426
2487
|
text: t,
|
|
2427
2488
|
timestamp: Date.now()
|
|
2428
|
-
}], this._saveMessages(), this.
|
|
2489
|
+
}], this._saveMessages(), this._shouldSpeak() && this._tts.speak(t), this.host.requestUpdate(), await this._waitForDom(1500);
|
|
2429
2490
|
let e = sessionStorage.getItem("bw-auto-resume");
|
|
2430
2491
|
if (e === "true" || e === "verify-only") {
|
|
2431
2492
|
sessionStorage.removeItem("bw-auto-resume"), r = e === "verify-only" ? "Страница загрузилась после отправки формы (SPA навигация). Проверь новый DOM: если задача выполнена — сообщи об успехе. НЕ нажимай ничего снова." : "Страница загрузилась (SPA навигация). Продолжай задачу, прочитай новый DOM.";
|
|
@@ -2437,14 +2498,14 @@ var gt = class {
|
|
|
2437
2498
|
role: "assistant",
|
|
2438
2499
|
text: t,
|
|
2439
2500
|
timestamp: Date.now()
|
|
2440
|
-
}], this._saveMessages(), this.
|
|
2501
|
+
}], this._saveMessages(), this._shouldSpeak() && this._tts.speak(t), this.host.requestUpdate(), e.action.type === "input_text" && e.action.element_id ? (await this._waitForDom(800), r = (document.getElementById(e.action.element_id)?.value ?? "").length > 0 ? "✅ Поле заполнено. Переходи к СЛЕДУЮЩЕМУ незаполненному полю или нажми кнопку отправки. НЕ повторяй ввод." : `⚠️ Поле не получило значение. Попробуй ввести снова в id="${e.action.element_id}".`) : (await this._waitForDom(800), r = n === this.gatherContext().page_text ? "⚠️ Страница не изменилась. Возможно кнопка не сработала. Проверь DOM." : "Действие выполнено. Если задача готова — сообщи. Иначе продолжай.");
|
|
2441
2502
|
continue;
|
|
2442
2503
|
}
|
|
2443
2504
|
this.messages = [...this.messages, {
|
|
2444
2505
|
role: "assistant",
|
|
2445
2506
|
text: t,
|
|
2446
2507
|
timestamp: Date.now()
|
|
2447
|
-
}], this._saveMessages(), this.
|
|
2508
|
+
}], this._saveMessages(), this._shouldSpeak() && this._tts.speak(t);
|
|
2448
2509
|
break;
|
|
2449
2510
|
}
|
|
2450
2511
|
} catch (e) {
|
|
@@ -2452,7 +2513,7 @@ var gt = class {
|
|
|
2452
2513
|
role: "assistant",
|
|
2453
2514
|
text: `❌ Ошибка: ${this.error}`,
|
|
2454
2515
|
timestamp: Date.now()
|
|
2455
|
-
}], this._saveMessages(), this.
|
|
2516
|
+
}], this._saveMessages(), this._shouldSpeak() && this._tts.speak(`Ошибка: ${this.error}`);
|
|
2456
2517
|
} finally {
|
|
2457
2518
|
this.isLoading = !1, this.host.requestUpdate();
|
|
2458
2519
|
}
|
|
@@ -2470,7 +2531,7 @@ var gt = class {
|
|
|
2470
2531
|
role: "assistant",
|
|
2471
2532
|
text: t,
|
|
2472
2533
|
timestamp: Date.now()
|
|
2473
|
-
}], this._saveMessages(), this.
|
|
2534
|
+
}], this._saveMessages(), this._shouldSpeak() && this._tts.speak(t), this.host.requestUpdate(), !n && (await this._waitForDom(1200), await this._agentStep("Действие подтверждено и выполнено. Проверь результат в DOM."));
|
|
2474
2535
|
}
|
|
2475
2536
|
cancelAction() {
|
|
2476
2537
|
this.pendingConfirmation && (this.pendingConfirmation = null, this.messages = [
|
|
@@ -2485,7 +2546,7 @@ var gt = class {
|
|
|
2485
2546
|
text: "🚫 Действие отменено. Чем ещё могу помочь?",
|
|
2486
2547
|
timestamp: Date.now()
|
|
2487
2548
|
}
|
|
2488
|
-
], this._saveMessages(), this.
|
|
2549
|
+
], this._saveMessages(), this._shouldSpeak() && this._tts.speak("Действие отменено. Чем ещё могу помочь?"), this.host.requestUpdate());
|
|
2489
2550
|
}
|
|
2490
2551
|
_waitForDom(e) {
|
|
2491
2552
|
return new Promise((t) => setTimeout(t, e));
|
|
@@ -2514,7 +2575,7 @@ var gt = class {
|
|
|
2514
2575
|
async transcribeAudio(e, t) {
|
|
2515
2576
|
let n = this.host.clientId || window.__BARIWEB_CLIENT_ID__ || "", r = new FormData();
|
|
2516
2577
|
r.append("language_mode", t), r.append("audio", e, "speech.wav");
|
|
2517
|
-
let i = await fetch(`${
|
|
2578
|
+
let i = await fetch(`${Z}/v1/stt/transcribe`, {
|
|
2518
2579
|
method: "POST",
|
|
2519
2580
|
headers: { "X-Client-ID": n },
|
|
2520
2581
|
body: r
|
|
@@ -2531,7 +2592,7 @@ var gt = class {
|
|
|
2531
2592
|
};
|
|
2532
2593
|
//#endregion
|
|
2533
2594
|
//#region \0@oxc-project+runtime@0.122.0/helpers/decorate.js
|
|
2534
|
-
function
|
|
2595
|
+
function Q(e, t, n, r) {
|
|
2535
2596
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
2536
2597
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
2537
2598
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -2539,171 +2600,249 @@ function Z(e, t, n, r) {
|
|
|
2539
2600
|
}
|
|
2540
2601
|
//#endregion
|
|
2541
2602
|
//#region src/widget.ts
|
|
2542
|
-
var
|
|
2543
|
-
kz: {
|
|
2544
|
-
langLabel: "Тану және виджет тілі",
|
|
2545
|
-
langKz: "Қазақша",
|
|
2546
|
-
langRu: "Орысша",
|
|
2547
|
-
langEn: "Ағылшынша",
|
|
2548
|
-
chatTab: "💬 Чат",
|
|
2549
|
-
settingsTab: "♿ Баптаулар",
|
|
2550
|
-
brandSub: "Инклюзия",
|
|
2551
|
-
madeIn: "Қазақстанда жасалған 🇰🇿",
|
|
2552
|
-
voiceBtnInit: "Дауыс",
|
|
2553
|
-
voiceBtnRec: "Жазылуда...",
|
|
2554
|
-
micBannerRec: "🎙️ Тыңдаудамын... (тыныштық болса тоқтаймын)",
|
|
2555
|
-
micBannerWait: "⏳ Сөзді тану...",
|
|
2556
|
-
micBannerErr: "⚠️",
|
|
2557
|
-
micAriaL: "Голостық енгізуді қосу (жазу үшін ұстап тұрыңыз)",
|
|
2558
|
-
inputAriaL: "Хабарламаны енгізу өрісі",
|
|
2559
|
-
inputPl: "Хабарлама енгізіңіз...",
|
|
2560
|
-
ttsAriaOn: "Жауапты дыбыстауды өшіру",
|
|
2561
|
-
ttsAriaOff: "Жауапты дыбыстауды қосу",
|
|
2562
|
-
sendAria: "Хабарлама жіберу",
|
|
2563
|
-
onPage: "Бетте:",
|
|
2564
|
-
emptyChatTitle: "Сіздің көмекшіңіз",
|
|
2565
|
-
emptyChatSub: "Тапсырманы сипаттаңыз — мен қажетті түймелерді тауып, өрістерді сіз үшін толтырамын.",
|
|
2566
|
-
confirmAction: "✅ Әрекетті растау",
|
|
2567
|
-
cancelAction: "Болдырмау",
|
|
2568
|
-
textScale: "Мәтін өлшемі",
|
|
2569
|
-
monochrome: "А/Қ",
|
|
2570
|
-
monochromeVal: "Монохром",
|
|
2571
|
-
contrast: "Контраст",
|
|
2572
|
-
contrastVal: "Қараңғы",
|
|
2573
|
-
links: "Сілтемелер",
|
|
2574
|
-
linksVal: "Ерекшелеу",
|
|
2575
|
-
spacing: "Аралық",
|
|
2576
|
-
spacingVal: "Үлкейту",
|
|
2577
|
-
font: "Қаріп",
|
|
2578
|
-
fontVal: "Дислексия",
|
|
2579
|
-
cursor: "Курсор",
|
|
2580
|
-
cursorVal: "Үлкейту",
|
|
2581
|
-
colorSettingsTitle: "Түс баптаулары",
|
|
2582
|
-
colorBg: "Фон",
|
|
2583
|
-
colorHeader: "Бас киім",
|
|
2584
|
-
colorText: "Мәтін",
|
|
2585
|
-
aiSimplifyTitle: "AI Мәтінді оңтайландыру",
|
|
2586
|
-
aiBlindTitle: "Зағиптар режимі (AI)",
|
|
2587
|
-
on: "ҚОСУЛЫ",
|
|
2588
|
-
off: "ӨШІРУЛІ",
|
|
2589
|
-
closeAria: "Жабу"
|
|
2590
|
-
},
|
|
2603
|
+
var gt = "bw-stt-lang-v1", _t = 200, vt = .015, yt = 1200, bt = 2e4, xt = 350, St = {
|
|
2591
2604
|
ru: {
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2605
|
+
announceVoiceInputAvailable: "Голосовой ввод доступен. Кнопка в нижнем правом углу.",
|
|
2606
|
+
announceWidgetOpened: "Виджет открыт.",
|
|
2607
|
+
announceSwitchedToChat: "Переход в чат. Голосовой ввод доступен.",
|
|
2608
|
+
errorMicNotSupported: "Микрофон не поддерживается.",
|
|
2609
|
+
errorNoMicAccess: "Нет доступа к микрофону.",
|
|
2610
|
+
errorProcessing: "Ошибка обработки.",
|
|
2611
|
+
errorTooShort: "Слишком короткая запись.",
|
|
2612
|
+
errorSpeechNotRecognized: "Речь не распознана.",
|
|
2613
|
+
errorRecognition: "Ошибка распознавания.",
|
|
2614
|
+
screenLabelPrefix: "На странице:",
|
|
2615
|
+
chatEmptyTitle: "Ваш помощник",
|
|
2616
|
+
chatEmptySub: "Опишите задачу — я найду нужные кнопки и заполню поля за вас.",
|
|
2617
|
+
confirmAction: "Подтвердить действие",
|
|
2618
|
+
cancel: "Отменить",
|
|
2619
|
+
listening: "Слушаю... (остановлюсь по тишине)",
|
|
2620
|
+
recognizingSpeech: "Распознаю речь...",
|
|
2621
|
+
micAria: "Включить голосовой ввод (удерживайте для записи)",
|
|
2622
|
+
inputPlaceholder: "Введите сообщение...",
|
|
2623
|
+
inputAria: "Текстовое поле ввода сообщения",
|
|
2624
|
+
ttsDisableAria: "Выключить озвучку ответа",
|
|
2625
|
+
ttsEnableAria: "Включить озвучку ответа",
|
|
2610
2626
|
sendAria: "Отправить сообщение",
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2627
|
+
tileTextSize: "Размер текста",
|
|
2628
|
+
tileMonochrome: "Ч/Б",
|
|
2629
|
+
valueMonochrome: "Монохром",
|
|
2630
|
+
tileContrast: "Контраст",
|
|
2631
|
+
valueDark: "Тёмный",
|
|
2632
|
+
tileLinks: "Ссылки",
|
|
2633
|
+
valueHighlight: "Выделить",
|
|
2634
|
+
tileSpacing: "Отступы",
|
|
2635
|
+
valueEnlarge: "Увеличить",
|
|
2636
|
+
tileFont: "Шрифт",
|
|
2637
|
+
valueDyslexia: "Дислексия",
|
|
2638
|
+
tileCursor: "Курсор",
|
|
2639
|
+
tileVoice: "Голос",
|
|
2640
|
+
valueRecording: "Запись...",
|
|
2641
|
+
valuePress: "Нажмите",
|
|
2642
|
+
colorSetup: "Настройка цвета",
|
|
2643
|
+
tabBackground: "Фон",
|
|
2644
|
+
tabHeader: "Шапка",
|
|
2645
|
+
tabText: "Текст",
|
|
2646
|
+
decrease: "Уменьшить",
|
|
2647
|
+
hue: "Оттенок",
|
|
2648
|
+
increase: "Увеличить",
|
|
2649
|
+
recognitionLanguage: "Язык",
|
|
2650
|
+
changeRecognitionLanguage: "Изменить язык распознавания",
|
|
2651
|
+
languageAuto: "Автоопределение",
|
|
2652
|
+
languageKz: "Казахский",
|
|
2653
|
+
languageRu: "Русский",
|
|
2654
|
+
languageEn: "Английский",
|
|
2655
|
+
aiSimplify: "AI Упрощение текста",
|
|
2656
|
+
aiBlindMode: "Режим для незрячих (AI)",
|
|
2635
2657
|
on: "ВКЛ",
|
|
2636
2658
|
off: "ВЫКЛ",
|
|
2637
|
-
|
|
2659
|
+
resetSettings: "Сбросить настройки",
|
|
2660
|
+
adminMode: "Режим администратора",
|
|
2661
|
+
adminAccess: "Admin доступ",
|
|
2662
|
+
adminLoggedIn: "Вы вошли как администратор",
|
|
2663
|
+
adminLogout: "Выйти из аккаунта",
|
|
2664
|
+
adminPrompt: "Введите ключ для активации режима обучения",
|
|
2665
|
+
adminLogin: "Войти",
|
|
2666
|
+
close: "Закрыть",
|
|
2667
|
+
inclusion: "Инклюзия",
|
|
2668
|
+
tabChat: "Чат",
|
|
2669
|
+
tabSettings: "Настройки",
|
|
2670
|
+
madeInKazakhstan: "Сделано в Казахстане 🇰🇿",
|
|
2671
|
+
closeWidgetAria: "Закрыть",
|
|
2672
|
+
widgetDialogAria: "BariWeb Accessibility Widget",
|
|
2673
|
+
triggerAria: "Открыть/Закрыть меню доступности",
|
|
2674
|
+
adminKeyPlaceholder: "Admin Key"
|
|
2675
|
+
},
|
|
2676
|
+
kz: {
|
|
2677
|
+
announceVoiceInputAvailable: "Дауыстық енгізу қолжетімді. Түйме төменгі оң жақ бұрышта.",
|
|
2678
|
+
announceWidgetOpened: "Виджет ашылды.",
|
|
2679
|
+
announceSwitchedToChat: "Чатқа ауысты. Дауыстық енгізу қолжетімді.",
|
|
2680
|
+
errorMicNotSupported: "Микрофонға қолдау жоқ.",
|
|
2681
|
+
errorNoMicAccess: "Микрофонға рұқсат жоқ.",
|
|
2682
|
+
errorProcessing: "Өңдеу қатесі.",
|
|
2683
|
+
errorTooShort: "Жазба тым қысқа.",
|
|
2684
|
+
errorSpeechNotRecognized: "Сөйлеу танылмады.",
|
|
2685
|
+
errorRecognition: "Тану қатесі.",
|
|
2686
|
+
screenLabelPrefix: "Бетте:",
|
|
2687
|
+
chatEmptyTitle: "Сіздің көмекшіңіз",
|
|
2688
|
+
chatEmptySub: "Міндетті сипаттаңыз — мен керек батырмаларды тауып, өрістерді толтырамын.",
|
|
2689
|
+
confirmAction: "Әрекетті растау",
|
|
2690
|
+
cancel: "Бас тарту",
|
|
2691
|
+
listening: "Тыңдап тұрмын... (үнсіздікте тоқтаймын)",
|
|
2692
|
+
recognizingSpeech: "Сөйлеуді танып жатырмын...",
|
|
2693
|
+
micAria: "Дауыстық енгізуді қосу (жазу үшін ұстап тұрыңыз)",
|
|
2694
|
+
inputPlaceholder: "Хабарлама енгізіңіз...",
|
|
2695
|
+
inputAria: "Хабарлама енгізу өрісі",
|
|
2696
|
+
ttsDisableAria: "Жауап дауысын өшіру",
|
|
2697
|
+
ttsEnableAria: "Жауап дауысын қосу",
|
|
2698
|
+
sendAria: "Хабарламаны жіберу",
|
|
2699
|
+
tileTextSize: "Мәтін өлшемі",
|
|
2700
|
+
tileMonochrome: "Қ/А",
|
|
2701
|
+
valueMonochrome: "Монохром",
|
|
2702
|
+
tileContrast: "Контраст",
|
|
2703
|
+
valueDark: "Қою",
|
|
2704
|
+
tileLinks: "Сілтемелер",
|
|
2705
|
+
valueHighlight: "Белгілеу",
|
|
2706
|
+
tileSpacing: "Аралықтар",
|
|
2707
|
+
valueEnlarge: "Үлкейту",
|
|
2708
|
+
tileFont: "Қаріп",
|
|
2709
|
+
valueDyslexia: "Дислексия",
|
|
2710
|
+
tileCursor: "Курсор",
|
|
2711
|
+
tileVoice: "Дауыс",
|
|
2712
|
+
valueRecording: "Жазып жатыр...",
|
|
2713
|
+
valuePress: "Басыңыз",
|
|
2714
|
+
colorSetup: "Түсті баптау",
|
|
2715
|
+
tabBackground: "Фон",
|
|
2716
|
+
tabHeader: "Тақырып",
|
|
2717
|
+
tabText: "Мәтін",
|
|
2718
|
+
decrease: "Азайту",
|
|
2719
|
+
hue: "Реңк",
|
|
2720
|
+
increase: "Көбейту",
|
|
2721
|
+
recognitionLanguage: "Тіл",
|
|
2722
|
+
changeRecognitionLanguage: "Тану тілін өзгерту",
|
|
2723
|
+
languageAuto: "Автоанықтау",
|
|
2724
|
+
languageKz: "Қазақша",
|
|
2725
|
+
languageRu: "Орысша",
|
|
2726
|
+
languageEn: "Ағылшынша",
|
|
2727
|
+
aiSimplify: "AI мәтінді жеңілдету",
|
|
2728
|
+
aiBlindMode: "Көру қабілеті нашарларға режим (AI)",
|
|
2729
|
+
on: "ҚОС",
|
|
2730
|
+
off: "ӨШІК",
|
|
2731
|
+
resetSettings: "Баптауларды қалпына келтіру",
|
|
2732
|
+
adminMode: "Әкімші режимі",
|
|
2733
|
+
adminAccess: "Admin қолжетімділігі",
|
|
2734
|
+
adminLoggedIn: "Сіз әкімші ретінде кірдіңіз",
|
|
2735
|
+
adminLogout: "Аккаунттан шығу",
|
|
2736
|
+
adminPrompt: "Оқыту режимін қосу үшін кілт енгізіңіз",
|
|
2737
|
+
adminLogin: "Кіру",
|
|
2738
|
+
close: "Жабу",
|
|
2739
|
+
inclusion: "Инклюзия",
|
|
2740
|
+
tabChat: "Чат",
|
|
2741
|
+
tabSettings: "Баптаулар",
|
|
2742
|
+
madeInKazakhstan: "Қазақстанда жасалған 🇰🇿",
|
|
2743
|
+
closeWidgetAria: "Жабу",
|
|
2744
|
+
widgetDialogAria: "BariWeb қолжетімділік виджеті",
|
|
2745
|
+
triggerAria: "Қолжетімділік мәзірін ашу/жабу",
|
|
2746
|
+
adminKeyPlaceholder: "Admin Key"
|
|
2638
2747
|
},
|
|
2639
2748
|
en: {
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2749
|
+
announceVoiceInputAvailable: "Voice input is available. The button is in the bottom-right corner.",
|
|
2750
|
+
announceWidgetOpened: "Widget opened.",
|
|
2751
|
+
announceSwitchedToChat: "Switched to chat. Voice input is available.",
|
|
2752
|
+
errorMicNotSupported: "Microphone is not supported.",
|
|
2753
|
+
errorNoMicAccess: "No access to microphone.",
|
|
2754
|
+
errorProcessing: "Processing error.",
|
|
2755
|
+
errorTooShort: "Recording is too short.",
|
|
2756
|
+
errorSpeechNotRecognized: "Speech was not recognized.",
|
|
2757
|
+
errorRecognition: "Recognition error.",
|
|
2758
|
+
screenLabelPrefix: "On page:",
|
|
2759
|
+
chatEmptyTitle: "Your assistant",
|
|
2760
|
+
chatEmptySub: "Describe your task — I will find the right buttons and fill fields for you.",
|
|
2761
|
+
confirmAction: "Confirm action",
|
|
2762
|
+
cancel: "Cancel",
|
|
2763
|
+
listening: "Listening... (will stop on silence)",
|
|
2764
|
+
recognizingSpeech: "Recognizing speech...",
|
|
2765
|
+
micAria: "Enable voice input (hold to record)",
|
|
2766
|
+
inputPlaceholder: "Type a message...",
|
|
2767
|
+
inputAria: "Message input field",
|
|
2768
|
+
ttsDisableAria: "Disable answer voice",
|
|
2769
|
+
ttsEnableAria: "Enable answer voice",
|
|
2658
2770
|
sendAria: "Send message",
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2771
|
+
tileTextSize: "Text size",
|
|
2772
|
+
tileMonochrome: "B/W",
|
|
2773
|
+
valueMonochrome: "Monochrome",
|
|
2774
|
+
tileContrast: "Contrast",
|
|
2775
|
+
valueDark: "Dark",
|
|
2776
|
+
tileLinks: "Links",
|
|
2777
|
+
valueHighlight: "Highlight",
|
|
2778
|
+
tileSpacing: "Spacing",
|
|
2779
|
+
valueEnlarge: "Enlarge",
|
|
2780
|
+
tileFont: "Font",
|
|
2781
|
+
valueDyslexia: "Dyslexia",
|
|
2782
|
+
tileCursor: "Cursor",
|
|
2783
|
+
tileVoice: "Voice",
|
|
2784
|
+
valueRecording: "Recording...",
|
|
2785
|
+
valuePress: "Press",
|
|
2786
|
+
colorSetup: "Color setup",
|
|
2787
|
+
tabBackground: "Background",
|
|
2788
|
+
tabHeader: "Header",
|
|
2789
|
+
tabText: "Text",
|
|
2790
|
+
decrease: "Decrease",
|
|
2791
|
+
hue: "Hue",
|
|
2792
|
+
increase: "Increase",
|
|
2793
|
+
recognitionLanguage: "Language",
|
|
2794
|
+
changeRecognitionLanguage: "Change recognition language",
|
|
2795
|
+
languageAuto: "Auto detect",
|
|
2796
|
+
languageKz: "Kazakh",
|
|
2797
|
+
languageRu: "Russian",
|
|
2798
|
+
languageEn: "English",
|
|
2799
|
+
aiSimplify: "AI text simplification",
|
|
2800
|
+
aiBlindMode: "Blind mode (AI)",
|
|
2683
2801
|
on: "ON",
|
|
2684
2802
|
off: "OFF",
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2803
|
+
resetSettings: "Reset settings",
|
|
2804
|
+
adminMode: "Administrator mode",
|
|
2805
|
+
adminAccess: "Admin access",
|
|
2806
|
+
adminLoggedIn: "You are logged in as administrator",
|
|
2807
|
+
adminLogout: "Log out",
|
|
2808
|
+
adminPrompt: "Enter key to activate training mode",
|
|
2809
|
+
adminLogin: "Log in",
|
|
2810
|
+
close: "Close",
|
|
2811
|
+
inclusion: "Inclusion",
|
|
2812
|
+
tabChat: "Chat",
|
|
2813
|
+
tabSettings: "Settings",
|
|
2814
|
+
madeInKazakhstan: "Made in Kazakhstan 🇰🇿",
|
|
2815
|
+
closeWidgetAria: "Close",
|
|
2816
|
+
widgetDialogAria: "BariWeb Accessibility Widget",
|
|
2817
|
+
triggerAria: "Open/close accessibility menu",
|
|
2818
|
+
adminKeyPlaceholder: "Admin Key"
|
|
2819
|
+
}
|
|
2820
|
+
}, $ = class extends G {
|
|
2688
2821
|
static {
|
|
2689
|
-
this.styles = [
|
|
2822
|
+
this.styles = [at];
|
|
2690
2823
|
}
|
|
2691
2824
|
constructor() {
|
|
2692
|
-
super(), this._a11y = new
|
|
2825
|
+
super(), this._a11y = new st(this), this._aiA11y = new lt(this), this._chat = new ht(this), this.clientId = "", this._isOpen = !1, this._activeTab = "chat", this._inputValue = "", this._isAdmin = !1, this._adminPassword = "", this._authError = "", this._currentScreenLabel = "", this._sttState = "idle", this._sttLanguageMode = "auto", this._sttError = "", this._adminClickCount = 0, this._showAdminLogin = !1, this._mediaStream = null, this._audioContext = null, this._analyser = null, this._scriptProcessor = null, this._pcmChunks = [], this._sampleRate = 44100, this._recordingStartTs = 0, this._silenceStartedTs = null, this._silenceIntervalId = null, this._maxDurationTimeoutId = null, this._adminClickTimer = null, this._handleGlobalKeydown = (e) => {
|
|
2693
2826
|
this._isOpen && e.altKey && e.code === "KeyV" && (e.preventDefault(), this._toggleVoice());
|
|
2694
2827
|
};
|
|
2695
2828
|
try {
|
|
2696
|
-
let e = localStorage.getItem(
|
|
2697
|
-
(e === "kz" || e === "ru" || e === "en") && (this._sttLanguageMode = e);
|
|
2829
|
+
let e = localStorage.getItem(gt);
|
|
2830
|
+
(e === "auto" || e === "kz" || e === "ru" || e === "en") && (this._sttLanguageMode = e);
|
|
2698
2831
|
} catch {}
|
|
2699
2832
|
this._checkAuthStatus();
|
|
2700
2833
|
}
|
|
2701
2834
|
_setSttLanguageMode(e) {
|
|
2702
2835
|
this._sttLanguageMode = e;
|
|
2703
2836
|
try {
|
|
2704
|
-
localStorage.setItem(
|
|
2837
|
+
localStorage.setItem(gt, e);
|
|
2705
2838
|
} catch {}
|
|
2706
2839
|
}
|
|
2840
|
+
_uiLang() {
|
|
2841
|
+
return this._sttLanguageMode === "kz" ? "kz" : this._sttLanguageMode === "en" ? "en" : "ru";
|
|
2842
|
+
}
|
|
2843
|
+
_t(e) {
|
|
2844
|
+
return St[this._uiLang()][e] ?? St.ru[e] ?? e;
|
|
2845
|
+
}
|
|
2707
2846
|
async _checkAuthStatus() {
|
|
2708
2847
|
let e = localStorage.getItem("bw_admin_token");
|
|
2709
2848
|
if (e) try {
|
|
@@ -2776,18 +2915,28 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2776
2915
|
disconnectedCallback() {
|
|
2777
2916
|
super.disconnectedCallback(), t.stop(), this._cleanupRecording(), window.removeEventListener("keydown", this._handleGlobalKeydown);
|
|
2778
2917
|
}
|
|
2918
|
+
_announce(e) {
|
|
2919
|
+
if ("speechSynthesis" in window) {
|
|
2920
|
+
let t = new SpeechSynthesisUtterance(e);
|
|
2921
|
+
t.lang = this._uiLang() === "kz" ? "kk-KZ" : this._uiLang() === "en" ? "en-US" : "ru-RU", window.speechSynthesis.speak(t);
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2779
2924
|
_beep(e) {
|
|
2780
|
-
|
|
2781
|
-
|
|
2925
|
+
try {
|
|
2926
|
+
let t = new (window.AudioContext || window.webkitAudioContext)(), n = t.createOscillator(), r = t.createGain();
|
|
2927
|
+
n.type = "sine", n.frequency.setValueAtTime(e, t.currentTime), r.gain.setValueAtTime(.1, t.currentTime), r.gain.exponentialRampToValueAtTime(1e-5, t.currentTime + .1), n.connect(r), r.connect(t.destination), n.start(), n.stop(t.currentTime + .1);
|
|
2928
|
+
} catch {}
|
|
2782
2929
|
}
|
|
2783
2930
|
_toggle() {
|
|
2784
|
-
this._isOpen = !this._isOpen;
|
|
2931
|
+
this._isOpen = !this._isOpen, this._isOpen && (setTimeout(() => this._announce(this._t("announceVoiceInputAvailable")), 500), this._scrollMessages());
|
|
2785
2932
|
}
|
|
2786
2933
|
setOpen(e) {
|
|
2787
|
-
this._isOpen = e;
|
|
2934
|
+
this._isOpen = e, e && (this._announce(this._t("announceWidgetOpened")), this._scrollMessages());
|
|
2788
2935
|
}
|
|
2789
2936
|
_setTab(e) {
|
|
2790
|
-
this._activeTab = e
|
|
2937
|
+
this._activeTab = e, e === "chat" && (this._announce(this._t("announceSwitchedToChat")), this._scrollMessages(), setTimeout(() => {
|
|
2938
|
+
this.renderRoot?.querySelector("#bw-voice-btn")?.focus();
|
|
2939
|
+
}, 300));
|
|
2791
2940
|
}
|
|
2792
2941
|
_handleInput(e) {
|
|
2793
2942
|
this._inputValue = e.target.value;
|
|
@@ -2797,7 +2946,10 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2797
2946
|
}
|
|
2798
2947
|
async _handleSend() {
|
|
2799
2948
|
let e = this._inputValue.trim();
|
|
2800
|
-
!e || this._chat.isLoading || this._sttState !== "idle"
|
|
2949
|
+
if (!e || this._chat.isLoading || this._sttState !== "idle") return;
|
|
2950
|
+
this._inputValue = "";
|
|
2951
|
+
let t = this._chat.sendMessage(e, !1);
|
|
2952
|
+
this._scrollMessages(), await t, this._scrollMessages();
|
|
2801
2953
|
}
|
|
2802
2954
|
_scrollMessages() {
|
|
2803
2955
|
this.updateComplete.then(() => {
|
|
@@ -2808,6 +2960,9 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2808
2960
|
let e = this._a11y.settings;
|
|
2809
2961
|
return e.activeColorTab === "background" ? e.customBgHue || 0 : e.activeColorTab === "header" ? e.customHeaderHue || 0 : e.customContentHue || 0;
|
|
2810
2962
|
}
|
|
2963
|
+
_resetWidgetSettings() {
|
|
2964
|
+
this._a11y.reset(), this._aiA11y.simplifyEnabled && this._aiA11y.toggleSimplify(), this._aiA11y.autoA11yEnabled && this._aiA11y.toggleAutoA11y(), this._setSttLanguageMode("auto"), this.requestUpdate();
|
|
2965
|
+
}
|
|
2811
2966
|
_clearSttTimers() {
|
|
2812
2967
|
this._silenceIntervalId !== null && (window.clearInterval(this._silenceIntervalId), this._silenceIntervalId = null), this._maxDurationTimeoutId !== null && (window.clearTimeout(this._maxDurationTimeoutId), this._maxDurationTimeoutId = null);
|
|
2813
2968
|
}
|
|
@@ -2825,7 +2980,7 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2825
2980
|
}
|
|
2826
2981
|
async _startRecording() {
|
|
2827
2982
|
if (!navigator.mediaDevices?.getUserMedia) {
|
|
2828
|
-
this._sttState = "error", this._sttError = "
|
|
2983
|
+
this._sttState = "error", this._sttError = this._t("errorMicNotSupported");
|
|
2829
2984
|
return;
|
|
2830
2985
|
}
|
|
2831
2986
|
try {
|
|
@@ -2837,7 +2992,7 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2837
2992
|
this._sttState === "recording" && (this._pcmChunks.push(new Float32Array(e.inputBuffer.getChannelData(0))), e.outputBuffer.getChannelData(0).fill(0));
|
|
2838
2993
|
}, this._sttState = "recording", this._beep(880), this._maxDurationTimeoutId = window.setTimeout(() => {
|
|
2839
2994
|
this._sttState === "recording" && this._stopRecording();
|
|
2840
|
-
},
|
|
2995
|
+
}, bt);
|
|
2841
2996
|
let n = new Uint8Array(this._analyser.fftSize);
|
|
2842
2997
|
this._silenceIntervalId = window.setInterval(() => {
|
|
2843
2998
|
if (!this._analyser || this._sttState !== "recording") return;
|
|
@@ -2847,34 +3002,34 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2847
3002
|
let r = (n[t] - 128) / 128;
|
|
2848
3003
|
e += r * r;
|
|
2849
3004
|
}
|
|
2850
|
-
Math.sqrt(e / n.length) <
|
|
2851
|
-
},
|
|
3005
|
+
Math.sqrt(e / n.length) < vt ? this._silenceStartedTs ? Date.now() - this._silenceStartedTs >= yt && this._stopRecording() : this._silenceStartedTs = Date.now() : this._silenceStartedTs = null;
|
|
3006
|
+
}, _t);
|
|
2852
3007
|
} catch {
|
|
2853
|
-
this._sttState = "error", this._sttError = "
|
|
3008
|
+
this._sttState = "error", this._sttError = this._t("errorNoMicAccess"), this._cleanupRecording();
|
|
2854
3009
|
}
|
|
2855
3010
|
}
|
|
2856
3011
|
_stopRecording() {
|
|
2857
3012
|
this._sttState === "recording" && (this._clearSttTimers(), this._sttState = "processing", this._beep(440), this._finalizeRecording().catch((e) => {
|
|
2858
|
-
this._sttState = "error", this._sttError = e?.message || "
|
|
3013
|
+
this._sttState = "error", this._sttError = e?.message || this._t("errorProcessing");
|
|
2859
3014
|
}));
|
|
2860
3015
|
}
|
|
2861
3016
|
async _finalizeRecording() {
|
|
2862
3017
|
let e = Date.now() - this._recordingStartTs, t = this._pcmChunks.reduce((e, t) => e + t.length, 0), n = new Float32Array(t), r = 0;
|
|
2863
3018
|
for (let e of this._pcmChunks) n.set(e, r), r += e.length;
|
|
2864
3019
|
let i = this._encodeWav(n, this._sampleRate);
|
|
2865
|
-
if (this._cleanupRecording(), e <
|
|
2866
|
-
this._sttState = "error", this._sttError = "
|
|
3020
|
+
if (this._cleanupRecording(), e < xt || i.size === 0) {
|
|
3021
|
+
this._sttState = "error", this._sttError = this._t("errorTooShort");
|
|
2867
3022
|
return;
|
|
2868
3023
|
}
|
|
2869
3024
|
try {
|
|
2870
3025
|
let e = (await this._chat.transcribeAudio(i, this._sttLanguageMode)).text?.trim();
|
|
2871
3026
|
if (!e) {
|
|
2872
|
-
this._sttState = "error", this._sttError = "
|
|
3027
|
+
this._sttState = "error", this._sttError = this._t("errorSpeechNotRecognized");
|
|
2873
3028
|
return;
|
|
2874
3029
|
}
|
|
2875
3030
|
await this._chat.sendMessage(e, !0), this._sttState = "idle", this._sttError = "", this._inputValue = "", this._scrollMessages();
|
|
2876
3031
|
} catch (e) {
|
|
2877
|
-
this._sttState = "error", this._sttError = e?.message || "
|
|
3032
|
+
this._sttState = "error", this._sttError = e?.message || this._t("errorRecognition");
|
|
2878
3033
|
}
|
|
2879
3034
|
}
|
|
2880
3035
|
_encodeWav(e, t) {
|
|
@@ -2893,51 +3048,66 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2893
3048
|
"vibrate" in navigator && navigator.vibrate(20);
|
|
2894
3049
|
}
|
|
2895
3050
|
_renderChatTab() {
|
|
2896
|
-
let e =
|
|
2897
|
-
return
|
|
3051
|
+
let e = this._chat.messages, t = this._chat.isLoading, n = this._chat.pendingConfirmation, r = t || this._sttState === "processing", i = (e) => this._t(e);
|
|
3052
|
+
return I`
|
|
2898
3053
|
<div class="chat-messages" id="bw-chat-messages">
|
|
2899
|
-
${this._currentScreenLabel ?
|
|
3054
|
+
${this._currentScreenLabel ? I`
|
|
2900
3055
|
<div class="screen-label-badge">
|
|
2901
3056
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" width="12" height="12"><polyline points="20 6 9 17 4 12"/></svg>
|
|
2902
|
-
${
|
|
3057
|
+
${i("screenLabelPrefix")} <strong>${this._currentScreenLabel}</strong>
|
|
2903
3058
|
</div>
|
|
2904
3059
|
` : ""}
|
|
2905
3060
|
|
|
2906
|
-
${
|
|
3061
|
+
${e.length === 0 ? I`
|
|
2907
3062
|
<div class="chat-empty">
|
|
2908
|
-
${
|
|
2909
|
-
<p class="chat-empty-title">${
|
|
2910
|
-
<p class="chat-empty-sub">${
|
|
3063
|
+
${Y.accessibility}
|
|
3064
|
+
<p class="chat-empty-title">${i("chatEmptyTitle")}</p>
|
|
3065
|
+
<p class="chat-empty-sub">${i("chatEmptySub")}</p>
|
|
2911
3066
|
</div>
|
|
2912
|
-
` :
|
|
3067
|
+
` : e.map((e) => {
|
|
3068
|
+
if (e.role === "assistant" && (e.text.includes("✅") || e.text.includes("⌨️") || e.text.includes("🔄"))) {
|
|
3069
|
+
let t = e.text.split("\n")[0];
|
|
3070
|
+
return I`
|
|
2913
3071
|
<details class="system-log">
|
|
2914
|
-
<summary class="system-log-header"
|
|
3072
|
+
<summary class="system-log-header">
|
|
3073
|
+
${Y.code} <span>${t}</span>
|
|
3074
|
+
</summary>
|
|
2915
3075
|
<div class="system-log-details">${e.text}</div>
|
|
2916
|
-
</details
|
|
3076
|
+
</details>
|
|
3077
|
+
`;
|
|
3078
|
+
}
|
|
3079
|
+
return I`
|
|
3080
|
+
<div class="chat-bubble ${e.role}">
|
|
3081
|
+
${e.text}
|
|
3082
|
+
</div>
|
|
3083
|
+
`;
|
|
3084
|
+
})}
|
|
2917
3085
|
|
|
2918
|
-
${
|
|
3086
|
+
${t ? I`
|
|
2919
3087
|
<div class="typing-indicator">
|
|
2920
|
-
<div class="typing-dot"></div
|
|
2921
|
-
|
|
3088
|
+
<div class="typing-dot"></div>
|
|
3089
|
+
<div class="typing-dot"></div>
|
|
3090
|
+
<div class="typing-dot"></div>
|
|
3091
|
+
</div>
|
|
3092
|
+
` : ""}
|
|
2922
3093
|
</div>
|
|
2923
3094
|
|
|
2924
|
-
${
|
|
3095
|
+
${n ? I`
|
|
2925
3096
|
<div class="confirm-panel">
|
|
2926
3097
|
<button class="btn-confirm" @click=${() => this._chat.confirmAction()} id="bw-confirm-action">
|
|
2927
|
-
${
|
|
3098
|
+
${i("confirmAction")}
|
|
2928
3099
|
</button>
|
|
2929
3100
|
<button class="btn-cancel" @click=${() => this._chat.cancelAction()} id="bw-cancel-action">
|
|
2930
|
-
${
|
|
3101
|
+
${i("cancel")}
|
|
2931
3102
|
</button>
|
|
2932
3103
|
</div>
|
|
2933
|
-
` :
|
|
3104
|
+
` : I`
|
|
2934
3105
|
<div class="chat-input-area">
|
|
2935
|
-
${this._sttState === "idle" ? "" :
|
|
3106
|
+
${this._sttState === "idle" ? "" : I`
|
|
2936
3107
|
<div class="stt-banner ${this._sttState}">
|
|
2937
|
-
${this._sttState === "recording" ?
|
|
3108
|
+
${this._sttState === "recording" ? `REC: ${i("listening")}` : this._sttState === "processing" ? `... ${i("recognizingSpeech")}` : `! ${this._sttError}`}
|
|
2938
3109
|
</div>`}
|
|
2939
3110
|
<div class="chat-input-row">
|
|
2940
|
-
<!-- 🎙️ Primary Mic Button (Large Target Size) -->
|
|
2941
3111
|
<button class="chat-icon-btn ${this._sttState === "recording" ? "recording" : ""}"
|
|
2942
3112
|
@mouseenter=${this._vibrate}
|
|
2943
3113
|
@focus=${this._vibrate}
|
|
@@ -2949,31 +3119,39 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2949
3119
|
@touchend=${(e) => {
|
|
2950
3120
|
e.preventDefault(), this._stopRecording();
|
|
2951
3121
|
}}
|
|
2952
|
-
@click=${this._toggleVoice}
|
|
2953
|
-
?disabled=${this._sttState === "processing" ||
|
|
2954
|
-
id="bw-voice-btn"
|
|
2955
|
-
aria-label
|
|
2956
|
-
${
|
|
3122
|
+
@click=${this._toggleVoice}
|
|
3123
|
+
?disabled=${this._sttState === "processing" || t}
|
|
3124
|
+
id="bw-voice-btn"
|
|
3125
|
+
aria-label=${i("micAria")}>
|
|
3126
|
+
${Y.mic}
|
|
2957
3127
|
</button>
|
|
2958
3128
|
|
|
2959
3129
|
<input
|
|
2960
3130
|
class="chat-input"
|
|
2961
3131
|
type="text"
|
|
2962
|
-
placeholder
|
|
3132
|
+
placeholder=${i("inputPlaceholder")}
|
|
2963
3133
|
.value=${this._inputValue}
|
|
2964
3134
|
@input=${this._handleInput}
|
|
2965
3135
|
@keydown=${this._handleKeydown}
|
|
2966
|
-
?disabled=${
|
|
3136
|
+
?disabled=${r}
|
|
2967
3137
|
id="bw-chat-input"
|
|
2968
|
-
aria-label
|
|
3138
|
+
aria-label=${i("inputAria")}
|
|
2969
3139
|
/>
|
|
2970
3140
|
|
|
2971
|
-
|
|
3141
|
+
<button class="chat-icon-btn ${this._chat.isTtsEnabled() ? "tts-on" : ""}"
|
|
3142
|
+
@click=${() => {
|
|
3143
|
+
this._chat.setTtsEnabled(!this._chat.isTtsEnabled()), this.requestUpdate();
|
|
3144
|
+
}}
|
|
3145
|
+
id="bw-tts-btn"
|
|
3146
|
+
aria-label=${this._chat.isTtsEnabled() ? i("ttsDisableAria") : i("ttsEnableAria")}>
|
|
3147
|
+
${this._chat.isTtsEnabled() ? Y.volumeOn : Y.volumeOff}
|
|
3148
|
+
</button>
|
|
3149
|
+
|
|
2972
3150
|
<button class="chat-send-btn" @click=${this._handleSend}
|
|
2973
|
-
?disabled=${!this._inputValue.trim() ||
|
|
2974
|
-
id="bw-send-btn"
|
|
2975
|
-
aria-label
|
|
2976
|
-
${
|
|
3151
|
+
?disabled=${!this._inputValue.trim() || r}
|
|
3152
|
+
id="bw-send-btn"
|
|
3153
|
+
aria-label=${i("sendAria")}>
|
|
3154
|
+
${Y.send}
|
|
2977
3155
|
</button>
|
|
2978
3156
|
</div>
|
|
2979
3157
|
</div>
|
|
@@ -2981,169 +3159,175 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
2981
3159
|
`;
|
|
2982
3160
|
}
|
|
2983
3161
|
_renderA11yTab() {
|
|
2984
|
-
let e =
|
|
3162
|
+
let e = this._a11y.settings, t = (e) => this._t(e);
|
|
3163
|
+
return I`
|
|
3164
|
+
<div class="a11y-scroller">
|
|
3165
|
+
<div class="settings-grid">
|
|
3166
|
+
${[
|
|
2985
3167
|
{
|
|
2986
3168
|
id: "bw-tile-textscale",
|
|
2987
|
-
icon:
|
|
2988
|
-
label:
|
|
2989
|
-
value: `${Math.round(
|
|
2990
|
-
active:
|
|
3169
|
+
icon: Y.textSize,
|
|
3170
|
+
label: t("tileTextSize"),
|
|
3171
|
+
value: `${Math.round(e.textScale * 100)}%`,
|
|
3172
|
+
active: e.textScale > 1,
|
|
2991
3173
|
action: () => this._a11y.incrementTextScale()
|
|
2992
3174
|
},
|
|
2993
3175
|
{
|
|
2994
3176
|
id: "bw-tile-monochrome",
|
|
2995
|
-
icon:
|
|
2996
|
-
label:
|
|
2997
|
-
value:
|
|
2998
|
-
active:
|
|
3177
|
+
icon: Y.palette,
|
|
3178
|
+
label: t("tileMonochrome"),
|
|
3179
|
+
value: t("valueMonochrome"),
|
|
3180
|
+
active: e.monochrome,
|
|
2999
3181
|
action: () => this._a11y.toggleMonochrome()
|
|
3000
3182
|
},
|
|
3001
3183
|
{
|
|
3002
3184
|
id: "bw-tile-contrast",
|
|
3003
|
-
icon:
|
|
3004
|
-
label:
|
|
3005
|
-
value:
|
|
3006
|
-
active:
|
|
3185
|
+
icon: Y.sun,
|
|
3186
|
+
label: t("tileContrast"),
|
|
3187
|
+
value: t("valueDark"),
|
|
3188
|
+
active: e.darkHighContrast,
|
|
3007
3189
|
action: () => this._a11y.toggleDarkHighContrast()
|
|
3008
3190
|
},
|
|
3009
3191
|
{
|
|
3010
3192
|
id: "bw-tile-links",
|
|
3011
|
-
icon:
|
|
3012
|
-
label:
|
|
3013
|
-
value:
|
|
3014
|
-
active:
|
|
3193
|
+
icon: Y.link,
|
|
3194
|
+
label: t("tileLinks"),
|
|
3195
|
+
value: t("valueHighlight"),
|
|
3196
|
+
active: e.linkHighlight,
|
|
3015
3197
|
action: () => this._a11y.toggleLinkHighlight()
|
|
3016
3198
|
},
|
|
3017
3199
|
{
|
|
3018
3200
|
id: "bw-tile-spacing",
|
|
3019
|
-
icon:
|
|
3020
|
-
label:
|
|
3021
|
-
value:
|
|
3022
|
-
active:
|
|
3201
|
+
icon: Y.type,
|
|
3202
|
+
label: t("tileSpacing"),
|
|
3203
|
+
value: t("valueEnlarge"),
|
|
3204
|
+
active: e.textSpacing,
|
|
3023
3205
|
action: () => this._a11y.toggleTextSpacing()
|
|
3024
3206
|
},
|
|
3025
3207
|
{
|
|
3026
3208
|
id: "bw-tile-font",
|
|
3027
|
-
icon:
|
|
3028
|
-
label:
|
|
3029
|
-
value:
|
|
3030
|
-
active:
|
|
3209
|
+
icon: Y.type,
|
|
3210
|
+
label: t("tileFont"),
|
|
3211
|
+
value: t("valueDyslexia"),
|
|
3212
|
+
active: e.dyslexicFont,
|
|
3031
3213
|
action: () => this._a11y.toggleDyslexicFont()
|
|
3032
3214
|
},
|
|
3033
3215
|
{
|
|
3034
3216
|
id: "bw-tile-cursor",
|
|
3035
|
-
icon:
|
|
3036
|
-
label:
|
|
3037
|
-
value:
|
|
3038
|
-
active:
|
|
3217
|
+
icon: Y.mouse,
|
|
3218
|
+
label: t("tileCursor"),
|
|
3219
|
+
value: t("valueEnlarge"),
|
|
3220
|
+
active: e.cursorMagnifier,
|
|
3039
3221
|
action: () => this._a11y.toggleCursorMagnifier()
|
|
3040
3222
|
},
|
|
3041
3223
|
{
|
|
3042
3224
|
id: "bw-tile-voice",
|
|
3043
3225
|
icon: null,
|
|
3044
|
-
label:
|
|
3045
|
-
value: this._sttState === "recording" ?
|
|
3226
|
+
label: t("tileVoice"),
|
|
3227
|
+
value: this._sttState === "recording" ? t("valueRecording") : t("valuePress"),
|
|
3046
3228
|
active: this._sttState === "recording",
|
|
3047
3229
|
action: () => this._toggleVoice()
|
|
3048
3230
|
}
|
|
3049
|
-
]
|
|
3050
|
-
return F`
|
|
3051
|
-
<div class="a11y-scroller">
|
|
3052
|
-
|
|
3053
|
-
<!-- Language config mapped to TOP of settings tab -->
|
|
3054
|
-
<div style="padding: 16px 16px 0;">
|
|
3055
|
-
<div style="display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--bw-bg-subtle, #f8fafc); border-radius: var(--bw-radius, 14px); margin-bottom: 0px;">
|
|
3056
|
-
<div style="display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--bw-fg, #1e293b);">
|
|
3057
|
-
${J.languages} ${e.langLabel}
|
|
3058
|
-
</div>
|
|
3059
|
-
<select style="height: 34px; padding: 0 8px; border: 1px solid var(--bw-primary, #6d28d9); border-radius: 8px; background: rgba(109, 40, 217, 0.05); color: var(--bw-primary, #6d28d9); cursor: pointer; outline: none; font-size: 13px; font-weight: 600;"
|
|
3060
|
-
.value=${this._sttLanguageMode}
|
|
3061
|
-
@change=${(e) => {
|
|
3062
|
-
this._setSttLanguageMode(e.target.value), this.requestUpdate();
|
|
3063
|
-
}}
|
|
3064
|
-
aria-label="${e.langLabel}">
|
|
3065
|
-
<option value="kz">${Q.kz.langKz}</option>
|
|
3066
|
-
<option value="ru">${Q.ru.langRu}</option>
|
|
3067
|
-
<option value="en">${Q.en.langEn}</option>
|
|
3068
|
-
</select>
|
|
3069
|
-
</div>
|
|
3070
|
-
</div>
|
|
3071
|
-
|
|
3072
|
-
<div class="settings-grid">
|
|
3073
|
-
${n.map((e) => F`
|
|
3231
|
+
].map((e) => I`
|
|
3074
3232
|
<button class="settings-card" ?active=${e.active} @click=${e.action} id=${e.id}
|
|
3075
3233
|
aria-pressed=${e.active ? "true" : "false"} aria-label=${e.label}>
|
|
3076
|
-
${e.icon ||
|
|
3234
|
+
${e.icon || Y.mic}
|
|
3077
3235
|
<span class="settings-card-label">${e.label}</span>
|
|
3078
3236
|
<span class="settings-card-value">${e.value}</span>
|
|
3079
|
-
${e.active ?
|
|
3237
|
+
${e.active ? I`<span class="active-badge">${Y.check}</span>` : ""}
|
|
3080
3238
|
</button>
|
|
3081
3239
|
`)}
|
|
3082
3240
|
</div>
|
|
3083
3241
|
|
|
3084
3242
|
<div class="color-section">
|
|
3085
3243
|
<div class="color-section-header">
|
|
3086
|
-
${
|
|
3087
|
-
<h4 class="color-section-title">${
|
|
3244
|
+
${Y.droplet}
|
|
3245
|
+
<h4 class="color-section-title">${t("colorSetup")}</h4>
|
|
3088
3246
|
</div>
|
|
3089
3247
|
<div class="color-tabs">
|
|
3090
|
-
<button class="color-tab" ?active=${
|
|
3248
|
+
<button class="color-tab" ?active=${e.activeColorTab === "background"}
|
|
3091
3249
|
@click=${() => {
|
|
3092
|
-
|
|
3093
|
-
}}>${
|
|
3094
|
-
<button class="color-tab" ?active=${
|
|
3250
|
+
e.activeColorTab = "background", this.requestUpdate();
|
|
3251
|
+
}}>${t("tabBackground")}</button>
|
|
3252
|
+
<button class="color-tab" ?active=${e.activeColorTab === "header"}
|
|
3095
3253
|
@click=${() => {
|
|
3096
|
-
|
|
3097
|
-
}}>${
|
|
3098
|
-
<button class="color-tab" ?active=${
|
|
3254
|
+
e.activeColorTab = "header", this.requestUpdate();
|
|
3255
|
+
}}>${t("tabHeader")}</button>
|
|
3256
|
+
<button class="color-tab" ?active=${e.activeColorTab === "content"}
|
|
3099
3257
|
@click=${() => {
|
|
3100
|
-
|
|
3101
|
-
}}>${
|
|
3258
|
+
e.activeColorTab = "content", this.requestUpdate();
|
|
3259
|
+
}}>${t("tabText")}</button>
|
|
3102
3260
|
</div>
|
|
3103
3261
|
<div class="hue-row">
|
|
3104
|
-
<button class="hue-step-btn" @click=${() => this._a11y.setCustomHue((this._getCurrentHue() - 15 + 360) % 360)} aria-label
|
|
3262
|
+
<button class="hue-step-btn" @click=${() => this._a11y.setCustomHue((this._getCurrentHue() - 15 + 360) % 360)} aria-label=${t("decrease")}>-</button>
|
|
3105
3263
|
<input type="range" class="hue-slider" min="0" max="360"
|
|
3106
3264
|
.value=${String(this._getCurrentHue())}
|
|
3107
3265
|
@input=${(e) => this._a11y.setCustomHue(parseInt(e.target.value))}
|
|
3108
|
-
aria-label
|
|
3109
|
-
<button class="hue-step-btn" @click=${() => this._a11y.setCustomHue((this._getCurrentHue() + 15) % 360)} aria-label
|
|
3266
|
+
aria-label=${t("hue")} />
|
|
3267
|
+
<button class="hue-step-btn" @click=${() => this._a11y.setCustomHue((this._getCurrentHue() + 15) % 360)} aria-label=${t("increase")}>+</button>
|
|
3110
3268
|
</div>
|
|
3111
3269
|
</div>
|
|
3112
3270
|
|
|
3113
|
-
<div class="ai-tools-section"
|
|
3271
|
+
<div class="ai-tools-section">
|
|
3272
|
+
<div style="display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--bw-bg-subtle, #f8fafc); border-radius: var(--bw-radius, 14px); margin-bottom: 12px;">
|
|
3273
|
+
<div class="lang-row-label" style="display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--bw-fg, #1e293b);">
|
|
3274
|
+
<span class="lang-row-icon">${Y.languages}</span>${t("recognitionLanguage")}
|
|
3275
|
+
</div>
|
|
3276
|
+
<select style="height: 34px; padding: 0 8px; border: 1px solid var(--bw-border); border-radius: 8px; background: #fff; cursor: pointer; outline: none; font-size: 13px;"
|
|
3277
|
+
.value=${this._sttLanguageMode}
|
|
3278
|
+
@change=${(e) => {
|
|
3279
|
+
this._setSttLanguageMode(e.target.value), this.requestUpdate();
|
|
3280
|
+
}}
|
|
3281
|
+
aria-label=${t("changeRecognitionLanguage")}>
|
|
3282
|
+
<option value="auto">${t("languageAuto")}</option>
|
|
3283
|
+
<option value="kz">${t("languageKz")}</option>
|
|
3284
|
+
<option value="ru">${t("languageRu")}</option>
|
|
3285
|
+
<option value="en">${t("languageEn")}</option>
|
|
3286
|
+
</select>
|
|
3287
|
+
</div>
|
|
3288
|
+
|
|
3114
3289
|
<button class="ai-tool-btn ${this._aiA11y.simplifyEnabled ? "active" : ""}"
|
|
3115
3290
|
@click=${() => this._aiA11y.toggleSimplify()} id="bw-ai-simplify">
|
|
3116
|
-
${
|
|
3117
|
-
<span class="ai-tool-btn-label">${
|
|
3291
|
+
${Y.textSize}
|
|
3292
|
+
<span class="ai-tool-btn-label">${t("aiSimplify")}</span>
|
|
3118
3293
|
<span class="ai-tool-badge ${this._aiA11y.simplifyEnabled ? "on" : ""}">
|
|
3119
|
-
${this._aiA11y.simplifyEnabled ?
|
|
3294
|
+
${this._aiA11y.simplifyEnabled ? t("on") : t("off")}
|
|
3120
3295
|
</span>
|
|
3121
3296
|
</button>
|
|
3122
|
-
|
|
3297
|
+
|
|
3123
3298
|
<button class="ai-tool-btn ${this._aiA11y.autoA11yEnabled ? "active" : ""}"
|
|
3124
|
-
@click=${() => this._aiA11y.toggleAutoA11y()}
|
|
3299
|
+
@click=${() => this._aiA11y.toggleAutoA11y()}
|
|
3125
3300
|
id="bw-ai-fix">
|
|
3126
|
-
${
|
|
3127
|
-
<span class="ai-tool-btn-label">${
|
|
3301
|
+
${Y.accessibility}
|
|
3302
|
+
<span class="ai-tool-btn-label">${t("aiBlindMode")}</span>
|
|
3128
3303
|
<span class="ai-tool-badge ${this._aiA11y.autoA11yEnabled ? "on" : ""}">
|
|
3129
|
-
${this._aiA11y.autoA11yEnabled ?
|
|
3304
|
+
${this._aiA11y.autoA11yEnabled ? t("on") : t("off")}
|
|
3130
3305
|
</span>
|
|
3131
3306
|
</button>
|
|
3132
3307
|
</div>
|
|
3308
|
+
|
|
3309
|
+
<div class="settings-actions">
|
|
3310
|
+
<button class="reset-settings-btn" @click=${this._resetWidgetSettings} id="bw-reset-settings-btn">
|
|
3311
|
+
${Y.refresh}
|
|
3312
|
+
${t("resetSettings")}
|
|
3313
|
+
</button>
|
|
3314
|
+
</div>
|
|
3133
3315
|
</div>
|
|
3134
3316
|
`;
|
|
3135
3317
|
}
|
|
3136
3318
|
_renderAdminOverlay() {
|
|
3137
|
-
|
|
3319
|
+
if (!this._showAdminLogin) return "";
|
|
3320
|
+
let e = (e) => this._t(e);
|
|
3321
|
+
return I`
|
|
3138
3322
|
<div class="admin-overlay">
|
|
3139
|
-
<div class="admin-icon"
|
|
3140
|
-
<h4>${this._isAdmin ? "
|
|
3141
|
-
${this._isAdmin ?
|
|
3142
|
-
<p class="admin-status"
|
|
3143
|
-
<button class="admin-logout-btn" @click=${this._handleAdminLogout}
|
|
3144
|
-
` :
|
|
3145
|
-
<p
|
|
3146
|
-
<input type="password" placeholder
|
|
3323
|
+
<div class="admin-icon">${Y.shield}</div>
|
|
3324
|
+
<h4>${this._isAdmin ? e("adminMode") : e("adminAccess")}</h4>
|
|
3325
|
+
${this._isAdmin ? I`
|
|
3326
|
+
<p class="admin-status">${e("adminLoggedIn")}</p>
|
|
3327
|
+
<button class="admin-logout-btn" @click=${this._handleAdminLogout}>${e("adminLogout")}</button>
|
|
3328
|
+
` : I`
|
|
3329
|
+
<p>${e("adminPrompt")}</p>
|
|
3330
|
+
<input type="password" placeholder=${e("adminKeyPlaceholder")}
|
|
3147
3331
|
.value=${this._adminPassword}
|
|
3148
3332
|
@input=${(e) => {
|
|
3149
3333
|
this._adminPassword = e.target.value;
|
|
@@ -3151,54 +3335,50 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
3151
3335
|
@keydown=${(e) => {
|
|
3152
3336
|
e.key === "Enter" && this._handleAdminLogin();
|
|
3153
3337
|
}} />
|
|
3154
|
-
${this._authError ?
|
|
3155
|
-
<button class="admin-login-btn" @click=${this._handleAdminLogin}
|
|
3338
|
+
${this._authError ? I`<div class="auth-error">${this._authError}</div>` : ""}
|
|
3339
|
+
<button class="admin-login-btn" @click=${this._handleAdminLogin}>${e("adminLogin")}</button>
|
|
3156
3340
|
`}
|
|
3157
3341
|
<button class="admin-close-btn" @click=${() => {
|
|
3158
3342
|
this._showAdminLogin = !1, this._authError = "";
|
|
3159
3343
|
}}>
|
|
3160
|
-
|
|
3344
|
+
${e("close")}
|
|
3161
3345
|
</button>
|
|
3162
3346
|
</div>
|
|
3163
|
-
|
|
3347
|
+
`;
|
|
3164
3348
|
}
|
|
3165
3349
|
render() {
|
|
3166
|
-
let e =
|
|
3167
|
-
return
|
|
3350
|
+
let e = (e) => this._t(e);
|
|
3351
|
+
return I`
|
|
3168
3352
|
<div class="widget-container">
|
|
3169
|
-
<!-- Panel -->
|
|
3170
3353
|
<div class="bw-panel ${this._isOpen ? "panel-visible" : "panel-hidden"}"
|
|
3171
|
-
role="dialog" aria-modal="true" aria-label
|
|
3354
|
+
role="dialog" aria-modal="true" aria-label=${e("widgetDialogAria")}>
|
|
3172
3355
|
|
|
3173
|
-
<!-- Header -->
|
|
3174
3356
|
<div class="bw-header">
|
|
3175
3357
|
<div class="header-branding" @click=${this._handleLogoClick} id="bw-logo">
|
|
3176
|
-
${
|
|
3358
|
+
${Y.accessibility}
|
|
3177
3359
|
<div class="header-branding-text">
|
|
3178
3360
|
<span class="header-brand-name">BariWeb</span>
|
|
3179
|
-
<span class="header-brand-sub">${e
|
|
3361
|
+
<span class="header-brand-sub">${e("inclusion")}</span>
|
|
3180
3362
|
</div>
|
|
3181
3363
|
</div>
|
|
3182
|
-
<button class="close-btn" @click=${this._toggle} aria-label
|
|
3183
|
-
${
|
|
3364
|
+
<button class="close-btn" @click=${this._toggle} aria-label=${e("closeWidgetAria")} id="bw-close">
|
|
3365
|
+
${Y.close}
|
|
3184
3366
|
</button>
|
|
3185
3367
|
</div>
|
|
3186
3368
|
|
|
3187
|
-
<!-- Tabs -->
|
|
3188
3369
|
<div class="bw-tabs" role="tablist">
|
|
3189
3370
|
<button class="bw-tab" ?active=${this._activeTab === "chat"}
|
|
3190
3371
|
@click=${() => this._setTab("chat")} role="tab"
|
|
3191
|
-
aria-selected=${this._activeTab === "chat"} id="bw-tab-chat">
|
|
3192
|
-
${
|
|
3372
|
+
aria-selected=${this._activeTab === "chat" ? "true" : "false"} id="bw-tab-chat">
|
|
3373
|
+
${Y.chat} ${e("tabChat")}
|
|
3193
3374
|
</button>
|
|
3194
3375
|
<button class="bw-tab" ?active=${this._activeTab === "a11y"}
|
|
3195
3376
|
@click=${() => this._setTab("a11y")} role="tab"
|
|
3196
|
-
aria-selected=${this._activeTab === "a11y"} id="bw-tab-settings">
|
|
3197
|
-
${
|
|
3377
|
+
aria-selected=${this._activeTab === "a11y" ? "true" : "false"} id="bw-tab-settings">
|
|
3378
|
+
${Y.settings} ${e("tabSettings")}
|
|
3198
3379
|
</button>
|
|
3199
3380
|
</div>
|
|
3200
3381
|
|
|
3201
|
-
<!-- Content -->
|
|
3202
3382
|
<div class="bw-content">
|
|
3203
3383
|
<div class="tab-panel" ?active=${this._activeTab === "chat"} role="tabpanel">
|
|
3204
3384
|
${this._renderChatTab()}
|
|
@@ -3209,29 +3389,27 @@ var _t = "bw-stt-lang-v1", vt = 200, yt = .015, bt = 1200, xt = 2e4, St = 350, Q
|
|
|
3209
3389
|
${this._renderAdminOverlay()}
|
|
3210
3390
|
</div>
|
|
3211
3391
|
|
|
3212
|
-
<!-- Footer -->
|
|
3213
3392
|
<div class="bw-footer" @click=${this._handleLogoClick}>
|
|
3214
3393
|
<div class="footer-brand">
|
|
3215
|
-
${
|
|
3394
|
+
${Y.accessibility} BariWeb
|
|
3216
3395
|
</div>
|
|
3217
|
-
<span>${e
|
|
3396
|
+
<span>${e("madeInKazakhstan")}</span>
|
|
3218
3397
|
</div>
|
|
3219
3398
|
</div>
|
|
3220
3399
|
|
|
3221
|
-
<!-- FAB Trigger -->
|
|
3222
3400
|
<button class="trigger" @click=${this._toggle}
|
|
3223
|
-
aria-expanded=${this._isOpen} aria-label
|
|
3224
|
-
id="bw-trigger" style="position:fixed; bottom:24px; left:24px; width:60px; height:60px; border-radius:50%; background:var(--bw-primary
|
|
3225
|
-
${this._isOpen ?
|
|
3401
|
+
aria-expanded=${this._isOpen} aria-label=${e("triggerAria")}
|
|
3402
|
+
id="bw-trigger" style="position:fixed; bottom:24px; left:24px; width:60px; height:60px; border-radius:50%; background:var(--bw-primary,#6d28d9); color:var(--bw-primary-fg, #05050a); border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; pointer-events:auto; box-shadow:0 4px 20px rgba(0,0,0,0.3); transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;">
|
|
3403
|
+
${this._isOpen ? Y.close : Y.accessibility}
|
|
3226
3404
|
</button>
|
|
3227
3405
|
</div>
|
|
3228
3406
|
`;
|
|
3229
3407
|
}
|
|
3230
3408
|
};
|
|
3231
|
-
|
|
3409
|
+
Q([Qe({
|
|
3232
3410
|
type: String,
|
|
3233
3411
|
attribute: "client-id"
|
|
3234
|
-
})], $.prototype, "clientId", void 0),
|
|
3412
|
+
})], $.prototype, "clientId", void 0), Q([K()], $.prototype, "_isOpen", void 0), Q([K()], $.prototype, "_activeTab", void 0), Q([K()], $.prototype, "_inputValue", void 0), Q([K()], $.prototype, "_isAdmin", void 0), Q([K()], $.prototype, "_adminPassword", void 0), Q([K()], $.prototype, "_authError", void 0), Q([K()], $.prototype, "_currentScreenLabel", void 0), Q([K()], $.prototype, "_sttState", void 0), Q([K()], $.prototype, "_sttLanguageMode", void 0), Q([K()], $.prototype, "_sttError", void 0), Q([K()], $.prototype, "_adminClickCount", void 0), Q([K()], $.prototype, "_showAdminLogin", void 0), Q([et(".chat-messages")], $.prototype, "_messagesEl", void 0), $ = Q([Ye("bw-widget")], $);
|
|
3235
3413
|
//#endregion
|
|
3236
3414
|
//#region src/index.ts
|
|
3237
3415
|
var Ct = () => {
|