import { options as l } from '../../dist/preact.js';

function n(){return l.t=l.debounceRendering,l.debounceRendering=function(n){return l.o=n},function(){return l.o&&l.o()}}var r=function(t){return null!=t&&"function"==typeof t.then},o=0;function u(u){if(++o>1){try{var e=u();if(r(e))return e.then(function(){--o;},function(t){throw --o,t})}catch(t){throw --o,t}return --o,Promise.resolve()}var f,c,a=l.requestAnimationFrame,l$1=n();l.requestAnimationFrame=function(t){return f=t};var h,v,y=function(){try{for(l$1();f;)c=f,f=null,c(),l$1();}catch(t){h||(h=t);}finally{i();}l.requestAnimationFrame=a,--o;};try{v=u();}catch(t){h=t;}if(r(v))return v.then(y,function(t){throw y(),t});if(y(),h)throw h;return Promise.resolve()}function i(){l.o&&(l.o(),delete l.o),void 0!==l.t?(l.debounceRendering=l.t,delete l.t):l.debounceRendering=void 0;}

export { u as act, n as setupRerender, i as teardown };
