xvai-loi 0.1.85 → 0.1.87

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.
Files changed (3) hide show
  1. package/co.txt +1 -1
  2. package/package.json +1 -1
  3. package/xvai-loi.js +21 -2
package/co.txt CHANGED
@@ -1 +1 @@
1
- xvaiLoi120210
1
+ xvaiLoi120323
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xvai-loi",
3
- "version": "0.1.85",
3
+ "version": "0.1.87",
4
4
  "description": "Loi dung video (Edit Video Tu Dong) nap vao tool Google Flow qua o cam engine/oCam.ts",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/xvai-loi.js CHANGED
@@ -11549,6 +11549,12 @@ function lapCuongMe(o) {
11549
11549
  the0(a, a + (t1 - t0), d);
11550
11550
  };
11551
11551
  const F = (fa, fb) => matRa(fm, nguon3(fa), nguon3(fb), [0, 0, 0, 0], 1, zc);
11552
+ const yenMat = (fa, fb) => {
11553
+ const a0 = nguon3(fa), b0 = nguon3(fb), ss = (fm || []).filter((x) => x && x.face && x.t >= a0 && x.t <= b0).map((x) => x.face);
11554
+ if (ss.length < 2) return true;
11555
+ const cx = ss.map((q) => q.x + q.w / 2), cy = ss.map((q) => q.y + q.h / 2), hh = ss.map((q) => q.h);
11556
+ return Math.max(...cx) - Math.min(...cx) <= 0.12 && Math.max(...cy) - Math.min(...cy) <= 0.08 && Math.max(...hh) / Math.max(1e-6, Math.min(...hh)) <= 1.35;
11557
+ };
11552
11558
  const tyLeMat = (fa, fb) => {
11553
11559
  const a0 = nguon3(fa), b0 = nguon3(fb), ss = (fm || []).filter((x) => x && x.t >= a0 && x.t <= b0);
11554
11560
  return ss.length ? ss.filter((x) => x.face).length / ss.length : 0;
@@ -11953,7 +11959,7 @@ function lapCuongMe(o) {
11953
11959
  if (x.kieu === "anh" && dV) {
11954
11960
  de(f2, dV, { uuTien: UT.so + 5, bo: "anh", ten: ten2, chu: chuK, chu2: chu22, keu: "whoosh", video: 1 }, 3, datAnh);
11955
11961
  ghiL("video", { bo: "anh", f: f2, d: dV }, "kho video: ung vien clip " + dV.toFixed(1) + " s thay anh: " + String(x.tu || ""));
11956
- } else if (x.kieu === "anh" && (co || chuK)) de(f2, (f2 < f1 ? 2 : 2.4) * kTram(), { uuTien: UT.anh, ...co ? ((o2) => x.khuon ? { ...o2, keu: "" } : o2)(nAnh++ % 3 === 0 || !((fb) => fb && fb[3] - fb[1] < KHUON_TOPN.nguoi.matToiDa)(F(f2, f2 + 2.4)) || tyLeMat(f2, f2 + 2.4) < 0.7 ? { bo: "anh", ten: ten2, chu: chuK, chu2: chu22, keu: "whoosh" } : (nAnh - 1) % 3 === 1 ? { bo: "chia", ten: ten2, chu: chuK, keu: "whoosh" } : { bo: "anh", ten: ten2, chu: chuK, chu2: chu22, pip: 1, keu: "whoosh" }) : { bo: "kinh", dong: [chuK, chu22].filter(Boolean), keu: "whoosh" } }, 3, datAnh);
11962
+ } else if (x.kieu === "anh" && (co || chuK)) de(f2, (f2 < f1 ? 2 : 2.4) * kTram(), { uuTien: UT.anh, ...co ? ((o2) => x.khuon ? { ...o2, keu: "" } : o2)(nAnh++ % 3 === 0 || !((fb) => fb && fb[3] - fb[1] < KHUON_TOPN.nguoi.matToiDa)(F(f2, f2 + 2.4)) || tyLeMat(f2, f2 + 2.4) < 0.7 || !yenMat(f2, f2 + 3.6) ? { bo: "anh", ten: ten2, chu: chuK, chu2: chu22, keu: "whoosh" } : (nAnh - 1) % 3 === 1 ? { bo: "chia", ten: ten2, chu: chuK, keu: "whoosh" } : { bo: "anh", ten: ten2, chu: chuK, chu2: chu22, pip: 1, keu: "whoosh" }) : { bo: "kinh", dong: [chuK, chu22].filter(Boolean), keu: "whoosh" } }, 3, datAnh);
11957
11963
  else if (x.kieu === "vat") {
11958
11964
  const LG = timLogo(suaChu(chuK + " " + sach3(String(x.tu || ""))))[0];
11959
11965
  if (LG) napHinhLogo(LG.slug);
@@ -12947,6 +12953,15 @@ function lapCuongMe(o) {
12947
12953
  sp.splice(i, 1);
12948
12954
  }
12949
12955
  }
12956
+ sp.forEach((x) => {
12957
+ const c2 = nt(x.chu2), c1 = nt(x.giant || x.chu || x.tieu);
12958
+ if (!c2 || !c1) return;
12959
+ const W1 = new Set(c1.split(/\s+/));
12960
+ if (c2.split(/\s+/).every((w) => W1.has(w))) {
12961
+ ghiL("doi", x, "chu2 trung y chu chinh: " + String(x.chu2).slice(0, 20));
12962
+ x.chu2 = "";
12963
+ }
12964
+ });
12950
12965
  }
12951
12966
  {
12952
12967
  sp.sort((p, q) => p.f - q.f);
@@ -13239,6 +13254,10 @@ function lapCuongMe(o) {
13239
13254
  }
13240
13255
  });
13241
13256
  if (s.bo === "card" || s.bo === "cut" || s.bo === "chia") (ms || []).forEach((q) => {
13257
+ if (q.kind === "sub" && q.t0 >= b - 0.06 && q.t0 < b + 0.04 && q.t1 > b + 0.2) {
13258
+ q.t0 = +(b + 0.04).toFixed(3);
13259
+ return;
13260
+ }
13242
13261
  if (q.kind === "sub" && q.t0 >= a - 0.2 && q.t0 < b && q.t1 <= b + 0.05) q.safeY = s.bo === "chia" ? 0.47 : s.bo === "card" ? 0.87 : 0.775;
13243
13262
  else if (s.bo === "chia" && q.kind === "sub" && q.t1 > a && q.t0 < b) q.safeY = 0.79;
13244
13263
  });
@@ -20990,7 +21009,7 @@ function datCauLenh(a) {
20990
21009
  on2 = true;
20991
21010
  window.addEventListener("message", async (ev) => {
20992
21011
  const d = ev.data;
20993
- if (!d || d.xvaiLoi120210 !== true) return;
21012
+ if (!d || d.xvaiLoi120323 !== true) return;
20994
21013
  const o = String(ev.origin || "");
20995
21014
  if (!(o.indexOf("https://flow.google.com") === 0 || o.indexOf("https://labs.google") === 0)) return;
20996
21015
  const tra = (kq) => {