2026-08-25 06:04:03 +00:00
// Module ID: 4963
// Function ID: 4964
2026-07-20 16:05:17 +00:00
// Name: openImagePickerUnhandled
2026-08-25 06:04:03 +00:00
// Dependencies: [109, 5, 17, 1304, 4474, 1922, 676, 4618, 3, 4964, 4975, 4955, 4981, 500, 4097, 1236, 4043, 4954, 1271, 4984, 4986, 4959, 4359, 4987, 4988, 4989, 1370, 4990, 4991, 4992, 4632, 4993, 2]
2026-07-29 08:29:29 +00:00
// Exports: cancelGetFileInfo, getAppDir, getCaptionLabel, getFileFromUploadItem, getFileInfo, getFileSize, getImageCompressionQuality, getImageDimensionsIfMissing, getType, isHEVCEncodingSupported, openImagePicker, resolveModeToVideoQualityForFreeUser, resolveModeToVideoQualityForUserWithFeature, shouldResolveToMediaFilePath
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 4963 (openImagePickerUnhandled)
2026-08-24 06:08:38 +00:00
import timestampDefault from "timestamp" /* 3 */ ;
import set from "set" /* 500 */ ;
import enforcingDefault from "enforcing" /* 1271 */ ;
2026-08-25 06:04:03 +00:00
import cancel from "cancel" /* 4954 */ ;
import items2 from "items" /* 4955 */ ;
import getUploadFileSizeSum from "getUploadFileSizeSum" /* 4959 */ ;
import toString from "toString" /* 4986 */ ;
import getTimeFormat from "getTimeFormat" /* 4993 */ ;
2026-08-24 06:08:38 +00:00
import closure_4 from "_objectWithoutProperties" /* 109 */ ;
import closure_5 from "asyncGeneratorStep" /* 5 */ ;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */ ;
import CHANNEL_SIDEBAR_WIDTH from "CHANNEL_SIDEBAR_WIDTH" /* 1304 */ ;
import closure_10 from "CHANNEL_SIDEBAR_WIDTH" /* 1304 */ ;
2026-08-25 06:04:03 +00:00
import closure_11 from "handleConnectionInfoChange" /* 4474 */ ;
2026-08-24 06:08:38 +00:00
import closure_12 from "mergeGuildAvatar" /* 1922 */ ;
import ME from "ME" /* 676 */ ;
2026-08-25 06:04:03 +00:00
import { NativePermissionTypes } from "NativePermissionStatus" /* 4618 */ ;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1 ;
2026-07-20 16:05:17 +00:00
function openImagePickerUnhandled() {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _openImagePickerUnhandled . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _openImagePickerUnhandled() {
const self = this ;
let tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c11 = 0 ;
c12 = 0 ;
c9 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 , originalMd5 ) {
2026-08-24 06:08:38 +00:00
if ( closure_12 === 2 ) {
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw originalMd5 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = originalMd5 ;
return obj ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
2026-08-24 06:08:38 +00:00
closure_12 = 2 ;
2026-07-29 08:29:29 +00:00
if ( 0 === c11 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
obj = { value : null , done : true } ;
obj [ 0 ] = originalMd5 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_6 = tmp2 ;
closure_7 = tmp7 ;
2026-07-29 08:29:29 +00:00
let type ;
let obj20 ;
let obj23 ;
let obj10 ;
let obj8 ;
closure_6 = undefined ;
closure_7 = undefined ;
2026-08-24 06:08:38 +00:00
let obj25 = closure_1_1 ( closure_1_2 [ 9 ] ) ;
2026-07-29 08:29:29 +00:00
c11 = 1 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
obj1 = { value : null , done : false } ;
obj1 [ 0 ] = obj25 . requestPermission ( closure_1_19 . PHOTOS ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( 1 === tmp7 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj2 = { value : null , done : true } ;
obj2 [ 0 ] = originalMd5 ;
return obj2 ;
} else if ( originalMd5 ) {
let obj3 = { width : null , height : null } ;
let size = lib ;
if ( "size" in lib ) {
size = size . size ;
obj3 [ 0 ] = size ;
obj3 [ 1 ] = lib . size ;
let tmp64 = obj3 ;
} else {
obj3 [ 0 ] = size . width ;
obj3 [ 1 ] = lib . height ;
tmp64 = obj3 ;
}
type = tmp64 ;
obj20 = type . width ;
obj23 = type . height ;
obj3 = new Promise ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
type = arg1 ;
2026-07-29 08:29:29 +00:00
type ( obj20 [ 10 ] ) . launchImageLibrary ( { mediaType : "photo" , includeBase64 : true , disableNewIOSPicker : true } , ( assets ) = > {
let first = null ;
if ( null != assets . assets ) {
first = null ;
if ( assets . assets . length > 0 ) {
first = assets . assets [ 0 ] ;
}
}
if ( assets . didCancel ) {
const _Error2 = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( closure_1_23 ) ;
2026-07-29 08:29:29 +00:00
callback2 ( error ) ;
} else {
if ( null == assets . errorCode ) {
let uri ;
if ( first != null ) {
uri = first . uri ;
}
if ( null != uri ) {
const obj = { uri : null , base64 : null } ;
( { uri : obj [ 0 ] , base64 : obj [ 1 ] } = first ) ;
callback ( obj ) ;
}
}
const _Error = Error ;
const error1 = new Error ( assets . errorMessage ) ;
callback2 ( error1 ) ;
}
} ) ;
} ) ;
c11 = 2 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
} else {
let _Error = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( "Missing permission" ) ;
2026-07-29 08:29:29 +00:00
throw error ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( 2 === tmp7 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj4 = { value : null , done : true } ;
obj4 [ 0 ] = originalMd5 ;
return obj4 ;
} else {
obj10 = originalMd5 ;
const obj5 = { uri : null , i : "" } ;
obj5 [ 0 ] = obj10 . uri ;
obj8 = lib ( obj20 [ 11 ] ) . getFile ( obj5 ) ;
const obj30 = lib ( obj20 [ 11 ] ) ;
const obj32 = type ( obj20 [ 12 ] ) ;
closure_6 = type ( obj20 [ 12 ] ) . fromFileUri ( obj10 . uri ) . catch ( ( ) = > null ) ;
if ( null != obj10 . base64 ) {
if ( obj33 . isAndroid ( ) ) {
let base64 = obj10 . base64 ;
if ( base64 . startsWith ( "UklGR" ) ) {
const obj6 = { } ;
2026-08-24 06:08:38 +00:00
closure_8 = obj6 ;
2026-07-29 08:29:29 +00:00
obj6 . base64 = closure_17 + obj10 . base64 ;
obj6 . mimeType = "image/webp" ;
c11 = 3 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
const obj7 = { value : null , done : false } ;
obj7 [ 0 ] = closure_6 ;
return obj7 ;
} else {
base64 = obj10 . base64 ;
if ( 4 === base64 . indexOf ( "ZnR5cA==" ) ) {
const base641 = obj10 . base64 ;
if ( 8 !== base641 . indexOf ( "YXZpZg==" ) ) {
const base642 = obj10 . base64 ;
}
obj8 = { base64 : closure_18 + obj10 . base64 , mimeType : "image/avif" } ;
c11 = 4 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
const obj9 = { value : null , done : false } ;
obj9 [ 0 ] = closure_6 ;
return obj9 ;
}
}
}
obj33 = lib ( obj20 [ 13 ] ) ;
}
if ( "image/gif" === obj8 . type ) {
obj10 = { } ;
obj10 . base64 = closure_14 + obj10 . base64 ;
obj10 . mimeType = "image/gif" ;
c11 = 5 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
const obj11 = { value : null , done : false } ;
obj11 [ 0 ] = closure_6 ;
return obj11 ;
} else {
let tmp = closure_6 ;
2026-08-24 06:08:38 +00:00
c9 = 1 ;
2026-07-29 08:29:29 +00:00
tmp = type ;
tmp = obj20 ;
const obj12 = { uri : null , width : null , height : null , includeBase64 : true , mimeType : null } ;
tmp = obj10 ;
obj12 [ 0 ] = obj10 . uri ;
tmp = obj20 ;
obj12 [ 1 ] = obj20 ;
tmp = obj23 ;
obj12 [ 2 ] = obj23 ;
tmp = lib ;
const preferredMimeType = lib . preferredMimeType ;
type = preferredMimeType ;
if ( preferredMimeType == null ) {
type = obj8 . type ;
}
obj12 [ 4 ] = type ;
c11 = 7 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
const obj13 = { value : null , done : false } ;
obj13 [ 0 ] = type ( obj20 [ 10 ] ) . launchCropper ( obj12 ) ;
return obj13 ;
}
const fromFileUriResult = type ( obj20 [ 12 ] ) . fromFileUri ( obj10 . uri ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( 3 === tmp7 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj14 = { value : null , done : true } ;
obj14 [ 0 ] = originalMd5 ;
return obj14 ;
} else {
closure_8 . originalMd5 = originalMd5 ;
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj15 = { value : null , done : true } ;
obj15 [ 0 ] = closure_8 ;
return obj15 ;
}
} else if ( 4 === tmp7 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj16 = { value : null , done : true } ;
obj16 [ 0 ] = originalMd5 ;
return obj16 ;
} else {
obj8 . originalMd5 = originalMd5 ;
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj17 = { value : null , done : true } ;
obj17 [ 0 ] = obj8 ;
return obj17 ;
}
} else if ( 5 === tmp7 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj18 = { value : null , done : true } ;
obj18 [ 0 ] = originalMd5 ;
return obj18 ;
} else {
obj10 . originalMd5 = originalMd5 ;
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj19 = { value : null , done : true } ;
obj19 [ 0 ] = obj10 ;
return obj19 ;
}
} else if ( 6 === tmp7 ) {
c9 = 0 ;
closure_8 = closure_10 ;
if ( "E_PICKER_CANCELLED" === closure_8 . code ) {
throw closure_8 ;
} else {
obj20 = { base64 : closure_13 + obj10 . base64 , mimeType : obj8.type , errorStr : closure_8.message } ;
c11 = 9 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
const obj21 = { value : null , done : false } ;
obj21 [ 0 ] = closure_6 ;
return obj21 ;
}
} else if ( 7 === tmp7 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
c9 = 0 ;
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj22 = { value : null , done : true } ;
obj22 [ 0 ] = originalMd5 ;
return obj22 ;
} else {
closure_7 = originalMd5 ;
obj23 = { } ;
const _HermesInternal = HermesInternal ;
obj23 . base64 = "data:" + closure_7 . mime + ";base64," + closure_7 . data ;
obj23 . mimeType = closure_7 . mime ;
c11 = 8 ;
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
const obj24 = { value : null , done : false } ;
obj24 [ 0 ] = closure_6 ;
return obj24 ;
}
} else if ( 8 === tmp7 ) {
if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
c9 = 0 ;
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
obj25 = { value : null , done : true } ;
obj25 [ 0 ] = originalMd5 ;
return obj25 ;
} else {
obj23 . originalMd5 = originalMd5 ;
c9 = 0 ;
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj26 = { value : null , done : true } ;
obj26 [ 0 ] = obj23 ;
return obj26 ;
}
} else if ( arg0 === 1 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
throw originalMd5 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
const obj27 = { value : null , done : true } ;
obj27 [ 0 ] = originalMd5 ;
return obj27 ;
} else {
obj20 . originalMd5 = originalMd5 ;
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
obj = { value : null , done : true } ;
obj [ 0 ] = obj20 ;
return obj ;
}
} catch ( tmp75 ) {
closure_10 = tmp75 ;
if ( tmp3 === c9 ) {
2026-08-24 06:08:38 +00:00
closure_12 = tmp ;
2026-07-29 08:29:29 +00:00
throw tmp75 ;
} else {
c11 = tmp4 ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_25 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
function openImagePicker ( closure_1_8 ) {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _openImagePicker . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _openImagePicker() {
const self = this ;
const tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c5 = 0 ;
c6 = 0 ;
c4 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 ) {
if ( c6 === 2 ) {
c6 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c6 = 2 ;
if ( 0 === c5 ) {
if ( arg0 === 1 ) {
c6 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_2 = tmp3 ;
closure_1 = tmp7 ;
2026-07-29 08:29:29 +00:00
closure_1 = undefined ;
c5 = 1 ;
c6 = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
obj1 [ 0 ] = closure_1_1 ( closure_1_2 [ 9 ] ) . requestPermission ( closure_1_19 . PHOTOS ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
} else if ( 1 === tmp7 ) {
if ( arg0 === 1 ) {
c6 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 3 ;
2026-08-24 06:08:38 +00:00
const obj2 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj2 [ 0 ] = arg1 ;
return obj2 ;
} else if ( arg1 ) {
2026-08-24 06:08:38 +00:00
c4 = 1 ;
2026-07-29 08:29:29 +00:00
c5 = 3 ;
c6 = 1 ;
2026-08-24 06:08:38 +00:00
const obj3 = { value : null , done : false } ;
2026-07-29 08:29:29 +00:00
obj3 [ 0 ] = callback2 ( callback ) ;
return obj3 ;
} else {
c6 = 3 ;
2026-08-24 06:08:38 +00:00
let obj4 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj4 [ 0 ] = { errorStr : "Missing permission" } ;
return obj4 ;
}
} else if ( 2 === tmp7 ) {
c4 = 0 ;
closure_2 = closure_3 ;
if ( "E_PICKER_CANCELLED" !== closure_2 . code ) {
if ( closure_2 . message !== closure_23 ) {
if ( "E_CROPPER_IMAGE_NOT_FOUND" === closure_2 . code ) {
2026-08-24 06:08:38 +00:00
let obj5 = callback ( closure_2 [ 14 ] ) ;
const intl2 = callback ( closure_2 [ 15 ] ) . intl ;
obj5 . presentFailedToast ( intl2 . string ( callback ( closure_2 [ 15 ] ) . t . TTzyzW ) ) ;
obj5 = { errorStr : "No select photo access" } ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj4 = callback ( closure_2 [ 14 ] ) ;
obj4 . presentFailedToast ( closure_2 . message ) ;
2026-07-29 08:29:29 +00:00
{ errorStr : null } [ 0 ] = closure_2 . message ;
}
}
c6 = 3 ;
}
} else if ( arg0 === 1 ) {
c6 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 0 ;
c6 = 3 ;
const obj7 = { value : null , done : true } ;
obj7 [ 0 ] = arg1 ;
return obj7 ;
} else {
closure_1 = arg1 ;
if ( null != closure_1 . errorStr ) {
2026-08-24 06:08:38 +00:00
obj = callback ( closure_2 [ 14 ] ) ;
const intl = callback ( closure_2 [ 15 ] ) . intl ;
2026-07-29 08:29:29 +00:00
const obj8 = { reason : null } ;
obj8 [ 0 ] = closure_1 . errorStr ;
2026-08-24 06:08:38 +00:00
obj . presentFailedToast ( intl . formatToPlainString ( callback ( closure_2 [ 15 ] ) . t . Ex162J , obj8 ) ) ;
2026-07-29 08:29:29 +00:00
}
c4 = 0 ;
c6 = 3 ;
2026-08-24 06:08:38 +00:00
const obj9 = { value : null , done : true } ;
obj9 [ 0 ] = closure_1 ;
return obj9 ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
} catch ( tmp46 ) {
closure_3 = tmp46 ;
2026-07-29 08:29:29 +00:00
if ( tmp4 === c4 ) {
c6 = tmp2 ;
2026-08-24 06:08:38 +00:00
throw tmp46 ;
2026-07-29 08:29:29 +00:00
} else {
c5 = tmp ;
}
}
}
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_26 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
function mediaManager() {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _mediaManager . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _mediaManager() {
const self = this ;
const tmp = callback ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_2 = arg2 ;
c7 = 0 ;
c8 = 0 ;
c6 = 0 ;
2026-07-29 08:29:29 +00:00
const iter = ( function * ( arg0 , arg1 ) {
2026-08-12 06:57:52 +00:00
if ( c8 === 2 ) {
c8 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp7 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-08-12 06:57:52 +00:00
}
} else {
try {
c8 = 2 ;
if ( 0 === c7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_4 = tmp3 ;
closure_3 = tmp5 ;
c2 = undefined ;
2026-08-12 06:57:52 +00:00
let tmp24 = c2 ;
if ( c2 === undefined ) {
tmp24 = null ;
}
c2 = tmp24 ;
c7 = 1 ;
c8 = 1 ;
return { value : "ct" , done : true } ;
}
} else if ( 1 === tmp8 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-08-12 06:57:52 +00:00
obj1 [ 0 ] = arg1 ;
return obj1 ;
} else {
let MediaManager = 1 ;
MediaManager = MediaManager . MediaManager ;
c7 = 3 ;
c8 = 1 ;
const obj2 = { value : null , done : false } ;
obj2 [ 0 ] = MediaManager [ closure_0 ] ( closure_1 , c2 ) ;
return obj2 ;
}
} else if ( 2 === tmp8 ) {
MediaManager = 0 ;
2026-08-24 06:08:38 +00:00
closure_3 = closure_5 ;
2026-08-12 06:57:52 +00:00
logger . warn ( closure_3 ) ;
c8 = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-08-12 06:57:52 +00:00
} else if ( arg0 === 1 ) {
c8 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
MediaManager = 0 ;
c8 = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = arg1 ;
return obj3 ;
} else {
MediaManager = 0 ;
c8 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
} catch ( tmp25 ) {
2026-08-24 06:08:38 +00:00
closure_5 = tmp25 ;
2026-08-12 06:57:52 +00:00
if ( tmp4 === MediaManager ) {
c8 = tmp2 ;
throw tmp25 ;
} else {
c7 = tmp ;
}
}
2026-07-29 08:29:29 +00:00
}
} ) ( ) ;
iter . next ( ) ;
return iter ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_28 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function getVideoQuality() {
2026-07-20 16:05:17 +00:00
if ( closure_10 . dataSavingMode ) {
if ( store . getType ( ) === constants3 . CELLULAR ) {
return constants . LOW ;
}
}
const videoUploadQuality = closure_10 . videoUploadQuality ;
2026-07-23 10:11:24 +00:00
currentUser = currentUser . getCurrentUser ( ) ;
2026-07-29 08:29:29 +00:00
const DATA_SAVER = constants2 . DATA_SAVER ;
2026-07-20 16:05:17 +00:00
if ( obj . canUseHighVideoUploadQuality ( currentUser ) ) {
2026-07-29 08:29:29 +00:00
if ( DATA_SAVER === videoUploadQuality ) {
let VERY_HIGH = constants . LOW ;
} else {
if ( tmp5 . STANDARD === videoUploadQuality ) {
VERY_HIGH = constants . HIGH ;
} else if ( tmp5 . BEST !== videoUploadQuality ) {
VERY_HIGH = constants . MEDIUM ;
}
VERY_HIGH = constants . VERY_HIGH ;
}
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if ( DATA_SAVER === videoUploadQuality ) {
let LOW = constants . LOW ;
} else if ( tmp5 . STANDARD === videoUploadQuality ) {
LOW = constants . MEDIUM ;
} else if ( tmp5 . BEST === videoUploadQuality ) {
LOW = constants . HIGH ;
} else {
LOW = constants . LOW ;
}
return LOW ;
2026-07-20 16:05:17 +00:00
}
}
function getAppDir() {
if ( obj . isAndroid ( ) ) {
2026-08-24 06:08:38 +00:00
if ( null == enforcingDefault ) {
2026-07-20 16:05:17 +00:00
const _Error = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( "RTNFileManager doesn't exist?" ) ;
2026-07-20 16:05:17 +00:00
throw error ;
} else {
2026-07-29 08:29:29 +00:00
const tmp3Result = tmp3 ( 1271 ) ;
return tmp3 ( 1271 ) . getConstants ( ) . CacheDirPath . replace ( /cache$/ , "" ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3 = importDefault ;
2026-07-20 16:05:17 +00:00
} else {
return "/private" + closure_6 . DCDFileManager . DocumentsDirPath . replace ( /Documents$/ , "" ) ;
}
2026-08-24 06:08:38 +00:00
obj = set ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function getFileInfo ( closure_0 , closure_1 ) {
( { item , spoiler , description } = closure_0 ) ;
let str = closure_1 ;
( { mimeType , allowOptimization } = closure_0 ) ;
if ( closure_1 === undefined ) {
2026-07-20 16:05:17 +00:00
str = "" ;
}
2026-08-24 06:08:38 +00:00
if ( item . platform !== cancel . UploadPlatform . REACT_NATIVE ) {
2026-07-20 16:05:17 +00:00
const _Error = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( "Try to get file info for unsupported upload item" ) ;
2026-07-20 16:05:17 +00:00
throw error ;
} else {
( { originalUri , filename , mimeType : mimeType2 } = item ) ;
2026-07-29 08:29:29 +00:00
if ( mimeType2 == null ) {
mimeType2 = mimeType ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { uri : null , overrideType : null } ;
obj [ 0 ] = originalUri ;
obj [ 1 ] = mimeType2 ;
if ( tmpResult . getFile ( obj ) . isVideo ) {
obj = { originalUri : null , filename : null , mimeType : null , fileSize : null , spoiler : null , description : null , i : null } ;
obj [ 0 ] = originalUri ;
obj [ 1 ] = filename ;
obj [ 2 ] = mimeType2 ;
obj [ 3 ] = item . size ;
obj [ 4 ] = spoiler ;
obj [ 5 ] = description ;
obj [ 6 ] = str ;
let tmp3 = ( function processVideoUpload ( arg0 ) {
const self = this ;
const apply = closure_37 . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-23 10:11:24 +00:00
} ) ( obj ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj1 = { originalUri : null , filename : null , mimeType : null , spoiler : null , description : null , i : null , width : null , height : null , allowOptimization : null } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = originalUri ;
obj1 [ 1 ] = filename ;
obj1 [ 2 ] = mimeType2 ;
obj1 [ 3 ] = spoiler ;
obj1 [ 4 ] = description ;
obj1 [ 5 ] = str ;
( { width : obj3 [ 6 ] , height : obj3 [ 7 ] } = item ) ;
obj1 [ 8 ] = allowOptimization ;
tmp3 = ( function processImageOrFileUpload ( arg0 ) {
const self = this ;
const apply = closure_38 . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
} ) ( obj1 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp = require ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _getPhotoKitDataUTI() {
const self = this ;
const tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c6 = 0 ;
c7 = 0 ;
c5 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 ) {
if ( c7 === 2 ) {
c7 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c7 = 2 ;
if ( 0 === MediaManager ) {
if ( arg0 === 1 ) {
c7 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c7 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_3 = tmp3 ;
closure_2 = tmp7 ;
2026-07-29 08:29:29 +00:00
if ( obj8 . isIOS ( ) ) {
if ( obj7 . startsWith ( "ph://" ) ) {
2026-08-24 06:08:38 +00:00
c5 = 1 ;
2026-07-29 08:29:29 +00:00
MediaManager = MediaManager . MediaManager ;
MediaManager = 2 ;
c7 = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = MediaManager . getImageContentType ( obj7 ) ;
return obj1 ;
}
}
c7 = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else if ( 1 === tmp7 ) {
c5 = 0 ;
2026-08-24 06:08:38 +00:00
const callback = closure_4 ;
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal ;
logger . warn ( "getImageContentType failed: " + callback ) ;
c7 = 3 ;
const obj2 = { value : null , done : true } ;
obj2 [ 0 ] = undefined ;
return obj2 ;
} else if ( arg0 === 1 ) {
c7 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c5 = 0 ;
c7 = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = arg1 ;
return obj3 ;
} else {
2026-08-24 06:08:38 +00:00
c1 = arg1 ;
2026-07-29 08:29:29 +00:00
if ( arg1 == null ) {
c1 = undefined ;
}
c5 = 0 ;
c7 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = c1 ;
return obj ;
}
} catch ( tmp16 ) {
2026-08-24 06:08:38 +00:00
closure_4 = tmp16 ;
2026-07-29 08:29:29 +00:00
if ( tmp4 === c5 ) {
c7 = tmp2 ;
throw tmp16 ;
} else {
MediaManager = tmp ;
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_30 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _shouldConvertToPNG() {
const self = this ;
const tmp = callback ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
c6 = 0 ;
c7 = 0 ;
c5 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 , arg1 ) {
if ( c7 === 2 ) {
c7 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c7 = 2 ;
if ( 0 === MediaManager ) {
if ( arg0 === 1 ) {
c7 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c7 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_3 = tmp3 ;
closure_2 = tmp7 ;
2026-07-29 08:29:29 +00:00
if ( obj7 . isIOS ( ) ) {
if ( tmp27Result . isPhotoKitAsset ( str3 , str4 ) ) {
let match ;
if ( str4 != null ) {
match = str4 . match ( /\.png$/i ) ;
}
if ( null == match ) {
c7 = 3 ;
return { value : false , done : true } ;
}
} else if ( null == str3 . match ( /^(assets-library|file):\/\/.+(&ext=|\.)png$/i ) ) {
c7 = 3 ;
return { value : false , done : true } ;
}
2026-08-24 06:08:38 +00:00
c5 = 1 ;
2026-07-29 08:29:29 +00:00
MediaManager = MediaManager . MediaManager ;
MediaManager = 2 ;
c7 = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = MediaManager . imageHasTransparency ( str3 ) ;
return obj1 ;
} else {
c7 = 3 ;
return { value : false , done : true } ;
}
2026-08-24 06:08:38 +00:00
obj7 = callback ( closure_1_2 [ 13 ] ) ;
2026-07-29 08:29:29 +00:00
const tmp27 = callback ;
2026-08-24 06:08:38 +00:00
const tmp28 = closure_1_2 ;
2026-07-29 08:29:29 +00:00
}
} else if ( 1 === tmp7 ) {
c5 = 0 ;
2026-08-24 06:08:38 +00:00
callback = closure_4 ;
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal ;
logger . error ( "shouldConvertToPNG: imageHasTransparency failed: " + callback ) ;
c7 = 3 ;
return { value : false , done : true } ;
} else if ( arg0 === 1 ) {
c7 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c5 = 0 ;
c7 = 3 ;
const obj2 = { value : null , done : true } ;
obj2 [ 0 ] = arg1 ;
return obj2 ;
} else {
c5 = 0 ;
c7 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
} catch ( tmp17 ) {
2026-08-24 06:08:38 +00:00
closure_4 = tmp17 ;
2026-07-29 08:29:29 +00:00
if ( tmp4 === c5 ) {
c7 = tmp2 ;
throw tmp17 ;
} else {
MediaManager = tmp ;
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_31 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function isVideo ( uri , overrideType ) {
2026-08-24 06:08:38 +00:00
let obj = items2 ;
2026-07-29 08:29:29 +00:00
obj = { uri , overrideType } ;
2026-07-20 16:05:17 +00:00
return obj . getFile ( obj ) . isVideo ;
}
function isImage ( uri , overrideType ) {
2026-08-24 06:08:38 +00:00
let obj = items2 ;
2026-07-20 16:05:17 +00:00
obj = { uri , overrideType } ;
return obj . getFile ( obj ) . isImage ;
}
function getType ( uri ) {
2026-08-24 06:08:38 +00:00
let obj = items2 ;
2026-07-20 16:05:17 +00:00
obj = { uri } ;
return obj . getFile ( obj ) . type ;
}
function convertVideo ( videoMetadata ) {
2026-07-23 10:11:24 +00:00
( { uri : require , filename : importDefault , isLowQuality : dependencyMap , compressionQuality : closure_3 , videoQualitySetting } = videoMetadata ) ;
2026-07-20 16:05:17 +00:00
videoMetadata = videoMetadata . videoMetadata ;
2026-07-29 08:29:29 +00:00
let result1 ;
2026-07-20 16:05:17 +00:00
let obj ;
2026-08-24 06:08:38 +00:00
c7 = undefined ;
const VideoQualityTarget = toString . VideoQualityTarget ;
2026-07-29 08:29:29 +00:00
const result = VideoQualityTarget . fromCompressionQuality ( videoQualitySetting ) ;
2026-08-24 06:08:38 +00:00
obj = toString ;
result1 = obj . canSkipVideoTranscode ( result , videoMetadata , videoMetadata . fileSize , getUploadFileSizeSum . maxFileSize ( ) ) ;
let obj2 = getUploadFileSizeSum ;
const result2 = toString . calculateTargetDimensions ( videoMetadata , result . targetResolution ) ;
let obj3 = toString ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-08-24 06:08:38 +00:00
const result3 = toString . calculateOptimalBitrate ( videoMetadata , result , toString . DEFAULT_VIDEO_ENCODING_CONFIG . bitrateFloor ) ;
const merged = Object . assign ( toString . DEFAULT_VIDEO_ENCODING_CONFIG ) ;
2026-07-29 08:29:29 +00:00
obj . videoQuality = result ;
( { width : obj5.targetWidth , height : obj5.targetHeight } = result2 ) ;
obj . targetBitrate = result3 ;
2026-08-24 06:08:38 +00:00
let obj4 = toString ;
2026-07-20 16:05:17 +00:00
if ( obj6 . isAndroid ( ) ) {
2026-07-29 08:29:29 +00:00
if ( tmpResult . getSystemVersionMajor ( ) > 34 ) {
2026-07-23 10:11:24 +00:00
let _Math = Math ;
2026-08-25 06:04:03 +00:00
let frameRate = Math . min ( videoMetadata . frameRate , tmp ( 4986 ) . DEFAULT_VIDEO_ENCODING_CONFIG . frameRate ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj . frameRate = frameRate ;
obj . skipVideoTranscode = result1 ;
( { isHDRContent : obj5.createHDR , rotationDegrees : obj5.rotationDegrees } = videoMetadata ) ;
2026-07-23 10:11:24 +00:00
c7 = 0 ;
let promise = new Promise ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
2026-07-29 08:29:29 +00:00
function _findCompatibleConfig() {
const self = this ;
let tmp = result1 ( function * ( ) {
if ( c13 === 2 ) {
c13 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const tmp75 = /* builtin0 */ ;
if ( tmp9 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
2026-08-24 06:08:38 +00:00
obj = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c13 = 2 ;
2026-08-24 06:08:38 +00:00
if ( 0 === closure_12 ) {
2026-07-29 08:29:29 +00:00
if ( arg0 === 1 ) {
c13 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c13 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_8 = tmp4 ;
closure_9 = tmp7 ;
2026-07-29 08:29:29 +00:00
let v ;
function * _loop() {
2026-08-04 21:03:28 +00:00
let maxWidth = tmp2 ;
2026-08-24 06:08:38 +00:00
c1 = tmp3 ;
let throwTypeErrorResult = closure_3_43 ;
2026-08-04 21:03:28 +00:00
throwTypeErrorResult = next ;
2026-08-24 06:08:38 +00:00
yield closure_3_43 ( next ) ;
2026-08-04 21:03:28 +00:00
throwTypeErrorResult = c1 ;
let min = arg1 ;
throwTypeErrorResult = min ;
if ( min . isSupported ) {
return { v : true } ;
}
if ( null != min ) {
throwTypeErrorResult = c1 ;
throwTypeErrorResult = min ;
if ( null != min . capabilities ) {
throwTypeErrorResult = c1 ;
throwTypeErrorResult = min ;
if ( null != min . failures ) {
throwTypeErrorResult = c1 ;
throwTypeErrorResult = min ;
if ( 0 !== min . failures . length ) {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c1 ;
2026-08-04 21:03:28 +00:00
c1 = false ;
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = min ;
2026-08-04 21:03:28 +00:00
const failures = min . failures ;
if ( null != failures . find ( ( ) = > { . . . } ) ) {
if ( next . useHEVC ) {
throwTypeErrorResult = c1 ;
throwTypeErrorResult = maxWidth ;
throwTypeErrorResult = next ;
next . useHEVC = false ;
c1 = true ;
} else {
2026-08-24 06:08:38 +00:00
closure_3_20 . error ( "No supported video encoder found" ) ;
2026-08-04 21:03:28 +00:00
const _Error3 = Error ;
throwTypeErrorResult = new . target ;
throwTypeErrorResult = new Error ( "No supported video encoder found" ) ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_1 ( throwTypeErrorResult ) ;
2026-08-04 21:03:28 +00:00
}
2026-08-24 06:08:38 +00:00
c4 = 3 ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
throwTypeErrorResult = c1 ;
throwTypeErrorResult = min ;
const failures1 = min . failures ;
if ( null != failures1 . find ( ( ) = > { . . . } ) ) {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c1 ;
throwTypeErrorResult = min ;
2026-08-04 21:03:28 +00:00
if ( null != min . capabilities . resolution ) {
throwTypeErrorResult = maxWidth ;
throwTypeErrorResult = next ;
if ( 0 !== next . targetHeight ) {
throwTypeErrorResult = maxWidth ;
throwTypeErrorResult = next ;
if ( 0 !== next . targetWidth ) {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c1 ;
2026-08-04 21:03:28 +00:00
throwTypeErrorResult = maxWidth ;
throwTypeErrorResult = min ;
maxWidth = min . capabilities . resolution . maxWidth ;
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = min ;
2026-08-04 21:03:28 +00:00
const maxHeight = min . capabilities . resolution . maxHeight ;
throwTypeErrorResult = next ;
throwTypeErrorResult = next ;
c4 = next . targetWidth / next . targetHeight ;
throwTypeErrorResult = globalThis ;
const _Math6 = Math ;
throwTypeErrorResult = next ;
throwTypeErrorResult = maxWidth ;
2026-08-24 06:08:38 +00:00
closure_5 = Math . min ( next . targetWidth , maxWidth ) ;
2026-08-04 21:03:28 +00:00
const _Math7 = Math ;
throwTypeErrorResult = next ;
throwTypeErrorResult = maxHeight ;
2026-08-24 06:08:38 +00:00
closure_6 = Math . min ( next . targetHeight , maxHeight ) ;
throwTypeErrorResult = closure_5 ;
2026-08-04 21:03:28 +00:00
throwTypeErrorResult = next ;
2026-08-24 06:08:38 +00:00
if ( closure_5 !== next . targetWidth ) {
2026-08-04 21:03:28 +00:00
const _Math = Math ;
2026-08-24 06:08:38 +00:00
closure_6 = Math . round ( closure_5 / c4 ) ;
2026-08-04 21:03:28 +00:00
}
if ( closure_6 !== next . targetHeight ) {
const _Math2 = Math ;
2026-08-24 06:08:38 +00:00
closure_5 = Math . round ( closure_6 * c4 ) ;
2026-08-04 21:03:28 +00:00
}
const blockSize = min . capabilities . blockSize ;
const widthAlignment = blockSize . widthAlignment ;
const heightAlignment = blockSize . heightAlignment ;
const _Math3 = Math ;
2026-08-24 06:08:38 +00:00
closure_5 = Math . floor ( closure_5 / widthAlignment ) * widthAlignment ;
2026-08-04 21:03:28 +00:00
const _Math4 = Math ;
closure_6 = Math . floor ( closure_6 / heightAlignment ) * heightAlignment ;
2026-08-24 06:08:38 +00:00
let tmp33 = closure_5 === next . targetWidth ;
2026-08-04 21:03:28 +00:00
if ( tmp33 ) {
tmp33 = closure_6 === next . targetHeight ;
}
if ( ! tmp33 ) {
next . targetWidth = iter8 ;
next . targetHeight = next ;
2026-08-24 06:08:38 +00:00
c1 = true ;
2026-07-29 08:29:29 +00:00
}
}
}
2026-08-04 21:03:28 +00:00
const _Error2 = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( "Invalid video dimensions: width or height is 0" ) ;
closure_1_1 ( error ) ;
2026-08-04 21:03:28 +00:00
c4 = 3 ;
const obj5 = { value : null , done : true } ;
obj5 [ 0 ] = { v : false } ;
return obj5 ;
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
const failures2 = closure_0 . failures ;
let message = failures2 . find ( ( ) = > { . . . } ) ;
2026-08-24 06:08:38 +00:00
capabilities = closure_0 . capabilities ;
2026-08-04 21:03:28 +00:00
if ( null != message ) {
throwTypeErrorResult = c1 ;
min = undefined ;
if ( capabilities != null ) {
const frameRate = capabilities . frameRate ;
if ( frameRate != null ) {
min = frameRate . min ;
}
}
if ( null != min ) {
throwTypeErrorResult = c1 ;
let max ;
if ( capabilities != null ) {
const frameRate2 = capabilities . frameRate ;
if ( frameRate2 != null ) {
max = frameRate2 . max ;
}
}
if ( null != max ) {
throwTypeErrorResult = c1 ;
throwTypeErrorResult = maxWidth ;
throwTypeErrorResult = next ;
let frameRate3 = next . frameRate ;
throwTypeErrorResult = message ;
message = message . message ;
throwTypeErrorResult = c1 ;
if ( message . includes ( "not supported at resolution" ) ) {
const items = [ 60 , 30 , 29.97 , 24 , 15 ] ;
const sorted = items . sort ( ( ) = > { . . . } ) ;
const found = sorted . find ( ( ) = > { . . . } ) ;
min = found ;
if ( found == null ) {
min = capabilities . frameRate . min ;
}
2026-08-24 06:08:38 +00:00
frameRate3 = min ;
2026-08-04 21:03:28 +00:00
} else {
const _Math5 = Math ;
frameRate3 = Math . min ( next . frameRate , capabilities . frameRate . max ) ;
}
2026-08-24 06:08:38 +00:00
if ( frameRate3 !== next . frameRate ) {
next . frameRate = frameRate3 ;
2026-08-04 21:03:28 +00:00
c1 = true ;
}
}
}
}
if ( c1 ) {
2026-08-24 06:08:38 +00:00
closure_7 = closure_7 + 1 ;
2026-08-04 21:03:28 +00:00
c4 = 3 ;
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-08-04 21:03:28 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj = { currentFailures : null , config : null , capabilities : null , attempt : null } ;
2026-08-04 21:03:28 +00:00
obj [ 0 ] = min . failures ;
obj [ 1 ] = next ;
obj [ 2 ] = min . capabilities ;
2026-08-24 06:08:38 +00:00
obj [ 3 ] = closure_7 + 1 ;
closure_3_20 . error ( "No adjustments possible for current failures" , obj ) ;
2026-08-04 21:03:28 +00:00
const _Error = Error ;
const error1 = new Error ( "No adjustments possible for current failures" ) ;
2026-08-24 06:08:38 +00:00
closure_1_1 ( error1 ) ;
2026-08-04 21:03:28 +00:00
c4 = 3 ;
const obj6 = { value : null , done : true } ;
obj6 [ 0 ] = { v : false } ;
return obj6 ;
}
2026-07-20 16:05:17 +00:00
}
}
}
}
}
2026-08-04 21:03:28 +00:00
throwTypeErrorResult = maxWidth ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_3_20 ;
2026-08-04 21:03:28 +00:00
const obj7 = { config : null , attempt : null } ;
throwTypeErrorResult = next ;
obj7 [ 0 ] = next ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_7 ;
obj7 [ 1 ] = closure_7 + 1 ;
throwTypeErrorResult = closure_3_20 . warn ( "Unable to determine device capabilities or adjust parameters" , obj7 ) ;
2026-08-04 21:03:28 +00:00
return 0 ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
let lib = _loop ;
if ( closure_1_7 < 4 ) {
2026-07-29 08:29:29 +00:00
const iter7 = _loop ( ) [ tmp75 . iterator ] ( ) ;
2026-08-24 06:08:38 +00:00
closure_7 = iter7 ;
2026-07-29 08:29:29 +00:00
HermesBuiltin . ensureObject ( "iterator is not an object" ) ;
let next = iter7 . next ;
v = undefined ;
const _loopResult = _loop ( ) ;
}
c13 = 3 ;
return { value : false , done : true } ;
}
} else {
if ( 1 !== tmp10 ) {
if ( 2 === tmp10 ) {
2026-08-24 06:08:38 +00:00
closure_10 = 0 ;
2026-07-29 08:29:29 +00:00
const method = HermesBuiltin . getMethod ( "throw" ) ;
if ( method === undefined ) {
const method1 = HermesBuiltin . getMethod ( "return" ) ;
if ( method1 !== undefined ) {
HermesBuiltin . ensureObject ( "iterator.return() did not return an object" ) ;
}
HermesBuiltin . throwTypeError ( ) ;
} else {
const iter3 = method ( tmp31 ) ;
HermesBuiltin . ensureObject ( "iterator.throw() did not return an object" ) ;
if ( iter3 . done ) {
2026-08-24 06:08:38 +00:00
lib = iter3 ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
c13 = 1 ;
return iter3 ;
}
}
2026-08-24 06:08:38 +00:00
let value = lib . value ;
2026-07-29 08:29:29 +00:00
v = value ;
if ( 0 !== value ) {
if ( 1 !== v ) {
if ( v ) {
c13 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = v . v ;
return obj1 ;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
if ( closure_1_7 < 4 ) {
const iter8 = lib ( ) [ tmp75 . iterator ] ( ) ;
2026-07-29 08:29:29 +00:00
HermesBuiltin . ensureObject ( "iterator is not an object" ) ;
next = iter8 . next ;
2026-08-24 06:08:38 +00:00
closure_2 = undefined ;
const tmp81 = lib ( ) ;
2026-07-29 08:29:29 +00:00
}
}
2026-08-24 06:08:38 +00:00
tmp31 = capabilities ;
2026-07-29 08:29:29 +00:00
} else {
if ( 3 !== tmp10 ) {
2026-08-24 06:08:38 +00:00
closure_10 = 0 ;
2026-07-29 08:29:29 +00:00
const method2 = HermesBuiltin . getMethod ( "throw" ) ;
if ( method2 === undefined ) {
const method3 = HermesBuiltin . getMethod ( "return" ) ;
if ( method3 !== undefined ) {
HermesBuiltin . ensureObject ( "iterator.return() did not return an object" ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
HermesBuiltin . throwTypeError ( ) ;
} else {
const iter = method2 ( tmp12 ) ;
HermesBuiltin . ensureObject ( "iterator.throw() did not return an object" ) ;
if ( iter . done ) {
let iter6 = iter ;
} else {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
c13 = 1 ;
return iter ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
value = iter6 . value ;
v = value ;
2026-08-24 06:08:38 +00:00
tmp12 = capabilities ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_10 = 2 ;
2026-07-29 08:29:29 +00:00
if ( arg0 === 1 ) {
c13 = 3 ;
throw arg1 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
closure_2 = arg1 ;
if ( arg0 === 2 ) {
closure_2 = arg1 ;
2026-08-24 06:08:38 +00:00
closure_10 = 0 ;
2026-07-29 08:29:29 +00:00
const method4 = HermesBuiltin . getMethod ( "return" ) ;
if ( method4 === undefined ) {
c13 = 3 ;
2026-08-04 21:03:28 +00:00
const obj2 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj2 [ 0 ] = arg1 ;
return obj2 ;
} else {
const iter2 = method4 ( closure_2 ) ;
HermesBuiltin . ensureObject ( "iterator.return() did not return an object" ) ;
if ( iter2 . done ) {
c13 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = iter2 . value ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
c13 = 1 ;
return iter2 ;
}
}
} else {
2026-08-24 06:08:38 +00:00
closure_10 = 0 ;
2026-07-29 08:29:29 +00:00
const tmp23 = arg1 ;
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
iter6 = next ( tmp23 ) ;
HermesBuiltin . ensureObject ( "iterator.next() did not return an object" ) ;
if ( ! iter6 . done ) {
2026-08-24 06:08:38 +00:00
closure_12 = 3 ;
2026-07-29 08:29:29 +00:00
c13 = 1 ;
return iter6 ;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
closure_10 = 1 ;
2026-07-29 08:29:29 +00:00
if ( arg0 === 1 ) {
c13 = 3 ;
throw arg1 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
v = arg1 ;
if ( arg0 === 2 ) {
v = arg1 ;
2026-08-24 06:08:38 +00:00
closure_10 = 0 ;
2026-07-29 08:29:29 +00:00
const method5 = HermesBuiltin . getMethod ( "return" ) ;
if ( method5 === undefined ) {
c13 = 3 ;
2026-08-04 21:03:28 +00:00
const obj3 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj3 [ 0 ] = arg1 ;
return obj3 ;
} else {
const iter4 = method5 ( v ) ;
HermesBuiltin . ensureObject ( "iterator.return() did not return an object" ) ;
if ( iter4 . done ) {
c13 = 3 ;
const obj4 = { value : null , done : true } ;
obj4 [ 0 ] = iter4 . value ;
return obj4 ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
c13 = 1 ;
return iter4 ;
2026-07-20 16:05:17 +00:00
}
}
} else {
2026-08-24 06:08:38 +00:00
closure_10 = 0 ;
2026-07-29 08:29:29 +00:00
const tmp42 = arg1 ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-24 06:08:38 +00:00
const iter5 = next ( tmp42 ) ;
2026-07-29 08:29:29 +00:00
HermesBuiltin . ensureObject ( "iterator.next() did not return an object" ) ;
2026-08-24 06:08:38 +00:00
lib = iter5 ;
2026-07-29 08:29:29 +00:00
if ( ! iter5 . done ) {
2026-08-24 06:08:38 +00:00
closure_12 = 1 ;
2026-07-29 08:29:29 +00:00
c13 = 1 ;
return iter5 ;
}
} catch ( tmp67 ) {
2026-08-24 06:08:38 +00:00
capabilities = tmp67 ;
if ( tmp5 === closure_10 ) {
2026-07-29 08:29:29 +00:00
c13 = tmp3 ;
throw tmp67 ;
} else if ( tmp2 === tmp69 ) {
2026-08-24 06:08:38 +00:00
closure_12 = tmp ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
closure_12 = tmp6 ;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
} ) ;
2026-08-24 06:08:38 +00:00
closure_2 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
function resolveWithConfig ( path ) {
2026-08-24 06:08:38 +00:00
return callback ( { path , encodingConfig : closure_1_6 } ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const promise = ( function findCompatibleConfig() {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _findCompatibleConfig . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
( function findCompatibleConfig() {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _findCompatibleConfig . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-23 10:11:24 +00:00
} ) ( ) . then ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
if ( arg0 ) {
2026-08-24 06:08:38 +00:00
obj1 = closure_2_0 ( closure_2_2 [ 13 ] ) ;
2026-07-29 08:29:29 +00:00
let isAndroidResult = obj1 . isAndroid ( ) ;
if ( isAndroidResult ) {
isAndroidResult = null != str3 . match ( /^content:\/\/.+$/i ) ;
}
if ( isAndroidResult ) {
2026-08-24 06:08:38 +00:00
obj = { encodingConfig : null , compressionQuality : null , isLowQuality : null , videoQuality : null , skipVideoTranscode : null } ;
obj [ 0 ] = closure_1_6 ;
2026-07-29 08:29:29 +00:00
obj [ 1 ] = resolveWithConfig ;
obj [ 2 ] = _findCompatibleConfig ;
2026-08-24 06:08:38 +00:00
obj [ 3 ] = closure_1_4 ;
obj [ 4 ] = closure_1_5 ;
let nextPromise = closure_2_27 ( "resolveToMediaFilePath" , str3 , obj ) . then ( resolveWithConfig , callback2 ) ;
const promise4 = closure_2_27 ( "resolveToMediaFilePath" , str3 , obj ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let tmp12Result = tmp12 ( tmp13 [ 13 ] ) ;
let isIOSResult = tmp12Result . isIOS ( ) ;
if ( ! isIOSResult ) {
if ( isIOSResult ) {
obj = { encodingConfig : null , videoQuality : null , isMov : true , skipVideoTranscode : null } ;
2026-08-24 06:08:38 +00:00
obj [ 0 ] = closure_1_6 ;
obj [ 1 ] = closure_1_4 ;
obj [ 3 ] = closure_1_5 ;
nextPromise = closure_2_27 ( "compressVideo" , str3 , obj ) . then ( resolveWithConfig , callback2 ) ;
const promise3 = closure_2_27 ( "compressVideo" , str3 , obj ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp12Result = tmp12 ( tmp13 [ 13 ] ) ;
const isIOSResult1 = tmp12Result . isIOS ( ) ;
if ( ! isIOSResult1 ) {
if ( isIOSResult1 ) {
obj1 = { encodingConfig : null , videoQuality : null , skipVideoTranscode : null } ;
2026-08-24 06:08:38 +00:00
obj1 [ 0 ] = closure_1_6 ;
obj1 [ 1 ] = closure_1_4 ;
obj1 [ 2 ] = closure_1_5 ;
nextPromise = closure_2_27 ( "compressVideo" , str3 , obj1 ) . then ( resolveWithConfig , callback2 ) ;
const promise2 = closure_2_27 ( "compressVideo" , str3 , obj1 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const formatted = str3 . toLowerCase ( ) ;
isIOSResult = tmp12 ( tmp13 [ 13 ] ) . isIOS ( ) ;
2026-07-20 16:05:17 +00:00
if ( isIOSResult ) {
2026-07-29 08:29:29 +00:00
isIOSResult = str3 . startsWith ( "file" ) ;
2026-07-20 16:05:17 +00:00
}
if ( isIOSResult ) {
let endsWithResult = formatted . endsWith ( "mov" ) ;
if ( ! endsWithResult ) {
endsWithResult = formatted . endsWith ( "mp4" ) ;
}
if ( ! endsWithResult ) {
endsWithResult = formatted . endsWith ( "qt" ) ;
}
isIOSResult = endsWithResult ;
}
if ( isIOSResult ) {
2026-07-29 08:29:29 +00:00
const obj2 = { encodingConfig : null , videoQuality : null , isMov : null , skipVideoTranscode : null } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_6 ;
obj2 [ 1 ] = closure_1_4 ;
2026-07-29 08:29:29 +00:00
const formatted1 = str3 . toLowerCase ( ) ;
2026-07-20 16:05:17 +00:00
let endsWithResult1 = formatted1 . endsWith ( "mov" ) ;
if ( ! endsWithResult1 ) {
2026-07-29 08:29:29 +00:00
const formatted2 = str3 . toLowerCase ( ) ;
2026-07-20 16:05:17 +00:00
endsWithResult1 = formatted2 . endsWith ( "qt" ) ;
}
2026-07-29 08:29:29 +00:00
obj2 [ 2 ] = endsWithResult1 ;
2026-08-24 06:08:38 +00:00
obj2 [ 3 ] = closure_1_5 ;
nextPromise = closure_2_27 ( "compressVideo" , str3 , obj2 ) . then ( resolveWithConfig , callback2 ) ;
const tmp36 = closure_2_27 ;
const tmp36Result = closure_2_27 ( "compressVideo" , str3 , obj2 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj3 = { uri : null , filename : null } ;
obj3 [ 0 ] = str3 ;
obj3 [ 1 ] = str4 ;
2026-08-24 06:08:38 +00:00
closure_2_20 . error ( "Unsupported video URI format" , obj3 ) ;
2026-07-20 16:05:17 +00:00
const _Error2 = Error ;
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
error = new Error ( "Unsupported video URI format: " + str3 ) ;
2026-07-29 08:29:29 +00:00
callback2 ( error ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp12Result1 = tmp12 ( tmp13 [ 13 ] ) ;
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
if ( tmp12Result2 . isPhotoKitAsset ( str3 , str4 ) ) {
2026-07-20 16:05:17 +00:00
let match ;
2026-07-29 08:29:29 +00:00
if ( str4 != null ) {
match = str4 . match ( /\.mp4$/i ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let isVideo2 = null != match ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
isVideo2 = null != str3 . match ( /^assets-library:\/\/.+&ext=mp4$/i ) ;
if ( isVideo2 ) {
2026-08-25 06:04:03 +00:00
const obj4 = { uri : null , overrideType : "a" } ;
2026-07-29 08:29:29 +00:00
obj4 [ 0 ] = str3 ;
isVideo2 = tmp12 ( tmp13 [ 11 ] ) . getFile ( obj4 ) . isVideo ;
const tmp12Result3 = tmp12 ( tmp13 [ 11 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp12Result2 = tmp12 ( tmp13 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
} else {
2026-07-29 08:29:29 +00:00
if ( tmp12Result4 . isPhotoKitAsset ( str3 , str4 ) ) {
2026-07-20 16:05:17 +00:00
let match1 ;
2026-07-29 08:29:29 +00:00
if ( str4 != null ) {
2026-07-20 16:05:17 +00:00
match1 = str4 . match ( /\.(mov|qt)$/i ) ;
}
2026-08-24 06:08:38 +00:00
isVideo = null != match1 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
isVideo = null != str3 . match ( /^assets-library:\/\/.+&ext=(mov|qt)$/i ) ;
if ( isVideo ) {
2026-08-25 06:04:03 +00:00
const obj5 = { uri : null , overrideType : "a" } ;
2026-07-29 08:29:29 +00:00
obj5 [ 0 ] = str3 ;
isVideo = tmp12 ( tmp13 [ 11 ] ) . getFile ( obj5 ) . isVideo ;
const tmp12Result5 = tmp12 ( tmp13 [ 11 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp12Result4 = tmp12 ( tmp13 [ 19 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
} else {
2026-07-29 08:29:29 +00:00
obj = { finalConfig : null , attempts : null } ;
2026-08-24 06:08:38 +00:00
obj [ 0 ] = closure_1_6 ;
obj [ 1 ] = closure_1_7 ;
closure_2_20 . error ( "Could not find compatible encoding configuration after multiple attempts" , obj ) ;
2026-07-20 16:05:17 +00:00
const _Error = Error ;
const error1 = new Error ( "Could not find compatible encoding configuration after multiple attempts" ) ;
2026-07-29 08:29:29 +00:00
callback2 ( error1 ) ;
2026-07-20 16:05:17 +00:00
}
} ) . catch ( arg1 ) ;
} ) ;
return promise ;
}
frameRate = videoMetadata . frameRate ;
}
function buildResolvedUpload ( arg0 ) {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _buildResolvedUpload . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _buildResolvedUpload() {
const self = this ;
const tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c2 = 0 ;
c3 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 ) {
if ( c3 === 2 ) {
c3 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
try {
c3 = 2 ;
if ( 0 === table ) {
if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c3 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
let filename = tmp2 ;
filename = undefined ;
table = undefined ;
c3 = undefined ;
( { path : obj7 [ 0 ] , i : obj7 [ 1 ] , mimeType : obj7 [ 2 ] , filename : obj7 [ 3 ] } = lib ) ;
const file = lib ( table [ 11 ] ) . getFile ( { uri : null , i : null , overrideType : null , overrideFilename : null } ) ;
filename = file . filename ;
2026-08-24 06:08:38 +00:00
table = closure_1_4 ( file , c3 ) ;
2026-07-29 08:29:29 +00:00
c3 = { } ;
2026-08-24 06:08:38 +00:00
isImage = lib . isImage ;
2026-07-29 08:29:29 +00:00
if ( isImage ) {
isImage = tmp35 . path !== tmp35 . originalUri ;
}
if ( isImage ) {
table = 1 ;
c3 = 1 ;
const obj2 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj2 [ 0 ] = closure_1_45 ( tmp35 . originalUri , tmp35 . path , tmp35 . filename , tmp35 . attachmentQualityMetricsEnabled , tmp35 . attachmentOriginDetectionEnabled ) ;
2026-07-29 08:29:29 +00:00
return obj2 ;
} else {
const obj3 = { } ;
const merged = Object . assign ( table ) ;
obj3 . name = filename ;
obj3 . spoiler = lib . spoiler ;
obj3 . description = lib . description ;
obj3 . imageCompressionQuality = lib . compressionQuality ;
obj3 . imageEncoderType = lib . imageEncoderType ;
obj3 . videoCompressionQuality = lib . videoQualitySetting ;
obj3 . videoMetadata = lib . videoMetadata ;
obj3 . encodingConfig = lib . encodingConfig ;
obj3 . sourceWidth = lib . sourceImageDimensions . width ;
obj3 . sourceHeight = lib . sourceImageDimensions . height ;
obj3 . uploadedImageWidth = lib . uploadedImageWidth ;
obj3 . uploadedImageHeight = lib . uploadedImageHeight ;
obj3 . psnr = c3 . psnr ;
obj3 . ssim = c3 . ssim ;
obj3 . origin = c3 . origin ;
obj3 . psnrMeasurementLatencyMs = c3 . psnrMeasurementLatencyMs ;
obj3 . ssimMeasurementLatencyMs = c3 . ssimMeasurementLatencyMs ;
c3 = 3 ;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = { uri : null , i : null , overrideType : null , overrideFilename : null } ;
2026-07-29 08:29:29 +00:00
const obj6 = lib ( table [ 11 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( arg0 === 1 ) {
c3 = 3 ;
throw arg1 ;
} else if ( arg0 !== 2 ) {
c3 = arg1 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
c3 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} catch ( tmp29 ) {
c3 = tmp ;
throw tmp29 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_36 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
}
function _processVideoUpload() {
let self = this ;
const tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c3 = 0 ;
c4 = 0 ;
2026-07-29 08:29:29 +00:00
const iter = ( function * ( arg0 ) {
2026-08-12 06:57:52 +00:00
if ( c4 === 2 ) {
c4 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-20 16:05:17 +00:00
}
2026-08-12 06:57:52 +00:00
} else {
try {
c4 = 2 ;
if ( 0 === c3 ) {
if ( arg0 === 1 ) {
c4 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
let table = tmp5 ;
c1 = tmp2 ;
let callback ;
c1 = undefined ;
table = undefined ;
c3 = undefined ;
c4 = undefined ;
c5 = undefined ;
c6 = undefined ;
( { originalUri : c0 , filename : c1 , mimeType : c2 , fileSize : c3 , spoiler : c4 , description : c5 , i : c6 } = callback ) ;
2026-08-24 06:08:38 +00:00
closure_7 = undefined ;
2026-08-12 06:57:52 +00:00
let dataSavingMode ;
2026-08-24 06:08:38 +00:00
closure_9 = undefined ;
closure_10 = undefined ;
2026-08-12 06:57:52 +00:00
let path ;
let encodingConfig ;
c3 = 1 ;
c4 = 1 ;
return { value : "ct" , done : true } ;
}
} else if ( 1 === tmp5 ) {
if ( arg0 === 1 ) {
c4 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-08-12 06:57:52 +00:00
obj1 [ 0 ] = arg1 ;
return obj1 ;
} else {
closure_7 = callback2 ( ) ;
dataSavingMode = closure_10 . dataSavingMode ;
if ( dataSavingMode ) {
dataSavingMode = path . getType ( ) === constants . CELLULAR ;
}
c3 = 2 ;
c4 = 1 ;
const obj2 = { value : null , done : false } ;
obj2 [ 0 ] = ( function fetchVideoMetadata ( c0 , c2 ) {
const self = this ;
const apply = closure_40 . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
} ) ( callback , table ) ;
return obj2 ;
}
} else if ( 2 === tmp5 ) {
if ( arg0 === 1 ) {
c4 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = arg1 ;
return obj3 ;
} else {
closure_9 = arg1 ;
if ( null == closure_9 ) {
const _Error3 = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( "Video metadata is required for video conversion" ) ;
2026-08-12 06:57:52 +00:00
throw error ;
} else {
if ( obj11 . getVideoFrameRateValidationExperimentConfig ( { location : "upload_utils.process_video_upload" } ) . enableFrameRateValidation ) {
if ( null != closure_9 . frameRate ) {
const _Number = Number ;
}
const _Error2 = Error ;
const _HermesInternal = HermesInternal ;
const error1 = new Error ( "Invalid video frame rate: " + closure_9 . frameRate ) ;
throw error1 ;
}
const obj4 = { uri : null , filename : null , isLowQuality : null , compressionQuality : null , videoQualitySetting : null , videoMetadata : null , fileSize : null } ;
obj4 [ 0 ] = callback ;
obj4 [ 1 ] = c1 ;
obj4 [ 2 ] = dataSavingMode ;
obj4 [ 3 ] = constants2 . LOW ;
obj4 [ 4 ] = closure_7 ;
obj4 [ 5 ] = closure_9 ;
obj4 [ 6 ] = c3 ;
c3 = 3 ;
c4 = 1 ;
const obj5 = { value : null , done : false } ;
obj5 [ 0 ] = callback3 ( obj4 ) ;
return obj5 ;
}
}
} else if ( arg0 === 1 ) {
c4 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 3 ;
const obj6 = { value : null , done : true } ;
obj6 [ 0 ] = arg1 ;
return obj6 ;
} else {
closure_10 = arg1 ;
path = closure_10 . path ;
encodingConfig = closure_10 . encodingConfig ;
if ( null == path ) {
const _Error = Error ;
const error2 = new Error ( "Failed to get video file path" ) ;
throw error2 ;
} else {
const obj7 = { path : null , i : null , mimeType : null , filename : null , originalUri : null , spoiler : null , description : null , compressionQuality : null , videoQualitySetting : null , videoMetadata : null , encodingConfig : null , sourceImageDimensions : null , isImage : false } ;
obj7 [ 0 ] = path ;
obj7 [ 1 ] = c6 ;
obj7 [ 2 ] = table ;
obj7 [ 3 ] = c1 ;
obj7 [ 4 ] = callback ;
obj7 [ 5 ] = c4 ;
obj7 [ 6 ] = c5 ;
obj7 [ 7 ] = constants2 . LOW ;
obj7 [ 8 ] = closure_7 ;
obj7 [ 9 ] = closure_9 ;
obj7 [ 10 ] = encodingConfig ;
obj7 [ 11 ] = { } ;
c4 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = callback4 ( obj7 ) ;
return obj ;
}
}
} catch ( tmp43 ) {
c4 = tmp ;
throw tmp43 ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
iter . next ( ) ;
return iter ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_37 = tmp ;
2026-07-29 08:29:29 +00:00
let apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _processImageOrFileUpload() {
let self = this ;
const tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c5 = 0 ;
c6 = 0 ;
2026-07-29 08:29:29 +00:00
const iter = ( function * ( arg0 ) {
2026-08-12 06:57:52 +00:00
if ( c6 === 2 ) {
c6 = 3 ;
let throwTypeErrorResult = HermesBuiltin . throwTypeError ( ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = arg1 ;
throwTypeErrorResult = arg0 ;
throwTypeErrorResult = tmp3 ;
if ( tmp4 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
} else {
try {
c6 = 2 ;
if ( 0 === c5 ) {
if ( arg0 === 1 ) {
c6 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
c4 = tmp5 ;
c3 = tmp2 ;
let lib ;
width = undefined ;
height = undefined ;
c3 = undefined ;
c4 = undefined ;
c5 = undefined ;
c6 = undefined ;
c7 = undefined ;
c8 = undefined ;
throwTypeErrorResult = lib ;
( { originalUri : c0 , filename : width , mimeType : height , spoiler : c3 , description : c4 , i : c5 , width : c6 , height : c7 , allowOptimization : c8 } = lib ) ;
2026-08-24 06:08:38 +00:00
c9 = undefined ;
c10 = undefined ;
c11 = undefined ;
c12 = undefined ;
obj3 = undefined ;
c14 = undefined ;
let _true ;
2026-08-12 06:57:52 +00:00
let constants ;
2026-08-24 06:08:38 +00:00
c17 = undefined ;
closure_18 = undefined ;
c19 = undefined ;
enableOriginDetection = undefined ;
c21 = undefined ;
c22 = undefined ;
c23 = undefined ;
2026-08-12 06:57:52 +00:00
let path ;
let encoderUsed ;
2026-08-24 06:08:38 +00:00
closure_26 = undefined ;
2026-08-12 06:57:52 +00:00
c5 = 1 ;
c6 = 1 ;
return { value : "ct" , done : true } ;
}
} else if ( 1 === tmp5 ) {
if ( arg0 === 1 ) {
c6 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-08-12 06:57:52 +00:00
obj1 [ 0 ] = arg1 ;
return obj1 ;
} else {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c4 ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = targetHeight ;
dataSavingMode = targetHeight . dataSavingMode ;
2026-08-12 06:57:52 +00:00
if ( dataSavingMode ) {
2026-08-24 06:08:38 +00:00
dataSavingMode = dataSavingMode . getType ( ) === _true . CELLULAR ;
2026-08-12 06:57:52 +00:00
}
2026-08-24 06:08:38 +00:00
closure_12 = callback ( lib , closure_1_2 ) ;
if ( closure_12 ) {
2026-08-12 06:57:52 +00:00
const obj2 = { width : null , height : null } ;
obj2 [ 0 ] = c6 ;
obj2 [ 1 ] = c7 ;
2026-08-24 06:08:38 +00:00
obj3 = obj2 ;
2026-08-12 06:57:52 +00:00
} else {
obj3 = { } ;
}
2026-08-24 06:08:38 +00:00
let LOW = constants . LOW ;
_true = false ;
let tmp51 = closure_12 ;
if ( closure_12 ) {
2026-08-12 06:57:52 +00:00
tmp51 = ! c11 ;
}
if ( tmp51 ) {
2026-08-24 06:08:38 +00:00
_true = lib ( height [ 24 ] ) . ADAPTIVE_COMPRESSION_CONFIG . useOriginalIfSmaller ;
2026-08-12 06:57:52 +00:00
let obj6 = lib ( height [ 24 ] ) ;
2026-08-24 06:08:38 +00:00
LOW = obj6 . getAdaptiveImageCompressionQuality ( obj3 , lib ( height [ 24 ] ) . ADAPTIVE_COMPRESSION_CONFIG ) ;
2026-08-12 06:57:52 +00:00
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
enableOriginDetection . log ( "Got image compression quality: " + LOW + " for " + lib + " with dimensions: " + c6 + "x" + closure_1_7 + " and useOriginalIfSmaller: " + _true ) ;
2026-08-12 06:57:52 +00:00
}
2026-08-24 06:08:38 +00:00
let obj7 = lib ( closure_1_2 [ 13 ] ) ;
2026-08-12 06:57:52 +00:00
let isIOSResult = obj7 . isIOS ( ) ;
if ( isIOSResult ) {
isIOSResult = lib . startsWith ( "ph://" ) ;
}
constants = isIOSResult ;
c17 = false ;
if ( c12 ) {
2026-08-24 06:08:38 +00:00
let obj8 = lib ( closure_1_2 [ 25 ] ) ;
2026-08-12 06:57:52 +00:00
closure_18 = obj8 . useMobileLosslessImageUploadV2Experiment ( { location : "upload_utils.process_image_upload" } ) ;
2026-08-24 06:08:38 +00:00
let obj9 = lib ( closure_1_2 [ 26 ] ) ;
enabled = obj9 . isDiscordFrontendDevelopment ( ) ;
2026-08-12 06:57:52 +00:00
if ( ! enabled ) {
2026-08-24 06:08:38 +00:00
enabled = closure_1_18 . enabled ;
2026-08-12 06:57:52 +00:00
}
}
2026-08-24 06:08:38 +00:00
enableQualityMetrics = false ;
enableOriginDetection = false ;
if ( closure_12 ) {
const AttachmentQualityMetricsExperiment = lib ( closure_1_2 [ 27 ] ) . AttachmentQualityMetricsExperiment ;
const config = AttachmentQualityMetricsExperiment . getConfig ( { location : "upload_utils.process_image_upload" } ) ;
enableQualityMetrics = config . enableQualityMetrics ;
enableOriginDetection = config . enableOriginDetection ;
2026-08-12 06:57:52 +00:00
}
2026-08-24 06:08:38 +00:00
useJpegliEncoder = false ;
let obj10 = lib ( closure_1_2 [ 13 ] ) ;
2026-08-12 06:57:52 +00:00
if ( obj10 . isIOS ( ) ) {
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_12 ;
if ( closure_12 ) {
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = c4 ;
throwTypeErrorResult = lib ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_2 ;
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = c3 ;
if ( obj12 . isDiscordFrontendDevelopment ( ) ) {
2026-08-24 06:08:38 +00:00
useJpegliEncoder = true ;
2026-08-12 06:57:52 +00:00
} else {
throwTypeErrorResult = c4 ;
throwTypeErrorResult = lib ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_2 ;
useJpegliEncoder = lib ( closure_1_2 [ 28 ] ) . getIosJpegliConfig ( { location : "upload_utils.process_image_upload" } ) . useJpegliEncoder ;
const obj13 = lib ( closure_1_2 [ 28 ] ) ;
2026-08-12 06:57:52 +00:00
}
throwTypeErrorResult = c3 ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = dataSavingMode ;
if ( ! dataSavingMode ) {
throwTypeErrorResult = obj3 ;
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = null ;
2026-08-24 06:08:38 +00:00
if ( null != obj3 . width ) {
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = c3 ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = obj3 ;
if ( null != obj3 . height ) {
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = c4 ;
throwTypeErrorResult = lib ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_2 ;
2026-08-12 06:57:52 +00:00
if ( obj21 . getMobileImageEncodingLadderConfig ( { location : "upload_utils.process_image_upload" } ) . useImageEncodingLadder ) {
throwTypeErrorResult = c3 ;
throwTypeErrorResult = c4 ;
throwTypeErrorResult = lib ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_2 ;
const ImageEncodingLadder = lib ( closure_1_2 [ 24 ] ) . ImageEncodingLadder ;
2026-08-12 06:57:52 +00:00
const obj4 = { width : null , height : null } ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = obj3 ;
obj4 [ 0 ] = obj3 . width ;
throwTypeErrorResult = obj3 ;
obj4 [ 1 ] = obj3 . height ;
closure_23 = ImageEncodingLadder . selectEncodingConfig ( obj4 ) ;
_true = true ;
throwTypeErrorResult = closure_23 ;
LOW = closure_23 . compressionQuality / 100 ;
throwTypeErrorResult = closure_23 ;
targetWidth = closure_23 . targetWidth ;
throwTypeErrorResult = closure_23 ;
targetHeight = closure_23 . targetHeight ;
2026-08-12 06:57:52 +00:00
}
2026-08-24 06:08:38 +00:00
obj21 = lib ( closure_1_2 [ 29 ] ) ;
2026-08-12 06:57:52 +00:00
}
}
}
2026-08-24 06:08:38 +00:00
obj12 = lib ( closure_1_2 [ 26 ] ) ;
2026-08-12 06:57:52 +00:00
}
}
throwTypeErrorResult = c3 ;
const obj5 = { uri : null , filename : null , isLowQuality : null , compressionQuality : null , mobileLosslessImageEnabled : null , useEnhancedConversion : null , useJpegliEncoder : null , allowOptimization : null , targetWidth : null , targetHeight : null } ;
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = lib ;
2026-08-12 06:57:52 +00:00
obj5 [ 0 ] = lib ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_1 ;
obj5 [ 1 ] = closure_1_1 ;
throwTypeErrorResult = dataSavingMode ;
obj5 [ 2 ] = dataSavingMode ;
throwTypeErrorResult = LOW ;
obj5 [ 3 ] = LOW ;
throwTypeErrorResult = enabled ;
obj5 [ 4 ] = enabled ;
throwTypeErrorResult = closure_1_16 ;
obj5 [ 5 ] = closure_1_16 ;
throwTypeErrorResult = useJpegliEncoder ;
obj5 [ 6 ] = useJpegliEncoder ;
throwTypeErrorResult = closure_1_8 ;
obj5 [ 7 ] = closure_1_8 ;
throwTypeErrorResult = targetWidth ;
obj5 [ 8 ] = targetWidth ;
throwTypeErrorResult = targetHeight ;
obj5 [ 9 ] = targetHeight ;
2026-08-12 06:57:52 +00:00
c5 = 2 ;
c6 = 1 ;
obj6 = { value : null , done : false } ;
obj6 [ 0 ] = ( function tryConvertImage ( arg0 ) {
const self = this ;
const apply = closure_39 . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
} ) ( obj5 ) ;
return obj6 ;
}
} else {
if ( 2 === tmp5 ) {
if ( arg0 === 1 ) {
c6 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 3 ;
obj7 = { value : null , done : true } ;
obj7 [ 0 ] = arg1 ;
return obj7 ;
} else {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c3 ;
2026-08-12 06:57:52 +00:00
closure_26 = arg1 ;
throwTypeErrorResult = closure_26 ;
throwTypeErrorResult = null ;
if ( null != closure_26 ) {
path = closure_26 . path ;
encoderUsed = closure_26 . encoderUsed ;
} else {
c5 = 3 ;
c6 = 1 ;
obj8 = { value : null , done : false } ;
obj8 [ 0 ] = ( function resolveFileUri ( c0 , c14 , c11 , c15 , c8 ) {
let flag = c8 ;
if ( c8 === undefined ) {
flag = true ;
}
let obj = _undefined ( height [ 13 ] ) ;
let isAndroidResult = obj . isAndroid ( ) ;
if ( isAndroidResult ) {
isAndroidResult = null != c0 . match ( /^content:\/\/.+$/i ) ;
}
if ( isAndroidResult ) {
obj = { compressionQuality : null , isLowQuality : null , skipVideoTranscode : true , useOriginalIfSmaller : null , allowOptimization : null } ;
obj [ 0 ] = c14 ;
obj [ 1 ] = c11 ;
obj [ 3 ] = c15 ;
obj [ 4 ] = flag ;
return callback ( "resolveToMediaFilePath" , c0 , obj ) ;
} else {
return Promise . resolve ( c0 ) ;
}
2026-08-24 06:08:38 +00:00
} ) ( lib , c14 , c11 , _true , c8 ) ;
2026-08-12 06:57:52 +00:00
return obj8 ;
}
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
} else if ( arg0 === 1 ) {
c6 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
path = arg1 ;
2026-08-04 21:03:28 +00:00
}
2026-08-24 06:08:38 +00:00
if ( null == closure_1_24 ) {
2026-08-12 06:57:52 +00:00
const _Error = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( "Failed to get image file path" ) ;
2026-08-12 06:57:52 +00:00
throw error ;
2026-07-29 08:29:29 +00:00
} else {
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = c3 ;
throwTypeErrorResult = c4 ;
obj9 = { path : null , i : null , mimeType : null , filename : null , originalUri : null , spoiler : null , description : null , compressionQuality : null , sourceImageDimensions : null , isImage : null , imageEncoderType : null , uploadedImageWidth : null , uploadedImageHeight : null , attachmentQualityMetricsEnabled : null , attachmentOriginDetectionEnabled : null } ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_24 ;
obj9 [ 0 ] = closure_1_24 ;
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = c5 ;
obj9 [ 1 ] = c5 ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_2 ;
obj9 [ 2 ] = closure_1_2 ;
throwTypeErrorResult = closure_1_1 ;
obj9 [ 3 ] = closure_1_1 ;
2026-08-12 06:57:52 +00:00
throwTypeErrorResult = lib ;
obj9 [ 4 ] = lib ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_3 ;
obj9 [ 5 ] = closure_1_3 ;
throwTypeErrorResult = closure_1_4 ;
obj9 [ 6 ] = closure_1_4 ;
throwTypeErrorResult = LOW ;
obj9 [ 7 ] = LOW ;
throwTypeErrorResult = obj3 ;
obj9 [ 8 ] = obj3 ;
throwTypeErrorResult = closure_12 ;
obj9 [ 9 ] = closure_12 ;
throwTypeErrorResult = closure_1_25 ;
obj9 [ 10 ] = closure_1_25 ;
2026-08-12 06:57:52 +00:00
let outputWidth ;
throwTypeErrorResult = closure_35 ;
2026-08-24 06:08:38 +00:00
if ( closure_1_26 != null ) {
outputWidth = closure_1_26 . outputWidth ;
2026-08-12 06:57:52 +00:00
}
width = outputWidth ;
if ( outputWidth == null ) {
2026-08-24 06:08:38 +00:00
width = obj3 . width ;
2026-08-12 06:57:52 +00:00
}
obj9 [ 11 ] = width ;
let outputHeight ;
if ( closure_26 != null ) {
outputHeight = closure_26 . outputHeight ;
}
height = outputHeight ;
if ( outputHeight == null ) {
2026-08-24 06:08:38 +00:00
height = obj3 . height ;
2026-08-12 06:57:52 +00:00
}
obj9 [ 12 ] = height ;
obj9 [ 13 ] = c19 ;
2026-08-24 06:08:38 +00:00
obj9 [ 14 ] = enableOriginDetection ;
2026-08-12 06:57:52 +00:00
c6 = 3 ;
obj10 = { value : null , done : true } ;
obj10 [ 0 ] = throwTypeErrorResult ( obj9 ) ;
return obj10 ;
2026-07-29 08:29:29 +00:00
}
2026-08-12 06:57:52 +00:00
}
} catch ( throwTypeErrorResult ) {
c6 = throwTypeErrorResult ;
throw throwTypeErrorResult ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
} ) ( ) ;
iter . next ( ) ;
return iter ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_38 = tmp ;
2026-07-29 08:29:29 +00:00
let apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
}
function _tryConvertImage() {
let self = this ;
const tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c7 = 0 ;
c8 = 0 ;
c5 = 0 ;
2026-07-29 08:29:29 +00:00
const iter = ( function * ( arg0 , path ) {
if ( c8 === 2 ) {
c8 = 3 ;
let throwTypeErrorResult = HermesBuiltin . throwTypeError ( ) ;
} else {
throwTypeErrorResult = path ;
throwTypeErrorResult = arg0 ;
throwTypeErrorResult = tmp5 ;
throwTypeErrorResult = null ;
throwTypeErrorResult = globalThis ;
if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw path ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = path ;
return obj ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c8 = 2 ;
if ( 0 === c7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = path ;
return obj ;
} else {
c4 = tmp2 ;
c3 = tmp7 ;
let lib ;
closure_1 = undefined ;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined ;
2026-07-29 08:29:29 +00:00
c3 = undefined ;
c4 = undefined ;
c5 = undefined ;
let MediaManager ;
c7 = undefined ;
c8 = undefined ;
c9 = undefined ;
throwTypeErrorResult = lib ;
( { uri : c0 , filename : closure_1 , isLowQuality : closure_2 , compressionQuality : c3 , mobileLosslessImageEnabled : c4 , useEnhancedConversion : c5 , useJpegliEncoder : c6 , allowOptimization : c7 , targetWidth : c8 , targetHeight : c9 } = lib ) ;
2026-08-24 06:08:38 +00:00
closure_10 = undefined ;
closure_11 = undefined ;
closure_12 = undefined ;
c13 = undefined ;
closure_14 = undefined ;
closure_15 = undefined ;
2026-07-29 08:29:29 +00:00
let encoderUsed ;
let outputWidth ;
let outputHeight ;
2026-08-24 06:08:38 +00:00
closure_19 = undefined ;
2026-07-29 08:29:29 +00:00
c7 = 1 ;
c8 = 1 ;
2026-08-12 06:57:52 +00:00
return { value : "ct" , done : true } ;
2026-07-29 08:29:29 +00:00
}
} else if ( 1 === tmp7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : true } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = path ;
return obj1 ;
} else {
throwTypeErrorResult = c3 ;
throwTypeErrorResult = closure_0 ;
c7 = 2 ;
c8 = 1 ;
const obj2 = { value : null , done : false } ;
obj2 [ 0 ] = ( function getPhotoKitDataUTI ( closure_0 ) {
const self = this ;
const apply = closure_30 . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
} ) ( closure_0 ) ;
return obj2 ;
}
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if ( 2 === tmp7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = path ;
return obj3 ;
} else {
throwTypeErrorResult = c3 ;
closure_10 = path ;
throwTypeErrorResult = lib ;
throwTypeErrorResult = c3 ;
if ( ( function shouldConvertBase64ToJPG ( c0 ) {
let isIOSResult = _undefined ( 500 ) . isIOS ( ) ;
if ( isIOSResult ) {
isIOSResult = null != c0 . match ( closure_21 ) ;
}
return isIOSResult ;
} ) ( lib ) ) {
throwTypeErrorResult = c4 ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_27 ;
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = lib ;
2026-08-24 06:08:38 +00:00
throwTypeErrorResult = closure_1_21 ;
2026-07-29 08:29:29 +00:00
const obj4 = { compressionQuality : null } ;
throwTypeErrorResult = c3 ;
obj4 [ 0 ] = c3 ;
c7 = 3 ;
c8 = 1 ;
const obj5 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj5 [ 0 ] = closure_1_27 ( "convertBase64ToJPEG" , lib . replace ( closure_1_21 , "" ) , obj4 ) ;
2026-07-29 08:29:29 +00:00
return obj5 ;
} else if ( ( function shouldConvertBase64ToGIF ( c0 ) {
let isIOSResult = _undefined ( 500 ) . isIOS ( ) ;
if ( isIOSResult ) {
isIOSResult = null != c0 . match ( closure_22 ) ;
}
return isIOSResult ;
} ) ( lib ) ) {
c7 = 4 ;
c8 = 1 ;
const obj6 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj6 [ 0 ] = closure_1_27 ( "convertBase64ToGIF" , lib . replace ( closure_1_22 , "" ) ) ;
2026-07-29 08:29:29 +00:00
return obj6 ;
} else if ( c4 ) {
c7 = 6 ;
c8 = 1 ;
const obj7 = { value : null , done : false } ;
obj7 [ 0 ] = ( function shouldConvertToPNG ( c0 , closure_1 ) {
const self = this ;
const apply = closure_31 . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
} ) ( lib , closure_1 ) ;
return obj7 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
} else if ( 3 === tmp7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
const obj8 = { value : null , done : true } ;
obj8 [ 0 ] = path ;
return obj8 ;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
closure_11 = path ;
2026-07-29 08:29:29 +00:00
let tmp51 = null ;
2026-08-24 06:08:38 +00:00
if ( closure_11 ) {
2026-07-29 08:29:29 +00:00
const obj9 = { path : null , encoderUsed : null } ;
2026-08-24 06:08:38 +00:00
obj9 [ 0 ] = closure_11 ;
2026-08-25 06:04:03 +00:00
obj9 [ 1 ] = lib ( 4632 ) . ImageEncoder . NATIVE ;
2026-07-29 08:29:29 +00:00
tmp51 = obj9 ;
}
c8 = 3 ;
const obj10 = { value : null , done : true } ;
obj10 [ 0 ] = tmp51 ;
return obj10 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( 4 === tmp7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
const obj11 = { value : null , done : true } ;
obj11 [ 0 ] = path ;
return obj11 ;
} else {
closure_12 = path ;
let tmp47 = null ;
if ( closure_12 ) {
const obj12 = { path : null } ;
obj12 [ 0 ] = closure_12 ;
tmp47 = obj12 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
c8 = 3 ;
const obj13 = { value : null , done : true } ;
obj13 [ 0 ] = tmp47 ;
return obj13 ;
}
} else if ( 5 === tmp7 ) {
c5 = 0 ;
const logger = MediaManager ;
const _HermesInternal = HermesInternal ;
logger . error ( "getLosslessImageData failed, falling through to JPEG conversion: " + logger ) ;
} else if ( 6 === tmp7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
const obj14 = { value : null , done : true } ;
obj14 [ 0 ] = path ;
return obj14 ;
} else if ( path ) {
c5 = 1 ;
dependencyMap = { } ;
MediaManager = MediaManager . MediaManager ;
c7 = 7 ;
c8 = 1 ;
const obj15 = { value : null , done : false } ;
obj15 [ 0 ] = MediaManager . getLosslessImageData ( lib ) ;
return obj15 ;
}
} else if ( 7 === tmp7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c5 = 0 ;
c8 = 3 ;
let obj16 = { value : null , done : true } ;
obj16 [ 0 ] = path ;
return obj16 ;
} else {
dependencyMap . path = path ;
2026-08-25 06:04:03 +00:00
dependencyMap . encoderUsed = lib ( 4632 ) . ImageEncoder . PASSTHROUGH ;
2026-07-29 08:29:29 +00:00
c5 = 0 ;
c8 = 3 ;
let obj17 = { value : null , done : true } ;
obj17 [ 0 ] = dependencyMap ;
return obj17 ;
}
} else if ( 8 === tmp7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
const obj18 = { value : null , done : true } ;
obj18 [ 0 ] = path ;
return obj18 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
throwTypeErrorResult = c3 ;
closure_14 = path ;
path = undefined ;
if ( closure_14 != null ) {
path = closure_14 . path ;
}
closure_1 = path ;
if ( path == null ) {
closure_1 = closure_14 ;
}
closure_15 = closure_1 ;
encoderUsed = undefined ;
if ( closure_14 != null ) {
encoderUsed = closure_14 . encoderUsed ;
}
outputWidth = undefined ;
if ( closure_14 != null ) {
outputWidth = closure_14 . outputWidth ;
}
outputHeight = undefined ;
if ( closure_14 != null ) {
outputHeight = closure_14 . outputHeight ;
}
let tmp24 = null ;
if ( closure_15 ) {
const obj19 = { path : null , encoderUsed : null , outputWidth : null , outputHeight : null } ;
obj19 [ 0 ] = closure_15 ;
obj19 [ 1 ] = encoderUsed ;
obj19 [ 2 ] = outputWidth ;
obj19 [ 3 ] = outputHeight ;
tmp24 = obj19 ;
}
c8 = 3 ;
const obj20 = { value : null , done : true } ;
obj20 [ 0 ] = tmp24 ;
return obj20 ;
}
} else if ( arg0 === 1 ) {
c8 = 3 ;
throw path ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
const obj21 = { value : null , done : true } ;
obj21 [ 0 ] = path ;
return obj21 ;
} else {
closure_19 = path ;
let tmp10 = null ;
if ( closure_19 ) {
obj = { path : null } ;
obj [ 0 ] = closure_19 ;
tmp10 = obj ;
}
c8 = 3 ;
const obj22 = { value : null , done : true } ;
obj22 [ 0 ] = tmp10 ;
return obj22 ;
}
2026-08-25 06:04:03 +00:00
obj16 = lib ( 4984 ) ;
2026-08-24 06:08:38 +00:00
closure_13 = obj16 . shouldForceConvertToJPG ( closure_0 , closure_1_1 , closure_1_10 ) ;
if ( ! closure_13 ) {
2026-08-25 06:04:03 +00:00
obj17 = lib ( 4984 ) ;
2026-08-24 06:08:38 +00:00
if ( ! obj17 . shouldConvertToJPG ( closure_0 , closure_1_1 , closure_1_2 , closure_1_4 , c7 ) ) {
if ( ( function shouldConvertToGifFilepath ( closure_0 , closure_1_1 ) {
2026-07-29 08:29:29 +00:00
const isIOSResult = _undefined ( 500 ) . isIOS ( ) ;
if ( ! isIOSResult ) {
return isIOSResult ;
} else {
2026-08-24 06:08:38 +00:00
if ( tmpResult . isPhotoKitAsset ( closure_0 , closure_1_1 ) ) {
2026-07-29 08:29:29 +00:00
let match ;
2026-08-24 06:08:38 +00:00
if ( closure_1_1 != null ) {
match = closure_1_1 . match ( /\.gif$/i ) ;
2026-07-29 08:29:29 +00:00
}
let tmp7 = null != match ;
} else {
tmp7 = null != closure_0 . match ( /^assets-library:\/\/.+&ext=gif$/i ) ;
}
2026-08-25 06:04:03 +00:00
tmpResult = _undefined ( 4984 ) ;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
} ) ( closure_0 , closure_1_1 ) ) {
2026-07-29 08:29:29 +00:00
c7 = 9 ;
c8 = 1 ;
const obj23 = { value : null , done : false } ;
obj23 [ 0 ] = callback ( "convertToGIFFilePath" , closure_0 ) ;
return obj23 ;
} else {
c8 = 3 ;
return { value : null , done : true } ;
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const obj24 = { compressionQuality : null , forceConvertToJPG : null , useEnhancedConversion : null , useJpegliEncoder : null , targetWidth : null , targetHeight : null } ;
obj24 [ 0 ] = c3 ;
obj24 [ 1 ] = c13 ;
obj24 [ 2 ] = c5 ;
obj24 [ 3 ] = MediaManager ;
obj24 [ 4 ] = c8 ;
obj24 [ 5 ] = c9 ;
c7 = 8 ;
c8 = 1 ;
const obj25 = { value : null , done : false } ;
2026-08-24 06:08:38 +00:00
obj25 [ 0 ] = closure_1_27 ( "convertToJPEG" , lib , obj24 ) ;
2026-07-29 08:29:29 +00:00
return obj25 ;
}
} catch ( throwTypeErrorResult ) {
MediaManager = throwTypeErrorResult ;
throwTypeErrorResult = c5 ;
if ( tmp3 === c5 ) {
c8 = throwTypeErrorResult ;
throw throwTypeErrorResult ;
} else {
c7 = tmp4 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
}
} ) ( ) ;
iter . next ( ) ;
return iter ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_39 = tmp ;
2026-07-29 08:29:29 +00:00
let apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
}
function _fetchVideoMetadata() {
const self = this ;
const tmp = callback ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
c7 = 0 ;
c8 = 0 ;
c6 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 , arg1 ) {
if ( c8 === 2 ) {
c8 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c8 = 2 ;
let warnResult = c7 ;
if ( 0 === c7 ) {
if ( arg0 === 1 ) {
c8 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c8 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_4 = tmp3 ;
closure_3 = warnResult ;
2026-07-29 08:29:29 +00:00
let rotationDegrees ;
2026-08-24 06:08:38 +00:00
warnResult = closure_1_32 ( closure_0 , rotationDegrees ) ;
2026-07-29 08:29:29 +00:00
if ( warnResult ) {
2026-08-24 06:08:38 +00:00
c6 = 1 ;
2026-07-29 08:29:29 +00:00
c7 = 2 ;
c8 = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
obj1 [ 0 ] = closure_1_27 ( "getVideoMetadata" , tmp20 ) ;
2026-07-29 08:29:29 +00:00
return obj1 ;
}
tmp20 = closure_0 ;
}
} else if ( 1 === warnResult ) {
c6 = 0 ;
2026-08-24 06:08:38 +00:00
c2 = closure_5 ;
2026-07-29 08:29:29 +00:00
const obj2 = { uri : null , error : null } ;
obj2 [ 0 ] = closure_0 ;
obj2 [ 1 ] = c2 ;
warnResult = logger . warn ( "Failed to fetch video metadata" , obj2 ) ;
} else if ( arg0 === 1 ) {
c8 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c6 = 0 ;
c8 = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = arg1 ;
return obj3 ;
} else {
rotationDegrees = arg1 ;
rotationDegrees = rotationDegrees . rotationDegrees ;
c2 = rotationDegrees ;
if ( rotationDegrees == null ) {
c2 = 0 ;
}
rotationDegrees . rotationDegrees = c2 ;
c6 = 0 ;
c8 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = rotationDegrees ;
return obj ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
c8 = 3 ;
} catch ( tmp24 ) {
2026-08-24 06:08:38 +00:00
closure_5 = tmp24 ;
2026-07-29 08:29:29 +00:00
if ( tmp4 === c6 ) {
c8 = tmp2 ;
throw tmp24 ;
} else {
c7 = tmp ;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_40 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
function getCaptionLabel ( type , isVideo , item ) {
if ( isVideo ) {
let str3 = "VIDEO" ;
if ( null != item . playableDuration ) {
2026-08-24 06:08:38 +00:00
str3 = getTimeFormat . getTimeFormat ( item . playableDuration ) ;
const obj = getTimeFormat ;
2026-07-20 16:05:17 +00:00
}
let str2 = str3 ;
} else {
str2 = null ;
if ( "image/gif" === type ) {
str2 = "GIF" ;
}
}
return str2 ;
}
2026-08-24 06:08:38 +00:00
function getImageDimensionsIfMissing ( closure_0 , closure_1_1 , closure_1_2 , c1 ) {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _getImageDimensionsIfMissing . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
}
function _getImageDimensionsIfMissing() {
const self = this ;
const tmp = callback ( ( arg0 , arg1 , arg2 , arg3 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_2 = arg2 ;
closure_3 = arg3 ;
c8 = 0 ;
c9 = 0 ;
c7 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 , arg1 , arg2 , arg3 ) {
if ( c9 === 2 ) {
c9 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp7 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c9 = 2 ;
if ( 0 === c8 ) {
if ( arg0 === 1 ) {
c9 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c9 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_5 = tmp3 ;
closure_4 = tmp5 ;
2026-07-29 08:29:29 +00:00
let file ;
let styles ;
2026-08-24 06:08:38 +00:00
obj1 = { width : null , height : null } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = obj1 ;
obj1 [ 1 ] = file ;
if ( null != obj1 ) {
if ( null != file ) {
c9 = 3 ;
const obj2 = { value : null , done : true } ;
obj2 [ 0 ] = obj1 ;
return obj2 ;
}
}
let obj4 = callback ( table [ 11 ] ) ;
const obj3 = { uri : null , overrideFilename : null } ;
obj3 [ 0 ] = callback ;
obj3 [ 1 ] = styles ;
file = obj4 . getFile ( obj3 ) ;
if ( ! file . isImage ) {
if ( ! file . isVideo ) {
c9 = 3 ;
obj4 = { value : null , done : true } ;
obj4 [ 0 ] = obj1 ;
return obj4 ;
}
}
2026-08-24 06:08:38 +00:00
c7 = 1 ;
2026-07-29 08:29:29 +00:00
c8 = 2 ;
c9 = 1 ;
const obj5 = { value : null , done : false } ;
obj5 [ 0 ] = ( function getImageDimensionByUri ( arg0 ) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
2026-07-29 08:29:29 +00:00
return new Promise ( ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
return closure_1_7 . getSize ( closure_0 , ( ) = > { . . . } , arg1 ) ;
2026-07-29 08:29:29 +00:00
} ) ;
} ) ( callback ) ;
return obj5 ;
}
} else if ( 1 === tmp8 ) {
c7 = 0 ;
2026-08-24 06:08:38 +00:00
closure_4 = DCDFileManager ;
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal ;
2026-08-24 06:08:38 +00:00
logger . warn ( "Unable to get width and height of media file: " + callback , closure_4 ) ;
2026-07-29 08:29:29 +00:00
c9 = 3 ;
const obj6 = { value : null , done : true } ;
obj6 [ 0 ] = obj1 ;
return obj6 ;
} else {
if ( 2 === tmp8 ) {
if ( arg0 === 1 ) {
c9 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c7 = 0 ;
c9 = 3 ;
const obj7 = { value : null , done : true } ;
obj7 [ 0 ] = arg1 ;
return obj7 ;
} else {
styles = arg1 ;
2026-08-24 06:08:38 +00:00
isVideo = callback ( file [ 13 ] ) . isIOS ( ) ;
2026-07-29 08:29:29 +00:00
if ( isVideo ) {
isVideo = file . isVideo ;
}
if ( isVideo ) {
isVideo = 0 === styles . width ;
}
if ( isVideo ) {
isVideo = 0 === styles . height ;
}
if ( isVideo ) {
DCDFileManager = DCDFileManager . DCDFileManager ;
c8 = 3 ;
c9 = 1 ;
const obj8 = { value : null , done : false } ;
obj8 [ 0 ] = DCDFileManager . getVideoDimensions ( callback ) ;
return obj8 ;
} else {
c7 = 0 ;
c9 = 3 ;
}
const obj12 = callback ( file [ 13 ] ) ;
}
} else if ( arg0 === 1 ) {
c9 = 3 ;
throw arg1 ;
} else if ( arg0 !== 2 ) {
styles = arg1 ;
}
c7 = 0 ;
c9 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
} catch ( tmp33 ) {
DCDFileManager = tmp33 ;
if ( tmp4 === c7 ) {
c9 = tmp2 ;
throw tmp33 ;
} else {
c8 = tmp ;
}
}
}
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_41 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
function isHEVCEncodingSupported() {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _isHEVCEncodingSupported . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _isHEVCEncodingSupported() {
const self = this ;
const tmp = callback ( function * ( ) {
if ( c5 === 2 ) {
c5 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2 ;
if ( 0 === c4 ) {
if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3 ;
closure_0 = tmp7 ;
c3 = 1 ;
const MediaManager = closure_1_6 . MediaManager ;
2026-07-29 08:29:29 +00:00
c4 = 2 ;
c5 = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = MediaManager . isHEVCEncodingSupported ( ) ;
return obj1 ;
}
} else if ( 1 === tmp7 ) {
c3 = 0 ;
closure_0 = closure_2 ;
logger . warn ( "Error checking HEVC support:" , closure_0 ) ;
c5 = 3 ;
return { value : false , done : true } ;
} else if ( arg0 === 1 ) {
c5 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c3 = 0 ;
c5 = 3 ;
const obj2 = { value : null , done : true } ;
obj2 [ 0 ] = arg1 ;
return obj2 ;
} else {
c3 = 0 ;
c5 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
} catch ( tmp16 ) {
closure_2 = tmp16 ;
if ( tmp4 === c3 ) {
c5 = tmp2 ;
throw tmp16 ;
} else {
c4 = tmp ;
}
}
}
} ) ;
2026-08-24 06:08:38 +00:00
closure_42 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
function checkVideoEncodingSupport ( arg0 ) {
2026-07-29 08:29:29 +00:00
const self = this ;
const apply = _checkVideoEncodingSupport . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function _checkVideoEncodingSupport() {
const self = this ;
const tmp = callback ( ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
c5 = 0 ;
c6 = 0 ;
c4 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 ) {
if ( MediaManager === 2 ) {
MediaManager = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp6 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
} else {
try {
MediaManager = 2 ;
if ( 0 === c5 ) {
if ( arg0 === 1 ) {
MediaManager = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
MediaManager = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-24 06:08:38 +00:00
closure_2 = tmp3 ;
closure_1 = tmp7 ;
c4 = 1 ;
2026-07-29 08:29:29 +00:00
MediaManager = MediaManager . MediaManager ;
( { targetWidth : obj7 [ 0 ] , targetHeight : obj7 [ 1 ] , frameRate : obj7 [ 2 ] , useHEVC : obj7 [ 3 ] } = closure_0 ) ;
c5 = 2 ;
MediaManager = 1 ;
const obj2 = { value : null , done : false } ;
obj2 [ 0 ] = MediaManager . isVideoEncodingSupported ( { width : null , height : null , frameRate : null , isHEVC : null } ) ;
return obj2 ;
}
} else if ( 1 === tmp7 ) {
c4 = 0 ;
closure_0 = closure_3 ;
logger . warn ( "Error checking video encoding support:" , closure_0 ) ;
MediaManager = 3 ;
const obj3 = { value : null , done : true } ;
obj3 [ 0 ] = { isSupported : true } ;
return obj3 ;
} else if ( arg0 === 1 ) {
MediaManager = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c4 = 0 ;
MediaManager = 3 ;
const obj4 = { value : null , done : true } ;
obj4 [ 0 ] = arg1 ;
return obj4 ;
} else {
c4 = 0 ;
MediaManager = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
} catch ( tmp15 ) {
closure_3 = tmp15 ;
if ( tmp4 === c4 ) {
MediaManager = tmp2 ;
throw tmp15 ;
} else {
c5 = tmp ;
}
}
}
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_44 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
}
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
function calculateImageQualityMetrics ( closure_0 , combined ) {
const self = this ;
const apply = _calculateImageQualityMetrics . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
}
function _calculateImageQualityMetrics() {
const self = this ;
const tmp = callback ( ( arg0 , arg1 , arg2 , arg3 , arg4 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_2 = arg3 ;
closure_3 = arg4 ;
c8 = 0 ;
c9 = 0 ;
c7 = 0 ;
2026-07-29 08:29:29 +00:00
return ( function * ( arg0 , arg1 , arg2 , arg3 , arg4 ) {
if ( c9 === 2 ) {
c9 = 3 ;
HermesBuiltin . throwTypeError ( ) ;
} else if ( tmp7 === 3 ) {
if ( arg0 === 1 ) {
throw arg1 ;
} else if ( arg0 === 2 ) {
let obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
} else {
2026-08-25 06:04:03 +00:00
return { value : "HermesInternal" , done : "HermesInternal" } ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
try {
c9 = 2 ;
if ( 0 === c8 ) {
if ( arg0 === 1 ) {
c9 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c9 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let MediaManager = tmp3 ;
let source = tmp5 ;
source = undefined ;
MediaManager = undefined ;
let combined ;
2026-08-24 06:08:38 +00:00
c7 = undefined ;
closure_3 = { } ;
2026-07-29 08:29:29 +00:00
if ( closure_3 ) {
c7 = 1 ;
MediaManager = lib ( 17 ) . NativeModules . MediaManager ;
c8 = 2 ;
c9 = 1 ;
2026-08-24 06:08:38 +00:00
obj1 = { value : null , done : false } ;
2026-07-29 08:29:29 +00:00
obj1 [ 0 ] = MediaManager . getMediaOrigin ( tmp76 ) ;
return obj1 ;
}
}
} else {
if ( 1 === tmp8 ) {
c7 = 0 ;
c8 = combined ;
logger . warn ( "Failed to detect media origin" , c8 ) ;
} else if ( 2 === tmp8 ) {
if ( arg0 === 1 ) {
c9 = 3 ;
throw arg1 ;
} else if ( arg0 === 2 ) {
c7 = 0 ;
c9 = 3 ;
const obj2 = { value : null , done : true } ;
obj2 [ 0 ] = arg1 ;
return obj2 ;
} else {
source = arg1 ;
closure_3 . origin = source . source ;
c7 = 0 ;
}
} else {
if ( 3 === tmp8 ) {
c7 = 0 ;
c9 = combined ;
logger . warn ( "Error in quality metrics calculation" , c9 ) ;
} else if ( arg0 === 1 ) {
c9 = 3 ;
throw arg1 ;
} else if ( arg0 !== 2 ) {
c7 = arg1 ;
closure_3 . psnr = c7 . psnr ;
closure_3 . ssim = c7 . ssim ;
closure_3 . psnrMeasurementLatencyMs = c7 . psnrCalculationTimeMs ;
closure_3 . ssimMeasurementLatencyMs = c7 . ssimCalculationTimeMs ;
const _HermesInternal3 = HermesInternal ;
logger . log ( "Quality metrics calculated: PSNR=" + c7 . psnr + "dB, SSIM=" + c7 . ssim ) ;
c7 = 0 ;
}
c7 = 0 ;
c9 = 3 ;
obj = { value : null , done : true } ;
obj [ 0 ] = arg1 ;
return obj ;
}
c9 = 3 ;
}
if ( dependencyMap ) {
c7 = 2 ;
MediaManager = lib ( 17 ) . NativeModules . MediaManager ;
combined = closure_1 ;
if ( closure_1 . includes ( "://" ) ) {
c8 = 4 ;
c9 = 1 ;
const obj3 = { value : null , done : false } ;
obj3 [ 0 ] = MediaManager . calculateImageQualityMetrics ( lib , combined ) ;
return obj3 ;
} else {
if ( ! closure_1 . includes ( "/" ) ) {
if ( ! closure_1 . includes ( "\\" ) ) {
const _HermesInternal = HermesInternal ;
if ( lib . startsWith ( "ph://" ) ) {
combined = concat ( tmp42 ) ;
} else {
combined = concat ( tmp42 ) ;
}
}
}
const _HermesInternal2 = HermesInternal ;
combined = "file://" + closure_1 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} catch ( tmp53 ) {
combined = tmp53 ;
if ( tmp4 === c7 ) {
c9 = tmp2 ;
throw tmp53 ;
} else if ( tmp === tmp55 ) {
c8 = tmp ;
} else {
c8 = tmp2 ;
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
} ) ( ) ;
} ) ;
2026-08-24 06:08:38 +00:00
closure_46 = tmp ;
2026-07-29 08:29:29 +00:00
const apply = tmp . apply ;
if ( typeof apply === "unknown" ) {
let applyArgumentsResult = HermesBuiltin . applyArguments ( self ) ;
} else {
applyArgumentsResult = apply ( self , arguments ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return applyArgumentsResult ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let closure_3 = [ "filename" ] ;
2026-07-29 08:29:29 +00:00
( { NativeModules : closure_6 , Image : error } = get_ActivityIndicator ) ;
2026-08-24 06:08:38 +00:00
( { VideoCompressionQuality : closure_8 , VideoQualitySettings : c9 } = CHANNEL_SIDEBAR_WIDTH ) ;
2026-07-29 08:29:29 +00:00
( { Base64PNGPrefix : map1 , Base64GIFPrefix } = ME ) ;
( { NetworkConnectionTypes : closure_15 , CompressionQuality : closure_16 , Base64WEBPPrefix : closure_17 , Base64AVIFPrefix : closure_18 , Base64JPEGPrefix } = ME ) ;
2026-08-24 06:08:38 +00:00
let closure_20 = new timestampDefault ( "UploadUtils.tsx" ) ;
2026-07-29 08:29:29 +00:00
const regExp = new RegExp ( "^" + Base64JPEGPrefix , "i" ) ;
2026-07-20 16:05:17 +00:00
const regExp1 = new RegExp ( "^" + Base64GIFPrefix , "i" ) ;
2026-07-23 10:11:24 +00:00
const Canceled = "Canceled" ;
2026-08-24 06:08:38 +00:00
let tmp5 = new timestampDefault ( "UploadUtils.tsx" ) ;
let result = require ( "set" ) . fileFinishedImporting ( "utils/native/UploadUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default { getFileInfo , isVideo , getType , openImagePickerUnhandled , openImagePicker , getCaptionLabel , getImageDimensionsIfMissing , isHEVCEncodingSupported , getAppDir } ;
export const base64JPEGRegex = regExp ;
export const base64GIFRegex = regExp1 ;
export { openImagePicker } ;
export { mediaManager } ;
export const getImageCompressionQuality = function getImageCompressionQuality() {
if ( closure_10 . dataSavingMode ) {
if ( store . getType ( ) === constants3 . CELLULAR ) {
let HIGH = constants4 . LOW ;
}
return HIGH ;
}
HIGH = constants4 . HIGH ;
} ;
export { getVideoQuality } ;
2026-07-29 08:29:29 +00:00
export const resolveModeToVideoQualityForUserWithFeature = function resolveModeToVideoQualityForUserWithFeature ( arg0 ) {
if ( constants2 . DATA_SAVER === arg0 ) {
return constants . LOW ;
} else if ( tmp . STANDARD === arg0 ) {
return constants . HIGH ;
} else if ( tmp . BEST === arg0 ) {
return constants . VERY_HIGH ;
} else {
return constants . MEDIUM ;
}
} ;
export const resolveModeToVideoQualityForFreeUser = function resolveModeToVideoQualityForFreeUser ( arg0 ) {
if ( constants2 . DATA_SAVER === arg0 ) {
return constants . LOW ;
} else if ( tmp . STANDARD === arg0 ) {
return constants . MEDIUM ;
} else if ( tmp . BEST === arg0 ) {
return constants . HIGH ;
} else {
return constants . LOW ;
}
} ;
export const cancelGetFileInfo = function cancelGetFileInfo ( closure_0 ) {
const item = closure_0 . item ;
2026-07-20 16:05:17 +00:00
return new Promise ( ( arg0 , arg1 ) = > {
if ( obj . isAndroid ( ) ) {
2026-08-24 06:08:38 +00:00
if ( item . platform === item ( closure_1_2 [ 17 ] ) . UploadPlatform . REACT_NATIVE ) {
closure_1_27 ( "cancelResolveToMediaFilePath" , item . uri ) . then ( arg0 , arg1 ) ;
const promise = closure_1_27 ( "cancelResolveToMediaFilePath" , item . uri ) ;
2026-07-20 16:05:17 +00:00
}
}
arg0 ( ) ;
} ) ;
} ;
export const getFileSize = function getFileSize ( uri ) {
let replaced = uri ;
if ( obj . isIOS ( ) ) {
replaced = uri . replace ( /file:\/\// , "" ) ;
}
2026-08-24 06:08:38 +00:00
obj = set ;
2026-07-29 08:29:29 +00:00
const tmp = require ;
if ( tmpResult . isAndroid ( ) ) {
2026-08-24 06:08:38 +00:00
if ( null == enforcingDefault ) {
2026-07-20 16:05:17 +00:00
let rejectResult = Promise . reject ( "RTNFileManager doesn't exist?" ) ;
} else {
2026-07-29 08:29:29 +00:00
rejectResult = tmp5 ( 1271 ) . getSize ( replaced ) ;
const tmp5Result = tmp5 ( 1271 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp5 = importDefault ;
2026-07-20 16:05:17 +00:00
} else {
const DCDFileManager = closure_6 . DCDFileManager ;
return DCDFileManager . getSize ( replaced ) ;
}
} ;
export { getAppDir } ;
export { getFileInfo } ;
2026-07-23 10:11:24 +00:00
export const shouldConvertToJPG = require ( "isPhotoKitAsset" ) . shouldConvertToJPG ;
export const shouldForceConvertToJPG = require ( "isPhotoKitAsset" ) . shouldForceConvertToJPG ;
2026-07-29 08:29:29 +00:00
export const shouldResolveToMediaFilePath = function shouldResolveToMediaFilePath ( str ) {
2026-08-24 06:08:38 +00:00
let isAndroidResult = set . isAndroid ( ) ;
2026-07-29 08:29:29 +00:00
if ( isAndroidResult ) {
isAndroidResult = null != str . match ( /^content:\/\/.+$/i ) ;
}
return isAndroidResult ;
} ;
2026-07-20 16:05:17 +00:00
export { isVideo } ;
export { isImage } ;
export { getType } ;
export { getCaptionLabel } ;
export { getImageDimensionsIfMissing } ;
export { isHEVCEncodingSupported } ;
export { checkVideoEncodingSupport } ;
export { calculateImageQualityMetrics } ;
export const getFileFromUploadItem = function getFileFromUploadItem ( result1 ) {
2026-08-24 06:08:38 +00:00
let obj = items2 ;
2026-07-20 16:05:17 +00:00
obj = { uri : result1.uri , overrideFilename : result1.filename , overrideType : result1.mimeType } ;
return obj . getFile ( obj ) ;
} ;