@nodaro/shared 3.31.0 → 3.33.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.
Files changed (378) hide show
  1. package/README.md +17 -0
  2. package/dist/chunk-23FJQTEA.js +1604 -0
  3. package/dist/chunk-23FJQTEA.js.map +1 -0
  4. package/dist/chunk-2NIQO2J3.cjs +54 -0
  5. package/dist/chunk-2NIQO2J3.cjs.map +1 -0
  6. package/dist/chunk-2NQLSLSN.cjs +19 -0
  7. package/dist/chunk-2NQLSLSN.cjs.map +1 -0
  8. package/dist/chunk-2OJIVO7R.cjs +32 -0
  9. package/dist/chunk-2OJIVO7R.cjs.map +1 -0
  10. package/dist/chunk-2RF4Z7KG.cjs +803 -0
  11. package/dist/chunk-2RF4Z7KG.cjs.map +1 -0
  12. package/dist/chunk-3RYKIUAE.js +86 -0
  13. package/dist/chunk-3RYKIUAE.js.map +1 -0
  14. package/dist/chunk-44I73CQS.cjs +194 -0
  15. package/dist/chunk-44I73CQS.cjs.map +1 -0
  16. package/dist/chunk-5PC6JBGJ.cjs +1419 -0
  17. package/dist/chunk-5PC6JBGJ.cjs.map +1 -0
  18. package/dist/chunk-5RU2HCW2.js +30 -0
  19. package/dist/chunk-5RU2HCW2.js.map +1 -0
  20. package/dist/chunk-5RYLK3MQ.js +267 -0
  21. package/dist/chunk-5RYLK3MQ.js.map +1 -0
  22. package/dist/chunk-5THUHJ3E.js +46 -0
  23. package/dist/chunk-5THUHJ3E.js.map +1 -0
  24. package/dist/chunk-6DAWSVX2.cjs +103 -0
  25. package/dist/chunk-6DAWSVX2.cjs.map +1 -0
  26. package/dist/chunk-6WZ2VN7V.js +920 -0
  27. package/dist/chunk-6WZ2VN7V.js.map +1 -0
  28. package/dist/chunk-7G7G42KS.js +86 -0
  29. package/dist/chunk-7G7G42KS.js.map +1 -0
  30. package/dist/chunk-7Z5LUTGU.js +1567 -0
  31. package/dist/chunk-7Z5LUTGU.js.map +1 -0
  32. package/dist/chunk-AINCI23X.js +2171 -0
  33. package/dist/chunk-AINCI23X.js.map +1 -0
  34. package/dist/chunk-BG5D5CZ6.js +1922 -0
  35. package/dist/chunk-BG5D5CZ6.js.map +1 -0
  36. package/dist/chunk-CK3GK34R.js +1381 -0
  37. package/dist/chunk-CK3GK34R.js.map +1 -0
  38. package/dist/chunk-CUH22J4D.js +17 -0
  39. package/dist/chunk-CUH22J4D.js.map +1 -0
  40. package/dist/chunk-D26ENTN2.cjs +1770 -0
  41. package/dist/chunk-D26ENTN2.cjs.map +1 -0
  42. package/dist/chunk-D6GNRSCV.cjs +2017 -0
  43. package/dist/chunk-D6GNRSCV.cjs.map +1 -0
  44. package/dist/chunk-FBV5DF6D.js +95 -0
  45. package/dist/chunk-FBV5DF6D.js.map +1 -0
  46. package/dist/chunk-FG4E7MTG.cjs +4 -0
  47. package/dist/chunk-FG4E7MTG.cjs.map +1 -0
  48. package/dist/chunk-FT5CF6IA.js +42 -0
  49. package/dist/chunk-FT5CF6IA.js.map +1 -0
  50. package/dist/chunk-G6IIVKMO.js +26 -0
  51. package/dist/chunk-G6IIVKMO.js.map +1 -0
  52. package/dist/chunk-HC7VKIV5.cjs +430 -0
  53. package/dist/chunk-HC7VKIV5.cjs.map +1 -0
  54. package/dist/chunk-HGC5JNVA.cjs +1503 -0
  55. package/dist/chunk-HGC5JNVA.cjs.map +1 -0
  56. package/dist/chunk-HKFMXNVQ.cjs +1273 -0
  57. package/dist/chunk-HKFMXNVQ.cjs.map +1 -0
  58. package/dist/chunk-HRXEZ3SX.cjs +526 -0
  59. package/dist/chunk-HRXEZ3SX.cjs.map +1 -0
  60. package/dist/chunk-HSHCCBIV.js +255 -0
  61. package/dist/chunk-HSHCCBIV.js.map +1 -0
  62. package/dist/chunk-HUR6ZJ7S.cjs +159 -0
  63. package/dist/chunk-HUR6ZJ7S.cjs.map +1 -0
  64. package/dist/chunk-J7BMO73N.cjs +114 -0
  65. package/dist/chunk-J7BMO73N.cjs.map +1 -0
  66. package/dist/chunk-JFS3NWZ5.cjs +1714 -0
  67. package/dist/chunk-JFS3NWZ5.cjs.map +1 -0
  68. package/dist/chunk-JL4C5VJ7.cjs +488 -0
  69. package/dist/chunk-JL4C5VJ7.cjs.map +1 -0
  70. package/dist/chunk-JSGIEF6Z.cjs +1087 -0
  71. package/dist/chunk-JSGIEF6Z.cjs.map +1 -0
  72. package/dist/chunk-JWA5SGCS.js +203 -0
  73. package/dist/chunk-JWA5SGCS.js.map +1 -0
  74. package/dist/chunk-K3LLGRK7.cjs +3545 -0
  75. package/dist/chunk-K3LLGRK7.cjs.map +1 -0
  76. package/dist/chunk-KU6S7IYV.cjs +210 -0
  77. package/dist/chunk-KU6S7IYV.cjs.map +1 -0
  78. package/dist/chunk-M36G6SRP.js +447 -0
  79. package/dist/chunk-M36G6SRP.js.map +1 -0
  80. package/dist/chunk-M7GQBRZU.cjs +1963 -0
  81. package/dist/chunk-M7GQBRZU.cjs.map +1 -0
  82. package/dist/chunk-MRXGWL42.cjs +4 -0
  83. package/dist/chunk-MRXGWL42.cjs.map +1 -0
  84. package/dist/chunk-NEJ2PV4C.cjs +211 -0
  85. package/dist/chunk-NEJ2PV4C.cjs.map +1 -0
  86. package/dist/chunk-OTATNBMD.js +141 -0
  87. package/dist/chunk-OTATNBMD.js.map +1 -0
  88. package/dist/chunk-OZSACQ2V.js +471 -0
  89. package/dist/chunk-OZSACQ2V.js.map +1 -0
  90. package/dist/chunk-PHZ23DP3.js +1782 -0
  91. package/dist/chunk-PHZ23DP3.js.map +1 -0
  92. package/dist/chunk-PQHS255G.js +1369 -0
  93. package/dist/chunk-PQHS255G.js.map +1 -0
  94. package/dist/chunk-PRYE7AZQ.cjs +1227 -0
  95. package/dist/chunk-PRYE7AZQ.cjs.map +1 -0
  96. package/dist/chunk-PVJBAPYJ.js +404 -0
  97. package/dist/chunk-PVJBAPYJ.js.map +1 -0
  98. package/dist/chunk-PXFQVLBX.js +776 -0
  99. package/dist/chunk-PXFQVLBX.js.map +1 -0
  100. package/dist/chunk-QA3MVQ32.js +21 -0
  101. package/dist/chunk-QA3MVQ32.js.map +1 -0
  102. package/dist/chunk-QJRP44ZO.js +769 -0
  103. package/dist/chunk-QJRP44ZO.js.map +1 -0
  104. package/dist/chunk-SAW5OK36.cjs +54 -0
  105. package/dist/chunk-SAW5OK36.cjs.map +1 -0
  106. package/dist/chunk-SES6GDBQ.cjs +624 -0
  107. package/dist/chunk-SES6GDBQ.cjs.map +1 -0
  108. package/dist/chunk-SFW3UB2P.js +31 -0
  109. package/dist/chunk-SFW3UB2P.js.map +1 -0
  110. package/dist/chunk-TNPDV7I4.cjs +2346 -0
  111. package/dist/chunk-TNPDV7I4.cjs.map +1 -0
  112. package/dist/chunk-TU33KYKW.cjs +25 -0
  113. package/dist/chunk-TU33KYKW.cjs.map +1 -0
  114. package/dist/chunk-TZBIY5C3.js +187 -0
  115. package/dist/chunk-TZBIY5C3.js.map +1 -0
  116. package/dist/chunk-TZE673G6.js +3 -0
  117. package/dist/chunk-TZE673G6.js.map +1 -0
  118. package/dist/chunk-UCFWI6D4.js +29 -0
  119. package/dist/chunk-UCFWI6D4.js.map +1 -0
  120. package/dist/chunk-UTQSSKSG.js +1164 -0
  121. package/dist/chunk-UTQSSKSG.js.map +1 -0
  122. package/dist/chunk-VA42637J.cjs +287 -0
  123. package/dist/chunk-VA42637J.cjs.map +1 -0
  124. package/dist/chunk-VNQRI2RO.cjs +1047 -0
  125. package/dist/chunk-VNQRI2RO.cjs.map +1 -0
  126. package/dist/chunk-VXPLKQWY.cjs +821 -0
  127. package/dist/chunk-VXPLKQWY.cjs.map +1 -0
  128. package/dist/chunk-WD6HJRBG.cjs +197 -0
  129. package/dist/chunk-WD6HJRBG.cjs.map +1 -0
  130. package/dist/chunk-WDIBOWAA.js +1054 -0
  131. package/dist/chunk-WDIBOWAA.js.map +1 -0
  132. package/dist/chunk-WKOIGLQX.cjs +38 -0
  133. package/dist/chunk-WKOIGLQX.cjs.map +1 -0
  134. package/dist/chunk-WNVQ3SMB.cjs +96 -0
  135. package/dist/chunk-WNVQ3SMB.cjs.map +1 -0
  136. package/dist/chunk-WRSWH7US.cjs +285 -0
  137. package/dist/chunk-WRSWH7US.cjs.map +1 -0
  138. package/dist/chunk-XGFTL5XY.js +181 -0
  139. package/dist/chunk-XGFTL5XY.js.map +1 -0
  140. package/dist/chunk-XNISPHTZ.js +1039 -0
  141. package/dist/chunk-XNISPHTZ.js.map +1 -0
  142. package/dist/chunk-Y2PM3FFL.js +3 -0
  143. package/dist/chunk-Y2PM3FFL.js.map +1 -0
  144. package/dist/chunk-YBPBK5KI.js +1030 -0
  145. package/dist/chunk-YBPBK5KI.js.map +1 -0
  146. package/dist/chunk-YWNYGYI7.cjs +31 -0
  147. package/dist/chunk-YWNYGYI7.cjs.map +1 -0
  148. package/dist/chunk-YYV35XOS.js +122 -0
  149. package/dist/chunk-YYV35XOS.js.map +1 -0
  150. package/dist/chunk-Z2OL5AJD.cjs +133 -0
  151. package/dist/chunk-Z2OL5AJD.cjs.map +1 -0
  152. package/dist/chunk-ZDFHA2EC.js +572 -0
  153. package/dist/chunk-ZDFHA2EC.js.map +1 -0
  154. package/dist/chunk-ZL7UM6PU.cjs +34 -0
  155. package/dist/chunk-ZL7UM6PU.cjs.map +1 -0
  156. package/dist/chunk-ZNZDQAXN.js +175 -0
  157. package/dist/chunk-ZNZDQAXN.js.map +1 -0
  158. package/dist/chunk-ZO5PBBFX.js +3497 -0
  159. package/dist/chunk-ZO5PBBFX.js.map +1 -0
  160. package/dist/chunk-ZRL2UFTH.cjs +1073 -0
  161. package/dist/chunk-ZRL2UFTH.cjs.map +1 -0
  162. package/dist/entries/apps.cjs +155 -0
  163. package/dist/entries/apps.cjs.map +1 -0
  164. package/dist/entries/apps.d.cts +292 -0
  165. package/dist/entries/apps.d.ts +292 -0
  166. package/dist/entries/apps.js +10 -0
  167. package/dist/entries/apps.js.map +1 -0
  168. package/dist/entries/captions.cjs +124 -0
  169. package/dist/entries/captions.cjs.map +1 -0
  170. package/dist/entries/captions.d.cts +354 -0
  171. package/dist/entries/captions.d.ts +354 -0
  172. package/dist/entries/captions.js +3 -0
  173. package/dist/entries/captions.js.map +1 -0
  174. package/dist/entries/catalogs.cjs +165 -0
  175. package/dist/entries/catalogs.cjs.map +1 -0
  176. package/dist/entries/catalogs.d.cts +385 -0
  177. package/dist/entries/catalogs.d.ts +385 -0
  178. package/dist/entries/catalogs.js +4 -0
  179. package/dist/entries/catalogs.js.map +1 -0
  180. package/dist/entries/credits.cjs +596 -0
  181. package/dist/entries/credits.cjs.map +1 -0
  182. package/dist/entries/credits.d.cts +1460 -0
  183. package/dist/entries/credits.d.ts +1460 -0
  184. package/dist/entries/credits.js +11 -0
  185. package/dist/entries/credits.js.map +1 -0
  186. package/dist/entries/edl.cjs +409 -0
  187. package/dist/entries/edl.cjs.map +1 -0
  188. package/dist/entries/edl.d.cts +1199 -0
  189. package/dist/entries/edl.d.ts +1199 -0
  190. package/dist/entries/edl.js +4 -0
  191. package/dist/entries/edl.js.map +1 -0
  192. package/dist/entries/entities.cjs +530 -0
  193. package/dist/entries/entities.cjs.map +1 -0
  194. package/dist/entries/entities.d.cts +1371 -0
  195. package/dist/entries/entities.d.ts +1371 -0
  196. package/dist/entries/entities.js +5 -0
  197. package/dist/entries/entities.js.map +1 -0
  198. package/dist/entries/i18n.cjs +48 -0
  199. package/dist/entries/i18n.cjs.map +1 -0
  200. package/dist/entries/i18n.d.cts +69 -0
  201. package/dist/entries/i18n.d.ts +69 -0
  202. package/dist/entries/i18n.js +3 -0
  203. package/dist/entries/i18n.js.map +1 -0
  204. package/dist/entries/llm-models.cjs +177 -0
  205. package/dist/entries/llm-models.cjs.map +1 -0
  206. package/dist/entries/llm-models.d.cts +435 -0
  207. package/dist/entries/llm-models.d.ts +435 -0
  208. package/dist/entries/llm-models.js +4 -0
  209. package/dist/entries/llm-models.js.map +1 -0
  210. package/dist/entries/media.cjs +335 -0
  211. package/dist/entries/media.cjs.map +1 -0
  212. package/dist/entries/media.d.cts +518 -0
  213. package/dist/entries/media.d.ts +518 -0
  214. package/dist/entries/media.js +6 -0
  215. package/dist/entries/media.js.map +1 -0
  216. package/dist/entries/model-catalog.cjs +259 -0
  217. package/dist/entries/model-catalog.cjs.map +1 -0
  218. package/dist/entries/model-catalog.d.cts +202 -0
  219. package/dist/entries/model-catalog.d.ts +202 -0
  220. package/dist/entries/model-catalog.js +6 -0
  221. package/dist/entries/model-catalog.js.map +1 -0
  222. package/dist/entries/models.cjs +833 -0
  223. package/dist/entries/models.cjs.map +1 -0
  224. package/dist/entries/models.d.cts +287 -0
  225. package/dist/entries/models.d.ts +287 -0
  226. package/dist/entries/models.js +8 -0
  227. package/dist/entries/models.js.map +1 -0
  228. package/dist/entries/nodes.cjs +789 -0
  229. package/dist/entries/nodes.cjs.map +1 -0
  230. package/dist/entries/nodes.d.cts +1600 -0
  231. package/dist/entries/nodes.d.ts +1600 -0
  232. package/dist/entries/nodes.js +16 -0
  233. package/dist/entries/nodes.js.map +1 -0
  234. package/dist/entries/organizations.cjs +80 -0
  235. package/dist/entries/organizations.cjs.map +1 -0
  236. package/dist/entries/organizations.d.cts +466 -0
  237. package/dist/entries/organizations.d.ts +466 -0
  238. package/dist/entries/organizations.js +3 -0
  239. package/dist/entries/organizations.js.map +1 -0
  240. package/dist/entries/pipeline.cjs +594 -0
  241. package/dist/entries/pipeline.cjs.map +1 -0
  242. package/dist/entries/pipeline.d.cts +2617 -0
  243. package/dist/entries/pipeline.d.ts +2617 -0
  244. package/dist/entries/pipeline.js +5 -0
  245. package/dist/entries/pipeline.js.map +1 -0
  246. package/dist/entries/scene3d.cjs +704 -0
  247. package/dist/entries/scene3d.cjs.map +1 -0
  248. package/dist/entries/scene3d.d.cts +4284 -0
  249. package/dist/entries/scene3d.d.ts +4284 -0
  250. package/dist/entries/scene3d.js +3 -0
  251. package/dist/entries/scene3d.js.map +1 -0
  252. package/dist/entries/social.cjs +714 -0
  253. package/dist/entries/social.cjs.map +1 -0
  254. package/dist/entries/social.d.cts +1366 -0
  255. package/dist/entries/social.d.ts +1366 -0
  256. package/dist/entries/social.js +5 -0
  257. package/dist/entries/social.js.map +1 -0
  258. package/dist/entries/types.cjs +13 -0
  259. package/dist/entries/types.cjs.map +1 -0
  260. package/dist/entries/types.d.cts +162 -0
  261. package/dist/entries/types.d.ts +162 -0
  262. package/dist/entries/types.js +4 -0
  263. package/dist/entries/types.js.map +1 -0
  264. package/dist/entries/ugc.cjs +279 -0
  265. package/dist/entries/ugc.cjs.map +1 -0
  266. package/dist/entries/ugc.d.cts +575 -0
  267. package/dist/entries/ugc.d.ts +575 -0
  268. package/dist/entries/ugc.js +6 -0
  269. package/dist/entries/ugc.js.map +1 -0
  270. package/dist/entries/video.cjs +549 -0
  271. package/dist/entries/video.cjs.map +1 -0
  272. package/dist/entries/video.d.cts +1791 -0
  273. package/dist/entries/video.d.ts +1791 -0
  274. package/dist/entries/video.js +8 -0
  275. package/dist/entries/video.js.map +1 -0
  276. package/dist/entries/workflow.cjs +574 -0
  277. package/dist/entries/workflow.cjs.map +1 -0
  278. package/dist/entries/workflow.d.cts +1743 -0
  279. package/dist/entries/workflow.d.ts +1743 -0
  280. package/dist/entries/workflow.js +5 -0
  281. package/dist/entries/workflow.js.map +1 -0
  282. package/dist/fan-out-meta-Bu6VyXcZ.d.cts +19 -0
  283. package/dist/fan-out-meta-Bu6VyXcZ.d.ts +19 -0
  284. package/dist/gemini-omni-voices-zeRXxSbZ.d.cts +174 -0
  285. package/dist/gemini-omni-voices-zeRXxSbZ.d.ts +174 -0
  286. package/dist/image-overlay-layers-CyBfRhxJ.d.cts +208 -0
  287. package/dist/image-overlay-layers-CyBfRhxJ.d.ts +208 -0
  288. package/dist/index.cjs +7747 -27084
  289. package/dist/index.cjs.map +1 -1
  290. package/dist/index.d.cts +32 -24198
  291. package/dist/index.d.ts +32 -24198
  292. package/dist/index.js +40 -25220
  293. package/dist/index.js.map +1 -1
  294. package/dist/model-catalog-V-ZNzRSd.d.cts +651 -0
  295. package/dist/model-catalog-V-ZNzRSd.d.ts +651 -0
  296. package/dist/presentation-types-0ENOCjoj.d.cts +61 -0
  297. package/dist/presentation-types-0ENOCjoj.d.ts +61 -0
  298. package/dist/presentation-utils-D0kxsWf9.d.cts +92 -0
  299. package/dist/presentation-utils-pZwlEAzo.d.ts +92 -0
  300. package/dist/scene-node-types-C3kl_zyK.d.cts +1949 -0
  301. package/dist/scene-node-types-C3kl_zyK.d.ts +1949 -0
  302. package/dist/supported-fonts-CRoF1gOy.d.cts +16 -0
  303. package/dist/supported-fonts-CRoF1gOy.d.ts +16 -0
  304. package/dist/types-BRlFPEru.d.cts +511 -0
  305. package/dist/types-BRlFPEru.d.ts +511 -0
  306. package/dist/types-DffyGSy5.d.cts +67 -0
  307. package/dist/types-DffyGSy5.d.ts +67 -0
  308. package/package.json +102 -1
  309. package/src/__tests__/add-captions-plan.test.ts +6 -2
  310. package/src/__tests__/caption-edge-dash.test.ts +23 -0
  311. package/src/__tests__/fixtures/root-exports.baseline.json +4625 -0
  312. package/src/__tests__/input-field-extra-keys.test.ts +1 -0
  313. package/src/__tests__/model-makers.test.ts +76 -0
  314. package/src/__tests__/no-internal-imports.test.ts +1 -1
  315. package/src/__tests__/node-aspect-ratio.test.ts +25 -0
  316. package/src/__tests__/node-runtime-keys.test.ts +9 -0
  317. package/src/__tests__/package-entries.test.ts +50 -0
  318. package/src/__tests__/pitch-tempo-pricing.test.ts +21 -0
  319. package/src/__tests__/presentation-utils.test.ts +15 -0
  320. package/src/__tests__/preview-gate-use-case.test.ts +151 -0
  321. package/src/__tests__/private-host.test.ts +53 -0
  322. package/src/__tests__/run-continuation.test.ts +7 -1
  323. package/src/__tests__/site-capture-node.test.ts +58 -0
  324. package/src/__tests__/ugc-lane-wires.test.ts +228 -0
  325. package/src/__tests__/ugc-node-wires.test.ts +9 -3
  326. package/src/__tests__/ugc-run-state.test.ts +5 -4
  327. package/src/__tests__/video-analysis-catalog-sync.test.ts +1 -1
  328. package/src/__tests__/video-analysis-pricing.test.ts +6 -6
  329. package/src/__tests__/voice-changer-pro-quote.test.ts +79 -0
  330. package/src/add-captions-plan.ts +9 -3
  331. package/src/caption-edge-dash.ts +33 -0
  332. package/src/component-types.ts +9 -0
  333. package/src/credit-estimators/index.ts +22 -1
  334. package/src/credit-estimators/pitch-tempo.ts +15 -1
  335. package/src/credit-estimators/speech.ts +72 -4
  336. package/src/credit-estimators/unit-quote.ts +52 -0
  337. package/src/credit-estimators/video-sfx.ts +15 -0
  338. package/src/credit-estimators/voice-changer-pro-quote.ts +138 -0
  339. package/src/credit-identifiers.ts +62 -17
  340. package/src/entity-image-handle.ts +2 -0
  341. package/src/entries/apps.ts +63 -0
  342. package/src/entries/captions.ts +34 -0
  343. package/src/entries/catalogs.ts +65 -0
  344. package/src/entries/credits.ts +105 -0
  345. package/src/entries/edl.ts +42 -0
  346. package/src/entries/entities.ts +144 -0
  347. package/src/entries/i18n.ts +31 -0
  348. package/src/entries/llm-models.ts +63 -0
  349. package/src/entries/media.ts +36 -0
  350. package/src/entries/model-catalog.ts +95 -0
  351. package/src/entries/models.ts +266 -0
  352. package/src/entries/nodes.ts +245 -0
  353. package/src/entries/organizations.ts +9 -0
  354. package/src/entries/pipeline.ts +43 -0
  355. package/src/entries/scene3d.ts +27 -0
  356. package/src/entries/social.ts +297 -0
  357. package/src/entries/types.ts +26 -0
  358. package/src/entries/ugc.ts +14 -0
  359. package/src/entries/video.ts +59 -0
  360. package/src/entries/workflow.ts +172 -0
  361. package/src/fan-out-rows.ts +2 -0
  362. package/src/index.ts +25 -1845
  363. package/src/json-kinds.ts +4 -0
  364. package/src/model-catalog.ts +243 -34
  365. package/src/node-mappable-fields.ts +1 -0
  366. package/src/node-run-routes.ts +2 -0
  367. package/src/node-runtime-keys.ts +8 -0
  368. package/src/normalize-node-params.ts +30 -0
  369. package/src/presentation-utils.ts +12 -0
  370. package/src/preview-gate.ts +92 -14
  371. package/src/private-host.ts +89 -59
  372. package/src/producer-types.ts +16 -2
  373. package/src/run-continuation.ts +21 -0
  374. package/src/site-capture-node.ts +82 -0
  375. package/src/ugc-lane-wires.ts +246 -0
  376. package/src/ugc-node-wires.ts +37 -7
  377. package/src/ugc-run-state.ts +5 -3
  378. package/src/video-analysis-pricing.ts +31 -29
@@ -0,0 +1,526 @@
1
+ 'use strict';
2
+
3
+ var chunkM7GQBRZU_cjs = require('./chunk-M7GQBRZU.cjs');
4
+
5
+ // src/fan-out-meta.ts
6
+ function fanOutItemMeta(output) {
7
+ const w = output?.clipWarnings;
8
+ const d = output?.durationSec;
9
+ return {
10
+ warnings: Array.isArray(w) ? w.filter((x) => typeof x === "string") : [],
11
+ durationSec: typeof d === "number" && Number.isFinite(d) && d > 0 ? d : null
12
+ };
13
+ }
14
+ function clipNotesFrom(meta, single) {
15
+ const rows = meta && meta.length > 0 ? meta : single ? [single] : [];
16
+ return rows.map((m, i) => ({
17
+ clip: i + 1,
18
+ warnings: m?.warnings ?? [],
19
+ ...typeof m?.durationSec === "number" ? { durationSec: m.durationSec } : {}
20
+ }));
21
+ }
22
+
23
+ // src/ugc-run-state.ts
24
+ var UGC_NODE_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards", "ugc-finish-clips"]);
25
+ var UGC_CREATOR_CANDIDATES_KEY = "candidates";
26
+ var UGC_PICK_FIRST_MESSAGE = "Pick a creator first.";
27
+ var UGC_NODE_RUN_STATE_KEYS = {
28
+ "ugc-creator": ["result", "keepResult", "ugcOutputs", UGC_CREATOR_CANDIDATES_KEY, "optionFailed", "generatedImageUrl"],
29
+ // `exampleLines`: a template's example run, shown until the node's own first script (display only).
30
+ "ugc-script": ["result", "keepResult", "ugcOutputs", "exampleLines"],
31
+ "ugc-clips": ["result", "quote", "__listResults", "ugcOutputs"],
32
+ "ugc-clip": [
33
+ "warnings",
34
+ "rerender",
35
+ "rerenderPending",
36
+ "__listResults",
37
+ "__listResultMeta",
38
+ "clipWarnings",
39
+ "durationSec",
40
+ "ugcOutputs",
41
+ "generatedVideoUrl",
42
+ "generatedResults",
43
+ "activeResultIndex"
44
+ ],
45
+ "ugc-cards": ["result", "ugcOutputs", "generatedText", "text"],
46
+ "ugc-finish-clips": ["ugcOutputs", "__listResults", "__listResultMeta", "generatedVideoUrl", "generatedResults", "activeResultIndex"]
47
+ };
48
+ var UGC_OVERRIDABLE_FIELDS = {
49
+ "ugc-creator": ["source", "gender", "photoUrl"],
50
+ "ugc-script": ["targetDurationSec", "language"],
51
+ "ugc-clips": [],
52
+ "ugc-clip": [],
53
+ "ugc-cards": [],
54
+ "ugc-finish-clips": []
55
+ };
56
+ var KEEP_RESULT_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script"]);
57
+ function ugcPickPending(data) {
58
+ const candidates = data && typeof data === "object" ? data[UGC_CREATOR_CANDIDATES_KEY] : void 0;
59
+ return Array.isArray(candidates) && candidates.length > 0;
60
+ }
61
+ function ugcRunWaitsForPick(runNodes, opts = {}) {
62
+ return runNodes.some((n) => n.type === "ugc-creator" && n.id !== opts.redrawId && ugcPickPending(n.data));
63
+ }
64
+ var UGC_PUBLISH_PRIVATE_FIELDS = {
65
+ "ugc-creator": ["photoUrl"]
66
+ };
67
+ function stripUgcRunState(nodes) {
68
+ return nodes.map((node) => {
69
+ const type = typeof node.type === "string" ? node.type : "";
70
+ if (!UGC_NODE_TYPES.has(type) || !node.data || typeof node.data !== "object") return node;
71
+ const data = { ...node.data };
72
+ for (const key of UGC_NODE_RUN_STATE_KEYS[type] ?? []) delete data[key];
73
+ for (const key of UGC_PUBLISH_PRIVATE_FIELDS[type] ?? []) delete data[key];
74
+ if (KEEP_RESULT_TYPES.has(type)) data.keepResult = false;
75
+ return { ...node, data };
76
+ });
77
+ }
78
+ function findUgcLockedFields(nodes, inputOverrides) {
79
+ if (!nodes || !inputOverrides) return [];
80
+ const found = [];
81
+ for (const node of nodes) {
82
+ const type = node?.type;
83
+ if (typeof type !== "string" || !UGC_NODE_TYPES.has(type)) continue;
84
+ const allowed = UGC_OVERRIDABLE_FIELDS[type] ?? [];
85
+ const fields = inputOverrides[node.id];
86
+ if (!fields || typeof fields !== "object") continue;
87
+ for (const field of Object.keys(fields)) {
88
+ if (!allowed.includes(field)) found.push({ nodeId: String(node.id), nodeType: type, field });
89
+ }
90
+ }
91
+ return found;
92
+ }
93
+
94
+ // src/ugc-node-wires.ts
95
+ var UGC_NOT_SERVED_MESSAGE = "UGC videos are a Nodaro Cloud feature and are not served on this deployment.";
96
+ var UGC_VERSION_MESSAGE = "This workflow was made with a newer version of the UGC nodes.";
97
+ var UGC_NEWER_APP_MESSAGE = "This step needs a newer app version.";
98
+ var UGC_PICK_GONE_MESSAGE = "These creator options are no longer available. Run UGC Creator again.";
99
+ var UGC_CREATOR_MISSING_MESSAGE = "UGC Creator has no creator yet. Run it, or pick one of its options.";
100
+ var UGC_SCRIPT_DEFAULT_TARGET_SEC = 15;
101
+ var UGC_SCRIPT_MIN_TARGET_SEC = 4;
102
+ var UGC_SCRIPT_MAX_TARGET_SEC = 300;
103
+ var MINOR_AGE_MESSAGE = "That age can't be used: UGC creators are adults only.";
104
+ var NEEDS_GENDER = "Choose woman or man.";
105
+ var NEEDS_PHOTO = "Connect or upload a photo of yourself.";
106
+ var NEEDS_CATEGORY = "Run UGC Script first, or pick a product category.";
107
+ var NEEDS_SITE = "Add the product name or website.";
108
+ var UGC_SCRIPT_NEEDS_CHANGES = "The script needs changes:";
109
+ var NEEDS_PLAN_OUT = "Connect the Script (sized) output of UGC Clips.";
110
+ var NEEDS_PLAN = "Connect the Script output of UGC Script.";
111
+ var NEEDS_TICKET = "Connect the Clips output of UGC Clips.";
112
+ var NEEDS_VIDEO = "Connect the joined video.";
113
+ var NEEDS_TRANSCRIPT = "Connect the Transcript output of UGC Clips.";
114
+ var UGC_NEEDS_FINISH_MESSAGE = "Add a UGC Finish node after UGC Clip, and connect UGC Clips' Script (sized) output to it.";
115
+ var UGC_FINISH_NEEDS_CLIPS_MESSAGE = "Connect the Video output of UGC Clip.";
116
+ var UGC_FINISH_NOT_READY_MESSAGE = "A clip did not follow its speech. Re-render it from the UGC Clip node and run again.";
117
+ var UGC_OVER_HOLD_MESSAGE = "The clips for this recording would cost more than this run was checked for, so none was rendered. Run UGC Clips again to record the speech again.";
118
+ var UGC_NODE_MESSAGES = Object.freeze({
119
+ notServed: UGC_NOT_SERVED_MESSAGE,
120
+ version: UGC_VERSION_MESSAGE,
121
+ newerApp: UGC_NEWER_APP_MESSAGE,
122
+ pickGone: UGC_PICK_GONE_MESSAGE,
123
+ creatorMissing: UGC_CREATOR_MISSING_MESSAGE,
124
+ minorAge: MINOR_AGE_MESSAGE,
125
+ needsGender: NEEDS_GENDER,
126
+ needsPhoto: NEEDS_PHOTO,
127
+ needsCategory: NEEDS_CATEGORY,
128
+ needsSite: NEEDS_SITE,
129
+ needsPlanOut: NEEDS_PLAN_OUT,
130
+ needsPlan: NEEDS_PLAN,
131
+ needsTicket: NEEDS_TICKET,
132
+ needsVideo: NEEDS_VIDEO,
133
+ needsTranscript: NEEDS_TRANSCRIPT,
134
+ needsFinish: UGC_NEEDS_FINISH_MESSAGE,
135
+ finishNeedsClips: UGC_FINISH_NEEDS_CLIPS_MESSAGE,
136
+ finishNotReady: UGC_FINISH_NOT_READY_MESSAGE,
137
+ overHold: UGC_OVER_HOLD_MESSAGE
138
+ });
139
+ var UGC_SCREENSHOT_HANDLES = [
140
+ "screenshot",
141
+ "screenshot2",
142
+ "screenshot3",
143
+ "screenshot4",
144
+ "screenshot5",
145
+ "screenshot6",
146
+ "screenshot7",
147
+ "screenshot8"
148
+ ];
149
+ var UGC_PRIMARY_HANDLE = {
150
+ "ugc-creator": "creator",
151
+ "ugc-script": "plan",
152
+ "ugc-clips": "clips",
153
+ "ugc-clip": "video-out",
154
+ "ugc-cards": "layerPlan",
155
+ "ugc-finish-clips": "video-out"
156
+ };
157
+ var isObject = (x) => !!x && typeof x === "object" && !Array.isArray(x);
158
+ function ugcPlanLengthSec(plan) {
159
+ const value = savedPlanOf(plan);
160
+ if (!value) return void 0;
161
+ const sec = value.targetDurationSec;
162
+ return typeof sec === "number" && Number.isInteger(sec) && sec >= UGC_SCRIPT_MIN_TARGET_SEC && sec <= UGC_SCRIPT_MAX_TARGET_SEC ? sec : void 0;
163
+ }
164
+ function ugcPlanScreenshotCount(plan) {
165
+ const value = savedPlanOf(plan);
166
+ if (!value || !Array.isArray(value.beats)) return void 0;
167
+ return value.beats.filter((beat) => isObject(beat) && isObject(beat.screenshot)).length;
168
+ }
169
+ function savedPlanOf(plan) {
170
+ let value = plan;
171
+ if (typeof value === "string") {
172
+ try {
173
+ value = JSON.parse(value);
174
+ } catch {
175
+ return void 0;
176
+ }
177
+ }
178
+ return isObject(value) ? value : void 0;
179
+ }
180
+ var filled = (x) => typeof x === "string" && x.trim() !== "" ? x : void 0;
181
+ function ugcPipValue(outputs, sourceType, sourceHandle) {
182
+ const pip = sourceHandle || (Object.hasOwn(UGC_PRIMARY_HANDLE, sourceType) ? UGC_PRIMARY_HANDLE[sourceType] : void 0);
183
+ if (pip === void 0 || !isObject(outputs) || !Object.hasOwn(outputs, pip)) return void 0;
184
+ const value = outputs[pip];
185
+ return typeof value === "string" ? value : void 0;
186
+ }
187
+ function readUgcWire(raw, unreadable = UGC_VERSION_MESSAGE) {
188
+ let parsed = raw;
189
+ if (typeof raw === "string") {
190
+ try {
191
+ parsed = JSON.parse(raw);
192
+ } catch {
193
+ return { error: unreadable };
194
+ }
195
+ }
196
+ if (!isObject(parsed) || parsed.v === void 0) return { error: unreadable };
197
+ if (parsed.v !== 1) return { error: UGC_VERSION_MESSAGE };
198
+ return { value: parsed };
199
+ }
200
+ function routeErrorOf(body) {
201
+ let parsed;
202
+ try {
203
+ parsed = JSON.parse(body);
204
+ } catch {
205
+ return {};
206
+ }
207
+ if (!isObject(parsed)) return {};
208
+ if (isObject(parsed.error)) {
209
+ const { code, message } = parsed.error;
210
+ return { code: typeof code === "string" ? code : void 0, message: filled(message) };
211
+ }
212
+ return { message: filled(parsed.message) };
213
+ }
214
+ function ugcFailure(status, body) {
215
+ const error = routeErrorOf(body);
216
+ if (status === 404 && error.code === void 0) return UGC_NOT_SERVED_MESSAGE;
217
+ if (error.code === "minor_age_refused") return MINOR_AGE_MESSAGE;
218
+ if ((status === 503 || status >= 400 && status < 500) && error.message) return error.message;
219
+ return `UGC step failed (${status})`;
220
+ }
221
+ var UGC_CREATOR_PICKER_TYPES = /* @__PURE__ */ new Set(["person", "styling", "setting", "lighting"]);
222
+ function previousTraits(data) {
223
+ if (ugcPickPending(data)) {
224
+ const first = data.candidates[0];
225
+ const record = isObject(first) ? first.record : void 0;
226
+ return isObject(record) ? record.traits : void 0;
227
+ }
228
+ return !data.keepResult && isObject(data.result) ? data.result.traits : void 0;
229
+ }
230
+ function setPickers(pickers) {
231
+ if (!pickers) return void 0;
232
+ const set = Object.entries(pickers).filter(([, fields]) => isObject(fields) && Object.keys(fields).length > 0);
233
+ return set.length > 0 ? Object.fromEntries(set) : void 0;
234
+ }
235
+ function ugcCreatorBody(input) {
236
+ const { data } = input;
237
+ const gender = data.gender;
238
+ if (gender !== "woman" && gender !== "man") return { error: NEEDS_GENDER };
239
+ if (data.source === "photo") {
240
+ const imageUrl = filled(input.photoUrl) ?? filled(data.photoUrl);
241
+ if (!imageUrl) return { error: NEEDS_PHOTO };
242
+ return { body: { source: { kind: "photo", imageUrl, gender } } };
243
+ }
244
+ const productCategory = filled(data.categoryOverride) ?? filled(input.category);
245
+ if (!productCategory) return { error: NEEDS_CATEGORY };
246
+ const pickers = setPickers(input.pickers);
247
+ const traits = previousTraits(data);
248
+ return {
249
+ body: {
250
+ ...typeof data.seed === "number" ? { seed: data.seed } : {},
251
+ source: {
252
+ kind: "sampled",
253
+ gender,
254
+ productCategory,
255
+ ...pickers ? { pickers } : {},
256
+ ...isObject(traits) ? { previous: traits } : {}
257
+ }
258
+ }
259
+ };
260
+ }
261
+ function ugcCreatorOutputs(answer, identityImages) {
262
+ const record = {
263
+ v: 1,
264
+ kind: answer.kind,
265
+ gender: answer.gender,
266
+ identityImages: [...identityImages],
267
+ traits: answer.traits ?? null,
268
+ seed: answer.seed ?? null,
269
+ promptsVersion: answer.promptsVersion,
270
+ productCategory: answer.productCategory ?? null
271
+ };
272
+ const imageUrl = identityImages[0] ?? "";
273
+ return { outputs: { creator: JSON.stringify(record), ...imageUrl ? { image: imageUrl } : {} }, imageUrl, record };
274
+ }
275
+ var callOf = (raw) => {
276
+ if (!raw || typeof raw !== "object") return void 0;
277
+ const { tool, args } = raw;
278
+ if (typeof tool !== "string" || !args || typeof args !== "object" || Array.isArray(args)) return void 0;
279
+ return { tool, args };
280
+ };
281
+ var fallbackOf = (image) => image && typeof image === "object" ? image.fallback : void 0;
282
+ function ugcCreatorCandidates(answer) {
283
+ const listed = answer.candidates;
284
+ const noList = listed === void 0 || listed === null || Array.isArray(listed) && listed.length === 0;
285
+ const noImage = answer.image === void 0 || answer.image === null;
286
+ if (noList && noImage) return { calls: [], fallback: null, pick: null };
287
+ if (noList) {
288
+ const image = callOf(answer.image);
289
+ if (!image) return { error: UGC_NEWER_APP_MESSAGE };
290
+ return { calls: [image], fallback: callOf(fallbackOf(answer.image)) ?? null, pick: "primary" };
291
+ }
292
+ if (!Array.isArray(listed)) return { error: UGC_NEWER_APP_MESSAGE };
293
+ const calls = listed.map(callOf);
294
+ if (calls.some((c) => c === void 0)) return { error: UGC_NEWER_APP_MESSAGE };
295
+ const how = answer.pick?.how;
296
+ return {
297
+ calls,
298
+ fallback: callOf(answer.fallback) ?? callOf(fallbackOf(answer.image)) ?? null,
299
+ pick: how === "user" && calls.length > 1 ? "user" : "primary"
300
+ };
301
+ }
302
+ function ugcCreatorCallsToRender(c, opts) {
303
+ return opts.personPicks && c.pick === "user" ? c.calls : c.calls.slice(0, 1);
304
+ }
305
+ function ugcCreatorCandidate(answer, images) {
306
+ const out = ugcCreatorOutputs(answer, images);
307
+ return { imageUrl: out.imageUrl, record: out.record };
308
+ }
309
+ function ugcAwaitsPick(output) {
310
+ const candidates = isObject(output) ? output.ugcCandidates : void 0;
311
+ return Array.isArray(candidates) && candidates.length >= 2;
312
+ }
313
+ function ugcCreatorPick(candidates, index) {
314
+ const entry = Array.isArray(candidates) && Number.isInteger(index) && index >= 0 ? candidates[index] : void 0;
315
+ const imageUrl = entry?.imageUrl;
316
+ const record = entry?.record;
317
+ if (typeof imageUrl !== "string" || !record || typeof record !== "object" || Array.isArray(record)) return { error: UGC_PICK_GONE_MESSAGE };
318
+ const r = record;
319
+ if (r.v !== 1) return { error: UGC_VERSION_MESSAGE };
320
+ if (!Array.isArray(r.identityImages) || r.identityImages[0] !== imageUrl) return { error: UGC_PICK_GONE_MESSAGE };
321
+ return { result: r, outputs: { creator: JSON.stringify(r), image: imageUrl }, imageUrl };
322
+ }
323
+ var UGC_SCRIPT_LANGUAGES = ["en", "he"];
324
+ function ugcScriptBody(input) {
325
+ const site = filled(input.site)?.trim();
326
+ if (!site) return { error: NEEDS_SITE };
327
+ const productImage = filled(input.productImage);
328
+ return {
329
+ body: {
330
+ site,
331
+ screenshots: input.screenshots.filter((s) => filled(s) !== void 0),
332
+ ...productImage ? { productImage } : {},
333
+ targetDurationSec: typeof input.targetDurationSec === "number" ? input.targetDurationSec : UGC_SCRIPT_DEFAULT_TARGET_SEC,
334
+ language: UGC_SCRIPT_LANGUAGES.includes(input.language) ? input.language : "en"
335
+ }
336
+ };
337
+ }
338
+ function ugcScriptOutputs(outputData) {
339
+ const plan = outputData.plan;
340
+ const category = filled(outputData.productCategory);
341
+ return {
342
+ ...isObject(plan) ? { plan: JSON.stringify({ v: 1, ...plan }) } : {},
343
+ ...category ? { category } : {}
344
+ };
345
+ }
346
+ function ugcScriptResult(outputData) {
347
+ const { plan, productCategory, warnings, notes, rounds } = outputData;
348
+ if (!isObject(plan)) return void 0;
349
+ return {
350
+ plan,
351
+ productCategory: filled(productCategory) ?? "",
352
+ warnings: Array.isArray(warnings) ? [...warnings] : [],
353
+ notes: Array.isArray(notes) ? notes.filter((n) => typeof n === "string") : [],
354
+ rounds: typeof rounds === "number" && Number.isFinite(rounds) ? rounds : 0
355
+ };
356
+ }
357
+ function ugcKeptOutputs(type, data) {
358
+ if (type === "ugc-creator" && ugcPickPending(data)) return null;
359
+ const result = data.keepResult === true ? data.result : void 0;
360
+ if (!isObject(result)) return null;
361
+ if (type === "ugc-creator") {
362
+ const image = Array.isArray(result.identityImages) ? filled(result.identityImages[0]) : void 0;
363
+ return image ? { creator: JSON.stringify(result), image } : null;
364
+ }
365
+ if (type === "ugc-script") return isObject(result.plan) ? ugcScriptOutputs(result) : null;
366
+ return null;
367
+ }
368
+ function ugcClipsBody(input) {
369
+ const plan = readUgcWire(input.planWire, NEEDS_PLAN);
370
+ if ("error" in plan) return plan;
371
+ const creator = readUgcWire(input.creatorWire, UGC_CREATOR_MISSING_MESSAGE);
372
+ if ("error" in creator) return creator;
373
+ const voiceId = filled(input.voiceId);
374
+ return {
375
+ body: {
376
+ plan: plan.value,
377
+ gender: creator.value.gender,
378
+ traits: creator.value.traits ?? null,
379
+ identityImages: creator.value.identityImages,
380
+ surface: "canvas",
381
+ ...voiceId ? { voiceId } : {}
382
+ }
383
+ };
384
+ }
385
+ function ugcClipsOutputs(answer) {
386
+ const errors = Array.isArray(answer.errors) ? answer.errors : [];
387
+ if (errors.length > 0) {
388
+ const said = errors.flatMap((e) => isObject(e) ? [filled(e.message), filled(e.fix)] : []).filter((s) => s !== void 0);
389
+ return { error: said.length > 0 ? `${UGC_SCRIPT_NEEDS_CHANGES} ${said.join(" ")}` : UGC_NEWER_APP_MESSAGE };
390
+ }
391
+ const { tickets, sizedPlan, transcript, speechCheckCall } = answer;
392
+ if (!Array.isArray(tickets) || tickets.length === 0 || !tickets.every(isObject) || !isObject(sizedPlan) || typeof transcript !== "string") {
393
+ return { error: UGC_NEWER_APP_MESSAGE };
394
+ }
395
+ const wires = tickets.map((t) => JSON.stringify(t));
396
+ const transcribeArgs = isObject(speechCheckCall) && isObject(speechCheckCall.args) ? speechCheckCall.args : {};
397
+ const finish = isObject(answer.finish) && isObject(answer.finish.args) ? { finish: answer.finish.args } : {};
398
+ return {
399
+ outputs: { clips: wires[0], "plan-out": JSON.stringify({ v: 1, plan: sizedPlan, transcribeArgs, ...finish }), transcript },
400
+ tickets: wires,
401
+ hasCards: answer.hasCards === true,
402
+ finishes: "finish" in finish
403
+ };
404
+ }
405
+ function ugcClipBody(input) {
406
+ const read = readUgcWire(input.ticketWire, NEEDS_TICKET);
407
+ if ("error" in read) return read;
408
+ const ticket = read.value;
409
+ const { index, durationSec } = ticket;
410
+ if (typeof index !== "number" || !Number.isInteger(index) || index < 0) return { error: NEEDS_TICKET };
411
+ if (typeof durationSec !== "number" || !Number.isFinite(durationSec) || durationSec <= 0) return { error: NEEDS_TICKET };
412
+ const clipNumber = index + 1;
413
+ const count = input.rerender?.[String(clipNumber)];
414
+ const nonce = typeof count === "number" && Number.isInteger(count) && count >= 0 ? count : 0;
415
+ const runKey = filled(input.runKey);
416
+ return { body: { ticket, nonce, ...runKey ? { runKey } : {} }, clipNumber, durationSec };
417
+ }
418
+ function ugcClipOutputs(outputData) {
419
+ const videoUrl = filled(outputData.videoUrl) ?? "";
420
+ const meta = fanOutItemMeta(outputData);
421
+ return { outputs: videoUrl ? { "video-out": videoUrl } : {}, videoUrl, durationSec: meta.durationSec, clipWarnings: [...meta.warnings] };
422
+ }
423
+ function ugcClipSavedList(data) {
424
+ if (!isObject(data)) return void 0;
425
+ const batch = Array.isArray(data.__listResults) ? data.__listResults.filter((u) => typeof u === "string" && u !== "") : [];
426
+ if (batch.length > 0) return batch;
427
+ const results = Array.isArray(data.generatedResults) ? data.generatedResults : [];
428
+ const index = typeof data.activeResultIndex === "number" && Number.isInteger(data.activeResultIndex) ? data.activeResultIndex : 0;
429
+ const active = results[index];
430
+ const url = (isObject(active) ? filled(active.url) : void 0) ?? filled(data.generatedVideoUrl);
431
+ return url ? [url] : void 0;
432
+ }
433
+ function ugcCardsJobs(input) {
434
+ const read = readUgcWire(input.planOutWire, NEEDS_PLAN_OUT);
435
+ if ("error" in read) return read;
436
+ const { plan, transcribeArgs } = read.value;
437
+ if (!isObject(plan) || !isObject(transcribeArgs)) return { error: NEEDS_PLAN_OUT };
438
+ const videoUrl = filled(input.videoUrl);
439
+ if (!videoUrl) return { error: NEEDS_VIDEO };
440
+ const transcript = input.transcript;
441
+ if (typeof transcript !== "string") return { error: NEEDS_TRANSCRIPT };
442
+ return {
443
+ alignment: { path: "/v1/forced-alignment", body: { audioUrl: videoUrl, transcript } },
444
+ transcribe: { path: "/v1/transcribe", body: { ...transcribeArgs, audioUrl: videoUrl, provider: chunkM7GQBRZU_cjs.DEFAULT_TRANSCRIBE_NODE_PROVIDER, wordTimestamps: true } },
445
+ plan
446
+ };
447
+ }
448
+ function ugcCardsBody(input) {
449
+ return {
450
+ surface: "canvas",
451
+ plan: input.plan,
452
+ videoUrl: input.videoUrl,
453
+ ...Array.isArray(input.alignment) ? { alignment: input.alignment } : {},
454
+ ...Array.isArray(input.words) ? { words: input.words } : {},
455
+ failed: [...input.failed],
456
+ clipNotes: [...input.clipNotes]
457
+ };
458
+ }
459
+ var EMPTY_CAPTION_PLAN = { v: 1, hookText: "", hookEndMs: 0, bodyEndMs: 0, captions: [] };
460
+ function ugcCardsOutputs(answer) {
461
+ const timing = answer.captionTiming;
462
+ const report = answer.report;
463
+ const lines = isObject(report) && Array.isArray(report.lines) ? report.lines.filter((l) => typeof l === "string") : [];
464
+ return {
465
+ layerPlan: JSON.stringify(Array.isArray(answer.layerPlan) ? answer.layerPlan : []),
466
+ captionPlan: JSON.stringify(isObject(timing) ? { v: 1, ...timing } : EMPTY_CAPTION_PLAN),
467
+ report: lines.join("\n")
468
+ };
469
+ }
470
+
471
+ exports.UGC_CREATOR_CANDIDATES_KEY = UGC_CREATOR_CANDIDATES_KEY;
472
+ exports.UGC_CREATOR_MISSING_MESSAGE = UGC_CREATOR_MISSING_MESSAGE;
473
+ exports.UGC_CREATOR_PICKER_TYPES = UGC_CREATOR_PICKER_TYPES;
474
+ exports.UGC_FINISH_NEEDS_CLIPS_MESSAGE = UGC_FINISH_NEEDS_CLIPS_MESSAGE;
475
+ exports.UGC_FINISH_NOT_READY_MESSAGE = UGC_FINISH_NOT_READY_MESSAGE;
476
+ exports.UGC_NEEDS_FINISH_MESSAGE = UGC_NEEDS_FINISH_MESSAGE;
477
+ exports.UGC_NEWER_APP_MESSAGE = UGC_NEWER_APP_MESSAGE;
478
+ exports.UGC_NODE_MESSAGES = UGC_NODE_MESSAGES;
479
+ exports.UGC_NODE_RUN_STATE_KEYS = UGC_NODE_RUN_STATE_KEYS;
480
+ exports.UGC_NODE_TYPES = UGC_NODE_TYPES;
481
+ exports.UGC_NOT_SERVED_MESSAGE = UGC_NOT_SERVED_MESSAGE;
482
+ exports.UGC_OVERRIDABLE_FIELDS = UGC_OVERRIDABLE_FIELDS;
483
+ exports.UGC_OVER_HOLD_MESSAGE = UGC_OVER_HOLD_MESSAGE;
484
+ exports.UGC_PICK_FIRST_MESSAGE = UGC_PICK_FIRST_MESSAGE;
485
+ exports.UGC_PICK_GONE_MESSAGE = UGC_PICK_GONE_MESSAGE;
486
+ exports.UGC_PRIMARY_HANDLE = UGC_PRIMARY_HANDLE;
487
+ exports.UGC_PUBLISH_PRIVATE_FIELDS = UGC_PUBLISH_PRIVATE_FIELDS;
488
+ exports.UGC_SCREENSHOT_HANDLES = UGC_SCREENSHOT_HANDLES;
489
+ exports.UGC_SCRIPT_DEFAULT_TARGET_SEC = UGC_SCRIPT_DEFAULT_TARGET_SEC;
490
+ exports.UGC_SCRIPT_LANGUAGES = UGC_SCRIPT_LANGUAGES;
491
+ exports.UGC_SCRIPT_MAX_TARGET_SEC = UGC_SCRIPT_MAX_TARGET_SEC;
492
+ exports.UGC_SCRIPT_MIN_TARGET_SEC = UGC_SCRIPT_MIN_TARGET_SEC;
493
+ exports.UGC_SCRIPT_NEEDS_CHANGES = UGC_SCRIPT_NEEDS_CHANGES;
494
+ exports.UGC_VERSION_MESSAGE = UGC_VERSION_MESSAGE;
495
+ exports.clipNotesFrom = clipNotesFrom;
496
+ exports.fanOutItemMeta = fanOutItemMeta;
497
+ exports.findUgcLockedFields = findUgcLockedFields;
498
+ exports.readUgcWire = readUgcWire;
499
+ exports.stripUgcRunState = stripUgcRunState;
500
+ exports.ugcAwaitsPick = ugcAwaitsPick;
501
+ exports.ugcCardsBody = ugcCardsBody;
502
+ exports.ugcCardsJobs = ugcCardsJobs;
503
+ exports.ugcCardsOutputs = ugcCardsOutputs;
504
+ exports.ugcClipBody = ugcClipBody;
505
+ exports.ugcClipOutputs = ugcClipOutputs;
506
+ exports.ugcClipSavedList = ugcClipSavedList;
507
+ exports.ugcClipsBody = ugcClipsBody;
508
+ exports.ugcClipsOutputs = ugcClipsOutputs;
509
+ exports.ugcCreatorBody = ugcCreatorBody;
510
+ exports.ugcCreatorCallsToRender = ugcCreatorCallsToRender;
511
+ exports.ugcCreatorCandidate = ugcCreatorCandidate;
512
+ exports.ugcCreatorCandidates = ugcCreatorCandidates;
513
+ exports.ugcCreatorOutputs = ugcCreatorOutputs;
514
+ exports.ugcCreatorPick = ugcCreatorPick;
515
+ exports.ugcFailure = ugcFailure;
516
+ exports.ugcKeptOutputs = ugcKeptOutputs;
517
+ exports.ugcPickPending = ugcPickPending;
518
+ exports.ugcPipValue = ugcPipValue;
519
+ exports.ugcPlanLengthSec = ugcPlanLengthSec;
520
+ exports.ugcPlanScreenshotCount = ugcPlanScreenshotCount;
521
+ exports.ugcRunWaitsForPick = ugcRunWaitsForPick;
522
+ exports.ugcScriptBody = ugcScriptBody;
523
+ exports.ugcScriptOutputs = ugcScriptOutputs;
524
+ exports.ugcScriptResult = ugcScriptResult;
525
+ //# sourceMappingURL=chunk-HRXEZ3SX.cjs.map
526
+ //# sourceMappingURL=chunk-HRXEZ3SX.cjs.map