"use strict";(self.webpackChunkname=self.webpackChunkname||[]).push([[781],{781:(e,t,n)=>{n.d(t,{qs:()=>u,O4:()=>c});const r=Symbol(),o=Symbol();!function(e){let t,n;const r={getItem:r=>{var i,s;const u=e=>{if(t!==(e=e||"")){try{n=JSON.parse(e)}catch{return o}t=e}return n},a=null!=(s=null==(i=e())?void 0:i.getItem(r))?s:null;return a instanceof Promise?a.then(u):u(a)},setItem:(t,n)=>{var r;return null==(r=e())?void 0:r.setItem(t,JSON.stringify(n))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(r.subscribe=(e,t)=>{const n=n=>{n.key===e&&n.newValue&&t(JSON.parse(n.newValue))};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}})}((()=>"undefined"!=typeof window?window.localStorage:void 0));var i=n(80620);n(81672);const s=()=>{const e=new WeakMap;return(t,n)=>{const r=((e,t)=>{do{const[n,...r]=t,o=e.get(n);if(!o)return;if(!r.length)return o[1];e=o[0],t=r}while(t.length)})(e,n);if(r)return r;const o=t();return((e,t,n)=>{do{const[r,...o]=t;let i=e.get(r);if(i||(i=[new WeakMap],e.set(r,i)),!o.length)return void(i[1]=n);e=i[0],t=o}while(t.length)})(e,n,o),o}};function u(e){const t=Symbol(),n=(0,i.atom)(t),o=(0,i.atom)((r=>{const o=r(n);return o!==t?o:e(r)}),((e,i,s)=>i(n,s===r?t:"function"==typeof s?s(e(o)):s)));return o}s(),s(),s(),s(),(0,i.atom)((()=>[]));const a=function(e){let t,n;const r={getItem:r=>{var i,s;const u=e=>{if(t!==(e=e||"")){try{n=JSON.parse(e)}catch{return o}t=e}return n},a=null!=(s=null==(i=e())?void 0:i.getItem(r))?s:null;return a instanceof Promise?a.then(u):u(a)},setItem:(t,n)=>{var r;return null==(r=e())?void 0:r.setItem(t,JSON.stringify(n))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};return"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(r.subscribe=(e,t)=>{const n=n=>{n.key===e&&n.newValue&&t(JSON.parse(n.newValue))};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}}),r}((()=>"undefined"!=typeof window?window.localStorage:void 0));function c(e,t,n=a){const s=()=>{const r=n.getItem(e);return r instanceof Promise?r.then((e=>e===o?t:e)):r===o?t:r},u=(0,i.atom)(n.delayInit?t:s());return u.onMount=t=>{let r;if(n.subscribe&&(r=n.subscribe(e,t),t(s())),n.delayInit){const e=s();e instanceof Promise?e.then(t):t(e)}return r},(0,i.atom)((e=>e(u)),((o,i,s)=>{const a="function"==typeof s?s(o(u)):s;return a===r?(i(u,t),n.removeItem(e)):(i(u,a),n.setItem(e,a))}))}s()}}]);