diff --git a/crmDashboard/.gitignore b/crmDashboard/.gitignore index a547bf3..a9b26d1 100644 --- a/crmDashboard/.gitignore +++ b/crmDashboard/.gitignore @@ -8,7 +8,7 @@ pnpm-debug.log* lerna-debug.log* node_modules -dist +#dist dist-ssr *.local diff --git a/crmDashboard/dist/assets/index-CQml-KSP.css b/crmDashboard/dist/assets/index-CQml-KSP.css new file mode 100644 index 0000000..1495e70 --- /dev/null +++ b/crmDashboard/dist/assets/index-CQml-KSP.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.block{display:block}.flex{display:flex}.hidden{display:none}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.border{border-style:var(--tw-border-style);border-width:1px}.uppercase{text-transform:uppercase}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}html,body{overflow-x:hidden}html.dark{color:#e4e4e7;background-color:#09090b}html:not(.dark){color:#18181b;background-color:#fafafa}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false} diff --git a/crmDashboard/dist/assets/index-MZB5x9l0.js b/crmDashboard/dist/assets/index-MZB5x9l0.js new file mode 100644 index 0000000..c485c23 --- /dev/null +++ b/crmDashboard/dist/assets/index-MZB5x9l0.js @@ -0,0 +1,169 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1ie||(e.current=re[ie],re[ie]=null,ie--)}function L(e,t){ie++,re[ie]=e.current,e.current=t}var oe=ae(null),se=ae(null),ce=ae(null),le=ae(null);function ue(e,t){switch(L(ce,t),L(se,e),L(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xd(t),e=Zd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}I(oe),L(oe,e)}function de(){I(oe),I(se),I(ce)}function R(e){e.memoizedState!==null&&L(le,e);var t=oe.current,n=Zd(t,e.type);t!==n&&(L(se,e),L(oe,n))}function fe(e){se.current===e&&(I(oe),I(se)),le.current===e&&(I(le),np._currentValue=ne)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.textContent,a=i.length;for(e=0;e=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=hn(),mn=pn=fn=null,$n=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Or=ln&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==It(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=Pd(Ar,`onSelect`),0>=o,i-=o,Ti=1<<32-Le(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Pi&&Di(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Pi&&Di(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Pi&&Di(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Pi&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Vl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Wl&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ql|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=P.T,s={};P.T=s,Ls(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ga(c,r),bu(e)):Is(e,t,r,bu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},bu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,ne,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},bu())}function As(){return ta(np)}function js(){return No().memoizedState}function Ms(){return No().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=bu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(Su(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=bu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ti(e,t,n,r),n!==null&&(Su(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,bu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Hl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return Su(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:vd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&Su(t,e,2)}function Rs(e){var t=e.alternate;return e===B||t!==null&&t===B}function zs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Vs={readContext:ta,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Vs.useEffectEvent=Co;var Hs={readContext:ta,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){Ie(!0);try{n(t)}finally{Ie(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ps.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,B,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=Mo();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Hl===null)throw Error(i(349));Wl&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=Hl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Ud(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ic(t)}}return Vc(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ce.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Bd(e.nodeValue,n)),e||Ri(t,!0)}else e=Yd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Vc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Vc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),zc(t,t.updateQueue),Vc(t),null);case 4:return de(),e===null&&Ad(t.stateNode.containerInfo),Vc(t),null;case 10:return Yi(t.type),Vc(t),null;case 19:if(I(uo),r=t.memoizedState,r===null)return Vc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Bc(r,!1);else{if(Zl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Bc(r,!1),e=o.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return L(uo,uo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>cu&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Vc(t),null}else 2*Te()-r.renderingStartTime>cu&&n!==536870912&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Vc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=uo.current,L(uo,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Vc(t),t.subtreeFlags&6&&(t.flags|=8192)):Vc(t),n=t.updateQueue,n!==null&&zc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&I(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Vc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Uc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(uo),null;case 4:return de(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&I(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Wc(e,t){switch(Ai(t),t.tag){case 3:Yi(sa),de();break;case 26:case 27:case 5:fe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:I(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&I(va);break;case 24:Yi(sa)}}function Gc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Zu(t,t.return,e)}}function Kc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Zu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Zu(t,t.return,e)}}function qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){Zu(e,e.return,t)}}}function Jc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Zu(e,t,n)}}function Yc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Zu(e,t,n)}}function Xc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Zu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Zu(e,t,n)}else n.current=null}function Zc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Zu(e,e.return,t)}}function Qc(e,t,n){try{var r=e.stateNode;Wd(r,e.type,n,t),r[st]=t}catch(t){Zu(e,e.return,t)}}function $c(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sf(e.type)||e.tag===4}function el(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||$c(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&sf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&sf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ud(t,r,n),t[ot]=e,t[st]=n}catch(t){Zu(e,e.return,t)}}var il=!1,al=!1,ol=!1,sl=typeof WeakSet==`function`?WeakSet:Set,cl=null;function ll(e,t){if(e=e.containerInfo,qd=dp,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},dp=!1,cl=t;cl!==null;)if(t=cl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,cl=e;else for(;cl!==null;){switch(t=cl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Ud(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,P.T=null,n=gu,gu=null;var o=fu,s=mu;if(du=0,pu=fu=null,mu=0,Vl&6)throw Error(i(331));var c=Vl;if(Vl|=4,Il(o.current),Ol(o,o.current,s,n),Vl=c,dd(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{F.p=a,P.T=r,Ju(e,t)}}function Xu(e,t,n){t=_i(n,t),t=tc(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Xe(e,2),ud(e))}function Zu(e,t,n){if(e.tag===3)Xu(e,e,n);else for(;t!==null;){if(t.tag===3){Xu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(uu===null||!uu.has(r))){e=_i(n,e),n=nc(2),r=Wa(t,n,2),r!==null&&(rc(n,r,t,e),Xe(r,2),ud(r));break}}t=t.return}}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Bl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Yl=!0,i.add(n),e=$u.bind(null,e,t,n),t.then(e,e))}function $u(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Hl===e&&(Wl&n)===n&&(Zl===4||Zl===3&&(Wl&62914560)===Wl&&300>Te()-ou?!(Vl&2)&&ku(e,0):eu|=n,nu===Wl&&(nu=0)),ud(e)}function ed(e,t){t===0&&(t=Je()),e=ni(e,t),e!==null&&(Xe(e,t),ud(e))}function td(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ed(e,n)}function nd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),ed(e,n)}function rd(e,t){return xe(e,t)}var id=null,ad=null,od=!1,sd=!1,cd=!1,ld=0;function ud(e){e!==ad&&e.next===null&&(ad===null?id=ad=e:ad=ad.next=e),sd=!0,od||(od=!0,_d())}function dd(e,t){if(!cd&&sd){cd=!0;do for(var n=!1,r=id;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,gd(r,a))}else a=Wl,a=Ge(r,r===Hl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,gd(r,a));r=r.next}while(n);cd=!1}}function fd(){pd()}function pd(){sd=od=!1;var e=0;ld!==0&&ef()&&(e=ld);for(var t=Te(),n=null,r=id;r!==null;){var i=r.next,a=md(r,t);a===0?(r.next=null,n===null?id=i:n.next=i,i===null&&(ad=n)):(n=r,(e!==0||a&3)&&(sd=!0)),r=i}du!==0&&du!==5||dd(e,!1),ld!==0&&(ld=0)}function md(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Gd(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function kf(e,t,n){var r=Of;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cf.has(i)||(Cf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Ud(t,`link`,e),yt(t),r.head.appendChild(t)))}}function K(e){Tf.D(e),kf(`dns-prefetch`,e,null)}function Af(e,t){Tf.C(e,t),kf(`preconnect`,e,t)}function jf(e,t,n){Tf.L(e,t,n);var r=Of;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Lf(e);break;case`script`:a=Bf(e)}Sf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Rf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Ud(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Mf(e,t){Tf.m(e,t);var n=Of;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!Sf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Sf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Ud(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Nf(e,t,n){Tf.S(e,t,n);var r=Of;if(r&&e){var i=vt(r).hoistableStyles,a=Lf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Rf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);yt(c),Ud(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Pf(e,t){Tf.X(e,t);var n=Of;if(n&&e){var r=vt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=h({src:e,async:!0},t),(t=Sf.get(i))&&Gf(e,t),a=n.createElement(`script`),yt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t){Tf.M(e,t);var n=Of;if(n&&e){var r=vt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Sf.get(i))&&Gf(e,t),a=n.createElement(`script`),yt(a),Ud(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t,n,r){var a=(a=ce.current)?wf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Lf(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Lf(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Rf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Sf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sf.set(e,n),o||zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Bf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Lf(e){return`href="`+Rt(e)+`"`}function Rf(e){return`link[rel="stylesheet"][`+e+`]`}function q(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Ud(t,`link`,n),yt(t),e.head.appendChild(t))}function Bf(e){return`[src="`+Rt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Ud(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Lf(n.href);var o=e.querySelector(Rf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=q(n),(a=Sf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Ud(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,yt(a),a):(r=n,(a=Sf.get(o))&&(r=h({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Ud(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Uf(r,n.precedence,e));return t.instance}function Uf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Yf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Lf(r.href),a=t.querySelector(Rf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=J.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=q(r),(i=Sf.get(i))&&Wf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Ud(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=J.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&Y(e,e.stylesheets),0Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function J(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Y(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ep=null;function Y(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ep=new Map,t.forEach(tp,e),ep=null,J.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=ep.get(e);if(n)var r=n.get(null);else{n=new Map,ep.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=typeof window<`u`?_.useLayoutEffect:_.useEffect;function y(e){let t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function b(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function x(e){let t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function S(e){return e[e.length-1]}function C(e){return typeof e==`function`}function w(e,t){return C(e)?e(t):e}var T=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;function D(e){for(let t in e)if(T.call(e,t))return!0;return!1}var O=()=>Object.create(null),k=(e,t)=>A(e,t,O);function A(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ee(e)&&ee(i);if(!a&&!(M(e)&&M(i)))return i;let o=a?e:j(e);if(!o)return i;let s=a?i:j(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;ti||!te(e[o],t[o],n)))return!1;return i===a}return!1}function P(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function F(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function ne(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function re(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ne(t)}var ie=[`http:`,`https:`,`mailto:`,`tel:`];function ae(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function I(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=re(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=re(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function L(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function oe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var le=4,ue=5;function de(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function R(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=de(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ge(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ge(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=ge(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=he(n.fullPath??n.from);e.kind=ue,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=he(n.fullPath??n.from);e.kind=le,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)fe(e,t,r,s,i,a,o)}function pe(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function me(e){if(e.pathless)for(let t of e.pathless)me(t);if(e.static)for(let t of e.static.values())me(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())me(t);if(e.dynamic?.length){e.dynamic.sort(pe);for(let t of e.dynamic)me(t)}if(e.optional?.length){e.optional.sort(pe);for(let t of e.optional)me(t)}if(e.wildcard?.length){e.wildcard.sort(pe);for(let t of e.wildcard)me(t)}}function he(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function ge(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function _e(e,t){let n=he(`/`),r=new Uint16Array(6);for(let t of e)fe(!1,r,t,1,n,0);me(n),t.masksTree=n,t.flatCache=ce(1e3)}function ve(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Ce(e,t.masksTree);return t.flatCache.set(e,r),r}function ye(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=he(`/`),fe(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ce(r,o,n)}function be(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ce(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Te(a.route)),t.matchCache.set(r,a),a}function xe(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Se(e,t=!1,n){let r=he(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return fe(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&se(),a[e.id]=e,s!==0&&e.path){let t=xe(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),me(r),{processedTree:{segmentTree:r,singleCache:ce(1e3),matchCache:ce(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ce(e,t,n=!1){let r=e.split(`/`),i=De(e,r,t,n);if(!i)return null;let[a]=we(e,r,i);return{route:i.node.route,rawParams:a}}function we(e,t,n){let r=Ee(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+Oe(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+Oe(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+Oe(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+Oe(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;ee.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===le)>(e.node.kind===le)||t.node.kind===le==(e.node.kind===le)&&t.depth>e.depth))):!0}function Me(e){return Ne(e.filter(e=>e!==void 0).join(`/`))}function Ne(e){return e.replace(/\/{2,}/g,`/`)}function Pe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Fe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Ie(e){return Fe(Pe(e))}function Le(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Re(e,t,n){return Le(e,n)===Le(t,n)}function ze({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&S(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e1&&(S(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Ne(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Be(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Ve(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ue(e,n)).join(`/`):Ue(r,n):r}function He({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s{t[0]===`?`&&(t=t.substring(1));let n=qe(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Ze(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Ge(e,r);return t?`?${t}`:``}}var Qe=`__root__`;function $e(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function et(e){return e instanceof Response&&!!e.options}var tt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},nt=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),rt=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),it=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},at=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},ot=(e,t,n)=>{if(!(!et(n)&&!We(n)))throw et(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:et(n)?`redirected`:We(n)?`notFound`:r.status===`pending`?`success`:r.status,context:it(e,t.index),isFetching:!1,error:n})),We(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),et(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},st=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},ct=(e,t,n)=>{let r=it(e,n);e.updateMatch(t,e=>({...e,context:r}))},lt=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,ot(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,ot(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!et(n)&&!We(n)&&(e.serialError??=n)},ut=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!rt(e,t)&&(n.options.loader||n.options.beforeLoad||xt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{tt(e)},i);r._nonReactive.pendingTimeout=t}},dt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ut(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&ot(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},ft=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=P(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&<(e,n,o),s&<(e,n,s),ut(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=P();let f={...it(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=rt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(et(r)||We(r))&&(u(),lt(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),F(y))return u(),y.catch(t=>{lt(e,n,t)}).then(v)}catch(t){u(),lt(e,n,t)}v(y)},pt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>ft(e,n,t,i),s=()=>{if(st(e,n))return;let t=dt(e,n,i);return F(t)?t.then(o):o()};return a()},mt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},ht=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=it(e,r),d=rt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},gt=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{bt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(ht(e,t,n,r,i)),l=!!s&&F(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;ot(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:it(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:it(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,We(t)&&await i.options.notFoundComponent?.preload?.(),ot(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,ot(e,e.router.getMatch(n),t)}!et(o)&&!We(o)&&await bt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:it(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),ot(e,r,t)}},_t=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(ht(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await gt(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){et(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await gt(e,t,i,n,d):ct(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(st(e,i)){if(!e.router.getMatch(i))return e.matches[n];ct(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=rt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&ot(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=P(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function vt(e){let t=e,n=[];nt(t.router)&&tt(t);let r;for(let e=0;e({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await bt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await bt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=mt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=tt(t);if(F(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function yt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function bt(e,t=St){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===St?(()=>{if(e._componentsPromise===void 0){let t=yt(e,St);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():yt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function xt(e){for(let t of St)if(e.options[t]?.preload)return!0;return!1}var St=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function Ct(e){return{input:({url:t})=>{for(let n of e)t=Tt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Et(e[n],t);return t}}}function wt(e){let t=Ie(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Me([`/`,t,e.pathname]),e)}}function Tt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Et(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Dt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Ot(o,_.get())),x=r(()=>Ot(s,v.get())),S=r(()=>Ot(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=ce(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){kt(e,o,_,n,i)}function j(e){kt(e,s,v,n,i)}function M(e){kt(e,c,y,n,i)}return k}function Ot(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function kt(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}oe(n.get(),a)||n.set(a)})}var At=`__TSR_index`,jt=`popstate`,Mt=`beforeunload`;function Nt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Lt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[At];i=Pt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[At];i=Pt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[At]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Pt(e,t){t||={};let n=Rt();return{...t,key:n,__TSR_key:n,[At]:e}}function Ft(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Lt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Rt();t.history.replaceState({[At]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Lt(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[At]-l.state[At],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Nt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Mt,S,{capture:!0}),t.removeEventListener(jt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Mt,S,{capture:!0}),t.addEventListener(jt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function It(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Lt(e,t){let n=It(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Rt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[At]:0,key:a,__TSR_key:a}}}function Rt(){return(Math.random()+1).toString(36).substring(7)}function zt(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Bt=new WeakMap,Vt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Be(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Ft()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=ce(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Dt(Wt(this.latestLocation),e),dn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Ie(o);t&&t!==`/`&&e.push(wt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ct(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Se(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&_e(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:I(e).path,external:!1,searchStr:o,search:k(t?.search,i),hash:I(r.slice(1)).path,state:A(t?.state,a)}}let o=new URL(i,this.origin),s=Tt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:I(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:k(t?.search,c),hash:I(s.hash.slice(1)).path,state:A(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>ze({base:e,to:t.includes(`//`)?Ne(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Kt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,w(t.params,s)),d=this.routesByPath[Fe(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&D(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:I(He({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Gt(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=qt({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=k(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?w(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?w(t.state,n.state):{};v=A(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Et(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=L(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=ve(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,w(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=te(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Fe(this.latestLocation.href)===Fe(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=P(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Lt(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Tt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ae(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Bt.set(this.latestLocation,t):Bt.delete(this.latestLocation);let n=this.latestLocation,r=zt(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await vt({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){et(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):We(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(zt(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ae(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=bt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await vt({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(et(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});We(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=ye(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!te(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?te(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Ye,parseSearch:e.parseSearch??Je,protocolAllowlist:e.protocolAllowlist??ie}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Te(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Fe(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Yt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;nthis.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=S(t),i={...e.search};for(let e of t)try{Object.assign(i,Gt(e.options.validateSearch,i))}catch{}let a=S(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Xt(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Ht=class extends Error{},Ut=class extends Error{};function Wt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Gt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Ht(`Async validation not supported`);if(n.issues)throw new Ht(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Kt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Fe(e),a,o=be(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function qt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Jt(n)(e,t,r??!1)}function Jt(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Gt(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:w(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Yt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Qe}function Xt(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function Zt(){try{return sessionStorage}catch{return}}var Qt=`tsr-scroll-restoration-v1_3`,$t=Zt();function en(){try{return JSON.parse($t?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function tn(){try{$t?.setItem(Qt,JSON.stringify(nn))}catch{}}var nn=en(),rn=`data-scroll-restoration-id`,an=e=>e.state.__TSR_key||e.href;function on(e){let t=e.getAttribute(rn);if(t)return`[${rn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var sn=!1,cn=`window`;function ln(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function un(e){let t=[];for(let n of e){if(n===cn)continue;let e=ln(n);e&&t.push(e)}return t}function dn(e,t){if((t??e.options.scrollRestoration)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup)return;e.isScrollRestorationSetup=!0,sn=!1;let n=e.options.getScrollRestorationKey||an,r=new Map,i=(e,t,n)=>{let i=r.get(e)||{};i.scrollX=t,i.scrollY=n,r.set(e,i)};history.scrollRestoration=`manual`;let a=t=>{if(!(sn||!e.isScrollRestoring))if(t.target===document)i(cn,scrollX,scrollY);else{let e=t.target;i(e,e.scrollLeft,e.scrollTop)}},o=t=>{if(!e.isScrollRestoring)return;let n=nn[t]||={};for(let[e,t]of r)e===cn?n[cn]=t:e.isConnected&&(n[on(e)]=t)};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(n(e.fromLocation)),r.clear()}),addEventListener(`pagehide`,()=>{o(n(e.stores.resolvedLocation.get()??e.stores.location.get())),tn()}),e.subscribe(`onRendered`,t=>{let i=e.options.scrollRestorationBehavior,a=e.options.scrollToTopSelectors,o=e.resetNextScroll,s;if(r.clear(),o||(e.resetNextScroll=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let c=n(t.toLocation),l=t.fromLocation&&n(t.fromLocation);if(e.isScrollRestoring&&l&&l!==c){let e=nn[l];if(e){let t=nn[c];for(let n in e){if(n===cn){if(o)continue}else{let e=ln(n);if(!e||o&&a&&(s??=un(a),s.includes(e)))continue}t||=nn[c]={},t[n]??=e[n]}}}sn=!0;try{let n=t.toLocation.hash,r=t.toLocation.state.__hashScrollIntoViewOptions??!0,l=!1;if(o){let o=Bt.get(t.toLocation),u=n&&r&&(o===`PUSH`||o===`REPLACE`),d=e.isScrollRestoring?nn[c]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:n}=d[e];if(e===cn){if(u)continue;scrollTo({top:n,left:t,behavior:i}),l=!0}else{let r=ln(e);r&&(r.scrollLeft=t,r.scrollTop=n)}}if(!l&&!n){let e={top:0,left:0,behavior:i};if(scrollTo(e),a){s??=un(a);for(let t of s)t.scrollTo(e)}}}!l&&n&&r&&document.getElementById(n)?.scrollIntoView(r)}finally{sn=!1}})}var fn=`Error preloading route! ☝️`,pn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Qe:this.parentRoute||se();let r=n?Qe:t?.path;r&&r!==`/`&&(r=Pe(r));let i=t?.id||r,a=n?Qe:Me([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Me([`/`,a]));let o=a===`__root__`?`/`:Me([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Fe(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>$e({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},mn=class extends pn{constructor(e){super(e)}},hn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),z=o(((e,t)=>{t.exports=hn()}))();function gn(e){let t=e.errorComponent??vn;return(0,z.jsx)(_n,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var _n=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function vn({error:e}){let[t,n]=_.useState(!1);return(0,z.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,z.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,z.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,z.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,z.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,z.jsx)(`div`,{children:(0,z.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,z.jsx)(`code`,{children:e.message}):null})}):null]})}function yn({children:e,fallback:t=null}){return bn()?(0,z.jsx)(_.Fragment,{children:e}):(0,z.jsx)(_.Fragment,{children:t})}function bn(){return _.useSyncExternalStore(xn,()=>!0,()=>!1)}function xn(){return()=>{}}var Sn=_.createContext(null);function Cn(e){return _.useContext(Sn)}var wn=_.createContext(void 0),Tn=_.createContext(void 0),En=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(En||{});function Dn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function On(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var kn=[],An=0,{link:jn,unlink:Mn,propagate:Nn,checkDirty:Pn,shallowPropagate:Fn}=Dn({update(e){return e._update()},notify(e){kn[Ln++]=e,e.flags&=~En.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=En.Mutable|En.Dirty,Vn(e))}}),In=0,Ln=0,Rn,zn=0;function Bn(e){try{++zn,e()}finally{--zn||Hn()}}function Vn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Mn(n,e)}function Hn(){if(!(zn>0)){for(;In{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Rn,o=t?.compare??Object.is;if(n)Rn=i,++An,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=En.Mutable|En.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Rn=a,n&&(i.flags&=~En.RecursedCheck),Vn(i)}}};return n?(i.flags=En.Mutable|En.Dirty,i.get=function(){let e=i.flags;if(e&En.Dirty||e&En.Pending&&Pn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Fn(e)}}else e&En.Pending&&(i.flags=e&~En.Pending);return Rn!==void 0&&jn(i,Rn,An),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Nn(e),Fn(e),Hn())}},i}function Wn(e){let t=()=>{let t=Rn;Rn=n,++An,n.depsTail=void 0,n.flags=En.Watching|En.RecursedCheck;try{return e()}finally{Rn=t,n.flags&=~En.RecursedCheck,Vn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:En.Watching|En.RecursedCheck,notify(){let e=this.flags;e&En.Dirty||e&En.Pending&&Pn(this.deps,this)?t():this.flags=En.Watching},stop(){this.flags=En.None,this.depsTail=void 0,Vn(this)}};return t(),n}var Gn=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Kn=o(((e,t)=>{t.exports=Gn()})),qn=o((e=>{var t=u(),n=Kn();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Jn=o(((e,t)=>{t.exports=qn()}))();function Yn(e,t){return e===t}function Xn(e,t,n=Yn){let r=(0,_.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,_.useCallback)(()=>e?.get(),[e]);return(0,Jn.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Zn={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function Qn(e){let t=Cn(),n=_.useContext(e.from?Tn:wn),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=_.useRef(void 0);return Xn(i??Zn,n=>{if((e.shouldThrow??!0)&&!n&&se(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=A(a.current,r);return a.current=e,e}return r})}function $n(e){return Qn({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function er(e){let{select:t,...n}=e;return Qn({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function tr(e){return Qn({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function nr(e){return Qn({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function rr(e){let t=Cn();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function ir(e){return Qn({...e,select:t=>e.select?e.select(t.context):t.context})}var ar=c(m(),1);function or(e,t){let n=Cn(),r=x(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:v,disabled:y,style:S,className:C,onClick:T,onBlur:E,onFocus:D,onMouseEnter:O,onMouseLeave:k,onTouchStart:A,ignoreBlocker:j,params:M,search:N,hash:ee,state:P,mask:F,reloadDocument:ne,unsafeRelative:re,from:ie,_fromLocation:I,...L}=e,oe=bn(),se=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ce=Xn(n.stores.location,e=>e,(e,t)=>e.href===t.href),le=_.useMemo(()=>{let e={_fromLocation:ce,...se};return n.buildLocation(e)},[n,ce,se]),ue=le.maskedLocation?le.maskedLocation.publicHref:le.publicHref,de=le.maskedLocation?le.maskedLocation.external:le.external,R=_.useMemo(()=>hr(ue,de,n.history,y),[y,de,ue,n.history]),fe=_.useMemo(()=>{if(R?.external)return ae(R.href,n.protocolAllowlist)?void 0:R.href;if(!gr(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ae(s,n.protocolAllowlist)?void 0:s}catch{}},[s,R,n.protocolAllowlist]),pe=_.useMemo(()=>{if(fe)return!1;if(o?.exact){if(!Re(ce.pathname,le.pathname,n.basepath))return!1}else{let e=Le(ce.pathname,n.basepath),t=Le(le.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!te(ce.search,le.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?oe&&ce.hash===le.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,ce,fe,oe,le.hash,le.pathname,le.search,n.basepath]),me=pe?w(i,{})??cr:sr,he=pe?sr:w(a,{})??sr,ge=[C,me.className,he.className].filter(Boolean).join(` `),_e=(S||me.style||he.style)&&{...S,...me.style,...he.style},[ve,ye]=_.useState(!1),be=_.useRef(!1),xe=e.reloadDocument||fe?!1:c??n.options.defaultPreload,Se=l??n.options.defaultPreloadDelay??0,Ce=_.useCallback(()=>{n.preloadRoute({...se,_builtLocation:le}).catch(e=>{console.warn(e),console.warn(fn)})},[n,se,le]);b(r,_.useCallback(e=>{e?.isIntersecting&&Ce()},[Ce]),pr,{disabled:!!y||xe!==`viewport`}),_.useEffect(()=>{be.current||!y&&xe===`render`&&(Ce(),be.current=!0)},[y,Ce,xe]);let we=e=>{let t=e.currentTarget.getAttribute(`target`),r=v===void 0?t:v;if(!y&&!vr(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,ar.flushSync)(()=>{ye(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ye(!1)});n.navigate({...se,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:j})}};if(fe)return{...L,ref:r,href:fe,...g&&{children:g},...v&&{target:v},...y&&{disabled:y},...S&&{style:S},...C&&{className:C},...T&&{onClick:T},...E&&{onBlur:E},...D&&{onFocus:D},...O&&{onMouseEnter:O},...k&&{onMouseLeave:k},...A&&{onTouchStart:A}};let Te=e=>{if(y||xe!==`intent`)return;if(!Se){Ce();return}let t=e.currentTarget;if(fr.has(t))return;let n=setTimeout(()=>{fr.delete(t),Ce()},Se);fr.set(t,n)},Ee=e=>{y||xe!==`intent`||Ce()},De=e=>{if(y||!xe||!Se)return;let t=e.currentTarget,n=fr.get(t);n&&(clearTimeout(n),fr.delete(t))};return{...L,...me,...he,href:R?.href,ref:r,onClick:mr([T,we]),onBlur:mr([E,De]),onFocus:mr([D,Te]),onMouseEnter:mr([O,Te]),onMouseLeave:mr([k,De]),onTouchStart:mr([A,Ee]),disabled:!!y,target:v,..._e&&{style:_e},...ge&&{className:ge},...y&&lr,...pe&&ur,...oe&&ve&&dr}}var sr={},cr={className:`active`},lr={role:`link`,"aria-disabled":!0},ur={"data-status":`active`,"aria-current":`page`},dr={"data-transitioning":`transitioning`},fr=new WeakMap,pr={rootMargin:`100px`},mr=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function hr(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function gr(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var _r=_.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=or(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return _.createElement(`a`,t,o)}return _.createElement(n,a,o)});function vr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var yr=class extends pn{constructor(e){super(e),this.useMatch=e=>Qn({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ir({...e,from:this.id}),this.useSearch=e=>nr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>tr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>er({...e,from:this.id}),this.useLoaderData=e=>$n({...e,from:this.id}),this.useNavigate=()=>rr({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,z.jsx)(_r,{ref:t,from:this.fullPath,...e}))}};function br(e){return new yr(e)}var xr=class extends mn{constructor(e){super(e),this.useMatch=e=>Qn({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ir({...e,from:this.id}),this.useSearch=e=>nr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>tr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>er({...e,from:this.id}),this.useLoaderData=e=>$n({...e,from:this.id}),this.useNavigate=()=>rr({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,z.jsx)(_r,{ref:t,from:this.fullPath,...e}))}};function Sr(e){return new xr(e)}function Cr(e){let t=Cn(),n=`not-found-${Xn(t.stores.location,e=>e.pathname)}-${Xn(t.stores.status,e=>e)}`;return(0,z.jsx)(gn,{getResetKey:()=>n,onCatch:(t,n)=>{if(We(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(We(t))return e.fallback?.(t);throw t},children:e.children})}function wr(){return(0,z.jsx)(`p`,{children:`Not Found`})}function Tr(e){return(0,z.jsx)(z.Fragment,{children:e.children})}function Er(e,t,n){return t.options.notFoundComponent?(0,z.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,z.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,z.jsx)(wr,{})}var Dr=_.memo(function({matchId:e}){let t=Cn(),n=t.stores.matchStores.get(e);n||se();let r=Xn(t.stores.loadedAt,e=>e),i=Xn(n,e=>e);return(0,z.jsx)(Or,{router:t,matchId:e,resetKey:r,matchState:_.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Or({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,z.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?_.Suspense:Tr,f=s?gn:Tr,p=l?Cr:Tr;return(0,z.jsxs)(i.isRoot?i.options.shellComponent??Tr:Tr,{children:[(0,z.jsx)(wn.Provider,{value:t,children:(0,z.jsx)(d,{fallback:o,children:(0,z.jsx)(f,{getResetKey:()=>n,errorComponent:s||vn,onCatch:(e,t)=>{if(We(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,z.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return _.createElement(l,e)},children:u||r._displayPending?(0,z.jsx)(yn,{fallback:o,children:(0,z.jsx)(Ar,{matchId:t})}):(0,z.jsx)(Ar,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(kr,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function kr({resetKey:e}){let t=Cn(),n=_.useRef(void 0);return v(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...zt(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Ar=_.memo(function({matchId:e}){let t=Cn(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||se();let i=Xn(r,e=>e),a=i.routeId,o=t.routesById[a],s=_.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=_.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,z.jsx)(e,{},s):(0,z.jsx)(jr,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=P();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return We(i.error)||se(),Er(t,o,i.error);if(i.status===`redirected`)throw et(i.error)||se(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),jr=_.memo(function(){let e=Cn(),t=_.useContext(wn),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Xn(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=Xn(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,z.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||se(),Er(e,a,void 0);if(!i)return null;let s=(0,z.jsx)(Dr,{matchId:i});return n===`__root__`?(0,z.jsx)(_.Suspense,{fallback:o,children:s}):s});function Mr(){let e=Cn(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),i=Xn(e.stores.isLoading,e=>e),a=Xn(e.stores.hasPending,e=>e),o=y(i),s=i||n||a,c=y(s),l=i||a,u=y(l);return e.startTransition=e=>{r(!0),_.startTransition(()=>{e(),r(!1)})},_.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Fe(e.latestLocation.publicHref)!==Fe(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),v(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),v(()=>{o&&!i&&e.emit({type:`onLoad`,...zt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),v(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...zt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),v(()=>{if(c&&!s){let t=zt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Bn(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function Nr(){let e=Cn(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,z.jsx)(t,{}):null,r=(0,z.jsxs)(typeof document<`u`&&e.ssr?Tr:_.Suspense,{fallback:n,children:[(0,z.jsx)(Mr,{}),(0,z.jsx)(Pr,{})]});return e.options.InnerWrap?(0,z.jsx)(e.options.InnerWrap,{children:r}):r}function Pr(){let e=Cn(),t=Xn(e.stores.firstId,e=>e),n=Xn(e.stores.loadedAt,e=>e),r=t?(0,z.jsx)(Dr,{matchId:t}):null;return(0,z.jsx)(wn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,z.jsx)(gn,{getResetKey:()=>n,errorComponent:vn,onCatch:void 0,children:r})})}var Fr=e=>({createMutableStore:Un,createReadonlyStore:Un,batch:Bn}),Ir=e=>new Lr(e),Lr=class extends Vt{constructor(e){super(e,Fr)}};function Rr({router:e,children:t,...n}){D(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,z.jsx)(Sn.Provider,{value:e,children:t});return e.options.Wrap?(0,z.jsx)(e.options.Wrap,{children:r}):r}function zr({router:e,...t}){return(0,z.jsx)(Rr,{router:e,...t,children:(0,z.jsx)(Nr,{})})}function Br(e){let t=Cn(),n=(0,_.useRef)(void 0);return Xn(t.stores.location,r=>{let i=e?.select?e.select(r):r;if(e?.structuralSharing??t.options.defaultStructuralSharing){let e=A(n.current,i);return n.current=e,e}return i})}var Vr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Hr=new class extends Vr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Ur={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Wr=new class{#e=Ur;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Gr(e){setTimeout(e,0)}var Kr=typeof window>`u`||`Deno`in globalThis;function qr(){}function Jr(e,t){return typeof e==`function`?e(t):e}function Yr(e){return typeof e==`number`&&e>=0&&e!==1/0}function Xr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zr(e,t){return typeof e==`function`?e(t):e}function Qr(e,t){return typeof e==`function`?e(t):e}function $r(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ti(o,t.options))return!1}else if(!ri(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ei(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ni(t.options.mutationKey)!==ni(a))return!1}else if(!ri(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ti(e,t){return(t?.queryKeyHashFn||ni)(e)}function ni(e){return JSON.stringify(e,(e,t)=>ci(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ri(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ri(e[n],t[n])):!1}var ii=Object.prototype.hasOwnProperty;function ai(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=si(e)&&si(t);if(!r&&!(ci(e)&&ci(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{Wr.setTimeout(t,e)})}function di(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ai(e,t)}function fi(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function pi(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mi=Symbol();function hi(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mi?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gi(e,t){return typeof e==`function`?e(...t):!!e}function _i(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var vi=(()=>{let e=()=>Kr;return{isServer(){return e()},setIsServer(t){e=t}}})();function yi(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var bi=Gr;function xi(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=bi,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Si=xi(),Ci=new class extends Vr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function wi(e){return Math.min(1e3*2**e,3e4)}function Ti(e){return(e??`online`)===`online`?Ci.isOnline():!0}var Ei=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Di(e){let t=!1,n=0,r,i=yi(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Ei(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Hr.isFocused()&&(e.networkMode===`always`||Ci.isOnline())&&e.canRun(),u=()=>Ti(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(vi.isServer()?0:3),o=e.retryDelay??wi,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&nl()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Oi=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yr(this.gcTime)&&(this.#e=Wr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vi.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Wr.clearTimeout(this.#e),this.#e=void 0)}};function ki(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{_i(e,()=>t.signal,()=>n=!0)},u=hi(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?pi:fi;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ji:Ai,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ai(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ai(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ji(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Mi=class extends Oi{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fi(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fi(this.options);e.data!==void 0&&(this.setState(Pi(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=di(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(qr).catch(qr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Qr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zr(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Xr(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=hi(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ki(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Di({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ei&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ei){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ni(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pi(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Si.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ni(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ti(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pi(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fi(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ii=class extends Vr{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=yi(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ri(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zi(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zi(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Qr(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!oi(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Bi(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Qr(this.options.enabled,this.#t)!==Qr(t.enabled,this.#t)||Zr(this.options.staleTime,this.#t)!==Zr(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Qr(this.options.enabled,this.#t)!==Qr(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Hi(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(qr)),t}#g(){this.#b();let e=Zr(this.options.staleTime,this.#t);if(vi.isServer()||this.#r.isStale||!Yr(e))return;let t=Xr(this.#r.dataUpdatedAt,e)+1;this.#d=Wr.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(vi.isServer()||Qr(this.options.enabled,this.#t)===!1||!Yr(this.#p)||this.#p===0)&&(this.#f=Wr.setInterval(()=>{(this.options.refetchIntervalInBackground||Hr.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Wr.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Wr.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ri(e,t),o=i&&Bi(e,n,t,r);(a||o)&&(l={...l,...Ni(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=di(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=di(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Vi(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Qr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=yi())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!oi(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Si.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Li(e,t){return Qr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&Qr(t.retryOnMount,e)===!1)}function Ri(e,t){return Li(e,t)||e.state.data!==void 0&&zi(e,t,t.refetchOnMount)}function zi(e,t,n){if(Qr(t.enabled,e)!==!1&&Zr(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Vi(e,t)}return!1}function Bi(e,t,n,r){return(e!==t||Qr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Vi(e,n)}function Vi(e,t){return Qr(t.enabled,e)!==!1&&e.isStaleByTime(Zr(t.staleTime,e))}function Hi(e,t){return!oi(e.getCurrentResult(),t)}var Ui=class extends Oi{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Wi(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Di({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Si.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Wi(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Gi=class extends Vr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ui({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ki(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ki(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ki(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Ki(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Si.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ei(t,e))}findAll(e={}){return this.getAll().filter(t=>ei(e,t))}notify(e){Si.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Si.batch(()=>Promise.all(e.map(e=>e.continue().catch(qr))))}};function Ki(e){return e.options.scope?.id}var qi=class extends Vr{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),oi(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ni(t.mutationKey)!==ni(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Wi();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Si.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ji=class extends Vr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ti(r,t),a=this.get(i);return a||(a=new Mi({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Si.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>$r(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>$r(e,t)):t}notify(e){Si.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Si.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Si.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Yi=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ji,this.#t=e.mutationCache||new Gi,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Hr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ci.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Zr(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Jr(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Si.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Si.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Si.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Si.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(qr).catch(qr)}invalidateQueries(e,t={}){return Si.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Si.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(qr)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(qr)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Zr(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qr).catch(qr)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qr).catch(qr)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Ci.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ni(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ri(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ni(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ri(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ti(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===mi&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Xi=_.createContext(void 0),Zi=e=>{let t=_.useContext(Xi);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Qi=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(Xi.Provider,{value:e,children:t})),$i=_.createContext(!1),ea=()=>_.useContext($i);$i.Provider;function ta(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var na=_.createContext(ta()),ra=()=>_.useContext(na),ia=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?gi(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},aa=e=>{_.useEffect(()=>{e.clearReset()},[e])},oa=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||gi(n,[e.error,r])),sa=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ca=(e,t)=>e.isLoading&&e.isFetching&&!t,la=(e,t)=>e?.suspense&&t.isPending,ua=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function da(e,t,n){let r=ea(),i=ra(),a=Zi(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,sa(o),ia(o,i,s),aa(i);let l=!a.getQueryCache().get(o.queryHash),[u]=_.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(_.useSyncExternalStore(_.useCallback(e=>{let t=f?u.subscribe(Si.batchCalls(e)):qr;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),_.useEffect(()=>{u.setOptions(o)},[o,u]),la(o,d))throw ua(o,u,i);if(oa({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!vi.isServer()&&ca(d,r)&&(l?ua(o,u,i):s?.promise)?.catch(qr).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function fa(e,t){return da(e,Ii,t)}function pa(e,t){let n=Zi(t),[r]=_.useState(()=>new qi(n,e));_.useEffect(()=>{r.setOptions(e)},[r,e]);let i=_.useSyncExternalStore(_.useCallback(e=>r.subscribe(Si.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=_.useCallback((e,t)=>{r.mutate(e,t).catch(qr)},[r]);if(i.error&&gi(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function ma(e,...t){let n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Minified MUI error #${e}; visit ${n} for the full message.`}var ha=`$$material`;function ga(){return ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?Ra(Ya,--qa):0,Ga--,Ja===10&&(Ga=1,Wa--),Ja}function eo(){return Ja=qa2||io(Ja)>3?``:` `}function lo(e,t){for(;--t&&eo()&&!(Ja<48||Ja>102||Ja>57&&Ja<65||Ja>70&&Ja<97););return ro(e,no()+(t<6&&to()==32&&eo()==32))}function uo(e){for(;eo();)switch(Ja){case e:return qa;case 34:case 39:e!==34&&e!==39&&uo(Ja);break;case 40:e===41&&uo(e);break;case 92:eo();break}return qa}function fo(e,t){for(;eo()&&e+Ja!==57&&!(e+Ja===84&&to()===47););return`/*`+ro(t,qa-1)+`*`+ja(e===47?e:eo())}function po(e){for(;!io(to());)eo();return ro(e,qa)}function B(e){return oo(mo(``,null,null,null,[``],e=ao(e),0,[0],e))}function mo(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=eo()){case 40:if(m!=108&&Ra(C,d-1)==58){La(C+=Ia(so(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=so(v);break;case 9:case 10:case 13:case 32:C+=co(m);break;case 92:C+=lo(no()-1,7);continue;case 47:switch(to()){case 42:case 47:Ha(go(fo(eo(),no()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=Ba(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=Ia(C,/\f/g,``)),p>0&&Ba(C)-d&&Ha(p>32?_o(C+`;`,r,n,d-1):_o(Ia(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(Ha(S=ho(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123)if(u===0)mo(C,t,S,S,b,a,d,s,x);else switch(f===99&&Ra(C,3)===110?100:f){case 100:case 108:case 109:case 115:mo(e,S,S,r&&Ha(ho(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:mo(C,S,S,S,[``],x,0,s,x)}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+Ba(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&$a()==125)continue}switch(C+=ja(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(Ba(C)-1)*_,_=1;break;case 64:to()===45&&(C+=so(eo())),f=to(),u=d=Ba(y=C+=po(no())),v++;break;case 45:m===45&&Ba(C)==2&&(h=0)}}return a}function ho(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=Va(f),m=0,h=0,g=0;m0?f[_]+` `+v:Ia(v,/&\f/g,f[_])))&&(c[g++]=y);return Xa(e,t,n,i===0?Ta:s,c,l,u)}function go(e,t,n){return Xa(e,t,n,wa,ja(Qa()),za(e,2,-2),0)}function _o(e,t,n,r){return Xa(e,t,n,Ea,za(e,0,r),za(e,r+1,-1),r)}function vo(e,t){for(var n=``,r=Va(e),i=0;i6)switch(Ra(e,t+1)){case 109:if(Ra(e,t+4)!==45)break;case 102:return Ia(e,/(.+:)(.+)-([^]+)/,`$1`+Ca+`$2-$3$1`+Sa+(Ra(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~La(e,`stretch`)?ko(Ia(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(Ra(e,t+1)!==115)break;case 6444:switch(Ra(e,Ba(e)-3-(~La(e,`!important`)&&10))){case 107:return Ia(e,`:`,`:`+Ca)+e;case 101:return Ia(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+Ca+(Ra(e,14)===45?`inline-`:``)+`box$3$1`+Ca+`$2$3$1`+xa+`$2box$3`)+e}break;case 5936:switch(Ra(e,t+11)){case 114:return Ca+e+xa+Ia(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return Ca+e+xa+Ia(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return Ca+e+xa+Ia(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return Ca+e+xa+e+e}return e}var Ao=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Ea:e.return=ko(e.value,e.length);break;case Oa:return vo([Za(e,{value:Ia(e.value,`@`,`@`+Ca)})],r);case Ta:if(e.length)return Ua(e.props,function(t){switch(Fa(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return vo([Za(e,{props:[Ia(t,/:(read-\w+)/,`:`+Sa+`$1`)]})],r);case`::placeholder`:return vo([Za(e,{props:[Ia(t,/:(plac\w+)/,`:`+Ca+`input-$1`)]}),Za(e,{props:[Ia(t,/:(plac\w+)/,`:`+Sa+`$1`)]}),Za(e,{props:[Ia(t,/:(plac\w+)/,xa+`input-$1`)]})],r)}return``})}}],jo=function(e){var t=e.key;if(t===`css`){var n=document.querySelectorAll(`style[data-emotion]:not([data-s])`);Array.prototype.forEach.call(n,function(e){e.getAttribute(`data-emotion`).indexOf(` `)!==-1&&(document.head.appendChild(e),e.setAttribute(`data-s`,``))})}var r=e.stylisPlugins||Ao,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll(`style[data-emotion^="`+t+` "]`),function(e){for(var t=e.getAttribute(`data-emotion`).split(` `),n=1;n{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),No=o(((e,t)=>{t.exports=Mo()})),Po=o(((e,t)=>{var n=No(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Bo={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Vo=!1,Ho=/[A-Z]|^ms/g,Uo=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Wo=function(e){return e.charCodeAt(1)===45},Go=function(e){return e!=null&&typeof e!=`boolean`},Ko=So(function(e){return Wo(e)?e:e.replace(Ho,`-$&`).toLowerCase()}),qo=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(Uo,function(e,t,n){return Qo={name:t,styles:n,next:Qo},t})}return Bo[e]!==1&&!Wo(e)&&typeof t==`number`&&t!==0?t+`px`:t},Jo=`Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.`;function Yo(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return Qo={name:i.name,styles:i.styles,next:Qo},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)Qo={name:o.name,styles:o.styles,next:Qo},o=o.next;return a.styles+`;`}return Xo(e,t,n);case`function`:if(e!==void 0){var s=Qo,c=n(e);return Qo=s,Yo(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function Xo(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i96?ys:bs},Ss=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return typeof r!=`function`&&n&&(r=e.__emotion_forwardProp),r},Cs=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Lo(t,n,r),ns(function(){return Ro(t,n,r)}),null},ws=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,a,o;n!==void 0&&(a=n.label,o=n.target);var s=Ss(t,n,r),c=s||xs(i),l=!c(`as`);return function(){var u=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(a!==void 0&&d.push(`label:`+a+`;`),u[0]==null||u[0].raw===void 0)d.push.apply(d,u);else{var f=u[0];d.push(f[0]);for(var p=u.length,m=1;mt(Ds(e)?n:e):t})}function ks(e,t){return Es(e,t)}function As(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}var js=[];function Ms(e){return js[0]=e,$o(js)}var Ns=o((e=>{var t=Symbol.for(`react.fragment`),n=Symbol.for(`react.strict_mode`),r=Symbol.for(`react.profiler`),i=Symbol.for(`react.consumer`),a=Symbol.for(`react.context`),o=Symbol.for(`react.forward_ref`),s=Symbol.for(`react.suspense`),c=Symbol.for(`react.suspense_list`),l=Symbol.for(`react.memo`),u=Symbol.for(`react.lazy`),d=Symbol.for(`react.client.reference`);e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===t||e===r||e===n||e===s||e===c||typeof e==`object`&&e&&(e.$$typeof===u||e.$$typeof===l||e.$$typeof===a||e.$$typeof===i||e.$$typeof===o||e.$$typeof===d||e.getModuleId!==void 0))}})),Ps=o(((e,t)=>{t.exports=Ns()}))();function Fs(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Is(e){if(_.isValidElement(e)||(0,Ps.isValidElementType)(e)||!Fs(e))return e;let t={};return Object.keys(e).forEach(n=>{t[n]=Is(e[n])}),t}function Ls(e,t,n={clone:!0}){let r=n.clone?{...e}:e;return Fs(e)&&Fs(t)&&Object.keys(t).forEach(i=>{_.isValidElement(t[i])||(0,Ps.isValidElementType)(t[i])?r[i]=t[i]:Fs(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Fs(e[i])?r[i]=Ls(e[i],t[i],n):n.clone?r[i]=Fs(t[i])?Is(t[i]):t[i]:r[i]=t[i]}),r}var Rs=e=>{let t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})};function zs(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n=`px`,step:r=5,...i}=e,a=Rs(t),o=Object.keys(a);function s(e){return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n})`}function c(e){return`@media (max-width:${(typeof t[e]==`number`?t[e]:e)-r/100}${n})`}function l(e,i){let a=o.indexOf(i);return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n}) and (max-width:${(a!==-1&&typeof t[o[a]]==`number`?t[o[a]]:i)-r/100}${n})`}function u(e){return o.indexOf(e)+1(e.match(Bs)?.[1]||0)-+(t.match(Bs)?.[1]||0));let r=t;for(let e=0;et.startsWith(`@${e}`))||!!t.match(/^@\d/))}function Ws(e,t){let n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;let[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function Gs(e){let t=(e,t)=>e.replace(`@media`,t?`@container ${t}`:`@container`);function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{let i=t(e.breakpoints.not(...n),r);return i.includes(`not all and`)?i.replace(`not all and `,``).replace(`min-width:`,`width<`).replace(`max-width:`,`width>`).replace(`and`,`or`):i}}let r={},i=e=>(n(r,e),r);return n(i),{...e,containerQueries:i}}var Ks={borderRadius:4};function qs(e){if(e==null)return!0;for(let t in e)return!1;return!0}function Js(e,t){let n=Array.isArray(t),r=Array.isArray(e);return $s(t)?t:ec(e)?tc(t):n&&r?Zs(e,t):n===r?nc(e,t):tc(t)}function Ys(e){let t=0,n=e.length,r=Array(n);for(t=0;t({up:t=>{let n=typeof t==`number`?t:ic[t]||t;return typeof n==`number`&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function sc(e,t,n){let r={};return cc(r,e.theme,t,(e,t,i)=>{let a=n(t,i);e?r[e]=a:Js(r,a)})}function cc(e,t,n,r){if(t??=rc,Array.isArray(n)){let i=t.breakpoints??ac;for(let t=0;t{if(e[t]==null)return null;let a=e[t],o=e.theme,s=hc(o,r)||{};return sc(e,a,e=>{let r=mc(s,i,e,t);return n===!1?r:{[n]:r}})};return a.propTypes={},a.filterProps=[t],a}var vc={internal_cache:{}},yc={m:`margin`,p:`padding`},bc={t:`Top`,r:`Right`,b:`Bottom`,l:`Left`,x:[`Left`,`Right`],y:[`Top`,`Bottom`]},xc={marginX:`mx`,marginY:`my`,paddingX:`px`,paddingY:`py`},Sc={};for(let e in yc)Sc[e]=[yc[e]];for(let e in yc)for(let t in bc){let n=yc[e],r=bc[t],i=Array.isArray(r)?r.map(e=>n+e):[n+r];Sc[e+t]=i}for(let e in xc)Sc[e]=Sc[xc[e]];var Cc=new Set([`m`,`mt`,`mr`,`mb`,`ml`,`mx`,`my`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginX`,`marginY`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`]),wc=new Set([`p`,`pt`,`pr`,`pb`,`pl`,`px`,`py`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingX`,`paddingY`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`]),Tc=new Set([...Cc,...wc]);function Ec(e,t,n,r){let i=hc(e,t,!0)??n;return typeof i==`number`||typeof i==`string`?e=>typeof e==`string`?e:typeof i==`string`?i.startsWith(`var(`)&&e===0?0:i.startsWith(`var(`)&&e===1?i:`calc(${e} * ${i})`:i*e:Array.isArray(i)?e=>{if(typeof e==`string`)return e;let t=i[Math.abs(e)];return e>=0?t:typeof t==`number`?-t:typeof t==`string`&&t.startsWith(`var(`)?`calc(-1 * ${t})`:`-${t}`}:typeof i==`function`?i:()=>void 0}function Dc(e){return Ec(e,`spacing`,8,`spacing`)}function Oc(e,t){return typeof t==`string`||t==null?t:e(t)}var kc=[``];function Ac(e,t){let n=e.theme??vc,r=n?.internal_cache?.unarySpacing??Dc(n),i={};for(let n in e){if(!t.has(n))continue;let a=Sc[n]??(kc[0]=n,kc),o=e[n];cc(i,e.theme,o,(e,t)=>{let n=e?i[e]:i;for(let e=0;e(e.length===0?[1]:e).map(e=>{let n=t(e);return typeof n==`number`?`${n}px`:n}).join(` `);return n.mui=!0,n}function Fc(...e){let t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>{let n={};for(let r in e)t[r]&&Js(n,t[r](e));return n};return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function Ic(e){return typeof e==`number`?`${e}px solid`:e}function Lc(e,t){return _c({prop:e,themeKey:`borders`,transform:t})}var Rc=Lc(`border`,Ic),zc=Lc(`borderTop`,Ic),Bc=Lc(`borderRight`,Ic),Vc=Lc(`borderBottom`,Ic),Hc=Lc(`borderLeft`,Ic),Uc=Lc(`borderColor`),Wc=Lc(`borderTopColor`),Gc=Lc(`borderRightColor`),Kc=Lc(`borderBottomColor`),qc=Lc(`borderLeftColor`),Jc=Lc(`outline`,Ic),Yc=Lc(`outlineColor`),Xc=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){let t=Ec(e.theme,`shape.borderRadius`,4,`borderRadius`);return sc(e,e.borderRadius,e=>({borderRadius:Oc(t,e)}))}return null};Xc.propTypes={},Xc.filterProps=[`borderRadius`],Fc(Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Xc,Jc,Yc);var Zc=e=>{if(e.gap!==void 0&&e.gap!==null){let t=Ec(e.theme,`spacing`,8,`gap`);return sc(e,e.gap,e=>({gap:Oc(t,e)}))}return null};Zc.propTypes={},Zc.filterProps=[`gap`];var Qc=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){let t=Ec(e.theme,`spacing`,8,`columnGap`);return sc(e,e.columnGap,e=>({columnGap:Oc(t,e)}))}return null};Qc.propTypes={},Qc.filterProps=[`columnGap`];var $c=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){let t=Ec(e.theme,`spacing`,8,`rowGap`);return sc(e,e.rowGap,e=>({rowGap:Oc(t,e)}))}return null};$c.propTypes={},$c.filterProps=[`rowGap`],Fc(Zc,Qc,$c,_c({prop:`gridColumn`}),_c({prop:`gridRow`}),_c({prop:`gridAutoFlow`}),_c({prop:`gridAutoColumns`}),_c({prop:`gridAutoRows`}),_c({prop:`gridTemplateColumns`}),_c({prop:`gridTemplateRows`}),_c({prop:`gridTemplateAreas`}),_c({prop:`gridArea`}));function el(e,t){return t===`grey`?t:e}Fc(_c({prop:`color`,themeKey:`palette`,transform:el}),_c({prop:`bgcolor`,cssProperty:`backgroundColor`,themeKey:`palette`,transform:el}),_c({prop:`backgroundColor`,themeKey:`palette`,transform:el}));function tl(e){return e<=1&&e!==0?`${e*100}%`:e}var nl=_c({prop:`width`,transform:tl}),rl=e=>e.maxWidth!==void 0&&e.maxWidth!==null?sc(e,e.maxWidth,t=>{let n=e.theme?.breakpoints?.values?.[t]||ic[t];return n?e.theme?.breakpoints?.unit===`px`?{maxWidth:n}:{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:tl(t)}}):null;rl.filterProps=[`maxWidth`];var il=_c({prop:`minWidth`,transform:tl}),al=_c({prop:`height`,transform:tl}),ol=_c({prop:`maxHeight`,transform:tl}),sl=_c({prop:`minHeight`,transform:tl});_c({prop:`size`,cssProperty:`width`,transform:tl}),_c({prop:`size`,cssProperty:`height`,transform:tl}),Fc(nl,rl,il,al,ol,sl,_c({prop:`boxSizing`}));var cl={border:{themeKey:`borders`,transform:Ic},borderTop:{themeKey:`borders`,transform:Ic},borderRight:{themeKey:`borders`,transform:Ic},borderBottom:{themeKey:`borders`,transform:Ic},borderLeft:{themeKey:`borders`,transform:Ic},borderColor:{themeKey:`palette`},borderTopColor:{themeKey:`palette`},borderRightColor:{themeKey:`palette`},borderBottomColor:{themeKey:`palette`},borderLeftColor:{themeKey:`palette`},outline:{themeKey:`borders`,transform:Ic},outlineColor:{themeKey:`palette`},borderRadius:{themeKey:`shape.borderRadius`,style:Xc},color:{themeKey:`palette`,transform:el},bgcolor:{themeKey:`palette`,cssProperty:`backgroundColor`,transform:el},backgroundColor:{themeKey:`palette`,transform:el},p:{style:Mc},pt:{style:Mc},pr:{style:Mc},pb:{style:Mc},pl:{style:Mc},px:{style:Mc},py:{style:Mc},padding:{style:Mc},paddingTop:{style:Mc},paddingRight:{style:Mc},paddingBottom:{style:Mc},paddingLeft:{style:Mc},paddingX:{style:Mc},paddingY:{style:Mc},paddingInline:{style:Mc},paddingInlineStart:{style:Mc},paddingInlineEnd:{style:Mc},paddingBlock:{style:Mc},paddingBlockStart:{style:Mc},paddingBlockEnd:{style:Mc},m:{style:jc},mt:{style:jc},mr:{style:jc},mb:{style:jc},ml:{style:jc},mx:{style:jc},my:{style:jc},margin:{style:jc},marginTop:{style:jc},marginRight:{style:jc},marginBottom:{style:jc},marginLeft:{style:jc},marginX:{style:jc},marginY:{style:jc},marginInline:{style:jc},marginInlineStart:{style:jc},marginInlineEnd:{style:jc},marginBlock:{style:jc},marginBlockStart:{style:jc},marginBlockEnd:{style:jc},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Zc},rowGap:{style:$c},columnGap:{style:Qc},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:`zIndex`},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:`shadows`},width:{transform:tl},maxWidth:{style:rl},minWidth:{transform:tl},height:{transform:tl},maxHeight:{transform:tl},minHeight:{transform:tl},boxSizing:{},font:{themeKey:`font`},fontFamily:{themeKey:`typography`},fontSize:{themeKey:`typography`},fontStyle:{themeKey:`typography`},fontWeight:{themeKey:`typography`},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:`typography`}},ll={};function ul(){function e(t){if(!t.sx)return null;let{sx:n,theme:r=ll,nested:i}=t,a=r.unstable_sxConfig??cl,o={sx:null,theme:r,nested:!0};function s(n){let s=n;if(typeof n==`function`)s=n(r);else if(typeof n!=`object`)return n;if(!s)return null;let c=r.breakpoints??ac,l=uc(c);for(let n in s){let i=pl(s[n],r);if(i!=null){if(typeof i!=`object`){fl(l,n,i,r,a);continue}if(a[n]){fl(l,n,i,r,a);continue}fc(c,i)?cc(l,t.theme,i,(e,t)=>{l[e][n]=t}):(o.sx=i,l[n]=e(o))}}return!i&&r.modularCssLayers?{"@layer sx":Vs(r,dc(c,l))}:Vs(r,dc(c,l))}return Array.isArray(n)?n.map(s):s(n)}return e.filterProps=[`sx`],e}var dl=ul();function fl(e,t,n,r,i){let a=i[t];if(!a){e[t]=n;return}if(n==null)return;let{themeKey:o}=a;if(o===`typography`&&n===`inherit`){e[t]=n;return}let{style:s}=a;if(s){Js(e,s({[t]:n,theme:r}));return}let{cssProperty:c=t,transform:l}=a,u=hc(r,o);cc(e,r,n,(n,r)=>{let i=mc(u,l,r,t);c===!1?Js(n?e[n]:e,i):n?e[n][c]=i:e[c]=i})}function pl(e,t){return typeof e==`function`?e(t):e}function ml(e,t){let n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!=`function`)return{};let r=n.getColorSchemeSelector(e);return r===`&`?t:((r.includes(`data-`)||r.includes(`.`))&&(r=`*:where(${r.replace(/\s*&$/,``)}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function hl(e={},...t){let{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,s=zs(n),c=Pc(i),l=Ls({breakpoints:s,direction:`ltr`,components:{},palette:{mode:`light`,...r},spacing:c,shape:{...Ks,...a}},o);return l=Gs(l),l.applyStyles=ml,l=t.reduce((e,t)=>Ls(e,t),l),l.unstable_sxConfig={...cl,...o?.unstable_sxConfig},l.unstable_sx=function(e){return dl({sx:e,theme:this})},l.internal_cache={},l}function gl(e){return Object.keys(e).length===0}function _l(e=null){let t=_.useContext(os);return!t||gl(t)?e:t}var vl=hl();function yl(e=vl){return _l(e)}function bl(e){let t=Ms(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function xl({styles:e,themeId:t,defaultTheme:n={}}){let r=yl(n),i=t&&r[t]||r,a=typeof e==`function`?e(i):e;return i.modularCssLayers&&(a=Array.isArray(a)?a.map(e=>bl(typeof e==`function`?e(i):e)):bl(a)),(0,z.jsx)(Os,{styles:a})}var Sl=e=>e,Cl=(()=>{let e=Sl;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Sl}}})();function wl(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;te!==`theme`&&e!==`sx`&&e!==`as`})(dl);return _.forwardRef(function(e,o){let s=yl(n),{className:c,component:l=`div`,...u}=e;return(0,z.jsx)(a,{as:l,ref:o,className:V(c,i?i(r):r),theme:t&&s[t]||s,...u})})}var El={active:`active`,checked:`checked`,completed:`completed`,disabled:`disabled`,error:`error`,expanded:`expanded`,focused:`focused`,focusVisible:`focusVisible`,open:`open`,readOnly:`readOnly`,required:`required`,selected:`selected`};function H(e,t,n=`Mui`){let r=El[t];return r?`${n}-${r}`:`${Cl.generate(e)}-${t}`}function U(e,t,n=`Mui`){let r={};return t.forEach(t=>{r[t]=H(e,t,n)}),r}function Dl(e){let{variants:t,...n}=e,r={variants:t,style:Ms(n),isProcessed:!0};return r.style===n||t&&t.forEach(e=>{typeof e.style!=`function`&&(e.style=Ms(e.style))}),r}var Ol=hl();function kl(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}function Al(e,t){return t&&e&&typeof e==`object`&&e.styles&&!e.styles.startsWith(`@layer`)&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function jl(e){return e?(t,n)=>n[e]:null}function Ml(e,t,n){e.theme=qs(e.theme)?n:e.theme[t]||e.theme}function Nl(e,t,n){let r=typeof t==`function`?t(e):t;if(Array.isArray(r))return r.flatMap(t=>Nl(e,t,n));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=n?Al(r.style,n):r.style;else{let{variants:e,...i}=r;t=n?Al(Ms(i),n):i}return Pl(e,r.variants,[t],n)}return r?.isProcessed?n?Al(Ms(r.style),n):r.style:n?Al(Ms(r),n):r}function Pl(e,t,n=[],r=void 0){let i;variantLoop:for(let a=0;a{As(e,e=>e.filter(e=>e!==dl));let{name:n,slot:o,skipVariantsResolver:s,skipSx:c,overridesResolver:l=jl(Ll(o)),...u}=t,d=n&&n.startsWith(`Mui`)||o?`components`:`custom`,f=s===void 0?o&&o!==`Root`&&o!==`root`||!1:s,p=c||!1,m=kl;o===`Root`||o===`root`?m=r:o?m=i:Il(e)&&(m=void 0);let h=ks(e,{shouldForwardProp:m,label:void 0,...u}),g=e=>{if(e.__emotion_real===e)return e;if(typeof e==`function`)return function(t){return Nl(t,e,t.theme.modularCssLayers?d:void 0)};if(Fs(e)){let t=Dl(e);return function(e){return t.variants?Nl(e,t,e.theme.modularCssLayers?d:void 0):e.theme.modularCssLayers?Al(t.style,d):t.style}}return e},_=(...t)=>{let r=[],i=t.map(g),o=[];if(r.push(a),n&&l&&o.push(function(e){let t=e.theme.components?.[n]?.styleOverrides;if(!t)return null;let r={};for(let n in t)r[n]=Nl(e,t[n],e.theme.modularCssLayers?`theme`:void 0);return l(e,r)}),n&&!f&&o.push(function(e){let t=e.theme?.components?.[n]?.variants;return t?Pl(e,t,[],e.theme.modularCssLayers?`theme`:void 0):null}),p||o.push(dl),Array.isArray(i[0])){let e=i.shift(),t=Array(r.length).fill(``),n=Array(o.length).fill(``),a;a=[...t,...e,...n],a.raw=[...t,...e.raw,...n],r.unshift(a)}let s=h(...r,...i,...o);return e.muiName&&(s.muiName=e.muiName),s};return h.withConfig&&(_.withConfig=h.withConfig),_}}function Il(e){return typeof e==`string`&&e.charCodeAt(0)>96}function Ll(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}var Rl=Fl();function zl(e,t,n=!1){let r={...t};for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let a=i;if(a===`components`||a===`slots`)r[a]={...e[a],...r[a]};else if(a===`componentsProps`||a===`slotProps`){let i=e[a],o=t[a];if(!o)r[a]=i||{};else if(!i)r[a]=o;else{r[a]={...o};for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let t=e;r[a][t]=zl(i[t],o[t],n)}}}else a===`className`&&n&&t.className!==void 0?r.className=V(e?.className,t?.className):a===`style`&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}function Bl(e){let{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:zl(t.components[n].defaultProps,r)}function Vl({props:e,name:t,defaultTheme:n,themeId:r}){let i=yl(n);return r&&(i=i[r]||i),Bl({theme:i,name:t,props:e})}var Hl=typeof window<`u`?_.useLayoutEffect:_.useEffect;function Ul(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Wl(e,t=0,n=1){return Ul(e,t,n)}function Gl(e){e=e.slice(1);let t=RegExp(`.{1,${e.length>=6?2:1}}`,`g`),n=e.match(t);return n&&n[0].length===1&&(n=n.map(e=>e+e)),n?`rgb${n.length===4?`a`:``}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(`, `)})`:``}function Kl(e){if(e.type)return e;if(e.charAt(0)===`#`)return Kl(Gl(e));let t=e.indexOf(`(`),n=e.substring(0,t);if(![`rgb`,`rgba`,`hsl`,`hsla`,`color`].includes(n))throw Error(ma(9,e));let r=e.substring(t+1,e.length-1),i;if(n===`color`){if(r=r.split(` `),i=r.shift(),r.length===4&&r[3].charAt(0)===`/`&&(r[3]=r[3].slice(1)),![`srgb`,`display-p3`,`a98-rgb`,`prophoto-rgb`,`rec-2020`].includes(i))throw Error(ma(10,i))}else r=r.split(`,`);return r=r.map(e=>parseFloat(e)),{type:n,values:r,colorSpace:i}}var ql=e=>{let t=Kl(e);return t.values.slice(0,3).map((e,n)=>t.type.includes(`hsl`)&&n!==0?`${e}%`:e).join(` `)},Jl=(e,t)=>{try{return ql(e)}catch{return e}};function Yl(e){let{type:t,colorSpace:n}=e,{values:r}=e;return t.includes(`rgb`)?r=r.map((e,t)=>t<3?parseInt(e,10):e):t.includes(`hsl`)&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=t.includes(`color`)?`${n} ${r.join(` `)}`:`${r.join(`, `)}`,`${t}(${r})`}function Xl(e){e=Kl(e);let{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1),s=`rgb`,c=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type===`hsla`&&(s+=`a`,c.push(t[3])),Yl({type:s,values:c})}function Zl(e){e=Kl(e);let t=e.type===`hsl`||e.type===`hsla`?Kl(Xl(e)).values:e.values;return t=t.map(t=>(e.type!==`color`&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Ql(e,t){let n=Zl(e),r=Zl(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function $l(e,t){return e=Kl(e),t=Wl(t),(e.type===`rgb`||e.type===`hsl`)&&(e.type+=`a`),e.type===`color`?e.values[3]=`/${t}`:e.values[3]=t,Yl(e)}function eu(e,t,n){try{return $l(e,t)}catch{return e}}function tu(e,t){if(e=Kl(e),t=Wl(t),e.type.includes(`hsl`))e.values[2]*=1-t;else if(e.type.includes(`rgb`)||e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Yl(e)}function nu(e,t,n){try{return tu(e,t)}catch{return e}}function ru(e,t){if(e=Kl(e),t=Wl(t),e.type.includes(`hsl`))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes(`rgb`))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Yl(e)}function iu(e,t,n){try{return ru(e,t)}catch{return e}}function au(e,t=.15){return Zl(e)>.5?tu(e,t):ru(e,t)}function ou(e,t,n){try{return au(e,t)}catch{return e}}var su=_.createContext(null);function cu(){return _.useContext(su)}var lu=typeof Symbol==`function`&&Symbol.for?Symbol.for(`mui.nested`):`__THEME_NESTED__`;function uu(e,t){return typeof t==`function`?t(e):{...e,...t}}function du(e){let{children:t,theme:n}=e,r=cu(),i=_.useMemo(()=>{let e=r===null?{...n}:uu(r,n);return e!=null&&(e[lu]=r!==null),e},[n,r]);return(0,z.jsx)(su.Provider,{value:i,children:t})}var fu=_.createContext();function pu({value:e,...t}){return(0,z.jsx)(fu.Provider,{value:e??!0,...t})}var mu=()=>_.useContext(fu)??!1,hu=_.createContext(void 0);function gu({value:e,children:t}){return(0,z.jsx)(hu.Provider,{value:e,children:t})}function _u(e){let{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;let i=t.components[n];return i.defaultProps?zl(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?zl(i,r,t.components.mergeClassNameAndStyle):r}function vu({props:e,name:t}){return _u({props:e,name:t,theme:{components:_.useContext(hu)}})}var yu=0;function bu(e){let[t,n]=_.useState(e),r=e||t;return _.useEffect(()=>{t??(yu+=1,n(`mui-${yu}`))},[t]),r}var xu={..._}.useId;function Su(e){if(xu!==void 0){let t=xu();return e??t}return bu(e)}function Cu(e){let t=_l(),n=Su()||``,{modularCssLayers:r}=e,i=`mui.global, mui.components, mui.theme, mui.custom, mui.sx`;return i=!r||t!==null?``:typeof r==`string`?r.replace(/mui(?!\.)/g,i):`@layer ${i};`,Hl(()=>{let e=document.querySelector(`head`);if(!e)return;let t=e.firstChild;if(i){if(t&&t.hasAttribute?.(`data-mui-layer-order`)&&t.getAttribute(`data-mui-layer-order`)===n)return;let r=document.createElement(`style`);r.setAttribute(`data-mui-layer-order`,n),r.textContent=i,e.prepend(r)}else e.querySelector(`style[data-mui-layer-order="${n}"]`)?.remove()},[i,n]),i?(0,z.jsx)(xl,{styles:i}):null}var wu={};function Tu(e,t,n,r=!1){return _.useMemo(()=>{let i=e&&t[e]||t;if(typeof n==`function`){let a=n(i),o=e?{...t,[e]:a}:a;return r?()=>o:o}return e?{...t,[e]:n}:{...t,...n}},[e,t,n,r])}function Eu(e){let{children:t,theme:n,themeId:r}=e,i=_l(wu),a=cu()||wu,o=Tu(r,i,n),s=Tu(r,a,n,!0),c=(r?o[r]:o).direction===`rtl`,l=Cu(o);return(0,z.jsx)(du,{theme:s,children:(0,z.jsx)(os.Provider,{value:o,children:(0,z.jsx)(pu,{value:c,children:(0,z.jsxs)(gu,{value:r?o[r].components:o.components,children:[l,t]})})})})}var Du={theme:void 0};function Ou(e){let t,n;return function(r){let i=t;return(i===void 0||r.theme!==n)&&(Du.theme=r.theme,i=Dl(e(Du)),t=i,n=r.theme),i}}var ku=`mode`,Au=`color-scheme`,ju=`data-color-scheme`;function Mu(e){let{defaultMode:t=`system`,defaultLightColorScheme:n=`light`,defaultDarkColorScheme:r=`dark`,modeStorageKey:i=ku,colorSchemeStorageKey:a=Au,attribute:o=ju,colorSchemeNode:s=`document.documentElement`,nonce:c}=e||{},l=``,u=o;if(o===`class`&&(u=`.%s`),o===`data`&&(u=`[data-%s]`),u.startsWith(`.`)){let e=u.substring(1);l+=`${s}.classList.remove('${e}'.replace('%s', light), '${e}'.replace('%s', dark)); + ${s}.classList.add('${e}'.replace('%s', colorScheme));`}let d=u.match(/\[([^[\]]+)\]/);if(d){let[e,t]=d[1].split(`=`);t||(l+=`${s}.removeAttribute('${e}'.replace('%s', light)); + ${s}.removeAttribute('${e}'.replace('%s', dark));`),l+=` + ${s}.setAttribute('${e}'.replace('%s', colorScheme), ${t?`${t}.replace('%s', colorScheme)`:`""`});`}else u!==`.%s`&&(l+=`${s}.setAttribute('${u}', colorScheme);`);return(0,z.jsx)(`script`,{suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(function() { +try { + let colorScheme = ''; + const mode = localStorage.getItem('${i}') || '${t}'; + const dark = localStorage.getItem('${a}-dark') || '${r}'; + const light = localStorage.getItem('${a}-light') || '${n}'; + if (mode === 'system') { + // handle system mode + const mql = window.matchMedia('(prefers-color-scheme: dark)'); + if (mql.matches) { + colorScheme = dark + } else { + colorScheme = light + } + } + if (mode === 'light') { + colorScheme = light; + } + if (mode === 'dark') { + colorScheme = dark; + } + if (colorScheme) { + ${l} + } +} catch(e){}})();`}},`mui-color-scheme-init`)}function Nu(){}var Pu=({key:e,storageWindow:t})=>(!t&&typeof window<`u`&&(t=window),{get(n){if(typeof window>`u`)return;if(!t)return n;let r;try{r=t.localStorage.getItem(e)}catch{}return r||n},set:n=>{if(t)try{t.localStorage.setItem(e,n)}catch{}},subscribe:n=>{if(!t)return Nu;let r=t=>{let r=t.newValue;t.key===e&&n(r)};return t.addEventListener(`storage`,r),()=>{t.removeEventListener(`storage`,r)}}});function Fu(){}function Iu(e){if(typeof window<`u`&&typeof window.matchMedia==`function`&&e===`system`)return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function Lu(e,t){if(e.mode===`light`||e.mode===`system`&&e.systemMode===`light`)return t(`light`);if(e.mode===`dark`||e.mode===`system`&&e.systemMode===`dark`)return t(`dark`)}function Ru(e){return Lu(e,t=>{if(t===`light`)return e.lightColorScheme;if(t===`dark`)return e.darkColorScheme})}function zu(e){let{defaultMode:t=`light`,defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:i=[],modeStorageKey:a=ku,colorSchemeStorageKey:o=Au,storageWindow:s=typeof window>`u`?void 0:window,storageManager:c=Pu,noSsr:l=!1}=e,u=i.join(`,`),d=i.length>1,f=_.useMemo(()=>c?.({key:a,storageWindow:s}),[c,a,s]),p=_.useMemo(()=>c?.({key:`${o}-light`,storageWindow:s}),[c,o,s]),m=_.useMemo(()=>c?.({key:`${o}-dark`,storageWindow:s}),[c,o,s]),[h,g]=_.useState(()=>{let e=f?.get(t)||t,i=p?.get(n)||n,a=m?.get(r)||r;return{mode:e,systemMode:Iu(e),lightColorScheme:i,darkColorScheme:a}}),[v,y]=_.useState(l||!d);_.useEffect(()=>{y(!0)},[]);let b=Ru(h),x=_.useCallback(e=>{g(n=>{if(e===n.mode)return n;let r=e??t;return f?.set(r),{...n,mode:r,systemMode:Iu(r)}})},[f,t]),S=_.useCallback(e=>{e?typeof e==`string`?e&&!u.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):g(t=>{let n={...t};return Lu(t,t=>{t===`light`&&(p?.set(e),n.lightColorScheme=e),t===`dark`&&(m?.set(e),n.darkColorScheme=e)}),n}):g(t=>{let i={...t},a=e.light===null?n:e.light,o=e.dark===null?r:e.dark;return a&&(u.includes(a)?(i.lightColorScheme=a,p?.set(a)):console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)),o&&(u.includes(o)?(i.darkColorScheme=o,m?.set(o)):console.error(`\`${o}\` does not exist in \`theme.colorSchemes\`.`)),i}):g(e=>(p?.set(n),m?.set(r),{...e,lightColorScheme:n,darkColorScheme:r}))},[u,p,m,n,r]),C=_.useCallback(e=>{h.mode===`system`&&g(t=>{let n=e?.matches?`dark`:`light`;return t.systemMode===n?t:{...t,systemMode:n}})},[h.mode]),w=_.useRef(C);return w.current=C,_.useEffect(()=>{if(typeof window.matchMedia!=`function`||!d)return;let e=(...e)=>w.current(...e),t=window.matchMedia(`(prefers-color-scheme: dark)`);return t.addListener(e),e(t),()=>{t.removeListener(e)}},[d]),_.useEffect(()=>{if(d){let e=f?.subscribe(e=>{(!e||[`light`,`dark`,`system`].includes(e))&&x(e||t)})||Fu,n=p?.subscribe(e=>{(!e||u.match(e))&&S({light:e})})||Fu,r=m?.subscribe(e=>{(!e||u.match(e))&&S({dark:e})})||Fu;return()=>{e(),n(),r()}}},[S,x,u,t,s,d,f,p,m]),{...h,mode:v?h.mode:void 0,systemMode:v?h.systemMode:void 0,colorScheme:v?b:void 0,setMode:x,setColorScheme:S}}var Bu=`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function Vu(e){let{themeId:t,theme:n={},modeStorageKey:r=ku,colorSchemeStorageKey:i=Au,disableTransitionOnChange:a=!1,defaultColorScheme:o,resolveTheme:s}=e,c={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},l=_.createContext(void 0),u=()=>_.useContext(l)||c,d={},f={};function p(e){let{children:c,theme:u,modeStorageKey:p=r,colorSchemeStorageKey:m=i,disableTransitionOnChange:h=a,storageManager:g,storageWindow:v=typeof window>`u`?void 0:window,documentNode:y=typeof document>`u`?void 0:document,colorSchemeNode:b=typeof document>`u`?void 0:document.documentElement,disableNestedContext:x=!1,disableStyleSheetGeneration:S=!1,defaultMode:C=`system`,forceThemeRerender:w=!1,noSsr:T}=e,E=_.useRef(!1),D=cu(),O=_.useContext(l),k=!!O&&!x,A=_.useMemo(()=>u||(typeof n==`function`?n():n),[u]),j=A[t],M=j||A,{colorSchemes:N=d,components:ee=f,cssVarPrefix:te}=M,P=Object.keys(N).filter(e=>!!N[e]).join(`,`),F=_.useMemo(()=>P.split(`,`),[P]),ne=typeof o==`string`?o:o.light,re=typeof o==`string`?o:o.dark,{mode:ie,setMode:ae,systemMode:I,lightColorScheme:L,darkColorScheme:oe,colorScheme:se,setColorScheme:ce}=zu({supportedColorSchemes:F,defaultLightColorScheme:ne,defaultDarkColorScheme:re,modeStorageKey:p,colorSchemeStorageKey:m,defaultMode:N[ne]&&N[re]?C:N[M.defaultColorScheme]?.palette?.mode||M.palette?.mode,storageManager:g,storageWindow:v,noSsr:T}),le=ie,ue=se;k&&(le=O.mode,ue=O.colorScheme);let de=ue||M.defaultColorScheme;M.vars&&!w&&(de=M.defaultColorScheme);let R=_.useMemo(()=>{let e=M.generateThemeVars?.()||M.vars,t={...M,components:ee,colorSchemes:N,cssVarPrefix:te,vars:e};if(typeof t.generateSpacing==`function`&&(t.spacing=t.generateSpacing()),de){let e=N[de];e&&typeof e==`object`&&Object.keys(e).forEach(n=>{e[n]&&typeof e[n]==`object`?t[n]={...t[n],...e[n]}:t[n]=e[n]})}return s?s(t):t},[M,de,ee,N,te]),fe=M.colorSchemeSelector;Hl(()=>{if(ue&&b&&fe&&fe!==`media`){let e=fe,t=fe;if(e===`class`&&(t=`.%s`),e===`data`&&(t=`[data-%s]`),e?.startsWith(`data-`)&&!e.includes(`%s`)&&(t=`[${e}="%s"]`),t.startsWith(`.`))b.classList.remove(...F.map(e=>t.substring(1).replace(`%s`,e))),b.classList.add(t.substring(1).replace(`%s`,ue));else{let e=t.replace(`%s`,ue).match(/\[([^\]]+)\]/);if(e){let[t,n]=e[1].split(`=`);n||F.forEach(e=>{b.removeAttribute(t.replace(ue,e))}),b.setAttribute(t,n?n.replace(/"|'/g,``):``)}else b.setAttribute(t,ue)}}},[ue,fe,b,F]),_.useEffect(()=>{let e;if(h&&E.current&&y){let t=y.createElement(`style`);t.appendChild(y.createTextNode(Bu)),y.head.appendChild(t),window.getComputedStyle(y.body),e=setTimeout(()=>{y.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[ue,h,y]),_.useEffect(()=>(E.current=!0,()=>{E.current=!1}),[]);let pe=_.useMemo(()=>({allColorSchemes:F,colorScheme:ue,darkColorScheme:oe,lightColorScheme:L,mode:le,setColorScheme:ce,setMode:ae,systemMode:I}),[F,ue,oe,L,le,ce,ae,I,R.colorSchemeSelector]),me=!0;(S||M.cssVariables===!1||k&&D?.cssVarPrefix===te)&&(me=!1);let he=(0,z.jsxs)(_.Fragment,{children:[(0,z.jsx)(Eu,{themeId:j?t:void 0,theme:R,children:c}),me&&(0,z.jsx)(Os,{styles:R.generateStyleSheets?.()||[]})]});return k?he:(0,z.jsx)(l.Provider,{value:pe,children:he})}let m=typeof o==`string`?o:o.light,h=typeof o==`string`?o:o.dark;return{CssVarsProvider:p,useColorScheme:u,getInitColorSchemeScript:e=>Mu({colorSchemeStorageKey:i,defaultLightColorScheme:m,defaultDarkColorScheme:h,modeStorageKey:r,...e})}}function Hu(e=``){function t(...n){if(!n.length)return``;let r=n[0];return typeof r==`string`&&!r.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:``}${r}${t(...n.slice(1))})`:`, ${r}`}return(n,...r)=>`var(--${e?`${e}-`:``}${n}${t(...r)})`}var Uu=(e,t,n,r=[])=>{let i=e;t.forEach((e,a)=>{a===t.length-1?Array.isArray(i)?i[Number(e)]=n:i&&typeof i==`object`&&(i[e]=n):i&&typeof i==`object`&&(i[e]||(i[e]=r.includes(e)?[]:{}),i=i[e])})},Wu=(e,t,n)=>{function r(e,i=[],a=[]){Object.entries(e).forEach(([e,o])=>{(!n||n&&!n([...i,e]))&&o!=null&&(typeof o==`object`&&Object.keys(o).length>0?r(o,[...i,e],Array.isArray(o)?[...a,e]:a):t([...i,e],o,a))})}r(e)},Gu=(e,t)=>typeof t==`number`?[`lineHeight`,`fontWeight`,`opacity`,`zIndex`].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes(`opacity`)?t:`${t}px`:t;function Ku(e,t){let{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return Wu(e,(e,t,s)=>{if((typeof t==`string`||typeof t==`number`)&&(!r||!r(e,t))){let r=`--${n?`${n}-`:``}${e.join(`-`)}`,c=Gu(e,t);Object.assign(i,{[r]:c}),Uu(a,e,`var(${r})`,s),Uu(o,e,`var(${r}, ${c})`,s)}},e=>e[0]===`vars`),{css:i,vars:a,varsWithDefaults:o}}function qu(e,t={}){let{getSelector:n=_,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:s,defaultColorScheme:c=`light`,...l}=e,{vars:u,css:d,varsWithDefaults:f}=Ku(l,t),p=f,m={},{[c]:h,...g}=o;if(Object.entries(g||{}).forEach(([e,n])=>{let{vars:r,css:i,varsWithDefaults:a}=Ku(n,t);p=Ls(p,a),m[e]={css:i,vars:r}}),h){let{css:e,vars:n,varsWithDefaults:r}=Ku(h,t);p=Ls(p,r),m[c]={css:e,vars:n}}function _(t,n){let r=i;if(i===`class`&&(r=`.%s`),i===`data`&&(r=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(r=`[${i}="%s"]`),t){if(r===`media`)return e.defaultColorScheme===t?`:root`:{[`@media (prefers-color-scheme: ${o[t]?.palette?.mode||t})`]:{":root":n}};if(r)return e.defaultColorScheme===t?`:root, ${r.replace(`%s`,String(t))}`:r.replace(`%s`,String(t))}return`:root`}return{vars:p,generateThemeVars:()=>{let e={...u};return Object.entries(m).forEach(([,{vars:t}])=>{e=Ls(e,t)}),e},generateStyleSheets:()=>{let t=[],i=e.defaultColorScheme||`light`;function s(e,n){Object.keys(n).length&&t.push(typeof e==`string`?{[e]:{...n}}:e)}s(n(void 0,{...d}),d);let{[i]:c,...l}=m;if(c){let{css:e}=c,t=o[i]?.palette?.mode,a=!r&&t?{colorScheme:t,...e}:{...e};s(n(i,{...a}),a)}return Object.entries(l).forEach(([e,{css:t}])=>{let i=o[e]?.palette?.mode,a=!r&&i?{colorScheme:i,...t}:{...t};s(n(e,{...a}),a)}),a&&t.push({":root":{"--__l-threshold":`0.7`,"--__l":`clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)`,"--__a":`clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)`}}),t}}}function Ju(e){return function(t){return e===`media`?`@media (prefers-color-scheme: ${t})`:e?e.startsWith(`data-`)&&!e.includes(`%s`)?`[${e}="${t}"] &`:e===`class`?`.${t} &`:e===`data`?`[data-${t}] &`:`${e.replace(`%s`,t)} &`:`&`}}function W(e,t,n=void 0){let r={};for(let i in e){let a=e[i],o=``,s=!0;for(let e=0;ee.filter(e=>t.includes(e)),Zu=(e,t,n)=>{let r=e.keys[0];Array.isArray(t)?t.forEach((t,r)=>{n((t,n)=>{r<=e.keys.length-1&&(r===0?Object.assign(t,n):t[e.up(e.keys[r])]=n)},t)}):t&&typeof t==`object`?(Object.keys(t).length>e.keys.length?e.keys:Xu(e.keys,Object.keys(t))).forEach(i=>{if(e.keys.includes(i)){let a=t[i];a!==void 0&&n((t,n)=>{r===i?Object.assign(t,n):t[e.up(i)]=n},a)}}):(typeof t==`number`||typeof t==`string`)&&n((e,t)=>{Object.assign(e,t)},t)};function Qu(e){return`--Grid-${e}Spacing`}function $u(e){return`--Grid-parent-${e}Spacing`}var ed=`--Grid-columns`,td=`--Grid-parent-columns`,nd=({theme:e,ownerState:t})=>{let n={};return Zu(e.breakpoints,t.size,(e,t)=>{let r={};t===`grow`&&(r={flexBasis:0,flexGrow:1,maxWidth:`100%`}),t===`auto`&&(r={flexBasis:`auto`,flexGrow:0,flexShrink:0,maxWidth:`none`,width:`auto`}),typeof t==`number`&&(r={flexGrow:0,flexBasis:`auto`,width:`calc(100% * ${t} / var(${td}) - (var(${td}) - ${t}) * (var(${$u(`column`)}) / var(${td})))`}),e(n,r)}),n},rd=({theme:e,ownerState:t})=>{let n={};return Zu(e.breakpoints,t.offset,(e,t)=>{let r={};t===`auto`&&(r={marginLeft:`auto`}),typeof t==`number`&&(r={marginLeft:t===0?`0px`:`calc(100% * ${t} / var(${td}) + var(${$u(`column`)}) * ${t} / var(${td}))`}),e(n,r)}),n},id=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={[ed]:12};return Zu(e.breakpoints,t.columns,(e,t)=>{let r=t??12;e(n,{[ed]:r,"> *":{[td]:r}})}),n},ad=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return Zu(e.breakpoints,t.rowSpacing,(t,r)=>{let i=typeof r==`string`?r:e.spacing?.(r);t(n,{[Qu(`row`)]:i,"> *":{[$u(`row`)]:i}})}),n},od=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return Zu(e.breakpoints,t.columnSpacing,(t,r)=>{let i=typeof r==`string`?r:e.spacing?.(r);t(n,{[Qu(`column`)]:i,"> *":{[$u(`column`)]:i}})}),n},sd=({theme:e,ownerState:t})=>{if(!t.container)return{};let n={};return Zu(e.breakpoints,t.direction,(e,t)=>{e(n,{flexDirection:t})}),n},cd=({ownerState:e})=>({minWidth:0,boxSizing:`border-box`,...e.container&&{display:`flex`,flexWrap:`wrap`,...e.wrap&&e.wrap!==`wrap`&&{flexWrap:e.wrap},gap:`var(${Qu(`row`)}) var(${Qu(`column`)})`}}),ld=e=>{let t=[];return Object.entries(e).forEach(([e,n])=>{n!==!1&&n!==void 0&&t.push(`grid-${e}-${String(n)}`)}),t},ud=(e,t=`xs`)=>{function n(e){return e===void 0?!1:typeof e==`string`&&!Number.isNaN(Number(e))||typeof e==`number`&&e>0}if(n(e))return[`spacing-${t}-${String(e)}`];if(typeof e==`object`&&!Array.isArray(e)){let t=[];return Object.entries(e).forEach(([e,r])=>{n(r)&&t.push(`spacing-${e}-${String(r)}`)}),t}return[]},dd=e=>e===void 0?[]:typeof e==`object`?Object.entries(e).map(([e,t])=>`direction-${e}-${t}`):[`direction-xs-${String(e)}`],fd=hl(),pd=Rl(`div`,{name:`MuiGrid`,slot:`Root`});function md(e){return Vl({props:e,name:`MuiGrid`,defaultTheme:fd})}function hd(e={}){let{createStyledComponent:t=pd,useThemeProps:n=md,useTheme:r=yl,componentName:i=`MuiGrid`}=e,a=(e,t)=>{let{container:n,direction:r,spacing:a,wrap:o,size:s}=e;return W({root:[`root`,n&&`container`,o!==`wrap`&&`wrap-xs-${String(o)}`,...dd(r),...ld(s),...n?ud(a,t.breakpoints.keys[0]):[]]},e=>H(i,e),{})};function o(e,t,n=()=>!0){let r={};return e===null||(Array.isArray(e)?e.forEach((e,i)=>{e!==null&&n(e)&&t.keys[i]&&(r[t.keys[i]]=e)}):typeof e==`object`?Object.keys(e).forEach(t=>{let i=e[t];i!=null&&n(i)&&(r[t]=i)}):r[t.keys[0]]=e),r}let s=t(id,od,ad,nd,sd,cd,rd),c=_.forwardRef(function(e,t){let i=r(),c=n(e),{className:l,children:u,columns:d=12,container:f=!1,component:p=`div`,direction:m=`row`,wrap:h=`wrap`,size:g={},offset:v={},spacing:y=0,rowSpacing:b=y,columnSpacing:x=y,unstable_level:S=0,...C}=c,w=o(g,i.breakpoints,e=>e!==!1),T=o(v,i.breakpoints),E=e.columns??(S?void 0:d),D=e.spacing??(S?void 0:y),O=e.rowSpacing??e.spacing??(S?void 0:b),k=e.columnSpacing??e.spacing??(S?void 0:x),A={...c,level:S,columns:E,container:f,direction:m,wrap:h,spacing:D,rowSpacing:O,columnSpacing:k,size:w,offset:T};return(0,z.jsx)(s,{ref:t,as:p,ownerState:A,className:V(a(A,i).root,l),...C,children:_.Children.map(u,e=>_.isValidElement(e)&&Yu(e,[`Grid`])&&f&&e.props.container?_.cloneElement(e,{unstable_level:e.props?.unstable_level??S+1}):e)})});return c.muiName=`Grid`,c}var gd={black:`#000`,white:`#fff`},_d={50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`,A100:`#f5f5f5`,A200:`#eeeeee`,A400:`#bdbdbd`,A700:`#616161`},vd={50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`,A100:`#ea80fc`,A200:`#e040fb`,A400:`#d500f9`,A700:`#aa00ff`},yd={50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`,A100:`#ff8a80`,A200:`#ff5252`,A400:`#ff1744`,A700:`#d50000`},bd={50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`,A100:`#ffd180`,A200:`#ffab40`,A400:`#ff9100`,A700:`#ff6d00`},xd={50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`,A100:`#82b1ff`,A200:`#448aff`,A400:`#2979ff`,A700:`#2962ff`},Sd={50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`,A100:`#80d8ff`,A200:`#40c4ff`,A400:`#00b0ff`,A700:`#0091ea`},Cd={50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`,A100:`#b9f6ca`,A200:`#69f0ae`,A400:`#00e676`,A700:`#00c853`};function wd(){return{text:{primary:`rgba(0, 0, 0, 0.87)`,secondary:`rgba(0, 0, 0, 0.6)`,disabled:`rgba(0, 0, 0, 0.38)`},divider:`rgba(0, 0, 0, 0.12)`,background:{paper:gd.white,default:gd.white},action:{active:`rgba(0, 0, 0, 0.54)`,hover:`rgba(0, 0, 0, 0.04)`,hoverOpacity:.04,selected:`rgba(0, 0, 0, 0.08)`,selectedOpacity:.08,disabled:`rgba(0, 0, 0, 0.26)`,disabledBackground:`rgba(0, 0, 0, 0.12)`,disabledOpacity:.38,focus:`rgba(0, 0, 0, 0.12)`,focusOpacity:.12,activatedOpacity:.12}}}var Td=wd();function Ed(){return{text:{primary:gd.white,secondary:`rgba(255, 255, 255, 0.7)`,disabled:`rgba(255, 255, 255, 0.5)`,icon:`rgba(255, 255, 255, 0.5)`},divider:`rgba(255, 255, 255, 0.12)`,background:{paper:`#121212`,default:`#121212`},action:{active:gd.white,hover:`rgba(255, 255, 255, 0.08)`,hoverOpacity:.08,selected:`rgba(255, 255, 255, 0.16)`,selectedOpacity:.16,disabled:`rgba(255, 255, 255, 0.3)`,disabledBackground:`rgba(255, 255, 255, 0.12)`,disabledOpacity:.38,focus:`rgba(255, 255, 255, 0.12)`,focusOpacity:.12,activatedOpacity:.24}}}var Dd=Ed();function Od(e,t,n,r){let i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t===`light`?e.light=ru(e.main,i):t===`dark`&&(e.dark=tu(e.main,a)))}function kd(e,t,n,r,i){let a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n===`light`?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n===`dark`&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function Ad(e=`light`){return e===`dark`?{main:xd[200],light:xd[50],dark:xd[400]}:{main:xd[700],light:xd[400],dark:xd[800]}}function jd(e=`light`){return e===`dark`?{main:vd[200],light:vd[50],dark:vd[400]}:{main:vd[500],light:vd[300],dark:vd[700]}}function Md(e=`light`){return e===`dark`?{main:yd[500],light:yd[300],dark:yd[700]}:{main:yd[700],light:yd[400],dark:yd[800]}}function Nd(e=`light`){return e===`dark`?{main:Sd[400],light:Sd[300],dark:Sd[700]}:{main:Sd[700],light:Sd[500],dark:Sd[900]}}function Pd(e=`light`){return e===`dark`?{main:Cd[400],light:Cd[300],dark:Cd[700]}:{main:Cd[800],light:Cd[500],dark:Cd[900]}}function Fd(e=`light`){return e===`dark`?{main:bd[400],light:bd[300],dark:bd[700]}:{main:`#ed6c02`,light:bd[500],dark:bd[900]}}function Id(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Ld(e){let{mode:t=`light`,contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||Ad(t),s=e.secondary||jd(t),c=e.error||Md(t),l=e.info||Nd(t),u=e.success||Pd(t),d=e.warning||Fd(t);function f(e){return i?Id(e):Ql(e,Dd.text.primary)>=n?Dd.text.primary:Td.text.primary}let p=({color:e,name:t,mainShade:n=500,lightShade:a=300,darkShade:o=700})=>{if(e={...e},!e.main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty(`main`))throw Error(ma(11,t?` (${t})`:``,n));if(typeof e.main!=`string`)throw Error(ma(12,t?` (${t})`:``,JSON.stringify(e.main)));return i?(kd(i,e,`light`,a,r),kd(i,e,`dark`,o,r)):(Od(e,`light`,a,r),Od(e,`dark`,o,r)),e.contrastText||=f(e.main),e},m;return t===`light`?m=wd():t===`dark`&&(m=Ed()),Ls({common:{...gd},mode:t,primary:p({color:o,name:`primary`}),secondary:p({color:s,name:`secondary`,mainShade:`A400`,lightShade:`A200`,darkShade:`A700`}),error:p({color:c,name:`error`}),warning:p({color:d,name:`warning`}),info:p({color:l,name:`info`}),success:p({color:u,name:`success`}),grey:_d,contrastThreshold:n,getContrastText:f,augmentColor:p,tonalOffset:r,...m},a)}function Rd(e){let t={};return Object.entries(e).forEach(e=>{let[n,r]=e;typeof r==`object`&&(t[n]=`${r.fontStyle?`${r.fontStyle} `:``}${r.fontVariant?`${r.fontVariant} `:``}${r.fontWeight?`${r.fontWeight} `:``}${r.fontStretch?`${r.fontStretch} `:``}${r.fontSize||``}${r.lineHeight?`/${r.lineHeight} `:``}${r.fontFamily||``}`)}),t}function zd(e,t){return{toolbar:{minHeight:56,[e.up(`xs`)]:{"@media (orientation: landscape)":{minHeight:48}},[e.up(`sm`)]:{minHeight:64}},...t}}function Bd(e){return Math.round(e*1e5)/1e5}var Vd={textTransform:`uppercase`},Hd=`"Roboto", "Helvetica", "Arial", sans-serif`;function Ud(e,t){let{fontFamily:n=Hd,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:c=16,allVariants:l,pxToRem:u,...d}=typeof t==`function`?t(e):t,f=r/14,p=u||(e=>`${e/c*f}rem`),m=(e,t,r,i,a)=>({fontFamily:n,fontWeight:e,fontSize:p(t),lineHeight:r,...n===Hd?{letterSpacing:`${Bd(i/t)}em`}:{},...a,...l});return Ls({htmlFontSize:c,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(o,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(o,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(o,14,1.75,.4,Vd),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,Vd),inherit:{fontFamily:`inherit`,fontWeight:`inherit`,fontSize:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},d,{clone:!1})}var Wd=.2,Gd=.14,Kd=.12;function qd(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Wd})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Gd})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Kd})`].join(`,`)}var Jd=[`none`,qd(0,2,1,-1,0,1,1,0,0,1,3,0),qd(0,3,1,-2,0,2,2,0,0,1,5,0),qd(0,3,3,-2,0,3,4,0,0,1,8,0),qd(0,2,4,-1,0,4,5,0,0,1,10,0),qd(0,3,5,-1,0,5,8,0,0,1,14,0),qd(0,3,5,-1,0,6,10,0,0,1,18,0),qd(0,4,5,-2,0,7,10,1,0,2,16,1),qd(0,5,5,-3,0,8,10,1,0,3,14,2),qd(0,5,6,-3,0,9,12,1,0,3,16,2),qd(0,6,6,-3,0,10,14,1,0,4,18,3),qd(0,6,7,-4,0,11,15,1,0,4,20,3),qd(0,7,8,-4,0,12,17,2,0,5,22,4),qd(0,7,8,-4,0,13,19,2,0,5,24,4),qd(0,7,9,-4,0,14,21,2,0,5,26,4),qd(0,8,9,-5,0,15,22,2,0,6,28,5),qd(0,8,10,-5,0,16,24,2,0,6,30,5),qd(0,8,11,-5,0,17,26,2,0,6,32,5),qd(0,9,11,-5,0,18,28,2,0,7,34,6),qd(0,9,12,-6,0,19,29,2,0,7,36,6),qd(0,10,13,-6,0,20,31,3,0,8,38,7),qd(0,10,13,-6,0,21,33,3,0,8,40,7),qd(0,10,14,-6,0,22,35,3,0,8,42,7),qd(0,11,14,-7,0,23,36,3,0,9,44,8),qd(0,11,15,-7,0,24,38,3,0,9,46,8)],Yd={easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`,easeOut:`cubic-bezier(0.0, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,sharp:`cubic-bezier(0.4, 0, 0.6, 1)`},Xd={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Zd(e){return`${Math.round(e)}ms`}function Qd(e){if(!e)return 0;let t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function $d(e){let t={...Yd,...e.easing},n={...Xd,...e.duration};return{getAutoHeightDuration:Qd,create:(e=[`all`],r={})=>{let{duration:i=n.standard,easing:a=t.easeInOut,delay:o=0,...s}=r;return(Array.isArray(e)?e:[e]).map(e=>`${e} ${typeof i==`string`?i:Zd(i)} ${a} ${typeof o==`string`?o:Zd(o)}`).join(`,`)},...e,easing:t,duration:n}}var ef={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function tf(e){return Fs(e)||e===void 0||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||Array.isArray(e)}function nf(e={}){let t={...e};function n(e){let t=Object.entries(e);for(let r=0;r{if(!Number.isNaN(+e))return+e;let t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let e=0;eLs(e,t),p),p.unstable_sxConfig={...cl,...u?.unstable_sxConfig},p.unstable_sx=function(e){return dl({sx:e,theme:this})},p.toRuntimeSource=nf,of(p),p}function cf(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}var lf=[...Array(25)].map((e,t)=>{if(t===0)return`none`;let n=cf(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function uf(e){return{inputPlaceholder:e===`dark`?.5:.42,inputUnderline:e===`dark`?.7:.42,switchTrackDisabled:e===`dark`?.2:.12,switchTrack:e===`dark`?.3:.38}}function df(e){return e===`dark`?lf:[]}function ff(e){let{palette:t={mode:`light`},opacity:n,overlays:r,colorSpace:i,...a}=e,o=Ld({...t,colorSpace:i});return{palette:o,opacity:{...uf(o.mode),...n},overlays:r||df(o.mode),...a}}function pf(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]===`palette`&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}var mf=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:``}overlays-${n}`),`--${e?`${e}-`:``}palette-AppBar-darkBg`,`--${e?`${e}-`:``}palette-AppBar-darkColor`],hf=e=>(t,n)=>{let r=e.rootSelector||`:root`,i=e.colorSchemeSelector,a=i;if(i===`class`&&(a=`.%s`),i===`data`&&(a=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t===`dark`){let i={};return mf(e.cssVarPrefix).forEach(e=>{i[e]=n[e],delete n[e]}),a===`media`?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace(`%s`,t)]:i,[`${r}, ${a.replace(`%s`,t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!==`media`)return`${r}, ${a.replace(`%s`,String(t))}`}else if(t){if(a===`media`)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace(`%s`,String(t))}return r};function gf(e,t){t.forEach(t=>{e[t]||(e[t]={})})}function G(e,t,n){!e[t]&&n&&(e[t]=n)}function _f(e){return typeof e!=`string`||!e.startsWith(`hsl`)?e:Xl(e)}function vf(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Jl(_f(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color(). +To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function yf(e){return typeof e==`number`?`${e}px`:typeof e==`string`||typeof e==`function`||Array.isArray(e)?e:`8px`}var bf=e=>{try{return e()}catch{}},xf=(e=`mui`)=>Hu(e);function Sf(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;let a=i===`dark`?`dark`:`light`;if(!r){t[i]=ff({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}let{palette:o,...s}=sf({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...uf(a),...n?.opacity},overlays:n?.overlays||df(a)},s}function Cf(e={},...t){let{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a=`mui`,nativeColor:o=!1,shouldSkipGeneratingVar:s=pf,colorSchemeSelector:c=n.light&&n.dark?`media`:void 0,rootSelector:l=`:root`,...u}=e,d=Object.keys(n)[0],f=r||(n.light&&d!==`light`?`light`:d),p=xf(a),{[f]:m,light:h,dark:g,..._}=n,v={..._},y=m;if((f===`dark`&&!(`dark`in n)||f===`light`&&!(`light`in n))&&(y=!0),!y)throw Error(ma(21,f));let b;o&&(b=`oklch`);let x=Sf(b,v,y,u,f);h&&!v.light&&Sf(b,v,h,void 0,`light`),g&&!v.dark&&Sf(b,v,g,void 0,`dark`);let S={defaultColorScheme:f,...x,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:l,getCssVar:p,colorSchemes:v,font:{...Rd(x.typography),...x.font},spacing:yf(u.spacing)};Object.keys(S.colorSchemes).forEach(e=>{let t=S.colorSchemes[e].palette,n=e=>{let n=e.split(`-`),r=n[1],i=n[2];return p(e,t[r][i])};t.mode===`light`&&(G(t.common,`background`,`#fff`),G(t.common,`onBackground`,`#000`)),t.mode===`dark`&&(G(t.common,`background`,`#000`),G(t.common,`onBackground`,`#fff`));function r(e,t,n){if(b){let r;return e===eu&&(r=`transparent ${((1-n)*100).toFixed(0)}%`),e===nu&&(r=`#000 ${(n*100).toFixed(0)}%`),e===iu&&(r=`#fff ${(n*100).toFixed(0)}%`),`color-mix(in ${b}, ${t}, ${r})`}return e(t,n)}if(gf(t,[`Alert`,`AppBar`,`Avatar`,`Button`,`Chip`,`FilledInput`,`LinearProgress`,`Skeleton`,`Slider`,`SnackbarContent`,`SpeedDialAction`,`StepConnector`,`StepContent`,`Switch`,`TableCell`,`Tooltip`]),t.mode===`light`){G(t.Alert,`errorColor`,r(nu,o?p(`palette-error-light`):t.error.light,.6)),G(t.Alert,`infoColor`,r(nu,o?p(`palette-info-light`):t.info.light,.6)),G(t.Alert,`successColor`,r(nu,o?p(`palette-success-light`):t.success.light,.6)),G(t.Alert,`warningColor`,r(nu,o?p(`palette-warning-light`):t.warning.light,.6)),G(t.Alert,`errorFilledBg`,n(`palette-error-main`)),G(t.Alert,`infoFilledBg`,n(`palette-info-main`)),G(t.Alert,`successFilledBg`,n(`palette-success-main`)),G(t.Alert,`warningFilledBg`,n(`palette-warning-main`)),G(t.Alert,`errorFilledColor`,bf(()=>t.getContrastText(t.error.main))),G(t.Alert,`infoFilledColor`,bf(()=>t.getContrastText(t.info.main))),G(t.Alert,`successFilledColor`,bf(()=>t.getContrastText(t.success.main))),G(t.Alert,`warningFilledColor`,bf(()=>t.getContrastText(t.warning.main))),G(t.Alert,`errorStandardBg`,r(iu,o?p(`palette-error-light`):t.error.light,.9)),G(t.Alert,`infoStandardBg`,r(iu,o?p(`palette-info-light`):t.info.light,.9)),G(t.Alert,`successStandardBg`,r(iu,o?p(`palette-success-light`):t.success.light,.9)),G(t.Alert,`warningStandardBg`,r(iu,o?p(`palette-warning-light`):t.warning.light,.9)),G(t.Alert,`errorIconColor`,n(`palette-error-main`)),G(t.Alert,`infoIconColor`,n(`palette-info-main`)),G(t.Alert,`successIconColor`,n(`palette-success-main`)),G(t.Alert,`warningIconColor`,n(`palette-warning-main`)),G(t.AppBar,`defaultBg`,n(`palette-grey-100`)),G(t.Avatar,`defaultBg`,n(`palette-grey-400`)),G(t.Button,`inheritContainedBg`,n(`palette-grey-300`)),G(t.Button,`inheritContainedHoverBg`,n(`palette-grey-A100`)),G(t.Chip,`defaultBorder`,n(`palette-grey-400`)),G(t.Chip,`defaultAvatarColor`,n(`palette-grey-700`)),G(t.Chip,`defaultIconColor`,n(`palette-grey-700`)),G(t.FilledInput,`bg`,`rgba(0, 0, 0, 0.06)`),G(t.FilledInput,`hoverBg`,`rgba(0, 0, 0, 0.09)`),G(t.FilledInput,`disabledBg`,`rgba(0, 0, 0, 0.12)`),G(t.LinearProgress,`primaryBg`,r(iu,o?p(`palette-primary-main`):t.primary.main,.62)),G(t.LinearProgress,`secondaryBg`,r(iu,o?p(`palette-secondary-main`):t.secondary.main,.62)),G(t.LinearProgress,`errorBg`,r(iu,o?p(`palette-error-main`):t.error.main,.62)),G(t.LinearProgress,`infoBg`,r(iu,o?p(`palette-info-main`):t.info.main,.62)),G(t.LinearProgress,`successBg`,r(iu,o?p(`palette-success-main`):t.success.main,.62)),G(t.LinearProgress,`warningBg`,r(iu,o?p(`palette-warning-light`):t.warning.main,.62)),G(t.Skeleton,`bg`,b?r(eu,o?p(`palette-text-primary`):t.text.primary,.11):`rgba(${n(`palette-text-primaryChannel`)} / 0.11)`),G(t.Slider,`primaryTrack`,r(iu,o?p(`palette-primary-main`):t.primary.main,.62)),G(t.Slider,`secondaryTrack`,r(iu,o?p(`palette-secondary-main`):t.secondary.main,.62)),G(t.Slider,`errorTrack`,r(iu,o?p(`palette-error-main`):t.error.main,.62)),G(t.Slider,`infoTrack`,r(iu,o?p(`palette-info-main`):t.info.main,.62)),G(t.Slider,`successTrack`,r(iu,o?p(`palette-success-main`):t.success.main,.62)),G(t.Slider,`warningTrack`,r(iu,o?p(`palette-warning-main`):t.warning.main,.62));let e=b?r(nu,o?p(`palette-background-default`):t.background.default,.6825):ou(t.background.default,.8);G(t.SnackbarContent,`bg`,e),G(t.SnackbarContent,`color`,bf(()=>b?Dd.text.primary:t.getContrastText(e))),G(t.SpeedDialAction,`fabHoverBg`,ou(t.background.paper,.15)),G(t.StepConnector,`border`,n(`palette-grey-400`)),G(t.StepContent,`border`,n(`palette-grey-400`)),G(t.Switch,`defaultColor`,n(`palette-common-white`)),G(t.Switch,`defaultDisabledColor`,n(`palette-grey-100`)),G(t.Switch,`primaryDisabledColor`,r(iu,o?p(`palette-primary-main`):t.primary.main,.62)),G(t.Switch,`secondaryDisabledColor`,r(iu,o?p(`palette-secondary-main`):t.secondary.main,.62)),G(t.Switch,`errorDisabledColor`,r(iu,o?p(`palette-error-main`):t.error.main,.62)),G(t.Switch,`infoDisabledColor`,r(iu,o?p(`palette-info-main`):t.info.main,.62)),G(t.Switch,`successDisabledColor`,r(iu,o?p(`palette-success-main`):t.success.main,.62)),G(t.Switch,`warningDisabledColor`,r(iu,o?p(`palette-warning-main`):t.warning.main,.62)),G(t.TableCell,`border`,r(iu,eu(o?p(`palette-divider`):t.divider,1),.88)),G(t.Tooltip,`bg`,r(eu,o?p(`palette-grey-700`):t.grey[700],.92))}if(t.mode===`dark`){G(t.Alert,`errorColor`,r(iu,o?p(`palette-error-light`):t.error.light,.6)),G(t.Alert,`infoColor`,r(iu,o?p(`palette-info-light`):t.info.light,.6)),G(t.Alert,`successColor`,r(iu,o?p(`palette-success-light`):t.success.light,.6)),G(t.Alert,`warningColor`,r(iu,o?p(`palette-warning-light`):t.warning.light,.6)),G(t.Alert,`errorFilledBg`,n(`palette-error-dark`)),G(t.Alert,`infoFilledBg`,n(`palette-info-dark`)),G(t.Alert,`successFilledBg`,n(`palette-success-dark`)),G(t.Alert,`warningFilledBg`,n(`palette-warning-dark`)),G(t.Alert,`errorFilledColor`,bf(()=>t.getContrastText(t.error.dark))),G(t.Alert,`infoFilledColor`,bf(()=>t.getContrastText(t.info.dark))),G(t.Alert,`successFilledColor`,bf(()=>t.getContrastText(t.success.dark))),G(t.Alert,`warningFilledColor`,bf(()=>t.getContrastText(t.warning.dark))),G(t.Alert,`errorStandardBg`,r(nu,o?p(`palette-error-light`):t.error.light,.9)),G(t.Alert,`infoStandardBg`,r(nu,o?p(`palette-info-light`):t.info.light,.9)),G(t.Alert,`successStandardBg`,r(nu,o?p(`palette-success-light`):t.success.light,.9)),G(t.Alert,`warningStandardBg`,r(nu,o?p(`palette-warning-light`):t.warning.light,.9)),G(t.Alert,`errorIconColor`,n(`palette-error-main`)),G(t.Alert,`infoIconColor`,n(`palette-info-main`)),G(t.Alert,`successIconColor`,n(`palette-success-main`)),G(t.Alert,`warningIconColor`,n(`palette-warning-main`)),G(t.AppBar,`defaultBg`,n(`palette-grey-900`)),G(t.AppBar,`darkBg`,n(`palette-background-paper`)),G(t.AppBar,`darkColor`,n(`palette-text-primary`)),G(t.Avatar,`defaultBg`,n(`palette-grey-600`)),G(t.Button,`inheritContainedBg`,n(`palette-grey-800`)),G(t.Button,`inheritContainedHoverBg`,n(`palette-grey-700`)),G(t.Chip,`defaultBorder`,n(`palette-grey-700`)),G(t.Chip,`defaultAvatarColor`,n(`palette-grey-300`)),G(t.Chip,`defaultIconColor`,n(`palette-grey-300`)),G(t.FilledInput,`bg`,`rgba(255, 255, 255, 0.09)`),G(t.FilledInput,`hoverBg`,`rgba(255, 255, 255, 0.13)`),G(t.FilledInput,`disabledBg`,`rgba(255, 255, 255, 0.12)`),G(t.LinearProgress,`primaryBg`,r(nu,o?p(`palette-primary-main`):t.primary.main,.5)),G(t.LinearProgress,`secondaryBg`,r(nu,o?p(`palette-secondary-main`):t.secondary.main,.5)),G(t.LinearProgress,`errorBg`,r(nu,o?p(`palette-error-main`):t.error.main,.5)),G(t.LinearProgress,`infoBg`,r(nu,o?p(`palette-info-main`):t.info.main,.5)),G(t.LinearProgress,`successBg`,r(nu,o?p(`palette-success-main`):t.success.main,.5)),G(t.LinearProgress,`warningBg`,r(nu,o?p(`palette-warning-main`):t.warning.main,.5)),G(t.Skeleton,`bg`,b?r(eu,o?p(`palette-text-primary`):t.text.primary,.13):`rgba(${n(`palette-text-primaryChannel`)} / 0.13)`),G(t.Slider,`primaryTrack`,r(nu,o?p(`palette-primary-main`):t.primary.main,.5)),G(t.Slider,`secondaryTrack`,r(nu,o?p(`palette-secondary-main`):t.secondary.main,.5)),G(t.Slider,`errorTrack`,r(nu,o?p(`palette-error-main`):t.error.main,.5)),G(t.Slider,`infoTrack`,r(nu,o?p(`palette-info-main`):t.info.main,.5)),G(t.Slider,`successTrack`,r(nu,o?p(`palette-success-main`):t.success.main,.5)),G(t.Slider,`warningTrack`,r(nu,o?p(`palette-warning-light`):t.warning.main,.5));let e=b?r(iu,o?p(`palette-background-default`):t.background.default,.985):ou(t.background.default,.98);G(t.SnackbarContent,`bg`,e),G(t.SnackbarContent,`color`,bf(()=>b?Td.text.primary:t.getContrastText(e))),G(t.SpeedDialAction,`fabHoverBg`,ou(t.background.paper,.15)),G(t.StepConnector,`border`,n(`palette-grey-600`)),G(t.StepContent,`border`,n(`palette-grey-600`)),G(t.Switch,`defaultColor`,n(`palette-grey-300`)),G(t.Switch,`defaultDisabledColor`,n(`palette-grey-600`)),G(t.Switch,`primaryDisabledColor`,r(nu,o?p(`palette-primary-main`):t.primary.main,.55)),G(t.Switch,`secondaryDisabledColor`,r(nu,o?p(`palette-secondary-main`):t.secondary.main,.55)),G(t.Switch,`errorDisabledColor`,r(nu,o?p(`palette-error-main`):t.error.main,.55)),G(t.Switch,`infoDisabledColor`,r(nu,o?p(`palette-info-main`):t.info.main,.55)),G(t.Switch,`successDisabledColor`,r(nu,o?p(`palette-success-main`):t.success.main,.55)),G(t.Switch,`warningDisabledColor`,r(nu,o?p(`palette-warning-light`):t.warning.main,.55)),G(t.TableCell,`border`,r(nu,eu(o?p(`palette-divider`):t.divider,1),.68)),G(t.Tooltip,`bg`,r(eu,o?p(`palette-grey-700`):t.grey[700],.92))}o||(vf(t.background,`default`),vf(t.background,`paper`),vf(t.common,`background`),vf(t.common,`onBackground`),vf(t,`divider`)),Object.keys(t).forEach(e=>{let n=t[e];e!==`tonalOffset`&&!o&&n&&typeof n==`object`&&(n.main&&G(t[e],`mainChannel`,Jl(_f(n.main))),n.light&&G(t[e],`lightChannel`,Jl(_f(n.light))),n.dark&&G(t[e],`darkChannel`,Jl(_f(n.dark))),n.contrastText&&G(t[e],`contrastTextChannel`,Jl(_f(n.contrastText))),e===`text`&&(vf(t[e],`primary`),vf(t[e],`secondary`)),e===`action`&&(n.active&&vf(t[e],`active`),n.selected&&vf(t[e],`selected`)))})}),S=t.reduce((e,t)=>Ls(e,t),S);let C={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:hf(S),enableContrastVars:o},{vars:w,generateThemeVars:T,generateStyleSheets:E}=qu(S,C);return S.vars=w,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([e,t])=>{S[e]=t}),S.generateThemeVars=T,S.generateStyleSheets=E,S.generateSpacing=function(){return Pc(u.spacing,Dc(this))},S.getColorSchemeSelector=Ju(c),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=s,S.unstable_sxConfig={...cl,...u?.unstable_sxConfig},S.unstable_sx=function(e){return dl({sx:e,theme:this})},S.internal_cache={},S.toRuntimeSource=nf,S}function wf(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Ld({...n===!0?{}:n.palette,mode:t})})}function Tf(e={},...t){let{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,s=a||`light`,c=i?.[s],l={...i,...n?{[s]:{...typeof c!=`boolean`&&c,palette:n}}:void 0};if(r===!1){if(!(`colorSchemes`in e))return sf(e,...t);let r=n;`palette`in e||l[s]&&(l[s]===!0?s===`dark`&&(r={mode:`dark`}):r=l[s].palette);let i=sf({...e,palette:r},...t);return i.defaultColorScheme=s,i.colorSchemes=l,i.palette.mode===`light`&&(i.colorSchemes.light={...l.light!==!0&&l.light,palette:i.palette},wf(i,`dark`,l.dark)),i.palette.mode===`dark`&&(i.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:i.palette},wf(i,`light`,l.light)),i}return!n&&!(`light`in l)&&s===`light`&&(l.light=!0),Cf({...o,colorSchemes:l,defaultColorScheme:s,...typeof r!=`boolean`&&r},...t)}var Ef=Tf();function Df(){let e=yl(Ef);return e.$$material||e}function Of(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}var kf=e=>Of(e)&&e!==`classes`,K=Fl({themeId:ha,defaultTheme:Ef,rootShouldForwardProp:kf});function Af({theme:e,...t}){let n=`$$material`in e?e[ha]:void 0;return(0,z.jsx)(Eu,{...t,themeId:n?ha:void 0,theme:n||e})}var jf={attribute:`data-mui-color-scheme`,colorSchemeStorageKey:`mui-color-scheme`,defaultLightColorScheme:`light`,defaultDarkColorScheme:`dark`,modeStorageKey:`mui-mode`},{CssVarsProvider:Mf,useColorScheme:Nf,getInitColorSchemeScript:Pf}=Vu({themeId:ha,theme:()=>Tf({cssVariables:!0}),colorSchemeStorageKey:jf.colorSchemeStorageKey,modeStorageKey:jf.modeStorageKey,defaultColorScheme:{light:jf.defaultLightColorScheme,dark:jf.defaultDarkColorScheme},resolveTheme:e=>{let t={...e,typography:Ud(e.palette,e.typography)};return t.unstable_sx=function(e){return dl({sx:e,theme:this})},t}}),Ff=Mf;function If({theme:e,...t}){let n=_.useMemo(()=>{if(typeof e==`function`)return e;let t=`$$material`in e?e[ha]:e;return`colorSchemes`in t?null:`vars`in t?e:{...e,vars:null}},[e]);return n?(0,z.jsx)(Af,{theme:n,...t}):(0,z.jsx)(Ff,{theme:e,...t})}function Lf(e){return(0,z.jsx)(xl,{...e,defaultTheme:Ef,themeId:ha})}function Rf(e){return function(t){return(0,z.jsx)(Lf,{styles:typeof e==`function`?n=>e({theme:n,...t}):e})}}function q(e){return vu(e)}var zf=typeof Rf({})==`function`,Bf=(e,t)=>({WebkitFontSmoothing:`antialiased`,MozOsxFontSmoothing:`grayscale`,boxSizing:`border-box`,WebkitTextSizeAdjust:`100%`,...t&&!e.vars&&{colorScheme:e.palette.mode}}),Vf=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),Hf=(e,t=!1)=>{let n={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector==`function`&&Object.entries(e.colorSchemes).forEach(([t,r])=>{let i=e.getColorSchemeSelector(t);i.startsWith(`@`)?n[i]={":root":{colorScheme:r.palette?.mode}}:n[i.replace(/\s*&/,``)]={colorScheme:r.palette?.mode}});let r={html:Bf(e,t),"*, *::before, *::after":{boxSizing:`inherit`},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...Vf(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...n},i=e.components?.MuiCssBaseline?.styleOverrides;return i&&(r=[r,i]),r},Uf=`mui-ecs`,Wf=e=>{let t=Hf(e,!1),n=Array.isArray(t)?t[0]:t;return!e.vars&&n&&(n.html[`:root:has(${Uf})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([t,r])=>{let i=e.getColorSchemeSelector(t);i.startsWith(`@`)?n[i]={[`:root:not(:has(.${Uf}))`]:{colorScheme:r.palette?.mode}}:n[i.replace(/\s*&/,``)]={[`&:not(:has(.${Uf}))`]:{colorScheme:r.palette?.mode}}}),t},Gf=Rf(zf?({theme:e,enableColorScheme:t})=>Hf(e,t):({theme:e})=>Wf(e));function Kf(e){let{children:t,enableColorScheme:n=!1}=q({props:e,name:`MuiCssBaseline`});return(0,z.jsxs)(_.Fragment,{children:[zf&&(0,z.jsx)(Gf,{enableColorScheme:n}),!zf&&!n&&(0,z.jsx)(`span`,{className:Uf,style:{display:`none`}}),t]})}var qf=c(g(),1),Jf=new Yi({defaultOptions:{queries:{staleTime:300*1e3,retry:1}}}),Yf=(0,_.createContext)({mode:`dark`,toggleTheme:()=>{}});function Xf({children:e}){let[t,n]=(0,_.useState)(`dark`),r=(0,_.useMemo)(()=>({mode:t,toggleTheme:()=>{let e=t===`dark`?`light`:`dark`;n(e),document.documentElement.classList.toggle(`dark`,e===`dark`)}}),[t]);return(0,z.jsx)(Yf.Provider,{value:r,children:e})}function Zf(){return(0,_.useContext)(Yf)}function Qf(){let{mode:e}=Zf();return(0,z.jsxs)(If,{theme:(0,_.useMemo)(()=>Tf({shape:{borderRadius:16},palette:{mode:e,primary:{main:`#6366f1`},background:{default:e===`dark`?`#09090b`:`#fafafa`,paper:e===`dark`?`#18181b`:`#ffffff`},text:{primary:e===`dark`?`#e4e4e7`:`#18181b`,secondary:e===`dark`?`#a1a1aa`:`#52525b`,disabled:e===`dark`?`#71717a`:`#a1a1aa`},divider:e===`dark`?`#27272a`:`#e4e4e7`,action:{hover:e===`dark`?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.04)`,selected:e===`dark`?`rgba(99,102,241,0.16)`:`rgba(99,102,241,0.12)`}},components:{MuiCard:{styleOverrides:{root:{border:`1px solid #27272a`,backgroundImage:`none`,boxShadow:`none`,borderRadius:20}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:`#18181b`,borderBottom:`1px solid #27272a`,boxShadow:`none`}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:`#18181b`,borderRight:`1px solid #27272a`}}},MuiButton:{styleOverrides:{root:{textTransform:`none`,borderRadius:12}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:12}}},MuiDialog:{styleOverrides:{paper:{borderRadius:20}}}}}),[e]),children:[(0,z.jsx)(Kf,{}),(0,z.jsx)(jr,{})]})}function $f(){return(0,z.jsx)(Qi,{client:Jf,children:(0,z.jsx)(Xf,{children:(0,z.jsx)(Qf,{})})})}var J=pc;function ep(...e){return e.reduce((e,t)=>t==null?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}var Y=Ou;function tp(e){return H(`MuiSvgIcon`,e)}U(`MuiSvgIcon`,[`root`,`colorPrimary`,`colorSecondary`,`colorAction`,`colorError`,`colorDisabled`,`fontSizeInherit`,`fontSizeSmall`,`fontSizeMedium`,`fontSizeLarge`]);var np=e=>{let{color:t,fontSize:n,classes:r}=e;return W({root:[`root`,t!==`inherit`&&`color${J(t)}`,`fontSize${J(n)}`]},tp,r)},rp=K(`svg`,{name:`MuiSvgIcon`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color!==`inherit`&&t[`color${J(n.color)}`],t[`fontSize${J(n.fontSize)}`]]}})(Y(({theme:e})=>({userSelect:`none`,width:`1em`,height:`1em`,display:`inline-block`,flexShrink:0,transition:e.transitions?.create?.(`fill`,{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:`currentColor`}},{props:{fontSize:`inherit`},style:{fontSize:`inherit`}},{props:{fontSize:`small`},style:{fontSize:e.typography?.pxToRem?.(20)||`1.25rem`}},{props:{fontSize:`medium`},style:{fontSize:e.typography?.pxToRem?.(24)||`1.5rem`}},{props:{fontSize:`large`},style:{fontSize:e.typography?.pxToRem?.(35)||`2.1875rem`}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:`action`},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:`disabled`},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:`inherit`},style:{color:void 0}}]}))),ip=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiSvgIcon`}),{children:r,className:i,color:a=`inherit`,component:o=`svg`,fontSize:s=`medium`,htmlColor:c,inheritViewBox:l=!1,titleAccess:u,viewBox:d=`0 0 24 24`,...f}=n,p=_.isValidElement(r)&&r.type===`svg`,m={...n,color:a,component:o,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:l,viewBox:d,hasSvgAsChild:p},h={};return l||(h.viewBox=d),(0,z.jsxs)(rp,{as:o,className:V(np(m).root,i),focusable:`false`,color:c,"aria-hidden":u?void 0:!0,role:u?`img`:void 0,ref:t,...h,...f,...p&&r.props,ownerState:m,children:[p?r.props.children:r,u?(0,z.jsx)(`title`,{children:u}):null]})});ip.muiName=`SvgIcon`;function ap(e,t){function n(t,n){return(0,z.jsx)(ip,{"data-testid":void 0,ref:n,...t,children:e})}return n.muiName=ip.muiName,_.memo(_.forwardRef(n))}function op(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}var sp=op,cp=Yu;function lp(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}var up=lp;function dp(e){return e&&e.ownerDocument||document}var fp=dp;function pp(e){return dp(e).defaultView||window}var mp=pp;function hp(e,t){typeof e==`function`?e(t):e&&(e.current=t)}var gp=Hl,_p=Su;function vp(e){let{controlled:t,default:n,name:r,state:i=`value`}=e,{current:a}=_.useRef(t!==void 0),[o,s]=_.useState(n);return[a?t:o,_.useCallback(e=>{a||s(e)},[])]}var yp=vp;function bp(e){let t=_.useRef(e);return Hl(()=>{t.current=e}),_.useRef((...e)=>(0,t.current)(...e)).current}var xp=bp;function Sp(...e){let t=_.useRef(void 0),n=_.useCallback(t=>{let n=e.map(e=>{if(e==null)return null;if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}});return()=>{n.forEach(e=>e?.())}},e);return _.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Cp=Sp;function wp(e,t){let n=e.charCodeAt(2);return e[0]===`o`&&e[1]===`n`&&n>=65&&n<=90&&typeof t==`function`}function Tp(e,t){if(!e)return t;function n(e,t){let n={};return Object.keys(t).forEach(r=>{wp(r,t[r])&&typeof e[r]==`function`&&(n[r]=(...n)=>{e[r](...n),t[r](...n)})}),n}if(typeof e==`function`||typeof t==`function`)return r=>{let i=typeof t==`function`?t(r):t,a=typeof e==`function`?e({...r,...i}):e,o=V(r?.className,i?.className,a?.className),s=n(a,i);return{...i,...a,...s,...!!o&&{className:o},...i?.style&&a?.style&&{style:{...i.style,...a.style}},...i?.sx&&a?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};let r=t,i=n(e,r),a=V(r?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...r?.style&&e?.style&&{style:{...r.style,...e.style}},...r?.sx&&e?.sx&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function Ep(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Dp(e,t){return Dp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dp(e,t)}function Op(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Dp(e,t)}var kp={disabled:!1},Ap=_.createContext(null),jp=function(e){return e.scrollTop},Mp=`unmounted`,Np=`exited`,Pp=`entering`,Fp=`entered`,Ip=`exiting`,Lp=function(e){Op(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=Np,r.appearStatus=Pp):o=Fp:o=t.unmountOnExit||t.mountOnEnter?Mp:Np,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:Np}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=Pp):(n===`entering`||n===`entered`)&&(t=Ip)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:ar.default.findDOMNode(this);n&&jp(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:Mp})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[ar.default.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||kp.disabled){this.safeSetState({status:Fp},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:Pp},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:Fp},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:ar.default.findDOMNode(this);if(!t||kp.disabled){this.safeSetState({status:Np},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:Ip},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Np},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:ar.default.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=Ep(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return _.createElement(Ap.Provider,{value:null},typeof n==`function`?n(e,r):_.cloneElement(_.Children.only(n),r))},t}(_.Component);Lp.contextType=Ap,Lp.propTypes={};function Rp(){}Lp.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Rp,onEntering:Rp,onEntered:Rp,onExit:Rp,onExiting:Rp,onExited:Rp},Lp.UNMOUNTED=Mp,Lp.EXITED=Np,Lp.ENTERING=Pp,Lp.ENTERED=Fp,Lp.EXITING=Ip;function zp(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Bp(e,t){var n=function(e){return t&&(0,_.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&_.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function Vp(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o{this.currentId=null,t()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear};function $p(){let e=Yp(Qp.create).current;return Zp(e.disposeEffect),e}var em=e=>e.scrollTop,tm={offsetX:0,offsetY:0},nm={matrix:[4,5],matrix3d:[12,13],translate:[0,1],translate3d:[0,1],translateX:[0,null],translateY:[null,0]};function rm(e){let t=parseFloat(e??``);return Number.isNaN(t)?0:t}function im(e){let t=e.match(/^(matrix|matrix3d|translate|translate3d|translateX|translateY)\((.+)\)$/);return t?{type:t[1],values:t[2].split(`,`).map(rm)}:null}function am(e,t){return t===null?0:e[t]||0}function om(e){if(!e||e===`none`)return tm;let t=im(e);if(!t)return tm;let{type:n,values:r}=t,i=nm[n];return i?{offsetX:am(r,i[0]),offsetY:am(r,i[1])}:tm}function sm(e,t){return n=>{if(t){let r=e.current;n===void 0?t(r):t(r,n)}}}function cm(e,t,n,r,i,a){let o=e===`exited`&&!t?r:n[e]||n.exited;return i||a?{...o,...i,...a}:o}function lm(e,t){let{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n==`number`?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r==`object`?r[t.mode]:r),delay:i.transitionDelay}}function um(e){return typeof e==`string`}function dm(e,t,n){return e===void 0||um(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function fm(e,t,n){return typeof e==`function`?e(t,n):e}function pm(e){if(e===void 0)return{};let t={};for(let n of Object.keys(e))wp(n,e[n])&&(t[n]=e[n]);return t}function mm(e){if(e===void 0)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&typeof e[t]==`function`)).forEach(n=>{t[n]=e[n]}),t}function hm(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=V(n?.className,a,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},o={...n,...i,...r};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}let o=pm({...i,...r}),s=mm(r),c=mm(i),l=t(o),u=V(l?.className,n?.className,a,i?.className,r?.className),d={...l?.style,...n?.style,...i?.style,...r?.style},f={...l,...n,...c,...s};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}function X(e,t){let{className:n,elementType:r,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...c}=t,{component:l,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...f}=a,p=u[e]||r,m=fm(d[e],i),{props:{component:h,...g},internalRef:_}=hm({className:n,...c,externalForwardedProps:e===`root`?f:void 0,externalSlotProps:m}),v=Sp(_,m?.ref,t.ref),y=e===`root`?h||l:h;return[p,dm(p,{...e===`root`&&!l&&!u[e]&&o,...e!==`root`&&!u[e]&&o,...g,...y&&!s&&{as:y},...y&&s&&{component:y},ref:v},i)]}function gm(e){return H(`MuiPaper`,e)}U(`MuiPaper`,`root.rounded.outlined.elevation.elevation0.elevation1.elevation2.elevation3.elevation4.elevation5.elevation6.elevation7.elevation8.elevation9.elevation10.elevation11.elevation12.elevation13.elevation14.elevation15.elevation16.elevation17.elevation18.elevation19.elevation20.elevation21.elevation22.elevation23.elevation24`.split(`.`));var _m=e=>{let{square:t,elevation:n,variant:r,classes:i}=e;return W({root:[`root`,r,!t&&`rounded`,r===`elevation`&&`elevation${n}`]},gm,i)},vm=K(`div`,{name:`MuiPaper`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant===`elevation`&&t[`elevation${n.elevation}`]]}})(Y(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create(`box-shadow`),variants:[{props:({ownerState:e})=>!e.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:`outlined`},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:`elevation`},style:{boxShadow:`var(--Paper-shadow)`,backgroundImage:`var(--Paper-overlay)`}}]}))),ym=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiPaper`}),r=Df(),{className:i,component:a=`div`,elevation:o=1,square:s=!1,variant:c=`elevation`,...l}=n,u={...n,component:a,elevation:o,square:s,variant:c};return(0,z.jsx)(vm,{as:a,ownerState:u,className:V(_m(u).root,i),ref:t,...l,style:{...c===`elevation`&&{"--Paper-shadow":(r.vars||r).shadows[o],...r.vars&&{"--Paper-overlay":r.vars.overlays?.[o]},...!r.vars&&r.palette.mode===`dark`&&{"--Paper-overlay":`linear-gradient(${$l(`#fff`,cf(o))}, ${$l(`#fff`,cf(o))})`}},...l.style}})});function bm(e){try{return e.matches(`:focus-visible`)}catch{}return!1}function xm(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return _.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}var Sm={};function Cm(e){let{nativeButton:t,nativeButtonProp:n,internalNativeButton:r=t,allowInferredHostMismatch:i=!1,disabled:a,type:o,hasFormAction:s=!1,tabIndex:c=0,focusableWhenDisabled:l,stopEventPropagation:u=!1,onBeforeKeyDown:d,onBeforeKeyUp:f}=e,p=_.useRef(null),m=l===!0,h=xm({focusableWhenDisabled:m,disabled:a,isNativeButton:t,tabIndex:c}),g=_.useCallback(()=>{let e=p.current;return e==null?t:e.tagName===`BUTTON`?!0:!!(e.tagName===`A`&&e.href)},[t]),v=_.useMemo(()=>{let e=m?{}:{tabIndex:a?-1:c};return t?(e.type=o===void 0&&!s?`button`:o,m||(e.disabled=a)):(e.role=`button`,!m&&a&&(e[`aria-disabled`]=a)),m?{...e,...h}:e},[a,m,h,s,t,c,o]);return{getButtonProps:_.useCallback((e=Sm)=>{let{onClick:t,onKeyDown:n,onKeyUp:r,...i}=e,o=e=>{if(u&&e.stopPropagation(),a){e.preventDefault();return}t?.(e)},s=e=>{if(m&&h.onKeyDown(e),!a&&(d?.(e),n?.(e),!(e.target!==e.currentTarget||g()))){if(e.key===` `){e.preventDefault();return}e.key===`Enter`&&(e.preventDefault(),e.currentTarget.click())}},c=e=>{a||(f?.(e),r?.(e),e.target===e.currentTarget&&!g()&&e.key===` `&&!e.defaultPrevented&&e.currentTarget.click())};return{...v,...i,onClick:o,onKeyDown:s,onKeyUp:c}},[v,a,m,h,g,d,f,u]),rootRef:p}}var wm=class e{static create(){return new e}static use(){let t=Yp(e.create).current,[n,r]=_.useState(!1);return t.shouldMount=n,t.setShouldMount=r,_.useEffect(t.mountEffect,[n]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=Em(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...e){this.mount().then(()=>this.ref.current?.start(...e))}stop(...e){this.mount().then(()=>this.ref.current?.stop(...e))}pulsate(...e){this.mount().then(()=>this.ref.current?.pulsate(...e))}};function Tm(){return wm.use()}function Em(){let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}function Dm(e){let{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:a,rippleSize:o,in:s,onExited:c,timeout:l}=e,[u,d]=_.useState(!1),f=V(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:o,height:o,top:-(o/2)+a,left:-(o/2)+i},m=V(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&d(!0),_.useEffect(()=>{if(!s&&c!=null){let e=setTimeout(c,l);return()=>{clearTimeout(e)}}},[c,s,l]),(0,z.jsx)(`span`,{className:f,style:p,children:(0,z.jsx)(`span`,{className:m})})}var Om=U(`MuiTouchRipple`,[`root`,`ripple`,`rippleVisible`,`ripplePulsate`,`child`,`childLeaving`,`childPulsate`]),km=550,Am=hs` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`,jm=hs` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`,Mm=hs` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`,Nm=K(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),Pm=K(Dm,{name:`MuiTouchRipple`,slot:`Ripple`})` + opacity: 0; + position: absolute; + + &.${Om.rippleVisible} { + opacity: 0.3; + transform: scale(1); + animation-name: ${Am}; + animation-duration: ${km}ms; + animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; + } + + &.${Om.ripplePulsate} { + animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; + } + + & .${Om.child} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${Om.childLeaving} { + opacity: 0; + animation-name: ${jm}; + animation-duration: ${km}ms; + animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; + } + + & .${Om.childPulsate} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${Mm}; + animation-duration: 2500ms; + animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`,Fm=_.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=q({props:e,name:`MuiTouchRipple`}),[o,s]=_.useState([]),c=_.useRef(0),l=_.useRef(null);_.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=_.useRef(!1),d=$p(),f=_.useRef(null),p=_.useRef(null),m=_.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,z.jsx)(Pm,{classes:{ripple:V(r.ripple,Om.ripple),rippleVisible:V(r.rippleVisible,Om.rippleVisible),ripplePulsate:V(r.ripplePulsate,Om.ripplePulsate),child:V(r.child,Om.child),childLeaving:V(r.childLeaving,Om.childLeaving),childPulsate:V(r.childPulsate,Om.childPulsate)},timeout:km,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),h=_.useCallback((e={},t={},r=()=>{})=>{let{pulsate:i=!1,center:a=n||t.pulsate,fakeElement:o=!1}=t;if(e?.type===`mousedown`&&u.current){u.current=!1;return}e?.type===`touchstart`&&(u.current=!0);let s=o?null:p.current,c=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0},l,h,g;if(a||e===void 0||e.clientX===0&&e.clientY===0||!e.clientX&&!e.touches)l=Math.round(c.width/2),h=Math.round(c.height/2);else{let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-c.left),h=Math.round(n-c.top)}if(a)g=Math.sqrt((2*c.width**2+c.height**2)/3),g%2==0&&(g+=1);else{let e=Math.max(Math.abs((s?s.clientWidth:0)-l),l)*2+2,t=Math.max(Math.abs((s?s.clientHeight:0)-h),h)*2+2;g=Math.sqrt(e**2+t**2)}e?.touches?f.current===null&&(f.current=()=>{m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},d.start(80,()=>{f.current&&=(f.current(),null)})):m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},[n,m,d]),g=_.useCallback(()=>{h({},{pulsate:!0})},[h]),v=_.useCallback((e,t)=>{if(d.clear(),e?.type===`touchend`&&f.current){f.current(),f.current=null,d.start(0,()=>{v(e,t)});return}f.current=null,s(e=>e.length>0?e.slice(1):e),l.current=t},[d]);return _.useImperativeHandle(t,()=>({pulsate:g,start:h,stop:v}),[g,h,v]),(0,z.jsx)(Nm,{className:V(Om.root,r.root,i),ref:p,...a,children:(0,z.jsx)(qp,{component:null,exit:!0,children:o})})});function Im(e){return H(`MuiButtonBase`,e)}var Lm=U(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]),Rm=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,suppressFocusVisible:i,classes:a}=e,o=W({root:[`root`,t&&`disabled`,n&&!i&&`focusVisible`]},Im,a);return n&&!i&&r&&(o.root+=` ${r}`),o},zm=K(`button`,{name:`MuiButtonBase`,slot:`Root`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,boxSizing:`border-box`,WebkitTapHighlightColor:`transparent`,backgroundColor:`transparent`,outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:`pointer`,userSelect:`none`,verticalAlign:`middle`,MozAppearance:`none`,WebkitAppearance:`none`,textDecoration:`none`,color:`inherit`,"&::-moz-focus-inner":{borderStyle:`none`},[`&.${Lm.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),Bm=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiButtonBase`}),{action:r,centerRipple:i=!1,children:a,className:o,component:s=`button`,disabled:c=!1,disableRipple:l=!1,disableTouchRipple:u=!1,focusRipple:d=!1,focusVisibleClassName:f,focusableWhenDisabled:p,suppressFocusVisible:m=!1,internalNativeButton:h,LinkComponent:g=`a`,nativeButton:v,onBlur:y,onClick:b,onContextMenu:x,onDragLeave:S,onFocus:C,onFocusVisible:w,onKeyDown:T,onKeyUp:E,onMouseDown:D,onMouseLeave:O,onMouseUp:k,onTouchEnd:A,onTouchMove:j,onTouchStart:M,tabIndex:N=0,TouchRippleProps:ee,touchRippleRef:te,type:P,...F}=n,ne=!!(F.href||F.to),re=!!F.formAction,ie=s;ie===`button`&&ne&&(ie=g);let ae=typeof ie==`string`?ie===`button`:h??!1,I=v??ae,L=Tm(),oe=Cp(L.ref,te),[se,ce]=_.useState(!1);(c||m)&&se&&ce(!1);let le=xp(e=>{d&&!e.repeat&&se&&e.key===` `&&L.stop(e,()=>{L.start(e)})}),ue=xp(e=>{d&&e.key===` `&&se&&!e.defaultPrevented&&L.stop(e,()=>{L.pulsate(e)})}),{getButtonProps:de,rootRef:R}=Cm({nativeButton:I,nativeButtonProp:v,internalNativeButton:ae,allowInferredHostMismatch:ne||typeof ie==`string`,disabled:c,type:P,hasFormAction:re,tabIndex:N,onBeforeKeyDown:le,onBeforeKeyUp:ue}),{onClick:fe,onKeyDown:pe,onKeyUp:me,...he}=de({onClick:b,onKeyDown:T,onKeyUp:E});_.useImperativeHandle(r,()=>({focusVisible:()=>{ce(!0),R.current.focus()}}),[R]);let ge=L.shouldMount&&!l&&!c;_.useEffect(()=>{se&&d&&!l&&L.pulsate()},[l,d,se,L]);let _e=Vm(L,`start`,D,u),ve=Vm(L,`stop`,x,u),ye=Vm(L,`stop`,S,u),be=Vm(L,`stop`,k,u),xe=Vm(L,`stop`,e=>{se&&e.preventDefault(),O&&O(e)},u),Se=Vm(L,`start`,M,u),Ce=Vm(L,`stop`,A,u),we=Vm(L,`stop`,j,u),Te=Vm(L,`stop`,e=>{bm(e.target)||ce(!1),y&&y(e)},!1),Ee=xp(e=>{R.current||=e.currentTarget,!m&&bm(e.target)&&(ce(!0),w&&w(e)),C&&C(e)}),De={};ne&&(De.tabIndex=c?-1:N,c&&(De[`aria-disabled`]=c),De.type=P);let Oe=Cp(t,R),ke={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,suppressFocusVisible:m,tabIndex:N,focusVisible:se},Ae=Rm(ke);return(0,z.jsxs)(zm,{as:ie,className:V(Ae.root,o),ownerState:ke,onBlur:Te,onClick:fe,onContextMenu:ve,onFocus:Ee,onKeyDown:pe,onKeyUp:me,onMouseDown:_e,onMouseLeave:xe,onMouseUp:be,onDragLeave:ye,onTouchEnd:Ce,onTouchMove:we,onTouchStart:Se,ref:Oe,...ne?De:he,...F,children:[a,ge?(0,z.jsx)(Fm,{ref:oe,center:i,...ee}):null]})});function Vm(e,t,n,r=!1){return xp(i=>(n&&n(i),r||e[t](i),!0))}function Hm(e){return typeof e.main==`string`}function Um(e,t=[]){if(!Hm(e))return!1;for(let n of t)if(!e.hasOwnProperty(n)||typeof e[n]!=`string`)return!1;return!0}function Wm(e=[]){return([,t])=>t&&Um(t,e)}function Gm(e){return H(`MuiAlert`,e)}var Km=U(`MuiAlert`,[`root`,`action`,`icon`,`message`,`filled`,`colorSuccess`,`colorInfo`,`colorWarning`,`colorError`,`outlined`,`standard`]);function qm(e){return H(`MuiCircularProgress`,e)}U(`MuiCircularProgress`,[`root`,`determinate`,`indeterminate`,`colorPrimary`,`colorSecondary`,`svg`,`track`,`circle`,`circleDisableShrink`]);var Jm=44,Ym=hs` + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +`,Xm=hs` + 0% { + stroke-dasharray: 1px, 200px; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 100px, 200px; + stroke-dashoffset: -15px; + } + + 100% { + stroke-dasharray: 1px, 200px; + stroke-dashoffset: -126px; + } +`,Zm=typeof Ym==`string`?null:ms` + animation: ${Ym} 1.4s linear infinite; + `,Qm=typeof Xm==`string`?null:ms` + animation: ${Xm} 1.4s ease-in-out infinite; + `,$m=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return W({root:[`root`,n,`color${J(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,i&&`circleDisableShrink`]},qm,t)},eh=K(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${J(n.color)}`]]}})(Y(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:Zm||{animation:`${Ym} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),th=K(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),nh=K(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,n.disableShrink&&t.circleDisableShrink]}})(Y(({theme:e})=>({stroke:`currentColor`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`stroke-dashoffset`)}},{props:{variant:`indeterminate`},style:{strokeDasharray:`80px, 200px`,strokeDashoffset:0}},{props:({ownerState:e})=>e.variant===`indeterminate`&&!e.disableShrink,style:Qm||{animation:`${Xm} 1.4s ease-in-out infinite`}}]}))),rh=K(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(Y(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),ih=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiCircularProgress`}),{className:r,color:i=`primary`,disableShrink:a=!1,enableTrackSlot:o=!1,min:s,max:c,size:l=40,style:u,thickness:d=3.6,value:f=n.min??0,variant:p=`indeterminate`,...m}=n,h=s??0,g=c??100,_={...n,color:i,disableShrink:a,size:l,thickness:d,value:f,variant:p,enableTrackSlot:o},v=$m(_),y={},b={},x={};if(p===`determinate`){let e=2*Math.PI*((Jm-d)/2),t=g-h;y.strokeDasharray=e.toFixed(3),y.strokeDashoffset=t>0?`${((g-f)/t*e).toFixed(3)}px`:`${e.toFixed(3)}px`,b.transform=`rotate(-90deg)`,x[`aria-valuenow`]=f,x[`aria-valuemin`]=h,x[`aria-valuemax`]=g}return(0,z.jsx)(eh,{className:V(v.root,r),style:{width:l,height:l,...b,...u},ownerState:_,ref:t,role:`progressbar`,...x,...m,children:(0,z.jsxs)(th,{className:v.svg,ownerState:_,viewBox:`${Jm/2} ${Jm/2} ${Jm} ${Jm}`,children:[o?(0,z.jsx)(rh,{className:v.track,ownerState:_,cx:Jm,cy:Jm,r:(Jm-d)/2,fill:`none`,strokeWidth:d,"aria-hidden":`true`}):null,(0,z.jsx)(nh,{className:v.circle,style:y,ownerState:_,cx:Jm,cy:Jm,r:(Jm-d)/2,fill:`none`,strokeWidth:d})]})})});function ah(e){return H(`MuiIconButton`,e)}var oh=U(`MuiIconButton`,[`root`,`disabled`,`colorInherit`,`colorPrimary`,`colorSecondary`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`,`edgeStart`,`edgeEnd`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`loading`,`loadingIndicator`,`loadingWrapper`]),sh=e=>{let{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e;return W({root:[`root`,o&&`loading`,n&&`disabled`,r!==`default`&&`color${J(r)}`,i&&`edge${J(i)}`,`size${J(a)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},ah,t)},ch=K(Bm,{name:`MuiIconButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!==`default`&&t[`color${J(n.color)}`],n.edge&&t[`edge${J(n.edge)}`],t[`size${J(n.size)}`]]}})(Y(({theme:e})=>({textAlign:`center`,flex:`0 0 auto`,fontSize:e.typography.pxToRem(24),padding:8,borderRadius:`50%`,color:(e.vars||e).palette.action.active,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:`var(--IconButton-hoverBg)`,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:{edge:`start`},style:{marginLeft:-12}},{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:{edge:`end`},style:{marginRight:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}}]})),Y(({theme:e})=>({variants:[{props:{color:`inherit`},style:{color:`inherit`}},...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main,"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:`small`},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:`large`},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${oh.disabled}`]:{backgroundColor:`transparent`,color:(e.vars||e).palette.action.disabled},[`&.${oh.loading}`]:{color:`transparent`}}))),lh=K(`span`,{name:`MuiIconButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:`flex`}}]})),uh=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiIconButton`}),{edge:r=!1,children:i,className:a,color:o=`default`,disabled:s=!1,disableFocusRipple:c=!1,size:l=`medium`,id:u,loading:d=null,loadingIndicator:f,...p}=n,m=_p(u),h=f??(0,z.jsx)(ih,{"aria-labelledby":m,color:`inherit`,size:16}),g={...n,edge:r,color:o,disabled:s,disableFocusRipple:c,loading:d,loadingIndicator:h,size:l},_=sh(g);return(0,z.jsxs)(ch,{id:d?m:u,className:V(_.root,a),centerRipple:!0,internalNativeButton:!0,focusRipple:!c,disabled:s||d,ref:t,...p,ownerState:g,children:[typeof d==`boolean`&&(0,z.jsx)(`span`,{className:_.loadingWrapper,style:{display:`contents`},children:(0,z.jsx)(lh,{className:_.loadingIndicator,ownerState:g,children:d&&h})}),i]})}),dh=ap((0,z.jsx)(`path`,{d:`M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z`}),`SuccessOutlined`),fh=ap((0,z.jsx)(`path`,{d:`M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z`}),`ReportProblemOutlined`),ph=ap((0,z.jsx)(`path`,{d:`M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z`}),`ErrorOutline`),mh=ap((0,z.jsx)(`path`,{d:`M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z`}),`InfoOutlined`),hh=ap((0,z.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`),gh=e=>{let{variant:t,color:n,severity:r,classes:i}=e;return W({root:[`root`,`color${J(n||r)}`,`${t}`],icon:[`icon`],message:[`message`],action:[`action`]},Gm,i)},_h=K(ym,{name:`MuiAlert`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant]]}})(Y(({theme:e})=>{let t=e.palette.mode===`light`?e.darken:e.lighten,n=e.palette.mode===`light`?e.lighten:e.darken;return{...e.typography.body2,backgroundColor:`transparent`,display:`flex`,padding:`6px 16px`,variants:[...Object.entries(e.palette).filter(Wm([`light`])).map(([r])=>({props:{colorSeverity:r,variant:`standard`},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${Km.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Wm([`light`])).map(([n])=>({props:{colorSeverity:n,variant:`outlined`},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${Km.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}})),...Object.entries(e.palette).filter(Wm([`dark`])).map(([t])=>({props:{colorSeverity:t,variant:`filled`},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${t}FilledColor`],backgroundColor:e.vars.palette.Alert[`${t}FilledBg`]}:{backgroundColor:e.palette.mode===`dark`?e.palette[t].dark:e.palette[t].main,color:e.palette.getContrastText(e.palette[t].main)}}}))]}})),vh=K(`div`,{name:`MuiAlert`,slot:`Icon`})({marginRight:12,padding:`7px 0`,display:`flex`,fontSize:22,opacity:.9}),yh=K(`div`,{name:`MuiAlert`,slot:`Message`})({padding:`8px 0`,minWidth:0,overflow:`auto`}),bh=K(`div`,{name:`MuiAlert`,slot:`Action`})({display:`flex`,alignItems:`flex-start`,padding:`4px 0 0 16px`,marginLeft:`auto`,marginRight:-8}),xh={success:(0,z.jsx)(dh,{fontSize:`inherit`}),warning:(0,z.jsx)(fh,{fontSize:`inherit`}),error:(0,z.jsx)(ph,{fontSize:`inherit`}),info:(0,z.jsx)(mh,{fontSize:`inherit`})},Sh=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiAlert`}),{action:r,children:i,className:a,closeText:o=`Close`,color:s,icon:c,iconMapping:l=xh,onClose:u,role:d=`alert`,severity:f=`success`,slotProps:p={},slots:m={},variant:h=`standard`,...g}=n,_={...n,color:s,severity:f,variant:h,colorSeverity:s||f},v=gh(_),y={slots:m,slotProps:p},[b,x]=X(`root`,{ref:t,shouldForwardComponentProp:!0,className:V(v.root,a),elementType:_h,externalForwardedProps:{...y,...g},ownerState:_,additionalProps:{role:d,elevation:0}}),[S,C]=X(`icon`,{className:v.icon,elementType:vh,externalForwardedProps:y,ownerState:_}),[w,T]=X(`message`,{className:v.message,elementType:yh,externalForwardedProps:y,ownerState:_}),[E,D]=X(`action`,{className:v.action,elementType:bh,externalForwardedProps:y,ownerState:_}),[O,k]=X(`closeButton`,{elementType:uh,externalForwardedProps:y,ownerState:_}),[A,j]=X(`closeIcon`,{elementType:hh,externalForwardedProps:y,ownerState:_});return(0,z.jsxs)(b,{...x,children:[c===!1?null:(0,z.jsx)(S,{...C,children:c||l[f]||xh[f]}),(0,z.jsx)(w,{...T,children:i}),r==null?null:(0,z.jsx)(E,{...D,children:r}),r==null&&u?(0,z.jsx)(E,{...D,children:(0,z.jsx)(O,{size:`small`,"aria-label":o,title:o,color:`inherit`,onClick:u,...k,children:(0,z.jsx)(A,{fontSize:`small`,...j})})}):null]})});function Ch(e){return H(`MuiTypography`,e)}var wh=U(`MuiTypography`,[`root`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`subtitle1`,`subtitle2`,`body1`,`body2`,`inherit`,`button`,`caption`,`overline`,`alignLeft`,`alignRight`,`alignCenter`,`alignJustify`,`noWrap`,`gutterBottom`]),Th=e=>{let{align:t,gutterBottom:n,noWrap:r,variant:i,classes:a}=e;return W({root:[`root`,i,e.align!==`inherit`&&`align${J(t)}`,n&&`gutterBottom`,r&&`noWrap`]},Ch,a)},Eh=K(`span`,{name:`MuiTypography`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!==`inherit`&&t[`align${J(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom]}})(Y(({theme:e})=>({margin:0,variants:[{props:{variant:`inherit`},style:{font:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},...Object.entries(e.typography).filter(([e,t])=>e!==`inherit`&&t&&typeof t==`object`).map(([e,t])=>({props:{variant:e},style:t})),...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,e])=>typeof e==`string`).map(([t])=>({props:{color:`text${J(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:e})=>e.align!==`inherit`,style:{textAlign:`var(--Typography-textAlign)`}},{props:({ownerState:e})=>e.noWrap,style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:`0.35em`}}]}))),Dh={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,h5:`h5`,h6:`h6`,subtitle1:`h6`,subtitle2:`h6`,body1:`p`,body2:`p`,inherit:`p`},Oh=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiTypography`}),{color:r,align:i=`inherit`,className:a,component:o,gutterBottom:s=!1,noWrap:c=!1,variant:l=`body1`,variantMapping:u=Dh,...d}=n,f={...n,align:i,color:r,className:a,component:o,gutterBottom:s,noWrap:c,variant:l,variantMapping:u};return(0,z.jsx)(Eh,{as:o||u[l]||Dh[l]||`span`,ref:t,className:V(Th(f).root,a),...d,ownerState:f,style:{...i!==`inherit`&&{"--Typography-textAlign":i},...d.style}})});function kh(e){return H(`MuiAppBar`,e)}U(`MuiAppBar`,[`root`,`positionFixed`,`positionAbsolute`,`positionSticky`,`positionStatic`,`positionRelative`,`colorDefault`,`colorPrimary`,`colorSecondary`,`colorInherit`,`colorTransparent`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`]);var Ah=e=>{let{color:t,position:n,classes:r}=e;return W({root:[`root`,`color${J(t)}`,`position${J(n)}`]},kh,r)},jh=(e,t)=>e?`${e.replace(`)`,``)}, ${t})`:t,Mh=K(ym,{name:`MuiAppBar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`position${J(n.position)}`],t[`color${J(n.color)}`]]}})(Y(({theme:e})=>({display:`flex`,flexDirection:`column`,width:`100%`,boxSizing:`border-box`,flexShrink:0,variants:[{props:{position:`fixed`},style:{position:`fixed`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0,"@media print":{position:`absolute`}}},{props:{position:`absolute`},style:{position:`absolute`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0}},{props:{position:`sticky`},style:{position:`sticky`,zIndex:(e.vars||e).zIndex.appBar,top:0,left:`auto`,right:0}},{props:{position:`static`},style:{position:`static`}},{props:{position:`relative`},style:{position:`relative`}},{props:{color:`inherit`},style:{"--AppBar-color":`inherit`,color:`var(--AppBar-color)`}},{props:{color:`default`},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles(`dark`,{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(Wm([`contrastText`])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:e=>e.enableColorOnDark===!0&&![`inherit`,`transparent`].includes(e.color),style:{backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`}},{props:e=>e.enableColorOnDark===!1&&![`inherit`,`transparent`].includes(e.color),style:{backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`,...e.applyStyles(`dark`,{backgroundColor:e.vars?jh(e.vars.palette.AppBar.darkBg,`var(--AppBar-background)`):null,color:e.vars?jh(e.vars.palette.AppBar.darkColor,`var(--AppBar-color)`):null})}},{props:{color:`transparent`},style:{"--AppBar-background":`transparent`,"--AppBar-color":`inherit`,backgroundColor:`var(--AppBar-background)`,color:`var(--AppBar-color)`,...e.applyStyles(`dark`,{backgroundImage:`none`})}}]}))),Nh=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiAppBar`}),{className:r,color:i=`primary`,enableColorOnDark:a=!1,position:o=`fixed`,...s}=n,c={...n,color:i,position:o,enableColorOnDark:a};return(0,z.jsx)(Mh,{square:!0,component:`header`,ownerState:c,elevation:4,className:V(Ah(c).root,r,o===`fixed`&&`mui-fixed`),ref:t,...s})});function Ph(e,t){if(!e||!t)return!1;if(e.contains(t))return!0;let n=t.getRootNode?.();if(n&&n instanceof ShadowRoot){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode??n.host??null}}return!1}function Fh(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:fm(n,r),{props:s,internalRef:c}=hm({...a,externalSlotProps:o}),l=Sp(c,o?.ref,e.additionalProps?.ref);return dm(t,{...s,ref:l},r)}function Ih(e){return e?.props?.ref||null}function Lh(e){return typeof e==`function`?e():e}var Rh=_.forwardRef(function(e,t){let{children:n,container:r,disablePortal:i=!1}=e,[a,o]=_.useState(null),s=Sp(_.isValidElement(n)?Ih(n):null,t);if(Hl(()=>{i||o(Lh(r)||document.body)},[r,i]),Hl(()=>{if(a&&!i)return hp(t,a),()=>{hp(t,null)}},[t,a,i]),i){if(_.isValidElement(n)){let e={ref:s};return _.cloneElement(n,e)}return n}return a&&ar.createPortal(n,a)}),zh=ap((0,z.jsx)(`path`,{d:`M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z`}),`Cancel`);function Bh(e){return H(`MuiChip`,e)}var Vh=U(`MuiChip`,[`root`,`sizeSmall`,`sizeMedium`,`colorDefault`,`colorError`,`colorInfo`,`colorPrimary`,`colorSecondary`,`colorSuccess`,`colorWarning`,`disabled`,`clickable`,`deletable`,`outlined`,`filled`,`avatar`,`icon`,`label`,`deleteIcon`,`focusVisible`]),Hh=e=>{let{classes:t,disabled:n,size:r,color:i,onDelete:a,clickable:o,variant:s}=e;return W({root:[`root`,s,n&&`disabled`,`size${J(r)}`,`color${J(i)}`,o&&`clickable`,a&&`deletable`],label:[`label`],avatar:[`avatar`],icon:[`icon`],deleteIcon:[`deleteIcon`]},Bh,t)},Uh=K(`div`,{name:`MuiChip`,slot:`Root`,shouldForwardProp:e=>kf(e)&&e!==`focusableWhenDisabled`&&e!==`skipFocusWhenDisabled`,overridesResolver:(e,t)=>{let{ownerState:n}=e,{color:r,clickable:i,onDelete:a,size:o,variant:s}=n;return[{[`& .${Vh.avatar}`]:t.avatar},{[`& .${Vh.icon}`]:t.icon},{[`& .${Vh.deleteIcon}`]:t.deleteIcon},t.root,t[`size${J(o)}`],t[`color${J(r)}`],i&&t.clickable,a&&t.deletable,t[s]]}})(Y(({theme:e})=>{let t=e.palette.mode===`light`?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:`100%`,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:`inline-flex`,alignItems:`center`,justifyContent:`center`,height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:`nowrap`,transition:e.transitions.create([`background-color`,`box-shadow`]),cursor:`unset`,outline:0,textDecoration:`none`,border:0,padding:0,verticalAlign:`middle`,boxSizing:`border-box`,[`&.${Vh.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:`none`},[`& .${Vh.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Vh.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Vh.deleteIcon}`]:{WebkitTapHighlightColor:`transparent`,color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:`pointer`,margin:`0 5px 0 -6px`,"&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{color:`primary`},style:{[`& .${Vh.avatar}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark}}},{props:{color:`secondary`},style:{[`& .${Vh.avatar}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark}}},{props:{size:`small`},style:{height:24,[`& .${Vh.avatar}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Vh.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Vh.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Wm([`contrastText`])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText,[`& .${Vh.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[t].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].contrastText}}}})),{props:e=>e.iconColor===e.color,style:{[`& .${Vh.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:e=>e.iconColor===e.color&&e.color!==`default`,style:{[`& .${Vh.icon}`]:{color:`inherit`}}},{props:{onDelete:!0},style:{[`&.${Vh.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Wm([`dark`])).map(([t])=>({props:{color:t,onDelete:!0},style:{[`&.${Vh.focusVisible}`]:{background:(e.vars||e).palette[t].dark}}})),{props:{clickable:!0},style:{userSelect:`none`,WebkitTapHighlightColor:`transparent`,cursor:`pointer`,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Vh.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Wm([`dark`])).map(([t])=>({props:{color:t,clickable:!0},style:{[`&:hover, &.${Vh.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t].dark}}})),{props:{variant:`outlined`},style:{backgroundColor:`transparent`,border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode===`light`?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Vh.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Vh.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Vh.avatar}`]:{marginLeft:4},[`& .${Vh.icon}`]:{marginLeft:4},[`& .${Vh.deleteIcon}`]:{marginRight:5}}},{props:{size:`small`,variant:`outlined`},style:{[`& .${Vh.avatar}`]:{marginLeft:2},[`& .${Vh.icon}`]:{marginLeft:2},[`& .${Vh.deleteIcon}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{variant:`outlined`,color:t},style:{color:(e.vars||e).palette[t].main,border:`1px solid ${e.alpha((e.vars||e).palette[t].main,.7)}`,[`&.${Vh.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Vh.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Vh.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[t].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t].main}}}}))]}})),Wh=K(`span`,{name:`MuiChip`,slot:`Label`})({overflow:`hidden`,textOverflow:`ellipsis`,paddingLeft:12,paddingRight:12,whiteSpace:`nowrap`,variants:[{props:{variant:`outlined`},style:{paddingLeft:11,paddingRight:11}},{props:{size:`small`},style:{paddingLeft:8,paddingRight:8}},{props:{size:`small`,variant:`outlined`},style:{paddingLeft:7,paddingRight:7}}]});function Gh(e){return e.key===`Backspace`||e.key===`Delete`}var Kh=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiChip`}),{avatar:r,className:i,clickable:a,color:o=`default`,component:s,deleteIcon:c,disabled:l=!1,icon:u,label:d,onClick:f,onDelete:p,onKeyDown:m,onKeyUp:h,size:g=`medium`,variant:v=`filled`,tabIndex:y,skipFocusWhenDisabled:b=!1,slots:x={},slotProps:S={},...C}=n,{nativeButton:w,...T}=C,E=Cp(_.useRef(null),t),D=e=>{e.stopPropagation(),p(e)},O=e=>{e.currentTarget===e.target&&Gh(e)&&e.preventDefault(),m&&m(e)},k=e=>{e.currentTarget===e.target&&p&&Gh(e)&&p(e),h&&h(e)},A=a!==!1&&f?!0:a,j=A||p?Bm:s||`div`,M={...n,component:j,disabled:l,size:g,color:o,iconColor:_.isValidElement(u)&&u.props.color||o,onDelete:!!p,clickable:A,variant:v},N=Hh(M),ee=j===Bm?{component:s||`div`,internalNativeButton:!1,focusVisibleClassName:N.focusVisible,...p&&{disableRipple:!0},...w!==void 0&&{nativeButton:w}}:{},te=null;p&&(te=c&&_.isValidElement(c)?_.cloneElement(c,{className:V(c.props.className,N.deleteIcon),onClick:D}):(0,z.jsx)(zh,{className:N.deleteIcon,onClick:D}));let P=null;r&&_.isValidElement(r)&&(P=_.cloneElement(r,{className:V(N.avatar,r.props.className)}));let F=null;u&&_.isValidElement(u)&&(F=_.cloneElement(u,{className:V(N.icon,u.props.className)}));let ne={slots:x,slotProps:S},[re,ie]=X(`root`,{elementType:Uh,externalForwardedProps:{...ne,...T},ownerState:M,shouldForwardComponentProp:!0,ref:E,className:V(N.root,i),additionalProps:{disabled:A&&l?!0:void 0,tabIndex:b&&l?-1:y,...ee},getSlotProps:e=>({...e,onClick:t=>{e.onClick?.(t),f?.(t)},onKeyDown:t=>{e.onKeyDown?.(t),O(t)},onKeyUp:t=>{e.onKeyUp?.(t),k(t)}})}),[ae,I]=X(`label`,{elementType:Wh,externalForwardedProps:ne,ownerState:M,className:N.label});return(0,z.jsxs)(re,{as:j,...ie,children:[P||F,(0,z.jsx)(ae,{...I,children:d}),te]})});function qh(e){return parseInt(e,10)||0}var Jh={shadow:{visibility:`hidden`,position:`absolute`,overflow:`hidden`,height:0,top:0,left:0,transform:`translateZ(0)`}};function Yh(e){for(let t in e)return!1;return!0}function Xh(e){return Yh(e)||e.outerHeightStyle===0&&!e.overflowing}var Zh=_.forwardRef(function(e,t){let{onChange:n,maxRows:r,minRows:i=1,style:a,value:o,...s}=e,{current:c}=_.useRef(o!=null),l=_.useRef(null),u=Sp(t,l),d=_.useRef(null),f=_.useRef(null),p=_.useCallback(()=>{let t=l.current,n=f.current;if(!t||!n)return;let a=pp(t).getComputedStyle(t);if(a.width===`0px`)return{outerHeightStyle:0,overflowing:!1};n.style.width=a.width,n.value=t.value||e.placeholder||`x`,n.value.slice(-1)===` +`&&(n.value+=` `);let o=a.boxSizing,s=qh(a.paddingBottom)+qh(a.paddingTop),c=qh(a.borderBottomWidth)+qh(a.borderTopWidth),u=n.scrollHeight;n.value=`x`;let d=n.scrollHeight,p=u;return i&&(p=Math.max(Number(i)*d,p)),r&&(p=Math.min(Number(r)*d,p)),p=Math.max(p,d),{outerHeightStyle:p+(o===`border-box`?s+c:0),overflowing:Math.abs(p-u)<=1}},[r,i,e.placeholder]),m=bp(()=>{let e=l.current,t=p();if(!e||!t||Xh(t))return!1;let n=t.outerHeightStyle;return d.current!=null&&d.current!==n}),h=_.useCallback(()=>{let e=l.current,t=p();if(!e||!t||Xh(t))return;let n=t.outerHeightStyle;d.current!==n&&(d.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?`hidden`:``},[p]),g=_.useRef(-1);return Hl(()=>{let e=op(h),t=l?.current;if(!t)return;let n=pp(t);n.addEventListener(`resize`,e);let r;return typeof ResizeObserver<`u`&&(r=new ResizeObserver(()=>{m()&&(r.unobserve(t),cancelAnimationFrame(g.current),h(),g.current=requestAnimationFrame(()=>{r.observe(t)}))}),r.observe(t)),()=>{e.clear(),cancelAnimationFrame(g.current),n.removeEventListener(`resize`,e),r&&r.disconnect()}},[p,h,m]),Hl(()=>{h()}),(0,z.jsxs)(_.Fragment,{children:[(0,z.jsx)(`textarea`,{value:o,onChange:e=>{c||h();let t=e.target,r=t.value.length,i=t.value.endsWith(` +`),a=t.selectionStart===r;i&&a&&t.setSelectionRange(r,r),n&&n(e)},ref:u,rows:i,style:a,...s}),(0,z.jsx)(`textarea`,{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:{...Jh.shadow,...a,paddingTop:0,paddingBottom:0}})]})}),Qh=_.createContext(void 0);function $h(){return _.useContext(Qh)}function eg({props:e,states:t}){let n=_.useContext(Qh),r={};return t.forEach(t=>{let i=e[t];r[t]=i===void 0&&n?n[t]:i}),[r,n]}function tg(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function ng(e,t=!1){return e&&(tg(e.value)&&e.value!==``||t&&tg(e.defaultValue)&&e.defaultValue!==``)}function rg(e){return e.startAdornment}function ig(e){return H(`MuiInputBase`,e)}var ag=U(`MuiInputBase`,[`root`,`formControl`,`focused`,`disabled`,`adornedStart`,`adornedEnd`,`error`,`sizeSmall`,`multiline`,`colorSecondary`,`fullWidth`,`hiddenLabel`,`readOnly`,`input`,`inputTypeSearch`]),og,sg=`mui-auto-fill`,cg=`mui-auto-fill-cancel`,lg=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size===`small`&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${J(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},ug=(e,t)=>{let{ownerState:n}=e;return[t.input,n.type===`search`&&t.inputTypeSearch]},dg=e=>{let{classes:t,color:n,disabled:r,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:c,hiddenLabel:l,multiline:u,readOnly:d,size:f,startAdornment:p,type:m}=e;return W({root:[`root`,`color${J(n)}`,r&&`disabled`,i&&`error`,c&&`fullWidth`,o&&`focused`,s&&`formControl`,f&&f!==`medium`&&`size${J(f)}`,u&&`multiline`,p&&`adornedStart`,a&&`adornedEnd`,l&&`hiddenLabel`,d&&`readOnly`],input:[`input`,r&&`disabled`,m===`search`&&`inputTypeSearch`,d&&`readOnly`]},ig,t)},fg=K(`div`,{name:`MuiInputBase`,slot:`Root`,overridesResolver:lg})(Y(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:`1.4375em`,boxSizing:`border-box`,position:`relative`,cursor:`text`,display:`inline-flex`,alignItems:`center`,[`&.${ag.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:`default`},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:`4px 0 5px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:`100%`}}]}))),pg=K(`input`,{name:`MuiInputBase`,slot:`Input`,overridesResolver:ug})(Y(({theme:e})=>{let t=e.palette.mode===`light`,n={color:`currentColor`,...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create(`opacity`,{duration:e.transitions.duration.shorter})},r={opacity:`0 !important`},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:`inherit`,letterSpacing:`inherit`,color:`currentColor`,padding:`4px 0 5px`,border:0,boxSizing:`content-box`,background:`none`,height:`1.4375em`,margin:0,WebkitTapHighlightColor:`transparent`,display:`block`,minWidth:0,width:`100%`,"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:`none`},"&::-webkit-search-decoration":{WebkitAppearance:`none`},[`label[data-shrink=false] + .${ag.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${ag.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:cg,animationDuration:`10ms`,"&:-webkit-autofill":{animationDuration:`5000s`,animationName:sg}}},{props:{size:`small`},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:`auto`,resize:`none`,padding:0,paddingTop:0}},{props:{type:`search`},style:{MozAppearance:`textfield`}}]}})),mg=Rf({[`@keyframes ${sg}`]:{from:{animationName:sg}},[`@keyframes ${cg}`]:{from:{animationName:cg}}}),hg=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiInputBase`}),{"aria-describedby":r,"aria-label":i,autoComplete:a,autoFocus:o,className:s,color:c,defaultValue:l,disabled:u,disableInjectingGlobalStyles:d,endAdornment:f,error:p,fullWidth:m=!1,id:h,inputComponent:g=`input`,inputProps:v={},inputRef:y,margin:b,maxRows:x,minRows:S,multiline:C=!1,name:w,onBlur:T,onChange:E,onClick:D,onFocus:O,onKeyDown:k,onKeyUp:A,placeholder:j,readOnly:M,renderSuffix:N,rows:ee,size:te,slotProps:P={},slots:F={},startAdornment:ne,type:re=`text`,value:ie,...ae}=n,I=v.value==null?ie:v.value,{current:L}=_.useRef(I!=null),oe=_.useRef(),se=_.useCallback(e=>{},[]),ce=Cp(oe,y,v.ref,se),[le,ue]=_.useState(!1),[de,R]=eg({props:n,states:[`color`,`disabled`,`error`,`hiddenLabel`,`size`,`required`,`filled`]});de.focused=R?R.focused:le,_.useEffect(()=>{!R&&u&&le&&(ue(!1),T&&T())},[R,u,le,T]);let fe=R&&R.onFilled,pe=R&&R.onEmpty,me=_.useCallback(e=>{ng(e)?fe&&fe():pe&&pe()},[fe,pe]);gp(()=>{L&&me({value:I})},[I,me,L]),gp(()=>{if(!o)return;let e=oe.current;if(!e)return;let t=fp(e),n=up(t),r=n==null||n===t.body||n===t.documentElement;e===n?R&&R.onFocus?R.onFocus():ue(!0):r&&e.focus()},[o]);let he=e=>{O&&O(e),v.onFocus&&v.onFocus(e),R&&R.onFocus?R.onFocus(e):ue(!0)},ge=e=>{T&&T(e),v.onBlur&&v.onBlur(e),R&&R.onBlur?R.onBlur(e):ue(!1)},_e=(e,...t)=>{if(!L){let t=e.target||oe.current;if(t==null)throw Error(ma(1));me({value:t.value})}v.onChange&&v.onChange(e,...t),E&&E(e,...t)};_.useEffect(()=>{me(oe.current)},[]);let ve=e=>{oe.current&&e.currentTarget===e.target&&oe.current.focus(),D&&D(e)},ye=g,be=v;C&&ye===`input`&&(be=ee?{type:void 0,minRows:ee,maxRows:ee,...be}:{type:void 0,maxRows:x,minRows:S,...be},ye=Zh);let xe=e=>{me(e.animationName===cg?oe.current:{value:`x`})};_.useEffect(()=>{R&&R.setAdornedStart(!!ne)},[R,ne]);let Se={...n,color:de.color||`primary`,disabled:de.disabled,endAdornment:f,error:de.error,focused:de.focused,formControl:R,fullWidth:m,hiddenLabel:de.hiddenLabel,multiline:C,size:de.size,startAdornment:ne,type:re},Ce=dg(Se),we=F.root||fg,Te=P.root||{},Ee=F.input||pg;return be={...be,...P.input},(0,z.jsxs)(_.Fragment,{children:[!d&&typeof mg==`function`&&(og||=(0,z.jsx)(mg,{})),(0,z.jsxs)(we,{...Te,ref:t,onClick:ve,...ae,...!um(we)&&{ownerState:{...Se,...Te.ownerState}},className:V(Ce.root,Te.className,s,M&&`MuiInputBase-readOnly`),children:[ne,(0,z.jsx)(Qh.Provider,{value:null,children:(0,z.jsx)(Ee,{"aria-invalid":de.error,"aria-describedby":r,"aria-label":i,autoComplete:a,autoFocus:o,defaultValue:l,disabled:de.disabled,id:h,onAnimationStart:xe,name:w,placeholder:j,readOnly:M,required:de.required,rows:ee,value:I,onKeyDown:k,onKeyUp:A,type:re,...be,...!um(Ee)&&{as:ye,ownerState:{...Se,...be.ownerState}},ref:ce,className:V(Ce.input,be.className,M&&`MuiInputBase-readOnly`),onBlur:ge,onChange:_e,onFocus:he})}),f,N?N({...de,startAdornment:ne}):null]})]})});function gg(e){return H(`MuiInput`,e)}var _g={...ag,...U(`MuiInput`,[`root`,`underline`,`input`])};function vg(e){return H(`MuiOutlinedInput`,e)}var yg={...ag,...U(`MuiOutlinedInput`,[`root`,`notchedOutline`,`input`])};function bg(e){return H(`MuiFilledInput`,e)}var xg={...ag,...U(`MuiFilledInput`,[`root`,`underline`,`input`,`adornedStart`,`adornedEnd`,`sizeSmall`,`multiline`,`hiddenLabel`])},Sg=ap((0,z.jsx)(`path`,{d:`M7 10l5 5 5-5z`}),`ArrowDropDown`),Cg={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0}},wg={opacity:0,visibility:`hidden`},Tg=_.forwardRef(function(e,t){let n=Df(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:o,easing:s,in:c,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:p,onExiting:m,style:h,timeout:g=r,...v}=e,y=_.useRef(null),b=Cp(y,Ih(o),t),x=sm(y,d),S=sm(y,(e,t)=>{em(e);let r=lm({style:h,timeout:g,easing:s},{mode:`enter`});e.style.transition=n.transitions.create(`opacity`,r),l&&l(e,t)}),C=sm(y,u),w=sm(y,m),T=sm(y,e=>{let t=lm({style:h,timeout:g,easing:s},{mode:`exit`});e.style.transition=n.transitions.create(`opacity`,t),f&&f(e)}),E=sm(y,e=>{e.style.transition=``,p&&p(e)});return(0,z.jsx)(Lp,{appear:a,in:c,nodeRef:y,onEnter:S,onEntered:C,onEntering:x,onExit:T,onExited:E,onExiting:w,addEndListener:e=>{i&&i(y.current,e)},timeout:g,...v,children:(e,{ownerState:t,...n})=>{let r=cm(e,c,Cg,wg,h,o.props.style);return _.cloneElement(o,{style:r,ref:b,...n})}})});function Eg(e){return H(`MuiBackdrop`,e)}U(`MuiBackdrop`,[`root`,`invisible`]);var Dg=e=>{let{classes:t,invisible:n}=e;return W({root:[`root`,n&&`invisible`]},Eg,t)},Og=K(`div`,{name:`MuiBackdrop`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:`fixed`,display:`flex`,alignItems:`center`,justifyContent:`center`,right:0,bottom:0,top:0,left:0,backgroundColor:`rgba(0, 0, 0, 0.5)`,WebkitTapHighlightColor:`transparent`,variants:[{props:{invisible:!0},style:{backgroundColor:`transparent`}}]}),kg=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiBackdrop`}),{children:r,className:i,component:a=`div`,invisible:o=!1,open:s,slotProps:c={},slots:l={},transitionDuration:u,...d}=n,f={...n,component:a,invisible:o},p=Dg(f),m={component:a,slots:l,slotProps:c},[h,g]=X(`root`,{elementType:Og,externalForwardedProps:m,className:V(p.root,i),ownerState:f}),[_,v]=X(`transition`,{elementType:Tg,externalForwardedProps:m,ownerState:f});return(0,z.jsx)(_,{in:s,timeout:u,...d,...v,children:(0,z.jsx)(h,{...g,ref:t,children:r})})}),Ag=U(`MuiBox`,[`root`]),jg=Tl({themeId:ha,defaultTheme:Tf(),defaultClassName:Ag.root,generateClassName:Cl.generate});function Mg(e){return H(`MuiButton`,e)}var Ng=U(`MuiButton`,`root.text.outlined.contained.disableElevation.focusVisible.disabled.colorInherit.colorPrimary.colorSecondary.colorSuccess.colorError.colorInfo.colorWarning.sizeMedium.sizeSmall.sizeLarge.fullWidth.startIcon.endIcon.icon.loading.loadingWrapper.loadingIconPlaceholder.loadingIndicator.loadingPositionCenter.loadingPositionStart.loadingPositionEnd`.split(`.`)),Pg=_.createContext({}),Fg=_.createContext(void 0),Ig=e=>{let{color:t,disableElevation:n,fullWidth:r,size:i,variant:a,loading:o,loadingPosition:s,classes:c}=e,l=W({root:[`root`,o&&`loading`,a,`size${J(i)}`,`color${J(t)}`,n&&`disableElevation`,r&&`fullWidth`,o&&`loadingPosition${J(s)}`],startIcon:[`icon`,`startIcon`],endIcon:[`icon`,`endIcon`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},Mg,c);return{...c,...l}},Lg=[{props:{size:`small`},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:`medium`},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:`large`},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Rg=K(Bm,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`size${J(n.size)}`],n.color===`inherit`&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Y(({theme:e})=>{let t=e.palette.mode===`light`?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode===`light`?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:`6px 16px`,border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`,`color`],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:`none`},[`&.${Ng.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.startIcon||e.loading&&e.loadingPosition===`start`,style:{"&::before":{content:`"\\200b"`,width:0,overflow:`hidden`}}},{props:{variant:`contained`},style:{color:`var(--variant-containedColor)`,backgroundColor:`var(--variant-containedBg)`,boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Ng.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Ng.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:`outlined`},style:{padding:`5px 15px`,border:`1px solid currentColor`,borderColor:`var(--variant-outlinedBorder, currentColor)`,backgroundColor:`var(--variant-outlinedBg)`,color:`var(--variant-outlinedColor)`,[`&.${Ng.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:`text`},style:{padding:`6px 8px`,color:`var(--variant-textColor)`,backgroundColor:`var(--variant-textBg)`}},...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t},style:{"--variant-textColor":(e.vars||e).palette[t].main,"--variant-outlinedColor":(e.vars||e).palette[t].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[t].main,.5),"--variant-containedColor":(e.vars||e).palette[t].contrastText,"--variant-containedBg":(e.vars||e).palette[t].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[t].dark,"--variant-textBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[t].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:`inherit`},style:{color:`inherit`,borderColor:`currentColor`,"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:`small`,variant:`text`},style:{padding:`4px 5px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`text`},style:{padding:`8px 11px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`outlined`},style:{padding:`3px 9px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`outlined`},style:{padding:`7px 21px`,fontSize:e.typography.pxToRem(15)}},{props:{size:`small`,variant:`contained`},style:{padding:`4px 10px`,fontSize:e.typography.pxToRem(13)}},{props:{size:`large`,variant:`contained`},style:{padding:`8px 22px`,fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:`none`,"&:hover":{boxShadow:`none`},[`&.${Ng.focusVisible}`]:{boxShadow:`none`},"&:active":{boxShadow:`none`},[`&.${Ng.disabled}`]:{boxShadow:`none`}}},{props:{fullWidth:!0},style:{width:`100%`}},{props:{loadingPosition:`center`},style:{transition:e.transitions.create([`background-color`,`box-shadow`,`border-color`],{duration:e.transitions.duration.short}),[`&.${Ng.loading}`]:{color:`transparent`}}}]}})),zg=K(`span`,{name:`MuiButton`,slot:`StartIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart]}})(({theme:e})=>({display:`inherit`,marginRight:8,marginLeft:-4,variants:[{props:{size:`small`},style:{marginLeft:-2}},{props:{loadingPosition:`start`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`start`,loading:!0,fullWidth:!0},style:{marginRight:-8}},...Lg]})),Bg=K(`span`,{name:`MuiButton`,slot:`EndIcon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd]}})(({theme:e})=>({display:`inherit`,marginRight:-4,marginLeft:8,variants:[{props:{size:`small`},style:{marginRight:-2}},{props:{loadingPosition:`end`,loading:!0},style:{transition:e.transitions.create([`opacity`],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:`end`,loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Lg]})),Vg=K(`span`,{name:`MuiButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,variants:[{props:{loading:!0},style:{display:`flex`}},{props:{loadingPosition:`start`},style:{left:14}},{props:{loadingPosition:`start`,size:`small`},style:{left:10}},{props:{variant:`text`,loadingPosition:`start`},style:{left:6}},{props:{loadingPosition:`center`},style:{left:`50%`,transform:`translate(-50%)`,color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:`end`},style:{right:14}},{props:{loadingPosition:`end`,size:`small`},style:{right:10}},{props:{variant:`text`,loadingPosition:`end`},style:{right:6}},{props:{loadingPosition:`start`,fullWidth:!0},style:{position:`relative`,left:-10}},{props:{loadingPosition:`end`,fullWidth:!0},style:{position:`relative`,right:-10}}]})),Hg=K(`span`,{name:`MuiButton`,slot:`LoadingIconPlaceholder`})({display:`inline-block`,width:`1em`,height:`1em`}),Ug=_.forwardRef(function(e,t){let n=_.useContext(Pg),r=_.useContext(Fg),i=q({props:zl(n,e),name:`MuiButton`}),{children:a,color:o=`primary`,component:s=`button`,className:c,disabled:l=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:p,fullWidth:m=!1,id:h,loading:g=null,loadingIndicator:v,loadingPosition:y=`center`,size:b=`medium`,startIcon:x,type:S,variant:C=`text`,...w}=i,T=_p(h),E=v??(0,z.jsx)(ih,{"aria-labelledby":T,color:`inherit`,size:16}),D={...i,color:o,component:s,disabled:l,disableElevation:u,disableFocusRipple:d,fullWidth:m,loading:g,loadingIndicator:E,loadingPosition:y,size:b,type:S,variant:C},O=Ig(D),k=(x||g&&y===`start`)&&(0,z.jsx)(zg,{className:O.startIcon,ownerState:D,children:x||(0,z.jsx)(Hg,{className:O.loadingIconPlaceholder,ownerState:D})}),A=(f||g&&y===`end`)&&(0,z.jsx)(Bg,{className:O.endIcon,ownerState:D,children:f||(0,z.jsx)(Hg,{className:O.loadingIconPlaceholder,ownerState:D})}),j=r||``,M=typeof g==`boolean`?(0,z.jsx)(`span`,{className:O.loadingWrapper,style:{display:`contents`},children:g&&(0,z.jsx)(Vg,{className:O.loadingIndicator,ownerState:D,children:E})}):null,{root:N,...ee}=O;return(0,z.jsxs)(Rg,{ownerState:D,className:V(n.className,O.root,c,j),component:s,disabled:l||g,focusRipple:!d,focusVisibleClassName:V(O.focusVisible,p),ref:t,internalNativeButton:!0,type:S,id:g?T:h,...w,classes:ee,children:[k,y!==`end`&&M,a,y===`end`&&M,A]})});function Wg(e){return H(`MuiCard`,e)}U(`MuiCard`,[`root`]);var Gg=e=>{let{classes:t}=e;return W({root:[`root`]},Wg,t)},Kg=K(ym,{name:`MuiCard`,slot:`Root`})({overflow:`hidden`}),qg=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiCard`}),{className:r,raised:i=!1,...a}=n,o={...n,raised:i};return(0,z.jsx)(Kg,{className:V(Gg(o).root,r),elevation:i?8:void 0,ref:t,ownerState:o,...a})});function Jg(e){return H(`MuiCardContent`,e)}U(`MuiCardContent`,[`root`]);var Yg=e=>{let{classes:t}=e;return W({root:[`root`]},Jg,t)},Xg=K(`div`,{name:`MuiCardContent`,slot:`Root`})({padding:16,"&:last-child":{paddingBottom:24}}),Zg=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiCardContent`}),{className:r,component:i=`div`,...a}=n,o={...n,component:i};return(0,z.jsx)(Xg,{as:i,className:V(Yg(o).root,r),ownerState:o,ref:t,...a})});function Qg(e){return H(`PrivateSwitchBase`,e)}U(`PrivateSwitchBase`,[`root`,`checked`,`disabled`,`input`,`edgeStart`,`edgeEnd`]);var $g=e=>{let{classes:t,checked:n,disabled:r,edge:i}=e;return W({root:[`root`,n&&`checked`,r&&`disabled`,i&&`edge${J(i)}`],input:[`input`]},Qg,t)},e_=K(Bm,{name:`MuiSwitchBase`})({padding:9,borderRadius:`50%`,variants:[{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e===`start`&&t.size!==`small`,style:{marginLeft:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e===`end`&&t.size!==`small`,style:{marginRight:-12}}]}),t_=K(`input`,{name:`MuiSwitchBase`,shouldForwardProp:kf})({cursor:`inherit`,position:`absolute`,opacity:0,width:`100%`,height:`100%`,top:0,left:0,margin:0,padding:0,zIndex:1}),n_=_.forwardRef(function(e,t){let{autoFocus:n,checked:r,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:s=!1,edge:c=!1,icon:l,id:u,name:d,onBlur:f,onChange:p,onFocus:m,readOnly:h,required:g=!1,tabIndex:_,type:v,value:y,slots:b={},slotProps:x={},...S}=e,{nativeButton:C,...w}=S,[T,E]=yp({controlled:r,default:!!a,name:`SwitchBase`,state:`checked`}),D=$h(),O=e=>{m&&m(e),D&&D.onFocus&&D.onFocus(e)},k=e=>{f&&f(e),D&&D.onBlur&&D.onBlur(e)},A=e=>{if(e.nativeEvent.defaultPrevented||h)return;let t=e.target.checked;E(t),p&&p(e,t)},j=o;D&&j===void 0&&(j=D.disabled);let M=v===`checkbox`||v===`radio`,N={...e,checked:T,disabled:j,disableFocusRipple:s,edge:c},ee=$g(N),te={slots:b,slotProps:x},[P,F]=X(`root`,{ref:t,elementType:e_,className:ee.root,shouldForwardComponentProp:!0,externalForwardedProps:{...te,component:`span`,...w},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),O(t)},onBlur:t=>{e.onBlur?.(t),k(t)}}),ownerState:N,additionalProps:{centerRipple:!0,focusRipple:!s,role:void 0,tabIndex:null}}),[ne,re]=X(`input`,{elementType:t_,className:ee.input,externalForwardedProps:te,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),A(t)}}),ownerState:N,additionalProps:{autoFocus:n,checked:r,defaultChecked:a,disabled:j,id:M?u:void 0,name:d,readOnly:h,required:g,tabIndex:_,type:v,...v===`checkbox`&&y===void 0?{}:{value:y}}});return(0,z.jsxs)(P,{...F,children:[(0,z.jsx)(ne,{...re}),T?i:l]})}),r_=ap((0,z.jsx)(`path`,{d:`M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z`}),`CheckBoxOutlineBlank`),i_=ap((0,z.jsx)(`path`,{d:`M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z`}),`CheckBox`),a_=ap((0,z.jsx)(`path`,{d:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z`}),`IndeterminateCheckBox`);function o_(e){return H(`MuiCheckbox`,e)}var s_=U(`MuiCheckbox`,[`root`,`checked`,`disabled`,`indeterminate`,`colorPrimary`,`colorSecondary`,`sizeSmall`,`sizeMedium`]),c_=e=>{let{classes:t,indeterminate:n,color:r,size:i}=e,a=W({root:[`root`,n&&`indeterminate`,`color${J(r)}`,`size${J(i)}`]},o_,t);return{...t,...a}},l_=K(n_,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiCheckbox`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${J(n.size)}`],n.color!==`default`&&t[`color${J(n.color)}`]]}})(Y(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:`default`,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t},style:{[`&.${s_.checked}, &.${s_.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${s_.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:`transparent`}}}}]}))),u_=(0,z.jsx)(i_,{}),d_=(0,z.jsx)(r_,{}),f_=(0,z.jsx)(a_,{}),p_=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiCheckbox`}),{checkedIcon:r=u_,color:i=`primary`,icon:a=d_,indeterminate:o=!1,indeterminateIcon:s=f_,size:c=`medium`,disableRipple:l=!1,className:u,slots:d={},slotProps:f={},...p}=n,m=o?s:a,h=o?s:r,g={...n,disableRipple:l,color:i,indeterminate:o,size:c},v=c_(g),y=f.input,[b,x]=X(`root`,{ref:t,elementType:l_,className:V(v.root,u),shouldForwardComponentProp:!0,externalForwardedProps:{slots:d,slotProps:f,...p},ownerState:g,additionalProps:{type:`checkbox`,icon:_.cloneElement(m,{fontSize:m.props.fontSize??c}),checkedIcon:_.cloneElement(h,{fontSize:h.props.fontSize??c}),disableRipple:l,slots:d,slotProps:{input:Tp(typeof y==`function`?y(g):y,{"data-indeterminate":o,"aria-checked":o?`mixed`:void 0})}}});return(0,z.jsx)(b,{...x,classes:v})});function m_(e=window){let t=e.document.documentElement.clientWidth;return e.innerWidth-t}function h_(e){let t=dp(e);return t.body===e?pp(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function g_(e,t){t?e.setAttribute(`aria-hidden`,`true`):e.removeAttribute(`aria-hidden`)}function __(e){return parseFloat(pp(e).getComputedStyle(e).paddingRight)||0}function v_(e){let t=[`TEMPLATE`,`SCRIPT`,`STYLE`,`LINK`,`MAP`,`META`,`NOSCRIPT`,`PICTURE`,`COL`,`COLGROUP`,`PARAM`,`SLOT`,`SOURCE`,`TRACK`].includes(e.tagName),n=e.tagName===`INPUT`&&e.getAttribute(`type`)===`hidden`;return t||n}function y_(e,t,n,r,i){let a=[t,n,...r];[].forEach.call(e.children,e=>{let t=!a.includes(e),n=!v_(e);t&&n&&g_(e,i)})}function b_(e,t){let n=-1;return e.some((e,r)=>t(e)?(n=r,!0):!1),n}function x_(e,t){let n=[],r=e.container;if(!t.disableScrollLock){if(h_(r)){let e=m_(pp(r));n.push({value:r.style.paddingRight,property:`padding-right`,el:r}),r.style.paddingRight=`${__(r)+e}px`;let t=dp(r).querySelectorAll(`.mui-fixed`);[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:`padding-right`,el:t}),t.style.paddingRight=`${__(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=dp(r).body;else{let t=r.parentElement,n=pp(r);e=t?.nodeName===`HTML`&&n.getComputedStyle(t).overflowY===`scroll`?t:r}n.push({value:e.style.overflow,property:`overflow`,el:e},{value:e.style.overflowX,property:`overflow-x`,el:e},{value:e.style.overflowY,property:`overflow-y`,el:e}),e.style.overflow=`hidden`}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}function S_(e){let t=[];return[].forEach.call(e.children,e=>{e.getAttribute(`aria-hidden`)===`true`&&t.push(e)}),t}var C_=class{constructor(){this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(n!==-1)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&g_(e.modalRef,!1);let r=S_(t);y_(t,e.mount,e.modalRef,r,!0);let i=b_(this.containers,e=>e.container===t);return i===-1?(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n):(this.containers[i].modals.push(e),n)}mount(e,t){let n=b_(this.containers,t=>t.modals.includes(e)),r=this.containers[n];r.restore||=x_(r,t)}remove(e,t=!0){let n=this.modals.indexOf(e);if(n===-1)return n;let r=b_(this.containers,t=>t.modals.includes(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),e.modalRef&&g_(e.modalRef,t),y_(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{let e=i.modals[i.modals.length-1];e.modalRef&&g_(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}},w_=Ph,T_=`data-mui-focusable`;function E_(e){return e?e.hasAttribute(`data-mui-focusable`)?e:e.querySelector(`[${T_}]`):null}var D_=[`input`,`select`,`textarea`,`a[href]`,`button`,`[tabindex]`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function O_(e){let t=parseInt(e.getAttribute(`tabindex`)||``,10);return Number.isNaN(t)?e.contentEditable===`true`||(e.nodeName===`AUDIO`||e.nodeName===`VIDEO`||e.nodeName===`DETAILS`)&&e.getAttribute(`tabindex`)===null?0:e.tabIndex:t}function k_(e){if(e.tagName!==`INPUT`||e.type!==`radio`||!e.name)return!1;let t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`),n=t(`[name="${e.name}"]:checked`);return n||=t(`[name="${e.name}"]`),n!==e}function A_(e){return!(e.disabled||e.tagName===`INPUT`&&e.type===`hidden`||k_(e))}function j_(e){let t=[],n=[];return Array.from(e.querySelectorAll(D_)).forEach((e,r)=>{let i=O_(e);i===-1||!A_(e)||(i===0?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function M_(){return!0}function N_(e){let{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:a=j_,isEnabled:o=M_,open:s}=e,c=_.useRef(!1),l=_.useRef(null),u=_.useRef(null),d=_.useRef(null),f=_.useRef(null),p=_.useRef(!1),m=_.useRef(null),h=Sp(Ih(t),m),g=_.useRef(null);_.useEffect(()=>{!s||!m.current||(p.current=!n)},[n,s]),_.useEffect(()=>{if(c.current=!1,!s||!m.current)return;let e=up(dp(m.current)),t=E_(m.current)??m.current;return w_(m.current,e)||(t.hasAttribute(`tabIndex`)||t.setAttribute(`tabIndex`,`-1`),p.current&&t.focus()),()=>{!i&&d.current&&(c.current=!0,d.current.focus(),d.current=null)}},[s]),_.useEffect(()=>{if(!s||!m.current)return;let e=dp(m.current),t=t=>{g.current=t,!(r||!o()||t.key!==`Tab`)&&up(e)===m.current&&t.shiftKey&&(c.current=!0,u.current&&u.current.focus())},n=()=>{let t=m.current;if(t===null)return;let n=up(e);if(!e.hasFocus()||!o()||c.current){c.current=!1;return}if(w_(t,n)||r&&n!==l.current&&n!==u.current)return;if(n!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let i=[];if((n===l.current||n===u.current)&&(i=a(m.current)),i.length>0){let e=!!(g.current?.shiftKey&&g.current?.key===`Tab`),t=i[0],n=i[i.length-1];typeof t!=`string`&&typeof n!=`string`&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener(`focusin`,n),e.addEventListener(`keydown`,t,!0);let i=setInterval(()=>{let t=up(e);t&&t.tagName===`BODY`&&n()},50);return()=>{clearInterval(i),e.removeEventListener(`focusin`,n),e.removeEventListener(`keydown`,t,!0)}},[n,r,i,o,s,a]);let v=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0,f.current=e.target;let n=t.props.onFocus;n&&n(e)},y=e=>{d.current===null&&(d.current=e.relatedTarget),p.current=!0};return(0,z.jsxs)(_.Fragment,{children:[(0,z.jsx)(`div`,{tabIndex:s?0:-1,onFocus:y,ref:l,"data-testid":`sentinelStart`}),_.cloneElement(t,{ref:h,onFocus:v}),(0,z.jsx)(`div`,{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":`sentinelEnd`})]})}function P_(e){return typeof e==`function`?e():e}function F_(e){return e?e.props.hasOwnProperty(`in`):!1}var I_=()=>{},L_=new C_;function R_(e){let{container:t,disableScrollLock:n=!1,closeAfterTransition:r=!1,onTransitionEnter:i,onTransitionExited:a,children:o,onClose:s,open:c,rootRef:l}=e,u=_.useRef({}),d=_.useRef(null),f=_.useRef(null),p=Sp(f,l),[m,h]=_.useState(!c),g=F_(o),v=!0;(e[`aria-hidden`]===`false`||e[`aria-hidden`]===!1)&&(v=!1);let y=()=>dp(d.current),b=()=>(u.current.modalRef=f.current,u.current.mount=d.current,u.current),x=()=>{L_.mount(b(),{disableScrollLock:n}),f.current&&(f.current.scrollTop=0)},S=bp(()=>{let e=P_(t)||y().body;L_.add(b(),e),f.current&&x()}),C=()=>L_.isTopModal(b()),w=bp(e=>{d.current=e,e&&(c&&C()?x():f.current&&g_(f.current,v))}),T=_.useCallback(()=>{L_.remove(b(),v)},[v]);_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>{c?S():(!g||!r)&&T()},[c,T,g,r,S]);let E=e=>t=>{e.onKeyDown?.(t),!(t.key!==`Escape`||t.which===229||!C())&&(t.stopPropagation(),s&&s(t,`escapeKeyDown`))},D=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&s&&s(t,`backdropClick`)};return{getRootProps:(t={})=>{let n=pm(e);delete n.onTransitionEnter,delete n.onTransitionExited;let r={...n,...t};return{role:`presentation`,...r,onKeyDown:E(r),ref:p}},getBackdropProps:(e={})=>{let t=e;return{"aria-hidden":!0,...t,onClick:D(t),open:c}},getTransitionProps:()=>({onEnter:ep(()=>{h(!1),i&&i()},o?.props.onEnter??I_),onExited:ep(()=>{h(!0),a&&a(),r&&T()},o?.props.onExited??I_)}),rootRef:p,portalRef:w,isTopModal:C,exited:m,hasTransition:g}}function z_(e){return H(`MuiModal`,e)}U(`MuiModal`,[`root`,`hidden`,`backdrop`]);var B_=e=>{let{open:t,exited:n,classes:r}=e;return W({root:[`root`,!t&&n&&`hidden`],backdrop:[`backdrop`]},z_,r)},V_=K(`div`,{name:`MuiModal`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(Y(({theme:e})=>({position:`fixed`,zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:e})=>!e.open&&e.exited,style:{visibility:`hidden`}}]}))),H_=K(kg,{name:`MuiModal`,slot:`Backdrop`})({zIndex:-1}),U_=_.forwardRef(function(e,t){let n=q({name:`MuiModal`,props:e}),{classes:r,className:i,closeAfterTransition:a=!1,children:o,container:s,component:c,disableAutoFocus:l=!1,disableEnforceFocus:u=!1,disablePortal:d=!1,disableRestoreFocus:f=!1,disableScrollLock:p=!1,hideBackdrop:m=!1,keepMounted:h=!1,onClose:g,onTransitionEnter:v,onTransitionExited:y,open:b,slotProps:x={},slots:S={},theme:C,...w}=n,T={...n,closeAfterTransition:a,disableAutoFocus:l,disableEnforceFocus:u,disablePortal:d,disableRestoreFocus:f,disableScrollLock:p,hideBackdrop:m,keepMounted:h},{getRootProps:E,getBackdropProps:D,getTransitionProps:O,portalRef:k,isTopModal:A,exited:j,hasTransition:M}=R_({...T,rootRef:t}),N={...T,exited:j},ee=B_(N),te={};if(o.props.tabIndex===void 0&&(te.tabIndex=`-1`),M){let{onEnter:e,onExited:t}=O();te.onEnter=e,te.onExited=t}let P={slots:S,slotProps:x},[F,ne]=X(`root`,{ref:t,elementType:V_,externalForwardedProps:{...P,...w,component:c},getSlotProps:E,ownerState:N,className:V(i,ee?.root,!N.open&&N.exited&&ee?.hidden)}),[re,ie]=X(`backdrop`,{elementType:H_,externalForwardedProps:P,shouldForwardComponentProp:!0,getSlotProps:e=>D({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:ee?.backdrop,ownerState:N});return!h&&!b&&(!M||j)?null:(0,z.jsx)(Rh,{ref:k,container:s,disablePortal:d,children:(0,z.jsxs)(F,{...ne,children:[m?null:(0,z.jsx)(re,{...ie}),(0,z.jsx)(N_,{disableEnforceFocus:u,disableAutoFocus:l,disableRestoreFocus:f,isEnabled:A,open:b,children:_.cloneElement(o,te)})]})})});function W_(e){return H(`MuiDialog`,e)}U(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]);var G_=_.createContext({}),K_=K(kg,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),q_=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return W({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${J(n)}`],paper:[`paper`,`paperWidth${J(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},W_,t)},J_=K(U_,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),Y_=K(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${J(n.scroll)}`]]}})({height:`100%`,"@media print":{height:`auto`},outline:0,variants:[{props:{scroll:`paper`},style:{display:`flex`,justifyContent:`center`,alignItems:`center`}},{props:{scroll:`body`},style:{overflowY:`auto`,overflowX:`hidden`,textAlign:`center`,"&::after":{content:`""`,display:`inline-block`,verticalAlign:`middle`,height:`100%`,width:`0`}}}]}),X_=K(ym,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`paperWidth${J(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(Y(({theme:e})=>({margin:32,position:`relative`,overflowY:`auto`,"@media print":{overflowY:`visible`,boxShadow:`none`},variants:[{props:{scroll:`paper`},style:{display:`flex`,flexDirection:`column`,maxHeight:`calc(100% - 64px)`}},{props:{scroll:`body`},style:{display:`inline-block`,verticalAlign:`middle`,textAlign:`initial`}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:`calc(100% - 64px)`}},{props:{maxWidth:`xs`},style:{maxWidth:e.breakpoints.unit===`px`?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`}},{props:{maxWidth:`xs`,scroll:`body`},style:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:`calc(100% - 64px)`}}},...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`}})),...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t,scroll:`body`},style:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:`calc(100% - 64px)`}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:`calc(100% - 64px)`}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:`100%`,maxWidth:`100%`,height:`100%`,maxHeight:`none`,borderRadius:0}},{props:({ownerState:e})=>e.fullScreen&&e.scroll===`body`,style:{margin:0,maxWidth:`100%`}}]}))),Z_=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiDialog`}),r=Df(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,"aria-modal":s=!0,children:c,className:l,fullScreen:u=!1,fullWidth:d=!1,maxWidth:f=`sm`,onClick:p,onClose:m,open:h,PaperComponent:g=ym,role:v=`dialog`,scroll:y=`paper`,slots:b={},slotProps:x={},transitionDuration:S=i,...C}=n,w={...n,fullScreen:u,fullWidth:d,maxWidth:f,scroll:y},T=q_(w),E=_.useRef(),D=e=>{E.current=e.target===e.currentTarget},O=e=>{p&&p(e),E.current&&(E.current=null,m&&m(e,`backdropClick`))},k=Su(o),A=_.useMemo(()=>({titleId:k}),[k]),j={slots:b,slotProps:x},[M,N]=X(`root`,{elementType:J_,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:w,className:V(T.root,l),ref:t}),[ee,te]=X(`backdrop`,{elementType:K_,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:w,className:T.backdrop}),[P,F]=X(`paper`,{elementType:X_,shouldForwardComponentProp:!0,externalForwardedProps:j,ownerState:w,className:T.paper,additionalProps:{elevation:24,role:v,"aria-describedby":a,"aria-labelledby":k,"aria-modal":s,tabIndex:-1,[T_]:``}}),[ne,re]=X(`container`,{elementType:Y_,externalForwardedProps:j,ownerState:w,className:T.container}),[ie,ae]=X(`transition`,{elementType:Tg,externalForwardedProps:j,ownerState:w,additionalProps:{appear:!0,in:h,timeout:S,role:`presentation`}});return(0,z.jsx)(M,{closeAfterTransition:!0,slots:{backdrop:ee},slotProps:{backdrop:{transitionDuration:S,...te}},onClose:m,open:h,onClick:O,...N,...C,children:(0,z.jsx)(ie,{...ae,children:(0,z.jsx)(ne,{onMouseDown:D,...re,children:(0,z.jsx)(P,{as:g,...F,children:(0,z.jsx)(G_.Provider,{value:A,children:c})})})})})});function Q_(e){return H(`MuiDialogActions`,e)}U(`MuiDialogActions`,[`root`,`spacing`]);var $_=e=>{let{classes:t,disableSpacing:n}=e;return W({root:[`root`,!n&&`spacing`]},Q_,t)},ev=K(`div`,{name:`MuiDialogActions`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:`flex`,alignItems:`center`,padding:8,justifyContent:`flex-end`,flex:`0 0 auto`,variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),tv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i};return(0,z.jsx)(ev,{className:V($_(o).root,r),ownerState:o,ref:t,...a})});function nv(e){return H(`MuiDialogContent`,e)}U(`MuiDialogContent`,[`root`,`dividers`]);function rv(e){return H(`MuiDialogTitle`,e)}var iv=U(`MuiDialogTitle`,[`root`]),av=e=>{let{classes:t,dividers:n}=e;return W({root:[`root`,n&&`dividers`]},nv,t)},ov=K(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(Y(({theme:e})=>({flex:`1 1 auto`,WebkitOverflowScrolling:`touch`,overflowY:`auto`,padding:`20px 24px`,variants:[{props:({ownerState:e})=>e.dividers,style:{padding:`16px 24px`,borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${iv.root} + &`]:{paddingTop:0}}}]}))),sv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i};return(0,z.jsx)(ov,{className:V(av(o).root,r),ownerState:o,ref:t,...a})}),cv=e=>{let{classes:t}=e;return W({root:[`root`]},rv,t)},lv=K(Oh,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),uv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=cv(o),{titleId:c=i}=_.useContext(G_);return(0,z.jsx)(lv,{component:`h2`,className:V(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function dv(e){return H(`MuiDivider`,e)}var fv=U(`MuiDivider`,[`root`,`absolute`,`fullWidth`,`inset`,`middle`,`flexItem`,`vertical`,`withChildren`,`textAlignRight`,`textAlignLeft`,`wrapper`,`wrapperVertical`]),pv=e=>{let{absolute:t,children:n,classes:r,flexItem:i,orientation:a,textAlign:o,variant:s}=e;return W({root:[`root`,t&&`absolute`,s,a===`vertical`&&`vertical`,i&&`flexItem`,n&&`withChildren`,o===`right`&&a!==`vertical`&&`textAlignRight`,o===`left`&&a!==`vertical`&&`textAlignLeft`],wrapper:[`wrapper`,a===`vertical`&&`wrapperVertical`]},dv,r)},mv=K(`div`,{name:`MuiDivider`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.orientation===`vertical`&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.textAlign===`right`&&n.orientation!==`vertical`&&t.textAlignRight,n.textAlign===`left`&&n.orientation!==`vertical`&&t.textAlignLeft]}})(Y(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:`solid`,borderColor:(e.vars||e).palette.divider,borderBottomWidth:`thin`,variants:[{props:{absolute:!0},style:{position:`absolute`,bottom:0,left:0,width:`100%`}},{props:{variant:`inset`},style:{marginLeft:72}},{props:{variant:`middle`,orientation:`horizontal`},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:`middle`,orientation:`vertical`},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:`vertical`},style:{height:`100%`,borderBottomWidth:0,borderRightWidth:`thin`}},{props:{flexItem:!0},style:{alignSelf:`stretch`,height:`auto`}},{props:({ownerState:e})=>!!e.children,style:{display:`flex`,textAlign:`center`,border:0,borderTopStyle:`solid`,borderLeftStyle:`solid`,"&::before, &::after":{content:`""`,alignSelf:`center`}}},{props:({ownerState:e})=>e.children&&e.orientation!==`vertical`,style:{"&::before, &::after":{width:`100%`,borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:`inherit`}}},{props:({ownerState:e})=>e.orientation===`vertical`&&e.children,style:{flexDirection:`column`,"&::before, &::after":{height:`100%`,borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:`inherit`}}},{props:({ownerState:e})=>e.textAlign===`right`&&e.orientation!==`vertical`,style:{"&::before":{width:`90%`},"&::after":{width:`10%`}}},{props:({ownerState:e})=>e.textAlign===`left`&&e.orientation!==`vertical`,style:{"&::before":{width:`10%`},"&::after":{width:`90%`}}}]}))),hv=K(`span`,{name:`MuiDivider`,slot:`Wrapper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.wrapper,n.orientation===`vertical`&&t.wrapperVertical]}})(Y(({theme:e})=>({display:`inline-block`,paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:`nowrap`,variants:[{props:{orientation:`vertical`},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),gv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiDivider`}),{absolute:r=!1,children:i,className:a,orientation:o=`horizontal`,component:s=i||o===`vertical`?`div`:`hr`,flexItem:c=!1,role:l=s===`hr`?void 0:`separator`,textAlign:u=`center`,variant:d=`fullWidth`,...f}=n,p={...n,absolute:r,component:s,flexItem:c,orientation:o,role:l,textAlign:u,variant:d},m=pv(p);return(0,z.jsx)(mv,{as:s,className:V(m.root,a),role:l,ref:t,ownerState:p,"aria-orientation":l===`separator`&&(s!==`hr`||o===`vertical`)?o:void 0,...f,children:i?(0,z.jsx)(hv,{className:m.wrapper,ownerState:p,children:i}):null})}),_v={visibility:`hidden`};function vv(e){return typeof e==`string`&&/^translate\(.+,\s*.+\)$/.test(e)}function yv(e,t,n,r={}){let{resetInlineTransform:i=!0}=r,a=n&&n.getBoundingClientRect(),o=mp(t),s,c;if(i){let e=t.style.transform,n=t.style.transition;t.style.transition=``,t.style.transform=``,s=t.getBoundingClientRect(),c=o.getComputedStyle(t).getPropertyValue(`transform`),t.style.transform=e,t.style.transition=n}else s=t.getBoundingClientRect(),c=o.getComputedStyle(t).getPropertyValue(`transform`);let{offsetX:l,offsetY:u}=om(c);return e===`left`?a?`translateX(${a.right+l-s.left}px)`:`translateX(${o.innerWidth+l-s.left}px)`:e===`right`?a?`translateX(-${s.right-a.left-l}px)`:`translateX(-${s.left+s.width-l}px)`:e===`up`?a?`translateY(${a.bottom+u-s.top}px)`:`translateY(${o.innerHeight+u-s.top}px)`:a?`translateY(-${s.top-a.top+s.height-u}px)`:`translateY(-${s.top+s.height-u}px)`}function bv(e){return typeof e==`function`?e():e}function xv(e,t,n,r){let i=yv(e,t,bv(n),r);i&&(t.style.transform=i)}var Sv=_.forwardRef(function(e,t){let n=Df(),r={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:o=!0,children:s,container:c,direction:l=`down`,easing:u=r,in:d,onEnter:f,onEntered:p,onEntering:m,onExit:h,onExited:g,onExiting:v,style:y,timeout:b=i,...x}=e,S=_.useRef(null),C=_.useRef(!1),w=Cp(Ih(s),S,t),T=sm(S,(e,t)=>{xv(l,e,c),em(e),f&&f(e,t)}),E=sm(S,(e,t)=>{let r=lm({timeout:b,style:y,easing:u},{mode:`enter`});e.style.transition=n.transitions.create(`transform`,r),e.style.transform=`none`,m&&m(e,t)}),D=sm(S,p),O=sm(S,v),k=sm(S,e=>{let t=lm({timeout:b,style:y,easing:u},{mode:`exit`});e.style.transition=n.transitions.create(`transform`,t);let r=vv(e.style.transform);C.current=r,xv(l,e,c,{resetInlineTransform:!r}),h&&h(e)}),A=sm(S,e=>{C.current=!1,e.style.transition=``,g&&g(e)}),j=e=>{a&&a(S.current,e)},M=_.useCallback(()=>{S.current&&xv(l,S.current,c)},[l,c]);return _.useEffect(()=>{if(d||l===`down`||l===`right`)return;let e=sp(()=>{S.current&&xv(l,S.current,c)}),t=mp(S.current);return t.addEventListener(`resize`,e),()=>{e.clear(),t.removeEventListener(`resize`,e)}},[l,d,c]),_.useEffect(()=>{!d&&!C.current&&M()},[d,M]),(0,z.jsx)(Lp,{nodeRef:S,onEnter:T,onEntered:D,onEntering:E,onExit:k,onExited:A,onExiting:O,addEndListener:j,appear:o,in:d,timeout:b,...x,children:(e,{ownerState:t,...n})=>{let r;return r=e===`exited`&&!d?y||s.props.style?{visibility:`hidden`,...y,...s.props.style}:_v:y&&s.props.style?{...y,...s.props.style}:y||s.props.style,_.cloneElement(s,{ref:w,style:r,...n})}})});function Cv(e){return H(`MuiDrawer`,e)}U(`MuiDrawer`,[`root`,`docked`,`paper`,`anchorLeft`,`anchorRight`,`anchorTop`,`anchorBottom`,`modal`]);var wv=(e,t)=>{let{ownerState:n}=e;return[t.root,(n.variant===`permanent`||n.variant===`persistent`)&&t.docked,n.variant===`temporary`&&t.modal]},Tv=e=>{let{classes:t,anchor:n,variant:r}=e;return W({root:[`root`,`anchor${J(n)}`],docked:[(r===`permanent`||r===`persistent`)&&`docked`],modal:[`modal`],paper:[`paper`]},Cv,t)},Ev=K(U_,{name:`MuiDrawer`,slot:`Root`,overridesResolver:wv})(Y(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Dv=K(`div`,{shouldForwardProp:kf,name:`MuiDrawer`,slot:`Docked`,skipVariantsResolver:!1,overridesResolver:wv})({flex:`0 0 auto`}),Ov=K(ym,{name:`MuiDrawer`,slot:`Paper`})(Y(({theme:e})=>({overflowY:`auto`,display:`flex`,flexDirection:`column`,height:`100%`,flex:`1 0 auto`,zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:`touch`,position:`fixed`,top:0,outline:0,variants:[{props:{anchor:`left`},style:{left:0}},{props:{anchor:`top`},style:{top:0,left:0,right:0,height:`auto`,maxHeight:`100%`}},{props:{anchor:`right`},style:{right:0}},{props:{anchor:`bottom`},style:{top:`auto`,left:0,bottom:0,right:0,height:`auto`,maxHeight:`100%`}},{props:({ownerState:e})=>e.anchor===`left`&&e.variant!==`temporary`,style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>e.anchor===`top`&&e.variant!==`temporary`,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>e.anchor===`right`&&e.variant!==`temporary`,style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>e.anchor===`bottom`&&e.variant!==`temporary`,style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),kv={left:`right`,right:`left`,top:`down`,bottom:`up`};function Av(e){return[`left`,`right`].includes(e)}function jv({direction:e},t){return e===`rtl`&&Av(t)?kv[t]:t}var Mv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiDrawer`}),r=Df(),i=mu(),a={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{anchor:o=`left`,children:s,className:c,elevation:l=16,hideBackdrop:u=!1,ModalProps:d={},onClose:f,open:p=!1,transitionDuration:m=a,variant:h=`temporary`,slots:g={},slotProps:v={},...y}=n,b=_.useRef(!1),x=_.useRef(null),S=Cp(t,x);_.useEffect(()=>{b.current=!0},[]);let C=_.useCallback(()=>x.current,[]),w=jv({direction:i?`rtl`:`ltr`},o),T=o,E={...n,anchor:T,elevation:l,open:p,variant:h,...y},D=Tv(E),O={slots:g,slotProps:{...v,backdrop:Tp(v.backdrop,{transitionDuration:m})}},[k,A]=X(`root`,{ref:S,elementType:Ev,className:V(D.root,D.modal,c),shouldForwardComponentProp:!0,ownerState:E,externalForwardedProps:{...O,...y,...d},additionalProps:{closeAfterTransition:!0,open:p,onClose:f,hideBackdrop:u,slots:{backdrop:O.slots.backdrop},slotProps:{backdrop:O.slotProps.backdrop}}}),[j,M]=X(`paper`,{elementType:Ov,shouldForwardComponentProp:!0,className:D.paper,ownerState:E,externalForwardedProps:O,additionalProps:{elevation:h===`temporary`?l:0,square:!0,...h===`temporary`&&{role:`dialog`,"aria-modal":`true`,"data-mui-focusable":``,tabIndex:-1}}}),[N,ee]=X(`docked`,{elementType:Dv,ref:S,className:V(D.root,D.docked,c),ownerState:E,externalForwardedProps:O,additionalProps:y}),[te,P]=X(`transition`,{elementType:Sv,ownerState:E,externalForwardedProps:O,additionalProps:{in:p,direction:kv[w],timeout:m,appear:b.current,...h===`temporary`&&(g.transition==null||g.transition===Sv)&&{container:C}}}),F=(0,z.jsx)(j,{...M,children:s});if(h===`permanent`)return(0,z.jsx)(N,{...ee,children:F});let ne=(0,z.jsx)(te,{...P,children:F});return h===`persistent`?(0,z.jsx)(N,{...ee,children:ne}):(0,z.jsx)(k,{...A,children:ne})}),Nv=e=>{let{classes:t,disableUnderline:n,startAdornment:r,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=e,c=W({root:[`root`,!n&&`underline`,r&&`adornedStart`,i&&`adornedEnd`,a===`small`&&`size${J(a)}`,o&&`hiddenLabel`,s&&`multiline`],input:[`input`]},bg,t);return{...t,...c}},Pv=K(fg,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiFilledInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...lg(e,t),!n.disableUnderline&&t.underline]}})(Y(({theme:e})=>{let t=e.palette.mode===`light`,n=t?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`,r=t?`rgba(0, 0, 0, 0.06)`:`rgba(255, 255, 255, 0.09)`,i=t?`rgba(0, 0, 0, 0.09)`:`rgba(255, 255, 255, 0.13)`,a=t?`rgba(0, 0, 0, 0.12)`:`rgba(255, 255, 255, 0.12)`;return{position:`relative`,backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:i,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${xg.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${xg.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a},variants:[{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${xg.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${xg.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${xg.disabled}, .${xg.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${xg.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{disableUnderline:!1,color:t},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t]?.main}`}}})),{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:12}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:12}},{props:({ownerState:e})=>e.multiline,style:{padding:`25px 12px 8px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.multiline&&e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}}]}})),Fv=K(pg,{name:`MuiFilledInput`,slot:`Input`,overridesResolver:ug})(Y(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,"&:-webkit-autofill":{...!e.vars&&{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`},borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`,...e.vars&&e.applyStyles(`dark`,{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`})},variants:[{props:{size:`small`},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:e})=>e.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}},{props:({ownerState:e})=>e.hiddenLabel&&e.size===`small`,style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:e})=>e.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),Iv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiFilledInput`}),{disableUnderline:r=!1,fullWidth:i=!1,hiddenLabel:a,inputComponent:o=`input`,multiline:s=!1,notched:c,slotProps:l,slots:u={},type:d=`text`,...f}=n,p={...n,disableUnderline:r,fullWidth:i,inputComponent:o,multiline:s,type:d},m=Nv(n),h={root:{ownerState:p},input:{ownerState:p}},g=l?Ls(h,l):h;return(0,z.jsx)(hg,{slots:{root:u.root??Pv,input:u.input??Fv},slotProps:g,fullWidth:i,inputComponent:o,multiline:s,ref:t,type:d,...f,classes:m})});Iv.muiName=`Input`;function Lv(e){return H(`MuiFormControl`,e)}U(`MuiFormControl`,[`root`,`marginNone`,`marginNormal`,`marginDense`,`fullWidth`,`disabled`]);var Rv=e=>{let{classes:t,margin:n,fullWidth:r}=e;return W({root:[`root`,n!==`none`&&`margin${J(n)}`,r&&`fullWidth`]},Lv,t)},zv=K(`div`,{name:`MuiFormControl`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`margin${J(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:`inline-flex`,flexDirection:`column`,position:`relative`,minWidth:0,padding:0,margin:0,border:0,verticalAlign:`top`,variants:[{props:{margin:`normal`},style:{marginTop:16,marginBottom:8}},{props:{margin:`dense`},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:`100%`}}]}),Bv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiFormControl`}),{children:r,className:i,color:a=`primary`,component:o=`div`,disabled:s=!1,error:c=!1,focused:l,fullWidth:u=!1,hiddenLabel:d=!1,margin:f=`none`,required:p=!1,size:m=`medium`,variant:h=`outlined`,...g}=n,v={...n,color:a,component:o,disabled:s,error:c,fullWidth:u,hiddenLabel:d,margin:f,required:p,size:m,variant:h},y=Rv(v),[b,x]=_.useState(()=>{let e=!1;return r&&_.Children.forEach(r,t=>{if(!cp(t,[`Input`,`Select`]))return;let n=cp(t,[`Select`])?t.props.input:t;n&&rg(n.props)&&(e=!0)}),e}),[S,C]=_.useState(()=>{let e=!1;return r&&_.Children.forEach(r,t=>{cp(t,[`Input`,`Select`])&&(ng(t.props,!0)||ng(t.props.inputProps,!0))&&(e=!0)}),e}),[w,T]=_.useState(!1);s&&w&&T(!1);let E=l!==void 0&&!s?l:w;_.useRef(!1);let D=_.useCallback(()=>{C(!0)},[]),O=_.useCallback(()=>{C(!1)},[]),k=_.useMemo(()=>({adornedStart:b,setAdornedStart:x,color:a,disabled:s,error:c,filled:S,focused:E,fullWidth:u,hiddenLabel:d,size:m,onBlur:()=>{T(!1)},onFocus:()=>{T(!0)},onEmpty:O,onFilled:D,registerEffect:void 0,required:p,variant:h}),[b,a,s,c,S,E,u,d,void 0,O,D,p,m,h]);return(0,z.jsx)(Qh.Provider,{value:k,children:(0,z.jsx)(zv,{as:o,ownerState:v,className:V(y.root,i),ref:t,...g,children:r})})});function Vv(e){return H(`MuiFormControlLabel`,e)}var Hv=U(`MuiFormControlLabel`,[`root`,`labelPlacementStart`,`labelPlacementTop`,`labelPlacementBottom`,`disabled`,`label`,`error`,`required`,`asterisk`]),Uv=e=>{let{classes:t,disabled:n,labelPlacement:r,error:i,required:a}=e;return W({root:[`root`,n&&`disabled`,`labelPlacement${J(r)}`,i&&`error`,a&&`required`],label:[`label`,n&&`disabled`],asterisk:[`asterisk`,i&&`error`]},Vv,t)},Wv=K(`label`,{name:`MuiFormControlLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Hv.label}`]:t.label},t.root,t[`labelPlacement${J(n.labelPlacement)}`]]}})(Y(({theme:e})=>({display:`inline-flex`,alignItems:`center`,cursor:`pointer`,verticalAlign:`middle`,WebkitTapHighlightColor:`transparent`,marginLeft:-11,marginRight:16,[`&.${Hv.disabled}`]:{cursor:`default`},[`& .${Hv.label}`]:{[`&.${Hv.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:`start`},style:{flexDirection:`row-reverse`,marginRight:-11}},{props:{labelPlacement:`top`},style:{flexDirection:`column-reverse`}},{props:{labelPlacement:`bottom`},style:{flexDirection:`column`}},{props:({labelPlacement:e})=>e===`start`||e===`top`||e===`bottom`,style:{marginLeft:16}}]}))),Gv=K(`span`,{name:`MuiFormControlLabel`,slot:`Asterisk`})(Y(({theme:e})=>({[`&.${Hv.error}`]:{color:(e.vars||e).palette.error.main}}))),Kv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiFormControlLabel`}),{checked:r,className:i,control:a,disabled:o,disableTypography:s,inputRef:c,label:l,labelPlacement:u=`end`,name:d,onChange:f,required:p,slots:m={},slotProps:h={},value:g,...v}=n,[y,b]=eg({props:n,states:[`error`]}),x=o??a.props.disabled??b?.disabled,S=p??a.props.required,C={disabled:x,required:S};[`checked`,`name`,`onChange`,`value`,`inputRef`].forEach(e=>{a.props[e]===void 0&&n[e]!==void 0&&(C[e]=n[e])});let w={...n,disabled:x,labelPlacement:u,required:S,error:y.error},T=Uv(w),[E,D]=X(`typography`,{elementType:Oh,externalForwardedProps:{slots:m,slotProps:h},ownerState:w}),O=l;return O!=null&&O.type!==Oh&&!s&&(O=(0,z.jsx)(E,{component:`span`,...D,className:V(T.label,D?.className),children:O})),(0,z.jsxs)(Wv,{className:V(T.root,i),ownerState:w,ref:t,...v,children:[_.cloneElement(a,C),S?(0,z.jsxs)(`div`,{children:[O,(0,z.jsxs)(Gv,{ownerState:w,"aria-hidden":!0,className:T.asterisk,children:[` `,`*`]})]}):O]})});function qv(e){return H(`MuiFormHelperText`,e)}var Jv=U(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]),Yv,Xv=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return W({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${J(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},qv,t)},Zv=K(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${J(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(Y(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Jv.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Jv.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:`small`},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),Qv=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiFormHelperText`}),{children:r,className:i,component:a=`p`,disabled:o,error:s,filled:c,focused:l,margin:u,required:d,variant:f,...p}=n,[m]=eg({props:n,states:[`variant`,`size`,`disabled`,`error`,`filled`,`focused`,`required`]}),h={...n,component:a,contained:m.variant===`filled`||m.variant===`outlined`,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};return delete h.ownerState,(0,z.jsx)(Zv,{as:a,className:V(Xv(h).root,i),ref:t,...p,ownerState:h,children:r===` `?Yv||=(0,z.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`}):r})});function $v(e){return H(`MuiFormLabel`,e)}var ey=U(`MuiFormLabel`,[`root`,`colorSecondary`,`focused`,`disabled`,`error`,`filled`,`required`,`asterisk`]),ty=e=>{let{classes:t,color:n,focused:r,disabled:i,error:a,filled:o,required:s}=e;return W({root:[`root`,`color${J(n)}`,i&&`disabled`,a&&`error`,o&&`filled`,r&&`focused`,s&&`required`],asterisk:[`asterisk`,a&&`error`]},$v,t)},ny=K(`label`,{name:`MuiFormLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color===`secondary`&&t.colorSecondary,n.filled&&t.filled]}})(Y(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:`1.4375em`,padding:0,position:`relative`,variants:[...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t},style:{[`&.${ey.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${ey.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ey.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),ry=K(`span`,{name:`MuiFormLabel`,slot:`Asterisk`})(Y(({theme:e})=>({[`&.${ey.error}`]:{color:(e.vars||e).palette.error.main}}))),iy=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiFormLabel`}),{children:r,className:i,color:a,component:o=`label`,disabled:s,error:c,filled:l,focused:u,required:d,...f}=n,[p]=eg({props:n,states:[`color`,`required`,`focused`,`disabled`,`error`,`filled`]}),m={...n,color:p.color||`primary`,component:o,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required},h=ty(m);return(0,z.jsxs)(ny,{as:o,ownerState:m,className:V(h.root,i),ref:t,...f,children:[r,p.required&&(0,z.jsxs)(ry,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[` `,`*`]})]})}),ay=hd({createStyledComponent:K(`div`,{name:`MuiGrid`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:`MuiGrid`,useThemeProps:e=>q({props:e,name:`MuiGrid`}),useTheme:Df});function oy(e){return`scale(${e}, ${e**2})`}var sy={entering:{opacity:1,transform:oy(1)},entered:{opacity:1,transform:`none`},exiting:{opacity:0,transform:oy(.75)},exited:{opacity:0,transform:oy(.75)}},cy={opacity:0,transform:oy(.75),visibility:`hidden`},ly=_.forwardRef(function(e,t){let{addEndListener:n,appear:r=!0,children:i,easing:a,in:o,onEnter:s,onEntered:c,onEntering:l,onExit:u,onExited:d,onExiting:f,style:p,timeout:m=`auto`,...h}=e,g=$p(),v=_.useRef(),y=Df(),b=_.useRef(null),x=Cp(b,Ih(i),t),S=sm(b,l),C=sm(b,(e,t)=>{em(e);let{duration:n,delay:r,easing:i}=lm({style:p,timeout:m,easing:a},{mode:`enter`}),o;m===`auto`?(o=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=o):o=n,e.style.transition=[y.transitions.create(`opacity`,{duration:o,delay:r}),y.transitions.create(`transform`,{duration:o*.666,delay:r,easing:i})].join(`,`),s&&s(e,t)}),w=sm(b,c),T=sm(b,f),E=sm(b,e=>{let{duration:t,delay:n,easing:r}=lm({style:p,timeout:m,easing:a},{mode:`exit`}),i;m===`auto`?(i=y.transitions.getAutoHeightDuration(e.clientHeight),v.current=i):i=t,e.style.transition=[y.transitions.create(`opacity`,{duration:i,delay:n}),y.transitions.create(`transform`,{duration:i*.666,delay:n||i*.333,easing:r})].join(`,`),e.style.opacity=0,e.style.transform=oy(.75),u&&u(e)}),D=sm(b,e=>{e.style.transition=``,d&&d(e)});return(0,z.jsx)(Lp,{appear:r,in:o,nodeRef:b,onEnter:C,onEntered:w,onEntering:S,onExit:E,onExited:D,onExiting:T,addEndListener:e=>{m===`auto`&&g.start(v.current||0,e),n&&n(b.current,e)},timeout:m===`auto`?null:m,...h,children:(e,{ownerState:t,...n})=>{let r=cm(e,o,sy,cy,p,i.props.style);return _.cloneElement(i,{style:r,ref:x,...n})}})});ly&&(ly.muiSupportAuto=!0);function uy(e){return H(`MuiInputLabel`,e)}var dy=U(`MuiInputLabel`,[`root`,`focused`,`disabled`,`error`,`required`,`asterisk`,`formControl`,`sizeSmall`,`shrink`,`animated`,`standard`,`filled`,`outlined`]),fy=e=>{let{classes:t,disableUnderline:n}=e,r=W({root:[`root`,!n&&`underline`],input:[`input`]},gg,t);return{...t,...r}},py=K(fg,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiInput`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[...lg(e,t),!n.disableUnderline&&t.underline]}})(Y(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`;return e.vars&&(t=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:`relative`,variants:[{props:({ownerState:e})=>e.formControl,style:{[`label + &, .${dy.root} + &`]:{marginTop:16}}},{props:({ownerState:e})=>!e.disableUnderline,style:{"&::after":{left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},[`&.${_g.focused}:after`]:{transform:`scaleX(1) translateX(0)`},[`&.${_g.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${t}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},[`&:hover:not(.${_g.disabled}, .${_g.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${t}`}},[`&.${_g.disabled}:before`]:{borderBottomStyle:`dotted`}}},...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t].main}`}}}))]}})),my=K(pg,{name:`MuiInput`,slot:`Input`,overridesResolver:ug})({}),hy=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiInput`}),{disableUnderline:r=!1,fullWidth:i=!1,inputComponent:a=`input`,multiline:o=!1,notched:s,slotProps:c,slots:l={},type:u=`text`,...d}=n,f=fy(n),p={root:{ownerState:{disableUnderline:r}}},m=c?Ls(c,p):p;return(0,z.jsx)(hg,{slots:{root:l.root??py,input:l.input??my},slotProps:m,fullWidth:i,inputComponent:a,multiline:o,ref:t,type:u,...d,classes:f})});hy.muiName=`Input`;var gy=e=>{let{classes:t,formControl:n,size:r,shrink:i,disableAnimation:a,variant:o,required:s}=e,c=W({root:[`root`,n&&`formControl`,!a&&`animated`,i&&`shrink`,r&&r!==`medium`&&`size${J(r)}`,o],asterisk:[s&&`asterisk`]},uy,t);return{...t,...c}},_y=K(iy,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiInputLabel`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${ey.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size===`small`&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(Y(({theme:e})=>({display:`block`,transformOrigin:`top left`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,maxWidth:`100%`,variants:[{props:({ownerState:e})=>e.formControl,style:{position:`absolute`,left:0,top:0,transform:`translate(0, 20px) scale(1)`}},{props:{size:`small`},style:{transform:`translate(0, 17px) scale(1)`}},{props:({ownerState:e})=>e.shrink,style:{transform:`translate(0, -1.5px) scale(0.75)`,transformOrigin:`top left`,maxWidth:`133%`}},{props:({ownerState:e})=>!e.disableAnimation,style:{transition:e.transitions.create([`color`,`transform`,`max-width`],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:`filled`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(12px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`filled`,size:`small`},style:{transform:`translate(12px, 13px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`filled`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,transform:`translate(12px, 7px) scale(0.75)`,maxWidth:`calc(133% - 24px)`}},{props:({variant:e,ownerState:t,size:n})=>e===`filled`&&t.shrink&&n===`small`,style:{transform:`translate(12px, 4px) scale(0.75)`}},{props:{variant:`outlined`},style:{zIndex:1,pointerEvents:`none`,transform:`translate(14px, 16px) scale(1)`,maxWidth:`calc(100% - 24px)`}},{props:{variant:`outlined`,size:`small`},style:{transform:`translate(14px, 9px) scale(1)`}},{props:({variant:e,ownerState:t})=>e===`outlined`&&t.shrink,style:{userSelect:`none`,pointerEvents:`auto`,maxWidth:`calc(133% - 32px)`,transform:`translate(14px, -9px) scale(0.75)`}}]}))),vy=_.forwardRef(function(e,t){let n=q({name:`MuiInputLabel`,props:e}),{disableAnimation:r=!1,margin:i,shrink:a,variant:o,className:s,...c}=n,[l,u]=eg({props:n,states:[`size`,`variant`,`required`,`focused`]}),d=a;d===void 0&&u&&(d=u.filled||u.focused||u.adornedStart);let f={...n,disableAnimation:r,formControl:u,shrink:d,size:l.size,variant:l.variant,required:l.required,focused:l.focused},p=gy(f);return(0,z.jsx)(_y,{"data-shrink":d,ref:t,className:V(p.root,s),...c,ownerState:f,classes:p})}),yy=_.createContext({});function by(e){return H(`MuiList`,e)}U(`MuiList`,[`root`,`padding`,`dense`,`subheader`]);var xy=e=>{let{classes:t,disablePadding:n,dense:r,subheader:i}=e;return W({root:[`root`,!n&&`padding`,r&&`dense`,i&&`subheader`]},by,t)},Sy=K(`ul`,{name:`MuiList`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:`none`,margin:0,padding:0,position:`relative`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0,isolation:`isolate`}}]}),Cy=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiList`}),{children:r,className:i,component:a=`ul`,dense:o=!1,disablePadding:s=!1,subheader:c,...l}=n,u=_.useMemo(()=>({dense:o}),[o]),d={...n,component:a,dense:o,disablePadding:s},f=xy(d);return(0,z.jsx)(yy.Provider,{value:u,children:(0,z.jsxs)(Sy,{as:a,className:V(f.root,i),ref:t,ownerState:d,...l,children:[c,r]})})});function wy(e){return H(`MuiListItem`,e)}U(`MuiListItem`,[`root`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);function Ty(e){return H(`MuiListItemButton`,e)}var Ey=U(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]),Dy=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems===`flex-start`&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]},Oy=e=>{let{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:a,divider:o,selected:s}=e,c=W({root:[`root`,r&&`dense`,!a&&`gutters`,o&&`divider`,i&&`disabled`,t===`flex-start`&&`alignItemsFlexStart`,s&&`selected`]},Ty,n);return{...n,...c}},ky=K(Bm,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiListItemButton`,slot:`Root`,overridesResolver:Dy})(Y(({theme:e})=>({display:`flex`,flexGrow:1,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,minWidth:0,boxSizing:`border-box`,textAlign:`left`,paddingTop:8,paddingBottom:8,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${Ey.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Ey.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${Ey.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${Ey.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ey.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},variants:[{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:{alignItems:`flex-start`},style:{alignItems:`flex-start`}},{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.dense,style:{paddingTop:4,paddingBottom:4}}]}))),Ay=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiListItemButton`}),{alignItems:r=`center`,autoFocus:i=!1,component:a=`div`,children:o,dense:s=!1,disableGutters:c=!1,divider:l=!1,focusVisibleClassName:u,selected:d=!1,className:f,...p}=n,m=_.useContext(yy),h=_.useMemo(()=>({dense:s||m.dense||!1,alignItems:r,disableGutters:c}),[r,m.dense,s,c]),g=_.useRef(null);gp(()=>{i&&g.current&&g.current.focus()},[i]);let v={...n,alignItems:r,dense:h.dense,disableGutters:c,divider:l,selected:d},y=Oy(v),{root:b,...x}=y,S=Cp(g,t);return(0,z.jsx)(yy.Provider,{value:h,children:(0,z.jsx)(ky,{ref:S,href:p.href||p.to,component:(p.href||p.to)&&a===`div`?`button`:a,internalNativeButton:!1,focusVisibleClassName:V(y.focusVisible,u),ownerState:v,className:V(y.root,f),...p,classes:x,children:o})})});function jy(e){return H(`MuiListItemSecondaryAction`,e)}U(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]);var My=e=>{let{disableGutters:t,classes:n}=e;return W({root:[`root`,t&&`disableGutters`]},jy,n)},Ny=K(`div`,{name:`MuiListItemSecondaryAction`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),Py=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiListItemSecondaryAction`}),{className:r,component:i,...a}=n,o=_.useContext(yy),s={...n,disableGutters:o.disableGutters};return(0,z.jsx)(Ny,{as:i,className:V(My(s).root,r),ownerState:s,ref:t,...a})});Py.muiName=`ListItemSecondaryAction`;var Fy=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems===`flex-start`&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding]},Iy=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o}=e;return W({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`],secondaryAction:[`secondaryAction`]},wy,n)},Ly=K(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:Fy})(Y(({theme:e})=>({display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,width:`100%`,boxSizing:`border-box`,textAlign:`left`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${Ey.root}`]:{paddingRight:48}}},{props:{alignItems:`flex-start`},style:{alignItems:`flex-start`}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}}}}]}))),Ry=K(Py,{name:`MuiListItem`,slot:`secondaryAction`})({}),zy=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiListItem`}),{alignItems:r=`center`,children:i,className:a,component:o=`li`,dense:s=!1,disableGutters:c=!1,disablePadding:l=!1,divider:u=!1,secondaryAction:d,slotProps:f={},slots:p={},...m}=n,h=_.useContext(yy),g=_.useMemo(()=>({dense:s||h.dense||!1,alignItems:r,disableGutters:c}),[r,h.dense,s,c]),v={...n,alignItems:r,dense:g.dense,disableGutters:c,disablePadding:l,divider:u,secondaryAction:d},y=Iy(v),b={slots:p,slotProps:f},[x,S]=X(`root`,{ref:t,elementType:Ly,externalForwardedProps:{component:o,...b,...m},ownerState:v,className:V(y.root,a)}),[C,w]=X(`secondaryAction`,{elementType:Ry,shouldForwardComponentProp:!0,externalForwardedProps:b,ownerState:v,className:y.secondaryAction});return(0,z.jsx)(yy.Provider,{value:g,children:(0,z.jsxs)(x,{...S,children:[i,d&&(0,z.jsx)(C,{...w,children:d})]})})});function By(e){return H(`MuiListItemIcon`,e)}var Vy=U(`MuiListItemIcon`,[`root`,`alignItemsFlexStart`]),Hy=e=>{let{alignItems:t,classes:n}=e;return W({root:[`root`,t===`flex-start`&&`alignItemsFlexStart`]},By,n)},Uy=K(`div`,{name:`MuiListItemIcon`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.alignItems===`flex-start`&&t.alignItemsFlexStart]}})(Y(({theme:e})=>({minWidth:e.spacing(4.5),color:(e.vars||e).palette.action.active,flexShrink:0,display:`inline-flex`,variants:[{props:{alignItems:`flex-start`},style:{marginTop:8}}]}))),Wy=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiListItemIcon`}),{className:r,...i}=n,a=_.useContext(yy),o={...n,alignItems:a.alignItems};return(0,z.jsx)(Uy,{className:V(Hy(o).root,r),ownerState:o,ref:t,...i})});function Gy(e){return H(`MuiListItemText`,e)}var Ky=U(`MuiListItemText`,[`root`,`multiline`,`dense`,`inset`,`primary`,`secondary`]),qy=e=>{let{classes:t,inset:n,primary:r,secondary:i,dense:a}=e;return W({root:[`root`,n&&`inset`,a&&`dense`,r&&i&&`multiline`],primary:[`primary`],secondary:[`secondary`]},Gy,t)},Jy=K(`div`,{name:`MuiListItemText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${Ky.primary}`]:t.primary},{[`& .${Ky.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:`1 1 auto`,minWidth:0,marginTop:4,marginBottom:4,[`.${wh.root}:where(& .${Ky.primary})`]:{display:`block`},[`.${wh.root}:where(& .${Ky.secondary})`]:{display:`block`},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),Yy=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiListItemText`}),{children:r,className:i,disableTypography:a=!1,inset:o=!1,primary:s,secondary:c,slots:l={},slotProps:u={},...d}=n,{dense:f}=_.useContext(yy),p=s??r,m=c,h={...n,disableTypography:a,inset:o,primary:!!p,secondary:!!m,dense:f},g=qy(h),v={slots:l,slotProps:u},[y,b]=X(`root`,{className:V(g.root,i),elementType:Jy,externalForwardedProps:{...v,...d},ownerState:h,ref:t}),[x,S]=X(`primary`,{className:g.primary,elementType:Oh,externalForwardedProps:v,ownerState:h}),[C,w]=X(`secondary`,{className:g.secondary,elementType:Oh,externalForwardedProps:v,ownerState:h});return p!=null&&p.type!==Oh&&!a&&(p=(0,z.jsx)(x,{variant:f?`body2`:`body1`,component:S?.variant?void 0:`span`,...S,children:p})),m!=null&&m.type!==Oh&&!a&&(m=(0,z.jsx)(C,{variant:`body2`,color:`textSecondary`,...w,children:m})),(0,z.jsxs)(y,{...b,children:[p,m]})}),Xy=_.createContext(void 0);function Zy(){let e=_.useContext(Xy);if(e===void 0)throw Error(`MUI: RovingTabIndexContext is missing. Roving tab index items must be placed within a roving tab index provider.`);return e}var Qy=Object.is;function $y(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(let r in e)if(n+=1,!Qy(e[r],t[r])||!(r in t))return!1;for(let e in t)r+=1;return n===r}var eb=[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`,`Home`,`End`];function tb(e){let{activeItemId:t,getDefaultActiveItemId:n,orientation:r,isRtl:i=!1,isItemFocusable:a=hb,wrap:o=!0}=e,[s,c]=_.useState(t),l=_.useRef(t),u=s;t!==l.current&&(l.current=t,t!==void 0&&t!==s&&(u=t,c(t)));let d=_.useRef(null),f=_.useRef(new Map),[p,m]=_.useState(0),h=_.useMemo(()=>fb(f.current),[p]),g=rb(u,h,a,n),v=_.useRef(g);v.current=g;let y=_.useCallback(()=>{let e=fb(f.current);return lb(e,rb(v.current,e,a,n))},[n,a]),b=_.useCallback(()=>f.current,[]),x=bp(e=>{$y(f.current.get(e.id)??null,e)||(f.current.set(e.id,e),m(e=>e+1))}),S=bp(e=>{f.current.delete(e)&&m(e=>e+1)}),C=bp(e=>{c(e)}),w=_.useCallback(e=>v.current===e,[]),T=_.useCallback((e,t,n,r)=>{let i=sb(pb(f.current),e,t,n,r??a);return i?(i.element?.focus(),c(i.id),i):null},[a]),E=_.useCallback(e=>({onFocus:e=>{let t=pb(f.current),n=db(t,e.target);n!==-1&&c(t[n].id)},onKeyDown:e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||!eb.includes(e.key))return;let t=r===`horizontal`?`ArrowLeft`:`ArrowUp`,n=r===`horizontal`?`ArrowRight`:`ArrowDown`;r===`horizontal`&&i&&(t=`ArrowRight`,n=`ArrowLeft`);let a=pb(f.current),s=lp(dp(d.current)),c=s===d.current,l=ob(a,s,v.current),u=`next`;switch(e.key){case t:u=`previous`,e.preventDefault(),c&&(l=a.length);break;case n:e.preventDefault(),c&&(l=-1);break;case`Home`:e.preventDefault(),l=-1;break;case`End`:e.preventDefault(),u=`previous`,l=a.length;break;default:return}T(l,u,o)},ref:vb(e,e=>{d.current=e})}),[T,i,r,o]),D=_.useCallback(e=>{let t=pb(f.current),n=lp(dp(d.current));return T(n===d.current?-1:ob(t,n,v.current),`next`,!0,e)?.id??null},[T]);return _.useMemo(()=>({activeItemId:g,focusNext:D,getActiveItem:y,getContainerProps:E,getItemMap:b,isItemActive:w,registerItem:x,setActiveItemId:C,unregisterItem:S}),[g,D,y,E,b,w,x,C,S])}function nb(e){let{activeItemId:t,registerItem:n,unregisterItem:r}=Zy(),i=_.useRef(null),a=_.useMemo(()=>({disabled:e.disabled??!1,element:null,focusableWhenDisabled:e.focusableWhenDisabled??!1,id:e.id,selected:e.selected??!1,textValue:e.textValue}),[e.disabled,e.focusableWhenDisabled,e.id,e.selected,e.textValue]),o=_.useRef(a);o.current=a;let s=_.useCallback(t=>{if(i.current=t,t==null){queueMicrotask(()=>{i.current??r(e.id)});return}n({...o.current,element:t})},[e.id,n,r]),c=Sp(e.ref,s);return Hl(()=>{i.current&&n({...a,element:i.current})},[a,n]),Hl(()=>{let t=e.id;return()=>{r(t)}},[e.id,r]),{ref:c,tabIndex:t===e.id?0:-1}}function rb(e,t,n,r){return e==null?ab(t,n,r):ib(e,t,n)}function ib(e,t,n){let r=ub(t,e);return r===-1?cb(t,n):n(t[r])?t[r].id:sb(t,r,`next`,!1,n)?.id??null}function ab(e,t,n){let r=n?.(e);if(r!=null){let n=lb(e,r);if(n&&t(n))return n.id}return cb(e,t)}function ob(e,t,n){if(t){let n=db(e,t);if(n!==-1)return n}return ub(e,n)}function sb(e,t,n,r,i){let a=e.length-1;if(a===-1)return null;let o=!1,s=mb(t,a,n,r),c=s;for(;s!==-1;){if(s===c){if(o)return null;o=!0}let t=e[s];if(!t||!i(t))s=mb(s,a,n,r);else return t}return null}function cb(e,t){return e.find(e=>t(e))?.id??null}function lb(e,t){return t==null?null:e.find(e=>e.id===t)??null}function ub(e,t){return t==null?-1:e.findIndex(e=>e.id===t)}function db(e,t){return t?e.findIndex(e=>e.element===t||e.element?.contains(t)):-1}function fb(e){let t=Array.from(e.values());if(t.every(e=>e.element==null))return t;let n=t.filter(gb).sort((e,t)=>_b(e.element,t.element)),r=t.filter(e=>!gb(e));return[...n,...r]}function pb(e){return fb(e).filter(gb)}function mb(e,t,n,r=!0){return n===`next`?e===t?r?0:-1:e+1:e===0?r?t:-1:e-1}function hb(e){return e.element?e.focusableWhenDisabled?!0:!e.disabled&&!e.element.hasAttribute(`disabled`)&&e.element.getAttribute(`aria-disabled`)!==`true`&&e.element.hasAttribute(`tabindex`):!1}function gb(e){return e.element!=null&&e.element.isConnected}function _b(e,t){if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function vb(...e){return t=>{e.forEach(e=>{hp(e??null,t)})}}var yb=m_;function bb(e,t){if(t==null){e.focus();return}try{e.focus({focusVisible:t===`keyboard`})}catch{e.focus()}}function xb(e){return e?e.type===`mousedown`||e.type===`pointerdown`||e.type===`touchstart`?`pointer`:e.type===`keydown`||e.type===`click`&&e.detail===0?`keyboard`:null:null}function Sb(e){return e==null||typeof e==`string`&&!e.trim()}function Cb(e,t){return typeof t==`object`&&t?e===t:String(e)===String(t)}var wb=_.createContext(null);function Tb(){return _.useContext(wb)}var Eb=wb.Provider,Db=_.createContext(void 0);function Ob(){let e=_.useContext(Db);if(e===void 0)throw Error(`MUI: MenuListContext is missing. MenuItems must be placed within Menu or MenuList.`);return e}function kb(e){let t=e?.element??e;if(!t)return``;if(e?.textValue!==void 0)return e.textValue;let n=t.innerText;return n===void 0&&(n=t.textContent),n??``}function Ab(e,t){if(t===void 0)return!0;let n=kb(e);return n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(``))}function jb(e,t){return Ab(e,t)?hb(e):!1}function Mb(e,t){bb(e,t)}var Nb=_.forwardRef(function(e,t){let{actions:n,autoFocus:r=!1,autoFocusItem:i=!1,children:a,className:o,disabledItemsFocusable:s=!1,disableListWrap:c=!1,onKeyDown:l,variant:u=`selectedMenu`,...d}=e,f=_.useRef(null),p=_.useRef(!1),[m,h]=_.useState(!1),g=Tb(),v=_.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null}),y=tb({activeItemId:void 0,getDefaultActiveItemId:_.useCallback(e=>u===`selectedMenu`?e.find(e=>e.selected&&hb(e))?.id??e.find(e=>hb(e))?.id??null:e.find(e=>hb(e))?.id??null,[u]),orientation:`vertical`,wrap:!c}),{activeItemId:b,focusNext:x,getActiveItem:S,getContainerProps:C,getItemMap:w}=y,T=xp((e=!1)=>{if(!f.current||!e&&p.current)return null;if(i){let e=S();if(e?.element){let t=Array.from(w().values()).some(e=>e.selected);return h(u===`menu`&&t&&!e.selected&&g==null),Mb(e.element,g),p.current=!0,e.element}return r?(h(!1),f.current.focus(),f.current):null}return r?(h(!1),f.current.focus(),p.current=!0,f.current):(h(!1),null)});gp(()=>{if(!r&&!i){p.current=!1,h(!1);return}T()},[b,i,r,T]),_.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{let n=!f.current.style.width;if(e.clientHeight{if(!f.current)return null;let e=up(fp(f.current));return e&&w_(f.current,e)?e:T(!0)}}),[T]);let E=C(),D=Cp(f,E.ref,t),O=_.useMemo(()=>({itemsFocusableWhenDisabled:s,suppressInitialFocusVisible:m,variant:u}),[s,m,u]);return(0,z.jsx)(Cy,{role:`menu`,ref:D,className:o,onKeyDown:xp(e=>{if(m&&h(!1),(e.ctrlKey||e.metaKey||e.altKey)&&l){l(e);return}if(E.onKeyDown(e),e.key.length===1){let t=v.current,n=e.key.toLowerCase(),r=performance.now();t.keys.length>0&&(r-t.lastTime>500?(t.keys=[],t.repeating=!0,t.previousKeyMatched=!0):t.repeating&&n!==t.keys[0]&&(t.repeating=!1)),t.lastTime=r,t.keys.push(n);let i=up(fp(f.current)),a=i&&!t.repeating&&Ab(i,t);t.previousKeyMatched&&(a||x(e=>jb(e,t))!=null)?e.preventDefault():t.previousKeyMatched=!1}l&&l(e)}),onFocus:E.onFocus,tabIndex:-1,...d,children:(0,z.jsx)(Db.Provider,{value:O,children:(0,z.jsx)(Xy.Provider,{value:y,children:a})})})});function Pb(e){return H(`MuiPopover`,e)}U(`MuiPopover`,[`root`,`paper`]);function Fb(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.height/2:t===`bottom`&&(n=e.height),n}function Ib(e,t){let n=0;return typeof t==`number`?n=t:t===`center`?n=e.width/2:t===`right`&&(n=e.width),n}function Lb(e){return[e.horizontal,e.vertical].map(e=>typeof e==`number`?`${e}px`:e).join(` `)}function Rb(e){return typeof e==`function`?e():e}var zb=e=>{let{classes:t}=e;return W({root:[`root`],paper:[`paper`]},Pb,t)},Bb=K(U_,{name:`MuiPopover`,slot:`Root`})({}),Vb=K(ym,{name:`MuiPopover`,slot:`Paper`})({position:`absolute`,overflowY:`auto`,overflowX:`hidden`,minWidth:16,minHeight:16,maxWidth:`calc(100% - 32px)`,maxHeight:`calc(100% - 32px)`,outline:0}),Hb=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiPopover`}),{action:r,anchorEl:i,anchorOrigin:a={vertical:`top`,horizontal:`left`},anchorPosition:o,anchorReference:s=`anchorEl`,children:c,className:l,container:u,disableAutoFocus:d=!1,elevation:f=8,marginThreshold:p=16,open:m,slots:h={},slotProps:g={},transformOrigin:v={vertical:`top`,horizontal:`left`},transitionDuration:y=`auto`,disableScrollLock:b=!1,...x}=n,S=_.useRef(),C={...n,anchorOrigin:a,anchorReference:s,elevation:f,marginThreshold:p,transformOrigin:v,transitionDuration:y},w=zb(C),T=_.useCallback(()=>{if(s===`anchorPosition`)return o;let e=Rb(i),t=(e&&e.nodeType===1?e:fp(S.current).body).getBoundingClientRect();return{top:t.top+Fb(t,a.vertical),left:t.left+Ib(t,a.horizontal)}},[i,a.horizontal,a.vertical,o,s]),E=_.useCallback(e=>({vertical:Fb(e,v.vertical),horizontal:Ib(e,v.horizontal)}),[v.horizontal,v.vertical]),D=_.useCallback(e=>{let t={width:e.offsetWidth,height:e.offsetHeight},n=E(t);if(s===`none`)return{top:null,left:null,transformOrigin:Lb(n)};let r=T(),a=r.top-n.vertical,o=r.left-n.horizontal,c=a+t.height,l=o+t.width,u=mp(Rb(i)),d=u.innerHeight-p,f=u.innerWidth-p;if(p!=null&&ad){let e=c-d;a-=e,n.vertical+=e}if(p!=null&&of){let e=l-f;o-=e,n.horizontal+=e}return{top:`${Math.round(a)}px`,left:`${Math.round(o)}px`,transformOrigin:Lb(n)}},[i,s,T,E,p]),[O,k]=_.useState(m),A=_.useCallback(()=>{let e=S.current;if(!e)return;let t=D(e);t.top!=null&&e.style.setProperty(`top`,t.top),t.left!=null&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,k(!0)},[D]);_.useEffect(()=>(b&&window.addEventListener(`scroll`,A),()=>window.removeEventListener(`scroll`,A)),[i,b,A]);let j=()=>{A()},M=()=>{k(!1)};_.useEffect(()=>{m&&A()}),_.useImperativeHandle(r,()=>m?{updatePosition:()=>{A()}}:null,[m,A]),_.useEffect(()=>{if(!m)return;let e=sp(()=>{A()}),t=mp(Rb(i));return t.addEventListener(`resize`,e),()=>{e.clear(),t.removeEventListener(`resize`,e)}},[i,m,A]);let N=y,ee={slots:h,slotProps:g},[te,P]=X(`transition`,{elementType:ly,externalForwardedProps:ee,ownerState:C,getSlotProps:e=>({...e,onEntering:(t,n)=>{e.onEntering?.(t,n),j()},onExited:t=>{e.onExited?.(t),M()}}),additionalProps:{appear:!0,in:m}});y===`auto`&&!te.muiSupportAuto&&(N=void 0);let F=u||(i?fp(Rb(i)).body:void 0),[ne,{slots:re,slotProps:ie,...ae}]=X(`root`,{ref:t,elementType:Bb,externalForwardedProps:{...ee,...x},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:h.backdrop},slotProps:{backdrop:Tp(typeof g.backdrop==`function`?g.backdrop(C):g.backdrop,{invisible:!0})},container:F,open:m},ownerState:C,className:V(w.root,l)}),[I,L]=X(`paper`,{ref:S,className:w.paper,elementType:Vb,externalForwardedProps:ee,shouldForwardComponentProp:!0,additionalProps:{elevation:f,style:O?void 0:{opacity:0}},ownerState:C});return(0,z.jsx)(ne,{...ae,...!um(ne)&&{slots:re,slotProps:ie,disableAutoFocus:d,disableScrollLock:b},children:(0,z.jsx)(te,{...P,timeout:N,children:(0,z.jsx)(I,{...L,children:c})})})});function Ub(e){return H(`MuiMenu`,e)}U(`MuiMenu`,[`root`,`paper`,`list`]);var Wb={vertical:`top`,horizontal:`right`},Gb={vertical:`top`,horizontal:`left`},Kb=e=>{let{classes:t}=e;return W({root:[`root`],paper:[`paper`],list:[`list`]},Ub,t)},qb=K(Hb,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiMenu`,slot:`Root`})({}),Jb=K(Vb,{name:`MuiMenu`,slot:`Paper`})({maxHeight:`calc(100% - 96px)`,WebkitOverflowScrolling:`touch`}),Yb=K(Nb,{name:`MuiMenu`,slot:`List`})({outline:0}),Xb=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiMenu`}),{autoFocus:r=!0,children:i,className:a,disableAutoFocusItem:o=!1,onClose:s,open:c,PopoverClasses:l,transitionDuration:u=`auto`,variant:d=`selectedMenu`,slots:f={},slotProps:p={},...m}=n,h=mu(),g={...n,autoFocus:r,disableAutoFocusItem:o,transitionDuration:u,variant:d},v=Kb(g),y=r&&c,b=y&&!o,x=_.useRef(null),S=(e,t)=>{x.current&&(x.current.adjustStyleForScrollbar(e,{direction:h?`rtl`:`ltr`}),y&&x.current.focusInitialTarget?.())},C=e=>{e.key===`Tab`&&(e.preventDefault(),s&&s(e,`tabKeyDown`))},w={slots:f,slotProps:p},T=Fh({elementType:f.root,externalSlotProps:p.root,ownerState:g,className:[v.root,a]}),[E,D]=X(`paper`,{className:v.paper,elementType:Jb,externalForwardedProps:w,shouldForwardComponentProp:!0,ownerState:g}),[O,k]=X(`list`,{className:v.list,elementType:Yb,shouldForwardComponentProp:!0,externalForwardedProps:w,getSlotProps:e=>({...e,onKeyDown:t=>{C(t),e.onKeyDown?.(t)}}),ownerState:g}),A=typeof p.transition==`function`?p.transition(g):p.transition;return(0,z.jsx)(qb,{disableAutoFocus:r,onClose:s,anchorOrigin:{vertical:`bottom`,horizontal:h?`right`:`left`},transformOrigin:h?Wb:Gb,slots:{root:f.root,paper:E,backdrop:f.backdrop,transition:f.transition},slotProps:{root:T,paper:D,backdrop:typeof p.backdrop==`function`?p.backdrop(g):p.backdrop,transition:{...A,onEntering:(...e)=>{S(...e),A?.onEntering?.(...e)}}},open:c,ref:t,transitionDuration:u,ownerState:g,...m,classes:l,children:(0,z.jsx)(O,{actions:x,autoFocus:y,autoFocusItem:b,variant:d,...k,children:i})})});function Zb(e){return H(`MuiMenuItem`,e)}var Qb=U(`MuiMenuItem`,[`root`,`focusVisible`,`dense`,`disabled`,`divider`,`gutters`,`selected`]),$b=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},ex=e=>{let{disabled:t,dense:n,divider:r,disableGutters:i,selected:a,classes:o}=e,s=W({root:[`root`,n&&`dense`,t&&`disabled`,!i&&`gutters`,r&&`divider`,a&&`selected`]},Zb,o);return{...o,...s}},tx=K(Bm,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiMenuItem`,slot:`Root`,overridesResolver:$b})(Y(({theme:e})=>({...e.typography.body1,display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:`border-box`,whiteSpace:`nowrap`,"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${Qb.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Qb.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${Qb.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${Qb.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Qb.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${fv.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${fv.inset}`]:{marginLeft:52},[`& .${Ky.root}`]:{marginTop:0,marginBottom:0},[`& .${Ky.inset}`]:{paddingLeft:36},[`& .${Vy.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>!e.dense,style:{[e.breakpoints.up(`sm`)]:{minHeight:`auto`}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Vy.root} svg`]:{fontSize:`1.25rem`}}}]}))),nx=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiMenuItem`}),{autoFocus:r=!1,component:i=`li`,dense:a=!1,divider:o=!1,disableGutters:s=!1,focusVisibleClassName:c,role:l=`menuitem`,tabIndex:u,className:d,...f}=n,p=Tb(),m=_.useContext(yy),h=_.useMemo(()=>({dense:a||m.dense||!1,disableGutters:s}),[m.dense,a,s]),g=Ob(),v=_p(),y=g.suppressInitialFocusVisible,b=g.itemsFocusableWhenDisabled,x=_.useRef(null);gp(()=>{r&&x.current&&bb(x.current,p)},[r]);let S={...n,dense:h.dense,divider:o,disableGutters:s},C=ex(n),{root:w,...T}=C,E=nb({id:v,ref:t,disabled:n.disabled,focusableWhenDisabled:b,selected:n.selected}),D=Cp(x,E.ref),O;return u===void 0?g.variant===`selectedMenu`?O=E.tabIndex:(!n.disabled||b)&&(O=-1):O=u,(0,z.jsx)(yy.Provider,{value:h,children:(0,z.jsx)(tx,{ref:D,role:l,tabIndex:O,component:i,internalNativeButton:!1,focusableWhenDisabled:b,suppressFocusVisible:y,focusVisibleClassName:V(C.focusVisible,c),className:V(C.root,d),...f,ownerState:S,classes:T})})});function rx(e){return H(`MuiNativeSelect`,e)}var ix=U(`MuiNativeSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`icon`,`iconOpen`,`iconFilled`,`iconOutlined`,`iconStandard`,`nativeInput`,`error`]),ax=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return W({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,`icon${J(n)}`,a&&`iconOpen`,r&&`disabled`]},rx,t)},ox=K(`select`,{name:`MuiNativeSelect`})(({theme:e})=>({MozAppearance:`none`,WebkitAppearance:`none`,userSelect:`none`,borderRadius:0,cursor:`pointer`,"&:focus":{borderRadius:0},[`&.${ix.disabled}`]:{cursor:`default`},"&[multiple]":{height:`auto`},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:e})=>e.variant!==`filled`&&e.variant!==`outlined`,style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:`filled`},style:{"&&&":{paddingRight:32}}},{props:{variant:`outlined`},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),sx=K(ox,{name:`MuiNativeSelect`,slot:`Select`,shouldForwardProp:kf,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${ix.multiple}`]:t.multiple}]}})({}),cx=K(`svg`,{name:`MuiNativeSelect`})(({theme:e})=>({position:`absolute`,right:0,top:`calc(50% - .5em)`,pointerEvents:`none`,color:(e.vars||e).palette.action.active,[`&.${ix.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:e})=>e.open,style:{transform:`rotate(180deg)`}},{props:{variant:`filled`},style:{right:7}},{props:{variant:`outlined`},style:{right:7}}]})),lx=K(cx,{name:`MuiNativeSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${J(n.variant)}`],n.open&&t.iconOpen]}})({}),ux=_.forwardRef(function(e,t){let{className:n,disabled:r,error:i,IconComponent:a,inputRef:o,variant:s=`standard`,...c}=e,l={...e,disabled:r,variant:s,error:i},u=ax(l);return(0,z.jsxs)(_.Fragment,{children:[(0,z.jsx)(sx,{ownerState:l,className:V(u.select,n),disabled:r,ref:o||t,...c}),e.multiple?null:(0,z.jsx)(lx,{as:a,ownerState:l,className:u.icon})]})}),dx,fx=K(`fieldset`,{name:`MuiNotchedOutlined`,shouldForwardProp:kf})({textAlign:`left`,position:`absolute`,bottom:0,right:0,top:-5,left:0,margin:0,padding:`0 8px`,pointerEvents:`none`,borderRadius:`inherit`,borderStyle:`solid`,borderWidth:1,overflow:`hidden`,minWidth:`0%`}),px=K(`legend`,{name:`MuiNotchedOutlined`,shouldForwardProp:kf})(Y(({theme:e})=>({float:`unset`,width:`auto`,overflow:`hidden`,variants:[{props:({ownerState:e})=>!e.withLabel,style:{padding:0,lineHeight:`11px`,transition:e.transitions.create(`width`,{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:e})=>e.withLabel,style:{display:`block`,padding:0,height:11,fontSize:`0.75em`,visibility:`hidden`,maxWidth:.01,transition:e.transitions.create(`max-width`,{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:`nowrap`,"& > span":{paddingLeft:5,paddingRight:5,display:`inline-block`,opacity:0,visibility:`visible`}}},{props:({ownerState:e})=>e.withLabel&&e.notched,style:{maxWidth:`100%`,transition:e.transitions.create(`max-width`,{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function mx(e){let{children:t,classes:n,className:r,label:i,notched:a,...o}=e,s=i!=null&&i!==``,c={...e,notched:a,withLabel:s};return(0,z.jsx)(fx,{"aria-hidden":!0,className:r,ownerState:c,...o,children:(0,z.jsx)(px,{ownerState:c,children:s?(0,z.jsx)(`span`,{children:i}):dx||=(0,z.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:`​`})})})}var hx=e=>{let{classes:t}=e,n=W({root:[`root`],notchedOutline:[`notchedOutline`],input:[`input`]},vg,t);return{...t,...n}},gx=K(fg,{shouldForwardProp:e=>kf(e)||e===`classes`,name:`MuiOutlinedInput`,slot:`Root`,overridesResolver:lg})(Y(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{position:`relative`,borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${yg.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${yg.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${yg.focused} .${yg.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Wm()).map(([t])=>({props:{color:t},style:{[`&.${yg.focused} .${yg.notchedOutline}`]:{borderColor:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${yg.error} .${yg.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${yg.disabled} .${yg.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:14}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:14}},{props:({ownerState:e})=>e.multiline,style:{padding:`16.5px 14px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{padding:`8.5px 14px`}}]}})),_x=K(mx,{name:`MuiOutlinedInput`,slot:`NotchedOutline`})(Y(({theme:e})=>{let t=e.palette.mode===`light`?`rgba(0, 0, 0, 0.23)`:`rgba(255, 255, 255, 0.23)`;return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),vx=K(pg,{name:`MuiOutlinedInput`,slot:`Input`,overridesResolver:ug})(Y(({theme:e})=>({padding:`16.5px 14px`,"&:-webkit-autofill":{...!e.vars&&{WebkitBoxShadow:e.palette.mode===`light`?null:`0 0 0 100px #266798 inset`,WebkitTextFillColor:e.palette.mode===`light`?null:`#fff`,caretColor:e.palette.mode===`light`?null:`#fff`},borderRadius:`inherit`,...e.vars&&e.applyStyles(`dark`,{WebkitBoxShadow:`0 0 0 100px #266798 inset`,WebkitTextFillColor:`#fff`,caretColor:`#fff`})},variants:[{props:{size:`small`},style:{padding:`8.5px 14px`}},{props:({ownerState:e})=>e.multiline,style:{padding:0}},{props:({ownerState:e})=>e.startAdornment,style:{paddingLeft:0}},{props:({ownerState:e})=>e.endAdornment,style:{paddingRight:0}}]}))),yx=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiOutlinedInput`}),{fullWidth:r=!1,inputComponent:i=`input`,label:a,multiline:o=!1,notched:s,slots:c={},slotProps:l={},type:u=`text`,...d}=n,f=hx(n),[p,m]=eg({props:n,states:[`color`,`disabled`,`error`,`focused`,`hiddenLabel`,`size`,`required`]}),h={...n,color:p.color||`primary`,disabled:p.disabled,error:p.error,focused:p.focused,formControl:m,fullWidth:r,hiddenLabel:p.hiddenLabel,multiline:o,size:p.size,type:u},g=c.root??gx,v=c.input??vx,[y,b]=X(`notchedOutline`,{elementType:_x,className:f.notchedOutline,shouldForwardComponentProp:!0,ownerState:h,externalForwardedProps:{slots:c,slotProps:l},additionalProps:{label:a!=null&&a!==``&&p.required?(0,z.jsxs)(_.Fragment,{children:[a,` `,`*`]}):a}});return(0,z.jsx)(hg,{slots:{root:g,input:v},slotProps:l,renderSuffix:e=>(0,z.jsx)(y,{...b,notched:s===void 0?!!(e.startAdornment||e.filled||e.focused):s}),fullWidth:r,inputComponent:i,multiline:o,ref:t,type:u,...d,classes:{...f,notchedOutline:null}})});yx.muiName=`Input`;function bx(e){return H(`MuiSelect`,e)}var xx=U(`MuiSelect`,[`root`,`select`,`multiple`,`filled`,`outlined`,`standard`,`disabled`,`focused`,`icon`,`iconOpen`,`nativeInput`,`error`]),Sx,Cx=2,wx=400,Tx=200;function Ex(e,t){if(!t)return!1;if(e.composedPath().includes(t)||e.target?.nodeType&&t.contains(e.target))return!0;let n=t.getBoundingClientRect();return n.width===0&&n.height===0?!1:e.clientX>=n.left-Cx&&e.clientX<=n.right+Cx&&e.clientY>=n.top-Cx&&e.clientY<=n.bottom+Cx}var Dx=K(ox,{name:`MuiSelect`,slot:`Select`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`&.${xx.select}`]:t.select},{[`&.${xx.select}`]:t[n.variant]},{[`&.${xx.error}`]:t.error},{[`&.${xx.multiple}`]:t.multiple}]}})({[`&.${xx.select}`]:{height:`auto`,minHeight:`1.4375em`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`}}),Ox=K(cx,{name:`MuiSelect`,slot:`Icon`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.icon,n.open&&t.iconOpen]}})({}),kx=K(`input`,{shouldForwardProp:e=>Of(e)&&e!==`classes`,name:`MuiSelect`,slot:`NativeInput`})({bottom:0,left:0,position:`absolute`,opacity:0,pointerEvents:`none`,width:`100%`,boxSizing:`border-box`}),Ax=e=>{let{classes:t,variant:n,disabled:r,multiple:i,open:a,error:o}=e;return W({select:[`select`,n,r&&`disabled`,i&&`multiple`,o&&`error`],icon:[`icon`,a&&`iconOpen`,r&&`disabled`],nativeInput:[`nativeInput`]},bx,t)},jx=_.forwardRef(function(e,t){let{"aria-describedby":n,"aria-label":r,autoFocus:i,autoWidth:a,children:o,className:s,defaultOpen:c,defaultValue:l,disabled:u,displayEmpty:d,error:f=!1,IconComponent:p,inputRef:m,labelId:h,MenuProps:g={},multiple:v,name:y,onBlur:b,onChange:x,onClose:S,onFocus:C,onKeyDown:w,onMouseDown:T,onOpen:E,open:D,readOnly:O,renderValue:k,required:A,SelectDisplayProps:j={},tabIndex:M,type:N,value:ee,variant:te=`standard`,...P}=e,[F,ne]=yp({controlled:ee,default:l,name:`Select`}),[re,ie]=yp({controlled:D,default:c,name:`Select`}),ae=_.useRef(null),I=_.useRef(null),L=_.useRef(null),oe=_.useRef(!1),se=_.useRef(!1),ce=_.useRef(null),le=_.useRef(!1),ue=_.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),de=$p(),R=$p(),[fe,pe]=_.useState(null),{current:me}=_.useRef(D!=null),[he,ge]=_.useState(),[_e,ve]=_.useState(null),ye=Cp(t,m),be=_.useCallback(e=>{I.current=e,e&&pe(e)},[]),xe=fe?.parentNode;_.useImperativeHandle(ye,()=>({focus:()=>{I.current.focus()},node:ae.current,value:F}),[F]);let Se=fe!==null&&re;gp(()=>{oe.current=Se},[Se]);let Ce=_.useCallback(()=>{de.clear(),R.clear()},[de,R]),we=_.useCallback(()=>{Ce(),le.current=!1,ue.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},[Ce]),Te=_.useCallback(()=>{ce.current&&=(ce.current(),null)},[]);_.useEffect(()=>{Se||(we(),Te())},[Se,we,Te]),_.useEffect(()=>()=>{we(),Te()},[we,Te]),_.useEffect(()=>{if(!Se||!xe||a||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{ge(xe.clientWidth)});return e.observe(xe),()=>{e.disconnect()}},[Se,xe,a]),_.useEffect(()=>{c&&re&&fe&&!me&&(ge(a?null:xe.clientWidth),I.current.focus())},[fe,a]),_.useEffect(()=>{i&&I.current.focus()},[i]),_.useEffect(()=>{if(!h)return;let e=fp(I.current).getElementById(h);if(e){let t=()=>{getSelection().isCollapsed&&I.current.focus()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}},[h]);let Ee=xp((e,t)=>{e||(we(),Te()),e?(ve(xb(t)),E&&E(t)):(ve(null),S&&S(t)),me||(oe.current=e,ge(a?null:xe.clientWidth),ie(e))}),De=()=>{we(),se.current?R.start(Tx,()=>{ue.current.allowUnselectedMouseUp=!0,de.start(Tx,()=>{ue.current.allowSelectedMouseUp=!0})}):de.start(wx,()=>{ue.current.allowSelectedMouseUp=!0,ue.current.allowUnselectedMouseUp=!0})},Oe=e=>{if(T?.(e),e.button!==0)return;e.preventDefault(),I.current.focus();let t=fp(e.currentTarget);De(),Te();let n=e=>{ce.current=null,I.current&&(Ex(e,I.current)||Ex(e,L.current)||!oe.current&&me||Ee(!1,e))};t.addEventListener(`mouseup`,n,{capture:!0,once:!0}),ce.current=()=>{t.removeEventListener(`mouseup`,n,!0)},Ee(!0,e)},ke=e=>{Ee(!1,e)},Ae=_.Children.toArray(o),je=e=>{let t=Ae.find(t=>t.props.value===e.target.value);t!==void 0&&(ne(t.props.value),x&&x(e,t))},Me=e=>t=>{le.current=!1;let n;if(t.currentTarget.hasAttribute(`tabindex`)){if(v){n=Array.isArray(F)?F.slice():[];let t=F.indexOf(e.props.value);t===-1?n.push(e.props.value):n.splice(t,1)}else n=e.props.value;if(e.props.onClick&&e.props.onClick(t),F!==n&&(ne(n),x)){let r=t.nativeEvent||t,i=new r.constructor(r.type,r);Object.defineProperty(i,"target",{writable:!0,value:{value:n,name:y}}),x(i,e)}v||Ee(!1,t)}},Ne=(e,t)=>n=>{if(e.props.onMouseUp?.(n),le.current){le.current=!1;return}let r=!ue.current.allowSelectedMouseUp&&t,i=!ue.current.allowUnselectedMouseUp&&!t;r||i||n.currentTarget.click()},Pe=e=>{O||([` `,`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),Ee(!0,e)),w?.(e))},Fe=e=>{!Se&&b&&(Object.defineProperty(e,"target",{writable:!0,value:{value:F,name:y}}),b(e))};delete P[`aria-invalid`];let Ie,Le,Re=[],ze=!1,Be=!1;(ng({value:F})||d)&&(k?Ie=k(F):ze=!0);let Ve=Ae.map(e=>{if(!_.isValidElement(e))return null;let t;if(v){if(!Array.isArray(F))throw Error(ma(2));t=F.some(t=>Cb(t,e.props.value)),t&&ze&&Re.push(e.props.children)}else t=Cb(F,e.props.value),t&&ze&&(Le=e.props.children);return t&&(Be=!0),_.cloneElement(e,{"aria-selected":t?`true`:`false`,onMouseDown:t=>{le.current=!0,e.props.onMouseDown?.(t)},onPointerDown:t=>{le.current=!0,e.props.onPointerDown?.(t)},onClick:Me(e),onMouseUp:Ne(e,t),onKeyUp:t=>{t.key===` `&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:`option`,selected:t,value:void 0,"data-value":e.props.value})});gp(()=>{se.current=Be},[Be]),ze&&(Ie=v?Re.length===0?null:Re.reduce((e,t,n)=>(e.push(t),n{let{classes:t}=e,n=W({root:[`root`]},bx,t);return{...t,...n}},Nx={name:`MuiSelect`,slot:`Root`,shouldForwardProp:e=>kf(e)&&e!==`variant`},Px=K(hy,Nx)(``),Fx=K(yx,Nx)(``),Ix=K(Iv,Nx)(``),Lx=_.forwardRef(function(e,t){let n=q({name:`MuiSelect`,props:e}),{autoWidth:r=!1,children:i,classes:a={},className:o,defaultOpen:s=!1,displayEmpty:c=!1,IconComponent:l=Sg,id:u,input:d,inputProps:f,label:p,labelId:m,MenuProps:h,multiple:g=!1,native:v=!1,onClose:y,onOpen:b,open:x,renderValue:S,SelectDisplayProps:C,variant:w=`outlined`,...T}=n,E=v?ux:jx,[D]=eg({props:n,states:[`variant`,`error`]}),O=D.variant||w,k={...n,variant:O,classes:a},A=Mx(k),{root:j,...M}=A,N=d||{standard:(0,z.jsx)(Px,{ownerState:k}),outlined:(0,z.jsx)(Fx,{label:p,ownerState:k}),filled:(0,z.jsx)(Ix,{ownerState:k})}[O],ee=Cp(t,Ih(N));return(0,z.jsx)(_.Fragment,{children:_.cloneElement(N,{inputComponent:E,inputProps:{children:i,error:D.error,IconComponent:l,variant:O,type:void 0,multiple:g,...v?{id:u}:{autoWidth:r,defaultOpen:s,displayEmpty:c,labelId:m,MenuProps:h,onClose:y,onOpen:b,open:x,renderValue:S,SelectDisplayProps:{id:u,...C}},...f,classes:f?Ls(M,f.classes):M,...d?d.props.inputProps:{}},...(g&&v||c)&&O===`outlined`?{notched:!0}:{},ref:ee,className:V(N.props.className,o,A.root),...!d&&{variant:O},...T})})});Lx.muiName=`Select`;function Rx(e){return H(`MuiTab`,e)}var zx=U(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`icon`]),Bx=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return W({root:[`root`,a&&o&&`labelIcon`,`textColor${J(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`icon`]},Rx,t)},Vx=K(Bm,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${J(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${zx.icon}`]:t.icon}]}})(Y(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:`relative`,minHeight:48,flexShrink:0,padding:`12px 16px`,overflow:`hidden`,whiteSpace:`normal`,textAlign:`center`,lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition===`top`||e.iconPosition===`bottom`),style:{flexDirection:`column`}},{props:({ownerState:e})=>e.label&&e.iconPosition!==`top`&&e.iconPosition!==`bottom`,style:{flexDirection:`row`}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`top`,style:{[`& > .${zx.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${zx.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${zx.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${zx.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${zx.selected}`]:{opacity:1},[`&.${zx.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${zx.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${zx.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${zx.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${zx.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:`none`}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Hx=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiTab`}),{className:r,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:o,icon:s,iconPosition:c=`top`,indicator:l,label:u,onChange:d,onClick:f,onFocus:p,selected:m,selectionFollowsFocus:h,textColor:g=`inherit`,value:v,wrapped:y=!1,...b}=n,x=Zy(),S=nb({id:v,ref:t,disabled:i,selected:m}),C=x.getItemMap().size===0&&m?0:S.tabIndex,w={...n,disabled:i,disableFocusRipple:a,selected:m,icon:!!s,iconPosition:c,label:!!u,fullWidth:o,textColor:g,wrapped:y},T=Bx(w),E=s&&u&&_.isValidElement(s)?_.cloneElement(s,{className:V(T.icon,s.props.className)}):s;return(0,z.jsxs)(Vx,{internalNativeButton:!0,focusRipple:!a,className:V(T.root,r),ref:S.ref,role:`tab`,"aria-selected":m,disabled:i,onClick:e=>{!m&&d&&d(e,v),f&&f(e)},onFocus:e=>{h&&!m&&d&&d(e,v),p&&p(e)},tabIndex:C,ownerState:w,...b,children:[c===`top`||c===`start`?(0,z.jsxs)(_.Fragment,{children:[E,u]}):(0,z.jsxs)(_.Fragment,{children:[u,E]}),l]})});function Ux(e){return H(`MuiToolbar`,e)}U(`MuiToolbar`,[`root`,`gutters`,`regular`,`dense`]);var Wx=e=>{let{classes:t,disableGutters:n,variant:r}=e;return W({root:[`root`,!n&&`gutters`,r]},Ux,t)},Gx=K(`div`,{name:`MuiToolbar`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Y(({theme:e})=>({position:`relative`,display:`flex`,alignItems:`center`,variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up(`sm`)]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:`dense`},style:{minHeight:48}},{props:{variant:`regular`},style:e.mixins.toolbar}]}))),Kx=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiToolbar`}),{className:r,component:i=`div`,disableGutters:a=!1,variant:o=`regular`,...s}=n,c={...n,component:i,disableGutters:a,variant:o};return(0,z.jsx)(Gx,{as:i,className:V(Wx(c).root,r),ref:t,ownerState:c,...s})}),qx=ap((0,z.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),Jx=ap((0,z.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function Yx(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function Xx(e,t,n,r={},i=()=>{}){let{ease:a=Yx,duration:o=300}=r,s=null,c=t[e],l=!1,u=()=>{l=!0},d=r=>{if(l){i(Error(`Animation cancelled`));return}s===null&&(s=r);let u=Math.min(1,(r-s)/o);if(t[e]=a(u)*(n-c)+c,u>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return c===n?(i(Error(`Element already at target position`)),u):(requestAnimationFrame(d),u)}var Zx={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`,pointerEvents:`none`};function Qx(e){let{onChange:t,...n}=e,r=_.useRef(),i=_.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return gp(()=>{let e=sp(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=mp(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),_.useEffect(()=>{a(),t(r.current)},[t]),(0,z.jsx)(`div`,{style:Zx,...n,ref:i})}function $x(e){return H(`MuiTabScrollButton`,e)}var eS=U(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),tS=e=>{let{classes:t,orientation:n,disabled:r}=e;return W({root:[`root`,n,r&&`disabled`]},$x,t)},nS=K(Bm,{name:`MuiTabScrollButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${eS.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),rS=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,{nativeButton:u,...d}=l,f=mu(),p={isRtl:f,...n},m=tS(p),h=i.StartScrollButtonIcon??qx,g=i.EndScrollButtonIcon??Jx,_=Fh({elementType:h,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:p}),v=Fh({elementType:g,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:p});return(0,z.jsx)(nS,{component:`div`,className:V(m.root,r),ref:t,role:null,ownerState:p,tabIndex:null,...d,style:{...d.style,...s===`vertical`&&{"--TabScrollButton-svgRotate":`rotate(${f?-90:90}deg)`}},children:o===`left`?(0,z.jsx)(h,{..._}):(0,z.jsx)(g,{...v})})});function iS(e){return H(`MuiTabs`,e)}var aS=U(`MuiTabs`,[`root`,`vertical`,`list`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),oS=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return W({root:[`root`,t&&`vertical`],scroller:[`scroller`,n&&`fixed`,r&&`hideScrollbar`,i&&`scrollableX`,a&&`scrollableY`],list:[`list`,t&&`vertical`,o&&`centered`],indicator:[`indicator`],scrollButtons:[`scrollButtons`,s&&`scrollButtonsHideMobile`],scrollableX:[i&&`scrollableX`],hideScrollbar:[r&&`hideScrollbar`]},iS,c)},sS=K(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${aS.scrollButtons}`]:t.scrollButtons},{[`& .${aS.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(Y(({theme:e})=>({overflow:`hidden`,minHeight:48,WebkitOverflowScrolling:`touch`,display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${aS.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),cS=K(`div`,{name:`MuiTabs`,slot:`Scroller`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:`relative`,display:`inline-block`,flex:`1 1 auto`,whiteSpace:`nowrap`,variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:`hidden`,width:`100%`}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:`auto`,overflowY:`hidden`}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:`auto`,overflowX:`hidden`}}]}),lS=K(`div`,{name:`MuiTabs`,slot:`List`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,n.centered&&t.centered]}})({display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.centered,style:{justifyContent:`center`}}]}),uS=K(`span`,{name:`MuiTabs`,slot:`Indicator`})(Y(({theme:e})=>({position:`absolute`,height:2,bottom:0,width:`100%`,transition:e.transitions.create(),variants:[{props:{indicatorColor:`primary`},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:`secondary`},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:`100%`,width:2,right:0}}]}))),dS=K(Qx)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),fS={},pS=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiTabs`}),r=Df(),i=mu(),{"aria-label":a,"aria-labelledby":o,action:s,centered:c=!1,children:l,className:u,component:d=`div`,allowScrollButtonsMobile:f=!1,indicatorColor:p=`primary`,onChange:m,orientation:h=`horizontal`,scrollButtons:g=`auto`,selectionFollowsFocus:v,slots:y={},slotProps:b={},textColor:x=`primary`,value:S,variant:C=`standard`,visibleScrollbar:w=!1,...T}=n,E=C===`scrollable`,D=h===`vertical`,O=D?`scrollTop`:`scrollLeft`,k=D?`top`:`left`,A=D?`bottom`:`right`,j=D?`clientHeight`:`clientWidth`,M=D?`height`:`width`,N={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:p,orientation:h,vertical:D,scrollButtons:g,textColor:x,variant:C,visibleScrollbar:w,fixed:!E,hideScrollbar:E&&!w,scrollableX:E&&!D,scrollableY:E&&D,centered:c&&!E,scrollButtonsHideMobile:!f},ee=oS(N),te=Fh({elementType:y.startScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:N}),P=Fh({elementType:y.endScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:N}),[F,ne]=_.useState(!1),[re,ie]=_.useState(fS),[ae,I]=_.useState(!1),[L,oe]=_.useState(!1),[se,ce]=_.useState(!1),le=S===!1?null:S,[ue,de]=_.useState(!1),[R,fe]=_.useState({overflow:`hidden`,scrollbarWidth:0}),pe=new Map,me=_.useRef(null),he=_.useRef(null),ge={slots:y,slotProps:b},_e=()=>{let e=me.current,t;if(e){let n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let n;if(e&&S!==!1){let e=he.current.children;if(e.length>0){let t=e[pe.get(S)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},ve=xp(()=>{let{tabsMeta:e,tabMeta:t}=_e(),n=0,r;D?(r=`top`,t&&e&&(n=t.top-e.top+e.scrollTop)):(r=i?`right`:`left`,t&&e&&(n=(i?-1:1)*(t[r]-e[r]+e.scrollLeft)));let a={[r]:n,[M]:t?t[M]:0};if(typeof re[r]!=`number`||typeof re[M]!=`number`)ie(a);else{let e=Math.abs(re[r]-a[r]),t=Math.abs(re[M]-a[M]);(e>=1||t>=1)&&ie(a)}}),ye=(e,{animation:t=!0}={})=>{t?Xx(O,me.current,e,{duration:r.transitions.duration.standard}):me.current[O]=e},be=e=>{let t=me.current[O];D?t+=e:t+=e*(i?-1:1),ye(t)},xe=()=>{let e=me.current[j],t=0,n=Array.from(he.current.children);for(let r=0;re){r===0&&(t=e);break}t+=i[j]}return t},Se=()=>{be(-1*xe())},Ce=()=>{be(xe())},[we,{onChange:Te,...Ee}]=X(`scrollbar`,{className:V(ee.scrollableX,ee.hideScrollbar),elementType:dS,shouldForwardComponentProp:!0,externalForwardedProps:ge,ownerState:N}),De=_.useCallback(e=>{Te?.(e),fe({overflow:null,scrollbarWidth:e})},[Te]),[Oe,ke]=X(`scrollButtons`,{className:ee.scrollButtons,elementType:rS,externalForwardedProps:ge,ownerState:N,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon},slotProps:{startScrollButtonIcon:te,endScrollButtonIcon:P}}}),Ae=()=>{let e={};e.scrollbarSizeListener=E?(0,z.jsx)(we,{...Ee,onChange:De}):null;let t=E&&(g===`auto`&&(ae||L)||g===!0);return e.scrollButtonStart=t?(0,z.jsx)(Oe,{direction:i?`right`:`left`,onClick:Se,disabled:!ae,...ke}):null,e.scrollButtonEnd=t?(0,z.jsx)(Oe,{direction:i?`left`:`right`,onClick:Ce,disabled:!L,...ke}):null,e},je=xp(e=>{let{tabsMeta:t,tabMeta:n}=_e();!n||!t||(n[k]t[A]&&ye(t[O]+(n[A]-t[A]),{animation:e}))}),Me=xp(()=>{E&&g!==!1&&ce(!se)});_.useEffect(()=>{let e=sp(()=>{me.current&&ve()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Me()},r=mp(me.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(he.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(he.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[ve,Me]),_.useEffect(()=>{let e=Array.from(he.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&E&&g!==!1){let n=e[0],r=e[t-1],i={root:me.current,threshold:.99},a=new IntersectionObserver(e=>{I(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{oe(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[E,g,se,l?.length]),_.useEffect(()=>{ne(!0)},[]),_.useEffect(()=>{ve()}),_.useEffect(()=>{je(fS!==re)},[je,re]),_.useImperativeHandle(s,()=>({updateIndicator:ve,updateScrollButtons:Me}),[ve,Me]);let[Ne,Pe]=X(`indicator`,{className:ee.indicator,elementType:uS,externalForwardedProps:ge,ownerState:N,additionalProps:{style:re}}),Fe=(0,z.jsx)(Ne,{...Pe}),Ie=tb({activeItemId:ue?void 0:le,orientation:h,isRtl:i}),Le=Ie.getContainerProps(),Re=_.Children.toArray(l).filter(_.isValidElement).map((e,t)=>{let n=e.props.value===void 0?t:e.props.value;return pe.set(n,t),{child:e,index:t,childValue:n}}).map(({child:e,childValue:t})=>{let n=t===S;return _.cloneElement(e,{fullWidth:C===`fullWidth`,indicator:n&&!F&&Fe,selected:n,selectionFollowsFocus:v,onChange:m,textColor:x,value:t})}),ze=Ae(),[Be,Ve]=X(`root`,{ref:t,className:V(ee.root,u),elementType:sS,externalForwardedProps:{...ge,...T,component:d},ownerState:N}),[He,Ue]=X(`scroller`,{ref:me,className:ee.scroller,elementType:cS,externalForwardedProps:ge,ownerState:N,additionalProps:{style:{overflow:R.overflow,[D?`margin${i?`Left`:`Right`}`:`marginBottom`]:w?void 0:-R.scrollbarWidth}}}),We=Cp(Le.ref,he),Ge=e=>{let t=he.current;up(fp(t))?.getAttribute(`role`)===`tab`&&Le.onKeyDown(e)},[Ke,qe]=X(`list`,{ref:We,className:ee.list,elementType:lS,externalForwardedProps:ge,ownerState:N,getSlotProps:e=>({...e,onBlur:t=>{w_(t.currentTarget,t.relatedTarget)||de(!1),e.onBlur?.(t)},onKeyDown:t=>{Ge(t),e.onKeyDown?.(t)},onFocus:t=>{de(!0),Le.onFocus(t),e.onFocus?.(t)}})});return(0,z.jsxs)(Be,{...Ve,children:[ze.scrollButtonStart,ze.scrollbarSizeListener,(0,z.jsxs)(He,{...Ue,children:[(0,z.jsx)(Ke,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...qe,children:(0,z.jsx)(Xy.Provider,{value:Ie,children:Re})}),F&&Fe]}),ze.scrollButtonEnd]})});function mS(e){return H(`MuiTextField`,e)}U(`MuiTextField`,[`root`]);var hS={standard:hy,filled:Iv,outlined:yx},gS=e=>{let{classes:t}=e;return W({root:[`root`]},mS,t)},_S=K(Bv,{name:`MuiTextField`,slot:`Root`})({}),vS=_.forwardRef(function(e,t){let n=q({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,fullWidth:d=!1,helperText:f,id:p,inputRef:m,label:h,maxRows:g,minRows:_,multiline:v=!1,name:y,onBlur:b,onChange:x,onFocus:S,placeholder:C,required:w=!1,rows:T,select:E=!1,slots:D={},slotProps:O={},type:k,value:A,variant:j=`outlined`,...M}=n,N={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:d,multiline:v,required:w,select:E,variant:j},ee=gS(N),te=Su(p),P=f&&te?`${te}-helper-text`:void 0,F=h&&te?`${te}-label`:void 0,ne=hS[j],re={slots:D,slotProps:O},[ie,ae]=X(`select`,{elementType:Lx,externalForwardedProps:re,ownerState:N}),I=E&&ae.native,L={},oe=re.slotProps.inputLabel;j===`outlined`&&(oe&&oe.shrink!==void 0&&(L.notched=oe.shrink),L.label=h),E&&(I||(L.id=void 0),L[`aria-describedby`]=void 0);let[se,ce]=X(`root`,{elementType:_S,shouldForwardComponentProp:!0,externalForwardedProps:{...re,...M},ownerState:N,className:V(ee.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:d,required:w,color:s,variant:j}}),[le,ue]=X(`input`,{elementType:ne,externalForwardedProps:re,additionalProps:L,ownerState:N}),[de,R]=X(`inputLabel`,{elementType:vy,externalForwardedProps:re,ownerState:N}),[fe,pe]=X(`htmlInput`,{elementType:`input`,externalForwardedProps:re,ownerState:N}),[me,he]=X(`formHelperText`,{elementType:Qv,externalForwardedProps:re,ownerState:N}),ge=(0,z.jsx)(le,{"aria-describedby":P,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:d,multiline:v,name:y,rows:T,maxRows:g,minRows:_,type:k,value:A,id:te,inputRef:m,onBlur:b,onChange:x,onFocus:S,placeholder:C,inputProps:pe,slots:{input:D.htmlInput?fe:void 0},...ue});return(0,z.jsxs)(se,{...ce,children:[h!=null&&h!==``&&(0,z.jsx)(de,{htmlFor:E&&!I?void 0:te,id:F,...E&&!I&&{component:`div`},...R,children:h}),E?(0,z.jsx)(ie,{"aria-describedby":P,id:te,labelId:F,value:A,input:ge,...ae,children:a}):ge,f&&(0,z.jsx)(me,{id:P,...he,children:f})]})}),yS=ap((0,z.jsx)(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`ChevronLeft`),bS=ap((0,z.jsx)(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),xS=ap((0,z.jsx)(`path`,{d:`M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6c3.31 0 6 2.69 6 6s-2.69 6-6 6`}),`Brightness4`),SS=ap((0,z.jsx)(`path`,{d:`M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4`}),`Brightness7`);function CS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);ie?(...t)=>e(...t):(...e)=>fetch(...e),ES=class extends Error{constructor(e,t=`FunctionsError`,n){super(e),this.name=t,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}},DS=class extends ES{constructor(e){super(`Failed to send a request to the Edge Function`,`FunctionsFetchError`,e)}},OS=class extends ES{constructor(e){super(`Relay Error invoking the Edge Function`,`FunctionsRelayError`,e)}},kS=class extends ES{constructor(e){super(`Edge Function returned a non-2xx status code`,`FunctionsHttpError`,e)}},AS;(function(e){e.Any=`any`,e.ApNortheast1=`ap-northeast-1`,e.ApNortheast2=`ap-northeast-2`,e.ApSouth1=`ap-south-1`,e.ApSoutheast1=`ap-southeast-1`,e.ApSoutheast2=`ap-southeast-2`,e.CaCentral1=`ca-central-1`,e.EuCentral1=`eu-central-1`,e.EuWest1=`eu-west-1`,e.EuWest2=`eu-west-2`,e.EuWest3=`eu-west-3`,e.SaEast1=`sa-east-1`,e.UsEast1=`us-east-1`,e.UsWest1=`us-west-1`,e.UsWest2=`us-west-2`})(AS||={});var jS=class{constructor(e,{headers:t={},customFetch:n,region:r=AS.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=TS(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return wS(this,arguments,void 0,function*(e,t={}){let n,r;try{let{headers:i,method:a,body:o,signal:s,timeout:c}=t,l={},{region:u}=t;u||=this.region;let d=new URL(`${this.url}/${e}`);u&&u!==`any`&&(l[`x-region`]=u,d.searchParams.set(`forceFunctionRegion`,u));let f;o&&(i&&!Object.prototype.hasOwnProperty.call(i,`Content-Type`)||!i)?typeof Blob<`u`&&o instanceof Blob||o instanceof ArrayBuffer?(l[`Content-Type`]=`application/octet-stream`,f=o):typeof o==`string`?(l[`Content-Type`]=`text/plain`,f=o):typeof FormData<`u`&&o instanceof FormData?f=o:(l[`Content-Type`]=`application/json`,f=JSON.stringify(o)):f=o&&typeof o!=`string`&&!(typeof Blob<`u`&&o instanceof Blob)&&!(o instanceof ArrayBuffer)&&!(typeof FormData<`u`&&o instanceof FormData)?JSON.stringify(o):o;let p=s;c&&(r=new AbortController,n=setTimeout(()=>r.abort(),c),s?(p=r.signal,s.addEventListener(`abort`,()=>r.abort())):p=r.signal);let m=yield this.fetch(d.toString(),{method:a||`POST`,headers:Object.assign(Object.assign(Object.assign({},l),this.headers),i),body:f,signal:p}).catch(e=>{throw new DS(e)}),h=m.headers.get(`x-relay-error`);if(h&&h===`true`)throw new OS(m);if(!m.ok)throw new kS(m);let g=(m.headers.get(`Content-Type`)??`text/plain`).split(`;`)[0].trim(),_;return _=g===`application/json`?yield m.json():g===`application/octet-stream`||g===`application/pdf`?yield m.blob():g===`text/event-stream`?m:g===`multipart/form-data`?yield m.formData():yield m.text(),{data:_,error:null,response:m}}catch(e){return{data:null,error:e,response:e instanceof kS||e instanceof OS?e.context:void 0}}finally{n&&clearTimeout(n)}})}},MS=3,NS=e=>Math.min(1e3*2**e,3e4),PS=[520,503],FS=[`GET`,`HEAD`,`OPTIONS`],IS=class extends Error{constructor(e){super(e.message),this.name=`PostgrestError`,this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function LS(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);function i(){clearTimeout(r),n()}t?.addEventListener(`abort`,i)})}function RS(e,t,n,r){return!(!r||n>=MS||!FS.includes(e)||!PS.includes(t))}var zS=class{constructor(e){this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError??!1,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle??!1,this.shouldStripNulls=e.shouldStripNulls??!1,this.urlLengthLimit=e.urlLengthLimit??8e3,this.retryEnabled=e.retry??!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get(`Accept`)===`text/csv`)throw Error(`stripNulls() cannot be used with csv()`);return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var n=this;if(this.schema===void 0||([`GET`,`HEAD`].includes(this.method)?this.headers.set(`Accept-Profile`,this.schema):this.headers.set(`Content-Profile`,this.schema)),this.method!==`GET`&&this.method!==`HEAD`&&this.headers.set(`Content-Type`,`application/json`),this.shouldStripNulls){let e=this.headers.get(`Accept`);e===`application/vnd.pgrst.object+json`?this.headers.set(`Accept`,`application/vnd.pgrst.object+json;nulls=stripped`):(!e||e===`application/json`)&&this.headers.set(`Accept`,`application/vnd.pgrst.array+json;nulls=stripped`)}let r=this.fetch,i=(async()=>{let e=0;for(;;){let t=new Headers(n.headers);e>0&&t.set(`X-Retry-Count`,String(e));let i;try{i=await r(n.url.toString(),{method:n.method,headers:t,body:JSON.stringify(n.body,(e,t)=>typeof t==`bigint`?t.toString():t),signal:n.signal})}catch(t){if(t?.name===`AbortError`||t?.code===`ABORT_ERR`||!FS.includes(n.method))throw t;if(n.retryEnabled&&e{let t=``,n=``,r=``,i=e?.cause;if(i){let n=i?.message??``,r=i?.code??``;t=`${e?.name??`FetchError`}: ${e?.message}`,t+=`\n\nCaused by: ${i?.name??`Error`}: ${n}`,r&&(t+=` (${r})`),i?.stack&&(t+=`\n${i.stack}`)}else t=e?.stack??``;let a=this.url.toString().length;return e?.name===`AbortError`||e?.code===`ABORT_ERR`?(r=``,n=`Request was aborted (timeout or manual cancellation)`,a>this.urlLengthLimit&&(n+=`. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):(i?.name===`HeadersOverflowError`||i?.code===`UND_ERR_HEADERS_OVERFLOW`)&&(r=``,n=`HTTP headers exceeded server limits (typically 16KB)`,a>this.urlLengthLimit&&(n+=`. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${e?.name??`FetchError`}: ${e?.message}`,details:t,hint:n,code:r},data:null,count:null,status:0,statusText:``}})),i.then(e,t)}async processResponse(e){var t=this;let n=null,r=null,i=null,a=e.status,o=e.statusText;if(e.ok){if(t.method!==`HEAD`){let n=await e.text();n===``||(r=t.headers.get(`Accept`)===`text/csv`||t.headers.get(`Accept`)&&t.headers.get(`Accept`)?.includes(`application/vnd.pgrst.plan+text`)?n:JSON.parse(n))}let s=t.headers.get(`Prefer`)?.match(/count=(exact|planned|estimated)/),c=e.headers.get(`content-range`)?.split(`/`);s&&c&&c.length>1&&(i=parseInt(c[1])),t.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:`PGRST116`,details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:`JSON object requested, multiple (or no) rows returned`},r=null,i=null,a=406,o=`Not Acceptable`):r=r.length===1?r[0]:null)}else{let i=await e.text();try{n=JSON.parse(i),Array.isArray(n)&&e.status===404&&(r=[],n=null,a=200,o=`OK`)}catch{e.status===404&&i===``?(a=204,o=`No Content`):n={message:i}}if(n&&t.shouldThrowOnError)throw new IS(n)}return{success:n===null,error:n,data:r,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},BS=class extends zS{select(e){let t=!1,n=(e??`*`).split(``).map(e=>/\s/.test(e)&&!t?``:(e===`"`&&(t=!t),e)).join(``);return this.url.searchParams.set(`select`,n),this.headers.append(`Prefer`,`return=representation`),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){let a=i?`${i}.order`:`order`,o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:``}${e}.${t?`asc`:`desc`}${n===void 0?``:n?`.nullsfirst`:`.nullslast`}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){let r=n===void 0?`limit`:`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){let i=r===void 0?`offset`:`${r}.offset`,a=r===void 0?`limit`:`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set(`Accept`,`application/vnd.pgrst.object+json`),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set(`Accept`,`text/csv`),this}geojson(){return this.headers.set(`Accept`,`application/geo+json`),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:a=`text`}={}){let o=[e?`analyze`:null,t?`verbose`:null,n?`settings`:null,r?`buffers`:null,i?`wal`:null].filter(Boolean).join(`|`),s=this.headers.get(`Accept`)??`application/json`;return this.headers.set(`Accept`,`application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`),this}rollback(){return this.headers.append(`Prefer`,`tx=rollback`),this}returns(){return this}maxAffected(e){return this.headers.append(`Prefer`,`handling=strict`),this.headers.append(`Prefer`,`max-affected=${e}`),this}},VS=RegExp(`[,()]`),HS=class extends BS{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(`,`)}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(`,`)}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(`,`)}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(`,`)}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&VS.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){let n=Array.from(new Set(t)).map(e=>typeof e==`string`&&VS.test(e)?`"${e}"`:`${e}`).join(`,`);return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t==`string`?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(`,`)}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t==`string`?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(`,`)}}`),this}textSearch(e,t,{config:n,type:r}={}){let i=``;r===`plain`?i=`pl`:r===`phrase`?i=`ph`:r===`websearch`&&(i=`w`);let a=n===void 0?``:`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${t}`),this}match(e){return Object.entries(e).filter(([e,t])=>t!==void 0).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){let r=n?`${n}.or`:`or`;return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},US=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:i=8e3,retry:a}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){let{head:n=!1,count:r}=t??{},i=n?`HEAD`:`GET`,a=!1,o=(e??`*`).split(``).map(e=>/\s/.test(e)&&!a?``:(e===`"`&&(a=!a),e)).join(``),{url:s,headers:c}=this.cloneRequestState();return s.searchParams.set(`select`,o),r&&c.append(`Prefer`,`count=${r}`),new HS({method:i,url:s,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:n=!0}={}){let{url:r,headers:i}=this.cloneRequestState();if(t&&i.append(`Prefer`,`count=${t}`),n||i.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);r.searchParams.set(`columns`,e.join(`,`))}}return new HS({method:`POST`,url:r,headers:i,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){let{url:a,headers:o}=this.cloneRequestState();if(o.append(`Prefer`,`resolution=${n?`ignore`:`merge`}-duplicates`),t!==void 0&&a.searchParams.set(`on_conflict`,t),r&&o.append(`Prefer`,`count=${r}`),i||o.append(`Prefer`,`missing=default`),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);a.searchParams.set(`columns`,e.join(`,`))}}return new HS({method:`POST`,url:a,headers:o,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){let{url:n,headers:r}=this.cloneRequestState();return t&&r.append(`Prefer`,`count=${t}`),new HS({method:`PATCH`,url:n,headers:r,schema:this.schema,body:e,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){let{url:t,headers:n}=this.cloneRequestState();return e&&n.append(`Prefer`,`count=${e}`),new HS({method:`DELETE`,url:t,headers:n,schema:this.schema,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function WS(e){"@babel/helpers - typeof";return WS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},WS(e)}function GS(e,t){if(WS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(WS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function KS(e){var t=GS(e,`string`);return WS(t)==`symbol`?t:t+``}function qS(e,t,n){return(t=KS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function YS(e){for(var t=1;t0?this.fetch=(e,t)=>{let n=new AbortController,r=setTimeout(()=>n.abort(),i),a=t?.signal;if(a){if(a.aborted)return clearTimeout(r),s(e,t);let i=()=>{clearTimeout(r),n.abort()};return a.addEventListener(`abort`,i,{once:!0}),s(e,YS(YS({},t),{},{signal:n.signal})).finally(()=>{clearTimeout(r),a.removeEventListener(`abort`,i)})}return s(e,YS(YS({},t),{},{signal:n.signal})).finally(()=>clearTimeout(r))}:this.fetch=s,this.retry=o}from(e){if(!e||typeof e!=`string`||e.trim()===``)throw Error(`Invalid relation name: relation must be a non-empty string.`);return new US(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new e(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,t={},{head:n=!1,get:r=!1,count:i}={}){let a,o=new URL(`${this.url}/rpc/${e}`),s,c=e=>typeof e==`object`&&!!e&&(!Array.isArray(e)||e.some(c)),l=n&&Object.values(t).some(c);l?(a=`POST`,s=t):n||r?(a=n?`HEAD`:`GET`,Object.entries(t).filter(([e,t])=>t!==void 0).map(([e,t])=>[e,Array.isArray(t)?`{${t.join(`,`)}}`:`${t}`]).forEach(([e,t])=>{o.searchParams.append(e,t)})):(a=`POST`,s=t);let u=new Headers(this.headers);return l?u.set(`Prefer`,i?`count=${i},return=minimal`:`return=minimal`):i&&u.set(`Prefer`,`count=${i}`),new HS({method:a,url:o,headers:u,schema:this.schemaName,body:s,fetch:this.fetch??fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}},ZS=class{constructor(){}static detectEnvironment(){if(typeof WebSocket<`u`)return{type:`native`,wsConstructor:WebSocket};let e=globalThis;if(typeof globalThis<`u`&&e.WebSocket!==void 0)return{type:`native`,wsConstructor:e.WebSocket};let t=typeof global<`u`?global:void 0;if(t&&t.WebSocket!==void 0)return{type:`native`,wsConstructor:t.WebSocket};if(typeof globalThis<`u`&&e.WebSocketPair!==void 0&&globalThis.WebSocket===void 0)return{type:`cloudflare`,error:`Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.`,workaround:`Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime.`};if(typeof globalThis<`u`&&e.EdgeRuntime||typeof navigator<`u`&&navigator.userAgent?.includes(`Vercel-Edge`))return{type:`unsupported`,error:`Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.`,workaround:`Use serverless functions or a different deployment target for WebSocket functionality.`};let n=globalThis.process;if(n){let e=n.versions;if(e&&e.node){let t=e.node,n=parseInt(t.replace(/^v/,``).split(`.`)[0]);return n>=22?globalThis.WebSocket===void 0?{type:`unsupported`,error:`Node.js ${n} detected but native WebSocket not found.`,workaround:`Provide a WebSocket implementation via the transport option.`}:{type:`native`,wsConstructor:globalThis.WebSocket}:{type:`unsupported`,error:`Node.js ${n} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: +import ws from "ws" +new RealtimeClient(url, { transport: ws })`}}}return{type:`unsupported`,error:`Unknown JavaScript runtime without WebSocket support.`,workaround:`Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation.`}}static getWebSocketConstructor(){let e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let t=e.error||`WebSocket not supported in this environment.`;throw e.workaround&&(t+=`\n\nSuggested solution: ${e.workaround}`),Error(t)}static isWebSocketSupported(){try{let e=this.detectEnvironment();return e.type===`native`||e.type===`ws`}catch{return!1}}},QS=`realtime-js/2.106.2`,$S=`1.0.0`,eC=`2.0.0`,tC=eC,nC=1e4,rC={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},iC={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`,access_token:`access_token`},aC={connecting:`connecting`,open:`open`,closing:`closing`,closed:`closed`},oC=class{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT=`broadcast`,this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,t){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event==`string`)return t(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){return this._isArrayBuffer(e.payload?.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){let t=e.payload?.payload??new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,t)}_encodeJsonUserBroadcastPush(e){let t=e.payload?.payload??{},n=new TextEncoder().encode(JSON.stringify(t)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,n)}_encodeUserBroadcastPush(e,t,n){let r=e.topic,i=e.ref??``,a=e.join_ref??``,o=e.payload.event,s=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},c=Object.keys(s).length===0?``:JSON.stringify(s);if(a.length>255)throw Error(`joinRef length ${a.length} exceeds maximum of 255`);if(i.length>255)throw Error(`ref length ${i.length} exceeds maximum of 255`);if(r.length>255)throw Error(`topic length ${r.length} exceeds maximum of 255`);if(o.length>255)throw Error(`userEvent length ${o.length} exceeds maximum of 255`);if(c.length>255)throw Error(`metadata length ${c.length} exceeds maximum of 255`);let l=this.USER_BROADCAST_PUSH_META_LENGTH+a.length+i.length+r.length+o.length+c.length,u=new ArrayBuffer(this.HEADER_LENGTH+l),d=new DataView(u),f=0;d.setUint8(f++,this.KINDS.userBroadcastPush),d.setUint8(f++,a.length),d.setUint8(f++,i.length),d.setUint8(f++,r.length),d.setUint8(f++,o.length),d.setUint8(f++,c.length),d.setUint8(f++,t),Array.from(a,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(i,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(r,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(o,e=>d.setUint8(f++,e.charCodeAt(0))),Array.from(c,e=>d.setUint8(f++,e.charCodeAt(0)));var p=new Uint8Array(u.byteLength+n.byteLength);return p.set(new Uint8Array(u),0),p.set(new Uint8Array(n),u.byteLength),p.buffer}decode(e,t){if(this._isArrayBuffer(e))return t(this._binaryDecode(e));if(typeof e==`string`){let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}return t({})}_binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,t,r)}}_decodeUserBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+4,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=e.slice(s,e.byteLength),f=o===this.JSON_ENCODING?JSON.parse(n.decode(d)):d,p={type:this.BROADCAST_EVENT,event:l,payload:f};return a>0&&(p.meta=JSON.parse(u)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(e){return e instanceof ArrayBuffer||e?.constructor?.name===`ArrayBuffer`}_pick(e,t){return!e||typeof e!=`object`?{}:Object.fromEntries(Object.entries(e).filter(([e])=>t.includes(e)))}},sC;(function(e){e.abstime=`abstime`,e.bool=`bool`,e.date=`date`,e.daterange=`daterange`,e.float4=`float4`,e.float8=`float8`,e.int2=`int2`,e.int4=`int4`,e.int4range=`int4range`,e.int8=`int8`,e.int8range=`int8range`,e.json=`json`,e.jsonb=`jsonb`,e.money=`money`,e.numeric=`numeric`,e.oid=`oid`,e.reltime=`reltime`,e.text=`text`,e.time=`time`,e.timestamp=`timestamp`,e.timestamptz=`timestamptz`,e.timetz=`timetz`,e.tsrange=`tsrange`,e.tstzrange=`tstzrange`})(sC||={});var cC=(e,t,n={})=>{let r=n.skipTypes??[];return t?Object.keys(t).reduce((n,i)=>(n[i]=lC(i,e,t,r),n),{}):{}},lC=(e,t,n,r)=>{let i=t.find(t=>t.name===e)?.type,a=n[e];return i&&!r.includes(i)?uC(i,a):dC(a)},uC=(e,t)=>{if(e.charAt(0)===`_`)return hC(t,e.slice(1,e.length));switch(e){case sC.bool:return fC(t);case sC.float4:case sC.float8:case sC.int2:case sC.int4:case sC.int8:case sC.numeric:case sC.oid:return pC(t);case sC.json:case sC.jsonb:return mC(t);case sC.timestamp:return gC(t);case sC.abstime:case sC.date:case sC.daterange:case sC.int4range:case sC.int8range:case sC.money:case sC.reltime:case sC.text:case sC.time:case sC.timestamptz:case sC.timetz:case sC.tsrange:case sC.tstzrange:return dC(t);default:return dC(t)}},dC=e=>e,fC=e=>{switch(e){case`t`:return!0;case`f`:return!1;default:return e}},pC=e=>{if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},mC=e=>{if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e},hC=(e,t)=>{if(typeof e!=`string`)return e;let n=e.length-1,r=e[n];if(e[0]===`{`&&r===`}`){let r,i=e.slice(1,n);try{r=JSON.parse(`[`+i+`]`)}catch{r=i?i.split(`,`):[]}return r.map(e=>uC(t,e))}return e},gC=e=>typeof e==`string`?e.replace(` `,`T`):e,_C=e=>{let t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,`http`),t.pathname=t.pathname.replace(/\/+$/,``).replace(/\/socket\/websocket$/i,``).replace(/\/socket$/i,``).replace(/\/websocket$/i,``),t.pathname===``||t.pathname===`/`?t.pathname=`/api/broadcast`:t.pathname+=`/api/broadcast`,t.href},vC=e=>typeof e==`function`?e:function(){return e},yC=typeof self<`u`?self:null,bC=typeof window<`u`?window:null,xC=yC||bC||globalThis,SC=`2.0.0`,CC=1e4,wC=1e3,TC={connecting:0,open:1,closing:2,closed:3},EC={closed:`closed`,errored:`errored`,joined:`joined`,joining:`joining`,leaving:`leaving`},DC={close:`phx_close`,error:`phx_error`,join:`phx_join`,reply:`phx_reply`,leave:`phx_leave`},OC={longpoll:`longpoll`,websocket:`websocket`},kC={complete:4},AC=`base64url.bearer.phx.`,jC=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived(`timeout`)||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger(`timeout`,{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},MC=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries+=1,this.callback()},this.timerCalc(this.tries+1))}},NC=class{constructor(e,t,n){this.state=EC.closed,this.topic=e,this.params=vC(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new jC(this,DC.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new MC(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive(`ok`,()=>{this.state=EC.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this.joinPush.receive(`error`,e=>{this.state=EC.errored,this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log(`channel`,`close ${this.topic}`),this.state=EC.closed,this.socket.remove(this)}),this.onError(e=>{this.socket.hasLogger()&&this.socket.log(`channel`,`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=EC.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive(`timeout`,()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`timeout ${this.topic}`,this.joinPush.timeout),new jC(this,DC.leave,vC({}),this.timeout).send(),this.state=EC.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(DC.reply,(e,t)=>{this.trigger(this.replyEventName(t),e)})}join(e=this.timeout){if(this.joinedOnce)throw Error(`tried to join multiple times. 'join' can only be called a single time per channel instance`);return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=EC.closed,this.bindings=[]}onClose(e){this.on(DC.close,e)}onError(e){return this.on(DC.error,t=>e(t))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter(n=>!(n.event===e&&(t===void 0||t===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t||={},!this.joinedOnce)throw Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new jC(this,e,function(){return t},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=EC.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log(`channel`,`leave ${this.topic}`),this.trigger(DC.close,`leave`)},n=new jC(this,DC.leave,vC({}),e);return n.receive(`ok`,()=>t()).receive(`timeout`,()=>t()),n.send(),this.canPush()||n.trigger(`ok`,{}),n}onMessage(e,t,n){return t}filterBindings(e,t,n){return!0}isMember(e,t,n,r){return this.topic===e?r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log(`channel`,`dropping outdated message`,{topic:e,event:t,payload:n,joinRef:r}),!1):!0:!1}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=EC.joining,this.joinPush.resend(e))}trigger(e,t,n,r){let i=this.onMessage(e,t,n,r);if(t&&!i)throw Error(`channel onMessage callbacks must return the payload, modified or unmodified`);let a=this.bindings.filter(r=>r.event===e&&this.filterBindings(r,t,n));for(let e=0;ec.abort(),i),s.signal=c.signal),xC.fetch(t,s).then(e=>e.text()).then(e=>this.parseJSON(e)).then(e=>o&&o(e)).catch(e=>{e.name===`AbortError`&&a?a():o&&o(null)}),c}static xdomainRequest(e,t,n,r,i,a,o){return e.timeout=i,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);o&&o(t)},a&&(e.ontimeout=a),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,i,a,o,s){e.open(t,n,!0),e.timeout=a;for(let[t,n]of Object.entries(r))e.setRequestHeader(t,n);return e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{e.readyState===kC.complete&&s&&s(this.parseJSON(e.responseText))},o&&(e.ontimeout=o),e.send(i),e}static parseJSON(e){if(!e||e===``)return null;try{return JSON.parse(e)}catch{return console&&console.log(`failed to parse JSON response`,e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=t?`${t}[${r}]`:r,a=e[r];typeof a==`object`?n.push(this.serialize(a,i)):n.push(encodeURIComponent(i)+`=`+encodeURIComponent(a))}return n.join(`&`)}static appendParams(e,t){return Object.keys(t).length===0?e:`${e}${e.match(/\?/)?`&`:`?`}${this.serialize(t)}`}},FC=e=>{let t=``,n=new Uint8Array(e),r=n.byteLength;for(let e=0;ethis.poll(),0)}normalizeEndpoint(e){return e.replace(`ws://`,`http://`).replace(`wss://`,`https://`).replace(RegExp(`(.*)/`+OC.websocket),`$1/`+OC.longpoll)}endpointURL(){return PC.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=TC.connecting}ontimeout(){this.onerror(`timeout`),this.closeAndRetry(1005,`timeout`,!1)}isActive(){return this.readyState===TC.open||this.readyState===TC.connecting}poll(){let e={Accept:`application/json`};this.authToken&&(e[`X-Phoenix-AuthToken`]=this.authToken),this.ajax(`GET`,e,null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:n,messages:r}=e;if(t===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,`session_gone`,!1);return}this.token=n}else t=0;switch(t){case 200:r.forEach(e=>{setTimeout(()=>this.onmessage({data:e}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=TC.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,`forbidden`,!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,`internal server error`,500);break;default:throw Error(`unhandled poll status ${t}`)}})}send(e){typeof e!=`string`&&(e=FC(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax(`POST`,{"Content-Type":`application/x-ndjson`},e.join(` +`),()=>this.onerror(`timeout`),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,`internal server error`,!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=TC.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<`u`?this.onclose(new CloseEvent(`close`,r)):this.onclose(r)}ajax(e,t,n,r,i){let a;a=PC.request(e,this.endpointURL(),t,n,this.timeout,()=>{this.reqs.delete(a),r()},e=>{this.reqs.delete(a),this.isActive()&&i(e)}),this.reqs.add(a)}},LC=class e{constructor(t,n={}){let r=n.events||{state:`presence_state`,diff:`presence_diff`};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.joinRef=this.channel.joinRef(),this.state=e.syncState(this.state,t,n,r),this.pendingDiffs.forEach(t=>{this.state=e.syncDiff(this.state,t,n,r)}),this.pendingDiffs=[],i()}),this.channel.on(r.diff,t=>{let{onJoin:n,onLeave:r,onSync:i}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(t):(this.state=e.syncDiff(this.state,t,n,r),i())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(t){return e.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,t,n,r){let i=this.clone(e),a={},o={};return this.map(i,(e,n)=>{t[e]||(o[e]=n)}),this.map(t,(e,t)=>{let n=i[e];if(n){let r=t.metas.map(e=>e.phx_ref),i=n.metas.map(e=>e.phx_ref),s=t.metas.filter(e=>i.indexOf(e.phx_ref)<0),c=n.metas.filter(e=>r.indexOf(e.phx_ref)<0);s.length>0&&(a[e]=t,a[e].metas=s),c.length>0&&(o[e]=this.clone(n),o[e].metas=c)}else a[e]=t}),this.syncDiff(i,{joins:a,leaves:o},n,r)}static syncDiff(e,t,n,r){let{joins:i,leaves:a}=this.clone(t);return n||=function(){},r||=function(){},this.map(i,(t,r)=>{let i=e[t];if(e[t]=this.clone(r),i){let n=e[t].metas.map(e=>e.phx_ref),r=i.metas.filter(e=>n.indexOf(e.phx_ref)<0);e[t].metas.unshift(...r)}n(t,i,r)}),this.map(a,(t,n)=>{let i=e[t];if(!i)return;let a=n.metas.map(e=>e.phx_ref);i.metas=i.metas.filter(e=>a.indexOf(e.phx_ref)<0),r(t,i,n),i.metas.length===0&&delete e[t]}),e}static list(e,t){return t||=function(e,t){return t},this.map(e,(e,n)=>t(e,n))}static map(e,t){return Object.getOwnPropertyNames(e).map(n=>t(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},RC={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,i,a,o]=JSON.parse(e);return t({join_ref:n,ref:r,topic:i,event:a,payload:o})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:i,payload:a}=e,o=this.META_LENGTH+t.length+n.length+i.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,i.length),c.setUint8(l++,r.length),Array.from(t,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(n,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(i,e=>c.setUint8(l++,e.charCodeAt(0))),Array.from(r,e=>c.setUint8(l++,e.charCodeAt(0)));var u=new Uint8Array(s.byteLength+a.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(a),s.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(o,o+r));o+=r;let c=n.decode(e.slice(o,o+i));o+=i;let l=n.decode(e.slice(o,o+a));return o+=a,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(o,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=t.getUint8(3),o=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+i));s+=i;let u=n.decode(e.slice(s,s+a));s+=a;let d=n.decode(e.slice(s,s+o));s+=o;let f={status:d,response:e.slice(s,e.byteLength)};return{join_ref:c,ref:l,topic:u,event:DC.reply,payload:f}},decodeBroadcast(e,t,n){let r=t.getUint8(1),i=t.getUint8(2),a=this.HEADER_LENGTH+2,o=n.decode(e.slice(a,a+r));a+=r;let s=n.decode(e.slice(a,a+i));return a+=i,{join_ref:null,ref:null,topic:o,event:s,payload:e.slice(a,e.byteLength)}}},zC=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||CC,this.transport=t.transport||xC.WebSocket||IC,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=xC&&xC.sessionStorage}catch{}this.sessionStore=t.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=RC.encode.bind(RC),this.defaultDecoder=RC.decode.bind(RC),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||`arraybuffer`,this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport===IC?(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder):(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder);let r=null;bC&&bC.addEventListener&&(bC.addEventListener(`pagehide`,e=>{this.conn&&(this.disconnect(),r=this.connectClock)}),bC.addEventListener(`pageshow`,e=>{r===this.connectClock&&(r=null,this.connect())}),bC.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=vC(t.params||{}),this.endPoint=`${e}/${OC.websocket}`,this.vsn=t.vsn||SC,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new MC(()=>{if(this.pageHidden){this.log(`Not reconnecting as page is hidden!`),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return IC}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&=(this.conn.close(),null),this.transport=e}protocol(){return location.protocol.match(/^https/)?`wss`:`ws`}endPointURL(){let e=PC.appendParams(PC.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)===`/`?e.charAt(1)===`/`?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`:e}disconnect(e,t,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,n)}connect(e){e&&(console&&console.log(`passing params to connect is deprecated. Instead pass :params to the Socket constructor`),this.params=vC(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==IC?this.connectWithFallback(IC,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:t});let r=this.onMessage(i=>{i.ref===t&&(this.off([r]),e(Date.now()-n))});return!0}transportName(e){switch(e){case IC:return`LongPoll`;default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=[`phoenix`,`${AC}${btoa(this.authToken).replace(/=/g,``)}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,i,a=this.transportName(e),o=t=>{this.log(`transport`,`falling back to ${a}...`,t),this.off([void 0,i]),r=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o(`memorized`);this.fallbackTimer=setTimeout(o,t),i=this.onError(e=>{this.log(`transport`,`error`,e),r&&!n&&(clearTimeout(this.fallbackTimer),o(e))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let t=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${t}`,`true`),this.log(`transport`,`established ${t} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,t),this.ping(e=>{this.log(`transport`,`connected to primary after`,e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log(`transport`,`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks(`open`)}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log(`transport`,`heartbeat timeout. Attempting to re-establish connection`);try{this.heartbeatCallback(`timeout`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.triggerChanError(Error(`heartbeat timeout`)),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),wC,`heartbeat timeout`)}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();let r=this.conn;this.waitForBufferDone(r,()=>{t?r.close(t,n||``):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,n=1){if(n===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,n+1)},150*n)}waitForSocketClosed(e,t,n=1){if(n===5||e.readyState===TC.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,n+1)},150*n)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log(`transport`,`close`,e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks(`close`,e)}onConnError(e){this.hasLogger()&&this.log(`transport`,`error`,e);let t=this.transport,n=this.establishedConnections;this.triggerStateCallbacks(`error`,e,t,n),(t===this.transport||n>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(DC.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case TC.connecting:return`connecting`;case TC.open:return`open`;case TC.closing:return`closing`;default:return`closed`}}isConnected(){return this.connectionState()===`open`}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([t])=>e.indexOf(t)===-1)}channel(e,t={}){let n=new NC(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;this.log(`push`,`${t} ${n} (${a}, ${i})`,r)}this.isConnected()?this.encode(e,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(e,e=>this.conn.send(e)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback(`disconnected`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:`phoenix`,event:`heartbeat`,payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback(`sent`)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:n,payload:r,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){let e=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(r.status===`ok`?`ok`:`error`,e)}catch(e){this.log(`error`,`error in heartbeat callback`,e)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log(`receive`,`${r.status||``} ${t} ${n} ${i&&`(`+i+`)`||``}`.trim(),r);for(let e=0;e{try{r(...t)}catch(t){this.log(`error`,`error in ${e} callback`,t)}})}catch(t){this.log(`error`,`error triggering ${e} callbacks`,t)}}leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t.isJoined()||t.isJoining()));t&&(this.hasLogger()&&this.log(`transport`,`leaving duplicate topic "${e}"`),t.leave())}},BC=class e{constructor(t,n){let r=UC(n);this.presence=new LC(t.getChannel(),r),this.presence.onJoin((n,r,i)=>{let a=e.onJoinPayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onLeave((n,r,i)=>{let a=e.onLeavePayload(n,r,i);t.getChannel().trigger(`presence`,a)}),this.presence.onSync(()=>{t.getChannel().trigger(`presence`,{event:`sync`})})}get state(){return e.transformState(this.presence.state)}static transformState(e){return e=HC(e),Object.getOwnPropertyNames(e).reduce((t,n)=>{let r=e[n];return t[n]=VC(r),t},{})}static onJoinPayload(e,t,n){return{event:`join`,key:e,currentPresences:WC(t),newPresences:VC(n)}}static onLeavePayload(e,t,n){return{event:`leave`,key:e,currentPresences:WC(t),leftPresences:VC(n)}}};function VC(e){return e.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function HC(e){return JSON.parse(JSON.stringify(e))}function UC(e){return e?.events&&{events:e.events}}function WC(e){return e?.metas?VC(e):[]}var GC;(function(e){e.SYNC=`sync`,e.JOIN=`join`,e.LEAVE=`leave`})(GC||={});var KC=class{get state(){return this.presenceAdapter.state}constructor(e,t){this.channel=e,this.presenceAdapter=new BC(this.channel.channelAdapter,t)}};function qC(e){if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(e&&typeof e==`object`){let t=e;if(typeof t.code==`number`){let n=typeof t.reason==`string`&&t.reason?` (${t.reason})`:``;return Error(`socket closed: ${t.code}${n}`,{cause:e})}return Error(`channel error: transport failure`,{cause:e})}return Error(`channel error: connection lost`)}var JC=class{constructor(e,t,n){let r=YC(n);this.channel=e.getSocket().channel(t,r),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,t){return this.channel.on(e,t)}off(e,t){this.channel.off(e,t)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,t,n){let r;try{r=this.channel.push(e,t,n)}catch{throw Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>100){let e=this.channel.pushBuffer.shift();e.cancelTimeout(),this.socket.log(`channel`,`discarded push due to buffer overflow: ${e.event}`,e.payload())}return r}updateJoinPayload(e){let t=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},t),e)}canPush(){return this.socket.isConnected()&&this.state===rC.joined}isJoined(){return this.state===rC.joined}isJoining(){return this.state===rC.joining}isClosed(){return this.state===rC.closed}isLeaving(){return this.state===rC.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}};function YC(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},e.config)}}var XC;(function(e){e.ALL=`*`,e.INSERT=`INSERT`,e.UPDATE=`UPDATE`,e.DELETE=`DELETE`})(XC||={});var ZC;(function(e){e.BROADCAST=`broadcast`,e.PRESENCE=`presence`,e.POSTGRES_CHANGES=`postgres_changes`,e.SYSTEM=`system`})(ZC||={});var QC;(function(e){e.SUBSCRIBED=`SUBSCRIBED`,e.TIMED_OUT=`TIMED_OUT`,e.CLOSED=`CLOSED`,e.CHANNEL_ERROR=`CHANNEL_ERROR`})(QC||={});var $C=class e{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,t={config:{}},n){if(this.topic=e,this.params=t,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,``),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:``,enabled:!1},private:!1},t.config),this.channelAdapter=new JC(this.socket.socketAdapter,e,this.params),this.presence=new KC(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=_C(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&this.params.config?.broadcast?.replay)throw Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,t=this.timeout){if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){let{config:{broadcast:n,presence:r,private:i}}=this.params,a=this.bindings.postgres_changes?.map(e=>e.filter)??[],o=!!this.bindings[ZC.PRESENCE]&&this.bindings[ZC.PRESENCE].length>0||this.params.config.presence?.enabled===!0,s={},c={broadcast:n,presence:Object.assign(Object.assign({},r),{enabled:o}),postgres_changes:a,private:i};this.socket.accessTokenValue&&(s.access_token=this.socket.accessTokenValue),this._onError(t=>{e?.(QC.CHANNEL_ERROR,qC(t))}),this._onClose(()=>e?.(QC.CLOSED)),this.updateJoinPayload(Object.assign({config:c},s)),this._updateFilterMessage(),this.channelAdapter.subscribe(t).receive(`ok`,async({postgres_changes:t})=>{if(this.socket._isManualToken()||this.socket.setAuth(),t===void 0){e?.(QC.SUBSCRIBED);return}this._updatePostgresBindings(t,e)}).receive(`error`,t=>{this.state=rC.errored;let n=Object.values(t).join(`, `)||`error`;e?.(QC.CHANNEL_ERROR,Error(n,{cause:t}))}).receive(`timeout`,()=>{e?.(QC.TIMED_OUT)})}return this}_updatePostgresBindings(t,n){let r=this.bindings.postgres_changes,i=r?.length??0,a=[];for(let o=0;o{let r=this.channelAdapter.push(e.type,e,t.timeout||this.timeout);e.type===`broadcast`&&!this.params?.config?.broadcast?.ack&&n(`ok`),r.receive(`ok`,()=>n(`ok`)),r.receive(`error`,()=>n(`error`)),r.receive(`timeout`,()=>n(`timed out`))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(t=>{this.channelAdapter.unsubscribe(e).receive(`ok`,()=>t(`ok`)).receive(`timeout`,()=>t(`timed out`)).receive(`error`,()=>t(`error`))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,t,n){let r=new AbortController,i=setTimeout(()=>r.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),a}_on(e,t,n){let r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:n,ref:this.channelAdapter.on(e,n)};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,t,n)=>{let r=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(r,n))return!1;let i=this.bindings[r]?.find(t=>t.ref===e.ref);if(!i)return!0;if([`broadcast`,`presence`,`postgres_changes`].includes(r))if(`id`in i){let e=i.id,n=i.filter?.event;return e&&t.ids?.includes(e)&&(n===`*`||n?.toLocaleLowerCase()===t.data?.type.toLocaleLowerCase())}else{let e=(i?.filter?.event)?.toLocaleLowerCase();return e===`*`||e===(t?.event)?.toLocaleLowerCase()}else return i.type.toLocaleLowerCase()===r})}_notThisChannelEvent(e,t){let{close:n,error:r,leave:i,join:a}=iC;return t&&[n,r,i,a].includes(e)&&t!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,t,n)=>{if(typeof t==`object`&&`ids`in t){let e=t.data,{schema:n,table:r,commit_timestamp:i,type:a,errors:o}=e;return Object.assign(Object.assign({},{schema:n,table:r,commit_timestamp:i,eventType:a,new:{},old:{},errors:o}),this._getPayloadRecords(e))}return t})}copyBindings(e){if(this.joinedOnce)throw Error(`cannot copy bindings into joined channel`);for(let t in e.bindings)for(let n of e.bindings[t])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,t){return(e??void 0)===(t??void 0)}_getPayloadRecords(e){let t={new:{},old:{}};return(e.type===`INSERT`||e.type===`UPDATE`)&&(t.new=cC(e.columns,e.record)),(e.type===`UPDATE`||e.type===`DELETE`)&&(t.old=cC(e.columns,e.old_record)),t}},ew=class{constructor(e,t){this.socket=new zC(e,t)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,t,n,r=1e4){return new Promise(i=>{setTimeout(()=>i(`timeout`),r),this.socket.disconnect(()=>{e(),i(`ok`)},t,n)})}push(e){this.socket.push(e)}log(e,t,n){this.socket.log(e,t,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==aC.connecting}isDisconnecting(){return this.socket.connectionState()==aC.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}},tw={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},nw=[1e3,2e3,5e3,1e4],rw=1e4;function iw(){let e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){return Array.from(e.keys())[t]??null},removeItem(t){e.delete(t)},setItem(t,n){e.set(t,String(n))}}}function aw(){try{if(typeof globalThis<`u`&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return iw()}var ow=` + addEventListener("message", (e) => { + if (e.data.event === "start") { + setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); + } + });`,sw=class{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,t){if(this.channels=[],this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint=``,this.headers={},this.params={},this.ref=0,this.serializer=new oC,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),!t?.params?.apikey)throw Error(`API key is required to connect to Realtime`);this.apiKey=t.params.apikey;let n=this._initializeOptions(t);this.socketAdapter=new ew(e,n),this.httpEndpoint=_C(e),this.fetch=this._resolveFetch(t?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely(`connect`),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){let t=e.message;throw t.includes(`Node.js`)?Error(`${t}\n\nTo use Realtime in Node.js, you need to provide a WebSocket implementation: + +Option 1: Use Node.js 22+ which has native WebSocket support +Option 2: Install and provide the "ws" package: + + npm install ws + + import ws from "ws" + const client = new RealtimeClient(url, { + ...options, + transport: ws + })`):Error(`WebSocket not available: ${t}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,t){return this._cancelPendingDisconnect(),this.isDisconnecting()?`ok`:await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,t)}getChannels(){return this.channels}async removeChannel(e){let t=await e.unsubscribe();return t===`ok`&&e.teardown(),t}async removeAllChannels(){let e=this.channels.map(async e=>{let t=await e.unsubscribe();return e.teardown(),t}),t=await Promise.all(e);return await this.disconnect(),t}log(e,t,n){this.socketAdapter.log(e,t,n)}connectionState(){return this.socketAdapter.connectionState()||aC.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,t={config:{}}){let n=`realtime:${e}`,r=this.getChannels().find(e=>e.topic===n);if(r)return r;{let n=new $C(`realtime:${e}`,t,this);return this._cancelPendingDisconnect(),this.channels.push(n),n}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(t=>t.topic!==e.topic),this.channels.length===0&&(this.log(`transport`,`no channels remaining, scheduling disconnect`),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log(`transport`,`disconnecting immediately - no channels`),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log(`transport`,`deferred disconnect fired - no channels, disconnecting`),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log(`transport`,`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log(`transport`,`pending disconnect cancelled - channel activity detected`),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let t,n=!1;if(e)t=e,n=!0;else if(this.accessToken)try{t=await this.accessToken()}catch(e){this.log(`error`,`Error fetching access token from callback`,e),t=this.accessTokenValue}else t=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=t&&(this.accessTokenValue=t,this.channels.forEach(e=>{let n={access_token:t,version:QS};t&&e.updateJoinPayload(n),e.joinedOnce&&e.channelAdapter.isJoined()&&e.channelAdapter.push(iC.access_token,{access_token:t})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e=`general`){this._isManualToken()||this.setAuth().catch(t=>{this.log(`error`,`Error setting auth in ${e}`,t)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(e=>{this.log(`error`,`error waiting for auth on connect`,e)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(t,n)=>{t==`sent`&&this._setAuthSafely(),e&&e(t,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log(`worker`,`starting worker for from ${this.workerUrl}`):this.log(`worker`,`starting default worker`);let e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=e=>{this.log(`worker`,`worker error`,e.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=e=>{e.data.event===`keepAlive`&&this.sendHeartbeat()},this.workerRef.postMessage({event:`start`,interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&=(this.log(`worker`,`terminating worker`),this.workerRef.terminate(),void 0)}_workerObjectUrl(e){let t;if(e)t=e;else{let e=new Blob([ow],{type:`application/javascript`});t=URL.createObjectURL(e)}return t}_initializeOptions(e){this.worker=e?.worker??!1,this.accessToken=e?.accessToken??null;let t={};t.timeout=e?.timeout??nC,t.heartbeatIntervalMs=e?.heartbeatIntervalMs??tw.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=e?.disconnectOnEmptyChannelsAfterMs??2*(e?.heartbeatIntervalMs??tw.HEARTBEAT_INTERVAL),t.transport=e?.transport??ZS.getWebSocketConstructor(),t.params=e?.params,t.logger=e?.logger,t.heartbeatCallback=this._wrapHeartbeatCallback(e?.heartbeatCallback),t.sessionStorage=e?.sessionStorage??aw(),t.reconnectAfterMs=e?.reconnectAfterMs??(e=>nw[e-1]||rw);let n,r,i=e?.vsn??tC;switch(i){case $S:n=(e,t)=>t(JSON.stringify(e)),r=(e,t)=>t(JSON.parse(e));break;case eC:n=this.serializer.encode.bind(this.serializer),r=this.serializer.decode.bind(this.serializer);break;default:throw Error(`Unsupported serializer version: ${t.vsn}`)}if(t.vsn=i,t.encode=e?.encode??n,t.decode=e?.decode??r,t.beforeReconnect=this._reconnectAuth.bind(this),(e?.logLevel||e?.log_level)&&(this.logLevel=e.logLevel||e.log_level,t.params=Object.assign(Object.assign({},t.params),{log_level:this.logLevel})),this.worker){if(typeof window<`u`&&!window.Worker)throw Error(`Web Worker is not supported`);this.workerUrl=e?.workerUrl,t.autoSendHeartbeat=!this.worker}return t}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}},cw=class extends Error{constructor(e,t){super(e),this.name=`IcebergError`,this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType===`CommitStateUnknownException`||[500,502,504].includes(t.status)&&t.icebergType?.includes(`CommitState`)===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function lw(e,t,n){let r=new URL(t,e);if(n)for(let[e,t]of Object.entries(n))t!==void 0&&r.searchParams.set(e,t);return r.toString()}async function uw(e){return!e||e.type===`none`?{}:e.type===`bearer`?{Authorization:`Bearer ${e.token}`}:e.type===`header`?{[e.name]:e.value}:e.type===`custom`?await e.getHeaders():{}}function dw(e){let t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:a,headers:o}){let s=lw(e.baseUrl,r,i),c=await uw(e.auth),l=await t(s,{method:n,headers:{...a?{"Content-Type":`application/json`}:{},...c,...o},body:a?JSON.stringify(a):void 0}),u=await l.text(),d=(l.headers.get(`content-type`)||``).includes(`application/json`),f=d&&u?JSON.parse(u):u;if(!l.ok){let e=d?f:void 0,t=e?.error;throw new cw(t?.message??`Request failed with status ${l.status}`,{status:l.status,icebergType:t?.type,icebergCode:t?.code,details:e})}return{status:l.status,headers:l.headers,data:f}}}}function fw(e){return e.join(``)}var pw=class{constructor(e,t=``){this.client=e,this.prefix=t}async listNamespaces(e){let t=e?{parent:fw(e.namespace)}:void 0;return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(e=>({namespace:e}))}async createNamespace(e,t){let n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${fw(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${fw(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${fw(e.namespace)}`}),!0}catch(e){if(e instanceof cw&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(e){if(e instanceof cw&&e.status===409)return;throw e}}};function mw(e){return e.join(``)}var hw=class{constructor(e,t=``,n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${mw(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){let n={};return this.accessDelegation&&(n[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${mw(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){let n=await this.client.request({method:`POST`,path:`${this.prefix}/namespaces/${mw(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data[`metadata-location`],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:`DELETE`,path:`${this.prefix}/namespaces/${mw(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){let t={};return this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation),(await this.client.request({method:`GET`,path:`${this.prefix}/namespaces/${mw(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){let t={};this.accessDelegation&&(t[`X-Iceberg-Access-Delegation`]=this.accessDelegation);try{return await this.client.request({method:`HEAD`,path:`${this.prefix}/namespaces/${mw(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(e){if(e instanceof cw&&e.status===404)return!1;throw e}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof cw&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},gw=class{constructor(e){let t=`v1`;e.catalogName&&(t+=`/${e.catalogName}`);let n=e.baseUrl.endsWith(`/`)?e.baseUrl:`${e.baseUrl}/`;this.client=dw({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(`,`),this.namespaceOps=new pw(this.client,t),this.tableOps=new hw(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function _w(e){"@babel/helpers - typeof";return _w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_w(e)}function vw(e,t){if(_w(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_w(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function yw(e){var t=vw(e,`string`);return _w(t)==`symbol`?t:t+``}function bw(e,t,n){return(t=yw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;te?(...t)=>e(...t):(...e)=>fetch(...e),kw=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Aw=e=>{if(Array.isArray(e))return e.map(e=>Aw(e));if(typeof e==`function`||e!==Object(e))return e;let t={};return Object.entries(e).forEach(([e,n])=>{let r=e.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace(/[-_]/g,``));t[r]=Aw(n)}),t},jw=e=>!e||typeof e!=`string`||e.length===0||e.length>100||e.trim()!==e||e.includes(`/`)||e.includes(`\\`)?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Mw=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error;if(typeof t.error==`object`&&t.error!==null){let e=t.error;if(typeof e.message==`string`)return e.message}}return JSON.stringify(e)},Nw=async(e,t,n,r)=>{if(typeof e==`object`&&e&&`json`in e&&typeof e.json==`function`){let n=e,i=parseInt(String(n.status),10);Number.isFinite(i)||(i=500),n.json().then(e=>{let n=e?.statusCode||e?.code||i+``;t(new ww(Mw(e),i,n,r))}).catch(()=>{let e=i+``;t(new ww(n.statusText||`HTTP ${i} error`,i,e,r))})}else t(new Tw(Mw(e),e,r))},Pw=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};if(e===`GET`||e===`HEAD`||!r)return Z(Z({},i),n);if(kw(r)){let e=t?.headers||{},n;for(let[t,r]of Object.entries(e))t.toLowerCase()===`content-type`&&(n=r);i.headers=Ew(e,`Content-Type`,n??`application/json`),i.body=JSON.stringify(r)}else i.body=r;return t?.duplex&&(i.duplex=t.duplex),Z(Z({},i),n)};async function Fw(e,t,n,r,i,a,o){return new Promise((s,c)=>{e(n,Pw(t,r,i,a)).then(e=>{if(!e.ok)throw e;if(r?.noResolveJson)return e;if(o===`vectors`){let t=e.headers.get(`content-type`);if(e.headers.get(`content-length`)===`0`||e.status===204||!t||!t.includes(`application/json`))return{}}return e.json()}).then(e=>s(e)).catch(e=>Nw(e,c,r,o))})}function Iw(e=`storage`){return{get:async(t,n,r,i)=>Fw(t,`GET`,n,r,i,void 0,e),post:async(t,n,r,i,a)=>Fw(t,`POST`,n,i,a,r,e),put:async(t,n,r,i,a)=>Fw(t,`PUT`,n,i,a,r,e),head:async(t,n,r,i)=>Fw(t,`HEAD`,n,Z(Z({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,a)=>Fw(t,`DELETE`,n,i,a,r,e)}}var{get:Lw,post:Rw,put:zw,head:Bw,remove:Vw}=Iw(`storage`),Hw=Iw(`vectors`),Uw=class{constructor(e,t={},n,r=`storage`){this.shouldThrowOnError=!1,this.url=e,this.headers=Dw(t),this.fetch=Ow(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Ew(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Cw(e))return{data:null,error:e};throw e}}},Ww=Symbol.toStringTag,Gw=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Ww]=`StreamDownloadBuilder`,this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Cw(t))return{data:null,error:t};throw t}}},Kw=Symbol.toStringTag,qw=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Kw]=`BlobDownloadBuilder`,this.promise=null}asStream(){return new Gw(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||=this.execute(),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Cw(t))return{data:null,error:t};throw t}}},Jw={limit:100,offset:0,sortBy:{column:`name`,order:`asc`}},Yw={cacheControl:`3600`,contentType:`text/plain;charset=UTF-8`,upsert:!1},Xw=class extends Uw{constructor(e,t={},n,r){super(e,t,r,`storage`),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let a,o=Z(Z({},Yw),r),s=Z(Z({},i.headers),e===`POST`&&{"x-upsert":String(o.upsert)}),c=o.metadata;if(typeof Blob<`u`&&n instanceof Blob?(a=new FormData,a.append(`cacheControl`,o.cacheControl),c&&a.append(`metadata`,i.encodeMetadata(c)),a.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(a=n,a.has(`cacheControl`)||a.append(`cacheControl`,o.cacheControl),c&&!a.has(`metadata`)&&a.append(`metadata`,i.encodeMetadata(c))):(a=n,s[`cache-control`]=`max-age=${o.cacheControl}`,s[`content-type`]=o.contentType,c&&(s[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&a instanceof ReadableStream||a&&typeof a==`object`&&`pipe`in a&&typeof a.pipe==`function`)&&!o.duplex&&(o.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))s=Ew(s,e,t);let l=i._removeEmptyFolders(t),u=i._getFinalPath(l),d=await(e==`PUT`?zw:Rw)(i.fetch,`${i.url}/object/${u}`,a,Z({headers:s},o?.duplex?{duplex:o.duplex}:{}));return{path:l,id:d.Id,fullPath:d.Key}})}async upload(e,t,n){return this.uploadOrUpdate(`POST`,e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;let a=i._removeEmptyFolders(e),o=i._getFinalPath(a),s=new URL(i.url+`/object/upload/sign/${o}`);return s.searchParams.set(`token`,t),i.handleOperation(async()=>{let e,t=Z(Z({},Yw),r),o=Z(Z({},i.headers),{"x-upsert":String(t.upsert)}),c=t.metadata;if(typeof Blob<`u`&&n instanceof Blob?(e=new FormData,e.append(`cacheControl`,t.cacheControl),c&&e.append(`metadata`,i.encodeMetadata(c)),e.append(``,n)):typeof FormData<`u`&&n instanceof FormData?(e=n,e.has(`cacheControl`)||e.append(`cacheControl`,t.cacheControl),c&&!e.has(`metadata`)&&e.append(`metadata`,i.encodeMetadata(c))):(e=n,o[`cache-control`]=`max-age=${t.cacheControl}`,o[`content-type`]=t.contentType,c&&(o[`x-metadata`]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<`u`&&e instanceof ReadableStream||e&&typeof e==`object`&&`pipe`in e&&typeof e.pipe==`function`)&&!t.duplex&&(t.duplex=`half`)),r?.headers)for(let[e,t]of Object.entries(r.headers))o=Ew(o,e,t);return{path:a,fullPath:(await zw(i.fetch,s.toString(),e,Z({headers:o},t?.duplex?{duplex:t.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e),i=Z({},n.headers);t?.upsert&&(i[`x-upsert`]=`true`);let a=await Rw(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(n.url+a.url),s=o.searchParams.get(`token`);if(!s)throw new Sw(`No token returned by API`);return{signedUrl:o.toString(),path:e,token:s}})}async update(e,t,n){return this.uploadOrUpdate(`PUT`,e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Rw(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Rw(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),a=typeof n?.transform==`object`&&n.transform!==null&&Object.keys(n.transform).length>0,o=await Rw(r.fetch,`${r.url}/object/sign/${i}`,Z({expiresIn:t},a?{transform:n.transform}:{}),{headers:r.headers}),s=new URLSearchParams;n?.download&&s.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&s.set(`cacheNonce`,String(n.cacheNonce));let c=s.toString();return{signedUrl:encodeURI(`${r.url}${o.signedURL}${c?`&${c}`:``}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{let i=await Rw(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),a=new URLSearchParams;n?.download&&a.set(`download`,n.download===!0?``:n.download),n?.cacheNonce!=null&&a.set(`cacheNonce`,String(n.cacheNonce));let o=a.toString();return i.map(e=>Z(Z({},e),{},{signedUrl:e.signedURL?encodeURI(`${r.url}${e.signedURL}${o?`&${o}`:``}`):null}))})}download(e,t,n){let r=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image/authenticated`:`object`,i=new URLSearchParams;t?.transform&&this.applyTransformOptsToQuery(i,t.transform),t?.cacheNonce!=null&&i.set(`cacheNonce`,String(t.cacheNonce));let a=i.toString(),o=this._getFinalPath(e);return new qw(()=>Lw(this.fetch,`${this.url}/${r}/${o}${a?`?${a}`:``}`,{headers:this.headers,noResolveJson:!0},n),this.shouldThrowOnError)}async info(e){var t=this;let n=t._getFinalPath(e);return t.handleOperation(async()=>Aw(await Lw(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;let n=t._getFinalPath(e);try{return await Bw(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Cw(e)){let t=e instanceof ww?e.status:e instanceof Tw?e.originalError?.status:void 0;if(t!==void 0&&[400,404].includes(t))return{data:!1,error:e}}throw e}}getPublicUrl(e,t){let n=this._getFinalPath(e),r=new URLSearchParams;t?.download&&r.set(`download`,t.download===!0?``:t.download),t?.transform&&this.applyTransformOptsToQuery(r,t.transform),t?.cacheNonce!=null&&r.set(`cacheNonce`,String(t.cacheNonce));let i=r.toString(),a=typeof t?.transform==`object`&&t.transform!==null&&Object.keys(t.transform).length>0?`render/image`:`object`;return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}`)+(i?`?${i}`:``)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Vw(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{let i=Z(Z(Z({},Jw),t),{},{prefix:e||``});return await Rw(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{let r=Z({},e);return await Rw(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<`u`?Buffer.from(e).toString(`base64`):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,``)}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)}applyTransformOptsToQuery(e,t){return t.width&&e.set(`width`,t.width.toString()),t.height&&e.set(`height`,t.height.toString()),t.resize&&e.set(`resize`,t.resize),t.format&&e.set(`format`,t.format),t.quality&&e.set(`quality`,t.quality.toString()),e}},Zw={"X-Client-Info":`storage-js/2.106.2`},Qw=class extends Uw{constructor(e,t={},n,r){let i=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes(`storage.supabase.`)&&(i.hostname=i.hostname.replace(`supabase.`,`storage.supabase.`));let a=i.href.replace(/\/$/,``),o=Z(Z({},Zw),t);super(a,o,n,`storage`)}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=t.listBucketOptionsToQueryString(e);return await Lw(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Lw(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Rw(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await zw(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Rw(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Vw(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){let t={};return e&&(`limit`in e&&(t.limit=String(e.limit)),`offset`in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?`?`+new URLSearchParams(t).toString():``}},$w=class extends Uw{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=Z(Z({},Zw),t);super(r,i,n,`storage`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Rw(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{let n=new URLSearchParams;e?.limit!==void 0&&n.set(`limit`,e.limit.toString()),e?.offset!==void 0&&n.set(`offset`,e.offset.toString()),e?.sortColumn&&n.set(`sortColumn`,e.sortColumn),e?.sortOrder&&n.set(`sortOrder`,e.sortOrder),e?.search&&n.set(`search`,e.search);let r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Lw(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Vw(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!jw(e))throw new Sw(`Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.`);let n=new gw({baseUrl:this.url,catalogName:e,auth:{type:`custom`,getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(e,t){let n=e[t];return typeof n==`function`?async(...t)=>{try{return{data:await n.apply(e,t),error:null}}catch(e){if(r)throw e;return{data:null,error:e}}}:n}})}},eT=class extends Uw{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=Z(Z({},Zw),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createIndex(e){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Hw.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Hw.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},tT=class extends Uw{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=Z(Z({},Zw),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw Error(`Vector batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw Error(`segmentCount must be between 1 and 16`);if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw Error(`Keys batch size must be between 1 and 500 items`);return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},nT=class extends Uw{constructor(e,t={},n){let r=e.replace(/\/$/,``),i=Z(Z({},Zw),{},{"Content-Type":`application/json`},t);super(r,i,n,`vectors`)}async createBucket(e){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Hw.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},rT=class extends nT{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new iT(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},iT=class extends eT{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,Z(Z({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,Z(Z({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new aT(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},aT=class extends tT{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,Z(Z({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,Z(Z({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,Z(Z({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,Z(Z({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,Z(Z({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},oT=class extends Qw{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new Xw(this.url,this.headers,e,this.fetch)}get vectors(){return new rT(this.url+`/vector`,{headers:this.headers,fetch:this.fetch})}get analytics(){return new $w(this.url+`/iceberg`,this.headers,this.fetch)}},sT=`2.106.2`,cT=30*1e3,lT=3*cT,uT=`http://localhost:9999`,dT=`supabase.auth.token`,fT={"X-Client-Info":`gotrue-js/${sT}`},pT=`X-Supabase-Api-Version`,mT={"2024-01-01":{timestamp:Date.parse(`2024-01-01T00:00:00.0Z`),name:`2024-01-01`}},hT=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,gT=class extends Error{constructor(e,t,n){super(e),this.__isAuthError=!0,this.name=`AuthError`,this.status=t,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}};function Q(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}var _T=class extends gT{constructor(e,t,n){super(e,t,n),this.name=`AuthApiError`,this.status=t,this.code=n}};function vT(e){return Q(e)&&e.name===`AuthApiError`}var yT=class extends gT{constructor(e,t){super(e),this.name=`AuthUnknownError`,this.originalError=t}},bT=class extends gT{constructor(e,t,n,r){super(e,n,r),this.name=t,this.status=n}},xT=class extends bT{constructor(){super(`Auth session missing!`,`AuthSessionMissingError`,400,void 0)}};function ST(e){return Q(e)&&e.name===`AuthSessionMissingError`}var CT=class extends bT{constructor(){super(`Auth session or user missing`,`AuthInvalidTokenResponseError`,500,void 0)}},wT=class extends bT{constructor(e){super(e,`AuthInvalidCredentialsError`,400,void 0)}},TT=class extends bT{constructor(e,t=null){super(e,`AuthImplicitGrantRedirectError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}};function ET(e){return Q(e)&&e.name===`AuthImplicitGrantRedirectError`}var DT=class extends bT{constructor(e,t=null){super(e,`AuthPKCEGrantCodeExchangeError`,500,void 0),this.details=null,this.details=t}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}},OT=class extends bT{constructor(){super(`PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.`,`AuthPKCECodeVerifierMissingError`,400,`pkce_code_verifier_not_found`)}},kT=class extends bT{constructor(e,t){super(e,`AuthRetryableFetchError`,t,void 0)}};function AT(e){return Q(e)&&e.name===`AuthRetryableFetchError`}var jT=class extends bT{constructor(e,t,n){super(e,`AuthWeakPasswordError`,t,`weak_password`),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}},MT=class extends bT{constructor(e){super(e,`AuthInvalidJwtError`,400,`invalid_jwt`)}},NT=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`.split(``),PT=` +\r=`.split(``),FT=(()=>{let e=Array(128);for(let t=0;t=6;)n(NT[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6;else if(t.queuedBits>0)for(t.queue<<=6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;)n(NT[t.queue>>t.queuedBits-6&63]),t.queuedBits-=6}function LT(e,t,n){let r=FT[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else if(r===-2)return;else throw Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}function RT(e){let t=[],n=e=>{t.push(String.fromCodePoint(e))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=e=>{VT(e,r,n)};for(let t=0;t>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function BT(e,t){for(let n=0;n55295&&r<=56319){let t=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|t)+65536,n+=1}zT(r,t)}}function VT(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw Error(`Invalid UTF-8 sequence`);--t.utf8seq}else if(t.utf8seq>0){if(e<=127)throw Error(`Invalid UTF-8 sequence`);t.codepoint=t.codepoint<<6|e&63,--t.utf8seq,t.utf8seq===0&&n(t.codepoint)}}function HT(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};for(let t=0;tt.push(e)),new Uint8Array(t)}function WT(e){let t=[],n={queue:0,queuedBits:0},r=e=>{t.push(e)};return e.forEach(e=>IT(e,n,r)),IT(null,n,r),t.join(``)}function GT(e){return Math.round(Date.now()/1e3)+e}function KT(){return Symbol(`auth-callback`)}var qT=()=>typeof window<`u`&&typeof document<`u`,JT={tested:!1,writable:!1},YT=()=>{if(!qT())return!1;try{if(typeof globalThis.localStorage!=`object`)return!1}catch{return!1}if(JT.tested)return JT.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),JT.tested=!0,JT.writable=!0}catch{JT.tested=!0,JT.writable=!1}return JT.writable};function XT(e){let t={},n=new URL(e);if(n.hash&&n.hash[0]===`#`)try{new URLSearchParams(n.hash.substring(1)).forEach((e,n)=>{t[n]=e})}catch{}return n.searchParams.forEach((e,n)=>{t[n]=e}),t}var ZT=e=>e?(...t)=>e(...t):(...e)=>fetch(...e),QT=e=>typeof e==`object`&&!!e&&`status`in e&&`ok`in e&&`json`in e&&typeof e.json==`function`,$T=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},eE=async(e,t)=>{let n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return null}},tE=async(e,t)=>{await e.removeItem(t)},nE=class e{constructor(){this.promise=new e.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}};nE.promiseConstructor=Promise;function rE(e){let t=e.split(`.`);if(t.length!==3)throw new MT(`Invalid JWT structure`);for(let e=0;e{setTimeout(()=>t(null),e)})}function aE(e,t){return new Promise((n,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{let r=await e(i);if(!t(i,null,r)){n(r);return}}catch(e){if(!t(i,e)){r(e);return}}})()})}function oE(e){return(`0`+e.toString(16)).substr(-2)}function sE(){let e=new Uint32Array(56);if(typeof crypto>`u`){let e=``;for(let t=0;t<56;t++)e+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~`.charAt(Math.floor(Math.random()*66));return e}return crypto.getRandomValues(e),Array.from(e,oE).join(``)}async function cE(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t),r=new Uint8Array(n);return Array.from(r).map(e=>String.fromCharCode(e)).join(``)}async function lE(e){if(!(typeof crypto<`u`&&crypto.subtle!==void 0&&typeof TextEncoder<`u`))return console.warn(`WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256.`),e;let t=await cE(e);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async function uE(e,t,n=!1){let r=sE(),i=r;n&&(i+=`/recovery`),await $T(e,`${t}-code-verifier`,i);let a=await lE(r);return[a,r===a?`plain`:`s256`]}var dE=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function fE(e){let t=e.headers.get(pT);if(!t||!t.match(dE))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function pE(e){if(!e)throw Error(`Missing exp claim`);if(e<=Math.floor(Date.now()/1e3))throw Error(`JWT has expired`)}function mE(e){switch(e){case`RS256`:return{name:`RSASSA-PKCS1-v1_5`,hash:{name:`SHA-256`}};case`ES256`:return{name:`ECDSA`,namedCurve:`P-256`,hash:{name:`SHA-256`}};default:throw Error(`Invalid alg claim`)}}var hE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function gE(e){if(!hE.test(e))throw Error(`@supabase/auth-js: Expected parameter to be UUID but is not`)}function _E(e){if(!e.passkey)throw Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function vE(){return new Proxy({},{get:(e,t)=>{if(t===`__isUserNotAvailableProxy`)return!0;if(typeof t==`symbol`){let e=t.toString();if(e===`Symbol(Symbol.toPrimitive)`||e===`Symbol(Symbol.toStringTag)`||e===`Symbol(util.inspect.custom)`)return}throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${t}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,t)=>{throw Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${t}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function yE(e,t){return new Proxy(e,{get:(e,n,r)=>{if(n===`__isInsecureUserWarningProxy`)return!0;if(typeof n==`symbol`){let t=n.toString();if(t===`Symbol(Symbol.toPrimitive)`||t===`Symbol(Symbol.toStringTag)`||t===`Symbol(util.inspect.custom)`||t===`Symbol(nodejs.util.inspect.custom)`)return Reflect.get(e,n,r)}return!t.value&&typeof n==`string`&&(console.warn(`Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server.`),t.value=!0),Reflect.get(e,n,r)}})}function bE(e){return JSON.parse(JSON.stringify(e))}var xE=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.msg==`string`)return t.msg;if(typeof t.message==`string`)return t.message;if(typeof t.error_description==`string`)return t.error_description;if(typeof t.error==`string`)return t.error}return JSON.stringify(e)},SE=[502,503,504,520,521,522,523,524,530];async function CE(e){if(!QT(e))throw new kT(xE(e),0);if(SE.includes(e.status))throw new kT(xE(e),e.status);let t;try{t=await e.json()}catch(e){throw new yT(xE(e),e)}let n,r=fE(e);if(r&&r.getTime()>=mT[`2024-01-01`].timestamp&&typeof t==`object`&&t&&typeof t.code==`string`?n=t.code:typeof t==`object`&&t&&typeof t.error_code==`string`&&(n=t.error_code),!n){if(typeof t==`object`&&t&&typeof t.weak_password==`object`&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0))throw new jT(xE(t),e.status,t.weak_password.reasons)}else if(n===`weak_password`)throw new jT(xE(t),e.status,t.weak_password?.reasons||[]);else if(n===`session_not_found`)throw new xT;throw new _T(xE(t),e.status||500,n)}var wE=(e,t,n,r)=>{let i={method:e,headers:t?.headers||{}};return e===`GET`?i:(i.headers=Object.assign({"Content-Type":`application/json;charset=UTF-8`},t?.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function $(e,t,n,r){let i=Object.assign({},r?.headers);i[`X-Supabase-Api-Version`]||(i[pT]=mT[`2024-01-01`].name),r?.jwt&&(i.Authorization=`Bearer ${r.jwt}`);let a=r?.query??{};r?.redirectTo&&(a.redirect_to=r.redirectTo);let o=await TE(e,t,n+(Object.keys(a).length?`?`+new URLSearchParams(a).toString():``),{headers:i,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(o):{data:Object.assign({},o),error:null}}async function TE(e,t,n,r,i,a){let o=wE(t,r,i,a),s;try{s=await e(n,Object.assign({},o))}catch(e){throw console.error(e),new kT(xE(e),0)}if(s.ok||await CE(s),r?.noResolveJson)return s;try{return await s.json()}catch(e){await CE(e)}}function EE(e){let t=null;ME(e)&&(t=Object.assign({},e),e.expires_at||(t.expires_at=GT(e.expires_in)));let n=e.user??(typeof e?.id==`string`?e:null);return{data:{session:t,user:n},error:null}}function DE(e){let t=EE(e);return!t.error&&e.weak_password&&typeof e.weak_password==`object`&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message==`string`&&e.weak_password.reasons.reduce((e,t)=>e&&typeof t==`string`,!0)&&(t.data.weak_password=e.weak_password),t}function OE(e){return{data:{user:e.user??e},error:null}}function kE(e){return{data:e,error:null}}function AE(e){let{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a}=e,o=CS(e,[`action_link`,`email_otp`,`hashed_token`,`redirect_to`,`verification_type`]);return{data:{properties:{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:a},user:Object.assign({},o)},error:null}}function jE(e){return e}function ME(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}var NE=[`global`,`local`,`others`],PE=class{_encodePathSegment(e){if(e===`.`||e===`..`)throw new gT(`Invalid path segment`);return encodeURIComponent(e)}constructor({url:e=``,headers:t={},fetch:n,experimental:r}){this.url=e,this.headers=t,this.fetch=ZT(n),this.experimental=r??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,t=NE[0]){if(NE.indexOf(t)<0)throw Error(`@supabase/auth-js: Parameter scope must be one of ${NE.join(`, `)}`);try{return await $(this.fetch,`POST`,`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Q(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await $(this.fetch,`POST`,`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:OE})}catch(e){if(Q(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,n=CS(e,[`options`]),r=Object.assign(Object.assign({},n),t);return`newEmail`in n&&(r.new_email=n?.newEmail,delete r.newEmail),await $(this.fetch,`POST`,`${this.url}/admin/generate_link`,{body:r,headers:this.headers,xform:AE,redirectTo:t?.redirectTo})}catch(e){if(Q(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await $(this.fetch,`POST`,`${this.url}/admin/users`,{body:e,headers:this.headers,xform:OE})}catch(e){if(Q(e))return{data:{user:null},error:e};throw e}}async listUsers(e){try{let t={nextPage:null,lastPage:0,total:0},n=await $(this.fetch,`GET`,`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:jE});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(Q(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){gE(e);try{return await $(this.fetch,`GET`,`${this.url}/admin/users/${e}`,{headers:this.headers,xform:OE})}catch(e){if(Q(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){gE(e);try{return await $(this.fetch,`PUT`,`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:OE})}catch(e){if(Q(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){gE(e);try{return await $(this.fetch,`DELETE`,`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:OE})}catch(e){if(Q(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){gE(e.userId);try{let{data:t,error:n}=await $(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:n}}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _deleteFactor(e){gE(e.userId),gE(e.id);try{return{data:await $(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _listOAuthClients(e){try{let t={nextPage:null,lastPage:0,total:0},n=await $(this.fetch,`GET`,`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(e?.page)?.toString()??``,per_page:(e?.perPage)?.toString()??``},xform:jE});if(n.error)throw n.error;let r=await n.json(),i=n.headers.get(`x-total-count`)??0,a=n.headers.get(`link`)?.split(`,`)??[];return a.length>0&&(a.forEach(e=>{let n=parseInt(e.split(`;`)[0].split(`=`)[1].substring(0,1)),r=JSON.parse(e.split(`;`)[1].split(`=`)[1]);t[`${r}Page`]=n}),t.total=parseInt(i)),{data:Object.assign(Object.assign({},r),t),error:null}}catch(e){if(Q(e))return{data:{clients:[]},error:e};throw e}}async _createOAuthClient(e){try{return await $(this.fetch,`POST`,`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _getOAuthClient(e){try{let t=this._encodePathSegment(e);return await $(this.fetch,`GET`,`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _updateOAuthClient(e,t){try{let n=this._encodePathSegment(e);return await $(this.fetch,`PUT`,`${this.url}/admin/oauth/clients/${n}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _deleteOAuthClient(e){try{let t=this._encodePathSegment(e);return await $(this.fetch,`DELETE`,`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _regenerateOAuthClientSecret(e){try{let t=this._encodePathSegment(e);return await $(this.fetch,`POST`,`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _listCustomProviders(e){try{let t={};return e?.type&&(t.type=e.type),await $(this.fetch,`GET`,`${this.url}/admin/custom-providers`,{headers:this.headers,query:t,xform:e=>({data:{providers:e?.providers??[]},error:null})})}catch(e){if(Q(e))return{data:{providers:[]},error:e};throw e}}async _createCustomProvider(e){try{return await $(this.fetch,`POST`,`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _getCustomProvider(e){try{let t=this._encodePathSegment(e);return await $(this.fetch,`GET`,`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _updateCustomProvider(e,t){try{let n=this._encodePathSegment(e);return await $(this.fetch,`PUT`,`${this.url}/admin/custom-providers/${n}`,{body:t,headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _deleteCustomProvider(e){try{let t=this._encodePathSegment(e);return await $(this.fetch,`DELETE`,`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _adminListPasskeys(e){_E(this.experimental),gE(e.userId);try{return await $(this.fetch,`GET`,`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:e=>({data:e,error:null})})}catch(e){if(Q(e))return{data:null,error:e};throw e}}async _adminDeletePasskey(e){_E(this.experimental),gE(e.userId),gE(e.passkeyId);try{return await $(this.fetch,`DELETE`,`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(e){if(Q(e))return{data:null,error:e};throw e}}};function FE(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}var IE={debug:!!(globalThis&&YT()&&globalThis.localStorage&&globalThis.localStorage.getItem(`supabase.gotrue-js.locks.debug`)===`true`)},LE=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}},RE=class extends LE{};async function zE(e,t,n){IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquire lock`,e,t);let r=new globalThis.AbortController,i;t>0&&(i=setTimeout(()=>{r.abort(),IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock acquire timed out`,e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:`exclusive`,ifAvailable:!0}:{mode:`exclusive`,signal:r.signal},async r=>{if(r){clearTimeout(i),IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquired`,e,r.name);try{return await n()}finally{IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: released`,e,r.name)}}else if(t===0)throw IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: not immediately available`,e),new RE(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);else{if(IE.debug)try{let e=await globalThis.navigator.locks.query();console.log(`@supabase/gotrue-js: Navigator LockManager state`,JSON.stringify(e,null,` `))}catch(e){console.warn(`@supabase/gotrue-js: Error when querying Navigator LockManager state`,e)}return console.warn(`@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request`),clearTimeout(i),await n()}})}catch(a){if(t>0&&clearTimeout(i),typeof a==`object`&&a&&`name`in a&&a.name===`AbortError`&&t>0){if(r.signal.aborted)return IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock`,e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:`exclusive`,steal:!0},async t=>{if(t){IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: recovered (stolen)`,e,t.name);try{return await n()}finally{IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: released (stolen)`,e,t.name)}}else return console.warn(`@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true`),await n()}));throw IE.debug&&console.log(`@supabase/gotrue-js: navigatorLock: lock was stolen by another request`,e),new RE(`Lock "${e}" was released because another request stole it`)}throw a}}function BE(){if(typeof globalThis!=`object`)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<`u`&&(self.globalThis=self)}}function VE(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function HE(e){return parseInt(e,16)}function UE(e){let t=new TextEncoder().encode(e);return`0x`+Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)}function WE(e){let{chainId:t,domain:n,expirationTime:r,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:s,resources:c,scheme:l,uri:u,version:d}=e;if(!Number.isInteger(t))throw Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${t}`);if(!n)throw Error(`@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.`);if(a&&a.length<8)throw Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!u)throw Error(`@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.`);if(d!==`1`)throw Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(e.statement?.includes(` +`))throw Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`);let f=VE(e.address),p=`${l?`${l}://${n}`:n} wants you to sign in with your Ethereum account:\n${f}\n\n${e.statement?`${e.statement}\n`:``}`,m=`URI: ${u}\nVersion: ${d}\nChain ID: ${t}${a?`\nNonce: ${a}`:``}\nIssued At: ${i.toISOString()}`;if(r&&(m+=`\nExpiration Time: ${r.toISOString()}`),o&&(m+=`\nNot Before: ${o.toISOString()}`),s&&(m+=`\nRequest ID: ${s}`),c){let e=` +Resources:`;for(let t of c){if(!t||typeof t!=`string`)throw Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${t}`);e+=`\n- ${t}`}m+=e}return`${p}\n${m}`}var GE=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=r??(n instanceof Error?n.name:void 0)??`Unknown Error`,this.code=t}toJSON(){return{name:this.name,message:this.message,code:this.code}}},KE=class extends GE{constructor(e,t){super({code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:t,message:e}),this.name=`WebAuthnUnknownError`,this.originalError=t}};function qE({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new GE({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new GE({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new GE({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new GE({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new GE({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new GE({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new GE({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new GE({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!eD(t))return new GE({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new GE({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new GE({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new GE({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new GE({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}function JE({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new GE({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new GE({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=window.location.hostname;if(!eD(t))return new GE({message:`${window.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new GE({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new GE({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return new GE({message:`a Non-Webauthn related error has occurred`,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e})}var YE=new class{createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}};function XE(e){if(!e)throw Error(`Credential creation options are required`);if(typeof PublicKeyCredential<`u`&&`parseCreationOptionsFromJSON`in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON==`function`)return PublicKeyCredential.parseCreationOptionsFromJSON(e);let{challenge:t,user:n,excludeCredentials:r}=e,i=CS(e,[`challenge`,`user`,`excludeCredentials`]),a=HT(t).buffer,o=Object.assign(Object.assign({},n),{id:HT(n.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(r&&r.length>0){s.excludeCredentials=Array(r.length);for(let e=0;e0){a.allowCredentials=Array(n.length);for(let e=0;etypeof e==`object`&&!!e&&!Array.isArray(e),n=e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e),r={};for(let i of e)if(i)for(let e in i){let a=i[e];if(a!==void 0)if(Array.isArray(a))r[e]=a;else if(n(a))r[e]=a;else if(t(a)){let n=r[e];t(n)?r[e]=oD(n,a):r[e]=oD(a)}else r[e]=a}return r}function sD(e,t){return oD(iD,e,t||{})}function cD(e,t){return oD(aD,e,t||{})}var lD=class{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:`webauthn`}))}async _challenge({factorId:e,webauthn:t,friendlyName:n,signal:r},i){try{let{data:a,error:o}=await this.client.mfa.challenge({factorId:e,webauthn:t});if(!a)return{data:null,error:o};let s=r??YE.createNewAbortSignal();if(a.webauthn.type===`create`){let{user:e}=a.webauthn.credential_options.publicKey;if(!e.name){let t=n;if(t)e.name=`${e.id}:${t}`;else{let t=(await this.client.getUser()).data.user,n=t?.user_metadata?.name||t?.email||t?.id||`User`;e.name=`${e.id}:${n}`}}e.displayName||=e.name}switch(a.webauthn.type){case`create`:{let{data:t,error:n}=await nD({publicKey:sD(a.webauthn.credential_options.publicKey,i?.create),signal:s});return t?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:t}},error:null}:{data:null,error:n}}case`request`:{let t=cD(a.webauthn.credential_options.publicKey,i?.request),{data:n,error:r}=await rD(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:t,signal:s}));return n?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:n}},error:null}:{data:null,error:r}}}}catch(e){return Q(e)?{data:null,error:e}:{data:null,error:new yT(`Unexpected error in challenge`,e)}}}async _verify({challengeId:e,factorId:t,webauthn:n}){return this.client.mfa.verify({factorId:t,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new gT(`rpId is required for WebAuthn authentication`)};try{if(!tD())return{data:null,error:new yT(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:t,rpOrigins:n},signal:r},{request:i});if(!a)return{data:null,error:o};let{webauthn:s}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:s.type,rpId:t,rpOrigins:n,credential_response:s.credential_response}})}catch(e){return Q(e)?{data:null,error:e}:{data:null,error:new yT(`Unexpected error in authenticate`,e)}}}async _register({friendlyName:e,webauthn:{rpId:t=typeof window<`u`?window.location.hostname:void 0,rpOrigins:n=typeof window<`u`?[window.location.origin]:void 0,signal:r}={}},i){if(!t)return{data:null,error:new gT(`rpId is required for WebAuthn registration`)};try{if(!tD())return{data:null,error:new yT(`Browser does not support WebAuthn`,null)};let{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(t=>t.data?.all.find(t=>t.factor_type===`webauthn`&&t.friendly_name===e&&t.status!==`unverified`)).then(e=>e?this.client.mfa.unenroll({factorId:e?.id}):void 0),{data:null,error:o};let{data:s,error:c}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:t,rpOrigins:n},signal:r},{create:i});return s?this._verify({factorId:a.id,challengeId:s.challengeId,webauthn:{rpId:t,rpOrigins:n,type:s.webauthn.type,credential_response:s.webauthn.credential_response}}):{data:null,error:c}}catch(e){return Q(e)?{data:null,error:e}:{data:null,error:new yT(`Unexpected error in register`,e)}}}};BE();var uD={url:uT,storageKey:dT,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:fT,flowType:`implicit`,debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function dD(e,t,n){return await n()}var fD={},pD=class e{get jwks(){return fD[this.storageKey]?.jwks??{keys:[]}}set jwks(e){fD[this.storageKey]=Object.assign(Object.assign({},fD[this.storageKey]),{jwks:e})}get jwks_cached_at(){return fD[this.storageKey]?.cachedAt??-(2**53-1)}set jwks_cached_at(e){fD[this.storageKey]=Object.assign(Object.assign({},fD[this.storageKey]),{cachedAt:e})}constructor(t){var n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;let r=Object.assign(Object.assign({},uD),t);if(this.storageKey=r.storageKey,this.instanceID=e.nextInstanceID[this.storageKey]??0,e.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!r.debug,typeof r.debug==`function`&&(this.logger=r.debug),this.instanceID>0&&qT()){let e=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(e),this.logDebugMessages&&console.trace(e)}if(this.persistSession=r.persistSession,this.autoRefreshToken=r.autoRefreshToken,this.experimental=r.experimental??{},this.admin=new PE({url:r.url,headers:r.headers,fetch:r.fetch,experimental:this.experimental}),this.url=r.url,this.headers=r.headers,this.fetch=ZT(r.fetch),this.lock=r.lock||dD,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,this.throwOnError=r.throwOnError,this.lockAcquireTimeout=r.lockAcquireTimeout,r.lock?this.lock=r.lock:this.persistSession&&qT()&&(globalThis==null?void 0:globalThis.navigator)?.locks?this.lock=zE:this.lock=dD,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=-(2**53-1)),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new lD(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(r.storage?this.storage=r.storage:YT()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=FE(this.memoryStorage)),r.userStorage&&(this.userStorage=r.userStorage)):(this.memoryStorage={},this.storage=FE(this.memoryStorage)),qT()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error(`Failed to create a new BroadcastChannel, multi-tab state changes will not be available`,e)}(n=this.broadcastChannel)==null||n.addEventListener(`message`,async e=>{this._debug(`received broadcast notification from other tab or client`,e);try{await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}catch(e){this._debug(`#broadcastChannel`,`error`,e)}})}r.skipAutoInitialize||this.initialize().catch(e=>{this._debug(`#initialize()`,`error`,e)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${sT}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise||=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise}async _initialize(){try{let e={},t=`none`;if(qT()&&(e=XT(window.location.href),this._isImplicitGrantCallback(e)?t=`implicit`:await this._isPKCECallback(e)&&(t=`pkce`)),qT()&&this.detectSessionInUrl&&t!==`none`){let{data:n,error:r}=await this._getSessionFromURL(e,t);if(r){if(this._debug(`#_initialize()`,`error detecting session from URL`,r),ET(r)){let e=r.details?.code;if(e===`identity_already_exists`||e===`identity_not_found`||e===`single_identity_not_deletable`)return{error:r}}return{error:r}}let{session:i,redirectType:a}=n;return this._debug(`#_initialize()`,`detected session in URL`,i,`redirect type`,a),await this._saveSession(i),setTimeout(async()=>{a===`recovery`?await this._notifyAllSubscribers(`PASSWORD_RECOVERY`,i):await this._notifyAllSubscribers(`SIGNED_IN`,i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return Q(e)?this._returnResult({error:e}):this._returnResult({error:new yT(`Unexpected error during initialization`,e)})}finally{await this._handleVisibilityChange(),this._debug(`#_initialize()`,`end`)}}async signInAnonymously(e){try{let{data:t,error:n}=await $(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{data:e?.options?.data??{},gotrue_meta_security:{captcha_token:e?.options?.captchaToken}},xform:EE});if(n||!t)return this._returnResult({data:{user:null,session:null},error:n});let r=t.session,i=t.user;return t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,r)),this._returnResult({data:{user:i,session:r},error:null})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signUp(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e,a=null,o=null;this.flowType===`pkce`&&([a,o]=await uE(this.storage,this.storageKey)),t=await $(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,redirectTo:i?.emailRedirectTo,body:{email:n,password:r,data:i?.data??{},gotrue_meta_security:{captcha_token:i?.captchaToken},code_challenge:a,code_challenge_method:o},xform:EE})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await $(this.fetch,`POST`,`${this.url}/signup`,{headers:this.headers,body:{phone:n,password:r,data:i?.data??{},channel:i?.channel??`sms`,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:EE})}else throw new wT(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r||!n)return await tE(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:r});let i=n.session,a=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,i)),this._returnResult({data:{user:a,session:i},error:null})}catch(e){if(await tE(this.storage,`${this.storageKey}-code-verifier`),Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithPassword(e){try{let t;if(`email`in e){let{email:n,password:r,options:i}=e;t=await $(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:DE})}else if(`phone`in e){let{phone:n,password:r,options:i}=e;t=await $(this.fetch,`POST`,`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:DE})}else throw new wT(`You must provide either an email or phone number and a password`);let{data:n,error:r}=t;if(r)return this._returnResult({data:{user:null,session:null},error:r});if(!n||!n.session||!n.user){let e=new CT;return this._returnResult({data:{user:null,session:null},error:e})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers(`SIGNED_IN`,n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:r})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOAuth(e){return await this._handleProviderSignIn(e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:e.options?.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){let{chain:t}=e;switch(t){case`ethereum`:return await this.signInWithEthereum(e);case`solana`:return await this.signInWithSolana(e);default:throw Error(`@supabase/auth-js: Unsupported chain "${t}"`)}}async signInWithEthereum(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!qT()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`ethereum`in e&&typeof e.ethereum==`object`&&`request`in e.ethereum&&typeof e.ethereum.request==`function`)s=e.ethereum;else throw Error(`@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href),l=await s.request({method:`eth_requestAccounts`}).then(e=>e).catch(()=>{throw Error(`@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid`)});if(!l||l.length===0)throw Error(`@supabase/auth-js: No accounts available. Please ensure the wallet is connected.`);let u=VE(l[0]),d=o?.signInWithEthereum?.chainId;d||=HE(await s.request({method:`eth_chainId`})),t=WE({domain:c.host,address:u,statement:a,uri:c.href,version:`1`,chainId:d,nonce:o?.signInWithEthereum?.nonce,issuedAt:o?.signInWithEthereum?.issuedAt??new Date,expirationTime:o?.signInWithEthereum?.expirationTime,notBefore:o?.signInWithEthereum?.notBefore,requestId:o?.signInWithEthereum?.requestId,resources:o?.signInWithEthereum?.resources}),n=await s.request({method:`personal_sign`,params:[UE(t),u]})}try{let{data:r,error:i}=await $(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`ethereum`,message:t,signature:n},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:EE});if(i)throw i;if(!r||!r.session||!r.user){let e=new CT;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSolana(e){let t,n;if(`message`in e)t=e.message,n=e.signature;else{let{chain:r,wallet:i,statement:a,options:o}=e,s;if(!qT()){if(typeof i!=`object`||!o?.url)throw Error(`@supabase/auth-js: Both wallet and url must be specified in non-browser environments.`);s=i}else if(typeof i==`object`)s=i;else{let e=window;if(`solana`in e&&typeof e.solana==`object`&&(`signIn`in e.solana&&typeof e.solana.signIn==`function`||`signMessage`in e.solana&&typeof e.solana.signMessage==`function`))s=e.solana;else throw Error(`@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.`)}let c=new URL(o?.url??window.location.href);if(`signIn`in s&&s.signIn){let e=await s.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},o?.signInWithSolana),{version:`1`,domain:c.host,uri:c.href}),a?{statement:a}:null)),r;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`)r=e[0];else if(e&&typeof e==`object`&&`signedMessage`in e&&`signature`in e)r=e;else throw Error(`@supabase/auth-js: Wallet method signIn() returned unrecognized value`);if(`signedMessage`in r&&`signature`in r&&(typeof r.signedMessage==`string`||r.signedMessage instanceof Uint8Array)&&r.signature instanceof Uint8Array)t=typeof r.signedMessage==`string`?r.signedMessage:new TextDecoder().decode(r.signedMessage),n=r.signature;else throw Error(`@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields`)}else{if(!(`signMessage`in s)||typeof s.signMessage!=`function`||!(`publicKey`in s)||typeof s!=`object`||!s.publicKey||!(`toBase58`in s.publicKey)||typeof s.publicKey.toBase58!=`function`)throw Error(`@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API`);t=[`${c.host} wants you to sign in with your Solana account:`,s.publicKey.toBase58(),...a?[``,a,``]:[``],`Version: 1`,`URI: ${c.href}`,`Issued At: ${o?.signInWithSolana?.issuedAt??new Date().toISOString()}`,...o?.signInWithSolana?.notBefore?[`Not Before: ${o.signInWithSolana.notBefore}`]:[],...o?.signInWithSolana?.expirationTime?[`Expiration Time: ${o.signInWithSolana.expirationTime}`]:[],...o?.signInWithSolana?.chainId?[`Chain ID: ${o.signInWithSolana.chainId}`]:[],...o?.signInWithSolana?.nonce?[`Nonce: ${o.signInWithSolana.nonce}`]:[],...o?.signInWithSolana?.requestId?[`Request ID: ${o.signInWithSolana.requestId}`]:[],...o?.signInWithSolana?.resources?.length?[`Resources`,...o.signInWithSolana.resources.map(e=>`- ${e}`)]:[]].join(` +`);let e=await s.signMessage(new TextEncoder().encode(t),`utf8`);if(!e||!(e instanceof Uint8Array))throw Error(`@supabase/auth-js: Wallet signMessage() API returned an recognized value`);n=e}}try{let{data:r,error:i}=await $(this.fetch,`POST`,`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:`solana`,message:t,signature:WT(n)},e.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options?.captchaToken}}:null),xform:EE});if(i)throw i;if(!r||!r.session||!r.user){let e=new CT;return this._returnResult({data:{user:null,session:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign({},r),error:i})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _exchangeCodeForSession(e){let[t,n]=(await eE(this.storage,`${this.storageKey}-code-verifier`)??``).split(`/`);try{if(!t&&this.flowType===`pkce`)throw new OT;let{data:r,error:i}=await $(this.fetch,`POST`,`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:EE});if(await tE(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!r||!r.session||!r.user){let e=new CT;return this._returnResult({data:{user:null,session:null,redirectType:null},error:e})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers(n===`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,r.session)),this._returnResult({data:Object.assign(Object.assign({},r),{redirectType:n??null}),error:i})}catch(e){if(await tE(this.storage,`${this.storageKey}-code-verifier`),Q(e))return this._returnResult({data:{user:null,session:null,redirectType:null},error:e});throw e}}async signInWithIdToken(e){try{let{options:t,provider:n,token:r,access_token:i,nonce:a}=e,{data:o,error:s}=await $(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:r,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:EE});if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!o||!o.session||!o.user){let e=new CT;return this._returnResult({data:{user:null,session:null},error:e})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(`SIGNED_IN`,o.session)),this._returnResult({data:o,error:s})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithOtp(e){try{if(`email`in e){let{email:t,options:n}=e,r=null,i=null;this.flowType===`pkce`&&([r,i]=await uE(this.storage,this.storageKey));let{error:a}=await $(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{email:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},code_challenge:r,code_challenge_method:i},redirectTo:n?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}if(`phone`in e){let{phone:t,options:n}=e,{data:r,error:i}=await $(this.fetch,`POST`,`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:n?.data??{},create_user:n?.shouldCreateUser??!0,gotrue_meta_security:{captcha_token:n?.captchaToken},channel:n?.channel??`sms`}});return this._returnResult({data:{user:null,session:null,messageId:r?.message_id},error:i})}throw new wT(`You must provide either an email or phone number.`)}catch(e){if(await tE(this.storage,`${this.storageKey}-code-verifier`),Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async verifyOtp(e){try{let t,n;`options`in e&&(t=e.options?.redirectTo,n=e.options?.captchaToken);let{data:r,error:i}=await $(this.fetch,`POST`,`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:t,xform:EE});if(i)throw i;if(!r)throw Error(`An error occurred on token verification.`);let a=r.session,o=r.user;return a?.access_token&&(await this._saveSession(a),await this._notifyAllSubscribers(e.type==`recovery`?`PASSWORD_RECOVERY`:`SIGNED_IN`,a)),this._returnResult({data:{user:o,session:a},error:null})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async signInWithSSO(e){try{let t=null,n=null;this.flowType===`pkce`&&([t,n]=await uE(this.storage,this.storageKey));let r=await $(this.fetch,`POST`,`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},`providerId`in e?{provider_id:e.providerId}:null),`domain`in e?{domain:e.domain}:null),{redirect_to:e.options?.redirectTo??void 0}),e?.options?.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:t,code_challenge_method:n}),headers:this.headers,xform:kE});return r.data?.url&&qT()&&!e.options?.skipBrowserRedirect&&window.location.assign(r.data.url),this._returnResult(r)}catch(e){if(await tE(this.storage,`${this.storageKey}-code-verifier`),Q(e))return this._returnResult({data:null,error:e});throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)throw n;if(!t)throw new xT;let{error:r}=await $(this.fetch,`GET`,`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return this._returnResult({data:{user:null,session:null},error:r})})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{let t=`${this.url}/resend`;if(`email`in e){let{email:n,type:r,options:i}=e,{error:a}=await $(this.fetch,`POST`,t,{headers:this.headers,body:{email:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if(`phone`in e){let{phone:n,type:r,options:i}=e,{data:a,error:o}=await $(this.fetch,`POST`,t,{headers:this.headers,body:{phone:n,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:o})}throw new wT(`You must provide either an email or phone number and a type`)}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug(`#_acquireLock`,`begin`,e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),n=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await n}catch{}})()),n}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug(`#_acquireLock`,`lock acquired for storage key`,this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch{}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug(`#_acquireLock`,`lock released for storage key`,this.storageKey),this.lockAcquired=!1}})}finally{this._debug(`#_acquireLock`,`end`)}}async _useSession(e){this._debug(`#_useSession`,`begin`);try{return await e(await this.__loadSession())}finally{this._debug(`#_useSession`,`end`)}}async __loadSession(){this._debug(`#__loadSession()`,`begin`),this.lockAcquired||this._debug(`#__loadSession()`,`used outside of an acquired lock!`,Error().stack);try{let e=null,t=await eE(this.storage,this.storageKey);if(this._debug(`#getSession()`,`session from storage`,t),t!==null&&(this._isValidSession(t)?e=t:(this._debug(`#getSession()`,`session from storage is not valid`),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at*1e3-Date.now()await this._getUser());return t.data.user&&(this.suppressGetSessionWarning=!0),t}async _getUser(e){try{return e?await $(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:e,xform:OE}):await this._useSession(async e=>{let{data:t,error:n}=e;if(n)throw n;return!t.session?.access_token&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new xT}:await $(this.fetch,`GET`,`${this.url}/user`,{headers:this.headers,jwt:t.session?.access_token??void 0,xform:OE})})}catch(e){if(Q(e))return ST(e)&&(await this._removeSession(),await tE(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:e});throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async n=>{let{data:r,error:i}=n;if(i)throw i;if(!r.session)throw new xT;let a=r.session,o=null,s=null;this.flowType===`pkce`&&e.email!=null&&([o,s]=await uE(this.storage,this.storageKey));let{data:c,error:l}=await $(this.fetch,`PUT`,`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:s}),jwt:a.access_token,xform:OE});if(l)throw l;return a.user=c.user,await this._saveSession(a),await this._notifyAllSubscribers(`USER_UPDATED`,a),this._returnResult({data:{user:a.user},error:null})})}catch(e){if(await tE(this.storage,`${this.storageKey}-code-verifier`),Q(e))return this._returnResult({data:{user:null},error:e});throw e}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new xT;let t=Date.now()/1e3,n=t,r=!0,i=null,{payload:a}=rE(e.access_token);if(a.exp&&(n=a.exp,r=n<=t),r){let{data:t,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return this._returnResult({data:{user:null,session:null},error:n});if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:r,error:a}=await this._getUser(e.access_token);if(a)return this._returnResult({data:{user:null,session:null},error:a});i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:`bearer`,expires_in:n-t,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers(`SIGNED_IN`,i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(e){if(Q(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{if(!e){let{data:n,error:r}=t;if(r)throw r;e=n.session??void 0}if(!e?.refresh_token)throw new xT;let{data:n,error:r}=await this._callRefreshToken(e.refresh_token);return r?this._returnResult({data:{user:null,session:null},error:r}):n?this._returnResult({data:{user:n.user,session:n},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(e){if(Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async _getSessionFromURL(e,t){try{if(!qT())throw new TT(`No browser detected.`);if(e.error||e.error_description||e.error_code)throw new TT(e.error_description||`Error in URL with unspecified error_description`,{error:e.error||`unspecified_error`,code:e.error_code||`unspecified_code`});switch(t){case`implicit`:if(this.flowType===`pkce`)throw new DT(`Not a valid PKCE flow url.`);break;case`pkce`:if(this.flowType===`implicit`)throw new TT(`Not a valid implicit grant flow url.`);break;default:}if(t===`pkce`){if(this._debug(`#_initialize()`,`begin`,`is PKCE flow`,!0),!e.code)throw new DT(`No code detected.`);let{data:t,error:n}=await this._exchangeCodeForSession(e.code);if(n)throw n;let r=new URL(window.location.href);return r.searchParams.delete(`code`),window.history.replaceState(window.history.state,``,r.toString()),{data:{session:t.session,redirectType:t.redirectType??null},error:null}}let{provider_token:n,provider_refresh_token:r,access_token:i,refresh_token:a,expires_in:o,expires_at:s,token_type:c}=e;if(!i||!o||!a||!c)throw new TT(`No session defined in URL`);let l=Math.round(Date.now()/1e3),u=parseInt(o),d=l+u;s&&(d=parseInt(s));let f=d-l;f*1e3<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);let p=d-u;l-p>=120?console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale`,p,d,l):l-p<0&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew`,p,d,l);let{data:m,error:h}=await this._getUser(i);if(h)throw h;let g={provider_token:n,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:a,token_type:c,user:m.user};return window.location.hash=``,this._debug(`#_getSessionFromURL()`,`clearing window.location.hash`),this._returnResult({data:{session:g,redirectType:e.type},error:null})}catch(e){if(Q(e))return this._returnResult({data:{session:null,redirectType:null},error:e});throw e}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl==`function`?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){let t=await eE(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:`global`}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:`global`}){return await this._useSession(async t=>{let{data:n,error:r}=t;if(r&&!ST(r))return this._returnResult({error:r});let i=n.session?.access_token;if(i){let{error:t}=await this.admin.signOut(i,e);if(t&&!(vT(t)&&(t.status===404||t.status===401||t.status===403)||ST(t)))return this._returnResult({error:t})}return e!==`others`&&(await this._removeSession(),await tE(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){let t=KT(),n={id:t,callback:e,unsubscribe:()=>{this._debug(`#unsubscribe()`,`state change callback with id removed`,t),this.stateChangeEmitters.delete(t)}};return this._debug(`#onAuthStateChange()`,`registered callback with id`,t),this.stateChangeEmitters.set(t,n),(async()=>{await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async t=>{try{let{data:{session:n},error:r}=t;if(r)throw r;await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,n),this._debug(`INITIAL_SESSION`,`callback id`,e,`session`,n)}catch(t){await this.stateChangeEmitters.get(e)?.callback(`INITIAL_SESSION`,null),this._debug(`INITIAL_SESSION`,`callback id`,e,`error`,t),ST(t)?console.warn(t):console.error(t)}})}async resetPasswordForEmail(e,t={}){let n=null,r=null;this.flowType===`pkce`&&([n,r]=await uE(this.storage,this.storageKey,!0));try{return await $(this.fetch,`POST`,`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(await tE(this.storage,`${this.storageKey}-code-verifier`),Q(e))return this._returnResult({data:null,error:e});throw e}}async getUserIdentities(){try{let{data:e,error:t}=await this.getUser();if(t)throw t;return this._returnResult({data:{identities:e.user.identities??[]},error:null})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async linkIdentity(e){return`token`in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){try{let{data:t,error:n}=await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;let i=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:e.options?.redirectTo,scopes:e.options?.scopes,queryParams:e.options?.queryParams,skipBrowserRedirect:!0});return await $(this.fetch,`GET`,i,{headers:this.headers,jwt:n.session?.access_token??void 0})});if(n)throw n;return qT()&&!e.options?.skipBrowserRedirect&&window.location.assign(t?.url),this._returnResult({data:{provider:e.provider,url:t?.url},error:null})}catch(t){if(Q(t))return this._returnResult({data:{provider:e.provider,url:null},error:t});throw t}}async linkIdentityIdToken(e){return await this._useSession(async t=>{try{let{error:n,data:{session:r}}=t;if(n)throw n;let{options:i,provider:a,token:o,access_token:s,nonce:c}=e,{data:l,error:u}=await $(this.fetch,`POST`,`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:r?.access_token??void 0,body:{provider:a,id_token:o,access_token:s,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:i?.captchaToken}},xform:EE});return u?this._returnResult({data:{user:null,session:null},error:u}):!l||!l.session||!l.user?this._returnResult({data:{user:null,session:null},error:new CT}):(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers(`USER_UPDATED`,l.session)),this._returnResult({data:l,error:u}))}catch(e){if(await tE(this.storage,`${this.storageKey}-code-verifier`),Q(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}})}async unlinkIdentity(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)throw r;return await $(this.fetch,`DELETE`,`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:n.session?.access_token??void 0})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,`begin`);try{let n=Date.now();return await aE(async n=>(n>0&&await iE(200*2**(n-1)),this._debug(t,`refreshing attempt`,n),await $(this.fetch,`POST`,`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:EE})),(e,t)=>{let r=200*2**e;return t&&AT(t)&&Date.now()+r-n<3e4})}catch(e){if(this._debug(t,`error`,e),Q(e))return this._returnResult({data:{session:null,user:null},error:e});throw e}finally{this._debug(t,`end`)}}_isValidSession(e){return typeof e==`object`&&!!e&&`access_token`in e&&`refresh_token`in e&&`expires_at`in e}async _handleProviderSignIn(e,t){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug(`#_handleProviderSignIn()`,`provider`,e,`options`,t,`url`,n),qT()&&!t.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){let e=`#_recoverAndRefresh()`;this._debug(e,`begin`);try{let t=await eE(this.storage,this.storageKey);if(t&&this.userStorage){let e=await eE(this.userStorage,this.storageKey+`-user`);!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!e&&(e={user:t.user},await $T(this.userStorage,this.storageKey+`-user`,e)),t.user=e?.user??vE()}else if(t&&!t.user&&!t.user){let e=await eE(this.storage,this.storageKey+`-user`);e&&e?.user?(t.user=e.user,await tE(this.storage,this.storageKey+`-user`),await $T(this.storage,this.storageKey,t)):t.user=vE()}if(this._debug(e,`session from storage`,t),!this._isValidSession(t)){this._debug(e,`session is not valid`),t!==null&&await this._removeSession();return}let n=(t.expires_at??1/0)*1e3-Date.now(){try{await n.callback(e,t)}catch(e){r.push(e)}});if(await Promise.all(i),r.length>0){for(let e=0;ethis._autoRefreshTokenTick(),cT);this.autoRefreshTicker=e,e&&typeof e==`object`&&typeof e.unref==`function`?e.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(e);let t=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=t,t&&typeof t==`object`&&typeof t.unref==`function`?t.unref():typeof Deno<`u`&&typeof Deno.unrefTimer==`function`&&Deno.unrefTimer(t)}async _stopAutoRefresh(){this._debug(`#_stopAutoRefresh()`);let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);let t=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,t&&clearTimeout(t)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug(`#_autoRefreshTokenTick()`,`begin`);try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:n}}=t;if(!n||!n.refresh_token||!n.expires_at){this._debug(`#_autoRefreshTokenTick()`,`no session`);return}let r=Math.floor((n.expires_at*1e3-e)/cT);this._debug(`#_autoRefreshTokenTick()`,`access token expires in ${r} ticks, a tick lasts ${cT}ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(n.refresh_token)})}catch(e){console.error(`Auto refresh tick failed with error. This is likely a transient error.`,e)}}finally{this._debug(`#_autoRefreshTokenTick()`,`end`)}})}catch(e){if(e instanceof LE)this._debug(`auto refresh token tick lock not available`);else throw e}}async _handleVisibilityChange(){if(this._debug(`#_handleVisibilityChange()`),!qT()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug(`#visibilityChangedCallback`,`error`,e)}},window==null||window.addEventListener(`visibilitychange`,this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error(`_handleVisibilityChange`,e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,`visibilityState`,document.visibilityState),document.visibilityState===`visible`?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!==`visible`){this._debug(t,`acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting`);return}await this._recoverAndRefresh()}))):document.visibilityState===`hidden`&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,n){let r=[`provider=${encodeURIComponent(t)}`];if(n?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&r.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType===`pkce`){let[e,t]=await uE(this.storage,this.storageKey),n=new URLSearchParams({code_challenge:`${encodeURIComponent(e)}`,code_challenge_method:`${encodeURIComponent(t)}`});r.push(n.toString())}if(n?.queryParams){let e=new URLSearchParams(n.queryParams);r.push(e.toString())}return n?.skipBrowserRedirect&&r.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${r.join(`&`)}`}async _unenroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;return r?this._returnResult({data:null,error:r}):await $(this.fetch,`DELETE`,`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:n?.session?.access_token})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _enroll(e){try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType===`phone`?{phone:e.phone}:e.factorType===`totp`?{issuer:e.issuer}:{}),{data:a,error:o}=await $(this.fetch,`POST`,`${this.url}/factors`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(e.factorType===`totp`&&a.type===`totp`&&a?.totp?.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),this._returnResult({data:a,error:null}))})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=Object.assign({challenge_id:e.challengeId},`webauthn`in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type===`create`?QE(e.webauthn.credential_response):$E(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:o}=await $(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/verify`,{body:i,headers:this.headers,jwt:n?.session?.access_token});return o?this._returnResult({data:null,error:o}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers(`MFA_CHALLENGE_VERIFIED`,a),this._returnResult({data:a,error:o}))})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async t=>{let{data:n,error:r}=t;if(r)return this._returnResult({data:null,error:r});let i=await $(this.fetch,`POST`,`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:n?.session?.access_token});if(i.error)return i;let{data:a}=i;if(a.type!==`webauthn`)return{data:a,error:null};switch(a.webauthn.type){case`create`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:XE(a.webauthn.credential_options.publicKey)})})}),error:null};case`request`:return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:ZE(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}})}async _challengeAndVerify(e){let{data:t,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let n={all:[],phone:[],totp:[],webauthn:[]};for(let t of e?.factors??[])n.all.push(t),t.status===`verified`&&n[t.factor_type].push(t);return{data:n,error:null}}async _getAuthenticatorAssuranceLevel(e){if(e)try{let{payload:t}=rE(e),n=null;t.aal&&(n=t.aal);let r=n,{data:{user:i},error:a}=await this.getUser(e);if(a)return this._returnResult({data:null,error:a});((i?.factors)?.filter(e=>e.status===`verified`)??[]).length>0&&(r=`aal2`);let o=t.amr||[];return{data:{currentLevel:n,nextLevel:r,currentAuthenticationMethods:o},error:null}}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}let{data:{session:t},error:n}=await this.getSession();if(n)return this._returnResult({data:null,error:n});if(!t)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let{payload:r}=rE(t.access_token),i=null;r.aal&&(i=r.aal);let a=i;(t.user.factors?.filter(e=>e.status===`verified`)??[]).length>0&&(a=`aal2`);let o=r.amr||[];return{data:{currentLevel:i,nextLevel:a,currentAuthenticationMethods:o},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await $(this.fetch,`GET`,`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new xT})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _approveAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new xT});let a=await $(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`approve`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&qT()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _denyAuthorization(e,t){try{return await this._useSession(async n=>{let{data:{session:r},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!r)return this._returnResult({data:null,error:new xT});let a=await $(this.fetch,`POST`,`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:r.access_token,body:{action:`deny`},xform:e=>({data:e,error:null})});return a.data&&a.data.redirect_url&&qT()&&!t?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _listOAuthGrants(){try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;return n?this._returnResult({data:null,error:n}):t?await $(this.fetch,`GET`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})}):this._returnResult({data:null,error:new xT})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?(await $(this.fetch,`DELETE`,`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new xT})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async fetchJwk(e,t={keys:[]}){let n=t.keys.find(t=>t.kid===e);if(n)return n;let r=Date.now();if(n=this.jwks.keys.find(t=>t.kid===e),n&&this.jwks_cached_at+6e5>r)return n;let{data:i,error:a}=await $(this.fetch,`GET`,`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=r,n=i.keys.find(t=>t.kid===e),!n)?null:n}async getClaims(e,t={}){try{let n=e;if(!n){let{data:e,error:t}=await this.getSession();if(t||!e.session)return this._returnResult({data:null,error:t});n=e.session.access_token}let{header:r,payload:i,signature:a,raw:{header:o,payload:s}}=rE(n);t?.allowExpired||pE(i.exp);let c=!r.alg||r.alg.startsWith(`HS`)||!r.kid||!(`crypto`in globalThis&&`subtle`in globalThis.crypto)?null:await this.fetchJwk(r.kid,t?.keys?{keys:t.keys}:t?.jwks);if(!c){let{error:e}=await this.getUser(n);if(e)throw e;return{data:{claims:i,header:r,signature:a},error:null}}let l=mE(r.alg),u=await crypto.subtle.importKey(`jwk`,c,l,!0,[`verify`]);if(!await crypto.subtle.verify(l,u,a,UT(`${o}.${s}`)))throw new MT(`Invalid JWT signature`);return{data:{claims:i,header:r,signature:a},error:null}}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async signInWithPasskey(e){_E(this.experimental);try{if(!tD())return this._returnResult({data:null,error:new yT(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyAuthentication({options:{captchaToken:e?.options?.captchaToken}});if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await rD({publicKey:ZE(t.options),signal:e?.options?.signal??YE.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new yT(`WebAuthn ceremony failed`,null)});let a=$E(r);return this._verifyPasskeyAuthentication({challengeId:t.challenge_id,credential:a})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async registerPasskey(e){_E(this.experimental);try{if(!tD())return this._returnResult({data:null,error:new yT(`Browser does not support WebAuthn`,null)});let{data:t,error:n}=await this._startPasskeyRegistration();if(n||!t)return this._returnResult({data:null,error:n});let{data:r,error:i}=await nD({publicKey:XE(t.options),signal:e?.options?.signal??YE.createNewAbortSignal()});if(i||!r)return this._returnResult({data:null,error:i??new yT(`WebAuthn ceremony failed`,null)});let a=QE(r);return this._verifyPasskeyRegistration({challengeId:t.challenge_id,credential:a})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyRegistration(){_E(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new xT});let{data:r,error:i}=await $(this.fetch,`POST`,`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:t.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){_E(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new xT});let{data:i,error:a}=await $(this.fetch,`POST`,`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _startPasskeyAuthentication(e){_E(this.experimental);try{let{data:t,error:n}=await $(this.fetch,`POST`,`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:e?.options?.captchaToken}}});return n?this._returnResult({data:null,error:n}):this._returnResult({data:t,error:null})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyAuthentication(e){_E(this.experimental);try{let{data:t,error:n}=await $(this.fetch,`POST`,`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:EE});return n?this._returnResult({data:null,error:n}):(t.session&&(await this._saveSession(t.session),await this._notifyAllSubscribers(`SIGNED_IN`,t.session)),this._returnResult({data:t,error:null}))}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _listPasskeys(){_E(this.experimental);try{return await this._useSession(async e=>{let{data:{session:t},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!t)return this._returnResult({data:null,error:new xT});let{data:r,error:i}=await $(this.fetch,`GET`,`${this.url}/passkeys`,{headers:this.headers,jwt:t.access_token,xform:e=>({data:e,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:r,error:null})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){_E(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new xT});let{data:i,error:a}=await $(this.fetch,`PATCH`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}async _deletePasskey(e){_E(this.experimental);try{return await this._useSession(async t=>{let{data:{session:n},error:r}=t;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new xT});let{error:i}=await $(this.fetch,`DELETE`,`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(e){if(Q(e))return this._returnResult({data:null,error:e});throw e}}};pD.nextInstanceID={};var mD=pD,hD=`modulepreload`,gD=function(e){return`/`+e},_D={},vD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=gD(t,n),t in _D)return;_D[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:hD,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},yD=`2.106.2`,bD=``;bD=typeof Deno<`u`?`deno`:typeof document<`u`?`web`:typeof navigator<`u`&&navigator.product===`ReactNative`?`react-native`:`node`;var xD={headers:{"X-Client-Info":`supabase-js-${bD}/${yD}`}},SD={schema:`public`},CD={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:`implicit`},wD={},TD={enabled:!1,respectSamplingDecision:!0};function ED(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var DD=null,OD=`@opentelemetry/api`;function kD(){return DD===null&&(DD=vD(()=>import(OD),[]).catch(()=>null)),DD}function AD(){return ED(this,void 0,void 0,function*(){try{let e=yield kD();if(!e||!e.propagation||!e.context)return null;let t={};e.propagation.inject(e.context.active(),t);let n=t.traceparent;return n?{traceparent:n,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function jD(e){if(!e||typeof e!=`string`)return null;let t=e.split(`-`);if(t.length!==4)return null;let[n,r,i,a]=t;if(n.length!==2||r.length!==32||i.length!==16||a.length!==2)return null;let o=/^[0-9a-f]+$/i;return!o.test(n)||!o.test(r)||!o.test(i)||!o.test(a)||r===`00000000000000000000000000000000`||i===`0000000000000000`?null:{version:n,traceId:r,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)==1}}function MD(e,t){if(!e||!t||t.length===0)return!1;let n;if(e instanceof URL)n=e;else try{n=new URL(e)}catch{return!1}for(let e of t)try{if(typeof e==`string`){if(ND(n.hostname,e))return!0}else if(e instanceof RegExp){if(e.test(n.hostname))return!0}else if(typeof e==`function`&&e(n))return!0}catch{continue}return!1}function ND(e,t){if(t===e)return!0;if(t.startsWith(`*.`)){let n=t.slice(2);if(e.endsWith(n)&&(e===n||e.endsWith(`.`+n)))return!0}return!1}function PD(e){let t=[];try{let n=new URL(e);t.push(n.hostname)}catch{}return t.push(`*.supabase.co`,`*.supabase.in`),t.push(`localhost`,`127.0.0.1`,`[::1]`),t}function FD(e){"@babel/helpers - typeof";return FD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},FD(e)}function ID(e,t){if(FD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(FD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function LD(e){var t=ID(e,`string`);return FD(t)==`symbol`?t:t+``}function RD(e,t,n){return(t=LD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BD(e){for(var t=1;te?(...t)=>e(...t):(...e)=>fetch(...e),HD=()=>Headers,UD=(e,t,n,r,i)=>{let a=VD(r),o=HD(),s=i?.enabled===!0,c=i?.respectSamplingDecision!==!1,l=s?PD(t):null;return async(t,r)=>{let i=await n()??e,s=new o(r?.headers);if(s.has(`apikey`)||s.set(`apikey`,e),s.has(`Authorization`)||s.set(`Authorization`,`Bearer ${i}`),l){let e=await WD(t,l,c);e&&(e.traceparent&&!s.has(`traceparent`)&&s.set(`traceparent`,e.traceparent),e.tracestate&&!s.has(`tracestate`)&&s.set(`tracestate`,e.tracestate),e.baggage&&!s.has(`baggage`)&&s.set(`baggage`,e.baggage))}return a(t,BD(BD({},r),{},{headers:s}))}};async function WD(e,t,n){if(!MD(typeof e==`string`||e instanceof URL?e:e.url,t))return null;let r=await AD();if(!r||!r.traceparent)return null;if(n){let e=jD(r.traceparent);if(e&&!e.isSampled)return null}return r}function GD(e){return typeof e==`boolean`?{enabled:e}:e}function KD(e){return e.endsWith(`/`)?e:e+`/`}function qD(e,t){let{db:n,auth:r,realtime:i,global:a}=e,{db:o,auth:s,realtime:c,global:l}=t,u=GD(e.tracePropagation),d=GD(t.tracePropagation),f={db:BD(BD({},o),n),auth:BD(BD({},s),r),realtime:BD(BD({},c),i),storage:{},global:BD(BD(BD({},l),a),{},{headers:BD(BD({},l?.headers??{}),a?.headers??{})}),tracePropagation:{enabled:u?.enabled??d?.enabled??!1,respectSamplingDecision:u?.respectSamplingDecision??d?.respectSamplingDecision??!0},accessToken:async()=>``};return e.accessToken?f.accessToken=e.accessToken:delete f.accessToken,f}function JD(e){let t=e?.trim();if(!t)throw Error(`supabaseUrl is required.`);if(!t.match(/^https?:\/\//i))throw Error(`Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.`);try{return new URL(KD(t))}catch{throw Error(`Invalid supabaseUrl: Provided URL is malformed.`)}}var YD=class extends mD{constructor(e){super(e)}},XD=class{constructor(e,t,n){this.supabaseUrl=e,this.supabaseKey=t;let r=JD(e);if(!t)throw Error(`supabaseKey is required.`);this.realtimeUrl=new URL(`realtime/v1`,r),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace(`http`,`ws`),this.authUrl=new URL(`auth/v1`,r),this.storageUrl=new URL(`storage/v1`,r),this.functionsUrl=new URL(`functions/v1`,r);let i=`sb-${r.hostname.split(`.`)[0]}-auth-token`,a={db:SD,realtime:wD,auth:BD(BD({},CD),{},{storageKey:i}),global:xD,tracePropagation:TD},o=qD(n??{},a);this.settings=o,this.storageKey=o.auth.storageKey??``,this.headers=o.global.headers??{},o.accessToken?(this.accessToken=o.accessToken,this.auth=new Proxy({},{get:(e,t)=>{throw Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(t)} is not possible`)}})):this.auth=this._initSupabaseAuthClient(o.auth??{},this.headers,o.global.fetch),this.fetch=UD(t,e,this._getAccessToken.bind(this),o.global.fetch,o.tracePropagation),this.realtime=this._initRealtimeClient(BD({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},o.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(e=>this.realtime.setAuth(e)).catch(e=>console.warn(`Failed to set initial Realtime auth token:`,e)),this.rest=new XS(new URL(`rest/v1`,r).href,{headers:this.headers,schema:o.db.schema,fetch:this.fetch,timeout:o.db.timeout,urlLengthLimit:o.db.urlLengthLimit}),this.storage=new oT(this.storageUrl.href,this.headers,this.fetch,n?.storage),o.accessToken||this._listenForAuthEvents()}get functions(){return new jS(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this;if(e.accessToken)return await e.accessToken();let{data:t}=await e.auth.getSession();return t.session?.access_token??e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:a,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:f},p,m){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new YD({url:this.authUrl.href,headers:BD(BD({},h),p),storageKey:a,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:o,lock:s,debug:c,throwOnError:l,experimental:u,fetch:m,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(e=>e.toLowerCase()===`authorization`)})}_initRealtimeClient(e){return new sw(this.realtimeUrl.href,BD(BD({},e),{},{params:BD(BD({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,`CLIENT`,t?.access_token)})}_handleTokenChanged(e,t,n){(e===`TOKEN_REFRESHED`||e===`SIGNED_IN`)&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e===`SIGNED_OUT`&&(this.realtime.setAuth(),t==`STORAGE`&&this.auth.signOut(),this.changedAccessToken=void 0)}},ZD=(e,t,n)=>new XD(e,t,n);function QD(){if(typeof window<`u`)return!1;let e=globalThis.process;if(!e)return!1;let t=e.version;if(t==null)return!1;let n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}QD()&&console.warn(`⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217`);var $D=`https://rehavit.beroth.moe/supabase`,eO=`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzc2NTU4OTc2LCJleHAiOjE5MzQyMzg5NzZ9.eFvvIQUstht8TxNffqAcqfmgS7W2JMZsDxkV41XBPOA`,tO=`campaign-media`,nO=ZD($D,eO);function rO({onCollapseClick:e,collapsed:t}){let n=Df(),r=rr(),{mode:i,toggleTheme:a}=Zf(),[o,s]=(0,_.useState)(``);return(0,_.useEffect)(()=>{nO.auth.getSession().then(({data:{session:e}})=>{e?.user?.email&&s(e.user.email)});let{data:{subscription:e}}=nO.auth.onAuthStateChange((e,t)=>{s(t?.user?.email||``)});return()=>e.unsubscribe()},[]),(0,z.jsx)(Nh,{position:`fixed`,sx:{width:{md:`calc(100% - ${t?72:240}px)`},ml:{md:`${t?72:240}px`},transition:n.transitions.create([`width`,`margin`],{easing:n.transitions.easing.sharp,duration:n.transitions.duration.enteringScreen})},children:(0,z.jsxs)(Kx,{children:[(0,z.jsx)(uh,{color:`inherit`,onClick:e,sx:{mr:2,display:{xs:`none`,md:`flex`}},children:t?(0,z.jsx)(bS,{}):(0,z.jsx)(yS,{})}),(0,z.jsx)(Oh,{variant:`h6`,component:`div`,sx:{flexGrow:1},children:`Panel de Campañas`}),o&&(0,z.jsx)(Oh,{variant:`caption`,sx:{mr:2,display:{xs:`none`,sm:`block`}},children:o}),(0,z.jsx)(uh,{color:`inherit`,onClick:a,sx:{mr:1},children:i===`dark`?(0,z.jsx)(SS,{}):(0,z.jsx)(xS,{})}),(0,z.jsx)(Ug,{color:`inherit`,onClick:async()=>{await nO.auth.signOut(),r({to:`/login`})},children:`Cerrar Sesión`})]})})}var iO=ap((0,z.jsx)(`path`,{d:`M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm11.5 3c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34`}),`Campaign`),aO=ap((0,z.jsx)(`path`,{d:`M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z`}),`Chat`),oO=ap((0,z.jsx)(`path`,{d:`M2 6H0v5h.01L0 20c0 1.1.9 2 2 2h18v-2H2zm20-2h-8l-2-2H6c-1.1 0-1.99.9-1.99 2L4 16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2M7 15l4.5-6 3.5 4.51 2.5-3.01L21 15z`}),`PermMedia`),sO=240,cO=72,lO=[{path:`/campaigns`,label:`Campañas`,icon:(0,z.jsx)(iO,{})},{path:`/sessions`,label:`Sesiones`,icon:(0,z.jsx)(aO,{})},{path:`/media`,label:`Archivos`,icon:(0,z.jsx)(oO,{})}];function uO({collapsed:e}){let t=Br();return(0,z.jsxs)(Mv,{variant:`permanent`,sx:{display:{xs:`none`,md:`block`},width:e?cO:sO,flexShrink:0,"& .MuiDrawer-paper":{boxSizing:`border-box`,width:e?cO:sO,overflowX:`hidden`,transition:e=>e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})}},open:!0,children:[(0,z.jsx)(Kx,{}),(0,z.jsx)(Cy,{children:lO.map(n=>(0,z.jsx)(zy,{disablePadding:!0,children:(0,z.jsxs)(Ay,{component:_r,to:n.path,selected:t.pathname===n.path,sx:{minHeight:48},children:[(0,z.jsx)(Wy,{sx:{minWidth:0,mr:e?`auto`:2,justifyContent:`center`},children:n.icon}),!e&&(0,z.jsx)(Yy,{primary:n.label})]})},n.path))})]})}function dO(){let e=Df(),[t,n]=(0,_.useState)(!1),r=rr(),i=Br();return(0,z.jsxs)(jg,{sx:{display:`flex`,minHeight:`100vh`},children:[(0,z.jsx)(rO,{onCollapseClick:()=>n(e=>!e),collapsed:t}),(0,z.jsx)(uO,{collapsed:t}),(0,z.jsxs)(jg,{component:`main`,sx:{flexGrow:1,p:{xs:2,md:3},mt:`64px`,minWidth:0,width:{md:`calc(100% - ${t?72:240}px)`},transition:e.transitions.create(`width`,{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen})},children:[(0,z.jsx)(ym,{elevation:0,sx:{display:{md:`none`},mb:2,borderRadius:3,border:`1px solid`,borderColor:`divider`,bgcolor:`background.paper`},children:(0,z.jsxs)(pS,{value:i.pathname,onChange:(e,t)=>r({to:t}),variant:`fullWidth`,textColor:`primary`,indicatorColor:`primary`,children:[(0,z.jsx)(Hx,{label:`Campañas`,value:`/campaigns`}),(0,z.jsx)(Hx,{label:`Sesiones`,value:`/sessions`}),(0,z.jsx)(Hx,{label:`Archivos`,value:`/media`})]})}),(0,z.jsx)(jr,{})]})]})}function fO(){let e=rr(),[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(``),[s,c]=(0,_.useState)(!1);return(0,z.jsx)(jg,{sx:{minHeight:`100vh`,display:`flex`,alignItems:`center`,justifyContent:`center`,p:3},children:(0,z.jsx)(qg,{sx:{width:`100%`,maxWidth:420},children:(0,z.jsxs)(Zg,{children:[(0,z.jsx)(Oh,{variant:`h5`,component:`h1`,gutterBottom:!0,children:`Panel de Campañas`}),(0,z.jsx)(Oh,{variant:`body2`,color:`text.secondary`,gutterBottom:!0,children:`Inicia sesión para gestionar campañas, sesiones y archivos.`}),(0,z.jsxs)(jg,{component:`form`,onSubmit:async n=>{n.preventDefault(),o(``),c(!0);let{error:i}=await nO.auth.signInWithPassword({email:t.trim(),password:r.trim()});if(c(!1),i){o(i.message);return}e({to:`/campaigns`})},sx:{mt:3},children:[(0,z.jsx)(vS,{fullWidth:!0,label:`Correo`,type:`email`,margin:`normal`,value:t,onChange:e=>n(e.target.value),required:!0}),(0,z.jsx)(vS,{fullWidth:!0,label:`Contraseña`,type:`password`,margin:`normal`,value:r,onChange:e=>i(e.target.value),required:!0}),a&&(0,z.jsx)(Sh,{severity:`error`,sx:{mt:2},children:a}),(0,z.jsx)(Ug,{type:`submit`,fullWidth:!0,variant:`contained`,sx:{mt:2},disabled:s,children:`Entrar`})]})]})})})}function pO(){return fa({queryKey:[`campaigns`],queryFn:async()=>{let{data:e,error:t}=await nO.from(`campaigns`).select(`*`).order(`created_at`,{ascending:!1});if(t)throw Error(t.message);return e||[]}})}function mO(){return fa({queryKey:[`mediaCampaignIds`],queryFn:async()=>{let{data:e,error:t}=await nO.from(`media`).select(`campaign_id`);if(t)throw Error(t.message);return new Set(e?.map(e=>e.campaign_id)||[])}})}function hO(){let e=Zi();return pa({mutationFn:async({name:e,promt:t})=>{let{error:n}=await nO.from(`campaigns`).insert([{name:e,promt:t,active:!0}]);if(n)throw Error(n.message)},onSuccess:()=>{e.invalidateQueries({queryKey:[`campaigns`]})}})}function gO(){let e=Zi();return pa({mutationFn:async({id:e,name:t,keywords:n,promt:r,send_welcome_photos:i,active:a})=>{let{error:o}=await nO.from(`campaigns`).update({name:t,keywords:n,promt:r,send_welcome_photos:i,active:a}).eq(`id`,e);if(o)throw Error(o.message)},onSuccess:()=>{e.invalidateQueries({queryKey:[`campaigns`]})}})}function _O(){let e=Zi();return pa({mutationFn:async e=>{let{error:t}=await nO.from(`campaigns`).delete().eq(`id`,e);if(t)throw Error(t.message)},onSuccess:()=>{e.invalidateQueries({queryKey:[`campaigns`]})}})}function vO(){let[e,t]=(0,_.useState)(``),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),c=hO();return(0,z.jsx)(qg,{children:(0,z.jsxs)(Zg,{children:[(0,z.jsx)(Oh,{variant:`h6`,gutterBottom:!0,children:`Crear Campaña`}),(0,z.jsxs)(jg,{component:`form`,onSubmit:async i=>{if(i.preventDefault(),a(``),s(``),!e.trim()){s(`El nombre de la campaña es obligatorio.`);return}try{await c.mutateAsync({name:e.trim(),promt:n.trim()}),t(``),r(``),a(`¡Campaña creada!`)}catch(e){s(e.message)}},children:[(0,z.jsx)(vS,{fullWidth:!0,label:`Nombre de campaña`,margin:`normal`,value:e,onChange:e=>t(e.target.value),required:!0}),(0,z.jsx)(vS,{fullWidth:!0,label:`Instrucciones para IA (opcional)`,margin:`normal`,multiline:!0,rows:2,value:n,onChange:e=>r(e.target.value)}),(0,z.jsx)(Ug,{type:`submit`,fullWidth:!0,variant:`contained`,sx:{mt:1},disabled:c.isPending,children:`Crear Campaña`}),i&&(0,z.jsx)(Sh,{severity:`success`,sx:{mt:2},children:i}),o&&(0,z.jsx)(Sh,{severity:`error`,sx:{mt:2},children:o})]})]})})}function yO(e){try{return new Date(e).toLocaleString()}catch{return e}}function bO({campaign:e,hasMedia:t,onEdit:n}){let r=_O(),i=async()=>{window.confirm(`¿Eliminar esta campaña?`)&&r.mutate(e.id)},a=e.active===!1?`error`:`success`,o=e.active===!1?`Inactiva`:`Activa`,s=Array.isArray(e.keywords)?e.keywords.join(`, `):``;return(0,z.jsx)(qg,{sx:{mb:2},children:(0,z.jsx)(Zg,{children:(0,z.jsxs)(jg,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`,gap:2},children:[(0,z.jsxs)(jg,{sx:{flex:1,minWidth:0},children:[(0,z.jsxs)(jg,{sx:{display:`flex`,alignItems:`center`,gap:1,flexWrap:`wrap`},children:[(0,z.jsx)(Oh,{variant:`h6`,noWrap:!0,children:e.name}),(0,z.jsx)(Kh,{size:`small`,color:a,label:o})]}),e.send_welcome_photos&&(0,z.jsx)(Oh,{variant:`caption`,color:`primary`,display:`block`,sx:{mt:.5},children:`📸 Requiere Fotos de Bienvenida`}),s&&(0,z.jsxs)(Oh,{variant:`caption`,display:`block`,color:`text.secondary`,sx:{mt:.5},children:[(0,z.jsx)(`strong`,{children:`Palabras clave:`}),` `,s]}),e.promt&&(0,z.jsxs)(Oh,{variant:`caption`,display:`block`,color:`text.secondary`,sx:{mt:.5,display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:[(0,z.jsx)(`strong`,{children:`Instrucciones:`}),` `,e.promt]}),(0,z.jsxs)(Oh,{variant:`caption`,display:`block`,color:`text.disabled`,sx:{mt:1,overflowWrap:`anywhere`},children:[`Creada: `,yO(e.created_at),` • ID: `,e.id.split(`-`)[0],`...`]})]}),(0,z.jsxs)(jg,{sx:{display:`flex`,flexDirection:`column`,gap:1,minWidth:0},children:[t&&(0,z.jsx)(Ug,{size:`small`,variant:`contained`,href:`/gallery?campaign_id=${e.id}`,target:`_blank`,rel:`noopener noreferrer`,children:`Galería`}),(0,z.jsx)(Ug,{size:`small`,variant:`outlined`,onClick:n,children:`Editar`}),(0,z.jsx)(Ug,{size:`small`,variant:`outlined`,color:`error`,onClick:i,disabled:r.isPending,children:`Eliminar`})]})]})})})}function xO({campaign:e,onClose:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(!0),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),g=gO();return(0,_.useEffect)(()=>{e&&(r(e.name||``),a(Array.isArray(e.keywords)?e.keywords.join(`, `):``),s(e.promt||``),l(e.send_welcome_photos===!0),d(e.active!==!1),p(``),h(``))},[e]),(0,z.jsxs)(Z_,{open:!!e,onClose:t,fullWidth:!0,maxWidth:`sm`,children:[(0,z.jsx)(uv,{children:`Editar Campaña`}),(0,z.jsx)(sv,{children:(0,z.jsxs)(jg,{sx:{pt:1},children:[(0,z.jsx)(vS,{fullWidth:!0,label:`Nombre`,margin:`dense`,value:n,onChange:e=>r(e.target.value)}),(0,z.jsx)(vS,{fullWidth:!0,label:`Palabras clave (separadas por coma)`,margin:`dense`,placeholder:`ej. casa, piscina, jardín`,value:i,onChange:e=>a(e.target.value)}),(0,z.jsx)(vS,{fullWidth:!0,label:`Instrucciones para IA`,margin:`dense`,multiline:!0,rows:3,value:o,onChange:e=>s(e.target.value)}),(0,z.jsx)(Kv,{control:(0,z.jsx)(p_,{checked:c,onChange:e=>l(e.target.checked)}),label:`Requerir Fotos de Bienvenida`}),(0,z.jsx)(Kv,{control:(0,z.jsx)(p_,{checked:u,onChange:e=>d(e.target.checked)}),label:`Campaña Activa`}),f&&(0,z.jsx)(Sh,{severity:`success`,sx:{mt:1},children:f}),m&&(0,z.jsx)(Sh,{severity:`error`,sx:{mt:1},children:m})]})}),(0,z.jsxs)(tv,{children:[(0,z.jsx)(Ug,{onClick:t,children:`Cancelar`}),(0,z.jsx)(Ug,{onClick:async()=>{if(p(``),h(``),!n.trim()){h(`El nombre es obligatorio.`);return}let r=i?i.split(`,`).map(e=>e.trim()).filter(e=>e.length>0):[];try{await g.mutateAsync({id:e.id,name:n.trim(),keywords:r,promt:o.trim(),send_welcome_photos:c,active:u}),p(`¡Guardado!`),t()}catch(e){h(e.message)}},variant:`contained`,disabled:g.isPending,children:`Guardar Cambios`})]})]})}function SO(){let{data:e,isLoading:t}=pO(),{data:n}=mO(),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(null),s=r?e:e?.filter(e=>e.active!==!1);return t?(0,z.jsx)(jg,{sx:{display:`flex`,justifyContent:`center`,mt:4},children:(0,z.jsx)(ih,{})}):(0,z.jsxs)(jg,{children:[(0,z.jsx)(vO,{}),(0,z.jsxs)(jg,{sx:{mt:3},children:[(0,z.jsxs)(jg,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,mb:2},children:[(0,z.jsx)(Oh,{variant:`h6`,children:`Lista de Campañas`}),(0,z.jsx)(Ug,{variant:`outlined`,size:`small`,onClick:()=>i(e=>!e),children:r?`Ocultar Inactivas`:`Mostrar Inactivas`})]}),s?.map(e=>(0,z.jsx)(bO,{campaign:e,hasMedia:n?.has(e.id),onEdit:()=>o(e)},e.id)),s?.length===0&&(0,z.jsx)(Oh,{color:`text.secondary`,children:`No se encontraron campañas.`})]}),(0,z.jsx)(xO,{campaign:a,onClose:()=>o(null)})]})}function CO(e=``){return fa({queryKey:[`sessions`,e],queryFn:async()=>{let t=nO.from(`sessions`).select(`*`).order(`created_at`,{ascending:!1}).limit(100);e&&(t=t.eq(`campaign_id`,e));let{data:n,error:r}=await t;if(r)throw Error(r.message);return n||[]}})}function wO(){let e=Zi();return pa({mutationFn:async({phone:e})=>{let{error:t}=await nO.from(`sessions`).update({block:!0}).eq(`phone`,e);if(t)throw Error(t.message)},onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]})}})}function TO(){let e=Zi();return pa({mutationFn:async({phone:e})=>{let{error:t}=await nO.from(`sessions`).update({block:!1}).eq(`phone`,e);if(t)throw Error(t.message)},onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]})}})}function EO(){let e=Zi();return pa({mutationFn:async({id:e,phone:t})=>{let{error:n}=await nO.from(`n8n_chat_histories`).delete().eq(`session_id`,e);if(n)throw Error(n.message);let{error:r}=await nO.from(`sessions`).delete().eq(`id`,e);if(r)throw Error(r.message);return{id:e,phone:t}},onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]})}})}function DO(e){return fa({queryKey:[`chatHistory`,e],queryFn:async()=>{if(!e)return[];let{data:t,error:n}=await nO.from(`n8n_chat_histories`).select(`*`).eq(`session_id`,e).order(`id`,{ascending:!0});if(n)throw Error(n.message);return t||[]},enabled:!!e})}var OO=`https://n8n.beroth.moe/webhook/send-msg`,kO=`PLACEHOLDER_XTOKEN`;function AO(){let e=Zi();return pa({mutationFn:async({sessionId:e,message:t})=>{let n=await fetch(OO,{method:`POST`,headers:{"Content-Type":`application/json`,xtoken:kO},body:JSON.stringify({phone:e,msg:t})});if(!n.ok){let e=await n.text().catch(()=>`Unknown error`);throw Error(`Webhook error ${n.status}: ${e}`)}let{error:r}=await nO.from(`n8n_chat_histories`).insert({session_id:e,message:{type:`ai`,content:t,additional_kwargs:{},response_metadata:{},tool_calls:[],invalid_tool_calls:[]}});if(r)throw Error(r.message)},onSuccess:(t,{sessionId:n})=>{e.invalidateQueries({queryKey:[`chatHistory`,n]})}})}var jO=ap((0,z.jsx)(`path`,{d:`M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2`}),`MoreVert`);function MO(e){try{return new Date(e).toLocaleString()}catch{return e}}function NO({session:e,onBlock:t,onChat:n}){let[r,i]=(0,_.useState)(null),a=EO(),o=TO(),s=async()=>{i(null),window.confirm(`¿Eliminar la sesión de ${e.phone||`desconocido`} y todo su historial de chat?`)&&a.mutate({id:e.id,phone:e.phone})},c=async()=>{i(null),window.confirm(`Desbloquear sesión para ${e.phone}?`)&&o.mutate({phone:e.phone})},l=()=>{i(null),n(e)},u=e.finished?`success`:`warning`,d=e.finished?`Finalizada`:`Activa`;return(0,z.jsxs)(qg,{sx:{mb:2},children:[(0,z.jsx)(Zg,{children:(0,z.jsxs)(jg,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`flex-start`},children:[(0,z.jsxs)(jg,{sx:{flex:1,minWidth:0},children:[(0,z.jsxs)(jg,{sx:{display:`flex`,alignItems:`center`,gap:1,flexWrap:`wrap`},children:[(0,z.jsxs)(Oh,{variant:`subtitle1`,sx:{fontWeight:600,overflowWrap:`anywhere`},children:[e.name||`Teléfono: ${e.phone||`desconocido`}`,e.name&&e.phone&&(0,z.jsxs)(Oh,{component:`span`,variant:`caption`,color:`text.secondary`,sx:{ml:1},children:[`(`,e.phone,`)`]})]}),(0,z.jsx)(Kh,{size:`small`,color:u,label:d}),e.block&&(0,z.jsx)(Kh,{size:`small`,color:`error`,label:`Bloqueada`})]}),(0,z.jsxs)(Oh,{variant:`caption`,display:`block`,color:`text.secondary`,sx:{mt:.5},children:[(0,z.jsx)(`strong`,{children:`Resumen:`}),` `,e.summary||`Aún no hay resumen.`]}),(0,z.jsxs)(Oh,{variant:`caption`,display:`block`,color:`text.disabled`,sx:{mt:1,overflowWrap:`anywhere`},children:[`Campaña: `,e.campaign_id?.split(`-`)[0]||`N/A`,`...`]}),(0,z.jsxs)(jg,{sx:{display:`flex`,gap:2,mt:.5,flexWrap:`wrap`},children:[(0,z.jsxs)(Oh,{variant:`caption`,color:`text.disabled`,children:[`Iniciada: `,MO(e.created_at)]}),(0,z.jsxs)(Oh,{variant:`caption`,color:`text.disabled`,children:[`Última interacción: `,e.last_interaction?MO(e.last_interaction):`Ninguna`]})]}),(0,z.jsxs)(Oh,{variant:`caption`,display:`block`,color:`text.disabled`,sx:{mt:.5,overflowWrap:`anywhere`},children:[`ID de sesión: `,e.id]})]}),(0,z.jsx)(uh,{onClick:e=>i(e.currentTarget),children:(0,z.jsx)(jO,{})})]})}),(0,z.jsxs)(Xb,{anchorEl:r,open:!!r,onClose:()=>i(null),children:[(0,z.jsx)(nx,{onClick:l,children:`Chat`}),e.block?(0,z.jsx)(nx,{onClick:c,sx:{color:`error.main`},children:`Desbloquear`}):(0,z.jsx)(nx,{onClick:()=>{i(null),t(e)},sx:{color:`error.main`},children:`Bloquear`}),(0,z.jsx)(nx,{onClick:s,sx:{color:`error.main`},children:`Eliminar`})]})]})}function PO({session:e,onClose:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),o=wO();return(0,z.jsxs)(Z_,{open:!!e,onClose:t,maxWidth:`xs`,fullWidth:!0,children:[(0,z.jsx)(uv,{children:`Bloquear Sesión?`}),(0,z.jsxs)(sv,{children:[(0,z.jsx)(Oh,{variant:`body2`,color:`text.secondary`,children:`Estás seguro de que quieres bloquear esta sesión? El número de teléfono será bloqueado.`}),n&&(0,z.jsx)(Sh,{severity:`success`,sx:{mt:2},children:n}),i&&(0,z.jsx)(Sh,{severity:`error`,sx:{mt:2},children:i})]}),(0,z.jsxs)(tv,{children:[(0,z.jsx)(Ug,{onClick:t,children:`Cancelar`}),(0,z.jsx)(Ug,{onClick:async()=>{r(``),a(``);try{await o.mutateAsync({phone:e.phone}),r(`¡Sesión bloqueada!`),setTimeout(()=>t(),600)}catch(e){a(e.message)}},variant:`contained`,color:`error`,disabled:o.isPending,children:`Bloquear`})]})]})}function FO({session:e,onClose:t}){let[n,r]=(0,_.useState)(``),i=(0,_.useRef)(null),{data:a,isLoading:o,error:s}=DO(e?.phone),c=AO();(0,_.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[a]);let l=async()=>{!n.trim()||!e||(await c.mutateAsync({sessionId:e.phone,message:n.trim()}),r(``))},u=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),l())},d=e=>{if(!e)return null;if(typeof e==`string`)try{return JSON.parse(e)}catch{return{type:`ai`,content:e}}return e};return(0,z.jsxs)(Z_,{open:!!e,onClose:t,maxWidth:`sm`,fullWidth:!0,children:[(0,z.jsxs)(uv,{children:[`Chat: `,e?.name||e?.phone||e?.id]}),(0,z.jsxs)(sv,{sx:{display:`flex`,flexDirection:`column`,height:`60vh`,p:2},children:[o&&(0,z.jsx)(jg,{sx:{display:`flex`,justifyContent:`center`,alignItems:`center`,flex:1},children:(0,z.jsx)(ih,{})}),s&&(0,z.jsx)(Sh,{severity:`error`,sx:{mb:2},children:s.message}),(0,z.jsx)(jg,{ref:i,sx:{flex:1,overflowY:`auto`,display:`flex`,flexDirection:`column`,gap:1,mb:2},children:a?.map(e=>{let t=d(e.message),n=t?.type===`ai`;return(0,z.jsx)(jg,{sx:e=>({alignSelf:n?`flex-start`:`flex-end`,bgcolor:n?e.palette.mode===`dark`?`grey.800`:`grey.200`:`primary.main`,color:n?e.palette.mode===`dark`?`grey.100`:`text.primary`:`primary.contrastText`,p:1.5,borderRadius:2,maxWidth:`80%`,whiteSpace:`pre-wrap`,wordBreak:`break-word`}),children:(0,z.jsx)(Oh,{variant:`body2`,children:t?.content||``})},e.id)})}),(0,z.jsxs)(jg,{sx:{display:`flex`,gap:1},children:[(0,z.jsx)(vS,{fullWidth:!0,size:`small`,placeholder:`Escribe un mensaje...`,value:n,onChange:e=>r(e.target.value),onKeyDown:u,disabled:c.isPending,multiline:!0,maxRows:4}),(0,z.jsx)(Ug,{variant:`contained`,onClick:l,disabled:!n.trim()||c.isPending,children:c.isPending?(0,z.jsx)(ih,{size:20,color:`inherit`}):`Enviar`})]}),c.isError&&(0,z.jsx)(Sh,{severity:`error`,sx:{mt:1},children:c.error?.message||`Error al enviar`})]}),(0,z.jsx)(tv,{children:(0,z.jsx)(Ug,{onClick:t,children:`Cerrar`})})]})}function IO(){let[e,t]=(0,_.useState)(``),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),{data:c}=pO(),{data:l,isLoading:u,refetch:d}=CO(e),f=n?l?.filter(e=>e.phone&&e.phone.toLowerCase().includes(n.toLowerCase())||e.name&&e.name.toLowerCase().includes(n.toLowerCase())||e.summary&&e.summary.toLowerCase().includes(n.toLowerCase())):l;return(0,z.jsxs)(jg,{children:[(0,z.jsx)(qg,{sx:{mb:3},children:(0,z.jsxs)(Zg,{children:[(0,z.jsx)(Oh,{variant:`h6`,gutterBottom:!0,children:`Sesiones`}),(0,z.jsxs)(Bv,{fullWidth:!0,margin:`normal`,size:`small`,children:[(0,z.jsx)(vy,{children:`Filtrar por campaña`}),(0,z.jsxs)(Lx,{value:e,label:`Filtrar por campaña`,onChange:e=>t(e.target.value),children:[(0,z.jsx)(nx,{value:``,children:`Todas las campañas`}),c?.map(e=>(0,z.jsx)(nx,{value:e.id,children:e.name},e.id))]})]}),(0,z.jsx)(Ug,{fullWidth:!0,variant:`contained`,onClick:()=>d(),sx:{mt:1},children:`Actualizar Sesiones`})]})}),(0,z.jsx)(qg,{children:(0,z.jsxs)(Zg,{children:[(0,z.jsx)(Oh,{variant:`h6`,gutterBottom:!0,children:`Lista de Sesiones`}),(0,z.jsx)(vS,{fullWidth:!0,label:`Buscar por teléfono, nombre o resumen...`,margin:`normal`,size:`small`,value:n,onChange:e=>r(e.target.value)}),u?(0,z.jsx)(jg,{sx:{display:`flex`,justifyContent:`center`,mt:4},children:(0,z.jsx)(ih,{})}):(0,z.jsxs)(jg,{sx:{mt:2},children:[f?.length===0&&(0,z.jsx)(Oh,{color:`text.secondary`,children:l?.length===0?`No se encontraron sesiones.`:`Ninguna sesión coincide con la búsqueda.`}),f?.map(e=>(0,z.jsx)(NO,{session:e,onBlock:e=>a(e),onChat:e=>s(e)},e.id))]})]})}),(0,z.jsx)(PO,{session:i,onClose:()=>a(null)}),(0,z.jsx)(FO,{session:o,onClose:()=>s(null)})]})}function LO(){return fa({queryKey:[`media`],queryFn:async()=>{let{data:e,error:t}=await nO.from(`media`).select(`*`).order(`created_at`,{ascending:!1}).limit(100);if(t)throw Error(t.message);return e||[]}})}function RO(){let e=Zi();return pa({mutationFn:async({campaignId:e,category:t,type:n,file:r,url:i})=>{if(!e)throw Error(`Select a campaign first.`);if(!r&&!i)throw Error(`Please select a file OR paste a URL.`);if(r&&i)throw Error(`Please select EITHER a file OR a URL, not both.`);let a=``;if(i)try{new URL(i),a=i}catch{throw Error(`Please provide a valid URL (include http/https).`)}else{let t=r.name.split(`.`).pop(),n=`${e}/${Date.now()}-${Math.random().toString(36).slice(2)}.${t}`,{error:i}=await nO.storage.from(tO).upload(n,r,{cacheControl:`3600`,upsert:!1});if(i)throw Error(`Upload error: `+i.message);let{data:o}=nO.storage.from(tO).getPublicUrl(n);a=o.publicUrl}let{error:o}=await nO.from(`media`).insert([{campaign_id:e,url:a,category:t,type:n}]);if(o)throw Error(`DB insert error: `+o.message);return a},onSuccess:()=>{e.invalidateQueries({queryKey:[`media`]}),e.invalidateQueries({queryKey:[`mediaCampaignIds`]})}})}function zO(){let e=Zi();return pa({mutationFn:async({id:e,url:t})=>{let{error:n}=await nO.from(`media`).delete().eq(`id`,e);if(n)throw Error(n.message);if(t.includes(`campaign-media`))try{let e=t.split(tO+`/`);if(e.length>=2){let t=e[1];await nO.storage.from(tO).remove([t])}}catch(e){console.error(`Failed to delete from storage`,e)}return e},onSuccess:()=>{e.invalidateQueries({queryKey:[`media`]}),e.invalidateQueries({queryKey:[`mediaCampaignIds`]})}})}var BO=ap((0,z.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Close`);function VO(e){try{return new Date(e).toLocaleString()}catch{return e}}function HO({media:e,campaignName:t,onDelete:n}){return(0,z.jsxs)(qg,{sx:{mb:2,overflow:`hidden`},children:[(0,z.jsxs)(jg,{sx:{position:`relative`},children:[(0,z.jsx)(`img`,{src:e.url,alt:e.category||`archivo`,loading:`lazy`,style:{width:`100%`,height:`auto`,display:`block`}}),(0,z.jsx)(uh,{size:`small`,onClick:()=>n(e),sx:{position:`absolute`,top:8,right:8,bgcolor:`rgba(0,0,0,0.5)`,color:`#fff`,"&:hover":{bgcolor:`rgba(0,0,0,0.8)`}},children:(0,z.jsx)(BO,{fontSize:`small`})})]}),(0,z.jsxs)(Zg,{children:[(0,z.jsxs)(Oh,{variant:`caption`,color:`primary`,sx:{fontWeight:700,textTransform:`uppercase`},children:[e.category||`foto`,` • `,e.type||`desconocido`]}),(0,z.jsx)(Oh,{variant:`body2`,sx:{fontWeight:600},noWrap:!0,children:t}),(0,z.jsx)(Oh,{variant:`caption`,color:`text.disabled`,children:VO(e.created_at)})]})]})}function UO({media:e,onClose:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),o=zO();return(0,z.jsxs)(Z_,{open:!!e,onClose:t,maxWidth:`xs`,fullWidth:!0,children:[(0,z.jsx)(uv,{children:`Eliminar Archivo?`}),(0,z.jsxs)(sv,{children:[(0,z.jsx)(Oh,{variant:`body2`,color:`text.secondary`,children:`Estás seguro de que quieres eliminar esta foto? Esta acción no se puede deshacer.`}),n&&(0,z.jsx)(Sh,{severity:`success`,sx:{mt:2},children:n}),i&&(0,z.jsx)(Sh,{severity:`error`,sx:{mt:2},children:i})]}),(0,z.jsxs)(tv,{children:[(0,z.jsx)(Ug,{onClick:t,children:`Cancelar`}),(0,z.jsx)(Ug,{onClick:async()=>{r(``),a(``);try{await o.mutateAsync({id:e.id,url:e.url}),r(`¡Eliminado con éxito!`),setTimeout(()=>t(),600)}catch(e){a(e.message)}},variant:`contained`,color:`error`,disabled:o.isPending,children:`Eliminar`})]})]})}function WO(){let[e,t]=(0,_.useState)(``),[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(null),{data:g}=pO(),{data:v,isLoading:y}=LO(),b=RO(),x=new Set(g?.filter(e=>e.active!==!1).map(e=>e.id)||[]),S=v?.filter(e=>x.has(e.campaign_id));return(0,z.jsxs)(jg,{children:[(0,z.jsx)(qg,{sx:{mb:3},children:(0,z.jsxs)(Zg,{children:[(0,z.jsx)(Oh,{variant:`h6`,gutterBottom:!0,children:`Subir Archivo`}),(0,z.jsxs)(jg,{component:`form`,onSubmit:async u=>{u.preventDefault(),d(``),p(``);try{await b.mutateAsync({campaignId:e,category:n.trim(),type:i.trim(),file:o,url:c.trim()}),t(``),r(``),a(``),s(null),l(``),d(`¡Archivo guardado con éxito!`)}catch(e){p(e.message)}},children:[(0,z.jsxs)(Bv,{fullWidth:!0,margin:`normal`,size:`small`,children:[(0,z.jsx)(vy,{children:`Campaña`}),(0,z.jsxs)(Lx,{value:e,label:`Campaña`,onChange:e=>t(e.target.value),children:[(0,z.jsx)(nx,{value:``,children:(0,z.jsx)(`em`,{children:`Seleccionar campaña`})}),g?.map(e=>(0,z.jsx)(nx,{value:e.id,children:e.name},e.id))]})]}),(0,z.jsx)(vS,{fullWidth:!0,label:`Categoría (ej. cocina, frente, baño)`,margin:`normal`,size:`small`,value:n,onChange:e=>r(e.target.value)}),(0,z.jsx)(vS,{fullWidth:!0,label:`Tipo (ej. foto, video)`,margin:`normal`,size:`small`,value:i,onChange:e=>a(e.target.value)}),(0,z.jsx)(Oh,{variant:`caption`,sx:{mt:1,display:`block`,fontWeight:600,textTransform:`uppercase`},children:`Fuente de archivo`}),(0,z.jsx)(`input`,{type:`file`,accept:`image/*,video/*`,onChange:e=>s(e.target.files?.[0]||null),style:{marginTop:8,marginBottom:8}}),(0,z.jsx)(gv,{sx:{my:1},children:(0,z.jsx)(Oh,{variant:`caption`,color:`text.secondary`,sx:{px:1},children:`O`})}),(0,z.jsx)(vS,{fullWidth:!0,type:`url`,label:`Pegar URL remota (ej. Google Drive, Imgur)`,margin:`normal`,size:`small`,value:c,onChange:e=>l(e.target.value)}),(0,z.jsx)(Ug,{type:`submit`,fullWidth:!0,variant:`contained`,sx:{mt:1},disabled:b.isPending,children:`Guardar Archivo`}),u&&(0,z.jsx)(Sh,{severity:`success`,sx:{mt:2},children:u}),f&&(0,z.jsx)(Sh,{severity:`error`,sx:{mt:2},children:f})]})]})}),(0,z.jsx)(qg,{children:(0,z.jsxs)(Zg,{children:[(0,z.jsx)(Oh,{variant:`h6`,gutterBottom:!0,children:`Lista de Archivos`}),y?(0,z.jsx)(jg,{sx:{display:`flex`,justifyContent:`center`,mt:4},children:(0,z.jsx)(ih,{})}):(0,z.jsxs)(ay,{container:!0,spacing:2,children:[S?.map(e=>{let t=g?.find(t=>t.id===e.campaign_id);return(0,z.jsx)(ay,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,z.jsx)(HO,{media:e,campaignName:t?.name||`Campaña desconocida`,onDelete:e=>h(e)})},e.id)}),S?.length===0&&(0,z.jsx)(ay,{item:!0,xs:12,children:(0,z.jsx)(Oh,{color:`text.secondary`,children:`No se encontraron archivos de campañas activas.`})})]})]})}),(0,z.jsx)(UO,{media:m,onClose:()=>h(null)})]})}var GO=Sr({component:$f}),KO=br({getParentRoute:()=>GO,path:`/`,beforeLoad:async()=>{let{data:{session:e}}=await nO.auth.getSession();throw $e({to:e?`/campaigns`:`/login`})}}),qO=br({getParentRoute:()=>GO,path:`/login`,component:fO,beforeLoad:async()=>{let{data:{session:e}}=await nO.auth.getSession();if(e)throw $e({to:`/campaigns`})}}),JO=br({getParentRoute:()=>GO,id:`_app`,component:dO,beforeLoad:async()=>{let{data:{session:e}}=await nO.auth.getSession();if(!e)throw $e({to:`/login`})}}),YO=br({getParentRoute:()=>JO,path:`/campaigns`,component:SO}),XO=br({getParentRoute:()=>JO,path:`/sessions`,component:IO}),ZO=br({getParentRoute:()=>JO,path:`/media`,component:WO}),QO=Ir({routeTree:GO.addChildren([KO,qO,JO.addChildren([YO,XO,ZO])])});qf.createRoot(document.getElementById(`root`)).render((0,z.jsx)(_.StrictMode,{children:(0,z.jsx)(zr,{router:QO})})); \ No newline at end of file diff --git a/crmDashboard/dist/favicon.svg b/crmDashboard/dist/favicon.svg new file mode 100644 index 0000000..6893eb1 --- /dev/null +++ b/crmDashboard/dist/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/crmDashboard/dist/icons.svg b/crmDashboard/dist/icons.svg new file mode 100644 index 0000000..e952219 --- /dev/null +++ b/crmDashboard/dist/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crmDashboard/dist/index.html b/crmDashboard/dist/index.html new file mode 100644 index 0000000..dc89be8 --- /dev/null +++ b/crmDashboard/dist/index.html @@ -0,0 +1,16 @@ + + + + + + Panel de Campañas + + + + + + + +
+ +