@oneb/ui-vue 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LogoOneb-b6ac382e.cjs +1 -0
- package/dist/LogoOneb-ddb388a4.js +16 -0
- package/dist/{OneHelpMenu-d5182c78.js → OneHelpMenu-2a2051d7.js} +2 -1
- package/dist/{OneHelpMenu-6ec63535.cjs → OneHelpMenu-78d9348a.cjs} +1 -1
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +2 -2
- package/dist/errorsPage/index.cjs +1 -1
- package/dist/errorsPage/index.js +251 -265
- package/dist/filterBuilder/index.cjs +1 -1
- package/dist/filterBuilder/index.js +71 -60
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.js +6 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +112 -110
- package/dist/layout/LogoOneb.vue.d.ts +2 -0
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +3 -1
- package/dist/popover/index.cjs +1 -1
- package/dist/popover/index.js +40 -38
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/errorsPage/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as T, computed as b, resolveComponent as N, openBlock as n, createElementBlock as u, createElementVNode as t, toDisplayString as r, createCommentVNode as h, createTextVNode as C, createVNode as I, withCtx as q, useSlots as re, normalizeClass as G, renderSlot as z, createBlock as Q, ref as x, onMounted as ae, onUnmounted as ne, normalizeStyle as le, Fragment as ue, renderList as ie, createSlots as W, onBeforeUnmount as X, watch as ce, unref as de } from "vue";
|
|
2
2
|
import { useOnebI18n as L } from "../i18n/index.js";
|
|
3
|
-
import { _ as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
7
|
-
|
|
8
|
-
const ye = {
|
|
3
|
+
import { _ as Y } from "../_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
import { useRouter as me } from "vue-router";
|
|
5
|
+
import { L as ve } from "../LogoOneb-ddb388a4.js";
|
|
6
|
+
import { c as fe } from "../clipboard-733b79a1.js";
|
|
7
|
+
const ge = {
|
|
9
8
|
statusMessage: {
|
|
10
9
|
type: String,
|
|
11
10
|
required: !1
|
|
@@ -26,69 +25,61 @@ const ye = {
|
|
|
26
25
|
type: Function,
|
|
27
26
|
default: void 0
|
|
28
27
|
}
|
|
29
|
-
},
|
|
28
|
+
}, ye = T({
|
|
30
29
|
name: "ErrorPage",
|
|
31
|
-
props:
|
|
30
|
+
props: ge,
|
|
32
31
|
setup(e) {
|
|
33
32
|
const o = L();
|
|
34
|
-
return { t:
|
|
33
|
+
return { t: b(() => e.t ?? o) };
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
|
-
const pe = { class: "error-container" },
|
|
36
|
+
const pe = { class: "error-container" }, xe = { class: "text-8xl text-secondary-content" }, he = { key: 0 }, _e = {
|
|
38
37
|
key: 1,
|
|
39
38
|
class: "pt-5"
|
|
40
39
|
}, be = { class: "request-info hidden" };
|
|
41
|
-
function ke(e, o,
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
e.statusMessage ? (
|
|
46
|
-
o[3] || (o[3] =
|
|
47
|
-
e.statusText ? (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
o[0] || (o[0] =
|
|
40
|
+
function ke(e, o, g, s, v, f) {
|
|
41
|
+
const i = N("router-link");
|
|
42
|
+
return n(), u("div", pe, [
|
|
43
|
+
t("h1", xe, r(e.statusCode), 1),
|
|
44
|
+
e.statusMessage ? (n(), u("p", he, r(e.statusMessage), 1)) : h("", !0),
|
|
45
|
+
o[3] || (o[3] = t("div", { class: "border-b border-secondary-stroke w-full pt-10" }, null, -1)),
|
|
46
|
+
e.statusText ? (n(), u("p", _e, r(e.statusText), 1)) : h("", !0),
|
|
47
|
+
t("div", be, [
|
|
48
|
+
t("p", null, [
|
|
49
|
+
o[0] || (o[0] = t("strong", null, "Request ID:", -1)),
|
|
51
50
|
C(" " + r(e.requestId), 1)
|
|
52
51
|
]),
|
|
53
|
-
o[1] || (o[1] =
|
|
54
|
-
o[2] || (o[2] =
|
|
52
|
+
o[1] || (o[1] = t("button", { class: "copy-btn" }, "Скопіювати", -1)),
|
|
53
|
+
o[2] || (o[2] = t("p", null, [
|
|
55
54
|
C(" Передайте цю інформацію розробнику або напишіть в "),
|
|
56
|
-
|
|
55
|
+
t("a", {
|
|
57
56
|
href: "https://t.me/telegram_bot",
|
|
58
57
|
target: "_blank"
|
|
59
58
|
}, "Telegram-бот")
|
|
60
59
|
], -1))
|
|
61
60
|
]),
|
|
62
|
-
|
|
61
|
+
I(i, {
|
|
63
62
|
to: "/",
|
|
64
63
|
class: "home-link"
|
|
65
64
|
}, {
|
|
66
|
-
default:
|
|
65
|
+
default: q(() => [
|
|
67
66
|
C(r(e.t("ui.errors.go_home")), 1)
|
|
68
67
|
]),
|
|
69
68
|
_: 1
|
|
70
69
|
})
|
|
71
70
|
]);
|
|
72
71
|
}
|
|
73
|
-
const gt = /* @__PURE__ */
|
|
74
|
-
key: 0,
|
|
75
|
-
class: "relative"
|
|
76
|
-
}, $e = { class: "one-error-logo-bounce" }, Ce = ["src"], Ee = {
|
|
72
|
+
const gt = /* @__PURE__ */ Y(ye, [["render", ke], ["__scopeId", "data-v-4ac01274"]]), we = { class: "flex items-center justify-center gap-2 sm:gap-4" }, Se = { class: "relative" }, $e = { class: "one-error-logo-bounce" }, Ce = ["src"], Ee = {
|
|
77
73
|
key: 0,
|
|
78
74
|
class: "absolute inset-0 animate-ping opacity-20",
|
|
79
75
|
"aria-hidden": "true"
|
|
80
|
-
}, Te = ["src"],
|
|
76
|
+
}, Te = ["src"], J = "text-[100px] sm:text-[160px] font-bold text-slate-200 leading-none select-none", Oe = /* @__PURE__ */ T({
|
|
81
77
|
__name: "OneErrorHero",
|
|
82
78
|
props: {
|
|
83
79
|
left: {
|
|
84
80
|
type: String,
|
|
85
81
|
required: !0
|
|
86
82
|
},
|
|
87
|
-
/** Fallback digit shown when there is no logo (neither slot nor logoSrc). */
|
|
88
|
-
middle: {
|
|
89
|
-
type: String,
|
|
90
|
-
required: !0
|
|
91
|
-
},
|
|
92
83
|
right: {
|
|
93
84
|
type: String,
|
|
94
85
|
required: !0
|
|
@@ -99,60 +90,61 @@ const gt = /* @__PURE__ */ ee(ge, [["render", ke], ["__scopeId", "data-v-4ac0127
|
|
|
99
90
|
}
|
|
100
91
|
},
|
|
101
92
|
setup(e) {
|
|
102
|
-
const o =
|
|
103
|
-
return (
|
|
104
|
-
|
|
105
|
-
class:
|
|
93
|
+
const o = re(), g = b(() => !!o.default);
|
|
94
|
+
return (s, v) => (n(), u("div", we, [
|
|
95
|
+
t("span", {
|
|
96
|
+
class: G(J)
|
|
106
97
|
}, r(e.left), 1),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
98
|
+
t("div", Se, [
|
|
99
|
+
t("div", $e, [
|
|
100
|
+
z(s.$slots, "default", {}, () => [
|
|
101
|
+
e.logoSrc ? (n(), u("img", {
|
|
102
|
+
key: 0,
|
|
111
103
|
src: e.logoSrc,
|
|
112
|
-
class: "w-
|
|
104
|
+
class: "w-24 h-24 sm:w-36 sm:h-36",
|
|
113
105
|
alt: "Logo"
|
|
114
|
-
}, null, 8, Ce)
|
|
106
|
+
}, null, 8, Ce)) : (n(), Q(ve, {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "w-24 h-24 sm:w-36 sm:h-36"
|
|
109
|
+
}))
|
|
115
110
|
], !0)
|
|
116
111
|
]),
|
|
117
|
-
e.logoSrc && !
|
|
118
|
-
|
|
112
|
+
e.logoSrc && !g.value ? (n(), u("div", Ee, [
|
|
113
|
+
t("img", {
|
|
119
114
|
src: e.logoSrc,
|
|
120
|
-
class: "w-
|
|
115
|
+
class: "w-24 h-24 sm:w-36 sm:h-36",
|
|
121
116
|
alt: ""
|
|
122
117
|
}, null, 8, Te)
|
|
123
118
|
])) : h("", !0)
|
|
124
|
-
])
|
|
125
|
-
|
|
126
|
-
class:
|
|
127
|
-
}, r(e.middle), 1)),
|
|
128
|
-
s("span", {
|
|
129
|
-
class: R(D)
|
|
119
|
+
]),
|
|
120
|
+
t("span", {
|
|
121
|
+
class: G(J)
|
|
130
122
|
}, r(e.right), 1)
|
|
131
123
|
]));
|
|
132
124
|
}
|
|
133
125
|
});
|
|
134
|
-
const
|
|
135
|
-
class: "text-
|
|
126
|
+
const Z = /* @__PURE__ */ Y(Oe, [["__scopeId", "data-v-957a8a83"]]), Ie = { class: "w-full" }, qe = { class: "flex items-center justify-between mb-4" }, ze = { class: "flex items-center gap-4" }, Le = { class: "text-sm text-slate-600" }, Fe = {
|
|
127
|
+
class: "text-emerald-700",
|
|
136
128
|
"data-test": "snake-score"
|
|
137
129
|
}, je = {
|
|
138
130
|
key: 0,
|
|
139
|
-
class: "text-sm text-
|
|
131
|
+
class: "text-sm text-rose-600 font-medium",
|
|
140
132
|
"data-test": "snake-status"
|
|
141
|
-
},
|
|
133
|
+
}, Re = {
|
|
142
134
|
key: 1,
|
|
143
|
-
class: "text-sm text-
|
|
135
|
+
class: "text-sm text-emerald-700",
|
|
144
136
|
"data-test": "snake-status"
|
|
145
|
-
},
|
|
137
|
+
}, Me = {
|
|
146
138
|
key: 2,
|
|
147
|
-
class: "text-sm text-
|
|
139
|
+
class: "text-sm text-slate-500",
|
|
148
140
|
"data-test": "snake-status"
|
|
149
|
-
},
|
|
141
|
+
}, Be = { class: "flex gap-2" }, Ge = { class: "bg-slate-50 border border-slate-200 rounded-2xl p-4 shadow-sm" }, Ne = ["data-snake"], De = {
|
|
150
142
|
key: 0,
|
|
151
|
-
class: "absolute inset-1 rounded-md border border-
|
|
143
|
+
class: "absolute inset-1 rounded-md border border-emerald-800/40"
|
|
152
144
|
}, He = {
|
|
153
145
|
key: 1,
|
|
154
|
-
class: "absolute inset-2 rounded-sm bg-
|
|
155
|
-
}, Pe = { class: "text-xs text-
|
|
146
|
+
class: "absolute inset-2 rounded-sm bg-rose-600"
|
|
147
|
+
}, Pe = { class: "text-xs text-slate-500 text-center mt-3" }, Ue = /* @__PURE__ */ T({
|
|
156
148
|
__name: "OneSnakeGame",
|
|
157
149
|
props: {
|
|
158
150
|
gridSize: {
|
|
@@ -169,62 +161,62 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
|
|
|
169
161
|
}
|
|
170
162
|
},
|
|
171
163
|
emits: ["score", "game-over"],
|
|
172
|
-
setup(e, { expose: o, emit:
|
|
173
|
-
const
|
|
174
|
-
let
|
|
175
|
-
const
|
|
176
|
-
() => Array.from({ length:
|
|
177
|
-
x:
|
|
178
|
-
y: Math.floor(
|
|
164
|
+
setup(e, { expose: o, emit: g }) {
|
|
165
|
+
const s = e, v = g, f = L(), i = b(() => s.t ?? f), m = x([]), y = x({ x: 1, y: 0 }), k = x({ x: 1, y: 0 }), p = x({ x: 0, y: 0 }), w = x(0), _ = x(!1), d = x(!1);
|
|
166
|
+
let E = null;
|
|
167
|
+
const te = b(
|
|
168
|
+
() => Array.from({ length: s.gridSize * s.gridSize }, (l, a) => ({
|
|
169
|
+
x: a % s.gridSize,
|
|
170
|
+
y: Math.floor(a / s.gridSize)
|
|
179
171
|
}))
|
|
180
|
-
),
|
|
181
|
-
var
|
|
182
|
-
return ((
|
|
183
|
-
},
|
|
184
|
-
const
|
|
185
|
-
for (let S = 0; S <
|
|
186
|
-
for (let $ = 0; $ <
|
|
187
|
-
|
|
188
|
-
if (
|
|
172
|
+
), R = (l) => {
|
|
173
|
+
var a, c;
|
|
174
|
+
return ((a = m.value[0]) == null ? void 0 : a.x) === l.x && ((c = m.value[0]) == null ? void 0 : c.y) === l.y;
|
|
175
|
+
}, D = (l) => m.value.some((a, c) => c !== 0 && a.x === l.x && a.y === l.y), M = (l) => p.value.x === l.x && p.value.y === l.y, H = (l) => {
|
|
176
|
+
const a = [];
|
|
177
|
+
for (let S = 0; S < s.gridSize; S += 1)
|
|
178
|
+
for (let $ = 0; $ < s.gridSize; $ += 1)
|
|
179
|
+
l.some((K) => K.x === $ && K.y === S) || a.push({ x: $, y: S });
|
|
180
|
+
if (a.length === 0)
|
|
189
181
|
return { x: 0, y: 0 };
|
|
190
|
-
const
|
|
191
|
-
return
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
|
|
182
|
+
const c = Math.floor(Math.random() * a.length);
|
|
183
|
+
return a[c];
|
|
184
|
+
}, F = () => {
|
|
185
|
+
E != null && (clearInterval(E), E = null), _.value = !1;
|
|
186
|
+
}, P = () => {
|
|
187
|
+
F(), d.value = !0, v("game-over", w.value);
|
|
188
|
+
}, O = () => {
|
|
189
|
+
F(), m.value = [
|
|
198
190
|
{
|
|
199
|
-
x: Math.floor(
|
|
200
|
-
y: Math.floor(
|
|
191
|
+
x: Math.floor(s.gridSize / 2),
|
|
192
|
+
y: Math.floor(s.gridSize / 2)
|
|
201
193
|
}
|
|
202
|
-
],
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
|
|
194
|
+
], y.value = { x: 1, y: 0 }, k.value = { x: 1, y: 0 }, p.value = H(m.value), w.value = 0, d.value = !1;
|
|
195
|
+
}, se = (l) => {
|
|
196
|
+
y.value.x + l.x === 0 && y.value.y + l.y === 0 || (k.value = l);
|
|
197
|
+
}, oe = () => {
|
|
198
|
+
y.value = k.value;
|
|
199
|
+
const l = m.value[0], a = { x: l.x + y.value.x, y: l.y + y.value.y };
|
|
200
|
+
if (a.x < 0 || a.x >= s.gridSize || a.y < 0 || a.y >= s.gridSize) {
|
|
201
|
+
P();
|
|
210
202
|
return;
|
|
211
203
|
}
|
|
212
|
-
if (m.value.some(($) => $.x ===
|
|
213
|
-
|
|
204
|
+
if (m.value.some(($) => $.x === a.x && $.y === a.y)) {
|
|
205
|
+
P();
|
|
214
206
|
return;
|
|
215
207
|
}
|
|
216
|
-
const S = [
|
|
217
|
-
|
|
218
|
-
},
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
if (
|
|
222
|
-
|
|
208
|
+
const S = [a, ...m.value];
|
|
209
|
+
a.x === p.value.x && a.y === p.value.y ? (w.value += 1, v("score", w.value), p.value = H(S)) : S.pop(), m.value = S;
|
|
210
|
+
}, U = () => {
|
|
211
|
+
E != null || d.value || (_.value = !0, E = setInterval(oe, s.tickMs));
|
|
212
|
+
}, A = () => {
|
|
213
|
+
if (d.value) {
|
|
214
|
+
O();
|
|
223
215
|
return;
|
|
224
216
|
}
|
|
225
|
-
|
|
226
|
-
},
|
|
227
|
-
const
|
|
217
|
+
_.value ? F() : U();
|
|
218
|
+
}, V = (l) => {
|
|
219
|
+
const a = l.key.toLowerCase(), c = {
|
|
228
220
|
arrowup: { x: 0, y: -1 },
|
|
229
221
|
w: { x: 0, y: -1 },
|
|
230
222
|
arrowdown: { x: 0, y: 1 },
|
|
@@ -234,57 +226,57 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
|
|
|
234
226
|
arrowright: { x: 1, y: 0 },
|
|
235
227
|
d: { x: 1, y: 0 }
|
|
236
228
|
};
|
|
237
|
-
|
|
229
|
+
c[a] ? (se(c[a]), !_.value && !d.value && U()) : a === " " ? (l.preventDefault(), d.value || A()) : a === "enter" && d.value && O();
|
|
238
230
|
};
|
|
239
|
-
return
|
|
240
|
-
|
|
241
|
-
}),
|
|
242
|
-
|
|
243
|
-
}), o({ score: w, isRunning:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
C(r(
|
|
248
|
-
|
|
231
|
+
return ae(() => {
|
|
232
|
+
O(), window.addEventListener("keydown", V);
|
|
233
|
+
}), ne(() => {
|
|
234
|
+
F(), window.removeEventListener("keydown", V);
|
|
235
|
+
}), o({ score: w, isRunning: _, isGameOver: d, resetGame: O }), (l, a) => (n(), u("div", Ie, [
|
|
236
|
+
t("div", qe, [
|
|
237
|
+
t("div", ze, [
|
|
238
|
+
t("span", Le, [
|
|
239
|
+
C(r(i.value("ui.errors.snake_score")) + ": ", 1),
|
|
240
|
+
t("strong", Fe, r(w.value), 1)
|
|
249
241
|
]),
|
|
250
|
-
|
|
242
|
+
d.value ? (n(), u("span", je, r(i.value("ui.errors.snake_game_over")), 1)) : _.value ? (n(), u("span", Re, r(i.value("ui.errors.snake_running")), 1)) : (n(), u("span", Me, r(i.value("ui.errors.snake_paused")), 1))
|
|
251
243
|
]),
|
|
252
|
-
|
|
253
|
-
|
|
244
|
+
t("div", Be, [
|
|
245
|
+
t("button", {
|
|
254
246
|
type: "button",
|
|
255
|
-
class: "px-3 py-1.5 rounded-lg text-sm text-white bg-
|
|
247
|
+
class: "px-3 py-1.5 rounded-lg text-sm text-white bg-emerald-600 hover:bg-emerald-700 transition",
|
|
256
248
|
"data-test": "snake-toggle",
|
|
257
|
-
onClick:
|
|
258
|
-
}, r(
|
|
259
|
-
|
|
249
|
+
onClick: A
|
|
250
|
+
}, r(d.value ? i.value("ui.errors.snake_restart") : _.value ? i.value("ui.errors.snake_pause") : i.value("ui.errors.snake_start")), 1),
|
|
251
|
+
t("button", {
|
|
260
252
|
type: "button",
|
|
261
|
-
class: "px-3 py-1.5 rounded-lg text-sm border border-
|
|
253
|
+
class: "px-3 py-1.5 rounded-lg text-sm border border-slate-300 text-slate-700 hover:bg-slate-50 transition",
|
|
262
254
|
"data-test": "snake-reset",
|
|
263
|
-
onClick:
|
|
264
|
-
}, r(
|
|
255
|
+
onClick: O
|
|
256
|
+
}, r(i.value("ui.errors.snake_reset")), 1)
|
|
265
257
|
])
|
|
266
258
|
]),
|
|
267
|
-
|
|
268
|
-
|
|
259
|
+
t("div", Ge, [
|
|
260
|
+
t("div", {
|
|
269
261
|
class: "w-full mx-auto",
|
|
270
|
-
style:
|
|
262
|
+
style: le({ display: "grid", gridTemplateColumns: `repeat(${e.gridSize}, minmax(0, 1fr))` })
|
|
271
263
|
}, [
|
|
272
|
-
(
|
|
273
|
-
key: `${
|
|
274
|
-
class:
|
|
275
|
-
|
|
264
|
+
(n(!0), u(ue, null, ie(te.value, (c) => (n(), u("div", {
|
|
265
|
+
key: `${c.x}-${c.y}`,
|
|
266
|
+
class: G(["relative aspect-square border border-slate-200/60", [
|
|
267
|
+
R(c) ? "bg-emerald-600 shadow-inner" : D(c) ? "bg-emerald-300" : M(c) ? "bg-rose-400" : "bg-white"
|
|
276
268
|
]]),
|
|
277
269
|
"data-test": "snake-cell",
|
|
278
|
-
"data-snake":
|
|
270
|
+
"data-snake": R(c) ? "head" : D(c) ? "body" : M(c) ? "food" : void 0
|
|
279
271
|
}, [
|
|
280
|
-
|
|
272
|
+
R(c) ? (n(), u("div", De)) : M(c) ? (n(), u("div", He)) : h("", !0)
|
|
281
273
|
], 10, Ne))), 128))
|
|
282
274
|
], 4)
|
|
283
275
|
]),
|
|
284
|
-
|
|
276
|
+
t("p", Pe, r(i.value("ui.errors.snake_instructions")), 1)
|
|
285
277
|
]));
|
|
286
278
|
}
|
|
287
|
-
}), Ae = { class: "flex flex-col items-center justify-center p-4" }, Ve = { class: "text-center mb-8" }, Ke = { class: "text-xl text-
|
|
279
|
+
}), Ae = { class: "min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4" }, Ve = { class: "text-center mb-8" }, Ke = { class: "text-xl text-gray-600 mt-2" }, Je = { class: "flex gap-4 mt-4" }, yt = /* @__PURE__ */ T({
|
|
288
280
|
__name: "OneNotFoundPage",
|
|
289
281
|
props: {
|
|
290
282
|
/** App logo shown between the digits; the #logo slot takes priority. */
|
|
@@ -306,68 +298,66 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
|
|
|
306
298
|
}
|
|
307
299
|
},
|
|
308
300
|
setup(e) {
|
|
309
|
-
const o = e,
|
|
310
|
-
|
|
301
|
+
const o = e, g = L(), s = b(() => o.t ?? g), v = me(), f = x(!1), i = () => {
|
|
302
|
+
v ? v.back() : typeof window < "u" && window.history.back();
|
|
311
303
|
};
|
|
312
|
-
return (m,
|
|
313
|
-
const k =
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
|
|
304
|
+
return (m, y) => {
|
|
305
|
+
const k = N("RouterLink");
|
|
306
|
+
return n(), u("div", Ae, [
|
|
307
|
+
t("div", Ve, [
|
|
308
|
+
I(Z, {
|
|
317
309
|
left: "4",
|
|
318
|
-
middle: "0",
|
|
319
310
|
right: "4",
|
|
320
311
|
"logo-src": e.logoSrc
|
|
321
|
-
},
|
|
312
|
+
}, W({ _: 2 }, [
|
|
322
313
|
m.$slots.logo ? {
|
|
323
314
|
name: "default",
|
|
324
|
-
fn:
|
|
325
|
-
|
|
315
|
+
fn: q(() => [
|
|
316
|
+
z(m.$slots, "logo")
|
|
326
317
|
]),
|
|
327
318
|
key: "0"
|
|
328
319
|
} : void 0
|
|
329
320
|
]), 1032, ["logo-src"]),
|
|
330
|
-
|
|
321
|
+
t("p", Ke, r(s.value("ui.errors.page_not_found")), 1)
|
|
331
322
|
]),
|
|
332
|
-
e.withGame && !
|
|
323
|
+
e.withGame && !f.value ? (n(), u("button", {
|
|
333
324
|
key: 0,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
label: t.value("ui.errors.play_snake"),
|
|
325
|
+
type: "button",
|
|
326
|
+
class: "px-6 py-2.5 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition font-medium shadow-lg",
|
|
337
327
|
"data-test": "nf-play",
|
|
338
|
-
onClick:
|
|
339
|
-
},
|
|
340
|
-
|
|
328
|
+
onClick: y[0] || (y[0] = (p) => f.value = !0)
|
|
329
|
+
}, r(s.value("ui.errors.play_snake")), 1)) : h("", !0),
|
|
330
|
+
f.value ? (n(), Q(Ue, {
|
|
341
331
|
key: 1,
|
|
342
332
|
class: "max-w-2xl",
|
|
343
|
-
t:
|
|
333
|
+
t: s.value
|
|
344
334
|
}, null, 8, ["t"])) : h("", !0),
|
|
345
|
-
|
|
346
|
-
|
|
335
|
+
t("div", Je, [
|
|
336
|
+
I(k, {
|
|
347
337
|
to: e.homeTo,
|
|
348
|
-
class: "text-
|
|
338
|
+
class: "text-blue-600 hover:text-blue-700 underline text-sm",
|
|
349
339
|
"data-test": "nf-home"
|
|
350
340
|
}, {
|
|
351
|
-
default:
|
|
352
|
-
C(r(
|
|
341
|
+
default: q(() => [
|
|
342
|
+
C(r(s.value("ui.errors.go_home")), 1)
|
|
353
343
|
]),
|
|
354
344
|
_: 1
|
|
355
345
|
}, 8, ["to"]),
|
|
356
|
-
|
|
346
|
+
t("button", {
|
|
357
347
|
type: "button",
|
|
358
|
-
class: "text-
|
|
348
|
+
class: "text-gray-600 hover:text-gray-700 underline text-sm",
|
|
359
349
|
"data-test": "nf-back",
|
|
360
|
-
onClick:
|
|
361
|
-
}, r(
|
|
350
|
+
onClick: i
|
|
351
|
+
}, r(s.value("ui.errors.go_back")), 1)
|
|
362
352
|
])
|
|
363
353
|
]);
|
|
364
354
|
};
|
|
365
355
|
}
|
|
366
|
-
}), Qe = { class: "flex flex-col items-center justify-center p-4" }, We = { class: "text-center mb-8" }, Xe = { class: "text-xl text-
|
|
356
|
+
}), Qe = { class: "min-h-screen flex flex-col items-center justify-center bg-gray-100 p-4" }, We = { class: "text-center mb-8" }, Xe = { class: "text-xl text-gray-600 mt-2" }, Ye = { class: "text-sm text-gray-500 mt-2 max-w-md mx-auto" }, Ze = {
|
|
367
357
|
key: 0,
|
|
368
|
-
class: "mb-6 text-sm text-
|
|
358
|
+
class: "mb-6 text-sm text-gray-600 text-center",
|
|
369
359
|
"data-test": "se-request"
|
|
370
|
-
}, et = { class: "flex flex-col items-center gap-4" },
|
|
360
|
+
}, et = { class: "flex flex-col items-center gap-4" }, pt = /* @__PURE__ */ T({
|
|
371
361
|
__name: "OneServerErrorPage",
|
|
372
362
|
props: {
|
|
373
363
|
/** App logo shown between the digits; the #logo slot takes priority. */
|
|
@@ -390,64 +380,62 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
|
|
|
390
380
|
}
|
|
391
381
|
},
|
|
392
382
|
setup(e) {
|
|
393
|
-
const o = e,
|
|
394
|
-
let
|
|
395
|
-
const
|
|
396
|
-
!o.requestId || !await
|
|
397
|
-
|
|
383
|
+
const o = e, g = L(), s = b(() => o.t ?? g), v = x(!1);
|
|
384
|
+
let f = null;
|
|
385
|
+
const i = async () => {
|
|
386
|
+
!o.requestId || !await fe(o.requestId) || (v.value = !0, f != null && clearTimeout(f), f = setTimeout(() => {
|
|
387
|
+
v.value = !1, f = null;
|
|
398
388
|
}, 2e3));
|
|
399
389
|
}, m = () => {
|
|
400
390
|
window.location.reload();
|
|
401
391
|
};
|
|
402
|
-
return
|
|
403
|
-
|
|
404
|
-
}), (
|
|
405
|
-
const p =
|
|
406
|
-
return
|
|
407
|
-
|
|
408
|
-
|
|
392
|
+
return X(() => {
|
|
393
|
+
f != null && clearTimeout(f);
|
|
394
|
+
}), (y, k) => {
|
|
395
|
+
const p = N("RouterLink");
|
|
396
|
+
return n(), u("div", Qe, [
|
|
397
|
+
t("div", We, [
|
|
398
|
+
I(Z, {
|
|
409
399
|
left: "5",
|
|
410
|
-
middle: "0",
|
|
411
400
|
right: "0",
|
|
412
401
|
"logo-src": e.logoSrc
|
|
413
|
-
},
|
|
414
|
-
|
|
402
|
+
}, W({ _: 2 }, [
|
|
403
|
+
y.$slots.logo ? {
|
|
415
404
|
name: "default",
|
|
416
|
-
fn:
|
|
417
|
-
|
|
405
|
+
fn: q(() => [
|
|
406
|
+
z(y.$slots, "logo")
|
|
418
407
|
]),
|
|
419
408
|
key: "0"
|
|
420
409
|
} : void 0
|
|
421
410
|
]), 1032, ["logo-src"]),
|
|
422
|
-
|
|
423
|
-
|
|
411
|
+
t("p", Xe, r(s.value("ui.errors.server_error")), 1),
|
|
412
|
+
t("p", Ye, r(s.value("ui.errors.server_error_hint")), 1)
|
|
424
413
|
]),
|
|
425
|
-
e.requestId ? (
|
|
426
|
-
C(r(
|
|
427
|
-
|
|
428
|
-
|
|
414
|
+
e.requestId ? (n(), u("div", Ze, [
|
|
415
|
+
C(r(s.value("ui.errors.request_id")) + ": ", 1),
|
|
416
|
+
t("strong", null, r(e.requestId), 1),
|
|
417
|
+
t("button", {
|
|
429
418
|
type: "button",
|
|
430
|
-
class: "ml-2 text-
|
|
419
|
+
class: "ml-2 text-blue-600 hover:text-blue-700 underline",
|
|
431
420
|
"data-test": "se-copy",
|
|
432
|
-
onClick:
|
|
433
|
-
}, r(
|
|
421
|
+
onClick: i
|
|
422
|
+
}, r(v.value ? s.value("ui.errors.copied") : s.value("ui.errors.copy")), 1)
|
|
434
423
|
])) : h("", !0),
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
label: t.value("ui.errors.reload_page"),
|
|
424
|
+
t("div", et, [
|
|
425
|
+
t("button", {
|
|
426
|
+
type: "button",
|
|
427
|
+
class: "px-6 py-3 rounded-xl text-white bg-emerald-600 hover:bg-emerald-700 transition text-lg font-medium shadow-lg",
|
|
440
428
|
"data-test": "se-reload",
|
|
441
429
|
onClick: m
|
|
442
|
-
},
|
|
443
|
-
|
|
444
|
-
|
|
430
|
+
}, r(s.value("ui.errors.reload_page")), 1),
|
|
431
|
+
z(y.$slots, "support"),
|
|
432
|
+
I(p, {
|
|
445
433
|
to: e.homeTo,
|
|
446
|
-
class: "text-
|
|
434
|
+
class: "text-blue-600 hover:text-blue-700 underline text-sm",
|
|
447
435
|
"data-test": "se-home"
|
|
448
436
|
}, {
|
|
449
|
-
default:
|
|
450
|
-
C(r(
|
|
437
|
+
default: q(() => [
|
|
438
|
+
C(r(s.value("ui.errors.go_home")), 1)
|
|
451
439
|
]),
|
|
452
440
|
_: 1
|
|
453
441
|
}, 8, ["to"])
|
|
@@ -455,31 +443,31 @@ const te = /* @__PURE__ */ ee(Oe, [["__scopeId", "data-v-59d54d25"]]), qe = { cl
|
|
|
455
443
|
]);
|
|
456
444
|
};
|
|
457
445
|
}
|
|
458
|
-
}),
|
|
459
|
-
function
|
|
460
|
-
return { show:
|
|
461
|
-
|
|
446
|
+
}), j = x(!1), B = x(null);
|
|
447
|
+
function ee() {
|
|
448
|
+
return { show: j, error: B, trigger: (g) => {
|
|
449
|
+
j.value || (B.value = g, j.value = !0);
|
|
462
450
|
}, dismiss: () => {
|
|
463
|
-
|
|
451
|
+
j.value = !1, B.value = null;
|
|
464
452
|
} };
|
|
465
453
|
}
|
|
466
454
|
const tt = {
|
|
467
455
|
key: 0,
|
|
468
|
-
class: "fixed inset-0 z-[10000] flex items-center justify-center bg-
|
|
456
|
+
class: "fixed inset-0 z-[10000] flex items-center justify-center bg-[#f5f7fb] p-6",
|
|
469
457
|
role: "alert",
|
|
470
458
|
"aria-live": "assertive",
|
|
471
459
|
"data-test": "crash-screen"
|
|
472
460
|
}, st = { class: "flex w-full max-w-[480px] flex-col items-center text-center" }, ot = {
|
|
473
461
|
key: 0,
|
|
474
462
|
class: "mb-6"
|
|
475
|
-
},
|
|
476
|
-
class: "mb-8 text-base text-
|
|
463
|
+
}, rt = ["src"], at = { class: "mb-3 text-2xl font-semibold text-gray-900" }, nt = {
|
|
464
|
+
class: "mb-8 text-base text-gray-600",
|
|
477
465
|
"data-test": "crash-message"
|
|
478
466
|
}, lt = {
|
|
479
467
|
key: 2,
|
|
480
468
|
"data-test": "crash-details",
|
|
481
|
-
class: "mt-6 text-xs text-
|
|
482
|
-
},
|
|
469
|
+
class: "mt-6 text-xs text-gray-400"
|
|
470
|
+
}, xt = /* @__PURE__ */ T({
|
|
483
471
|
__name: "OneCrashScreen",
|
|
484
472
|
props: {
|
|
485
473
|
/** App logo above the title; the #logo slot takes priority. */
|
|
@@ -515,78 +503,76 @@ const tt = {
|
|
|
515
503
|
}
|
|
516
504
|
},
|
|
517
505
|
setup(e) {
|
|
518
|
-
const o = e,
|
|
506
|
+
const o = e, g = L(), s = b(() => o.t ?? g), { show: v, error: f } = ee(), i = x(o.autoReloadSeconds);
|
|
519
507
|
let m = null;
|
|
520
|
-
const
|
|
521
|
-
const
|
|
522
|
-
return
|
|
523
|
-
}), k =
|
|
508
|
+
const y = b(() => {
|
|
509
|
+
const d = f.value;
|
|
510
|
+
return d instanceof Error ? `${d.name}: ${d.message}` : String(d ?? "Unknown error");
|
|
511
|
+
}), k = b(() => o.persistent ? s.value("ui.crash.persistent") : i.value > 0 ? s.value("ui.crash.countdown", { n: i.value }) : s.value("ui.crash.reloading")), p = () => {
|
|
524
512
|
m != null && (clearInterval(m), m = null);
|
|
525
513
|
}, w = () => {
|
|
526
514
|
p(), window.location.reload();
|
|
527
|
-
},
|
|
515
|
+
}, _ = () => {
|
|
528
516
|
o.accountUrl && (p(), window.location.href = o.accountUrl);
|
|
529
517
|
};
|
|
530
|
-
return
|
|
531
|
-
|
|
532
|
-
(
|
|
533
|
-
p(),
|
|
534
|
-
|
|
518
|
+
return ce(
|
|
519
|
+
v,
|
|
520
|
+
(d) => {
|
|
521
|
+
p(), d && (i.value = o.autoReloadSeconds, !o.persistent && (m = setInterval(() => {
|
|
522
|
+
i.value -= 1, i.value <= 0 && (p(), window.location.reload());
|
|
535
523
|
}, 1e3)));
|
|
536
524
|
},
|
|
537
525
|
{ immediate: !0 }
|
|
538
|
-
),
|
|
526
|
+
), X(() => {
|
|
539
527
|
p();
|
|
540
|
-
}), (
|
|
541
|
-
|
|
542
|
-
e.logoSrc ||
|
|
543
|
-
|
|
544
|
-
|
|
528
|
+
}), (d, E) => de(v) ? (n(), u("div", tt, [
|
|
529
|
+
t("div", st, [
|
|
530
|
+
e.logoSrc || d.$slots.logo ? (n(), u("div", ot, [
|
|
531
|
+
z(d.$slots, "logo", {}, () => [
|
|
532
|
+
t("img", {
|
|
545
533
|
src: e.logoSrc,
|
|
546
534
|
alt: "",
|
|
547
535
|
class: "h-20 w-20"
|
|
548
|
-
}, null, 8,
|
|
536
|
+
}, null, 8, rt)
|
|
549
537
|
])
|
|
550
538
|
])) : h("", !0),
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
label: t.value("ui.crash.reload_now"),
|
|
539
|
+
t("h1", at, r(s.value("ui.crash.title")), 1),
|
|
540
|
+
t("p", nt, r(k.value), 1),
|
|
541
|
+
t("button", {
|
|
542
|
+
type: "button",
|
|
543
|
+
class: "mb-3 w-full rounded-lg bg-gradient-to-r from-[#E1A508] to-[#E04040] px-6 py-3 text-base font-medium text-white transition hover:opacity-90",
|
|
557
544
|
"data-test": "crash-reload",
|
|
558
545
|
onClick: w
|
|
559
|
-
},
|
|
560
|
-
e.accountUrl ? (
|
|
546
|
+
}, r(s.value("ui.crash.reload_now")), 1),
|
|
547
|
+
e.accountUrl ? (n(), u("button", {
|
|
561
548
|
key: 1,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
label: t.value("ui.crash.open_account"),
|
|
549
|
+
type: "button",
|
|
550
|
+
class: "w-full rounded-lg border border-gray-300 bg-white px-6 py-3 text-base font-medium text-gray-700 transition hover:bg-gray-50",
|
|
565
551
|
"data-test": "crash-account",
|
|
566
|
-
onClick:
|
|
567
|
-
},
|
|
568
|
-
e.showDetails ? (
|
|
552
|
+
onClick: _
|
|
553
|
+
}, r(s.value("ui.crash.open_account")), 1)) : h("", !0),
|
|
554
|
+
e.showDetails ? (n(), u("p", lt, r(y.value), 1)) : h("", !0)
|
|
569
555
|
])
|
|
570
556
|
])) : h("", !0);
|
|
571
557
|
}
|
|
572
558
|
});
|
|
573
|
-
function
|
|
559
|
+
function ht(e = {}) {
|
|
574
560
|
const o = e.criticalInfos ?? ["setup function", "render function"];
|
|
575
|
-
return (
|
|
576
|
-
var
|
|
561
|
+
return (g, s, v) => {
|
|
562
|
+
var f;
|
|
577
563
|
try {
|
|
578
|
-
(
|
|
564
|
+
(f = e.onError) == null || f.call(e, g, v);
|
|
579
565
|
} catch {
|
|
580
566
|
}
|
|
581
|
-
console.error("[Vue Error]",
|
|
567
|
+
console.error("[Vue Error]", g, v), o.includes(v) && (e.onCritical ?? ee().trigger)(g);
|
|
582
568
|
};
|
|
583
569
|
}
|
|
584
570
|
export {
|
|
585
|
-
|
|
571
|
+
xt as OneCrashScreen,
|
|
586
572
|
gt as OneErrorPage,
|
|
587
|
-
|
|
588
|
-
|
|
573
|
+
yt as OneNotFoundPage,
|
|
574
|
+
pt as OneServerErrorPage,
|
|
589
575
|
Ue as OneSnakeGame,
|
|
590
|
-
|
|
591
|
-
|
|
576
|
+
ht as createAppErrorHandler,
|
|
577
|
+
ee as useCrashState
|
|
592
578
|
};
|