@ddict/popup 1.6.5 → 1.6.6
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/popup.css +1 -1
- package/dist/popup.es.js +860 -784
- package/dist/popup.umd.js +10 -10
- package/package.json +7 -3
package/dist/popup.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElementBlock as C, openBlock as h, createElementVNode as f, Fragment as z, renderList as
|
|
1
|
+
import { createElementBlock as C, openBlock as h, createElementVNode as f, Fragment as z, renderList as Q, normalizeClass as P, createTextVNode as Ee, normalizeStyle as Zn, toDisplayString as G, createStaticVNode as Ne, createCommentVNode as R, createBlock as Z, computed as O, unref as k, shallowRef as Un, watch as F, triggerRef as Dt, onScopeDispose as Tt, ref as $, onUnmounted as Fe, inject as le, watchEffect as fe, onMounted as se, cloneVNode as sn, h as Ve, defineComponent as pe, provide as ce, nextTick as Y, toRaw as ne, reactive as an, hasInjectionContext as Wn, getCurrentInstance as rn, markRaw as be, effectScope as un, isRef as $e, isReactive as St, toRef as it, getCurrentScope as cn, toRefs as Rt, mergeModels as qn, useModel as Gn, withCtx as ze, createVNode as N, withModifiers as ft, withDirectives as tt, vModelText as nt, pushScopeId as Et, popScopeId as $t, withKeys as Jn } from "vue";
|
|
2
2
|
const vt = navigator.userAgent.match(
|
|
3
3
|
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i
|
|
4
4
|
), Ze = {
|
|
@@ -59,7 +59,7 @@ const Kn = { class: "dropdown dropdown-end z-50" }, eo = /* @__PURE__ */ f("div"
|
|
|
59
59
|
return (s, r) => (h(), C("div", Kn, [
|
|
60
60
|
eo,
|
|
61
61
|
f("ul", to, [
|
|
62
|
-
(h(), C(z, null,
|
|
62
|
+
(h(), C(z, null, Q(o, (a) => f("li", {
|
|
63
63
|
key: a.value
|
|
64
64
|
}, [
|
|
65
65
|
f("input", {
|
|
@@ -86,7 +86,7 @@ const Kn = { class: "dropdown dropdown-end z-50" }, eo = /* @__PURE__ */ f("div"
|
|
|
86
86
|
])
|
|
87
87
|
]));
|
|
88
88
|
}
|
|
89
|
-
}, ao = { class: "flex justify-between" }, ro = { class: "flex flex-row items-center" }, io = /* @__PURE__ */
|
|
89
|
+
}, ao = { class: "flex justify-between" }, ro = { class: "flex flex-row items-center" }, io = /* @__PURE__ */ Ne('<svg class="w-24 text-primary" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M40.151 8.94498H35.7256V23.055H40.151C44.7473 23.055 47.826 20.0825 47.826 15.9795C47.8267 11.8093 44.7678 8.94498 40.151 8.94498ZM40.1312 21.025H37.993V10.9974H40.1312C43.4217 10.9974 45.4972 12.9846 45.4972 15.9795C45.4965 18.9296 43.4012 21.025 40.1312 21.025Z" fill="currentColor"></path><path d="M54.5158 8.94498H50.0903V23.055H54.5158C59.1121 23.055 62.1908 20.0825 62.1908 15.9795C62.1914 11.8093 59.1351 8.94498 54.5158 8.94498ZM54.496 21.025H52.3578V10.9974H54.496C57.789 10.9974 59.8619 12.9846 59.8619 15.9795C59.8613 18.9296 57.766 21.025 54.496 21.025Z" fill="currentColor"></path><path d="M66.7237 8.94498H64.4575V23.055H66.7237V8.94498Z" fill="currentColor"></path><path d="M76.4301 10.7837C78.29 10.7837 79.7436 11.6603 80.7487 13.2207L82.4589 11.9591C81.2401 9.97057 78.9957 8.70953 76.409 8.70953C72.3898 8.64555 68.9048 11.9591 68.9906 16C68.9048 20.0403 72.3898 23.3544 76.409 23.2905C79.0385 23.2905 81.2618 22.0294 82.4589 20.0409L80.7487 18.7793C79.7436 20.3397 78.29 21.2163 76.4301 21.2163C73.544 21.2163 71.3418 18.993 71.3418 16C71.3418 13.007 73.5433 10.7837 76.4301 10.7837Z" fill="currentColor"></path><path d="M83.3135 8.94498V10.9757H88.0595V23.055H90.3256V10.9757H95.0934V8.94498H83.3135Z" fill="currentColor"></path><path d="M8.66351 4.7121H4.604V15.4427L6.87208 13.3839V6.79143H8.64559C11.4639 6.79143 13.2835 8.47857 13.2835 11.0877C13.2835 13.6916 11.421 15.4427 8.64559 15.4427H4.604V17.5016H8.66351C12.7531 17.5016 15.6098 14.8644 15.6098 11.0877C15.6104 7.27575 12.8196 4.7121 8.66351 4.7121Z" fill="currentColor"></path><path d="M26.2425 9.25528H21.5502L20.7537 14.293L21.4523 14.3308L21.4069 14.7294C21.3916 14.8656 21.3289 15.0448 21.112 15.1734C21.1017 15.9399 21.0845 17.0493 20.9706 18.1766H26.5937V19.8586H21.4677C22.4133 22.9424 24.1254 24.9648 26.5611 25.8669L27.1536 26.0864L26.6795 26.5048C26.4875 26.6737 26.2182 27.0141 26.0896 27.2489L25.9258 27.5438L25.6155 27.4152C23.167 26.4095 21.4223 24.4926 20.2905 21.563C19.3602 24.3365 17.5797 26.2553 14.8592 27.428L14.5438 27.5617L14.3775 27.2642C14.2764 27.08 14.0294 26.7876 13.8151 26.5989L13.3564 26.1951L13.9239 25.9655C16.4555 24.9392 18.064 23.1414 18.8228 20.4837C19.6647 19.8381 20.2099 18.8221 20.2169 17.6801V4.53231C20.2169 2.58349 18.6334 1 16.6846 1H3.53487C1.58349 1 0 2.58349 0 4.53231V17.6795C0 19.6283 1.58349 21.2143 3.53487 21.2143H8.25528V27.2431C8.25528 29.3135 9.93986 31 12.0096 31H26.2431C28.3161 31 29.9974 29.3129 29.9974 27.2431V13.0096C29.9974 10.9392 28.3154 9.25528 26.2425 9.25528ZM3.53487 19.4517C2.55662 19.4517 1.762 18.6603 1.762 17.6788V4.53231C1.762 3.55662 2.55598 2.762 3.53487 2.762H16.6839C17.6571 2.762 18.4517 3.55598 18.4517 4.53231V17.6795C18.4517 17.778 18.444 17.8733 18.4267 17.9667C18.3941 18.1811 18.3231 18.38 18.215 18.5592C17.9149 19.0934 17.3372 19.4517 16.6846 19.4517H3.53487Z" fill="currentColor"></path></svg>', 1), uo = {
|
|
90
90
|
key: 0,
|
|
91
91
|
class: "ml-2 px-1.5 py-0.5 text-[10px] font-medium bg-primary/10 text-primary border border-primary/20 rounded-full"
|
|
92
92
|
}, co = { class: "flex" }, fo = /* @__PURE__ */ f("svg", {
|
|
@@ -176,7 +176,7 @@ const Kn = { class: "dropdown dropdown-end z-50" }, eo = /* @__PURE__ */ f("div"
|
|
|
176
176
|
})
|
|
177
177
|
], -1), Co = [
|
|
178
178
|
bo
|
|
179
|
-
], xo = /* @__PURE__ */
|
|
179
|
+
], xo = /* @__PURE__ */ Ne('<svg class="w-6 h-6 text-primary" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.467 2.47236C2.75841 2.17799 3.23328 2.17559 3.52764 2.467L8.52765 7.41675C8.82201 7.70816 8.82441 8.18303 8.533 8.4774C8.24159 8.77176 7.76672 8.77416 7.47235 8.48275L2.47236 3.533C2.17799 3.24159 2.17559 2.76672 2.467 2.47236Z" fill="currentColor"></path><path d="M8.533 15.4724C8.82441 15.7667 8.82201 16.2416 8.52765 16.533L3.52765 21.4828C3.23328 21.7742 2.75841 21.7718 2.467 21.4774C2.17559 21.183 2.17799 20.7082 2.47236 20.4167L7.47235 15.467C7.76672 15.1756 8.24159 15.178 8.533 15.4724Z" fill="currentColor"></path><path d="M15.52 15.4697C15.8129 15.1768 16.2877 15.1768 16.5806 15.4697L21.5304 20.4194C21.8233 20.7123 21.8233 21.1872 21.5304 21.4801C21.2375 21.773 20.7626 21.773 20.4697 21.4801L15.52 16.5303C15.2271 16.2374 15.2271 15.7626 15.52 15.4697Z" fill="currentColor"></path><path d="M21.4801 2.46967C21.773 2.76256 21.773 3.23744 21.4801 3.53033L16.5303 8.48008C16.2374 8.77297 15.7626 8.77297 15.4697 8.48008C15.1768 8.18719 15.1768 7.71231 15.4697 7.41942L20.4194 2.46967C20.7123 2.17678 21.1872 2.17678 21.4801 2.46967Z" fill="currentColor"></path><path d="M15.75 3C15.75 2.58579 16.0858 2.25 16.5 2.25H21C21.4142 2.25 21.75 2.58579 21.75 3V7.5C21.75 7.91421 21.4142 8.25 21 8.25C20.5858 8.25 20.25 7.91421 20.25 7.5V3.75H16.5C16.0858 3.75 15.75 3.41421 15.75 3Z" fill="currentColor"></path><path d="M21 15.75C21.4142 15.75 21.75 16.0858 21.75 16.5V21C21.75 21.4142 21.4142 21.75 21 21.75H16.5C16.0858 21.75 15.75 21.4142 15.75 21C15.75 20.5858 16.0858 20.25 16.5 20.25H20.25V16.5C20.25 16.0858 20.5858 15.75 21 15.75Z" fill="currentColor"></path><path d="M3 15.75C3.41421 15.75 3.75 16.0858 3.75 16.5V20.25H7.5C7.91421 20.25 8.25 20.5858 8.25 21C8.25 21.4142 7.91421 21.75 7.5 21.75H3C2.58579 21.75 2.25 21.4142 2.25 21V16.5C2.25 16.0858 2.58579 15.75 3 15.75Z" fill="currentColor"></path><path d="M2.25 3C2.25 2.58579 2.58579 2.25 3 2.25H7.5C7.91421 2.25 8.25 2.58579 8.25 3C8.25 3.41421 7.91421 3.75 7.5 3.75H3.75V7.5C3.75 7.91421 3.41421 8.25 3 8.25C2.58579 8.25 2.25 7.91421 2.25 7.5V3Z" fill="currentColor"></path></svg>', 1), yo = [
|
|
180
180
|
xo
|
|
181
181
|
], wo = {
|
|
182
182
|
__name: "Header",
|
|
@@ -213,7 +213,7 @@ const Kn = { class: "dropdown dropdown-end z-50" }, eo = /* @__PURE__ */ f("div"
|
|
|
213
213
|
e.isPremium ? (h(), C("span", uo, "Premium")) : R("", !0)
|
|
214
214
|
]),
|
|
215
215
|
f("div", co, [
|
|
216
|
-
e.headerSettings.showThemeSelector ? (h(),
|
|
216
|
+
e.headerSettings.showThemeSelector ? (h(), Z(so, {
|
|
217
217
|
key: 0,
|
|
218
218
|
"current-theme": e.currentTheme,
|
|
219
219
|
onThemeChange: o
|
|
@@ -256,24 +256,24 @@ function Ie(e, n, t) {
|
|
|
256
256
|
let u;
|
|
257
257
|
t.key && ((s = t.debug) != null && s.call(t)) && (u = Date.now());
|
|
258
258
|
const c = e();
|
|
259
|
-
if (!(c.length !== o.length || c.some((
|
|
259
|
+
if (!(c.length !== o.length || c.some((g, x) => o[x] !== g)))
|
|
260
260
|
return l;
|
|
261
261
|
o = c;
|
|
262
|
-
let
|
|
263
|
-
if (t.key && ((r = t.debug) != null && r.call(t)) && (
|
|
264
|
-
const
|
|
265
|
-
for (
|
|
266
|
-
|
|
267
|
-
return
|
|
262
|
+
let T;
|
|
263
|
+
if (t.key && ((r = t.debug) != null && r.call(t)) && (T = Date.now()), l = n(...c), t.key && ((a = t.debug) != null && a.call(t))) {
|
|
264
|
+
const g = Math.round((Date.now() - u) * 100) / 100, x = Math.round((Date.now() - T) * 100) / 100, b = x / 16, A = (V, I) => {
|
|
265
|
+
for (V = String(V); V.length < I; )
|
|
266
|
+
V = " " + V;
|
|
267
|
+
return V;
|
|
268
268
|
};
|
|
269
269
|
console.info(
|
|
270
|
-
`%c⏱ ${
|
|
270
|
+
`%c⏱ ${A(x, 5)} /${A(g, 5)} ms`,
|
|
271
271
|
`
|
|
272
272
|
font-size: .6rem;
|
|
273
273
|
font-weight: bold;
|
|
274
274
|
color: hsl(${Math.max(
|
|
275
275
|
0,
|
|
276
|
-
Math.min(120 - 120 *
|
|
276
|
+
Math.min(120 - 120 * b, 120)
|
|
277
277
|
)}deg 100% 31%);`,
|
|
278
278
|
t == null ? void 0 : t.key
|
|
279
279
|
);
|
|
@@ -497,27 +497,27 @@ class Mo {
|
|
|
497
497
|
this.pendingMeasuredCacheIndexes = [];
|
|
498
498
|
const c = this.measurementsCache.slice(0, u);
|
|
499
499
|
for (let d = u; d < t; d++) {
|
|
500
|
-
let
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
if (!
|
|
504
|
-
|
|
500
|
+
let T = (i = this.measurementsCache[d]) == null ? void 0 : i.measureElement;
|
|
501
|
+
T || (T = (E) => {
|
|
502
|
+
const y = s(d), w = this.elementsCache.get(y);
|
|
503
|
+
if (!E) {
|
|
504
|
+
w && (this.observer.unobserve(w), this.elementsCache.delete(y));
|
|
505
505
|
return;
|
|
506
506
|
}
|
|
507
|
-
|
|
507
|
+
w !== E && (w && this.observer.unobserve(w), this.observer.observe(E), this.elementsCache.set(y, E)), E.isConnected && this.resizeItem(
|
|
508
508
|
d,
|
|
509
|
-
this.options.measureElement(
|
|
509
|
+
this.options.measureElement(E, void 0, this)
|
|
510
510
|
);
|
|
511
511
|
});
|
|
512
|
-
const
|
|
512
|
+
const g = s(d), x = this.options.lanes === 1 ? c[d - 1] : this.getFurthestMeasurement(c, d), b = x ? x.end + this.options.gap : o + l, A = a.get(g), V = typeof A == "number" ? A : this.options.estimateSize(d), I = b + V, _ = x ? x.lane : d % this.options.lanes;
|
|
513
513
|
c[d] = {
|
|
514
514
|
index: d,
|
|
515
|
-
start:
|
|
516
|
-
size:
|
|
517
|
-
end:
|
|
518
|
-
key:
|
|
519
|
-
lane:
|
|
520
|
-
measureElement:
|
|
515
|
+
start: b,
|
|
516
|
+
size: V,
|
|
517
|
+
end: I,
|
|
518
|
+
key: g,
|
|
519
|
+
lane: _,
|
|
520
|
+
measureElement: T
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
523
|
return this.measurementsCache = c, c;
|
|
@@ -728,7 +728,7 @@ function Vo(e) {
|
|
|
728
728
|
}
|
|
729
729
|
function Do(e) {
|
|
730
730
|
return Vo(
|
|
731
|
-
|
|
731
|
+
O(() => ({
|
|
732
732
|
observeElementRect: $o,
|
|
733
733
|
observeElementOffset: Lo,
|
|
734
734
|
scrollToFn: ko,
|
|
@@ -737,8 +737,8 @@ function Do(e) {
|
|
|
737
737
|
);
|
|
738
738
|
}
|
|
739
739
|
function Ro(e, n, t) {
|
|
740
|
-
let o = $(t == null ? void 0 : t.value), l =
|
|
741
|
-
return [
|
|
740
|
+
let o = $(t == null ? void 0 : t.value), l = O(() => e.value !== void 0);
|
|
741
|
+
return [O(() => l.value ? e.value : o.value), function(s) {
|
|
742
742
|
return l.value || (o.value = s), n == null ? void 0 : n(s);
|
|
743
743
|
}];
|
|
744
744
|
}
|
|
@@ -785,12 +785,12 @@ function Qe() {
|
|
|
785
785
|
} };
|
|
786
786
|
return n;
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function Bo() {
|
|
789
789
|
let e = Qe();
|
|
790
790
|
return Fe(() => e.dispose()), e;
|
|
791
791
|
}
|
|
792
|
-
function
|
|
793
|
-
let e =
|
|
792
|
+
function No() {
|
|
793
|
+
let e = Bo();
|
|
794
794
|
return (n) => {
|
|
795
795
|
e.dispose(), e.nextFrame(n);
|
|
796
796
|
};
|
|
@@ -799,7 +799,7 @@ let Fo = Symbol("headlessui.useid"), jo = 0;
|
|
|
799
799
|
function je() {
|
|
800
800
|
return le(Fo, () => `${++jo}`)();
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function B(e) {
|
|
803
803
|
var n;
|
|
804
804
|
if (e == null || e.value == null) return null;
|
|
805
805
|
let t = (n = e.value.$el) != null ? n : e.value;
|
|
@@ -813,10 +813,10 @@ function ue(e, n, ...t) {
|
|
|
813
813
|
let o = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map((l) => `"${l}"`).join(", ")}.`);
|
|
814
814
|
throw Error.captureStackTrace && Error.captureStackTrace(o, ue), o;
|
|
815
815
|
}
|
|
816
|
-
var Ho = Object.defineProperty, zo = (e, n, t) => n in e ? Ho(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t,
|
|
816
|
+
var Ho = Object.defineProperty, zo = (e, n, t) => n in e ? Ho(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, Bt = (e, n, t) => (zo(e, typeof n != "symbol" ? n + "" : n, t), t);
|
|
817
817
|
let Zo = class {
|
|
818
818
|
constructor() {
|
|
819
|
-
|
|
819
|
+
Bt(this, "current", this.detect()), Bt(this, "currentId", 0);
|
|
820
820
|
}
|
|
821
821
|
set(n) {
|
|
822
822
|
this.current !== n && (this.currentId = 0, this.current = n);
|
|
@@ -841,21 +841,21 @@ function Lt(e) {
|
|
|
841
841
|
if (Ot.isServer) return null;
|
|
842
842
|
if (e instanceof Node) return e.ownerDocument;
|
|
843
843
|
if (e != null && e.hasOwnProperty("value")) {
|
|
844
|
-
let n =
|
|
844
|
+
let n = B(e);
|
|
845
845
|
if (n) return n.ownerDocument;
|
|
846
846
|
}
|
|
847
847
|
return document;
|
|
848
848
|
}
|
|
849
|
-
let
|
|
849
|
+
let Nt = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
850
850
|
var Uo = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(Uo || {}), Wo = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(Wo || {}), qo = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(qo || {}), fn = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(fn || {});
|
|
851
851
|
function Go(e, n = 0) {
|
|
852
852
|
var t;
|
|
853
853
|
return e === ((t = Lt(e)) == null ? void 0 : t.body) ? !1 : ue(n, { 0() {
|
|
854
|
-
return e.matches(
|
|
854
|
+
return e.matches(Nt);
|
|
855
855
|
}, 1() {
|
|
856
856
|
let o = e;
|
|
857
857
|
for (; o !== null; ) {
|
|
858
|
-
if (o.matches(
|
|
858
|
+
if (o.matches(Nt)) return !0;
|
|
859
859
|
o = o.parentElement;
|
|
860
860
|
}
|
|
861
861
|
return !1;
|
|
@@ -894,7 +894,7 @@ function Ko(e, n, t) {
|
|
|
894
894
|
window.addEventListener(e, n, t), o(() => window.removeEventListener(e, n, t));
|
|
895
895
|
});
|
|
896
896
|
}
|
|
897
|
-
function el(e, n, t =
|
|
897
|
+
function el(e, n, t = O(() => !0)) {
|
|
898
898
|
function o(s, r) {
|
|
899
899
|
if (!t.value || s.defaultPrevented) return;
|
|
900
900
|
let a = r(s);
|
|
@@ -904,7 +904,7 @@ function el(e, n, t = L(() => !0)) {
|
|
|
904
904
|
}(e);
|
|
905
905
|
for (let u of i) {
|
|
906
906
|
if (u === null) continue;
|
|
907
|
-
let c = u instanceof HTMLElement ? u :
|
|
907
|
+
let c = u instanceof HTMLElement ? u : B(u);
|
|
908
908
|
if (c != null && c.contains(a) || s.composed && s.composedPath().includes(c)) return;
|
|
909
909
|
}
|
|
910
910
|
return !Go(a, fn.Loose) && a.tabIndex !== -1 && s.preventDefault(), n(s, a);
|
|
@@ -931,7 +931,7 @@ function tl(e, n) {
|
|
|
931
931
|
t.value = Ft(e.value.type, e.value.as);
|
|
932
932
|
}), fe(() => {
|
|
933
933
|
var o;
|
|
934
|
-
t.value ||
|
|
934
|
+
t.value || B(n) && B(n) instanceof HTMLButtonElement && !((o = B(n)) != null && o.hasAttribute("type")) && (t.value = "button");
|
|
935
935
|
}), t;
|
|
936
936
|
}
|
|
937
937
|
function jt(e) {
|
|
@@ -975,20 +975,20 @@ function ct({ props: e, attrs: n, slots: t, slot: o, name: l }) {
|
|
|
975
975
|
var s, r;
|
|
976
976
|
let { as: a, ...i } = ot(e, ["unmount", "static"]), u = (s = t.default) == null ? void 0 : s.call(t, o), c = {};
|
|
977
977
|
if (o) {
|
|
978
|
-
let d = !1,
|
|
979
|
-
for (let [
|
|
980
|
-
d && (c["data-headlessui-state"] =
|
|
978
|
+
let d = !1, T = [];
|
|
979
|
+
for (let [g, x] of Object.entries(o)) typeof x == "boolean" && (d = !0), x === !0 && T.push(g);
|
|
980
|
+
d && (c["data-headlessui-state"] = T.join(" "));
|
|
981
981
|
}
|
|
982
982
|
if (a === "template") {
|
|
983
983
|
if (u = pn(u ?? []), Object.keys(i).length > 0 || Object.keys(n).length > 0) {
|
|
984
|
-
let [d, ...
|
|
985
|
-
if (!al(d) ||
|
|
986
|
-
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((
|
|
984
|
+
let [d, ...T] = u ?? [];
|
|
985
|
+
if (!al(d) || T.length > 0) throw new Error(['Passing props on "template"!', "", `The current component <${l} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(i).concat(Object.keys(n)).map((b) => b.trim()).filter((b, A, V) => V.indexOf(b) === A).sort((b, A) => b.localeCompare(A)).map((b) => ` - ${b}`).join(`
|
|
986
|
+
`), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((b) => ` - ${b}`).join(`
|
|
987
987
|
`)].join(`
|
|
988
988
|
`));
|
|
989
|
-
let
|
|
990
|
-
for (let
|
|
991
|
-
return
|
|
989
|
+
let g = hn((r = d.props) != null ? r : {}, i, c), x = sn(d, g, !0);
|
|
990
|
+
for (let b in g) b.startsWith("on") && (x.props || (x.props = {}), x.props[b] = g[b]);
|
|
991
|
+
return x;
|
|
992
992
|
}
|
|
993
993
|
return Array.isArray(u) && u.length === 1 ? u[0] : u;
|
|
994
994
|
}
|
|
@@ -1040,7 +1040,7 @@ function il() {
|
|
|
1040
1040
|
function ul(e) {
|
|
1041
1041
|
ce(gn, e);
|
|
1042
1042
|
}
|
|
1043
|
-
var
|
|
1043
|
+
var X = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(X || {}), bn = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(bn || {});
|
|
1044
1044
|
function cl(e) {
|
|
1045
1045
|
function n() {
|
|
1046
1046
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", n));
|
|
@@ -1115,16 +1115,16 @@ function we(e) {
|
|
|
1115
1115
|
return n;
|
|
1116
1116
|
}
|
|
1117
1117
|
let _n = Symbol("VirtualContext"), ml = pe({ name: "VirtualProvider", setup(e, { slots: n }) {
|
|
1118
|
-
let t = we("VirtualProvider"), o =
|
|
1119
|
-
let a =
|
|
1118
|
+
let t = we("VirtualProvider"), o = O(() => {
|
|
1119
|
+
let a = B(t.optionsRef);
|
|
1120
1120
|
if (!a) return { start: 0, end: 0 };
|
|
1121
1121
|
let i = window.getComputedStyle(a);
|
|
1122
1122
|
return { start: parseFloat(i.paddingBlockStart || i.paddingTop), end: parseFloat(i.paddingBlockEnd || i.paddingBottom) };
|
|
1123
|
-
}), l = Do(
|
|
1123
|
+
}), l = Do(O(() => ({ scrollPaddingStart: o.value.start, scrollPaddingEnd: o.value.end, count: t.virtual.value.options.length, estimateSize() {
|
|
1124
1124
|
return 40;
|
|
1125
1125
|
}, getScrollElement() {
|
|
1126
|
-
return
|
|
1127
|
-
}, overscan: 12 }))), s =
|
|
1126
|
+
return B(t.optionsRef);
|
|
1127
|
+
}, overscan: 12 }))), s = O(() => {
|
|
1128
1128
|
var a;
|
|
1129
1129
|
return (a = t.virtual.value) == null ? void 0 : a.options;
|
|
1130
1130
|
}), r = $(0);
|
|
@@ -1137,44 +1137,44 @@ let _n = Symbol("VirtualContext"), ml = pe({ name: "VirtualProvider", setup(e, {
|
|
|
1137
1137
|
}
|
|
1138
1138
|
} }, l.value.getVirtualItems().map((a) => sn(n.default({ option: t.virtual.value.options[a.index], open: t.comboboxState.value === 0 })[0], { key: `${r.value}-${a.index}`, "data-index": a.index, "aria-setsize": t.virtual.value.options.length, "aria-posinset": a.index + 1, style: { position: "absolute", top: 0, left: 0, transform: `translateY(${a.start}px)`, overflowAnchor: "none" } })))];
|
|
1139
1139
|
} }), gl = pe({ name: "Combobox", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], nullable: !0, default: null }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, nullable: { type: Boolean, default: !1 }, multiple: { type: [Boolean], default: !1 }, immediate: { type: [Boolean], default: !1 }, virtual: { type: Object, default: null } }, inheritAttrs: !1, setup(e, { slots: n, attrs: t, emit: o }) {
|
|
1140
|
-
let l = $(1), s = $(null), r = $(null), a = $(null), i = $(null), u = $({ static: !1, hold: !1 }), c = $([]), d = $(null),
|
|
1141
|
-
function
|
|
1142
|
-
let p = d.value !== null ? c.value[d.value] : null,
|
|
1140
|
+
let l = $(1), s = $(null), r = $(null), a = $(null), i = $(null), u = $({ static: !1, hold: !1 }), c = $([]), d = $(null), T = $(2), g = $(!1);
|
|
1141
|
+
function x(v = (p) => p) {
|
|
1142
|
+
let p = d.value !== null ? c.value[d.value] : null, L = v(c.value.slice()), M = L.length > 0 && L[0].dataRef.order.value !== null ? L.sort((H, K) => H.dataRef.order.value - K.dataRef.order.value) : Yo(L, (H) => B(H.dataRef.domRef)), j = p ? M.indexOf(p) : null;
|
|
1143
1143
|
return j === -1 && (j = null), { options: M, activeOptionIndex: j };
|
|
1144
1144
|
}
|
|
1145
|
-
let
|
|
1146
|
-
function
|
|
1147
|
-
return ue(
|
|
1148
|
-
return
|
|
1145
|
+
let b = O(() => e.multiple ? 1 : 0), A = O(() => e.nullable), [V, I] = Ro(O(() => e.modelValue), (v) => o("update:modelValue", v), O(() => e.defaultValue)), _ = O(() => V.value === void 0 ? ue(b.value, { 1: [], 0: void 0 }) : V.value), E = null, y = null;
|
|
1146
|
+
function w(v) {
|
|
1147
|
+
return ue(b.value, { 0() {
|
|
1148
|
+
return I == null ? void 0 : I(v);
|
|
1149
1149
|
}, 1: () => {
|
|
1150
|
-
let p = ne(
|
|
1151
|
-
return M === -1 ? p.push(
|
|
1150
|
+
let p = ne(S.value.value).slice(), L = ne(v), M = p.findIndex((j) => S.compare(L, ne(j)));
|
|
1151
|
+
return M === -1 ? p.push(L) : p.splice(M, 1), I == null ? void 0 : I(p);
|
|
1152
1152
|
} });
|
|
1153
1153
|
}
|
|
1154
|
-
let
|
|
1154
|
+
let m = O(() => {
|
|
1155
1155
|
});
|
|
1156
|
-
F([
|
|
1157
|
-
if (
|
|
1158
|
-
let
|
|
1159
|
-
|
|
1156
|
+
F([m], ([v], [p]) => {
|
|
1157
|
+
if (S.virtual.value && v && p && d.value !== null) {
|
|
1158
|
+
let L = v.indexOf(p[d.value]);
|
|
1159
|
+
L !== -1 ? d.value = L : d.value = null;
|
|
1160
1160
|
}
|
|
1161
1161
|
});
|
|
1162
|
-
let
|
|
1162
|
+
let S = { comboboxState: l, value: _, mode: b, compare(v, p) {
|
|
1163
1163
|
if (typeof e.by == "string") {
|
|
1164
|
-
let
|
|
1165
|
-
return (v == null ? void 0 : v[
|
|
1164
|
+
let L = e.by;
|
|
1165
|
+
return (v == null ? void 0 : v[L]) === (p == null ? void 0 : p[L]);
|
|
1166
1166
|
}
|
|
1167
1167
|
return e.by === null ? fl(v, p) : e.by(v, p);
|
|
1168
1168
|
}, calculateIndex(v) {
|
|
1169
|
-
return
|
|
1170
|
-
}, defaultValue:
|
|
1171
|
-
|
|
1172
|
-
}, activeOptionIndex:
|
|
1173
|
-
if (
|
|
1174
|
-
if (
|
|
1175
|
-
let p =
|
|
1169
|
+
return S.virtual.value ? e.by === null ? S.virtual.value.options.indexOf(v) : S.virtual.value.options.findIndex((p) => S.compare(p, v)) : c.value.findIndex((p) => S.compare(p.dataRef.value, v));
|
|
1170
|
+
}, defaultValue: O(() => e.defaultValue), nullable: A, immediate: O(() => !1), virtual: O(() => null), inputRef: r, labelRef: s, buttonRef: a, optionsRef: i, disabled: O(() => e.disabled), options: c, change(v) {
|
|
1171
|
+
I(v);
|
|
1172
|
+
}, activeOptionIndex: O(() => {
|
|
1173
|
+
if (g.value && d.value === null && (S.virtual.value ? S.virtual.value.options.length > 0 : c.value.length > 0)) {
|
|
1174
|
+
if (S.virtual.value) {
|
|
1175
|
+
let p = S.virtual.value.options.findIndex((L) => {
|
|
1176
1176
|
var M;
|
|
1177
|
-
return !((M =
|
|
1177
|
+
return !((M = S.virtual.value) != null && M.disabled(L));
|
|
1178
1178
|
});
|
|
1179
1179
|
if (p !== -1) return p;
|
|
1180
1180
|
}
|
|
@@ -1182,102 +1182,102 @@ let _n = Symbol("VirtualContext"), ml = pe({ name: "VirtualProvider", setup(e, {
|
|
|
1182
1182
|
if (v !== -1) return v;
|
|
1183
1183
|
}
|
|
1184
1184
|
return d.value;
|
|
1185
|
-
}), activationTrigger:
|
|
1186
|
-
|
|
1185
|
+
}), activationTrigger: T, optionsPropsRef: u, closeCombobox() {
|
|
1186
|
+
g.value = !1, !e.disabled && l.value !== 1 && (l.value = 1, d.value = null);
|
|
1187
1187
|
}, openCombobox() {
|
|
1188
|
-
if (
|
|
1189
|
-
if (
|
|
1190
|
-
let v =
|
|
1188
|
+
if (g.value = !0, !e.disabled && l.value !== 0) {
|
|
1189
|
+
if (S.value.value) {
|
|
1190
|
+
let v = S.calculateIndex(S.value.value);
|
|
1191
1191
|
v !== -1 && (d.value = v);
|
|
1192
1192
|
}
|
|
1193
1193
|
l.value = 0;
|
|
1194
1194
|
}
|
|
1195
1195
|
}, setActivationTrigger(v) {
|
|
1196
|
-
|
|
1197
|
-
}, goToOption(v, p,
|
|
1198
|
-
|
|
1196
|
+
T.value = v;
|
|
1197
|
+
}, goToOption(v, p, L) {
|
|
1198
|
+
g.value = !1, E !== null && cancelAnimationFrame(E), E = requestAnimationFrame(() => {
|
|
1199
1199
|
if (e.disabled || i.value && !u.value.static && l.value === 1) return;
|
|
1200
|
-
if (
|
|
1201
|
-
d.value = v === q.Specific ? p : Ht({ focus: v }, { resolveItems: () =>
|
|
1200
|
+
if (S.virtual.value) {
|
|
1201
|
+
d.value = v === q.Specific ? p : Ht({ focus: v }, { resolveItems: () => S.virtual.value.options, resolveActiveIndex: () => {
|
|
1202
1202
|
var H, K;
|
|
1203
|
-
return (K = (H =
|
|
1204
|
-
var
|
|
1205
|
-
return !((
|
|
1203
|
+
return (K = (H = S.activeOptionIndex.value) != null ? H : S.virtual.value.options.findIndex((ee) => {
|
|
1204
|
+
var U;
|
|
1205
|
+
return !((U = S.virtual.value) != null && U.disabled(ee));
|
|
1206
1206
|
})) != null ? K : null;
|
|
1207
|
-
}, resolveDisabled: (H) =>
|
|
1207
|
+
}, resolveDisabled: (H) => S.virtual.value.disabled(H), resolveId() {
|
|
1208
1208
|
throw new Error("Function not implemented.");
|
|
1209
|
-
} }),
|
|
1209
|
+
} }), T.value = L ?? 2;
|
|
1210
1210
|
return;
|
|
1211
1211
|
}
|
|
1212
|
-
let M =
|
|
1212
|
+
let M = x();
|
|
1213
1213
|
if (M.activeOptionIndex === null) {
|
|
1214
1214
|
let H = M.options.findIndex((K) => !K.dataRef.disabled);
|
|
1215
1215
|
H !== -1 && (M.activeOptionIndex = H);
|
|
1216
1216
|
}
|
|
1217
1217
|
let j = v === q.Specific ? p : Ht({ focus: v }, { resolveItems: () => M.options, resolveActiveIndex: () => M.activeOptionIndex, resolveId: (H) => H.id, resolveDisabled: (H) => H.dataRef.disabled });
|
|
1218
|
-
d.value = j,
|
|
1218
|
+
d.value = j, T.value = L ?? 2, c.value = M.options;
|
|
1219
1219
|
});
|
|
1220
1220
|
}, selectOption(v) {
|
|
1221
1221
|
let p = c.value.find((M) => M.id === v);
|
|
1222
1222
|
if (!p) return;
|
|
1223
|
-
let { dataRef:
|
|
1224
|
-
|
|
1223
|
+
let { dataRef: L } = p;
|
|
1224
|
+
w(L.value);
|
|
1225
1225
|
}, selectActiveOption() {
|
|
1226
|
-
if (
|
|
1227
|
-
if (
|
|
1226
|
+
if (S.activeOptionIndex.value !== null) {
|
|
1227
|
+
if (S.virtual.value) w(S.virtual.value.options[S.activeOptionIndex.value]);
|
|
1228
1228
|
else {
|
|
1229
|
-
let { dataRef: v } = c.value[
|
|
1230
|
-
|
|
1229
|
+
let { dataRef: v } = c.value[S.activeOptionIndex.value];
|
|
1230
|
+
w(v.value);
|
|
1231
1231
|
}
|
|
1232
|
-
|
|
1232
|
+
S.goToOption(q.Specific, S.activeOptionIndex.value);
|
|
1233
1233
|
}
|
|
1234
1234
|
}, registerOption(v, p) {
|
|
1235
|
-
let
|
|
1236
|
-
if (
|
|
1237
|
-
c.value.push(
|
|
1235
|
+
let L = an({ id: v, dataRef: p });
|
|
1236
|
+
if (S.virtual.value) {
|
|
1237
|
+
c.value.push(L);
|
|
1238
1238
|
return;
|
|
1239
1239
|
}
|
|
1240
|
-
|
|
1241
|
-
let M =
|
|
1242
|
-
d.value === null &&
|
|
1243
|
-
let j =
|
|
1240
|
+
y && cancelAnimationFrame(y);
|
|
1241
|
+
let M = x((j) => (j.push(L), j));
|
|
1242
|
+
d.value === null && S.isSelected(p.value.value) && (M.activeOptionIndex = M.options.indexOf(L)), c.value = M.options, d.value = M.activeOptionIndex, T.value = 2, M.options.some((j) => !B(j.dataRef.domRef)) && (y = requestAnimationFrame(() => {
|
|
1243
|
+
let j = x();
|
|
1244
1244
|
c.value = j.options, d.value = j.activeOptionIndex;
|
|
1245
1245
|
}));
|
|
1246
1246
|
}, unregisterOption(v, p) {
|
|
1247
|
-
if (
|
|
1247
|
+
if (E !== null && cancelAnimationFrame(E), p && (g.value = !0), S.virtual.value) {
|
|
1248
1248
|
c.value = c.value.filter((M) => M.id !== v);
|
|
1249
1249
|
return;
|
|
1250
1250
|
}
|
|
1251
|
-
let
|
|
1251
|
+
let L = x((M) => {
|
|
1252
1252
|
let j = M.findIndex((H) => H.id === v);
|
|
1253
1253
|
return j !== -1 && M.splice(j, 1), M;
|
|
1254
1254
|
});
|
|
1255
|
-
c.value =
|
|
1255
|
+
c.value = L.options, d.value = L.activeOptionIndex, T.value = 2;
|
|
1256
1256
|
}, isSelected(v) {
|
|
1257
|
-
return ue(
|
|
1257
|
+
return ue(b.value, { 0: () => S.compare(ne(S.value.value), ne(v)), 1: () => ne(S.value.value).some((p) => S.compare(ne(p), ne(v))) });
|
|
1258
1258
|
}, isActive(v) {
|
|
1259
|
-
return d.value ===
|
|
1259
|
+
return d.value === S.calculateIndex(v);
|
|
1260
1260
|
} };
|
|
1261
|
-
el([r, a, i], () =>
|
|
1262
|
-
let
|
|
1261
|
+
el([r, a, i], () => S.closeCombobox(), O(() => l.value === 0)), ce(wn, S), ul(O(() => ue(l.value, { 0: Re.Open, 1: Re.Closed })));
|
|
1262
|
+
let D = O(() => {
|
|
1263
1263
|
var v;
|
|
1264
|
-
return (v =
|
|
1264
|
+
return (v = B(r)) == null ? void 0 : v.closest("form");
|
|
1265
1265
|
});
|
|
1266
1266
|
return se(() => {
|
|
1267
|
-
F([
|
|
1268
|
-
if (!
|
|
1267
|
+
F([D], () => {
|
|
1268
|
+
if (!D.value || e.defaultValue === void 0) return;
|
|
1269
1269
|
function v() {
|
|
1270
|
-
|
|
1270
|
+
S.change(e.defaultValue);
|
|
1271
1271
|
}
|
|
1272
|
-
return
|
|
1272
|
+
return D.value.addEventListener("reset", v), () => {
|
|
1273
1273
|
var p;
|
|
1274
|
-
(p =
|
|
1274
|
+
(p = D.value) == null || p.removeEventListener("reset", v);
|
|
1275
1275
|
};
|
|
1276
1276
|
}, { immediate: !0 });
|
|
1277
1277
|
}), () => {
|
|
1278
|
-
var v, p,
|
|
1279
|
-
let { name: M, disabled: j, form: H, ...K } = e, ee = { open: l.value === 0, disabled: j, activeIndex:
|
|
1280
|
-
return Ve(z, [...M != null &&
|
|
1278
|
+
var v, p, L;
|
|
1279
|
+
let { name: M, disabled: j, form: H, ...K } = e, ee = { open: l.value === 0, disabled: j, activeIndex: S.activeOptionIndex.value, activeOption: S.activeOptionIndex.value === null ? null : S.virtual.value ? S.virtual.value.options[(v = S.activeOptionIndex.value) != null ? v : 0] : (L = (p = S.options.value[S.activeOptionIndex.value]) == null ? void 0 : p.dataRef.value) != null ? L : null, value: _.value };
|
|
1280
|
+
return Ve(z, [...M != null && _.value != null ? Cn({ [M]: _.value }).map(([U, zn]) => Ve(rl, sl({ features: mn.Hidden, key: U, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: H, disabled: j, name: U, value: zn }))) : [], ye({ theirProps: { ...t, ...ot(K, ["by", "defaultValue", "immediate", "modelValue", "multiple", "nullable", "onUpdate:modelValue", "virtual"]) }, ourProps: {}, slot: ee, slots: n, attrs: t, name: "Combobox" })]);
|
|
1281
1281
|
};
|
|
1282
1282
|
} });
|
|
1283
1283
|
pe({ name: "ComboboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: null } }, setup(e, { attrs: n, slots: t }) {
|
|
@@ -1285,7 +1285,7 @@ pe({ name: "ComboboxLabel", props: { as: { type: [Object, String], default: "lab
|
|
|
1285
1285
|
let l = (o = e.id) != null ? o : `headlessui-combobox-label-${je()}`, s = we("ComboboxLabel");
|
|
1286
1286
|
function r() {
|
|
1287
1287
|
var a;
|
|
1288
|
-
(a =
|
|
1288
|
+
(a = B(s.inputRef)) == null || a.focus({ preventScroll: !0 });
|
|
1289
1289
|
}
|
|
1290
1290
|
return () => {
|
|
1291
1291
|
let a = { open: s.comboboxState.value === 0, disabled: s.disabled.value }, { ...i } = e, u = { id: l, ref: s.labelRef, onClick: r };
|
|
@@ -1297,149 +1297,149 @@ let bl = pe({ name: "ComboboxButton", props: { as: { type: [Object, String], def
|
|
|
1297
1297
|
let s = (l = e.id) != null ? l : `headlessui-combobox-button-${je()}`, r = we("ComboboxButton");
|
|
1298
1298
|
o({ el: r.buttonRef, $el: r.buttonRef });
|
|
1299
1299
|
function a(c) {
|
|
1300
|
-
r.disabled.value || (r.comboboxState.value === 0 ? r.closeCombobox() : (c.preventDefault(), r.openCombobox()),
|
|
1300
|
+
r.disabled.value || (r.comboboxState.value === 0 ? r.closeCombobox() : (c.preventDefault(), r.openCombobox()), Y(() => {
|
|
1301
1301
|
var d;
|
|
1302
|
-
return (d =
|
|
1302
|
+
return (d = B(r.inputRef)) == null ? void 0 : d.focus({ preventScroll: !0 });
|
|
1303
1303
|
}));
|
|
1304
1304
|
}
|
|
1305
1305
|
function i(c) {
|
|
1306
1306
|
switch (c.key) {
|
|
1307
|
-
case
|
|
1308
|
-
c.preventDefault(), c.stopPropagation(), r.comboboxState.value === 1 && r.openCombobox(),
|
|
1307
|
+
case X.ArrowDown:
|
|
1308
|
+
c.preventDefault(), c.stopPropagation(), r.comboboxState.value === 1 && r.openCombobox(), Y(() => {
|
|
1309
1309
|
var d;
|
|
1310
1310
|
return (d = r.inputRef.value) == null ? void 0 : d.focus({ preventScroll: !0 });
|
|
1311
1311
|
});
|
|
1312
1312
|
return;
|
|
1313
|
-
case
|
|
1314
|
-
c.preventDefault(), c.stopPropagation(), r.comboboxState.value === 1 && (r.openCombobox(),
|
|
1313
|
+
case X.ArrowUp:
|
|
1314
|
+
c.preventDefault(), c.stopPropagation(), r.comboboxState.value === 1 && (r.openCombobox(), Y(() => {
|
|
1315
1315
|
r.value.value || r.goToOption(q.Last);
|
|
1316
|
-
})),
|
|
1316
|
+
})), Y(() => {
|
|
1317
1317
|
var d;
|
|
1318
1318
|
return (d = r.inputRef.value) == null ? void 0 : d.focus({ preventScroll: !0 });
|
|
1319
1319
|
});
|
|
1320
1320
|
return;
|
|
1321
|
-
case
|
|
1321
|
+
case X.Escape:
|
|
1322
1322
|
if (r.comboboxState.value !== 0) return;
|
|
1323
|
-
c.preventDefault(), r.optionsRef.value && !r.optionsPropsRef.value.static && c.stopPropagation(), r.closeCombobox(),
|
|
1323
|
+
c.preventDefault(), r.optionsRef.value && !r.optionsPropsRef.value.static && c.stopPropagation(), r.closeCombobox(), Y(() => {
|
|
1324
1324
|
var d;
|
|
1325
1325
|
return (d = r.inputRef.value) == null ? void 0 : d.focus({ preventScroll: !0 });
|
|
1326
1326
|
});
|
|
1327
1327
|
return;
|
|
1328
1328
|
}
|
|
1329
1329
|
}
|
|
1330
|
-
let u = tl(
|
|
1330
|
+
let u = tl(O(() => ({ as: e.as, type: n.type })), r.buttonRef);
|
|
1331
1331
|
return () => {
|
|
1332
1332
|
var c, d;
|
|
1333
|
-
let
|
|
1334
|
-
return ye({ ourProps:
|
|
1333
|
+
let T = { open: r.comboboxState.value === 0, disabled: r.disabled.value, value: r.value.value }, { ...g } = e, x = { ref: r.buttonRef, id: s, type: u.value, tabindex: "-1", "aria-haspopup": "listbox", "aria-controls": (c = B(r.optionsRef)) == null ? void 0 : c.id, "aria-expanded": r.comboboxState.value === 0, "aria-labelledby": r.labelRef.value ? [(d = B(r.labelRef)) == null ? void 0 : d.id, s].join(" ") : void 0, disabled: r.disabled.value === !0 ? !0 : void 0, onKeydown: i, onClick: a };
|
|
1334
|
+
return ye({ ourProps: x, theirProps: g, slot: T, attrs: n, slots: t, name: "ComboboxButton" });
|
|
1335
1335
|
};
|
|
1336
1336
|
} }), Cl = pe({ name: "ComboboxInput", props: { as: { type: [Object, String], default: "input" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, displayValue: { type: Function }, defaultValue: { type: String, default: void 0 }, id: { type: String, default: null } }, emits: { change: (e) => !0 }, setup(e, { emit: n, attrs: t, slots: o, expose: l }) {
|
|
1337
1337
|
var s;
|
|
1338
|
-
let r = (s = e.id) != null ? s : `headlessui-combobox-input-${je()}`, a = we("ComboboxInput"), i =
|
|
1338
|
+
let r = (s = e.id) != null ? s : `headlessui-combobox-input-${je()}`, a = we("ComboboxInput"), i = O(() => Lt(B(a.inputRef))), u = { value: !1 };
|
|
1339
1339
|
l({ el: a.inputRef, $el: a.inputRef });
|
|
1340
1340
|
function c() {
|
|
1341
1341
|
a.change(null);
|
|
1342
|
-
let
|
|
1343
|
-
|
|
1342
|
+
let y = B(a.optionsRef);
|
|
1343
|
+
y && (y.scrollTop = 0), a.goToOption(q.Nothing);
|
|
1344
1344
|
}
|
|
1345
|
-
let d =
|
|
1346
|
-
var
|
|
1347
|
-
let
|
|
1348
|
-
return
|
|
1345
|
+
let d = O(() => {
|
|
1346
|
+
var y;
|
|
1347
|
+
let w = a.value.value;
|
|
1348
|
+
return B(a.inputRef) ? typeof e.displayValue < "u" && w !== void 0 ? (y = e.displayValue(w)) != null ? y : "" : typeof w == "string" ? w : "" : "";
|
|
1349
1349
|
});
|
|
1350
1350
|
se(() => {
|
|
1351
|
-
F([d, a.comboboxState, i], ([
|
|
1351
|
+
F([d, a.comboboxState, i], ([y, w], [m, S]) => {
|
|
1352
1352
|
if (u.value) return;
|
|
1353
|
-
let
|
|
1354
|
-
|
|
1353
|
+
let D = B(a.inputRef);
|
|
1354
|
+
D && ((S === 0 && w === 1 || y !== m) && (D.value = y), requestAnimationFrame(() => {
|
|
1355
1355
|
var v;
|
|
1356
|
-
if (u.value || !
|
|
1357
|
-
let { selectionStart: p, selectionEnd:
|
|
1358
|
-
Math.abs((
|
|
1356
|
+
if (u.value || !D || ((v = i.value) == null ? void 0 : v.activeElement) !== D) return;
|
|
1357
|
+
let { selectionStart: p, selectionEnd: L } = D;
|
|
1358
|
+
Math.abs((L ?? 0) - (p ?? 0)) === 0 && p === 0 && D.setSelectionRange(D.value.length, D.value.length);
|
|
1359
1359
|
}));
|
|
1360
|
-
}, { immediate: !0 }), F([a.comboboxState], ([
|
|
1361
|
-
if (
|
|
1360
|
+
}, { immediate: !0 }), F([a.comboboxState], ([y], [w]) => {
|
|
1361
|
+
if (y === 0 && w === 1) {
|
|
1362
1362
|
if (u.value) return;
|
|
1363
|
-
let
|
|
1364
|
-
if (!
|
|
1365
|
-
let
|
|
1366
|
-
|
|
1363
|
+
let m = B(a.inputRef);
|
|
1364
|
+
if (!m) return;
|
|
1365
|
+
let S = m.value, { selectionStart: D, selectionEnd: v, selectionDirection: p } = m;
|
|
1366
|
+
m.value = "", m.value = S, p !== null ? m.setSelectionRange(D, v, p) : m.setSelectionRange(D, v);
|
|
1367
1367
|
}
|
|
1368
1368
|
});
|
|
1369
1369
|
});
|
|
1370
|
-
let
|
|
1371
|
-
function
|
|
1372
|
-
|
|
1370
|
+
let T = $(!1);
|
|
1371
|
+
function g() {
|
|
1372
|
+
T.value = !0;
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1374
|
+
function x() {
|
|
1375
1375
|
Qe().nextFrame(() => {
|
|
1376
|
-
|
|
1376
|
+
T.value = !1;
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
1379
|
-
let
|
|
1380
|
-
function
|
|
1381
|
-
switch (u.value = !0,
|
|
1379
|
+
let b = No();
|
|
1380
|
+
function A(y) {
|
|
1381
|
+
switch (u.value = !0, b(() => {
|
|
1382
1382
|
u.value = !1;
|
|
1383
|
-
}),
|
|
1384
|
-
case
|
|
1385
|
-
if (u.value = !1, a.comboboxState.value !== 0 ||
|
|
1386
|
-
if (
|
|
1383
|
+
}), y.key) {
|
|
1384
|
+
case X.Enter:
|
|
1385
|
+
if (u.value = !1, a.comboboxState.value !== 0 || T.value) return;
|
|
1386
|
+
if (y.preventDefault(), y.stopPropagation(), a.activeOptionIndex.value === null) {
|
|
1387
1387
|
a.closeCombobox();
|
|
1388
1388
|
return;
|
|
1389
1389
|
}
|
|
1390
1390
|
a.selectActiveOption(), a.mode.value === 0 && a.closeCombobox();
|
|
1391
1391
|
break;
|
|
1392
|
-
case
|
|
1393
|
-
return u.value = !1,
|
|
1394
|
-
case
|
|
1395
|
-
return u.value = !1,
|
|
1396
|
-
a.openCombobox(),
|
|
1392
|
+
case X.ArrowDown:
|
|
1393
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), ue(a.comboboxState.value, { 0: () => a.goToOption(q.Next), 1: () => a.openCombobox() });
|
|
1394
|
+
case X.ArrowUp:
|
|
1395
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), ue(a.comboboxState.value, { 0: () => a.goToOption(q.Previous), 1: () => {
|
|
1396
|
+
a.openCombobox(), Y(() => {
|
|
1397
1397
|
a.value.value || a.goToOption(q.Last);
|
|
1398
1398
|
});
|
|
1399
1399
|
} });
|
|
1400
|
-
case
|
|
1401
|
-
if (
|
|
1402
|
-
return u.value = !1,
|
|
1403
|
-
case
|
|
1404
|
-
return u.value = !1,
|
|
1405
|
-
case
|
|
1406
|
-
if (
|
|
1407
|
-
return u.value = !1,
|
|
1408
|
-
case
|
|
1409
|
-
return u.value = !1,
|
|
1410
|
-
case
|
|
1400
|
+
case X.Home:
|
|
1401
|
+
if (y.shiftKey) break;
|
|
1402
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), a.goToOption(q.First);
|
|
1403
|
+
case X.PageUp:
|
|
1404
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), a.goToOption(q.First);
|
|
1405
|
+
case X.End:
|
|
1406
|
+
if (y.shiftKey) break;
|
|
1407
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), a.goToOption(q.Last);
|
|
1408
|
+
case X.PageDown:
|
|
1409
|
+
return u.value = !1, y.preventDefault(), y.stopPropagation(), a.goToOption(q.Last);
|
|
1410
|
+
case X.Escape:
|
|
1411
1411
|
if (u.value = !1, a.comboboxState.value !== 0) return;
|
|
1412
|
-
|
|
1412
|
+
y.preventDefault(), a.optionsRef.value && !a.optionsPropsRef.value.static && y.stopPropagation(), a.nullable.value && a.mode.value === 0 && a.value.value === null && c(), a.closeCombobox();
|
|
1413
1413
|
break;
|
|
1414
|
-
case
|
|
1414
|
+
case X.Tab:
|
|
1415
1415
|
if (u.value = !1, a.comboboxState.value !== 0) return;
|
|
1416
1416
|
a.mode.value === 0 && a.activationTrigger.value !== 1 && a.selectActiveOption(), a.closeCombobox();
|
|
1417
1417
|
break;
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1421
|
-
n("change",
|
|
1420
|
+
function V(y) {
|
|
1421
|
+
n("change", y), a.nullable.value && a.mode.value === 0 && y.target.value === "" && c(), a.openCombobox();
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1424
|
-
var
|
|
1425
|
-
let
|
|
1426
|
-
if (u.value = !1, !((
|
|
1423
|
+
function I(y) {
|
|
1424
|
+
var w, m, S;
|
|
1425
|
+
let D = (w = y.relatedTarget) != null ? w : ge.find((v) => v !== y.currentTarget);
|
|
1426
|
+
if (u.value = !1, !((m = B(a.optionsRef)) != null && m.contains(D)) && !((S = B(a.buttonRef)) != null && S.contains(D)) && a.comboboxState.value === 0) return y.preventDefault(), a.mode.value === 0 && (a.nullable.value && a.value.value === null ? c() : a.activationTrigger.value !== 1 && a.selectActiveOption()), a.closeCombobox();
|
|
1427
1427
|
}
|
|
1428
|
-
function
|
|
1429
|
-
var
|
|
1430
|
-
let
|
|
1431
|
-
(
|
|
1428
|
+
function _(y) {
|
|
1429
|
+
var w, m, S;
|
|
1430
|
+
let D = (w = y.relatedTarget) != null ? w : ge.find((v) => v !== y.currentTarget);
|
|
1431
|
+
(m = B(a.buttonRef)) != null && m.contains(D) || (S = B(a.optionsRef)) != null && S.contains(D) || a.disabled.value || a.immediate.value && a.comboboxState.value !== 0 && (a.openCombobox(), Qe().nextFrame(() => {
|
|
1432
1432
|
a.setActivationTrigger(1);
|
|
1433
1433
|
}));
|
|
1434
1434
|
}
|
|
1435
|
-
let
|
|
1436
|
-
var
|
|
1437
|
-
return (
|
|
1435
|
+
let E = O(() => {
|
|
1436
|
+
var y, w, m, S;
|
|
1437
|
+
return (S = (m = (w = e.defaultValue) != null ? w : a.defaultValue.value !== void 0 ? (y = e.displayValue) == null ? void 0 : y.call(e, a.defaultValue.value) : null) != null ? m : a.defaultValue.value) != null ? S : "";
|
|
1438
1438
|
});
|
|
1439
1439
|
return () => {
|
|
1440
|
-
var
|
|
1441
|
-
let
|
|
1442
|
-
return ye({ ourProps: K, theirProps: H, slot:
|
|
1440
|
+
var y, w, m, S, D, v, p;
|
|
1441
|
+
let L = { open: a.comboboxState.value === 0 }, { displayValue: M, onChange: j, ...H } = e, K = { "aria-controls": (y = a.optionsRef.value) == null ? void 0 : y.id, "aria-expanded": a.comboboxState.value === 0, "aria-activedescendant": a.activeOptionIndex.value === null ? void 0 : a.virtual.value ? (w = a.options.value.find((ee) => !a.virtual.value.disabled(ee.dataRef.value) && a.compare(ee.dataRef.value, a.virtual.value.options[a.activeOptionIndex.value]))) == null ? void 0 : w.id : (m = a.options.value[a.activeOptionIndex.value]) == null ? void 0 : m.id, "aria-labelledby": (v = (S = B(a.labelRef)) == null ? void 0 : S.id) != null ? v : (D = B(a.buttonRef)) == null ? void 0 : D.id, "aria-autocomplete": "list", id: r, onCompositionstart: g, onCompositionend: x, onKeydown: A, onInput: V, onFocus: _, onBlur: I, role: "combobox", type: (p = t.type) != null ? p : "text", tabIndex: 0, ref: a.inputRef, defaultValue: E.value, disabled: a.disabled.value === !0 ? !0 : void 0 };
|
|
1442
|
+
return ye({ ourProps: K, theirProps: H, slot: L, attrs: t, slots: o, features: De.RenderStrategy | De.Static, name: "ComboboxInput" });
|
|
1443
1443
|
};
|
|
1444
1444
|
} }), xl = pe({ name: "ComboboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, hold: { type: [Boolean], default: !1 } }, setup(e, { attrs: n, slots: t, expose: o }) {
|
|
1445
1445
|
let l = we("ComboboxOptions"), s = `headlessui-combobox-options-${je()}`;
|
|
@@ -1448,8 +1448,8 @@ let bl = pe({ name: "ComboboxButton", props: { as: { type: [Object, String], def
|
|
|
1448
1448
|
}), fe(() => {
|
|
1449
1449
|
l.optionsPropsRef.value.hold = e.hold;
|
|
1450
1450
|
});
|
|
1451
|
-
let r = il(), a =
|
|
1452
|
-
ol({ container:
|
|
1451
|
+
let r = il(), a = O(() => r !== null ? (r.value & Re.Open) === Re.Open : l.comboboxState.value === 0);
|
|
1452
|
+
ol({ container: O(() => B(l.optionsRef)), enabled: O(() => l.comboboxState.value === 0), accept(u) {
|
|
1453
1453
|
return u.getAttribute("role") === "option" ? NodeFilter.FILTER_REJECT : u.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
|
|
1454
1454
|
}, walk(u) {
|
|
1455
1455
|
u.setAttribute("role", "none");
|
|
@@ -1459,54 +1459,54 @@ let bl = pe({ name: "ComboboxButton", props: { as: { type: [Object, String], def
|
|
|
1459
1459
|
}
|
|
1460
1460
|
return () => {
|
|
1461
1461
|
var u, c, d;
|
|
1462
|
-
let
|
|
1463
|
-
return ye({ ourProps:
|
|
1462
|
+
let T = { open: l.comboboxState.value === 0 }, g = { "aria-labelledby": (d = (u = B(l.labelRef)) == null ? void 0 : u.id) != null ? d : (c = B(l.buttonRef)) == null ? void 0 : c.id, id: s, ref: l.optionsRef, role: "listbox", "aria-multiselectable": l.mode.value === 1 ? !0 : void 0, onMousedown: i }, x = ot(e, ["hold"]);
|
|
1463
|
+
return ye({ ourProps: g, theirProps: x, slot: T, attrs: n, slots: l.virtual.value && l.comboboxState.value === 0 ? { ...t, default: () => [Ve(ml, {}, t.default)] } : t, features: De.RenderStrategy | De.Static, visible: a.value, name: "ComboboxOptions" });
|
|
1464
1464
|
};
|
|
1465
1465
|
} }), yl = pe({ name: "ComboboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: !1 }, order: { type: [Number], default: null } }, setup(e, { slots: n, attrs: t, expose: o }) {
|
|
1466
|
-
let l = we("ComboboxOption"), s = `headlessui-combobox-option-${je()}`, r = $(null), a =
|
|
1466
|
+
let l = we("ComboboxOption"), s = `headlessui-combobox-option-${je()}`, r = $(null), a = O(() => e.disabled);
|
|
1467
1467
|
o({ el: r, $el: r });
|
|
1468
|
-
let i =
|
|
1469
|
-
var
|
|
1470
|
-
return l.virtual.value ? l.activeOptionIndex.value === l.calculateIndex(e.value) : l.activeOptionIndex.value === null ? !1 : ((
|
|
1471
|
-
}), u =
|
|
1468
|
+
let i = O(() => {
|
|
1469
|
+
var I;
|
|
1470
|
+
return l.virtual.value ? l.activeOptionIndex.value === l.calculateIndex(e.value) : l.activeOptionIndex.value === null ? !1 : ((I = l.options.value[l.activeOptionIndex.value]) == null ? void 0 : I.id) === s;
|
|
1471
|
+
}), u = O(() => l.isSelected(e.value)), c = le(_n, null), d = O(() => ({ disabled: e.disabled, value: e.value, domRef: r, order: O(() => e.order) }));
|
|
1472
1472
|
se(() => l.registerOption(s, d)), Fe(() => l.unregisterOption(s, i.value)), fe(() => {
|
|
1473
|
-
let
|
|
1474
|
-
|
|
1473
|
+
let I = B(r);
|
|
1474
|
+
I && (c == null || c.value.measureElement(I));
|
|
1475
1475
|
}), fe(() => {
|
|
1476
|
-
l.comboboxState.value === 0 && i.value && (l.virtual.value || l.activationTrigger.value !== 0 &&
|
|
1477
|
-
var
|
|
1478
|
-
return (
|
|
1476
|
+
l.comboboxState.value === 0 && i.value && (l.virtual.value || l.activationTrigger.value !== 0 && Y(() => {
|
|
1477
|
+
var I, _;
|
|
1478
|
+
return (_ = (I = B(r)) == null ? void 0 : I.scrollIntoView) == null ? void 0 : _.call(I, { block: "nearest" });
|
|
1479
1479
|
}));
|
|
1480
1480
|
});
|
|
1481
|
-
function
|
|
1482
|
-
|
|
1483
|
-
var
|
|
1484
|
-
return (
|
|
1481
|
+
function T(I) {
|
|
1482
|
+
I.preventDefault(), I.button === bn.Left && (a.value || (l.selectOption(s), vn() || requestAnimationFrame(() => {
|
|
1483
|
+
var _;
|
|
1484
|
+
return (_ = B(l.inputRef)) == null ? void 0 : _.focus({ preventScroll: !0 });
|
|
1485
1485
|
}), l.mode.value === 0 && l.closeCombobox()));
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1488
|
-
var
|
|
1489
|
-
if (e.disabled || (
|
|
1490
|
-
let
|
|
1491
|
-
l.goToOption(q.Specific,
|
|
1487
|
+
function g() {
|
|
1488
|
+
var I;
|
|
1489
|
+
if (e.disabled || (I = l.virtual.value) != null && I.disabled(e.value)) return l.goToOption(q.Nothing);
|
|
1490
|
+
let _ = l.calculateIndex(e.value);
|
|
1491
|
+
l.goToOption(q.Specific, _);
|
|
1492
1492
|
}
|
|
1493
|
-
let
|
|
1494
|
-
function
|
|
1495
|
-
|
|
1493
|
+
let x = nl();
|
|
1494
|
+
function b(I) {
|
|
1495
|
+
x.update(I);
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1498
|
-
var
|
|
1499
|
-
if (!
|
|
1500
|
-
let
|
|
1501
|
-
l.goToOption(q.Specific,
|
|
1497
|
+
function A(I) {
|
|
1498
|
+
var _;
|
|
1499
|
+
if (!x.wasMoved(I) || e.disabled || (_ = l.virtual.value) != null && _.disabled(e.value) || i.value) return;
|
|
1500
|
+
let E = l.calculateIndex(e.value);
|
|
1501
|
+
l.goToOption(q.Specific, E, 0);
|
|
1502
1502
|
}
|
|
1503
|
-
function
|
|
1504
|
-
var
|
|
1505
|
-
|
|
1503
|
+
function V(I) {
|
|
1504
|
+
var _;
|
|
1505
|
+
x.wasMoved(I) && (e.disabled || (_ = l.virtual.value) != null && _.disabled(e.value) || i.value && (l.optionsPropsRef.value.hold || l.goToOption(q.Nothing)));
|
|
1506
1506
|
}
|
|
1507
1507
|
return () => {
|
|
1508
|
-
let { disabled:
|
|
1509
|
-
return ye({ ourProps:
|
|
1508
|
+
let { disabled: I } = e, _ = { active: i.value, selected: u.value, disabled: I }, E = { id: s, ref: r, role: "option", tabIndex: I === !0 ? void 0 : -1, "aria-disabled": I === !0 ? !0 : void 0, "aria-selected": u.value, disabled: void 0, onMousedown: T, onFocus: g, onPointerenter: b, onMouseenter: b, onPointermove: A, onMousemove: A, onPointerleave: V, onMouseleave: V }, y = ot(e, ["order", "value"]);
|
|
1509
|
+
return ye({ ourProps: E, theirProps: y, slot: _, attrs: t, slots: n, name: "ComboboxOption" });
|
|
1510
1510
|
};
|
|
1511
1511
|
} });
|
|
1512
1512
|
function wl(e, n) {
|
|
@@ -1751,7 +1751,7 @@ function Dl(e, n, t, o) {
|
|
|
1751
1751
|
}, 4e4);
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1754
|
+
function W(e, n) {
|
|
1755
1755
|
const t = "🍍 " + e;
|
|
1756
1756
|
typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(t, n) : n === "error" ? console.error(t) : n === "warn" ? console.warn(t) : console.log(t);
|
|
1757
1757
|
}
|
|
@@ -1760,42 +1760,42 @@ function kt(e) {
|
|
|
1760
1760
|
}
|
|
1761
1761
|
function In() {
|
|
1762
1762
|
if (!("clipboard" in navigator))
|
|
1763
|
-
return
|
|
1763
|
+
return W("Your browser doesn't support the Clipboard API", "error"), !0;
|
|
1764
1764
|
}
|
|
1765
1765
|
function kn(e) {
|
|
1766
|
-
return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (
|
|
1766
|
+
return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (W('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
|
|
1767
1767
|
}
|
|
1768
1768
|
async function Rl(e) {
|
|
1769
1769
|
if (!In())
|
|
1770
1770
|
try {
|
|
1771
|
-
await navigator.clipboard.writeText(JSON.stringify(e.state.value)),
|
|
1771
|
+
await navigator.clipboard.writeText(JSON.stringify(e.state.value)), W("Global state copied to clipboard.");
|
|
1772
1772
|
} catch (n) {
|
|
1773
1773
|
if (kn(n))
|
|
1774
1774
|
return;
|
|
1775
|
-
|
|
1775
|
+
W("Failed to serialize the state. Check the console for more details.", "error"), console.error(n);
|
|
1776
1776
|
}
|
|
1777
1777
|
}
|
|
1778
1778
|
async function Pl(e) {
|
|
1779
1779
|
if (!In())
|
|
1780
1780
|
try {
|
|
1781
|
-
Mn(e, JSON.parse(await navigator.clipboard.readText())),
|
|
1781
|
+
Mn(e, JSON.parse(await navigator.clipboard.readText())), W("Global state pasted from clipboard.");
|
|
1782
1782
|
} catch (n) {
|
|
1783
1783
|
if (kn(n))
|
|
1784
1784
|
return;
|
|
1785
|
-
|
|
1785
|
+
W("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(n);
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
|
-
async function
|
|
1788
|
+
async function Bl(e) {
|
|
1789
1789
|
try {
|
|
1790
1790
|
Ln(new Blob([JSON.stringify(e.state.value)], {
|
|
1791
1791
|
type: "text/plain;charset=utf-8"
|
|
1792
1792
|
}), "pinia-state.json");
|
|
1793
1793
|
} catch (n) {
|
|
1794
|
-
|
|
1794
|
+
W("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(n);
|
|
1795
1795
|
}
|
|
1796
1796
|
}
|
|
1797
1797
|
let ie;
|
|
1798
|
-
function
|
|
1798
|
+
function Nl() {
|
|
1799
1799
|
ie || (ie = document.createElement("input"), ie.type = "file", ie.accept = ".json");
|
|
1800
1800
|
function e() {
|
|
1801
1801
|
return new Promise((n, t) => {
|
|
@@ -1812,13 +1812,13 @@ function Bl() {
|
|
|
1812
1812
|
}
|
|
1813
1813
|
async function Fl(e) {
|
|
1814
1814
|
try {
|
|
1815
|
-
const t = await
|
|
1815
|
+
const t = await Nl()();
|
|
1816
1816
|
if (!t)
|
|
1817
1817
|
return;
|
|
1818
1818
|
const { text: o, file: l } = t;
|
|
1819
|
-
Mn(e, JSON.parse(o)),
|
|
1819
|
+
Mn(e, JSON.parse(o)), W(`Global state imported from "${l.name}".`);
|
|
1820
1820
|
} catch (n) {
|
|
1821
|
-
|
|
1821
|
+
W("Failed to import the state from JSON. Check the console for more details.", "error"), console.error(n);
|
|
1822
1822
|
}
|
|
1823
1823
|
}
|
|
1824
1824
|
function Mn(e, n) {
|
|
@@ -1917,7 +1917,7 @@ function Wl(e, n) {
|
|
|
1917
1917
|
componentStateTypes: Ye,
|
|
1918
1918
|
app: e
|
|
1919
1919
|
}, (t) => {
|
|
1920
|
-
typeof t.now != "function" &&
|
|
1920
|
+
typeof t.now != "function" && W("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), t.addTimelineLayer({
|
|
1921
1921
|
id: me,
|
|
1922
1922
|
label: "Pinia 🍍",
|
|
1923
1923
|
color: 15064968
|
|
@@ -1944,7 +1944,7 @@ function Wl(e, n) {
|
|
|
1944
1944
|
{
|
|
1945
1945
|
icon: "save",
|
|
1946
1946
|
action: () => {
|
|
1947
|
-
|
|
1947
|
+
Bl(n);
|
|
1948
1948
|
},
|
|
1949
1949
|
tooltip: "Save the state as a JSON file"
|
|
1950
1950
|
},
|
|
@@ -1962,7 +1962,7 @@ function Wl(e, n) {
|
|
|
1962
1962
|
tooltip: 'Reset the state (with "$reset")',
|
|
1963
1963
|
action: (o) => {
|
|
1964
1964
|
const l = n._s.get(o);
|
|
1965
|
-
l ? typeof l.$reset != "function" ?
|
|
1965
|
+
l ? typeof l.$reset != "function" ? W(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`, "warn") : (l.$reset(), W(`Store "${o}" reset.`)) : W(`Cannot reset "${o}" store because it wasn't found.`, "warn");
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
1968
|
]
|
|
@@ -2021,7 +2021,7 @@ function Wl(e, n) {
|
|
|
2021
2021
|
if (o.app === e && o.inspectorId === J) {
|
|
2022
2022
|
const s = o.nodeId === ht ? n : n._s.get(o.nodeId);
|
|
2023
2023
|
if (!s)
|
|
2024
|
-
return
|
|
2024
|
+
return W(`store "${o.nodeId}" not found`, "error");
|
|
2025
2025
|
const { path: r } = o;
|
|
2026
2026
|
kt(s) ? r.unshift("state") : (r.length !== 1 || !s._customProperties.has(r[0]) || r[0] in s.$state) && r.unshift("$state"), Se = !1, o.set(s, r, o.state.value), Se = !0;
|
|
2027
2027
|
}
|
|
@@ -2029,10 +2029,10 @@ function Wl(e, n) {
|
|
|
2029
2029
|
if (o.type.startsWith("🍍")) {
|
|
2030
2030
|
const l = o.type.replace(/^🍍\s*/, ""), s = n._s.get(l);
|
|
2031
2031
|
if (!s)
|
|
2032
|
-
return
|
|
2032
|
+
return W(`store "${l}" not found`, "error");
|
|
2033
2033
|
const { path: r } = o;
|
|
2034
2034
|
if (r[0] !== "state")
|
|
2035
|
-
return
|
|
2035
|
+
return W(`Invalid path for store "${l}":
|
|
2036
2036
|
${r}
|
|
2037
2037
|
Only state can be modified.`);
|
|
2038
2038
|
r[0] = "$state", Se = !1, o.set(s, r, o.state.value), Se = !0;
|
|
@@ -2166,8 +2166,8 @@ function ql(e, n) {
|
|
|
2166
2166
|
});
|
|
2167
2167
|
const { $dispose: s } = n;
|
|
2168
2168
|
n.$dispose = () => {
|
|
2169
|
-
s(), t.notifyComponentUpdate(), t.sendInspectorTree(J), t.sendInspectorState(J), t.getSettings().logStoreChanges &&
|
|
2170
|
-
}, t.notifyComponentUpdate(), t.sendInspectorTree(J), t.sendInspectorState(J), t.getSettings().logStoreChanges &&
|
|
2169
|
+
s(), t.notifyComponentUpdate(), t.sendInspectorTree(J), t.sendInspectorState(J), t.getSettings().logStoreChanges && W(`Disposed "${n.$id}" store 🗑`);
|
|
2170
|
+
}, t.notifyComponentUpdate(), t.sendInspectorTree(J), t.sendInspectorState(J), t.getSettings().logStoreChanges && W(`"${n.$id}" store installed 🆕`);
|
|
2171
2171
|
});
|
|
2172
2172
|
}
|
|
2173
2173
|
let Vn = 0, de;
|
|
@@ -2277,10 +2277,10 @@ function qt(e, n, t, o) {
|
|
|
2277
2277
|
// use ref() to unwrap refs inside state TODO: check if this is still necessary
|
|
2278
2278
|
Rt($(l ? l() : {}).value)
|
|
2279
2279
|
) : Rt(t.state.value[e]);
|
|
2280
|
-
return te(c, s, Object.keys(r || {}).reduce((d,
|
|
2280
|
+
return te(c, s, Object.keys(r || {}).reduce((d, T) => (process.env.NODE_ENV !== "production" && T in c && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${T}" in store "${e}".`), d[T] = be(O(() => {
|
|
2281
2281
|
Pe(t);
|
|
2282
|
-
const
|
|
2283
|
-
return r[
|
|
2282
|
+
const g = t._s.get(e);
|
|
2283
|
+
return r[T].call(g, g);
|
|
2284
2284
|
})), d), {}));
|
|
2285
2285
|
}
|
|
2286
2286
|
return i = gt(e, u, n, t, o, !0), i;
|
|
@@ -2295,34 +2295,34 @@ function gt(e, n, t = {}, o, l, s) {
|
|
|
2295
2295
|
// flush: 'post',
|
|
2296
2296
|
};
|
|
2297
2297
|
process.env.NODE_ENV !== "production" && (i.onTrigger = (v) => {
|
|
2298
|
-
u ?
|
|
2298
|
+
u ? g = v : u == !1 && !m._hotUpdating && (Array.isArray(g) ? g.push(v) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
|
|
2299
2299
|
});
|
|
2300
|
-
let u, c, d = [],
|
|
2301
|
-
const
|
|
2302
|
-
!s && !
|
|
2303
|
-
const
|
|
2304
|
-
let
|
|
2305
|
-
function
|
|
2300
|
+
let u, c, d = [], T = [], g;
|
|
2301
|
+
const x = o.state.value[e];
|
|
2302
|
+
!s && !x && (process.env.NODE_ENV === "production" || !l) && (o.state.value[e] = {});
|
|
2303
|
+
const b = $({});
|
|
2304
|
+
let A;
|
|
2305
|
+
function V(v) {
|
|
2306
2306
|
let p;
|
|
2307
|
-
u = c = !1, process.env.NODE_ENV !== "production" && (
|
|
2307
|
+
u = c = !1, process.env.NODE_ENV !== "production" && (g = []), typeof v == "function" ? (v(o.state.value[e]), p = {
|
|
2308
2308
|
type: ae.patchFunction,
|
|
2309
2309
|
storeId: e,
|
|
2310
|
-
events:
|
|
2310
|
+
events: g
|
|
2311
2311
|
}) : (mt(o.state.value[e], v), p = {
|
|
2312
2312
|
type: ae.patchObject,
|
|
2313
2313
|
payload: v,
|
|
2314
2314
|
storeId: e,
|
|
2315
|
-
events:
|
|
2315
|
+
events: g
|
|
2316
2316
|
});
|
|
2317
|
-
const
|
|
2318
|
-
|
|
2319
|
-
|
|
2317
|
+
const L = A = Symbol();
|
|
2318
|
+
Y().then(() => {
|
|
2319
|
+
A === L && (u = !0);
|
|
2320
2320
|
}), c = !0, Te(d, p, o.state.value[e]);
|
|
2321
2321
|
}
|
|
2322
|
-
const
|
|
2323
|
-
const { state: p } = t,
|
|
2322
|
+
const I = s ? function() {
|
|
2323
|
+
const { state: p } = t, L = p ? p() : {};
|
|
2324
2324
|
this.$patch((M) => {
|
|
2325
|
-
te(M,
|
|
2325
|
+
te(M, L);
|
|
2326
2326
|
});
|
|
2327
2327
|
} : (
|
|
2328
2328
|
/* istanbul ignore next */
|
|
@@ -2330,120 +2330,120 @@ function gt(e, n, t = {}, o, l, s) {
|
|
|
2330
2330
|
throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
|
|
2331
2331
|
} : Rn
|
|
2332
2332
|
);
|
|
2333
|
-
function
|
|
2334
|
-
r.stop(), d = [],
|
|
2333
|
+
function _() {
|
|
2334
|
+
r.stop(), d = [], T = [], o._s.delete(e);
|
|
2335
2335
|
}
|
|
2336
|
-
function
|
|
2336
|
+
function E(v, p) {
|
|
2337
2337
|
return function() {
|
|
2338
2338
|
Pe(o);
|
|
2339
|
-
const
|
|
2340
|
-
function H(
|
|
2341
|
-
M.push(
|
|
2339
|
+
const L = Array.from(arguments), M = [], j = [];
|
|
2340
|
+
function H(U) {
|
|
2341
|
+
M.push(U);
|
|
2342
2342
|
}
|
|
2343
|
-
function K(
|
|
2344
|
-
j.push(
|
|
2343
|
+
function K(U) {
|
|
2344
|
+
j.push(U);
|
|
2345
2345
|
}
|
|
2346
|
-
Te(
|
|
2347
|
-
args:
|
|
2346
|
+
Te(T, {
|
|
2347
|
+
args: L,
|
|
2348
2348
|
name: v,
|
|
2349
|
-
store:
|
|
2349
|
+
store: m,
|
|
2350
2350
|
after: H,
|
|
2351
2351
|
onError: K
|
|
2352
2352
|
});
|
|
2353
2353
|
let ee;
|
|
2354
2354
|
try {
|
|
2355
|
-
ee = p.apply(this && this.$id === e ? this :
|
|
2356
|
-
} catch (
|
|
2357
|
-
throw Te(j,
|
|
2355
|
+
ee = p.apply(this && this.$id === e ? this : m, L);
|
|
2356
|
+
} catch (U) {
|
|
2357
|
+
throw Te(j, U), U;
|
|
2358
2358
|
}
|
|
2359
|
-
return ee instanceof Promise ? ee.then((
|
|
2359
|
+
return ee instanceof Promise ? ee.then((U) => (Te(M, U), U)).catch((U) => (Te(j, U), Promise.reject(U))) : (Te(M, ee), ee);
|
|
2360
2360
|
};
|
|
2361
2361
|
}
|
|
2362
|
-
const
|
|
2362
|
+
const y = /* @__PURE__ */ be({
|
|
2363
2363
|
actions: {},
|
|
2364
2364
|
getters: {},
|
|
2365
2365
|
state: [],
|
|
2366
|
-
hotState:
|
|
2367
|
-
}),
|
|
2366
|
+
hotState: b
|
|
2367
|
+
}), w = {
|
|
2368
2368
|
_p: o,
|
|
2369
2369
|
// _s: scope,
|
|
2370
2370
|
$id: e,
|
|
2371
|
-
$onAction: Ut.bind(null,
|
|
2372
|
-
$patch:
|
|
2373
|
-
$reset:
|
|
2371
|
+
$onAction: Ut.bind(null, T),
|
|
2372
|
+
$patch: V,
|
|
2373
|
+
$reset: I,
|
|
2374
2374
|
$subscribe(v, p = {}) {
|
|
2375
|
-
const
|
|
2375
|
+
const L = Ut(d, v, p.detached, () => M()), M = r.run(() => F(() => o.state.value[e], (j) => {
|
|
2376
2376
|
(p.flush === "sync" ? c : u) && v({
|
|
2377
2377
|
storeId: e,
|
|
2378
2378
|
type: ae.direct,
|
|
2379
|
-
events:
|
|
2379
|
+
events: g
|
|
2380
2380
|
}, j);
|
|
2381
2381
|
}, te({}, i, p)));
|
|
2382
|
-
return
|
|
2382
|
+
return L;
|
|
2383
2383
|
},
|
|
2384
|
-
$dispose:
|
|
2385
|
-
},
|
|
2384
|
+
$dispose: _
|
|
2385
|
+
}, m = an(process.env.NODE_ENV !== "production" || Ae ? te(
|
|
2386
2386
|
{
|
|
2387
|
-
_hmrPayload:
|
|
2387
|
+
_hmrPayload: y,
|
|
2388
2388
|
_customProperties: be(/* @__PURE__ */ new Set())
|
|
2389
2389
|
// devtools custom properties
|
|
2390
2390
|
},
|
|
2391
|
-
|
|
2391
|
+
w
|
|
2392
2392
|
// must be added later
|
|
2393
2393
|
// setupStore
|
|
2394
|
-
) :
|
|
2395
|
-
o._s.set(e,
|
|
2396
|
-
const
|
|
2397
|
-
for (const v in
|
|
2398
|
-
const p =
|
|
2394
|
+
) : w);
|
|
2395
|
+
o._s.set(e, m);
|
|
2396
|
+
const D = (o._a && o._a.runWithContext || Yl)(() => o._e.run(() => (r = un()).run(n)));
|
|
2397
|
+
for (const v in D) {
|
|
2398
|
+
const p = D[v];
|
|
2399
2399
|
if ($e(p) && !Wt(p) || St(p))
|
|
2400
|
-
process.env.NODE_ENV !== "production" && l ? We(
|
|
2400
|
+
process.env.NODE_ENV !== "production" && l ? We(b.value, v, it(D, v)) : s || (x && Xl(p) && ($e(p) ? p.value = x[v] : mt(p, x[v])), o.state.value[e][v] = p), process.env.NODE_ENV !== "production" && y.state.push(v);
|
|
2401
2401
|
else if (typeof p == "function") {
|
|
2402
|
-
const
|
|
2403
|
-
|
|
2404
|
-
} else process.env.NODE_ENV !== "production" && Wt(p) && (
|
|
2402
|
+
const L = process.env.NODE_ENV !== "production" && l ? p : E(v, p);
|
|
2403
|
+
D[v] = L, process.env.NODE_ENV !== "production" && (y.actions[v] = p), a.actions[v] = p;
|
|
2404
|
+
} else process.env.NODE_ENV !== "production" && Wt(p) && (y.getters[v] = s ? (
|
|
2405
2405
|
// @ts-expect-error
|
|
2406
2406
|
t.getters[v]
|
|
2407
|
-
) : p, lt && (
|
|
2408
|
-
(
|
|
2407
|
+
) : p, lt && (D._getters || // @ts-expect-error: same
|
|
2408
|
+
(D._getters = be([]))).push(v));
|
|
2409
2409
|
}
|
|
2410
|
-
if (te(
|
|
2411
|
-
get: () => process.env.NODE_ENV !== "production" && l ?
|
|
2410
|
+
if (te(m, D), te(ne(m), D), Object.defineProperty(m, "$state", {
|
|
2411
|
+
get: () => process.env.NODE_ENV !== "production" && l ? b.value : o.state.value[e],
|
|
2412
2412
|
set: (v) => {
|
|
2413
2413
|
if (process.env.NODE_ENV !== "production" && l)
|
|
2414
2414
|
throw new Error("cannot set hotState");
|
|
2415
|
-
|
|
2415
|
+
V((p) => {
|
|
2416
2416
|
te(p, v);
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
|
-
}), process.env.NODE_ENV !== "production" && (
|
|
2420
|
-
|
|
2421
|
-
if (p in
|
|
2422
|
-
const
|
|
2423
|
-
typeof
|
|
2419
|
+
}), process.env.NODE_ENV !== "production" && (m._hotUpdate = be((v) => {
|
|
2420
|
+
m._hotUpdating = !0, v._hmrPayload.state.forEach((p) => {
|
|
2421
|
+
if (p in m.$state) {
|
|
2422
|
+
const L = v.$state[p], M = m.$state[p];
|
|
2423
|
+
typeof L == "object" && Ce(L) && Ce(M) ? Dn(L, M) : v.$state[p] = M;
|
|
2424
2424
|
}
|
|
2425
|
-
We(
|
|
2426
|
-
}), Object.keys(
|
|
2427
|
-
p in v.$state || dt(
|
|
2428
|
-
}), u = !1, c = !1, o.state.value[e] = it(v._hmrPayload, "hotState"), c = !0,
|
|
2425
|
+
We(m, p, it(v.$state, p));
|
|
2426
|
+
}), Object.keys(m.$state).forEach((p) => {
|
|
2427
|
+
p in v.$state || dt(m, p);
|
|
2428
|
+
}), u = !1, c = !1, o.state.value[e] = it(v._hmrPayload, "hotState"), c = !0, Y().then(() => {
|
|
2429
2429
|
u = !0;
|
|
2430
2430
|
});
|
|
2431
2431
|
for (const p in v._hmrPayload.actions) {
|
|
2432
|
-
const
|
|
2433
|
-
We(
|
|
2432
|
+
const L = v[p];
|
|
2433
|
+
We(m, p, E(p, L));
|
|
2434
2434
|
}
|
|
2435
2435
|
for (const p in v._hmrPayload.getters) {
|
|
2436
|
-
const
|
|
2436
|
+
const L = v._hmrPayload.getters[p], M = s ? (
|
|
2437
2437
|
// special handling of options api
|
|
2438
|
-
|
|
2439
|
-
) :
|
|
2440
|
-
We(
|
|
2438
|
+
O(() => (Pe(o), L.call(m, m)))
|
|
2439
|
+
) : L;
|
|
2440
|
+
We(m, p, M);
|
|
2441
2441
|
}
|
|
2442
|
-
Object.keys(
|
|
2443
|
-
p in v._hmrPayload.getters || dt(
|
|
2444
|
-
}), Object.keys(
|
|
2445
|
-
p in v._hmrPayload.actions || dt(
|
|
2446
|
-
}),
|
|
2442
|
+
Object.keys(m._hmrPayload.getters).forEach((p) => {
|
|
2443
|
+
p in v._hmrPayload.getters || dt(m, p);
|
|
2444
|
+
}), Object.keys(m._hmrPayload.actions).forEach((p) => {
|
|
2445
|
+
p in v._hmrPayload.actions || dt(m, p);
|
|
2446
|
+
}), m._hmrPayload = v._hmrPayload, m._getters = v._getters, m._hotUpdating = !1;
|
|
2447
2447
|
})), Ae) {
|
|
2448
2448
|
const v = {
|
|
2449
2449
|
writable: !0,
|
|
@@ -2452,28 +2452,28 @@ function gt(e, n, t = {}, o, l, s) {
|
|
|
2452
2452
|
enumerable: !1
|
|
2453
2453
|
};
|
|
2454
2454
|
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p) => {
|
|
2455
|
-
Object.defineProperty(
|
|
2455
|
+
Object.defineProperty(m, p, te({ value: m[p] }, v));
|
|
2456
2456
|
});
|
|
2457
2457
|
}
|
|
2458
2458
|
return o._p.forEach((v) => {
|
|
2459
2459
|
if (Ae) {
|
|
2460
2460
|
const p = r.run(() => v({
|
|
2461
|
-
store:
|
|
2461
|
+
store: m,
|
|
2462
2462
|
app: o._a,
|
|
2463
2463
|
pinia: o,
|
|
2464
2464
|
options: a
|
|
2465
2465
|
}));
|
|
2466
|
-
Object.keys(p || {}).forEach((
|
|
2466
|
+
Object.keys(p || {}).forEach((L) => m._customProperties.add(L)), te(m, p);
|
|
2467
2467
|
} else
|
|
2468
|
-
te(
|
|
2469
|
-
store:
|
|
2468
|
+
te(m, r.run(() => v({
|
|
2469
|
+
store: m,
|
|
2470
2470
|
app: o._a,
|
|
2471
2471
|
pinia: o,
|
|
2472
2472
|
options: a
|
|
2473
2473
|
})));
|
|
2474
|
-
}), process.env.NODE_ENV !== "production" &&
|
|
2474
|
+
}), process.env.NODE_ENV !== "production" && m.$state && typeof m.$state == "object" && typeof m.$state.constructor == "function" && !m.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
2475
2475
|
state: () => new MyClass()
|
|
2476
|
-
Found in store "${
|
|
2476
|
+
Found in store "${m.$id}".`), x && s && t.hydrate && t.hydrate(m.$state, x), u = !0, c = !0, m;
|
|
2477
2477
|
}
|
|
2478
2478
|
function He(e, n, t) {
|
|
2479
2479
|
let o, l;
|
|
@@ -2493,15 +2493,15 @@ This will fail in production.`);
|
|
|
2493
2493
|
a = Me, a._s.has(o) || (s ? gt(o, n, l, a) : qt(o, l, a), process.env.NODE_ENV !== "production" && (r._pinia = a));
|
|
2494
2494
|
const c = a._s.get(o);
|
|
2495
2495
|
if (process.env.NODE_ENV !== "production" && i) {
|
|
2496
|
-
const d = "__hot:" + o,
|
|
2497
|
-
i._hotUpdate(
|
|
2496
|
+
const d = "__hot:" + o, T = s ? gt(d, n, l, a, !0) : qt(d, te({}, l), a, !0);
|
|
2497
|
+
i._hotUpdate(T), delete a.state.value[d], a._s.delete(d);
|
|
2498
2498
|
}
|
|
2499
2499
|
if (process.env.NODE_ENV !== "production" && lt) {
|
|
2500
2500
|
const d = rn();
|
|
2501
2501
|
if (d && d.proxy && // avoid adding stores that are just built for hot module replacement
|
|
2502
2502
|
!i) {
|
|
2503
|
-
const
|
|
2504
|
-
|
|
2503
|
+
const T = d.proxy, g = "_pStores" in T ? T._pStores : T._pStores = {};
|
|
2504
|
+
g[o] = c;
|
|
2505
2505
|
}
|
|
2506
2506
|
}
|
|
2507
2507
|
return c;
|
|
@@ -2530,12 +2530,12 @@ const xe = He("loader", () => {
|
|
|
2530
2530
|
}),
|
|
2531
2531
|
emits: ["update:modelValue"],
|
|
2532
2532
|
setup(e) {
|
|
2533
|
-
const n = xe(), t = e, o = Gn(e, "modelValue"), l = $(""), s = $(null), r =
|
|
2533
|
+
const n = xe(), t = e, o = Gn(e, "modelValue"), l = $(""), s = $(null), r = O(() => Object.entries(t.languages).filter(
|
|
2534
2534
|
([, i]) => i.toLowerCase().includes(l.value.toLowerCase())
|
|
2535
2535
|
)), a = (i) => {
|
|
2536
2536
|
i.target.value = "", l.value = "", s.value && s.value.$el.click();
|
|
2537
2537
|
};
|
|
2538
|
-
return (i, u) => (h(),
|
|
2538
|
+
return (i, u) => (h(), Z(k(gl), {
|
|
2539
2539
|
modelValue: o.value,
|
|
2540
2540
|
"onUpdate:modelValue": u[3] || (u[3] = (c) => o.value = c),
|
|
2541
2541
|
disabled: k(n).loading,
|
|
@@ -2543,19 +2543,19 @@ const xe = He("loader", () => {
|
|
|
2543
2543
|
class: "relative mt-1"
|
|
2544
2544
|
}, {
|
|
2545
2545
|
default: ze(() => [
|
|
2546
|
-
|
|
2546
|
+
N(k(Cl), {
|
|
2547
2547
|
class: "w-full bg-base-100 border border-base-300 rounded py-2.5 pl-3 pr-10 text-sm text-base-content font-medium focus:outline-none focus:ring-0.5 focus:ring-primary focus:border-primary",
|
|
2548
2548
|
onChange: u[0] || (u[0] = (c) => l.value = c.target.value),
|
|
2549
2549
|
displayValue: (c) => e.languages[c],
|
|
2550
2550
|
onFocus: u[1] || (u[1] = (c) => a(c))
|
|
2551
2551
|
}, null, 8, ["displayValue"]),
|
|
2552
|
-
|
|
2552
|
+
N(k(bl), {
|
|
2553
2553
|
ref_key: "btnSelect",
|
|
2554
2554
|
ref: s,
|
|
2555
2555
|
class: "absolute inset-y-0 right-0 flex items-center pr-2"
|
|
2556
2556
|
}, {
|
|
2557
2557
|
default: ze(() => [
|
|
2558
|
-
|
|
2558
|
+
N(k(_l), {
|
|
2559
2559
|
class: "h-5 w-5 text-base-content/50",
|
|
2560
2560
|
"aria-hidden": "true",
|
|
2561
2561
|
onClick: u[2] || (u[2] = (c) => a(c))
|
|
@@ -2563,21 +2563,21 @@ const xe = He("loader", () => {
|
|
|
2563
2563
|
]),
|
|
2564
2564
|
_: 1
|
|
2565
2565
|
}, 512),
|
|
2566
|
-
|
|
2566
|
+
N(k(xl), { class: "absolute mt-1 max-h-60 w-full overflow-auto rounded-md bg-base-100 py-1 text-base shadow-lg ring-1 ring-base-300 focus:outline-none sm:text-sm z-50" }, {
|
|
2567
2567
|
default: ze(() => [
|
|
2568
|
-
(h(!0), C(z, null,
|
|
2568
|
+
(h(!0), C(z, null, Q(r.value, ([c, d]) => (h(), Z(k(yl), {
|
|
2569
2569
|
key: c,
|
|
2570
2570
|
value: c
|
|
2571
2571
|
}, {
|
|
2572
|
-
default: ze(({ active:
|
|
2572
|
+
default: ze(({ active: T, selected: g }) => [
|
|
2573
2573
|
f("li", {
|
|
2574
2574
|
class: P([
|
|
2575
2575
|
"relative cursor-default select-none py-2 pl-3 pr-9",
|
|
2576
|
-
|
|
2576
|
+
T ? "bg-primary text-primary-content" : "text-base-content"
|
|
2577
2577
|
])
|
|
2578
2578
|
}, [
|
|
2579
2579
|
f("span", {
|
|
2580
|
-
class: P(["block truncate",
|
|
2580
|
+
class: P(["block truncate", g && "font-semibold"])
|
|
2581
2581
|
}, G(d), 3)
|
|
2582
2582
|
], 2)
|
|
2583
2583
|
]),
|
|
@@ -2590,9 +2590,9 @@ const xe = He("loader", () => {
|
|
|
2590
2590
|
_: 1
|
|
2591
2591
|
}, 8, ["modelValue", "disabled"]));
|
|
2592
2592
|
}
|
|
2593
|
-
}, Kl = ["disabled"], es = /* @__PURE__ */
|
|
2593
|
+
}, Kl = ["disabled"], es = /* @__PURE__ */ Ne('<svg class="w-4 h-4 text-primary" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.68688 2.3131C3.88214 2.50837 3.88214 2.82495 3.68688 3.02021L2.04043 4.66666L3.68688 6.3131C3.88214 6.50837 3.88214 6.82495 3.68688 7.02021C3.49162 7.21547 3.17504 7.21547 2.97977 7.02021L0.979775 5.02021C0.784513 4.82495 0.784513 4.50837 0.979775 4.3131L2.97977 2.3131C3.17504 2.11784 3.49162 2.11784 3.68688 2.3131Z" fill="currentColor"></path><path d="M12.3131 8.97977C12.5084 8.78451 12.825 8.78451 13.0202 8.97977L15.0202 10.9798C15.2155 11.175 15.2155 11.4916 15.0202 11.6869L13.0202 13.6869C12.825 13.8821 12.5084 13.8821 12.3131 13.6869C12.1178 13.4916 12.1178 13.175 12.3131 12.9798L13.9596 11.3333L12.3131 9.68688C12.1178 9.49161 12.1178 9.17503 12.3131 8.97977Z" fill="currentColor"></path><path d="M0.833328 4.66666C0.833328 4.39051 1.05719 4.16666 1.33333 4.16666H14.6667C14.9428 4.16666 15.1667 4.39051 15.1667 4.66666C15.1667 4.9428 14.9428 5.16666 14.6667 5.16666H1.33333C1.05719 5.16666 0.833328 4.9428 0.833328 4.66666Z" fill="currentColor"></path><path d="M0.833328 11.3333C0.833328 11.0572 1.05719 10.8333 1.33333 10.8333H14.6667C14.9428 10.8333 15.1667 11.0572 15.1667 11.3333C15.1667 11.6095 14.9428 11.8333 14.6667 11.8333H1.33333C1.05719 11.8333 0.833328 11.6095 0.833328 11.3333Z" fill="currentColor"></path></svg>', 1), ts = [
|
|
2594
2594
|
es
|
|
2595
|
-
], ns = ["disabled"], os = /* @__PURE__ */
|
|
2595
|
+
], ns = ["disabled"], os = /* @__PURE__ */ Ne('<svg class="w-4 h-4 text-primary" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.68688 2.3131C3.88214 2.50837 3.88214 2.82495 3.68688 3.02021L2.04043 4.66666L3.68688 6.3131C3.88214 6.50837 3.88214 6.82495 3.68688 7.02021C3.49162 7.21547 3.17504 7.21547 2.97977 7.02021L0.979775 5.02021C0.784513 4.82495 0.784513 4.50837 0.979775 4.3131L2.97977 2.3131C3.17504 2.11784 3.49162 2.11784 3.68688 2.3131Z" fill="currentColor"></path><path d="M12.3131 8.97977C12.5084 8.78451 12.825 8.78451 13.0202 8.97977L15.0202 10.9798C15.2155 11.175 15.2155 11.4916 15.0202 11.6869L13.0202 13.6869C12.825 13.8821 12.5084 13.8821 12.3131 13.6869C12.1178 13.4916 12.1178 13.175 12.3131 12.9798L13.9596 11.3333L12.3131 9.68688C12.1178 9.49161 12.1178 9.17503 12.3131 8.97977Z" fill="currentColor"></path><path d="M0.833328 4.66666C0.833328 4.39051 1.05719 4.16666 1.33333 4.16666H14.6667C14.9428 4.16666 15.1667 4.39051 15.1667 4.66666C15.1667 4.9428 14.9428 5.16666 14.6667 5.16666H1.33333C1.05719 5.16666 0.833328 4.9428 0.833328 4.66666Z" fill="currentColor"></path><path d="M0.833328 11.3333C0.833328 11.0572 1.05719 10.8333 1.33333 10.8333H14.6667C14.9428 10.8333 15.1667 11.0572 15.1667 11.3333C15.1667 11.6095 14.9428 11.8333 14.6667 11.8333H1.33333C1.05719 11.8333 0.833328 11.6095 0.833328 11.3333Z" fill="currentColor"></path></svg>', 1), ls = [
|
|
2596
2596
|
os
|
|
2597
2597
|
], ss = {
|
|
2598
2598
|
__name: "SwapBtn",
|
|
@@ -2604,7 +2604,7 @@ const xe = He("loader", () => {
|
|
|
2604
2604
|
},
|
|
2605
2605
|
emits: ["swap"],
|
|
2606
2606
|
setup(e, { emit: n }) {
|
|
2607
|
-
const t = xe(), o =
|
|
2607
|
+
const t = xe(), o = O(() => t.isLoading("translation")), l = n;
|
|
2608
2608
|
return (s, r) => e.isBidirect ? (h(), C("button", {
|
|
2609
2609
|
key: 1,
|
|
2610
2610
|
onClick: r[0] || (r[0] = (a) => l("swap")),
|
|
@@ -2618,7 +2618,7 @@ const xe = He("loader", () => {
|
|
|
2618
2618
|
const e = $("auto"), n = $("vi"), t = $({
|
|
2619
2619
|
src: [],
|
|
2620
2620
|
target: []
|
|
2621
|
-
}), o =
|
|
2621
|
+
}), o = O(() => t.value.src[e.value]), l = O(() => t.value.target[n.value]);
|
|
2622
2622
|
function s(i, u) {
|
|
2623
2623
|
e.value = i == null ? void 0 : i.src, n.value = i == null ? void 0 : i.target, t.value = u;
|
|
2624
2624
|
}
|
|
@@ -2664,7 +2664,7 @@ const xe = He("loader", () => {
|
|
|
2664
2664
|
f("div", rs, [
|
|
2665
2665
|
f("div", is, [
|
|
2666
2666
|
t.value.length > 0 ? (h(), C("div", us, [
|
|
2667
|
-
(h(!0), C(z, null,
|
|
2667
|
+
(h(!0), C(z, null, Q(t.value, (a) => (h(), C("button", {
|
|
2668
2668
|
key: a,
|
|
2669
2669
|
class: "px-1 bg-base-100 border border-primary text-primary text-xs rounded hover:bg-primary hover:text-primary-content",
|
|
2670
2670
|
onClick: (i) => k(n).src = a
|
|
@@ -2673,7 +2673,7 @@ const xe = He("loader", () => {
|
|
|
2673
2673
|
]),
|
|
2674
2674
|
f("div", ds, [
|
|
2675
2675
|
o.value.length > 0 ? (h(), C("div", fs, [
|
|
2676
|
-
(h(!0), C(z, null,
|
|
2676
|
+
(h(!0), C(z, null, Q(o.value, (a) => (h(), C("button", {
|
|
2677
2677
|
key: a,
|
|
2678
2678
|
class: "px-1 bg-base-100 border border-primary text-primary text-xs rounded hover:bg-primary hover:text-primary-content",
|
|
2679
2679
|
onClick: (i) => k(n).target = a
|
|
@@ -2683,20 +2683,20 @@ const xe = He("loader", () => {
|
|
|
2683
2683
|
]),
|
|
2684
2684
|
f("div", ps, [
|
|
2685
2685
|
f("div", hs, [
|
|
2686
|
-
|
|
2686
|
+
N(Gt, {
|
|
2687
2687
|
modelValue: k(n).src,
|
|
2688
2688
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => k(n).src = a),
|
|
2689
2689
|
languages: k(n).languages.src,
|
|
2690
2690
|
class: "grow"
|
|
2691
2691
|
}, null, 8, ["modelValue", "languages"])
|
|
2692
2692
|
]),
|
|
2693
|
-
|
|
2693
|
+
N(ss, {
|
|
2694
2694
|
isBidirect: k(n).src !== "auto",
|
|
2695
2695
|
class: "grow-0 mx-3 mt-4 self-start",
|
|
2696
2696
|
onSwap: l
|
|
2697
2697
|
}, null, 8, ["isBidirect"]),
|
|
2698
2698
|
f("div", ms, [
|
|
2699
|
-
|
|
2699
|
+
N(Gt, {
|
|
2700
2700
|
modelValue: k(n).target,
|
|
2701
2701
|
"onUpdate:modelValue": r[1] || (r[1] = (a) => k(n).target = a),
|
|
2702
2702
|
languages: k(n).languages.target,
|
|
@@ -2774,7 +2774,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
2774
2774
|
},
|
|
2775
2775
|
emits: ["loadTTS"],
|
|
2776
2776
|
setup(e, { emit: n }) {
|
|
2777
|
-
const t = bt(), o = e, l = n, s =
|
|
2777
|
+
const t = bt(), o = e, l = n, s = O(() => t.tts[o.type]), r = $(!1), a = new Audio(), i = $(!1);
|
|
2778
2778
|
F(
|
|
2779
2779
|
s,
|
|
2780
2780
|
() => {
|
|
@@ -2805,7 +2805,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
2805
2805
|
}
|
|
2806
2806
|
return a.onended = () => {
|
|
2807
2807
|
r.value = !1;
|
|
2808
|
-
}, (
|
|
2808
|
+
}, (T, g) => r.value ? (h(), C("button", {
|
|
2809
2809
|
key: 1,
|
|
2810
2810
|
class: "btn btn-xs btn-circle",
|
|
2811
2811
|
onClick: ft(d, ["prevent"])
|
|
@@ -2878,7 +2878,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
2878
2878
|
fill: "currentColor"
|
|
2879
2879
|
}, null, -1), Ps = [
|
|
2880
2880
|
Rs
|
|
2881
|
-
],
|
|
2881
|
+
], Bs = {
|
|
2882
2882
|
__name: "FavoriteBtn",
|
|
2883
2883
|
props: {
|
|
2884
2884
|
disabled: Boolean,
|
|
@@ -2909,7 +2909,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
2909
2909
|
], 10, As)
|
|
2910
2910
|
]));
|
|
2911
2911
|
}
|
|
2912
|
-
},
|
|
2912
|
+
}, Ns = {
|
|
2913
2913
|
class: "tooltip tooltip-top tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!text-xs before:!py-1 before:!px-2",
|
|
2914
2914
|
"data-tip": "AI Translate"
|
|
2915
2915
|
}, Fs = ["disabled"], js = /* @__PURE__ */ f("path", {
|
|
@@ -2925,7 +2925,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
2925
2925
|
js,
|
|
2926
2926
|
Hs,
|
|
2927
2927
|
zs
|
|
2928
|
-
], Us = /* @__PURE__ */
|
|
2928
|
+
], Us = /* @__PURE__ */ Ne('<path d="M6.8544 3.20309C5.39975 2.89815 4.26277 1.76117 3.95787 0.30649C3.92042 0.12792 3.76292 0 3.58041 0C3.3979 0 3.2404 0.12792 3.20297 0.30652C2.89805 1.76117 1.76107 2.89812 0.306418 3.20302C0.127818 3.24045 -0.00012207 3.39798 -0.00012207 3.58046C-0.00012207 3.76295 0.127798 3.92047 0.306418 3.9579C1.76105 4.26285 2.89798 5.3998 3.2029 6.85448C3.24033 7.03307 3.39783 7.16102 3.58034 7.16102C3.76282 7.16102 3.92035 7.0331 3.95778 6.85448C4.26272 5.39983 5.39973 4.26287 6.85438 3.95799C7.03297 3.92056 7.16092 3.76306 7.16092 3.58056C7.1609 3.39805 7.03297 3.24052 6.8544 3.20309ZM3.58036 5.60938C3.14292 4.73132 2.42956 4.01792 1.55151 3.58049C2.42958 3.14305 3.14297 2.42968 3.58041 1.55161C4.01785 2.4297 4.73122 3.14307 5.60926 3.58053C4.73119 4.01797 4.0178 4.73132 3.58036 5.60938Z" fill="currentColor"></path><path d="M6.21683 9.574C5.53147 9.4303 4.99578 8.8947 4.85209 8.2093C4.81466 8.0307 4.65716 7.90271 4.47465 7.90271C4.29217 7.90271 4.13464 8.0306 4.09721 8.2092C3.95352 8.8946 3.4178 9.4303 2.73244 9.574C2.55385 9.6114 2.4259 9.7689 2.4259 9.9514C2.4259 10.1339 2.55383 10.2914 2.73244 10.3288C3.41778 10.4725 3.95349 11.0082 4.09716 11.6936C4.13459 11.8722 4.2921 12.0002 4.4746 12.0002C4.65709 12.0002 4.81461 11.8723 4.85204 11.6936C4.99574 11.0082 5.53145 10.4725 6.21683 10.3289C6.39543 10.2914 6.52337 10.1339 6.52337 9.9514C6.52337 9.7689 6.39545 9.6114 6.21683 9.574ZM4.47463 10.6408C4.29163 10.3688 4.05725 10.1345 3.78526 9.9515C4.0573 9.7684 4.29163 9.5341 4.47463 9.2621C4.65765 9.5341 4.892 9.7685 5.164 9.9515C4.892 10.1345 4.65763 10.3688 4.47463 10.6408Z" fill="currentColor"></path><path d="M11.4271 6.00324C10.5007 5.80904 9.7766 5.08496 9.5825 4.15859C9.545 3.98 9.3875 3.85205 9.205 3.85205C9.0225 3.85205 8.865 3.97995 8.8276 4.15857C8.6334 5.08496 7.90932 5.80902 6.98293 6.0032C6.80434 6.04063 6.67639 6.19815 6.67639 6.38064C6.67639 6.56312 6.80431 6.72062 6.98293 6.75807C7.9093 6.95228 8.6334 7.67633 8.8275 8.6027C8.865 8.7813 9.0225 8.9093 9.205 8.9093C9.3875 8.9093 9.545 8.7814 9.5824 8.6027C9.7766 7.67633 10.5007 6.95228 11.4271 6.75812C11.6057 6.72067 11.7336 6.56317 11.7336 6.38068C11.7336 6.1982 11.6057 6.04067 11.4271 6.00324ZM9.205 7.47681C8.9365 7.02634 8.5593 6.64914 8.1089 6.38066C8.5593 6.11218 8.9365 5.73502 9.205 5.28453C9.4735 5.73502 9.8507 6.11221 10.3012 6.38068C9.8507 6.64916 9.4735 7.02636 9.205 7.47681Z" fill="currentColor"></path><circle cx="3.5" cy="3.5" r="1.5" fill="currentColor"></circle><ellipse cx="4.5" cy="10" rx="0.5" ry="1" fill="currentColor"></ellipse><path d="M3.5 1L4.79904 2.5H2.20096L3.5 1Z" fill="currentColor"></path><path d="M6 3.5L4.5 4.79904L4.5 2.20096L6 3.5Z" fill="currentColor"></path><path d="M10.3697 6.67832L8.22108 7.01422L9.5776 4.65296L10.3697 6.67832Z" fill="currentColor"></path><path d="M8.27756 5.34149L10.768 6.00067L9.11199 7.77878L8.27756 5.34149Z" fill="currentColor"></path><path d="M1 3.5L2.5 2.20096L2.5 4.79904L1 3.5Z" fill="currentColor"></path><path d="M3.5 6L2.20096 4.5L4.79904 4.5L3.5 6Z" fill="currentColor"></path><circle cx="9" cy="6" r="1" fill="currentColor"></circle><path d="M5.49718 9.92495L4.03391 10.4693L3.96891 9.60573L5.49718 9.92495Z" fill="currentColor"></path><path d="M3.54089 9.71696L5.10212 9.72621L4.857 10.5568L3.54089 9.71696Z" fill="currentColor"></path><path d="M3.50071 9.96247L5.0159 9.58606L4.9834 10.4515L3.50071 9.96247Z" fill="currentColor"></path>', 15), Ws = [
|
|
2929
2929
|
Us
|
|
2930
2930
|
], qs = {
|
|
2931
2931
|
__name: "AIBtn",
|
|
@@ -2934,7 +2934,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
2934
2934
|
isFilled: Boolean
|
|
2935
2935
|
},
|
|
2936
2936
|
setup(e) {
|
|
2937
|
-
return (n, t) => (h(), C("div",
|
|
2937
|
+
return (n, t) => (h(), C("div", Ns, [
|
|
2938
2938
|
f("button", {
|
|
2939
2939
|
class: P(["btn btn-xs btn-circle", [
|
|
2940
2940
|
{ "btn-ghost": !e.disabled },
|
|
@@ -2963,7 +2963,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
2963
2963
|
fill: "currentColor"
|
|
2964
2964
|
}, null, -1), Qs = [
|
|
2965
2965
|
Ys
|
|
2966
|
-
],
|
|
2966
|
+
], Bn = {
|
|
2967
2967
|
__name: "CopyBtn",
|
|
2968
2968
|
props: {
|
|
2969
2969
|
disabled: Boolean
|
|
@@ -3059,7 +3059,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
3059
3059
|
setup(e, { emit: n }) {
|
|
3060
3060
|
const t = n;
|
|
3061
3061
|
return (o, l) => (h(), C("div", Xs, [
|
|
3062
|
-
e.src && e.isTTS ? (h(),
|
|
3062
|
+
e.src && e.isTTS ? (h(), Z(Es, {
|
|
3063
3063
|
key: 0,
|
|
3064
3064
|
type: e.type,
|
|
3065
3065
|
onLoadTTS: l[0] || (l[0] = (s) => t("loadTTS"))
|
|
@@ -3068,29 +3068,29 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
3068
3068
|
Ee(G(e.srcLabel) + " ", 1),
|
|
3069
3069
|
e.phonetic ? (h(), C("span", ea, "- " + G(e.phonetic), 1)) : R("", !0)
|
|
3070
3070
|
]),
|
|
3071
|
-
e.loading ? (h(),
|
|
3071
|
+
e.loading ? (h(), Z(Mt, {
|
|
3072
3072
|
key: 1,
|
|
3073
3073
|
class: "absolute right-6 top-2"
|
|
3074
3074
|
})) : R("", !0),
|
|
3075
3075
|
f("div", ta, [
|
|
3076
|
-
e.hasClearBtn ? (h(),
|
|
3076
|
+
e.hasClearBtn ? (h(), Z(Pn, {
|
|
3077
3077
|
key: 0,
|
|
3078
3078
|
onClick: l[1] || (l[1] = (s) => t("clear")),
|
|
3079
3079
|
disabled: e.loading
|
|
3080
3080
|
}, null, 8, ["disabled"])) : R("", !0),
|
|
3081
|
-
e.src && e.hasAIBtn ? (h(),
|
|
3081
|
+
e.src && e.hasAIBtn ? (h(), Z(qs, {
|
|
3082
3082
|
key: 1,
|
|
3083
3083
|
isFilled: e.isAITranslate,
|
|
3084
3084
|
onClick: l[2] || (l[2] = (s) => t("aiTranslate")),
|
|
3085
3085
|
disabled: e.loading
|
|
3086
3086
|
}, null, 8, ["isFilled", "disabled"])) : R("", !0),
|
|
3087
|
-
e.src && e.hasFavoriteBtn ? (h(),
|
|
3087
|
+
e.src && e.hasFavoriteBtn ? (h(), Z(Bs, {
|
|
3088
3088
|
key: 2,
|
|
3089
3089
|
isFilled: e.isFavorite,
|
|
3090
3090
|
onClick: l[3] || (l[3] = (s) => t("favorite")),
|
|
3091
3091
|
disabled: e.loading
|
|
3092
3092
|
}, null, 8, ["isFilled", "disabled"])) : R("", !0),
|
|
3093
|
-
e.src && e.hasCopyBtn ? (h(),
|
|
3093
|
+
e.src && e.hasCopyBtn ? (h(), Z(Bn, {
|
|
3094
3094
|
key: 3,
|
|
3095
3095
|
onClick: l[4] || (l[4] = (s) => t("copy")),
|
|
3096
3096
|
disabled: e.loading
|
|
@@ -3098,18 +3098,18 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
3098
3098
|
])
|
|
3099
3099
|
]));
|
|
3100
3100
|
}
|
|
3101
|
-
},
|
|
3101
|
+
}, Nn = /* @__PURE__ */ he(na, [["__scopeId", "data-v-faca0157"]]), ve = He("translation", () => {
|
|
3102
3102
|
const e = $(null), n = $(null), t = $(null), o = $({
|
|
3103
3103
|
src: null,
|
|
3104
3104
|
target: null
|
|
3105
3105
|
}), l = $(null), s = $([]), r = $([]), a = $([]), i = $([]), u = $({
|
|
3106
3106
|
src: null,
|
|
3107
3107
|
target: null
|
|
3108
|
-
}), c = Oe(), d =
|
|
3109
|
-
function
|
|
3110
|
-
e.value =
|
|
3108
|
+
}), c = Oe(), d = O(() => c.getLabel(e.value)), T = O(() => c.getLabel(n.value));
|
|
3109
|
+
function g(b) {
|
|
3110
|
+
e.value = b.src, n.value = b.target, t.value = b.text, o.value = b.phonetic, l.value = b.result, s.value = b.dictionary, r.value = b.definitions, a.value = b.synonyms, i.value = b.examples, u.value = b.tts;
|
|
3111
3111
|
}
|
|
3112
|
-
function
|
|
3112
|
+
function x() {
|
|
3113
3113
|
e.value = null, n.value = null, t.value = null, o.value = {
|
|
3114
3114
|
src: null,
|
|
3115
3115
|
target: null
|
|
@@ -3122,7 +3122,7 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
3122
3122
|
src: e,
|
|
3123
3123
|
srcLabel: d,
|
|
3124
3124
|
target: n,
|
|
3125
|
-
targetLabel:
|
|
3125
|
+
targetLabel: T,
|
|
3126
3126
|
phonetic: o,
|
|
3127
3127
|
text: t,
|
|
3128
3128
|
result: l,
|
|
@@ -3131,8 +3131,8 @@ const Mt = /* @__PURE__ */ he(bs, [["render", xs]]), bt = He("tts", () => {
|
|
|
3131
3131
|
synonyms: a,
|
|
3132
3132
|
examples: i,
|
|
3133
3133
|
tts: u,
|
|
3134
|
-
init:
|
|
3135
|
-
reset:
|
|
3134
|
+
init: g,
|
|
3135
|
+
reset: x
|
|
3136
3136
|
};
|
|
3137
3137
|
});
|
|
3138
3138
|
function oa(e) {
|
|
@@ -3189,20 +3189,20 @@ function ua() {
|
|
|
3189
3189
|
}
|
|
3190
3190
|
function ca(e) {
|
|
3191
3191
|
const n = ua();
|
|
3192
|
-
return
|
|
3192
|
+
return O(() => (n.value, !!e()));
|
|
3193
3193
|
}
|
|
3194
3194
|
function da(e, n, t = {}) {
|
|
3195
3195
|
const { window: o = ia, ...l } = t;
|
|
3196
3196
|
let s;
|
|
3197
3197
|
const r = ca(() => o && "ResizeObserver" in o), a = () => {
|
|
3198
3198
|
s && (s.disconnect(), s = void 0);
|
|
3199
|
-
}, i =
|
|
3199
|
+
}, i = O(() => Array.isArray(e) ? e.map((d) => Qt(d)) : [Qt(e)]), u = F(
|
|
3200
3200
|
i,
|
|
3201
3201
|
(d) => {
|
|
3202
3202
|
if (a(), r.value && o) {
|
|
3203
3203
|
s = new ResizeObserver(n);
|
|
3204
|
-
for (const
|
|
3205
|
-
|
|
3204
|
+
for (const T of d)
|
|
3205
|
+
T && s.observe(T, l);
|
|
3206
3206
|
}
|
|
3207
3207
|
},
|
|
3208
3208
|
{ immediate: !0, flush: "post" }
|
|
@@ -3224,7 +3224,7 @@ function st(e) {
|
|
|
3224
3224
|
let i = "";
|
|
3225
3225
|
t.value.style[l] = "1px", s.value = (a = t.value) == null ? void 0 : a.scrollHeight, e != null && e.styleTarget ? Ke(e.styleTarget).style[l] = `${s.value}px` : i = `${s.value}px`, t.value.style[l] = i;
|
|
3226
3226
|
}
|
|
3227
|
-
return F([o, t], () =>
|
|
3227
|
+
return F([o, t], () => Y(r), { immediate: !0 }), F(s, () => {
|
|
3228
3228
|
var a;
|
|
3229
3229
|
return (a = e == null ? void 0 : e.onResize) == null ? void 0 : a.call(e);
|
|
3230
3230
|
}), da(t, () => r()), e != null && e.watch && F(e.watch, r, { immediate: !0, deep: !0 }), {
|
|
@@ -3247,53 +3247,53 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3247
3247
|
},
|
|
3248
3248
|
emits: ["change", "clear", "loadTTS"],
|
|
3249
3249
|
setup(e, { emit: n }) {
|
|
3250
|
-
const t = ve(), o = e, l = $(o.text), s =
|
|
3251
|
-
var
|
|
3252
|
-
return (
|
|
3250
|
+
const t = ve(), o = e, l = $(o.text), s = O(() => t.src), r = O(() => t.srcLabel), a = O(() => {
|
|
3251
|
+
var x;
|
|
3252
|
+
return (x = t.phonetic) == null ? void 0 : x.src;
|
|
3253
3253
|
}), { textarea: i } = st({ input: l, styleProp: "minHeight" }), u = n, c = ra(() => {
|
|
3254
3254
|
u("change", l.value);
|
|
3255
3255
|
}, Le.INPUT_DEBOUNCE);
|
|
3256
3256
|
se(() => {
|
|
3257
|
-
|
|
3257
|
+
g();
|
|
3258
3258
|
});
|
|
3259
3259
|
function d() {
|
|
3260
3260
|
if (!l.value) {
|
|
3261
|
-
|
|
3261
|
+
T();
|
|
3262
3262
|
return;
|
|
3263
3263
|
}
|
|
3264
3264
|
c();
|
|
3265
3265
|
}
|
|
3266
|
-
function
|
|
3266
|
+
function T() {
|
|
3267
3267
|
u("clear"), l.value = "", i.value.focus();
|
|
3268
3268
|
}
|
|
3269
|
-
async function
|
|
3270
|
-
await
|
|
3269
|
+
async function g() {
|
|
3270
|
+
await Y(), i.value.select();
|
|
3271
3271
|
}
|
|
3272
3272
|
return F(
|
|
3273
3273
|
() => o.text,
|
|
3274
|
-
(
|
|
3275
|
-
l.value !==
|
|
3274
|
+
(x) => {
|
|
3275
|
+
l.value !== x && g(), l.value = x;
|
|
3276
3276
|
}
|
|
3277
|
-
), (
|
|
3278
|
-
|
|
3277
|
+
), (x, b) => (h(), C("div", fa, [
|
|
3278
|
+
N(Nn, {
|
|
3279
3279
|
src: s.value,
|
|
3280
3280
|
srcLabel: r.value,
|
|
3281
3281
|
isTTS: e.isTTS,
|
|
3282
3282
|
type: "src",
|
|
3283
3283
|
phonetic: a.value,
|
|
3284
3284
|
hasClearBtn: l.value.length > 0,
|
|
3285
|
-
onClear:
|
|
3286
|
-
onLoadTTS:
|
|
3285
|
+
onClear: T,
|
|
3286
|
+
onLoadTTS: b[0] || (b[0] = (A) => u("loadTTS"))
|
|
3287
3287
|
}, null, 8, ["src", "srcLabel", "isTTS", "phonetic", "hasClearBtn"]),
|
|
3288
3288
|
tt(f("textarea", {
|
|
3289
3289
|
ref_key: "textarea",
|
|
3290
3290
|
ref: i,
|
|
3291
|
-
"onUpdate:modelValue":
|
|
3291
|
+
"onUpdate:modelValue": b[1] || (b[1] = (A) => l.value = A),
|
|
3292
3292
|
class: "w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden",
|
|
3293
3293
|
autofocus: "",
|
|
3294
3294
|
rows: "2",
|
|
3295
3295
|
onInput: d,
|
|
3296
|
-
onFocus:
|
|
3296
|
+
onFocus: g
|
|
3297
3297
|
}, null, 544), [
|
|
3298
3298
|
[
|
|
3299
3299
|
nt,
|
|
@@ -3318,11 +3318,11 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3318
3318
|
},
|
|
3319
3319
|
emits: ["loadTTS", "favorite", "aiTranslate", "copy"],
|
|
3320
3320
|
setup(e, { emit: n }) {
|
|
3321
|
-
const t = ve(), o =
|
|
3322
|
-
var
|
|
3323
|
-
return (
|
|
3324
|
-
}), a = xe(), i =
|
|
3325
|
-
return (
|
|
3321
|
+
const t = ve(), o = O(() => t.result), l = O(() => t.target), s = O(() => t.targetLabel), r = O(() => {
|
|
3322
|
+
var T;
|
|
3323
|
+
return (T = t.phonetic) == null ? void 0 : T.target;
|
|
3324
|
+
}), a = xe(), i = O(() => a.isLoading("translation")), { textarea: u, input: c } = st({ input: o, styleProp: "minHeight" }), d = n;
|
|
3325
|
+
return (T, g) => (h(), C("div", {
|
|
3326
3326
|
class: P([
|
|
3327
3327
|
"relative p-0.5 bg-[length:300%_300%] bg-[position:0%_50%] border border-base-300 rounded",
|
|
3328
3328
|
{
|
|
@@ -3331,7 +3331,7 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3331
3331
|
])
|
|
3332
3332
|
}, [
|
|
3333
3333
|
f("div", ha, [
|
|
3334
|
-
|
|
3334
|
+
N(Nn, {
|
|
3335
3335
|
loading: i.value,
|
|
3336
3336
|
src: l.value,
|
|
3337
3337
|
srcLabel: s.value,
|
|
@@ -3343,16 +3343,16 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3343
3343
|
isFavorite: e.isFavorite,
|
|
3344
3344
|
isAITranslate: e.isAITranslate,
|
|
3345
3345
|
phonetic: r.value,
|
|
3346
|
-
onFavorite:
|
|
3347
|
-
onLoadTTS:
|
|
3348
|
-
onAiTranslate:
|
|
3349
|
-
onCopy:
|
|
3346
|
+
onFavorite: g[0] || (g[0] = (x) => d("favorite")),
|
|
3347
|
+
onLoadTTS: g[1] || (g[1] = (x) => d("loadTTS")),
|
|
3348
|
+
onAiTranslate: g[2] || (g[2] = (x) => d("aiTranslate")),
|
|
3349
|
+
onCopy: g[3] || (g[3] = (x) => d("copy"))
|
|
3350
3350
|
}, null, 8, ["loading", "src", "srcLabel", "isTTS", "hasFavoriteBtn", "hasAIBtn", "isFavorite", "isAITranslate", "phonetic"]),
|
|
3351
3351
|
f("div", ma, [
|
|
3352
3352
|
tt(f("textarea", {
|
|
3353
3353
|
ref_key: "textarea",
|
|
3354
3354
|
ref: u,
|
|
3355
|
-
"onUpdate:modelValue":
|
|
3355
|
+
"onUpdate:modelValue": g[4] || (g[4] = (x) => $e(c) ? c.value = x : null),
|
|
3356
3356
|
class: "w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden",
|
|
3357
3357
|
readonly: "",
|
|
3358
3358
|
rows: "2",
|
|
@@ -3372,10 +3372,10 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3372
3372
|
setup(e) {
|
|
3373
3373
|
const n = e;
|
|
3374
3374
|
return (t, o) => (h(), C("button", Ca, [
|
|
3375
|
-
n.isExpanded ? (h(),
|
|
3375
|
+
n.isExpanded ? (h(), Z(k(Tl), {
|
|
3376
3376
|
key: 0,
|
|
3377
3377
|
class: "w-7 text-base-content/50"
|
|
3378
|
-
})) : (h(),
|
|
3378
|
+
})) : (h(), Z(k(wl), {
|
|
3379
3379
|
key: 1,
|
|
3380
3380
|
class: "w-7 text-base-content/50"
|
|
3381
3381
|
}))
|
|
@@ -3385,7 +3385,7 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3385
3385
|
__name: "Dictionary",
|
|
3386
3386
|
emits: ["translate"],
|
|
3387
3387
|
setup(e, { emit: n }) {
|
|
3388
|
-
const t = $(!0), o = ve(), l = Oe(), s =
|
|
3388
|
+
const t = $(!0), o = ve(), l = Oe(), s = O(() => o.dictionary), r = n, a = () => {
|
|
3389
3389
|
t.value = !t.value;
|
|
3390
3390
|
}, i = (u) => {
|
|
3391
3391
|
r("translate", u, o.target, o.src), l.src = o.target, l.target = o.src, window.scrollTo(0, 0);
|
|
@@ -3396,26 +3396,26 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3396
3396
|
onClick: a
|
|
3397
3397
|
}, [
|
|
3398
3398
|
xa,
|
|
3399
|
-
|
|
3399
|
+
N(at, { isExpanded: t.value }, null, 8, ["isExpanded"])
|
|
3400
3400
|
]),
|
|
3401
3401
|
f("div", {
|
|
3402
3402
|
class: P(["overflow-hidden", t.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3403
3403
|
}, [
|
|
3404
3404
|
f("ul", null, [
|
|
3405
|
-
(h(!0), C(z, null,
|
|
3406
|
-
key: `${d.pos}-${
|
|
3405
|
+
(h(!0), C(z, null, Q(s.value, (d, T) => (h(), C("li", {
|
|
3406
|
+
key: `${d.pos}-${T}`,
|
|
3407
3407
|
class: "mb-2"
|
|
3408
3408
|
}, [
|
|
3409
3409
|
f("h5", ya, G(d.pos), 1),
|
|
3410
3410
|
f("ul", wa, [
|
|
3411
|
-
(h(!0), C(z, null,
|
|
3412
|
-
key: `${
|
|
3411
|
+
(h(!0), C(z, null, Q(d.items, (g, x) => (h(), C("li", {
|
|
3412
|
+
key: `${g.word}-${x}`
|
|
3413
3413
|
}, [
|
|
3414
3414
|
f("span", {
|
|
3415
3415
|
class: "m-0.5 font-normal badge badge-ghost bg-primary text-primary-content cursor-pointer border-0 rounded",
|
|
3416
|
-
onClick: (
|
|
3417
|
-
}, G(
|
|
3418
|
-
f("small", Ta, " - " + G(
|
|
3416
|
+
onClick: (b) => i(g.word)
|
|
3417
|
+
}, G(g.word), 9, _a),
|
|
3418
|
+
f("small", Ta, " - " + G(g.reverse_translation.join(", ")), 1)
|
|
3419
3419
|
]))), 128))
|
|
3420
3420
|
])
|
|
3421
3421
|
]))), 128))
|
|
@@ -3429,7 +3429,7 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3429
3429
|
}, ka = {
|
|
3430
3430
|
__name: "Definition",
|
|
3431
3431
|
setup(e) {
|
|
3432
|
-
const n = $(!0), t = ve(), o =
|
|
3432
|
+
const n = $(!0), t = ve(), o = O(() => t.definitions), l = () => {
|
|
3433
3433
|
n.value = !n.value;
|
|
3434
3434
|
};
|
|
3435
3435
|
return (s, r) => (h(), C(z, null, [
|
|
@@ -3438,19 +3438,19 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3438
3438
|
onClick: l
|
|
3439
3439
|
}, [
|
|
3440
3440
|
Ea,
|
|
3441
|
-
|
|
3441
|
+
N(at, { isExpanded: n.value }, null, 8, ["isExpanded"])
|
|
3442
3442
|
]),
|
|
3443
3443
|
f("div", {
|
|
3444
3444
|
class: P(["overflow-hidden", n.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3445
3445
|
}, [
|
|
3446
3446
|
f("ul", null, [
|
|
3447
|
-
(h(!0), C(z, null,
|
|
3447
|
+
(h(!0), C(z, null, Q(o.value, (a, i) => (h(), C("li", {
|
|
3448
3448
|
key: `${a.pos}-${i}`,
|
|
3449
3449
|
class: "mb-2"
|
|
3450
3450
|
}, [
|
|
3451
3451
|
f("h5", $a, G(a.pos), 1),
|
|
3452
3452
|
f("ul", Oa, [
|
|
3453
|
-
(h(!0), C(z, null,
|
|
3453
|
+
(h(!0), C(z, null, Q(a.items, (u, c) => (h(), C("li", {
|
|
3454
3454
|
key: `${u.gloss}-${c}`,
|
|
3455
3455
|
class: "mb-1"
|
|
3456
3456
|
}, [
|
|
@@ -3467,7 +3467,7 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3467
3467
|
}, Ma = /* @__PURE__ */ f("h2", { class: "card-title text-base font-bold text-base-content" }, "Examples", -1), Aa = { class: "text-base-content text-sm list-disc list-outside ml-5 my-2" }, Va = ["innerHTML"], Da = {
|
|
3468
3468
|
__name: "Example",
|
|
3469
3469
|
setup(e) {
|
|
3470
|
-
const n = $(!0), t = ve(), o =
|
|
3470
|
+
const n = $(!0), t = ve(), o = O(() => t.examples), l = () => {
|
|
3471
3471
|
n.value = !n.value;
|
|
3472
3472
|
};
|
|
3473
3473
|
return (s, r) => (h(), C(z, null, [
|
|
@@ -3476,13 +3476,13 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3476
3476
|
onClick: l
|
|
3477
3477
|
}, [
|
|
3478
3478
|
Ma,
|
|
3479
|
-
|
|
3479
|
+
N(at, { isExpanded: n.value }, null, 8, ["isExpanded"])
|
|
3480
3480
|
]),
|
|
3481
3481
|
f("div", {
|
|
3482
3482
|
class: P(["overflow-hidden", n.value ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3483
3483
|
}, [
|
|
3484
3484
|
f("ul", Aa, [
|
|
3485
|
-
(h(!0), C(z, null,
|
|
3485
|
+
(h(!0), C(z, null, Q(o.value, (a, i) => (h(), C("li", {
|
|
3486
3486
|
key: `${a.definition_id}-${i}`,
|
|
3487
3487
|
innerHTML: a
|
|
3488
3488
|
}, null, 8, Va))), 128))
|
|
@@ -3490,11 +3490,11 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3490
3490
|
], 2)
|
|
3491
3491
|
], 64));
|
|
3492
3492
|
}
|
|
3493
|
-
}, Ra = /* @__PURE__ */ f("h2", { class: "card-title text-base font-bold text-base-content" }, "Synonyms", -1), Pa = { class: "capitalize text-xs font-normal text-base-content/70 mb-1" },
|
|
3493
|
+
}, Ra = /* @__PURE__ */ f("h2", { class: "card-title text-base font-bold text-base-content" }, "Synonyms", -1), Pa = { class: "capitalize text-xs font-normal text-base-content/70 mb-1" }, Ba = { class: "list-none list-inside" }, Na = { class: "flex flex-wrap" }, Fa = ["onClick"], ja = {
|
|
3494
3494
|
__name: "Synonyms",
|
|
3495
3495
|
emits: ["translate"],
|
|
3496
3496
|
setup(e, { emit: n }) {
|
|
3497
|
-
const t = $(!0), o = ve(), l =
|
|
3497
|
+
const t = $(!0), o = ve(), l = O(() => o.synonyms), s = n, r = () => {
|
|
3498
3498
|
t.value = !t.value;
|
|
3499
3499
|
}, a = (i) => {
|
|
3500
3500
|
s("translate", i), window.scrollTo(0, 0);
|
|
@@ -3505,28 +3505,28 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3505
3505
|
onClick: r
|
|
3506
3506
|
}, [
|
|
3507
3507
|
Ra,
|
|
3508
|
-
|
|
3508
|
+
N(at, { isExpanded: t.value }, null, 8, ["isExpanded"])
|
|
3509
3509
|
]),
|
|
3510
3510
|
f("div", {
|
|
3511
3511
|
class: P(["overflow-hidden", t.value ? "max-h-[2000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3512
3512
|
}, [
|
|
3513
3513
|
f("ul", null, [
|
|
3514
|
-
(h(!0), C(z, null,
|
|
3514
|
+
(h(!0), C(z, null, Q(l.value, (c, d) => (h(), C("li", {
|
|
3515
3515
|
key: `${c.pos}-${d}`,
|
|
3516
3516
|
class: "mb-2"
|
|
3517
3517
|
}, [
|
|
3518
3518
|
f("h5", Pa, G(c.pos), 1),
|
|
3519
|
-
f("ul",
|
|
3520
|
-
(h(!0), C(z, null,
|
|
3521
|
-
key: `${
|
|
3519
|
+
f("ul", Ba, [
|
|
3520
|
+
(h(!0), C(z, null, Q(c.items, (T, g) => (h(), C("li", {
|
|
3521
|
+
key: `${T.word}-${g}`,
|
|
3522
3522
|
class: "mb-2"
|
|
3523
3523
|
}, [
|
|
3524
|
-
f("div",
|
|
3525
|
-
(h(!0), C(z, null,
|
|
3526
|
-
key: `${
|
|
3524
|
+
f("div", Na, [
|
|
3525
|
+
(h(!0), C(z, null, Q(T.synonym, (x, b) => (h(), C("span", {
|
|
3526
|
+
key: `${x}-${b}`,
|
|
3527
3527
|
class: "m-0.5 ml-0 font-normal badge badge-ghost bg-primary text-primary-content cursor-pointer border-0 rounded",
|
|
3528
|
-
onClick: (
|
|
3529
|
-
}, G(
|
|
3528
|
+
onClick: (A) => a(x)
|
|
3529
|
+
}, G(x), 9, Fa))), 128))
|
|
3530
3530
|
])
|
|
3531
3531
|
]))), 128))
|
|
3532
3532
|
])
|
|
@@ -3605,7 +3605,7 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3605
3605
|
},
|
|
3606
3606
|
emits: ["aiExplain"],
|
|
3607
3607
|
setup(e, { emit: n }) {
|
|
3608
|
-
const t = xe(), o =
|
|
3608
|
+
const t = xe(), o = O(() => t.isLoading("aiExplanation")), l = n;
|
|
3609
3609
|
function s() {
|
|
3610
3610
|
l("aiExplain");
|
|
3611
3611
|
}
|
|
@@ -3615,9 +3615,9 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3615
3615
|
f("div", Ya, [
|
|
3616
3616
|
Qa,
|
|
3617
3617
|
f("div", Xa, [
|
|
3618
|
-
o.value ? (h(),
|
|
3618
|
+
o.value ? (h(), Z(Mt, { key: 0 })) : R("", !0),
|
|
3619
3619
|
f("div", Ka, [
|
|
3620
|
-
|
|
3620
|
+
N(Ga, {
|
|
3621
3621
|
isExpanded: e.isAIExplain,
|
|
3622
3622
|
disabled: o.value,
|
|
3623
3623
|
onClick: s
|
|
@@ -3629,7 +3629,7 @@ const fa = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
3629
3629
|
class: P(["overflow-hidden", e.isAIExplain ? "max-h-[1000px] opacity-100" : "max-h-0 opacity-0"])
|
|
3630
3630
|
}, [
|
|
3631
3631
|
(i = e.explanation) != null && i.result ? (h(), C("ul", er, [
|
|
3632
|
-
(h(!0), C(z, null,
|
|
3632
|
+
(h(!0), C(z, null, Q(((u = e.explanation) == null ? void 0 : u.result.split(`
|
|
3633
3633
|
`)) || [], (c, d) => (h(), C("li", {
|
|
3634
3634
|
key: `${c}-${d}`,
|
|
3635
3635
|
innerHTML: c
|
|
@@ -3649,7 +3649,7 @@ function lr() {
|
|
|
3649
3649
|
const Xt = {
|
|
3650
3650
|
supportRTL: or,
|
|
3651
3651
|
removeRTL: lr
|
|
3652
|
-
}, sr = ["ar", "fa", "iw", "yi", "ur", "pa"], ar = (e) => (Et("data-v-
|
|
3652
|
+
}, sr = ["ar", "fa", "iw", "yi", "ur", "pa"], ar = (e) => (Et("data-v-6989ae32"), e = e(), $t(), e), rr = { class: "pb-6" }, ir = { class: "flex flex-col lg:flex-row lg:gap-2" }, ur = {
|
|
3653
3653
|
id: "input",
|
|
3654
3654
|
class: "w-full lg:w-[calc(50%-1rem)] flex mt-1"
|
|
3655
3655
|
}, cr = /* @__PURE__ */ ar(() => /* @__PURE__ */ f("div", { class: "w-6 h-4 mx-auto hidden lg:block" }, null, -1)), dr = { class: "w-full lg:w-[calc(50%-1rem)] flex mt-1" }, fr = {
|
|
@@ -3687,7 +3687,11 @@ const Xt = {
|
|
|
3687
3687
|
isFavorite: Boolean,
|
|
3688
3688
|
isAITranslate: Boolean,
|
|
3689
3689
|
isAIExplain: Boolean,
|
|
3690
|
-
aiExplainMinLength: Number
|
|
3690
|
+
aiExplainMinLength: Number,
|
|
3691
|
+
seedText: {
|
|
3692
|
+
type: String,
|
|
3693
|
+
default: ""
|
|
3694
|
+
}
|
|
3691
3695
|
},
|
|
3692
3696
|
emits: [
|
|
3693
3697
|
"opt",
|
|
@@ -3696,149 +3700,158 @@ const Xt = {
|
|
|
3696
3700
|
"favorite",
|
|
3697
3701
|
"aiTranslate",
|
|
3698
3702
|
"aiExplain",
|
|
3699
|
-
"copy"
|
|
3703
|
+
"copy",
|
|
3704
|
+
"seeded"
|
|
3700
3705
|
],
|
|
3701
3706
|
setup(e, { emit: n }) {
|
|
3702
|
-
const t = $(""), o = $(!1), l =
|
|
3703
|
-
const
|
|
3704
|
-
sr.includes(
|
|
3707
|
+
const t = $(""), o = $(!1), l = $(!1), s = e, r = le("translationStore"), a = le("ttsStore"), i = le("languageStore"), u = le("loaderStore"), c = n, d = () => {
|
|
3708
|
+
const _ = s.opt.target;
|
|
3709
|
+
sr.includes(_) ? Xt.supportRTL() : Xt.removeRTL();
|
|
3705
3710
|
};
|
|
3706
3711
|
F(
|
|
3707
|
-
() =>
|
|
3708
|
-
(
|
|
3709
|
-
|
|
3710
|
-
|
|
3712
|
+
() => s.translation,
|
|
3713
|
+
(_) => {
|
|
3714
|
+
var m;
|
|
3715
|
+
const E = (m = s.seedText) == null ? void 0 : m.trim();
|
|
3716
|
+
if (E && !l.value) {
|
|
3717
|
+
l.value = !0, o.value = !0, t.value = E, u.setLoading("translation", !0), r.reset();
|
|
3718
|
+
return;
|
|
3719
|
+
}
|
|
3720
|
+
if (!_) {
|
|
3721
|
+
l.value || u.setLoading("translation", !1);
|
|
3711
3722
|
return;
|
|
3712
3723
|
}
|
|
3713
|
-
const
|
|
3714
|
-
o.value &&
|
|
3724
|
+
const y = _.text || "", w = t.value || "";
|
|
3725
|
+
o.value && y !== w || (u.setLoading("translation", !1), t.value = y, r.init(_), a.reset());
|
|
3715
3726
|
},
|
|
3716
3727
|
{ immediate: !0 }
|
|
3717
3728
|
), F(
|
|
3718
|
-
[() =>
|
|
3719
|
-
([
|
|
3720
|
-
|
|
3729
|
+
[() => s.explanation, () => s.isAIExplain],
|
|
3730
|
+
([_]) => {
|
|
3731
|
+
_ != null && _.result && u.setLoading("aiExplanation", !1);
|
|
3721
3732
|
},
|
|
3722
3733
|
{ immediate: !0, deep: !0 }
|
|
3723
3734
|
), F(
|
|
3724
|
-
() =>
|
|
3725
|
-
(
|
|
3726
|
-
if (!
|
|
3727
|
-
|
|
3735
|
+
() => s.tts,
|
|
3736
|
+
(_) => {
|
|
3737
|
+
if (!_) {
|
|
3738
|
+
a.reset();
|
|
3728
3739
|
return;
|
|
3729
3740
|
}
|
|
3730
|
-
|
|
3741
|
+
a.set(_);
|
|
3731
3742
|
},
|
|
3732
3743
|
{ immediate: !0 }
|
|
3733
|
-
), F([() =>
|
|
3734
|
-
|
|
3735
|
-
}), F([() =>
|
|
3736
|
-
|
|
3744
|
+
), F([() => s.opt, () => s.languages], ([_, E]) => {
|
|
3745
|
+
i.init(_, E), d();
|
|
3746
|
+
}), F([() => i.src, () => i.target], ([_, E]) => {
|
|
3747
|
+
c("opt", { src: _, target: E }), !l.value && b(t.value);
|
|
3737
3748
|
}), se(() => {
|
|
3738
|
-
|
|
3749
|
+
i.init(s.opt, s.languages), d(), l.value && (b(t.value), c("seeded"), Y(() => {
|
|
3750
|
+
l.value = !1;
|
|
3751
|
+
}));
|
|
3739
3752
|
});
|
|
3740
|
-
function
|
|
3741
|
-
o.value = !0, t.value = "",
|
|
3753
|
+
function T() {
|
|
3754
|
+
o.value = !0, t.value = "", u.setLoading("translation", !1), s.isAITranslate && A(), r.reset();
|
|
3742
3755
|
}
|
|
3743
|
-
function
|
|
3744
|
-
o.value = !0, t.value =
|
|
3756
|
+
function g(_) {
|
|
3757
|
+
o.value = !0, t.value = _, b(_);
|
|
3745
3758
|
}
|
|
3746
|
-
function
|
|
3747
|
-
const
|
|
3748
|
-
|
|
3759
|
+
function x(_) {
|
|
3760
|
+
const E = _ === "src" ? r.text : r.result;
|
|
3761
|
+
c("loadTTS", { type: _, data: E });
|
|
3749
3762
|
}
|
|
3750
|
-
function
|
|
3751
|
-
|
|
3752
|
-
src:
|
|
3753
|
-
target:
|
|
3754
|
-
text:
|
|
3763
|
+
function b(_, E = i.src, y = i.target) {
|
|
3764
|
+
_ && (I(), t.value = _, u.setLoading("translation", !0), c("translate", {
|
|
3765
|
+
src: E,
|
|
3766
|
+
target: y,
|
|
3767
|
+
text: _
|
|
3755
3768
|
}));
|
|
3756
3769
|
}
|
|
3757
|
-
function
|
|
3758
|
-
|
|
3759
|
-
src:
|
|
3760
|
-
target:
|
|
3770
|
+
function A() {
|
|
3771
|
+
s.isAITranslate || u.setLoading("translation", !0), c("aiTranslate", {
|
|
3772
|
+
src: i.src,
|
|
3773
|
+
target: i.target,
|
|
3761
3774
|
text: t.value
|
|
3762
3775
|
});
|
|
3763
3776
|
}
|
|
3764
|
-
function
|
|
3765
|
-
|
|
3766
|
-
src:
|
|
3767
|
-
target:
|
|
3777
|
+
function V() {
|
|
3778
|
+
s.isAIExplain || u.setLoading("aiExplanation", !0), c("aiExplain", {
|
|
3779
|
+
src: i.src,
|
|
3780
|
+
target: i.target,
|
|
3768
3781
|
text: t.value
|
|
3769
3782
|
});
|
|
3770
3783
|
}
|
|
3771
|
-
function
|
|
3772
|
-
const
|
|
3773
|
-
|
|
3784
|
+
function I() {
|
|
3785
|
+
const _ = document.getElementById("input");
|
|
3786
|
+
_ && _.getBoundingClientRect().top < 0 && _.scrollIntoView({ behavior: "smooth" });
|
|
3774
3787
|
}
|
|
3775
|
-
return (
|
|
3776
|
-
var
|
|
3788
|
+
return (_, E) => {
|
|
3789
|
+
var y, w, m, S, D;
|
|
3777
3790
|
return h(), C("div", rr, [
|
|
3778
|
-
|
|
3791
|
+
N(gs),
|
|
3779
3792
|
f("div", ir, [
|
|
3780
3793
|
f("div", ur, [
|
|
3781
|
-
|
|
3794
|
+
N(pa, {
|
|
3782
3795
|
text: t.value,
|
|
3783
3796
|
isTTS: e.isTTS,
|
|
3784
|
-
onChange:
|
|
3785
|
-
onClear:
|
|
3786
|
-
onLoadTTS:
|
|
3797
|
+
onChange: g,
|
|
3798
|
+
onClear: T,
|
|
3799
|
+
onLoadTTS: E[0] || (E[0] = (v) => x("src")),
|
|
3787
3800
|
class: "flex-grow flex flex-col"
|
|
3788
3801
|
}, null, 8, ["text", "isTTS"])
|
|
3789
3802
|
]),
|
|
3790
3803
|
cr,
|
|
3791
3804
|
f("div", dr, [
|
|
3792
|
-
|
|
3805
|
+
N(ba, {
|
|
3793
3806
|
isFavoriteFeatureEnabled: e.isFavoriteFeatureEnabled,
|
|
3794
3807
|
isAITranslateFeatureEnabled: e.isAITranslateFeatureEnabled,
|
|
3795
3808
|
isAITranslate: e.isAITranslate,
|
|
3796
3809
|
isFavorite: e.isFavorite,
|
|
3797
3810
|
isTTS: e.isTTS,
|
|
3798
|
-
onCopy:
|
|
3799
|
-
var
|
|
3800
|
-
return
|
|
3811
|
+
onCopy: E[1] || (E[1] = (v) => {
|
|
3812
|
+
var p;
|
|
3813
|
+
return _.$emit("copy", (p = k(r)) == null ? void 0 : p.result);
|
|
3801
3814
|
}),
|
|
3802
|
-
onAiTranslate:
|
|
3803
|
-
onFavorite:
|
|
3804
|
-
onLoadTTS:
|
|
3815
|
+
onAiTranslate: A,
|
|
3816
|
+
onFavorite: E[2] || (E[2] = (v) => _.$emit("favorite")),
|
|
3817
|
+
onLoadTTS: E[3] || (E[3] = (v) => x("target")),
|
|
3805
3818
|
class: "flex-grow flex flex-col"
|
|
3806
3819
|
}, null, 8, ["isFavoriteFeatureEnabled", "isAITranslateFeatureEnabled", "isAITranslate", "isFavorite", "isTTS"])
|
|
3807
3820
|
])
|
|
3808
3821
|
]),
|
|
3809
3822
|
e.translation ? (h(), C("div", fr, [
|
|
3810
|
-
((
|
|
3811
|
-
|
|
3823
|
+
((y = k(r).result) == null ? void 0 : y.length) > e.aiExplainMinLength ? (h(), C("div", vr, [
|
|
3824
|
+
N(nr, {
|
|
3812
3825
|
isAIExplain: e.isAIExplain,
|
|
3813
3826
|
explanation: e.explanation,
|
|
3814
|
-
onAiExplain:
|
|
3827
|
+
onAiExplain: V
|
|
3815
3828
|
}, null, 8, ["isAIExplain", "explanation"])
|
|
3816
3829
|
])) : R("", !0),
|
|
3817
|
-
(
|
|
3830
|
+
(w = k(r).dictionary) != null && w.length ? (h(), C("div", pr, [
|
|
3818
3831
|
f("div", hr, [
|
|
3819
|
-
|
|
3832
|
+
N(Sa, { onTranslate: b })
|
|
3820
3833
|
])
|
|
3821
3834
|
])) : R("", !0),
|
|
3822
|
-
(
|
|
3835
|
+
(m = k(r).definitions) != null && m.length ? (h(), C("div", mr, [
|
|
3823
3836
|
f("div", gr, [
|
|
3824
|
-
|
|
3837
|
+
N(ka)
|
|
3825
3838
|
])
|
|
3826
3839
|
])) : R("", !0),
|
|
3827
|
-
(S = k(
|
|
3840
|
+
(S = k(r).synonyms) != null && S.length ? (h(), C("div", br, [
|
|
3828
3841
|
f("div", Cr, [
|
|
3829
|
-
|
|
3842
|
+
N(ja, { onTranslate: b })
|
|
3830
3843
|
])
|
|
3831
3844
|
])) : R("", !0),
|
|
3832
|
-
(
|
|
3845
|
+
(D = k(r).examples) != null && D.length ? (h(), C("div", xr, [
|
|
3833
3846
|
f("div", yr, [
|
|
3834
|
-
|
|
3847
|
+
N(Da)
|
|
3835
3848
|
])
|
|
3836
3849
|
])) : R("", !0)
|
|
3837
3850
|
])) : (h(), C("span", wr, "Service unavailable"))
|
|
3838
3851
|
]);
|
|
3839
3852
|
};
|
|
3840
3853
|
}
|
|
3841
|
-
}, Tr = /* @__PURE__ */ he(_r, [["__scopeId", "data-v-
|
|
3854
|
+
}, Tr = /* @__PURE__ */ he(_r, [["__scopeId", "data-v-6989ae32"]]), Sr = ["disabled"], Er = /* @__PURE__ */ f("path", {
|
|
3842
3855
|
"stroke-linecap": "round",
|
|
3843
3856
|
"stroke-linejoin": "round",
|
|
3844
3857
|
"stroke-width": "2",
|
|
@@ -3907,7 +3920,42 @@ const Xt = {
|
|
|
3907
3920
|
], 10, Ir)
|
|
3908
3921
|
], 8, Lr));
|
|
3909
3922
|
}
|
|
3910
|
-
}, Rr = {
|
|
3923
|
+
}, Rr = {
|
|
3924
|
+
class: "tooltip tooltip-bottom tooltip-small before:!bg-baseColor before:!border before:!border-solid before:!border-gray-200 before:![box-shadow:0px_1px_8px_0px_#3D44514D] before:!rounded-md before:!text-textSecondary before:!top-[90%] before:!text-xs before:!py-1 before:!px-2",
|
|
3925
|
+
"data-tip": "Translate"
|
|
3926
|
+
}, Pr = ["disabled"], Br = /* @__PURE__ */ f("path", {
|
|
3927
|
+
d: "m10.5 21 5.25-11.25L21 21m-9-3h7.5M3 5.621a48.474 48.474 0 0 1 6-.371m0 0c1.12 0 2.233.038 3.334.114M9 5.25V3m3.334 2.364C11.176 10.658 7.69 15.08 3 17.502m9.334-12.138c.896.061 1.785.147 2.666.257m-4.589 8.495a18.023 18.023 0 0 1-3.827-5.802",
|
|
3928
|
+
stroke: "currentColor",
|
|
3929
|
+
"stroke-width": "1.5",
|
|
3930
|
+
"stroke-linecap": "round",
|
|
3931
|
+
"stroke-linejoin": "round"
|
|
3932
|
+
}, null, -1), Nr = [
|
|
3933
|
+
Br
|
|
3934
|
+
], Fr = {
|
|
3935
|
+
__name: "TranslateBtn",
|
|
3936
|
+
props: {
|
|
3937
|
+
disabled: Boolean
|
|
3938
|
+
},
|
|
3939
|
+
setup(e) {
|
|
3940
|
+
return (n, t) => (h(), C("div", Rr, [
|
|
3941
|
+
f("button", {
|
|
3942
|
+
class: P(["btn btn-xs btn-circle", [
|
|
3943
|
+
{ "btn-ghost": !e.disabled },
|
|
3944
|
+
{ "!bg-transparent !border-none !shadow-none !ring-0": e.disabled }
|
|
3945
|
+
]]),
|
|
3946
|
+
disabled: e.disabled,
|
|
3947
|
+
"aria-label": "Translate"
|
|
3948
|
+
}, [
|
|
3949
|
+
(h(), C("svg", {
|
|
3950
|
+
class: P(["w-4 h-4 text-primary", [{ "opacity-100": !e.disabled }, { "opacity-50 transform ": e.disabled }]]),
|
|
3951
|
+
viewBox: "0 0 24 24",
|
|
3952
|
+
fill: "none",
|
|
3953
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3954
|
+
}, Nr, 2))
|
|
3955
|
+
], 10, Pr)
|
|
3956
|
+
]));
|
|
3957
|
+
}
|
|
3958
|
+
}, jr = { class: "flex flex-row px-2 pr-10 items-center bg-transparent relative" }, Hr = { class: "absolute right-1 top-1 flex flex-col items-center gap-0" }, Fn = {
|
|
3911
3959
|
__name: "InputBtnGroup",
|
|
3912
3960
|
props: {
|
|
3913
3961
|
loading: {
|
|
@@ -3922,6 +3970,10 @@ const Xt = {
|
|
|
3922
3970
|
type: Boolean,
|
|
3923
3971
|
default: !1
|
|
3924
3972
|
},
|
|
3973
|
+
hasTranslateBtn: {
|
|
3974
|
+
type: Boolean,
|
|
3975
|
+
default: !1
|
|
3976
|
+
},
|
|
3925
3977
|
hasClearBtn: {
|
|
3926
3978
|
type: Boolean,
|
|
3927
3979
|
default: !1
|
|
@@ -3939,33 +3991,38 @@ const Xt = {
|
|
|
3939
3991
|
default: !1
|
|
3940
3992
|
}
|
|
3941
3993
|
},
|
|
3942
|
-
emits: ["copy", "clear", "toggleDiff", "info"],
|
|
3994
|
+
emits: ["copy", "clear", "toggleDiff", "info", "translate"],
|
|
3943
3995
|
setup(e) {
|
|
3944
|
-
return (n, t) => (h(), C("div",
|
|
3945
|
-
e.loading ? (h(),
|
|
3996
|
+
return (n, t) => (h(), C("div", jr, [
|
|
3997
|
+
e.loading ? (h(), Z(Mt, {
|
|
3946
3998
|
key: 0,
|
|
3947
3999
|
class: "absolute right-6 top-2"
|
|
3948
4000
|
})) : R("", !0),
|
|
3949
|
-
f("div",
|
|
3950
|
-
e.showDiffToggle ? (h(),
|
|
4001
|
+
f("div", Hr, [
|
|
4002
|
+
e.showDiffToggle ? (h(), Z(Dr, {
|
|
3951
4003
|
key: 0,
|
|
3952
4004
|
disabled: e.loading,
|
|
3953
4005
|
isDiffMode: e.isDiffMode,
|
|
3954
4006
|
onToggle: t[0] || (t[0] = (o) => n.$emit("toggleDiff"))
|
|
3955
4007
|
}, null, 8, ["disabled", "isDiffMode"])) : R("", !0),
|
|
3956
|
-
e.
|
|
4008
|
+
e.hasTranslateBtn && e.src.trim() ? (h(), Z(Fr, {
|
|
3957
4009
|
key: 1,
|
|
3958
|
-
|
|
3959
|
-
|
|
4010
|
+
disabled: e.loading,
|
|
4011
|
+
onClick: t[1] || (t[1] = (o) => n.$emit("translate"))
|
|
3960
4012
|
}, null, 8, ["disabled"])) : R("", !0),
|
|
3961
|
-
e.
|
|
4013
|
+
e.hasClearBtn && e.src ? (h(), Z(Pn, {
|
|
3962
4014
|
key: 2,
|
|
3963
|
-
onClick: t[2] || (t[2] = (o) => n.$emit("
|
|
4015
|
+
onClick: t[2] || (t[2] = (o) => n.$emit("clear")),
|
|
4016
|
+
disabled: e.loading
|
|
4017
|
+
}, null, 8, ["disabled"])) : R("", !0),
|
|
4018
|
+
e.hasCopyBtn && e.src ? (h(), Z(Bn, {
|
|
4019
|
+
key: 3,
|
|
4020
|
+
onClick: t[3] || (t[3] = (o) => n.$emit("copy"))
|
|
3964
4021
|
})) : R("", !0)
|
|
3965
4022
|
])
|
|
3966
4023
|
]));
|
|
3967
4024
|
}
|
|
3968
|
-
},
|
|
4025
|
+
}, zr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }, Zr = ["onKeydown", "placeholder"], Ur = {
|
|
3969
4026
|
__name: "Input",
|
|
3970
4027
|
props: {
|
|
3971
4028
|
text: {
|
|
@@ -3995,14 +4052,14 @@ const Xt = {
|
|
|
3995
4052
|
return F(
|
|
3996
4053
|
() => t.text,
|
|
3997
4054
|
(c) => {
|
|
3998
|
-
o.value !== c && (o.value = c,
|
|
4055
|
+
o.value !== c && (o.value = c, Y(i));
|
|
3999
4056
|
}
|
|
4000
4057
|
), se(() => {
|
|
4001
|
-
o.value = t.text,
|
|
4058
|
+
o.value = t.text, Y(() => {
|
|
4002
4059
|
l.value.focus(), i();
|
|
4003
4060
|
});
|
|
4004
|
-
}), (c, d) => (h(), C("div",
|
|
4005
|
-
|
|
4061
|
+
}), (c, d) => (h(), C("div", zr, [
|
|
4062
|
+
N(Fn, {
|
|
4006
4063
|
src: e.text,
|
|
4007
4064
|
hasClearBtn: !0,
|
|
4008
4065
|
hasInfoBtn: !0,
|
|
@@ -4012,7 +4069,7 @@ const Xt = {
|
|
|
4012
4069
|
tt(f("textarea", {
|
|
4013
4070
|
ref_key: "textarea",
|
|
4014
4071
|
ref: l,
|
|
4015
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
4072
|
+
"onUpdate:modelValue": d[0] || (d[0] = (T) => o.value = T),
|
|
4016
4073
|
class: "w-full outline-none px-2 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden h-full",
|
|
4017
4074
|
autofocus: "",
|
|
4018
4075
|
rows: "2",
|
|
@@ -4020,7 +4077,7 @@ const Xt = {
|
|
|
4020
4077
|
onFocus: i,
|
|
4021
4078
|
onKeydown: Jn(ft(u, ["ctrl", "prevent"]), ["enter"]),
|
|
4022
4079
|
placeholder: `Min ${k(Le).IMPROVE_INPUT_MIN_LENGTH} characters. ${k(vt) ? "" : "Ctrl+Enter to improve"}`
|
|
4023
|
-
}, null, 40,
|
|
4080
|
+
}, null, 40, Zr), [
|
|
4024
4081
|
[
|
|
4025
4082
|
nt,
|
|
4026
4083
|
o.value,
|
|
@@ -4030,7 +4087,7 @@ const Xt = {
|
|
|
4030
4087
|
])
|
|
4031
4088
|
]));
|
|
4032
4089
|
}
|
|
4033
|
-
},
|
|
4090
|
+
}, Wr = /* @__PURE__ */ he(Ur, [["__scopeId", "data-v-66614870"]]);
|
|
4034
4091
|
function re() {
|
|
4035
4092
|
}
|
|
4036
4093
|
re.prototype = {
|
|
@@ -4038,54 +4095,54 @@ re.prototype = {
|
|
|
4038
4095
|
var o, l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, s = l.callback;
|
|
4039
4096
|
typeof l == "function" && (s = l, l = {});
|
|
4040
4097
|
var r = this;
|
|
4041
|
-
function a(
|
|
4042
|
-
return
|
|
4043
|
-
s(
|
|
4044
|
-
}, 0), !0) :
|
|
4098
|
+
function a(E) {
|
|
4099
|
+
return E = r.postProcess(E, l), s ? (setTimeout(function() {
|
|
4100
|
+
s(E);
|
|
4101
|
+
}, 0), !0) : E;
|
|
4045
4102
|
}
|
|
4046
4103
|
n = this.castInput(n, l), t = this.castInput(t, l), n = this.removeEmpty(this.tokenize(n, l)), t = this.removeEmpty(this.tokenize(t, l));
|
|
4047
4104
|
var i = t.length, u = n.length, c = 1, d = i + u;
|
|
4048
4105
|
l.maxEditLength != null && (d = Math.min(d, l.maxEditLength));
|
|
4049
|
-
var
|
|
4106
|
+
var T = (o = l.timeout) !== null && o !== void 0 ? o : 1 / 0, g = Date.now() + T, x = [{
|
|
4050
4107
|
oldPos: -1,
|
|
4051
4108
|
lastComponent: void 0
|
|
4052
|
-
}],
|
|
4053
|
-
if (
|
|
4054
|
-
return a(Kt(r,
|
|
4055
|
-
var
|
|
4056
|
-
function
|
|
4057
|
-
for (var
|
|
4058
|
-
var
|
|
4059
|
-
|
|
4060
|
-
var
|
|
4061
|
-
if (
|
|
4062
|
-
var
|
|
4063
|
-
|
|
4109
|
+
}], b = this.extractCommon(x[0], t, n, 0, l);
|
|
4110
|
+
if (x[0].oldPos + 1 >= u && b + 1 >= i)
|
|
4111
|
+
return a(Kt(r, x[0].lastComponent, t, n, r.useLongestToken));
|
|
4112
|
+
var A = -1 / 0, V = 1 / 0;
|
|
4113
|
+
function I() {
|
|
4114
|
+
for (var E = Math.max(A, -c); E <= Math.min(V, c); E += 2) {
|
|
4115
|
+
var y = void 0, w = x[E - 1], m = x[E + 1];
|
|
4116
|
+
w && (x[E - 1] = void 0);
|
|
4117
|
+
var S = !1;
|
|
4118
|
+
if (m) {
|
|
4119
|
+
var D = m.oldPos - E;
|
|
4120
|
+
S = m && 0 <= D && D < i;
|
|
4064
4121
|
}
|
|
4065
|
-
var v =
|
|
4066
|
-
if (!
|
|
4067
|
-
|
|
4122
|
+
var v = w && w.oldPos + 1 < u;
|
|
4123
|
+
if (!S && !v) {
|
|
4124
|
+
x[E] = void 0;
|
|
4068
4125
|
continue;
|
|
4069
4126
|
}
|
|
4070
|
-
if (!v ||
|
|
4071
|
-
return a(Kt(r,
|
|
4072
|
-
|
|
4127
|
+
if (!v || S && w.oldPos < m.oldPos ? y = r.addToPath(m, !0, !1, 0, l) : y = r.addToPath(w, !1, !0, 1, l), b = r.extractCommon(y, t, n, E, l), y.oldPos + 1 >= u && b + 1 >= i)
|
|
4128
|
+
return a(Kt(r, y.lastComponent, t, n, r.useLongestToken));
|
|
4129
|
+
x[E] = y, y.oldPos + 1 >= u && (V = Math.min(V, E - 1)), b + 1 >= i && (A = Math.max(A, E + 1));
|
|
4073
4130
|
}
|
|
4074
4131
|
c++;
|
|
4075
4132
|
}
|
|
4076
4133
|
if (s)
|
|
4077
|
-
(function
|
|
4134
|
+
(function E() {
|
|
4078
4135
|
setTimeout(function() {
|
|
4079
|
-
if (c > d || Date.now() >
|
|
4136
|
+
if (c > d || Date.now() > g)
|
|
4080
4137
|
return s();
|
|
4081
|
-
|
|
4138
|
+
I() || E();
|
|
4082
4139
|
}, 0);
|
|
4083
4140
|
})();
|
|
4084
4141
|
else
|
|
4085
|
-
for (; c <= d && Date.now() <=
|
|
4086
|
-
var
|
|
4087
|
-
if (
|
|
4088
|
-
return
|
|
4142
|
+
for (; c <= d && Date.now() <= g; ) {
|
|
4143
|
+
var _ = I();
|
|
4144
|
+
if (_)
|
|
4145
|
+
return _;
|
|
4089
4146
|
}
|
|
4090
4147
|
},
|
|
4091
4148
|
addToPath: function(n, t, o, l, s) {
|
|
@@ -4154,11 +4211,11 @@ function Kt(e, n, t, o, l) {
|
|
|
4154
4211
|
d.value = e.join(o.slice(c, c + d.count)), c += d.count;
|
|
4155
4212
|
else {
|
|
4156
4213
|
if (!d.added && l) {
|
|
4157
|
-
var
|
|
4158
|
-
|
|
4159
|
-
var
|
|
4160
|
-
return
|
|
4161
|
-
}), d.value = e.join(
|
|
4214
|
+
var T = t.slice(u, u + d.count);
|
|
4215
|
+
T = T.map(function(g, x) {
|
|
4216
|
+
var b = o[c + x];
|
|
4217
|
+
return b.length > g.length ? b : g;
|
|
4218
|
+
}), d.value = e.join(T);
|
|
4162
4219
|
} else
|
|
4163
4220
|
d.value = e.join(t.slice(u, u + d.count));
|
|
4164
4221
|
u += d.count, d.added || (c += d.count);
|
|
@@ -4201,9 +4258,9 @@ function qe(e, n) {
|
|
|
4201
4258
|
return xt(e, n, "");
|
|
4202
4259
|
}
|
|
4203
4260
|
function nn(e, n) {
|
|
4204
|
-
return n.slice(0,
|
|
4261
|
+
return n.slice(0, qr(e, n));
|
|
4205
4262
|
}
|
|
4206
|
-
function
|
|
4263
|
+
function qr(e, n) {
|
|
4207
4264
|
var t = 0;
|
|
4208
4265
|
e.length > n.length && (t = e.length - n.length);
|
|
4209
4266
|
var o = n.length;
|
|
@@ -4223,7 +4280,7 @@ function Hr(e, n) {
|
|
|
4223
4280
|
}
|
|
4224
4281
|
return s;
|
|
4225
4282
|
}
|
|
4226
|
-
var et = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",
|
|
4283
|
+
var et = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}", Gr = new RegExp("[".concat(et, "]+|\\s+|[^").concat(et, "]"), "ug"), rt = new re();
|
|
4227
4284
|
rt.equals = function(e, n, t) {
|
|
4228
4285
|
return t.ignoreCase && (e = e.toLowerCase(), n = n.toLowerCase()), e.trim() === n.trim();
|
|
4229
4286
|
};
|
|
@@ -4236,7 +4293,7 @@ rt.tokenize = function(e) {
|
|
|
4236
4293
|
return s.segment;
|
|
4237
4294
|
});
|
|
4238
4295
|
} else
|
|
4239
|
-
t = e.match(
|
|
4296
|
+
t = e.match(Gr) || [];
|
|
4240
4297
|
var o = [], l = null;
|
|
4241
4298
|
return t.forEach(function(s) {
|
|
4242
4299
|
/\s/.test(s) ? l == null ? o.push(s) : o.push(o.pop() + s) : /\s/.test(l) ? o[o.length - 1] == l ? o.push(o.pop() + s) : o.push(l + s) : o.push(s), l = s;
|
|
@@ -4269,16 +4326,16 @@ function on(e, n, t, o) {
|
|
|
4269
4326
|
} else if (t)
|
|
4270
4327
|
e && (t.value = t.value.replace(/^\s*/, "")), o && (o.value = o.value.replace(/^\s*/, ""));
|
|
4271
4328
|
else if (e && o) {
|
|
4272
|
-
var c = o.value.match(/^\s*/)[0], d = n.value.match(/^\s*/)[0],
|
|
4273
|
-
n.value = ke(n.value,
|
|
4274
|
-
var
|
|
4275
|
-
n.value = qe(n.value,
|
|
4329
|
+
var c = o.value.match(/^\s*/)[0], d = n.value.match(/^\s*/)[0], T = n.value.match(/\s*$/)[0], g = en(c, d);
|
|
4330
|
+
n.value = ke(n.value, g);
|
|
4331
|
+
var x = tn(ke(c, g), T);
|
|
4332
|
+
n.value = qe(n.value, x), o.value = Ct(o.value, c, x), e.value = xt(e.value, c, c.slice(0, c.length - x.length));
|
|
4276
4333
|
} else if (o) {
|
|
4277
|
-
var
|
|
4278
|
-
n.value = qe(n.value,
|
|
4334
|
+
var b = o.value.match(/^\s*/)[0], A = n.value.match(/\s*$/)[0], V = nn(A, b);
|
|
4335
|
+
n.value = qe(n.value, V);
|
|
4279
4336
|
} else if (e) {
|
|
4280
|
-
var
|
|
4281
|
-
n.value = ke(n.value,
|
|
4337
|
+
var I = e.value.match(/\s*$/)[0], _ = n.value.match(/^\s*/)[0], E = nn(I, _);
|
|
4338
|
+
n.value = ke(n.value, E);
|
|
4282
4339
|
}
|
|
4283
4340
|
}
|
|
4284
4341
|
var jn = new re();
|
|
@@ -4286,7 +4343,7 @@ jn.tokenize = function(e) {
|
|
|
4286
4343
|
var n = new RegExp("(\\r?\\n)|[".concat(et, "]+|[^\\S\\n\\r]+|[^").concat(et, "]"), "ug");
|
|
4287
4344
|
return e.match(n) || [];
|
|
4288
4345
|
};
|
|
4289
|
-
function
|
|
4346
|
+
function Jr(e, n, t) {
|
|
4290
4347
|
return jn.diff(e, n, t);
|
|
4291
4348
|
}
|
|
4292
4349
|
var At = new re();
|
|
@@ -4308,12 +4365,12 @@ At.equals = function(e, n, t) {
|
|
|
4308
4365
|
`) && (e = e.slice(0, -1)), n.endsWith(`
|
|
4309
4366
|
`) && (n = n.slice(0, -1))), re.prototype.equals.call(this, e, n, t);
|
|
4310
4367
|
};
|
|
4311
|
-
var
|
|
4312
|
-
|
|
4368
|
+
var Yr = new re();
|
|
4369
|
+
Yr.tokenize = function(e) {
|
|
4313
4370
|
return e.split(/(\S.+?[.!?])(?=\s+|$)/);
|
|
4314
4371
|
};
|
|
4315
|
-
var
|
|
4316
|
-
|
|
4372
|
+
var Qr = new re();
|
|
4373
|
+
Qr.tokenize = function(e) {
|
|
4317
4374
|
return e.split(/([{}:;,]|\s+)/);
|
|
4318
4375
|
};
|
|
4319
4376
|
function yt(e) {
|
|
@@ -4324,17 +4381,17 @@ function yt(e) {
|
|
|
4324
4381
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
4325
4382
|
}, yt(e);
|
|
4326
4383
|
}
|
|
4327
|
-
var
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4384
|
+
var Be = new re();
|
|
4385
|
+
Be.useLongestToken = !0;
|
|
4386
|
+
Be.tokenize = At.tokenize;
|
|
4387
|
+
Be.castInput = function(e, n) {
|
|
4331
4388
|
var t = n.undefinedReplacement, o = n.stringifyReplacer, l = o === void 0 ? function(s, r) {
|
|
4332
4389
|
return typeof r > "u" ? t : r;
|
|
4333
4390
|
} : o;
|
|
4334
4391
|
return typeof e == "string" ? e : JSON.stringify(wt(e, null, null, l), l, " ");
|
|
4335
4392
|
};
|
|
4336
|
-
|
|
4337
|
-
return re.prototype.equals.call(
|
|
4393
|
+
Be.equals = function(e, n, t) {
|
|
4394
|
+
return re.prototype.equals.call(Be, e.replace(/,([\r\n])/g, "$1"), n.replace(/,([\r\n])/g, "$1"), t);
|
|
4338
4395
|
};
|
|
4339
4396
|
function wt(e, n, t, o, l) {
|
|
4340
4397
|
n = n || [], t = t || [], o && (e = o(l, e));
|
|
@@ -4367,7 +4424,7 @@ _t.tokenize = function(e) {
|
|
|
4367
4424
|
_t.join = _t.removeEmpty = function(e) {
|
|
4368
4425
|
return e;
|
|
4369
4426
|
};
|
|
4370
|
-
const
|
|
4427
|
+
const Xr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }, Kr = { class: "flex justify-end items-center mb-1" }, ei = { class: "bg-transparent" }, ti = ["innerHTML"], ni = {
|
|
4371
4428
|
__name: "Result",
|
|
4372
4429
|
props: {
|
|
4373
4430
|
text: {
|
|
@@ -4383,44 +4440,51 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4383
4440
|
default: "improve"
|
|
4384
4441
|
}
|
|
4385
4442
|
},
|
|
4386
|
-
emits: ["copy", "change", "clear"],
|
|
4443
|
+
emits: ["copy", "change", "clear", "translate"],
|
|
4387
4444
|
setup(e, { emit: n }) {
|
|
4388
|
-
const t = e, o = xe(), l =
|
|
4445
|
+
const t = e, o = xe(), l = O(() => o.isLoading("writing")), s = O(() => l.value ? "" : t.text), r = $(""), a = $(Le.DEFAULT_DIFF_MODE), { textarea: i } = st({ input: s, styleProp: "minHeight" }), u = n;
|
|
4389
4446
|
function c() {
|
|
4390
4447
|
!l.value && s.value && u("copy", s.value);
|
|
4391
4448
|
}
|
|
4392
|
-
function d(
|
|
4393
|
-
|
|
4449
|
+
function d() {
|
|
4450
|
+
var b;
|
|
4451
|
+
const x = (b = s.value) == null ? void 0 : b.trim();
|
|
4452
|
+
!l.value && x && u("translate", x);
|
|
4453
|
+
}
|
|
4454
|
+
function T(x, b) {
|
|
4455
|
+
return Jr(x, b).map((V) => V.added ? `<span class="bg-addedBg inline leading-snug animate-addedText">${V.value}</span>` : V.removed ? `<span class="bg-removedBg inline leading-snug animate-removedText">${V.value}</span>` : V.value).join("");
|
|
4394
4456
|
}
|
|
4395
|
-
function
|
|
4457
|
+
function g() {
|
|
4396
4458
|
a.value = !a.value, Le.DEFAULT_DIFF_MODE = a.value;
|
|
4397
4459
|
}
|
|
4398
4460
|
return F(
|
|
4399
4461
|
() => t.text,
|
|
4400
|
-
(
|
|
4401
|
-
t.type === "check" && (r.value =
|
|
4462
|
+
(x) => {
|
|
4463
|
+
t.type === "check" && (r.value = T(t.originalText, x));
|
|
4402
4464
|
},
|
|
4403
4465
|
{ immediate: !0 }
|
|
4404
|
-
), F(s, (
|
|
4405
|
-
u("change",
|
|
4406
|
-
}), (
|
|
4407
|
-
f("div",
|
|
4408
|
-
|
|
4466
|
+
), F(s, (x) => {
|
|
4467
|
+
u("change", x);
|
|
4468
|
+
}), (x, b) => (h(), C("div", Xr, [
|
|
4469
|
+
f("div", Kr, [
|
|
4470
|
+
N(Fn, {
|
|
4409
4471
|
loading: l.value,
|
|
4410
4472
|
src: s.value,
|
|
4411
4473
|
hasCopyBtn: !l.value && !!s.value,
|
|
4474
|
+
hasTranslateBtn: !l.value && !!s.value,
|
|
4412
4475
|
showDiffToggle: e.type === "check",
|
|
4413
4476
|
isDiffMode: a.value,
|
|
4414
4477
|
onCopy: c,
|
|
4415
|
-
|
|
4416
|
-
|
|
4478
|
+
onTranslate: d,
|
|
4479
|
+
onToggleDiff: g
|
|
4480
|
+
}, null, 8, ["loading", "src", "hasCopyBtn", "hasTranslateBtn", "showDiffToggle", "isDiffMode"])
|
|
4417
4481
|
]),
|
|
4418
|
-
f("div",
|
|
4482
|
+
f("div", ei, [
|
|
4419
4483
|
e.type !== "check" || !a.value ? tt((h(), C("textarea", {
|
|
4420
4484
|
key: 0,
|
|
4421
4485
|
ref_key: "textarea",
|
|
4422
4486
|
ref: i,
|
|
4423
|
-
"onUpdate:modelValue":
|
|
4487
|
+
"onUpdate:modelValue": b[0] || (b[0] = (A) => s.value = A),
|
|
4424
4488
|
class: "w-full outline-none px-1 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden font-sans text-base leading-normal",
|
|
4425
4489
|
readonly: "",
|
|
4426
4490
|
spellcheck: "false"
|
|
@@ -4430,27 +4494,27 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4430
4494
|
key: 1,
|
|
4431
4495
|
class: "w-full min-h-[80px] outline-none px-1 pr-8 bg-transparent text-base-content resize-none pb-3 overflow-x-hidden overflow-y-hidden whitespace-pre-wrap break-words font-sans text-base leading-normal",
|
|
4432
4496
|
innerHTML: l.value ? "" : r.value
|
|
4433
|
-
}, null, 8,
|
|
4497
|
+
}, null, 8, ti))
|
|
4434
4498
|
])
|
|
4435
4499
|
]));
|
|
4436
4500
|
}
|
|
4437
|
-
},
|
|
4438
|
-
src:
|
|
4501
|
+
}, oi = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20stroke='currentColor'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='2'%20d='M21%2012h1m-3.5-6.5%201-1M12%203V2M5.5%205.5l-1-1M3%2012H2m8%2010h4m3-10a5%205%200%201%200-7%204.584V19h4v-2.416A5.001%205.001%200%200%200%2017%2012z'/%3e%3c/svg%3e", li = "data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6.8544%203.20309C5.39975%202.89815%204.26277%201.76117%203.95787%200.30649C3.92042%200.12792%203.76292%200%203.58041%200C3.3979%200%203.2404%200.12792%203.20297%200.30652C2.89805%201.76117%201.76107%202.89812%200.306418%203.20302C0.127818%203.24045%20-0.00012207%203.39798%20-0.00012207%203.58046C-0.00012207%203.76295%200.127798%203.92047%200.306418%203.9579C1.76105%204.26285%202.89798%205.3998%203.2029%206.85448C3.24033%207.03307%203.39783%207.16102%203.58034%207.16102C3.76282%207.16102%203.92035%207.0331%203.95778%206.85448C4.26272%205.39983%205.39973%204.26287%206.85438%203.95799C7.03297%203.92056%207.16092%203.76306%207.16092%203.58056C7.1609%203.39805%207.03297%203.24052%206.8544%203.20309ZM3.58036%205.60938C3.14292%204.73132%202.42956%204.01792%201.55151%203.58049C2.42958%203.14305%203.14297%202.42968%203.58041%201.55161C4.01785%202.4297%204.73122%203.14307%205.60926%203.58053C4.73119%204.01797%204.0178%204.73132%203.58036%205.60938Z'%20fill='currentColor'/%3e%3cpath%20d='M6.21683%209.574C5.53147%209.4303%204.99578%208.8947%204.85209%208.2093C4.81466%208.0307%204.65716%207.90271%204.47465%207.90271C4.29217%207.90271%204.13464%208.0306%204.09721%208.2092C3.95352%208.8946%203.4178%209.4303%202.73244%209.574C2.55385%209.6114%202.4259%209.7689%202.4259%209.9514C2.4259%2010.1339%202.55383%2010.2914%202.73244%2010.3288C3.41778%2010.4725%203.95349%2011.0082%204.09716%2011.6936C4.13459%2011.8722%204.2921%2012.0002%204.4746%2012.0002C4.65709%2012.0002%204.81461%2011.8723%204.85204%2011.6936C4.99574%2011.0082%205.53145%2010.4725%206.21683%2010.3289C6.39543%2010.2914%206.52337%2010.1339%206.52337%209.9514C6.52337%209.7689%206.39545%209.6114%206.21683%209.574ZM4.47463%2010.6408C4.29163%2010.3688%204.05725%2010.1345%203.78526%209.9515C4.0573%209.7684%204.29163%209.5341%204.47463%209.2621C4.65765%209.5341%204.892%209.7685%205.164%209.9515C4.892%2010.1345%204.65763%2010.3688%204.47463%2010.6408Z'%20fill='currentColor'/%3e%3cpath%20d='M11.4271%206.00324C10.5007%205.80904%209.7766%205.08496%209.5825%204.15859C9.545%203.98%209.3875%203.85205%209.205%203.85205C9.0225%203.85205%208.865%203.97995%208.8276%204.15857C8.6334%205.08496%207.90932%205.80902%206.98293%206.0032C6.80434%206.04063%206.67639%206.19815%206.67639%206.38064C6.67639%206.56312%206.80431%206.72062%206.98293%206.75807C7.9093%206.95228%208.6334%207.67633%208.8275%208.6027C8.865%208.7813%209.0225%208.9093%209.205%208.9093C9.3875%208.9093%209.545%208.7814%209.5824%208.6027C9.7766%207.67633%2010.5007%206.95228%2011.4271%206.75812C11.6057%206.72067%2011.7336%206.56317%2011.7336%206.38068C11.7336%206.1982%2011.6057%206.04067%2011.4271%206.00324ZM9.205%207.47681C8.9365%207.02634%208.5593%206.64914%208.1089%206.38066C8.5593%206.11218%208.9365%205.73502%209.205%205.28453C9.4735%205.73502%209.8507%206.11221%2010.3012%206.38068C9.8507%206.64916%209.4735%207.02636%209.205%207.47681Z'%20fill='currentColor'/%3e%3c/svg%3e", si = "data:image/svg+xml,%3csvg%20class='w-5%20h-5'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='currentColor'%20aria-hidden='true'%20%3e%3cpath%20fill-rule='evenodd'%20d='M5.293%207.293a1%201%200%20011.414%200L10%2010.586l3.293-3.293a1%201%200%20111.414%201.414l-4%204a1%201%200%2001-1.414%200l-4-4a1%201%200%20010-1.414z'%20clip-rule='evenodd'%20/%3e%3c/svg%3e", ai = "data:image/svg+xml,%3csvg%20class='w-5%20h-5'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='currentColor'%20aria-hidden='true'%20%3e%3cpath%20fill-rule='evenodd'%20d='M5.293%207.293a1%201%200%20011.414%200L10%2010.586l3.293-3.293a1%201%200%20111.414%201.414l-4%204a1%201%200%2001-1.414%200l-4-4a1%201%200%20010-1.414z'%20clip-rule='evenodd'%20/%3e%3c/svg%3e", Vt = (e) => (Et("data-v-345bc0b4"), e = e(), $t(), e), ri = { class: "flex rounded-md w-full" }, ii = ["disabled"], ui = { class: "flex items-center text-xs" }, ci = ["src"], di = /* @__PURE__ */ Vt(() => /* @__PURE__ */ f("div", { class: "w-px bg-base-300" }, null, -1)), fi = { class: "relative block" }, vi = ["aria-expanded", "disabled"], pi = /* @__PURE__ */ Vt(() => /* @__PURE__ */ f("span", { class: "sr-only" }, "Open options", -1)), hi = /* @__PURE__ */ Vt(() => /* @__PURE__ */ f("img", {
|
|
4502
|
+
src: ai,
|
|
4439
4503
|
alt: "Chevron down",
|
|
4440
4504
|
class: "w-4 h-4 fill-current"
|
|
4441
|
-
}, null, -1)),
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
],
|
|
4505
|
+
}, null, -1)), mi = [
|
|
4506
|
+
pi,
|
|
4507
|
+
hi
|
|
4508
|
+
], gi = {
|
|
4445
4509
|
key: 0,
|
|
4446
4510
|
class: "origin-top-right absolute left-0 mt-1 w-full rounded-md shadow-lg bg-base-100 ring-1 ring-base-300 focus:outline-none z-50",
|
|
4447
4511
|
role: "menu",
|
|
4448
4512
|
"aria-orientation": "vertical",
|
|
4449
4513
|
"aria-labelledby": "options-menu"
|
|
4450
|
-
},
|
|
4514
|
+
}, bi = {
|
|
4451
4515
|
class: "py-1",
|
|
4452
4516
|
role: "none"
|
|
4453
|
-
},
|
|
4517
|
+
}, Ci = ["onClick"], xi = { class: "flex items-center" }, yi = ["src"], wi = {
|
|
4454
4518
|
__name: "ButtonSelect",
|
|
4455
4519
|
props: {
|
|
4456
4520
|
modelValue: {
|
|
@@ -4476,37 +4540,37 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4476
4540
|
},
|
|
4477
4541
|
emits: ["update:modelValue", "action"],
|
|
4478
4542
|
setup(e, { emit: n }) {
|
|
4479
|
-
const t = e, o = n, l = $(!1), s = $(t.modelValue), r = $(null), a =
|
|
4543
|
+
const t = e, o = n, l = $(!1), s = $(t.modelValue), r = $(null), a = O(() => t.options.find((g) => g.value === s.value) || t.options[0]);
|
|
4480
4544
|
function i() {
|
|
4481
4545
|
o("action");
|
|
4482
4546
|
}
|
|
4483
4547
|
function u() {
|
|
4484
4548
|
t.loading || (l.value = !l.value);
|
|
4485
4549
|
}
|
|
4486
|
-
function c(
|
|
4487
|
-
|
|
4550
|
+
function c(g) {
|
|
4551
|
+
g.value !== s.value && (s.value = g.value, o("update:modelValue", g.value)), l.value = !1;
|
|
4488
4552
|
}
|
|
4489
|
-
function d(
|
|
4490
|
-
return new URL((/* @__PURE__ */ Object.assign({ "../../assets/icons/ai-explain.svg":
|
|
4553
|
+
function d(g) {
|
|
4554
|
+
return new URL((/* @__PURE__ */ Object.assign({ "../../assets/icons/ai-explain.svg": oi, "../../assets/icons/ai-translate.svg": li, "../../assets/icons/chevron-down.svg": si }))[`../../assets/icons/${g}.svg`], import.meta.url).href;
|
|
4491
4555
|
}
|
|
4492
|
-
function
|
|
4493
|
-
r.value && !r.value.contains(
|
|
4556
|
+
function T(g) {
|
|
4557
|
+
r.value && !r.value.contains(g.target) && (l.value = !1);
|
|
4494
4558
|
}
|
|
4495
4559
|
return F(
|
|
4496
4560
|
() => t.modelValue,
|
|
4497
|
-
(
|
|
4498
|
-
|
|
4561
|
+
(g) => {
|
|
4562
|
+
g !== s.value && (s.value = g);
|
|
4499
4563
|
}
|
|
4500
4564
|
), F(
|
|
4501
4565
|
() => t.isTextEmpty,
|
|
4502
|
-
(
|
|
4503
|
-
|
|
4566
|
+
(g) => {
|
|
4567
|
+
g && (l.value = !1);
|
|
4504
4568
|
}
|
|
4505
4569
|
), se(() => {
|
|
4506
|
-
document.addEventListener("click",
|
|
4570
|
+
document.addEventListener("click", T);
|
|
4507
4571
|
}), Fe(() => {
|
|
4508
|
-
document.removeEventListener("click",
|
|
4509
|
-
}), (
|
|
4572
|
+
document.removeEventListener("click", T);
|
|
4573
|
+
}), (g, x) => (h(), C("div", {
|
|
4510
4574
|
class: "relative inline-block text-left flex-1",
|
|
4511
4575
|
ref_key: "dropdownRef",
|
|
4512
4576
|
ref: r
|
|
@@ -4517,7 +4581,7 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4517
4581
|
e.isTextEmpty || t.loading ? "border-base-300" : "border-primary"
|
|
4518
4582
|
])
|
|
4519
4583
|
}, [
|
|
4520
|
-
f("div",
|
|
4584
|
+
f("div", ri, [
|
|
4521
4585
|
f("button", {
|
|
4522
4586
|
onClick: i,
|
|
4523
4587
|
class: P(["px-2 py-1 text-sm font-medium rounded-s focus:z-10 focus:outline-none flex-grow text-left relative", [
|
|
@@ -4525,17 +4589,17 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4525
4589
|
]]),
|
|
4526
4590
|
disabled: e.isTextEmpty || t.loading
|
|
4527
4591
|
}, [
|
|
4528
|
-
f("div",
|
|
4592
|
+
f("div", ui, [
|
|
4529
4593
|
f("img", {
|
|
4530
4594
|
src: d(a.value.icon),
|
|
4531
4595
|
alt: "",
|
|
4532
4596
|
class: "w-4 h-4 mr-2"
|
|
4533
|
-
}, null, 8,
|
|
4597
|
+
}, null, 8, ci),
|
|
4534
4598
|
Ee(" " + G(a.value.label), 1)
|
|
4535
4599
|
])
|
|
4536
|
-
], 10,
|
|
4537
|
-
|
|
4538
|
-
f("div",
|
|
4600
|
+
], 10, ii),
|
|
4601
|
+
di,
|
|
4602
|
+
f("div", fi, [
|
|
4539
4603
|
f("button", {
|
|
4540
4604
|
onClick: u,
|
|
4541
4605
|
type: "button",
|
|
@@ -4545,36 +4609,36 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4545
4609
|
"aria-haspopup": "true",
|
|
4546
4610
|
"aria-expanded": l.value,
|
|
4547
4611
|
disabled: e.isTextEmpty || t.loading
|
|
4548
|
-
},
|
|
4612
|
+
}, mi, 10, vi)
|
|
4549
4613
|
])
|
|
4550
4614
|
])
|
|
4551
4615
|
], 2),
|
|
4552
|
-
l.value ? (h(), C("div",
|
|
4553
|
-
f("div",
|
|
4554
|
-
(h(!0), C(z, null,
|
|
4555
|
-
key:
|
|
4556
|
-
onClick: (
|
|
4616
|
+
l.value ? (h(), C("div", gi, [
|
|
4617
|
+
f("div", bi, [
|
|
4618
|
+
(h(!0), C(z, null, Q(e.options, (b) => (h(), C("a", {
|
|
4619
|
+
key: b.value,
|
|
4620
|
+
onClick: (A) => c(b),
|
|
4557
4621
|
href: "#",
|
|
4558
4622
|
class: "block px-1 py-1 text-sm text-base-content hover:bg-base-200 hover:text-primary",
|
|
4559
4623
|
role: "menuitem"
|
|
4560
4624
|
}, [
|
|
4561
|
-
f("div",
|
|
4625
|
+
f("div", xi, [
|
|
4562
4626
|
f("img", {
|
|
4563
|
-
src: d(
|
|
4627
|
+
src: d(b.icon),
|
|
4564
4628
|
alt: "",
|
|
4565
4629
|
class: "w-4 h-4 mr-2"
|
|
4566
|
-
}, null, 8,
|
|
4567
|
-
Ee(" " + G(
|
|
4630
|
+
}, null, 8, yi),
|
|
4631
|
+
Ee(" " + G(b.label), 1)
|
|
4568
4632
|
])
|
|
4569
|
-
], 8,
|
|
4633
|
+
], 8, Ci))), 128))
|
|
4570
4634
|
])
|
|
4571
4635
|
])) : R("", !0)
|
|
4572
4636
|
], 512));
|
|
4573
4637
|
}
|
|
4574
|
-
},
|
|
4638
|
+
}, _i = /* @__PURE__ */ he(wi, [["__scopeId", "data-v-345bc0b4"]]), Ti = { class: "w-full mt-1" }, Si = { class: "flex flex-col lg:flex-row lg:items-stretch lg:space-x-4 lg:min-h-[50vh]" }, Ei = { class: "lg:flex-grow lg:w-0 flex flex-col" }, $i = { class: "flex flex-row lg:flex-col items-center justify-center place-content-center min-h-full" }, Oi = {
|
|
4575
4639
|
class: "flex items-center",
|
|
4576
4640
|
style: { "max-width": "300px" }
|
|
4577
|
-
},
|
|
4641
|
+
}, Li = { class: "lg:flex-grow lg:w-0 flex flex-col" }, Ii = {
|
|
4578
4642
|
__name: "WriteTab",
|
|
4579
4643
|
props: {
|
|
4580
4644
|
opt: {
|
|
@@ -4590,7 +4654,7 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4590
4654
|
default: null
|
|
4591
4655
|
}
|
|
4592
4656
|
},
|
|
4593
|
-
emits: ["opt", "write", "copy"],
|
|
4657
|
+
emits: ["opt", "write", "copy", "translate"],
|
|
4594
4658
|
setup(e, { emit: n }) {
|
|
4595
4659
|
const t = le("writingStore"), o = le("loaderStore"), l = e, s = n, r = [
|
|
4596
4660
|
{ value: "check", label: "Check", icon: "ai-translate" },
|
|
@@ -4602,52 +4666,52 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4602
4666
|
];
|
|
4603
4667
|
F(
|
|
4604
4668
|
() => l.writing,
|
|
4605
|
-
(
|
|
4606
|
-
o.setLoading("writing", !1),
|
|
4669
|
+
(b) => {
|
|
4670
|
+
o.setLoading("writing", !1), b && (t.reset(), t.init(b));
|
|
4607
4671
|
},
|
|
4608
4672
|
{ immediate: !0 }
|
|
4609
4673
|
), F(
|
|
4610
4674
|
() => l.opt,
|
|
4611
|
-
(
|
|
4612
|
-
|
|
4675
|
+
(b) => {
|
|
4676
|
+
b.src !== t.src && t.init({ ...t.$state, src: b.src });
|
|
4613
4677
|
},
|
|
4614
4678
|
{ deep: !0 }
|
|
4615
4679
|
);
|
|
4616
|
-
function a(
|
|
4617
|
-
t.init({ ...t.$state, text:
|
|
4680
|
+
function a(b) {
|
|
4681
|
+
t.init({ ...t.$state, text: b });
|
|
4618
4682
|
}
|
|
4619
4683
|
function i() {
|
|
4620
4684
|
t.reset();
|
|
4621
4685
|
}
|
|
4622
|
-
function u(
|
|
4623
|
-
t.init({ ...t.$state, result:
|
|
4686
|
+
function u(b) {
|
|
4687
|
+
t.init({ ...t.$state, result: b });
|
|
4624
4688
|
}
|
|
4625
4689
|
function c() {
|
|
4626
4690
|
t.init({ ...t.$state, result: "", suggestions: [] });
|
|
4627
4691
|
}
|
|
4628
|
-
function d(
|
|
4629
|
-
t.text.length < Le.IMPROVE_INPUT_MIN_LENGTH || (o.setLoading("writing", !0),
|
|
4692
|
+
function d(b = null) {
|
|
4693
|
+
t.text.length < Le.IMPROVE_INPUT_MIN_LENGTH || (o.setLoading("writing", !0), g(t.text, l.opt.type, b));
|
|
4630
4694
|
}
|
|
4631
|
-
function
|
|
4695
|
+
function T() {
|
|
4632
4696
|
d("retry");
|
|
4633
4697
|
}
|
|
4634
|
-
function
|
|
4635
|
-
|
|
4698
|
+
function g(b, A = l.opt.type, V) {
|
|
4699
|
+
b && (o.setLoading("writing", !0), s("write", {
|
|
4636
4700
|
src: l.opt.src,
|
|
4637
|
-
text:
|
|
4638
|
-
action:
|
|
4639
|
-
flag:
|
|
4701
|
+
text: b,
|
|
4702
|
+
action: A,
|
|
4703
|
+
flag: V
|
|
4640
4704
|
}));
|
|
4641
4705
|
}
|
|
4642
|
-
function
|
|
4643
|
-
o.setLoading("writing", !0), s("opt", { ...l.opt, type:
|
|
4706
|
+
function x(b) {
|
|
4707
|
+
o.setLoading("writing", !0), s("opt", { ...l.opt, type: b, text: t.text });
|
|
4644
4708
|
}
|
|
4645
|
-
return (
|
|
4646
|
-
var
|
|
4647
|
-
return h(), C("div",
|
|
4648
|
-
f("div",
|
|
4649
|
-
f("div",
|
|
4650
|
-
|
|
4709
|
+
return (b, A) => {
|
|
4710
|
+
var V, I;
|
|
4711
|
+
return h(), C("div", Ti, [
|
|
4712
|
+
f("div", Si, [
|
|
4713
|
+
f("div", Ei, [
|
|
4714
|
+
N(Wr, {
|
|
4651
4715
|
class: "my-2 lg:my-0 w-full flex-grow lg:min-h-[50vh]",
|
|
4652
4716
|
text: k(t).text,
|
|
4653
4717
|
onChange: a,
|
|
@@ -4655,37 +4719,38 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4655
4719
|
onImprove: d
|
|
4656
4720
|
}, null, 8, ["text"])
|
|
4657
4721
|
]),
|
|
4658
|
-
f("div",
|
|
4659
|
-
f("div",
|
|
4660
|
-
|
|
4722
|
+
f("div", $i, [
|
|
4723
|
+
f("div", Oi, [
|
|
4724
|
+
N(_i, {
|
|
4661
4725
|
class: "w-full",
|
|
4662
4726
|
modelValue: l.opt.type,
|
|
4663
4727
|
options: r,
|
|
4664
4728
|
loading: k(o).isLoading("writing"),
|
|
4665
|
-
isTextEmpty: k(t).text && ((
|
|
4729
|
+
isTextEmpty: k(t).text && ((V = k(t).text) == null ? void 0 : V.length) < k(Le).IMPROVE_INPUT_MIN_LENGTH,
|
|
4666
4730
|
hasResult: !!k(t).result,
|
|
4667
|
-
"onUpdate:modelValue":
|
|
4731
|
+
"onUpdate:modelValue": x,
|
|
4668
4732
|
onAction: d
|
|
4669
4733
|
}, null, 8, ["modelValue", "loading", "isTextEmpty", "hasResult"])
|
|
4670
4734
|
]),
|
|
4671
|
-
|
|
4735
|
+
N(Or, {
|
|
4672
4736
|
class: "ml-2 lg:m-2",
|
|
4673
|
-
disabled: ((
|
|
4674
|
-
onClick:
|
|
4737
|
+
disabled: ((I = k(t).text) == null ? void 0 : I.length) < 5 || !k(t).result,
|
|
4738
|
+
onClick: T
|
|
4675
4739
|
}, null, 8, ["disabled"])
|
|
4676
4740
|
]),
|
|
4677
|
-
f("div",
|
|
4678
|
-
|
|
4741
|
+
f("div", Li, [
|
|
4742
|
+
N(ni, {
|
|
4679
4743
|
class: "my-2 lg:my-0 w-full flex-grow lg:min-h-[50vh]",
|
|
4680
4744
|
text: k(t).result,
|
|
4681
4745
|
originalText: k(t).text,
|
|
4682
4746
|
type: l.opt.type,
|
|
4683
4747
|
onChange: u,
|
|
4684
4748
|
onClear: c,
|
|
4685
|
-
onCopy:
|
|
4686
|
-
var
|
|
4687
|
-
return s("copy", (
|
|
4688
|
-
})
|
|
4749
|
+
onCopy: A[0] || (A[0] = (_) => {
|
|
4750
|
+
var E;
|
|
4751
|
+
return s("copy", (E = k(t)) == null ? void 0 : E.result);
|
|
4752
|
+
}),
|
|
4753
|
+
onTranslate: A[1] || (A[1] = (_) => s("translate", _))
|
|
4689
4754
|
}, null, 8, ["text", "originalText", "type"])
|
|
4690
4755
|
])
|
|
4691
4756
|
])
|
|
@@ -4693,7 +4758,7 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4693
4758
|
};
|
|
4694
4759
|
}
|
|
4695
4760
|
}, ln = He("writing", () => {
|
|
4696
|
-
const e = $(null), n = $(""), t = $(""), o = $([]), l = $(null), s = Oe(), r =
|
|
4761
|
+
const e = $(null), n = $(""), t = $(""), o = $([]), l = $(null), s = Oe(), r = O(() => s.getLabel(e.value));
|
|
4697
4762
|
function a(u) {
|
|
4698
4763
|
e.value = u.src, n.value = u.text, t.value = u.result, o.value = u.suggestions, l.value = u.action;
|
|
4699
4764
|
}
|
|
@@ -4710,17 +4775,17 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4710
4775
|
init: a,
|
|
4711
4776
|
reset: i
|
|
4712
4777
|
};
|
|
4713
|
-
}), Hn = (e) => (Et("data-v-
|
|
4778
|
+
}), Hn = (e) => (Et("data-v-848b8f0b"), e = e(), $t(), e), ki = ["data-theme"], Mi = { class: "flex-none py-2 pl-3 pr-2 shadow border border-base-300" }, Ai = { class: "flex-none" }, Vi = { class: "flex w-full border-b border-base-300 items-center" }, Di = {
|
|
4714
4779
|
key: 0,
|
|
4715
4780
|
class: "text-xs text-base-content/40 ml-1 italic"
|
|
4716
|
-
},
|
|
4717
|
-
|
|
4718
|
-
],
|
|
4781
|
+
}, Ri = /* @__PURE__ */ Hn(() => /* @__PURE__ */ f("small", null, "(Tab)", -1)), Pi = [
|
|
4782
|
+
Ri
|
|
4783
|
+
], Bi = {
|
|
4719
4784
|
key: 0,
|
|
4720
4785
|
class: "text-xs text-base-content/40 ml-1 italic"
|
|
4721
|
-
},
|
|
4722
|
-
|
|
4723
|
-
],
|
|
4786
|
+
}, Ni = /* @__PURE__ */ Hn(() => /* @__PURE__ */ f("small", null, "(Tab)", -1)), Fi = [
|
|
4787
|
+
Ni
|
|
4788
|
+
], ji = { class: "flex-1 min-h-0" }, Hi = { class: "h-full overflow-y-auto overflow-x-hidden custom-scrollbar" }, zi = {
|
|
4724
4789
|
__name: "Popup",
|
|
4725
4790
|
props: {
|
|
4726
4791
|
options: {
|
|
@@ -4770,17 +4835,25 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4770
4835
|
ve(t), bt(t), Oe(t), xe(t), ln(t);
|
|
4771
4836
|
const o = ve(), l = bt(), s = Oe(), r = xe(), a = ln();
|
|
4772
4837
|
ce("translationStore", o), ce("ttsStore", l), ce("languageStore", s), ce("loaderStore", r), ce("writingStore", a);
|
|
4773
|
-
const i = n, u = (
|
|
4774
|
-
i("nav", { action:
|
|
4775
|
-
}, c = (
|
|
4776
|
-
i("nav", { action: "themeChange", payload:
|
|
4777
|
-
}, d = (
|
|
4778
|
-
i("translate", { action:
|
|
4779
|
-
},
|
|
4780
|
-
i("write", { action:
|
|
4781
|
-
},
|
|
4782
|
-
i("common", { action:
|
|
4783
|
-
},
|
|
4838
|
+
const i = n, u = (y, w) => {
|
|
4839
|
+
i("nav", { action: y, payload: w });
|
|
4840
|
+
}, c = (y) => {
|
|
4841
|
+
i("nav", { action: "themeChange", payload: y });
|
|
4842
|
+
}, d = (y, w = {}) => {
|
|
4843
|
+
i("translate", { action: y, payload: w });
|
|
4844
|
+
}, T = (y, w = {}) => {
|
|
4845
|
+
i("write", { action: y, payload: w });
|
|
4846
|
+
}, g = (y, w = {}) => {
|
|
4847
|
+
i("common", { action: y, payload: w });
|
|
4848
|
+
}, x = $("");
|
|
4849
|
+
function b(y) {
|
|
4850
|
+
const w = y == null ? void 0 : y.trim();
|
|
4851
|
+
w && (x.value = w, u("activeTab", "translate"));
|
|
4852
|
+
}
|
|
4853
|
+
function A() {
|
|
4854
|
+
x.value = "";
|
|
4855
|
+
}
|
|
4856
|
+
const V = e, I = {
|
|
4784
4857
|
activeTab: "translate",
|
|
4785
4858
|
translateOpts: { src: "auto", target: "en" },
|
|
4786
4859
|
writeOpts: { type: "check" },
|
|
@@ -4796,96 +4869,99 @@ const qr = { class: "bg-base-100 relative z-10 border border-base-300 rounded" }
|
|
|
4796
4869
|
isAIExplain: !1,
|
|
4797
4870
|
aiExplainMinLength: 5,
|
|
4798
4871
|
isTTS: !0
|
|
4799
|
-
},
|
|
4800
|
-
if (
|
|
4801
|
-
|
|
4802
|
-
const
|
|
4803
|
-
u("activeTab",
|
|
4872
|
+
}, _ = O(() => Object.assign({}, I, V.options)), E = (y) => {
|
|
4873
|
+
if (y.key === "Tab") {
|
|
4874
|
+
y.preventDefault();
|
|
4875
|
+
const m = _.value.activeTab === "translate" ? "write" : "translate";
|
|
4876
|
+
u("activeTab", m);
|
|
4804
4877
|
}
|
|
4805
4878
|
};
|
|
4806
4879
|
return se(() => {
|
|
4807
|
-
window.addEventListener("keydown",
|
|
4880
|
+
window.addEventListener("keydown", E);
|
|
4808
4881
|
}), Fe(() => {
|
|
4809
|
-
window.removeEventListener("keydown",
|
|
4810
|
-
}), (
|
|
4882
|
+
window.removeEventListener("keydown", E);
|
|
4883
|
+
}), (y, w) => (h(), C("div", {
|
|
4811
4884
|
"data-theme": e.theme,
|
|
4812
4885
|
class: "h-screen flex flex-col bg-base-100"
|
|
4813
4886
|
}, [
|
|
4814
|
-
f("div",
|
|
4815
|
-
|
|
4887
|
+
f("div", Mi, [
|
|
4888
|
+
N(wo, {
|
|
4816
4889
|
"header-settings": e.headerSettings,
|
|
4817
4890
|
"current-theme": e.theme,
|
|
4818
4891
|
"is-premium": e.isPremium,
|
|
4819
|
-
onReader:
|
|
4820
|
-
onLearn:
|
|
4821
|
-
onSettings:
|
|
4822
|
-
onFullScreen:
|
|
4823
|
-
onAccount:
|
|
4892
|
+
onReader: w[0] || (w[0] = (m) => u("reader")),
|
|
4893
|
+
onLearn: w[1] || (w[1] = (m) => u("learn")),
|
|
4894
|
+
onSettings: w[2] || (w[2] = (m) => u("settings")),
|
|
4895
|
+
onFullScreen: w[3] || (w[3] = (m) => u("fullscreen")),
|
|
4896
|
+
onAccount: w[4] || (w[4] = (m) => u("account")),
|
|
4824
4897
|
onThemeChange: c
|
|
4825
4898
|
}, null, 8, ["header-settings", "current-theme", "is-premium"])
|
|
4826
4899
|
]),
|
|
4827
|
-
f("div",
|
|
4828
|
-
f("div",
|
|
4900
|
+
f("div", Ai, [
|
|
4901
|
+
f("div", Vi, [
|
|
4829
4902
|
f("button", {
|
|
4830
4903
|
class: P([
|
|
4831
4904
|
"w-1/2 px-4 py-2 text-sm font-medium",
|
|
4832
|
-
|
|
4905
|
+
_.value.activeTab === "translate" ? "text-primary border-b-2 border-primary" : "text-base-content/60 hover:text-primary"
|
|
4833
4906
|
]),
|
|
4834
|
-
onClick:
|
|
4907
|
+
onClick: w[5] || (w[5] = (m) => u("activeTab", "translate"))
|
|
4835
4908
|
}, [
|
|
4836
4909
|
Ee(" Translate "),
|
|
4837
|
-
!k(vt) &&
|
|
4910
|
+
!k(vt) && _.value.activeTab !== "translate" ? (h(), C("span", Di, Pi)) : R("", !0)
|
|
4838
4911
|
], 2),
|
|
4839
4912
|
f("button", {
|
|
4840
4913
|
class: P([
|
|
4841
4914
|
"w-1/2 px-4 py-2 text-sm font-medium",
|
|
4842
|
-
|
|
4915
|
+
_.value.activeTab === "write" ? "text-primary border-b-2 border-primary" : "text-base-content/60 hover:text-primary"
|
|
4843
4916
|
]),
|
|
4844
|
-
onClick:
|
|
4917
|
+
onClick: w[6] || (w[6] = (m) => u("activeTab", "write"))
|
|
4845
4918
|
}, [
|
|
4846
4919
|
Ee(" Write "),
|
|
4847
|
-
!k(vt) &&
|
|
4920
|
+
!k(vt) && _.value.activeTab !== "write" ? (h(), C("span", Bi, Fi)) : R("", !0)
|
|
4848
4921
|
], 2)
|
|
4849
4922
|
])
|
|
4850
4923
|
]),
|
|
4851
|
-
f("div",
|
|
4852
|
-
f("div",
|
|
4853
|
-
|
|
4924
|
+
f("div", ji, [
|
|
4925
|
+
f("div", Hi, [
|
|
4926
|
+
_.value.activeTab === "translate" ? (h(), Z(Tr, {
|
|
4854
4927
|
key: 0,
|
|
4855
|
-
opt:
|
|
4856
|
-
languages:
|
|
4928
|
+
opt: _.value.translateOpts,
|
|
4929
|
+
languages: _.value.languages,
|
|
4857
4930
|
translation: e.data.translation,
|
|
4858
4931
|
explanation: e.data.explanation,
|
|
4859
4932
|
tts: e.data.tts,
|
|
4860
|
-
isTTS:
|
|
4861
|
-
isFavoriteFeatureEnabled:
|
|
4862
|
-
isAITranslateFeatureEnabled:
|
|
4863
|
-
isFavorite:
|
|
4864
|
-
isAITranslate:
|
|
4865
|
-
isAIExplain:
|
|
4866
|
-
aiExplainMinLength:
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4933
|
+
isTTS: _.value.isTTS,
|
|
4934
|
+
isFavoriteFeatureEnabled: _.value.isFavoriteFeatureEnabled,
|
|
4935
|
+
isAITranslateFeatureEnabled: _.value.isAITranslateFeatureEnabled,
|
|
4936
|
+
isFavorite: _.value.isFavorite,
|
|
4937
|
+
isAITranslate: _.value.isAITranslate,
|
|
4938
|
+
isAIExplain: _.value.isAIExplain,
|
|
4939
|
+
aiExplainMinLength: _.value.aiExplainMinLength,
|
|
4940
|
+
seedText: x.value,
|
|
4941
|
+
onOpt: w[7] || (w[7] = (m) => d("updateOpts", m)),
|
|
4942
|
+
onTranslate: w[8] || (w[8] = (m) => d("translate", m)),
|
|
4943
|
+
onLoadTTS: w[9] || (w[9] = (m) => d("loadTTS", m)),
|
|
4944
|
+
onFavorite: w[10] || (w[10] = (m) => d("favorite")),
|
|
4945
|
+
onAiTranslate: w[11] || (w[11] = (m) => d("aiTranslate", m)),
|
|
4946
|
+
onAiExplain: w[12] || (w[12] = (m) => d("aiExplain", m)),
|
|
4947
|
+
onCopy: w[13] || (w[13] = (m) => g("copy", m)),
|
|
4948
|
+
onSeeded: A
|
|
4949
|
+
}, null, 8, ["opt", "languages", "translation", "explanation", "tts", "isTTS", "isFavoriteFeatureEnabled", "isAITranslateFeatureEnabled", "isFavorite", "isAITranslate", "isAIExplain", "aiExplainMinLength", "seedText"])) : R("", !0),
|
|
4950
|
+
_.value.activeTab === "write" ? (h(), Z(Ii, {
|
|
4876
4951
|
key: 1,
|
|
4877
|
-
opt:
|
|
4878
|
-
languages:
|
|
4952
|
+
opt: _.value.writeOpts,
|
|
4953
|
+
languages: _.value.languages,
|
|
4879
4954
|
writing: e.data.writing,
|
|
4880
|
-
onOpt:
|
|
4881
|
-
onWrite:
|
|
4882
|
-
onCopy:
|
|
4955
|
+
onOpt: w[14] || (w[14] = (m) => T("updateOpts", m)),
|
|
4956
|
+
onWrite: w[15] || (w[15] = (m) => T("write", m)),
|
|
4957
|
+
onCopy: w[16] || (w[16] = (m) => g("copy", m)),
|
|
4958
|
+
onTranslate: b
|
|
4883
4959
|
}, null, 8, ["opt", "languages", "writing"])) : R("", !0)
|
|
4884
4960
|
])
|
|
4885
4961
|
])
|
|
4886
|
-
], 8,
|
|
4962
|
+
], 8, ki));
|
|
4887
4963
|
}
|
|
4888
|
-
},
|
|
4964
|
+
}, Wi = /* @__PURE__ */ he(zi, [["__scopeId", "data-v-848b8f0b"]]);
|
|
4889
4965
|
export {
|
|
4890
|
-
|
|
4966
|
+
Wi as default
|
|
4891
4967
|
};
|