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object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var rt=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var ot=t=>pe(t,\"__esModule\",{value:!0});var st=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var it=(t,e,n)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let r of tt(e))!nt.call(t,r)&&r!==\"default\"&&pe(t,r,{get:()=>e[r],enumerable:!(n=et(e,r))||n.enumerable});return t},at=t=>it(ot(pe(t!=null?Ze(rt(t)):{},\"default\",t&&t.__esModule&&\"default\"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var ke=st((ne,xe)=>{(function(t,e){typeof ne==\"object\"&&typeof xe!=\"undefined\"?e(ne):typeof define==\"function\"&&define.amd?define([\"exports\"],e):(t=typeof globalThis!=\"undefined\"?globalThis:t||self,e(t.fastUniqueNumbers={}))})(ne,function(t){\"use strict\";var e=function(o){return function(p){var d=o(p);return p.add(d),d}},n=function(o){return function(p,d){return o.set(p,d),d}},r=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,i=536870912,h=i*2,y=function(o,p){return function(d){var W=p.get(d),k=W===void 0?d.size:Wr)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;d.has(k);)k=Math.floor(Math.random()*r);return o(d,k)}},w=new WeakMap,M=n(w),m=y(M,w),u=e(m);t.addUniqueNumber=u,t.generateUniqueNumber=m,Object.defineProperty(t,\"__esModule\",{value:!0})})});function ut(t){return function(n){let r={...n};!r.onPrompt&&t.prototype.onPrompt&&(r.onPrompt=()=>{t.prototype.onPrompt()}),!r.onIdle&&t.prototype.onIdle&&(r.onIdle=()=>{t.prototype.onIdle()}),!r.onActive&&t.prototype.onActive&&(r.onActive=h=>{t.prototype.onActive(h)}),!r.onAction&&t.prototype.onAction&&(r.onAction=h=>{t.prototype.onAction(h)});let i=X(r);return React.createElement(t,{...n,...i})}}import{useEffect as B,useRef as f,useCallback as g}from\"react\";var $=at(ke());var Se=t=>t.method!==void 0&&t.method===\"call\";var Re=t=>t.error===null&&typeof t.id==\"number\";var Pe=t=>{let e=new Map([[0,()=>{}]]),n=new Map([[0,()=>{}]]),r=new Map,i=new Worker(t);return i.addEventListener(\"message\",({data:m})=>{if(Se(m)){let{params:{timerId:u,timerType:l}}=m;if(l===\"interval\"){let o=e.get(u);if(typeof o==\"number\"){let p=r.get(o);if(p===void 0||p.timerId!==u||p.timerType!==l)throw new Error(\"The timer is in an undefined state.\")}else if(typeof o!=\"undefined\")o();else throw new Error(\"The timer is in an undefined state.\")}else if(l===\"timeout\"){let o=n.get(u);if(typeof o==\"number\"){let p=r.get(o);if(p===void 0||p.timerId!==u||p.timerType!==l)throw new Error(\"The timer is in an undefined state.\")}else if(typeof o!=\"undefined\")o(),n.delete(u);else throw new Error(\"The timer is in an undefined state.\")}}else if(Re(m)){let{id:u}=m,l=r.get(u);if(l===void 0)throw new Error(\"The timer is in an undefined state.\");let{timerId:o,timerType:p}=l;r.delete(u),p===\"interval\"?e.delete(o):n.delete(o)}else{let{error:{message:u}}=m;throw new Error(u)}}),{clearInterval:m=>{let u=(0,$.generateUniqueNumber)(r);r.set(u,{timerId:m,timerType:\"interval\"}),e.set(m,u),i.postMessage({id:u,method:\"clear\",params:{timerId:m,timerType:\"interval\"}})},clearTimeout:m=>{let u=(0,$.generateUniqueNumber)(r);r.set(u,{timerId:m,timerType:\"timeout\"}),n.set(m,u),i.postMessage({id:u,method:\"clear\",params:{timerId:m,timerType:\"timeout\"}})},setInterval:(m,u)=>{let l=(0,$.generateUniqueNumber)(e);return e.set(l,()=>{m(),typeof e.get(l)==\"function\"&&i.postMessage({id:null,method:\"set\",params:{delay:u,now:performance.now(),timerId:l,timerType:\"interval\"}})}),i.postMessage({id:null,method:\"set\",params:{delay:u,now:performance.now(),timerId:l,timerType:\"interval\"}}),l},setTimeout:(m,u)=>{let l=(0,$.generateUniqueNumber)(n);return n.set(l,m),i.postMessage({id:null,method:\"set\",params:{delay:u,now:performance.now(),timerId:l,timerType:\"timeout\"}}),l}}};var K=null,Ae=(t,e)=>()=>{if(K!==null)return K;let n=new Blob([e],{type:\"application/javascript; charset=utf-8\"}),r=URL.createObjectURL(n);return K=t(r),K.setTimeout(()=>URL.revokeObjectURL(r),0),K};var De=`(()=>{\"use strict\";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:\"call\",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener(\"message\",(i=>{let{data:s}=i;try{if(\"clear\"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if(\"interval\"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id \"'.concat(t,'\".'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if(\"timeout\"!==i)throw new Error('The given type \"'.concat(i,'\" is not supported'));(e=>{const r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id \"'.concat(e,'\".'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if(\"set\"!==s.method)throw new Error('The given method \"'.concat(s.method,'\" is not supported'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if(\"interval\"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,\"interval\"))})(i,a,n);else{if(\"timeout\"!==d)throw new Error('The given type \"'.concat(d,'\" is not supported'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,\"timeout\"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();`;var oe=Ae(Pe,De),_e=t=>oe().clearInterval(t),Ce=t=>oe().clearTimeout(t),Oe=(t,e)=>oe().setInterval(t,e),Ne=(t,e)=>oe().setTimeout(t,e);var T={setTimeout:Ne,clearTimeout:Ce,setInterval:Oe,clearInterval:_e};function fe(){T.setTimeout=setTimeout,T.clearTimeout=clearTimeout,T.setInterval=setInterval,T.clearInterval=clearInterval}var q={},Fe=class{constructor(e){this.closed=!1;this.mc=new MessageChannel;this.name=e,q[e]=q[e]||[],q[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener(\"storage\",this.onStorage)}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||e.newValue===null)return;let n=JSON.parse(e.newValue);this.mc.port2.postMessage(n)}postMessage(e){if(this.closed)throw new Error(\"InvalidStateError\");let n=JSON.stringify(e),r=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(r,n),T.setTimeout(()=>{window.localStorage.removeItem(r)},500),q[this.name].forEach(i=>{i!==this&&i.mc.port2.postMessage(JSON.parse(n))})}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener(\"storage\",this.onStorage);let e=q[this.name].indexOf(this);q[this.name].splice(e,1)}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e}addEventListener(e,n){return this.mc.port1.addEventListener(e,n)}removeEventListener(e,n){return this.mc.port1.removeEventListener(e,n)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}},Ue=typeof window==\"undefined\"?void 0:typeof window.BroadcastChannel==\"function\"?window.BroadcastChannel:Fe;function Be(t=0){return new Promise(e=>T.setTimeout(e,t))}var U=(typeof window==\"undefined\"?\"undefined\":typeof window)==\"object\";var b=()=>U?performance.now():Date.now();function We(){return b().toString(36).substring(2)}var V;(function(e){e[e.LEADER=0]=\"LEADER\"})(V||(V={}));var x;(function(r){r[r.APPLY=0]=\"APPLY\",r[r.TELL=1]=\"TELL\",r[r.CLOSE=2]=\"CLOSE\"})(x||(x={}));var he=class{constructor(e,n){this.token=We();this.isLeader=!1;this.isDead=!1;this.isApplying=!1;this.intervals=[];this.listeners=[];this.channel=e,this.options=n,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this)}async apply(){if(this.isLeader||this.isDead||this.isApplying)return!1;this.isApplying=!0;let e=!1,n=r=>{let{ctx:i,token:h,action:y}=r.data;i===0&&h!==this.token&&(y===0&&h>this.token&&(e=!0),y===1&&(e=!0))};this.channel.addEventListener(\"message\",n);try{if(this.sendAction(0),await Be(this.options.responseTime),e)throw new Error;return this.sendAction(0),this.assumeLead(),this.channel.removeEventListener(\"message\",n),this.isApplying=!1,!0}catch{return!1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,n=null;return new Promise(r=>{let i=()=>{if(e)return;e=!0,T.clearInterval(n);let y=this.intervals.indexOf(n);this.intervals.splice(y,1),this.channel.removeEventListener(\"message\",h),r()};n=T.setInterval(()=>{this.apply().then(()=>{this.isLeader&&i()})},this.options.fallbackInterval),this.intervals.push(n);let h=y=>{let{ctx:w,action:M}=y.data;w===0&&M===2&&this.apply().then(()=>{this.isLeader&&i()})};this.channel.addEventListener(\"message\",h)})}sendAction(e){this.channel.postMessage({ctx:0,action:e,token:this.token})}assumeLead(){this.isLeader=!0;let e=n=>{let{ctx:r,action:i}=n.data;r===0&&i===0&&this.sendAction(1)};return this.channel.addEventListener(\"message\",e),this.listeners.push(e),this.sendAction(1)}waitForLeadership(){return this.deferred?this.deferred:(this.deferred=this.awaitLeadership(),this.deferred)}close(){this.isDead||(this.isDead=!0,this.isLeader=!1,this.sendAction(2),this.listeners.forEach(e=>this.channel.removeEventListener(\"message\",e)),this.intervals.forEach(e=>T.clearInterval(e)))}};var c;(function(o){o[o.REGISTER=0]=\"REGISTER\",o[o.DEREGISTER=1]=\"DEREGISTER\",o[o.IDLE=2]=\"IDLE\",o[o.ACTIVE=3]=\"ACTIVE\",o[o.EMIT_IDLE=4]=\"EMIT_IDLE\",o[o.EMIT_ACTIVE=5]=\"EMIT_ACTIVE\",o[o.EMIT_MESSAGE=6]=\"EMIT_MESSAGE\",o[o.START=7]=\"START\",o[o.RESET=8]=\"RESET\",o[o.PAUSE=9]=\"PAUSE\",o[o.RESUME=10]=\"RESUME\",o[o.MESSAGE=11]=\"MESSAGE\"})(c||(c={}));var ve=class{constructor(e){this.isLeader=!1;this.allIdle=!1;this.registry=new Map;let{channelName:n,fallbackInterval:r,responseTime:i}=e;this.options=e,this.channel=new Ue(n),this.elector=new he(this.channel,{fallbackInterval:r,responseTime:i}),this.elector.waitForLeadership().then(()=>{this.isLeader=!0}),this.channel.addEventListener(\"message\",h=>{let{action:y,token:w,data:M}=h.data;switch(y){case 0:this.registry.set(w,!1);break;case 1:this.registry.delete(w);break;case 2:this.idle(w);break;case 3:this.active(w);break;case 4:this.options.onIdle();break;case 5:this.options.onActive();break;case 6:this.options.onMessage(M);break;case 7:this.options.start(!0);break;case 8:this.options.reset(!0);break;case 9:this.options.pause(!0);break;case 10:this.options.resume(!0);break}}),this.send(0)}idle(e=this.elector.token){this.registry.set(e,!0);let n=[...this.registry.values()].every(r=>r);!this.allIdle&&n&&(this.allIdle=!0,this.isLeader?(this.options.onIdle(),this.options.emitOnAllTabs&&this.send(4)):this.send(2))}active(e=this.elector.token){this.registry.set(e,!1);let n=[...this.registry.values()].some(r=>!r);this.allIdle&&n&&(this.allIdle=!1,this.isLeader?(this.options.onActive(),this.options.emitOnAllTabs&&this.send(5)):this.send(3))}message(e){try{this.channel.postMessage({action:6,token:this.elector.token,data:e})}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.elector.token})}catch{}}close(){this.send(1),this.elector.close(),this.channel.close()}};var He=U?document:null,Ge=[\"mousemove\",\"keydown\",\"wheel\",\"DOMMouseScroll\",\"mousewheel\",\"mousedown\",\"touchstart\",\"touchmove\",\"MSPointerDown\",\"MSPointerMove\",\"visibilitychange\"];import{useRef as lt,useEffect as ct}from\"react\";function N(t){let e=lt(t);return ct(()=>{e.current=t},[t]),e}function qe(t,e){let n;function r(...i){n&&clearTimeout(n),n=setTimeout(()=>{t(...i),n=null},e)}return r.cancel=function(){clearTimeout(n)},r}function Te(t,e){let n=0;return function(...r){let i=new Date().getTime();if(!(i-n{},onIdle:y=()=>{},onActive:w=()=>{},onAction:M=()=>{},onMessage:m=()=>{},debounce:u=0,throttle:l=0,eventsThrottle:o=200,startOnMount:p=!0,startManually:d=!1,stopOnIdle:W=!1,nativeTimers:k=!1,crossTab:Ee=!1,emitOnAllTabs:S=!1}={}){let j=f(b()),Ie=f(Date.now()),A=f(null),D=f(null),Y=f(0),v=f(!0),R=f(!1),Q=f(!0),z=f(!1),E=f(!1),L=f(0),_=f(0),C=f(null),a=f(null),ie=N(e),Ve=N(W),be=N(i),ae=f(n),ue=f([...new Set([...r,...i]).values()]),le=N(y),Z=N(w),je=N(h),ee=N(m),P=f();B(()=>{P.current&&P.current.cancel&&P.current.cancel(),u>0?P.current=qe(M,u):l>0?P.current=Te(M,l):P.current=M},[M,l,u]);let O=()=>{C.current!==null&&(T.clearTimeout(C.current),C.current=null)},J=(s,I=!0)=>{O(),C.current=T.setTimeout(ce,s||t),I&&(D.current=b())},ce=s=>{let I=!v.current;if(I){if(ie.current>0&&!E.current){L.current=0,_.current=b(),E.current=!0,je.current(s),J(ie.current,!1);return}v.current=I,Ve.current?(O(),H()):E.current&&(_.current=0,E.current=!1),A.current=b(),a.current?a.current.idle():le.current();return}v.current=I,Y.current+=b()-A.current,F(),a.current?a.current.active():Z.current(s)},ge=s=>{if(P.current(s),E.current)return;O();let I=b()-D.current;if((v.current&&!W||!v.current&&I>t)&&ce(s),R.current=!1,L.current=0,_.current=0,!v.current&&be.current.includes(s.type)){ce(s);return}J()},te=f();B(()=>{let s=z.current;s&&H(),o>0?te.current=Te(ge,o):te.current=ge,s&&F()},[o]);let F=()=>{!U||z.current||(ue.current.forEach(s=>{ae.current.addEventListener(s,te.current,{capture:!0,passive:!0})}),z.current=!0)},H=(s=!1)=>{!U||(z.current||s)&&(ue.current.forEach(I=>{ae.current.removeEventListener(I,te.current,{capture:!0})}),z.current=!1)},G=g(s=>{O(),F(),v.current=!1,E.current=!1,R.current=!1,L.current=0,_.current=0,a.current&&(a.current.allIdle=!1,!s&&S&&a.current.send(c.START)),J()},[C,v,t,a,S]),re=g(s=>{O(),F(),(v.current||E.current)&&(a.current?a.current.active():Z.current()),v.current=!1,E.current=!1,R.current=!1,L.current=0,_.current=0,a.current&&(a.current.allIdle=!1,!s&&S&&a.current.send(c.RESET)),J()},[C,v,t,a,S]),me=g((s=!1)=>R.current?!1:(L.current=ye(),R.current=!0,H(),O(),a.current&&!s&&S&&a.current.send(c.PAUSE),!0),[C,a,S]),de=g((s=!1)=>R.current?(R.current=!1,E.current||F(),v.current||J(L.current),_.current&&(_.current=b()),a.current&&!s&&S&&a.current.send(c.RESUME),!0):!1,[C,L,S,a]),Ye=g((s,I)=>{a.current?(I&&ee.current(s),a.current.message(s)):I&&ee.current(s)},[m]),ze=g(()=>v.current,[v]),Je=g(()=>E.current,[E]),Xe=g(()=>a.current?a.current.isLeader:!0,[a]),ye=g(()=>{if(R.current)return L.current;let s=L.current?L.current:E.current?ie.current:t,I=D.current?E.current?b()-_.current:b()-D.current:0,Me=Math.ceil(s-I);return Me<0?0:Math.abs(Me)},[t,e,E,L,D]),we=g(()=>Math.round(b()-j.current),[j]),$e=g(()=>A.current?new Date(Ie.current-j.current+A.current):null,[A]),Ke=g(()=>D.current?new Date(Ie.current-j.current+D.current):null,[D]),Le=g(()=>v.current?Math.round(b()-A.current+Y.current):Math.round(Y.current),[A,Y]),Qe=g(()=>{let s=Math.round(we()-Le());return s>=0?s:0},[j,A,Y]);return B(()=>{if(u>0&&l>0)throw new Error(\"\\u274C onAction can either be throttled or debounced, not both.\");return k&&fe(),()=>{O(),H(!0),P.current.cancel&&P.current.cancel(),a.current&&a.current.close()}},[]),B(()=>{if(!Q.current){if(H(),ue.current=[...new Set([...r,...be.current]).values()],ae.current=n,d)return;p?G():F()}},[n,r]),B(()=>{O(),H(!0),Q.current||(R.current=!0,v.current=!0,L.current=0),!d&&(p?G():F())},[d,p]),B(()=>{if(Q.current)Q.current=!1;else{if(d)return;v.current?re():G()}},[t]),B(()=>{a.current&&a.current.close(),Ee?a.current=new ve({channelName:\"idle-timer\",fallbackInterval:2e3,responseTime:100,emitOnAllTabs:S,onIdle:le.current,onActive:Z.current,onMessage:ee.current,start:G,reset:re,pause:me,resume:de}):a.current=null},[Ee,S,le,Z,ee,G,re,me,de]),{message:Ye,start:G,reset:re,pause:me,resume:de,isIdle:ze,isPrompted:Je,isLeader:Xe,getRemainingTime:ye,getElapsedTime:we,getLastIdleTime:$e,getLastActiveTime:Ke,getTotalIdleTime:Le,getTotalActiveTime:Qe}}import mt,{createContext as dt,useContext as pt}from\"react\";var se=dt(null);function ft(t){let e=X(t);return mt.createElement(se.Provider,{value:e},t.children)}var ht=se.Consumer;function vt(){return pt(se)}export{ht as IdleTimerConsumer,se as IdleTimerContext,ft as IdleTimerProvider,fe as createMocks,X as useIdleTimer,vt as useIdleTimerContext,ut as withIdleTimer};\n","var at=Object.create,ve=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,mt=Object.prototype.hasOwnProperty;var dt=t=>ve(t,\"__esModule\",{value:!0});var pt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ft=(t,e,n)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let r of ct(e))!mt.call(t,r)&&r!==\"default\"&&ve(t,r,{get:()=>e[r],enumerable:!(n=lt(e,r))||n.enumerable});return t},ht=t=>ft(dt(ve(t!=null?at(ut(t)):{},\"default\",t&&t.__esModule&&\"default\"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Ne=pt((ie,Ce)=>{(function(t,e){typeof ie==\"object\"&&typeof Ce!=\"undefined\"?e(ie):typeof define==\"function\"&&define.amd?define([\"exports\"],e):(t=typeof globalThis!=\"undefined\"?globalThis:t||self,e(t.fastUniqueNumbers={}))})(ie,function(t){\"use strict\";var e=function(p){return function(o){var f=p(o);return o.add(f),f}},n=function(p){return function(o,f){return p.set(o,f),f}},r=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,s=536870912,u=s*2,g=function(p,o){return function(f){var x=o.get(f),L=x===void 0?f.size:xr)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;f.has(L);)L=Math.floor(Math.random()*r);return p(f,L)}},U=new WeakMap,Z=n(U),m=g(Z,U),c=e(m);t.addUniqueNumber=c,t.generateUniqueNumber=m,Object.defineProperty(t,\"__esModule\",{value:!0})})});import vt,{forwardRef as Tt}from\"react\";function It(t){return Tt(function(n,r){let s={...n};!s.onPrompt&&t.prototype.onPrompt&&(s.onPrompt=()=>{t.prototype.onPrompt()}),!s.onIdle&&t.prototype.onIdle&&(s.onIdle=()=>{t.prototype.onIdle()}),!s.onActive&&t.prototype.onActive&&(s.onActive=g=>{t.prototype.onActive(g)}),!s.onAction&&t.prototype.onAction&&(s.onAction=g=>{t.prototype.onAction(g)});let u=$(s);return typeof r==\"function\"?r(u):r&&(r.current=u),vt.createElement(t,{...n,...u})})}import{useEffect as F,useRef as h,useCallback as b}from\"react\";var K=ht(Ne());var _e=t=>t.method!==void 0&&t.method===\"call\";var Fe=t=>t.error===null&&typeof t.id==\"number\";var Ue=t=>{let e=new Map([[0,()=>{}]]),n=new Map([[0,()=>{}]]),r=new Map,s=new Worker(t);return s.addEventListener(\"message\",({data:m})=>{if(_e(m)){let{params:{timerId:c,timerType:d}}=m;if(d===\"interval\"){let p=e.get(c);if(typeof p==\"number\"){let o=r.get(p);if(o===void 0||o.timerId!==c||o.timerType!==d)throw new Error(\"The timer is in an undefined state.\")}else if(typeof p!=\"undefined\")p();else throw new Error(\"The timer is in an undefined state.\")}else if(d===\"timeout\"){let p=n.get(c);if(typeof p==\"number\"){let o=r.get(p);if(o===void 0||o.timerId!==c||o.timerType!==d)throw new Error(\"The timer is in an undefined state.\")}else if(typeof p!=\"undefined\")p(),n.delete(c);else throw new Error(\"The timer is in an undefined state.\")}}else if(Fe(m)){let{id:c}=m,d=r.get(c);if(d===void 0)throw new Error(\"The timer is in an undefined state.\");let{timerId:p,timerType:o}=d;r.delete(c),o===\"interval\"?e.delete(p):n.delete(p)}else{let{error:{message:c}}=m;throw new Error(c)}}),{clearInterval:m=>{let c=(0,K.generateUniqueNumber)(r);r.set(c,{timerId:m,timerType:\"interval\"}),e.set(m,c),s.postMessage({id:c,method:\"clear\",params:{timerId:m,timerType:\"interval\"}})},clearTimeout:m=>{let c=(0,K.generateUniqueNumber)(r);r.set(c,{timerId:m,timerType:\"timeout\"}),n.set(m,c),s.postMessage({id:c,method:\"clear\",params:{timerId:m,timerType:\"timeout\"}})},setInterval:(m,c)=>{let d=(0,K.generateUniqueNumber)(e);return e.set(d,()=>{m(),typeof e.get(d)==\"function\"&&s.postMessage({id:null,method:\"set\",params:{delay:c,now:performance.now(),timerId:d,timerType:\"interval\"}})}),s.postMessage({id:null,method:\"set\",params:{delay:c,now:performance.now(),timerId:d,timerType:\"interval\"}}),d},setTimeout:(m,c)=>{let d=(0,K.generateUniqueNumber)(n);return n.set(d,m),s.postMessage({id:null,method:\"set\",params:{delay:c,now:performance.now(),timerId:d,timerType:\"timeout\"}}),d}}};var Q=null,We=(t,e)=>()=>{if(Q!==null)return Q;let n=new Blob([e],{type:\"application/javascript; charset=utf-8\"}),r=URL.createObjectURL(n);return Q=t(r),Q.setTimeout(()=>URL.revokeObjectURL(r),0),Q};var Be=`(()=>{\"use strict\";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:\"call\",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener(\"message\",(i=>{let{data:s}=i;try{if(\"clear\"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if(\"interval\"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id \"'.concat(t,'\".'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if(\"timeout\"!==i)throw new Error('The given type \"'.concat(i,'\" is not supported'));(e=>{const r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id \"'.concat(e,'\".'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if(\"set\"!==s.method)throw new Error('The given method \"'.concat(s.method,'\" is not supported'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if(\"interval\"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,\"interval\"))})(i,a,n);else{if(\"timeout\"!==d)throw new Error('The given type \"'.concat(d,'\" is not supported'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,\"timeout\"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();`;var se=We(Ue,Be),He=t=>se().clearInterval(t),Ge=t=>se().clearTimeout(t),qe=(t,e)=>se().setInterval(t,e),Ve=(t,e)=>se().setTimeout(t,e);var w=(typeof window==\"undefined\"?\"undefined\":typeof window)==\"object\";var v={setTimeout:w?setTimeout.bind(window):setTimeout,clearTimeout:w?clearTimeout.bind(window):clearTimeout,setInterval:w?setInterval.bind(window):setInterval,clearInterval:w?clearInterval.bind(window):clearInterval},Et={setTimeout:Ve,clearTimeout:Ge,setInterval:qe,clearInterval:He};function bt(){v.setTimeout=setTimeout,v.clearTimeout=clearTimeout,v.setInterval=setInterval,v.clearInterval=clearInterval}function je(t){v.setTimeout=t.setTimeout,v.clearTimeout=t.clearTimeout,v.setInterval=t.setInterval,v.clearInterval=t.clearInterval}var j={},Ye=class{constructor(e){this.closed=!1;this.mc=new MessageChannel;this.name=e,j[e]=j[e]||[],j[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener(\"storage\",this.onStorage)}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||e.newValue===null)return;let n=JSON.parse(e.newValue);this.mc.port2.postMessage(n)}postMessage(e){if(this.closed)throw new Error(\"InvalidStateError\");let n=JSON.stringify(e),r=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(r,n),v.setTimeout(()=>{window.localStorage.removeItem(r)},500),j[this.name].forEach(s=>{s!==this&&s.mc.port2.postMessage(JSON.parse(n))})}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener(\"storage\",this.onStorage);let e=j[this.name].indexOf(this);j[this.name].splice(e,1)}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e}addEventListener(e,n){return this.mc.port1.addEventListener(e,n)}removeEventListener(e,n){return this.mc.port1.removeEventListener(e,n)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}},Je=typeof window==\"undefined\"?void 0:typeof window.BroadcastChannel==\"function\"?window.BroadcastChannel:Ye;function ze(t=0){return new Promise(e=>v.setTimeout(e,t))}var I=()=>w?performance.now():Date.now();function ae(){return I().toString(36).substring(2)}var l;(function(o){o[o.APPLY=0]=\"APPLY\",o[o.TELL=1]=\"TELL\",o[o.CLOSE=2]=\"CLOSE\",o[o.REGISTER=3]=\"REGISTER\",o[o.DEREGISTER=4]=\"DEREGISTER\",o[o.IDLE=5]=\"IDLE\",o[o.ACTIVE=6]=\"ACTIVE\",o[o.PROMPT=7]=\"PROMPT\",o[o.START=8]=\"START\",o[o.RESET=9]=\"RESET\",o[o.PAUSE=10]=\"PAUSE\",o[o.RESUME=11]=\"RESUME\",o[o.MESSAGE=12]=\"MESSAGE\"})(l||(l={}));var Te=class{constructor(e,n){this.token=ae();this.isLeader=!1;this.isDead=!1;this.isApplying=!1;this.reApply=!1;this.intervals=[];this.listeners=[];this.channel=e,this.options=n,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this)}async apply(){if(this.isLeader||this.isDead)return!1;if(this.isApplying)return this.reApply=!0,!1;this.isApplying=!0;let e=!1,n=r=>{let{token:s,action:u}=r.data;s!==this.token&&(u===l.APPLY&&s>this.token&&(e=!0),u===l.TELL&&(e=!0))};this.channel.addEventListener(\"message\",n);try{return this.sendAction(l.APPLY),await ze(this.options.responseTime),this.channel.removeEventListener(\"message\",n),this.isApplying=!1,e?this.reApply?this.apply():!1:(this.assumeLead(),!0)}catch{return!1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,n=null;return new Promise(r=>{let s=()=>{if(e)return;e=!0,v.clearInterval(n);let g=this.intervals.indexOf(n);this.intervals.splice(g,1),this.channel.removeEventListener(\"message\",u),r()};n=v.setInterval(()=>{this.apply().then(()=>{this.isLeader&&s()})},this.options.fallbackInterval),this.intervals.push(n);let u=g=>{let{action:U}=g.data;U===l.CLOSE&&this.apply().then(()=>{this.isLeader&&s()})};this.channel.addEventListener(\"message\",u)})}sendAction(e){this.channel.postMessage({action:e,token:this.token})}assumeLead(){this.isLeader=!0;let e=n=>{let{action:r}=n.data;r===l.APPLY&&this.sendAction(l.TELL)};return this.channel.addEventListener(\"message\",e),this.listeners.push(e),this.sendAction(l.TELL)}waitForLeadership(){return this.deferred?this.deferred:(this.deferred=this.awaitLeadership(),this.deferred)}close(){this.isDead||(this.isDead=!0,this.isLeader=!1,this.sendAction(l.CLOSE),this.listeners.forEach(e=>this.channel.removeEventListener(\"message\",e)),this.intervals.forEach(e=>v.clearInterval(e)))}};var P;(function(r){r[r.PROMPTED=0]=\"PROMPTED\",r[r.ACTIVE=1]=\"ACTIVE\",r[r.IDLE=2]=\"IDLE\"})(P||(P={}));var Ie=class{constructor(e){this.token=ae();this.registry=new Map;this.allIdle=!1;let{channelName:n}=e;if(this.options=e,this.channel=new Je(n),this.registry.set(this.token,1),e.leaderElection){let r={fallbackInterval:2e3,responseTime:100};this.elector=new Te(this.channel,r),this.elector.waitForLeadership()}this.channel.addEventListener(\"message\",r=>{let{action:s,token:u,data:g}=r.data;switch(s){case l.REGISTER:this.registry.set(u,1);break;case l.DEREGISTER:this.registry.delete(u);break;case l.IDLE:this.idle(u);break;case l.ACTIVE:this.active(u);break;case l.PROMPT:this.prompt(u);break;case l.MESSAGE:this.options.onMessage(g);break;case l.START:this.options.start(!0);break;case l.RESET:this.options.reset(!0);break;case l.PAUSE:this.options.pause(!0);break;case l.RESUME:this.options.resume(!0);break}}),this.send(l.REGISTER)}get isLeader(){if(!this.elector)throw new Error('\\u274C Leader election is not enabled. To Enable it set the \"leaderElection\" property to true.');return this.elector.isLeader}prompt(e=this.token){this.registry.set(e,0);let n=[...this.registry.values()].every(r=>r===0);e===this.token&&this.send(l.PROMPT),n&&this.options.onPrompt()}idle(e=this.token){this.registry.set(e,2);let n=[...this.registry.values()].every(r=>r===2);e===this.token&&this.send(l.IDLE),!this.allIdle&&n&&(this.allIdle=!0,this.options.onIdle())}active(e=this.token){this.registry.set(e,1);let n=[...this.registry.values()].some(r=>r===1);e===this.token&&this.send(l.ACTIVE),this.allIdle&&n&&(this.allIdle=!1,this.options.onActive())}sync(){try{this.channel.postMessage({action:l.RESET,token:this.token})}catch{}}message(e){try{this.channel.postMessage({action:l.MESSAGE,token:this.token,data:e})}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.token})}catch{}}close(){this.options.leaderElection&&this.elector.close(),this.send(l.DEREGISTER),this.channel.close()}};var Xe=w?document:null,$e=[\"mousemove\",\"keydown\",\"wheel\",\"DOMMouseScroll\",\"mousewheel\",\"mousedown\",\"touchstart\",\"touchmove\",\"MSPointerDown\",\"MSPointerMove\",\"visibilitychange\"];import{useRef as gt,useEffect as wt}from\"react\";function _(t){let e=gt(t);return wt(()=>{e.current=t},[t]),e}function Ke(t,e){let n;function r(...s){n&&clearTimeout(n),n=setTimeout(()=>{t(...s),n=null},e)}return r.cancel=function(){clearTimeout(n)},r}function le(t,e){let n=0;return function(...r){let s=new Date().getTime();if(!(s-n{},onIdle:U=()=>{},onActive:Z=()=>{},onAction:m=()=>{},onMessage:c=()=>{},debounce:d=0,throttle:p=0,eventsThrottle:o=200,startOnMount:f=!0,startManually:x=!1,stopOnIdle:L=!1,crossTab:G=!1,name:Ee=\"idle-timer\",syncTimers:Y=0,leaderElection:be=!1}={}){let J=h(I()),ge=h(Date.now()),ue=h(I()),O=h(null),D=h(null),z=h(0),T=h(!0),S=h(!1),W=h(!0),X=h(!1),E=h(!1),y=h(0),R=h(0),C=h(null),a=h(null),N=_(t),ee=_(e),Qe=_(L),we=h(u),me=h(n),de=h([...new Set([...r,...u]).values()]),ye=_(U),te=_(Z),Le=_(g),re=_(c),M=h();F(()=>{M.current&&M.current.cancel&&M.current.cancel(),d>0?M.current=Ke(m,d):p>0?M.current=le(m,p):M.current=m},[m,p,d]);let Me=h();F(()=>{G&&Y&&(Me.current=le(()=>{a.current.sync()},Y))},[G,Y]);let A=()=>{C.current!==null&&(v.clearTimeout(C.current),C.current=null)},q=(i,k=!0)=>{A(),C.current=v.setTimeout(pe,i||N.current),k&&(D.current=I())},ke=i=>{y.current=0,R.current=I(),E.current=!0,q(ee.current,!1),Le.current(i)},xe=()=>{T.current=!0,O.current=I(),Qe.current?(A(),H()):E.current&&(R.current=0,E.current=!1),ye.current()},Pe=i=>{E.current=!1,R.current=0,T.current=!1,z.current+=I()-O.current,B(),q(),te.current(i)},pe=i=>{if(!T.current){if(ee.current>0&&!E.current){a.current?a.current.prompt():ke(i);return}a.current?a.current.idle():xe();return}a.current?a.current.active():Pe(i)},Se=i=>{if(M.current(i),E.current)return;G&&Y&&Me.current(),A();let k=I()-D.current;if((T.current&&!L||!T.current&&k>N.current)&&pe(i),S.current=!1,y.current=0,R.current=0,!T.current&&we.current.includes(i.type)){pe(i);return}q(),a.current&&a.current.active()},ne=h();F(()=>{let i=X.current;i&&H(),o>0?ne.current=le(Se,o):ne.current=Se,i&&B()},[o,G,Y]);let B=()=>{!w||X.current||(de.current.forEach(i=>{me.current.addEventListener(i,ne.current,{capture:!0,passive:!0})}),X.current=!0)},H=(i=!1)=>{!w||(X.current||i)&&(de.current.forEach(k=>{me.current.removeEventListener(k,ne.current,{capture:!0})}),X.current=!1)},V=b(i=>{A(),B(),E.current&&te.current(),T.current=!1,E.current=!1,S.current=!1,y.current=0,R.current=0,a.current&&!i&&(a.current.active(),a.current.send(l.START)),q()},[C,T,N,a]),oe=b(i=>{A(),B(),(T.current||E.current)&&(te.current(),a.current&&a.current.active()),T.current=!1,E.current=!1,S.current=!1,y.current=0,R.current=0,ue.current=I(),a.current&&(a.current.allIdle=!1,i||a.current.send(l.RESET)),q()},[C,T,N,a]),fe=b((i=!1)=>S.current?!1:(y.current=Re(),S.current=!0,H(),A(),a.current&&(i||a.current.send(l.PAUSE)),!0),[C,a]),he=b((i=!1)=>S.current?(S.current=!1,E.current||B(),T.current||q(y.current),R.current&&(R.current=I()),a.current&&(i||a.current.send(l.RESUME)),!0):!1,[C,N,y,a]),Ze=b((i,k)=>{a.current?(k&&re.current(i),a.current.message(i)):k&&re.current(i)},[c]),et=b(()=>T.current,[T]),tt=b(()=>E.current,[E]),rt=b(()=>{if(!a.current)throw new Error('\\u274C Cross Tab feature is not enabled. To enable it set the \"crossTab\" property to true.');return a.current.isLeader},[a]),Re=b(()=>{if(S.current)return y.current;let i=y.current?y.current:E.current?ee.current:N.current,k=D.current?E.current?I()-R.current:I()-D.current:0,De=Math.ceil(i-k);return De<0?0:Math.abs(De)},[N,ee,E,y,D]),nt=b(()=>Math.round(I()-ue.current),[ue]),Ae=b(()=>Math.round(I()-J.current),[J]),ot=b(()=>O.current?new Date(ge.current-J.current+O.current):null,[O]),it=b(()=>D.current?new Date(ge.current-J.current+D.current):null,[D]),Oe=b(()=>T.current?Math.round(I()-O.current+z.current):Math.round(z.current),[O,z]),st=b(()=>{let i=Math.round(Ae()-Oe());return i>=0?i:0},[J,O,z]);return F(()=>{if(d>0&&p>0)throw new Error(\"\\u274C onAction can either be throttled or debounced, not both.\");s&&je(s);let i=()=>{a.current&&a.current.close(),M.current.cancel&&M.current.cancel(),A(),H(!0)};return w&&window.addEventListener(\"beforeunload\",i),()=>{w&&window.removeEventListener(\"beforeunload\",i),a.current&&a.current.close(),M.current.cancel&&M.current.cancel(),A(),H(!0)}},[]),F(()=>{a.current&&a.current.close(),G?a.current=new Ie({channelName:Ee,leaderElection:be,onPrompt:()=>{ke()},onIdle:()=>{xe()},onActive:()=>{Pe()},onMessage:re.current,start:V,reset:oe,pause:fe,resume:he}):a.current=null},[G,Ee,be,Le,ye,te,re,V,oe,fe,he]),F(()=>{A(),H(!0),W.current||(S.current=!0,T.current=!0,y.current=0),!x&&(f?V():B())},[x,f,W]),F(()=>{if(!W.current){let i=[...new Set([...r,...u]).values()];if(H(),de.current=i,me.current=n,we.current=u,x)return;f?V():B()}},[n,JSON.stringify(r),JSON.stringify(u),W,x,f]),F(()=>{if(W.current)W.current=!1;else{if(N.current=t,x)return;T.current?oe():V()}},[t,x,W,T]),{message:Ze,start:V,reset:oe,pause:fe,resume:he,isIdle:et,isPrompted:tt,isLeader:rt,getRemainingTime:Re,getElapsedTime:nt,getTotalElapsedTime:Ae,getLastIdleTime:ot,getLastActiveTime:it,getTotalIdleTime:Oe,getTotalActiveTime:st}}import yt,{createContext as Lt,useContext as Mt}from\"react\";var ce=Lt(null);function kt(t){let e=$(t);return yt.createElement(ce.Provider,{value:e},t.children)}var xt=ce.Consumer;function Pt(){return Mt(ce)}export{xt as IdleTimerConsumer,ce as IdleTimerContext,kt as IdleTimerProvider,bt as createMocks,$ as useIdleTimer,Pt as useIdleTimerContext,It as withIdleTimer,Et as workerTimers};\n"],"sourceRoot":""}