@deep-eye/core 0.9.0 → 1.0.0
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/CHANGELOG.md +100 -0
- package/README.md +140 -86
- package/dist/components/chat/ChatBot.vue.d.ts +48 -17
- package/dist/components/chat/ChatBot.vue.d.ts.map +1 -1
- package/dist/components/chat/attachmentController.d.ts +25 -0
- package/dist/components/chat/attachmentController.d.ts.map +1 -0
- package/dist/components/chat/attachments.d.ts +12 -0
- package/dist/components/chat/attachments.d.ts.map +1 -0
- package/dist/components/chat/chatContext.d.ts +14 -0
- package/dist/components/chat/chatContext.d.ts.map +1 -0
- package/dist/components/chat/chatErrors.d.ts +16 -0
- package/dist/components/chat/chatErrors.d.ts.map +1 -0
- package/dist/components/chat/chatQueue.d.ts +6 -0
- package/dist/components/chat/chatQueue.d.ts.map +1 -0
- package/dist/components/chat/components/ArtifactPreview.vue.d.ts +15 -0
- package/dist/components/chat/components/ArtifactPreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatActionbar.vue.d.ts +3 -3
- package/dist/components/chat/components/ChatActionbar.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatAttachments.vue.d.ts +12 -0
- package/dist/components/chat/components/ChatAttachments.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatFilePreview.vue.d.ts +45 -0
- package/dist/components/chat/components/ChatFilePreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts +24 -0
- package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatImageLightbox.vue.d.ts +16 -0
- package/dist/components/chat/components/ChatImageLightbox.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatMediaPreview.vue.d.ts +9 -0
- package/dist/components/chat/components/ChatMediaPreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatMessage.vue.d.ts +43 -2
- package/dist/components/chat/components/ChatMessage.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatOfficePreview.vue.d.ts +9 -0
- package/dist/components/chat/components/ChatOfficePreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatProvider.vue.d.ts +73 -0
- package/dist/components/chat/components/ChatProvider.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatQueue.vue.d.ts +16 -0
- package/dist/components/chat/components/ChatQueue.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatReasoning.vue.d.ts +21 -0
- package/dist/components/chat/components/ChatReasoning.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatSender.vue.d.ts +34 -17
- package/dist/components/chat/components/ChatSender.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts +13 -0
- package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatToolGroup.vue.d.ts +28 -0
- package/dist/components/chat/components/ChatToolGroup.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ConversationList.vue.d.ts +129 -0
- package/dist/components/chat/components/ConversationList.vue.d.ts.map +1 -0
- package/dist/components/chat/components/InputContentParts.vue.d.ts +8 -0
- package/dist/components/chat/components/InputContentParts.vue.d.ts.map +1 -0
- package/dist/components/chat/components/MessageBubble.vue.d.ts +43 -2
- package/dist/components/chat/components/MessageBubble.vue.d.ts.map +1 -1
- package/dist/components/chat/components/TextPartRenderer.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ToolCallPart.vue.d.ts +12 -3
- package/dist/components/chat/components/ToolCallPart.vue.d.ts.map +1 -1
- package/dist/components/chat/components/index.d.ts +9 -0
- package/dist/components/chat/components/index.d.ts.map +1 -1
- package/dist/components/chat/composables/index.d.ts +0 -1
- package/dist/components/chat/composables/index.d.ts.map +1 -1
- package/dist/components/chat/composables/useChatVoice.d.ts +45 -0
- package/dist/components/chat/composables/useChatVoice.d.ts.map +1 -0
- package/dist/components/chat/composables/useConversation.d.ts +1 -5
- package/dist/components/chat/composables/useConversation.d.ts.map +1 -1
- package/dist/components/chat/composables/useMeasuredHeight.d.ts +11 -0
- package/dist/components/chat/composables/useMeasuredHeight.d.ts.map +1 -0
- package/dist/components/chat/composables/useStreamSmoothing.d.ts +13 -0
- package/dist/components/chat/composables/useStreamSmoothing.d.ts.map +1 -0
- package/dist/components/chat/index.d.ts +12 -4
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/mdoc/ContentNodes.vue.d.ts.map +1 -1
- package/dist/components/chat/mdoc/MediaImageStack.vue.d.ts.map +1 -1
- package/dist/components/chat/previewRenderers.d.ts +6 -0
- package/dist/components/chat/previewRenderers.d.ts.map +1 -0
- package/dist/components/chat/qiniuUpload.d.ts +10 -0
- package/dist/components/chat/qiniuUpload.d.ts.map +1 -0
- package/dist/components/chat/responseStream.d.ts +17 -0
- package/dist/components/chat/responseStream.d.ts.map +1 -0
- package/dist/components/chat/toolLabels.d.ts +4 -0
- package/dist/components/chat/toolLabels.d.ts.map +1 -0
- package/dist/components/chat/toolStatus.d.ts +16 -0
- package/dist/components/chat/toolStatus.d.ts.map +1 -0
- package/dist/components/chat/types.d.ts +457 -144
- package/dist/components/chat/types.d.ts.map +1 -1
- package/dist/components/visualization/types.d.ts +8 -7
- package/dist/components/visualization/types.d.ts.map +1 -1
- package/dist/components/visualization/utils.d.ts +4 -2
- package/dist/components/visualization/utils.d.ts.map +1 -1
- package/dist/composables/useMindMapTheme.d.ts +4 -7
- package/dist/composables/useMindMapTheme.d.ts.map +1 -1
- package/dist/errors-CHzikrqu.js +70 -0
- package/dist/errors-upLl4kf2.cjs +1 -0
- package/dist/index-B4hgICk-.cjs +198 -0
- package/dist/index-BJdNN1GV.cjs +33 -0
- package/dist/index-Bj9h-xEr.cjs +112 -0
- package/dist/index-BufnUXnQ.js +5071 -0
- package/dist/index-CnxZBHPD.js +42825 -0
- package/dist/index-DF8KmkKX.js +38392 -0
- package/dist/index-DPhuLMkO.cjs +1 -0
- package/dist/index-Dq4cniDm.cjs +5 -0
- package/dist/index-cW_BnxHR.js +1722 -0
- package/dist/index-iCVvFIlX.js +28 -0
- package/dist/index.cjs +275 -49
- package/dist/index.js +18895 -8273
- package/dist/media-community-skin-Djo8L1G9.js +302 -0
- package/dist/media-community-skin-YI6NjsJg.cjs +1 -0
- package/dist/media-core-CkW37AYl.js +3827 -0
- package/dist/media-core-Rxz2MNwG.cjs +1 -0
- package/dist/media-outlet-CZTh6XmJ.cjs +1 -0
- package/dist/media-outlet-D2rcuhYN.js +2 -0
- package/dist/media-player-BZrIM0O_.js +387 -0
- package/dist/media-player-D_USOhtK.cjs +1 -0
- package/dist/media-ui-DfPbRfFS.js +2832 -0
- package/dist/media-ui-zZVnK1ts.cjs +1 -0
- package/dist/prod-Ba2x-T01.cjs +4 -0
- package/dist/prod-DBMM0zDd.js +992 -0
- package/dist/provider-B7wAEcCR.js +163 -0
- package/dist/provider-BPphQwpc.cjs +1 -0
- package/dist/provider-BSeBwvzM.cjs +1 -0
- package/dist/provider-DgSZc2dM.js +162 -0
- package/dist/provider-EKFFiZS1.js +27 -0
- package/dist/provider-O8r0RFmF.cjs +1 -0
- package/dist/provider-WrRdjcjY.js +483 -0
- package/dist/provider-sqICX3H9.cjs +1 -0
- package/dist/srt-parser-BECMkbXb.cjs +2 -0
- package/dist/srt-parser-BR28Llpk.js +27 -0
- package/dist/ssa-parser-BJTK0kd-.js +209 -0
- package/dist/ssa-parser-CuKkTpK_.cjs +4 -0
- package/dist/style.css +1 -1
- package/package.json +8 -2
- package/dist/components/chat/AiConversation.vue.d.ts +0 -28
- package/dist/components/chat/AiConversation.vue.d.ts.map +0 -1
- package/dist/components/chat/components/AssistantTrace.vue.d.ts +0 -27
- package/dist/components/chat/components/AssistantTrace.vue.d.ts.map +0 -1
- package/dist/components/chat/composables/useConversationStream.d.ts +0 -3
- package/dist/components/chat/composables/useConversationStream.d.ts.map +0 -1
- package/dist/components/chat/presentation.d.ts +0 -27
- package/dist/components/chat/presentation.d.ts.map +0 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
var F = Object.defineProperty;
|
|
2
|
+
var A = (c, t, s) => t in c ? F(c, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : c[t] = s;
|
|
3
|
+
var u = (c, t, s) => A(c, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { b as L, p as y } from "./prod-DBMM0zDd.js";
|
|
5
|
+
const b = /^Format:[\s\t]*/, O = /^Style:[\s\t]*/, _ = /^Dialogue:[\s\t]*/, S = /[\s\t]*,[\s\t]*/, w = /\{[^}]+\}/g, I = /\\N/g, x = /^\[(.*)[\s\t]?Styles\]$/, m = /^\[(.*)[\s\t]?Events\]$/;
|
|
6
|
+
class $ {
|
|
7
|
+
constructor() {
|
|
8
|
+
u(this, "f");
|
|
9
|
+
u(this, "O", 0);
|
|
10
|
+
u(this, "a", null);
|
|
11
|
+
u(this, "j", []);
|
|
12
|
+
u(this, "k", []);
|
|
13
|
+
u(this, "N", null);
|
|
14
|
+
u(this, "d");
|
|
15
|
+
u(this, "P", {});
|
|
16
|
+
}
|
|
17
|
+
async init(t) {
|
|
18
|
+
this.f = t, t.errors && (this.d = (await import("./errors-CHzikrqu.js")).ParseErrorBuilder);
|
|
19
|
+
}
|
|
20
|
+
parse(t, s) {
|
|
21
|
+
var e, a;
|
|
22
|
+
if (this.O)
|
|
23
|
+
switch (this.O) {
|
|
24
|
+
case 1:
|
|
25
|
+
if (t === "")
|
|
26
|
+
this.O = 0;
|
|
27
|
+
else if (O.test(t))
|
|
28
|
+
if (this.N) {
|
|
29
|
+
const i = t.replace(O, "").split(S);
|
|
30
|
+
this.S(i);
|
|
31
|
+
} else
|
|
32
|
+
this.e((e = this.d) == null ? void 0 : e.T("Style", s));
|
|
33
|
+
else b.test(t) ? this.N = t.replace(b, "").split(S) : m.test(t) && (this.N = null, this.O = 2);
|
|
34
|
+
break;
|
|
35
|
+
case 2:
|
|
36
|
+
if (t === "")
|
|
37
|
+
this.Q();
|
|
38
|
+
else if (_.test(t))
|
|
39
|
+
if (this.Q(), this.N) {
|
|
40
|
+
const i = t.replace(_, "").split(S), r = this.U(i, s);
|
|
41
|
+
r && (this.a = r);
|
|
42
|
+
} else
|
|
43
|
+
this.e((a = this.d) == null ? void 0 : a.T("Dialogue", s));
|
|
44
|
+
else this.a ? this.a.text += `
|
|
45
|
+
` + t.replace(w, "").replace(I, `
|
|
46
|
+
`) : b.test(t) ? this.N = t.replace(b, "").split(S) : x.test(t) ? (this.N = null, this.O = 1) : m.test(t) && (this.N = null);
|
|
47
|
+
}
|
|
48
|
+
else t === "" || (x.test(t) ? (this.N = null, this.O = 1) : m.test(t) && (this.N = null, this.O = 2));
|
|
49
|
+
}
|
|
50
|
+
done() {
|
|
51
|
+
return {
|
|
52
|
+
metadata: {},
|
|
53
|
+
cues: this.j,
|
|
54
|
+
regions: [],
|
|
55
|
+
errors: this.k
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
Q() {
|
|
59
|
+
var t, s;
|
|
60
|
+
this.a && (this.j.push(this.a), (s = (t = this.f).onCue) == null || s.call(t, this.a), this.a = null);
|
|
61
|
+
}
|
|
62
|
+
S(t) {
|
|
63
|
+
let s = "Default", e = {}, a, i = "center", r = "bottom", f, n = 1.2, o, p, h = 3, d = [];
|
|
64
|
+
for (let g = 0; g < this.N.length; g++) {
|
|
65
|
+
const M = this.N[g], l = t[g];
|
|
66
|
+
switch (M) {
|
|
67
|
+
case "Name":
|
|
68
|
+
s = l;
|
|
69
|
+
break;
|
|
70
|
+
case "Fontname":
|
|
71
|
+
e["font-family"] = l;
|
|
72
|
+
break;
|
|
73
|
+
case "Fontsize":
|
|
74
|
+
e["font-size"] = `calc(${l} / var(--overlay-height))`;
|
|
75
|
+
break;
|
|
76
|
+
case "PrimaryColour":
|
|
77
|
+
const E = N(l);
|
|
78
|
+
E && (e["--cue-color"] = E);
|
|
79
|
+
break;
|
|
80
|
+
case "BorderStyle":
|
|
81
|
+
h = parseInt(l, 10);
|
|
82
|
+
break;
|
|
83
|
+
case "BackColour":
|
|
84
|
+
p = N(l);
|
|
85
|
+
break;
|
|
86
|
+
case "OutlineColour":
|
|
87
|
+
const R = N(l);
|
|
88
|
+
R && (o = R);
|
|
89
|
+
break;
|
|
90
|
+
case "Bold":
|
|
91
|
+
parseInt(l) && (e["font-weight"] = "bold");
|
|
92
|
+
break;
|
|
93
|
+
case "Italic":
|
|
94
|
+
parseInt(l) && (e["font-style"] = "italic");
|
|
95
|
+
break;
|
|
96
|
+
case "Underline":
|
|
97
|
+
parseInt(l) && (e["text-decoration"] = "underline");
|
|
98
|
+
break;
|
|
99
|
+
case "StrikeOut":
|
|
100
|
+
parseInt(l) && (e["text-decoration"] = "line-through");
|
|
101
|
+
break;
|
|
102
|
+
case "Spacing":
|
|
103
|
+
e["letter-spacing"] = l + "px";
|
|
104
|
+
break;
|
|
105
|
+
case "AlphaLevel":
|
|
106
|
+
e.opacity = parseFloat(l);
|
|
107
|
+
break;
|
|
108
|
+
case "ScaleX":
|
|
109
|
+
d.push(`scaleX(${parseFloat(l) / 100})`);
|
|
110
|
+
break;
|
|
111
|
+
case "ScaleY":
|
|
112
|
+
d.push(`scaleY(${parseFloat(l) / 100})`);
|
|
113
|
+
break;
|
|
114
|
+
case "Angle":
|
|
115
|
+
d.push(`rotate(${l}deg)`);
|
|
116
|
+
break;
|
|
117
|
+
case "Shadow":
|
|
118
|
+
n = parseInt(l, 10) * 1.2;
|
|
119
|
+
break;
|
|
120
|
+
case "MarginL":
|
|
121
|
+
e["--cue-width"] = "auto", e["--cue-left"] = parseFloat(l) + "px";
|
|
122
|
+
break;
|
|
123
|
+
case "MarginR":
|
|
124
|
+
e["--cue-width"] = "auto", e["--cue-right"] = parseFloat(l) + "px";
|
|
125
|
+
break;
|
|
126
|
+
case "MarginV":
|
|
127
|
+
f = parseFloat(l);
|
|
128
|
+
break;
|
|
129
|
+
case "Outline":
|
|
130
|
+
a = parseInt(l, 10);
|
|
131
|
+
break;
|
|
132
|
+
case "Alignment":
|
|
133
|
+
const k = parseInt(l, 10);
|
|
134
|
+
switch (k >= 4 && (r = k >= 7 ? "top" : "center"), k % 3) {
|
|
135
|
+
case 1:
|
|
136
|
+
i = "start";
|
|
137
|
+
break;
|
|
138
|
+
case 2:
|
|
139
|
+
i = "center";
|
|
140
|
+
break;
|
|
141
|
+
case 3:
|
|
142
|
+
i = "end";
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (e.R = r, e["--cue-white-space"] = "normal", e["--cue-line-height"] = "normal", e["--cue-text-align"] = i, r === "center" ? (e["--cue-top"] = "50%", d.push("translateY(-50%)")) : e[`--cue-${r}`] = (f || 0) + "px", h === 1 && (e["--cue-padding-y"] = "0"), (h === 1 || p) && (e["--cue-bg-color"] = h === 1 ? "none" : p), h === 3 && o && (e["--cue-outline"] = `${a}px solid ${o}`), h === 1 && typeof a == "number") {
|
|
148
|
+
const g = p ?? "#000";
|
|
149
|
+
e["--cue-text-shadow"] = [
|
|
150
|
+
o && T(a * 1.2, n * 1.2, o),
|
|
151
|
+
o ? T(a * (a / 2), n * (a / 2), g) : T(a, n, g)
|
|
152
|
+
].filter(Boolean).join(", ");
|
|
153
|
+
}
|
|
154
|
+
d.length && (e["--cue-transform"] = d.join(" ")), this.P[s] = e;
|
|
155
|
+
}
|
|
156
|
+
U(t, s) {
|
|
157
|
+
const e = this.V(t), a = this.o(e.Start, e.End, s);
|
|
158
|
+
if (!a)
|
|
159
|
+
return;
|
|
160
|
+
const i = new L(a[0], a[1], ""), r = { ...this.P[e.Style] || {} }, f = e.Name ? `<v ${e.Name}>` : "", n = r.R, o = e.MarginL && parseFloat(e.MarginL), p = e.MarginR && parseFloat(e.MarginR), h = e.MarginV && parseFloat(e.MarginV);
|
|
161
|
+
return o && (r["--cue-width"] = "auto", r["--cue-left"] = o + "px"), p && (r["--cue-width"] = "auto", r["--cue-right"] = p + "px"), h && n !== "center" && (r[`--cue-${n}`] = h + "px"), i.text = f + t.slice(this.N.length - 1).join(", ").replace(w, "").replace(I, `
|
|
162
|
+
`), delete r.R, Object.keys(r).length && (i.style = r), i;
|
|
163
|
+
}
|
|
164
|
+
V(t) {
|
|
165
|
+
const s = {};
|
|
166
|
+
for (let e = 0; e < this.N.length; e++)
|
|
167
|
+
s[this.N[e]] = t[e];
|
|
168
|
+
return s;
|
|
169
|
+
}
|
|
170
|
+
o(t, s, e) {
|
|
171
|
+
var r, f, n;
|
|
172
|
+
const a = y(t), i = y(s);
|
|
173
|
+
if (a !== null && i !== null && i > a)
|
|
174
|
+
return [a, i];
|
|
175
|
+
a === null && this.e((r = this.d) == null ? void 0 : r.q(t, e)), i === null && this.e((f = this.d) == null ? void 0 : f.r(s, e)), a != null && i !== null && i > a && this.e((n = this.d) == null ? void 0 : n.s(a, i, e));
|
|
176
|
+
}
|
|
177
|
+
e(t) {
|
|
178
|
+
var s, e;
|
|
179
|
+
if (t) {
|
|
180
|
+
if (this.k.push(t), this.f.strict)
|
|
181
|
+
throw this.f.cancel(), t;
|
|
182
|
+
(e = (s = this.f).onError) == null || e.call(s, t);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function N(c) {
|
|
187
|
+
const t = parseInt(c.replace("&H", ""), 16);
|
|
188
|
+
if (t >= 0) {
|
|
189
|
+
const e = (t >> 24 & 255 ^ 255) / 255, a = t >> 16 & 255, i = t >> 8 & 255;
|
|
190
|
+
return "rgba(" + [t & 255, i, a, e].join(",") + ")";
|
|
191
|
+
}
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
function T(c, t, s) {
|
|
195
|
+
const e = Math.ceil(2 * Math.PI * c);
|
|
196
|
+
let a = "";
|
|
197
|
+
for (let i = 0; i < e; i++) {
|
|
198
|
+
const r = 2 * Math.PI * i / e;
|
|
199
|
+
a += c * Math.cos(r) + "px " + t * Math.sin(r) + "px 0 " + s + (i == e - 1 ? "" : ",");
|
|
200
|
+
}
|
|
201
|
+
return a;
|
|
202
|
+
}
|
|
203
|
+
function j() {
|
|
204
|
+
return new $();
|
|
205
|
+
}
|
|
206
|
+
export {
|
|
207
|
+
$ as SSAParser,
|
|
208
|
+
j as default
|
|
209
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var A=Object.defineProperty;var P=(n,t,s)=>t in n?A(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s;var u=(n,t,s)=>P(n,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./prod-Ba2x-T01.cjs"),b=/^Format:[\s\t]*/,O=/^Style:[\s\t]*/,_=/^Dialogue:[\s\t]*/,S=/[\s\t]*,[\s\t]*/,w=/\{[^}]+\}/g,I=/\\N/g,M=/^\[(.*)[\s\t]?Styles\]$/,m=/^\[(.*)[\s\t]?Events\]$/;class x{constructor(){u(this,"f");u(this,"O",0);u(this,"a",null);u(this,"j",[]);u(this,"k",[]);u(this,"N",null);u(this,"d");u(this,"P",{})}async init(t){this.f=t,t.errors&&(this.d=(await Promise.resolve().then(()=>require("./errors-upLl4kf2.cjs"))).ParseErrorBuilder)}parse(t,s){var e,a;if(this.O)switch(this.O){case 1:if(t==="")this.O=0;else if(O.test(t))if(this.N){const i=t.replace(O,"").split(S);this.S(i)}else this.e((e=this.d)==null?void 0:e.T("Style",s));else b.test(t)?this.N=t.replace(b,"").split(S):m.test(t)&&(this.N=null,this.O=2);break;case 2:if(t==="")this.Q();else if(_.test(t))if(this.Q(),this.N){const i=t.replace(_,"").split(S),r=this.U(i,s);r&&(this.a=r)}else this.e((a=this.d)==null?void 0:a.T("Dialogue",s));else this.a?this.a.text+=`
|
|
2
|
+
`+t.replace(w,"").replace(I,`
|
|
3
|
+
`):b.test(t)?this.N=t.replace(b,"").split(S):M.test(t)?(this.N=null,this.O=1):m.test(t)&&(this.N=null)}else t===""||(M.test(t)?(this.N=null,this.O=1):m.test(t)&&(this.N=null,this.O=2))}done(){return{metadata:{},cues:this.j,regions:[],errors:this.k}}Q(){var t,s;this.a&&(this.j.push(this.a),(s=(t=this.f).onCue)==null||s.call(t,this.a),this.a=null)}S(t){let s="Default",e={},a,i="center",r="bottom",f,c=1.2,o,p,h=3,d=[];for(let g=0;g<this.N.length;g++){const F=this.N[g],l=t[g];switch(F){case"Name":s=l;break;case"Fontname":e["font-family"]=l;break;case"Fontsize":e["font-size"]=`calc(${l} / var(--overlay-height))`;break;case"PrimaryColour":const R=N(l);R&&(e["--cue-color"]=R);break;case"BorderStyle":h=parseInt(l,10);break;case"BackColour":p=N(l);break;case"OutlineColour":const y=N(l);y&&(o=y);break;case"Bold":parseInt(l)&&(e["font-weight"]="bold");break;case"Italic":parseInt(l)&&(e["font-style"]="italic");break;case"Underline":parseInt(l)&&(e["text-decoration"]="underline");break;case"StrikeOut":parseInt(l)&&(e["text-decoration"]="line-through");break;case"Spacing":e["letter-spacing"]=l+"px";break;case"AlphaLevel":e.opacity=parseFloat(l);break;case"ScaleX":d.push(`scaleX(${parseFloat(l)/100})`);break;case"ScaleY":d.push(`scaleY(${parseFloat(l)/100})`);break;case"Angle":d.push(`rotate(${l}deg)`);break;case"Shadow":c=parseInt(l,10)*1.2;break;case"MarginL":e["--cue-width"]="auto",e["--cue-left"]=parseFloat(l)+"px";break;case"MarginR":e["--cue-width"]="auto",e["--cue-right"]=parseFloat(l)+"px";break;case"MarginV":f=parseFloat(l);break;case"Outline":a=parseInt(l,10);break;case"Alignment":const k=parseInt(l,10);switch(k>=4&&(r=k>=7?"top":"center"),k%3){case 1:i="start";break;case 2:i="center";break;case 3:i="end";break}}}if(e.R=r,e["--cue-white-space"]="normal",e["--cue-line-height"]="normal",e["--cue-text-align"]=i,r==="center"?(e["--cue-top"]="50%",d.push("translateY(-50%)")):e[`--cue-${r}`]=(f||0)+"px",h===1&&(e["--cue-padding-y"]="0"),(h===1||p)&&(e["--cue-bg-color"]=h===1?"none":p),h===3&&o&&(e["--cue-outline"]=`${a}px solid ${o}`),h===1&&typeof a=="number"){const g=p??"#000";e["--cue-text-shadow"]=[o&&E(a*1.2,c*1.2,o),o?E(a*(a/2),c*(a/2),g):E(a,c,g)].filter(Boolean).join(", ")}d.length&&(e["--cue-transform"]=d.join(" ")),this.P[s]=e}U(t,s){const e=this.V(t),a=this.o(e.Start,e.End,s);if(!a)return;const i=new T.VTTCue(a[0],a[1],""),r={...this.P[e.Style]||{}},f=e.Name?`<v ${e.Name}>`:"",c=r.R,o=e.MarginL&&parseFloat(e.MarginL),p=e.MarginR&&parseFloat(e.MarginR),h=e.MarginV&&parseFloat(e.MarginV);return o&&(r["--cue-width"]="auto",r["--cue-left"]=o+"px"),p&&(r["--cue-width"]="auto",r["--cue-right"]=p+"px"),h&&c!=="center"&&(r[`--cue-${c}`]=h+"px"),i.text=f+t.slice(this.N.length-1).join(", ").replace(w,"").replace(I,`
|
|
4
|
+
`),delete r.R,Object.keys(r).length&&(i.style=r),i}V(t){const s={};for(let e=0;e<this.N.length;e++)s[this.N[e]]=t[e];return s}o(t,s,e){var r,f,c;const a=T.parseVTTTimestamp(t),i=T.parseVTTTimestamp(s);if(a!==null&&i!==null&&i>a)return[a,i];a===null&&this.e((r=this.d)==null?void 0:r.q(t,e)),i===null&&this.e((f=this.d)==null?void 0:f.r(s,e)),a!=null&&i!==null&&i>a&&this.e((c=this.d)==null?void 0:c.s(a,i,e))}e(t){var s,e;if(t){if(this.k.push(t),this.f.strict)throw this.f.cancel(),t;(e=(s=this.f).onError)==null||e.call(s,t)}}}function N(n){const t=parseInt(n.replace("&H",""),16);if(t>=0){const e=(t>>24&255^255)/255,a=t>>16&255,i=t>>8&255;return"rgba("+[t&255,i,a,e].join(",")+")"}return null}function E(n,t,s){const e=Math.ceil(2*Math.PI*n);let a="";for(let i=0;i<e;i++){const r=2*Math.PI*i/e;a+=n*Math.cos(r)+"px "+t*Math.sin(r)+"px 0 "+s+(i==e-1?"":",")}return a}function L(){return new x}exports.SSAParser=x;exports.default=L;
|