/* Metro module 1693; source: unknown; dependencies: [65, 57, 1614] */ function _fun18457(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#18457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:6, offset: 0x00e8d253, size: 357 bytes, params: 8, frame: 22 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(65) /* metro dependency 65 */; const env0_3 = importDefault(57) /* metro dependency 57 */; object = {code: 'function checkIfConfigIsValid_Pnpm_springUtilsTs1(config){const{logger}=this.__closure;var _config$clamp,_config$clamp2;let errorMessage=\'\';[\'stiffness\',\'damping\',\'dampingRatio\',\'restDisplacementThreshold\',\'restSpeedThreshold\',\'mass\'].forEach(function(prop){const value=config[prop];if(value<=0){errorMessage+=", "+prop+" must be grater than zero but got "+value;}});if(config.duration<0){errorMessage+=", duration can\'t be negative, got "+config.duration;}if((_config$clamp=config.clamp)!==null&&_config$clamp!==void 0&&_config$clamp.min&&(_config$clamp2=config.clamp)!==null&&_config$clamp2!==void 0&&_config$clamp2.max&&config.clamp.min>config.clamp.max){errorMessage+=", clamp.min should be lower than clamp.max, got clamp: {min: "+config.clamp.min+", max: "+config.clamp.max+"} ";}if(errorMessage!==\'\'){logger.warn(\'Invalid spring config\'+errorMessage);}return errorMessage===\'\';}'}; const value = _fun18458(); object = {code: 'function bisectRoot_Pnpm_springUtilsTs2({min:min,max:max,func:func,maxIterations=20}){const ACCURACY=0.00005;let idx=maxIterations;let current=(max+min)/2;while(Math.abs(func(current))>ACCURACY&&idx>0){idx-=1;if(func(current)<0){min=current;}else{max=current;}current=(min+max)/2;}return current;}'}; const value2 = _fun18461(); object = {code: 'function initialCalculations_Pnpm_springUtilsTs3(mass=0,config){if(config.skipAnimation){return{zeta:0,omega0:0,omega1:0};}if(config.useDuration){const{stiffness:k,dampingRatio:zeta}=config;const omega0=Math.sqrt(k/mass);const omega1=zeta<1?omega0*Math.sqrt(1-zeta**2):0;return{zeta:zeta,omega0:omega0,omega1:omega1};}else{const{damping:c,mass:m,stiffness:k}=config;const zeta=c/(2*Math.sqrt(k*m));const omega0=Math.sqrt(k/m);const omega1=zeta<1?omega0*Math.sqrt(1-zeta**2):0;return{zeta:zeta,omega0:omega0,omega1:omega1};}}'}; const value3 = _fun18463(); object = {code: 'function scaleZetaToMatchClamps_Pnpm_springUtilsTs4(animation,clamp){const{zeta:zeta,toValue:toValue,startValue:startValue}=animation;const toValueNum=Number(toValue);if(toValueNum===startValue){return zeta;}const[firstBound,secondBound]=toValueNum-startValue>0?[clamp.min,clamp.max]:[clamp.max,clamp.min];const relativeExtremum1=secondBound!==undefined?Math.abs((secondBound-toValueNum)/(toValueNum-startValue)):undefined;const relativeExtremum2=firstBound!==undefined?Math.abs((firstBound-toValueNum)/(toValueNum-startValue)):undefined;const newZeta1=relativeExtremum1!==undefined?Math.abs(Math.log(relativeExtremum1)/Math.PI):undefined;const newZeta2=relativeExtremum2!==undefined?Math.abs(Math.log(relativeExtremum2)/(2*Math.PI)):undefined;const zetaSatisfyingClamp=[newZeta1,newZeta2].filter(function(x){return x!==undefined;});return Math.max(...zetaSatisfyingClamp,zeta);}'}; const value4 = _fun18465(); object = {code: "function calculateNewMassToMatchDuration_Pnpm_springUtilsTs5(x0,config,v0){const{bisectRoot}=this.__closure;if(config.skipAnimation){return 0;}const{stiffness:k,dampingRatio:zeta,restSpeedThreshold:threshold,duration:duration}=config;const durationForMass=function(mass){'worklet';const amplitude=(mass*v0*v0+k*x0*x0)/(Math.exp(1-0.5*zeta)*k);const c=zeta*2*Math.sqrt(k*mass);return 1000*(-2*mass/c)*Math.log(threshold*0.01/amplitude)-duration;};return bisectRoot({min:0,max:100,func:durationForMass});}"}; object = {code: 'function pnpm_springUtilsTs6(mass){const{v0,k,x0,zeta,threshold,duration}=this.__closure;const amplitude=(mass*v0*v0+k*x0*x0)/(Math.exp(1-0.5*zeta)*k);const c=zeta*2*Math.sqrt(k*mass);return 1000*(-2*mass/c)*Math.log(threshold*0.01/amplitude)-duration;}'}; const value5 = _fun18468(); object = {code: 'function criticallyDampedSpringCalculations_Pnpm_springUtilsTs7(animation,precalculatedValues){const{toValue:toValue}=animation;const{v0:v0,x0:x0,omega0:omega0,t:t}=precalculatedValues;const criticallyDampedEnvelope=Math.exp(-omega0*t);const criticallyDampedPosition=toValue-criticallyDampedEnvelope*(x0+(v0+omega0*x0)*t);const criticallyDampedVelocity=criticallyDampedEnvelope*(v0*(t*omega0-1)+t*x0*omega0*omega0);return{position:criticallyDampedPosition,velocity:criticallyDampedVelocity};}'}; const value6 = _fun18471(); object = {code: 'function underDampedSpringCalculations_Pnpm_springUtilsTs8(animation,precalculatedValues){const{toValue:toValue,current:current,velocity:velocity}=animation;const{zeta:zeta,t:t,omega0:omega0,omega1:omega1}=precalculatedValues;const v0=-velocity;const x0=toValue-current;const sin1=Math.sin(omega1*t);const cos1=Math.cos(omega1*t);const underDampedEnvelope=Math.exp(-zeta*omega0*t);const underDampedFrag1=underDampedEnvelope*(sin1*((v0+zeta*omega0*x0)/omega1)+x0*cos1);const underDampedPosition=toValue-underDampedFrag1;const underDampedVelocity=zeta*omega0*underDampedFrag1-underDampedEnvelope*(cos1*(v0+zeta*omega0*x0)-omega1*x0*sin1);return{position:underDampedPosition,velocity:underDampedVelocity};}'}; const value7 = _fun18473(); object = {code: 'function isAnimationTerminatingCalculation_Pnpm_springUtilsTs9(animation,config){const{toValue:toValue,velocity:velocity,startValue:startValue,current:current}=animation;const isOvershooting=config.overshootClamping?current>toValue&&startValuetoValue:false;const isVelocity=Math.abs(velocity) clamp.max; } if (r3) { binding = env0_1; clamp = a0.clamp; min = clamp.min; clamp = a0.clamp; env0_1 = binding + (', clamp.min should be lower than clamp.max, got clamp: {min: ' + min + ', max: ' + clamp.max + '} '); } if (env0_1 !== '') { value4 = environment.__proto__; (require(1614) /* metro dependency 1614 */).logger.warn('Invalid spring config' + env0_1); } return env0_1 === ''; } function bisectRoot({min, max, func, maxIterations}) { // fn#18462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:2021, offset: 0x00e8d5b3, size: 183 bytes, params: 2, frame: 25 var r1; var r10; var r11; var r13; var r0; var value3; let r8 = maxIterations === undefined ? 20 : maxIterations; value = (max + min) / 2; let Math = global.Math; if (Math.abs(func(value)) > 0.00005) { if (r8 > 0) { r1 = value; r10 = max; r11 = min; while (true) { value = r8 - 1; if (func(r1) < 0) { r11 = r1; r13 = r10; } else { r13 = r1; } value3 = (r11 + r13) / 2; Math = global.Math; if (Math.abs(func(value3)) > 0.00005) { if (value > 0) { r1 = value3; r8 = value; r10 = r13; continue; } r0 = value3; break; } r0 = value3; break; } } else { r0 = value; } } else { r0 = value; } return r0; } function initialCalculations() { // fn#18464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:2816, offset: 0x00e8d698, size: 318 bytes, params: 1, frame: 20 var r1; var stiffness; var Math; var object2; var dampingRatio; let value = undefined; const value2 = 0; const r5 = arguments.length > value2 ? value === arguments[value2] ? value2 : arguments[value2] : value2; const r2 = arguments.length > 1 ? arguments[1] : value; if (r2.skipAnimation) { return {'zeta': 0, 'omega0': 0, 'omega1': 0}; } if (r2.useDuration) { stiffness = r2.stiffness; dampingRatio = r2.dampingRatio; Math = global.Math; value = Math.sqrt(stiffness / r5); object2 = {zeta: dampingRatio, omega0: value}; if (dampingRatio < 1) { Math = global.Math; value *= Math.sqrt(1 - exponentiationOperator(dampingRatio, 2, undefined)); r1 = value; } else { r1 = value2; } object2.omega1 = r1; } else { var damping = r2.damping; var mass = r2.mass; stiffness = r2.stiffness; Math = global.Math; value = Math.sqrt(stiffness * mass); value = damping / (2 * value); Math = global.Math; var value4 = Math.sqrt(stiffness / mass); object2 = {zeta: value, omega0: value4}; object2.omega1 = value < 1 ? value4 * global.Math.sqrt(1 - exponentiationOperator(value, 2, 2)) : value2; } return object2; } function scaleZetaToMatchClamps({zeta, toValue, startValue}, a1) { // fn#18466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:4249, offset: 0x00e8d804, size: 406 bytes, params: 3, frame: 22 const Number = global.Number; let value = undefined; const value2 = Number(toValue); if (value2 === startValue) { return zeta; } const value4 = env1_3(value2 - startValue > 0 ? [a1.min, a1.max] : [a1.max, a1.min], 2); const property = value4[0]; const property2 = value4[1]; const r9 = value === property2 ? value : global.Math.abs((property2 - value2) / (value2 - startValue)); const r11 = value === property ? value : global.Math.abs((property - value2) / (value2 - startValue)); const items2 = [value === r9 ? value : global.Math.abs(global.Math.log(r9) / global.Math.PI)]; items2[1] = value === r11 ? value : global.Math.abs(global.Math.log(r11) / (2 * global.Math.PI)); const value13 = items2.filter(function(a0) { return a0 !== undefined; }); let Math = global.Math; const max = Math.max; const apply = max.apply; Math = global.Math; value = env1_2(value13); return Reflect.apply(apply, max, [Math, value.concat([zeta])]); } function calculateNewMassToMatchDuration(a0, a1, a2) { // fn#18469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:5565, offset: 0x00e8d9dc, size: 176 bytes, params: 4, frame: 16 const env0_0 = a0; const env0_1 = a2; if (a1.skipAnimation) { return 0; } const stiffness = a1.stiffness; const dampingRatio = a1.dampingRatio; const restSpeedThreshold = a1.restSpeedThreshold; const duration = a1.duration; const closure = func; closure.__closure = {v0: a2, k: stiffness, x0: a0, zeta: dampingRatio, threshold: restSpeedThreshold, duration: duration}; closure.__workletHash = 9188609427640; closure.__initData = env1_10; return env1_6({'min': 0, 'max': 100, func: closure}); } function criticallyDampedSpringCalculations({toValue}, {v0, x0, omega0, t}) { // fn#18472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:6596, offset: 0x00e8db8d, size: 133 bytes, params: 3, frame: 16 const Math = global.Math; const value = Math.exp(-omega0 * t); return {position: toValue - value * (x0 + (v0 + omega0 * x0) * t), velocity: value * (v0 * (t * omega0 - 1) + t * x0 * omega0 * omega0)}; } function underDampedSpringCalculations({toValue, current, velocity}, {zeta, t, omega0, omega1}) { // fn#18474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:7580, offset: 0x00e8dc40, size: 218 bytes, params: 3, frame: 20 let value = -velocity; const value2 = toValue - current; let Math = global.Math; const value3 = Math.sin(omega1 * t); Math = global.Math; const value4 = Math.cos(omega1 * t); Math = global.Math; const value5 = Math.exp(-zeta * omega0 * t); const value7 = value5 * (value3 * ((value + zeta * omega0 * value2) / omega1) + value2 * value4); const value8 = zeta * omega0 * value7; value = value4 * (value + zeta * omega0 * value2); return {position: toValue - value7, velocity: value8 - value5 * (value - omega1 * value2 * value3)}; } function isAnimationTerminatingCalculation({toValue, velocity, startValue, current}, {overshootClamping, restSpeedThreshold, restDisplacementThreshold}) { // fn#18476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:8480, offset: 0x00e8dd48, size: 154 bytes, params: 3, frame: 18 var r4; var r3; const object2 = {}; if (overshootClamping) { r4 = current > toValue && startValue < toValue; r4 = !r4 ? current < toValue && startValue > toValue : r4; r3 = r4; } else { r3 = !!overshootClamping; } object2.isOvershooting = r3; let Math = global.Math; object2.isVelocity = Math.abs(velocity) < restSpeedThreshold; Math = global.Math; object2.isDisplacement = Math.abs(toValue - current) < restDisplacementThreshold; return object2; } function _fun18460(a0) { // fn#18460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:1201, offset: 0x00e8d541, size: 68 bytes, params: 2, frame: 17 const property = env0_0[a0]; if (property <= 0) { env0_1 = env0_1 + (', ' + a0 + ' must be grater than zero but got ' + property); } } function calculateNewMassToMatchDurationFunc(a0) { // fn#18470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1820:5720, owner: calculateNewMassToMatchDuration.func, offset: 0x00e8da8c, size: 211 bytes, params: 2, frame: 17 const value2 = a0 * importDefault * importDefault; const stiffnessBinding = stiffness; const binding = env0_0; const value3 = value2 + stiffnessBinding * binding * binding; let Math = global.Math; const value5 = value3 / (Math.exp(1 - 0.5 * dampingRatio) * stiffness); const value6 = -2 * a0; const value7 = 2 * dampingRatio; Math = global.Math; const value8 = value7 * Math.sqrt(stiffness * a0); Math = global.Math; return value6 / value8 * 1000 * Math.log(0.01 * restSpeedThreshold / value5) - duration; }