2026-07-20 16:05:17 +00:00
// Module ID: 1589
2026-07-23 10:11:24 +00:00
// Function ID: 17733
2026-07-20 16:05:17 +00:00
// Name: runWorkletOnJS
2026-07-23 10:11:24 +00:00
// Dependencies: [65, 57, 1585, 1590, 1612, 1607]
2026-07-20 16:05:17 +00:00
// Exports: executeOnUIRuntimeSync
// Module 1589 (runWorkletOnJS)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray" ;
import _slicedToArray from "_slicedToArray" ;
import isJest from "isJest" ;
import isJest from "isJest" ;
const require = arg1 ;
2026-07-20 16:05:17 +00:00
function runWorkletOnJS ( apply ) {
const length = arguments . length ;
let num = 0 ;
if ( length > 1 ) {
num = length - 1 ;
}
const array = new Array ( num ) ;
for ( let num2 = 1 ; num2 < length ; num2 = num2 + 1 ) {
array [ num2 - 1 ] = arguments [ num2 ] ;
}
apply . apply ( undefined , array ) ;
}
2026-07-23 10:11:24 +00:00
isJest = isJest . isJest ( ) ;
isJest = isJest . shouldBeUseWeb ( ) ;
2026-07-20 16:05:17 +00:00
let closure _7 = [ ] ;
let closure _8 = { code : "function setupMicrotasks_Pnpm_threadsTs1(){let microtasksQueue=[];let isExecutingMicrotasksQueue=false;global.queueMicrotask=function(callback){microtasksQueue.push(callback);};global.__callMicrotasks=function(){if(isExecutingMicrotasksQueue){return;}try{isExecutingMicrotasksQueue=true;for(let index=0;index<microtasksQueue.length;index+=1){microtasksQueue[index]();}microtasksQueue=[];global._maybeFlushUIUpdatesQueue();}finally{isExecutingMicrotasksQueue=false;}};}" } ;
let closure _9 = { code : "function callMicrotasksOnUIThread_Pnpm_threadsTs2(){global.__callMicrotasks();}" } ;
2026-07-23 10:11:24 +00:00
let fn = ( ( ) => {
2026-07-20 16:05:17 +00:00
function callMicrotasksOnUIThread ( ) {
2026-07-23 10:11:24 +00:00
outer1 _0 . _ _callMicrotasks ( ) ;
2026-07-20 16:05:17 +00:00
}
callMicrotasksOnUIThread . _ _closure = { } ;
callMicrotasksOnUIThread . _ _workletHash = 741957556389 ;
callMicrotasksOnUIThread . _ _initData = closure _9 ;
return callMicrotasksOnUIThread ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
if ( isJest ) {
2026-07-20 16:05:17 +00:00
fn = ( ) => {
} ;
}
let closure _11 = { code : "function runOnUI_Pnpm_threadsTs3(worklet){const{__DEV__,SHOULD_BE_USE_WEB,isWorkletFunction,IS_JEST,ReanimatedModule,makeShareableCloneRecursive,callMicrotasks}=this.__closure;if(__DEV__&&!SHOULD_BE_USE_WEB&&_WORKLET){throw new ReanimatedError('`runOnUI` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.');}if(__DEV__&&!SHOULD_BE_USE_WEB&&!isWorkletFunction(worklet)){throw new ReanimatedError('`runOnUI` can only be used with worklets.');}return function(...args){if(IS_JEST){ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';worklet(...args);}));return;}if(__DEV__){makeShareableCloneRecursive(worklet);makeShareableCloneRecursive(args);}_runOnUIQueue.push([worklet,args]);if(_runOnUIQueue.length===1){queueMicrotask(function(){const queue=_runOnUIQueue;_runOnUIQueue=[];ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';queue.forEach(function([worklet,args]){worklet(...args);});callMicrotasks();}));});}};}" } ;
let closure _12 = { code : "function pnpm_threadsTs4(){const{worklet,args}=this.__closure;worklet(...args);}" } ;
let closure _13 = { code : "function pnpm_threadsTs5(){const{queue,callMicrotasks}=this.__closure;queue.forEach(function([worklet,args]){worklet(...args);});callMicrotasks();}" } ;
let closure _14 = { code : "function pnpm_threadsTs6(){const{worklet,args,makeShareableCloneOnUIRecursive}=this.__closure;const result=worklet(...args);return makeShareableCloneOnUIRecursive(result);}" } ;
let closure _15 = { code : "function runOnUIImmediately_Pnpm_threadsTs7(worklet){const{__DEV__,SHOULD_BE_USE_WEB,isWorkletFunction,ReanimatedModule,makeShareableCloneRecursive}=this.__closure;if(__DEV__&&!SHOULD_BE_USE_WEB&&_WORKLET){throw new ReanimatedError('`runOnUIImmediately` cannot be called on the UI runtime. Please call the function synchronously or use `queueMicrotask` or `requestAnimationFrame` instead.');}if(__DEV__&&!SHOULD_BE_USE_WEB&&!isWorkletFunction(worklet)){throw new ReanimatedError('`runOnUIImmediately` can only be used with worklets.');}return function(...args){ReanimatedModule.scheduleOnUI(makeShareableCloneRecursive(function(){'worklet';worklet(...args);}));};}" } ;
let closure _16 = { code : "function pnpm_threadsTs8(){const{worklet,args}=this.__closure;worklet(...args);}" } ;
2026-07-23 10:11:24 +00:00
let tmp3 = ( ( ) => {
export function setupMicrotasks ( ) {
2026-07-20 16:05:17 +00:00
let closure _0 = [ ] ;
2026-07-23 10:11:24 +00:00
let c1 = false ;
outer1 _0 . queueMicrotask = ( arg0 ) => {
2026-07-20 16:05:17 +00:00
} ;
2026-07-23 10:11:24 +00:00
outer1 _0 . _ _callMicrotasks = ( ) => {
2026-07-20 16:05:17 +00:00
let length ;
let sum ;
2026-07-23 10:11:24 +00:00
if ( ! c1 ) {
c1 = true ;
2026-07-20 16:05:17 +00:00
let num2 = 0 ;
if ( 0 < arr . length ) {
do {
2026-07-23 10:11:24 +00:00
let tmp2 = arr ;
2026-07-20 16:05:17 +00:00
let tmp3 = num2 ;
2026-07-23 10:11:24 +00:00
let tmp4 = arr [ num2 ] ( ) ;
2026-07-20 16:05:17 +00:00
sum = num2 + 1 ;
num2 = sum ;
2026-07-23 10:11:24 +00:00
let tmp6 = arr ;
length = arr . length ;
2026-07-20 16:05:17 +00:00
} while ( sum < length ) ;
}
2026-07-23 10:11:24 +00:00
arr = [ ] ;
const result = outer2 _0 . _maybeFlushUIUpdatesQueue ( ) ;
c1 = false ;
2026-07-20 16:05:17 +00:00
}
} ;
}
setupMicrotasks . _ _closure = { } ;
setupMicrotasks . _ _workletHash = 2487728156345 ;
setupMicrotasks . _ _initData = closure _8 ;
return setupMicrotasks ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
function runOnJS ( _ _remoteFunction ) {
2026-07-23 10:11:24 +00:00
if ( ! isJest ) {
2026-07-20 16:05:17 +00:00
if ( globalThis . _WORKLET ) {
if ( obj . isWorkletFunction ( _ _remoteFunction ) ) {
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
const items = [ _ _remoteFunction ] ;
2026-07-23 10:11:24 +00:00
return outer1 _17 ( outer1 _18 ) . apply ( undefined , items . concat ( array ) ) ;
2026-07-20 16:05:17 +00:00
} ;
} else {
let tmp4 = _ _remoteFunction ;
if ( _ _remoteFunction . _ _remoteFunction ) {
_ _remoteFunction = _ _remoteFunction . _ _remoteFunction ;
tmp4 = _ _remoteFunction ;
}
if ( "function" === typeof tmp4 ) {
2026-07-23 10:11:24 +00:00
let _scheduleRemoteFunctionOnJS = _ _remoteFunction . _scheduleHostFunctionOnJS ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
_scheduleRemoteFunctionOnJS = _ _remoteFunction . _scheduleRemoteFunctionOnJS ;
2026-07-20 16:05:17 +00:00
}
return ( ) => {
const length = arguments . length ;
const arr = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
arr [ num ] = arguments [ num ] ;
}
let shareableCloneOnUIRecursive ;
if ( arr . length > 0 ) {
2026-07-23 10:11:24 +00:00
shareableCloneOnUIRecursive = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 4 ] ) . makeShareableCloneOnUIRecursive ( arr ) ;
const obj = _scheduleRemoteFunctionOnJS ( outer1 _2 [ 4 ] ) ;
2026-07-20 16:05:17 +00:00
}
_scheduleRemoteFunctionOnJS ( _ _remoteFunction , shareableCloneOnUIRecursive ) ;
} ;
}
2026-07-23 10:11:24 +00:00
obj = _scheduleRemoteFunctionOnJS ( 1607 ) ;
2026-07-20 16:05:17 +00:00
}
}
return ( ) => {
const length = arguments . length ;
const arr = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
arr [ num ] = arguments [ num ] ;
}
2026-07-23 10:11:24 +00:00
return queueMicrotask ( arr . length ? ( ( ) => arr . apply ( undefined , arr ) ) : arr ) ;
2026-07-20 16:05:17 +00:00
} ;
}
2026-07-23 10:11:24 +00:00
isJest = { SHOULD _BE _USE _WEB : isJest } ;
let tmp4 = ( ( ) => {
export function runOnUI ( fn ) {
let closure _0 = fn ;
2026-07-20 16:05:17 +00:00
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
2026-07-23 10:11:24 +00:00
if ( outer2 _5 ) {
let ReanimatedModule = outer2 _1 ( outer2 _2 [ 3 ] ) . ReanimatedModule ;
let obj = outer2 _1 ( outer2 _2 [ 4 ] ) ;
2026-07-20 16:05:17 +00:00
/* worklet (recovered source) */ function pnpm _threadsTs4 ( ) { const { worklet , args } = this . _ _closure ; worklet ( ... args ) ; }
2026-07-23 10:11:24 +00:00
obj = { worklet : array , args : array } ;
2026-07-20 16:05:17 +00:00
pnpm _threadsTs4 . _ _closure = obj ;
pnpm _threadsTs4 . _ _workletHash = 10268384484340 ;
2026-07-23 10:11:24 +00:00
pnpm _threadsTs4 . _ _initData = outer2 _12 ;
2026-07-20 16:05:17 +00:00
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( pnpm _threadsTs4 ) ) ;
} else {
2026-07-23 10:11:24 +00:00
const items = [ array , array ] ;
outer2 _7 . push ( items ) ;
if ( 1 === outer2 _7 . length ) {
2026-07-20 16:05:17 +00:00
const _queueMicrotask = queueMicrotask ;
queueMicrotask ( ( ) => {
2026-07-23 10:11:24 +00:00
let closure _0 = outer3 _7 ;
outer3 _7 = [ ] ;
const ReanimatedModule = outer3 _1 ( outer3 _2 [ 3 ] ) . ReanimatedModule ;
let obj = outer3 _1 ( outer3 _2 [ 4 ] ) ;
2026-07-20 16:05:17 +00:00
/* worklet (recovered source) */ function pnpm _threadsTs5 ( ) { const { queue , callMicrotasks } = this . _ _closure ; queue . forEach ( function ( [ worklet , args ] ) { worklet ( ... args ) ; } ) ; callMicrotasks ( ) ; }
2026-07-23 10:11:24 +00:00
obj = { queue : outer3 _7 , callMicrotasks : outer3 _10 } ;
2026-07-20 16:05:17 +00:00
pnpm _threadsTs5 . _ _closure = obj ;
pnpm _threadsTs5 . _ _workletHash = 2773761092576 ;
2026-07-23 10:11:24 +00:00
pnpm _threadsTs5 . _ _initData = outer3 _13 ;
2026-07-20 16:05:17 +00:00
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( pnpm _threadsTs5 ) ) ;
} ) ;
}
}
} ;
}
2026-07-23 10:11:24 +00:00
runOnUI . _ _closure = { _ _DEV _ _ : false , SHOULD _BE _USE _WEB : isJest , isWorkletFunction : require ( 1607 ) /* isWorkletFunction */ . isWorkletFunction , IS _JEST : isJest , ReanimatedModule : require ( 1590 ) /* ReanimatedModule */ . ReanimatedModule , makeShareableCloneRecursive : require ( 1612 ) /* isPlainJSObject */ . makeShareableCloneRecursive , callMicrotasks : fn } ;
2026-07-20 16:05:17 +00:00
runOnUI . _ _workletHash = 8710271011487 ;
runOnUI . _ _initData = closure _11 ;
return runOnUI ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
isJest . isWorkletFunction = require ( "isWorkletFunction" ) . isWorkletFunction ;
isJest . runWorkletOnJS = runWorkletOnJS ;
isJest . makeShareableCloneOnUIRecursive = require ( "isPlainJSObject" ) . makeShareableCloneOnUIRecursive ;
runOnJS . _ _closure = isJest ;
2026-07-20 16:05:17 +00:00
runOnJS . _ _workletHash = 4576792393858 ;
runOnJS . _ _initData = { code : "function runOnJS_Pnpm_threadsTs9(fun){const runOnJS_Pnpm_threadsTs9=this._recur;const{SHOULD_BE_USE_WEB,isWorkletFunction,runWorkletOnJS,makeShareableCloneOnUIRecursive}=this.__closure;if(SHOULD_BE_USE_WEB||!_WORKLET){return function(...args){return queueMicrotask(args.length?function(){return fun(...args);}:fun);};}if(isWorkletFunction(fun)){return function(...args){return runOnJS_Pnpm_threadsTs9(runWorkletOnJS)(fun,...args);};}if(fun.__remoteFunction){fun=fun.__remoteFunction;}const scheduleOnJS=typeof fun==='function'?global._scheduleHostFunctionOnJS:global._scheduleRemoteFunctionOnJS;return function(...args){scheduleOnJS(fun,args.length>0?makeShareableCloneOnUIRecursive(args):undefined);};}" } ;
export const callMicrotasks = fn ;
export function executeOnUIRuntimeSync ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure _0 = arg0 ;
2026-07-20 16:05:17 +00:00
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
2026-07-23 10:11:24 +00:00
const ReanimatedModule = outer1 _1 ( outer1 _2 [ 3 ] ) . ReanimatedModule ;
let obj = outer1 _1 ( outer1 _2 [ 4 ] ) ;
2026-07-20 16:05:17 +00:00
/* worklet (recovered source) */ function pnpm _threadsTs6 ( ) { const { worklet , args , makeShareableCloneOnUIRecursive } = this . _ _closure ; const result = worklet ( ... args ) ; return makeShareableCloneOnUIRecursive ( result ) ; }
2026-07-23 10:11:24 +00:00
obj = { worklet : array , args : array , makeShareableCloneOnUIRecursive : outer1 _1 ( outer1 _2 [ 4 ] ) . makeShareableCloneOnUIRecursive } ;
2026-07-20 16:05:17 +00:00
pnpm _threadsTs6 . _ _closure = obj ;
pnpm _threadsTs6 . _ _workletHash = 6038069575410 ;
2026-07-23 10:11:24 +00:00
pnpm _threadsTs6 . _ _initData = outer1 _14 ;
2026-07-20 16:05:17 +00:00
return ReanimatedModule . executeOnUIRuntimeSync ( obj . makeShareableCloneRecursive ( pnpm _threadsTs6 ) ) ;
} ;
}
2026-07-23 10:11:24 +00:00
export const runOnUIImmediately = ( ( ) => {
2026-07-20 16:05:17 +00:00
function runOnUIImmediately ( pnpm _FrameCallbackRegistryUITs1 ) {
2026-07-23 10:11:24 +00:00
let closure _0 = pnpm _FrameCallbackRegistryUITs1 ;
2026-07-20 16:05:17 +00:00
return ( ) => {
const length = arguments . length ;
const array = new Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
array [ num ] = arguments [ num ] ;
}
2026-07-23 10:11:24 +00:00
const ReanimatedModule = outer2 _1 ( outer2 _2 [ 3 ] ) . ReanimatedModule ;
let obj = outer2 _1 ( outer2 _2 [ 4 ] ) ;
2026-07-20 16:05:17 +00:00
/* worklet (recovered source) */ function pnpm _threadsTs8 ( ) { const { worklet , args } = this . _ _closure ; worklet ( ... args ) ; }
2026-07-23 10:11:24 +00:00
obj = { worklet : array , args : array } ;
2026-07-20 16:05:17 +00:00
pnpm _threadsTs8 . _ _closure = obj ;
pnpm _threadsTs8 . _ _workletHash = 6969436050040 ;
2026-07-23 10:11:24 +00:00
pnpm _threadsTs8 . _ _initData = outer2 _16 ;
2026-07-20 16:05:17 +00:00
ReanimatedModule . scheduleOnUI ( obj . makeShareableCloneRecursive ( pnpm _threadsTs8 ) ) ;
} ;
}
2026-07-23 10:11:24 +00:00
runOnUIImmediately . _ _closure = { _ _DEV _ _ : false , SHOULD _BE _USE _WEB : isJest , isWorkletFunction : require ( 1607 ) /* isWorkletFunction */ . isWorkletFunction , ReanimatedModule : require ( 1590 ) /* ReanimatedModule */ . ReanimatedModule , makeShareableCloneRecursive : require ( 1612 ) /* isPlainJSObject */ . makeShareableCloneRecursive } ;
2026-07-20 16:05:17 +00:00
runOnUIImmediately . _ _workletHash = 3385146413149 ;
runOnUIImmediately . _ _initData = closure _15 ;
return runOnUIImmediately ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
2026-07-20 16:05:17 +00:00
export { runOnJS } ;