@nodaro/shared 3.63.0 → 3.64.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/dist/{chunk-AE3AAJ4O.js → chunk-36VWLB4J.js} +3 -3
- package/dist/{chunk-AE3AAJ4O.js.map → chunk-36VWLB4J.js.map} +1 -1
- package/dist/{chunk-HWQ2SYNA.js → chunk-3AYM47GW.js} +5 -5
- package/dist/{chunk-HWQ2SYNA.js.map → chunk-3AYM47GW.js.map} +1 -1
- package/dist/{chunk-CZ5IQB3L.js → chunk-3KTWYYCN.js} +8 -5
- package/dist/chunk-3KTWYYCN.js.map +1 -0
- package/dist/{chunk-4MMZD63H.js → chunk-4IUE2JB7.js} +3 -3
- package/dist/{chunk-4MMZD63H.js.map → chunk-4IUE2JB7.js.map} +1 -1
- package/dist/{chunk-M5OCFGHF.cjs → chunk-5OBTGNUQ.cjs} +296 -25
- package/dist/chunk-5OBTGNUQ.cjs.map +1 -0
- package/dist/{chunk-ZPE2ZTJ4.cjs → chunk-67CMMTLN.cjs} +4 -4
- package/dist/{chunk-ZPE2ZTJ4.cjs.map → chunk-67CMMTLN.cjs.map} +1 -1
- package/dist/{chunk-WRSWH7US.cjs → chunk-6BRWPJPP.cjs} +17 -2
- package/dist/chunk-6BRWPJPP.cjs.map +1 -0
- package/dist/{chunk-HBXF6RUU.js → chunk-6YIV37V7.js} +4 -4
- package/dist/{chunk-HBXF6RUU.js.map → chunk-6YIV37V7.js.map} +1 -1
- package/dist/{chunk-F6WGGYQW.cjs → chunk-7AJGUI7L.cjs} +37 -15
- package/dist/chunk-7AJGUI7L.cjs.map +1 -0
- package/dist/{chunk-KCZHQH2O.js → chunk-7KQ6W5DS.js} +4 -4
- package/dist/{chunk-KCZHQH2O.js.map → chunk-7KQ6W5DS.js.map} +1 -1
- package/dist/{chunk-TM5JYSJF.cjs → chunk-ACZZHHFZ.cjs} +72 -33
- package/dist/chunk-ACZZHHFZ.cjs.map +1 -0
- package/dist/{chunk-Y35JQPT6.cjs → chunk-AZNZ5WNZ.cjs} +42 -42
- package/dist/{chunk-Y35JQPT6.cjs.map → chunk-AZNZ5WNZ.cjs.map} +1 -1
- package/dist/{chunk-HSHCCBIV.js → chunk-BQYCZLMF.js} +16 -3
- package/dist/chunk-BQYCZLMF.js.map +1 -0
- package/dist/{chunk-GMBDLNLD.cjs → chunk-CHS2SIP6.cjs} +183 -60
- package/dist/chunk-CHS2SIP6.cjs.map +1 -0
- package/dist/{chunk-77WU3V3J.cjs → chunk-CHTZZRAL.cjs} +6 -6
- package/dist/{chunk-77WU3V3J.cjs.map → chunk-CHTZZRAL.cjs.map} +1 -1
- package/dist/{chunk-WZVIBAKN.cjs → chunk-D4KWNDPH.cjs} +12 -12
- package/dist/{chunk-WZVIBAKN.cjs.map → chunk-D4KWNDPH.cjs.map} +1 -1
- package/dist/{chunk-PSKZKLDG.js → chunk-DZ4IOP3Q.js} +288 -26
- package/dist/chunk-DZ4IOP3Q.js.map +1 -0
- package/dist/{chunk-XGVJGNZW.cjs → chunk-EXEVT6D2.cjs} +15 -5
- package/dist/chunk-EXEVT6D2.cjs.map +1 -0
- package/dist/{chunk-X5BAFW3Q.cjs → chunk-FHGRKQVZ.cjs} +8 -8
- package/dist/{chunk-X5BAFW3Q.cjs.map → chunk-FHGRKQVZ.cjs.map} +1 -1
- package/dist/{chunk-GSKLPI3J.cjs → chunk-GTWUS6MQ.cjs} +118 -61
- package/dist/chunk-GTWUS6MQ.cjs.map +1 -0
- package/dist/{chunk-Q6IES3U2.js → chunk-H5KHWTAE.js} +5 -2
- package/dist/chunk-H5KHWTAE.js.map +1 -0
- package/dist/{chunk-V5EEQR2U.cjs → chunk-HDPJNNMF.cjs} +21 -21
- package/dist/{chunk-V5EEQR2U.cjs.map → chunk-HDPJNNMF.cjs.map} +1 -1
- package/dist/{chunk-6M563QE6.js → chunk-IYSOVS7O.js} +55 -23
- package/dist/chunk-IYSOVS7O.js.map +1 -0
- package/dist/{chunk-XGGZWA4A.cjs → chunk-J6B7J73J.cjs} +52 -49
- package/dist/chunk-J6B7J73J.cjs.map +1 -0
- package/dist/{chunk-MD4XHED4.js → chunk-KB2SQAR3.js} +3 -3
- package/dist/{chunk-MD4XHED4.js.map → chunk-KB2SQAR3.js.map} +1 -1
- package/dist/{chunk-BLJUCPMV.cjs → chunk-KSHAAPQF.cjs} +5 -2
- package/dist/chunk-KSHAAPQF.cjs.map +1 -0
- package/dist/{chunk-6TGB7ECA.cjs → chunk-O4RPXBDZ.cjs} +12 -8
- package/dist/chunk-O4RPXBDZ.cjs.map +1 -0
- package/dist/{chunk-YUER7TJG.js → chunk-OBOOHG3N.js} +13 -4
- package/dist/chunk-OBOOHG3N.js.map +1 -0
- package/dist/{chunk-6BZC2ZHC.cjs → chunk-OOZW2MM6.cjs} +9 -9
- package/dist/{chunk-6BZC2ZHC.cjs.map → chunk-OOZW2MM6.cjs.map} +1 -1
- package/dist/{chunk-A2PX5IRC.cjs → chunk-PERUFUVH.cjs} +13 -13
- package/dist/{chunk-A2PX5IRC.cjs.map → chunk-PERUFUVH.cjs.map} +1 -1
- package/dist/{chunk-3K24DWOH.js → chunk-PJJAZQVZ.js} +3 -3
- package/dist/{chunk-3K24DWOH.js.map → chunk-PJJAZQVZ.js.map} +1 -1
- package/dist/{chunk-EPXGG27L.js → chunk-Q2Y4JHF7.js} +5 -5
- package/dist/{chunk-EPXGG27L.js.map → chunk-Q2Y4JHF7.js.map} +1 -1
- package/dist/{chunk-KMGCHV6O.js → chunk-QYU7J5EQ.js} +37 -15
- package/dist/chunk-QYU7J5EQ.js.map +1 -0
- package/dist/{chunk-IY3Y462W.js → chunk-S3UGLZSF.js} +3 -3
- package/dist/{chunk-IY3Y462W.js.map → chunk-S3UGLZSF.js.map} +1 -1
- package/dist/{chunk-34QLPTSA.js → chunk-SHH2T4CR.js} +3 -3
- package/dist/{chunk-34QLPTSA.js.map → chunk-SHH2T4CR.js.map} +1 -1
- package/dist/{chunk-L2TVY6XN.cjs → chunk-SPAHI7DY.cjs} +4 -4
- package/dist/{chunk-L2TVY6XN.cjs.map → chunk-SPAHI7DY.cjs.map} +1 -1
- package/dist/{chunk-YX6TFX7H.js → chunk-SXHHLZ22.js} +66 -11
- package/dist/chunk-SXHHLZ22.js.map +1 -0
- package/dist/{chunk-LMAQUR55.cjs → chunk-T2OVDF2M.cjs} +6 -6
- package/dist/{chunk-LMAQUR55.cjs.map → chunk-T2OVDF2M.cjs.map} +1 -1
- package/dist/{chunk-2QKF7M2Z.js → chunk-TAPBDT47.js} +3 -3
- package/dist/{chunk-2QKF7M2Z.js.map → chunk-TAPBDT47.js.map} +1 -1
- package/dist/{chunk-BMJVKYVB.js → chunk-TPQJKS7D.js} +109 -7
- package/dist/chunk-TPQJKS7D.js.map +1 -0
- package/dist/{chunk-63H4C56Q.cjs → chunk-TQW3R44P.cjs} +8 -8
- package/dist/{chunk-63H4C56Q.cjs.map → chunk-TQW3R44P.cjs.map} +1 -1
- package/dist/{chunk-4DVWXEB6.js → chunk-TTGZ2L3O.js} +3 -3
- package/dist/{chunk-4DVWXEB6.js.map → chunk-TTGZ2L3O.js.map} +1 -1
- package/dist/{chunk-XBTYGQ6Z.js → chunk-VPTA4Z7G.js} +8 -5
- package/dist/chunk-VPTA4Z7G.js.map +1 -0
- package/dist/{chunk-6XUG4L7X.cjs → chunk-VZ6TE23U.cjs} +6 -6
- package/dist/{chunk-6XUG4L7X.cjs.map → chunk-VZ6TE23U.cjs.map} +1 -1
- package/dist/{chunk-LH72PQO2.cjs → chunk-W6VJAUGM.cjs} +114 -45
- package/dist/chunk-W6VJAUGM.cjs.map +1 -0
- package/dist/{chunk-OV3JTKBY.js → chunk-W7KHHNZR.js} +74 -17
- package/dist/chunk-W7KHHNZR.js.map +1 -0
- package/dist/{chunk-2PU3AGGS.cjs → chunk-YQV53HRR.cjs} +7 -7
- package/dist/{chunk-2PU3AGGS.cjs.map → chunk-YQV53HRR.cjs.map} +1 -1
- package/dist/{chunk-FXGNRYQQ.js → chunk-ZI3QDUHO.js} +3 -3
- package/dist/{chunk-FXGNRYQQ.js.map → chunk-ZI3QDUHO.js.map} +1 -1
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.js +8 -7
- package/dist/entries/captions.cjs +38 -30
- package/dist/entries/captions.d.cts +47 -1
- package/dist/entries/captions.d.ts +47 -1
- package/dist/entries/captions.js +1 -1
- package/dist/entries/credits.cjs +303 -191
- package/dist/entries/credits.d.cts +219 -15
- package/dist/entries/credits.d.ts +219 -15
- package/dist/entries/credits.js +11 -11
- package/dist/entries/llm-models.cjs +62 -62
- package/dist/entries/llm-models.d.cts +29 -7
- package/dist/entries/llm-models.d.ts +29 -7
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/model-catalog.cjs +149 -109
- package/dist/entries/model-catalog.d.cts +64 -7
- package/dist/entries/model-catalog.d.ts +64 -7
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +394 -346
- package/dist/entries/models.d.cts +4 -4
- package/dist/entries/models.d.ts +4 -4
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +220 -211
- package/dist/entries/nodes.d.cts +46 -3
- package/dist/entries/nodes.d.ts +46 -3
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +156 -152
- package/dist/entries/pipeline.d.cts +13 -3
- package/dist/entries/pipeline.d.ts +13 -3
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +145 -145
- package/dist/entries/video.js +6 -6
- package/dist/entries/workflow.cjs +150 -150
- package/dist/entries/workflow.d.cts +1 -1
- package/dist/entries/workflow.d.ts +1 -1
- package/dist/entries/workflow.js +2 -2
- package/dist/index.cjs +1879 -1659
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +25 -25
- package/dist/{model-catalog-C_Eo35tL.d.cts → model-catalog-Cf9fkEUp.d.cts} +15 -2
- package/dist/{model-catalog-C_Eo35tL.d.ts → model-catalog-Cf9fkEUp.d.ts} +15 -2
- package/dist/{model-constants-DWcxOmaY.d.cts → model-constants-BxjiWVQ9.d.ts} +89 -19
- package/dist/{model-constants-Bg4ccSQb.d.ts → model-constants-C_Nyft_i.d.cts} +89 -19
- package/package.json +1 -1
- package/src/__tests__/add-captions-nemotron-pricing.test.ts +111 -0
- package/src/__tests__/extend-providers.test.ts +266 -26
- package/src/__tests__/fixtures/mask-composite-quote-parity.json +1 -1
- package/src/__tests__/fixtures/measured-input-quote-parity.json +1435 -0
- package/src/__tests__/fixtures/planned-length-quote-parity.json +1866 -0
- package/src/__tests__/fixtures/video-utility-quote-parity.json +2343 -0
- package/src/__tests__/flux-3-klein.test.ts +203 -0
- package/src/__tests__/gpt-image-2-6-formats.test.ts +3 -1
- package/src/__tests__/llm-models.test.ts +7 -9
- package/src/__tests__/llm-price-key.test.ts +12 -0
- package/src/__tests__/model-makers.test.ts +3 -0
- package/src/__tests__/node-runtime-keys.test.ts +7 -0
- package/src/__tests__/normalize-node-params.test.ts +147 -1
- package/src/__tests__/retired-lip-sync-providers.test.ts +43 -0
- package/src/__tests__/seedance-extend-source-credit-id.test.ts +89 -0
- package/src/__tests__/sequence-execution.test.ts +22 -1
- package/src/__tests__/suno-credit-type.test.ts +21 -2
- package/src/__tests__/transcribe-capabilities.test.ts +4 -2
- package/src/__tests__/video-analysis-catalog-sync.test.ts +4 -2
- package/src/__tests__/video-analysis-pricing.test.ts +10 -9
- package/src/caption-styles.ts +62 -0
- package/src/credit-estimators/add-captions-nemotron.ts +73 -0
- package/src/credit-estimators/index.ts +10 -0
- package/src/credit-identifiers.ts +249 -13
- package/src/entries/captions.ts +2 -0
- package/src/entries/credits.ts +25 -1
- package/src/entries/model-catalog.ts +13 -0
- package/src/entries/models.ts +15 -0
- package/src/entries/nodes.ts +2 -0
- package/src/entries/pipeline.ts +1 -1
- package/src/flux-3-klein.ts +69 -0
- package/src/input-image-pricing.ts +23 -6
- package/src/llm-models.ts +60 -16
- package/src/model-catalog.ts +280 -25
- package/src/model-constants.ts +146 -17
- package/src/node-default-mappings.ts +3 -0
- package/src/node-runtime-keys.ts +3 -0
- package/src/normalize-node-params.ts +123 -2
- package/src/seedance-extend-rate.ts +116 -0
- package/src/sequence-execution.ts +24 -0
- package/src/transcribe-preflight.ts +23 -0
- package/src/video-analysis-pricing.ts +28 -15
- package/dist/chunk-6M563QE6.js.map +0 -1
- package/dist/chunk-6TGB7ECA.cjs.map +0 -1
- package/dist/chunk-BLJUCPMV.cjs.map +0 -1
- package/dist/chunk-BMJVKYVB.js.map +0 -1
- package/dist/chunk-CZ5IQB3L.js.map +0 -1
- package/dist/chunk-F6WGGYQW.cjs.map +0 -1
- package/dist/chunk-GMBDLNLD.cjs.map +0 -1
- package/dist/chunk-GSKLPI3J.cjs.map +0 -1
- package/dist/chunk-HSHCCBIV.js.map +0 -1
- package/dist/chunk-KMGCHV6O.js.map +0 -1
- package/dist/chunk-LH72PQO2.cjs.map +0 -1
- package/dist/chunk-M5OCFGHF.cjs.map +0 -1
- package/dist/chunk-OV3JTKBY.js.map +0 -1
- package/dist/chunk-PSKZKLDG.js.map +0 -1
- package/dist/chunk-Q6IES3U2.js.map +0 -1
- package/dist/chunk-TM5JYSJF.cjs.map +0 -1
- package/dist/chunk-WRSWH7US.cjs.map +0 -1
- package/dist/chunk-XBTYGQ6Z.js.map +0 -1
- package/dist/chunk-XGGZWA4A.cjs.map +0 -1
- package/dist/chunk-XGVJGNZW.cjs.map +0 -1
- package/dist/chunk-YUER7TJG.js.map +0 -1
- package/dist/chunk-YX6TFX7H.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk44I73CQS_cjs = require('./chunk-44I73CQS.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var chunkT2OVDF2M_cjs = require('./chunk-T2OVDF2M.cjs');
|
|
5
|
+
var chunkW6VJAUGM_cjs = require('./chunk-W6VJAUGM.cjs');
|
|
6
|
+
var chunk5OBTGNUQ_cjs = require('./chunk-5OBTGNUQ.cjs');
|
|
7
7
|
var zod = require('zod');
|
|
8
8
|
|
|
9
9
|
// src/video-character-refs.ts
|
|
10
10
|
var VIDEO_CHARACTER_REFS_WIRE_MAX = Math.max(
|
|
11
11
|
0,
|
|
12
|
-
...Object.values(
|
|
12
|
+
...Object.values(chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER).map((l) => l?.characters ?? 0)
|
|
13
13
|
);
|
|
14
14
|
var VIDEO_CHARACTER_EXTRA_IMAGES_MAX = 3;
|
|
15
15
|
var VIDEO_CHARACTER_DESCRIPTION_MAX = 2e3;
|
|
@@ -17,10 +17,10 @@ var VIDEO_CHARACTER_NAME_MAX = 100;
|
|
|
17
17
|
var VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = 2e3;
|
|
18
18
|
var VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = 120;
|
|
19
19
|
function videoCharacterRefCap(provider) {
|
|
20
|
-
return provider ?
|
|
20
|
+
return provider ? chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.characters ?? 0 : 0;
|
|
21
21
|
}
|
|
22
22
|
function videoCharacterVoiceCap(provider) {
|
|
23
|
-
return provider ?
|
|
23
|
+
return provider ? chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.voices ?? 0 : 0;
|
|
24
24
|
}
|
|
25
25
|
function videoCharacterVoiceKey(ref) {
|
|
26
26
|
const voice = ref.voice;
|
|
@@ -36,7 +36,7 @@ function videoCharacterDistinctVoices(characterReferences) {
|
|
|
36
36
|
return keys.size;
|
|
37
37
|
}
|
|
38
38
|
function videoCharacterRefProviders() {
|
|
39
|
-
return Object.entries(
|
|
39
|
+
return Object.entries(chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => (l?.characters ?? 0) > 0).map(([id]) => id);
|
|
40
40
|
}
|
|
41
41
|
function videoCharacterRefUnits(characterReferences) {
|
|
42
42
|
let units = 0;
|
|
@@ -77,7 +77,7 @@ function videoCharacterRefProblem(args) {
|
|
|
77
77
|
message: `${provider} accepts at most ${cap} character references; got ${characterReferences.length}.`
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
const limits =
|
|
80
|
+
const limits = chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider];
|
|
81
81
|
const materials = limits?.materials;
|
|
82
82
|
if (materials !== void 0) {
|
|
83
83
|
const audioSeats = limits?.audioBindsToCharacters ? 0 : args.audioCount ?? 0;
|
|
@@ -102,7 +102,7 @@ function videoCharacterRefProblem(args) {
|
|
|
102
102
|
message: `${provider} does not use an end frame (endFrameUrl) together with characterReferences. Drop the end frame, or drop characterReferences.`
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
const budget =
|
|
105
|
+
const budget = chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.images ?? 7;
|
|
106
106
|
const used = args.imageCount + args.videoCount * 2 + videoCharacterRefUnits(characterReferences);
|
|
107
107
|
if (used > budget) {
|
|
108
108
|
return {
|
|
@@ -138,8 +138,8 @@ function characterReferencesFromWired(refs) {
|
|
|
138
138
|
// src/video-overlay-geometry.ts
|
|
139
139
|
var evenFloor = (n) => Math.max(2, Math.floor(n / 2) * 2);
|
|
140
140
|
function videoOverlayCanvas(display, outputAspect) {
|
|
141
|
-
if (
|
|
142
|
-
const d =
|
|
141
|
+
if (chunkT2OVDF2M_cjs.isVideoOverlayOutputAspect(outputAspect)) {
|
|
142
|
+
const d = chunkW6VJAUGM_cjs.ASPECT_RATIO_DIMENSIONS[outputAspect];
|
|
143
143
|
return { w: d.width, h: d.height };
|
|
144
144
|
}
|
|
145
145
|
if (!display || !(display.width > 0) || !(display.height > 0)) return null;
|
|
@@ -201,13 +201,13 @@ function videoOverlayLayoutPlacesBase(id) {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// src/video-overlay-validate.ts
|
|
204
|
-
var inTimeRange = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <=
|
|
205
|
-
var BOUNDED_FIELDS = Object.keys(
|
|
204
|
+
var inTimeRange = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_TIME_SEC;
|
|
205
|
+
var BOUNDED_FIELDS = Object.keys(chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOUNDS);
|
|
206
206
|
function outOfBounds(l) {
|
|
207
207
|
for (const f of BOUNDED_FIELDS) {
|
|
208
208
|
const v = l[f];
|
|
209
209
|
if (v === void 0 || v === null) continue;
|
|
210
|
-
const [min, max] =
|
|
210
|
+
const [min, max] = chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOUNDS[f];
|
|
211
211
|
const integer = f === "zIndex";
|
|
212
212
|
if (typeof v !== "number" || !Number.isFinite(v) || v < min || v > max || integer && !Number.isInteger(v)) {
|
|
213
213
|
return { field: f, allowed: `${integer ? "integers " : ""}${min}..${max}` };
|
|
@@ -216,25 +216,25 @@ function outOfBounds(l) {
|
|
|
216
216
|
if (l.anchor != null && !chunk44I73CQS_cjs.OVERLAY_ANCHORS.includes(l.anchor)) {
|
|
217
217
|
return { field: "anchor", allowed: chunk44I73CQS_cjs.OVERLAY_ANCHORS.join(", ") };
|
|
218
218
|
}
|
|
219
|
-
if (l.fit != null && !
|
|
219
|
+
if (l.fit != null && !chunkT2OVDF2M_cjs.isFit(l.fit)) return { field: "fit", allowed: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_FITS.join(", ") };
|
|
220
220
|
if (l.animate != null && typeof l.animate !== "boolean") return { field: "animate", allowed: "true, false" };
|
|
221
221
|
return null;
|
|
222
222
|
}
|
|
223
223
|
function soundOutOfBounds(sound) {
|
|
224
224
|
if (sound === void 0 || sound === null) return null;
|
|
225
|
-
const [min, max] =
|
|
225
|
+
const [min, max] = chunkT2OVDF2M_cjs.VIDEO_OVERLAY_VOLUME_BOUNDS;
|
|
226
226
|
const v = typeof sound === "object" && !Array.isArray(sound) ? sound.volume : void 0;
|
|
227
227
|
return typeof v === "number" && Number.isFinite(v) && v >= min && v <= max ? null : { field: "sound.volume", allowed: `${min}..${max}` };
|
|
228
228
|
}
|
|
229
229
|
function baseBoxIssue(raw) {
|
|
230
|
-
const own =
|
|
231
|
-
const box = Object.fromEntries(
|
|
230
|
+
const own = chunkT2OVDF2M_cjs.asLayer(raw) ?? {};
|
|
231
|
+
const box = Object.fromEntries(chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOX_FIELDS.map((f) => [f, own[f]]));
|
|
232
232
|
if (box.anchor == null || box.width == null) return { ok: false, code: "incomplete_box", params: { field: "baseBox" } };
|
|
233
233
|
const bad = outOfBounds(box);
|
|
234
234
|
return bad ? { ok: false, code: "field_out_of_bounds", params: { ...bad, field: `baseBox.${bad.field}` } } : null;
|
|
235
235
|
}
|
|
236
236
|
function hasDrawableVideoOverlayBox(layer) {
|
|
237
|
-
const l =
|
|
237
|
+
const l = chunkT2OVDF2M_cjs.asLayer(layer);
|
|
238
238
|
if (!l) return false;
|
|
239
239
|
if (!chunk44I73CQS_cjs.OVERLAY_ANCHORS.includes(l.anchor)) return false;
|
|
240
240
|
if (typeof l.width !== "number" || !Number.isFinite(l.width)) return false;
|
|
@@ -244,15 +244,15 @@ function validateVideoOverlayRequest(body) {
|
|
|
244
244
|
if (body.planError) return { ok: false, code: "invalid_layer_plan", params: {} };
|
|
245
245
|
const layers = Array.isArray(body.layers) ? body.layers : [];
|
|
246
246
|
if (layers.length === 0) return { ok: false, code: "no_layers", params: {} };
|
|
247
|
-
if (layers.length >
|
|
248
|
-
return { ok: false, code: "too_many_layers", params: { max:
|
|
247
|
+
if (layers.length > chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_LAYERS) {
|
|
248
|
+
return { ok: false, code: "too_many_layers", params: { max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_LAYERS, count: layers.length } };
|
|
249
249
|
}
|
|
250
|
-
const videoCount = layers.filter(
|
|
251
|
-
if (videoCount >
|
|
252
|
-
return { ok: false, code: "too_many_video_layers", params: { max:
|
|
250
|
+
const videoCount = layers.filter(chunkT2OVDF2M_cjs.isVideoOverlayVideoLayer).length;
|
|
251
|
+
if (videoCount > chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_VIDEO_LAYERS) {
|
|
252
|
+
return { ok: false, code: "too_many_video_layers", params: { max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_VIDEO_LAYERS, count: videoCount } };
|
|
253
253
|
}
|
|
254
254
|
for (let i = 0; i < layers.length; i++) {
|
|
255
|
-
const l =
|
|
255
|
+
const l = chunkT2OVDF2M_cjs.asLayer(layers[i]) ?? {};
|
|
256
256
|
const at = (code, params = {}) => ({
|
|
257
257
|
ok: false,
|
|
258
258
|
code,
|
|
@@ -261,25 +261,25 @@ function validateVideoOverlayRequest(body) {
|
|
|
261
261
|
...typeof l.planLayer === "number" ? { planLayer: l.planLayer } : {},
|
|
262
262
|
params
|
|
263
263
|
});
|
|
264
|
-
const boxFields =
|
|
265
|
-
if (!
|
|
264
|
+
const boxFields = chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOX_FIELDS.filter((f) => l[f] !== void 0 && l[f] !== null);
|
|
265
|
+
if (!chunkT2OVDF2M_cjs.isVideoOverlayPresetId(l.preset) && boxFields.length > 0 && (l.anchor == null || l.width == null)) return at("incomplete_box");
|
|
266
266
|
const bad = outOfBounds(l) ?? soundOutOfBounds(l.sound);
|
|
267
267
|
if (bad) return at("field_out_of_bounds", bad);
|
|
268
|
-
const hasVideo =
|
|
269
|
-
if (
|
|
270
|
-
if (!
|
|
268
|
+
const hasVideo = chunkT2OVDF2M_cjs.nonEmpty(l.videoUrl);
|
|
269
|
+
if (chunkT2OVDF2M_cjs.nonEmpty(l.imageUrl) && hasVideo) return at("layer_two_sources");
|
|
270
|
+
if (!chunkT2OVDF2M_cjs.nonEmpty(l.imageUrl) && !hasVideo) return at("layer_without_image");
|
|
271
271
|
if (l.sound != null && !hasVideo) return at("sound_without_video");
|
|
272
|
-
if (!inTimeRange(l.start)) return at("time_out_of_range", { field: "start", max:
|
|
272
|
+
if (!inTimeRange(l.start)) return at("time_out_of_range", { field: "start", max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_TIME_SEC });
|
|
273
273
|
if (l.end !== void 0 && l.end !== null) {
|
|
274
|
-
if (!inTimeRange(l.end)) return at("time_out_of_range", { field: "end", max:
|
|
274
|
+
if (!inTimeRange(l.end)) return at("time_out_of_range", { field: "end", max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_TIME_SEC });
|
|
275
275
|
if (!(l.end > l.start)) return at("end_before_start", { start: l.start, end: l.end });
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
const hasAspect =
|
|
278
|
+
const hasAspect = chunkT2OVDF2M_cjs.isVideoOverlayOutputAspect(body.outputAspect);
|
|
279
279
|
if (!hasAspect && (body.baseFit != null || body.backgroundColor != null)) {
|
|
280
280
|
return { ok: false, code: "fit_without_aspect", params: {} };
|
|
281
281
|
}
|
|
282
|
-
const stored =
|
|
282
|
+
const stored = chunkT2OVDF2M_cjs.storedLayout(body.layout);
|
|
283
283
|
if (stored !== void 0 && !isVideoOverlayLayoutId(stored)) {
|
|
284
284
|
return { ok: false, code: "field_out_of_bounds", params: { field: "layout", allowed: VIDEO_OVERLAY_LAYOUT_IDS.join(", ") } };
|
|
285
285
|
}
|
|
@@ -288,7 +288,7 @@ function validateVideoOverlayRequest(body) {
|
|
|
288
288
|
const boxIssue = body.baseBox != null ? baseBoxIssue(body.baseBox) : null;
|
|
289
289
|
if (boxIssue) return boxIssue;
|
|
290
290
|
if (layout && !hasAspect && videoOverlayLayoutNeedsAspect(layout)) return { ok: false, code: "layout_needs_aspect", params: { layout } };
|
|
291
|
-
if (layout && videoOverlayLayoutNeedsVideoLayer(layout) && !layers.some(
|
|
291
|
+
if (layout && videoOverlayLayoutNeedsVideoLayer(layout) && !layers.some(chunkT2OVDF2M_cjs.isVideoOverlayVideoLayer)) {
|
|
292
292
|
return { ok: false, code: "layout_needs_video_layer", params: { layout } };
|
|
293
293
|
}
|
|
294
294
|
if (body.baseBox != null && !hasAspect) return { ok: false, code: "base_box_needs_aspect", params: {} };
|
|
@@ -349,7 +349,7 @@ function sameShallow(a, b) {
|
|
|
349
349
|
}
|
|
350
350
|
function firstVideoLayerIndex(layers) {
|
|
351
351
|
if (!Array.isArray(layers)) return -1;
|
|
352
|
-
return
|
|
352
|
+
return chunkT2OVDF2M_cjs.videoOverlayRenderOrder(layers).find((i) => chunkT2OVDF2M_cjs.isVideoOverlayVideoLayer(layers[i])) ?? -1;
|
|
353
353
|
}
|
|
354
354
|
function expandBaseBox(raw) {
|
|
355
355
|
if (typeof raw !== "object" || Array.isArray(raw) || raw.anchor == null || raw.width == null) return raw;
|
|
@@ -367,10 +367,10 @@ function placeFirstVideoLayer(layout, layer) {
|
|
|
367
367
|
if (!acceptedAlone(layer)) return layer;
|
|
368
368
|
if (layout !== "pip") return layer.animate === false ? layer : { ...layer, animate: false };
|
|
369
369
|
const rest = { ...layer };
|
|
370
|
-
for (const f of
|
|
370
|
+
for (const f of chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOX_FIELDS) delete rest[f];
|
|
371
371
|
delete rest.preset;
|
|
372
|
-
const corner =
|
|
373
|
-
const next =
|
|
372
|
+
const corner = chunkT2OVDF2M_cjs.isVideoOverlayCorner(layer.corner) ? layer.corner : "bottom-right";
|
|
373
|
+
const next = chunkT2OVDF2M_cjs.expandVideoOverlayLayer({ ...rest, ...pipBox(corner), animate: false });
|
|
374
374
|
return sameShallow(next, layer) ? layer : next;
|
|
375
375
|
}
|
|
376
376
|
function expandVideoOverlayLayout(req) {
|
|
@@ -987,7 +987,7 @@ function parseAspectToken(token) {
|
|
|
987
987
|
function resolveFrameFitAspect(args) {
|
|
988
988
|
const requested = args.requestedAspect?.trim();
|
|
989
989
|
if (requested && !OPEN_ASPECT_TOKENS.has(requested.toLowerCase())) return requested;
|
|
990
|
-
const ratios = args.provider ?
|
|
990
|
+
const ratios = args.provider ? chunk5OBTGNUQ_cjs.getModel(args.provider)?.aspectRatios : void 0;
|
|
991
991
|
if (!ratios?.length || !(args.sourceWidth > 0) || !(args.sourceHeight > 0)) return void 0;
|
|
992
992
|
const source = args.sourceWidth / args.sourceHeight;
|
|
993
993
|
let best;
|
|
@@ -1142,5 +1142,5 @@ exports.videoOverlayLayoutNeedsAspect = videoOverlayLayoutNeedsAspect;
|
|
|
1142
1142
|
exports.videoOverlayLayoutNeedsVideoLayer = videoOverlayLayoutNeedsVideoLayer;
|
|
1143
1143
|
exports.videoOverlayLayoutPlacesBase = videoOverlayLayoutPlacesBase;
|
|
1144
1144
|
exports.windowAnalysisSchema = windowAnalysisSchema;
|
|
1145
|
-
//# sourceMappingURL=chunk-
|
|
1146
|
-
//# sourceMappingURL=chunk-
|
|
1145
|
+
//# sourceMappingURL=chunk-AZNZ5WNZ.cjs.map
|
|
1146
|
+
//# sourceMappingURL=chunk-AZNZ5WNZ.cjs.map
|