164 lines
4.1 KiB
JavaScript
164 lines
4.1 KiB
JavaScript
/*
|
|
* Extracted from browser-delivered Turbopack chunk: 09166d9658efb080.e1742a6c63.js
|
|
* Module id: 799545
|
|
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
|
*/
|
|
|
|
const moduleFactory = (e) => {
|
|
"use strict";
|
|
function t(e) {
|
|
if ("string" != typeof e) return;
|
|
let t = e.trim();
|
|
if (t && "auto" !== t) return t;
|
|
}
|
|
let n = [
|
|
{ label: "1:1", value: 1 },
|
|
{ label: "9:16", value: 9 / 16 },
|
|
{ label: "16:9", value: 16 / 9 },
|
|
{ label: "3:4", value: 3 / 4 },
|
|
{ label: "4:3", value: 4 / 3 },
|
|
{ label: "3:2", value: 1.5 },
|
|
{ label: "2:3", value: 2 / 3 },
|
|
{ label: "4:5", value: 0.8 },
|
|
{ label: "5:4", value: 5 / 4 },
|
|
{ label: "21:9", value: 21 / 9 },
|
|
];
|
|
function o(e, t) {
|
|
if (e <= 0 || t <= 0) return "16:9";
|
|
let o = e / t,
|
|
i = "16:9",
|
|
r = 1 / 0;
|
|
for (let e of n) {
|
|
let t = Math.abs(o - e.value);
|
|
t < r && ((r = t), (i = e.label));
|
|
}
|
|
return i;
|
|
}
|
|
function i(e) {
|
|
if (!e) return;
|
|
let n = t(e.ratio);
|
|
if (n) return n;
|
|
for (let n of Object.keys(e)) {
|
|
if (!n.startsWith("ratio") || "ratio" === n) continue;
|
|
let o = t(e[n]);
|
|
if (o) return o;
|
|
}
|
|
return t(e.aspectRatio);
|
|
}
|
|
function r(e) {
|
|
if (null == e || "object" != typeof e) return;
|
|
let n = i(e.settings);
|
|
return n || t(e.aspectRatio);
|
|
}
|
|
function a(e) {
|
|
if (!e || "auto" === e) return { width: 350, height: 350 };
|
|
let t = e.split(":");
|
|
if (2 !== t.length) return { width: 350, height: 350 };
|
|
let n = parseInt(t[0], 10),
|
|
o = parseInt(t[1], 10);
|
|
return isNaN(n) || isNaN(o) || n <= 0 || o <= 0
|
|
? { width: 350, height: 350 }
|
|
: n <= o
|
|
? { width: 350, height: Math.min(Math.round((o / n) * 350), 1050) }
|
|
: { width: Math.min(Math.round((n / o) * 350), 1050), height: 350 };
|
|
}
|
|
function s(e, t) {
|
|
return e <= 0 || t <= 0
|
|
? { width: 350, height: 350 }
|
|
: e >= t
|
|
? { width: Math.min(Math.round((e / t) * 350), 1050), height: 350 }
|
|
: { width: 350, height: Math.min(Math.round((t / e) * 350), 1050) };
|
|
}
|
|
e.s(
|
|
[
|
|
"CONFIRM_AREA_H",
|
|
0,
|
|
44,
|
|
"GRID_GAP",
|
|
0,
|
|
8,
|
|
"GRID_ITEM_H",
|
|
0,
|
|
163,
|
|
"GRID_ITEM_W",
|
|
0,
|
|
163,
|
|
"GRID_PADDING",
|
|
0,
|
|
8,
|
|
"MAX_VIDEO_COMPOSE_DURATION_SEC",
|
|
0,
|
|
1200,
|
|
"NODE_GAP",
|
|
0,
|
|
100,
|
|
"NODE_HEIGHT_EMPTY",
|
|
0,
|
|
350,
|
|
"NODE_WIDTH",
|
|
0,
|
|
350,
|
|
"SNAP_GRID_SIZE",
|
|
0,
|
|
12,
|
|
"approximateToPresetRatio",
|
|
() => o,
|
|
"computeNodeDimensionsFromNatural",
|
|
() => s,
|
|
"computeNodeDimensionsFromRatio",
|
|
() => a,
|
|
"extractRatioFromNodeParams",
|
|
() => r,
|
|
"extractRatioFromSettings",
|
|
() => i,
|
|
],
|
|
713118,
|
|
);
|
|
let l = "asset://";
|
|
function d(e) {
|
|
return e.startsWith(l);
|
|
}
|
|
function u(e) {
|
|
return e.startsWith(l) ? e.slice(l.length) : void 0;
|
|
}
|
|
function c(e) {
|
|
return Array.isArray(e) && 0 !== e.length
|
|
? e
|
|
.map((e, t) => {
|
|
if ("string" == typeof e)
|
|
return { url: e, nodeId: `legacy-${t}` };
|
|
if (e && "object" == typeof e) {
|
|
if (Array.isArray(e.url)) {
|
|
let n = e.url[0] ?? "";
|
|
return n
|
|
? { ...e, url: n, nodeId: e.nodeId ?? `legacy-${t}` }
|
|
: null;
|
|
}
|
|
if ("string" == typeof e.url) return e;
|
|
}
|
|
return null;
|
|
})
|
|
.filter((e) => null !== e && "" !== e.url)
|
|
: [];
|
|
}
|
|
e.s(
|
|
[
|
|
"MAGIC_SELECT_MAX_COUNT",
|
|
0,
|
|
20,
|
|
"PORTRAIT_ASSET_PROTOCOL",
|
|
0,
|
|
l,
|
|
"isAssetProtocol",
|
|
() => d,
|
|
"normalizeMediaList",
|
|
() => c,
|
|
"parseAssetId",
|
|
() => u,
|
|
],
|
|
799545,
|
|
);
|
|
};
|
|
|
|
export default moduleFactory;
|