(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5991],{4151:(e,t,n)=>{"use strict";n.d(t,{Kq:()=>i,Pj:()=>s,Xr:()=>g,fp:()=>m,md:()=>C});var r=n(39355),o=n(72243),a=n(19848);let l=(0,r.createContext)(void 0);function s(e){let t=(0,r.useContext)(l);return(null==e?void 0:e.store)||t||(0,o.zp)()}function i(e){let{children:t,store:n}=e,a=(0,r.useRef)(void 0);return n||a.current||(a.current=(0,o.y$)()),(0,r.createElement)(l.Provider,{value:n||a.current},t)}let u=e=>"function"==typeof(null==e?void 0:e.then),d=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},c=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw d(e),e}),f=new WeakMap,h=(e,t)=>{let n=f.get(e);return n||(n=new Promise((r,o)=>{let l=e,s=e=>t=>{l===e&&r(t)},i=e=>t=>{l===e&&o(t)},d=()=>{try{let e=t();u(e)?(f.set(e,n),l=e,e.then(s(e),i(e)),(0,a.MO)(e,d)):r(e)}catch(e){o(e)}};e.then(s(e),i(e)),(0,a.MO)(e,d)}),f.set(e,n)),n};function C(e,t){let{delay:n,unstable_promiseStatus:o=!r.use}=t||{},a=s(t),[[l,i,f],C]=(0,r.useReducer)(t=>{let n=a.get(e);return Object.is(t[0],n)&&t[1]===a&&t[2]===e?t:[n,a,e]},void 0,()=>[a.get(e),a,e]),g=l;if((i!==a||f!==e)&&(C(),g=a.get(e)),(0,r.useEffect)(()=>{let t=a.sub(e,()=>{if(o)try{let t=a.get(e);u(t)&&d(h(t,()=>a.get(e)))}catch(e){}if("number"==typeof n)return void setTimeout(C,n);C()});return C(),t},[a,e,n,o]),(0,r.useDebugValue)(g),u(g)){let t=h(g,()=>a.get(e));return o&&d(t),c(t)}return g}function g(e,t){let n=s(t);return(0,r.useCallback)(function(){for(var t=arguments.length,r=Array(t),o=0;o{"use strict";n.d(t,{MO:()=>p,_w:()=>g,eE:()=>m});let r=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,o=e=>"v"in e||"e"in e,a=e=>{if("e"in e)throw e.e;if(!("v"in e))throw Error("[Bug] atom state is not initialized");return e.v},l=new WeakMap,s=e=>{var t;return u(e)&&!!(null==(t=l.get(e))?void 0:t[0])},i=(e,t)=>{let n=l.get(e);if(!n){n=[!0,new Set],l.set(e,n);let t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)},u=e=>"function"==typeof(null==e?void 0:e.then),d=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},c=(e,t,n)=>{let r=n(e),o="v"in r,a=r.v;if(u(t))for(let o of r.d.keys())d(e,t,n(o));r.v=t,delete r.e,o&&Object.is(a,r.v)||(++r.n,u(a)&&(e=>{let t=l.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach(e=>e()))})(a))},f=(e,t,n)=>{var r;let o=new Set;for(let t of(null==(r=n.get(e))?void 0:r.t)||[])n.has(t)&&o.add(t);for(let e of t.p)o.add(e);return o},h=()=>{let e={},t=new WeakMap,n=n=>{var r,o;null==(r=t.get(e))||r.forEach(e=>e(n)),null==(o=t.get(n))||o.forEach(e=>e())};return n.add=(n,r)=>{let o=n||e,a=(t.has(o)?t:t.set(o,new Set)).get(o);return a.add(r),()=>{null==a||a.delete(r),a.size||t.delete(o)}},n},C=Symbol(),g=(e=new WeakMap,t=new WeakMap,n=new WeakMap,l=new Set,h=new Set,g=new Set,m={},p=(e,...t)=>e.read(...t),w=(e,...t)=>e.write(...t),v=(e,t)=>{var n;return null==(n=e.unstable_onInit)?void 0:n.call(e,t)},y=(e,t)=>{var n;return null==(n=e.onMount)?void 0:n.call(e,t)},...F)=>{let b=F[0]||(t=>{if(!t)throw Error("Atom is undefined or null");let n=e.get(t);return n||(n={d:new Map,p:new Set,n:0},e.set(t,n),null==v||v(t,j)),n}),_=F[1]||(()=>{let e=[],n=t=>{try{t()}catch(t){e.push(t)}};do{m.f&&n(m.f);let e=new Set,r=e.add.bind(e);l.forEach(e=>{var n;return null==(n=t.get(e))?void 0:n.l.forEach(r)}),l.clear(),g.forEach(r),g.clear(),h.forEach(r),h.clear(),e.forEach(n),l.size&&E()}while(l.size||g.size||h.size);if(e.length)throw AggregateError(e)}),E=F[2]||(()=>{let e=[],r=new WeakSet,o=new WeakSet,a=Array.from(l);for(;a.length;){let l=a[a.length-1],s=b(l);if(o.has(l)){a.pop();continue}if(r.has(l)){if(n.get(l)===s.n)e.push([l,s]);else if(n.has(l))throw Error("[Bug] invalidated atom exists");o.add(l),a.pop();continue}for(let e of(r.add(l),f(l,s,t)))r.has(e)||a.push(e)}for(let t=e.length-1;t>=0;--t){let[r,o]=e[t],a=!1;for(let e of o.d.keys())if(e!==r&&l.has(e)){a=!0;break}a&&(k(r),M(r)),n.delete(r)}}),k=F[3]||(e=>{var f;let h,C,g=b(e);if(o(g)&&(t.has(e)&&n.get(e)!==g.n||Array.from(g.d).every(([e,t])=>k(e).n===t)))return g;g.d.clear();let w=!0,v=()=>{t.has(e)&&(M(e),E(),_())},y=g.n;try{let n=p(e,n=>{var l;if(r(e,n)){let e=b(n);if(!o(e))if("init"in n)c(n,n.init,b);else throw Error("no atom init");return a(e)}let i=k(n);try{return a(i)}finally{g.d.set(n,i.n),s(g.v)&&d(e,g.v,i),null==(l=t.get(n))||l.t.add(e),w||v()}},{get signal(){return h||(h=new AbortController),h.signal},get setSelf(){return e.write||console.warn("setSelf function cannot be used with read-only atom"),!C&&e.write&&(C=(...t)=>{if(w&&console.warn("setSelf function cannot be called in sync"),!w)try{return A(e,...t)}finally{E(),_()}}),C}});return c(e,n,b),u(n)&&(i(n,()=>null==h?void 0:h.abort()),n.then(v,v)),g}catch(e){return delete g.v,g.e=e,++g.n,g}finally{w=!1,y!==g.n&&n.get(e)===y&&(n.set(e,g.n),l.add(e),null==(f=m.c)||f.call(m,e))}}),S=F[4]||(e=>{let r=[e];for(;r.length;){let e=r.pop(),o=b(e);for(let a of f(e,o,t)){let e=b(a);n.set(a,e.n),r.push(a)}}}),A=F[5]||((e,...t)=>{let n=!0;try{return w(e,e=>a(k(e)),(t,...o)=>{var a;let s=b(t);try{if(!r(e,t))return A(t,...o);{if(!("init"in t))throw Error("atom not writable");let e=s.n,n=o[0];c(t,n,b),M(t),e!==s.n&&(l.add(t),null==(a=m.c)||a.call(m,t),S(t));return}}finally{n||(E(),_())}},...t)}finally{n=!1}}),M=F[6]||(e=>{var n;let r=b(e),o=t.get(e);if(o&&!s(r.v)){for(let[t,a]of r.d)if(!o.d.has(t)){let r=b(t);O(t).t.add(e),o.d.add(t),a!==r.n&&(l.add(t),null==(n=m.c)||n.call(m,t),S(t))}for(let t of o.d||[])if(!r.d.has(t)){o.d.delete(t);let n=x(t);null==n||n.t.delete(e)}}}),O=F[7]||(e=>{var n;let r=b(e),o=t.get(e);if(!o){for(let t of(k(e),r.d.keys()))O(t).t.add(e);o={l:new Set,d:new Set(r.d.keys()),t:new Set},t.set(e,o),null==(n=m.m)||n.call(m,e),e.write&&h.add(()=>{let t=!0;try{let n=y(e,(...n)=>{try{return A(e,...n)}finally{t||(E(),_())}});n&&(o.u=()=>{t=!0;try{n()}finally{t=!1}})}finally{t=!1}})}return o}),x=F[8]||(e=>{var n;let r=b(e),o=t.get(e);if(o&&!o.l.size&&!Array.from(o.t).some(n=>{var r;return null==(r=t.get(n))?void 0:r.d.has(e)})){for(let a of(o.u&&g.add(o.u),o=void 0,t.delete(e),null==(n=m.u)||n.call(m,e),r.d.keys())){let t=x(a);null==t||t.t.delete(e)}return}return o}),j={get:e=>a(k(e)),set:(e,...t)=>{try{return A(e,...t)}finally{E(),_()}},sub:(e,t)=>{let n=O(e).l;return n.add(t),_(),()=>{n.delete(t),x(e),_()}}};return Object.defineProperty(j,C,{value:[e,t,n,l,h,g,m,p,w,v,y,b,_,E,k,S,A,M,O,x]}),j},m=e=>(e.c||(e.c=h()),e.m||(e.m=h()),e.u||(e.u=h()),e.f||(e.f=(()=>{let e=new Set,t=()=>{e.forEach(e=>e())};return t.add=t=>(e.add(t),()=>{e.delete(t)}),t})()),e),p=i},62051:e=>{function t(e,t,n,r){return Math.round(e/n)+" "+r+(t>=1.5*n?"s":"")}e.exports=function(e,n){n=n||{};var r,o,a,l,s=typeof e;if("string"===s&&e.length>0){var i=e;if(!((i=String(i)).length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(u){var d=parseFloat(u[1]);switch((u[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*d;case"weeks":case"week":case"w":return 6048e5*d;case"days":case"day":case"d":return 864e5*d;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*d;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*d;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:break}}}return}if("number"===s&&isFinite(e)){return n.long?(o=Math.abs(r=e))>=864e5?t(r,o,864e5,"day"):o>=36e5?t(r,o,36e5,"hour"):o>=6e4?t(r,o,6e4,"minute"):o>=1e3?t(r,o,1e3,"second"):r+" ms":(l=Math.abs(a=e))>=864e5?Math.round(a/864e5)+"d":l>=36e5?Math.round(a/36e5)+"h":l>=6e4?Math.round(a/6e4)+"m":l>=1e3?Math.round(a/1e3)+"s":a+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},72243:(e,t,n)=>{"use strict";let r,o;n.d(t,{eU:()=>s,y$:()=>d,zp:()=>c});var a=n(19848);let l=0;function s(e,t){let n=`atom${++l}`,r={toString(){return this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=i,r.write=u),t&&(r.write=t),r}function i(e){return e(this)}function u(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function d(){return r?r():(()=>{let e=0,t=(0,a.eE)({}),n=new WeakMap,r=new WeakMap,o=(0,a._w)(n,r,void 0,void 0,void 0,void 0,t,void 0,(t,n,r,...o)=>e?r(t,...o):t.write(n,r,...o)),l=new Set;return t.m.add(void 0,e=>{l.add(e),n.get(e).m=r.get(e)}),t.u.add(void 0,e=>{l.delete(e);let t=n.get(e);delete t.m}),Object.assign(o,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),n),dev4_get_mounted_atoms:()=>l,dev4_restore_atoms:t=>{o.set({read:()=>null,write:(n,r)=>{++e;try{for(let[e,n]of t)"init"in e&&r(e,n)}finally{--e}}})}})})()}function c(){return o||(o=d(),globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=o),globalThis.__JOTAI_DEFAULT_STORE__!==o&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044")),o}},76518:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,a,l=null;function s(...e){if(!s.enabled)return;let r=Number(new Date);s.diff=r-(n||r),s.prev=n,s.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,r)=>{if("%%"===n)return"%";o++;let a=t.formatters[r];if("function"==typeof a){let t=e[o];n=a.call(s,t),e.splice(o,1),o--}return n}),t.formatArgs.call(s,e),(s.log||t.log).apply(s,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==l?l:(o!==t.namespaces&&(o=t.namespaces,a=t.enabled(e)),a),set:e=>{l=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,n){let r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e,t){let n=0,r=0,o=-1,a=0;for(;n"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){for(let n of(t.save(e),t.namespaces=e,t.names=[],t.skips=[],("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===n[0]?t.skips.push(n.slice(1)):t.names.push(n)},t.enabled=function(e){for(let n of t.skips)if(o(e,n))return!1;for(let n of t.names)if(o(e,n))return!0;return!1},t.humanize=n(62051),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{var r=n(37811);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))}),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},t.useColors=function(){let e;return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(76518)(t);let{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}}]);