/* Metro module 7738; source: modules/video_calls/native/useDraggablePip.tsx; dependencies: [57, 7715, 7722, 4017, 4504, 1305, 7739, 5321, 4577, 2] */ function _fun61935(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7916:6, offset: 0x01b4ef5b, size: 453 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(57) /* metro dependency 57 */; const env0_3 = (require(7715) /* metro dependency 7715: ChannelCallStore */).useChannelCallStore; const constantsModule = require(7722) /* metro dependency 7722: Constants */; const env0_4 = constantsModule.PIP_FOCUS_SCALE; const env0_5 = constantsModule.PIP_GESTURE_ACTIVE_OFFSET; const env0_6 = {'mass': 1, 'stiffness': 250, 'overshootClamping': true, 'restSpeedThreshold': 0.001, 'restDisplacementThreshold': 0.001, 'damping': 20}; object = {code: 'function useDraggablePipTsx1(){const{withTiming,pipFocus,PIP_FOCUS_SCALE,STANDARD_EASING}=this.__closure;return withTiming(pipFocus?PIP_FOCUS_SCALE:1,{easing:STANDARD_EASING,duration:250});}'}; object = {code: 'function useDraggablePipTsx2(){const{width}=this.__closure;return width;}'}; object = {code: 'function useDraggablePipTsx3(){const{height}=this.__closure;return height;}'}; object = {code: 'function useDraggablePipTsx4(){const{pipScale,width}=this.__closure;return pipScale.get()*width;}'}; object = {code: 'function useDraggablePipTsx5(){const{pipScale,height}=this.__closure;return pipScale.get()*height;}'}; object = {code: 'function useDraggablePipTsx6(){const{containerWidth}=this.__closure;return containerWidth;}'}; object = {code: 'function useDraggablePipTsx7(){const{containerHeight}=this.__closure;return containerHeight;}'}; object = {code: 'function useDraggablePipTsx8(){const{containerWidth,scaledWidthDv,xPosition}=this.__closure;return[containerWidth-scaledWidthDv.get(),xPosition.get()];}'}; object = {code: 'function useDraggablePipTsx9(result,previous){const{cheapWorkletArrayShallowEqual,clamp,xPosition,xDestination}=this.__closure;if(cheapWorkletArrayShallowEqual(result,previous!==null&&previous!==void 0?previous:undefined))return;const[containerWidthNew,xPositionNew]=result;const[containerWidthOld]=previous!==null&&previous!==void 0?previous:[0,0];if(previous!=null&&containerWidthNew!==containerWidthOld){const newX=clamp(xPositionNew*(containerWidthNew/containerWidthOld),0,containerWidthNew);xPosition.set(newX);xDestination.set(newX);}}'}; object = {code: 'function useDraggablePipTsx10(){const{containerHeight,scaledHeightDv,yPosition}=this.__closure;return[containerHeight-scaledHeightDv.get(),yPosition.get()];}'}; object = {code: 'function useDraggablePipTsx11(result,previous){const{cheapWorkletArrayShallowEqual,clamp,yPosition,yDestination}=this.__closure;if(cheapWorkletArrayShallowEqual(result,previous!==null&&previous!==void 0?previous:undefined))return;const[containerHeightNew,yPositionNew]=result;const[containerHeightOld]=previous!==null&&previous!==void 0?previous:[0,0];if(previous!=null&&containerHeightNew!==containerHeightOld){const newY=clamp(yPositionNew*(containerHeightNew/containerHeightOld),0,containerHeightNew);yPosition.set(newY);yDestination.set(newY);}}'}; object = {code: 'function useDraggablePipTsx12(event){const{xPosition,containerWidthDv,scaledWidthDv,clamp,yPosition,containerHeightDv,scaledHeightDv,snapToCorners,withSpring,spring,xDestination,yDestination}=this.__closure;const toss=0.0875;const xToss=xPosition.get()+toss*event.velocityX;const xMin=0;const xMax=containerWidthDv.get()-scaledWidthDv.get();const targetX=clamp(xToss,xMin,xMax);const yToss=yPosition.get()+toss*event.velocityY;const yMin=0;const yMax=containerHeightDv.get()-scaledHeightDv.get();const targetY=clamp(yToss,yMin,yMax);const top=targetY;const bottom=containerHeightDv.get()-scaledHeightDv.get()-targetY;const left=targetX;const right=containerWidthDv.get()-scaledWidthDv.get()-targetX;const minDistance=Math.min(top,bottom,left,right);let snapX=targetX;let snapY=targetY;switch(minDistance){case top:snapY=yMin;if(snapToCorners){snapX=left